CDOps.mesa (part of ChipNDale)
Copyright © 1983, 1986 by Xerox Corporation. All rights reserved.
by Christian Jacobi, February 24, 1984 2:03 pm
last edited by Christian Jacobi, March 14, 1986 10:15:51 am PST
DIRECTORY
CD,
Rope USING [ROPE];
CDOps: CEDAR DEFINITIONS =
BEGIN
simple operation on ChipNDale designs.
All procedures do not queue; proper synchronization by the caller is assumed. (Except DelayedRedraw.)
CreateDesign: PROC [technology: CD.Technology] RETURNS [design: CD.Design];
--does not open a viewer
ResetDesign: PROC [design: CD.Design];
IncludeInstance: PROC [design: CD.Design, inst: CD.Instance, draw: BOOL TRUE];
IncludeInstanceList: PROC [design: CD.Design, il: CD.InstanceList, draw: BOOL TRUE];
RemoveInstance: PROC [design: CD.Design, inst: CD.Instance, draw: BOOL TRUE];
ReOrderInstance: PROC [design: CD.Design, inst: CD.Instance];
IncludeObjectI: PROC[design: CD.Design, ob: CD.Object, location: CD.Position ← [0, 0], orientation: CD.Orientation ← CD.original];
--conveniant procedure; sets selection according to internal mode
QuickDrawDesign: PROC [design: CD.Design, pr: CD.DrawRef];
--shortcuts are taken; suits the implementation of viewers
--inclusive selection
DrawDesign: PROC [design: CD.Design, pr: CD.DrawRef];
--ommit selection
--no shortcuts, usefull on abstract devices
Redraw: PROC [design: CD.Design, r: CD.Rect𡤊ll, eraseFirst: BOOLTRUE];
--Refreshes the the area r in all viewers
DelayedRedraw: PROC [design: CD.Design, r: CD.Rect𡤊ll, eraseFirst: BOOLTRUE];
--Refreshes the the area r in all viewers
--Is delayed until the current command is finished
--efficiency hint: if a lot of small rectangles need to be redrawn, it can be more efficiant
--  to call a redraw of a big rectangle first.
all: PRIVATE CD.Rect = [FIRST[CD.Number], FIRST[CD.Number], LAST[CD.Number], LAST[CD.Number]];
DoTheDelayedRedraws: PROC [design: CD.Design];
--does the DelayedRedraw's which have not yet been done
--should be called from the command sequencer
RedrawInstance: PROC [design: CD.Design, inst: CD.Instance←NIL, erase: BOOLTRUE];
--redraws the instance (delayed)
SetInstList: PROC [design: CD.Design, instList: CD.InstanceList ← NIL] = INLINE {
design^.actual.first.specific.contents ← instList
};
InstList: PROC [design: CD.Design] RETURNS [CD.InstanceList] = INLINE {
RETURN[design^.actual.first.specific.contents]
};
PointedInstance: PROC [design: CD.Design, pos: CD.Position] RETURNS [CD.Instance];
SelectedInstance: PROC [design: CD.Design] RETURNS [first: CD.Instance, multiple: BOOL];
--first: returns ref to any selected application if there is one or more, otherwise nil.
--multiple: more than one application is selected
ObjectInfo: PROC[ob: CD.Object] RETURNS [Rope.ROPE];
LayerName: PROC[layer: CD.Layer] RETURNS [Rope.ROPE];
END.