X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxrow.h;h=652366abcf4657dfda909758363ef971fb932f74;hb=b3ced091d2eb7b1f2e174973614157b1c26c7001;hp=c17e6349333d89624e3ad57cf513966017c7fa82;hpb=8943967181ed1119ad9643c9e5cc5beda537719f;p=lyx.git diff --git a/src/lyxrow.h b/src/lyxrow.h index c17e634933..652366abcf 100644 --- a/src/lyxrow.h +++ b/src/lyxrow.h @@ -17,90 +17,74 @@ #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); - /// - lyx::pos_type pos() const; - /// - void endpos(lyx::pos_type p); - /// - lyx::pos_type endpos() const; - /// - void height(unsigned int h) { height_ = h; } - /// - unsigned int height() const { return height_; } - /// - void width(unsigned int w); - /// - unsigned int width() const; - /// - void ascent_of_text(unsigned int a); + Row(pos_type pos); /// - unsigned int ascent_of_text() const; + void pos(pos_type p); /// - void top_of_text(unsigned int top); + pos_type pos() const; /// - unsigned int top_of_text() const; + void endpos(pos_type p); /// - void baseline(unsigned int b); + pos_type endpos() const; /// - 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 height() const { return ascent_ + descent_; } /// - float x() const; + void width(int w); /// - void x(float); + int width() const; /// - float fill_separator() const; + void ascent(int b); /// - void fill_separator(float); + int ascent() const; /// - float fill_hfill() const; + void descent(int b) { descent_ = b; } /// - void fill_hfill(float); - /// - float fill_label_hfill() const; - /// - void fill_label_hfill(float); + 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_; - /// - unsigned int height_; + pos_type end_; /// - 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 ascent_; /// - unsigned int baseline_; - /// offet from left border - float x_; + int descent_; /// - float fill_separator_; - /// - float fill_hfill_; - /// - float fill_label_hfill_; + 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