]> git.lyx.org Git - lyx.git/blob - src/lyxrow.C
* lyxrow.[Ch]: add end_ member
[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 {}
27
28
29 Row::Row(pos_type pos)
30         : pos_(pos), end_(0), fill_(0), height_(0), width_(0), y_(0),
31           ascent_of_text_(0), baseline_(0)
32 {}
33
34
35 void Row::y(unsigned int newy)
36 {
37         y_ = newy;
38 }
39
40
41 unsigned int Row::y() const
42 {
43         return y_;
44 }
45
46
47 unsigned short Row::height() const
48 {
49         return height_;
50 }
51
52
53 void Row::pos(pos_type p)
54 {
55         pos_ = p;
56 }
57
58
59 pos_type Row::pos() const
60 {
61         return pos_;
62 }
63
64
65 void Row::end(pos_type p)
66 {
67         end_ = p;
68 }
69
70
71 pos_type Row::end() const
72 {
73         return end_;
74 }
75
76
77 void Row::fill(int f)
78 {
79         fill_ = f;
80 }
81
82
83 int Row::fill() const
84 {
85         return fill_;
86 }
87
88
89 void Row::height(unsigned short h)
90 {
91         height_ = h;
92 }
93
94
95 void Row::width(unsigned int w)
96 {
97         width_ = w;
98 }
99
100
101 unsigned int Row::width() const
102 {
103         return width_;
104 }
105
106
107 void Row::ascent_of_text(unsigned short a)
108 {
109         ascent_of_text_ = a;
110 }
111
112
113 unsigned short Row::ascent_of_text() const
114 {
115         return ascent_of_text_;
116 }
117
118
119 void Row::top_of_text(unsigned int top)
120 {
121         top_of_text_ = top;
122 }
123
124
125 unsigned int Row::top_of_text() const
126 {
127         return top_of_text_;
128 }
129
130
131 void Row::baseline(unsigned int b)
132 {
133         baseline_ = b;
134 }
135
136
137 unsigned int Row::baseline() const
138 {
139         return baseline_;
140 }
141
142
143 bool Row::isParStart() const
144 {
145         return !pos();
146 }
147
148
149 void Row::dump(const char * s) const
150 {
151         lyxerr << s << " pos: " << pos_ << " width: " << width_
152                 << " height: " << height_
153                 << " fill: " << fill_
154                 << " ascent_of_text: " << ascent_of_text_
155                 << " top_of_text: " << top_of_text_
156                 << " y: " << y_ << std::endl;
157 }
158