]> git.lyx.org Git - lyx.git/blobdiff - src/lyxcursor.h
more keyboard/keysym changes
[lyx.git] / src / lyxcursor.h
index 0a2af4cba0ce01d766bea41e55b7c9fcc976d9f9..60ad1e0bfbe4386b2fc85d2dd55c3fc1703c4f4a 100644 (file)
 #ifndef LYXCURSOR_H
 #define LYXCURSOR_H
 
+#ifdef __GNUG__
+#pragma interface
+#endif
+
 #include "lyxparagraph.h"
 
 struct Row;
 
 /** All these variables should be explained. Matthias?
  */
-struct LyXCursor {
+class LyXCursor {
+public:
+       ///
+       void par(LyXParagraph * p);
+       ///
+       LyXParagraph * par();
+       ///
+       LyXParagraph * par() const;
+       ///
+       void pos(LyXParagraph::size_type p);
+       ///
+       LyXParagraph::size_type pos() const;
+       ///
+       void boundary(bool b);
+       ///
+       bool boundary() const;
        ///
-       LyXParagraph * par;
+       void x(int i);
        ///
-       LyXParagraph::size_type pos;
+       int x() const;
        ///
-       int x;
+       void x_fix(int i);
        ///
-       int x_fix;
+       int x_fix() const;
        ///
-       unsigned long y;
+       void y(unsigned long i);
        ///
-       Row * row;
+       unsigned long y() const;
        ///
-       inline bool operator==(const LyXCursor &a) const
-               { return (a.par == par) && (a.pos == pos); }
-       inline bool operator!=(const LyXCursor &a) const
-               { return (a.par != par) || (a.pos != pos); }
+       void row(Row * r);
+       ///
+       Row * row();
+       ///
+       Row * row() const;
+private:
+       /// The paragraph the cursor is in.
+       LyXParagraph * par_;
+       /// The position inside the paragraph
+       LyXParagraph::size_type pos_;
+       ///
+       bool boundary_;
+       ///
+       int x_;
+       ///
+       int x_fix_;
+       ///
+       unsigned long y_;
+       ///
+       Row * row_;
 };
 
+///
+inline
+bool operator==(LyXCursor const & a, LyXCursor const & b)
+{
+       return (a.par() == b.par())
+               && (a.pos() == b.pos())
+               && a.boundary() == b.boundary();
+}
+
+///
+inline
+bool operator!=(LyXCursor const & a, LyXCursor const & b)
+{
+       return !(a == b);
+}
+
 #endif