-/* 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
*
- * 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 "paragraph.h"
+#include "layout.h"
+#include "lyxlayout.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), next_(0), previous_(0)
+ : pos_(0), fill_(0), height_(0), width_(0), y_(0),
+ ascent_of_text_(0), baseline_(0)
+{}
+
+
+Row::Row(ParagraphList::iterator pit, pos_type po)
+ : pit_(pit), pos_(po), fill_(0), height_(0), width_(0), y_(0),
+ ascent_of_text_(0), baseline_(0)
{}
-void Row::par(Paragraph * p)
+void Row::y(unsigned int newy)
+{
+ y_ = newy;
+}
+
+
+unsigned int Row::y() const
{
- par_ = p;
+ return y_;
}
-void Row::pos(lyx::pos_type p)
+ParagraphList::iterator Row::par()
+{
+ return pit_;
+}
+
+
+ParagraphList::iterator Row::par() const
+{
+ return pit_;
+}
+
+
+unsigned short Row::height() const
+{
+ return height_;
+}
+
+
+void Row::par(ParagraphList::iterator pit)
+{
+ pit_ = pit;
+}
+
+
+void Row::pos(pos_type p)
{
pos_ = p;
}
-lyx::pos_type Row::pos() const
+pos_type Row::pos() const
{
return pos_;
}
top_of_text_ = top;
}
-
+
unsigned int Row::top_of_text() const
{
return top_of_text_;
}
-
+
void Row::baseline(unsigned int b)
{
baseline_ = b;
}
-void Row::next(Row * r)
-{
- next_ = r;
-}
-
-
-void Row::previous(Row * r)
-{
- previous_ = r;
-}
-
-
-Row * Row::previous() const
+bool Row::isParStart() const
{
- return previous_;
+ return !pos();
}