]> git.lyx.org Git - lyx.git/blob - src/lyxrow.C
More 'standard conformant blurb' nonsense.
[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), fill_(0), height_(0), width_(0), y_(0),
25           ascent_of_text_(0), baseline_(0)
26 {}
27
28
29 Row::Row(pos_type po)
30         : pos_(po), 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::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::height(unsigned short h)
78 {
79         height_ = h;
80 }
81
82
83 void Row::width(unsigned int w)
84 {
85         width_ = w;
86 }
87
88
89 unsigned int Row::width() const
90 {
91         return width_;
92 }
93
94
95 void Row::ascent_of_text(unsigned short a)
96 {
97         ascent_of_text_ = a;
98 }
99
100
101 unsigned short Row::ascent_of_text() const
102 {
103         return ascent_of_text_;
104 }
105
106
107 void Row::top_of_text(unsigned int top)
108 {
109         top_of_text_ = top;
110 }
111
112
113 unsigned int Row::top_of_text() const
114 {
115         return top_of_text_;
116 }
117
118
119 void Row::baseline(unsigned int b)
120 {
121         baseline_ = b;
122 }
123
124
125 unsigned int Row::baseline() const
126 {
127         return baseline_;
128 }
129
130
131 bool Row::isParStart() const
132 {
133         return !pos();
134 }
135
136
137 void Row::dump(const char * s) const
138 {
139         lyxerr << s << " pos: " << pos_ << " width: " << width_
140                 << " height: " << height_
141                 << " fill: " << fill_
142                 << " ascent_of_text: " << ascent_of_text_
143                 << " top_of_text: " << top_of_text_
144                 << " y: " << y_ << "\n";
145 }
146