mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-26 06:15:16 +00:00
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:
parent
17c2c4e024
commit
12b2d2ec4d
@ -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:
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
21
src/text2.C
21
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)
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user