]> git.lyx.org Git - lyx.git/blob - src/lyxcursor.C
Add a couple of new functions.
[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), ix_(0), x_fix_(0), y_(0), iy_(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::ix(int n)
73 {
74         ix_ = n;
75 }
76
77 int LyXCursor::ix() const
78 {
79         return ix_;
80 }
81
82
83 void LyXCursor::x_fix(int i)
84 {
85         x_fix_ = i;
86 }
87
88
89 int LyXCursor::x_fix() const
90 {
91         return x_fix_;
92 }
93
94
95 void LyXCursor::y(int i)
96 {
97         y_ = i;
98 }
99
100
101 int LyXCursor::y() const
102 {
103         return y_;
104 }
105
106
107 void LyXCursor::iy(int i)
108 {
109         iy_ = i;
110 }
111
112
113 int LyXCursor::iy() const
114 {
115         return iy_;
116 }
117
118
119 bool operator==(LyXCursor const & a, LyXCursor const & b)
120 {
121         return a.par() == b.par()
122             && a.pos() == b.pos()
123             && a.boundary() == b.boundary();
124 }
125
126
127 bool operator!=(LyXCursor const & a, LyXCursor const & b)
128 {
129         return !(a == b);
130 }
131