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