SimpleDisplays.mesa
Copyright © 1990 by Xerox Corporation. All rights reserved.
Norman Adams, March 4, 1990 3:28 pm PST
Spreitze, April 3, 1990 1:47 pm PDT
Last tweaked by Mike Spreitzer on April 4, 1990 12:20:05 pm PDT
DIRECTORY IO, ViewerClasses, CharDisplays;
SimpleDisplays: CEDAR DEFINITIONS = {
FlushModeType: TYPE = { FlushOnBlock, FlushOnScroll, FlushOnChangeCount };
SimpleDisplayState: TYPE = REF SimpleDisplayStateRep;
SimpleDisplayStateRep: TYPE = MONITORED RECORD [
paintDone: CONDITION,
sdvData: REF ANY,  -- viewers client data
topViewer, aViewer: ViewerClasses.Viewer,
theLines: REF LinesRep,
-- In control of flushing accumulated changed to the display
flushMode: FlushModeType ← FlushOnBlock,
changeCount: INT ← 0,  -- how many changes since last flush
changeCountLimit: INT ← 250, -- flush after this many changes
out: IO.STREAM,   -- transcript
logging: BOOLEANFALSE,
driver: IO.STREAM,  -- UnixFileDescriptorStream of the Unix fd where
   -- plumb get characters to write to the screen
emphs: CharDisplays.Emphs,
hasSomeEmphasis: BOOLEANFALSE,
debugChars: BOOLEANFALSE,
debugCM: BOOLEANFALSE,
debugOps: BOOLEANFALSE,
debugScroll: BOOLEANFALSE,
debugViewers: BOOLEANFALSE,
debugEmph: BOOLEANFALSE
];
LinesRep: TYPE = RECORD [
SEQUENCE count: NATURAL OF REF LineRep
];
ModificationType: TYPE = { new, unchanged, insert1, delete1, over1, tail };
LineRep: TYPE = RECORD [
hasSomeEmphasis: BOOLEANFALSE,
emphs: REF LineEmphsRep,
chars: REF TEXT,
modified: ModificationType ← new,
relativeScreenPosition: INT ← 0,
screenLine: INT ← 0,
tailStartColumn: INT ← 0
];
LineEmphsRep: TYPE = RECORD [
SEQUENCE count: NATURAL OF CharDisplays.Emphs
];
SimpleDisplaysViewer:
PROC [sd: SimpleDisplayState, cd: CharDisplays.CharDisplay]
RETURNS [v: ViewerClasses.Viewer, fromD: IO.STREAM];
LogTranscriptLine: PROC [sd: SimpleDisplayState, chars: REF TEXT];
SDChangeDetails: PROC [cd: CharDisplays.CharDisplay, new: CharDisplays.DisplayDetails];
ResizeTerminal: PROC [ cd: CharDisplays.CharDisplay, sd: SimpleDisplayState, r,c: INT ];
}.