-- TJaMGraphicsContexts.mesa -- Last edit by Stone, January 31, 1984 2:13:10 pm PST --for clients who want to use alternate contexts in TJaMGraphics DIRECTORY JaM USING [State], Graphics USING [Context]; TJaMGraphicsContexts: CEDAR DEFINITIONS = { State: TYPE = JaM.State; DCList: TYPE = REF DCRec; DCRec: TYPE = RECORD [next: DCList, init: PROC RETURNS[Graphics.Context], dc: Graphics.Context, enabled, initOnErase: BOOLEAN, name: ATOM]; GProc: TYPE = PROC [dc: Graphics.Context]; ForAllDCs: PROC [list: DCList, proc: GProc]; --replaces Establish and ForgetNonViewerContext. 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. --the proc init will be called initially and each time .initdc is called. --initOnErase calls init if .erase is called --you must Enable the context to cause things to be displayed in it. --do not pass a viewer context in here!! AddContext: PROC [frame: State, init: PROC RETURNS[Graphics.Context], name: ATOM, enabled, initOnErase: BOOLEAN _ TRUE]; RemoveContext: PROC [frame: State, name: ATOM] RETURNS [context: Graphics.Context]; --turns display to context on and off. EnableContext: PROC [frame: State, name: ATOM]; DisableContext: PROC [frame: State, name: ATOM]; EnableViewer: PROC [frame: State]; DisableViewer: PROC [frame: State]; NotFound: SIGNAL; --raised by RemoveContext, EnableContext and DisableContext }.