]> git.lyx.org Git - lyx.git/blob - src/lyxcursor.C
some integer type changes for inset unification
[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_(0), pos_(0), boundary_(false)
21 {}
22
23
24 void LyXCursor::par(lyx::paroffset_type par)
25 {
26         par_ = par;
27 }
28
29
30 lyx::paroffset_type LyXCursor::par() const
31 {
32         return par_;
33 }
34
35
36 void LyXCursor::pos(lyx::pos_type pos)
37 {
38         pos_ = pos;
39 }
40
41
42 lyx::pos_type LyXCursor::pos() const
43 {
44         return pos_;
45 }
46
47
48 void LyXCursor::boundary(bool boundary)
49 {
50         boundary_ = boundary;
51 }
52
53
54 bool LyXCursor::boundary() const
55 {
56         return boundary_;
57 }
58
59
60 bool operator==(LyXCursor const & a, LyXCursor const & b)
61 {
62         return a.par() == b.par()
63             && a.pos() == b.pos()
64             && a.boundary() == b.boundary();
65 }
66
67
68 bool operator!=(LyXCursor const & a, LyXCursor const & b)
69 {
70         return !(a == b);
71 }
72
73
74 bool operator<(LyXCursor const & a, LyXCursor const & b)
75 {
76         return (a.par() < b.par() ||
77                 (a.par() == b.par()  && a.pos() < b.pos()));
78 }
79
80
81 bool operator>(LyXCursor const & a, LyXCursor const & b)
82 {
83         return (a.par() > b.par() ||
84                 (a.par() == b.par()  && a.pos() > b.pos()));
85 }