DIRECTORY Xl; XlExtensions: CEDAR DEFINITIONS ~ BEGIN ExtensionData: TYPE = Extensions; firstExtension: BYTE = 64; --first event code reserved for extension events Extensions: TYPE = ARRAY [firstExtension..127] OF Extension ¬ ALL[NIL]; --mapping from event-code to implementor of the corresponding extension. Used per connection. ProcessExtensionEvent: PROC [xEvent: REF Xl.EventRep.extension] RETURNS [reuse: BOOL]; ExtensionContinue: TYPE = {noop, dispatch, reuse}; ProcessExtensionEventProc: TYPE = PROC [self: Extension, xEvent: REF Xl.EventRep.extension] RETURNS [continue: ExtensionContinue ¬ noop]; Extension: TYPE = REF ExtensionRec; ExtensionRec: TYPE = RECORD [ --per-connection description of an X window extension state: REF ¬ NIL, --per-connection private data for the extension implementor majorOpcode, firstEvent, firstError: BYTE ¬ 0, --data from X server class: REF READONLY ExtensionClass --describes extension class ]; ExtensionClass: TYPE = RECORD [ --static description of this extension for all connections key: ATOM, processEvents: ProcessExtensionEventProc, majorEventsCnt: NAT ¬ 0 ]; DefineExtensionClass: PROC [key: ATOM, processEvents: ProcessExtensionEventProc, majorEventsCnt: NAT ¬ 1]; StartExtension: PROC [c: Xl.Connection, key: ATOM] RETURNS [Extension ¬ NIL]; END. xXlExtensions.mesa Copyright Σ 1993 by Xerox Corporation. All rights reserved. Christian Jacobi, February 2, 1993 2:12:41 pm PST Christian Jacobi, February 2, 1993 3:23 pm PST Private interface to implement X window extensions for Xl Features used by Xl to implement extensions Used in ConnectionPrivate. Eventually use a private type of our own in Xl. Called from main event reading loop, to handle extension events Features used by implementations of particular extensions Type for procedure to decode extension events. self: describes extension. xEvent: event un-decoded as arrived from main-event-loop; connection field already initialized. continue: dispatch to request dispatching the decoded event; reuse to indicate that the event object may be re-used. Globally registers an event processing procedure for handling events of this extension. (For all connections). Enables extension handling for this connection. Issues request to X server to find out about extension if called the first time. Does not raise errors. Returns extension data. Returns NIL if extension is not supported by server, or, key is not defined. Κ •NewlineDelimiter –(cedarcode) style˜code™Kšœ Οeœ1™Kšœ˜K˜—šœžœžœ :˜ZKšœžœ˜ Kšœ*˜*Kšœžœ˜Kšœ˜—K˜šŸœžœžœ<žœ˜jK™o—K™š Ÿœžœžœžœžœ˜MK™™K™K™L——K˜Kšžœ˜K˜—…— ₯