1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
6 @brief The action interface for user-available actions
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 OBActions
: public otk::OtkEventHandler
{
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
];
60 void insertPress(const XButtonEvent
&e
);
61 void removePress(const XButtonEvent
&e
);
64 //! Constructs an OBActions object
66 //! Destroys the OBActions object
69 virtual void buttonPressHandler(const XButtonEvent
&e
);
70 virtual void buttonReleaseHandler(const XButtonEvent
&e
);
72 virtual void enterHandler(const XCrossingEvent
&e
);
73 virtual void leaveHandler(const XCrossingEvent
&e
);
75 virtual void keyPressHandler(const XKeyEvent
&e
);
77 virtual void motionHandler(const XMotionEvent
&e
);
79 virtual void mapRequestHandler(const XMapRequestEvent
&e
);
80 virtual void unmapHandler(const XUnmapEvent
&e
);
81 virtual void destroyHandler(const XDestroyWindowEvent
&e
);
87 #endif // __actions_hh