- int dist(BufferView & bv, int x, int y) const;
-
- /// ascent of this cell above the baseline
- int ascent() const { return dim_.asc; }
- /// descent of this cell below the baseline
- int descent() const { return dim_.des; }
- /// height of the cell
- int height() const { return dim_.asc + dim_.des; }
- /// width of this cell
- int width() const { return dim_.wid; }
- /// dimensions of cell
- Dimension const & dim() const { return dim_; }
- /// dimensions of cell
- void setDim(Dimension const & d) const { dim_ = d; }
+ int dist(BufferView const & bv, int x, int y) const;
+
+ /// minimum ascent offset for superscript
+ int minasc() const { return minasc_; }
+ /// minimum descent offset for subscript
+ int mindes() const { return mindes_; }
+ /// level above/below which super/subscript should extend
+ int slevel() const { return slevel_; }
+ /// additional super/subscript shift
+ int sshift() const { return sshift_; }
+ /// Italic correction as described in InsetMathScript.h
+ int kerning(BufferView const *) const { return kerning_; }
+ ///
+ void swap(MathData & ar) { base_type::swap(ar); }
+
+ /// attach/detach arguments to macros, updating the cur to
+ /// stay visually at the same position (cur==0 is allowed)
+ void updateMacros(Cursor * cur, MacroContext const & mc, UpdateType, int nesting);
+ ///
+ void updateBuffer(ParIterator const &, UpdateType);
+ ///
+ void setBuffer(Buffer & b) { buffer_ = &b; }
+
+protected:
+ /// cached values for super/subscript placement
+ mutable int minasc_;
+ mutable int mindes_;
+ mutable int slevel_;
+ mutable int sshift_;
+ mutable int kerning_;
+ Buffer * buffer_;
+
+ /// cached object that describes typeset data
+ mutable std::map<BufferView*, MathRow> mrow_cache_;