M
Malcolm McLean
The absolute basic interface would go something likeA widget is a process that can write to the portion of a screen and
receives events from a superwidget. It contains zero or more subwidgets
which can receive events from the widget and write portions of the screens
contained in the widget.
That would mean a widget library would
(1) Have a way to receive events.
(2) A way to create/send events.
(3) A way to draw a pixel on the screen.
(4) A way to get information about the widget.
You could make that the BabyX interface.
The user can then define their own libraries which add this set or that
set of events to a widget, and/or create more elaborate drawers in terms
of simpler drawers.
Once you can draw individual pixels, you can use that implement a quadratic
(Quickdraw), cubic (Postscript), OpenGL, etc. And of course the libraries
could also use hardware shortcuts if they can find them.
And then define more libraries which use those libraries, and so on.
int openwindow(int requestwidth, int requestheight, int *givenwidth, int *givenheight);
void drawpixel(int x, int y, int r, int g, int b);
int querymouse(int *x, int *y, int *buttons);
int querykeyboard(KEYBOARD *pressed)
int iskeypressed(KEYBOARD *keys, int ch);
It might be an idea to provide that, and then build eveything else on top of it.