]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathRow.h
typo
[lyx.git] / src / mathed / MathRow.h
index cb4c8614cd38f5993cc31a8821ce5cf501634724..9efab92e8535c03c52c73ddab6ffd3ad5200a10a 100644 (file)
 #ifndef MATH_ROW_H
 #define MATH_ROW_H
 
-#include "InsetMath.h"
 #include "MathClass.h"
 
 #include "ColorCode.h"
+#include "Dimension.h"
 
 #include "support/docstring.h"
 
 namespace lyx {
 
 class BufferView;
-class Dimension;
+class InsetMath;
+class MathData;
 class MetricsInfo;
 class PainterInfo;
 
-class InsetMath;
-class MathData;
+enum class marker_type : int;
 
 /*
  * While for editing purpose it is important that macros are counted
@@ -65,10 +65,10 @@ public:
                MathClass mclass;
                /// the spacing around the element
                int before, after;
-               /// count wether the current mathdata is nested in macro(s)
+               /// count whether the current mathdata is nested in macro(s)
                int macro_nesting;
                /// Marker type
-               InsetMath::marker_type marker;
+               marker_type marker;
 
                /// When type is INSET
                /// the math inset (also for BEGIN and END)
@@ -86,7 +86,9 @@ public:
        };
 
        ///
-       MathRow() {};
+       MathRow() {}
+       ///
+       MathRow(Dimension const & dim) : caret_dim(dim) {}
        ///
        typedef std::vector<Element> Elements;
        ///
@@ -110,14 +112,18 @@ public:
        // compute the spacings.
        MathRow(MetricsInfo & mi, MathData const * ar);
 
-       // this returns true if the caret is here
-       bool metrics(MetricsInfo & mi, Dimension & dim);
+       //
+       void metrics(MetricsInfo & mi, Dimension & dim);
        //
        void draw(PainterInfo & pi, int const x, int const y) const;
 
        /// superscript kerning
        int kerning(BufferView const *) const;
 
+       /// useful when the caret visits this cell
+       Dimension caret_dim;
+
+
 private:
        // Index of the first inset element before position i
        int before(int i) const;