PWBasics.mesa,
Created by Bertrand Serlet
Last Edited by Bertrand Serlet, May 2, 1985 1:46:42 am PDT
All the commonly used operations. Also contains all the stuff for error messages, warnings, bugs ...
DIRECTORY
CD, Rope;
PWBasics: CEDAR DEFINITIONS =
BEGIN
-- Utilities
ROPE: TYPE = Rope.ROPE;
Outputs messages in the TerminalIO window
Output: PROC [r1, r2, r3, r4, r5, r6: ROPENIL];
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: ROPENIL];
-- 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: ROPENIL];
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: ROPENIL];
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.