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"
12 #include "otk/eventhandler.hh"
16 //! The action interface for user-available actions
18 When these actions are fired, hooks to the guile engine are fired so that
21 class OBActions : public otk::OtkEventHandler {
23 struct MouseButtonAction {
27 MouseButtonAction() { win = 0; button = 0; time = 0; }
31 // milliseconds XXX: config option
32 static const unsigned int DOUBLECLICKDELAY;
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
39 void insertPress(Window win, unsigned int button, Time time);
45 virtual void buttonPressHandler(const XButtonEvent &e);
46 virtual void buttonReleaseHandler(const XButtonEvent &e);
48 virtual void enterHandler(const XCrossingEvent &e);
49 virtual void leaveHandler(const XCrossingEvent &e);
51 //! Notify that a mouse drag is taking place.
53 @param win The window the drag is on
54 @param delta The change in position of the mouse pointer
55 @param modifiers The modifier state during the drag.
57 void drag(Window win, otk::Point delta, unsigned int modifiers,
58 unsigned int button, Time time);
60 //! Notify that a key press has occured on a window.
62 @param win The window the key press was on
63 @param modifiers The modifier state for the action.
64 @param keycode The keycode of the key pressed.
66 void key(Window win, unsigned int modifiers, unsigned int keycode);
71 #endif // __actions_hh