]> git.lyx.org Git - lyx.git/blobdiff - src/lyxcursor.h
some support for matrix operations with maple ('M-x math-extern maple evalm')
[lyx.git] / src / lyxcursor.h
index 8a9ac616e0abd040e81027cc550b9b7efa591a2e..1032055f0e5006f217dfe3fe6ee165907d9a3214 100644 (file)
@@ -5,7 +5,7 @@
  *           LyX, The Document Processor
  *      
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2000 The LyX Team.
+ *           Copyright 1995-2001 The LyX Team.
  *
  * ====================================================== */
 
@@ -16,7 +16,7 @@
 #pragma interface
 #endif
 
-#include "lyxparagraph.h"
+#include "paragraph.h"
 
 struct Row;
 
@@ -24,16 +24,15 @@ struct Row;
  */
 class LyXCursor {
 public:
+       LyXCursor();
        ///
-       void par(LyXParagraph * p);
+       void par(Paragraph * p);
        ///
-       LyXParagraph * par();
+       Paragraph * par() const;
        ///
-       LyXParagraph * par() const;
+       void pos(Paragraph::size_type p);
        ///
-       void pos(LyXParagraph::size_type p);
-       ///
-       LyXParagraph::size_type pos() const;
+       Paragraph::size_type pos() const;
        ///
        void boundary(bool b);
        ///
@@ -53,14 +52,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_;
+       Paragraph::size_type pos_;
        ///
        bool boundary_;
        ///
@@ -89,4 +86,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