1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
6 @brief The action interface for user-available actions
9 #include "widgetbase.hh"
10 #include "otk/point.hh"
11 #include "otk/rect.hh"
12 #include "otk/eventhandler.hh"
23 //! The action interface for user-available actions
25 When these actions are fired, hooks to the guile engine are fired so that
28 class Actions
: public otk::EventHandler
{
30 #ifndef SWIG // get rid of a swig warning
31 struct ButtonReleaseAction
{
35 ButtonReleaseAction() { win
= 0; button
= 0; time
= 0; }
38 struct ButtonPressAction
{
42 ButtonPressAction() { button
= 0; }
46 // milliseconds XXX: config option
47 static const int BUTTONS
= 5;
49 //! The mouse button currently being watched from a press for a CLICK
51 //! The last button release processed for CLICKs
52 ButtonReleaseAction _release
;
53 //! The point where the mouse was when each mouse button was pressed
55 Used for motion events as the starting position.
57 ButtonPressAction
*_posqueue
[BUTTONS
];
58 //! This is set to true once a drag has started and false when done to make
59 //! sure the threshold isnt checked anymore once a drag is underway
63 void insertPress(const XButtonEvent
&e
);
64 void removePress(const XButtonEvent
&e
);
67 //! Constructs an Actions object
69 //! Destroys the Actions object
72 virtual void buttonPressHandler(const XButtonEvent
&e
);
73 virtual void buttonReleaseHandler(const XButtonEvent
&e
);
75 virtual void enterHandler(const XCrossingEvent
&e
);
76 virtual void leaveHandler(const XCrossingEvent
&e
);
78 virtual void keyPressHandler(const XKeyEvent
&e
);
79 virtual void keyReleaseHandler(const XKeyEvent
&e
);
81 virtual void motionHandler(const XMotionEvent
&e
);
84 virtual void xkbHandler(const XkbEvent
&e
);
91 #endif // __actions_hh