]> git.lyx.org Git - lyx.git/blob - src/lyxrow.C
the lyxrow changes including accessors.
[lyx.git] / src / lyxrow.C
1 /**
2  * \file lyxrow.C
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  *
8  * Full author contact details are available in file CREDITS
9  *
10  * Metrics for an on-screen text row.
11  */
12
13 #include <config.h>
14
15 #include "lyxrow.h"
16 #include "debug.h"
17
18 using lyx::pos_type;
19
20 using std::max;
21 using std::min;
22
23 Row::Row()
24         : pos_(0), end_(0), fill_(0), height_(0), width_(0), y_(0),
25           ascent_of_text_(0), baseline_(0),
26           x_(0), fill_separator_(0), fill_hfill_(0), fill_label_hfill_(0)
27 {}
28
29
30 Row::Row(pos_type pos)
31         : pos_(pos), end_(0), fill_(0), height_(0), width_(0), y_(0),
32           ascent_of_text_(0), baseline_(0),
33           x_(0), fill_separator_(0), fill_hfill_(0), fill_label_hfill_(0)
34 {}
35
36
37 void Row::y(unsigned int newy)
38 {
39         y_ = newy;
40 }
41
42
43 unsigned int Row::y() const
44 {
45         return y_;
46 }
47
48
49 unsigned short Row::height() const
50 {
51         return height_;
52 }
53
54
55 void Row::pos(pos_type p)
56 {
57         pos_ = p;
58 }
59
60
61 pos_type Row::pos() const
62 {
63         return pos_;
64 }
65
66
67 void Row::end(pos_type p)
68 {
69         end_ = p;
70 }
71
72
73 pos_type Row::end() const
74 {
75         return end_;
76 }
77
78
79 void Row::fill(int f)
80 {
81         fill_ = f;
82 }
83
84
85 int Row::fill() const
86 {
87         return fill_;
88 }
89
90
91 void Row::height(unsigned short h)
92 {
93         height_ = h;
94 }
95
96
97 void Row::width(unsigned int w)
98 {
99         width_ = w;
100 }
101
102
103 unsigned int Row::width() const
104 {
105         return width_;
106 }
107
108
109 void Row::ascent_of_text(unsigned short a)
110 {
111         ascent_of_text_ = a;
112 }
113
114
115 unsigned short Row::ascent_of_text() const
116 {
117         return ascent_of_text_;
118 }
119
120
121 void Row::top_of_text(unsigned int top)
122 {
123         top_of_text_ = top;
124 }
125
126
127 unsigned int Row::top_of_text() const
128 {
129         return top_of_text_;
130 }
131
132
133 void Row::baseline(unsigned int b)
134 {
135         baseline_ = b;
136 }
137
138
139 unsigned int Row::baseline() const
140 {
141         return baseline_;
142 }
143
144
145 float Row::x() const
146 {
147         return x_;
148 }
149
150
151 void Row::x(float f)
152 {
153         x_ = f;
154 }
155
156
157 float Row::fill_separator() const
158 {
159         return fill_separator_;
160 }
161
162
163 void Row::fill_separator(float f)
164 {
165         fill_separator_ = f;
166 }
167
168
169 float Row::fill_hfill() const
170 {
171         return fill_hfill_;
172 }
173
174
175 void Row::fill_hfill(float f)
176 {
177         fill_hfill_ = f;
178 }
179
180
181 float Row::fill_label_hfill() const
182 {
183         return fill_label_hfill_;
184 }
185
186
187 void Row::fill_label_hfill(float f)
188 {
189         fill_label_hfill_ = f;
190 }
191
192
193 bool Row::isParStart() const
194 {
195         return !pos();
196 }
197
198
199 void Row::dump(const char * s) const
200 {
201         lyxerr << s << " pos: " << pos_ << " width: " << width_
202                 << " height: " << height_
203                 << " fill: " << fill_
204                 << " ascent_of_text: " << ascent_of_text_
205                 << " top_of_text: " << top_of_text_
206                 << " y: " << y_ << std::endl;
207 }
208