MBQueuePrivate.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Doug Wyatt, May 8, 1985 5:18:37 pm PDT
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 [
firstEvent: Event ← NIL,
pushModel: BOOL,
newEvent: CONDITION,
notifierRunning: BOOLFALSE
];
Enqueue: PROC [q: Queue, e: Event];
Enqueues a primitive Event.
MyClickInfo: TYPE ~ REF MyClickInfoObj;
MyClickInfoObj: TYPE ~ RECORD [
proc: Menus.ClickProc,
clientData: REF ANY,
q: Queue
];
UserClick: Menus.ClickProc;
Enqueues an event; expects clientData to be MyClickInfo.
END.