PSPrivate.mesa
Copyright Ó 1986, 1987 by Xerox Corporation. All rights reserved.
Doug Wyatt, April 1, 1987 6:01:46 pm PST
DIRECTORY
PS,
IO USING [STREAM],
Random USING [RandomStream],
Rope USING [ROPE];
PSPrivate: CEDAR DEFINITIONS
~ BEGIN OPEN PS;
AnyRep: TYPE ~ RECORD [
executable: BOOL,
variant: SELECT type: TypeCode FROM
null => [],
integer => [int: INT],
real => [real: REAL],
boolean => [bool: BOOL],
array => [access: Access, start, length: ArrayIndex, base: ArrayBase],
string => [access: Access, start, length: StringIndex, base: StringBase],
name => [atom: ATOM],
dict => [base: DictBase],
operator => [name: ROPE, proc: OperatorProc],
file => [access: Access, stream: STREAM],
mark => [],
save => [level: Level],
font => [font: Font],
ENDCASE
];
Any: TYPE ~ RECORD [val: Val, ref: REF];
Val: TYPE ~ RECORD [
executable: BOOL,
variant: SELECT type: TypeCode FROM
null => [],
integer => [int: INT],
real => [real: REAL],
boolean => [bool: BOOL],
array => [access: Access, start, length: ArrayIndex], -- , ref: ArrayRef
string => [access: Access, start, length: StringIndex], -- , ref: StringRef
name => [], -- ref: NameRef
dict => [], -- ref: DictRef
operator => [name: Rope.ROPE, proc: OperatorProc],
file => [access: Access], -- , ref: FileRef
mark => [],
save => [level: Level],
font => [font: Font],
ENDCASE
];
StringRef: TYPE ~ REF TEXT;
FileRef: TYPE ~ IO.STREAM;
NameRef: TYPE ~ ATOM;
ArrayRef: TYPE ~ REF ArrayRep;
ArrayRep: TYPE ~ RECORD [SEQUENCE maxLength: ArrayIndex OF Any];
DictRef: TYPE ~ REF DictRep;
DictRep: TYPE ~ RECORD [
access: Access,
maxLength: INT,
length: INT,
lengthLimit: INT,
data: REF DictSeq
];
DictSeq: TYPE ~ RECORD [nodes: SEQUENCE max: NAT OF DictNode];
DictNode: TYPE ~ REF DictNodeRep;
DictNodeRep: TYPE ~ RECORD [key: Any, val: Any, next: DictNode];
Stack: TYPE ~ REF StackRep;
StackRep: TYPE ~ RECORD [
base: ArrayRef,
count, size: ArrayIndex
];
RootRep: TYPE ~ RECORD [
stack: ArrayRef,
stackCount: INT,
stackSize: INT,
dstack: LIST OF Dict,
stdin, stdout, stderr: File,
random: Random.RandomStream,
graphics: GState
];
Matrix: TYPE ~ RECORD [a, b, c, d, tx, ty: REAL];
Path: TYPE ~ LIST OF PathPoint;
PathPointType: TYPE ~ {move, line, curve, close};
PathPoint: TYPE ~ RECORD [type: PathPointType, point: VEC];
LineCap: TYPE ~ MACHINE DEPENDENT {butt(0), round(1), square(2)};
LineJoin: TYPE ~ MACHINE DEPENDENT {miter(0), round(1), bevel(2)};
Device: TYPE ~ REF DeviceRep;
DeviceRep: TYPE ~ RECORD [
defaultMatrix: Matrix,
defaultClipPath: Path,
impl: REF DeviceImplRep
];
DeviceImplRep: TYPE;
Color: TYPE ~ REF ColorRep;
ColorRep: TYPE;
GState: TYPE ~ REF GStateRep;
GStateRep: TYPE ~ RECORD [
CTM: Matrix,
color: Color,
path: Path,
clipPath: Path,
font: Dict,
lineWidth: REAL,
lineCap: LineCap,
lineJoin: LineJoin,
screenFrequency: REAL,
screenAngle: REAL,
screenProc: Array,
transfer: Array,
flatness: REAL,
miterLimit: REAL,
dashArray: Array,
dashOffset: REAL,
device: Device,
rest: GState
];
Transform: PROC [m: Matrix, p: VEC] RETURNS [VEC];
DTransform: PROC [m: Matrix, d: VEC] RETURNS [VEC];
ITransform: PROC [m: Matrix, p: VEC] RETURNS [VEC];
IDTransform: PROC [m: Matrix, d: VEC] RETURNS [VEC];
END.