]> git.lyx.org Git - lyx.git/blob - src/Row.cpp
3bf393b7cefe2ea24e621eab8581aca6dea3633d
[lyx.git] / src / Row.cpp
1 /**
2  * \file Row.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author unknown
7  * \author Lars Gullik Bjønnes
8  * \author John Levon
9  * \author André Pönitz
10  * \author Jürgen Vigna
11  *
12  * Full author contact details are available in file CREDITS.
13  *
14  * Metrics for an on-screen text row.
15  */
16
17 #include <config.h>
18
19 #include "Row.h"
20 #include "debug.h"
21
22
23 namespace lyx {
24
25
26 Row::Row()
27         : changed_(false), crc_(0), pos_(0), end_(0), separator(0), hfill(0),
28         label_hfill(0), x(0)
29 {}
30
31
32 Row::Row(pos_type pos)
33         : changed_(false), crc_(0), pos_(pos), end_(0), separator(0), hfill(0),
34         label_hfill(0), x(0)
35 {}
36
37
38 void Row::setCrc(size_type crc)
39 {
40         changed_ |= crc != crc_;
41         crc_ = crc;
42 }
43
44
45 void Row::setDimension(Dimension const & dim)
46 {
47         changed_ |= dim != dim_;
48         dim_ = dim;
49 }
50
51
52 void Row::pos(pos_type p)
53 {
54         pos_ = p;
55 }
56
57
58 void Row::endpos(pos_type p)
59 {
60         end_ = p;
61 }
62
63
64 void Row::dump(const char * s) const
65 {
66         lyxerr << s << " pos: " << pos_ << " end: " << end_
67                 << " width: " << dim_.wid
68                 << " ascent: " << dim_.asc
69                 << " descent: " << dim_.des
70                 << std::endl;
71 }
72
73
74 } // namespace lyx