<<-- TiogaDisplayTable.mesa; Written by S. McGregor, May 1983>> <<-- Edited by McGregor, September 1, 1983 11:16 am>> DIRECTORY TiogaNode USING [Location, Path, Span], TiogaItemClass USING [Break]; TiogaDisplayTable: CEDAR DEFINITIONS = BEGIN <> <<>> <<***** Basic DisplayTable data structures *****>> <<>> DisplayTable: TYPE = REF DisplayTableRec; DisplayTableRec: TYPE = RECORD [ lastIndexUsed: INTEGER _ 0, lastY: INTEGER _ 0, objects: REF PageRectangleSequenceRec ]; PageRectangleSequenceRec: TYPE = RECORD [ SEQUENCE maxRectangle: INTEGER OF PageRectangle -- sorted in y ]; PageRectangle: TYPE = MACHINE DEPENDENT RECORD [ -- 19 words startPos: TiogaNode.Location, -- first offset in displayed rectangle endPos: TiogaNode.Location, -- last offset in displayed rectangle valid: BOOL _ TRUE, -- metrics valid for this rectangle topLevelItem: BOOL _ TRUE, -- is this rectangle for a top level item instead of a child? startOfComp: BOOL _ TRUE, -- is this rectangle the start of a composing stick load? end: Break _ eon, -- reason for terminating rectangle selectable: BOOL _ TRUE, -- can this entry be selected allInclusive: BOOL _ TRUE, -- no data in span [startPos..endPos] outside of PageRectangle filler: [0..512) _ 0, -- unused bits yBaseline: INTEGER _ 0, -- baseline displacement from top of parent xBaseline: INTEGER _ 0, -- baseline displacement from left of parent topExtent: INTEGER _ 0, -- bounding box extent above yBaseline bottomExtent: INTEGER _ 0, -- bounding box extent below yBaseline leftExtent: INTEGER _ 0, -- bounding box extent left of xBaseline rightExtent: INTEGER _ 0 -- bounding box extent right of xBaseline ]; <> Break: TYPE = TiogaItemClass.Break; <<>> <<***** Update entry in display table *****>> StorePageRectangle: PROC [dt: DisplayTable, index: INTEGER, pr: PageRectangle] ; <> <<>> <<***** Partial invalidation of display tables *****>> InvalidateSpan: PROC [dt: DisplayTable, span: TiogaNode.Span]; <> InvalidateChildren: PROC [dt: DisplayTable, parent: TiogaNode.Path]; <> InvalidateBranch: PROC [dt: DisplayTable, node: TiogaNode.Path]; <> <<>> VerticalScroll: PROC [dt: DisplayTable, upLines: INTEGER]; <> <<>> <<***** Coordinate to rectangle mapping *****>> Resolve: PROC [dt: DisplayTable, x, y: INTEGER, useClosest: BOOL _ TRUE] RETURNS [index: INTEGER _ notFound, mappedX, mappedY: INTEGER]; notFound: INTEGER = -1; <> <<>> <<***** Table size management *****>> New: PROC [nEntries: INTEGER] RETURNS [dt: DisplayTable] ; <> Size: PROC [dt: DisplayTable] RETURNS [nEntries: INTEGER] = INLINE {RETURN[dt.objects.maxRectangle+1]}; <> SetSize: PROC [dt: DisplayTable, nEntries: INTEGER]; <> LastIndex: PROC [dt: DisplayTable] RETURNS [lastIndex: INTEGER] = INLINE {RETURN[dt.lastIndexUsed]}; <> SetLastIndex: PROC [dt: DisplayTable, lastIndex: INTEGER] = INLINE {dt.lastIndexUsed _ lastIndex}; <> LastY: PROC [dt: DisplayTable] RETURNS [lastY: INTEGER] = INLINE {RETURN[dt.lastY]}; <> SetLastY: PROC [dt: DisplayTable, lastY: INTEGER] = INLINE {dt.lastY _ lastY}; <> END.