<<>> <> <> <> <> <> 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: BOOLEAN ¬ FALSE, driver: IO.STREAM, -- UnixFileDescriptorStream of the Unix fd where << -- plumb get characters to write to the screen>> emphs: CharDisplays.Emphs, hasSomeEmphasis: BOOLEAN ¬ FALSE, debugChars: BOOLEAN ¬ FALSE, debugCM: BOOLEAN ¬ FALSE, debugOps: BOOLEAN ¬ FALSE, debugScroll: BOOLEAN ¬ FALSE, debugViewers: BOOLEAN ¬ FALSE, debugEmph: BOOLEAN ¬ FALSE ]; LinesRep: TYPE = RECORD [ SEQUENCE count: NATURAL OF REF LineRep ]; ModificationType: TYPE = { new, unchanged, insert1, delete1, over1, tail }; LineRep: TYPE = RECORD [ hasSomeEmphasis: BOOLEAN ¬ FALSE, 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 ]; }.