DIRECTORY BoxTree, InternalExpr, ImagerFont; BoxTreeImpl: CEDAR PROGRAM ~ BEGIN EXPR: TYPE ~ InternalExpr.EXPR; BoxTreeRep: TYPE ~ RECORD [ boundbox: ImagerFont.Extents, -- size of bounding box( what type should this be) offset: Vector.VEC; -- offset from origin of parent box subBoxes: LIST OF BoxTree.BOXTREE, -- list of boxes bound by this box parentBox: BoxTree.BOXTREE, -- parent bounding box style: BoxTree.STYLE, expression: EXPR -- pointer to expression bound by this box ]; Format: PUBLIC PROC [expr: InternalExpr.EXPR, style: STYLE] RETURNS [BOXTREE] ~ { box : BoxTree _ NewBox[expr, style]; --create a new scaled box with pointer to expr box.subBoxes _ GetFormat[expr]; --get formating information for expr from data base. FOR l: LIST OF BoxTree.BOXTREE _ box.subBox, l.next DO { l.first.style.scale _ l.first.style.scale*box.style.scale; l.first.parentBox _ box; l.first.subBoxes _ Format[l.first.expression, l.first.style]; }; ENDLOOP; IF box.subBox THEN box.boundBox _ ComputeBox[box.subBox] ELSE box.boundBox _ ; }; Paint: PUBLIC PROC [boxTree: BOXTREE, context: Imager.Context, selections: LIST OF Selection]; NewBox: PROC [expr: InternalExpr.EXPR, style: STYLE] RETURNS [BOXTREE] ~ { Return[NEW[BoxTreeRep _ [style: style, expression: expr]]]; }; GetFormat: PROC [expr: InternalExpr.EXPR] RETURNS [LIST OF BOXTREE] ~ { }; END. ’BoxTreeImpl.mesa Mcisaac, June 30, 1987 5:56:57 pm PDT Implementation for Displaying Mathematical Expressions Type Definitions Display & Formatting returns a boxed expression formatted in user space paints a boxed expression in the imager space given by context create a new scaled box with pointer to expr returns a boxTree with expr, scale and looks field's determined from the data base Κq˜JšΟc™Icodešœ%™%K™JšΟa6™6K™šΠkr ˜ JšΠrt˜Kšœ ˜ Kšœ ˜ —K˜KšΟn œΟkœ’˜šœ’˜K˜Kš‘™™Kš’œ’œ’œ˜J˜K˜K˜šœ ’œ˜š’œ˜Kšœ2˜QKšœ’œ#˜8Kšœ ’œ’œ ’œ"˜FKšœ’œ˜2Jšœ’œ˜Kšœ ’œ*˜™>K˜K˜——š ‘œ’œ’œ ’œ’œ’œ˜JKšœ,™,K˜Kšœ’œ1˜;Kšœ˜—K˜K˜š‘ œ’œ’œ’œ’œ’œ’œ˜GKšœR™RK˜—K˜K˜—K˜Kš’œ˜K˜—…—` c