diff options
Diffstat (limited to 'indra/newview/llviewerinventory.h')
-rwxr-xr-x[-rw-r--r--] | indra/newview/llviewerinventory.h | 75 |
1 files changed, 38 insertions, 37 deletions
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 7822ef4da6..13e95c57cb 100644..100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -242,59 +242,60 @@ public: virtual void fire(const LLUUID& inv_item) = 0; }; -class WearOnAvatarCallback : public LLInventoryCallback -{ -public: - WearOnAvatarCallback(bool do_replace = false) : mReplace(do_replace) {} - - void fire(const LLUUID& inv_item); +class LLViewerJointAttachment; -protected: - bool mReplace; -}; +void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp); -class ModifiedCOFCallback : public LLInventoryCallback -{ - void fire(const LLUUID& inv_item); -}; +void activate_gesture_cb(const LLUUID& inv_item); -class LLViewerJointAttachment; +void create_gesture_cb(const LLUUID& inv_item); -class RezAttachmentCallback : public LLInventoryCallback +class AddFavoriteLandmarkCallback : public LLInventoryCallback { public: - RezAttachmentCallback(LLViewerJointAttachment *attachmentp); - void fire(const LLUUID& inv_item); - -protected: - ~RezAttachmentCallback(); + AddFavoriteLandmarkCallback() : mTargetLandmarkId(LLUUID::null) {} + void setTargetLandmarkId(const LLUUID& target_uuid) { mTargetLandmarkId = target_uuid; } private: - LLViewerJointAttachment* mAttach; -}; - -class ActivateGestureCallback : public LLInventoryCallback -{ -public: void fire(const LLUUID& inv_item); -}; -class CreateGestureCallback : public LLInventoryCallback -{ -public: - void fire(const LLUUID& inv_item); + LLUUID mTargetLandmarkId; }; -class AddFavoriteLandmarkCallback : public LLInventoryCallback +typedef boost::function<void(const LLUUID&)> inventory_func_type; +void no_op_inventory_func(const LLUUID&); // A do-nothing inventory_func + +typedef boost::function<void()> nullary_func_type; +void no_op(); // A do-nothing nullary func. + +// Shim between inventory callback and boost function/callable +class LLBoostFuncInventoryCallback: public LLInventoryCallback { public: - AddFavoriteLandmarkCallback() : mTargetLandmarkId(LLUUID::null) {} - void setTargetLandmarkId(const LLUUID& target_uuid) { mTargetLandmarkId = target_uuid; } -private: - void fire(const LLUUID& inv_item); + LLBoostFuncInventoryCallback(inventory_func_type fire_func, + nullary_func_type destroy_func = no_op): + mFireFunc(fire_func), + mDestroyFunc(destroy_func) + { + } - LLUUID mTargetLandmarkId; + // virtual + void fire(const LLUUID& item_id) + { + mFireFunc(item_id); + } + + // virtual + ~LLBoostFuncInventoryCallback() + { + mDestroyFunc(); + } + + +private: + inventory_func_type mFireFunc; + nullary_func_type mDestroyFunc; }; // misc functions |