Use the dispatch_result wrapper class DispatchResult to remove

#include "insets/insetbase.h" from cursor.h.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7787 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-09-18 11:21:53 +00:00
parent 3fbad6656f
commit de04f0162d
5 changed files with 24 additions and 5 deletions

View File

@ -1,9 +1,14 @@
2003-09-18 Angus Leeming <leeming@lyx.org>
* cursor.[Ch]: use the dispatch_result wrapper class DispatchResult to remove
#include "insets/insetbase.h" from cursor.h.
2003-09-18 Angus Leeming <leeming@lyx.org>
* paragraph.[Ch] (insetAllowed): use the InsetOld::Code wrapper class
InsetOld_code to remove #include "inset.h".
* iterators.C: add #include "inset.h"
* iterators.C: add #include "insets/inset.h"
2003-09-16 Martin Vermeer <martin.vermeer@hut.fi>

View File

@ -23,7 +23,7 @@
using std::vector;
dispatch_result Cursor::dispatch(FuncRequest const &)
DispatchResult Cursor::dispatch(FuncRequest const &)
{
for (int i = data_.size() - 1; i >= 0; --i) {
lyxerr << "trying to dispatch to " << data_[i].text_ << std::endl;

View File

@ -17,10 +17,11 @@
#include "support/types.h"
#include "insets/insetbase.h"
#include <vector>
class BufferView;
class DispatchResult;
class FuncRequest;
class LyXText;
@ -47,7 +48,7 @@ public:
///
Cursor() {}
///
dispatch_result dispatch(FuncRequest const & cmd);
DispatchResult dispatch(FuncRequest const & cmd);
public:
/// mainly used as stack, bnut wee need random access
std::vector<CursorItem> data_;

View File

@ -1,6 +1,7 @@
2003-09-18 Angus Leeming <leeming@lyx.org>
* inset.h: add the InsetOld::Code wrapper class InsetOld_code.
* insetbase.h: add the dispatch_result wrapper class DispatchResult.
2003-09-16 Angus Leeming <leeming@lyx.org>

View File

@ -50,6 +50,18 @@ enum dispatch_result {
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_; }
};
/// Common base class to all insets
class InsetBase {