* Licence details can be found in the file COPYING.
*
* \author unknown
+ * \author Lars Gullik Bjønnes
+ * \author John Levon
+ * \author André Pönitz
+ * \author Jürgen Vigna
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*
* Metrics for an on-screen text row.
*/
#include <config.h>
#include "lyxrow.h"
-#include "paragraph.h"
-#include "layout.h"
-#include "lyxlayout.h"
+#include "debug.h"
-using lyx::pos_type;
-using std::max;
-using std::min;
-
-Row::Row()
- : par_(0), pos_(0), fill_(0), height_(0), width_(0),
- ascent_of_text_(0), baseline_(0)
-{}
+namespace lyx {
-Row::Row(Paragraph * pa, pos_type po)
- : par_(pa), pos_(po), fill_(0), height_(0), width_(0),
- ascent_of_text_(0), baseline_(0)
+RowMetrics::RowMetrics()
+ : separator(0), hfill(0), label_hfill(0), x(0)
{}
-Paragraph * Row::par()
-{
- return par_;
-}
-
-
-Paragraph * Row::par() const
-{
- return par_;
-}
-
-
-unsigned short Row::height() const
-{
- return height_;
-}
+Row::Row()
+ : pos_(0), end_(0), ascent_(0), descent_(0), width_(0)
+{}
-void Row::par(Paragraph * p)
-{
- par_ = p;
-}
+Row::Row(pos_type pos)
+ : pos_(pos), end_(0), ascent_(0), descent_(0), width_(0)
+{}
void Row::pos(pos_type p)
}
-void Row::fill(int f)
+void Row::endpos(pos_type p)
{
- fill_ = f;
+ end_ = p;
}
-int Row::fill() const
+pos_type Row::endpos() const
{
- return fill_;
+ return end_;
}
-void Row::height(unsigned short h)
-{
- height_ = h;
-}
-
-
-void Row::width(unsigned int w)
+void Row::width(int w)
{
width_ = w;
}
-unsigned int Row::width() const
+int Row::width() const
{
return width_;
}
-void Row::ascent_of_text(unsigned short a)
-{
- ascent_of_text_ = a;
-}
-
-
-unsigned short Row::ascent_of_text() const
-{
- return ascent_of_text_;
-}
-
-
-void Row::top_of_text(unsigned int top)
+void Row::ascent(int b)
{
- top_of_text_ = top;
+ ascent_ = b;
}
-unsigned int Row::top_of_text() const
+int Row::ascent() const
{
- return top_of_text_;
+ return ascent_;
}
-void Row::baseline(unsigned int b)
+void Row::dump(const char * s) const
{
- baseline_ = b;
+ lyxerr << s << " pos: " << pos_ << " end: " << end_
+ << " width: " << width_
+ << " ascent: " << ascent_
+ << " descent: " << descent_
+ << std::endl;
}
-unsigned int Row::baseline() const
-{
- return baseline_;
-}
-
-
-bool Row::isParStart() const
-{
- return !pos();
-}
+} // namespace lyx