<<>> <> <> <> <> <> 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 ]; }.