summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.h
diff options
context:
space:
mode:
authorCG Linden <cg@lindenlab.com>2010-01-26 13:44:24 -0800
committerCG Linden <cg@lindenlab.com>2010-01-26 13:44:24 -0800
commitb8856efd5ff0e4899bb369dfd0815e824cd3a432 (patch)
tree4c99369867ed9e58b69dfad4ba8ee3a2e9a17b9b /indra/newview/llappearancemgr.h
parent5fc9d8bddad16b7d8dc6d481107a8ce690fdf731 (diff)
parentfee564c26e1018787cf70b95fc677c1da447118c (diff)
Pulled from viewer-2-0
Diffstat (limited to 'indra/newview/llappearancemgr.h')
-rw-r--r--indra/newview/llappearancemgr.h48
1 files changed, 46 insertions, 2 deletions
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 20745b70e4..dd50b482cf 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -39,7 +39,7 @@
#include "llcallbacklist.h"
class LLWearable;
-struct LLWearableHoldingPattern;
+class LLWearableHoldingPattern;
class LLAppearanceManager: public LLSingleton<LLAppearanceManager>
{
@@ -59,7 +59,7 @@ public:
LLPointer<LLInventoryCallback> cb);
// Find the Current Outfit folder.
- LLUUID getCOF();
+ const LLUUID getCOF() const;
// Finds the folder link to the currently worn outfit
const LLViewerInventoryItem *getBaseOutfitLink();
@@ -132,6 +132,14 @@ private:
std::set<LLUUID> mRegisteredAttachments;
bool mAttachmentInvLinkEnabled;
bool mOutfitIsDirty;
+
+ //////////////////////////////////////////////////////////////////////////////////
+ // Item-specific convenience functions
+public:
+ // Is this in the COF?
+ BOOL getIsInCOF(const LLUUID& obj_id) const;
+ // Is this in the COF and can the user delete it from the COF?
+ BOOL getIsProtectedCOFItem(const LLUUID& obj_id) const;
};
#define SUPPORT_ENSEMBLES 0
@@ -168,4 +176,40 @@ void doOnIdle(T callable)
gIdleCallbacks.addFunction(&OnIdleCallback<T>::onIdle,cb_functor);
}
+// Shim class and template function to allow arbitrary boost::bind
+// expressions to be run as recurring idle callbacks.
+template <typename T>
+class OnIdleCallbackRepeating
+{
+public:
+ OnIdleCallbackRepeating(T callable):
+ mCallable(callable)
+ {
+ }
+ // Will keep getting called until the callable returns false.
+ static void onIdle(void *data)
+ {
+ OnIdleCallbackRepeating<T>* self = reinterpret_cast<OnIdleCallbackRepeating<T>*>(data);
+ bool done = self->call();
+ if (done)
+ {
+ gIdleCallbacks.deleteFunction(onIdle, data);
+ delete self;
+ }
+ }
+ bool call()
+ {
+ return mCallable();
+ }
+private:
+ T mCallable;
+};
+
+template <typename T>
+void doOnIdleRepeating(T callable)
+{
+ OnIdleCallbackRepeating<T>* cb_functor = new OnIdleCallbackRepeating<T>(callable);
+ gIdleCallbacks.addFunction(&OnIdleCallbackRepeating<T>::onIdle,cb_functor);
+}
+
#endif