There is one object called an event_stream. This object contains callback functions for doing the window-system-dependent operations that XEmacs requires.
If XEmacs is compiled with support for X11 and the X Toolkit, then this event_stream structure will contain functions that can cope with input on SXEmacs windows on multiple displays, as well as input from dumb tty frames.
If it is desired to have SXEmacs able to open frames on the displays of multiple heterogeneous machines, X11 and SunView, or X11 and NeXT, for example, then it will be necessary to construct an event_stream structure that can cope with the given types. Currently, the only implemented event_streams are for dumb-ttys, and for X11 plus dumb-ttys, and for mswindows.
To implement this for one window system is relatively simple. To implement this for multiple window systems is trickier and may not be possible in all situations, but it's been done for X and TTY.
Note that these callbacks are NOT console methods; that's because the routines are not specific to a particular console type but must be able to simultaneously cope with all allowable console types.
The slots of the event_stream structure:
next_event_cbIMPORTANT: timer events and especially process events *must not* be
returned if there are events of other types available; otherwise you can
end up with an infinite loop in Fdiscard_input().
event_pending_cbnext_event_cb will block. If called with a non-zero argument,
then this should say whether there are that many user-generated events
pending (that is, keypresses, mouse-clicks, dialog-box selection events,
etc.). (This is used for redisplay optimization, among other things.)
The difference is that the former includes process events and timer
events, but the latter doesn't.
If this function is not sure whether there are events to be read, it
must return 0. Otherwise various undesirable effects will
occur, such as redisplay not occurring until the next event occurs.
handle_magic_event_cbnext_event_cb never returns an
event of type "magic", this will never be used.
format_magic_event_cbcompare_magic_event_cbhash_magic_event_cbadd_timeout_cbremove_timeout_cbadd_timeout_cb. If the given
wakeup has already expired, this should do nothing.
select_process_cbunselect_process_cbselect_console_cbunselect_console_cbselect_device_cbunselect_device_cbselect()
and file descriptors and have a separate input fd per device).
create_io_streams_cbdelete_io_streams_cbquitp_cbQUIT macro which should check
whether the quit character has been typed. On systems with SIGIO, this
will not be called unless the sigio_happened flag is true (it is set
from the SIGIO handler).
SXEmacs has its own event structures, which are distinct from the event structures used by X or any other window system. It is the job of the event_stream layer to translate to this format.