Replace "EventProvider" class of the DefaultEventManager implementation with "Common::EventSource".

svn-id: r42718
This commit is contained in:
Johannes Schickel 2009-07-25 00:59:03 +00:00
parent 908af0a37f
commit ba7e01ad7c
4 changed files with 6 additions and 16 deletions

View File

@ -29,7 +29,7 @@
#include "common/system.h"
#include "backends/events/default/default-events.h"
class BaseBackend : public OSystem, EventProvider {
class BaseBackend : public OSystem, Common::EventSource {
public:
virtual Common::EventManager *getEventManager();
virtual void displayMessageOnOSD(const char *msg);

View File

@ -92,7 +92,7 @@ void writeRecord(Common::OutSaveFile *outFile, uint32 diff, Common::Event &event
}
}
DefaultEventManager::DefaultEventManager(EventProvider *boss) :
DefaultEventManager::DefaultEventManager(Common::EventSource *boss) :
_boss(boss),
_buttonState(0),
_modifierState(0),

View File

@ -41,20 +41,8 @@ namespace Common {
}
class EventProvider {
public:
virtual ~EventProvider() {}
/**
* Get the next event in the event queue.
* @param event point to an Common::Event struct, which will be filled with the event data.
* @return true if an event was retrieved.
*/
virtual bool pollEvent(Common::Event &event) = 0;
};
class DefaultEventManager : public Common::EventManager {
EventProvider *_boss;
Common::EventSource *_boss;
#ifdef ENABLE_VKEYBD
Common::VirtualKeyboard *_vk;
@ -128,7 +116,7 @@ class DefaultEventManager : public Common::EventManager {
void record(Common::Event &event);
bool playback(Common::Event &event);
public:
DefaultEventManager(EventProvider *boss);
DefaultEventManager(Common::EventSource *boss);
~DefaultEventManager();
virtual void init();

View File

@ -199,6 +199,8 @@ public:
/**
* Tries to catch events from the registered event
* sources and dispatch them to the observers.
*
* This dispatches *all* events the sources offer.
*/
void dispatch();