SimpleTerminal.mesa
Copyright Ó 1985, 1986 by Xerox Corporation. All rights reserved.
Levin on September 22, 1983 12:21 pm
Doug Wyatt, February 27, 1985 10:22:06 am PST
DIRECTORY
IO USING [STREAM],
Process USING [Ticks],
Rope USING [ROPE];
SimpleTerminal: CEDAR DEFINITIONS
= BEGIN
ROPE: TYPE ~ Rope.ROPE;
STREAM: TYPE ~ IO.STREAM;
Ticks: TYPE ~ Process.Ticks;
TurnOn:
PROC [nameStripe:
ROPE ←
NIL]
RETURNS [in, out:
STREAM];
This procedure sets up a virtual terminal and initializes it for typescript-style I/O. The virtual terminal remains in use until TurnOff is called, at which time the screen reverts to its original state. If "nameStripe" is NIL, the implementation supplies a rope that includes the system version and build date. Note that the streams returned are extremely simple; the input stream offers no editing, comment filtering, or echoing to the output stream. The client is free to layer these features on top using the IO interface.
TurnOff:
PROC;
This procedure undoes the effect of TurnOn.
SetInputTimeout:
PROC [ticks: Ticks];
This procedure alters the semantics of IO.GetChar as applied to the input stream returned by TurnOn. If a call on GetChar waits for the specified interval without receiving input, it will raise InputTimeout. Resuming this signal is equivalent to calling GetChar anew. If the parameter is 0, GetChar will wait indefinitely (this is the initial state).
DisableCursorTracking:
PROC;
... increments a counter that controls cursor tracking.
Disables the cursor tracking process if the old count was zero.
EnableCursorTracking:
PROC;
... decrements (if greater than zero) a counter that controls cursor tracking.
Enables the cursor tracking process if the new count is zero.
END.