X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxrow.h;h=652366abcf4657dfda909758363ef971fb932f74;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=d855d77e30942f745ed2698a2a20ac98c2084cfb;hpb=dd306473146eec6098bf9c15ae23107658379360;p=lyx.git diff --git a/src/lyxrow.h b/src/lyxrow.h index d855d77e30..652366abcf 100644 --- a/src/lyxrow.h +++ b/src/lyxrow.h @@ -17,67 +17,56 @@ #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_; }; @@ -95,4 +84,7 @@ public: }; + +} // namespace lyx + #endif