]> git.lyx.org Git - lyx.git/blobdiff - src/lyxcursor.h
fix typo that put too many include paths for most people
[lyx.git] / src / lyxcursor.h
index bb5e1f6ae8a13004daaee4f7c3eeb259d9d5f1f0..c36812befd3ac70d82f49f08ab19a6df233d88ab 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.
  *
 #pragma interface
 #endif
 
-#include "lyxparagraph.h"
+#include "support/types.h"
 
-struct Row;
+class Paragraph;
+class Row;
 
 /** All these variables should be explained. Matthias?
  */
 class LyXCursor {
 public:
-       LyXCursor();
        ///
-       void par(LyXParagraph * p);
+       LyXCursor();
        ///
-       LyXParagraph * par();
+       void par(Paragraph * p);
        ///
-       LyXParagraph * par() const;
+       Paragraph * par() const;
        ///
-       void pos(LyXParagraph::size_type p);
+       void pos(lyx::pos_type p);
        ///
-       LyXParagraph::size_type pos() const;
+       lyx::pos_type pos() const;
        ///
        void boundary(bool b);
        ///
@@ -54,14 +54,12 @@ public:
        ///
        void row(Row * r);
        ///
-       Row * row();
-       ///
        Row * row() const;
 private:
        /// The paragraph the cursor is in.
-       LyXParagraph * par_;
+       Paragraph * par_;
        /// The position inside the paragraph
-       LyXParagraph::size_type pos_;
+       lyx::pos_type pos_;
        ///
        bool boundary_;
        ///
@@ -90,4 +88,34 @@ bool operator!=(LyXCursor const & a, LyXCursor const & b)
        return !(a == b);
 }
 
+///
+inline
+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());
+}
+
+///
+inline
+bool operator>(LyXCursor const & a, LyXCursor const & b)
+{
+       return b < a;
+}
+
+///
+inline
+bool operator>=(LyXCursor const & a, LyXCursor const & b)
+{
+       return !(a < b);
+}
+
+
+///
+inline
+bool operator<=(LyXCursor const & a, LyXCursor const & b)
+{
+       return !(a > b);
+}
+
 #endif