<<>> <> <> <> <<>> <> <> <<>> DIRECTORY Atom USING [PutPropOnList], BasicTime USING [GMT], ImagerInterpress USING [Ref], IO USING [STREAM], Rope USING [ROPE], ViewerClasses USING [Viewer, ViewerClass], ViewerOps USING [AddProp], XNSPrint USING [Properties]; XTSetter: CEDAR DEFINITIONS IMPORTS Atom, ViewerOps ~ BEGIN ROPE: TYPE ~ Rope.ROPE; <> Tool: TYPE ~ REF ToolRep; ToolRep: TYPE; <> Options: TYPE ~ REF OptionsRep; OptionsRep: TYPE ~ RECORD [ keepIP: BOOL ¬ FALSE, -- TRUE when interpress files generated by XTSetter should be kept instead of thrown away compress: BOOL ¬ FALSE, -- TRUE when compresed files should be sent to printer copyCount: CARD16 ¬ 1, -- number of copies to be printed device: ROPE ¬ NIL, -- device propertoy to be assigned to root node (if any) pageFirst: CARD16 ¬ 1, -- first page number to be printed pageLast: CARD16 ¬ LAST [CARD16], -- last page number to be printed mediumHint: ROPE ¬ NIL, -- Describes the paper size (or more generally print support) to be used. Defaults to UsLetter format stapled: BOOL ¬ FALSE, -- TRUE when printer output should be stapled (if supported) twoSided: BOOL ¬ FALSE, -- TRUE when printer should print on both sides of the paper (if supported) telephone: ROPE ¬ NIL, -- Phone number to be used to telefax documents - Not yet supported tiogaStyle: ROPE ¬ NIL, -- Tioga style to be applied if formatting a Tioga document. NIL or "" means use style specified in root node of document tiogaScale: REAL ¬ 1.0 -- Scale factor to be applied if formatting a Tioga document. ]; <> Error: ERROR[why: ROPE]; -- Raised if unable to access printer GetTool: PROC [printer: ROPE ¬ NIL, new: BOOL ¬ FALSE] RETURNS [tool: Tool]; <> <<>> DestroyTool: PROC [tool: Tool]; <> <<>> DefaultOptions: PROC [] RETURNS [options: Options]; <> <<>> GetOptions: PROC [tool: Tool, reset: BOOL ¬ TRUE] RETURNS [options: Options]; <> <<>> Position: TYPE = RECORD [start, length: CARDINAL]; ComponentPositions: TYPE = RECORD [server, dir, subDirs, base, ext, ver: Position]; ExpandName: PROC[name: ROPE, wDir: ROPE ¬ NIL] RETURNS [fullFName: ROPE ¬ NIL, cp: ComponentPositions, dirOmitted: BOOL]; SetOptions: PROC [tool: Tool, options: Options]; <> <<>> GetProperties: PROC [tool: Tool] RETURNS [printerProperties: XNSPrint.Properties]; <> <<>> CreateOptionsViewer: PROC [tool: Tool]; <> <<>> DestroyOptionsViewer: PROC [tool: Tool]; <> <<>> CreateServerStatusViewer: PROC [tool: Tool]; <> <<>> DestroyServerStatusViewer: PROC [tool: Tool]; <> <> <> <> <> <> <<>> PrintFile: PROC [tool: Tool, file: ROPE, options: Options ¬ NIL]; <> <<>> PrintViewer: PROC [tool: Tool, v: ViewerClasses.Viewer, options: Options ¬ NIL]; <> <<>> Screen: TYPE ~ {bw, left, right, color}; -- the four flavors that may be printed PrintScreen: PROC [tool: Tool, screen: Screen, options: Options ¬ NIL]; <> <> <> < IP master processing. The printing mechanism is an inherited property: it is first looked up on the specific viewer, then on the viewer class if not found. A default IPProducer is provided by XTSetter that approximates the viewer's paint mechanism (the default IPProducer will not work properly on viewer classes that do not use the Imager in a device-independant fashion to paint heir viewers). As mentionned above, this property is used only for top-level viewers.>> <<>> Info: TYPE ~ REF InfoRep; InfoRep: TYPE ~ RECORD [ date: BasicTime.GMT, -- creation date that should be used on the printed document. title: ROPE, -- document name that should be used on the printed document. keptFile: ROPE -- Name of the IP file if it is kept. ]; ProductionProgressProc: TYPE ~ PROC [percent: REAL] RETURNS [stop: BOOL]; IPProducer: TYPE ~ PROC [source: REF, options: Options, info: Info, master: ImagerInterpress.Ref, err: IO.STREAM, progress: ProductionProgressProc] RETURNS [pages: INT ¬ 0]; <> SetClassGenerator: PROC [class: ViewerClasses.ViewerClass, producer: IPProducer] ~ INLINE { <> <> class.props ¬ Atom.PutPropOnList[class.props, $IPProducer, NEW [IPProducer ¬ producer]]; }; <<>> SetGenerator: PROC [v: ViewerClasses.Viewer, producer: IPProducer] ~ INLINE { <> <> ViewerOps.AddProp[v, $IPProducer, NEW [IPProducer ¬ producer]]; }; <<>> GetGenerator: PROC [v: ViewerClasses.Viewer] RETURNS [producer: IPProducer]; <> <<>> PaperSize: PROC [paper: ROPE] RETURNS [length: REAL, width: REAL]; <> END.