<> <> <> <> <<>> DIRECTORY CD, CDSequencer, Rope USING [ROPE]; CDCommandOps: CEDAR DEFINITIONS = BEGIN <<>> <> CommandProc: TYPE = CDSequencer.CommandProc; Command: TYPE = CDSequencer.Command; DoWithResource: PROC [proc: CDSequencer.CommandProc, comm: CDSequencer.Command, resource: REF _ NIL, waitIfBusy: BOOL _ FALSE, messageIfSkipped: BOOL _ TRUE] RETURNS [skipped: BOOL]; <<--Monitoring commands using global resources >> <<--proc will be called with comm as parameter >> <<--resource: typically atom; every resource is called only once at a time>> <<--waitIfBusy>> <<-- TRUE: proc waits if resource is occupied >> <<-- FALSE: proc is skipped if resource is occupied >> <<--messageIfSkipped: The procedure message on Terminal if it skipped the call >> RegisterWithMenu: PROC [menu: REF_NIL, entry: Rope.ROPE_NIL, doc: Rope.ROPE_NIL, key: ATOM_NIL, proc: CDSequencer.CommandProc_NIL, queue: CDSequencer.QueueMethod_doQueue, tech: CD.Technology_NIL]; <<--Pure conveniance>> <<--Fetches a menu, installs an entry and implements a command with CDSequencer>> <<--menu: pop-up menu, or NIL >> <<--entry: entry line for pop up menu >> <<--doc: documentation >> <<--key: command key (as in tip table, pop-up menu) >> <<--proc #NIL: registers proc with CDSequencer >> <<--proc NIL: registration of menu entry only >> <<--queue: method how proc is called>> <<--tech: (NIL for all technologies); used for command registration but not for menu>> <<--There are two classes of tools>> <<-- Standard tools register commands with CDSequencer, >> <<-- they do not make PopUp menus themself >> <<-- Fancy tools might not be included in the PopUp menu table file >> <<-- they might consider registering a menu themself, after they are loaded >> RegisterCurrentLayerCommand: PROC [key: ATOM, layer: CD.Layer, tech: CD.Technology_NIL, w: CD.Number_-1]; <<--Registers a command to set layer current layer >> IncludeOb: PROC [comm: CDSequencer.Command, ob: CD.Object, failMessage: Rope.ROPE_NIL]; <<--Includes object into design and makes (always!) a message>> <<--failMessage: output if ob is NIL >> <<--Trivial procedure, but used often enough>> RegisterCommanderNewDesign: PROC [technology: CD.Technology]; <<--Registers a commander command to create a new design>> END.