ImagerBackdoor.mesa
Copyright © 1984, 1985, 1986 by Xerox Corporation. All rights reserved.
Doug Wyatt, March 20, 1986 2:39:27 pm PST
DIRECTORY
ImagerColor USING [SpecialColor],
Imager USING [Color, 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
};
RealKey: TYPE ~ { -- for SetReal, GetReal
DCScpx, DCScpy,
mediumXSize, mediumYSize,
fieldXMin, fieldYMin, fieldXMax, fieldYMax,
strokeWidth,
underlineStart,
amplifySpace,
correctShrink,
correctMX, correctMY,
correctTX, correctTY
};
Clipper: TYPE ~ LIST OF ClipperItem; -- for SetClipper, GetClipper
ClipperItem: TYPE ~ RECORD [outline: Outline, 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, oddWrap, 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
SpecialColor: TYPE ~ ImagerColor.SpecialColor;
invert: READONLY SpecialColor;
MakeStipple: PROC [stipple: WORD, xor: BOOLFALSE] RETURNS [SpecialColor];
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.