DIRECTORY MBQueue, MBQueuePrivate, TBQueue USING [], Rope USING [ROPE], TiogaButtons USING [TiogaButtonProc, TiogaButton, AppendToButton, CreateButton, CreateButtonFromNode], TiogaOps USING [Ref], ViewerClasses USING [Viewer]; TBQueueImpl: CEDAR PROGRAM IMPORTS MBQueuePrivate, TiogaButtons EXPORTS MBQueue, TBQueue = BEGIN OPEN MBQueue, MBQueuePrivate; QueueObj: PUBLIC TYPE ~ MBQueuePrivate.QueueObj; -- export concrete type to MBQueue Viewer: TYPE = ViewerClasses.Viewer; ROPE: TYPE = Rope.ROPE; CreateTiogaButton: PUBLIC PROC [ q: Queue, viewer: ViewerClasses.Viewer, rope: ROPE _ NIL, format: ROPE _ NIL, looks: ROPE _ NIL, proc: TiogaButtons.TiogaButtonProc, clientData: REF ANY _ NIL, fork: BOOL _ TRUE, paint: BOOL _ TRUE ] RETURNS [TiogaButtons.TiogaButton] = { RETURN[TiogaButtons.CreateButton[ viewer, rope, format, looks, UserClick, NEW[MyClickInfoObj _ [proc, clientData, q]], fork]] }; CreateTiogaButtonFromNode: PUBLIC PROC [ q: Queue, node: TiogaOps.Ref, start: INT _ 0, end: INT _ INT.LAST, proc: TiogaButtons.TiogaButtonProc _ NIL, clientData: REF ANY _ NIL, fork: BOOL _ TRUE] RETURNS [TiogaButtons.TiogaButton] = { RETURN[TiogaButtons.CreateButtonFromNode[ node, start, end, UserClick, NEW[MyClickInfoObj _ [proc, clientData, q]], fork]]; }; AppendToTiogaButton: PUBLIC PROC [ q: Queue, button: TiogaButtons.TiogaButton, rope: ROPE _ NIL, looks: ROPE _ NIL, proc: TiogaButtons.TiogaButtonProc _ NIL, clientData: REF ANY _ NIL, fork: BOOL _ TRUE] RETURNS [TiogaButtons.TiogaButton] = { RETURN[TiogaButtons.AppendToButton[ button, rope, looks, UserClick, NEW[MyClickInfoObj _ [proc, clientData, q]], fork]]; }; END. `TBQueueImpl.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Willie-Sue, May 9, 1985 9:49:07 am PDT Contents: impl'n of TBQueue - modeled after MBQueueImpl 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). 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. Public procedures Κμ˜šΟn™Icodešœ Οmœ1™