]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_cursor.h
revert most of the stuff that got reverted yesterday but was not
[lyx.git] / src / mathed / math_cursor.h
index f38125aa459c82c4873e85dde7e7cea28523ee9c..ec6ae8934b9bdca751ea773e70dadbcb3528173d 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "math_defs.h"
 #include "math_inset.h"
+#include "math_pos.h"
 #include "LString.h"
 
 class InsetFormulaBase;
@@ -41,32 +42,6 @@ this formula's mathHullInset to the current position.
 */
 
 
-/// Description of a position 
-struct MathCursorPos {
-       /// pointer to an inset
-       MathAtom * par_;
-       /// cell index of a position in this inset
-       MathInset::idx_type idx_;
-       /// position in this cell
-       MathInset::pos_type pos_;
-
-       /// returns cell corresponding to this position
-       MathArray & cell() const;
-       /// returns cell corresponding to this position
-       MathArray & cell(MathInset::idx_type idx) const;
-       /// returns xcell corresponding to this position
-       MathXArray & xcell() const;
-       /// returns xcell corresponding to this position
-       MathXArray & xcell(MathInset::idx_type idx) const;
-};
-
-/// test for equality
-bool operator==(MathCursorPos const &, MathCursorPos const &);
-/// test for unequality
-bool operator<(MathCursorPos const &, MathCursorPos const &);
-
-
-/// see above
 class MathCursor {
 public:
        /// short of anything else reasonable
@@ -127,12 +102,12 @@ public:
        void setPos(int x, int y);
        /// in pixels from top of screen
        void getPos(int & x, int & y);
-       /// 
-       MathAtom & par() const;
+       /// current inset
+       MathInset * par() const;
        /// return the next enclosing grid inset and the cursor's index in it
        MathGridInset * enclosingGrid(idx_type &) const;
        ///
-       InsetFormulaBase const * formula();
+       InsetFormulaBase * formula();
        /// current offset in the current cell
        pos_type pos() const;
        /// current cell
@@ -196,11 +171,9 @@ public:
        ///
        char halign() const;
        ///
-       col_type ncols() const;
-       ///
-       col_type col() const;
+       col_type hullCol() const;
        ///
-       row_type row() const;
+       row_type hullRow() const;
 
        /// make sure cursor position is valid
        void normalize() const;
@@ -273,8 +246,8 @@ private:
        bool goUp();
        /// moves position somehow down
        bool goDown();
-       /// moves position somehow down
-       bool bruteUpDown(int ylow, int yhigh);
+       /// moves position into box
+       bool bruteFind(int xlow, int xhigh, int ylow, int yhigh);
 
        ///
        string macroName() const;
@@ -284,15 +257,13 @@ private:
        void insert(char, MathTextCodes t);
        /// can we enter the inset? 
        bool openable(MathAtom const &, bool selection) const;
-       /// can the setPos routine enter that inset?
-       bool positionable(MathAtom const &, int x, int y) const;
        /// write access to cursor cell position
        pos_type & pos();
        /// write access to cursor cell index
        idx_type & idx();
 
        ///
-       InsetFormulaBase * const formula_;
+       InsetFormulaBase * formula_;
        ///
        MathTextCodes lastcode_;
        // Selection stuff