From 37ae3fda0dc69a466f4cdc3757edc3d55cc40594 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 1 Aug 2003 14:51:09 +0000 Subject: [PATCH] * 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 --- src/BufferView_pimpl.C | 5 +++-- src/frontends/ChangeLog | 4 ++++ src/frontends/screen.C | 27 ++++----------------------- src/frontends/screen.h | 14 +------------- src/text2.C | 12 ++++++------ 5 files changed, 18 insertions(+), 44 deletions(-) diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 4ce52f79b3..533b520f30 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -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(); } diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 8e9303ba9d..4232770fa9 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,4 +1,8 @@ +2003-08-01 André Pönitz + + * screen.[Ch]: merge update() and repaint() + 2003-07-29 André Pönitz * screen.[Ch]: remove toggleToggle. diff --git a/src/frontends/screen.C b/src/frontends/screen.C index 48060a82da..a98e78b949 100644 --- a/src/frontends/screen.C +++ b/src/frontends/screen.C @@ -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(); diff --git a/src/frontends/screen.h b/src/frontends/screen.h index 9f87cb5c6b..f500017402 100644 --- a/src/frontends/screen.h +++ b/src/frontends/screen.h @@ -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(); diff --git a/src/text2.C b/src/text2.C index 16c8484a14..7ae9733aa3 100644 --- a/src/text2.C +++ b/src/text2.C @@ -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); -- 2.39.2