3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
10 * \author Jürgen Vigna
12 * Full author contact details are available in file CREDITS.
14 * Metrics for an on-screen text row.
27 : separator(0), hfill(0), label_hfill(0), x(0),
28 sel_beg(-1), sel_end(-1), changed_(false), crc_(0), pos_(0), end_(0)
32 Row::Row(pos_type pos)
33 : separator(0), hfill(0), label_hfill(0), x(0),
34 sel_beg(-1), sel_end(-1), changed_(false), crc_(0), pos_(pos), end_(0)
38 void Row::setCrc(size_type crc)
40 changed_ |= crc != crc_;
45 void Row::setDimension(Dimension const & dim)
47 changed_ |= dim != dim_;
52 void Row::pos(pos_type p)
58 void Row::endpos(pos_type p)
64 void Row::setSelection(pos_type beg, pos_type end)
66 pos_type sel_beg_b = sel_beg;
67 if (pos_ >= beg && pos_ <= end)
69 else if (beg > pos_ && beg <= end_)
74 pos_type sel_end_b = sel_end;
75 if (end_ >= beg && end_ <= end)
77 else if (end < end_ && end >= pos_)
82 && ((rit->pos() >= beg.pos() && rit->pos() <= end.pos())
83 || (rit->endpos() >= beg.pos() && rit->endpos() <= end.pos())
84 || (beg.pos() >= rit->pos() && beg.pos() <= rit->endpos())
85 || (end.pos() >= rit->pos() && end.pos() <= rit->endpos()));
87 changed_ |= sel_beg_b != sel_beg;
88 changed_ |= sel_end_b != sel_end;
92 void Row::dump(char const * s) const
94 lyxerr << s << " pos: " << pos_ << " end: " << end_
95 << " width: " << dim_.wid
96 << " ascent: " << dim_.asc
97 << " descent: " << dim_.des