ViewerContexts:
CEDAR
DEFINITIONS = {
VECI: TYPE ~ RECORD [x, y: INTEGER];
Viewer: TYPE ~ ViewerClasses.Viewer;
Context: TYPE ~ Imager.Context;
ContextViewer: TYPE ~ REF ContextViewerPrivate;
ContextViewerPrivate: TYPE;
Create:
PROC
[viewerInit: ViewerClasses.ViewerRec,
size: VECI,
NoteClear: PROC [clientData: REF ANY] ¬ NIL,
NoteChange: PROC [clientData: REF ANY, idealToViewer, viewerToScreen, viewerSize, idealSize: VECI] ¬ NIL,
NoteDestruction: PROC [clientData: REF ANY] ¬ NIL,
clientData: REF ANY ¬ NIL]
RETURNS [ContextViewer];
NoteClear, NoteChange and NoteDestruction may or may not be called under any combination of: the write lock for the viewer, and some locks internal to the implementation of ViewerContexts.
QuaViewer:
PROC [cv: ContextViewer, which: WhichViewer]
RETURNS [Viewer];
A ContextViewer may be implemented by a nest of Viewers; which tells whether the outermost or the innermost is desired.
WhichViewer: TYPE ~ {inner, outer};
QuaContextViewer:
PROC [Viewer]
RETURNS [MaybeContextViewer];
MaybeContextViewer: TYPE ~ RECORD [is: BOOL, it: ContextViewer];
DoWithInfo: PROC [cv: ContextViewer, With: PROC [idealToViewer, viewerToScreen, viewerSize, idealSize: VECI, destroyed: BOOL]];
SetIdealSize: PROC [ContextViewer, VECI];
GetMenuPane: PROC [ContextViewer] RETURNS [Viewer];
AddMenuElt: PROC [cv: ContextViewer, elt: Viewer, paint: BOOL];
AddPane: PROC [cv: ContextViewer, pane: Viewer, above, paint: BOOL];
DeletePane: PROC [cv: ContextViewer, pane: Viewer, paint: BOOL];
CreateContext: PROC [ContextViewer] RETURNS [Context];
QuaViewerContext: PROC [Context] RETURNS [MaybeContextViewer];
SetCursor: PROC [ContextViewer, ViewerClasses.CursorType];
Destroy: PROC [ContextViewer];
}.