aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJohannes Schickel2009-07-25 01:01:22 +0000
committerJohannes Schickel2009-07-25 01:01:22 +0000
commit901f2d5836027ee36bac706b68c8c9a06f515031 (patch)
treebd28358f437a32322e250265c8fe1cf64dda4820 /common
parentef7166740369bab9111289122aac3ef07c48c0bb (diff)
downloadscummvm-rg350-901f2d5836027ee36bac706b68c8c9a06f515031.tar.gz
scummvm-rg350-901f2d5836027ee36bac706b68c8c9a06f515031.tar.bz2
scummvm-rg350-901f2d5836027ee36bac706b68c8c9a06f515031.zip
- EventDispatcher is no longer a singleton.
- Add "getEventDispatcher" method to EventManager. svn-id: r42728
Diffstat (limited to 'common')
-rw-r--r--common/events.cpp2
-rw-r--r--common/events.h19
2 files changed, 12 insertions, 9 deletions
diff --git a/common/events.cpp b/common/events.cpp
index 149b4936a9..0fab55c956 100644
--- a/common/events.cpp
+++ b/common/events.cpp
@@ -25,8 +25,6 @@
#include "common/events.h"
-DECLARE_SINGLETON(Common::EventDispatcher);
-
namespace Common {
EventDispatcher::EventDispatcher() : _mapper(0) {
diff --git a/common/events.h b/common/events.h
index 4f060a6da7..2ca705c70c 100644
--- a/common/events.h
+++ b/common/events.h
@@ -236,9 +236,11 @@ public:
* mapper will be processed before an event is sent to the
* observers.
*/
-class EventDispatcher : public Singleton<EventDispatcher> {
- friend class Singleton<SingletonBaseType>;
+class EventDispatcher {
public:
+ EventDispatcher();
+ ~EventDispatcher();
+
/**
* Tries to catch events from the registered event
* sources and dispatch them to the observers.
@@ -289,9 +291,6 @@ public:
*/
void unregisterObserver(EventObserver *obs);
private:
- EventDispatcher();
- ~EventDispatcher();
-
EventMapper *_mapper;
struct Entry {
@@ -314,8 +313,6 @@ private:
void dispatchEvent(const Event &event);
};
-#define g_eventDispatcher (Common::EventDispatcher::instance())
-
class Keymapper;
/**
@@ -398,6 +395,14 @@ public:
#ifdef ENABLE_KEYMAPPER
virtual Common::Keymapper *getKeymapper() = 0;
#endif
+
+ /**
+ * Returns the underlying EventDispatcher.
+ */
+ EventDispatcher *getEventDispatcher() { return &_dispatcher; }
+
+protected:
+ EventDispatcher _dispatcher;
};
} // End of namespace Common