RTBasic.mesa
Copyright Ó 1985, 1986, 1987 by Xerox Corporation. All rights reserved.
by Bryan Preas August 29, 1985 2:48:22 pm PDT
last edited by Bryan Preas April 3, 1987 2:21:43 pm PST
DIRECTORY
Basics, CD, CDCells, D2Basic, PW, Rope;
RTBasic: CEDAR DEFINITIONS
IMPORTS CD, CDCells, PW
= {
Types
SideOrNone: TYPE = {bottom, top, left, right, none};
Side: TYPE = SideOrNone[bottom .. right];
LRSide: TYPE = SideOrNone[left .. right];
TBSide: TYPE = SideOrNone[bottom .. top];
DirectionOrNone: TYPE = {horizontal, vertical, none};
Direction: TYPE = DirectionOrNone[horizontal .. vertical];
AboveOrBelow: TYPE = {above, below};
PQPos: TYPE = RECORD[
p: D2Basic.Number,
q: D2Basic.Number];
PQRectRef: TYPE = REF PQRect;
PQRect: TYPE = RECORD[
c1, c2: PQPos];
PQRectList: TYPE = LIST OF PQRect;
Range: TYPE = RECORD [
l, r: D2Basic.Number];
RangeList: TYPE = LIST OF Range;
RefRange: TYPE = REF Range;
sideName: ARRAY RTBasic.Side OF Rope.ROPE;
Errors
Error: ERROR [errorType: ErrorType ← callingError, explanation: Rope.ROPENIL];
Signal: SIGNAL [signalType: ErrorType ← callingError, explanation: Rope.ROPENIL];
ErrorType: TYPE = {programmingError, callingError, noResource, designRuleViolation, other};
Procedures 
OtherSide: PROCEDURE [side: Side]
RETURNS [Side];
OtherDirection: PROCEDURE [direction: Direction]
RETURNS [Direction];
OtherRelation: PROCEDURE [aboveOrBelow: AboveOrBelow]
RETURNS [AboveOrBelow];
SimpleCompare: PROCEDURE [result1, result2: D2Basic.Number]
RETURNS [result: Basics.Comparison];
XYToPQ: PROC [pDir: Direction, pos: D2Basic.Vector] RETURNS [pqPos: PQPos];
convert a position from x-y to p-q space.
PQToXY: PROC [pDir: Direction, pqPos: PQPos] RETURNS [pos: D2Basic.Vector];
convert a position from p-q to x-y space.
IRSize: PROC [obj: CD.Object] RETURNS [CD.Position] ~ INLINE{
RETURN[CD.InterestSize[obj]]};
SetCDCellName: PROC [obj: CD.Object, name: Rope.ROPE] ~ INLINE{
PW.SetName[obj, name]};
GetCDCellName: PROC [obj: CD.Object] RETURNS [Rope.ROPE]~ INLINE{
RETURN[PW.Name[obj]]};
CDCellIsEmpty: PROC [obj: CD.Object] RETURNS [BOOLEAN] ~ INLINE{
RETURN[CDCells.IsEmpty[obj]]};
RepositionCell: PROC [obj: CD.Object] ~ INLINE{
IF ~CDCellIsEmpty[obj] THEN [] ← CDCells.ResizeCell[NIL, obj]};
}.