DIRECTORY Xl USING [Connection, Details, Event, Match, MatchList, SetOfEvent, unspecifiedEvents, Window]; XlDispatch: CEDAR DEFINITIONS ~ BEGIN OPEN Xl; DispatchHandle: TYPE = REF DispatchHandleRec; DispatchHandleRec: TYPE; GetDispatchHandle: PROC [c: Connection] RETURNS [DispatchHandle]; Dispatch: PROC [handle: DispatchHandle, event: Event]; FindAndDispatch: PROC [event: Event]; WindowData: TYPE = REF WindowDataRec; WindowDataRec: TYPE; GetWindowData: PROC [c: Connection, w: Window] RETURNS [WindowData]; DispatchExplicite: PROC [wd: WindowData, event: Event]; AddMatch: PROC [c: Connection, w: Window, match: Match ¬ NIL, generate: SetOfEvent ¬ unspecifiedEvents, details: Details ¬ NIL]; RemoveMatch: PROC [c: Connection, w: Window, match: Match ¬ NIL, details: Details ¬ NIL]; AddMatches: PROC [c: Connection, w: Window, matchList: MatchList ¬ NIL, generate: SetOfEvent ¬ unspecifiedEvents, details: Details ¬ NIL]; AddMatchForUnregistered: PROC [c: Connection, match: Match ¬ NIL]; AddPriviledgedMatch: PRIVATE PROC [c: Connection, match: Match]; RemovePriviledgedMatch: PROC [c: Connection, match: Match]; InitConnection: PRIVATE PROC [c: Connection]; InitWindow: PRIVATE PROC [c: Connection, w: Window]; RemoveWindow: PRIVATE PROC [c: Connection, w: Window]; InternalAddMatch: PRIVATE PROC [c: Connection, w: Window, match: Match, generate: SetOfEvent ¬ unspecifiedEvents]; EnforcedSetOfEvent: PRIVATE PROC [c: Connection, w: Window, external: SetOfEvent ¬ unspecifiedEvents] RETURNS [SetOfEvent]; END. æ XlDispatch.mesa Copyright Ó 1990, 1991 by Xerox Corporation. All rights reserved. Christian Jacobi, November 12, 1990 5:42 pm PST Christian Jacobi, March 7, 1991 5:01 pm PST This is an internal interface used for the implementation of Xl. General event dispatching This ought to be used mainly by the main loop of XlImpl; but it is conceivable that these procedures are useful for applications like TIP table implementations. One such data per connection. Get the dispatch data structure. Dispatches to all listeners for event.dispatchDrawable. Get appropriate DispatchHandle and dispatches to all listeners for event.dispatchDrawable. Speed hack useful for speeding up local events This ought to be used by some speed crazy applications dispatching local events. E.g. TIP table implementations. One such data per window while it is active. Get window data structure which allows DispatchExplicite. This data structure is kept alive only while the window has active matches. Returns NIL if not available. For safe use, use only after adding match and don't use after removing of match. Dispatches to explicite listeners; might be slightly faster then Dispatch. Adding and removing matches Updating the knowledge what to call on dispatch. In general matches are set up and not removed. Once an event made it all the way from the X server we can not gain much efficiency by discarding the event before dispatching. In exceptional cases (ICCCM) we are required to listen to events sent in account of foreign windows owned by other connections. The problem is to guarantee cleanup of foreign WindowData when those windows are no more used, or, the window or its real connection is destroyed. Add a match and events for a window. (Removed on window deletion.) Removes all matches on window using equal proc, thread and data. Add multiple matches and events for a window. (Removed on window deletion.) Add match for non-found windows. Priviledged procedures Expensive. Event will match non-explicite matches for all windows. Get rid of expensive priviledged match as fast as possible. Private engine room procedures Reserved for the implementation of XlImpl and friends. Clients ought not use these procedures as problems from incorrect use may impact independent clients. Call this after creation of connection to initialize internal data. Call this after creation of a window. Call this on a destroyNotify event after dispatching the event. Call this from within c's lock only. Procedure made for implementation of Xl.CreateWindow only. Des NOT request server to generate "generate" events. Caller must do this and must also require structureNotifyMask himself. To be used by implementation of Xl.ChangeWindowAttributes. Does tell XlDispatchImpl that the externally set events are "external". They are or'ed with the internal set of events when doing a internal ChangeWindowAttributes. Returns set of internally required events or'ed with "external". Must be used reliably and within connection lock only. Ê!•NewlineDelimiter –(cedarcode) style™šœ™Icodešœ Ïeœ7™BK™/K™+—šÏk œ˜ KšœžœW˜_K˜—KšÏn@™@K˜Kš Ÿ œžœž œžœžœ˜.headšœ™K™ K™šœžœžœ˜-Kšœ™Kšœžœ˜—K˜šŸœžœžœ˜AKšœ!™!K˜—šŸœžœ(˜6Kšœ7™7K™—šŸœžœ˜%KšœZ™Z——šœ.™.K™qK™šœ žœžœ˜%Kšœ,™,Kšœžœ˜—K˜šŸ œžœžœ˜DKšœ9™9K™MK™oK™—šŸœžœ!˜8KšœJ™J——™Kšœ2™2KšœÅ™ÅK˜šŸœžœ+žœ?žœ˜€K™$K™K˜—šŸ œžœ+žœžœ˜YKšœ@™@K™—šŸ œžœ3žœ?žœ˜ŠK™-K™K˜—šŸœžœ žœ˜BKšœ!™!——™Kšœ ™ K˜šŸœžœžœ ˜AKšœ+Ïbœ ™7K™—šŸœžœ˜;Kšœ<™<——™KšœŸ™ŸK˜šŸœžœžœ˜-K™CK™—šŸ œžœžœ˜4K™%K™—šŸ œžœžœ˜6Kšœ# œ™?K™—šŸœžœžœT˜rKšœ`™`Kšœ€™€K™—šŸœžœžœFžœ˜{K™:Kšœ¥™¥Kšœ@™@Kšœ6™6K™—K™—Kšžœ˜—…—øÿ