]> git.lyx.org Git - lyx.git/blobdiff - src/lyxcursor.h
Call an update before setting the_locking_inset = 0 as otherwise we
[lyx.git] / src / lyxcursor.h
index 43cbc0980cb8443f472834820c02c41e1500a042..d33515c44df339bc985778d887f2ad9aaf519846 100644 (file)
@@ -1,9 +1,9 @@
 // -*- C++ -*-
 /* This file is part of
- * ====================================================== 
- * 
+ * ======================================================
+ *
  *           LyX, The Document Processor
- *      
+ *
  *           Copyright 1995 Matthias Ettrich
  *           Copyright 1995-2001 The LyX Team.
  *
@@ -25,8 +25,6 @@ class Row;
  */
 class LyXCursor {
 public:
-       /// position in a paragraph
-       typedef lyx::pos_type pos_type;
        ///
        LyXCursor();
        ///
@@ -34,9 +32,9 @@ public:
        ///
        Paragraph * par() const;
        ///
-       void pos(pos_type p);
+       void pos(lyx::pos_type p);
        ///
-       pos_type pos() const;
+       lyx::pos_type pos() const;
        ///
        void boundary(bool b);
        ///
@@ -46,6 +44,10 @@ public:
        ///
        int x() const;
        ///
+       void ix(int i);
+       ///
+       int ix() const;
+       ///
        void x_fix(int i);
        ///
        int x_fix() const;
@@ -54,24 +56,41 @@ public:
        ///
        int y() const;
        ///
+       void iy(int i);
+       ///
+       int iy() const;
+       ///
        void row(Row * r);
        ///
        Row * row() const;
+       ///
+       void irow(Row * r);
+       ///
+       Row * irow() const;
 private:
        /// The paragraph the cursor is in.
        Paragraph * par_;
        /// The position inside the paragraph
-       pos_type pos_;
+       lyx::pos_type pos_;
        ///
        bool boundary_;
        ///
        int x_;
+       /// the x position of the position before the inset when we put
+       /// the cursor on the end of the row before, otherwise equal to x.
+       int ix_;
        ///
        int x_fix_;
        ///
        int y_;
+       /// the y position of the position before the inset when we put
+       /// the cursor on the end of the row before, otherwise equal to y.
+       int iy_;
        ///
        Row * row_;
+       /// the row of the position before the inset when we put
+       /// the cursor on the end of the row before, otherwise equal to row.
+       Row * irow_;
 };
 
 ///
@@ -92,7 +111,7 @@ bool operator!=(LyXCursor const & a, LyXCursor const & b)
 
 ///
 inline
-bool operator<(LyXCursor const & a, LyXCursor const & b) 
+bool operator<(LyXCursor const & a, LyXCursor const & b)
 {
        // Can this be done in a nother way?
        return (a.y() < b.y() && a.pos() < b.pos());
@@ -100,7 +119,7 @@ bool operator<(LyXCursor const & a, LyXCursor const & b)
 
 ///
 inline
-bool operator>(LyXCursor const & a, LyXCursor const & b) 
+bool operator>(LyXCursor const & a, LyXCursor const & b)
 {
        return b < a;
 }