-/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
- *
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2000 The LyX Team.
+/**
+ * \file lyxcursor.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * ====================================================== */
+ * \author Lars Gullik Bjønnes
+ * \author Matthias Ettrich
+ * \author André Pönitz
+ * \author Jürgen Vigna
+ *
+ * Full author contact details are available in file CREDITS.
+ */
#include <config.h>
#include "lyxcursor.h"
-void LyXCursor::par(LyXParagraph * p)
-{
- par_ = p;
-}
+LyXCursor::LyXCursor()
+ : par_(-1), pos_(0), boundary_(false), x_(0), y_(0)
+{}
-LyXParagraph * LyXCursor::par()
+void LyXCursor::par(lyx::paroffset_type par)
{
- return par_;
+ par_ = par;
}
-LyXParagraph * LyXCursor::par() const
+lyx::paroffset_type LyXCursor::par() const
{
return par_;
}
-void LyXCursor::pos(LyXParagraph::size_type p)
+void LyXCursor::pos(lyx::pos_type p)
{
pos_ = p;
}
-LyXParagraph::size_type LyXCursor::pos() const
+lyx::pos_type LyXCursor::pos() const
{
return pos_;
}
-void LyXCursor::boundary(bool b)
+void LyXCursor::boundary(bool b)
{
boundary_ = b;
}
x_ = n;
}
+
int LyXCursor::x() const
{
return x_;
}
-void LyXCursor::x_fix(int i)
-{
- x_fix_ = i;
-}
-
-
-int LyXCursor::x_fix() const
-{
- return x_fix_;
-}
-
-
-void LyXCursor::y(unsigned long i)
+void LyXCursor::y(int i)
{
y_ = i;
}
-unsigned long LyXCursor::y() const
+int LyXCursor::y() const
{
return y_;
}
-void LyXCursor::row(Row * r)
+bool operator==(LyXCursor const & a, LyXCursor const & b)
{
- row_ = r;
+ return a.par() == b.par()
+ && a.pos() == b.pos()
+ && a.boundary() == b.boundary();
}
-Row * LyXCursor::row()
+bool operator!=(LyXCursor const & a, LyXCursor const & b)
{
- return row_;
+ return !(a == b);
}
-
-Row * LyXCursor::row() const
-{
- return row_;
-}