ImagerState.mesa
Copyright © 1984 Xerox Corporation. All rights reserved.
Doug Wyatt, September 17, 1984 2:58:37 pm PDT
DIRECTORY
Font USING [FONT],
ImagerColor USING [Color],
ImagerPath USING [PathProc],
ImagerTransformation USING [Transformation],
Vector2 USING [VEC];
ImagerState: CEDAR DEFINITIONS
~ BEGIN
VEC: TYPE ~ Vector2.VEC;
Transformation: TYPE ~ ImagerTransformation.Transformation;
FONT: TYPE ~ Font.FONT;
Color: TYPE ~ ImagerColor.Color;
CARD: TYPE ~ LONG CARDINAL;
State: TYPE ~ REF StateRep;
StateRep: TYPE ~ RECORD[
p: PersistentVariables, -- persistent variables
transformation: Transformation, -- current client-to-view transformation
lastTid: CARD, -- last tid used
font: FONT, -- current font ("showVec")
color: Color, -- current color
clipper: Clipper, -- current clipping outline
np: NonPersistentVariables -- other non-persistent variables
];
PersistentVariables: TYPE ~ RECORD[
cp: VEC ← [0, 0], -- current position
correctMeasure: VEC ← [0, 0], -- target line measure for Correct
correctMaskCount: INT ← 0, -- tally number of CorrectMask calls in pass 1
correctSum: VEC ← [0, 0], -- tally adjustable space from CorrectSpace calls in pass 1
correctMask: VEC ← [0, 0], -- amount of space added by each CorrectMask call in pass 2
correctSpace: VEC ← [0, 0] -- fraction of space added by each CorrectSpace call in pass 2
];
NonPersistentVariables: TYPE ~ RECORD[
tid: CARD ← 0, -- unique id for transformation
priorityImportant: INT ← 0, -- if nonzero, priority of masks is important
mediumSize: VEC ← [0, 0], -- size of medium, in meters
fieldMin: VEC ← [0, 0], -- minimum x and y of field, in meters
fieldMax: VEC ← [0, 0], -- maximum x and y of field, in meters
noImage: INT ← 0, -- if nonzero, don't image masks
strokeWidth: REAL ← 0, -- stroke width
strokeEnd: INT ← 0, -- stroke end treatment
underlineStart: REAL ← 0, -- starting x position for underline
amplifySpace: REAL ← 1.0, -- multiplies width of amplified characters
correctPass: INT ← 0, -- which pass, during Correct
correctShrink: REAL ← 0.5, -- allowable space shrink
correctTolerance: VEC ← [0, 0] -- tolerable deviation from correctMeasure
];
Clipper: TYPE ~ LIST OF ClipperItem; -- the Clipper is the intersection of the ClipperItems.
ClipperItem: TYPE ~ RECORD [
exclude: BOOL, -- True if it is an excluding clipper
easyRectangle: BOOL, -- True if path is known to be a rectangle with sides parallel to the axes
pathProc: ImagerPath.PathProc,
pathData: REF -- must be immutable for the life of the clipper
];
END.