]> git.lyx.org Git - lyx.git/blob - src/lyxrow.C
more cursor dispatch
[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), fill_(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), fill_(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::fill(int f)
64 {
65         fill_ = f;
66 }
67
68
69 int Row::fill() const
70 {
71         return fill_;
72 }
73
74
75 void Row::width(unsigned int w)
76 {
77         width_ = w;
78 }
79
80
81 unsigned int Row::width() const
82 {
83         return width_;
84 }
85
86
87 void Row::ascent_of_text(unsigned int a)
88 {
89         ascent_of_text_ = a;
90 }
91
92
93 unsigned int Row::ascent_of_text() const
94 {
95         return ascent_of_text_;
96 }
97
98
99 void Row::top_of_text(unsigned int top)
100 {
101         top_of_text_ = top;
102 }
103
104
105 unsigned int Row::top_of_text() const
106 {
107         return top_of_text_;
108 }
109
110
111 void Row::baseline(unsigned int b)
112 {
113         baseline_ = b;
114 }
115
116
117 unsigned int Row::baseline() const
118 {
119         return baseline_;
120 }
121
122
123 float Row::x() const
124 {
125         return x_;
126 }
127
128
129 void Row::x(float f)
130 {
131         x_ = f;
132 }
133
134
135 float Row::fill_separator() const
136 {
137         return fill_separator_;
138 }
139
140
141 void Row::fill_separator(float f)
142 {
143         fill_separator_ = f;
144 }
145
146
147 float Row::fill_hfill() const
148 {
149         return fill_hfill_;
150 }
151
152
153 void Row::fill_hfill(float f)
154 {
155         fill_hfill_ = f;
156 }
157
158
159 float Row::fill_label_hfill() const
160 {
161         return fill_label_hfill_;
162 }
163
164
165 void Row::fill_label_hfill(float f)
166 {
167         fill_label_hfill_ = f;
168 }
169
170
171 bool Row::isParStart() const
172 {
173         return !pos();
174 }
175
176
177 void Row::dump(const char * s) const
178 {
179         lyxerr << s << " pos: " << pos_ << " width: " << width_
180                 << " height: " << height_
181                 << " fill: " << fill_
182                 << " ascent_of_text: " << ascent_of_text_
183                 << " top_of_text: " << top_of_text_
184                 << " y_offset: " << y_offset_ << std::endl;
185 }
186