CDViewer.mesa (part of ChipNDale)
Copyright © 1983, 1986 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, October 13, 1983 2:51 pm
Last edited by: Christian Jacobi, September 19, 1986 11:19:25 am PDT
DIRECTORY
CD USING [Rect, Position, Design],
CDSequencer USING [Command],
Rope USING [ROPE],
ViewerClasses USING [Viewer];
CDViewer: CEDAR DEFINITIONS =
BEGIN
--Accessing viewers of ChipNDale designs
CreateViewer:
PROC [design:
CD.Design, openDialogue, openPanel:
BOOL←
TRUE]
RETURNS [ViewerClasses.Viewer];
--Creates a viewer and displays the design,
--If already a viewer exists, this split's the viewer
GetViewer:
PROC [comm: CDSequencer
.Command]
RETURNS [ViewerClasses.Viewer];
--Returns the viewer from which the command was issued, if detectable
--Might return NIL
LastViewer:
PROC []
RETURNS [ViewerClasses.Viewer];
--The last ChipNDale design viewer which had the input focus
--Might return NIL
--Scaling and paning
ShowPosition:
PROC [viewer: ViewerClasses.Viewer, pos:
CD.Position];
--Moves viewer such that pos is in visible area (does not open closed viewer)
--Approximative only
ShowAndScale:
PROC [viewer: ViewerClasses.Viewer, rect:
CD.Rect];
--Moves and scales viewer such that rect is in visible area (does not open closed viewer)
--Approximative only
VisibleRect:
PROC [viewer: ViewerClasses.Viewer]
RETURNS [r:
CD.Rect];
--Undefined if viewer is not open or does not represent a ChipNDale design
--Transfer
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 [design:
CD.Design];
--NIL if not a ChipNDale design
FindDesign:
PROC [name: Rope.
ROPE, case:
BOOL ←
FALSE]
RETURNS [design:
CD.Design];
--Might not find designs which do not have viewers
--If multiple designs have the same name, find arbitrary one
--NIL if not found
END.