]> git.lyx.org Git - lyx.git/blobdiff - src/lyxrow.C
Point fix, earlier forgotten
[lyx.git] / src / lyxrow.C
index 804cbc7e99517f640363a1a401522f5710e25df1..a93192a5fb83a990ac3b8b3c1cf7a22d90d369c5 100644 (file)
@@ -1,61 +1,76 @@
-/* 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;
 
+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), end_(0), fill_(0), height_(0), width_(0), y_(0),
+         ascent_of_text_(0), baseline_(0),
+         x_(0), fill_separator_(0), fill_hfill_(0), fill_label_hfill_(0)
 {}
 
 
-void Row::par(Paragraph * p)
-{
-       par_ = p;
-}
+Row::Row(pos_type pos)
+       : pos_(pos), end_(0), fill_(0), height_(0), width_(0), y_(0),
+         ascent_of_text_(0), baseline_(0),
+         x_(0), fill_separator_(0), fill_hfill_(0), fill_label_hfill_(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)
+void Row::end(pos_type p)
 {
-       fill_ = f;
+       end_ = p;
 }
 
 
-int Row::fill() const
+pos_type Row::end() const
 {
-       return fill_;
+       return end_;
+}
+
+
+void Row::fill(int f)
+{
+       fill_ = f;
 }
 
 
-void Row::height(unsigned short h)
+int Row::fill() const
 {
-       height_ = h;
+       return fill_;
 }
 
 
@@ -71,13 +86,13 @@ unsigned int Row::width() const
 }
 
 
-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_;
 }
@@ -88,13 +103,13 @@ void Row::top_of_text(unsigned int top)
        top_of_text_ = top;
 }
 
+
 unsigned int Row::top_of_text() const
 {
        return top_of_text_;
 }
 
+
 void Row::baseline(unsigned int b)
 {
        baseline_ = b;
@@ -107,19 +122,67 @@ unsigned int Row::baseline() const
 }
 
 
-void Row::next(Row * r)
+float Row::x() const
+{
+       return x_;
+}
+
+
+void Row::x(float f)
+{
+       x_ = f;
+}
+
+
+float Row::fill_separator() const
+{
+       return fill_separator_;
+}
+
+
+void Row::fill_separator(float f)
+{
+       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)
 {
-       next_ = r;
+       fill_label_hfill_ = f;
 }
 
 
-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_
+               << " fill: " << fill_
+               << " ascent_of_text: " << ascent_of_text_
+               << " top_of_text: " << top_of_text_
+               << " y: " << y_ << std::endl;
 }
+