diff options
Diffstat (limited to 'indra/newview/lltoolpipette.h')
-rw-r--r-- | indra/newview/lltoolpipette.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/indra/newview/lltoolpipette.h b/indra/newview/lltoolpipette.h index 54c24e9467..3b6ebec67e 100644 --- a/indra/newview/lltoolpipette.h +++ b/indra/newview/lltoolpipette.h @@ -40,6 +40,8 @@ #include "lltool.h" #include "lltextureentry.h" +#include <boost/function.hpp> +#include <boost/signals2.hpp> class LLViewerObject; class LLPickInfo; @@ -56,18 +58,19 @@ public: virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect *sticky_rect_screen); - typedef void (*select_callback)(const LLTextureEntry& te, void *data); - void setSelectCallback(select_callback callback, void* user_data); + // Note: Don't return connection; use boost::bind + boost::signals2::trackable to disconnect slots + typedef boost::signals2::signal<void (const LLTextureEntry& te)> signal_t; + void setToolSelectCallback(const signal_t::slot_type& cb) { mSignal.connect(cb); } void setResult(BOOL success, const std::string& msg); - + + void setTextureEntry(const LLTextureEntry* entry); static void pickCallback(const LLPickInfo& pick_info); protected: LLTextureEntry mTextureEntry; - select_callback mSelectCallback; + signal_t mSignal; BOOL mSuccess; std::string mTooltipMsg; - void* mUserData; }; #endif //LL_LLTOOLPIPETTE_H |