-- File: WalnutDisplayerOps.Mesa

-- Created by: Haugeland, May 11, 1983
-- Last Edited by: Willie-Sue, September 9, 1983 3:50 pm


DIRECTORY

 Menus USING [Menu, MenuProc],
 Rope USING [ROPE],
 ViewerClasses USING [Viewer];

WalnutDisplayerOps: CEDAR DEFINITIONS =

BEGIN

Viewer
: TYPE = ViewerClasses.Viewer;
ROPE: TYPE = Rope.ROPE;

msgMenu: Menus.Menu;
msgMenuAvailable: BOOL;
msgName: ROPE;
msgSetName: ROPE;

-- displaying Msgs, from WalnutMsgDisplayerImpl

GetMsgName: PROC[v: Viewer] RETURNS[mName: ROPE];
-- of v is a Viewer for a Walnut Entity, then return its name else NIL

StuffMsgContents: PROC[v: Viewer, mName: ROPE] RETURNS[found: BOOLEAN];
-- if mName is the name of a msg, then display that msg in v else return found← FALSE

AddToMsgMenu: PROC[label: ROPE, proc: Menus.MenuProc, onQueue: BOOLFALSE];
-- adds menu button, synchronised using walnutQueue if onQueue is TRUE

-- ***********************************************************
-- calls from outside Walnut, will use walnutQueue

DisplayListOfMsgs: PUBLIC PROC[mL: LIST OF ROPE, name: ROPE, oldV: Viewer]
RETURNS[v: Viewer];
-- builds a msgset-like displayer for a list of msgs, using oldV if given
-- Walnut will maintain it in the face of aborts

CreateMsgViewer: PROC[name: ROPE, shift, paint: BOOLFALSE] RETURNS[v: Viewer];
-- returns NIL if mName is not a Msg

DisplayMsgInViewer: PROC[name: ROPE, v: Viewer, shift: BOOLFALSE];
-- displays Msg name (if it exists) in Viewer v

CreateMsgSetViewer: PROC[name: ROPE, shift, paint: BOOLFALSE] RETURNS[v: Viewer];
-- returns NIL if msName is not a MsgSet
-- if msName is already being displayed, returns that Viewer

DisplayMsgSetInViewer: PROC[name: ROPE, v: Viewer, shift: BOOLFALSE];
-- displays the MsgSet name (if it exists) in Viewer v

END.