VerifyToolImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
last edited by Levin on December 15, 1983 12:00 pm
Doug Wyatt, March 6, 1985 12:57:55 pm PST
Spreitzer, May 20, 1985 5:52:37 pm PDT
DIRECTORY
Containers USING [ChildXBound, Create],
DFOperations USING [SModelAction],
DFOperationsQueue USING [Enqueue, RequestRecord],
DFToolInternal USING [AddOpToTable, DFTool, EnsureDFName, offScreenY, OpDefiner, Operation, OpsInteraction, OpSpecificProc, ViewerToRopeList],
FileViewerOps USING [WaitUntilSaved],
Rope USING [ROPE],
ViewerOps USING [MoveViewer],
ViewerTools USING [GetContents];
VerifyToolImpl: CEDAR PROGRAM
IMPORTS Containers, DFOperationsQueue, DFToolInternal, FileViewerOps, ViewerOps, ViewerTools
= BEGIN OPEN
Ops: DFOperations,
OpsQ: DFOperationsQueue,
Tool: DFToolInternal;
ROPE: TYPE = Rope.ROPE;
-- ---- ---- ---- ---- ---- ---- ----
Verify-specific Code
-- ---- ---- ---- ---- ---- ---- ----
VerifyData: TYPE = RECORD [ -- this is a placeholder for future options
dummy: NAT ← 0
];
VerifySpecific: Tool.OpSpecificProc = {
SELECT action FROM
$createOptions => {
op: Tool.Operation = NARROW[param];
tool: Tool.DFTool = op.tool;
data: REF VerifyData = NEW[VerifyData ← []];
op.options ← data;
op.optionsContainer ← Containers.Create[info: [
wx: 0, wy: Tool.offScreenY,
ww: 9999, -- arbitrary; Containers.ChildXBound overrides
wh: 0,
parent: tool.inner,
border: FALSE,
scrollable: FALSE
]];
Containers.ChildXBound[tool.inner, op.optionsContainer];
Eventually, options creation will go here.
op.height ← op.height + tool.parameters.entryVSpace;
ViewerOps.MoveViewer[
viewer: op.optionsContainer,
x: op.optionsContainer.wx, y: op.optionsContainer.wy,
w: op.optionsContainer.ww, h: op.height,
paint: FALSE
];
};
$doOp => {
op: Tool.Operation = NARROW[param];
tool: Tool.DFTool = op.tool;
wDir: ROPE = ViewerTools.GetContents[tool.wDir];
data: REF VerifyData = NARROW[op.options];
FOR list: LIST OF ROPE ← Tool.ViewerToRopeList[tool.dfNames], list.rest UNTIL list = NIL DO
short, long: ROPE;
[short, long] ← Tool.EnsureDFName[list.first, wDir];
FileViewerOps.WaitUntilSaved[long, tool.feedback];
tool.opsQueue.Enqueue[NEW[OpsQ.RequestRecord ← [
dfFile: short,
wDir: wDir,
interact: Tool.OpsInteraction,
log: tool.log,
clientData: op,
opSpecific: verify[]
]]];
ENDLOOP;
};
ENDCASE;
};
-- ---- ---- ---- ---- ---- ---- ----
Initialization
-- ---- ---- ---- ---- ---- ---- ----
Tool.AddOpToTable[
NEW[Tool.OpDefiner ← ["Verify", $verify, $individual, VerifySpecific]]];
END.