DIRECTORY CD, CDSymbolicObjects USING [InstEnumerator], Rope USING [ROPE]; PWPins: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; Side: TYPE = {bottom, right, top, left, none}; GetSide: PROC [ob: CD.Object, pin: CD.Instance] RETURNS [side: Side]; EnumerateDeepPins: PROC [ob: CD.Object, eachPin: InstanceEnumerator, stopEnumerateDeepPins: BOOL _ TRUE] RETURNS [quit: BOOL]; InstanceEnumerator: TYPE = CDSymbolicObjects.InstEnumerator; -- [inst: CD.Instance] RETURNS [quit: BOOL _ FALSE] EnumerateEdgePins: PROC [ob: CD.Object, eachPin: InstanceEnumerator, stopEnumerateDeepPins: BOOL _ TRUE] RETURNS [quit: BOOL]; ChangePins: PUBLIC PROC [ob: CD.Object, changePinProc: ChangePinProc _ DefaultChangePinProc, stopEnumerateDeepPins: BOOL _ TRUE] RETURNS [cell: CD.Object]; ChangePinProc: TYPE = PROC [oldPin: CD.Instance] RETURNS [newPin: CD.Instance _ NIL]; DefaultChangePinProc: ChangePinProc; -- {newPin _ oldPin}; Identity change RenamePins: PUBLIC PROC [ob: CD.Object, renameProc: RenameProc _ DefaultRenameProc, stopEnumerateDeepPins: BOOL _ TRUE] RETURNS [cell: CD.Object]; RenameProc: TYPE = PROC [oldRope: ROPE] RETURNS [newRope: ROPE _ NIL]; DefaultRenameProc: RenameProc; -- {newRope _ oldRope}; Identity renaming Index: PROC [rope: ROPE, index: INT] RETURNS [indexedRope: ROPE]; TransferCell: PUBLIC PROC [template: CD.Object, objSide: Side, width: INT, objProc: ForEachPinProc, selectNameProc: SelectNamesProc _ KeepAll] RETURNS [cell: CD.Object]; ForEachPinProc: TYPE = PROC [inst: CD.Instance] RETURNS [obj: CD.Object]; SelectNamesProc: TYPE = PROC [name: ROPE] RETURNS [keepIt: BOOL]; KeepAll: SelectNamesProc; END. hPWPins.mesa Copyright c 1985, 1986 by Xerox Corporation. All rights reversed. Created by Bertrand Serlet, June, 1985 0:20:20 am PDT Bertrand Serlet, December 18, 1986 5:23:37 pm PST Attention, this interface is completely obsolete and will disappear soon! Types and Definitions The convention for getting the side of a pin is to see if the pin is located on the border of the InterestRect of the ob. For pins at a corner, the biggest direction is the relevant one. This is not a Hack, because in fact only the dimension parallel to the side of the pin is meaningful. Enumeration of pins This proc enumerates in random order all pins, even the ones found in the deepest levels of the hierarchy of ob. The instances passed to eachPin are new instances, with all properties (e.g. the name) copied, so that the coordinate system refers to the one of ob. EnumerateDeepPins uses the expand proc for objects of unknown class. Changes on pins while the enumeration may or may not be seen. If the flag stopEnumerateDeepPins is TRUE, the recursion stops on instances of cells which have a non-nil $StopEnumerateDeepPins property, i.e. those instances will not be enumerated. The following function is a speed up of EnumerateDeepPins when the only pins wanted are the ones which intersect the border of the InterestRect, i.e. pins such as GetSide.isOnBorder is TRUE. Creation of cells by copying (and changing) some pins The following procs parse an object, extract all pins along the edges, and creates a new cell having an instance of the object, and changed pins. If the flag stopEnumerateDeepPins is TRUE, the property $StopEnumerateDeepPins is added on the instance, so that EnumerateDeepPins will only enumerate the copied pins next call. There are two ways of specifying how to change pins, by specifying either the new pin or the new name. In both cases NIL pins/names are not copied. Useful in many RenameProcs for indexing names. e.g. Index["foo", 4]="foo[4]" Transfer cell is a very Xerographic constructor: it first creates an empty cell: one dimension is the specified width, the other is the same as the side of the template; then it parses the side of the template, and for every pin it calls the objProc and sticks the resulting object in the cell so that it faces the pin; the object is rotated according to the side in use, and the right side corresponds to the original orientation Ê1˜– "Cedar" stylešœ ™ Jšœ Ïmœ7™BJšœ2Ïk™5Jšœ1™1—J˜šž œ˜ Jšžœ˜Jšœžœ˜*Jšœžœžœ˜—J˜JšÐbnœžœž œž˜!IheadšÑbsxI™I™Jšžœžœžœ˜J˜JšÏbœžœ%˜/J˜Jšœ£™£Jš Ïnœžœžœžœ žœ˜E—™Jšœ™¡œžœA¡œ7™ÄJš¢œžœžœ=žœžœžœžœ˜~J˜J•StartOfExpansion= -- [app: CD.ApplicationPtr] RETURNS [quit: BOOL _ FALSE] -- š¡œžœ%Ïc4˜qJ˜Jšœ¹žœ™¾Jš¢œžœžœ=žœžœžœžœ˜~—™5Jš œŸ¡œžœ¡œÛžœ™ÛJš¢ œžœžœžœUžœžœžœžœ ˜›J˜J–[]š œžœžœ žœ žœ žœ žœ˜UJšŸœ£%˜JJ˜Jš¢ œžœžœžœLžœžœžœžœ ˜’J˜J–[]š œ žœžœ žœžœ žœžœ˜FJšŸœ£)˜HJ˜JšœL™Lš ¢œžœžœ žœžœžœ˜BJ˜—Jšœ®™®Jš¢ œžœžœ žœžœFžœžœ ˜©Jš œžœžœžœ žœžœ ˜IJš œžœžœžœžœ žœ˜AJš¢œ˜J˜—Jšžœ˜—…—t