CDTexts.mesa A ChipNDale module
Copyright © 1983 by Xerox Corporation. All rights reserved.
by Christian Jacobi, July 29, 1983 10:42 am
last edited by Christian Jacobi, March 25, 1986 1:12:53 pm PST
DIRECTORY
CD,
Rope USING [ROPE],
Imager USING [Font, VEC];
CDTexts: CEDAR DEFINITIONS =
BEGIN
Text objects.
IsText:
PROC [ob:
CD.Object]
RETURNS [
BOOL] =
INLINE {
RETURN [ ob.class = textClass ]
};
TextPtr: TYPE = REF TextRec;
TextRec:
TYPE =
RECORD [
text: Rope.ROPE,
cdFont: CDFont
];
CDFont: TYPE = REF READONLY FontRec;
FontRec:
TYPE =
RECORD [
font: Imager.Font,
xy: Imager.VEC,
scaleR: REAL ← 1.0,
scaleI: INT ← 1,
origin: CD.Position,
height: CD.Number ← -1,
isPlaceHolder: BOOL ← FALSE,
supposedKey: Rope.ROPE,
supposedName: Rope.ROPE,
format: PRIVATE INT,
data: PRIVATE REF ANY ← NIL, --for CDTextsImpl
properties: CD.PropRef
];
CreateText: PROC [text: Rope.ROPE, font: REF READONLY ANY, layer: CD.Layer ← CD.commentLayer] RETURNS [CD.Object];
MakeFont:
PROC [name: Rope.
ROPE, scale:
CD.Number ← 2]
RETURNS [CDFont];
--use lambda for good scale
textClass: PRIVATE CD.ObjectClass;
END.