-- CGDummyDeviceImpl.mesa
-- Last changed by Doug Wyatt, August 31, 1982 6:46 pm

DIRECTORY
CGArea USING [Empty, Ref, Remove],
CGDummyDevice USING [], -- exports only
CGDevice USING [Ref, Rep],
CGMatrix USING [New, Ref],
CGSource USING [Ref],
CGStorage USING [qZone],
GraphicsBasic USING [Box, Trap];

CGDummyDeviceImpl: CEDAR PROGRAM
IMPORTS CGArea, CGMatrix, CGStorage
EXPORTS CGDummyDevice = {
OPEN Area: CGArea, Matrix: CGMatrix, Source: CGSource,
CGDevice, GraphicsBasic;

repZone: ZONE = CGStorage.qZone;

ref: Ref ← repZone.NEW[Rep ← [
GetMatrix: GetMatrix, GetBounds: GetBounds, Show: Show,
GetRaster: GetRaster, data: NIL]];

Get: PUBLIC PROC[] RETURNS[Ref] = { RETURN[ref] };

matrix: Matrix.Ref ← Matrix.New[];

GetMatrix: PROC[self: Ref] RETURNS[Matrix.Ref] = { RETURN[matrix] };

GetBounds: PROC[self: Ref] RETURNS[Box] = {
RETURN[[xmin: 0, ymin: 0, xmax: 1, ymax: 1]];
};

GetRaster: PROC[self: Ref] RETURNS[LONG POINTER,CARDINAL] = {
RETURN[NIL,0];
};

Show: PROC[self: Ref, area: Area.Ref, src: Source.Ref, map: Matrix.Ref] = {
UNTIL Area.Empty[area] DO
trap: Trap ← Area.Remove[area];
ENDLOOP;
};

}.