DispatchResult::update() ==> DispatchResult::screenUpdate()

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35631 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-10-13 17:28:55 +00:00
parent 35eb1a2405
commit 6a80ce62ca
12 changed files with 64 additions and 64 deletions

View File

@ -2045,7 +2045,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
docstring const str = branch_name + ' ' + from_ascii(x11hexname);
lyx::dispatch(FuncRequest(LFUN_SET_COLOR, str));
dr.setError(false);
dr.update(Update::Force);
dr.screenUpdate(Update::Force);
}
}
if (!msg.empty())
@ -2072,7 +2072,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
} else {
branch->setSelected(func.action() == LFUN_BRANCH_ACTIVATE);
dr.setError(false);
dr.update(Update::Force);
dr.screenUpdate(Update::Force);
dr.forceBufferUpdate();
}
break;
@ -2109,7 +2109,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
}
if (success) {
dr.update(Update::Force);
dr.screenUpdate(Update::Force);
dr.forceBufferUpdate();
}
break;

View File

@ -1207,7 +1207,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
// We are most certainly here because of a change in the document
// It is then better to make sure that all dialogs are in sync with
// current document settings.
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
dr.forceBufferUpdate();
break;
}
@ -1219,7 +1219,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
buffer_.params().clearLayoutModules();
buffer_.params().makeDocumentClass();
updateDocumentClass(oldClass);
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
dr.forceBufferUpdate();
break;
}
@ -1237,7 +1237,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
buffer_.params().addLayoutModule(argument);
buffer_.params().makeDocumentClass();
updateDocumentClass(oldClass);
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
dr.forceBufferUpdate();
break;
}
@ -1269,7 +1269,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
buffer_.params().setBaseClass(argument);
buffer_.params().makeDocumentClass();
updateDocumentClass(oldDocClass);
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
dr.forceBufferUpdate();
break;
}
@ -1295,7 +1295,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
buffer_.params().setBaseClass(bc);
buffer_.params().makeDocumentClass();
updateDocumentClass(oldClass);
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
dr.forceBufferUpdate();
break;
}
@ -1306,7 +1306,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
if (!cur.textUndo())
dr.setMessage(_("No further undo information"));
else
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
dr.forceBufferUpdate();
break;
@ -1316,7 +1316,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
if (!cur.textRedo())
dr.setMessage(_("No further redo information"));
else
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
dr.forceBufferUpdate();
break;
@ -1365,7 +1365,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
// Set the cursor
dit.pos() = pos;
setCursor(dit);
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
} else {
// Switch to other buffer view and resend cmd
lyx::dispatch(FuncRequest(
@ -1419,18 +1419,18 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
case LFUN_CHANGE_NEXT:
findNextChange(this);
// FIXME: Move this LFUN to Buffer so that we don't have to do this:
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
break;
case LFUN_CHANGE_PREVIOUS:
findPreviousChange(this);
// FIXME: Move this LFUN to Buffer so that we don't have to do this:
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
break;
case LFUN_CHANGES_MERGE:
if (findNextChange(this) || findPreviousChange(this)) {
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
dr.forceBufferUpdate();
showDialog("changes");
}
@ -1444,7 +1444,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
// accept everything in a single step to support atomic undo
buffer_.text().acceptOrRejectChanges(cur, Text::ACCEPT);
// FIXME: Move this LFUN to Buffer so that we don't have to do this:
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
dr.forceBufferUpdate();
break;
@ -1457,7 +1457,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
// Note: reject does not work recursively; the user may have to repeat the operation
buffer_.text().acceptOrRejectChanges(cur, Text::REJECT);
// FIXME: Move this LFUN to Buffer so that we don't have to do this:
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
dr.forceBufferUpdate();
break;
@ -1663,7 +1663,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
bool update = in_texted && cur.bv().checkDepm(cur, old);
cur.finishUndo();
if (update) {
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
dr.forceBufferUpdate();
}
break;
@ -1687,7 +1687,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
y = getPos(cur).y_;
cur.finishUndo();
dr.update(Update::SinglePar | Update::FitCursor);
dr.screenUpdate(Update::SinglePar | Update::FitCursor);
break;
}
@ -1704,7 +1704,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
y = getPos(cur).y_;
cur.finishUndo();
dr.update(Update::SinglePar | Update::FitCursor);
dr.screenUpdate(Update::SinglePar | Update::FitCursor);
break;
}
@ -1747,7 +1747,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
cur.endUndoGroup();
cur = savecur;
cur.fixIfBroken();
dr.update(Update::Force);
dr.screenUpdate(Update::Force);
dr.forceBufferUpdate();
if (iterations >= max_iter) {
@ -1853,7 +1853,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
// single par update would be good enough, but it has no way
// to tell us that at the moment.
inset->dispatch(cur, fr);
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
dr.forceBufferUpdate();
break;
}
@ -2061,8 +2061,8 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
theSelection().haveSelection(cursor().selection());
// If the command has been dispatched,
if (cur.result().dispatched() || cur.result().update())
processUpdateFlags(cur.result().update());
if (cur.result().dispatched() || cur.result().screenUpdate())
processUpdateFlags(cur.result().screenUpdate());
}
@ -2878,10 +2878,10 @@ void BufferView::setInlineCompletion(Cursor & cur, DocIterator const & pos,
// set update flags
if (changed) {
if (singlePar && !(cur.result().update() & Update::Force))
cur.screenUpdateFlags(cur.result().update() | Update::SinglePar);
if (singlePar && !(cur.result().screenUpdate() & Update::Force))
cur.screenUpdateFlags(cur.result().screenUpdate() | Update::SinglePar);
else
cur.screenUpdateFlags(cur.result().update() | Update::Force);
cur.screenUpdateFlags(cur.result().screenUpdate() | Update::Force);
}
}

View File

@ -339,7 +339,7 @@ void Cursor::dispatch(FuncRequest const & cmd0)
if (lyxaction.funcHasFlag(cmd.action(), LyXAction::AtPoint)
&& nextInset()) {
disp_.dispatched(true);
disp_.update(Update::FitCursor | Update::Force);
disp_.screenUpdate(Update::FitCursor | Update::Force);
FuncRequest tmpcmd = cmd;
LYXERR(Debug::DEBUG, "Cursor::dispatch: (AtPoint) cmd: "
<< cmd0 << endl << *this);
@ -362,7 +362,7 @@ void Cursor::dispatch(FuncRequest const & cmd0)
// The common case is 'LFUN handled, need update', so make the
// LFUN handler's life easier by assuming this as default value.
// The handler can reset the update and val flags if necessary.
disp_.update(Update::FitCursor | Update::Force);
disp_.screenUpdate(Update::FitCursor | Update::Force);
disp_.dispatched(true);
inset().dispatch(*this, cmd);
if (disp_.dispatched())
@ -383,7 +383,7 @@ void Cursor::dispatch(FuncRequest const & cmd0)
safe.pos() = safe.lastpos();
}
operator=(safe);
disp_.update(Update::None);
disp_.screenUpdate(Update::None);
disp_.dispatched(false);
} else {
// restore the previous one because nested Cursor::dispatch calls
@ -2122,7 +2122,7 @@ void Cursor::dispatched()
void Cursor::screenUpdateFlags(Update::flags f)
{
disp_.update(f);
disp_.screenUpdate(f);
}
@ -2146,7 +2146,7 @@ bool Cursor::needBufferUpdate() const
void Cursor::noScreenUpdate()
{
disp_.update(Update::None);
disp_.screenUpdate(Update::None);
}

View File

@ -41,9 +41,9 @@ public:
///
void setMessage(docstring m) { message_ = m; }
///
Update::flags update() const { return update_; }
Update::flags screenUpdate() const { return update_; }
///
void update(Update::flags f) { update_ = f; }
void screenUpdate(Update::flags f) { update_ = f; }
/// Does the buffer need updating?
bool needBufferUpdate() const { return need_buf_update_; }
/// Force the buffer to be updated

View File

@ -2036,8 +2036,8 @@ bool Text::insertCompletion(Cursor & cur, docstring const & s, bool /*finished*/
LASSERT(cur.bv().cursor() == cur, /**/);
cur.insert(s);
cur.bv().cursor() = cur;
if (!(cur.result().update() & Update::Force))
cur.screenUpdateFlags(cur.result().update() | Update::SinglePar);
if (!(cur.result().screenUpdate() & Update::Force))
cur.screenUpdateFlags(cur.result().screenUpdate() | Update::SinglePar);
return true;
}

View File

@ -2133,7 +2133,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
// for now only Text::erase() and Text::backspace() do that.
// The plan is to verify all the LFUNs and then to remove this
// singleParUpdate boolean altogether.
if (cur.result().update() & Update::Force) {
if (cur.result().screenUpdate() & Update::Force) {
singleParUpdate = false;
needsUpdate = true;
}

View File

@ -1092,7 +1092,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd)
DispatchResult dr;
// redraw the screen at the end (first of the two drawing steps).
//This is done unless explicitly requested otherwise
dr.update(Update::FitCursor);
dr.screenUpdate(Update::FitCursor);
dispatch(cmd, dr);
if (!current_view_)
@ -1108,7 +1108,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd)
// also initializes the position cache for all insets in
// (at least partially) visible top-level paragraphs.
// We will redraw the screen only if needed.
bv->processUpdateFlags(dr.update());
bv->processUpdateFlags(dr.screenUpdate());
// Do we have a selection?
theSelection().haveSelection(bv->cursor().selection());
@ -1237,7 +1237,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
dr.setMessage(flag.message());
dr.setError(true);
dr.dispatched(false);
dr.update(Update::None);
dr.screenUpdate(Update::None);
dr.clearBufferUpdate();
return;
};
@ -1564,7 +1564,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
case LFUN_BOOKMARK_GOTO:
// go to bookmark, open unopened file and switch to buffer if necessary
gotoBookmark(convert<unsigned int>(to_utf8(cmd.argument())), true, true);
dr.update(Update::Force | Update::FitCursor);
dr.screenUpdate(Update::Force | Update::FitCursor);
break;
case LFUN_BOOKMARK_CLEAR:

View File

@ -313,8 +313,8 @@ void GuiCompleter::updateVisibility(Cursor & cur, bool start, bool keep, bool cu
inline_timer_.start(int(lyxrc.completion_inline_delay * 1000));
else {
// no inline completion, hence a metrics update is needed
if (!(cur.result().update() & Update::Force))
cur.screenUpdateFlags(cur.result().update() | Update::SinglePar);
if (!(cur.result().screenUpdate() & Update::Force))
cur.screenUpdateFlags(cur.result().screenUpdate() | Update::SinglePar);
}
// update prefix if any completion is possible
@ -335,8 +335,8 @@ void GuiCompleter::updateVisibility(bool start, bool keep)
updateVisibility(cur, start, keep);
if (cur.result().update())
gui_->bufferView().processUpdateFlags(cur.result().update());
if (cur.result().screenUpdate())
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
@ -600,8 +600,8 @@ void GuiCompleter::showPopup()
showPopup(cur);
// redraw if needed
if (cur.result().update())
gui_->bufferView().processUpdateFlags(cur.result().update());
if (cur.result().screenUpdate())
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
@ -613,8 +613,8 @@ void GuiCompleter::showInline()
showInline(cur);
// redraw if needed
if (cur.result().update())
gui_->bufferView().processUpdateFlags(cur.result().update());
if (cur.result().screenUpdate())
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
@ -626,8 +626,8 @@ void GuiCompleter::hidePopup()
hidePopup(cur);
// redraw if needed
if (cur.result().update())
gui_->bufferView().processUpdateFlags(cur.result().update());
if (cur.result().screenUpdate())
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
@ -639,8 +639,8 @@ void GuiCompleter::hideInline()
hideInline(cur);
// redraw if needed
if (cur.result().update())
gui_->bufferView().processUpdateFlags(cur.result().update());
if (cur.result().screenUpdate())
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
@ -718,8 +718,8 @@ void GuiCompleter::tab()
popup_timer_.start(0);
// redraw if needed
if (cur.result().update())
gui_->bufferView().processUpdateFlags(cur.result().update());
if (cur.result().screenUpdate())
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
@ -884,8 +884,8 @@ void GuiCompleter::popupActivated(const QString & completion)
hidePopup(cur);
hideInline(cur);
if (cur.result().update())
gui_->bufferView().processUpdateFlags(cur.result().update());
if (cur.result().screenUpdate())
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
@ -900,8 +900,8 @@ void GuiCompleter::popupHighlighted(const QString & completion)
if (inlineVisible())
updateInline(cur, completion);
if (cur.result().update())
gui_->bufferView().processUpdateFlags(cur.result().update());
if (cur.result().screenUpdate())
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
} // namespace frontend

View File

@ -2831,7 +2831,7 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
{
BufferView * bv = currentBufferView();
// By default we won't need any update.
dr.update(Update::None);
dr.screenUpdate(Update::None);
// assume cmd will be dispatched
dr.dispatched(true);

View File

@ -1454,7 +1454,7 @@ void InsetMathNest::lfunMousePress(Cursor & cur, FuncRequest & cmd)
// position if needed
// cur.result().update(): don't overwrite previously set flags.
cur.screenUpdateFlags(Update::Decoration | Update::FitCursor
| cur.result().update());
| cur.result().screenUpdate());
} else if (cmd.button() == mouse_button::button2) {
if (cap::selection()) {
// See comment in Text::dispatch why we do this

View File

@ -704,13 +704,13 @@ bool InsetMathScript::notifyCursorLeaves(Cursor const & old, Cursor & cur)
// must be a subscript...
old.recordUndoInset();
removeScript(false);
cur.screenUpdateFlags(cur.result().update() | Update::SinglePar);
cur.screenUpdateFlags(cur.result().screenUpdate() | Update::SinglePar);
return true;
} else if (cell(1).empty()) {
// must be a superscript...
old.recordUndoInset();
removeScript(true);
cur.screenUpdateFlags(cur.result().update() | Update::SinglePar);
cur.screenUpdateFlags(cur.result().screenUpdate() | Update::SinglePar);
return true;
}
}
@ -740,7 +740,7 @@ bool InsetMathScript::notifyCursorLeaves(Cursor const & old, Cursor & cur)
insetCur.cell().insert(insetCur.pos(), ar);
// redraw
cur.screenUpdateFlags(cur.result().update() | Update::SinglePar);
cur.screenUpdateFlags(cur.result().screenUpdate() | Update::SinglePar);
return true;
}

View File

@ -640,7 +640,7 @@ bool MathMacro::notifyCursorLeaves(Cursor const & old, Cursor & cur)
inset_cursor.cell().erase(inset_cursor.pos());
inset_cursor.cell().insert(inset_cursor.pos(),
createInsetMath(unfolded_name, cur.buffer()));
cur.screenUpdateFlags(cur.result().update() | Update::SinglePar);
cur.screenUpdateFlags(cur.result().screenUpdate() | Update::SinglePar);
return true;
}
}