PPreView.mesa
Copyright Ó 1989, 1990, 1992 by Xerox Corporation. All rights reserved.
Pier, January 3, 1991 2:45 pm PST
This should be considered a Private interface. See PreViewClient.mesa for public uses. This interface ties together PreViewTool and PreViewImpl, which would be one module if the compiler could handle a module of that size.
DIRECTORY
BasicTime, BiScrollers, Commander, Containers, Imager, ImagerColor, ImagerPixelArray, InterpressInterpreter, RasterEncodingStandardIO, Real, Rope, Sliders, ViewerClasses;
PPreView: CEDAR DEFINITIONS = BEGIN
bsStyle: BiScrollers.BiScrollerStyle;
SwitchRange: TYPE = CHAR['A..'Z];
Switches: TYPE = PACKED ARRAY SwitchRange OF BOOLEAN;
FileType: TYPE = {none, ip, ais, res, any};
Data: TYPE = REF Rep;
Rep: TYPE = RECORD [
fileNames: NameList ¬ NIL,
xSize: REAL ¬ 0.0,
ySize: REAL ¬ 0.0,
mustBe: FileType ¬ any,
fileInfo: FileInfo ¬ NIL,
container: Containers.Container ¬ NIL,
preViewer: ViewerClasses.Viewer ¬ NIL,
clientPaint: ViewerClasses.PaintProc ¬ NIL, -- allow client use of Preview functions
clientData: REF ANY ¬ NIL,  -- passed to clientPaint as whatChanged
selectionWViewer, selectionHViewer: ViewerClasses.Viewer ¬ NIL,
pageNumberViewer: ViewerClasses.Viewer ¬ NIL,
pageNumberSlider: Sliders.Slider ¬ NIL,
pageNumber: INTEGER ¬ 1,
lastPageNumber: INTEGER ¬ 1,
pageInMem: INTEGER ¬ 0,-- which page is in iMemContext.
iMemContext: Imager.Context ¬ NIL, -- an ImagerMemory context
pageHeight, pageWidth: REAL ¬ 0.0,
bBox: BBoxState ¬ NIL,
abort: BOOLEAN ¬ FALSE,
painting: BOOLEAN ¬ FALSE,
switches: Switches ¬ ALL[FALSE],
stuffWithBorders: BOOLEAN ¬ FALSE,
stuffWithFit: BOOLEAN ¬ FALSE,
kind: SELECT type: FileType FROM
none => [],
ip => [ipMaster: InterpressInterpreter.Master ¬ NIL],
ais => [state: AISState ¬ NIL],
res => [image: RasterEncodingStandardIO.RES],
ENDCASE
];
IPData: TYPE = REF ip Rep;
AISData: TYPE = REF ais Rep;
RESData: TYPE = REF res Rep;
FileInfo: TYPE = REF FileInfoRep;
FileInfoRep: TYPE = RECORD [
filetype: FileType ¬ none,
fullFName: Rope.ROPE ¬ NIL,
created: BasicTime.GMT ¬ BasicTime.nullGMT,
ref: REF ANY ¬ NIL
];
AISState: TYPE = REF AISStateRep;
AISStateRep: TYPE = RECORD [
openFile: AIS.FRef ← NIL,
op: ImagerColor.ColorOperator ¬ NIL,
pa: ImagerPixelArray.PixelArray ¬ NIL,
scans, pixels: NAT ¬ 0, --lines per page, pixels per line
active: BOOL ¬ FALSE
];
BBoxState: TYPE = REF BBoxStateRep;
BBoxStateRep: TYPE = RECORD [
active:    BOOL ¬ FALSE,      -- was there ever a mouse down?
p0, p1:    Imager.VEC ¬ [0.0, 0.0],    -- the min and max (x,y) points
rect, prev:   Imager.Rectangle ¬ [0, 0, 0, 0], -- current and previous bounding boxes
x0, x1, y0, y1, all: BOOL ¬ FALSE,      -- corner, edge, or all picked by user?
origin:    Imager.VEC ¬ [0.0, 0.0]    -- intial mouse down point
];
BBoxOp: TYPE = {stuff, ipMaster};
NameList: TYPE = LIST OF Rope.ROPE;
PaintOp: TYPE = {paint, remove, change};
DoFileOps: PROC [op: BBoxOp, viewer: ViewerClasses.Viewer, data: Data, fileName: Rope.ROPE, clip: BOOL ¬ TRUE];
ResetProcess: PROC [data: Data];
PVFeedback: PROC [data: Data, v: ViewerClasses.Viewer, op: PaintOp ¬ paint];
PVNotify: ViewerClasses.NotifyProc;
PVPaint: ViewerClasses.PaintProc;
PVDestroy: ViewerClasses.DestroyProc;
PVGetName: ViewerClasses.GetProc;
PVBasicTransformProc: BiScrollers.TransformGenerator;
PVExtremaProc: BiScrollers.ExtremaProc;
PVListRemove: PROC [ref: REF ANY];
IPLogError: InterpressInterpreter.LogProc;
IPPreView: Commander.CommandProc;
RESPreView: Commander.CommandProc;
AISPreView: Commander.CommandProc;
AnyPreView: Commander.CommandProc;
END.