DIRECTORY Imager USING [Context], CedarProcess USING [Process], ViewerClasses USING [Viewer], ActionQueue USING [Queue], Terminal USING [Virtual], Rope USING [ ROPE ]; QuickViewer: CEDAR DEFINITIONS ~ BEGIN BuildViewer: PROC[ viewerTitle: Rope.ROPE, menuLabels: LIST OF Rope.ROPE, reDrawProc: PROC[imagerCtx: Imager.Context, toDo: REF ANY], buttonProc: PROC[bttn, choice: ATOM, x, y: REAL], quitProc: PROC[] ] RETURNS [ quickView: REF QuickView ]; DrawInViewer: PUBLIC PROCEDURE [view: REF QuickView, proc: PROC[Imager.Context]]; CountedCondition: TYPE ~ RECORD [ count: NAT _ 0, condition: CONDITION ]; QuickView: TYPE = RECORD [ outer: ViewerClasses.Viewer, -- enclosing container viewer: ViewerClasses.Viewer, -- graphics area within terminal: Terminal.Virtual, -- virtual terminal changed: BOOLEAN _ FALSE, -- has viewer size, etc. changed menuQueue: ActionQueue.Queue, -- queued menu clicks newEvent: CountedCondition, -- prevents pile-up of mouse positions eventProcess: CedarProcess.Process, -- event action process inputEvent: ATOM, -- Action from tip table choice: ATOM, -- from pop-up menu or ctrl-shift x, y: REAL _ 0, -- mouse coordinates drawProc: PROC[Imager.Context, REF ANY], -- procedure for redrawing window buttProc: PROC[ATOM, ATOM, REAL, REAL], -- procedure for button actions exitProc: PROC[] -- procedure for cleaning up on exit ]; END. &QuickViewer.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Last Edited by: Frank Crow September 22, 1986 5:11:55 pm PDT Rick Beach, June 13, 1986 5:10:16 pm PDT Make a viewer with the supplied menu labels. Use the supplied ReDrawProc when the screen must be redrawn (because the viewer changes size, etc.). Use the supplied QuitProc to clean up on program termination (which occurs when the viewer is destroyed). The ButtonProc will be called with the button name, an atom representing a choice from a pop-up menu or the state of the control and shift keys and the mouse position whenever the state of an input device (keyboard, mouse) changes. Callback procedure used to draw on display. QuickViewer will supply the Imager context to the supplied procedure then call it. Ê ˜codešœ™Kšœ Ïmœ1™Jšœ žœ ¡˜2Jšœžœ ¡!˜8Jšœžœ¡˜-Jšœ žœžœžœ¡!˜KJš œ žœžœžÏiœžœžœ¡ ˜IJšœ žœ ¡$˜>Jšœ˜——J˜Jšžœ˜J˜K˜—…—Ò