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