DIRECTORY CD, Rope USING [ROPE]; CDOps: CEDAR DEFINITIONS = BEGIN CreateDesign: PROC [technology: CD.Technology] RETURNS [design: CD.Design]; SetMutability: PROC [design: CD.Design, mutability: CD.Mutability _ editable]; ResetDesign: PROC [design: CD.Design]; RenameDesign: PROC [design: CD.Design, name: Rope.ROPE] RETURNS [done: BOOL]; RealTopCell: PROC [design: CD.Design] RETURNS [dummyCell: CD.Object]; PushedTopCell: PROC [design: CD.Design] RETURNS [dummyCell: CD.Object]; MakeImmutable: PROC [ob: CD.Object] RETURNS [done: BOOL]; FlushRemember: PROC [design: CD.Design]; GetRemembered: PROC [design: CD.Design] RETURNS [CD.InstanceList]; Remember: PROC [design: CD.Design, what: REF]; LambdaRope: PROC [n: CD.Number, lambda: CD.Number] RETURNS [Rope.ROPE]; InstRope: PROC [inst: CD.Instance, design: CD.Design_NIL, verbosity: INT_1] RETURNS [Rope.ROPE]; LayerRope: PROC [layer: CD.Layer] RETURNS [Rope.ROPE]; ToRope: PROC [x: REF, whenFailed: REF_NIL] RETURNS [Rope.ROPE]; DrawDesign: PROC [design: CD.Design, pr: CD.DrawRef]; QuickDrawDesign: PROC [design: CD.Design, pr: CD.DrawRef]; ImmediateRedraw: PROC [design: CD.Design, r: CD.Rect_all, eraseFirst: BOOL_TRUE]; Redraw: PROC [design: CD.Design, r: CD.Rect_all, eraseFirst: BOOL_TRUE]; all: PRIVATE CD.Rect = [FIRST[CD.Number], FIRST[CD.Number], LAST[CD.Number], LAST[CD.Number]]; DoTheDelayedRedraws: PROC [design: CD.Design]; RedrawInstance: PROC [design: CD.Design, inst: CD.Instance_NIL, erase: BOOL_TRUE]; 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] }; 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]; IncludeObject: PROC [design: CD.Design, ob: CD.Object, trans: CD.Transformation_[[0,0], original]] RETURNS [CD.Instance]; FitObjectI: PROC [ob: CD.Object, location: CD.Position _ [0, 0], orientation: CD.Orientation _ CD.Orientation[original]] RETURNS [trans: CD.Transformation]; IncludeObjectI: PROC [design: CD.Design, ob: CD.Object, location: CD.Position _ [0, 0], orientation: CD.Orientation _ CD.Orientation[original]] RETURNS [CD.Instance]; SelectedInstance: PROC [design: CD.Design] RETURNS [first: CD.Instance, multiple: BOOL]; TheInstance: PROC [design: CD.Design, text: Rope.ROPE_NIL] RETURNS [inst: CD.Instance]; GetGrid: PROC [design: CD.Design, hint: REF_NIL] RETURNS [CD.Number]; PlaceInst: PROC [design: CD.Design, ob: CD.Object, hint: REF_NIL] RETURNS [inst: CD.Instance]; BoundingBox: PROC [design: CD.Design, onlySelected: BOOL _ FALSE] RETURNS [CD.Rect]; DeselectAll: PROC [design: CD.Design, setSelection: BOOL_FALSE]; END. CDOps.mesa (part of ChipNDale) Copyright c 1983, 1986, 1987 by Xerox Corporation. All rights reserved. Created by: Christian Jacobi, February 24, 1984 2:03 pm Last edited by: Christian Jacobi, April 10, 1987 6:00:30 pm PDT Simple operation on ChipNDale designs. All procedures do not queue; proper synchronization with CDSequencer by the caller is assumed. (Except CreateDesign, Redraw, or ImmediateRedraw, and the printing procs, which can be called anytime) --Basics --Creates a new, empty design; does not open a viewer yet. --Caller is supposed to set mutability after design is built. --Caller holds the synchronization lock until mutability is initialized and a viewer is opened --After the call, the design might be changed by interactive commands --Makes design empty --Renames a design; This procedure can fail; not all ropes are legal names! --Returns dummy cell which represents the top level of the design. --Do not reposition dummyCell; dummyCell can be changed without -- calling CDDirectory.PropagateChange. --Do not include dummyCell in directory --Returns dummy cell which represents the pushed in cell of the design; --- (The level where all the interactive edits happen) --Do not reposition dummyCell; represents can be changed without -- calling CDDirectory.PropagateChange --Do not include dummyCell in directory -- Tries to make an object immutable by making all its children immutable first, -- and then setting the objects own immutable bit. -- Very important: To make an object immutable is an operation which changes the -- object! It must be called only while owning the designs lock [of the design -- owning ob] with CDSequencer. [Because a parallel editing process can not check -- the immutable-bit atomicly with performing a change to the object]. -- However, this change is not propagated. --Undelete --Makes design forget its undelete cache --Returns instances in the undelete cache --the returned instances are removed from the cache --Rememembers either an instance or an InstanceList for a short time in the undelete cache. --Printing --For printing purposes --For printing purposes --For printing purposes --Tries hard to make rope; for printing purposes --Drawing --Draws a design into a device --No shortcuts, usefull for abstract devices --Drawing into viewers --Draw a design into a device, using the quick draw procedures --Shortcuts are taken; suits the implementation of viewers --Refreshes the the area r in all viewers without extra delay [drawing is forked] --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 efficient -- to call a redraw of a big rectangle first. --Forwards all Redraw requests which have not yet been drawn to the viewers. --Should be called from the command sequencer --Redraws the instance (delayed) --Handling instances on a design basis --Sets instance list of the currently pushed in cell of the design --Returns instance list of the currently pushed in cell of the design --Includes instance into design [pushed cell] --Includes instances into design [pushed cell] --Removes instance from design [pushed cell] --Puts instance at the end [pushed cell] --Used to make next selection finding different instance --Conveniance: Includes object into design [pushed cell] --Side effect: Sets selection according to internal selection mode --Conveniance: Returns a transformation such that the oriented objects interest rect --will have its lower left corner at location --Conveniance: Includes object into design [pushed cell] --Fancy coordinate transformation: -- fits oriented objects lower left corner of interest rect to location --Side effect: Sets selection according to internal selection mode --first: returns ref to any selected instance if there is one or more, otherwise NIL. --multiple: more than one instance is selected -- Finds the single selected instance of a design -- if returned instance is nil, all messages are made and caller might return quietly -- if returned instance is not nil; text line is written. --Returns a grid number --Interesting, because it returns a grid without explicitely importing viewer modules --Places ob down, somewhere into design and returns the instance made --Makes a guess for a good position --hint: hint to find gridding information -- use NIL, ViewerClasses.Viewer, or CDSequencer.Command --Bounding box of whole design --Empty for empty design --Set or clear selection of all instances Κ,˜codešœ%™%Kšœ Οmœ=™HKšœ9™9K™?—K˜šΟk ˜ Kšžœ˜Kšœžœžœ˜K˜—KšΟnœžœž œ˜Kšž˜K˜™&KšœΖ™ΖK™—K™K™K™š Ÿ œžœžœ žœ žœ ˜KKšœ:™:Kšœ=™=Kšœ^™^—K˜šŸ œžœ žœžœ˜NKšΟcE™EK˜—šŸ œžœ žœ ˜&K™—K˜š Ÿ œžœ žœžœžœžœ˜MK™K—K˜K˜š Ÿ œžœ žœ žœ žœ ˜EKšœB™BKšœ@™@Kšœ*™*Kšœ(™(—K˜š Ÿ œžœ žœ žœ žœ ˜GKšœG™GK™8KšœA™AKšœ(™(Kšœ(™(—K˜š Ÿ œžœžœ žœžœ˜9Kš P™PKšœ$  œ™2KšœΟbœ  œ#™RKšœS™SKšœW™WKšœK™KKšœ-™-—K™K™K™ K™šŸ œžœ žœ ˜(Kšœ)™)—K˜š Ÿ œžœ žœ žœžœ˜BKšœ*™*Kšœ3™3—K˜šŸœžœ žœžœ˜.Kšœ[™[—K™K™K™ K˜š Ÿ œžœžœžœ žœžœ˜GK™—K˜šŸœžœžœžœžœ žœžœžœ˜`K™—K˜š Ÿ œžœžœžœžœ˜6K™—K˜šŸœžœžœžœžœžœžœ˜?K™0K˜—K™K™ K˜šŸ œžœ žœ žœ ˜5Kšœ™Kšœ,™,—K˜K™K™K™šŸœžœ žœ žœ ˜:Kšœ>™>Kšœ:™:K˜—š Ÿœžœ žœ žœžœžœ˜QKšœQ™Q—K˜š Ÿœžœ žœ žœžœžœ˜HKšœ)™)Kšœ2™2Kšœ™KšœP™PKšœ0™0Kšœžœžœ žœžœ žœžœ žœžœ žœžœ ˜^K˜—šŸœžœ žœ ˜.KšœL™LKšœ-™-K˜—šŸœžœ žœžœ žœ žœžœ˜RK™ —K˜K˜K™'K˜š Ÿ œžœ žœ%žœžœ˜QKšœB™BKšœ1˜1Kšœ˜K˜—š Ÿœžœ žœ žœžœ˜GKšœE™EKšžœ(˜.Kšœ˜—K˜š Ÿœžœ žœžœžœžœ˜PK™-—K˜š Ÿœžœ žœ žœžœžœ˜VK™.—K˜š Ÿœžœ žœžœžœžœ˜OK™,—K˜šŸœžœ žœžœ ˜=K™(K™8K˜—šŸ œžœ žœ žœžœ#žœžœ ˜yKš 9™9KšœB™B—K˜šŸ œžœžœžœ!žœžœžœ žœ˜œKšœV™VKšœ.™.—K˜šŸœžœ žœ žœžœ!žœžœžœžœ ˜¦Kšœ9™9K™#K™JKšœB™B—K˜š Ÿœžœ žœ žœ žœžœ˜XKšœU™UKšœ.™.K™—šŸ œžœ žœžœžœžœžœ ˜WK™1KšœX™XKšœ<™