On 1/21/17, John Spikowski <supp...@scriptbasic.org> wrote:
> Eric,
>
> Before we determine how best to deal with the UI side of IUP browser
> interface, I think we need to get the basic framework for the browser
> IUP driver working. Antonio didn't think this was a big deal when I
> brought up the concept the first time around.
>

Hi John,

As I said, I don’t really understand the architecture that is in your
head. I really need you to describe it so I can understand where you
are coming from.

Because at the moment, I’m in agreement with Antonio. These things are
either minor details or things that do not belong in the IUP backend
implementation for the web browser. (Those things would go in your
user application or library above IUP, not the IUP library itself.)


> * Determine screen size, DPI, default font, ...



- Screen size:
I think this is a minor detail.
var width = screen.width;
http://www.w3schools.com/jsref/prop_screen_width.asp

- DPI: I think this is a pretty optional thing and another minor
detail. I don’t know if this is even available. I know Apple platforms
go to great lengths to avoid telling you the DPI. They already have
their own point size abstraction level that does “the right thing”,
and trying to compute things based on the DPI actually just breaks
things.

The web browser in this case is the “native platform” for us. Each
browser already has to deal with each platform’s specific rendering
size differences. I don’t think this is really a core IUP tenet. (You
are going to be disappointed on the native Mac and iOS IUP backends if
it is.)


- Default font:
So fonts are important to IUP. However, IUP does have deference to the
native platform. So whatever the browsers will allow I guess.

function getFont() {
    return document.getElementById('header').style.font;
}
http://stackoverflow.com/questions/845/detecting-which-font-was-used-in-a-web-page



> * Work out callbacks. Some may be handled by the client and others off
> loaded to the server.


- Callbacks:
Again, I don’t understand the design in your head, but to me, server
vs. client discussion is irrelevant for the IUP backend. IUP lets
users define their own callbacks for events.

If you want a server callback, you put that in your application
callback code. That doesn’t go in IUP itself.

So say, you are writing a Twitter client in IUP for native Windows and
GTK. You create a button to submit a new Tweet. In IUP, you create a
button, and you also implement a callback for the button press. That
implementation will contain a server request to Twitter. Obviously,
this belongs in your application and not IUP.

Now you recompile your IUP app with Emscipten so you can make your
Twitter client work in the web browser. It should still work
fundamentally the same way. Say you used libcurl to send the server
request. I don’t know if libcurl just works via Emscripten, but if it
does, you’re done. If not, you might need a #ifdef in your
submit-callback implementation:

#ifdef __EMSCRIPTEN__
        emscripten_async_wget(…);
#else
        curl_multi_perform(…);
#endif

But either way, neither of these things belong in IUP which is just a
GUI library.


>
> Between HTML, CSS and JavaScript I think a desktop compatible UI could
> be assembled and be a worthwhile effort on our part.
>
> The other direction might be HTML5.


So I think the majority has to be JavaScript as I tried to explain.
There might be some parts that can be done in HTML and CSS, but the
vast majority of stuff I can only see working in JavaScript. I ask the
question again, how do you map IUP’s procedural, dynamic,
Turing-complete layout algorithm in C to anything else? I can only see
it work in the general case if it is converted to JavaScript. And that
goes for pretty much the entire IUP code base. (If you have a solution
to this, I’d really like to know about it.)


>  desktop compatible UI

And theoretically, we should be targeting web standards. So this
should work on any standards compliant web browser, which also means
mobile web browsers and not just desktop.

Thanks,
Eric

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to