ViewerInputQueue.mesa
Last Edited by: Pausch, August 15, 1983 9:35 am
Last Edited by: Wyatt, October 31, 1983 3:52 pm
DIRECTORY
ViewerClasses USING [NotifyProc, Viewer];
ViewerInputQueue: CEDAR DEFINITIONS
= BEGIN
Queue: TYPE = REF QueueObj;
QueueObj: TYPE;
Action: TYPE = RECORD [
notify: ViewerClasses.NotifyProc,
viewer: ViewerClasses.Viewer,
input: LIST OF REF
];
Create: PROC [pushModel: BOOLTRUE] RETURNS [Queue];
Creates a queue, into which objects can be placed if they should not be handled immediately by the client's NotifyProc. All items placed into the queue will be strictly serialized, i.e. each will be called in the order that the user clicked, and each proc will completely finish execution before the next one starts. If pushModel = FALSE, then actions are to be removed from the queue by a client process, using DequeueAction (below), rather than by this package. The client process should be prepared to handle ABORTED.
QueueAction: PROC [q: Queue, action: Action];
Puts a new action on the queue.
DequeueAction: PROC [q: Queue] RETURNS [Action];
Waits for an action to appear, then returns it. Called only for "pull model" queues.
Flush: PROC [q: Queue, proc: PROC[Action]← NIL];
Flushes all pending button presses and menu selections in the context of q. This procedure can be called, e.g., when some illegal action suggests the user is confused and further mouse-ahead should be ignored. If proc is not NIL, it will be called for each Action in the queue, to allow cleanup, NOTIFYs, etc.
END.