]> Dogcows Code - chaz/openbox/blob - otk/eventdispatcher.hh
change the default titlebar layout
[chaz/openbox] / otk / eventdispatcher.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __eventdispatcher
3 #define __eventdispatcher
4
5 #include "eventhandler.hh"
6 #include <map>
7 #include <utility>
8
9 namespace otk {
10
11 typedef std::map<unsigned int, EventHandler *> EventMap;
12
13 class EventDispatcher {
14 public:
15
16 EventDispatcher();
17 virtual ~EventDispatcher();
18
19 virtual void clearAllHandlers(void);
20 virtual void registerHandler(Window id, EventHandler *handler);
21 virtual void clearHandler(Window id);
22 virtual void dispatchEvents(void);
23
24 inline void setFallbackHandler(EventHandler *fallback)
25 { _fallback = fallback; }
26 EventHandler *getFallbackHandler(void) const { return _fallback; }
27
28 //! Sets an event handler that gets all events for all handlers after
29 //! any specific handlers have received them
30 inline void setMasterHandler(EventHandler *master)
31 { _master = master; }
32 EventHandler *getMasterHandler(void) const { return _master; }
33
34 EventHandler *findHandler(Window win);
35
36 inline Time lastTime() const { return _lasttime; }
37
38 private:
39 EventMap _map;
40 EventHandler *_fallback;
41 EventHandler *_master;
42
43 //! The time at which the last XEvent with a time was received
44 Time _lasttime;
45
46 void dispatch(Window win, const XEvent &e);
47 void dispatchFocus(const XEvent &e);
48 };
49
50 }
51
52 #endif
This page took 0.033907 seconds and 4 git commands to generate.