2002-08-04 23:11:50 +00:00
|
|
|
/**
|
|
|
|
* \file lyxcursor.C
|
|
|
|
* Copyright 1995-2001 the LyX Team
|
|
|
|
* Read the file COPYING
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
2002-08-04 23:11:50 +00:00
|
|
|
* \author Matthias Ettrich
|
|
|
|
*/
|
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-06-27 08:38:41 +00:00
|
|
|
x_(0), ix_(0), x_fix_(0), y_(0), iy_(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_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-04-12 15:59:03 +00:00
|
|
|
void LyXCursor::ix(int n)
|
|
|
|
{
|
|
|
|
ix_ = n;
|
|
|
|
}
|
|
|
|
|
|
|
|
int LyXCursor::ix() const
|
|
|
|
{
|
|
|
|
return ix_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-06-08 23:16:16 +00:00
|
|
|
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_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-04-11 09:53:23 +00:00
|
|
|
void LyXCursor::iy(int i)
|
|
|
|
{
|
|
|
|
iy_ = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int LyXCursor::iy() const
|
|
|
|
{
|
|
|
|
return iy_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|