<<-- TiogaDisplayTableImpl.mesa; Written by S. McGregor, June 1983>> <<-- Edited by McGregor, August 23, 1983 4:01 pm>> DIRECTORY TiogaDisplayTable, TiogaNode USING [Location, Path, Span]; TiogaDisplayTableImpl: CEDAR PROGRAM EXPORTS TiogaDisplayTable = BEGIN OPEN TiogaDisplayTable; <<***** Partial invalidation of display tables *****>> StorePageRectangle: PUBLIC PROC [dt: DisplayTable, index: INTEGER, pr: PageRectangle] = BEGIN IF index>dt.objects.maxRectangle THEN SetSize[dt, MIN[1, dt.objects.maxRectangle]*2]; dt.objects[index] _ pr; dt.lastY _ MAX[dt.lastY, pr.yBaseline+pr.bottomExtent]; dt.lastIndexUsed _ MAX[dt.lastIndexUsed, index]; END; <<>> <<***** Partial invalidation of display tables *****>> InvalidateSpan: PUBLIC PROC [dt: DisplayTable, span: TiogaNode.Span] = BEGIN ERROR; -- Not Yet Implemented END; InvalidateChildren: PUBLIC PROC [dt: DisplayTable, parent: TiogaNode.Path] = BEGIN <<-- invalidate lines for children of node>> ERROR; -- Not Yet Implemented END; InvalidateBranch: PUBLIC PROC [dt: DisplayTable, node: TiogaNode.Path] = BEGIN <<-- invalidate lines for children of node>> ERROR; -- Not Yet Implemented END; <<>> VerticalScroll: PUBLIC PROC [dt: DisplayTable, upLines: INTEGER] = BEGIN ERROR; -- Not Yet Implemented END; <<>> <<***** Coordinate to rectangle mapping *****>> Resolve: PUBLIC PROC [dt: DisplayTable, x, y: INTEGER, useClosest: BOOL _ TRUE] RETURNS [index: INTEGER _ notFound, mappedX, mappedY: INTEGER] = BEGIN ERROR; -- Not Yet Implemented END; <<>> <<***** Table size management *****>> New: PUBLIC PROC [nEntries: INTEGER] RETURNS [dt: DisplayTable] = BEGIN dt _ NEW[DisplayTableRec]; dt.objects _ NEW[PageRectangleSequenceRec[nEntries]]; END; SetSize: PUBLIC PROC [dt: DisplayTable, nEntries: INTEGER] = BEGIN oldObjects: REF PageRectangleSequenceRec _ dt.objects; dt.objects _ NEW[PageRectangleSequenceRec[nEntries]]; <> FOR i: INTEGER IN [0..MIN[nEntries, dt.lastIndexUsed]) DO dt.objects[i] _ oldObjects[i]; ENDLOOP; END; END.