]> Dogcows Code - chaz/openbox/blob - src/actions.hh
924a8dc0c29bfe5307dc65b612334ee80b8cd215
[chaz/openbox] / src / actions.hh
1 // -*- mode: C++; indent-tabs-mode: nil; -*-
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/display.hh"
10 #include "otk/point.hh"
11 #include "otk/rect.hh"
12 #include "otk/eventhandler.hh"
13
14 namespace ob {
15
16 //! The action interface for user-available actions
17 /*!
18 When these actions are fired, hooks to the guile engine are fired so that
19 guile code is run.
20 */
21 class OBActions : public otk::OtkEventHandler {
22 public:
23 struct MousePressAction {
24 Window win;
25 unsigned int button;
26 Time time;
27 MousePressAction() { win = 0; button = 0; time = 0; }
28 };
29
30 private:
31 // milliseconds XXX: config option
32 static const unsigned int DOUBLECLICKDELAY;
33
34 //! The last 2 button presses processed for CLICKs
35 /*!
36 Inserted such that index 0 is the latest action.
37 */
38 MousePressAction *_presses[2];
39 //! The mouse button currently being watched from a press for a CLICK
40 unsigned int _button;
41 //! The window the last enter action occured on (where the mouse is located)
42 Window _enter_win;
43
44 void insertPress(Window win, unsigned int button, Time time);
45
46 public:
47 OBActions();
48 virtual ~OBActions();
49
50 virtual void buttonPressHandler(const XButtonEvent &e);
51 virtual void buttonReleaseHandler(const XButtonEvent &e);
52
53
54
55
56 //! Notify that a mouse enter action has occured on a window.
57 /*!
58 @param win The window on which the action was performed.
59 @param modifiers The modifier state for the action.
60 */
61 void enter(Window win, unsigned int modifiers);
62
63 //! Notify that a mouse leave action has occured on a window.
64 /*!
65 @param modifiers The modifier state for the action.
66 */
67 void leave(unsigned int modifiers);
68
69 //! Notify that a mouse drag is taking place.
70 /*!
71 @param win The window the drag is on
72 @param delta The change in position of the mouse pointer
73 @param modifiers The modifier state during the drag.
74 */
75 void drag(Window win, otk::Point delta, unsigned int modifiers,
76 unsigned int button, Time time);
77
78 //! Notify that a key press has occured on a window.
79 /*!
80 @param win The window the key press was on
81 @param modifiers The modifier state for the action.
82 @param keycode The keycode of the key pressed.
83 */
84 void key(Window win, unsigned int modifiers, unsigned int keycode);
85 };
86
87 }
88
89 #endif // __actions_hh
This page took 0.03914 seconds and 4 git commands to generate.