IPOperatorOut.mesa
Last edited by Andy Shore, January 30, 1983 5:18 pm
Last edited by Doug Wyatt, March 2, 1983 10:59 am
This module provides the Interpress 2.0 Operator Interface
(see Introduction to Interpress chapter 7)
For many cases, the user must appeal to the lower-level Literal Interface on which this is based. IPEncodingOut is the literal interface.
DIRECTORY
IPEncodingOut USING [Handle, AppendInteger, AppendOp, AppendRational, AppendReal],
IPVariables USING [FrameVariable, ImagerVariable, StrokeEnd],
Rope USING [MaxLen, ROPE];
IPOperatorOut: CEDAR DEFINITIONS
IMPORTS IPEncodingOut, Rope = BEGIN
Handle: TYPE = RECORD[ip: IPEncodingOut.Handle];
Number: TYPE = RECORD [SELECT type: NumberType FROM
integer => [value: INT],
rational => [i, j: INT],
real => [value: REAL],
ENDCASE];
NumberType: TYPE = {integer, rational, real};
int: PROCEDURE [v: INT] RETURNS [Number] = INLINE {RETURN [[integer[v]]]};
real: PROCEDURE [v: REAL] RETURNS [Number] = INLINE {RETURN [[real[v]]]};
rational: PROCEDURE [i, j: INT] RETURNS [Number] = INLINE {RETURN [[rational[i, j]]]};
Master Creation
BeginMaster: PROCEDURE [name: Rope.ROPE] RETURNS [ip: Handle];
opens file stream and writes header and BEGIN
ERRORS: Error[FileNotAvailable];
EndMaster: PROCEDURE [ip: Handle];
writes END and closes stream
Body Builders (2.5.4)
LeftBrace, BeginPreamble, BeginPage, BeginBody: PROCEDURE [ip: Handle] = INLINE {ip.AppendOp[beginBody];};
RightBrace, EndPreamble, EndPage, EndBody: PROCEDURE [ip: Handle] = INLINE {ip.AppendOp[endBody];};
Vectors (2.4.3)
Get: PROCEDURE [ip: Handle, n: INT];
MakeVec: PROCEDURE [ip: Handle, n: INT];
MakeVecLU: PROCEDURE [ip: Handle, l, u : INT];
Frames (2.4.4)
FGet: PROCEDURE [ip: Handle, n: IPVariables.FrameVariable];
FSet: PROCEDURE [ip: Handle, x: Number, n: IPVariables.FrameVariable];
Body Operators (2.4.5, 2.4.7, 4.10)
BeginMakeSimpleCO: PROCEDURE [ip: Handle];
EndMakeSimpleCO: PROCEDURE [ip: Handle];
BeginDoSaveSimpleBody: PROCEDURE [ip: Handle];
EndDoSaveSimpleBody: PROCEDURE [ip: Handle];
BeginCorrect: PROCEDURE [ip: Handle];
EndCorrect: PROCEDURE [ip: Handle];
BeginIf: PROCEDURE [ip: Handle];
EndIf: PROCEDURE [ip: Handle];
BeginIfElse: PROCEDURE [ip: Handle];
EndIfElse: PROCEDURE [ip: Handle];
BeginIfCopy: PROCEDURE [ip: Handle];
EndIfCopy: PROCEDURE [ip: Handle];
Imager State (4.2)
IGet: PROCEDURE [ip: Handle, n: IPVariables.ImagerVariable];
ISet: PROCEDURE [ip: Handle, x: Number, n: IPVariables.ImagerVariable];
SetStrokeWidth: PROCEDURE [ip: Handle, width: Number];
SetStrokeEnd: PROCEDURE [ip: Handle, end: IPVariables.StrokeEnd];
SetAmplifySpace: PROCEDURE [ip: Handle, amplify: Number];
SetPriorityImportant: PUBLIC PROCEDURE [ip: Handle, on: BOOLEANFALSE];
Transformations (4.4)
Translate: PROCEDURE [ip: Handle, x, y: Number, concatT: BOOLEANTRUE];
Rotate: PROCEDURE [ip: Handle, alpha: Number, concatT: BOOLEANTRUE];
Scale: PROCEDURE [ip: Handle, s: Number, concatT: BOOLEANTRUE];
Scale2: PROCEDURE [ip: Handle, sx, sy: Number, concatT: BOOLEANTRUE];
Show: PROCEDURE [ip: Handle, text: Rope.ROPENIL, start: INT ← 0, len: INT ← Rope.MaxLen];
Current Position (4.5)
SetXY: PROCEDURE [ip: Handle, x, y: Number];
SetXYRel: PROCEDURE [ip: Handle, x, y: Number];
SetXRel: PROCEDURE [ip: Handle, x: Number];
SetYRel: PROCEDURE [ip: Handle, y: Number];
PushCP: PROCEDURE [ip: Handle]; -- save DCScpx and DCScpy on stack
PopCP: PROCEDURE [ip: Handle]; -- restore DCScpx and DCScpy from stack
Color (4.7)
SetGray: PROCEDURE [ip: Handle, f: Number];
Masks (4.8)
MoveTo: PROCEDURE [ip: Handle, x, y: Number];
LineTo: PROCEDURE [ip: Handle, x, y: Number];
LineToX: PROCEDURE [ip: Handle, x: Number];
LineToY: PROCEDURE [ip: Handle, y: Number];
MaskRectangle: PROCEDURE [ip: Handle, x, y, w, h: Number];
StartUnderline: PROCEDURE [ip: Handle] = INLINE {ip.AppendOp[startunderline];};
MaskUnderline: PROCEDURE [ip: Handle, dy, h: Number];
MaskVector: PROCEDURE [ip: Handle, x1, y1, x2, y2: Number];
Character Operators (4.9)
SetFont: PROCEDURE [ip: Handle, font: IPVariables.FrameVariable];
Corrected Masks (4.10)
CorrectSpace: PROCEDURE [ip: Handle, x, y: Number];
SetCorrectMeasure: PROCEDURE [ip: Handle, x, y: Number];
SetCorrectTolerance: PROCEDURE [ip: Handle, x, y: Number];
Space: PROCEDURE [ip: Handle, x: Number];
PushAndDisableCorrection: PROCEDURE [ip: Handle];
PopAndRestoreCorrection: PROCEDURE [ip: Handle];
Other Nice Functions
SetUpFont: PROCEDURE [ip: Handle, fontNumber: IPVariables.FrameVariable, name: Rope.ROPE, scale: Number, rotation: Number ← int[0], putInFrame: BOOLEANTRUE];
AppendHierarchicalName: PROCEDURE [ip: Handle, name: Rope.ROPE, start: INT ← 0, len: INT ← Rope.MaxLen];
change id1/id2/... to [id1 id2 ...] n MAKEVEC
AppendNumber: PROCEDURE [ip: Handle, v: Number] = INLINE {
WITH v SELECT FROM
integer => ip.AppendInteger[value];
rational => ip.AppendRational[i, j];
real => ip.AppendReal[value];
ENDCASE;
};
NumberIsZero: PROCEDURE [n: Number] RETURNS [BOOLEAN];
Full Interpress Extensions
CurveTo: PROCEDURE [ip: Handle, x1, y1, x2, y2, x3, y3: Number];
Error: ERROR [errorCode: ErrorCode];
ErrorCode: PUBLIC TYPE = {FileNotAvailable};
END.
Change Log
Created by Shore; August 24, 1982 10:18 am
Changed by Shore; September 16, 1982 2:05 pm
Changed procedures to INLINE where possible
Changed by Shore; September 24, 1982 2:37 pm
made changes suggested by Sproull
Changed by Shore; November 11, 1982 2:33 pm
change to Cedar.Style and added node styles
Changed by Shore; January 19, 1983 3:48 pm
changed to CEDAR, Interpress 2.0, and new node styles
Changed by Wyatt; March 2, 1983 10:59 am
added CurveTo