TBQueuePrivate.mesa
Copyright Ó 1985, 1986, 1987, 1992 by Xerox Corporation. All rights reserved.
Doug Wyatt, May 8, 1985 5:18:37 pm PDT
Russ Atkinson (RRA) January 20, 1987 3:05:51 am PST
Willie-Sue, January 26, 1987 2:11:58 pm PST
Private definitions for TBQueue.
DIRECTORY
ViewerClasses USING [ClickProc],
TBQueue USING [Action],
TiogaButtons USING [TiogaButton, TiogaButtonProc];
TBQueuePrivate: CEDAR DEFINITIONS
~ BEGIN
A Queue represents a context for button/menu clicks or TiogaButton clicks. It contains a list of pending events. If pushModel, then notifierRunning is a BOOL that indicates whether or not a process is currently processing an event. (notifierRunning is ignored if NOT pushModel). If NOT pushModel, then newEvent is a CONDITION on which a client process may wait for the next event to occur. (newEvent is ignored if pushModel).
An Action represents a single click or client-defined action. It contains the information needed to process the click when the notifier gets around to it, including all the arguments to a button proc.
MyClickInfo is stored in the clientData field maintained by Viewers. Since we assign an MBQueue ClickProc and clientData with the button, we need this record to save the real clientData and ClickProc. We also save the queue, so we know the context of the click.
Action: TYPE ~ TBQueue.Action;
Event: TYPE ~ LIST OF Action;
Queue: TYPE ~ REF QueueObj;
QueueObj: TYPE ~ MONITORED RECORD [
notifier: PROCESS ¬ NIL,
firstEvent: Event ¬ NIL,
aborts: CARD ¬ 0,
newEvent: CONDITION,
stateChange: CONDITION,
pushModel: BOOL,
abortPending: BOOL ¬ FALSE
];
Enqueue: PROC [q: Queue, e: Event, immediate: BOOL];
Enqueues a primitive Event.
MyClickInfo: TYPE ~ REF MyClickInfoObj;
MyClickInfoObj: TYPE ~ RECORD [
tbProc: TiogaButtons.TiogaButtonProc,  -- only one of these should be nonNIL
mbProc: ViewerClasses.ClickProc,  -- only one of these should be nonNIL
immediate: BOOL,
clientData: REF,
q: Queue
];
TBUserClick: TiogaButtons.TiogaButtonProc;
Enqueues an event; expects clientData to be MyClickInfo with tbProc # NIL.
MBUserClick: ViewerClasses.ClickProc;
Enqueues an event; expects clientData to be MyClickInfo with mbProc # NIL.
END.