DIRECTORY Feedback, IO, Rope, ViewerClasses; FeedbackOps: CEDAR DEFINITIONS = BEGIN Viewer: TYPE = ViewerClasses.Viewer; MsgType: TYPE = Feedback.MsgType; MsgClass: TYPE = Feedback.MsgClass; MsgRouter: TYPE = Feedback.MsgRouter; MsgHandler: TYPE = Feedback.MsgHandler; CreateNamedTypescript: PROC [headerText: Rope.ROPE, typescriptName: ATOM, openHeight: NAT _ 120, storing: BOOL _ FALSE] RETURNS [alreadyExists: BOOL, typescript: Viewer]; CreateTypescriptFromStream: PROC [stream: IO.STREAM, typescriptName: ATOM, storing: BOOL _ FALSE] RETURNS [alreadyExists: BOOL, oldStream: IO.STREAM]; GetTypescripts: PROC [] RETURNS [names: LIST OF ATOM]; GetTypescriptStream: PROC [typescriptName: ATOM] RETURNS [IO.STREAM]; messageWindow: READONLY Viewer; CreateViewersHandler: PROC [typescriptName: ATOM _ $None, label: Viewer _ NIL, blink: BOOL _ FALSE] RETURNS [MsgHandler]; IsViewersHandler: PROC [MsgHandler] RETURNS [is: BOOL, typescriptName: ATOM _ $None, label: Viewer _ NIL, blink: BOOL _ FALSE]; HandleToLabel: PROC [vh: MsgHandler, label: Viewer, blink: BOOL _ FALSE]; HandleToTypescript: PROC [vh: MsgHandler, typescriptName: ATOM _ $None]; SetLabel: PROC [router: MsgRouter, label: Viewer, blink: BOOL _ FALSE, msgClass: MsgClass _ $Every]; SetMultiLabel: PROC [router: MsgRouter, label: Viewer, blink: BOOL _ FALSE, msgClasses: LIST OF ATOM]; SetMessageWindow: PROC [router: MsgRouter, blink: BOOL _ FALSE, msgClass: MsgClass _ $Every]; SetMultiMessageWindow: PROC [router: MsgRouter, blink: BOOL _ FALSE, msgClasses: LIST OF ATOM]; SetTypescript: PROC [router: MsgRouter, typescriptName: ATOM _ $None, msgClass: MsgClass _ $Every]; SetMultiTypescript: PROC [router: MsgRouter, typescriptName: ATOM _ $None, msgClasses: LIST OF ATOM]; CreateSimpleRouter: PROC [label: Viewer, blink: BOOL _ FALSE, typescriptName: ATOM] RETURNS [router: MsgRouter]; CreateMultiRouter: PROC [label: Viewer, blink: BOOL _ FALSE, labelClasses: LIST OF ATOM, typescriptName: ATOM, typescriptClasses: LIST OF ATOM] RETURNS [router: MsgRouter]; GetLabel: PROC [router: MsgRouter, msgClass: MsgClass _ $Default] RETURNS [label: Viewer, blink: BOOL _ FALSE]; GetTypescriptName: PROC [router: MsgRouter, msgClass: MsgClass _ $Default] RETURNS [typescriptName: ATOM]; END. Ύ FeedbackOps.mesa Copyright Σ 1988, 1990 by Xerox Corporation. All rights reserved. Bier, August 23, 1989 10:16:56 am PDT Last tweaked by Mike Spreitzer on May 3, 1990 9:40:14 am PDT Contents: Setting Feedback handlers that manipulate Viewers objects. Copied Types Named typescripts Open a new typescript with the headerText in its black strip. Register it under name. The typescript is returned so that the client can later destroy it, if desired. If a (working) typescript of this name already exists, no new typescript is made and alreadyExists = TRUE. If storing, the typescript henceforth (until directed otherwise) remembers its output, so that if the typescript is later destroyed and then re-created, the old output can be re-produced. Like CreateNamedTypescript, but lets you provide your own stream instead of using ViewerIO to make one. If this stream is ever closed, output to this typescriptName will stop appearing until CreateTypescriptFromStream is called again to provide a fresh stream. If alreadyExists = TRUE, oldStream is the value of the old stream. The new stream is put in its place. Lists all of the named typescripts that were created by CreateNamedTypescript above. Returns the output stream that goes to typescript typescriptName. Our two-headed handlers This interface provides MsgHandlers that can output to one, both, or neither of two places: (1) a label (either the MessageWindow or a Viewer created through the Labels interface), and (2) a named typescript. For output to a label, the handler is told whether or not to blink the label on each text output operation. Although the facilies for creating such handlers are presented next, most clients can use the convenience procendures that follow, which operate directly on MsgRouters. Creates a new two-headed handler, and initializes it; it may be redirected later. typescriptName=$None => no output to any named typescript. typescriptName#$None => output goes to that named typescript, if it exists at the moment of output. label=NIL => no output to any label. label=messageWindow => output goes to the MessageWindow. label is from Labels => output goes to that label. blink <=> label is blinked when text is output to it. Reports whether the given handler is one of ours. Redirects the label head of the given handler, which must be a Viewers handler. Redirects the typescript head of the given handler, which must be a Viewers handler. Wiring up a MsgRouter to specific Viewers output streams Direct output to (router, msgClass) to a label (possibly in addition to a typescript). If blink is TRUE, the label will be blinked when messages of msgClass are received. If label=NIL, no output will be sent to a label when msgClass messages are received. Like SetLabel, but sets the label for several specific message classes at once. = {SetLabel[router, messageWindow, blink, msgClass]}; Like SetMessageWindow, but sets the label for several specific message classes at once. Direct output to (router, msgClass) to a typescript (possibly in addition to a label or the MessageWindow). If typescriptName=$None, no output will be sent to a typescript when msgClass messages are received. Like SetTypescript, but sets the typescript for several specific message classes at once. For convenience. Equivalent to CreateRouter[], SetLabel[...$Every], SetTypescript[...$Every]. For convenience. Equivalent to CreateRouter[], SetMultiLabel, SetMultiTypescript. Queries on routers (mostly for debugging) Get the label that router is using when messages of msgClass are received. If msgClass = $Default, return the label that is used when a message is received for a message class that is has no special label assigned to it. If label=messageWindow, the Cedar Message Window is being used. Get the typescript name that router is using when messages of msgClass are received. If msgClass = $Default, return the typescript that is used when a message is received for a message class that is has no special typescript assigned to it. ΚΠ™codešœ™KšœB™BKšœ%™%K™<—K™KšΟbœ=™EK™KšΟk œ žœ˜,K˜KšΟn œžœž œž˜&Ihead™ Kšœžœ˜$Kšœ žœ˜!Kšœ žœ˜#Kšœ žœ˜%Kšœ žœ˜'L™šŸœžœžœžœžœžœžœžœžœ˜ͺKšœΠ™Π—K˜šŸœžœ žœžœžœ žœžœžœžœ žœžœ˜–Kšœξ™ξ—K˜š Ÿœžœžœ žœžœžœ˜6KšœT™T—K˜š Ÿœžœžœžœžœžœ˜EKšœA™A—™K™½K™K™¨—K˜Kšœžœ˜K˜šŸœžœžœžœ žœžœžœ˜yK™QKšœ:™:Kšœc™cK™$Kšœ8™8K™2K™5—K˜šŸœžœžœžœžœžœ žœžœ˜K™1—K˜šŸ œžœ(žœžœ˜IK™O—K˜šŸœžœ"žœ ˜HK™T—Lšœ8™8šŸœžœ+žœžœ˜dKšœ«™«KšœT™T—šŸ œžœ+žœžœžœžœžœ˜fKšœO™O—šŸœžœžœžœ˜]Kšœ5™5—šŸœžœžœžœžœžœžœ˜_KšœW™WK™—šŸ œžœ%žœ'˜cKšœΡ™Ρ—š Ÿœžœ%žœžœžœžœ˜eKšœY™YK™—š Ÿœžœžœžœžœžœ˜pKšœ^™^—šŸœžœžœžœžœžœžœžœžœžœžœžœ˜¬KšœR™R—L™)š Ÿœžœ4žœžœžœ˜oKšœž™ž—K˜šŸœžœ4žœžœ˜jKšœρ™ρ—K˜Kšžœ˜K˜—…—Ψf