]> git.lyx.org Git - lyx.git/blobdiff - src/lyxrow.h
remove unneeded includes
[lyx.git] / src / lyxrow.h
index 64089fc711991ca6d840590817cb21e470351203..652366abcf4657dfda909758363ef971fb932f74 100644 (file)
@@ -1,41 +1,90 @@
 // -*- C++ -*-
-/* This file is part of
- * ======================================================
- * 
- *           LyX, The Document Processor
- *      
- *         Copyright (C) 1995 Matthias Ettrich
+/**
+ * \file lyxrow.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *======================================================*/
+ * \author Matthias Ettrich
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS.
+ *
+ * Metrics for an on-screen text row.
+ */
+
+#ifndef LYXROW_H
+#define LYXROW_H
 
-#ifndef _LYXROW_H
-#define _LYXROW_H
+#include "support/types.h"
 
-//#include "lyxparagraph.h"
 
-class LyXParagraph;
+namespace lyx {
 
-///
-struct Row {
+/**
+ * An on-screen row of text. A paragraph is broken into a
+ * RowList for display. Each Row contains position pointers
+ * into the first and last character positions of that row.
+ */
+class Row {
+public:
+       ///
+       Row();
+       ///
+       Row(pos_type pos);
+       ///
+       void pos(pos_type p);
+       ///
+       pos_type pos() const;
+       ///
+       void endpos(pos_type p);
+       ///
+       pos_type endpos() const;
        ///
-       LyXParagraph *par;
+       int height() const { return ascent_ + descent_; }
        ///
-       int pos;
+       void width(int w);
        ///
-       unsigned short  baseline;
+       int width() const;
        ///
-       /** what is missing to a full row can be negative.
-         Needed for hfills, flushright, block etc. */
-       int fill;
+       void ascent(int b);
        ///
-       unsigned short  height;
+       int ascent() const;
        ///
-       unsigned short ascent_of_text;
-       
+       void descent(int b) { descent_ = b; }
        ///
-       Row* next;
+       int descent() const { return descent_; }
+       /// current debugging only
+       void dump(const char * = "") const;
+
+private:
+       /// first pos covered by this row
+       pos_type pos_;
+       /// one behind last pos covered by this row
+       pos_type end_;
+       ///
+       int ascent_;
+       ///
+       int descent_;
        ///
-       Row* previous;
+       int width_;
 };
 
+
+class RowMetrics {
+public:
+       RowMetrics();
+       /// width of a separator (i.e. space)
+       double separator;
+       /// width of hfills in the body
+       double hfill;
+       /// width of hfills in the label
+       double label_hfill;
+       /// the x position of the row
+       double x;
+};
+
+
+
+} // namespace lyx
+
 #endif