TypeScript.mesa
Copyright Ó 1985, 1986, 1991 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, October 22, 1991 5:13 pm PDT
DIRECTORY
Rope USING [ROPE],
Tioga USING [Looks, CharSet, PropList],
ViewerClasses USING [Viewer, ViewerRec];
TypeScript: CEDAR DEFINITIONS
= BEGIN
Creating and destroying typescripts
TS: TYPE = ViewerClasses.Viewer;
Create: PROC [info: ViewerClasses.ViewerRec, paint: BOOL ¬ TRUE] 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: NAT ¬ LAST[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
Looks: TYPE ~ Tioga.Looks;
CharSet: TYPE ~ Tioga.CharSet;
PropList: TYPE ~ Tioga.PropList;
ModifyLooks: PROC [ts: TS, remove, add: Looks];
SetLooks: PROC [ts: TS, looks: Looks];
GetLooks: PROC [ts: TS] RETURNS [Looks];
SetCharSet: PROC [ts: TS, charSet: CharSet];
GetCharSet: PROC [ts: TS] RETURNS [CharSet];
SetCharProps: PROC [ts: TS, charProps: PropList];
GetCharProps: PROC [ts: TS] RETURNS [PropList];
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.