openbox/otk/eventdispatcher.hh

38 lines
840 B
C++
Raw Normal View History

2002-11-16 02:11:44 +00:00
#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;
//! The time at which the last XEvent with a time was received
Time _lasttime; // XXX: store this! also provide an accessor!
2002-11-16 02:11:44 +00:00
};
}
#endif