"William M. Perry" wrote:
Andy Piper <andy(a)xemacs.org> writes:
> At 10:09 PM 4/12/00 -0700, Ben Wing wrote:
>
> >i think it's wrong to tout the raw gtk-* interface as the "right"
> >interface to write lisp in. in fact, if at all possible i'd suggest not
> >exposing this at all. instead, expand the generic interface as
> >necessary to include new gtk features. you could also provide an
> >"escape" mechanism for adding or querying raw gtk properties that are
> >not implemented in the abstract interface, but i do NOT want to see a
> >proliferation of lisp code that is gtk-specific. although creating raw
> >interfaces may seem "easier" and more powerful, it is in fact a
classic
> >mistake made by novice interface designers, and invariably comes back to
> >haunt them.
>
> Absolutely right.
>
> From an XEmacs point-of-view the statement "..abstract interface is
> beyond the scope of this project...." seems erronous to me. Given the
> effort we've put into clean abstraction we absolutely can't start
> breaking this with a proliferation of gtk specific dialogs. Especially as
> its not clear to me how some of these constructs would map onto other
> windowing systems. I would be the first to admit, however, that what we
> have right now API-wise is a million miles from the richness of the gtk
> APIs. Whether this is a bad thing or not is less clear to me...
>
> I like the XML glade idea.
Personally I do too, and have been leaning more towards that since I
discovered some of the 'arguments' stuff that Gtk has. Qt 2.1.0 has
something similar as well. You can set generic properties on objects and
define arbitrary handlers for them in your object. With Gtk you can use
gtk_object_query_args() to figure out what arguments a widget accepts and
what types of objects it expects (using the GTK_FUNDAMENTAL_TYPE() macro).
Using this, mapping things onto generic 'get' and 'put' routines after
you
create the widgets would be fairly easy. Converting glyphs to/from Gdk
could be a pain (even though they have gdk_pixmap_foreign_new()). I think
eventually it might make sense to have a real port to using Gdk/Gtk as the
'windowing system' as an alternative to X. Then we could use them for our
ports to Windows, BeOS, Macintosh, etc.
One of the reasons I was looking at exposing all the gtk-specific pieces is
to emulate what the rep-gtk port (and sawmill) has done. If we could
incorporate some of their stuff, we could probably move a lot of the logic
about WM interaction into lisp.
if your abstract interface is well-designed, it should be very easy to port the
wm interaction logic to it. exposing the gtk interface will not help much
here.
I'm not sure if actually using glade is a good idea or not - I personally
would prefer a 'real' lisp representation. Writing an XML parser wouldn't
be _that_ difficult, but it would take time, and I've got basically the
next 5 weeks to work on it full time to get the core redisplay & binding
design done. I think what I will end up doing is in the first cut have a
lisp-only representation, and then maybe use PSGML or actually make expat
into a loadable module (like I've had roughed out for the last 2 years
*sigh*) and use that to parse the glade stuff into that lispy
representation. Then we get the best of both worlds.
I'm going to start working on the implementation document tonight. I think
that Gtk is the way to go, and unless people have huge arguments against
it, that's what I'll base the next document on.
again, any interfaces you propose should be sufficiently abstract that they
could handle either gtk or qt underneath. (or some other widget set for that
matter, e.g. motif or athena!)
hasn't andy already created a bunch of abstract interfaces onto widgets?
-Bill P.
--
Ben
In order to save my hands, I am cutting back on my mail. I also write
as succinctly as possible -- please don't be offended. If you send me
mail, you _will_ get a response, but please be patient, especially for
XEmacs-related mail. If you need an immediate response and it is not
apparent in your message, please say so. Thanks for your understanding.
See also
http://www.666.com/ben/typing.html.