DIRECTORY BasicTime USING [GMT, nullGMT], Buttons USING [Button, ButtonProc], Containers USING [Container], DFOperations USING [InteractionProc], DFOperationsQueue USING [OpTerminationInteraction, Queue, RequestedOp], IO USING [STREAM], Labels USING [Label], Rope USING [ROPE], UserProfile USING [ProfileChangedProc], VFonts USING [Font], ViewerClasses USING [Viewer]; DFToolInternal: CEDAR DEFINITIONS = BEGIN OPEN Ops: DFOperations, OpsQ: DFOperationsQueue; ROPE: TYPE = Rope.ROPE; DFTool: TYPE = REF DFToolRecord; DFToolRecord: TYPE = MONITORED RECORD [ outer: Containers.Container _ NIL, parameters: Parameters _ NIL, height: INT _ 0, opsQueue: OpsQ.Queue _ NIL, dfNames: ViewerClasses.Viewer _ NIL, -- text viewer for df file names wDir: ViewerClasses.Viewer _ NIL, -- text viewer for working directory inner: Containers.Container _ NIL, -- container for variable-size portion of tool (within 'outer') selectedOp: Operation _ NIL, bottom: Containers.Container _ NIL, -- container for interaction/feedback area (within 'inner') interaction: Containers.Container _ NIL, -- container for interaction area (within 'bottom') bottomMinHeight: INT _ 0, prompter: ViewerClasses.Viewer _ NIL, -- graphic prompter question: ViewerClasses.Viewer _ NIL, -- place for interaction queries abortRequested: BOOL _ FALSE, autoConfirm: BOOL _ FALSE, -- if TRUE, suppress button interactions responseValue: NAT _ NAT.LAST, -- (*) ResponseSeen and WaitForResponse responseSeen: BOOL _ TRUE, -- (*) ResponseSeen, WaitForResponse, and PrompterProcess responseMade: CONDITION, -- (*) ResponseSeen, WaitForResponse, and PrompterProcess prompterSeq: PrompterSeq _ PrompterSeq.FIRST, choicesX: INT _ 0, -- relative to 'interaction' choicesY: INT _ 0, -- relative to 'interaction' feedback: IO.STREAM _ NIL, -- session log startTime: BasicTime.GMT _ BasicTime.nullGMT, -- (*) DoIt, IdleNotifier recursionDepth: INT _ -1, unusualEnd: LIST OF REF OpsQ.OpTerminationInteraction _ NIL, -- ops with errors/warnings. log: IO.STREAM _ NIL -- (*) long-term log (DoIt, IdleNotifier) ]; offScreenY: INT = -9999; OpTable: TYPE = RECORD [ nOps: NAT, ops: SEQUENCE length: NAT OF REF OpDefiner ]; OpDefiner: TYPE = RECORD [ opName: ROPE, opID: OpsQ.RequestedOp, userClass: UserClass, proc: OpSpecificProc, opAlias: ROPE _ NIL ]; UserClass: TYPE = {individual, releaseParticipant, releaseMaster}; OpSpecificAction: TYPE = {createOptions, doOp, doHelp, makeCommandLine, doCommandLine}; OpSpecificProc: TYPE = PROC [action: OpSpecificAction, param: REF ANY]; Operation: TYPE = REF OperationRecord; OperationRecord: TYPE = RECORD [ tool: DFTool _ NIL, definer: REF OpDefiner _ NIL, button: Buttons.Button _ NIL, optionsContainer: Containers.Container _ NIL, height: INT _ 0, options: REF ANY _ NIL ]; OptionSelector: TYPE = RECORD [ name: ROPE, displayer: Labels.Label _ NIL, choices: LIST OF Choice, default: ROPE ]; Choice: TYPE = RECORD [ name: ROPE, value: REF ANY ]; PrompterSeq: TYPE = NAT[0..8); Parameters: TYPE = REF ToolParameters; ToolParameters: TYPE = RECORD [ userClass: UserClass, opTable: REF OpTable, font: VFonts.Font, boldFont: VFonts.Font, entryHeight: NAT, entryVSpace: NAT, entryHSpace: NAT, compactLayout: BOOL, dfNamePrefixes: LIST OF ROPE ]; userClasses: ARRAY UserClass OF ROPE; OpsInteraction: Ops.InteractionProc; AddOpToTable: PROC [definer: REF OpDefiner]; ViewerToRopeList: PUBLIC PROC [viewer: ViewerClasses.Viewer] RETURNS [LIST OF ROPE]; EnsureDFName: PUBLIC PROC [dfBase, wDir: ROPE] RETURNS [short, long: ROPE]; LabelWidthForChoices: PROC [tool: DFTool, list: LIST OF Choice] RETURNS [max: INT _ 0]; MakeCenteredLabel: PROC [op: Operation, name: ROPE]; OuterContainerWidth: PROC [tool: DFTool] RETURNS [INT]; CreateSelector: PROC [ name: ROPE, proc: Buttons.ButtonProc, clientData: REF ANY, choices: LIST OF Choice, op: Operation, x: INTEGER _ -1] RETURNS [selector: REF OptionSelector, initialChoice: Choice, newX: INTEGER]; SelectOption: PROC [selector: REF OptionSelector] RETURNS [choice: Choice]; ResetOption: PROC [selector: REF OptionSelector]; GetToolParameters: PROC RETURNS [Parameters]; ReactToProfile: UserProfile.ProfileChangedProc; AcquireLog: PROC RETURNS [IO.STREAM]; ReleaseLog: PROC [log: IO.STREAM]; END. RDFToolInternal.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. last edited by Levin on December 16, 1983 2:22 pm Doug Wyatt, March 6, 1985 12:04:20 pm PST Spreitzer, May 20, 1985 5:45:04 pm PDT Types Fields marked (*) are protected by the monitor. NARROW[param] = Operation for all cases of 'action' except 'doCommandLine', for which it is IO.STREAM. Variables (actually, start-time constants) Procedures from DFInterfaceImpl Procedures from DFToolUtilitiesImpl This procedure is intended to be called as part of the initialization of each tool-level operation. It fills in 'opAlias' as a side-effect. This procedure parses the contents of the argument viewer (which must be acceptable to ViewerTools.GetContents) and produces a list of ROPEs. For atomicity purposes, it should usually be invoked synchronously with the Viewers notifer. This procedure adds the ".df" extension, as necessary, to the argument file name. Returns both with and without directory part. This procedure is intended to be called from the $createOptions case of an OpSpecificProc. This procedure is intended to be called from the $createOptions case of an OpSpecificProc. Procedures from DFLogImpl Returns a log stream intended for the use of a DFTool instance during the course of an operation. When the operation is complete, ReleaseLog should be called. Called to indicate that 'log' is no longer in use by a DFTool instance. Everything that has been written to 'log' since it was acquired is transferred to a long-term log file, whose maximum size is under the user's control (via a profile parameter). Êé˜codešœ™Kšœ Ïmœ1™