diff options
| author | Marius Nita <marius@cs.pdx.edu> | 2002-11-16 02:11:44 +0000 |
|---|---|---|
| committer | Marius Nita <marius@cs.pdx.edu> | 2002-11-16 02:11:44 +0000 |
| commit | e53fbcf092c40b22ccc4c5f23795e12c9862c338 (patch) | |
| tree | 1af236afed9fba729d9220f26e8edcd9e64cc470 /otk/eventdispatcher.hh | |
| parent | 1210e6d688b62aceec2395bd3833e7c280d57326 (diff) | |
event handling classes
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 |
