CharDisplays.Mesa
Last Edited by: Spreitzer, February 19, 1986 9:02:41 pm PST
DIRECTORY IO, Rope, ViewerClasses;
CharDisplays: CEDAR DEFINITIONS = {
ROPE: TYPE = Rope.ROPE;
Viewer: TYPE = ViewerClasses.Viewer;
DisplayDestroyed: ERROR [cd: CharDisplay];
CharDisplay: TYPE = REF CharDisplayRep;
CharDisplayRep: TYPE = RECORD [
class: CharDisplayClass,
det: DisplayDetails,
name: ROPE,
viewer: Viewer ← NIL,
fromDisplay: IO.STREAMNIL,
line, col: INT ← 0,
emphs: Emphs,
otherInstanceData: REF ANYNIL];
DisplayDetails: TYPE = RECORD [
lines: NAT ← 24,
columns: NAT ← 80,
autoMargins, scrolls: BOOLTRUE,
autoMarginsVariable, scrollsVariable: BOOLFALSE];
CharDisplayClass: TYPE = REF CharDisplayClassRep;
CharDisplayClassRep: TYPE = RECORD [
name: ROPE,
Init: PROC [cd: CharDisplay, initData: REF ANY],
ChangeDetails: PROC [cd: CharDisplay, new: DisplayDetails],
DeleteChar: PROC [cd: CharDisplay],
TakeChar: PROC [cd: CharDisplay, char: CHAR, insert: BOOL --← FALSE--],
CursorMove: PROC [cd: CharDisplay, line, col: INT, relative: BOOL --← FALSE--, doLine, doCol: BOOL --← TRUE--],
Line: PROC [cd: CharDisplay, insert: BOOL],
Insert/Delete
ClearTo: PROC [cd: CharDisplay, where: Where],
ClearAll: PROC [cd: CharDisplay],
SetEmph: PROC [cd: CharDisplay, emph: Emph, on: BOOL],
Emphasize: PROC [cd: CharDisplay, emph: Emph, on: BOOL],
Apply to char at cursor
SetFont: PROC [cd: CharDisplay, font: ROPE],
Beep: PROC [cd: CharDisplay],
Flush: PROC [cd: CharDisplay] ← NIL,
Notifes display that nothing more will be done to it for a while.
Flush may be falsely called, but must be called when it becomes true.
Destroyed: PROC [cd: CharDisplay] RETURNS [BOOL]
];
SimplyChange: PROC [cd: CharDisplay, new: DisplayDetails];
Where: TYPE = {EndOfLine, EndOfScreen};
Emph: TYPE = {underline, bold, italic, inverse};
Emphs: TYPE = ARRAY Emph OF BoolDefaultsFalse;
BoolDefaultsFalse: TYPE = BOOLFALSE;
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;
}.