* screen.[Ch]: merge update() and repaint()

suppress excessive debug messages


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7475 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2003-08-01 14:51:09 +00:00
parent a848fced97
commit 37ae3fda0d
5 changed files with 18 additions and 44 deletions

View File

@ -469,7 +469,8 @@ int BufferView::Pimpl::resizeCurrentBuffer()
void BufferView::Pimpl::repaint()
{
// Regenerate the screen.
screen().redraw(bv_, bv_->text);
lyxerr << "BufferView::repaint()\n";
screen().redraw(*bv_);
}
@ -648,7 +649,7 @@ void BufferView::Pimpl::workAreaResize()
void BufferView::Pimpl::update()
{
lyxerr << "BufferView::update()\n";
screen().update(*bv_);
screen().redraw(*bv_);
bv_->text->clearPaint();
}

View File

@ -1,4 +1,8 @@
2003-08-01 André Pönitz <poenitz@gmx.net>
* screen.[Ch]: merge update() and repaint()
2003-07-29 André Pönitz <poenitz@gmx.net>
* screen.[Ch]: remove toggleToggle.

View File

@ -297,25 +297,6 @@ bool LyXScreen::fitCursor(LyXText * text, BufferView * bv)
}
void LyXScreen::update(BufferView & bv, int yo, int xo)
{
LyXText * text = bv.text;
workarea().getPainter().start();
if (text->needRefresh()) {
int const vwidth = workarea().workWidth();
int const vheight = workarea().workHeight();
text->updateRowPositions();
int const y = 0;
drawFromTo(text, &bv, y, vheight, yo, xo);
expose(0, y, vwidth, vheight - y);
}
workarea().getPainter().end();
}
void LyXScreen::toggleSelection(LyXText * text, BufferView * bv,
bool kill_selection,
int yo, int xo)
@ -348,9 +329,9 @@ void LyXScreen::toggleSelection(LyXText * text, BufferView * bv,
}
void LyXScreen::redraw(BufferView * bv, LyXText * text)
void LyXScreen::redraw(BufferView & bv)
{
greyed_out_ = !text;
greyed_out_ = !bv.text;
if (greyed_out_) {
greyOut();
@ -359,8 +340,8 @@ void LyXScreen::redraw(BufferView * bv, LyXText * text)
workarea().getPainter().start();
text->updateRowPositions();
drawFromTo(text, bv, 0, workarea().workHeight(), 0, 0);
bv.text->updateRowPositions();
drawFromTo(bv.text, &bv, 0, workarea().workHeight(), 0, 0);
expose(0, 0, workarea().workWidth(), workarea().workHeight());
workarea().getPainter().end();

View File

@ -61,7 +61,7 @@ public:
int x, int y, int a, int d);
/// redraw the screen, without using existing pixmap
virtual void redraw(BufferView * bv, LyXText * text);
virtual void redraw(BufferView & bv);
/**
* topCursorVisible - get a new "top" to make the cursor visible
@ -83,18 +83,6 @@ public:
*/
virtual bool fitCursor(LyXText *, BufferView *);
/**
* update - update part of the screen rendering
* @param bv the bufferview
* @param xo the x offset into the text
* @param yo the x offset into the text
*
* Updates part of the screen. If bv->text->needRefresh is
* true, we update from the
* point of change to the end of the screen.
*/
virtual void update(BufferView & bv, int yo = 0, int xo = 0);
/// hide the visible cursor, if it is visible
void hideCursor();

View File

@ -648,7 +648,7 @@ void LyXText::redoParagraph(ParagraphList::iterator pit)
// insert a new row, starting at position 0
Row newrow(pit, 0);
rit = rowlist_.insert(rit, newrow);
newrow.dump("newrow: ");
//newrow.dump("newrow: ");
// and now append the whole paragraph before the new row
// was: appendParagraph(rit);
@ -660,12 +660,12 @@ void LyXText::redoParagraph(ParagraphList::iterator pit)
pos_type z = rowBreakPoint(*rit);
RowList::iterator tmprow = rit;
tmprow->dump("tmprow: ");
//tmprow->dump("tmprow: ");
if (z < last) {
++z;
Row newrow(rit->par(), z);
newrow.dump("newrow2: ");
//newrow.dump("newrow2: ");
rit = rowlist_.insert(boost::next(rit), newrow);
} else {
done = true;
@ -674,11 +674,11 @@ void LyXText::redoParagraph(ParagraphList::iterator pit)
// Set the dimensions of the row
// fixed fill setting now by calling inset->update() in
// SingleWidth when needed!
tmprow->dump("tmprow 1: ");
//tmprow->dump("tmprow 1: ");
tmprow->fill(fill(tmprow, workWidth()));
tmprow->dump("tmprow 2: ");
//tmprow->dump("tmprow 2: ");
setHeightOfRow(tmprow);
tmprow->dump("tmprow 3: ");
//tmprow->dump("tmprow 3: ");
height += rit->height();
} while (!done);