ImagerRasterPrivate.mesa
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Michael Plass, June 26, 1985 7:12:59 pm PDT
Doug Wyatt, May 30, 1985 11:13:12 pm PDT
Private definitions used by ImagerRasterImpl.
DIRECTORY
Basics USING [BITAND, BITNOT, BITOR],
Imager USING [Context],
ImagerCache USING [Ref],
ImagerDevice USING [CharMask, Device, DeviceBox],
ImagerFont USING [Font, XChar, XStringProc],
ImagerFontPrivate USING [FontAtom],
ImagerManhattan USING [DeviceRectangle, Polygon],
ImagerRaster USING [FontTuner],
ImagerScanConverter USING [DevicePath],
ImagerState USING [State],
ImagerTransformation USING [Transformation];
ImagerRasterPrivate: CEDAR DEFINITIONS
IMPORTS Basics
~ BEGIN
Context: TYPE ~ Imager.Context;
Device: TYPE ~ ImagerDevice.Device;
DeviceBox: TYPE ~ ImagerDevice.DeviceBox;
CharMask: TYPE ~ ImagerDevice.CharMask;
DevicePath: TYPE ~ ImagerScanConverter.DevicePath;
FontAtom: TYPE ~ ImagerFontPrivate.FontAtom;
Transformation: TYPE ~ ImagerTransformation.Transformation;
ManhattanPolygon: TYPE ~ ImagerManhattan.Polygon;
DeviceRectangle: TYPE ~ ImagerManhattan.DeviceRectangle;
Font: TYPE ~ ImagerFont.Font;
XChar: TYPE ~ ImagerFont.XChar;
XStringProc: TYPE ~ ImagerFont.XStringProc;
Flags:
TYPE ~
RECORD[
clientToDevice: BOOL ← FALSE, -- clientToDevice is valid
clientClipper: BOOL ← FALSE, -- clientClipMask and clientClipBox are valid
fontInfo: BOOL ← FALSE, -- charToDevice and fontAtom are valid
deviceColor: BOOL ← FALSE, -- color last set by SetColor[device, ...] is valid
devicePriority: BOOL ← FALSE, -- priority last set by SetPriority[device, ...] is valid
unused: [0..3777B] ← 0
];
OrFlags:
PROC[f1, f2: Flags]
RETURNS[Flags] ~
INLINE {
RETURN[LOOPHOLE[Basics.BITOR[LOOPHOLE[f1], LOOPHOLE[f2]]]];
};
AndFlags:
PROC[f1, f2: Flags]
RETURNS[Flags] ~
INLINE {
RETURN[LOOPHOLE[Basics.BITAND[LOOPHOLE[f1], LOOPHOLE[f2]]]];
};
NotFlags:
PROC[f: Flags]
RETURNS[Flags] ~
INLINE {
RETURN[LOOPHOLE[Basics.BITNOT[LOOPHOLE[f]]]];
};
FontCache:
TYPE ~ ImagerCache.Ref;
charArraySize: NAT ~ 128;
CharArrayIndex: TYPE ~ NAT[0..charArraySize);
CharArray: TYPE ~ REF CharArrayRep;
CharArrayRep:
TYPE ~
ARRAY CharArrayIndex
OF CharMask;
Data: TYPE ~ REF DataRep;
DataRep:
TYPE ~
RECORD[
device: Device ← NIL, -- a particular raster device
charArray: CharArray ← NIL, -- local cache of recently used characters
fontCache: FontCache ← NIL,
rastWeight: REAL ← 0.0, -- bigger values favor bitmaps in the cache.
fontTuner: ImagerRaster.FontTuner ← NIL,
devicePath: DevicePath ← NIL, -- scratch storage for scan converter
valid: Flags ← [],
viewToDevice: Transformation ← NIL, -- always valid
viewClipMask: ManhattanPolygon ← NIL, -- device coords; always valid
viewClipBox: DeviceRectangle ← [0, 0, 0, 0], -- device coords; always valid
clientToDevice: Transformation ← NIL, -- valid iff valid.clientToDevice
clientClipMask: ManhattanPolygon ← NIL, -- device coords; valid iff valid.clientClipper
clientClipRect: DeviceRectangle ← [0, 0, 0, 0], -- device coords; valid iff valid.clientClipper
clientClipBox: DeviceBox ← [0, 0, 0, 0], -- device coords; valid iff valid.clientClipper
clientClipBoxOnly: BOOL ← FALSE, -- client clipper is equal to clientClipBox; valid iff valid.clientClipper
specialClipPresent: BOOL ← FALSE, -- Used by ImagerOpsImpl
specialClipRect: DeviceRectangle ← [0, 0, 0, 0], -- device coords; valid iff specialClipPresent
maskToDevice: Transformation ← NIL, -- scratch storage for MaskBits and MaskPixel
fontAtom: FontAtom ← NIL, -- valid iff valid.fontInfo
charToDevice: Transformation ← NIL -- valid iff valid.fontInfo
];
NoteStateChanges:
PROC [data: Data, state: ImagerState.State];
ValidateIfNeeded:
PROC [data: Data, state: ImagerState.State, needs: Flags];
ClipBoxToMask:
PROC [box: DeviceBox, mask: ManhattanPolygon, action:
PROC[DeviceBox]];
RasterShow:
PROC [context: Context, string: XStringProc, xrel:
BOOL];
BasicShowChar:
PROC [context: Context, font: Font, char: XChar,
checkBB:
BOOL, imaging:
BOOL, fontTuner: ImagerRaster.FontTuner ←
NIL];
ShowCharacterMask:
PROC [data: Data, mask: CharMask, s:
INTEGER, f:
INTEGER];
RasterShowText:
PROC [context: Context, text:
REF
READONLY
TEXT, start, len:
NAT, xrel:
BOOL];
END.