ImagerRasterPrivate.mesa
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Michael Plass, June 26, 1985 7:12:59 pm PDT
Doug Wyatt, February 17, 1986 3:31:23 pm PST
Private definitions used by ImagerRasterImpl.
DIRECTORY
Basics USING [BITAND, BITNOT, BITOR],
Imager USING [Context],
ImagerCache USING [Ref],
ImagerDevice USING [CharMask, Device],
ImagerFont USING [Font, XChar, XStringProc],
ImagerFontPrivate USING [FontAtom],
ImagerManhattan USING [Polygon],
ImagerRaster USING [FontTuner],
ImagerScanConverter USING [DevicePath],
ImagerState USING [State],
ImagerTransformation USING [Transformation],
SF USING [Box];
ImagerRasterPrivate: CEDAR DEFINITIONS
IMPORTS Basics
~ BEGIN
Context: TYPE ~ Imager.Context;
Device: TYPE ~ ImagerDevice.Device;
CharMask: TYPE ~ ImagerDevice.CharMask;
Box: TYPE ~ SF.Box;
nullBox: Box ~ [min: [0, 0], max: [0, 0]];
DevicePath: TYPE ~ ImagerScanConverter.DevicePath;
FontAtom: TYPE ~ ImagerFontPrivate.FontAtom;
Transformation: TYPE ~ ImagerTransformation.Transformation;
ManhattanPolygon: TYPE ~ ImagerManhattan.Polygon;
Font: TYPE ~ ImagerFont.Font;
XChar: TYPE ~ ImagerFont.XChar;
XStringProc: TYPE ~ ImagerFont.XStringProc;
Flags: TYPE ~ RECORD[
clientToDevice: BOOLFALSE, -- clientToDevice is valid
clientClipper: BOOLFALSE, -- clientClipMask and clientClipBox are valid
fontInfo: BOOLFALSE, -- charToDevice and fontAtom are valid
deviceColor: BOOLFALSE, -- color last set by SetColor[device, ...] is valid
devicePriority: BOOLFALSE, -- priority last set by SetPriority[device, ...] is valid
unused: [0..3777B] ← 0
];
noFlags: Flags ~ [];
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: Box ← nullBox, -- device coords; always valid
clientToDevice: Transformation ← NIL, -- valid iff valid.clientToDevice
clientClipMask: ManhattanPolygon ← NIL, -- device coords; valid iff valid.clientClipper
clientClipBox: Box ← nullBox, -- device coords; valid iff valid.clientClipper
clientClipBoxOnly: BOOLFALSE, -- client clipper is equal to clientClipBox; valid iff valid.clientClipper
specialClipPresent: BOOLFALSE, -- Used by ImagerOpsImpl
specialClipBox: Box ← nullBox, -- 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: Box, mask: ManhattanPolygon, action: PROC[Box]];
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.