newImagerOps.mesa
ImagerOps: CEDAR DEFINITIONS
= BEGIN
State: TYPE = REF StateRep;
StateRep: TYPE = RECORD[
persistent variables
for DCScpx, DCScpy, use GetViewCP/SetViewCP
correctMX, correctMY: REAL, -- line measure
correctMaskCount: INT, -- tally CORRECTMASK calls
correctMaskX, correctMaskY: REAL, -- space to be taken up by CORRECTMASK calls
correctSumX, correctSumY: REAL, -- tally adjustable space from CORRECTSPACE calls
correctSpaceX, correctSpaceY: REAL, -- space to be taken up by CORRECTSPACE calls
correctcpx, correctcpy: REAL, -- current position at start of CORRECT
correctTargetX, correctTargetY: REAL, -- where corrected text should end up
non-persistent variables
for T, use GetT/SetT
for clipOutline, use GetClipper/SetClipper
showVec: REF, -- IP.Vector
color: Color,
priorityImportant: INT,
mediumXSize, mediumYSize: REAL, -- in meters
fieldXMin, fieldYMin, fieldXMax, fieldYMax: REAL, -- in meters
noImage: INT,
strokeWidth: REAL,
strokeEnd: INT,
underlineStart: REAL,
amplifySpace: REAL,
correctPass: INT,
correctShrink: REAL, -- allowable space shrink
correctTX, correctTY: REAL -- line tolerance
];
initialStateRep: StateRep = [
correctMX: 0, correctMY: 0,
correctMaskCount: 0,
correctMaskX: 0, correctMaskY: 0,
correctSumX: 0, correctSumY: 0,
correctSpaceX: 0, correctSpaceY: 0,
correctcpx: 0, correctcpy: 0,
correctTargetX: 0, correctTargetY: 0,
showVec: NIL,
color: NIL,
priorityImportant: 0,
mediumXSize: 0, mediumYSize: 0,
fieldXMin: 0, fieldYMin: 0, fieldXMax: 0, fieldYMax: 0,
noImage: 0,
strokeWidth: 0,
strokeEnd: 0,
underlineStart: 0,
amplifySpace: 1.0,
correctPass: 0,
correctShrink: 0.5,
correctTX: 0, correctTY: 0
];
GetState: PROC[context: Context] RETURNS[State];
Returns a reference to the above state variables of the context
GetT: PROC [context: Context] RETURNS [Transformation];
SetT: PROC [context: Context, m: Transformation];
Get and Set the client-to-view transformation
GetViewCP: PROC [context: Context] RETURNS [Pair];
SetViewCP: PROC [context: Context, cp: Pair];
GetCP: PROC [context: Context] RETURNS [Pair];
GetCPRounded: PROC [context: Context] RETURNS [Pair];
GetColor: PROC [context: Context] RETURNS [Color];
[[what about sampled colors, which bind a transformation to device coords?]]
Class record definition.
ClassRep: TYPE = RECORD [
deviceType: ATOM,
Init: PROC [context: Context, name: ROPE, bounds: IntRectangle],
GetViewCP: PROC[context: Context] RETURNS[Pair],
SetViewCP: PROC[context: Context, value: Pair],
GetT: PROC[context: Context] RETURNS[Transformation],
SetT: PROC[context: Context, value: Transformation],
GetClipper: PROC[context: Context] RETURNS[Clipper],
SetClipper: PROC[context: Context, value: Clipper],
GetColor: PROC[context: Context] RETURNS[Color],
SetColor: PROC[context: Context, value: Color],
ConcatT: PROC [context: Context, transformation: Transformation],
TranslateT: PROC [context: Context, dx, dy: REAL],
MaskFill: PROC [context: Context, path: PathClosure],
MaskStroke: PROC [context: Context, path: PathClosure, width: REAL, strokeEnds: StrokeEnds, closed: BOOL],
MaskPixel: PROC [context: Context, pixelArray: PixelArray],
MaskRectangle: PROC [context: Context, area: Rectangle],
MaskIntRectangle: PROC [context: Context, area: IntRectangle],
MaskThinStroke: PROC [context: Context, path: PathClosure, closed: BOOL],
MaskBits: PROC [context: Context, base: LONG POINTER, raster: CARDINAL, tile: IntRectangle, area: IntRectangle],
MaskChar: PROC [context: Context, font: FONT, char: CHAR],
MaskCharacters: PROC [context: Context, font: FONT, characters: REF, start: INT, length: INT],
GetCP: PROC [context: Context] RETURNS [Pair],
SetCP: PROC [context: Context, p: Pair, relative: BOOL],
DoSave: PROC [context: Context, action: PROC, all: BOOL],
ClipOutline: PROC [context: Context, outline: PathClosure, exclude: BOOL],
ClipRectangle: PROC [context: Context, outline: Rectangle, exclude: BOOL],
TestRectangle: PROC [context: Context, area: Rectangle] RETURNS [Visibility],
DoWithoutClipping: PROC [context: Context, bounds: IntRectangle, callBack: PROC[Context]],
Reset: PROC [context: Context] ← NIL,
SetView: PROC [context: Context, box: IntRectangle, halftoneOrigin: IntPair] ← NIL,
ClipView: PROC [context: Context, box: IntRectangle, exclude: BOOL] ← NIL,
GetSurfaceBounds: PROC [context: Context] RETURNS [IntRectangle] ← NIL,
GetViewBounds: PROC [context: Context] RETURNS [IntRectangle] ← NIL,
MoveSurfaceRectangle: PROC [context: Context, source: IntRectangle, dest: IntPair] RETURNS [BOOL] ← NIL,
SetColorInvert: PROC [context: Context] ← NIL,
DrawBitmap: PROC [context: Context, base: LONG POINTER, raster: CARDINAL, area: IntRectangle] ← NIL,
SpecialOp: PROC [context: Context, op: ATOM, data: REF] RETURNS [BOOL] ← NIL
];
RegisterDevice: PROC[class: REF ClassRep];
END.