diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-20 23:03:30 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-20 23:03:30 +0100 |
commit | 28b06f7e5bce72e6210667965e23a19430f184bf (patch) | |
tree | 23f76c9b4fb34782dda9df6c5507dbd3b856f59d /src | |
parent | 11b0c18dacbb46541ce0d22e0498abac38d30f7b (diff) | |
download | usdx-28b06f7e5bce72e6210667965e23a19430f184bf.tar.gz usdx-28b06f7e5bce72e6210667965e23a19430f184bf.tar.xz usdx-28b06f7e5bce72e6210667965e23a19430f184bf.zip |
menu/drawable_control: add signals for mouse events
Diffstat (limited to 'src')
-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; + }; }; |