<> <> TerminalMultiplex: DEFINITIONS = BEGIN << This interface provides a facility for multiplexing virtual terminals on a single physical terminal. The interface is designed for an arbitrary (but fixed) number of virtual terminals and is intended to be used to support debugging of new versions of terminal-handling code. This multiplexing facility has the following primary features:>> <<1) The human user at the keyboard can swap between two particular virtual terminals (the "primary" and the "alternate") by a particular key combination (control-shift-shift). (This is equivalent to an implicit call of SelectTerminal[]; see below.)>> <<2) A client program can select which virtual terminal is to be connected to the physical terminal, and can prevent a change of virtual terminal by clients or the user.>> <<3) Clients may register procedures that the multiplexor will invoke whenever the virtual-to-physical terminal correspondance changes.>> TerminalDesired: TYPE = {primary, alternate, special, swap}; Terminal: TYPE = TerminalDesired[primary..special]; SelectTerminal: PROC [terminal: TerminalDesired _ swap, lock: BOOL _ FALSE] RETURNS [worked: BOOL]; <> CurrentTerminal: PROC RETURNS[terminal: Terminal, lockCount: NAT, debuggerLockCount: NAT]; <> PreventSwaps, PermitSwaps: PROC; <> PreventDebuggerSwaps, PermitDebuggerSwaps: PROC; <> InputAction: TYPE = {enable, disable}; InputController: TYPE = PROC [action: InputAction]; RegisterInputController: PROC [InputController]; <> UnregisterInputController: PROC RETURNS [InputController]; <> SwapAction: TYPE = {coming, going}; TerminalSwapNotifier: TYPE = PROC [action: SwapAction]; RegisterNotifier: PROC [TerminalSwapNotifier]; <> UnregisterNotifier: PROC [TerminalSwapNotifier]; <> END.