CharDisplays.Mesa
Copyright Ó 1992 by Xerox Corporation. All rights reserved.
Last Edited by: Spreitzer, February 19, 1986 9:02:41 pm PST
Last tweaked by Mike Spreitzer on April 4, 1990 9:52:01 am PDT
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,
name, tipTableName: ROPE,
det: DisplayDetails,
client: Client,
viewer: Viewer ¬ NIL,
fromDisplay: IO.STREAM ¬ NIL,
line, col: INT ¬ 0,
emphs: Emphs,
otherInstanceData: REF ANY ¬ NIL];
DisplayDetails: TYPE = RECORD [
lines: NAT ¬ 24,
columns: NAT ¬ 80,
autoMargins, scrolls: BOOL ¬ TRUE,
autoMarginsVariable, scrollsVariable: BOOL ¬ FALSE];
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 = BOOL ¬ FALSE;
EmphOp: TYPE = {add, subtract, set};
Client: TYPE ~ REF ClientRep;
ClientRep: TYPE ~ RECORD [
InitiateChangeDetails: PROC [Client, CharDisplay, DisplayDetails] RETURNS [BOOL],
Either does it (including call on ChangeDetails) and returns TRUE, or doesn't and returns FALSE.
clientData: REF ANY ¬ NIL];
GetClass: PROC [name: ROPE] RETURNS [cdc: CharDisplayClass];
RegClass: PROC [cdc: CharDisplayClass];
EnumerateClasses: PROC [PROC [CharDisplayClass]];
unchangeableClient: Client;
Create: PROC [class: CharDisplayClass, client: Client, name, tipTableName: ROPE ¬ NIL, det: DisplayDetails ¬ [], initData: REF ANY ¬ NIL] RETURNS [cd: CharDisplay];
Split: PROC [l: CharDisplayList, client: Client, name: ROPE ¬ NIL] RETURNS [s: CharDisplay];
CharDisplayList: TYPE = LIST OF CharDisplay;
}.