rename the refresh stuff

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6572 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2003-03-25 01:28:29 +00:00
parent 17c2c4e024
commit 12b2d2ec4d
10 changed files with 47 additions and 37 deletions

View File

@ -1,3 +1,9 @@
2003-03-25 John Levon <levon@movementarian.org>
* lyxtext.h:
* text2.C:
* text3.C: rename the refreshing stuff to better names
2003-03-24 John Levon <levon@movementarian.org>
* BufferView_pimpl.h:

View File

@ -1,7 +1,8 @@
2003-03-22 John Levon <levon@movementarian.org>
* screen.C:
* screen.h:
* screen.h: LyXText refresh renamings
2003-03-17 Lars Gullik Bjønnes <larsbj@gullik.net>
* adjust for BufferView* arg removal from lyxtext.

View File

@ -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;
}

View File

@ -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);

View File

@ -1,3 +1,8 @@
2003-03-25 John Levon <levon@movementarian.org>
* insettext.C:
* insettabular.C: LyXText renamings
2003-03-24 John Levon <levon@movementarian.org>
* insettext.C: remove some dead code. Fix bug 972 and

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -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();