]> git.lyx.org Git - lyx.git/commitdiff
dispatchresult -> DispatchResult
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 29 Oct 2003 10:47:21 +0000 (10:47 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 29 Oct 2003 10:47:21 +0000 (10:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7998 a592a061-630c-0410-9148-cb99ea01b6c8

79 files changed:
src/BufferView_pimpl.C
src/ChangeLog
src/Makefile.am
src/cursor.C
src/dispatchresult.h [new file with mode: 0644]
src/insets/ChangeLog
src/insets/insetbase.C
src/insets/insetbase.h
src/insets/insetbibitem.C
src/insets/insetbibitem.h
src/insets/insetbibtex.C
src/insets/insetbibtex.h
src/insets/insetbox.C
src/insets/insetbox.h
src/insets/insetbranch.C
src/insets/insetbranch.h
src/insets/insetcite.C
src/insets/insetcite.h
src/insets/insetcollapsable.C
src/insets/insetcollapsable.h
src/insets/insetcommand.C
src/insets/insetcommand.h
src/insets/insetert.C
src/insets/insetert.h
src/insets/insetexternal.C
src/insets/insetexternal.h
src/insets/insetfloat.C
src/insets/insetfloat.h
src/insets/insetfloatlist.C
src/insets/insetfloatlist.h
src/insets/insetgraphics.C
src/insets/insetgraphics.h
src/insets/insetinclude.C
src/insets/insetinclude.h
src/insets/insetindex.C
src/insets/insetindex.h
src/insets/insetlabel.C
src/insets/insetlabel.h
src/insets/insetlatexaccent.C
src/insets/insetminipage.C
src/insets/insetminipage.h
src/insets/insetnote.C
src/insets/insetnote.h
src/insets/insetref.C
src/insets/insetref.h
src/insets/insettabular.C
src/insets/insettabular.h
src/insets/insettext.C
src/insets/insettext.h
src/insets/insettoc.C
src/insets/insettoc.h
src/insets/inseturl.C
src/insets/inseturl.h
src/insets/insetwrap.C
src/insets/insetwrap.h
src/insets/updatableinset.C
src/insets/updatableinset.h
src/lyxfunc.C
src/lyxtext.h
src/mathed/ChangeLog
src/mathed/command_inset.C
src/mathed/command_inset.h
src/mathed/formulabase.C
src/mathed/formulabase.h
src/mathed/math_cursor.C
src/mathed/math_cursor.h
src/mathed/math_gridinset.C
src/mathed/math_gridinset.h
src/mathed/math_hullinset.C
src/mathed/math_hullinset.h
src/mathed/math_nestinset.C
src/mathed/math_nestinset.h
src/mathed/math_scriptinset.C
src/mathed/math_scriptinset.h
src/mathed/ref_inset.C
src/mathed/ref_inset.h
src/text.C
src/text2.C
src/text3.C

index bb20bee8ec32d28d07a038e04762f2cdaf3bcf41..ad600d96d1fa12d2e1cd60bbf3519ea2e6856110 100644 (file)
@@ -25,6 +25,7 @@
 #include "bufferparams.h"
 #include "cursor.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "factory.h"
 #include "FloatList.h"
 #include "funcrequest.h"
index 9a35a386fd11d0dfc970bf5df3eb916fee3dd00e..9b685fa25aa9bc048037b70f597f1ae8eabd4e20 100644 (file)
@@ -1,3 +1,18 @@
+2003-10-29  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * text3.C: 
+       * text2.C: 
+       * text.C: 
+       * lyxtext.h: 
+       * lyxfunc.C: 
+       * cursor.C: 
+       * BufferView_pimpl.C: dispatch_result -> DispatchResult changes.
+
+       * dispatchresult.h: new file, DispatchResult broken out of
+       insets/insetbase.h 
+
+       * Makefile.am (lyx_SOURCES): add dispatchresult.h 
+
 2003-10-28  Alfredo Braunstein  <abraunst@libero.it>
 
        * text.C (rowBreakPoint): put a hack inside #if 0
 
 2003-10-27  Alfredo Braunstein  <abraunst@libero.it>
 
-       * text.C: 
-       * lyxrow_funcs.[Ch]: 
-       * Bidi.C: 
-       * paragraph.C: 
-       * lyxtext.h: 
-       * rowpainter.C: 
-       * text2.C: 
+       * text.C:
+       * lyxrow_funcs.[Ch]:
+       * Bidi.C:
+       * paragraph.C:
+       * lyxtext.h:
+       * rowpainter.C:
+       * text2.C:
        * text3.C: remove lastPos uses in favour of Row::endpos
 
 2003-10-27  Alfredo Braunstein  <abraunst@libero.it>
@@ -67,9 +82,9 @@
 
 2003-10-25  Alfredo Braunstein  <abraunst@libero.it>
 
-       * text.C (prepareToPrint): fix linebreak rowbreaking as suggested 
+       * text.C (prepareToPrint): fix linebreak rowbreaking as suggested
        by Martin
-       (rowBreakPoint): fix width. change point to point + 1. 
+       (rowBreakPoint): fix width. change point to point + 1.
        Add a missing check.
 
 2003-10-25  Martin Vermeer  <martin.vermeer@hut.fi>
        * text3.C (cursorPrevious, cursorNext): fix 2 "dontlikes"
 
 2003-10-23  André Pönitz  <poenitz@gmx.net>
-       
+
        * RowList_fwd.h: change list<> to vector<> to gain speed
        after suggestion from Alfredo
 
index 9bc3752b2be14e6759b5ca3ce1a809ed11fea1a3..bae5416a49e71781651d3097045c9c60c5290bb6 100644 (file)
@@ -143,6 +143,7 @@ lyx_SOURCES = \
        debug.h \
        dimension.C \
        dimension.h \
+       dispatchresult.h \
        encoding.C \
        encoding.h \
        errorlist.C \
index fb07ee137d4007d4700556de7176dcd3f318f3ca..58313c2025bd3d19c6ebb14f52ddb6235f18b258 100644 (file)
@@ -14,6 +14,7 @@
 #include "BufferView.h"
 #include "cursor.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "iterators.h"
 #include "lyxtext.h"
 #include "paragraph.h"
diff --git a/src/dispatchresult.h b/src/dispatchresult.h
new file mode 100644 (file)
index 0000000..be994a9
--- /dev/null
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+/**
+ * \file dispatchresult.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author none
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef DISPATCH_RESULT_H
+#define DISPATCH_RESULT_H
+
+/** Dispatch result codes
+       DISPATCHED          = the inset catched the action
+       DISPATCHED_NOUPDATE = the inset catched the action and no update
+                       is needed here to redraw the inset
+       FINISHED            = the inset must be unlocked as a result
+                       of the action
+       FINISHED_RIGHT      = FINISHED, but put the cursor to the RIGHT of
+                       the inset.
+       FINISHED_UP         = FINISHED, but put the cursor UP of
+                       the inset.
+       FINISHED_DOWN       = FINISHED, but put the cursor DOWN of
+                       the inset.
+       UNDISPATCHED        = the action was not catched, it should be
+                       dispatched by lower level insets
+*/
+enum dispatch_result_t {
+       UNDISPATCHED = 0,
+       DISPATCHED,
+       DISPATCHED_NOUPDATE,
+       FINISHED,
+       FINISHED_RIGHT,
+       FINISHED_UP,
+       FINISHED_DOWN,
+       DISPATCHED_POP
+};
+
+/** \c DispatchResult is a wrapper for dispatch_result_t.
+ *  It can be forward-declared and passed as a function argument without
+ *  having to expose insetbase.h.
+ */
+class DispatchResult {
+       dispatch_result_t val_;
+public:
+       DispatchResult()
+               : val_(UNDISPATCHED) {}
+       DispatchResult(dispatch_result_t val) : val_(val) {}
+       operator dispatch_result_t() const{ return val_; }
+};
+
+#endif // DISPATCH_RESULT_H
index 80b93a2825de2a9dcd3c8b10652fd018526d1883..f5f207748d431e373b6ac490cb2980b7da962eba 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-29  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * most insets: dispatch_result -> DispatchResult
+
+       * insetbase.h: move DispatchResult out to dispatchresult.h
 
 2003-10-27  André Pönitz  <poenitz@gmx.net>
 
@@ -68,7 +73,7 @@
 
        * inset.h:
        * insetfloat.h:
-       * insetfootlike.h: re-introduce display() for insets, 
+       * insetfootlike.h: re-introduce display() for insets,
        fixing the various bugs (stretch of line above, math inset
        positioning, ...)
 
index 4c8a6022be1dcda608c70f8a8e0ac650a9277d16..dc2098f47cf7609887e156ae58814e5f46d55d9e 100644 (file)
 #include <config.h>
 
 #include "insetbase.h"
+#include "dispatchresult.h"
 
 
-dispatch_result
+DispatchResult
 InsetBase::dispatch(FuncRequest const & f, idx_type & i, pos_type & p)
 {
        return priv_dispatch(f, i, p);
 }
 
 
-dispatch_result
+DispatchResult
 InsetBase::dispatch(FuncRequest const & f)
 {
        idx_type i = 0;
@@ -29,7 +30,7 @@ InsetBase::dispatch(FuncRequest const & f)
 }
 
 
-dispatch_result
+DispatchResult
 InsetBase::priv_dispatch(FuncRequest const &, idx_type &, pos_type &)
 {
        return UNDISPATCHED;
index 587d1bdd177285d83c7884b3bb0840c95562eeb0..179b43db3ed1d8293ee72f0cc9186ec20d1d134b 100644 (file)
@@ -23,45 +23,7 @@ class MetricsInfo;
 class Dimension;
 class PainterInfo;
 class LaTeXFeatures;
-
-/** Dispatch result codes
-               DISPATCHED          = the inset catched the action
-               DISPATCHED_NOUPDATE = the inset catched the action and no update
-                               is needed here to redraw the inset
-               FINISHED            = the inset must be unlocked as a result
-                               of the action
-               FINISHED_RIGHT      = FINISHED, but put the cursor to the RIGHT of
-                               the inset.
-               FINISHED_UP         = FINISHED, but put the cursor UP of
-                               the inset.
-               FINISHED_DOWN       = FINISHED, but put the cursor DOWN of
-                               the inset.
-               UNDISPATCHED        = the action was not catched, it should be
-                               dispatched by lower level insets
-*/
-enum dispatch_result {
-       UNDISPATCHED = 0,
-       DISPATCHED,
-       DISPATCHED_NOUPDATE,
-       FINISHED,
-       FINISHED_RIGHT,
-       FINISHED_UP,
-       FINISHED_DOWN,
-       DISPATCHED_POP
-};
-
-/** \c DispatchResult is a wrapper for dispatch_result.
- *  It can be forward-declared and passed as a function argument without
- *  having to expose insetbase.h.
- */
-class DispatchResult {
-       dispatch_result val_;
-public:
-       DispatchResult(dispatch_result val) : val_(val) {}
-       operator dispatch_result() const{ return val_; }
-};
-
-
+class DispatchResult;
 
 /// Common base class to all insets
 class InsetBase {
@@ -85,10 +47,10 @@ public:
        virtual std::auto_ptr<InsetBase> clone() const = 0;
 
        // the real dispatcher
-       dispatch_result
+       DispatchResult
        dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
        // the real dispatcher
-       dispatch_result
+       DispatchResult
        dispatch(FuncRequest const & cmd);
 
        /// compute the size of the object returned in dim
@@ -103,8 +65,9 @@ public:
                                  std::vector<std::string> & /* list */) const {}
 protected:
        // the real dispatcher
-       virtual dispatch_result priv_dispatch
-               (FuncRequest const & cmd, idx_type & idx, pos_type & pos);
+       virtual
+       DispatchResult
+       priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
 };
 
 #endif
index 1eb749e3a81e47152bff2d47a3a8976abb6f86c5..807b722fc002404f8f33e8b6197265935702f64a 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "buffer.h"
 #include "BufferView.h"
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "lyxfont.h"
 #include "lyxlex.h"
@@ -58,7 +59,7 @@ auto_ptr<InsetBase> InsetBibitem::clone() const
 }
 
 
-dispatch_result
+DispatchResult
 InsetBibitem::priv_dispatch(FuncRequest const & cmd,
                            idx_type & idx, pos_type & pos)
 {
index ae3c6649a315ace94a2f2b33fe8906453bc26d38..c71e9e26cc82e8253ffd1dd94d6793ceba4823ec 100644 (file)
@@ -53,7 +53,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
 private:
        ///
index 4a7c04349015be7ea249d37c8bcbe9edfe4953ff..2b20f510699a6aa37e284105631124ff2b074d29 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "buffer.h"
 #include "bufferparams.h"
+#include "dispatchresult.h"
 #include "debug.h"
 #include "funcrequest.h"
 #include "gettext.h"
@@ -87,7 +88,7 @@ void InsetBibtex::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-dispatch_result
+DispatchResult
 InsetBibtex::priv_dispatch(FuncRequest const & cmd,
                           idx_type & idx, pos_type & pos)
 {
index fa0d63ceaa26c60503ee12e5e18b282460e659f3..2554b48fef3b17c8f025675229e5a8a9f704c3e0 100644 (file)
@@ -53,7 +53,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
 };
 
index 9f867c502fada1762e10eeffd6f5846e78ee9112..d8346b8c603a60834ac112d52602fc53e9c6e979 100644 (file)
 #include <config.h>
 
 #include "insetbox.h"
-#include "debug.h"
 
 #include "BufferView.h"
+#include "dispatchresult.h"
+#include "debug.h"
 #include "funcrequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
@@ -164,7 +165,7 @@ bool InsetBox::showInsetDialog(BufferView * bv) const
 }
 
 
-dispatch_result
+DispatchResult
 InsetBox::priv_dispatch(FuncRequest const & cmd,
                        idx_type & idx, pos_type & pos)
 {
index 4fcb7b513b7e7de5b295703cbe96c5bcc7159f48..c83606e575894686ba25c0e8903db944f559f929 100644 (file)
@@ -102,7 +102,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
 private:
        friend class InsetBoxParams;
index 7b92208753801b809a1739e507ae91d9728c200e..283b6d69d60ff6abf4adcf1f64bf92f167be4c1e 100644 (file)
@@ -15,6 +15,7 @@
 #include "buffer.h"
 #include "bufferparams.h"
 #include "BufferView.h"
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "gettext.h"
 #include "LColor.h"
@@ -116,7 +117,7 @@ bool InsetBranch::showInsetDialog(BufferView * bv) const
 }
 
 
-dispatch_result
+DispatchResult
 InsetBranch::priv_dispatch(FuncRequest const & cmd,
                           idx_type & idx, pos_type & pos)
 {
index d05e2e6a91b972b5441f53c6c077f0d5b11e3a4d..15945de5defbda8d9b1136d4672baa07aac055d0 100644 (file)
@@ -73,7 +73,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
 private:
        friend class InsetBranchParams;
index 596f29ee3116727c35bf4868c934ea1fe2a72581..05f06ee5ce7d9386716ae0d3862010e830d78d27 100644 (file)
@@ -16,6 +16,7 @@
 #include "buffer.h"
 #include "bufferparams.h"
 #include "BufferView.h"
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "LaTeXFeatures.h"
 
@@ -308,7 +309,7 @@ string const InsetCitation::getScreenLabel(Buffer const & buffer) const
 }
 
 
-dispatch_result
+DispatchResult
 InsetCitation::priv_dispatch(FuncRequest const & cmd,
                             idx_type & idx, pos_type & pos)
 {
index 925b223db2404cea5bc14aecb293f959872f94c7..a4cda12ec84f2dcdf6950401df19c302b3fc48fe 100644 (file)
@@ -40,13 +40,13 @@ public:
        int latex(Buffer const &, std::ostream &,
                  LatexRunParams const &) const;
        ///
-       dispatch_result localDispatch(FuncRequest const & cmd);
+       DispatchResult localDispatch(FuncRequest const & cmd);
        ///
        void validate(LaTeXFeatures &) const;
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
 private:
        struct Cache {
index febaa9ceedae3ee42e14fb3ba74fd705674cfd58..277b447aaac1469bfd3983646fb9bfb1d4dbaec6 100644 (file)
@@ -17,6 +17,7 @@
 #include "buffer.h"
 #include "BufferView.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "LColor.h"
 #include "lyxlex.h"
 #include "funcrequest.h"
@@ -281,7 +282,7 @@ void InsetCollapsable::edit(BufferView * bv, int index)
 }
 
 
-dispatch_result
+DispatchResult
 InsetCollapsable::priv_dispatch(FuncRequest const & cmd,
                                idx_type & idx, pos_type & pos)
 {
@@ -355,7 +356,7 @@ InsetCollapsable::priv_dispatch(FuncRequest const & cmd,
                        return DISPATCHED;
 
                default:
-                       dispatch_result result = inset.dispatch(cmd);
+                       DispatchResult result = inset.dispatch(cmd);
                        if (result >= FINISHED)
                                bv->unlockInset(this);
                        first_after_edit = false;
index 7fef35072010e23e616b744caf482182dda1265f..a8e365ffbd88edb0f01b4f9c90313d3dcdec2c19 100644 (file)
@@ -151,7 +151,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
        ///
        void dimension_collapsed(Dimension &) const;
index caa1c11ad2db87f24c737a8a65104190a1277ce9..c0257e0bcd8050b14ca760d31001ee7adf648e31 100644 (file)
@@ -14,6 +14,7 @@
 #include "insetcommand.h"
 
 #include "BufferView.h"
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "lyxlex.h"
 #include "metricsinfo.h"
@@ -84,7 +85,7 @@ int InsetCommand::docbook(Buffer const &, ostream &, bool) const
 }
 
 
-dispatch_result
+DispatchResult
 InsetCommand::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
 {
        switch (cmd.action) {
index 8003f3119e4b4e57934b6bba3e889bc06feb3813..0e4b29e4e46d23bbd235cb2f9b28924a9baabda9 100644 (file)
@@ -55,7 +55,7 @@ public:
        virtual int docbook(Buffer const &, std::ostream &, bool) const;
        ///
        InsetOld::Code lyxCode() const { return InsetOld::NO_CODE; }
-       
+
        ///
        InsetCommandParams const & params() const { return p_; }
        ///
@@ -70,7 +70,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
        ///
        std::string const getCommand() const { return p_.getCommand(); }
index 23722cf930caf41b7b5e2a70220972c67a457828..326f75c52e3fd5cf36a2a8c6c172f5cef5db38e2 100644 (file)
@@ -16,6 +16,7 @@
 #include "bufferparams.h"
 #include "BufferView.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "gettext.h"
 #include "language.h"
@@ -421,11 +422,11 @@ int InsetERT::docbook(Buffer const &, ostream & os, bool) const
 }
 
 
-dispatch_result
+DispatchResult
 InsetERT::priv_dispatch(FuncRequest const & cmd,
                        idx_type & idx, pos_type & pos)
 {
-       dispatch_result result = UNDISPATCHED;
+       DispatchResult result = UNDISPATCHED;
        BufferView * bv = cmd.view();
 
        if (inset.paragraphs.begin()->empty()) {
index c886156c69bcce15ca08d827aedbd974642c7375..86c9694e5fe57380bae394f5f67cdef36a5aa3a0 100644 (file)
@@ -111,7 +111,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
 private:
        ///
index c07713af02fd7a8c4d833e99e90d804ae28b6129..cb8360d19ccf5bd824f5ff0a8d9e1514f4307e95 100644 (file)
@@ -20,6 +20,7 @@
 #include "buffer.h"
 #include "BufferView.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
@@ -120,7 +121,7 @@ Translator<DisplayType, string> const initTranslator()
 } // namespace anon
 
 
-Translator<DisplayType, string> const & displayTranslator() 
+Translator<DisplayType, string> const & displayTranslator()
 {
        static Translator<DisplayType, string> const translator =
                initTranslator();
@@ -426,7 +427,7 @@ void InsetExternal::statusChanged() const
 }
 
 
-dispatch_result
+DispatchResult
 InsetExternal::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
 {
        switch (cmd.action) {
index 6dbbddf1ade91f171b4bd7233714651559c91783..cf5300ee782923432bc102ea97ba47cf5f7fe096 100644 (file)
@@ -142,7 +142,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
 private:
        /** This method is connected to the graphics loader, so we are
index 8f93e35d9a7391b963ba387a0b8d535a3542411d..6dab6802fb1be095699044933c8a77cd142c20d8 100644 (file)
@@ -17,6 +17,7 @@
 #include "bufferparams.h"
 #include "BufferView.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "Floating.h"
 #include "FloatList.h"
 #include "funcrequest.h"
@@ -159,7 +160,7 @@ InsetFloat::~InsetFloat()
 }
 
 
-dispatch_result
+DispatchResult
 InsetFloat::priv_dispatch(FuncRequest const & cmd,
                          idx_type & idx, pos_type & pos)
 {
index 5416845ac27d83000f1aa3c9334471d6ea473a3f..8691c61af5a91ddbbf57aa69dbd2373f8bfbbde0 100644 (file)
@@ -79,7 +79,7 @@ public:
        InsetFloatParams const & params() const { return params_; }
 protected:
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
 private:
        ///
index 3926935e897654a293a921e393641bea5eb64c43..cc373a97c7671950c7f42bd8111c66e5b8c6c18d 100644 (file)
@@ -15,6 +15,7 @@
 #include "buffer.h"
 #include "bufferparams.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "Floating.h"
 #include "FloatList.h"
 #include "funcrequest.h"
@@ -118,7 +119,7 @@ void InsetFloatList::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-dispatch_result
+DispatchResult
 InsetFloatList::priv_dispatch(FuncRequest const & cmd,
                              idx_type & idx, pos_type & pos)
 {
index 6d77f159f185da5b1df48ccd7917c0cf5dc32fb7..387ae14d9f18e27fa69ed284c669c1ea3c5c4b9b 100644 (file)
@@ -59,7 +59,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
 };
 
index 754f6a6116edc743a726c6b4bcf6b0d6fbd4a846..24369697fa0d66c981394a18455cf5d5eacd0b45 100644 (file)
@@ -59,6 +59,7 @@ TODO
 #include "BufferView.h"
 #include "converter.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "format.h"
 #include "funcrequest.h"
 #include "gettext.h"
@@ -190,7 +191,7 @@ void InsetGraphics::statusChanged() const
 }
 
 
-dispatch_result
+DispatchResult
 InsetGraphics::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
 {
        switch (cmd.action) {
index 79e37b2610d882f31322494b4ec7250fa98a2786..4284291c271f41dd5ca77d27aaa8c1ab4c76a5e4 100644 (file)
@@ -77,7 +77,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
 private:
        ///
index 80405c0e264360246ac72505dbe2d008343cc29d..93485d1c7fabada646c594625b78233297c55dbd 100644 (file)
@@ -18,6 +18,7 @@
 #include "bufferparams.h"
 #include "BufferView.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
@@ -107,7 +108,7 @@ InsetInclude::~InsetInclude()
 }
 
 
-dispatch_result
+DispatchResult
 InsetInclude::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
 {
        switch (cmd.action) {
index 5064e03c0233ec520d340aeae8358bf947149a55..675811c766f348b71aacf32600ce9209a89c3d93 100644 (file)
@@ -80,7 +80,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
 private:
        /// Slot receiving a signal that the preview is ready to display.
index fa99b04310c777c4b75d1350d33aa436a1939d3c..0997af17146d412c31065bd4e4173879d0bfdcd9 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "insetindex.h"
 
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
@@ -60,7 +61,7 @@ void InsetPrintIndex::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-dispatch_result
+DispatchResult
 InsetIndex::priv_dispatch(FuncRequest const & cmd,
                          idx_type & idx, pos_type & pos)
 {
index 5e5d607b81f0b468e824a2ff9d2c1cc571ce8114..d30319586a1bd6139a5b80d600904d2f3f5c9e1a 100644 (file)
@@ -40,7 +40,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
 };
 
index 3e9ca9ad8fd9406d1bc314147736ce27e0a15725..45c81e52b7e16fb9196f0a4d3a647951faa0221d 100644 (file)
@@ -13,6 +13,7 @@
 #include "insetlabel.h"
 
 #include "BufferView.h"
+#include "dispatchresult.h"
 #include "funcrequest.h"
 
 #include "frontends/LyXView.h"
@@ -56,7 +57,7 @@ string const InsetLabel::getScreenLabel(Buffer const &) const
 }
 
 
-dispatch_result
+DispatchResult
 InsetLabel::priv_dispatch(FuncRequest const & cmd,
                          idx_type & idx, pos_type & pos)
 {
index 76ce67df8475e27b8a2e8b0d71311863916387e4..fb7fc1f3a1d5878d28a08321306558eb17c3c990 100644 (file)
@@ -42,7 +42,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
 };
 
index 6f46127c858cb3c8f3567c8ceb5354ea60f56202..31ec370350f78bc43e0b17798b767bb9e655f756 100644 (file)
@@ -444,8 +444,8 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
                case ACUTE:
                        drawAccent(pi, x2, baseline, char(0xB4));
                        break;
-               
-               case GRAVE: 
+
+               case GRAVE:
                        drawAccent(pi, x2, baseline, char(0x60));
                        break;
 
@@ -477,7 +477,7 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
                        drawAccent(pi, x2, baseline, '.');
                        break;
 
-               case CIRCLE: 
+               case CIRCLE:
                        drawAccent(pi, x2, baseline, char(0xB0));
                        break;
 
index 7c19ef39c3f81e97366d7cf88f1d94ab6ce2b423..545d27274c1f8de69f8a3d61aeef1f76fd840dc7 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "BufferView.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "gettext.h"
 #include "LColor.h"
@@ -95,7 +96,7 @@ InsetMinipage::~InsetMinipage()
 }
 
 
-dispatch_result
+DispatchResult
 InsetMinipage::priv_dispatch(FuncRequest const & cmd,
                             idx_type & idx, pos_type & pos)
 {
index b6a355b12b1fceef2a7ac34337d627ec0dcf1819..cdfaaa1f88a27345c9ba758253ade549f0e643de 100644 (file)
@@ -91,7 +91,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
 private:
        ///
index 98b855b1daeb562eed842a1dbe4e74937a53f35c..8a37b8c726030b927ec775dccd84f3f5d2a1304d 100644 (file)
@@ -15,6 +15,7 @@
 #include "insetnote.h"
 
 #include "BufferView.h"
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
@@ -129,7 +130,7 @@ bool InsetNote::showInsetDialog(BufferView * bv) const
 }
 
 
-dispatch_result
+DispatchResult
 InsetNote::priv_dispatch(FuncRequest const & cmd,
                         idx_type & idx, pos_type & pos)
 {
index ec775739295b38667a94b5475b2e2f9c3f0fe177..9b21f8c8d7835d32a14fe789f0c6d567ce94ef2d 100644 (file)
@@ -71,7 +71,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
 private:
        friend class InsetNoteParams;
index 959f3e903ce9182c52bba1e7e9b114db7253e30c..024d79efb0b6f8659d3822f31f66eb6879e42e07 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "buffer.h"
 #include "BufferView.h"
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
@@ -45,8 +46,9 @@ InsetRef::~InsetRef()
 }
 
 
-dispatch_result
-InsetRef::priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
+DispatchResult
+InsetRef::priv_dispatch(FuncRequest const & cmd,
+                       idx_type & idx, pos_type & pos)
 {
        switch (cmd.action) {
        case LFUN_INSET_EDIT:
index 95a506939c23a89075ac4a91991db3ac0074ba8b..ff01a16c095ad32aabf554aeb3728872e90872ae 100644 (file)
@@ -67,7 +67,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
 private:
        ///
index 477bb3d4d921d3574073017eb0f475c78719e1cc..0a390dc5e2b7e9b03bc07e12546b77accafcafe4 100644 (file)
@@ -16,6 +16,7 @@
 #include "bufferparams.h"
 #include "BufferView.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "FuncStatus.h"
 #include "gettext.h"
@@ -660,14 +661,14 @@ void InsetTabular::edit(BufferView * bv, int index)
 }
 
 
-dispatch_result
+DispatchResult
 InsetTabular::priv_dispatch(FuncRequest const & cmd,
                            idx_type & idx, pos_type & pos)
 {
        // We need to save the value of the_locking_inset as the call to
        // the_locking_inset->localDispatch might unlock it.
        old_locking_inset = the_locking_inset;
-       dispatch_result result = UpdatableInset::priv_dispatch(cmd, idx, pos);
+       DispatchResult result = UpdatableInset::priv_dispatch(cmd, idx, pos);
        BufferView * bv = cmd.view();
 
        if (cmd.action == LFUN_INSET_EDIT) {
@@ -1394,7 +1395,7 @@ void InsetTabular::resetPos(BufferView * bv) const
 }
 
 
-dispatch_result InsetTabular::moveRight(BufferView * bv, bool lock)
+DispatchResult InsetTabular::moveRight(BufferView * bv, bool lock)
 {
        if (lock && !old_locking_inset) {
                if (activateCellInset(bv))
@@ -1412,7 +1413,7 @@ dispatch_result InsetTabular::moveRight(BufferView * bv, bool lock)
 }
 
 
-dispatch_result InsetTabular::moveLeft(BufferView * bv, bool lock)
+DispatchResult InsetTabular::moveLeft(BufferView * bv, bool lock)
 {
        bool moved = isRightToLeft(bv) ? moveNextCell(bv) : movePrevCell(bv);
        if (!moved)
@@ -1425,7 +1426,7 @@ dispatch_result InsetTabular::moveLeft(BufferView * bv, bool lock)
 }
 
 
-dispatch_result InsetTabular::moveUp(BufferView * bv, bool lock)
+DispatchResult InsetTabular::moveUp(BufferView * bv, bool lock)
 {
        int const ocell = actcell;
        actcell = tabular.getCellAbove(actcell);
@@ -1446,7 +1447,7 @@ dispatch_result InsetTabular::moveUp(BufferView * bv, bool lock)
 }
 
 
-dispatch_result InsetTabular::moveDown(BufferView * bv, bool lock)
+DispatchResult InsetTabular::moveDown(BufferView * bv, bool lock)
 {
        int const ocell = actcell;
        actcell = tabular.getCellBelow(actcell);
index 33c4a9d6b8ed714e0bd780d9cf44e90622bf4417..41eda0b58a2a61c43bd5e49200bc031556a7fe4b 100644 (file)
@@ -207,7 +207,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
 private:
        /// lock cell with given index
@@ -235,13 +235,13 @@ private:
        ///
        void setPos(BufferView *, int x, int y) const;
        ///
-       dispatch_result moveRight(BufferView *, bool lock = true);
+       DispatchResult moveRight(BufferView *, bool lock = true);
        ///
-       dispatch_result moveLeft(BufferView *, bool lock = true);
+       DispatchResult moveLeft(BufferView *, bool lock = true);
        ///
-       dispatch_result moveUp(BufferView *, bool lock = true);
+       DispatchResult moveUp(BufferView *, bool lock = true);
        ///
-       dispatch_result moveDown(BufferView *, bool lock = true);
+       DispatchResult moveDown(BufferView *, bool lock = true);
        ///
        bool moveNextCell(BufferView *, bool lock = false);
        ///
index 275114a6c32a05c55aab9aed719d229b1a6cf3cb..4551ed3d384e33258cd94236719e0082a1f012bb 100644 (file)
@@ -18,6 +18,7 @@
 #include "BufferView.h"
 #include "CutAndPaste.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "errorlist.h"
 #include "funcrequest.h"
 #include "gettext.h"
@@ -587,7 +588,7 @@ void InsetText::lfunMouseMotion(FuncRequest const & cmd)
 }
 
 
-dispatch_result
+DispatchResult
 InsetText::priv_dispatch(FuncRequest const & cmd,
                         idx_type & idx, pos_type & pos)
 {
@@ -669,7 +670,7 @@ InsetText::priv_dispatch(FuncRequest const & cmd,
        bool was_empty = paragraphs.begin()->empty() && paragraphs.size() == 1;
        no_selection = false;
 
-       dispatch_result result = UpdatableInset::priv_dispatch(cmd, idx, pos);
+       DispatchResult result = UpdatableInset::priv_dispatch(cmd, idx, pos);
        if (result != UNDISPATCHED)
                return DISPATCHED;
 
@@ -1178,7 +1179,7 @@ void InsetText::fitInsetCursor(BufferView * bv) const
 }
 
 
-dispatch_result InsetText::moveRight(BufferView * bv)
+DispatchResult InsetText::moveRight(BufferView * bv)
 {
        if (text_.cursorPar()->isRightToLeftPar(bv->buffer()->params()))
                return moveLeftIntern(bv, false, true, false);
@@ -1187,7 +1188,7 @@ dispatch_result InsetText::moveRight(BufferView * bv)
 }
 
 
-dispatch_result InsetText::moveLeft(BufferView * bv)
+DispatchResult InsetText::moveLeft(BufferView * bv)
 {
        if (text_.cursorPar()->isRightToLeftPar(bv->buffer()->params()))
                return moveRightIntern(bv, true, true, false);
@@ -1196,7 +1197,7 @@ dispatch_result InsetText::moveLeft(BufferView * bv)
 }
 
 
-dispatch_result
+DispatchResult
 InsetText::moveRightIntern(BufferView * bv, bool front,
                           bool activate_inset, bool selecting)
 {
@@ -1213,7 +1214,7 @@ InsetText::moveRightIntern(BufferView * bv, bool front,
 }
 
 
-dispatch_result
+DispatchResult
 InsetText::moveLeftIntern(BufferView * bv, bool front,
                          bool activate_inset, bool selecting)
 {
@@ -1228,7 +1229,7 @@ InsetText::moveLeftIntern(BufferView * bv, bool front,
 }
 
 
-dispatch_result InsetText::moveUp(BufferView * bv)
+DispatchResult InsetText::moveUp(BufferView * bv)
 {
        if (crow() == text_.firstRow())
                return FINISHED_UP;
@@ -1238,7 +1239,7 @@ dispatch_result InsetText::moveUp(BufferView * bv)
 }
 
 
-dispatch_result InsetText::moveDown(BufferView * bv)
+DispatchResult InsetText::moveDown(BufferView * bv)
 {
        if (crow() == text_.lastRow())
                return FINISHED_DOWN;
index 578ccdacd565f8cd0f1bbae60c3f74a2ddf8e422..2ac839309dfb6e048b071c7f8b32b3ff7e2fa1aa 100644 (file)
@@ -202,7 +202,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
        ///
        void updateLocal(BufferView *, bool mark_dirty);
@@ -222,22 +222,22 @@ private:
        void lfunMouseMotion(FuncRequest const &);
 
        ///
-       dispatch_result moveRight(BufferView *);
+       DispatchResult moveRight(BufferView *);
        ///
-       dispatch_result moveLeft(BufferView *);
+       DispatchResult moveLeft(BufferView *);
        ///
-       dispatch_result moveRightIntern(BufferView *, bool front,
+       DispatchResult moveRightIntern(BufferView *, bool front,
                                               bool activate_inset = true,
                                               bool selecting = false);
        ///
-       dispatch_result moveLeftIntern(BufferView *, bool front,
+       DispatchResult moveLeftIntern(BufferView *, bool front,
                                              bool activate_inset = true,
                                              bool selecting = false);
 
        ///
-       dispatch_result moveUp(BufferView *);
+       DispatchResult moveUp(BufferView *);
        ///
-        dispatch_result moveDown(BufferView *);
+        DispatchResult moveDown(BufferView *);
        ///
        void setCharFont(Buffer const &, int pos, LyXFont const & font);
        ///
index d9466b1fa12fc82b8689e0cbde8daece0903fb19..99948c74191a92c30a97d787256175b0b7c61301 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "insettoc.h"
 
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "gettext.h"
 #include "metricsinfo.h"
@@ -73,8 +74,9 @@ void InsetTOC::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-dispatch_result
-InsetTOC::priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
+DispatchResult
+InsetTOC::priv_dispatch(FuncRequest const & cmd,
+                       idx_type & idx, pos_type & pos)
 {
        switch (cmd.action) {
        case LFUN_MOUSE_RELEASE:
index 0bad336d45516a46dca4bf271d4d328f94dd6a7f..d7159e269ddc0207f46451eef0a718fee5313140 100644 (file)
@@ -49,7 +49,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
 };
 
index 13a25dd3fa7d8a095cdee4b30a71e6bf0022ae4d..fa918fa99d3f7109c7c6f1a9ef63c7e06c5f1a6b 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "inseturl.h"
 
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "latexrunparams.h"
 #include "LaTeXFeatures.h"
@@ -43,7 +44,7 @@ InsetUrl::~InsetUrl()
 }
 
 
-dispatch_result
+DispatchResult
 InsetUrl::priv_dispatch(FuncRequest const & cmd,
                        idx_type & idx, pos_type & pos)
 {
index 716f7c4b21391a41daf9f8766e21cbbf39020118..408f8b35f18dd3f966d011ad81e6fab6507cbecc 100644 (file)
@@ -52,7 +52,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
 };
 
index b070bd80bb2fa36e4f71a534ea691a52d3ccd3b5..bc457c459cd6c8af4861c86b2e8f6c03bb38a352 100644 (file)
@@ -16,6 +16,7 @@
 #include "bufferparams.h"
 #include "BufferView.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "Floating.h"
 #include "FloatList.h"
 #include "funcrequest.h"
@@ -83,7 +84,7 @@ InsetWrap::~InsetWrap()
 }
 
 
-dispatch_result
+DispatchResult
 InsetWrap::priv_dispatch(FuncRequest const & cmd,
                         idx_type & idx, pos_type & pos)
 {
index 94adbb1c20ac9dad7aa7e12f4b5c949adfa4df0f..633c4b97cc3bf773c20dcdd9b9108ba1e8aaece9 100644 (file)
@@ -71,7 +71,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
 private:
        ///
index 9ff4c08e0c153c53f799186e01f7271861b8383f..937dc5b10728d061500e36d4278dda5946c09236 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "BufferView.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "lyxtext.h"
 #include "WordLangTuple.h"
@@ -108,7 +109,7 @@ void UpdatableInset::scroll(BufferView * bv, int offset) const
 
 
 ///  An updatable inset could handle lyx editing commands
-dispatch_result
+DispatchResult
 UpdatableInset::priv_dispatch(FuncRequest const & ev, idx_type &, pos_type &)
 {
        if (ev.action == LFUN_MOUSE_RELEASE)
index 608f7a24d47fcf785430c687bb812b09c2408ecc..d791ecfdaa45a3b3b32c4d07cc2e71b827be96a8 100644 (file)
@@ -113,7 +113,7 @@ public:
 protected:
        ///  An updatable inset could handle lyx editing commands
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
        /// scrolls to absolute position in bufferview-workwidth * sx units
        void scroll(BufferView *, float sx) const;
index 25350974e1e3a187d0c9b907e99ace5242dcfc71..d6de7ed83b64546949fbb3178802bf38284c247b 100644 (file)
@@ -29,6 +29,7 @@
 #include "BufferView.h"
 #include "cursor.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "encoding.h"
 #include "exporter.h"
 #include "format.h"
@@ -894,7 +895,7 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose)
 
 
        if (view()->available() && view()->theLockingInset()) {
-               dispatch_result result;
+               DispatchResult result;
                if (action > 1 || (action == LFUN_UNKNOWN_ACTION &&
                                     !keyseq.deleted()))
                {
@@ -1485,12 +1486,12 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose)
                break;
        }
 
-       case LFUN_DIALOG_SHOW_NEXT_INSET: 
+       case LFUN_DIALOG_SHOW_NEXT_INSET:
                break;
 
        case LFUN_INSET_DIALOG_SHOW: {
                InsetOld * inset = view()->getLyXText()->getInset();
-               if (inset) 
+               if (inset)
                        inset->dispatch(FuncRequest(view(), LFUN_INSET_DIALOG_SHOW));
                break;
        }
@@ -1556,7 +1557,7 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose)
                argument = split(argument, countstr, ' ');
                istringstream is(countstr);
                int count = 0;
-               is >> count;    
+               is >> count;
                lyxerr << "repeat: count: " << count << " cmd: " << argument << endl;
                for (int i = 0; i < count; ++i)
                        dispatch(lyxaction.lookupFunc(argument));
@@ -1631,7 +1632,7 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose)
                if (isStrInt(argument)) {
                        pid_t const pid = strToInt(argument);
                        ForkedcallsController & fcc = ForkedcallsController::get();
-                       fcc.kill(pid);  
+                       fcc.kill(pid);
                }
                break;
 
index 3250ee013304d914ba0391dacc5d4b6fb552fc6d..5ed7f5f72a73871df836057a89f0c0d7ac66f9e1 100644 (file)
@@ -150,7 +150,7 @@ public:
        void metrics(MetricsInfo & mi, Dimension & dim);
 
        ///
-       dispatch_result dispatch(FuncRequest const & cmd);
+       DispatchResult dispatch(FuncRequest const & cmd);
 
        BufferView * bv();
 
@@ -409,7 +409,7 @@ private:
 
        /// FIXME
        int labelEnd(ParagraphList::iterator pit, Row const & row) const;
-       
+
        ///
        void charInserted();
 
index 5115db8168e84159c57f1bdb1dc0bd362a0389e6..3d138510002b1b2e1ae93d2badb00c55d31f9cc1 100644 (file)
@@ -1,3 +1,19 @@
+2003-10-29  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * math_scriptinset.h: change dispatch to priv_dispatch and make it
+       protected
+
+       * math_nestinset.h: make priv_dispatch protected
+
+       * math_hullinset.h: make priv_dispatch protected
+
+       * math_gridinset.h: make priv_dispatch protected
+
+       * command_inset.[Ch]: change dispatch to priv_dispatch and make it
+       protected.
+
+       * several files: dispatch_result -> DispatchResult
+
 2003-10-22  Angus Leeming  <leeming@lyx.org>
 
        * formula.C (generatePreview): changes due to the changed
@@ -15,7 +31,7 @@
        into this
        (localDispatch): delete
 
-       * math_nestinset.C (dispatch): 
+       * math_nestinset.C (dispatch):
        * math_hullinset.C (dispatch):
        * math_gridinset.C (dispatch):
        * formulabase.C (openNewInset, priv_dispatch, mathDispatch):
index 811f2d17c17d2d89d110c6a5e53f094011def766..128ad213052408081d5007b38810aee0f183d86a 100644 (file)
@@ -13,6 +13,7 @@
 #include "command_inset.h"
 #include "math_data.h"
 #include "math_mathmlstream.h"
+#include "dispatchresult.h"
 #include "funcrequest.h"
 #include "support/std_sstream.h"
 
@@ -52,8 +53,10 @@ void CommandInset::draw(PainterInfo & pi, int x, int y) const
        button_.draw(pi, x, y);
 }
 
-dispatch_result
-CommandInset::dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
+
+DispatchResult
+CommandInset::priv_dispatch(FuncRequest const & cmd,
+                           idx_type & idx, pos_type & pos)
 {
        switch (cmd.action) {
                default:
index 553adc165d4b42c4ac3f545b679e8ba34e7e9fc6..c9739b48e26cce88e39f2d9a488cce2712afcf57 100644 (file)
@@ -33,14 +33,16 @@ public:
        //
        // void infoize(std::ostream & os) const;
        ///
-       dispatch_result dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
-       ///
        virtual std::string const screenLabel() const;
        /// generate something that will be understood by the Dialogs.
        std::string const createDialogStr(std::string const & name) const;
 
        std::string const & commandname() const { return name_; }
-
+protected:
+       ///
+       virtual
+       DispatchResult
+       priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
 private:
        std::string name_;
        mutable bool set_label_;
index 495f412781706d9445a6da21d1d9f93b822a21db..40c4d1111e5c1dfcd7ec51c4ff5dffb778f7a40b 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "BufferView.h"
 #include "bufferview_funcs.h"
+#include "dispatchresult.h"
 #include "debug.h"
 #include "funcrequest.h"
 #include "gettext.h"
@@ -211,7 +212,7 @@ void InsetFormulaBase::toggleInsetSelection(BufferView * bv)
 }
 
 
-dispatch_result InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
+DispatchResult InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
 {
        if (!mathcursor)
                return UNDISPATCHED;
@@ -256,7 +257,7 @@ dispatch_result InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
 }
 
 
-dispatch_result InsetFormulaBase::lfunMousePress(FuncRequest const & cmd)
+DispatchResult InsetFormulaBase::lfunMousePress(FuncRequest const & cmd)
 {
        BufferView * bv = cmd.view();
        //lyxerr << "lfunMousePress: buttons: " << cmd.button() << endl;
@@ -288,7 +289,7 @@ dispatch_result InsetFormulaBase::lfunMousePress(FuncRequest const & cmd)
 }
 
 
-dispatch_result InsetFormulaBase::lfunMouseMotion(FuncRequest const & cmd)
+DispatchResult InsetFormulaBase::lfunMouseMotion(FuncRequest const & cmd)
 {
        if (!mathcursor)
                return DISPATCHED;
@@ -316,7 +317,7 @@ dispatch_result InsetFormulaBase::lfunMouseMotion(FuncRequest const & cmd)
 }
 
 
-dispatch_result
+DispatchResult
 InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
                                idx_type &, pos_type &)
 {
@@ -370,7 +371,7 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
                return UNDISPATCHED;
 
        string argument    = cmd.argument;
-       dispatch_result result      = DISPATCHED;
+       DispatchResult result      = DISPATCHED;
        bool sel           = false;
        bool was_macro     = mathcursor->inMacroMode();
        bool was_selection = mathcursor->selection();
@@ -494,7 +495,7 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
 
        //    case LFUN_GETXY:
        //      sprintf(dispatch_buffer, "%d %d",);
-       //      dispatch_result = dispatch_buffer;
+       //      DispatchResult= dispatch_buffer;
        //      break;
        case LFUN_SETXY: {
                lyxerr << "LFUN_SETXY broken!" << endl;
index 885ba98da17a92b72942f0f3564c82a013de4d6f..56075c6b9c5c8aab2d303a051e04734a9e9b3b2c 100644 (file)
@@ -84,7 +84,7 @@ public:
 protected:
        /// To allow transparent use of math editing functions
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
 private:
        /// unimplemented
@@ -92,11 +92,11 @@ private:
        /// common base for handling accents
        void handleAccent(BufferView * bv, std::string const & arg, std::string const & name);
        /// lfun handler
-       dispatch_result lfunMousePress(FuncRequest const &);
+       DispatchResult lfunMousePress(FuncRequest const &);
        ///
-       dispatch_result lfunMouseRelease(FuncRequest const &);
+       DispatchResult lfunMouseRelease(FuncRequest const &);
        ///
-       dispatch_result lfunMouseMotion(FuncRequest const &);
+       DispatchResult lfunMouseMotion(FuncRequest const &);
 
 protected:
 
index 2194fc4e36481707d9aae6f4442a62761db7b6b1..1e4f7a7f0eac3888a4c60f57d5147eff88d41ad1 100644 (file)
 
 #include <config.h>
 
+#include "math_cursor.h"
 #include "lyxrc.h"
 #include "support/limited_stack.h"
+#include "dispatchresult.h"
 #include "debug.h"
 #include "support/std_sstream.h"
-#include "math_cursor.h"
 #include "formulabase.h"
 #include "funcrequest.h"
 #include "math_braceinset.h"
@@ -1406,7 +1407,7 @@ CursorPos MathCursor::normalAnchor() const
 }
 
 
-dispatch_result MathCursor::dispatch(FuncRequest const & cmd)
+DispatchResult MathCursor::dispatch(FuncRequest const & cmd)
 {
        // mouse clicks are somewhat special
        // check
@@ -1416,7 +1417,7 @@ dispatch_result MathCursor::dispatch(FuncRequest const & cmd)
                case LFUN_MOUSE_RELEASE:
                case LFUN_MOUSE_DOUBLE: {
                        CursorPos & pos = Cursor_.back();
-                       dispatch_result res = UNDISPATCHED;
+                       DispatchResult res = UNDISPATCHED;
                        int x = 0, y = 0;
                        getPos(x, y);
                        if (x < cmd.x && hasPrevAtom()) {
@@ -1436,7 +1437,7 @@ dispatch_result MathCursor::dispatch(FuncRequest const & cmd)
 
        for (int i = Cursor_.size() - 1; i >= 0; --i) {
                CursorPos & pos = Cursor_[i];
-               dispatch_result res = pos.inset_->dispatch(cmd, pos.idx_, pos.pos_);
+               DispatchResult res = pos.inset_->dispatch(cmd, pos.idx_, pos.pos_);
                if (res != UNDISPATCHED) {
                        if (res == DISPATCHED_POP) {
                                Cursor_.shrink(i + 1);
index b43e1268c605fa852131318e58b752daa6c5769d..c6a15a1ef43f4fbfbc0def49d3e0688b2a49d2f5 100644 (file)
@@ -217,9 +217,6 @@ public:
        CursorPos const & cursor() const;
        /// how deep are we nested?
        unsigned depth() const;
-
-       /// local dispatcher
-       dispatch_result dispatch(FuncRequest const & cmd);
        /// describe the situation
        std::string info() const;
        /// dump selection information for debugging
@@ -246,7 +243,9 @@ public:
        void pullArg();
        /// split font inset etc
        void handleFont(std::string const & font);
-
+       ///
+       DispatchResult
+       dispatch(FuncRequest const & cmd);
 private:
        /// moves cursor index one cell to the left
        bool idxLeft();
index 89135398fa1a367c6327180c0534e5c896686695..4636f6562a48589fa5304297a6fbe9289c42b6f7 100644 (file)
@@ -14,6 +14,7 @@
 #include "math_data.h"
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
+#include "dispatchresult.h"
 #include "debug.h"
 #include "funcrequest.h"
 #include "LColor.h"
@@ -1041,7 +1042,7 @@ void MathGridInset::splitCell(idx_type & idx, pos_type & pos)
 }
 
 
-dispatch_result MathGridInset::priv_dispatch(FuncRequest const & cmd,
+DispatchResult MathGridInset::priv_dispatch(FuncRequest const & cmd,
        idx_type & idx, pos_type & pos)
 {
        switch (cmd.action) {
index 1757d245b865b15545d7a8c40ca531d3817086e4..c60ed8108f3133f3458aef423fd51d87bb4ccae5 100644 (file)
@@ -135,10 +135,6 @@ public:
        MathGridInset * asGridInset() { return this; }
        /// identifies GridInset
        MathGridInset const * asGridInset() const { return this; }
-       /// local dispatcher
-       dispatch_result priv_dispatch(FuncRequest const & cmd,
-               idx_type & idx, pos_type & pos);
-
        ///
        col_type ncols() const;
        ///
@@ -219,6 +215,11 @@ public:
        //void octave(OctaveStream &) const;
 
 protected:
+       ///
+       virtual
+       DispatchResult
+       priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
+
        /// returns x offset of cell compared to inset
        int cellXOffset(idx_type idx) const;
        /// returns y offset of cell compared to inset
index 0a81fcf1a516f2e1572dc3b421513f76c6f3b41d..3bfaf6a9c6218e6eff82939f53ea9fbbdacae9c9 100644 (file)
@@ -18,6 +18,7 @@
 #include "math_extern.h"
 #include "math_charinset.h"
 #include "textpainter.h"
+#include "dispatchresult.h"
 #include "debug.h"
 #include "funcrequest.h"
 #include "gettext.h"
@@ -771,7 +772,7 @@ void MathHullInset::doExtern
 }
 
 
-dispatch_result MathHullInset::priv_dispatch
+DispatchResult MathHullInset::priv_dispatch
        (FuncRequest const & cmd, idx_type & idx, pos_type & pos)
 {
        switch (cmd.action) {
index 82256f7494630d384de82c8d48b1b8fd52902e60..e568af0db6aaaee01f1bca5bbc4fc1faf7b33593 100644 (file)
@@ -50,9 +50,6 @@ public:
        bool display() const;
        ///
        bool ams() const;
-       /// local dispatcher
-       dispatch_result priv_dispatch(FuncRequest const & cmd,
-               idx_type & idx, pos_type & pos);
        /// Appends \c list with all labels found within this inset.
        void getLabelList(Buffer const &,
                          std::vector<std::string> & list) const;
@@ -100,6 +97,10 @@ public:
        void infoize(std::ostream & os) const;
 
 protected:
+       ///
+       virtual
+       DispatchResult
+       priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
        ///
        std::string eolString(row_type row, bool fragile) const;
 
index 3e4f3457bf525ecb9f464af3716970586e49869b..418e39345c96952cacd6f50ae891c986b35d95b3 100644 (file)
@@ -15,6 +15,7 @@
 #include "math_mathmlstream.h"
 #include "math_parser.h"
 #include "BufferView.h"
+#include "dispatchresult.h"
 #include "debug.h"
 #include "funcrequest.h"
 #include "LColor.h"
@@ -285,8 +286,9 @@ void MathNestInset::notifyCursorLeaves(idx_type idx)
 }
 
 
-dispatch_result MathNestInset::priv_dispatch(FuncRequest const & cmd,
-       idx_type & idx, pos_type & pos)
+DispatchResult
+MathNestInset::priv_dispatch(FuncRequest const & cmd,
+                            idx_type & idx, pos_type & pos)
 {
        BufferView * bv = cmd.view();
 
index 4db158a2bac34fa5b6a69d628bfbd279fc9322a3..2c4a6f14c792d52f17d65d5d607510222f142cf2 100644 (file)
@@ -101,12 +101,12 @@ public:
        void write(WriteStream & os) const;
        /// writes [, name(), and args in []
        void normalize(NormalStream & os) const;
-
-       /// local dispatcher
-       dispatch_result priv_dispatch(FuncRequest const & cmd,
-               idx_type & idx, pos_type & pos);
-
 protected:
+       ///
+       virtual
+       DispatchResult
+       priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
+
        /// we store the cells in a vector
        typedef std::vector<MathArray> cells_type;
        /// thusly:
@@ -123,7 +123,6 @@ protected:
        void metricsMarkers(int frame = 1) const;
        /// add space for markers
        void metricsMarkers2(int frame = 1) const;
-
 };
 
 #endif
index 524a2d580105a50f24907f99809a268243fd6f32..df73bf0ed4f4a4d4313f71a4f55bdd1bc5bc6e6d 100644 (file)
@@ -15,6 +15,7 @@
 #include "math_mathmlstream.h"
 #include "math_support.h"
 #include "math_symbolinset.h"
+#include "dispatchresult.h"
 #include "debug.h"
 #include "funcrequest.h"
 
@@ -511,8 +512,9 @@ void MathScriptInset::notifyCursorLeaves(idx_type idx)
 }
 
 
-dispatch_result MathScriptInset::dispatch
-       (FuncRequest const & cmd, idx_type & idx, pos_type & pos)
+DispatchResult
+MathScriptInset::priv_dispatch(FuncRequest const & cmd,
+                         idx_type & idx, pos_type & pos)
 {
        if (cmd.action == LFUN_MATH_LIMITS) {
                if (!cmd.argument.empty()) {
index 408f9015bbd5923627c693f7605e8329bb7f3604..5253d0f66025c86f3d54f8fddd276777884362af 100644 (file)
@@ -95,9 +95,11 @@ public:
        void infoize(std::ostream & os) const;
        /// say whether we have displayed limits
        void infoize2(std::ostream & os) const;
-       /// local dispatcher
-       dispatch_result dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
-
+protected:
+       ///
+       virtual
+       DispatchResult
+       priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
 private:
        /// returns x offset for main part
        int dxx() const;
index d762e5060f9bc3fc31a4ded5932ffea89e0607f5..163c5999baab304faddc78e9693838c841f3f984 100644 (file)
@@ -15,6 +15,7 @@
 #include "math_factory.h"
 
 #include "BufferView.h"
+#include "dispatchresult.h"
 #include "debug.h"
 #include "funcrequest.h"
 #include "math_support.h"
@@ -52,8 +53,9 @@ void RefInset::infoize(std::ostream & os) const
 }
 
 
-dispatch_result
-RefInset::priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
+DispatchResult
+RefInset::priv_dispatch(FuncRequest const & cmd,
+                       idx_type & idx, pos_type & pos)
 {
        switch (cmd.action) {
        case LFUN_INSET_MODIFY:
index 3a5d327ba21b552bd0db01645edc43486b8e3938..7d70b71744c07ae1c69a35092879970f5e3ca4db 100644 (file)
@@ -43,7 +43,7 @@ public:
        int docbook(std::ostream & os, bool) const;
 
        /// small wrapper for the time being
-       dispatch_result localDispatch(FuncRequest const & cmd);
+       DispatchResult localDispatch(FuncRequest const & cmd);
 
        struct ref_type_info {
                ///
@@ -61,7 +61,7 @@ public:
 protected:
        ///
        virtual
-       dispatch_result
+       DispatchResult
        priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
 };
 
index 1cdea810c8a8c99f11103f11c73f4cde2bbad2f7..05c612da29cd1006b40232fff5e2aaec164f0f87 100644 (file)
@@ -22,6 +22,7 @@
 #include "bufferparams.h"
 #include "BufferView.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "encoding.h"
 #include "funcrequest.h"
 #include "gettext.h"
@@ -200,7 +201,7 @@ int LyXText::singleWidth(ParagraphList::iterator pit,
                return font_metrics::width(c, font);
        }
 
-       if (c == Paragraph::META_INSET) 
+       if (c == Paragraph::META_INSET)
                return pit->getInset(pos)->width();
 
        if (IsSeparatorChar(c))
@@ -409,7 +410,7 @@ namespace {
 pos_type addressBreakPoint(pos_type i, Paragraph const & par)
 {
        pos_type const end = par.size();
-       
+
        for (; i < end; ++i)
                if (par.isNewline(i))
                        return i + 1;
@@ -428,7 +429,7 @@ void LyXText::rowBreakPoint(ParagraphList::iterator pit, Row & row) const
                row.endpos(end);
                return;
        }
-       
+
        // maximum pixel width of a row.
        int width = workWidth() - rightMargin(*pit, *bv()->buffer());
 //             - leftMargin(pit, row);
@@ -472,7 +473,7 @@ void LyXText::rowBreakPoint(ParagraphList::iterator pit, Row & row) const
                        point = i + 1;
                        break;
                }
-               // Break before...      
+               // Break before...
                if (i + 1 < end) {
                        InsetOld * in = pit->getInset(i + 1);
                        if (in && in->display()) {
@@ -488,12 +489,12 @@ void LyXText::rowBreakPoint(ParagraphList::iterator pit, Row & row) const
                }
 
                char const c = pit->getChar(i);
+
                if (i > endPosOfFontSpan) {
                        font = getFont(pit, i);
                        endPosOfFontSpan = pit->getEndPosOfFontSpan(i);
                }
-               
+
                {
                        int thiswidth = singleWidth(pit, i, c, font);
 
@@ -512,7 +513,7 @@ void LyXText::rowBreakPoint(ParagraphList::iterator pit, Row & row) const
                        //<< x << " width: " << width << endl;
                        chunkwidth += thiswidth;
                }
-               
+
 
                // break before a character that will fall off
                // the right of the row
@@ -521,7 +522,7 @@ void LyXText::rowBreakPoint(ParagraphList::iterator pit, Row & row) const
                        if (point == end || chunkwidth >= width - left) {
                                if (i > pos) {
                                        point = i;
-                                       break;  
+                                       break;
                                }
                        }
                        // exit on last registered breakpoint:
@@ -537,7 +538,7 @@ void LyXText::rowBreakPoint(ParagraphList::iterator pit, Row & row) const
                        // some insets are line separators too
                        if (pit->isLineSeparator(i)) {
                                // register breakpoint:
-                               point = i + 1; 
+                               point = i + 1;
                                chunkwidth = 0;
                        }
                }
@@ -709,7 +710,7 @@ void LyXText::setHeightOfRow(ParagraphList::iterator pit, Row & row)
                BufferParams const & bufparams = bv()->buffer()->params();
                // some parksips VERY EASY IMPLEMENTATION
                if (bv()->buffer()->params().paragraph_separation
-                   == BufferParams::PARSEP_SKIP 
+                   == BufferParams::PARSEP_SKIP
                        && pit != ownerParagraphs().begin()
                        && ((layout->isParagraph() && pit->getDepth() == 0)
                            || (boost::prior(pit)->layout()->isParagraph()
@@ -1106,7 +1107,7 @@ void LyXText::prepareToPrint(ParagraphList::iterator pit, Row & row) const
                {
                        align = LYX_ALIGN_CENTER;
                }
-               
+
                switch (align) {
     case LYX_ALIGN_BLOCK: {
                                int const ns = numberOfSeparators(*pit, row);
index feca17135c90655c257335d01b8619ff1a600db0..49c5bbcc490467e81cc15a3fdfb909862971baf2 100644 (file)
@@ -29,6 +29,7 @@
 #include "counters.h"
 #include "CutAndPaste.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "errorlist.h"
 #include "Floating.h"
 #include "FloatList.h"
@@ -602,7 +603,7 @@ void LyXText::toggleFree(LyXFont const & font, bool toggleall)
        // If there is a change in the language the implicit word selection
        // is disabled.
        LyXCursor resetCursor = cursor;
-       bool implicitSelection = 
+       bool implicitSelection =
                font.language() == ignore_language
                && font.number() == LyXFont::IGNORE
                && selectWordWhenUnderCursor(lyx::WHOLE_WORD_STRICT);
@@ -1354,7 +1355,7 @@ float LyXText::getCursorX(ParagraphList::iterator pit, Row const & row,
        double fill_label_hfill = row.fill_label_hfill();
        pos_type const row_pos  = row.pos();
        pos_type const end = row.endpos();
-       
+
        if (end <= row_pos)
                cursor_vpos = row_pos;
        else if (pos >= end && !boundary)
index 62eaa28e74dc0f4525066eef48a66c8f8c53d47f..de438501508bdfc2474dce806bdf1cbc71be08fc 100644 (file)
@@ -21,6 +21,7 @@
 #include "bufferparams.h"
 #include "BufferView.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "factory.h"
 #include "funcrequest.h"
 #include "gettext.h"
@@ -389,7 +390,7 @@ void doInsertInset(LyXText * lt, FuncRequest const & cmd,
 } // anon namespace
 
 
-dispatch_result LyXText::dispatch(FuncRequest const & cmd)
+DispatchResult LyXText::dispatch(FuncRequest const & cmd)
 {
        lyxerr[Debug::ACTION] << "LyXText::dispatch: action[" << cmd.action
                              <<"] arg[" << cmd.argument << ']' << "xy[" <<