DIRECTORY BasicTime USING [Now], Buttons USING [Button, ButtonProc, Create], Commander USING [CommandProc, Register], Containers USING [ChildXBound, ChildYBound, Container, Create], Convert USING [CardFromRope, Error], FS USING [Error], Imager USING [Context, metersPerInch, TranslateT], ImagerSample USING [Clear, RasterSampleMap], Interpress USING [DoPage, LogProc, Master, Open], IO USING [PutF, PutF1, PutRope, rope, STREAM, time], Loader USING [BCDBuildTime], PlatemakerControl USING [ContextFromSampleMap, MakePrinterSampleMap, PrintMap], Rope USING [ROPE], Rules USING [Create, Rule], TypeScript USING [Create], VFonts USING [EstablishFont, Font, FontHeight], ViewerClasses USING [Viewer], ViewerIO USING [CreateViewerStreams], ViewerOps USING [PaintViewer, SetOpenHeight], ViewerTools USING [GetContents, InhibitUserEdits, MakeNewTextViewer, SetSelection]; PlatemakerInterfaceImpl: CEDAR PROGRAM IMPORTS BasicTime, Buttons, Commander, Containers, Convert, FS, Imager, ImagerSample, IO, Interpress, Loader, PlatemakerControl, Rules, TypeScript, VFonts, ViewerIO, ViewerOps, ViewerTools EXPORTS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; STREAM: TYPE ~ IO.STREAM; ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- Tool: TYPE ~ REF ToolRep; ToolRep: TYPE ~ RECORD [ outer: Containers.Container _ NIL, height: INT _ 0, busy: BOOL _ FALSE, fileNameViewer: ViewerClasses.Viewer, fileName: ROPE, pageNumberViewer: ViewerClasses.Viewer, pageNumber: ROPE, negButton: Buttons.Button, reverseScan: Buttons.Button, typeScript: STREAM]; ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- minFeedbackLines: NAT = 4; interactionQuestionLines: NAT = 1; idleMessage: ROPE _ " "; offScreen: INT = -9999; font: VFonts.Font _ VFonts.EstablishFont["Tioga", 10]; entryHSpace: INT _ 10; entryHeight: INT _ VFonts.FontHeight[font] + 2; entryVSpace: INT _ VFonts.FontHeight[font]/6; ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- NewTool: PROC [] RETURNS [tool: Tool] = BEGIN AddSeparatingRule: PROC = BEGIN rule: Rules.Rule = Rules.Create[info: [ wx: 0, wy: tool.height, ww: 9999, -- arbitrary; Containers.ChildXBound overrides wh: 1, parent: tool.outer ]]; Containers.ChildXBound[tool.outer, rule]; -- constrain rule to be width of parent tool.height _ tool.height + entryVSpace; -- spacing after rule END; BuildCommandButtons: PROC = BEGIN prev: ViewerClasses.Viewer; prev _ Buttons.Create[ info: [name: "Decompose", wx: entryHSpace, wy: tool.height, wh: entryHeight, parent: tool.outer, border: FALSE ], proc: Decompose, fork: TRUE, clientData: tool, font: font ]; prev _ Buttons.Create[ info: [name: "Print", wx: prev.wx + prev.ww + entryHSpace, wy: tool.height, wh: entryHeight, parent: tool.outer, border: FALSE ], proc: Print, fork: TRUE, clientData: tool, font: font ]; tool.height _ tool.height + entryHeight + entryVSpace; AddSeparatingRule[]; END; BuildFileInfo: PROC = BEGIN prev: ViewerClasses.Viewer; prev _ Buttons.Create[ info: [name: "File:", wx: entryHSpace, wy: tool.height, wh: entryHeight, parent: tool.outer, border: FALSE ], proc: SelectFileName, fork: FALSE, clientData: tool, font: font ]; tool.fileNameViewer _ ViewerTools.MakeNewTextViewer[info: [ wx: prev.wx + prev.ww + entryHSpace/2, wy: tool.height, ww: 9999, wh: entryHeight, data: NIL, parent: tool.outer, scrollable: FALSE, border: FALSE ]]; Containers.ChildXBound[container: tool.outer, child: tool.fileNameViewer]; tool.height _ tool.height + entryHeight + entryVSpace; AddSeparatingRule[]; END; -- BuildFileInfo BuildPageNumber: PROC = BEGIN prev: ViewerClasses.Viewer; prev _ Buttons.Create[ info: [name: "Page #:", wx: entryHSpace, wy: tool.height, wh: entryHeight, parent: tool.outer, border: FALSE ], proc: SelectPageNumber, fork: FALSE, clientData: tool, font: font ]; tool.pageNumberViewer _ ViewerTools.MakeNewTextViewer[info: [ wx: prev.wx + prev.ww + entryHSpace/2, wy: tool.height, ww: 9999, wh: entryHeight, data: NIL, parent: tool.outer, scrollable: FALSE, border: FALSE ]]; Containers.ChildXBound[container: tool.outer, child: tool.pageNumberViewer]; tool.height _ tool.height + entryHeight + entryVSpace; AddSeparatingRule[]; END; -- BuildPageNumber v: ViewerClasses.Viewer; tool _ NEW [ToolRep]; tool.outer _ Containers.Create[ info: [ name: "Platemaker Tool", iconic: FALSE, column: right, scrollable: FALSE ], paint: TRUE ]; tool.height _ entryVSpace; BuildCommandButtons[]; BuildFileInfo[]; BuildPageNumber[]; v _ TypeScript.Create[ info: [ wx: 0, wy: tool.height + 5, ww: 9999, wh: 9999, parent: tool.outer, border: FALSE] ]; tool.typeScript _ ViewerIO.CreateViewerStreams[name: "PlatemakerTool.log", viewer: v, backingFile: "PlatemakerTool.log"].out; Containers.ChildXBound[container: tool.outer, child: v]; Containers.ChildYBound[container: tool.outer, child: v]; ViewerTools.InhibitUserEdits[v]; ViewerOps.SetOpenHeight[tool.outer, tool.height]; ViewerOps.PaintViewer[tool.outer, all]; IO.PutF[tool.typeScript, "PlatemakerTool of %t\nSession began at %t\n", IO.time[Loader.BCDBuildTime[]], IO.time[BasicTime.Now[]]]; END; -- Internal Procs Decompose: Buttons.ButtonProc = BEGIN ENABLE UNWIND => NULL; Log: Interpress.LogProc = BEGIN -- [class: INT, code: ATOM, explanation: ROPE]; IO.PutF1[tool.typeScript, "\nIntepress Error: %g", IO.rope[explanation]]; END; tool: Tool _ NARROW[clientData]; contents: ROPE _ ViewerTools.GetContents[tool.fileNameViewer]; pageNumberRope: ROPE _ ViewerTools.GetContents[tool.pageNumberViewer]; pageNumber: INT _ 1; ip: Interpress.Master; context: Imager.Context; IF tool.busy THEN RETURN; IF contents = NIL THEN RETURN; IF pageNumberRope = NIL THEN RETURN; pageNumber _ Convert.CardFromRope[pageNumberRope ! Convert.Error => {IO.PutRope[tool.typeScript, "\nConvert Error on pagenumber"]; GOTO Out}]; ip _ Interpress.Open[contents, Log ! FS.Error => {IO.PutF1[tool.typeScript, "\nFS Error: %g", IO.rope[error.explanation]]; GOTO Out}]; ImagerSample.Clear[sampleMap]; context _ PlatemakerControl.ContextFromSampleMap[sampleMap]; Imager.TranslateT[context, [x: 0.75 * Imager.metersPerInch, y: 0.125 * Imager.metersPerInch]]; Interpress.DoPage[ip, pageNumber, context, Log]; EXITS Out => RETURN; END; Print: Buttons.ButtonProc = BEGIN ENABLE UNWIND => NULL; tool: Tool _ NARROW[clientData]; IO.PutRope[tool.typeScript, "\nInsert paper"]; [] _ PlatemakerControl.PrintMap[sampleMap]; IO.PutRope[tool.typeScript, "\nGet papern"]; END; SelectFileName: Buttons.ButtonProc = BEGIN ENABLE UNWIND => NULL; tool: Tool _ NARROW[clientData]; ViewerTools.SetSelection[tool.fileNameViewer]; END; SelectPageNumber: Buttons.ButtonProc = BEGIN ENABLE UNWIND => NULL; tool: Tool _ NARROW[clientData]; ViewerTools.SetSelection[tool.pageNumberViewer]; END; CommanderNewTool: Commander.CommandProc = BEGIN [] _ NewTool[]; END; sampleMap: ImagerSample.RasterSampleMap _ PlatemakerControl.MakePrinterSampleMap[]; Commander.Register["PlatemakerTool", CommanderNewTool]; END... ΞPlatemakerInterfaceImpl.mesa Copyright Σ 1987 by Xerox Corporation. All rights reserved. Tim Diebert: April 21, 1987 9:42:15 am PDT Tool Configuration Parameters (private) Tool Construction ***Main Body of NewTool*** [parent: Viewer, clientData: REF ANY _ NIL, mouseButton: MouseButton _ red, shift, control: BOOL _ FALSE]; [parent: Viewer, clientData: REF ANY _ NIL, mouseButton: MouseButton _ red, shift, control: BOOL _ FALSE]; [parent: Viewer, clientData: REF ANY _ NIL, mouseButton: MouseButton _ red, shift, control: BOOL _ FALSE]; [parent: Viewer, clientData: REF ANY _ NIL, mouseButton: MouseButton _ red, shift, control: BOOL _ FALSE]; [cmd: Handle] RETURNS [result: REF _ NIL, msg: ROPE _ NIL]; Κ q˜codešœ™K™Jšœœ2˜FJšœ œ˜J˜/Jšœ œœ˜Jšœ œœœ˜Jšœœœœ˜$KšœEœ<œ˜ŽKš œ%œ œ*œœ˜†J˜Jšœ<˜