{
lyxerr << "BufferView::update()\n";
screen().redraw(*bv_);
- bv_->text->clearPaint();
}
* text.C:
* text2.C: make redoParagraph more independent of current cursor
+ * lyxtext.h (need_update, needUpdate, postPaint, clearPaint):
+ * text.C:
+ * text2.C: remove unneeded members
+
2003-07-30 André Pönitz <poenitz@gmx.net>
* paragraph.[Ch] (copyIntoMinibuffer): removed unused function
paintRows(*bv, text_, rit, x, 0, yo, y2, yo);
- text_.clearPaint();
-
if (drawFrame_ == ALWAYS || (drawFrame_ == LOCKED && locked))
drawFrame(pain, int(start_x));
void InsetText::setUpdateStatus(int what) const
{
need_update |= what;
- // we will to redraw us full if our LyXText wants it
- if (text_.needRefresh())
- need_update |= FULL;
-
// this to not draw a selection when we redraw all of it!
if (need_update & CURSOR && !(need_update & SELECTION)) {
if (text_.selection.set())
text_.partialRebreak();
setUpdateStatus(what);
bool flag = mark_dirty ||
- ((need_update != CURSOR && need_update != NONE) ||
- text_.needRefresh() || text_.selection.set());
+ (need_update != CURSOR && need_update != NONE) ||
+ text_.selection.set();
if (!text_.selection.set())
text_.selection.cursor = text_.cursor;
bv->fitCursor();
- if (flag) {
- text_.postPaint();
+ if (flag)
bv->updateInset(const_cast<InsetText *>(this));
- }
if (need_update == CURSOR)
need_update = NONE;
/// compute text metrics
void metrics(MetricsInfo & mi, Dimension & dim);
- /// clear any pending paints
- void clearPaint();
-
- /// submit repaint request
- void postPaint();
-
///
InsetOld::RESULT dispatch(FuncRequest const & cmd);
friend class LyXScreen;
- /**
- * Return the status. This represents what repaints are
- * pending after some operation (e.g. inserting a char).
- */
- bool needRefresh() const;
-
-private:
- // do we need a refresh?
- bool need_refresh_;
-
public:
/// only the top-level LyXText has this non-zero
BufferView * bv_owner;
anchor_row_offset_ = newy - y;
lyxerr[Debug::GUI] << "changing reference to row: " << &*anchor_row_
<< " offset: " << anchor_row_offset_ << endl;
- postPaint();
}
cursorLeft(bv());
}
- postPaint();
-
removeParagraph(cursorRow());
// set the dimensions of the cursor row
setHeightOfRow(boost::prior(row));
- postPaint();
-
breakAgainOneRow(row);
current_font = rawtmpfont;
}
if (c == Paragraph::META_INSET || row->fill() < 0) {
- postPaint();
breakAgainOneRow(row);
RowList::iterator next_row = boost::next(row);
} else {
// FIXME: similar code is duplicated all over - make resetHeightOfRow
setHeightOfRow(row);
- postPaint();
current_font = rawtmpfont;
real_current_font = realtmpfont;
++pos;
}
-
- if (getRow(to) != getRow(from))
- postPaint();
}
cursorLeft(bv());
// the layout things can change the height of a row !
- int const tmpheight = cursorRow()->height();
setHeightOfRow(cursorRow());
- if (cursorRow()->height() != tmpheight)
- postPaint();
return;
}
}
if (cursor.pos())
cursor.pos(cursor.pos() - 1);
- postPaint();
-
// remove the lost paragraph
// This one is not safe, since the paragraph that the tmprow and the
// following rows belong to has been deleted by the PasteParagraph
y -= tmprow->height();
tmprow->fill(fill(tmprow, workWidth()));
setHeightOfRow(tmprow);
- postPaint();
setCursor(cursor.par(), cursor.pos(),
false, cursor.boundary());
if (lastPos(*this, row) == row->par()->size() - 1)
removeRow(boost::next(row));
- postPaint();
-
breakAgainOneRow(row);
// will the cursor be in another row now?
if (boost::next(row) != rows().end() &&
// set the dimensions of the row
row->fill(fill(row, workWidth()));
setHeightOfRow(row);
- postPaint();
setCursor(cursor.par(), cursor.pos(), false, cursor.boundary());
}
}
inset_owner(0), the_locking_inset(0), bv_owner(bv)
{
anchor_row_ = rows().end();
- need_refresh_ = true;
}
inset_owner(inset), the_locking_inset(0), bv_owner(bv)
{
anchor_row_ = rows().end();
- need_refresh_ = true;
}
rowlist_.clear();
width = height = 0;
- need_refresh_ = true;
anchor_row_ = rows().end();
anchor_row_offset_ = 0;
setHeightOfRow(tmprow);
}
- postPaint();
-
setCursor(cursor.par(), cursor.pos(), false, cursor.boundary());
}
params.noindent(noindent);
tmppit = boost::prior(pit);
}
- postPaint();
redoParagraphs(selection.start.par(), endpit);
void LyXText::checkParagraph(ParagraphList::iterator pit, pos_type pos)
{
breakAgain(getRow(pit, pos));
- postPaint();
setCursorIntern(cursor.par(), cursor.pos(), false, cursor.boundary());
}
if (getRow(old_cursor) != rows().begin()) {
RowList::iterator prevrow = boost::prior(getRow(old_cursor));
- postPaint();
tmpcursor = cursor;
cursor = old_cursor; // that undo can restore the right cursor position
#warning FIXME. --end() iterator is usable here
setHeightOfRow(prevrow);
} else {
RowList::iterator nextrow = boost::next(getRow(old_cursor));
- postPaint();
tmpcursor = cursor;
cursor = old_cursor; // that undo can restore the right cursor position
}
-bool LyXText::needRefresh() const
-{
- return need_refresh_;
-}
-
-
-void LyXText::clearPaint()
-{
- need_refresh_ = false;
-}
-
-
-void LyXText::postPaint()
-{
- need_refresh_ = true;
-
- // We are an inset's lyxtext. Tell the top-level lyxtext
- // it needs to update the row we're in.
- if (inset_owner)
- bv()->text->postPaint();
-}
-
-
bool LyXText::isInInset() const
{
// Sub-level has non-null bv owner and
else
bv->repaint();
}
- if (!lt->isInInset()) {
- bv->update(lt, BufferView::SELECT);
- } else if (bv->text->needRefresh()) {
- bv->update(BufferView::SELECT);
- }
+ bv->update();
if (!lt->selection.set())
bv->haveSelection(false);
// we can set the refreshing parameters now
updateCounters();
redoHeightOfParagraph();
- postPaint();
setCursor(cursor.par(), cursor.pos());
update();
break;
}
finishUndo();
-
- // And repaint the lot
- bv->text->postPaint();
-
return true;
}
freezeUndo();
bv->unlockInset(bv->theLockingInset());
finishUndo();
- bv->text->postPaint();
unFreezeUndo();
return false;
}