]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_cursor.h
oh well
[lyx.git] / src / mathed / math_cursor.h
index 6e2742fd6505e64415185e9b946663798f44836f..6d8748a20377fabd78ec40a1b1473b788c280604 100644 (file)
@@ -2,7 +2,7 @@
 /*
  *  File:        math_cursor.h
  *  Purpose:     Declaration of interaction classes for mathed
- *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx> 
+ *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
  *  Created:     January 1996
  *  Description: MathCursor control all user interaction
  *
@@ -106,6 +106,8 @@ public:
        MathInset * par() const;
        /// return the next enclosing grid inset and the cursor's index in it
        MathGridInset * enclosingGrid(idx_type &) const;
+       /// return the next enclosing grid inset and the cursor's index in it
+       void popToEnclosingGrid();
        ///
        InsetFormulaBase * formula();
        /// current offset in the current cell
@@ -124,9 +126,11 @@ public:
        bool toggleLimits();
        /// interpret name a name of a macro
        void macroModeClose();
-       ///
+       /// are we currently typing the name of a macro?
        bool inMacroMode() const;
-       
+       /// are we currently typing '#1' or '#2' or...?
+       bool inMacroArgMode() const;
+
        // Local selection methods
        ///
        bool selection() const;
@@ -156,7 +160,7 @@ public:
        void handleNest(MathInset * p);
        /// splits cells and shifts right part to the next cell
        void splitCell();
-       /// splits line and insert new row of cell 
+       /// splits line and insert new row of cell
        void breakLine();
        /// read contents of line into an array
        void readLine(MathArray & ar) const;
@@ -183,10 +187,12 @@ public:
 
        /// make sure cursor position is valid
        void normalize();
+       /// mark current cursor trace for redraw
+       void touch();
        ///
        UpdatableInset * asHyperActiveInset() const;
 
-       /// enter a MathInset 
+       /// enter a MathInset
        void push(MathAtom & par);
        /// enter a MathInset from the front
        void pushLeft(MathAtom & par);
@@ -219,24 +225,27 @@ public:
        /// returns the normalized anchor of the selection
        MathCursorPos normalAnchor() const;
 
-       /// path of positions the cursor had to go if it were leving each inset
-       cursor_type Cursor_;
-       /// path of positions the anchor had to go if it were leving each inset
-       mutable cursor_type Anchor_;
-
        /// reference to the last item of the path, i.e. "The Cursor"
        MathCursorPos & cursor();
        /// reference to the last item of the path, i.e. "The Cursor"
        MathCursorPos const & cursor() const;
 
+       /// describe the situation
+       string info() const;
        /// dump selection information for debugging
        void seldump(char const * str) const;
        /// dump selection information for debugging
        void dump(char const * str) const;
        ///
        void stripFromLastEqualSign();
-       /// moves on 
+       /// moves on
        void setSelection(cursor_type const & where, size_type n);
+       ///
+       void insert(char);
+
+       /// hack for reveal codes
+       void markInsert();
+       void markErase();
 
        ///
        friend class Selection;
@@ -261,16 +270,20 @@ private:
        MathInset::difference_type macroNamePos() const;
        ///
        void insert(char, MathTextCodes t);
-       /// can we enter the inset? 
+       /// can we enter the inset?
        bool openable(MathAtom const &, bool selection) const;
        /// write access to cursor cell position
        pos_type & pos();
        /// write access to cursor cell index
        idx_type & idx();
 
-       ///
+       /// path of positions the cursor had to go if it were leving each inset
+       cursor_type Cursor_;
+       /// path of positions the anchor had to go if it were leving each inset
+       mutable cursor_type Anchor_;
+       /// pointer to enclsing LyX inset
        InsetFormulaBase * formula_;
-       ///
+       /// text code of last char entered
        MathTextCodes lastcode_;
        // Selection stuff
        /// do we currently select