]> git.lyx.org Git - lyx.git/blob - src/Row.cpp
LyXText -> Text
[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 RowMetrics::RowMetrics()
27         : separator(0), hfill(0), label_hfill(0), x(0)
28 {}
29
30
31 Row::Row()
32         : pos_(0), end_(0), ascent_(0), descent_(0), width_(0)
33 {}
34
35
36 Row::Row(pos_type pos)
37         : pos_(pos), end_(0), ascent_(0), descent_(0), width_(0)
38 {}
39
40
41 void Row::pos(pos_type p)
42 {
43         pos_ = p;
44 }
45
46
47 pos_type Row::pos() const
48 {
49         return pos_;
50 }
51
52
53 void Row::endpos(pos_type p)
54 {
55         end_ = p;
56 }
57
58
59 pos_type Row::endpos() const
60 {
61         return end_;
62 }
63
64
65 void Row::width(int w)
66 {
67         width_ = w;
68 }
69
70
71 int Row::width() const
72 {
73         return width_;
74 }
75
76
77 void Row::ascent(int b)
78 {
79         ascent_ = b;
80 }
81
82
83 int Row::ascent() const
84 {
85         return ascent_;
86 }
87
88
89 void Row::dump(const char * s) const
90 {
91         lyxerr << s << " pos: " << pos_ << " end: " << end_
92                 << " width: " << width_
93                 << " ascent: " << ascent_
94                 << " descent: " << descent_
95                 << std::endl;
96 }
97
98
99 } // namespace lyx