1 // -*- mode: C++; indent-tabs-mode: nil; -*-
6 @brief The action interface for user-available actions
9 #include "otk/point.hh"
10 #include "otk/rect.hh"
11 #include "otk/eventhandler.hh"
19 //! The action interface for user-available actions
21 When these actions are fired, hooks to the guile engine are fired so that
24 class OBActions
: public otk::OtkEventHandler
{
36 struct ButtonReleaseAction
{
40 ButtonReleaseAction() { win
= 0; button
= 0; time
= 0; }
43 struct ButtonPressAction
{
47 ButtonPressAction() { button
= 0; }
51 // milliseconds XXX: config option
52 static const unsigned int DOUBLECLICKDELAY
;
53 static const int BUTTONS
= 5;
55 //! The mouse button currently being watched from a press for a CLICK
57 //! The last button release processed for CLICKs
58 ButtonReleaseAction _release
;
59 //! The point where the mouse was when each mouse button was pressed
61 Used for motion events as the starting position.
63 ButtonPressAction
*_posqueue
[BUTTONS
];
64 //! The delta x/y of the last motion sequence
67 //! Insert a button/position in the _posqueue
68 void insertPress(const XButtonEvent
&e
);
69 //! Remove a button/position from the _posqueue
70 void removePress(const XButtonEvent
&e
);
73 //! Constructs an OBActions object
75 //! Destroys the OBActions object
78 virtual void buttonPressHandler(const XButtonEvent
&e
);
79 virtual void buttonReleaseHandler(const XButtonEvent
&e
);
81 virtual void enterHandler(const XCrossingEvent
&e
);
82 virtual void leaveHandler(const XCrossingEvent
&e
);
84 virtual void keyPressHandler(const XKeyEvent
&e
);
86 virtual void motionHandler(const XMotionEvent
&e
);
91 #endif // __actions_hh