-- CGDevice.mesa
-- Last changed by Doug Wyatt, September 20, 1982 4:42 pm

DIRECTORY
CGMatrix USING [Ref],
GraphicsBasic USING [Box, Color, PaintMode, Trap];

CGDevice: CEDAR DEFINITIONS = { OPEN GraphicsBasic;

Generator: TYPE = PROC[showTrap: PROC[Trap], showBox: PROC[Box]];

Fill: TYPE = RECORD[color: Color, mode: PaintMode, fat: BOOLEAN];

PixelArray: TYPE = RECORD [
scanLength, scanCount: NAT, -- width and height
bitsPerSample: [0..16), -- bits per array sample
baseAddress: LONG POINTER, -- starting address for array
wordsPerLine: CARDINAL -- words per line for array
];

Ref: TYPE = REF Rep;
Rep: TYPE = RECORD [
GetMatrix: PROC[self: Ref] RETURNS[CGMatrix.Ref],
GetBounds: PROC[self: Ref] RETURNS[Box],
ShowConst: PROC[self: Ref, gen: Generator, fill: Fill],
ShowArray: PROC[self: Ref, gen: Generator,
color: Color, source: PixelArray, map: CGMatrix.Ref,
mode: PaintMode ← opaque],
ShowMask: PROC[self: Ref, gen: Generator,
color: Color, mask: PixelArray, map: CGMatrix.Ref,
invert: BOOLEANFALSE],
GetRaster: PROC[self: Ref] RETURNS[base: LONG POINTER, raster: CARDINAL],
MoveBlock: PROC[self: Ref, width, height, fromX, fromY, toX, toY: NAT] ← NIL,
data: REF ANY];

}.