X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxrow.C;h=5416e69b1b73d58cf6ce0e0be68befaaf125ec87;hb=d68ec289063394f24296ee098f5113e9242f2b0b;hp=682186c71f8f118d0ca034a5d689f5b697ed1806;hpb=02a625161081ec2c0be59aa19858cffd1aa7bb8c;p=lyx.git diff --git a/src/lyxrow.C b/src/lyxrow.C index 682186c71f..5416e69b1b 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. */ @@ -13,61 +17,25 @@ #include #include "lyxrow.h" -#include "paragraph.h" -#include "layout.h" -#include "lyxlayout.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) +RowMetrics::RowMetrics() : separator(0), hfill(0), label_hfill(0), x(0) {} -Row::Row(ParagraphList::iterator pit, pos_type po) - : pit_(pit), pos_(po), fill_(0), height_(0), width_(0), y_(0), +Row::Row() + : pos_(0), end_(0), height_(0), width_(0), y_offset_(0), ascent_of_text_(0), baseline_(0) {} -void Row::y(unsigned int newy) -{ - y_ = newy; -} - - -unsigned int Row::y() const -{ - return y_; -} - - -ParagraphList::iterator Row::par() -{ - return pit_; -} - - -ParagraphList::iterator Row::par() const -{ - return pit_; -} - - -unsigned short Row::height() const -{ - return height_; -} - - -void Row::par(ParagraphList::iterator pit) -{ - pit_ = pit; -} +Row::Row(pos_type pos) + : pos_(pos), end_(0), height_(0), width_(0), y_offset_(0), + ascent_of_text_(0), baseline_(0) +{} void Row::pos(pos_type p) @@ -82,21 +50,15 @@ pos_type Row::pos() const } -void Row::fill(int f) +void Row::endpos(pos_type p) { - fill_ = f; + end_ = p; } -int Row::fill() const +pos_type Row::endpos() const { - return fill_; -} - - -void Row::height(unsigned short h) -{ - height_ = h; + return end_; } @@ -112,13 +74,13 @@ unsigned int Row::width() const } -void Row::ascent_of_text(unsigned short a) +void Row::ascent_of_text(unsigned int a) { ascent_of_text_ = a; } -unsigned short Row::ascent_of_text() const +unsigned int Row::ascent_of_text() const { return ascent_of_text_; } @@ -152,3 +114,13 @@ bool Row::isParStart() const { return !pos(); } + + +void Row::dump(const char * s) const +{ + lyxerr << s << " pos: " << pos_ << " width: " << width_ + << " height: " << height_ + << " ascent_of_text: " << ascent_of_text_ + << " top_of_text: " << top_of_text_ + << " y_offset: " << y_offset_ << std::endl; +}