DIRECTORY
Imager USING [Color, ConstantColor, Context, Font, Outline, PathProc, Rectangle, Transformation, VEC];
Access to imager variables
Not all Contexts implement these. To be device-independent, clients should avoid them.
IntKey:
TYPE ~ {
-- for SetInt, GetInt
priorityImportant,
noImage,
strokeEnd,
strokeJoint,
correctPass,
int1, int2, int3 -- spares
};
RealKey:
TYPE ~ {
-- for SetReal, GetReal
DCScpx, DCScpy,
mediumXSize, mediumYSize,
fieldXMin, fieldYMin, fieldXMax, fieldYMax,
strokeWidth,
underlineStart,
amplifySpace,
correctShrink,
correctMX, correctMY,
correctTX, correctTY,
real1, real2, real3 -- spares
};
Clipper: TYPE ~ LIST OF ClipperItem; -- for SetClipper, GetClipper
ClipperItem:
TYPE ~
RECORD [outline: Outline, parity, exclude:
BOOL ←
FALSE];
SetInt: PROC [context: Context, key: IntKey, val: INT];
SetReal: PROC [context: Context, key: RealKey, val: REAL];
SetT: PROC [context: Context, m: Transformation];
SetClipper: PROC [context: Context, clipper: Clipper];
GetInt: PROC [context: Context, key: IntKey] RETURNS [INT];
GetReal: PROC [context: Context, key: RealKey] RETURNS [REAL];
GetT: PROC [context: Context] RETURNS [Transformation];
GetFont: PROC [context: Context] RETURNS [Font];
GetColor: PROC [context: Context] RETURNS [Color];
GetClipper: PROC [context: Context] RETURNS [Clipper];
GetCP:
PROC [context: Context, rounded:
BOOL ←
FALSE]
RETURNS [
VEC];
Returns, in client coordinates, the current position.
If rounded~TRUE, first rounds the position to the nearest device grid point.
GetBounds:
PROC [context: Context]
RETURNS [Rectangle];
Returns, in client coordinates, a bounding rectangle for the composite clipping outline.
View Operations
ViewReset:
PROC [context: Context];
ViewClip:
PROC [context: Context, path: PathProc, parity, exclude:
BOOL ←
FALSE];
ViewClipRectangleI:
PROC [context: Context, x, y, w, h:
INTEGER, exclude:
BOOL ←
FALSE];
coordinates relative to current view origin
ViewTranslateI:
PROC [context: Context, x, y:
INTEGER];
ClientFromView: PROC [context: Context, p: VEC] RETURNS [VEC];
ViewFromClient: PROC [context: Context, p: VEC] RETURNS [VEC];
ViewFromDevice: PROC [context: Context, p: VEC] RETURNS [VEC];
DeviceFromView: PROC [context: Context, p: VEC] RETURNS [VEC];
MoveViewRectangle: PROC [context: Context,
width, height, fromX, fromY, toX, toY: INTEGER];
Visibility:
TYPE ~ {none, part, all};
TestViewRectangle:
PROC [context: Context, x, y, w, h:
INTEGER]
RETURNS [Visibility];
Other Utilities
invert: READONLY ConstantColor;
MakeStipple: PROC [stipple: WORD, xor: BOOL ← FALSE] RETURNS [Color];
DrawBits: PROC [context: Context, base: LONG POINTER, wordsPerLine: NAT,
sMin, fMin, sSize, fSize: NAT, tx, ty: INTEGER ← 0];
DoIfVisible:
PROC [context: Context, r: Rectangle, action:
PROC];
Calls action iff the rectangle specified by r might be visible.
ClientFromDevice: PROC [context: Context, p: VEC] RETURNS [VEC];
DeviceFromClient: PROC [context: Context, p: VEC] RETURNS [VEC];