IIBackdoor.mesa
Copyright © 1984, 1985, 1986 by Xerox Corporation. All rights reserved.
Doug Wyatt, April 21, 1985 3:45:00 pm PST
Michael Plass, December 10, 1986 12:03:53 pm PST
DIRECTORY
II USING [Color, SpecialColor, Context, Font, Outline, PathProc, Rectangle, Transformation, VEC];
Access to imager variables
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, oddWrap, 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.
Coordinate Systems and Transformations
CoordSys:
TYPE ~ {client, view, surface, device};
Note: In device coordinates, s ~ x and f ~ y.
TransformPoint:
PROC [context: Context, p:
VEC, from, to: CoordSys]
RETURNS [
VEC];
TransformVec:
PROC [context: Context, v:
VEC, from, to: CoordSys]
RETURNS [
VEC];
GetTransformation:
PROC [context: Context, from, to: CoordSys]
RETURNS [Transformation];
Makes a new Transformation; use IITransformation.Destroy, if appropriate, to save allocations.
View Operations
ViewReset:
PROC [context: Context];
ViewClip:
PROC [context: Context, path: PathProc, oddWrap, 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];
Visibility: TYPE ~ {none, part, all};
TestViewRectangle:
PROC [context: Context, x, y, w, h:
INTEGER]
RETURNS [Visibility];
MoveViewRectangle: PROC [context: Context, width, height, fromX, fromY, toX, toY: INTEGER];
Other Utilities
invert: READONLY SpecialColor;
MakeStipple: PROC [stipple: WORD, xor: BOOL ← FALSE] RETURNS [SpecialColor];
MaskBits:
PROC [context: Context, base:
LONG
POINTER, wordsPerLine:
NAT,
sMin, fMin, sSize, fSize:
NAT, tx, ty:
INTEGER ← 0];
Provided for compatibility with earlier Imager releases.
[base, wordsPerLine, sMin, fMin, sSize, fSize] describes a raw raster;
a scan mode of [slow~down, fast~right] is assumed for the raster
[tx, ty] is the position in client coordinates at which to place the upper left corner of the raster
DrawBits:
PROC [context: Context, base:
LONG
POINTER, wordsPerLine:
NAT,
sMin, fMin, sSize, fSize:
NAT, tx, ty:
INTEGER ← 0];
Analogous to MaskBits, but zero bits become white and one bits become black, regardless of the current color.
ClientFromView:
PROC [context: Context, p:
VEC]
RETURNS [
VEC]
~ INLINE {RETURN [TransformPoint[context: context, p: p, from: view, to: client]]};
ViewFromClient:
PROC [context: Context, p:
VEC]
RETURNS [
VEC]
~ INLINE {RETURN [TransformPoint[context: context, p: p, from: client, to: view]]};
ViewFromDevice:
PROC [context: Context, p:
VEC]
RETURNS [
VEC]
~ INLINE {RETURN [TransformPoint[context: context, p: p, from: device, to: view]]};
DeviceFromView:
PROC [context: Context, p:
VEC]
RETURNS [
VEC]
~ INLINE {RETURN [TransformPoint[context: context, p: p, from: view, to: device]]};
ClientFromDevice:
PROC [context: Context, p:
VEC]
RETURNS [
VEC]
~ INLINE {RETURN [TransformPoint[context: context, p: p, from: device, to: client]]};
DeviceFromClient:
PROC [context: Context, p:
VEC]
RETURNS [
VEC]
~ INLINE {RETURN [TransformPoint[context: context, p: p, from: client, to: device]]};