X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fmath_gridinset.h;h=101d506fc3cf8618f4e37afa20ea31b01e75ee06;hb=c9c3b9b447c3f99a059730e7e4a6caf95496221a;hp=6216e55780108cc811aa556a85d5a98e326eb052;hpb=51e0c8bd1f265913a64fb46bc61fcfdb26f02303;p=lyx.git diff --git a/src/mathed/math_gridinset.h b/src/mathed/math_gridinset.h index 6216e55780..101d506fc3 100644 --- a/src/mathed/math_gridinset.h +++ b/src/mathed/math_gridinset.h @@ -3,6 +3,7 @@ #define MATH_GRID_H #include "math_nestinset.h" +#include "LString.h" #ifdef __GNUG__ #pragma interface @@ -20,15 +21,15 @@ class MathGridInset : public MathNestInset { struct RowInfo { /// RowInfo(); - /// - int descent_; - /// - int ascent_; - /// - int offset_; - /// + /// cached descent + mutable int descent_; + /// cached ascent + mutable int ascent_; + /// cached offset + mutable int offset_; + /// hline abow this row? bool upperline_; - /// + /// hline below this row? bool lowerline_; }; @@ -40,11 +41,11 @@ class MathGridInset : public MathNestInset { char h_align_; /// cache for drawing int h_offset; - /// - int width_; - /// - int offset_; - /// + /// cached width + mutable int width_; + /// cached offset + mutable int offset_; + /// bool leftline_; /// bool rightline_; @@ -52,15 +53,13 @@ class MathGridInset : public MathNestInset { public: /// - MathGridInset(int m, int n, string const & nm); - /// - virtual MathInset * clone() const = 0; + MathGridInset(int m, int n); /// void write(std::ostream &, bool fragile) const; /// - void metrics(MathStyles st); + void metrics(MathStyles st) const; /// - void draw(Painter &, int, int); + void draw(Painter &, int x, int y) const; /// void halign(string const &); /// @@ -88,6 +87,10 @@ public: int col(int idx) const { return idx % ncols(); } /// int row(int idx) const { return idx / ncols(); } + /// + int cellXOffset(int idx) const; + /// + int cellYOffset(int idx) const; /// bool idxUp(int &, int &) const;