all repos — openbox @ 638d4e6f1902c92e73b04246f349318236378437

openbox fork - make it a bit more like ryudo

otk/eventdispatcher.hh (raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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