DIRECTORY Atom USING [PropList], Imager USING [Box, Context, Font, Transformation, VEC, XChar], NodeStyle USING [Ref], Real USING [LargestNumber], Rope USING [ROPE], TextNode USING [Location]; TiogaImager: CEDAR DEFINITIONS ~ BEGIN Box: TYPE ~ REF BoxRep; BoxRep: TYPE ~ RECORD [ nChars: INT, bounds: Imager.Box, expansion: Imager.VEC, -- factor applied to stretch or shrink of component boxes escapement: Imager.VEC, stretch: Imager.VEC, shrink: Imager.VEC, class: Class, duplicate: BOOL _ FALSE, data: REF, props: Atom.PropList _ NIL ]; FormatLine: PROC [start: TextNode.Location, lineWidth: REAL, style: NodeStyle.Ref, screenStyle: BOOL _ FALSE] RETURNS [Box]; FilterProc: TYPE ~ PROC [node: TextNode.Location, level: INT, position: Imager.VEC] RETURNS [skip: BOOL _ FALSE, stop: BOOL _ FALSE, maxLineLength: REAL _ Real.LargestNumber]; InsertID: TYPE ~ {nil, head, top, normal, bottom, foot}; SepProc: TYPE ~ PROC [InsertID] RETURNS [LIST OF Box]; FormattedNodes: TYPE ~ RECORD [box: Box, resume: TextNode.Location]; FormatNodes: PROC [start: TextNode.Location, bounds: Imager.VEC, screenStyle: BOOL _ FALSE, filter: FilterProc _ NIL, sep: SepProc _ NIL] RETURNS [FormattedNodes]; Marks: TYPE ~ Atom.PropList; FormattedPage: TYPE ~ RECORD [ box: Box, nextLoc: TextNode.Location, marks: Marks, pageFigure: INT ]; FormatPage: PROC [pageCounter: INT, startLoc: TextNode.Location, filter: FilterProc _ NIL, marks: Marks _ NIL, screenStyle: BOOL _ FALSE] RETURNS [FormattedPage]; EmptyBox: PROC [escapement: Imager.VEC _ [0,0], stretch: Imager.VEC _ [0,0], shrink: Imager.VEC _ [0,0]] RETURNS [Box]; BoxFromChar: PROC [font: Imager.Font, char: CHAR] RETURNS [Box]; BoxFromXChar: PROC [font: Imager.Font, xchar: Imager.XChar] RETURNS [Box]; BoxFromRope: PROC [font: Imager.Font, rope: Rope.ROPE] RETURNS [Box]; BoxFromList: PROC [list: LIST OF Box, xFix, yFix: Fix _ []] RETURNS [Box]; Fix: TYPE ~ RECORD [ what: {expansion, size} _ expansion, value: REAL _ 0.0 ]; Overlay: PROC [base, new: Box, offset: Imager.VEC] RETURNS [Box]; Composite: PROC [box: Box] RETURNS [BOOL]; UnBox: PROC [box: Box] RETURNS [LIST OF Box]; ModifyBox: PROC [box: Box, m: Imager.Transformation] RETURNS [Box]; Render: PROC [box: Box, context: Imager.Context, position: Imager.VEC]; Resolve: PROC [box: Box, p: Imager.VEC] RETURNS [TextNode.Location]; FirstLocWithin: PROC [box: Box] RETURNS [TextNode.Location]; Destroy: PROC [box: Box]; Duplicate: PROC [box: Box]; Boxes: TYPE ~ RECORD [ list: LIST OF Box _ NIL, last: LIST OF Box _ NIL ]; AppendList: PROC [boxes: Boxes, list: LIST OF Box] RETURNS [Boxes]; AppendBox: PROC [boxes: Boxes, box: Box] RETURNS [Boxes]; Class: TYPE ~ REF ClassRep; ClassRep: TYPE ~ RECORD [ Composite: PROC [box: Box] RETURNS [BOOL], UnBox: PROC [box: Box] RETURNS [LIST OF Box], Render: PROC [box: Box, context: Imager.Context, position: Imager.VEC], Resolve: PROC [box: Box, p: Imager.VEC] RETURNS [TextNode.Location], FirstLocWithin: PROC [box: Box] RETURNS [TextNode.Location], Destroy: PROC [box: Box] ]; END. ”TiogaImager.mesa Copyright c 1985, 1986 by Xerox Corporation. All rights reserved. Michael Plass, March 21, 1986 10:39:44 am PST Facility for rendering portions of a tioga document via the Imager. The procedures you probably want are FormatPage, Render, and Destroy. General comments This interface provides a typesetting abstraction that combines some of the features of TEX's boxes-and-glue model with the Interpress notion of what a character operator is. Making boxes The box representing the formatted page The location at which to resume formatting The formatting information accumulated from previous pages. The number assigned to the page after taking style information into account Initially, pageCounter = 0, marks = NIL Makes a box by overlaying two boxes, possibly offset from each other. escapement, stretch, shrink are inherited from base. offset is from reference point of base to reference point of new Basic operations Returns TRUE if UnBox operation is meaningful. Renders the box into the context. The reference point of the box will be placed at the specified position. Finds the character or node pointed at. The point p is relative to the box's reference point. Asserts that box is no longer needed, so storage may be re-used. Ensures that the box will not be destroyed, since there are multiple ref to it. List manipulation Destructive list concatenation. Destructive append. Class record สo˜code™Kšœ ฯmœ7™BK™-™K™CK™KšœE™E——K˜šฯk ˜ Kšœžœ ˜Kšœžœ&žœ ˜>Kšœ žœ˜Kšœžœ˜Kšœžœžœ˜Kšœ žœ ˜K˜—Kšะln œžœž ˜Kšœž˜head™™KšœYะdlœT™ฎ—K™Kšœžœžœ˜šœžœžœ˜Kšœžœ˜ K˜Kšœžœฯc9˜PKšœžœ˜Kšœžœ˜Kšœžœ˜K˜ Kšœ žœžœ˜Kšœžœ˜ Kšœž˜Kšœ˜——™ š ฯn œžœ'žœ%žœžœžœ˜|K˜—Kšข œžœžœ"žœžœžœžœžœžœžœžœ˜ฏKšœ žœ*˜8Kš œ žœžœ žœžœžœ˜6Kšœžœžœ'˜Dšข œžœ+žœžœžœžœžœžœ˜ฃK˜—Kšœžœ˜šœžœžœ˜šœ ˜ K™'—šœ˜K™*—šœ ˜ K™;—šœ ž˜K™K—Kšœ˜—šข œžœžœ4žœžœžœžœžœ˜ขKšœ$ž™'K˜—š ขœžœžœžœžœ žœ˜wK˜—šข œžœžœžœ˜@K˜—šข œžœ*žœ˜JK˜—šข œžœ žœžœ˜EK˜—Kš ข œžœžœžœžœ˜Jšœžœžœ˜Kšœ$˜$Kšœžœ˜Kšœ˜K˜—šขœžœ!žœžœ˜AK™EKšœ4™4Kšœ@™@K˜—K˜—™šข œžœ žœžœ˜*Kšœžœ"™.K˜—š ขœžœ žœžœžœ˜-K˜—šข œžœ&žœ˜CK˜—šขœžœ6žœ˜GKšœk™kK˜—šขœžœžœžœ˜DK™'K™5K˜—šขœžœ žœ˜