File: StretchLines.mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
Created by: Bob Mayo, July 2, 1984 2:53:37 pm PDT
Last Edited by: Mayo, November 5, 1984 6:38:03 pm PST
-- StretchLines: Add stretch lines to ChipNDale. Stretch Lines are named line segments and come in two flavors: pointed and blunt. The tiler package interprets the pointed lines as designating that the entire cell should be stretched along that line, while the blunted ones are interpreted as meaning just stretch the goemetry under the line without moving anything else.
DIRECTORY
Rope USING [ROPE],
Stretch USING [Direction],
CD USING [Design, ObPtr, ApplicationPtr, Position, Level, combined];
StretchLines: CEDAR DEFINITIONS =
BEGIN
LineData: TYPE = RECORD [
point: CD.Position,   -- left (or lower) endpoint of stretch line
length: INT ← 1,    -- length of line (forced be be equal or greater than some minimum)
direction: LineDirections ← up, -- the direction to stretch in
type: LineTypes ← pointed,  -- type type of object
label: Rope.ROPENIL,   -- the attached label
level: CD.Level ← CD.combined -- The level (or layer) that it refers to. If value is CD.combined and type = blunt and we know what design it is being placed in, then it is set to that design's current default level. Always set to 'combined' for pointed lines
];
LineTypes: TYPE = {pointed, blunt};
LineDirections: TYPE = Stretch.Direction;
-- Place stretch line. If shift = TRUE then shift the object so that the line is at the point specified, if FALSE the lower left corner of the object (not the line) goes at the point specified.
Place: PROC [into: CD.Design, line: LineData, shift: BOOLTRUE];
-- Find a stretch line with the given label in a cell.
Find: PROC [ob: CD.ObPtr, label: Rope.ROPE] RETURNS [REF LineData];
-- Find all stretch lines in a cell.
FindList: PROC [ob: CD.ObPtr] RETURNS [LIST OF LineData];
-- back door procedures --
objAtom: READONLY ATOM; -- Contains the atom that stretch lines are tagged with.
-- Like above, but returns an application that is not included in any design. Returns NIL if an error occured (such as no level specified for a blunt line).
MakeLineAptr: PROC [line: LineData, shift: BOOLTRUE] RETURNS [CD.ApplicationPtr];
-- Given a ChipNDale application that points to a stretch line, return it's information. Returns NIL if the application is not a stretch line.
AptrToLine: PROC [aptr: CD.ApplicationPtr] RETURNS [REF LineData];
END.