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