]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_scriptinset.h
oh well
[lyx.git] / src / mathed / math_scriptinset.h
index f11c6002505b9b40d1c87b0d7296fc1f63ff9151..29049e9e27774eb60d0bfbfc7a52ff5942f10820 100644 (file)
@@ -28,30 +28,32 @@ public:
        void metrics(MathMetricsInfo const & st) const;
        ///
        void draw(Painter &, int x, int y) const;
+       ///
+       void metricsT(TextMetricsInfo const & st) const;
+       ///
+       void drawT(TextPainter &, int x, int y) const;
 
        ///
        void metrics(MathInset const * nuc, MathMetricsInfo const & st) const;
        ///
        void draw(MathInset const * nuc, Painter &, int x, int y) const;
        ///
-       int ascent(MathInset const * nuc) const;
+       void metricsT(MathInset const * nuc, TextMetricsInfo const & st) const;
+       ///
+       void drawT(MathInset const * nuc, TextPainter &, int x, int y) const;
        ///
-       int descent(MathInset const * nuc) const;
+       int ascent2(MathInset const * nuc) const;
        ///
-       int width(MathInset const * nuc) const;
+       int descent2(MathInset const * nuc) const;
+       ///
+       int width2(MathInset const * nuc) const;
 
        ///
        bool idxLeft(idx_type &, pos_type &) const;
        ///
        bool idxRight(idx_type &, pos_type &) const;
-       ///
-       bool idxFirstUp(idx_type &, pos_type &) const;
-       ///
-       bool idxFirstDown(idx_type &, pos_type &) const;
-       ///
-       bool idxLastUp(idx_type &, pos_type &) const;
-       ///
-       bool idxLastDown(idx_type &, pos_type &) const;
+       /// can we enter this cell?
+       bool validCell(idx_type i) const { return script_[i]; }
 
        /// identifies scriptinsets
        MathScriptInset const * asScriptInset() const;
@@ -76,14 +78,14 @@ public:
        bool hasDown() const;
        /// do we have a script?
        bool has(bool up) const;
+       /// do we have a anything?
+       bool empty() const;
        /// remove script
        void removeScript(bool up);
        /// remove script
        void removeEmptyScripts();
        /// make sure a script is accessible
        void ensure(bool up);
-       /// only true if we are _in_ sub- or superscript, not in the convex hull
-       bool covers(int x, int y) const;
 
        // call these methods ...2 to make compaq cxx in anal mode happy...
        /// suppresses empty braces if necessary
@@ -115,12 +117,11 @@ private:
        bool hasLimits(MathInset const * nuc) const;
 
        /// possible subscript (index 0) and superscript (index 1)
-       bool script_[2]; 
+       bool script_[2];
        /// 1 - "limits", -1 - "nolimits", 0 - "default"
        int limits_;
-       /// cached MathMetricsInfo
-       mutable MathMetricsInfo mi_;
+       /// cached font
+       mutable LyXFont font_;
 };
 
 #endif
-