TypeScript.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Edited by Paxton on January 4, 1983 2:31 pm
Last Edited by: Maxwell, January 5, 1983 9:57 am
Last Edited by: Teitelman, January 10, 1983 1:09 pm
Michael Plass, March 21, 1985 3:03:37 pm PST
Doug Wyatt, March 3, 1985 10:38:20 am PST
DIRECTORY
Rope USING [ROPE],
ViewerClasses USING [Viewer, ViewerRec];
TypeScript: CEDAR DEFINITIONS
= BEGIN
Creating and destroying typescripts
TS: TYPE = ViewerClasses.Viewer;
Create: PROC [info: ViewerClasses.ViewerRec, paint: BOOLTRUE] RETURNS [ts: TS];
IsATypeScript: PROC [ts: TS] RETURNS [yes: BOOL];
Destroy: PROC [ts: TS];
Destroys typescript viewer and related data structures
Reset: PROC [ts: TS];
Erases all the typescript text data and clears the screen.
Output to typescript
PutChar: PROC [ts: TS, char: CHAR];
PutRope: PROC [ts: TS, rope: Rope.ROPE];
PutText: PROC [ts: TS, text: REF READONLY TEXT,
start: NAT ← 0, stopPlusOne: NATLAST[NAT]];
BackSpace: PROC [ts: TS, count: INT ← 1];
Delete character(s) from end of ts.
ChangeLooks: PROC [ts: TS, look: CHAR];
look char in 'a..'z means add that look
in 'A..'Z means remove
blank means remove all looks
GetLooks: PROC [ts: TS] RETURNS [looks: Rope.ROPE];
Following echoed chars will not have any looks.
Input from typescript
GetChar: PROC [ts: TS] RETURNS [char: CHAR];
CharsAvailable: PROC [ts: TS] RETURNS [BOOL];
RETURNS TRUE if no chars waiting.
TypeIn: PROC [ts: TS, input: REF ANY];
Simulate user typein to a typescript
can be REF CHAR, ROPE, REF TEXT, or ATOM (be careful).
InsertRopeAtFrontOfBuffer: PROC [ts: TS, rope: Rope.ROPE];
This will be the next thing read, even if there are characters waiting in the input buffer.
InsertCharAtFrontOfBuffer: PROC [ts: TS, char: CHAR];
Synchronization
Flush: PROC [ts: TS];
This won't return until echo buffer has been emptied and all chars inserted in ts. (done automatically by BackSpace, AddLooks, and ClearLooks)'
WaitUntilIdle: PROC [ts: TS];
This won't return until input buffer has been emptied and input process is waiting in GetChar for more characters.
WaitUntilCharsAvail: PROC [ts: TS];
This won't return until a character is available to GetChar.
Errors
Destroyed: ERROR [ts: TS];
END.