DIRECTORY Imager USING [Color, Context, Box], ImagerFont USING [Font, XChar], NodeStyle USING [Ref, TabStop, FontUnderlining], NodeStyleOps USING [OfStyle], Scaled USING [Value], TEditDocument USING [LineBreak], TextEdit USING [Offset, RefTextNode], TextLooks USING [Looks], TextNode USING [Location]; TEditFormat: CEDAR DEFINITIONS ~ BEGIN LineInfo: TYPE = REF LineInfoRec; LineInfoRec: TYPE = RECORD [ charInfo: CharInfo, formatInfo: FormatInfo, positionInfo: PositionInfo, artworkClass: ArtworkClass, artworkData: REF, startPos, nextPos: TextNode.Location, xOffset: Scaled.Value, xmin, ymin, xmax, ymax: INTEGER, nChars: NAT, nBlankCharsAtEnd: NAT, break: TEditDocument.LineBreak, hasBackground: BOOL, amplifySpace: REAL, startAmplifyIndex: CharNumber, index: INT, -- for use by clients data: REF, -- for use by clients link: LineInfo ]; CharNumber: TYPE = [0..LAST[CARDINAL]/SIZE[CharInfoEntry]-8); CharInfo: PUBLIC TYPE = REF CharInfoRec; CharInfoRec: PUBLIC TYPE = RECORD [ seq: SEQUENCE maxLength: CharNumber OF CharInfoEntry ]; CharInfoEntry: TYPE = RECORD [ char: ImagerFont.XChar, formatNumber: FormatNumber, alteredWidth: BOOLEAN, amplified: BOOLEAN, width: Scaled.Value ]; FormatNumber: TYPE = [0..LAST[CARDINAL]/SIZE[FormatInfoEntry]-16); FormatInfo: PUBLIC TYPE = REF FormatInfoRec; FormatInfoRec: PUBLIC TYPE = RECORD [ length: FormatNumber _ 0, seq: SEQUENCE maxLength: FormatNumber OF FormatInfoEntry ]; FormatInfoEntry: TYPE = RECORD [ looks: TextLooks.Looks, font: ImagerFont.Font _ NIL, color: Imager.Color _ NIL, tab: NodeStyle.TabStop _ NIL, vShift: REAL _ 0.0, charProps: REF, strikeout: NodeStyle.FontUnderlining _ None, underlining: NodeStyle.FontUnderlining _ None, unique: BOOL ]; PositionInfo: PUBLIC TYPE = REF PositionInfoRec; PositionInfoRec: PUBLIC TYPE = RECORD [ seq: SEQUENCE maxLength: CharNumber OF INTEGER ]; FormatLine: FormatProc; FormatProc: TYPE ~ PROC [ lineInfo: LineInfo, node: TextEdit.RefTextNode, startOffset: TextEdit.Offset, nodeStyle: NodeStyle.Ref, lineWidth: Scaled.Value, doLigsAndKern: BOOLEAN _ FALSE, kind: NodeStyleOps.OfStyle _ screen ]; Paint: PaintProc; PaintProc: TYPE ~ PROC [lineInfo: LineInfo, context: Imager.Context]; Resolve: ResolveProc; ResolveProc: TYPE ~ PROC [lineInfo: LineInfo, x: INTEGER] RETURNS [loc: TextNode.Location, xmin, width: INTEGER, rightOfLine: BOOLEAN]; CharPosition: CharPositionProc; CharPositionProc: TYPE ~ PROC [lineInfo: LineInfo, offset: TextEdit.Offset] RETURNS [x, width: INTEGER]; BoundingBox: BoundingBoxProc; BoundingBoxProc: TYPE ~ PROC [lineInfo: LineInfo, start: INT _ 0, length: INT _ LAST[INT]] RETURNS [Imager.Box]; Allocate: PROC RETURNS [lineInfo: LineInfo]; Release: PROC [lineInfo: LineInfo]; RegisterArtwork: PROC [ArtworkClass]; UnRegisterArtwork: PROC [ATOM]; GetArtworkClass: PROC [ATOM] RETURNS [ArtworkClass]; ArtworkClass: TYPE ~ REF ArtworkClassRep; ArtworkClassRep: TYPE ~ RECORD [ name: ATOM, format: FormatProc, paint: PaintProc, resolve: ResolveProc, charPosition: CharPositionProc, boundingBox: BoundingBoxProc ]; END. κTEditFormat.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Michael Plass, May 23, 1985 9:04:16 am PDT A (perhaps slightly generous) bounding box for the line. Paints the line with its origin at the current position. Finds the character pointed to. Finds the position of the indicated character. Returns FIRST[INTEGER] or LAST[INTEGER] if the character occurs before or after the line, respectively. Computes a higher-precision bounding box of characters [start..start+length) of the line, relative to the line's origin. This is how to get working space. Keeps a cache of storage. A promise that the client is done with this LineInfo, and all those chained from it. Use whenever possible to save on allocations. ΚΪ˜codešœ™Kšœ Οmœ1™