DIRECTORY IO USING [STREAM, Value], Rope USING [ROPE]; TerminalIO: CEDAR DEFINITIONS = BEGIN CreateStream: PROC [] RETURNS [stream: IO.STREAM]; PutRope: PROC [text: Rope.ROPE]; PutRopes: PROC [t1, t2, t3: Rope.ROPE_NIL]; PutF: PROC [format: Rope.ROPE _ NIL, v1, v2, v3, v4, v5: IO.Value _ [null[]]]; PutF1: PROC [format: Rope.ROPE _ NIL, value: IO.Value _ [null[]]]; UserAbort: SIGNAL; TimeOut: SIGNAL; RequestRope: PROC [prompt: Rope.ROPE_NIL, timeOut: NAT_0] RETURNS [Rope.ROPE]; RequestInt: PROC [prompt: Rope.ROPE _ NIL, timeOut: NAT_0] RETURNS [INT]; Confirm: PROC [text: Rope.ROPE, help: Rope.ROPE_NIL, timeOut: NAT _ 0, dontLog: BOOL_FALSE] RETURNS [BOOL]; RequestSelection: PROC [ header: Rope.ROPE _ NIL, choice: LIST OF Rope.ROPE, headerDoc: Rope.ROPE _ NIL, choiceDoc: LIST OF Rope.ROPE _ NIL, default: NAT _ 0, timeOut: NAT _ 0, position: REF _ NIL, dontLog: BOOL _ FALSE ] RETURNS [INT]; AddLock: PRIVATE PROC [lock, free: PROC]; END. zTerminalIO.mesa Copyright c 1983, 1985, 1986 by Xerox Corporation. All rights reserved. Created by: Christian Jacobi, August 3, 1983 9:54 am Last edited by: Christian Jacobi, October 23, 1986 12:48:45 pm PDT Sequential IO for "terminal and keyboard" All processes share one log viewer. Output may be delayed while input is pending. Don't use procedures from inside a viewers-repaint or a TIP-notify procedure. Output Output must not overwhelm the user: the user must be able to recognize an output line made by a different application. Output made in form of lines simplifies the recognition of the output source. It is also a good idea to follow the input convention for outputs. Creates an output stream which writes its output into the log viewer. This procedure is lightweight; the viewer is only created when output is done. No signals or errors are raised, neither on call nor on sequential output. Short cuts Input In order to allow different applications to share this package in an orderly fashion, (one that will not confuse users) clients must follow the convention below: Do not require input except as immediate response to an user action. Requests user to type in a rope. May raise UserAbort and TimeOut. prompt: NIL is ok, but others are better. timeOut: in seconds; 0 for no timeout [the user can always abort]. Shortcut; calls RequestRope and converts rope to integer Requests user for confirmation; defaults to FALSE timeOut: in seconds; 0 for no timeout dontLog: prevent loging in viewer and log file Shows a pop-up menu and returns the number of the selected entry. returns: 1 for first choice, 2 for second... 0 if selected outside menu or on header-line -1 if timed out header: Header text; can not be selected. choice: List of possible selections. headerDoc: Documentation shown if selection is on header or outside menu. choiceDoc: Documentation for the corresponding choice. default: Hint for initial selection by implicit mouse movement. 0 if no default. timeOut: In seconds; 0 for no time out. position: Hint to override mouse position. See documentation for possible types. dontLog: prevent loging in viewer and log file There might be a maximum number of choices, see documentation. USE WITH CARE. Procedures tell client module whether some input is in progress. This is typically used to diplay a different cursor, so the user sees that input is required. The lock procedure is a hint, do not rely on it. The client procedures are called in a monitored way; they must be fast and not cause any wedge. Do not make assumptions about the order of calls. The registered procedures can not be removed, use only one per client. Κ/˜codešœ™Kšœ Οmœ=™HKšœ5™5K™BK˜—šΟk œ˜ Kšžœžœžœ˜Kšœžœžœ˜—K˜šΟn œžœž œž˜%K™—šœ*™*Kšœ#™#Kšœ-™-KšœM™MK™—K™™K™IK™JK™RK™"K˜—š Ÿ œžœžœ žœžœ˜2KšœE™EK™NK™KK˜—K˜™ K˜—KšŸœžœ žœ˜ KšŸœžœžœ˜+Kš Ÿœžœžœžœžœ˜Nš Ÿœžœžœžœ žœ˜BK˜—K˜™K˜K™U™KK™D—K˜—Kšœ žœ˜šœ žœ˜K˜—šŸ œžœžœžœ žœžœžœ˜NKšœ ™ Kšœ!™!Kšœ*™*KšœB™BK˜—šŸ œžœžœžœ žœžœžœ˜IKšœ8™8K˜—šŸœžœ žœ žœžœ žœžœžœžœžœ˜kKšœ1™1Kšœ%™%Kšœ.™.K˜—š*Ÿœžœžœžœ žœžœžœžœžœ žœžœžœžœ žœžœžœžœ žœžœžœžœ˜ν™AKšœ,™,Kšœ-™-Kšœ™Kšœ*™*Kšœ%™%KšœI™IKšœ6™6KšœQ™QKšœ(™(KšœQ™QKšœ.™.K™>——K˜šŸœžœžœžœ˜)Kšœ™KšœF™FK™KKšœ>™>KšœG™GKšœK™KKšœF™F—K˜Kšžœ˜K˜—…—Ξw