JaMImagerContexts.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last edit by Stone, January 22, 1984 6:48:49 pm PST
Tim Diebert: July 18, 1985 3:22:00 pm PDT
DIRECTORY
JaM USING [State],
Imager USING [Context];
JaMImagerContexts: CEDAR DEFINITIONS = {
State: TYPE = JaM.State;
Context: TYPE = Imager.Context;
Pick any name ie: $PD. If a context with the name already exists for that frame, AddContext will replace the old context with the new one. You must Enable the context to cause things to be displayed in it.
AddContext: PROC [state: State, context: Context, callMe: CallMe, name: ATOM, enabled: BOOLEANTRUE];
Command: TYPE = {initdc, erase, pushdc, popdc};
CallMe: TYPE = PROC[context: Context, command: Command] RETURNS[new: Context];
generic call back procedure used to notify client of certain JaMImager commands.
If you don't want to change the context just hand it back.
The proc: callMe will be called for the following reasons
command=initdc: .initdc is called.
command=erase: .erase is called
command=pushdc: .pushdc is called. Note: the imager does not have a stack model
command=popdc: .popdc is called.
RemoveContext: PROC [state: State, name: ATOM] RETURNS [context: Context];
turns display to context on and off.
EnableContext: PROC [state: State, name: ATOM];
DisableContext: PROC [state: State, name: ATOM];
turns context in viewer on and off
EnableViewer: PROC [state: State];
DisableViewer: PROC [state: State];
NotFound: SIGNAL; --raised by RemoveContext, EnableContext and DisableContext
DCList: TYPE = REF DCRec;
DCRec: TYPE = RECORD [
next: DCList,
callMe: CallMe,
dc: Imager.Context,
enabled: BOOLEAN,
name: ATOM];
GProc: TYPE = PROC [dc: Context];
ForAllDCs: PROC [list: DCList, proc: GProc];
}.