diff options
-rw-r--r-- | src/menu/drawable_control.cpp | 7 | ||||
-rw-r--r-- | src/menu/drawable_control.hpp | 11 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/menu/drawable_control.cpp b/src/menu/drawable_control.cpp index 1793981c..f30980cb 100644 --- a/src/menu/drawable_control.cpp +++ b/src/menu/drawable_control.cpp @@ -267,29 +267,36 @@ namespace usdx void DrawableControl::mouse_move(const Point<int>& p) { + on_mouse_move(p); } void DrawableControl::mouse_down(uint8_t button, const Point<int>& p) { + on_mouse_down(button, p); } void DrawableControl::mouse_up(uint8_t button, const Point<int>& p) { + on_mouse_up(button, p); } void DrawableControl::mouse_enter(void) { + on_mouse_enter(); } void DrawableControl::mouse_leave(void) { + on_mouse_leave(); } void DrawableControl::mouse_click(uint8_t button, const Point<int>& p) { + on_mouse_click(button, p); } void DrawableControl::mouse_dbl_click(uint8_t button, const Point<int>& p) { + on_mouse_dbl_click(button, p); } }; diff --git a/src/menu/drawable_control.hpp b/src/menu/drawable_control.hpp index bac1ccfb..0aa64cb8 100644 --- a/src/menu/drawable_control.hpp +++ b/src/menu/drawable_control.hpp @@ -27,6 +27,7 @@ #include <SDL/SDL.h> #include <boost/thread/shared_mutex.hpp> +#include <boost/signals2.hpp> #include <log4cpp/Category.hh> #include "drawable.hpp" @@ -150,6 +151,16 @@ namespace usdx virtual void mouse_click(uint8_t button, const Point<int>& p); virtual void mouse_dbl_click(uint8_t button, const Point<int>& p); + + boost::signals2::signal<void (const Point<int>&)> on_mouse_move; + boost::signals2::signal<void (uint8_t, const Point<int>&)> on_mouse_down; + boost::signals2::signal<void (uint8_t, const Point<int>&)> on_mouse_up; + boost::signals2::signal<void (void)> on_mouse_enter; + boost::signals2::signal<void (void)> on_mouse_leave; + + boost::signals2::signal<void (uint8_t, const Point<int>&)> on_mouse_click; + boost::signals2::signal<void (uint8_t, const Point<int>&)> on_mouse_dbl_click; + }; }; |