]> Dogcows Code - chaz/openbox/blob - src/actions.hh
add 'grab_server' for grabbing .. the .. server!
[chaz/openbox] / src / actions.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __actions_hh
3 #define __actions_hh
4
5 /*! @file actions.hh
6 @brief The action interface for user-available actions
7 */
8
9 #include "otk/point.hh"
10 #include "otk/rect.hh"
11 #include "otk/eventhandler.hh"
12
13 extern "C" {
14 #include <X11/Xlib.h>
15 #include <Python.h>
16 }
17
18 #include <map>
19
20 namespace ob {
21
22 //! The action interface for user-available actions
23 /*!
24 When these actions are fired, hooks to the guile engine are fired so that
25 guile code is run.
26 */
27 class Actions : public otk::EventHandler {
28 public:
29 #ifndef SWIG // get rid of a swig warning
30 struct ButtonReleaseAction {
31 Window win;
32 unsigned int button;
33 Time time;
34 ButtonReleaseAction() { win = 0; button = 0; time = 0; }
35 };
36
37 struct ButtonPressAction {
38 Window win;
39 unsigned int button;
40 otk::Point pos;
41 otk::Rect clientarea;
42 ButtonPressAction() { button = 0; }
43 };
44 #endif // SWIG
45 private:
46 //! The last button release processed for CLICKs
47 ButtonReleaseAction _release;
48 //! The last button press processed for CLICKs
49 ButtonPressAction _press;
50 //! This is set to true once a drag has started and false when done to make
51 //! sure the threshold isnt checked anymore once a drag is underway
52 bool _dragging;
53
54 public:
55 //! Constructs an Actions object
56 Actions();
57 //! Destroys the Actions object
58 virtual ~Actions();
59
60 virtual void buttonPressHandler(const XButtonEvent &e);
61 virtual void buttonReleaseHandler(const XButtonEvent &e);
62
63 virtual void enterHandler(const XCrossingEvent &e);
64 virtual void leaveHandler(const XCrossingEvent &e);
65
66 virtual void keyPressHandler(const XKeyEvent &e);
67 virtual void keyReleaseHandler(const XKeyEvent &e);
68
69 virtual void motionHandler(const XMotionEvent &e);
70
71 #ifdef XKB
72 virtual void xkbHandler(const XkbEvent &e);
73 #endif // XKB
74
75 };
76
77 }
78
79 #endif // __actions_hh
This page took 0.036771 seconds and 4 git commands to generate.