MBQueuePrivate.mesa
Copyright Ó 1985, 1986, 1987, 1991 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
Private definitions for MBQueue.
DIRECTORY
MBQueue USING [Action],
Menus USING [ClickProc];
MBQueuePrivate: CEDAR DEFINITIONS
~ BEGIN
A Queue represents a context for button 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 ~ MBQueue.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 [
proc: Menus.ClickProc,
immediate: BOOL,
clientData: REF,
q: Queue
];
UserClick: Menus.ClickProc;
Enqueues an event; expects clientData to be MyClickInfo.
END.