-- 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: BOOLTRUE]
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]];
copy old info (someday, figure out how to do a safe BLT here instead)
FOR i: INTEGER IN [0..MIN[nEntries, dt.lastIndexUsed]) DO
dt.objects[i] ← oldObjects[i];
ENDLOOP;
END;
END.