X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxcursor.h;h=cc7cb9ef90b91f22d5755a4db3353a2b323314ca;hb=8d1c58af82d1fc356f470dff97878ab7c3e8a2fe;hp=a6ffefc9adbbe45f281fa2c4c2cb5a38abf0e616;hpb=7fa7d437404b2bb93bacedd41319e18955bc8d39;p=lyx.git diff --git a/src/lyxcursor.h b/src/lyxcursor.h index a6ffefc9ad..cc7cb9ef90 100644 --- a/src/lyxcursor.h +++ b/src/lyxcursor.h @@ -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,25 +16,25 @@ #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