X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxrow.C;h=179354bad84b0770f3799ff8075a4a9b6f33696e;hb=3f8fa07c6ed38218d6a4048f2993a512aa942c96;hp=204dbf5ea9f59c8bf44fe31c9934ca5a27034eef;hpb=87cab819b4196e3baaaeeab96baf6bb3b2de205f;p=lyx.git diff --git a/src/lyxrow.C b/src/lyxrow.C index 204dbf5ea9..179354bad8 100644 --- a/src/lyxrow.C +++ b/src/lyxrow.C @@ -4,8 +4,12 @@ * Licence details can be found in the file COPYING. * * \author unknown + * \author Lars Gullik Bjønnes + * \author John Levon + * \author André Pönitz + * \author Jürgen Vigna * - * 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. */ @@ -15,39 +19,23 @@ #include "lyxrow.h" #include "debug.h" -using lyx::pos_type; -using std::max; -using std::min; - -Row::Row() - : pos_(0), fill_(0), height_(0), width_(0), y_(0), - ascent_of_text_(0), baseline_(0) -{} +namespace lyx { -Row::Row(pos_type po) - : pos_(po), fill_(0), height_(0), width_(0), y_(0), - ascent_of_text_(0), baseline_(0) +RowMetrics::RowMetrics() + : separator(0), hfill(0), label_hfill(0), x(0) {} -void Row::y(unsigned int newy) -{ - y_ = newy; -} - - -unsigned int Row::y() const -{ - return y_; -} +Row::Row() + : pos_(0), end_(0), ascent_(0), descent_(0), width_(0) +{} -unsigned short Row::height() const -{ - return height_; -} +Row::Row(pos_type pos) + : pos_(pos), end_(0), ascent_(0), descent_(0), width_(0) +{} void Row::pos(pos_type p) @@ -62,85 +50,50 @@ pos_type Row::pos() const } -void Row::fill(int f) -{ - fill_ = f; -} - - -int Row::fill() const +void Row::endpos(pos_type p) { - return fill_; + end_ = p; } -void Row::height(unsigned short h) +pos_type Row::endpos() const { - height_ = h; + return end_; } -void Row::width(unsigned int w) +void Row::width(int w) { width_ = w; } -unsigned int Row::width() const +int Row::width() const { return width_; } -void Row::ascent_of_text(unsigned short a) +void Row::ascent(int b) { - ascent_of_text_ = a; + ascent_ = b; } -unsigned short Row::ascent_of_text() const +int Row::ascent() const { - return ascent_of_text_; -} - - -void Row::top_of_text(unsigned int top) -{ - top_of_text_ = top; -} - - -unsigned int Row::top_of_text() const -{ - return top_of_text_; -} - - -void Row::baseline(unsigned int b) -{ - baseline_ = b; -} - - -unsigned int Row::baseline() const -{ - return baseline_; -} - - -bool Row::isParStart() const -{ - return !pos(); + return ascent_; } void Row::dump(const char * s) const { - lyxerr << s << " pos: " << pos_ << " width: " << width_ - << " height: " << height_ - << " fill: " << fill_ - << " ascent_of_text: " << ascent_of_text_ - << " top_of_text: " << top_of_text_ - << " y: " << y_ << "\n"; + lyxerr << s << " pos: " << pos_ << " end: " << end_ + << " width: " << width_ + << " ascent: " << ascent_ + << " descent: " << descent_ + << std::endl; } + +} // namespace lyx