DIRECTORY CornerStitching, IO, LinearSolver, Real, Rope, TextNode USING [Ref], TSGraphic USING [Object], TSOutput, TSTypes; TableBase: CEDAR DEFINITIONS = { ROPE: TYPE = Rope.ROPE; RefTable: TYPE = REF Table; Table: TYPE = RECORD [ branch: TextNode.Ref _ NIL, -- Tioga branch containing table boxes in fillInOrder emptyNodeTemplateRoot: TextNode.Ref _ NIL, -- Tioga branch containing a node to copy when creating an empty table node tableGrid: REF CornerStitching.Tesselation _ NIL, newTableGrid: REF CornerStitching.Tesselation _ NIL, backgrounds: LIST OF RefTableBackground _ NIL, newBackgrounds: LIST OF RefTableBackground _ NIL, rowGrids: GridNumber _ 0, columnGrids: GridNumber _ 0, rowGridPositions: REF GridVector _ NIL, colGridPositions: REF GridVector _ NIL, rowConstraints: LIST OF RefConstraint _ NIL, colConstraints: LIST OF RefConstraint _ NIL, rows: LIST OF AttributeElement _ NIL, cols: LIST OF AttributeElement _ NIL, fillInOrder: FillInOrder _ byRowThenColumn, rowAlignment: VerticalAlignment _ center, -- alignment properties colAlignment: HorizontalAlignment _ center, alignChar: CHARACTER _ '., bearoffExtents: TSTypes.Dimensions _ [TSTypes.zeroDimn, TSTypes.zeroDimn, TSTypes.zeroDimn, TSTypes.zeroDimn], gridOverlayThickness: TSTypes.Dimn _ TSTypes.nilDimn, gridOverlayHue: REAL _ 0.0, gridOverlaySaturation: REAL _ 0.0, gridOverlayBrightness: REAL _ 0.5, originX, originY: TSTypes.Dimn _ TSTypes.zeroDimn, tableau: LinearSolver.Tableau ]; RefConstraint: TYPE ~ REF Constraint; Constraint: TYPE ~ RECORD [ equality: BOOLEAN _ TRUE, coefficients: LIST OF Coefficient]; Coefficient: TYPE ~ RECORD [ coefficient: REAL, unknown: ROPE]; AttributeElement: TYPE = RECORD [ grid1, grid2: GridNumber, rowAlignment: VerticalAlignment _ center, -- alignment properties colAlignment: HorizontalAlignment _ center, alignChar: CHARACTER _ '., bearoffExtents: TSTypes.Dimensions _ [TSTypes.nilDimn, TSTypes.nilDimn, TSTypes.nilDimn, TSTypes.nilDimn] ]; GridNumber: TYPE = CARDINAL; GridVector: TYPE = RECORD [ grid: SEQUENCE length: NAT OF TSTypes.Dimn ]; RefTableEntry: TYPE = REF TableEntry; TableEntry: TYPE = RECORD [ top, left, bottom, right: GridNumber, entrySpecs: SELECT boxType: BoxType FROM box => [ node: TextNode.Ref _ NIL, -- the text or graphics contents nodeExtents: TSTypes.Dimensions _ [TSTypes.zeroDimn, TSTypes.zeroDimn, TSTypes.zeroDimn, TSTypes.zeroDimn], -- [left, right, up, down] nodeExtentsValid: BOOLEAN _ FALSE, -- hint rowAlignment: VerticalAlignment _ default, -- alignment properties colAlignment: HorizontalAlignment _ default, alignOnChar: BOOLEAN _ FALSE, alignChar: CHARACTER _ '., alignFirst: BOOLEAN _ TRUE, bearoffExtents: TSTypes.Dimensions _ [TSTypes.nilDimn, TSTypes.nilDimn, TSTypes.nilDimn, TSTypes.nilDimn], tsObject: TSGraphic.Object _ NIL, -- the object representation of node boxExtents: TSTypes.Dimensions _ [TSTypes.zeroDimn, TSTypes.zeroDimn, TSTypes.zeroDimn, TSTypes.zeroDimn], -- [left, right, up, down] xOffset, yOffset: TSTypes.Dimn _ TSTypes.zeroDimn, -- the offset from the nodeExtents origin to the boxExtents alignment point x, y: TSTypes.Dimn _ TSTypes.zeroDimn -- the position of the table entry relative to the table ], rule => [ orientation: Orientation _ horizontal, thickness: TSTypes.Dimn _ TSTypes.zeroDimn ], background => [ hue, saturation, brightness: REAL _ 0.0 ], ENDCASE ]; RefTableBox: TYPE = REF TableBox; TableBox: TYPE = box TableEntry; RefTableRule: TYPE = REF TableRule; TableRule: TYPE = rule TableEntry; RefTableBackground: TYPE = REF TableBackground; TableBackground: TYPE = background TableEntry; BoxType: TYPE = {box, rule, background}; RowOrColumn: TYPE = {row, column}; FillInOrder: TYPE = {byRowThenColumn, byColumnThenRow}; HorizontalAlignment: TYPE = {default, flushLeft, flushRight, center}; VerticalAlignment: TYPE = {default, flushTop, flushBottom, center, topBaseline, bottomBaseline, centerOnTopBaseline, centerOnBottomBaseline}; Orientation: TYPE = {horizontal, vertical}; ImplementationError: ERROR [ROPE]; UnimplementedCase: ERROR; BoxFromTile: PROCEDURE [tile: CornerStitching.TilePtr] RETURNS [box: RefTableBox]; TileFromBox: PROCEDURE [box: RefTableBox] RETURNS [tile: CornerStitching.TilePtr]; BranchToTable: PROCEDURE [node: TextNode.Ref] RETURNS [table: RefTable]; TableToBranch: PROCEDURE [table: RefTable] RETURNS [branch: TextNode.Ref]; TableBoxToRope: PROCEDURE [box: RefTableEntry] RETURNS [rope: ROPE _ NIL]; InsertEntryInGrid: PROCEDURE [table: RefTable, entry: RefTableEntry]; InsideGridToRect: PROCEDURE [left, top, right, bottom: GridNumber] RETURNS [rect: CornerStitching.Rect]; OnGridToRect: PROCEDURE [left, top, right, bottom: GridNumber] RETURNS [rect: CornerStitching.Rect]; EnumeratedEntryProc: TYPE = PROCEDURE [table: RefTable, entry: RefTableEntry] RETURNS [stop: BOOLEAN _ FALSE]; EnumerateByRows: PROCEDURE [table: RefTable, entryProc: EnumeratedEntryProc]; EnumerateByColumns: PROCEDURE [table: RefTable, entryProc: EnumeratedEntryProc]; EnumerateTable: PROCEDURE [table: RefTable, entryProc: EnumeratedEntryProc, left: GridNumber _ FIRST[GridNumber], right: GridNumber _ LAST[GridNumber], top: GridNumber _ FIRST[GridNumber], bottom: GridNumber _ LAST[GridNumber]]; WithinGridLines: PROCEDURE [entry: RefTableBox, which: RowOrColumn, grid1, grid2: GridNumber] RETURNS [BOOLEAN]; }. ‚TableBase.Mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Rick Beach, February 18, 1985 10:04:43 pm PST Κ`˜™Jšœ Οmœ1™