]> git.lyx.org Git - lyx.git/blob - src/lyxcursor.C
Point fix, earlier forgotten
[lyx.git] / src / lyxcursor.C
1 /**
2  * \file lyxcursor.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  * \author Matthias Ettrich
8  * \author André Pönitz
9  * \author Jürgen Vigna
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #include <config.h>
15
16 #include "lyxcursor.h"
17
18
19 LyXCursor::LyXCursor()
20         : par_(), pos_(0), boundary_(false),
21           x_(0), x_fix_(0), y_(0)
22 {}
23
24
25 void LyXCursor::par(ParagraphList::iterator pit)
26 {
27         par_ = pit;
28 }
29
30
31 ParagraphList::iterator LyXCursor::par() const
32 {
33         return par_;
34 }
35
36
37 void LyXCursor::pos(lyx::pos_type p)
38 {
39         pos_ = p;
40 }
41
42
43 lyx::pos_type LyXCursor::pos() const
44 {
45         return pos_;
46 }
47
48
49 void LyXCursor::boundary(bool b)
50 {
51         boundary_ = b;
52 }
53
54
55 bool LyXCursor::boundary() const
56 {
57         return boundary_;
58 }
59
60
61 void LyXCursor::x(int n)
62 {
63         x_ = n;
64 }
65
66 int LyXCursor::x() const
67 {
68         return x_;
69 }
70
71
72 void LyXCursor::x_fix(int i)
73 {
74         x_fix_ = i;
75 }
76
77
78 int LyXCursor::x_fix() const
79 {
80         return x_fix_;
81 }
82
83
84 void LyXCursor::y(int i)
85 {
86         y_ = i;
87 }
88
89
90 int LyXCursor::y() const
91 {
92         return y_;
93 }
94
95
96 bool operator==(LyXCursor const & a, LyXCursor const & b)
97 {
98         return a.par() == b.par()
99             && a.pos() == b.pos()
100             && a.boundary() == b.boundary();
101 }
102
103
104 bool operator!=(LyXCursor const & a, LyXCursor const & b)
105 {
106         return !(a == b);
107 }
108