CDViewer.mesa (part of Chipndale)
by Christian Jacobi October 13, 1983 2:51 pm
last edited by Christian Jacobi November 21, 1983 3:28 pm
DIRECTORY
CD USING [DesignRect, DesignPosition, Design],
Rope USING [ROPE],
ViewerClasses USING [Viewer];
CDViewer: CEDAR DEFINITIONS =
BEGIN
ViewerList: TYPE = LIST OF ViewerClasses.Viewer;
ViewersOf:
PROC[design:
REF]
RETURNS [ViewerList];
--returns the viewers which might display the design;
DesignOf:
PROC[viewer: ViewerClasses.Viewer]
RETURNS [isDesign: BOOL, design: CD.Design, rect: CD.DesignRect];
--if viewer is not open, rect is undefined
--design gets NIL if NOT isDesign
ShowPosition:
PROC[viewer: ViewerClasses.Viewer, pos:
CD.DesignPosition];
--moves viewer such that pos is in visible area (does not open closed viewer)
--approximative only
ShowAndScale:
PROC[viewer: ViewerClasses.Viewer, rect:
CD.DesignRect];
--moves and scales viewer such that rect is in visible area (does not open closed viewer)
--approximative only
CreateViewer:
PROC [design:
CD.Design]
RETURNS [ViewerClasses.Viewer];
--... and displays the design,
ShowArrow:
PROC [design:
CD.Design, pos:
CD.DesignPosition];
--visible on viewers only
RemoveArrow: PROC[design: CD.Design];
FindDesign:
PROC[name: Rope.
ROPE, case:
BOOL ←
TRUE]
RETURNS [
CD.Design];
--only designs with viewers can be found;
--if multiple designs have the same name, find arbitrary one
END.