DIRECTORY Imager USING [Context], NodeStyle USING [Ref, TabStop, FontUnderlining], Scaled USING [Value, zero], TEditDocument USING [TEditDocumentData, LineBreak], TextEdit USING [Offset, RefTextNode], TextLooks USING [Looks], TextNode USING [Location], UnifiedFonts; TEditFormat: CEDAR DEFINITIONS = BEGIN TEditDocumentData: TYPE = TEditDocument.TEditDocumentData; LineInfo: TYPE = REF LineInfoRec; LineInfoRec: TYPE = RECORD [ charInfo: CharInfo, formatInfo: FormatInfo, positionInfo: PositionInfo, startPos, nextPos: TextNode.Location, xOffset: Scaled.Value, xmin, ymin, xmax, ymax: INTEGER, nChars: NAT, break: TEditDocument.LineBreak ]; 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: CHAR, formatNumber: FormatNumber, 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: UnifiedFonts.FONT _ NIL, tab: NodeStyle.TabStop _ NIL, vShift: Scaled.Value _ Scaled.zero, strikeout, underlining: NodeStyle.FontUnderlining _ None ]; PositionInfo: PUBLIC TYPE = REF PositionInfoRec; PositionInfoRec: PUBLIC TYPE = RECORD [ seq: SEQUENCE maxLength: CharNumber OF INTEGER ]; FormatLine: PROC [self: LineInfo, tdd: TEditDocumentData, node: TextEdit.RefTextNode, startOffset: TextEdit.Offset, nodeStyle: NodeStyle.Ref, lineWidth: Scaled.Value, forPaint: BOOLEAN _ FALSE, doLigsAndKern: BOOLEAN _ FALSE ]; Paint: PROC [lineInfo: LineInfo, context: Imager.Context, whiten: BOOLEAN _ FALSE]; Resolve: PROC [lineInfo: LineInfo, x: INTEGER] RETURNS [loc: TextNode.Location, xmin, width: INTEGER, rightOfLine: BOOLEAN]; CharPosition: PROC [lineInfo: LineInfo, offset: TextEdit.Offset] RETURNS [x, width: INTEGER]; Allocate: PROC RETURNS [lineInfo: LineInfo]; Release: PROC [lineInfo: LineInfo]; END. (TEditFormat.mesa Edited by McGregor on January 27, 1983 3:02 pm Edited by Paxton on December 2, 1982 2:48 pm Edited by Plass on August 9, 1983 2:23 pm A (perhaps slightly generous) bounding box for the line. Paints the line with its origin at the current position. The LineInfo must have been created with forPaint: TRUE. 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. This is how to get working space. Keeps a small cache of storage. A promise that the client is done with this LineInfo. Use whenever possible to save on allocations. Michael Plass, February 1, 1983 9:15 am: conversion to UnifiedFonts Michael Plass, August 9, 1983 2:23 pm: conversion to Imager Κ0˜Jšœ@™@Jšœ,™,Jšœ)™)unitšΟk ˜ Jšœœ ˜Jšœ œ!˜0Jšœœ˜Jšœœ ˜3Jšœ œ˜%Jšœ œ ˜Jšœ œ ˜Jšœ ˜ —Kšœ œ˜&Kšœœ#˜:Kšœ œœ ˜!šœ œœ˜J˜J˜J˜Jšœ%˜%J˜šœœ˜ J™8—Jšœœ˜ Jšœ˜Jšœ˜—Kš œ œœœœ˜=Kšœ œœœ ˜(šœ œœœ˜#Jšœœœ˜4Jšœ˜—šœœœ˜Jšœœ˜ J˜J˜Jšœ˜—Kš œœœœœ˜BKšœ œœœ˜,šœœœœ˜%Jšœ˜Jšœœœ˜8Jšœ˜—šœœœ˜ Jšœ˜Jšœœœ˜Jšœœ˜Jšœ#˜#Jšœ8˜8Jšœ˜—Kšœœœœ˜0šœœœœ˜'Jšœœœ˜.Jšœ˜—Kš Οn œœ‘œœœœ˜γšžœœ7œœ˜SJšœq™q—šžœœœ˜.Jšœ'œœ˜MJšœ™—šž œœ.˜@Jšœ œ˜Jš œ8œœœœA™——šžœœœ˜,J™A—šžœœ˜#J™c—Kšœ˜J™CJ™;J™—…—Z²