<> <<>> <<>> <> <> DIRECTORY Imager USING [Context], Rope USING [ROPE], ViewerClasses USING [MenuEntryDisplayOp, NotifyProc, Viewer]; Menus: CEDAR DEFINITIONS = BEGIN Viewer: TYPE = ViewerClasses.Viewer; ROPE: TYPE = Rope.ROPE; MenuEntryTrigger: TYPE = {leftup, middleup, rightup, shiftleftup, shiftmiddleup, shiftrightup, all, notrigger}; <> <> <> <<>> targetNotFound: SIGNAL; <> <<>> Menu: TYPE = RECORD[ <> name: ROPE, beginsActive: BOOLEAN _ TRUE, breakBefore: BOOLEAN _ TRUE, breakAfter: BOOLEAN _ TRUE, notify: ViewerClasses.NotifyProc _ NIL, entries: LIST OF Entry _ NIL ]; Entry: TYPE = RECORD[ <> name: ROPE, guarded: BOOLEAN _ FALSE, displayData: REF ANY _ NIL, -- must narrow to Rope.ROPE or DrawingRec actions: LIST OF EntryNotifyRecord _ NIL ]; EntryNotifyRecord: TYPE = RECORD[ <> trigger: LIST OF MenuEntryTrigger _ NIL, notifyData: LIST OF REF ANY _ NIL, popupDoc: ROPE _ NIL, guardResponse: REF ANY _ NIL, -- must narrow to Rope.ROPE or REF UnGuardRec makeActive: LIST OF ROPE _ NIL, makeInActive: LIST OF ROPE _ NIL, toggle: LIST OF ROPE _ NIL ]; DrawingRec: TYPE = RECORD [ proc: DrawingProc, -- procedure to call to do the drawing data: REF ANY _ NIL -- will be passed as the 'clientData' parm to the procedure ]; UnGuardRec: TYPE = RECORD [ proc: UnGuardProc, -- procedure to call when menu becomes unguarded data: REF ANY _ NIL -- will be passed as the 'clientData' parm to the procedure ]; DrawingProc: TYPE = PROC [op: ViewerClasses.MenuEntryDisplayOp, ctx: Imager.Context _ NIL, clientData: REF ANY _ NIL] RETURNS[width: INTEGER _ 64]; UnGuardProc: TYPE = PROC [clientData: REF ANY _ NIL]; <> RegisterMenu: PROC [menu: Menu]; <> <<>> AlreadyRegistered: PROC [name: ROPE] RETURNS [registered: BOOLEAN]; <> <<>> ReRegisterMenu: PROC [menu: Menu, paint: BOOL _ TRUE]; <> <<>> GetRegisteredMenu: PROC [name: ROPE] RETURNS [menu: Menu]; <> <<>> <> ClearMenus: PROC [viewer: Viewer, paint: BOOL _ TRUE]; <> AddMenu: PROC [viewer: Viewer, name: ROPE, paint: BOOL _ TRUE, addBefore: ROPE _ NIL]; <> MakeActive: PROC [viewer: Viewer, menu: ROPE, paint: BOOL _ TRUE]; <<'menu' is made accessable to the human user. >> <<>> MakeInActive: PROC [viewer: Viewer, menu: ROPE, paint: BOOL _ TRUE]; <<'menu' is made inaccessable to the human user.>> <<>> Toggle: PROC [viewer: Viewer, menu: ROPE, paint: BOOL _ TRUE]; <> <<>> MenuInViewer: PROC [viewer: Viewer, menu: ROPE] RETURNS [exists: BOOLEAN]; <> <> ParseDescription: PROC [def: Rope.ROPE, prevlist: LIST OF Menu _ NIL, errorFile: Rope.ROPE _ NIL] RETURNS [LIST OF Menu]; <> END.