XlRecycleMotionEvents.mesa
Copyright Ó 1991 by Xerox Corporation. All rights reserved.
Christian Jacobi, August 15, 1991 7:34:13 pm PDT
Christian Jacobi, August 15, 1991 8:07 pm PDT
DIRECTORY
Xl USING [Connection, EventRep, MotionNotifyEvent, Window];
This is an unsafe, quite private interface used for speeding up TIP stuff.
Its implementation is likely to be found where where dispatches are registered,
XlRecycleMotionEvents: CEDAR DEFINITIONS ~ BEGIN
EventCache: TYPE = RECORD [
m1, m2: REF Xl.EventRep.motionNotify ¬ NIL
];
GetCache: PROC [c: Xl.Connection, w: Xl.Window] RETURNS [cache: REF EventCache];
--Returns a cache where MotionNotifyEvent's can be recycled
--This procedure either returns a harmless (and useless) repository if there are multiple recipients of MotionNotifyEvent's. If the window has exactly one recipient of MotionNotifyEvent's (or is the sentinel used in connection-reader), this returns the actual cache used for allocating events of this connection.
--This is unsafe in the sense that we do not know whether later other recipients of MotionNotifyEvent's will be registered and therefore should only be used in applications which know the window.
UnsafeRecycle: UNSAFE PROC [recipent: REF EventCache, motionNotify: Xl.MotionNotifyEvent] = TRUSTED INLINE {
--It is this recipients duty to know that it doesn't forward events it will cache
IF recipent.m1=NIL
THEN recipent.m1 ¬ LOOPHOLE[motionNotify]
ELSE recipent.m2 ¬ LOOPHOLE[motionNotify]
};
END.