From 12b2d2ec4d11ff589a702051820a046f8421553b Mon Sep 17 00:00:00 2001 From: John Levon Date: Tue, 25 Mar 2003 01:28:29 +0000 Subject: [PATCH] rename the refresh stuff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6572 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 6 ++++++ src/frontends/ChangeLog | 3 ++- src/frontends/screen.C | 8 ++++---- src/frontends/screen.h | 4 ++-- src/insets/ChangeLog | 5 +++++ src/insets/insettabular.C | 2 +- src/insets/insettext.C | 14 +++++++------- src/lyxtext.h | 19 +++++++++---------- src/text2.C | 21 ++++++++++----------- src/text3.C | 2 +- 10 files changed, 47 insertions(+), 37 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c2ff2de440..750963d3f5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2003-03-25 John Levon + + * lyxtext.h: + * text2.C: + * text3.C: rename the refreshing stuff to better names + 2003-03-24 John Levon * BufferView_pimpl.h: diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 13733d3b26..d400b74965 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,7 +1,8 @@ 2003-03-22 John Levon * screen.C: - * screen.h: + * screen.h: LyXText refresh renamings + 2003-03-17 Lars Gullik Bjønnes * adjust for BufferView* arg removal from lyxtext. diff --git a/src/frontends/screen.C b/src/frontends/screen.C index 58b7d17e6e..a7e6f67c9f 100644 --- a/src/frontends/screen.C +++ b/src/frontends/screen.C @@ -252,15 +252,15 @@ void LyXScreen::update(BufferView & bv, int yo, int xo) workarea().getPainter().start(); - switch (text->status()) { - case LyXText::NEED_MORE_REFRESH: + switch (text->refreshStatus()) { + case LyXText::REFRESH_AREA: { int const y = max(int(text->refresh_y - text->top_y()), 0); drawFromTo(text, &bv, y, vheight, yo, xo); expose(0, y, vwidth, vheight - y); } break; - case LyXText::NEED_VERY_LITTLE_REFRESH: + case LyXText::REFRESH_ROW: { // ok I will update the current cursor row drawOneRow(text, &bv, text->refresh_row, text->refresh_y, @@ -273,7 +273,7 @@ void LyXScreen::update(BufferView & bv, int yo, int xo) } } break; - case LyXText::UNCHANGED: + case LyXText::REFRESH_NONE: // Nothing needs done break; } diff --git a/src/frontends/screen.h b/src/frontends/screen.h index 4239c57569..2c012d97d7 100644 --- a/src/frontends/screen.h +++ b/src/frontends/screen.h @@ -123,9 +123,9 @@ public: * @param yo the x offset into the text * * Updates part of the screen. If bv->text->status is - * LyXText::NEED_MORE_REFRESH, we update from the + * LyXText::REFRESH_AREA, we update from the * point of change and to the end of the screen. - * If text->status is LyXText::NEED_VERY_LITTLE_REFRESH, + * If text->status is LyXText::REFRESH_ROW, * we only update the current row. */ virtual void update(BufferView & bv, int yo = 0, int xo = 0); diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index ebfa63cf33..ad46449fb6 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2003-03-25 John Levon + + * insettext.C: + * insettabular.C: LyXText renamings + 2003-03-24 John Levon * insettext.C: remove some dead code. Fix bug 972 and diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index cd4d6d6204..36649405e4 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -411,7 +411,7 @@ void InsetTabular::update(BufferView * bv, bool reinit) if (the_locking_inset) the_locking_inset->update(bv, reinit); if (need_update < FULL && - bv->text->status() == LyXText::NEED_MORE_REFRESH) + bv->text->refreshStatus() == LyXText::REFRESH_AREA) { need_update = FULL; } diff --git a/src/insets/insettext.C b/src/insets/insettext.C index addaf9faf3..2a9486ae4c 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -499,12 +499,12 @@ void InsetText::update(BufferView * bv, bool reinit) lt = getLyXText(bv); clear = true; } - if ((need_update & CURSOR_PAR) && (lt->status() == LyXText::UNCHANGED) && + if ((need_update & CURSOR_PAR) && (lt->refreshStatus() == LyXText::REFRESH_NONE) && the_locking_inset) { lt->updateInset(the_locking_inset); } - if (lt->status() == LyXText::NEED_MORE_REFRESH) + if (lt->refreshStatus() == LyXText::REFRESH_AREA) need_update |= FULL; if (clear) lt = 0; @@ -525,14 +525,14 @@ void InsetText::setUpdateStatus(BufferView * bv, int what) const LyXText * llt = getLyXText(bv); need_update |= what; - // we have to redraw us full if our LyXText NEED_MORE_REFRESH or + // we have to redraw us full if our LyXText REFRESH_AREA or // if we don't break row so that we only have one row to update! - if ((llt->status() == LyXText::NEED_MORE_REFRESH) || + if ((llt->refreshStatus() == LyXText::REFRESH_AREA) || (!autoBreakRows && - (llt->status() == LyXText::NEED_VERY_LITTLE_REFRESH))) + (llt->refreshStatus() == LyXText::REFRESH_ROW))) { need_update |= FULL; - } else if (llt->status() == LyXText::NEED_VERY_LITTLE_REFRESH) { + } else if (llt->refreshStatus() == LyXText::REFRESH_ROW) { need_update |= CURSOR_PAR; } @@ -558,7 +558,7 @@ void InsetText::updateLocal(BufferView * bv, int what, bool mark_dirty) setUpdateStatus(bv, what); bool flag = mark_dirty || (((need_update != CURSOR) && (need_update != NONE)) || - (lt->status() != LyXText::UNCHANGED) || lt->selection.set()); + (lt->refreshStatus() != LyXText::REFRESH_NONE) || lt->selection.set()); if (!lt->selection.set()) lt->selection.cursor = lt->cursor; diff --git a/src/lyxtext.h b/src/lyxtext.h index eba0ec42a6..8bcb5667d4 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -37,13 +37,13 @@ class ParagraphList; class LyXText { public: /// what repainting is needed - enum text_status { + enum refresh_status { /// no repaint is needed - UNCHANGED = 0, + REFRESH_NONE = 0, /// the refresh_row needs repainting - NEED_VERY_LITTLE_REFRESH = 1, + REFRESH_ROW = 1, /// everything from refresh_y downwards needs repainting - NEED_MORE_REFRESH = 2 + REFRESH_AREA = 2 }; /// @@ -207,26 +207,25 @@ public: * Return the status. This represents what repaints are * pending after some operation (e.g. inserting a char). */ - text_status status() const; + refresh_status refreshStatus() const; private: /** * The pixel y position from which to repaint the screen. * The position is absolute along the height of outermost - * lyxtext (I think). NEED_MORE_REFRESH and NEED_LITTLE_REFRESH + * lyxtext (I think). REFRESH_AREA and REFRESH_ROW * repaints both use this as a starting point (if it's within * the viewable portion of the lyxtext). */ int refresh_y; /** * The row from which to repaint the screen, used by screen.c. - * This must be set if the pending update is NEED_LITTLE_REFRESH. - * It doesn't make any difference for NEED_MORE_REFRESH. + * This must be set if the pending update is REFRESH_ROW. + * It doesn't make any difference for REFRESH_AREA. */ Row * refresh_row; - /// refresh status - text_status status_; + refresh_status refresh_status_; /// only the top-level LyXText has this non-zero BufferView * bv_owner; diff --git a/src/text2.C b/src/text2.C index 9410373ee2..df586f9893 100644 --- a/src/text2.C +++ b/src/text2.C @@ -2442,15 +2442,15 @@ void LyXText::ownerParagraph(int id, Paragraph * p) const } -LyXText::text_status LyXText::status() const +LyXText::refresh_status LyXText::refreshStatus() const { - return status_; + return refresh_status_; } void LyXText::clearPaint() { - status_ = UNCHANGED; + refresh_status_ = REFRESH_NONE; refresh_row = 0; refresh_y = 0; } @@ -2458,14 +2458,13 @@ void LyXText::clearPaint() void LyXText::postPaint(int start_y) { - text_status old = status_; + refresh_status old = refresh_status_; - status_ = NEED_MORE_REFRESH; + refresh_status_ = REFRESH_AREA; refresh_row = 0; - if (old != UNCHANGED && refresh_y < start_y) { + if (old != REFRESH_NONE && refresh_y < start_y) return; - } refresh_y = start_y; @@ -2483,17 +2482,17 @@ void LyXText::postPaint(int start_y) // make refresh_y be 0, and use row->y etc. void LyXText::postRowPaint(Row * row, int start_y) { - if (status_ != UNCHANGED && refresh_y < start_y) { - status_ = NEED_MORE_REFRESH; + if (refresh_status_ != REFRESH_NONE && refresh_y < start_y) { + refresh_status_ = REFRESH_AREA; return; } else { refresh_y = start_y; } - if (status_ == NEED_MORE_REFRESH) + if (refresh_status_ == REFRESH_AREA) return; - status_ = NEED_VERY_LITTLE_REFRESH; + refresh_status_ = REFRESH_ROW; refresh_row = row; if (!inset_owner) diff --git a/src/text3.C b/src/text3.C index 6e9ed0883d..34885b6803 100644 --- a/src/text3.C +++ b/src/text3.C @@ -67,7 +67,7 @@ namespace { if (!lt->isInInset()) { bv->update(lt, BufferView::SELECT); bv->showCursor(); - } else if (bv->text->status() != LyXText::UNCHANGED) { + } else if (bv->text->refreshStatus() != LyXText::REFRESH_NONE) { bv->theLockingInset()->hideInsetCursor(bv); bv->update(BufferView::SELECT); bv->showCursor();