-/* This file is part of
- * ======================================================
+/**
+ * \file lyxrow.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * LyX, The Document Processor
+ * \author unknown
+ * \author Lars Gullik Bjønnes
+ * \author John Levon
+ * \author André Pönitz
+ * \author Jürgen Vigna
*
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 The LyX Team.
+ * Full author contact details are available in file CREDITS.
*
- * ====================================================== */
+ * Metrics for an on-screen text row.
+ */
#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
#include "lyxrow.h"
+#include "debug.h"
+
+using lyx::pos_type;
+
+
+RowMetrics::RowMetrics() : separator(0), hfill(0), label_hfill(0), x(0)
+{}
Row::Row()
- : par_(0), pos_(0), fill_(0), height_(0), width_(0),
- ascent_of_text_(0), baseline_(0), next_(0), previous_(0)
+ : pos_(0), end_(0), height_(0), width_(0), y_offset_(0),
+ ascent_of_text_(0), baseline_(0)
{}
-void Row::par(Paragraph * p)
-{
- par_ = p;
-}
+Row::Row(pos_type pos)
+ : pos_(pos), end_(0), height_(0), width_(0), y_offset_(0),
+ ascent_of_text_(0), baseline_(0)
+{}
-void Row::pos(lyx::pos_type p)
+void Row::pos(pos_type p)
{
pos_ = p;
}
-lyx::pos_type Row::pos() const
+pos_type Row::pos() const
{
return pos_;
}
-void Row::fill(int f)
-{
- fill_ = f;
-}
-
-
-int Row::fill() const
+void Row::endpos(pos_type p)
{
- return fill_;
+ end_ = p;
}
-void Row::height(unsigned short h)
+pos_type Row::endpos() const
{
- height_ = h;
+ return end_;
}
}
-void Row::ascent_of_text(unsigned short a)
+void Row::ascent_of_text(unsigned int a)
{
ascent_of_text_ = a;
}
-unsigned short Row::ascent_of_text() const
+unsigned int Row::ascent_of_text() const
{
return ascent_of_text_;
}
-void Row::baseline(unsigned int b)
+void Row::top_of_text(unsigned int top)
{
- baseline_ = b;
+ top_of_text_ = top;
}
-unsigned int Row::baseline() const
+unsigned int Row::top_of_text() const
{
- return baseline_;
+ return top_of_text_;
+}
+
+
+void Row::baseline(unsigned int b)
+{
+ baseline_ = b;
}
-void Row::next(Row * r)
+unsigned int Row::baseline() const
{
- next_ = r;
+ return baseline_;
}
-void Row::previous(Row * r)
+bool Row::isParStart() const
{
- previous_ = r;
+ return !pos();
}
-Row * Row::previous() const
+void Row::dump(const char * s) const
{
- return previous_;
+ lyxerr << s << " pos: " << pos_ << " width: " << width_
+ << " height: " << height_
+ << " ascent_of_text: " << ascent_of_text_
+ << " top_of_text: " << top_of_text_
+ << " y_offset: " << y_offset_ << std::endl;
}