* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-2000 The LyX Team.
+ * Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
#pragma interface
#endif
-#include "lyxparagraph.h"
+#include "paragraph.h"
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);
///
///
int x_fix() const;
///
- void y(unsigned long i);
+ void y(int i);
///
- unsigned long y() const;
+ int y() const;
///
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_;
///
///
int x_fix_;
///
- unsigned long y_;
+ int y_;
///
Row * row_;
};
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