DIRECTORY TiogaNode USING [Location, Ref, RefBranchNode, Span]; TiogaDisplayTable: CEDAR DEFINITIONS = BEGIN 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 [ -- 15 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 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..2048) _ 0, -- unused bits yOffset: INTEGER _ 0, -- displacement from top of parent (viewer for top level) xOffset: INTEGER _ 0, -- displacement from left edge of parent (viewer for top level) width: INTEGER _ 0, -- width of PageRectangle height: INTEGER _ 0, -- height of PageRectangle yBaseline: INTEGER _ 0, -- baseline displacement from top of PageRectangle xBaseline: INTEGER _ 0 -- baseline displacement from left of PageRectangle ]; Break: TYPE = { eon, cr, wrap, hyphen } _ eon; StorePageRectangle: PROC [dt: DisplayTable, index: INTEGER, pr: PageRectangle] ; InvalidateSpan: PROC [dt: DisplayTable, span: TiogaNode.Span]; InvalidateChildren: PROC [dt: DisplayTable, parent: TiogaNode.Ref]; InvalidateBranch: PROC [dt: DisplayTable, node: TiogaNode.RefBranchNode]; VerticalScroll: PROC [dt: DisplayTable, upLines: INTEGER]; Resolve: PROC [dt: DisplayTable, x, y: INTEGER, useClosest: BOOL _ TRUE] RETURNS [index: INTEGER _ notFound, mappedX, mappedY: INTEGER]; notFound: INTEGER = -1; 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.  -- TiogaDisplayTable.mesa; Written by S. McGregor, May 1983 -- Edited by McGregor, July 11, 1983 11:10 am The data structures herein are used to describe the layout of the nodes in a displayed page. They are typically used for mouse resolving, incremental redisplay and scrolling. The screen layout is assumed to be non-overlapping rectangles, each representing an entire item or branch node, or a span within a text or list node. This data structure may be recursively applied by clients (such as box nodes) who wish to simulate page layout within the box node. ***** Basic DisplayTable data structures ***** ***** Update entry in display table ***** Store a new value in the table, making room for more entries if needed, and update the lastIndexUsed and lastY fields. ***** Partial invalidation of display tables ***** Invalidate table entries contained within the span Invalidate table entries contained within the children of the parent node Invalidate table entries contained within the branch Update the line table in case of a scrolling operation. If upLines is negative then table will be scrolled downward. Invalidated table entries will be set to startPos [NIL, 0], and yOffsets will be adjusted. ***** Coordinate to rectangle mapping ***** Map DisplayTable relative coordinates to the corresponding selectable display rectangle. If useClosest is TRUE, then the algorithm will choose the closest rectangle in the event that the coordinates are not contained within any rectangle. [needs refinement -SM] ***** Table size management ***** Return a new DisplayTable with room for at least nEntries. Return the current allocated size of the display table. Reallocate the table to a new size with space to hold up to nEntries. New entries are marked valid with startPos [NIL, 0]. Return the index of the last entry in the table (client maintained). Set the index of the last entry in the table (client maintained). Return the lastY value for the table (client maintained). Set the lastY value for the table (client maintained). ÊȘJšÏc3œ™;Jšœ™-J˜šÏk ˜ Jšœ žœ&˜5J˜—Jšœžœž˜,J˜JšË™ËJ™šœ.™.J™Jšœžœžœ˜)šœžœžœ˜ Jšœžœ˜Jšœžœ˜Jšœ žœ˜%J˜J˜—šœžœžœ˜)Jšžœžœžœ˜>Jšœ˜—J˜š œžœžœž œžœ ˜˜YJšœ˜(Jšœ žœ9˜QJšœ žœ?˜WJšœžœ˜/Jšœžœ˜1Jšœ žœ2˜KJšœ žœ3˜LJ˜J˜—Jšœžœ#˜.—J™šœ)™)J˜šÏnœžœžœ˜PJšœv™v——J™šœ2™2J˜šŸœžœ*˜>Jšœ2™2J˜—šŸœžœ+˜CJšœI™I—J˜šŸœžœ3˜IJšœ4™4J™—šŸœžœžœ˜:Jšœªžœ%™Ò——J™šœ+™+J˜š Ÿœžœžœžœžœ˜HJšžœ žœžœ˜?Jšœ žœ˜Jšœˆ™ˆ——J™šœ!™!J˜šŸœžœ žœžœ˜:Jšœ:™:J˜—š Ÿœžœžœ žœž˜BJšœžœ˜$Jšœ7™7J˜—šŸœžœžœ˜4Jšœsžœ™{J˜—š Ÿ œžœžœ žœž˜HJšœžœ˜JšœD™DJ˜—šŸ œžœžœž˜BJšœ˜JšœA™AJ˜—š Ÿœžœžœ žœž˜@Jšœžœ ˜Jšœ9™9J˜—šŸœžœžœž˜:Jšœ˜Jšœ6™6J˜——Jšžœ˜J˜J˜—…—  r