X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxrow.h;h=652366abcf4657dfda909758363ef971fb932f74;hb=b3ced091d2eb7b1f2e174973614157b1c26c7001;hp=7c6fbf75269507715023e065eab680182bd3a509;hpb=b7f49f9b42d5345209d09ae933d901411912cd80;p=lyx.git diff --git a/src/lyxrow.h b/src/lyxrow.h index 7c6fbf7526..652366abcf 100644 --- a/src/lyxrow.h +++ b/src/lyxrow.h @@ -7,7 +7,7 @@ * \author Matthias Ettrich * \author Lars Gullik Bjønnes * - * Full author contact details are available in file CREDITS + * Full author contact details are available in file CREDITS. * * Metrics for an on-screen text row. */ @@ -17,73 +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); + Row(pos_type pos); /// - lyx::pos_type pos() const; + void pos(pos_type p); /// - void end(lyx::pos_type p); + pos_type pos() const; /// - lyx::pos_type end() const; + void endpos(pos_type p); /// - void fill(int f); + pos_type endpos() const; /// - int fill() const; + int height() const { return ascent_ + descent_; } /// - void height(unsigned short h); + void width(int w); /// - unsigned short height() const; + int width() const; /// - void width(unsigned int w); + void ascent(int b); /// - unsigned int width() const; + int ascent() const; /// - void ascent_of_text(unsigned short a); + void descent(int b) { descent_ = b; } /// - unsigned short ascent_of_text() const; - /// - void top_of_text(unsigned int top); - /// - 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() const; - /// cache the y position - void y(unsigned int 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_; - /** what is missing to a full row. Can be negative. - Needed for hfills, flushright, block etc. */ - mutable int fill_; - /// - unsigned short height_; - /// - unsigned int width_; - /// cached y position - unsigned int y_; - /// 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_; - /// - unsigned int baseline_; + pos_type end_; + /// + int ascent_; + /// + int descent_; + /// + 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