summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerinventory.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerinventory.h')
-rwxr-xr-xindra/newview/llviewerinventory.h66
1 files changed, 23 insertions, 43 deletions
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index e2793ba105..1a427605b6 100755
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -242,48 +242,13 @@ 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);
-
-protected:
- bool mReplace;
-};
-
-class ModifiedCOFCallback : public LLInventoryCallback
-{
- void fire(const LLUUID& inv_item);
-};
-
class LLViewerJointAttachment;
-class RezAttachmentCallback : public LLInventoryCallback
-{
-public:
- RezAttachmentCallback(LLViewerJointAttachment *attachmentp);
- void fire(const LLUUID& inv_item);
+void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp);
-protected:
- ~RezAttachmentCallback();
+void activate_gesture_cb(const LLUUID& inv_item);
-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);
-};
+void create_gesture_cb(const LLUUID& inv_item);
class AddFavoriteLandmarkCallback : public LLInventoryCallback
{
@@ -297,25 +262,40 @@ private:
LLUUID mTargetLandmarkId;
};
-// Shim between inventory callback and boost function/callable
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:
- LLBoostFuncInventoryCallback(const inventory_func_type& func):
- mFunc(func)
+ LLBoostFuncInventoryCallback(inventory_func_type fire_func,
+ nullary_func_type destroy_func = no_op):
+ mFireFunc(fire_func),
+ mDestroyFunc(destroy_func)
{
}
+ // virtual
void fire(const LLUUID& item_id)
{
- mFunc(item_id);
+ mFireFunc(item_id);
}
+ // virtual
+ ~LLBoostFuncInventoryCallback()
+ {
+ mDestroyFunc;
+ }
+
+
private:
- inventory_func_type mFunc;
+ inventory_func_type mFireFunc;
+ nullary_func_type mDestroyFunc;
};
// misc functions