-/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
- *
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2000 The LyX Team.
+/**
+ * \file lyxrow.C
+ * This file is part of LyX, the document processor.
+ * 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.
+ *
+ * Metrics for an on-screen text row.
+ */
#include <config.h>
#include "lyxrow.h"
+#include "debug.h"
+
+using lyx::pos_type;
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), fill_(0), height_(0), width_(0), y_offset_(0),
+ ascent_of_text_(0), baseline_(0),
+ x_(0), fill_separator_(0), fill_hfill_(0), fill_label_hfill_(0)
{}
-void Row::par(LyXParagraph * p)
-{
- par_ = p;
-}
+Row::Row(pos_type pos)
+ : pos_(pos), end_(0), fill_(0), height_(0), width_(0), y_offset_(0),
+ ascent_of_text_(0), baseline_(0),
+ x_(0), fill_separator_(0), fill_hfill_(0), fill_label_hfill_(0)
+{}
-LyXParagraph * Row::par()
+void Row::pos(pos_type p)
{
- return par_;
+ pos_ = p;
}
-LyXParagraph * Row::par() const
+pos_type Row::pos() const
{
- return par_;
+ return pos_;
}
-void Row::pos(LyXParagraph::size_type p)
+void Row::endpos(pos_type p)
{
- pos_ = p;
+ end_ = p;
}
-LyXParagraph::size_type Row::pos() const
+pos_type Row::endpos() const
{
- return pos_;
+ return end_;
}
}
-void Row::height(unsigned short h)
+void Row::width(unsigned int w)
{
- height_ = h;
+ width_ = w;
}
-unsigned short Row::height() const
+unsigned int Row::width() const
{
- return height_;
+ return width_;
}
-void Row::width(unsigned int w)
+void Row::ascent_of_text(unsigned int a)
{
- width_ = w;
+ ascent_of_text_ = a;
}
-unsigned int Row::width() const
+unsigned int Row::ascent_of_text() const
{
- return width_;
+ return ascent_of_text_;
}
-void Row::ascent_of_text(unsigned short a)
+void Row::top_of_text(unsigned int top)
{
- ascent_of_text_ = a;
+ top_of_text_ = top;
}
-unsigned short Row::ascent_of_text() const
+unsigned int Row::top_of_text() const
{
- return ascent_of_text_;
+ return top_of_text_;
}
}
-void Row::next(Row * r)
+float Row::x() const
{
- next_ = r;
+ return x_;
}
-Row * Row::next() const
+void Row::x(float f)
{
- return next_;
+ x_ = f;
}
-void Row::previous(Row * r)
+float Row::fill_separator() const
{
- previous_ = r;
+ return fill_separator_;
}
-Row * Row::previous() const
+void Row::fill_separator(float f)
{
- return previous_;
+ fill_separator_ = f;
}
+
+
+float Row::fill_hfill() const
+{
+ return fill_hfill_;
+}
+
+
+void Row::fill_hfill(float f)
+{
+ fill_hfill_ = f;
+}
+
+
+float Row::fill_label_hfill() const
+{
+ return fill_label_hfill_;
+}
+
+
+void Row::fill_label_hfill(float f)
+{
+ fill_label_hfill_ = f;
+}
+
+
+bool Row::isParStart() const
+{
+ return !pos();
+}
+
+
+void Row::dump(const char * s) const
+{
+ lyxerr << s << " pos: " << pos_ << " width: " << width_
+ << " height: " << height_
+ << " fill: " << fill_
+ << " ascent_of_text: " << ascent_of_text_
+ << " top_of_text: " << top_of_text_
+ << " y_offset: " << y_offset_ << std::endl;
+}
+