... turns out to be trivial after all. See attached patch.
[New inset/insetbase.h, derive Inset and MathInset from the new InsetBase,
and as an "application" replacing the two different enums for dispatch()'s
return values by a single one]

The tough question is, which of the virtual functions of the "unified
hierarchy" should be declared in the base class and which should start
further down.

Declaring everything in the base class makes it far to fat, putting
everything in the derived classes means a lot of "pseudo_dynamic_casts"
(i.e. either mathed's  'FooBarInset * asFooBarInset(); or mainstream's
LyXCode - both of which are not Nice).

Any ideas where to draw the line?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)
? lyx_main
? old.diff
? 1.diff
? workarea.diff.gz
? frontends/qt2/xforms/Makefile.in
? insets/insetbase.C
? insets/insettext.C.try
? mathed/tmp.diff
? mathed/1.diff
? mathed/haveit
? mathed/script.diff
? mathed/all
? mathed/rmcopyright.sh
? mathed/shared_ptr.diff
Index: lyxfunc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.379
diff -u -p -r1.379 lyxfunc.C
--- lyxfunc.C   16 Sep 2002 12:52:57 -0000      1.379
+++ lyxfunc.C   9 Oct 2002 13:28:02 -0000
@@ -726,7 +726,7 @@ void LyXFunc::dispatch(FuncRequest const
        }
 
        if (view()->available() && view()->theLockingInset()) {
-               Inset::RESULT result;
+               InsetBase::result_type result;
                if ((action > 1) || ((action == LFUN_UNKNOWN_ACTION) &&
                                     (!keyseq.deleted())))
                {
Index: lyxtext.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxtext.h,v
retrieving revision 1.127
diff -u -p -r1.127 lyxtext.h
--- lyxtext.h   29 Aug 2002 12:00:50 -0000      1.127
+++ lyxtext.h   9 Oct 2002 13:28:02 -0000
@@ -189,7 +189,7 @@ public:
        void status(BufferView *, text_status) const;
 
        ///
-       Inset::RESULT dispatch(FuncRequest const & cmd);
+       InsetBase::result_type dispatch(FuncRequest const & cmd);
 
 private:
        /** wether the screen needs a refresh,
Index: text3.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.23
diff -u -p -r1.23 text3.C
--- text3.C     11 Sep 2002 14:48:19 -0000      1.23
+++ text3.C     9 Oct 2002 13:28:03 -0000
@@ -368,7 +368,7 @@ void specialChar(LyXText * lt, BufferVie
 }
 
 
-Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
+InsetBase::result_type LyXText::dispatch(FuncRequest const & cmd)
 {
        lyxerr[Debug::ACTION] << "LyXFunc::dispatch: action[" << cmd.action
                              <<"] arg[" << cmd.argument << "]" << endl;
Index: insets/Makefile.am
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/Makefile.am,v
retrieving revision 1.50
diff -u -p -r1.50 Makefile.am
--- insets/Makefile.am  24 Sep 2002 18:20:26 -0000      1.50
+++ insets/Makefile.am  9 Oct 2002 13:28:03 -0000
@@ -15,6 +15,7 @@ EXTRA_DIST = \
 libinsets_la_SOURCES = \
        ExternalTemplate.C \
        ExternalTemplate.h \
+       insetbase.h \
        inset.C \
        inset.h \
        insetbib.C \
Index: insets/inset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inset.C,v
retrieving revision 1.83
diff -u -p -r1.83 inset.C
--- insets/inset.C      25 Sep 2002 14:26:10 -0000      1.83
+++ insets/inset.C      9 Oct 2002 13:28:03 -0000
@@ -95,7 +95,7 @@ void Inset::edit(BufferView *, bool)
 {}
 
 
-Inset::RESULT Inset::localDispatch(FuncRequest const &)
+Inset::result_type Inset::localDispatch(FuncRequest const &)
 {
        return UNDISPATCHED;
 }
@@ -291,7 +291,7 @@ void UpdatableInset::scroll(BufferView *
 
 
 ///  An updatable inset could handle lyx editing commands
-Inset::RESULT UpdatableInset::localDispatch(FuncRequest const & ev)
+Inset::result_type UpdatableInset::localDispatch(FuncRequest const & ev)
 {
        if (ev.action == LFUN_MOUSE_RELEASE)
                return (editable() == IS_EDITABLE) ? DISPATCHED : UNDISPATCHED;
Index: insets/inset.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inset.h,v
retrieving revision 1.59
diff -u -p -r1.59 inset.h
--- insets/inset.h      25 Sep 2002 14:26:10 -0000      1.59
+++ insets/inset.h      9 Oct 2002 13:28:03 -0000
@@ -19,11 +19,13 @@
 #pragma interface
 #endif
 
-#include <vector>
 #include "LString.h"
 #include "LColor.h"
+#include "insetbase.h"
 #include "frontends/mouse_state.h"
 
+#include <vector>
+
 class LyXFont;
 class BufferView;
 class Buffer;
@@ -42,7 +44,7 @@ namespace grfx {
 }
 
 /// Insets
-class Inset {
+class Inset : public InsetBase {
 public:
        /** This is not quite the correct place for this enum. I think
            the correct would be to let each subclass of Inset declare
@@ -142,37 +144,8 @@ public:
                HIGHLY_EDITABLE
        };
 
-       /** Dispatch result codes
-           Now that nested updatable insets are allowed, the local dispatch
-           becomes a bit complex, just two possible results (boolean)
-           are not enough.
-
-           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 RESULT {
-               UNDISPATCHED = 0,
-               DISPATCHED,
-               DISPATCHED_NOUPDATE,
-               FINISHED,
-               FINISHED_RIGHT,
-               FINISHED_UP,
-               FINISHED_DOWN
-       };
-
        /// To convert old binary dispatch results
-       RESULT DISPATCH_RESULT(bool b) {
+       result_type DISPATCH_RESULT(bool b) {
                return b ? DISPATCHED : FINISHED;
        }
 
@@ -181,7 +154,7 @@ public:
        ///
        Inset(Inset const & in, bool same_id = false);
        ///
-       virtual ~Inset() {}
+       ~Inset() {}
        ///
        virtual int ascent(BufferView *, LyXFont const &) const = 0;
        ///
@@ -203,7 +176,7 @@ public:
        ///
        virtual EDITABLE editable() const;
        /// 
-       virtual RESULT localDispatch(FuncRequest const & cmd);
+       virtual result_type localDispatch(FuncRequest const & cmd);
        ///
        virtual bool isTextInset() const { return false; }
        ///
@@ -501,7 +474,7 @@ public:
                                        bool /*lr*/ = false)
                { return false; }
        ///  An updatable inset could handle lyx editing commands
-       virtual RESULT localDispatch(FuncRequest const & cmd);
+       virtual result_type localDispatch(FuncRequest const & cmd);
        ///
        bool isCursorVisible() const { return cursor_visible_; }
        ///
Index: insets/insetbase.h
===================================================================
RCS file: insets/insetbase.h
diff -N insets/insetbase.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ insets/insetbase.h  9 Oct 2002 13:28:03 -0000
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+/**
+ * \file insetbase.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS
+ */
+
+#ifndef INSETBASE_H
+#define INSETBASE_H
+
+/// Base class for any kind of insets in LyX
+class InsetBase {
+public:
+       /** Dispatch result codes
+           Now that nested updatable insets are allowed, the local dispatch
+           becomes a bit complex, just two possible results (boolean)
+           are not enough.
+
+           DISPATCHED          = the inset catched the action
+           DISPATCHED_NOUPDATE = the inset catched the action and no update
+                                 is needed here to redraw the inset
+                       DISPATCHED_POP      = the inset catched the action, cursor has
+                           to move up
+           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 result_type {
+               UNDISPATCHED = 0,
+               DISPATCHED,
+               DISPATCHED_NOUPDATE,
+               FINISHED,
+               FINISHED_RIGHT,
+               FINISHED_UP,
+               FINISHED_DOWN,
+               DISPATCHED_POP
+       };
+
+       /// we behave nicely
+       InsetBase() {}
+       /// virtual base class destructor
+       virtual ~InsetBase() {}
+};
+
+#endif
Index: insets/insetcollapsable.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcollapsable.C,v
retrieving revision 1.120
diff -u -p -r1.120 insetcollapsable.C
--- insets/insetcollapsable.C   25 Sep 2002 14:26:10 -0000      1.120
+++ insets/insetcollapsable.C   9 Oct 2002 13:28:03 -0000
@@ -447,7 +447,7 @@ void InsetCollapsable::update(BufferView
 }
 
 
-Inset::RESULT InsetCollapsable::localDispatch(FuncRequest const & cmd)
+Inset::result_type InsetCollapsable::localDispatch(FuncRequest const & cmd)
 {
        switch (cmd.action) {
 
@@ -464,7 +464,7 @@ Inset::RESULT InsetCollapsable::localDis
                        return DISPATCHED;
 
                default:
-                       UpdatableInset::RESULT result = inset.localDispatch(cmd);
+                       UpdatableInset::result_type result = inset.localDispatch(cmd);
                        if (result >= FINISHED)
                                cmd.view()->unlockInset(this);
                        first_after_edit = false;
Index: insets/insetcollapsable.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcollapsable.h,v
retrieving revision 1.89
diff -u -p -r1.89 insetcollapsable.h
--- insets/insetcollapsable.h   25 Sep 2002 14:26:10 -0000      1.89
+++ insets/insetcollapsable.h   9 Oct 2002 13:28:03 -0000
@@ -90,7 +90,7 @@ public:
        ///
        int insetInInsetY() const;
        ///
-       RESULT localDispatch(FuncRequest const &);
+       result_type localDispatch(FuncRequest const &);
        ///
        int latex(Buffer const *, std::ostream &,
                  bool fragile, bool free_spc) const;
Index: insets/insetert.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetert.C,v
retrieving revision 1.95
diff -u -p -r1.95 insetert.C
--- insets/insetert.C   25 Sep 2002 14:26:10 -0000      1.95
+++ insets/insetert.C   9 Oct 2002 13:28:03 -0000
@@ -437,9 +437,9 @@ int InsetERT::docbook(Buffer const *, os
 }
 
 
-Inset::RESULT InsetERT::localDispatch(FuncRequest const & cmd)
+Inset::result_type InsetERT::localDispatch(FuncRequest const & cmd)
 {
-       Inset::RESULT result = DISPATCHED_NOUPDATE;
+       Inset::result_type result = DISPATCHED_NOUPDATE;
        BufferView * bv = cmd.view();
 
        if (inset.paragraph()->empty()) {
Index: insets/insetert.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetert.h,v
retrieving revision 1.55
diff -u -p -r1.55 insetert.h
--- insets/insetert.h   25 Sep 2002 14:26:10 -0000      1.55
+++ insets/insetert.h   9 Oct 2002 13:28:03 -0000
@@ -87,7 +87,7 @@ public:
        ///
        void validate(LaTeXFeatures &) const {}
        ///
-       RESULT localDispatch(FuncRequest const &);
+       result_type localDispatch(FuncRequest const &);
        ///
        bool checkInsertChar(LyXFont &);
        ///
Index: insets/insettabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.C,v
retrieving revision 1.229
diff -u -p -r1.229 insettabular.C
--- insets/insettabular.C       25 Sep 2002 14:26:11 -0000      1.229
+++ insets/insettabular.C       9 Oct 2002 13:28:03 -0000
@@ -890,12 +890,12 @@ void InsetTabular::lfunMouseMotion(FuncR
 }
 
 
-Inset::RESULT InsetTabular::localDispatch(FuncRequest const & cmd)
+Inset::result_type InsetTabular::localDispatch(FuncRequest const & cmd)
 {
        // 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;
-       RESULT result = UpdatableInset::localDispatch(cmd);
+       result_type result = UpdatableInset::localDispatch(cmd);
 
        BufferView * bv = cmd.view();
        if (result == DISPATCHED || result == DISPATCHED_NOUPDATE) {
@@ -1639,7 +1639,7 @@ void InsetTabular::resetPos(BufferView *
 }
 
 
-Inset::RESULT InsetTabular::moveRight(BufferView * bv, bool lock)
+Inset::result_type InsetTabular::moveRight(BufferView * bv, bool lock)
 {
        if (lock && !old_locking_inset) {
                if (activateCellInset(bv))
@@ -1657,7 +1657,7 @@ Inset::RESULT InsetTabular::moveRight(Bu
 }
 
 
-Inset::RESULT InsetTabular::moveLeft(BufferView * bv, bool lock)
+Inset::result_type InsetTabular::moveLeft(BufferView * bv, bool lock)
 {
        bool moved = isRightToLeft(bv) ? moveNextCell(bv) : movePrevCell(bv);
        if (!moved)
@@ -1671,7 +1671,7 @@ Inset::RESULT InsetTabular::moveLeft(Buf
 }
 
 
-Inset::RESULT InsetTabular::moveUp(BufferView * bv, bool lock)
+Inset::result_type InsetTabular::moveUp(BufferView * bv, bool lock)
 {
        int const ocell = actcell;
        actcell = tabular->GetCellAbove(actcell);
@@ -1692,7 +1692,7 @@ Inset::RESULT InsetTabular::moveUp(Buffe
 }
 
 
-Inset::RESULT InsetTabular::moveDown(BufferView * bv, bool lock)
+Inset::result_type InsetTabular::moveDown(BufferView * bv, bool lock)
 {
        int const ocell = actcell;
        actcell = tabular->GetCellBelow(actcell);
Index: insets/insettabular.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.h,v
retrieving revision 1.100
diff -u -p -r1.100 insettabular.h
--- insets/insettabular.h       25 Sep 2002 14:26:12 -0000      1.100
+++ insets/insettabular.h       9 Oct 2002 13:28:03 -0000
@@ -136,7 +136,7 @@ public:
        ///
        bool display() const { return tabular->IsLongTabular(); }
        ///
-       RESULT localDispatch(FuncRequest const &);
+       result_type localDispatch(FuncRequest const &);
        ///
        int latex(Buffer const *, std::ostream &, bool, bool) const;
        ///
@@ -269,13 +269,13 @@ private:
        ///
        void setPos(BufferView *, int x, int y) const;
        ///
-       RESULT moveRight(BufferView *, bool lock = true);
+       result_type moveRight(BufferView *, bool lock = true);
        ///
-       RESULT moveLeft(BufferView *, bool lock = true);
+       result_type moveLeft(BufferView *, bool lock = true);
        ///
-       RESULT moveUp(BufferView *, bool lock = true);
+       result_type moveUp(BufferView *, bool lock = true);
        ///
-       RESULT moveDown(BufferView *, bool lock = true);
+       result_type moveDown(BufferView *, bool lock = true);
        ///
        bool moveNextCell(BufferView *, bool lock = false);
        ///
Index: insets/insettext.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.C,v
retrieving revision 1.332
diff -u -p -r1.332 insettext.C
--- insets/insettext.C  25 Sep 2002 14:26:12 -0000      1.332
+++ insets/insettext.C  9 Oct 2002 13:28:03 -0000
@@ -1174,7 +1174,7 @@ void InsetText::lfunMouseMotion(FuncRequ
 }
 
 
-Inset::RESULT InsetText::localDispatch(FuncRequest const & ev)
+Inset::result_type InsetText::localDispatch(FuncRequest const & ev)
 {
        BufferView * bv = ev.view();
        switch (ev.action) {
@@ -1192,7 +1192,7 @@ Inset::RESULT InsetText::localDispatch(F
 
        bool was_empty = (paragraphs.begin()->empty() && !paragraphs.begin()->next());
        no_selection = false;
-       RESULT result = UpdatableInset::localDispatch(ev);
+       result_type result = UpdatableInset::localDispatch(ev);
        if (result != UNDISPATCHED)
                return DISPATCHED;
 
@@ -1846,7 +1846,7 @@ void InsetText::fitInsetCursor(BufferVie
 }
 
 
-Inset::RESULT
+InsetBase::result_type
 InsetText::moveRight(BufferView * bv, bool activate_inset, bool selecting)
 {
        if (getLyXText(bv)->cursor.par()->isRightToLeftPar(bv->buffer()->params))
@@ -1856,7 +1856,7 @@ InsetText::moveRight(BufferView * bv, bo
 }
 
 
-Inset::RESULT
+InsetBase::result_type
 InsetText::moveLeft(BufferView * bv, bool activate_inset, bool selecting)
 {
        if (getLyXText(bv)->cursor.par()->isRightToLeftPar(bv->buffer()->params))
@@ -1866,7 +1866,7 @@ InsetText::moveLeft(BufferView * bv, boo
 }
 
 
-Inset::RESULT
+InsetBase::result_type
 InsetText::moveRightIntern(BufferView * bv, bool front,
                           bool activate_inset, bool selecting)
 {
@@ -1881,7 +1881,7 @@ InsetText::moveRightIntern(BufferView * 
 }
 
 
-Inset::RESULT
+InsetBase::result_type
 InsetText::moveLeftIntern(BufferView * bv, bool front,
                          bool activate_inset, bool selecting)
 {
@@ -1896,7 +1896,7 @@ InsetText::moveLeftIntern(BufferView * b
 }
 
 
-Inset::RESULT
+InsetBase::result_type
 InsetText::moveUp(BufferView * bv)
 {
        if (!crow(bv)->previous())
@@ -1906,7 +1906,7 @@ InsetText::moveUp(BufferView * bv)
 }
 
 
-Inset::RESULT
+InsetBase::result_type
 InsetText::moveDown(BufferView * bv)
 {
        if (!crow(bv)->next())
Index: insets/insettext.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.h,v
retrieving revision 1.134
diff -u -p -r1.134 insettext.h
--- insets/insettext.h  25 Sep 2002 14:26:12 -0000      1.134
+++ insets/insettext.h  9 Oct 2002 13:28:03 -0000
@@ -122,7 +122,7 @@ public:
        ///
        bool updateInsetInInset(BufferView *, Inset *);
        ///
-       RESULT localDispatch(FuncRequest const &);
+       result_type localDispatch(FuncRequest const &);
        ///
        int latex(Buffer const *, std::ostream &,
                  bool fragile, bool free_spc) const;
@@ -290,26 +290,26 @@ private:
        ///
        int beginningOfMainBody(Paragraph * par) const;
        ///
-       RESULT moveRight(BufferView *,
+       result_type moveRight(BufferView *,
                                         bool activate_inset = true,
                                         bool selecting = false);
        ///
-       RESULT moveLeft(BufferView *,
+       result_type moveLeft(BufferView *,
                                        bool activate_inset = true,
                                        bool selecting = false);
        ///
-       RESULT moveRightIntern(BufferView *, bool front,
+       result_type moveRightIntern(BufferView *, bool front,
                                               bool activate_inset = true,
                                               bool selecting = false);
        ///
-       RESULT moveLeftIntern(BufferView *, bool front,
+       result_type moveLeftIntern(BufferView *, bool front,
                                              bool activate_inset = true,
                                              bool selecting = false);
 
        ///
-       RESULT moveUp(BufferView *);
+       result_type moveUp(BufferView *);
        ///
-       RESULT moveDown(BufferView *);
+       result_type moveDown(BufferView *);
        ///
        void setCharFont(Buffer const *, int pos, LyXFont const & font);
        ///
Index: mathed/formulabase.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulabase.C,v
retrieving revision 1.212
diff -u -p -r1.212 formulabase.C
--- mathed/formulabase.C        20 Sep 2002 12:36:36 -0000      1.212
+++ mathed/formulabase.C        9 Oct 2002 13:28:03 -0000
@@ -235,6 +235,12 @@ void InsetFormulaBase::toggleInsetCursor
 
 void InsetFormulaBase::showInsetCursor(BufferView * bv, bool)
 {
+       if (!mathcursor) {
+               // let's not Assert() on this for a while
+               lyxerr[Debug::MATHED]
+                       << "InsetFormulaBase::showInsetCursor(): should not happen\n";
+               return;
+       }
        if (isCursorVisible())
                return;
        fitInsetCursor(bv);
@@ -249,6 +255,12 @@ void InsetFormulaBase::showInsetCursor(B
 
 void InsetFormulaBase::hideInsetCursor(BufferView * bv)
 {
+       if (!mathcursor) {
+               // let's not Assert() on this for a while
+               lyxerr[Debug::MATHED]
+                       << "InsetFormulaBase::hideInsetCursor(): should not happen\n";
+               return;
+       }
        if (!isCursorVisible())
                return;
        bv->hideLockedInsetCursor();
@@ -289,7 +301,8 @@ void InsetFormulaBase::updateLocal(Buffe
 }
 
 
-Inset::RESULT InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
+InsetBase::result_type
+       InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
 {
        if (!mathcursor)
                return UNDISPATCHED;
@@ -322,7 +335,8 @@ Inset::RESULT InsetFormulaBase::lfunMous
 }
 
 
-Inset::RESULT InsetFormulaBase::lfunMousePress(FuncRequest const & cmd)
+InsetBase::result_type
+       InsetFormulaBase::lfunMousePress(FuncRequest const & cmd)
 {
        BufferView * bv = cmd.view();
        releaseMathCursor(bv);
@@ -349,7 +363,8 @@ Inset::RESULT InsetFormulaBase::lfunMous
 }
 
 
-Inset::RESULT InsetFormulaBase::lfunMouseMotion(FuncRequest const & cmd)
+InsetBase::result_type
+       InsetFormulaBase::lfunMouseMotion(FuncRequest const & cmd)
 {
        if (!mathcursor)
                return DISPATCHED;
@@ -376,7 +391,8 @@ Inset::RESULT InsetFormulaBase::lfunMous
 }
 
 
-Inset::RESULT InsetFormulaBase::localDispatch(FuncRequest const & cmd)
+InsetBase::result_type
+       InsetFormulaBase::localDispatch(FuncRequest const & cmd)
 {
        //lyxerr << "InsetFormulaBase::localDispatch: act: " << cmd.action
        //      << " arg: '" << cmd.argument
@@ -403,7 +419,7 @@ Inset::RESULT InsetFormulaBase::localDis
 
        BufferView * bv    = cmd.view();
        string argument    = cmd.argument;
-       RESULT result      = DISPATCHED;
+       result_type result = DISPATCHED;
        bool sel           = false;
        bool was_macro     = mathcursor->inMacroMode();
        bool was_selection = mathcursor->selection();
Index: mathed/formulabase.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulabase.h,v
retrieving revision 1.52
diff -u -p -r1.52 formulabase.h
--- mathed/formulabase.h        11 Sep 2002 08:26:02 -0000      1.52
+++ mathed/formulabase.h        9 Oct 2002 13:28:03 -0000
@@ -79,7 +79,7 @@ public:
        virtual void insetUnlock(BufferView *);
 
        /// To allow transparent use of math editing functions
-       virtual RESULT localDispatch(FuncRequest const &);
+       virtual result_type localDispatch(FuncRequest const &);
        /// To allow transparent use of math editing functions
        //virtual void status(FuncRequest const &);
 
@@ -117,11 +117,11 @@ private:
        /// common base for handling accents
        void handleAccent(BufferView * bv, string const & arg, string const & name);
        /// lfun handler 
-       RESULT lfunMousePress(FuncRequest const &);
+       result_type lfunMousePress(FuncRequest const &);
        ///
-       RESULT lfunMouseRelease(FuncRequest const &);
+       result_type lfunMouseRelease(FuncRequest const &);
        ///
-       RESULT lfunMouseMotion(FuncRequest const &);
+       result_type lfunMouseMotion(FuncRequest const &);
 
 protected:
        ///
Index: mathed/math_inset.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_inset.h,v
retrieving revision 1.146
diff -u -p -r1.146 math_inset.h
--- mathed/math_inset.h 11 Sep 2002 09:14:56 -0000      1.146
+++ mathed/math_inset.h 9 Oct 2002 13:28:03 -0000
@@ -31,6 +31,7 @@
 #include "LString.h"
 #include "frontends/mouse_state.h"
 #include "math_data.h"
+#include "insets/insetbase.h"
 
 /**
 
@@ -83,7 +84,7 @@ class Dimension;
 class FuncRequest;
 
 
-class MathInset {
+class MathInset : public InsetBase {
 public:
        /// short of anything else reasonable
        typedef MathArray::size_type        size_type;
@@ -100,8 +101,8 @@ public:
 
        /// our members behave nicely...
        MathInset() {}
-       /// the virtual base destructor
-       virtual ~MathInset() {}
+       /// our members behave nicely...
+       ~MathInset() {}
 
        /// reproduce itself
        virtual MathInset * clone() const = 0;
@@ -228,12 +229,6 @@ public:
        virtual bool isRelOp() const { return false; }
        /// -1: text mode, 1: math mode, 0 undecided
        enum mode_type {UNDECIDED_MODE, TEXT_MODE, MATH_MODE, VERBATIM_MODE};
-       /// Dispatch result codes, see inset/inset.h
-       enum result_type {
-               UNDISPATCHED = 0, DISPATCHED, DISPATCHED_NOUPDATE,
-               FINISHED, FINISHED_RIGHT, FINISHED_UP, FINISHED_DOWN,
-               DISPATCHED_POP
-       };
 
        virtual mode_type currentMode() const { return UNDECIDED_MODE; }
        /// will this get written as a single block in {..}

Reply via email to