class RowPainter {
public:
/// initialise and run painter
- RowPainter(PainterInfo & pi, LyXText const & text,
+ RowPainter(PainterInfo & pi, Text const & text,
pit_type pit, Row const & row, int x, int y);
// paint various parts
/// Painter to use
Painter & pain_;
- /// LyXText for the row
- LyXText const & text_;
+ /// Text for the row
+ Text const & text_;
TextMetrics & text_metrics_;
ParagraphList const & pars_;
RowPainter::RowPainter(PainterInfo & pi,
- LyXText const & text, pit_type pit, Row const & row, int x, int y)
+ Text const & text, pit_type pit, Row const & row, int x, int y)
: bv_(*pi.base.bv), pain_(pi.pain), text_(text),
text_metrics_(pi.base.bv->textMetrics(&text)),
pars_(text.paragraphs()),
if (prev_change != Change::UNCHANGED) {
Font copy(font);
if (prev_change == Change::DELETED) {
- copy.setColor(Color::strikeout);
+ copy.setColor(Color::deletedtext);
} else if (prev_change == Change::INSERTED) {
- copy.setColor(Color::newtext);
+ copy.setColor(Color::addedtext);
}
x_ += pain_.text(int(x_), yo_, s, copy);
} else {
if (par_.isInserted(par_.size()) || par_.isDeleted(par_.size())) {
FontMetrics const & fm = theFontMetrics(bv_.buffer()->params().getFont());
int const length = fm.maxAscent() / 2;
- Color::color col = par_.isInserted(par_.size()) ? Color::newtext : Color::strikeout;
+ Color::color col = par_.isInserted(par_.size()) ? Color::addedtext : Color::deletedtext;
pain_.line(int(x_) + 1, yo_ + 2, int(x_) + 1, yo_ + 2 - length, col,
Painter::line_solid, Painter::line_thick);
= theFontMetrics(bv_.buffer()->params().getFont());
int const middle = yo_ - fm.maxAscent() / 3;
pain_.line(last_strikeout_x, middle, int(x_), middle,
- Color::strikeout, Painter::line_solid, Painter::line_thin);
+ Color::deletedtext, Painter::line_solid, Painter::line_thin);
running_strikeout = false;
}
x_ += 2;
++vpos;
} else if (par_.isSeparator(pos)) {
+ Font orig_font = text_.getFont(*bv_.buffer(), par_, pos);
+ double const orig_x = x_;
x_ += width_pos;
if (pos >= body_pos)
x_ += separator_;
++vpos;
+ paintForeignMark(orig_x, orig_font);
} else {
paintFromPos(vpos);
}
= theFontMetrics(bv_.buffer()->params().getFont());
int const middle = yo_ - fm.maxAscent() / 3;
pain_.line(last_strikeout_x, middle, int(x_), middle,
- Color::strikeout, Painter::line_solid, Painter::line_thin);
+ Color::deletedtext, Painter::line_solid, Painter::line_thin);
running_strikeout = false;
}
}
bool CursorOnRow(PainterInfo & pi, pit_type const pit,
- RowList::const_iterator rit, LyXText const & text)
+ RowList::const_iterator rit, Text const & text)
{
// Is there a cursor on this row (or inside inset on row)
Cursor & cur = pi.base.bv->cursor();
bool innerCursorOnRow(PainterInfo & pi, pit_type pit,
- RowList::const_iterator rit, LyXText const & text)
+ RowList::const_iterator rit, Text const & text)
{
// Is there a cursor inside an inset on this row, and is this inset
// the only "character" on this row
void paintPar
- (PainterInfo & pi, LyXText const & text, pit_type pit, int x, int y,
+ (PainterInfo & pi, Text const & text, pit_type pit, int x, int y,
bool repaintAll)
{
// lyxerr << " paintPar: pit: " << pit << " at y: " << y << endl;
{
BOOST_ASSERT(bv.buffer());
Buffer const & buffer = *bv.buffer();
- LyXText & text = buffer.text();
+ Text & text = buffer.text();
bool const select = bv.cursor().selection();
ViewMetricsInfo const & vi = bv.viewMetricsInfo();
}
-void paintTextInset(LyXText const & text, PainterInfo & pi, int x, int y)
+void paintTextInset(Text const & text, PainterInfo & pi, int x, int y)
{
// lyxerr << " paintTextInset: y: " << y << endl;