Hello,

well, I have a few questions I'd like to raise over the way I can use
the LibXMI framework within LibGWT.

First, I wonder if I should allow several paintedSet and several miGC per
window (option 1), or hide these XMI abstractions inside a GWT window
(option 2).

With option 1, the drawing API to a window could be, e.g.:

void gwtmiDrawRectangles(gwt_window_t win, miPaintedSet *paintedSet,
             const miGC *pGC, int nrects, const miRectangle *pRects);

and the user application would be requested to create canvas for each
windows and call gwtmiCopyPaintedSetToCanvas().

With option 2, the drawing API could be, e.g.:

void gwtmiDrawRectangles(gwt_window_t win,
                         int nrects, const miRectangle *pRects);

With option 2, a gwt_window_t window would contain a miGC, and would use
an internal per-window paintedSet. These would be accessible to the
application only through the API. (Several paintedSets per ggi_visual_t
are still very useful, as there are _several_ windows on screen.)

Furthermore, with option 2, the canvas can be hidden to the application:
this can be convenient in the case of a windowing library, I can create
several canvas corresponding to the various rectangles composing the
visible region of the window, and draw them in turn. Furthermore, such
actual drawing can occur in a gwtFlush() for example.

However, with option 1, the application retains much more control over the
way paintedSets are managed, as well as canvas. But I don't know if this
is so interesting in the context of a windowed application.
In fact, I find it difficult to understand exactly the role of canvas --
especially, I see them as something pretty close to a
(pixel-based) window. That's disturbing (for me -- with the other
windows simultanesouly).

Maybe a compromise is the right solution (e.g.: several GCs per
window, but the paintedSet and canvas abstractions hidden from the
application).

Do you have any hint or ideas to give me that could help me define an API
for LibGWT 2D drawing functions based on LibXMI ?

Rodolphe

PS: I can post the current API if you want (and maybe the one I'd see with
option 2 -- if you give me some time to sketch it).


Reply via email to