CharDisplays.Mesa
Last Edited by: Spreitzer, March 13, 1985 0:23:10 am PST
DIRECTORY IO, Rope, ViewerClasses;
CharDisplays: CEDAR DEFINITIONS = {
ROPE: TYPE = Rope.ROPE;
Viewer: TYPE = ViewerClasses.Viewer;
CharDisplay: TYPE = REF CharDisplayRep;
CharDisplayRep: TYPE = RECORD [
class: CharDisplayClass,
det: DisplayDetails,
name: ROPE,
viewer: Viewer ← NIL,
fromDisplay: IO.STREAMNIL,
line, col: INT ← 0,
modes: Modes,
otherInstanceData: REF ANYNIL];
DisplayDetails: TYPE = RECORD [
lines: NAT ← 24,
columns: NAT ← 80,
autoMargins: BOOLTRUE];
CharDisplayClass: TYPE = REF CharDisplayClassRep;
CharDisplayClassRep: TYPE = RECORD [
name: ROPE,
Init: PROC [cd: CharDisplay, initData: REF ANY],
DeleteChar: PROC [cd: CharDisplay],
TakeChar: PROC [cd: CharDisplay, char: CHAR],
CursorMove: PROC [cd: CharDisplay, line, col: INT, relative: BOOLFALSE, doLine, doCol: BOOLTRUE],
Line: PROC [cd: CharDisplay, insert: BOOL],
Insert/Delete
ClearTo: PROC [cd: CharDisplay, where: Where],
ClearAll: PROC [cd: CharDisplay],
SetMode: PROC [cd: CharDisplay, mode: Mode, on: BOOL],
Emphasize: PROC [cd: CharDisplay, emph: Emph, on: BOOL],
Apply to char at cursor
Flash: PROC [cd: CharDisplay]
];
Where: TYPE = {EndOfLine, EndOfScreen};
Mode: TYPE = {insertChar, underline, standout};
Modes: TYPE = ARRAY Mode OF BoolDefaultsFalse;
BoolDefaultsFalse: TYPE = BOOLFALSE;
Emph: TYPE = Mode[underline .. standout];
EmphOp: TYPE = {add, subtract, set};
GetClass: PROC [name: ROPE] RETURNS [cdc: CharDisplayClass];
RegClass: PROC [cdc: CharDisplayClass];
Create: PROC [class: CharDisplayClass, name: ROPENIL, det: DisplayDetails ← [], initData: REF ANYNIL] RETURNS [cd: CharDisplay];
Split: PROC [l: CharDisplayList, name: ROPENIL] RETURNS [s: CharDisplay];
CharDisplayList: TYPE = LIST OF CharDisplay;
}.