Hello,

like any trilogy of trilogy, LibGWT (Generic Windowing Toolkit for those
of you too young to remember) started in the middle. The infancy of this
library allowed to have some more-or-less working implementation of the
functionality (gwtCreateWindow, gwtReparent, etc.).

Now, it's time to go back to the origin, and I'd like some external advice
to turn this library into a real GGI extension lib.

There are two pretty distinct sets of functions in LibGWT:
 1- window-management related functions (let's call them gwtWindow*);
 2- in-window-drawing functions (let's call them gwtDraw*).

Functions of set 1, gwtWindow*, deal mainly with LibGWT-specific data
(private extension data). Currently, they are offered in LibGWT as native
library functions. These functions could easily be turned into
extension-lib operations via the GGI extension lib system. However, I
don't really see yet how these functions could take advantage of several
display-specific variants. So, the only real advantage I see in doing that
is that each gwtWindow*(gwt_window_t win, ...) would be replaced by
gwtWindow*(ggi_visual_t vis, ...). This would be more "GGI-conformant",
but is it worth the overhead penalty ? Do you see other advantages for
these functions to become visual operations (e.g. for interesting display
targets that could deserve specific implementations) ?


Functions of set 2 are, for LibGWT-as-an-extension, pretty tricky. LibGWT
draws currently by calling some other GGI (or XMI, or whatever) drawing
functions with clipping, possibly several times (LibGWT manages windows as
sets of non-overlapping rectangles). So, in fact, for a LibGWT-enabled
visual, LibGWT ought to _replace_ all the drawing functions of a visual
(referring to GGI libraries known by LibGWT) by its own specific routines
(which, in turn, will call these functions, but probably on another visual
and surely with a different clipping context).

I've always asked me lots of questions on how to do this the right way in
the GGI context - so I once again request some advice on how this should
be done. Currently, LibGWT provides different drawing functions, like
gwtDrawRectangle(win,x,y,w,h), which, to summarize, calls
ggiDrawRectangle(win->vis,x,y,w,h) in a loop (surrounded by different
clipping setups). But now, I'd really like some (hypothetical) LibGWT user
to write code like this:

        gwtAttach(vis);
        ...
        ggiDrawRectangle(vis,x,y,w,h);

And see the correct output (ie: a rectangle clipped by possibly
overlapping windows).


The link between functions of set 1 and set 2 is made by
gwtCreateWindow() which should sort-of clone the parent window/visual,
copying the set of operations allowed on the parent (to provide the same
drawing operations on a child window and its parent). At least as I see
it.


Any idea, or do you think I should just try to code first, and talk after?


Rodolphe



Reply via email to