2002-08-04 23:11:50 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file lyxcursor.C
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2002-08-04 23:11:50 +00:00
|
|
|
|
* \author Matthias Ettrich
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-08-04 23:11:50 +00:00
|
|
|
|
*/
|
2000-06-08 23:16:16 +00:00
|
|
|
|
|
2000-06-15 15:54:05 +00:00
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2000-06-08 23:16:16 +00:00
|
|
|
|
#include "lyxcursor.h"
|
|
|
|
|
|
|
|
|
|
|
2001-08-06 19:12:46 +00:00
|
|
|
|
LyXCursor::LyXCursor()
|
2003-05-27 17:29:03 +00:00
|
|
|
|
: par_(), pos_(0), boundary_(false),
|
2003-09-02 17:08:54 +00:00
|
|
|
|
x_(0), x_fix_(0), y_(0)
|
2001-08-06 19:12:46 +00:00
|
|
|
|
{}
|
2001-01-08 14:19:29 +00:00
|
|
|
|
|
|
|
|
|
|
2003-04-09 09:15:20 +00:00
|
|
|
|
void LyXCursor::par(ParagraphList::iterator pit)
|
2000-06-08 23:16:16 +00:00
|
|
|
|
{
|
2003-04-09 09:15:20 +00:00
|
|
|
|
par_ = pit;
|
2000-06-08 23:16:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-04-09 09:15:20 +00:00
|
|
|
|
ParagraphList::iterator LyXCursor::par() const
|
2000-06-08 23:16:16 +00:00
|
|
|
|
{
|
|
|
|
|
return par_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-11-27 10:34:16 +00:00
|
|
|
|
void LyXCursor::pos(lyx::pos_type p)
|
2000-06-08 23:16:16 +00:00
|
|
|
|
{
|
|
|
|
|
pos_ = p;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-11-27 10:34:16 +00:00
|
|
|
|
lyx::pos_type LyXCursor::pos() const
|
2000-06-08 23:16:16 +00:00
|
|
|
|
{
|
|
|
|
|
return pos_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-03-21 17:27:08 +00:00
|
|
|
|
void LyXCursor::boundary(bool b)
|
2000-06-08 23:16:16 +00:00
|
|
|
|
{
|
|
|
|
|
boundary_ = b;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool LyXCursor::boundary() const
|
|
|
|
|
{
|
|
|
|
|
return boundary_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LyXCursor::x(int n)
|
|
|
|
|
{
|
|
|
|
|
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_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2000-09-29 18:44:07 +00:00
|
|
|
|
void LyXCursor::y(int i)
|
2000-06-08 23:16:16 +00:00
|
|
|
|
{
|
|
|
|
|
y_ = i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2000-09-29 18:44:07 +00:00
|
|
|
|
int LyXCursor::y() const
|
2000-06-08 23:16:16 +00:00
|
|
|
|
{
|
|
|
|
|
return y_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-06-26 09:42:28 +00:00
|
|
|
|
bool operator==(LyXCursor const & a, LyXCursor const & b)
|
|
|
|
|
{
|
|
|
|
|
return a.par() == b.par()
|
|
|
|
|
&& a.pos() == b.pos()
|
|
|
|
|
&& a.boundary() == b.boundary();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool operator!=(LyXCursor const & a, LyXCursor const & b)
|
|
|
|
|
{
|
|
|
|
|
return !(a == b);
|
|
|
|
|
}
|
|
|
|
|
|