Hi Bill,
You wrote to me awhile ago about this and asked about documentation, and I
dictated a response but never got it sent, so here it is:
I don't think there's any more documentation on how things work under Xt but it
should be clear. The EmacsFrame widget is the widget corresponding to the X
window that Emacs draws into and there is a handler for expose events called
from Xt which arranges for the invalidated areas to get redrawn. I think this
used to happen as part of the handler itself but now it is delayed until the
next call to redisplay.
However, one thing that you absolutely must not do is remove the Xt support.
This would be an incredibly unfriendly thing to do as it would prevent people
from using any widget set other than Qt or GTK. Keep in mind that people run
XEmacs on all sorts of different versions of X in Unix, and Xt is the standard
and the only toolkit that probably exists on all of these systems.
Pardon me if I've misunderstood your intentions w.r.t. this.
As for how you would implement GTK support, it will not be very hard to convert
redisplay to draw into a GTK window instead of an Xt window. In fact redisplay
basically doesn't know about Xt at all, except in the portion that handles
updating menubars and scrollbars and stuff that's directly related to Xt.
What you'd probably want to do is create a new set of event routines to replace
the ones in event-Xt.c. On the display side you could conceivably create a new
device type but you probably wouldn't want to do that because it would be an
externally visible change at the Lisp level. You might simply want to put a
flag on each frame indicating what sort of toolkit the frame was created under
and put conditions in the redisplay code and the code to update toolbars and
menubars and so forth to test this flag and do the appropriate thing.
"William M. Perry" wrote:
Well, my proposal was accepted by the BeOpen folks on SourceXchange,
so I'm
going to start working on the various documents outlining how I'll be
replacing the lwlib/motif/athena/etc widgets with gtk or qt. 99.9% sure it
is going to have to be gtk after talking with stallman and the discussion
we had on the mailing list a few weeks ago. Ah well...
But while I was sketching out some things, and looking at the current
EmacsFrame widget I wondered why we should even bother having the toolbars
and menubars managed differently than the various 'gutters' that andy has
implemented. If I'm going to be completely rewriting large chunks of that
code, why not take the next step and just use the gutter than andy has
worked so hard on? Things like scrollbars would still need to be done in
the core I think (because they go with windows not frames).
The basic idea would be to simplify the XEmacs window to just be an X
Window with gutters on all 4 sides. When you turn on the toolbar,
something just gets added to the top gutter. When you turn on the menubar,
ditto. This would entail making 'toolbar' and 'menubar' widgets
accesible
like 'button' and 'progress-gauge', but I don't think that would be
very
hard.
Read what I've written in Architecting XEmacs about dialog boxes -- I describe
a similar but even more general scheme, that makes *all* frame layout be
controllable in Lisp, i.e. an Emacs "window" is just another widget just like
menubars, toolbars, scrollbars, etc. If you're going to rehash this stuff you
might as well go whole hog in your implementation.
As a side-benefit this would allow you to have multiple menubars, and
multiple toolbars visible at once. Just imagine... a XEmacs completely
surrounded my toolbars. *shudder*
(As far as I know, you can already do this with toolbars ...)
Thoughts, comments, etc?
-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.