]> git.lyx.org Git - lyx.git/blob - src/lyxrow.C
Enable convertDefault.sh to run even if its executable bit is not set.
[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 using std::max;
25 using std::min;
26
27 Row::Row()
28         : pos_(0), end_(0), fill_(0), height_(0), width_(0), y_(0),
29           ascent_of_text_(0), baseline_(0),
30           x_(0), fill_separator_(0), fill_hfill_(0), fill_label_hfill_(0)
31 {}
32
33
34 Row::Row(pos_type pos)
35         : pos_(pos), end_(0), fill_(0), height_(0), width_(0), y_(0),
36           ascent_of_text_(0), baseline_(0),
37           x_(0), fill_separator_(0), fill_hfill_(0), fill_label_hfill_(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::end(pos_type p)
54 {
55         end_ = p;
56 }
57
58
59 pos_type Row::end() const
60 {
61         return end_;
62 }
63
64
65 void Row::fill(int f)
66 {
67         fill_ = f;
68 }
69
70
71 int Row::fill() const
72 {
73         return fill_;
74 }
75
76
77 void Row::width(unsigned int w)
78 {
79         width_ = w;
80 }
81
82
83 unsigned int Row::width() const
84 {
85         return width_;
86 }
87
88
89 void Row::ascent_of_text(unsigned int a)
90 {
91         ascent_of_text_ = a;
92 }
93
94
95 unsigned int Row::ascent_of_text() const
96 {
97         return ascent_of_text_;
98 }
99
100
101 void Row::top_of_text(unsigned int top)
102 {
103         top_of_text_ = top;
104 }
105
106
107 unsigned int Row::top_of_text() const
108 {
109         return top_of_text_;
110 }
111
112
113 void Row::baseline(unsigned int b)
114 {
115         baseline_ = b;
116 }
117
118
119 unsigned int Row::baseline() const
120 {
121         return baseline_;
122 }
123
124
125 float Row::x() const
126 {
127         return x_;
128 }
129
130
131 void Row::x(float f)
132 {
133         x_ = f;
134 }
135
136
137 float Row::fill_separator() const
138 {
139         return fill_separator_;
140 }
141
142
143 void Row::fill_separator(float f)
144 {
145         fill_separator_ = f;
146 }
147
148
149 float Row::fill_hfill() const
150 {
151         return fill_hfill_;
152 }
153
154
155 void Row::fill_hfill(float f)
156 {
157         fill_hfill_ = f;
158 }
159
160
161 float Row::fill_label_hfill() const
162 {
163         return fill_label_hfill_;
164 }
165
166
167 void Row::fill_label_hfill(float f)
168 {
169         fill_label_hfill_ = f;
170 }
171
172
173 bool Row::isParStart() const
174 {
175         return !pos();
176 }
177
178
179 void Row::dump(const char * s) const
180 {
181         lyxerr << s << " pos: " << pos_ << " width: " << width_
182                 << " height: " << height_
183                 << " fill: " << fill_
184                 << " ascent_of_text: " << ascent_of_text_
185                 << " top_of_text: " << top_of_text_
186                 << " y: " << y_ << std::endl;
187 }
188