SilDisplayInternal.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Tracy Larrabee: March 29, 1984 1:10:35 pm PST
Last Edited by: Ken Pier, August 16, 1985 4:59:28 pm PDT
A module allowing for the shared use of an opaque type definition by all of the display modules: SilDisplay, SilDisplayCursors, and SilDisplayUtils.
DIRECTORY
Rope USING [ROPE],
ImagerFont USING [Font],
Imager USING [Transformation],
SilFile,
SilUserInput,
ViewRec USING [RecordViewer]
;
SilDisplayInternal: CEDAR DEFINITIONS = BEGIN
ROPE: TYPE = Rope.ROPE;
This is the concrete representation of an opaque type defined in SilKernel. The SilDisplayDataRec contains state that the Display modules needs to operate.
SilDisplayDataRec: TYPE = MONITORED RECORD [
Information about the state of the Rebuilder
needRebuild: BOOLFALSE,
inRebuild: BOOLFALSE,
selectedOnly: BOOLFALSE,
rebuildMinX, rebuildMinY: INTEGER,
rebuildMaxX, rebuildMaxY: INTEGER,
rebuildStage: RebuildStage,
currentFgndObj: SilFile.SilObject ← NIL, --current foreground object
currentBkgndObj: SilFile.SilObject ← NIL, --current background object
Information about the tic marks:
ticSpacing: INTEGER ← defaultTicSpacing,
ticsOn: BOOLFALSE,
framesOn: BOOLFALSE,
Information about the transform from Sil coordinates to Client coordinates:
Client Coords = (Sil Coords + offset) * scale
xScale = gridMagnification,
yScale = - gridMagnification,
xOffset, yOffset: REAL ← 0.0,
magnificationOn: BOOLFALSE,
trans: Imager.Transformation,
Was the last box we drew one that will interact with a new box?
lastBoxLeftToRight: BOOLFALSE,
lastBoxTopToBottom: BOOLFALSE,
lastBoxPointX: INTEGER,
lastBoxPointY: INTEGER,
What happens to input Characters?
mode: InputCharMode ← WaitingToInputRope,
collectingObject: SilFile.SilObjectRec,
collectingText: REF TEXT,
collectingFileName: REF TEXT,
clipOutputFile: BOOLTRUE, -- after collecting an output file name, clip to alto size?
largeFormat: BOOLFALSE, -- us standard AltoSil file format or new large file format?
relativeInput: BOOLFALSE, -- put objects at (0,0) origin or at (MarkX, MarkY) origin
oldText: ROPE,
If we are confirming a macro def, what is its name?
macroDefName: CHAR,
If we are making a PD file, what device is it for?
pdDev: DeviceType ← raven300,
currentFontRef: ImagerFont.Font,
Details about this Sil reported in the command line
currentGridSpacing: NAT ← SilUserInput.defaultGridSpacing,
currentBoxWidth: NAT ← defaultBoxWidth,
currentMagnification: NAT ← defaultMagnification,
currentFont: SilFile.UserFonts ← defaultFont,
currentBoldState: BOOL ← defaultBoldState,
currentItalicState: BOOL ← defaultItalicState,
currentOneLevel: BOOLFALSE,
yLock: BOOL ← defaultYLock,
currentColor: SilFile.Color ← defaultColor,
currentNumObjectsSelected: NAT ← 0,
yInc: INTEGER ← defaultYInc,
viewRec: ViewRec.RecordViewer,
commandLine: REF ANY,
edited: BOOLFALSE --TRUE if display edited since file read in
];
CommandChange: TYPE = {Grid, LineWidth, Mag, Font, Bold, Italic, Color, MacExpand, Ylock, Selections, Pos, PosX, PosY};
Defaults for various Sil values - the current values of which are used in the record, above.
defaultTicSpacing: NAT = 16;
defaultGrid: NAT = 4;
defaultBoxWidth: NAT = 1;
defaultMagnification: NAT = 1;
defaultColor: NAT = 0;
defaultFont: NAT = 0;
defaultItalicState: BOOL = FALSE;
defaultBoldState: BOOL = FALSE;
defaultOneLevel: BOOL = FALSE;
defaultYLock: BOOL = FALSE;
defaultYInc: NAT = 0;
Screen parameters which are used to determine appropriate magnification or clipping on output.
AltoScreenWidth: INTEGER = 606;
AltoScreenLength: INTEGER = 808;
maxMagnification: INTEGER = 9;
RebuildStage: TYPE = {Background, SelectedBackground, Foreground, SelectedForeground};
DeviceType: TYPE = {nil, raven300, raven384, plateMaker, reticleMaker, puffin, versatec, colorVersatec, spare1, spare2, spare3}; --copy of ImagerPD.DeviceType, but we don't want "clients" to use ImagerPD interface
At all times Sil will be in one of the below modes. Most of the time it will be "WaitingToInputRope". The current state is saved in the monitored record, above.
InputCharMode: TYPE = {
WaitingToInputRope, InputingRope, EditingExistingRope,
InputingInputFileName, EditingExistingInputFileName,
InputingOutputFileName, EditingExistingOutputFileName,
InputingHardFileName, EditingExistingHardFileName, -- HardFile means HardcopyFile, not DifficultFile
WaitingForKillConfirmation, WaitingForMacroDefConfirmation,
WaitingForMacroDeleteConfirmation};
END.