ImagerInterpress.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Doug Wyatt, October 18, 1985 6:21:01 pm PDT
Michael Plass, June 7, 1985 1:16:42 pm PDT
Imager clients can use this interface to create Interpress masters.
DIRECTORY
Imager USING [Color, ColorOperator, Context, Font, PixelArray],
IO USING [STREAM],
Rope USING [ROPE];
ImagerInterpress: CEDAR DEFINITIONS
~ BEGIN
Ref: TYPE ~ REF Rep;
Create:
PROC [fileName: Rope.
ROPE, header: Rope.
ROPE ←
NIL]
RETURNS [Ref];
Creates a file with the given name.
If header=NIL, a header of "Interpress/Xerox/3.0 " is supplied.
CreateFromStream:
PROC [stream:
IO.
STREAM, header: Rope.
ROPE]
RETURNS [Ref];
Retruns a handle aimed at stream; header is inserted verbatim at beginning.
DeclareFont:
PROC [self: Ref, font: Imager.Font];
Includes a Font in the preamble.
DeclareColor:
PROC [self: Ref, color: Imager.Color];
Includes a Color in the preamble.
DeclarePixelArray:
PROC [self: Ref, pixelArray: Imager.PixelArray];
Includes a PixelArray in the preamble.
DeclareColorOperator:
PROC [self: Ref, colorOperator: Imager.ColorOperator];
Includes a ColorOperator in the preamble.
DoPage:
PROC [self: Ref, action:
PROC [Imager.Context], scale:
REAL ← 1.0];
Calls action to generate the next page.
Close:
PROC [self: Ref];
Finishes the master and closes the underlying stream.
Finish:
PROC [self: Ref];
Finishes the master without closing the underlying stream.
The following provide hooks for getting a context that behaves in the way that ImagerPress and ImagerViewer behave:
GetContext:
PROC [self: Ref]
RETURNS [Imager.Context];
This procedure creates a context into which the imager calls do thier actions. You must call NewPage with last TRUE for the last page and before the Master is closed.
NewPage:
PROC [self: Ref, context: Imager.Context, last:
BOOL]
;
This causes a new page to be written into the master. It must be called with last TRUE on the last page of the master.
END.