]> git.lyx.org Git - lyx.git/blob - src/lyxrow.C
Wednesday's 'de-mathed-ification' + Row::fill removal
[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  * \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 "lyxrow.h"
20 #include "debug.h"
21
22 using lyx::pos_type;
23
24
25 Row::Row()
26         : pos_(0), end_(0), height_(0), width_(0), y_offset_(0),
27           ascent_of_text_(0), baseline_(0),
28           x_(0), fill_separator_(0), fill_hfill_(0), fill_label_hfill_(0)
29 {}
30
31
32 Row::Row(pos_type pos)
33         : pos_(pos), end_(0), height_(0), width_(0), y_offset_(0),
34           ascent_of_text_(0), baseline_(0),
35           x_(0), fill_separator_(0), fill_hfill_(0), fill_label_hfill_(0)
36 {}
37
38
39 void Row::pos(pos_type p)
40 {
41         pos_ = p;
42 }
43
44
45 pos_type Row::pos() const
46 {
47         return pos_;
48 }
49
50
51 void Row::endpos(pos_type p)
52 {
53         end_ = p;
54 }
55
56
57 pos_type Row::endpos() const
58 {
59         return end_;
60 }
61
62
63 void Row::width(unsigned int w)
64 {
65         width_ = w;
66 }
67
68
69 unsigned int Row::width() const
70 {
71         return width_;
72 }
73
74
75 void Row::ascent_of_text(unsigned int a)
76 {
77         ascent_of_text_ = a;
78 }
79
80
81 unsigned int Row::ascent_of_text() const
82 {
83         return ascent_of_text_;
84 }
85
86
87 void Row::top_of_text(unsigned int top)
88 {
89         top_of_text_ = top;
90 }
91
92
93 unsigned int Row::top_of_text() const
94 {
95         return top_of_text_;
96 }
97
98
99 void Row::baseline(unsigned int b)
100 {
101         baseline_ = b;
102 }
103
104
105 unsigned int Row::baseline() const
106 {
107         return baseline_;
108 }
109
110
111 float Row::x() const
112 {
113         return x_;
114 }
115
116
117 void Row::x(float f)
118 {
119         x_ = f;
120 }
121
122
123 float Row::fill_separator() const
124 {
125         return fill_separator_;
126 }
127
128
129 void Row::fill_separator(float f)
130 {
131         fill_separator_ = f;
132 }
133
134
135 float Row::fill_hfill() const
136 {
137         return fill_hfill_;
138 }
139
140
141 void Row::fill_hfill(float f)
142 {
143         fill_hfill_ = f;
144 }
145
146
147 float Row::fill_label_hfill() const
148 {
149         return fill_label_hfill_;
150 }
151
152
153 void Row::fill_label_hfill(float f)
154 {
155         fill_label_hfill_ = f;
156 }
157
158
159 bool Row::isParStart() const
160 {
161         return !pos();
162 }
163
164
165 void Row::dump(const char * s) const
166 {
167         lyxerr << s << " pos: " << pos_ << " width: " << width_
168                 << " height: " << height_
169                 << " ascent_of_text: " << ascent_of_text_
170                 << " top_of_text: " << top_of_text_
171                 << " y_offset: " << y_offset_ << std::endl;
172 }
173