ImagerBackdoor.mesa
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Doug Wyatt, April 21, 1985 3:45:00 pm PST
DIRECTORY
Imager USING [Color, ConstantColor, Context, Font, Outline, PathProc, Rectangle, Transformation, VEC];
ImagerBackdoor: CEDAR DEFINITIONS
~ BEGIN OPEN Imager;
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: BOOLFALSE];
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: BOOLFALSE] 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.
Bitmaps
Bitmap: TYPE ~ REF BitmapRep;
BitmapRep: TYPE ~ RECORD [
ref: REF,
base: LONG POINTER,
wordsPerLine: NAT,
width, height: NAT
];
NewBitmap: PROC [width, height: NAT] RETURNS [Bitmap];
BitmapContext: PROC [bitmap: Bitmap] RETURNS [Context];
View Operations
ViewReset: PROC [context: Context];
ViewClip: PROC [context: Context, path: PathProc, parity, exclude: BOOLFALSE];
ViewClipRectangleI: PROC [context: Context, x, y, w, h: INTEGER, exclude: BOOLFALSE];
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: BOOLFALSE] 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];
END.