PreView.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Last edited by Ken Pier; May 15, 1986 9:57:28 am PDT
Doug Wyatt, June 7, 1986 1:51:29 pm PDT
Bland, August 28, 1986 4:25:10 pm PDT
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
AIS USING [FRef],
BasicTime USING [GMT, nullGMT],
BiScrollers USING [BiScrollerStyle, TransformGenerator, ExtremaProc],
Containers USING [Container],
GriffinImageUtils USING [GriffinImage],
Imager USING [Context, VEC, Rectangle],
ImagerColorOperator USING [ColorOperator],
ImagerPixelArray USING [PixelArray],
Interpress USING [LogProc, Master],
PDFileReader USING [Handle],
PDImageReader USING [Handle, ImageLink],
Real USING [LargestNumber],
Rope USING [ROPE],
ShowPress USING [Handle],
Sliders USING [Slider],
ViewerClasses USING [Viewer, NotifyProc, PaintProc, DestroyProc, GetProc];
PreView: CEDAR DEFINITIONS = BEGIN
bsStyle: BiScrollers.BiScrollerStyle;
SwitchRange: TYPE = CHAR['A..'Z];
Switches: TYPE = PACKED ARRAY SwitchRange OF BOOLEAN;
FileType: TYPE = {none, press, pd, ip, ais, griffin};
Data: TYPE = REF Rep;
Rep: TYPE = RECORD [
fileInfo: FileInfo ← NIL,
container: Containers.Container ← NIL,
preViewer: 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: BOOLEANFALSE,
process: UNSAFE PROCESSNIL,
switches: Switches ← ALL[FALSE],
stuffWithBorders: BOOLEANFALSE,
stuffWithFit: BOOLEANFALSE,
kind: SELECT type: FileType FROM
none => [],
press => [presshandle: ShowPress.Handle ← NIL],
pd => [
atImage: PDImageReader.ImageLink ← NIL, --set by ResetToImage
pageStructure: PDImageReader.ImageLink ← NIL, --set by GetPageStructure
pdhandle: PDFileReader.Handle ← NIL,
image: PDImageReader.Handle ← NIL,
scaleFactors: Imager.VEC ← [x: 1.0, y: 1.0],
scalePD: BOOLEANTRUE
],
ip => [ipMaster: Interpress.Master ← NIL],
ais => [state: AISState ← NIL],
griffin => [image: GriffinImageUtils.GriffinImage],
ENDCASE
];
PressData: TYPE = REF press Rep;
PDData: TYPE = REF pd Rep;
IPData: TYPE = REF ip Rep;
AISData: TYPE = REF ais Rep;
GData: TYPE = REF griffin Rep;
FileInfo: TYPE = REF FileInfoRep;
FileInfoRep: TYPE = RECORD [
filetype: FileType ← none,
fullFName: Rope.ROPENIL,
created: BasicTime.GMT ← BasicTime.nullGMT,
ref: REF ANYNIL
];
AISState: TYPE = REF AISStateRep;
AISStateRep: TYPE = RECORD [
openFile: AIS.FRef ← NIL,
op: ImagerColorOperator.ColorOperator ← NIL,
pa: ImagerPixelArray.PixelArray ← NIL,
scans, pixels: NAT ← 0, --lines per page, pixels per line
active: BOOLFALSE
];
BBoxState: TYPE = REF BBoxStateRep;
BBoxStateRep: TYPE = RECORD [
active: BOOLFALSE,
rect: Imager.Rectangle ← [0.0,0.0,0.0,0.0], -- actual bounding rectangle for clipping
mode: BBoxMode ← waitingForFirstPoint, -- mode for responding to mouse
lastX, lastY: REAL ← Real.LargestNumber, -- most recent point acquired from NotifyProc
x0, y0: REAL ← 0.0-- first point acquired from NotifyProc
];
BBoxMode: TYPE = {waitingForFirstPoint, waitingForSecondPoint};
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: BOOLTRUE];
ResetProcess: PROC [data: Data];
PVFeedback: PROC [data: Data, v: ViewerClasses.Viewer, x, y: REAL ← 0.0, 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: Interpress.LogProc;
END.