1 // -*- mode: C++; indent-tabs-mode: nil; -*-
6 @brief The action interface for user-available actions
9 #include "otk/display.hh"
10 #include "otk/point.hh"
11 #include "otk/rect.hh"
15 //! The action interface for user-available actions
17 When these actions are fired, hooks to the guile engine are fired so that
22 struct MousePressAction {
26 MousePressAction() { win = 0; button = 0; time = 0; }
30 // milliseconds XXX: config option
31 static const unsigned int DOUBLECLICKDELAY = 200;
33 //! The last 2 button presses processed for CLICKs
35 Inserted such that index 0 is the latest action.
37 MousePressAction *_presses[2];
38 //! The mouse button currently being watched from a press for a CLICK
40 //! The window the last enter action occured on (where the mouse is located)
43 void insertPress(Window win, unsigned int button, Time time);
49 //! Notify that a mouse button press has occured on a window.
51 @param win The window on which the action was performed.
52 @param modifiers The modifier state for the action.
53 @param button The mouse button the action is for.
54 @param time The time at which the event occured (from the XEvent).
56 void bpress(Window win, unsigned int modifiers, unsigned int button,
59 //! Notify that a mouse button release has occured on a window.
61 @param win The window on which the action was performed.
62 @param area The area of the window on which the action was performed.
63 @param mpos The position of the mouse pointer relative to the root window.
64 @param modifiers The modifier state for the action.
65 @param button The mouse button the action is for.
66 @param time The time at which the event occured (from the XEvent).
68 void brelease(Window win, const otk::Rect &area, const otk::Point &mpos,
69 unsigned int modifiers, unsigned int button, Time time);
71 //! Notify that a mouse enter action has occured on a window.
73 @param win The window on which the action was performed.
74 @param modifiers The modifier state for the action.
76 void enter(Window win, unsigned int modifiers);
78 //! Notify that a mouse leave action has occured on a window.
80 @param modifiers The modifier state for the action.
82 void leave(unsigned int modifiers);
84 //! Notify that a mouse drag is taking place.
86 @param win The window the drag is on
87 @param delta The change in position of the mouse pointer
88 @param modifiers The modifier state during the drag.
90 void drag(Window win, otk::Point delta, unsigned int modifiers,
91 unsigned int button, Time time);
93 //! Notify that a key press has occured on a window.
95 @param win The window the key press was on
96 @param modifiers The modifier state for the action.
97 @param keycode The keycode of the key pressed.
99 void key(Window win, unsigned int modifiers, unsigned int keycode);
104 #endif // __actions_hh