]> git.lyx.org Git - features.git/commitdiff
DispatchResult::update() ==> DispatchResult::screenUpdate()
authorRichard Heck <rgheck@comcast.net>
Wed, 13 Oct 2010 17:28:55 +0000 (17:28 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 13 Oct 2010 17:28:55 +0000 (17:28 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35631 a592a061-630c-0410-9148-cb99ea01b6c8

12 files changed:
src/Buffer.cpp
src/BufferView.cpp
src/Cursor.cpp
src/DispatchResult.h
src/Text.cpp
src/Text3.cpp
src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/GuiCompleter.cpp
src/frontends/qt4/GuiView.cpp
src/mathed/InsetMathNest.cpp
src/mathed/InsetMathScript.cpp
src/mathed/MathMacro.cpp

index 74eb47c6948164d0026a9f6bdad067949384c021..b2c3d8ddd8ec5c20a011ed596ba0ab4c847410ce 100644 (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;
index e3abe9586ff49bdd7a3b1481bc343275be72bee1..d4113974f9d02ef93ff9b64699ba6ab484202608 100644 (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);
        }
 }
 
index e4a34b158ce88590237ee7ad3c4c75ec6b118409..16067119e3eb376586b450d0349277b6084f7ba7 100644 (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);
 }
 
 
index 070ee1bdfc0efa65d84621cc18e5c41ce9dac8ed..bc5bb59c8e95b59d8fe7fdb7565d30099bf934d9 100644 (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
index 702bcdf78041f26e8cbfabf1de7421e806c1c7b7..77385f0419fde380193729f1d724d2bc6b2e870b 100644 (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;
 }
        
index 08049f005382689ec374c9291df51a022b5a7560..4dd686a19624c6fb2241f50f24102109662ffb65 100644 (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;
        }
index f42c099df3e83584fc5e6b4f681628e037b90651..5c511a32338a1f1d282fc5295009d5a5a8e0efe5 100644 (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:
index 17d4c63c2d0e8d24320d114251253b606263cefe..dfd15a941943a60bd2678718be76ccd1f07a4b73 100644 (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
index 40a0373ddf737eb489fae5b31351dea9f4461267..704c94a648b8f1a6e850ff91738e4984efebe5f0 100644 (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);
 
index 7748da2f5c49a34a103d7da7bc34c9198fdadffb..0b11be1308614340f3c0c5aec9f6305c16832f9b 100644 (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
index feadd025347a0634bd16f0a089f03d70fb541e61..5970af9a9d637fe6b6c62bcb33264c2250c52adc 100644 (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;
        }
 
index 5eb5c3a8d0a875718f31f259699fe5c347198cbb..6a232716dce29bbd1a8cce64d9e7a257f406c2ee 100644 (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;
                }
        }