diff options
Diffstat (limited to 'otk/eventdispatcher.hh')
| -rw-r--r-- | otk/eventdispatcher.hh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/otk/eventdispatcher.hh b/otk/eventdispatcher.hh new file mode 100644 index 00000000..5e7a1fe4 --- /dev/null +++ b/otk/eventdispatcher.hh @@ -0,0 +1,35 @@ +#ifndef __eventdispatcher +#define __eventdispatcher + +#include "eventhandler.hh" +#include <map> +#include <utility> + +namespace otk { + +typedef std::map<unsigned int, OtkEventHandler *> OtkEventMap; + +class OtkEventDispatcher { +public: + + OtkEventDispatcher(); + virtual ~OtkEventDispatcher(); + + virtual void clearAllHandlers(void); + virtual void registerHandler(Window id, OtkEventHandler *handler); + virtual void clearHandler(Window id); + virtual void dispatchEvents(void); + + inline void setFallbackHandler(OtkEventHandler *fallback) + { _fallback = fallback; } + OtkEventHandler *getFallbackHandler(void) const { return _fallback; } + +private: + OtkEventMap _map; + OtkEventHandler *_fallback; + +}; + +} + +#endif |
