]> icculus.org git repositories - dana/openbox.git/blob - src/actions.hh
handle mouse motion too
[dana/openbox.git] / 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 MouseButtonAction {
24     Window win;
25     unsigned int button;
26     Time time;
27     MouseButtonAction() { 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 release processed for CLICKs
35   MouseButtonAction _release;
36   //! The mouse button currently being watched from a press for a CLICK
37   unsigned int _button;
38
39   void insertPress(Window win, unsigned int button, Time time);
40   
41 public:
42   OBActions();
43   virtual ~OBActions();
44
45   virtual void buttonPressHandler(const XButtonEvent &e);
46   virtual void buttonReleaseHandler(const XButtonEvent &e);
47   
48   virtual void enterHandler(const XCrossingEvent &e);
49   virtual void leaveHandler(const XCrossingEvent &e);
50
51   virtual void keyPressHandler(const XKeyEvent &e);
52
53   virtual void motionHandler(const XMotionEvent &e);
54 };
55
56 }
57
58 #endif // __actions_hh