CDTexts.mesa A ChipNDale module
Copyright © 1983 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, July 29, 1983 10:42 am
Last edited by: Christian Jacobi, September 18, 1986 2:53:08 pm PDT
DIRECTORY
CD,
Rope USING [ROPE],
Imager USING [Font, VEC];
CDTexts: CEDAR DEFINITIONS =
BEGIN
Text objects.
IsRigidText: PROC [ob: CD.Object] RETURNS [BOOL] = INLINE {
RETURN [ ob.class=rigidTextClass ]
};
IsFlipText: PROC [ob: CD.Object] RETURNS [BOOL] = INLINE {
RETURN [ ob.class=flipTextClass ]
};
IsText: PROC [ob: CD.Object] RETURNS [BOOL] = INLINE {
RETURN [ ob.class=rigidTextClass OR ob.class=flipTextClass ]
};
TextSpecific: TYPE = REF TextRec;
TextRec: TYPE = RECORD [
text: Rope.ROPE,
cdFont: CDFont
];
CDFont: TYPE = REF --READONLY-- FontRec;
FontRec: TYPE = RECORD [ --readonly to clients except properties
font: Imager.Font,
xy: Imager.VEC,
scaleI: INT ← 1,
origin: CD.Position,
height: CD.Number ← -1,
isPlaceHolder: BOOLFALSE,
supposedKey: Rope.ROPE,
supposedName: Rope.ROPE,
substitutedFont: Imager.Font,
format: PRIVATE INT,
data: PRIVATE REF ANYNIL, --for CDTextsImpl
properties: CD.PropRef
];
Create: PROC [text: Rope.ROPE, font: REF ANY, layer: CD.Layer ← CD.commentLayer, flip: BOOLTRUE] RETURNS [CD.Object];
MakeFont: PROC [name: Rope.ROPE, scale: CD.Number ← 2] RETURNS [CDFont];
--use lambda for good scale
rigidTextClass: PRIVATE CD.ObjectClass;
flipTextClass: PRIVATE CD.ObjectClass;
END.