ImagerRasterPrivate.mesa
Copyright © 1984 Xerox Corporation. All rights reserved.
Doug Wyatt, November 30, 1984 2:33:41 pm PST
DIRECTORY
ImagerColor USING [Color],
ImagerDevice USING [Device],
ImagerFont USING [Font],
ImagerManhattan USING [DeviceRectangle, Polygon],
ImagerPath USING [Clipper],
ImagerScanConverter USING [DevicePath],
ImagerTransformation USING [Transformation],
Vector2 USING [VEC];
ImagerRasterPrivate: CEDAR DEFINITIONS
~ BEGIN
CARD: TYPE ~ LONG CARDINAL;
IVEC: TYPE ~ RECORD[x, y: INTEGER];
Color: TYPE ~ ImagerColor.Color;
Font: TYPE ~ ImagerFont.Font;
Clipper: TYPE ~ ImagerPath.Clipper;
Transformation: TYPE ~ ImagerTransformation.Transformation;
VEC: TYPE ~ Vector2.VEC;
DevicePath: TYPE ~ ImagerScanConverter.DevicePath;
DeviceRectangle: TYPE ~ ImagerManhattan.DeviceRectangle;
ManhattanPolygon: TYPE ~ ImagerManhattan.Polygon;
PersistentVariables: TYPE ~ RECORD[
cp: VEC ← [0, 0], -- current position, view coords
correctMeasure: VEC ← [0, 0], -- target line measure for Correct, view coords
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[
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, client coords
strokeStyle: INT ← 0, -- stroke end and joint treatment
underlineStart: REAL ← 0, -- starting x position for underline, client coords
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, view coords
];
Data: TYPE ~ REF DataRep;
DataRep: TYPE ~ RECORD[
p: PersistentVariables ← [], -- persistent variables
np: NonPersistentVariables ← [], -- non-persistent variables other than T, font, color, clipper
clientToView: Transformation ← NIL, -- current client-to-view transformation ("T")
clientToViewID: CARD ← 0, -- unique id for contents of clientToView transformation
lastID: CARD ← 0, -- last value used for clientToViewID
font: Font ← NIL, -- current font ("showVec")
color: Color ← NIL, -- current color
clipper: Clipper ← NIL, -- current clipping outline
devicePath: ImagerScanConverter.DevicePath ← NIL, -- scratch storage for scan converter
viewToDeviceValid: BOOLFALSE,
viewClipperValid: BOOLFALSE,
clientToDeviceValid: BOOLFALSE,
clientClipperValid: BOOLFALSE,
charToDeviceValid: BOOLFALSE,
deviceColorValid: BOOLFALSE,
devicePriorityValid: BOOLFALSE,
viewToDeviceEasy: BOOLFALSE, -- valid iff viewToDeviceValid
clientToDeviceEasy: BOOLFALSE, -- valid iff clientToDeviceValid
viewToDevice: Transformation ← NIL, -- always valid
clientToDevice: Transformation ← NIL, -- valid iff clientToDeviceValid
charToDevice: Transformation ← NIL, -- valid iff charToDeviceValid
viewOrigin: IVEC ← [0, 0], -- valid iff viewToDeviceValid AND viewToDeviceEasy
clientOrigin: IVEC ← [0, 0], -- valid iff clientToDeviceValid AND clientToDeviceEasy
viewClipMask: ManhattanPolygon ← NIL, -- device coords; always valid
clientClipMask: ManhattanPolygon ← NIL, -- device coords; valid iff clientClipperValid
viewClipBox: DeviceRectangle ← [0, 0, 0, 0], -- device coords; valid iff viewClipperValid
clientClipBox: DeviceRectangle ← [0, 0, 0, 0], -- device coords; valid iff clientClipperValid
device: ImagerDevice.Device ← NIL -- a particular raster device
];
CreateData: PROC[ImagerDevice.Device] RETURNS[Data];
END.