#include "support/types.h"
-///
+
+namespace lyx {
+
+/**
+ * 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(lyx::pos_type pos);
- ///
- void pos(lyx::pos_type p);
+ Row(pos_type pos);
///
- lyx::pos_type pos() const;
+ void pos(pos_type p);
///
- void endpos(lyx::pos_type p);
+ pos_type pos() const;
///
- lyx::pos_type endpos() const;
+ void endpos(pos_type p);
///
- void height(unsigned int h) { height_ = h; }
+ pos_type endpos() const;
///
- unsigned int height() const { return height_; }
+ int height() const { return ascent_ + descent_; }
///
- void width(unsigned int w);
+ void width(int w);
///
- unsigned int width() const;
+ int width() const;
///
- void ascent_of_text(unsigned int a);
+ void ascent(int b);
///
- unsigned int ascent_of_text() const;
+ int ascent() const;
///
- void top_of_text(unsigned int top);
+ void descent(int b) { descent_ = b; }
///
- unsigned int top_of_text() const;
- ///
- void baseline(unsigned int b);
- ///
- unsigned int baseline() const;
- /// return true if this row is the start of a paragraph
- bool isParStart() const;
- /// return the cached y position
- unsigned int y_offset() const { return y_offset_; }
- /// cache the y position
- void y_offset(unsigned int newy) { y_offset_ = newy; }
+ int descent() const { return descent_; }
/// current debugging only
void dump(const char * = "") const;
private:
/// first pos covered by this row
- lyx::pos_type pos_;
+ pos_type pos_;
/// one behind last pos covered by this row
- lyx::pos_type end_;
+ pos_type end_;
///
- unsigned int height_;
+ int ascent_;
///
- unsigned int width_;
- /// cached y position
- unsigned int y_offset_;
- /// ascent from baseline including prelude space
- unsigned short ascent_of_text_;
- /// the top of the real text in the row
- unsigned int top_of_text_;
+ int descent_;
///
- unsigned int baseline_;
+ int width_;
};
};
+
+} // namespace lyx
+
#endif