PWBasics.mesa,
Created by Bertrand Serlet
Last Edited by Bertrand Serlet, May 2, 1985 1:46:42 am PDT
PWBasics:
CEDAR
DEFINITIONS =
BEGIN
-- Utilities
ROPE: TYPE = Rope.ROPE;
Outputs messages in the TerminalIO window
Output: PROC [r1, r2, r3, r4, r5, r6: ROPE ← NIL];
RopeFromCell: PROC [cell: CD.ObPtr] RETURNS [rope: ROPE];
RopeFromPos: PROC [pos: CD.Position] RETURNS [rope: ROPE];
RopeFromRect: PROC [rect: CD.Rect] RETURNS [rope: ROPE];
-- Converting from PWLow to PW
If name=NIL or if name is not found, returns NIL
ObjFromName: PROC [design: CD.Design, name: ROPE] RETURNS [object: CD.ObPtr ← NIL];
Gets the name from the object.
If object=NIL returns NIL
NameFromObj: PROC [object: CD.ObPtr] RETURNS [name: ROPE ← NIL];
-- Geometric primitives
The following primitive allow the use of the interestRectangle coordinates only
GetLocation: PROC [appl: CD.ApplicationPtr, obj: CD.ObPtr] RETURNS [location: CD.Position];
Gives the size of the interest Rect
GetISize: PROC [obj: CD.ObPtr] RETURNS [size: CD.Position];
Gives sizes of a rectangle.
IntFromRectProc: TYPE = PROC [rect: CD.Rect] RETURNS [size: CD.Number];
SizeX: IntFromRectProc;
SizeY: IntFromRectProc;
-- Creation of a new cell
-- Inclusion of an application of a subCell in a cell
IncludeApplication:
PROC [cell, subcell:
CD.ObPtr, location:
CD.Position ← [0, 0], orientation:
CD.Orientation ←
CD.combined]
RETURNS [newAppl:
CD.ApplicationPtr];
-- When all inclusions have been made, this proc should be called. Assumptions are that object is a cell and that Size and InterestRect are meaningless and need being recomputed.
If design is given, the cell is added to to directory, if not previously done.
If name is given, it is the preferred name of the new cell.
RepositionCell: PROC [design: CD.Design, cell: CD.ObPtr, name: ROPE ← NIL];
As CDDirectory.Include, but may include the same cell twice in the same design.
If name is given, it is the preferred name of the new cell.
Include: PROC [design: CD.Design, object: CD.ObPtr, name: ROPE ← NIL];
Adds the properties of obj which are copiable to the ones of newObj,
AppendProps: PROC [newObj, obj: CD.ObPtr];
-- For mapping some rectangles
MapRectProc: TYPE = PROC [rect: CD.Rect] RETURNS [CD.Rect];
END.