diff options
| -rw-r--r-- | indra/llui/llaccordionctrltab.h | 3 | ||||
| -rw-r--r-- | indra/newview/llagentwearables.cpp | 18 | ||||
| -rw-r--r-- | indra/newview/llappearancemgr.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llfavoritesbar.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llfloatergesture.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llfloaterworldmap.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llfriendcard.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llimfloater.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 171 | ||||
| -rw-r--r-- | indra/newview/llinventoryfunctions.h | 214 | ||||
| -rw-r--r-- | indra/newview/llinventorymodel.cpp | 199 | ||||
| -rw-r--r-- | indra/newview/llinventorymodel.h | 229 | ||||
| -rw-r--r-- | indra/newview/llinventorypanel.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/lllandmarkactions.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llpanellandmarkinfo.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llpreviewgesture.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/lltooldraganddrop.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llviewerinventory.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llviewermenu.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llviewermessage.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llvoavatarself.cpp | 1 | 
21 files changed, 407 insertions, 443 deletions
| diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index 462ccc6d53..4b8b22405e 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -35,8 +35,9 @@  #include <string>  #include "llrect.h" +#include "lluictrl.h" +#include "lluicolor.h" -class LLUICtrl;  class LLUICtrlFactory;  class LLUIImage;  class LLButton; diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 1fb4cff31a..36c03aca57 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -31,28 +31,28 @@   */  #include "llviewerprecompiledheaders.h" +#include "llagentwearables.h" +#include "llaccordionctrltab.h"  #include "llagent.h"  #include "llagentcamera.h" -#include "llagentwearables.h" - +#include "llappearancemgr.h"  #include "llcallbacklist.h"  #include "llfloatercustomize.h" +#include "llfolderview.h" +#include "llgesturemgr.h"  #include "llinventorybridge.h" +#include "llinventoryfunctions.h"  #include "llinventoryobserver.h"  #include "llinventorypanel.h"  #include "llnotificationsutil.h" +#include "llpaneloutfitsinventory.h" +#include "llsidetray.h" +#include "lltexlayer.h"  #include "llviewerregion.h"  #include "llvoavatarself.h"  #include "llwearable.h"  #include "llwearablelist.h" -#include "llgesturemgr.h" -#include "llappearancemgr.h" -#include "lltexlayer.h" -#include "llsidetray.h" -#include "llpaneloutfitsinventory.h" -#include "llfolderview.h" -#include "llaccordionctrltab.h"  #include <boost/scoped_ptr.hpp> diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 80d24f75b9..5b034b53c0 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -39,6 +39,7 @@  #include "llfloatercustomize.h"  #include "llgesturemgr.h"  #include "llinventorybridge.h" +#include "llinventoryfunctions.h"  #include "llinventoryobserver.h"  #include "llnotificationsutil.h"  #include "llsidepanelappearance.h" diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index bf7c735488..ba92c33d59 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -31,7 +31,6 @@   */  #include "llviewerprecompiledheaders.h" -  #include "llfavoritesbar.h"  #include "llfloaterreg.h" @@ -47,6 +46,7 @@  #include "llclipboard.h"  #include "llinventoryclipboard.h"  #include "llinventorybridge.h" +#include "llinventoryfunctions.h"  #include "llfloaterworldmap.h"  #include "lllandmarkactions.h"  #include "llnotificationsutil.h" diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index bf03412696..5a332726b2 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -36,6 +36,7 @@  #include "llinventory.h"  #include "llinventorybridge.h" +#include "llinventoryfunctions.h"  #include "llinventorymodel.h"  #include "llinventoryclipboard.h" diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index f05bd8574f..f17c9765b9 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -51,6 +51,7 @@  //#include "llfirstuse.h"  #include "llfloaterreg.h"		// getTypedInstance()  #include "llfocusmgr.h" +#include "llinventoryfunctions.h"  #include "llinventorymodel.h"  #include "llinventorymodelbackgroundfetch.h"  #include "llinventoryobserver.h" diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index 1a06bef6cb..a848128d67 100644 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -33,6 +33,7 @@  #include "llviewerprecompiledheaders.h"  #include "llinventory.h" +#include "llinventoryfunctions.h"  #include "llinventoryobserver.h"  #include "lltrans.h" diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 9c477791b3..3ec8d11fb0 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -44,6 +44,7 @@  #include "llchiclet.h"  #include "llfloaterreg.h"  #include "llimfloatercontainer.h" // to replace separate IM Floaters with multifloater container +#include "llinventoryfunctions.h"  #include "lllayoutstack.h"  #include "lllineeditor.h"  #include "lllogchat.h" diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 1e0abeadf1..ab2133d779 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -86,6 +86,177 @@  BOOL LLInventoryState::sWearNewClothing = FALSE;  LLUUID LLInventoryState::sWearNewClothingTransactionID; + +///---------------------------------------------------------------------------- +/// LLInventoryCollectFunctor implementations +///---------------------------------------------------------------------------- + +// static +bool LLInventoryCollectFunctor::itemTransferCommonlyAllowed(LLInventoryItem* item) +{ +	if (!item) +		return false; + +	bool allowed = false; + +	switch(item->getType()) +	{ +	case LLAssetType::AT_CALLINGCARD: +		// not allowed +		break; +		 +	case LLAssetType::AT_OBJECT: +		if (isAgentAvatarValid() && !gAgentAvatarp->isWearingAttachment(item->getUUID())) +		{ +			allowed = true; +		} +		break; +		 +	case LLAssetType::AT_BODYPART: +	case LLAssetType::AT_CLOTHING: +		if(!gAgentWearables.isWearingItem(item->getUUID())) +		{ +			allowed = true; +		} +		break; +		 +	default: +		allowed = true; +		break; +	} + +	return allowed; +} + +bool LLIsType::operator()(LLInventoryCategory* cat, LLInventoryItem* item) +{ +	if(mType == LLAssetType::AT_CATEGORY) +	{ +		if(cat) return TRUE; +	} +	if(item) +	{ +		if(item->getType() == mType) return TRUE; +	} +	return FALSE; +} + +bool LLIsNotType::operator()(LLInventoryCategory* cat, LLInventoryItem* item) +{ +	if(mType == LLAssetType::AT_CATEGORY) +	{ +		if(cat) return FALSE; +	} +	if(item) +	{ +		if(item->getType() == mType) return FALSE; +		else return TRUE; +	} +	return TRUE; +} + +bool LLIsTypeWithPermissions::operator()(LLInventoryCategory* cat, LLInventoryItem* item) +{ +	if(mType == LLAssetType::AT_CATEGORY) +	{ +		if(cat)  +		{ +			return TRUE; +		} +	} +	if(item) +	{ +		if(item->getType() == mType) +		{ +			LLPermissions perm = item->getPermissions(); +			if ((perm.getMaskBase() & mPerm) == mPerm) +			{ +				return TRUE; +			} +		} +	} +	return FALSE; +} + +bool LLBuddyCollector::operator()(LLInventoryCategory* cat, +								  LLInventoryItem* item) +{ +	if(item) +	{ +		if((LLAssetType::AT_CALLINGCARD == item->getType()) +		   && (!item->getCreatorUUID().isNull()) +		   && (item->getCreatorUUID() != gAgent.getID())) +		{ +			return true; +		} +	} +	return false; +} + + +bool LLUniqueBuddyCollector::operator()(LLInventoryCategory* cat, +										LLInventoryItem* item) +{ +	if(item) +	{ +		if((LLAssetType::AT_CALLINGCARD == item->getType()) + 		   && (item->getCreatorUUID().notNull()) + 		   && (item->getCreatorUUID() != gAgent.getID())) +		{ +			mSeen.insert(item->getCreatorUUID()); +			return true; +		} +	} +	return false; +} + + +bool LLParticularBuddyCollector::operator()(LLInventoryCategory* cat, +											LLInventoryItem* item) +{ +	if(item) +	{ +		if((LLAssetType::AT_CALLINGCARD == item->getType()) +		   && (item->getCreatorUUID() == mBuddyID)) +		{ +			return TRUE; +		} +	} +	return FALSE; +} + + +bool LLNameCategoryCollector::operator()( +	LLInventoryCategory* cat, LLInventoryItem* item) +{ +	if(cat) +	{ +		if (!LLStringUtil::compareInsensitive(mName, cat->getName())) +		{ +			return true; +		} +	} +	return false; +} + +///---------------------------------------------------------------------------- +/// LLAssetIDMatches  +///---------------------------------------------------------------------------- +bool LLAssetIDMatches::operator()(LLInventoryCategory* cat, LLInventoryItem* item) +{ +	return (item && item->getAssetUUID() == mAssetID); +} + +///---------------------------------------------------------------------------- +/// LLLinkedItemIDMatches  +///---------------------------------------------------------------------------- +bool LLLinkedItemIDMatches::operator()(LLInventoryCategory* cat, LLInventoryItem* item) +{ +	return (item &&  +			(item->getIsLinkType()) && +			(item->getLinkedUUID() == mBaseItemID)); // A linked item's assetID will be the compared-to item's itemID. +} +  void LLSaveFolderState::setApply(BOOL apply)  {  	mApply = apply;  diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 968db84819..eb33763670 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -38,15 +38,221 @@  #include "llfolderview.h"  #include "llfolderviewitem.h" +/******************************************************************************** + **                                                                            ** + **                    INVENTORY COLLECTOR FUNCTIONS + **/ + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryCollectFunctor +// +// Base class for LLInventoryModel::collectDescendentsIf() method +// which accepts an instance of one of these objects to use as the +// function to determine if it should be added. Derive from this class +// and override the () operator to return TRUE if you want to collect +// the category or item passed in. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLInventoryCollectFunctor +{ +public: +	virtual ~LLInventoryCollectFunctor(){}; +	virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) = 0; + +	static bool itemTransferCommonlyAllowed(LLInventoryItem* item); +}; + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLAssetIDMatches +// +// This functor finds inventory items pointing to the specified asset +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLViewerInventoryItem; + +class LLAssetIDMatches : public LLInventoryCollectFunctor +{ +public: +	LLAssetIDMatches(const LLUUID& asset_id) : mAssetID(asset_id) {} +	virtual ~LLAssetIDMatches() {} +	bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); +	 +protected: +	LLUUID mAssetID; +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLLinkedItemIDMatches +// +// This functor finds inventory items linked to the specific inventory id. +// Assumes the inventory id is itself not a linked item. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLLinkedItemIDMatches : public LLInventoryCollectFunctor +{ +public: +	LLLinkedItemIDMatches(const LLUUID& item_id) : mBaseItemID(item_id) {} +	virtual ~LLLinkedItemIDMatches() {} +	bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); +	 +protected: +	LLUUID mBaseItemID; +}; +  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLIsType  // -// This is a collection of miscellaneous functions and classes -// that don't fit cleanly into any other class header.  Eventually, -// we should figure out where to put these functions so that we can -// get rid of this generic file. +// Implementation of a LLInventoryCollectFunctor which returns TRUE if +// the type is the type passed in during construction. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLIsType : public LLInventoryCollectFunctor +{ +public: +	LLIsType(LLAssetType::EType type) : mType(type) {} +	virtual ~LLIsType() {} +	virtual bool operator()(LLInventoryCategory* cat, +							LLInventoryItem* item); +protected: +	LLAssetType::EType mType; +}; + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLIsNotType  // +// Implementation of a LLInventoryCollectFunctor which returns FALSE if the +// type is the type passed in during construction, otherwise false.  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLIsNotType : public LLInventoryCollectFunctor +{ +public: +	LLIsNotType(LLAssetType::EType type) : mType(type) {} +	virtual ~LLIsNotType() {} +	virtual bool operator()(LLInventoryCategory* cat, +							LLInventoryItem* item); +protected: +	LLAssetType::EType mType; +}; + +class LLIsTypeWithPermissions : public LLInventoryCollectFunctor +{ +public: +	LLIsTypeWithPermissions(LLAssetType::EType type, const PermissionBit perms, const LLUUID &agent_id, const LLUUID &group_id)  +		: mType(type), mPerm(perms), mAgentID(agent_id), mGroupID(group_id) {} +	virtual ~LLIsTypeWithPermissions() {} +	virtual bool operator()(LLInventoryCategory* cat, +							LLInventoryItem* item); +protected: +	LLAssetType::EType mType; +	PermissionBit mPerm; +	LLUUID			mAgentID; +	LLUUID			mGroupID; +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLBuddyCollector +// +// Simple class that collects calling cards that are not null, and not +// the agent. Duplicates are possible. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLBuddyCollector : public LLInventoryCollectFunctor +{ +public: +	LLBuddyCollector() {} +	virtual ~LLBuddyCollector() {} +	virtual bool operator()(LLInventoryCategory* cat, +							LLInventoryItem* item); +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLUniqueBuddyCollector +// +// Simple class that collects calling cards that are not null, and not +// the agent. Duplicates are discarded. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLUniqueBuddyCollector : public LLInventoryCollectFunctor +{ +public: +	LLUniqueBuddyCollector() {} +	virtual ~LLUniqueBuddyCollector() {} +	virtual bool operator()(LLInventoryCategory* cat, +							LLInventoryItem* item); + +protected: +	std::set<LLUUID> mSeen; +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLParticularBuddyCollector +// +// Simple class that collects calling cards that match a particular uuid +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLParticularBuddyCollector : public LLInventoryCollectFunctor +{ +public: +	LLParticularBuddyCollector(const LLUUID& id) : mBuddyID(id) {} +	virtual ~LLParticularBuddyCollector() {} +	virtual bool operator()(LLInventoryCategory* cat, +							LLInventoryItem* item); +protected: +	LLUUID mBuddyID; +}; + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLNameCategoryCollector +// +// Collects categories based on case-insensitive match of prefix +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLNameCategoryCollector : public LLInventoryCollectFunctor +{ +public: +	LLNameCategoryCollector(const std::string& name) : mName(name) {} +	virtual ~LLNameCategoryCollector() {} +	virtual bool operator()(LLInventoryCategory* cat, +							LLInventoryItem* item); +protected: +	std::string mName; +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLFindCOFValidItems +// +// Collects items that can be legitimately linked to in the COF. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLFindCOFValidItems : public LLInventoryCollectFunctor +{ +public: +	LLFindCOFValidItems() {} +	virtual ~LLFindCOFValidItems() {} +	virtual bool operator()(LLInventoryCategory* cat, +							LLInventoryItem* item); +	 +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLFindWearables +// +// Collects wearables based on item type. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLFindWearables : public LLInventoryCollectFunctor +{ +public: +	LLFindWearables() {} +	virtual ~LLFindWearables() {} +	virtual bool operator()(LLInventoryCategory* cat, +							LLInventoryItem* item); +}; + +/**                    Inventory Collector Functions + **                                                                            ** + *******************************************************************************/ +  class LLInventoryState  {  public: diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 96b9bbb725..d1cc0ae936 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -3212,205 +3212,6 @@ void LLInventoryModel::dumpInventory() const  }  ///---------------------------------------------------------------------------- -/// LLInventoryCollectFunctor implementations -///---------------------------------------------------------------------------- - -// static -bool LLInventoryCollectFunctor::itemTransferCommonlyAllowed(LLInventoryItem* item) -{ -	if (!item) -		return false; - -	bool allowed = false; - -	switch(item->getType()) -	{ -	case LLAssetType::AT_CALLINGCARD: -		// not allowed -		break; -		 -	case LLAssetType::AT_OBJECT: -		if (isAgentAvatarValid() && !gAgentAvatarp->isWearingAttachment(item->getUUID())) -		{ -			allowed = true; -		} -		break; -		 -	case LLAssetType::AT_BODYPART: -	case LLAssetType::AT_CLOTHING: -		if(!gAgentWearables.isWearingItem(item->getUUID())) -		{ -			allowed = true; -		} -		break; -		 -	default: -		allowed = true; -		break; -	} - -	return allowed; -} - -bool LLIsType::operator()(LLInventoryCategory* cat, LLInventoryItem* item) -{ -	if(mType == LLAssetType::AT_CATEGORY) -	{ -		if(cat) return TRUE; -	} -	if(item) -	{ -		if(item->getType() == mType) return TRUE; -	} -	return FALSE; -} - -bool LLIsNotType::operator()(LLInventoryCategory* cat, LLInventoryItem* item) -{ -	if(mType == LLAssetType::AT_CATEGORY) -	{ -		if(cat) return FALSE; -	} -	if(item) -	{ -		if(item->getType() == mType) return FALSE; -		else return TRUE; -	} -	return TRUE; -} - -bool LLIsTypeWithPermissions::operator()(LLInventoryCategory* cat, LLInventoryItem* item) -{ -	if(mType == LLAssetType::AT_CATEGORY) -	{ -		if(cat)  -		{ -			return TRUE; -		} -	} -	if(item) -	{ -		if(item->getType() == mType) -		{ -			LLPermissions perm = item->getPermissions(); -			if ((perm.getMaskBase() & mPerm) == mPerm) -			{ -				return TRUE; -			} -		} -	} -	return FALSE; -} - - -//bool LLIsClone::operator()(LLInventoryCategory* cat, LLInventoryItem* item) -//{ -//	if(cat) return FALSE; -//	if(item) -//	{ -//		if(mItemMap->getType() == LLAssetType::AT_CALLINGCARD) -//		{ -//			if((item->getType() == LLAssetType::AT_CALLINGCARD) -//			   && !(item->getCreatorUUID().isNull()) -//			   && (item->getCreatorUUID() == mItemMap->getCreatorUUID())) -//			{ -//				return TRUE; -//			} -//		} -//		else -//		{ -//			if((item->getType() == mItemMap->getType()) -//			   && !(item->getAssetUUID().isNull()) -//			   && (item->getAssetUUID() == mItemMap->getAssetUUID()) -//			   && (item->getName() == mItemMap->getName())) -//			{ -//				return TRUE; -//			} -//		} -//	} -//	return FALSE; -//} - -bool LLBuddyCollector::operator()(LLInventoryCategory* cat, -								  LLInventoryItem* item) -{ -	if(item) -	{ -		if((LLAssetType::AT_CALLINGCARD == item->getType()) -		   && (!item->getCreatorUUID().isNull()) -		   && (item->getCreatorUUID() != gAgent.getID())) -		{ -			return true; -		} -	} -	return false; -} - - -bool LLUniqueBuddyCollector::operator()(LLInventoryCategory* cat, -										LLInventoryItem* item) -{ -	if(item) -	{ -		if((LLAssetType::AT_CALLINGCARD == item->getType()) - 		   && (item->getCreatorUUID().notNull()) - 		   && (item->getCreatorUUID() != gAgent.getID())) -		{ -			mSeen.insert(item->getCreatorUUID()); -			return true; -		} -	} -	return false; -} - - -bool LLParticularBuddyCollector::operator()(LLInventoryCategory* cat, -											LLInventoryItem* item) -{ -	if(item) -	{ -		if((LLAssetType::AT_CALLINGCARD == item->getType()) -		   && (item->getCreatorUUID() == mBuddyID)) -		{ -			return TRUE; -		} -	} -	return FALSE; -} - - -bool LLNameCategoryCollector::operator()( -	LLInventoryCategory* cat, LLInventoryItem* item) -{ -	if(cat) -	{ -		if (!LLStringUtil::compareInsensitive(mName, cat->getName())) -		{ -			return true; -		} -	} -	return false; -} - -///---------------------------------------------------------------------------- -/// LLAssetIDMatches  -///---------------------------------------------------------------------------- -bool LLAssetIDMatches::operator()(LLInventoryCategory* cat, LLInventoryItem* item) -{ -	return (item && item->getAssetUUID() == mAssetID); -} - -///---------------------------------------------------------------------------- -/// LLLinkedItemIDMatches  -///---------------------------------------------------------------------------- -bool LLLinkedItemIDMatches::operator()(LLInventoryCategory* cat, LLInventoryItem* item) -{ -	return (item &&  -			(item->getIsLinkType()) && -			(item->getLinkedUUID() == mBaseItemID)); // A linked item's assetID will be the compared-to item's itemID. -} - -///----------------------------------------------------------------------------  /// Local function definitions  ///---------------------------------------------------------------------------- diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 700e5317f7..b7c1b57397 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -534,234 +534,5 @@ private:  // a special inventory model for the agent  extern LLInventoryModel gInventory; -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryCollectFunctor -// -// Base class for LLInventoryModel::collectDescendentsIf() method -// which accepts an instance of one of these objects to use as the -// function to determine if it should be added. Derive from this class -// and override the () operator to return TRUE if you want to collect -// the category or item passed in. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLInventoryCollectFunctor -{ -public: -	virtual ~LLInventoryCollectFunctor(){}; -	virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) = 0; - -	static bool itemTransferCommonlyAllowed(LLInventoryItem* item); -}; - - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLAssetIDMatches -// -// This functor finds inventory items pointing to the specified asset -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLViewerInventoryItem; - -class LLAssetIDMatches : public LLInventoryCollectFunctor -{ -public: -	LLAssetIDMatches(const LLUUID& asset_id) : mAssetID(asset_id) {} -	virtual ~LLAssetIDMatches() {} -	bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); -	 -protected: -	LLUUID mAssetID; -}; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLLinkedItemIDMatches -// -// This functor finds inventory items linked to the specific inventory id. -// Assumes the inventory id is itself not a linked item. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLLinkedItemIDMatches : public LLInventoryCollectFunctor -{ -public: -	LLLinkedItemIDMatches(const LLUUID& item_id) : mBaseItemID(item_id) {} -	virtual ~LLLinkedItemIDMatches() {} -	bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); -	 -protected: -	LLUUID mBaseItemID; -}; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLIsType -// -// Implementation of a LLInventoryCollectFunctor which returns TRUE if -// the type is the type passed in during construction. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLIsType : public LLInventoryCollectFunctor -{ -public: -	LLIsType(LLAssetType::EType type) : mType(type) {} -	virtual ~LLIsType() {} -	virtual bool operator()(LLInventoryCategory* cat, -							LLInventoryItem* item); -protected: -	LLAssetType::EType mType; -}; - - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLIsNotType -// -// Implementation of a LLInventoryCollectFunctor which returns FALSE if the -// type is the type passed in during construction, otherwise false. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLIsNotType : public LLInventoryCollectFunctor -{ -public: -	LLIsNotType(LLAssetType::EType type) : mType(type) {} -	virtual ~LLIsNotType() {} -	virtual bool operator()(LLInventoryCategory* cat, -							LLInventoryItem* item); -protected: -	LLAssetType::EType mType; -}; - -class LLIsTypeWithPermissions : public LLInventoryCollectFunctor -{ -public: -	LLIsTypeWithPermissions(LLAssetType::EType type, const PermissionBit perms, const LLUUID &agent_id, const LLUUID &group_id)  -		: mType(type), mPerm(perms), mAgentID(agent_id), mGroupID(group_id) {} -	virtual ~LLIsTypeWithPermissions() {} -	virtual bool operator()(LLInventoryCategory* cat, -							LLInventoryItem* item); -protected: -	LLAssetType::EType mType; -	PermissionBit mPerm; -	LLUUID			mAgentID; -	LLUUID			mGroupID; -}; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLIsClone -// -// Implementation of a LLInventoryCollectFunctor which returns TRUE if -// the object is a clone of the item passed in during -// construction. -// -// *NOTE: Since clone information is determined based off of asset id -// (or creator with calling cards), if the id is NULL, it has no -// clones - even itself. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -//class LLIsClone : public LLInventoryCollectFunctor -//{ -//public: -//	LLIsClone(LLViewerInventoryItem* item) : mItem(item) {} -//	virtual ~LLIsClone() {} -//	virtual bool operator()(LLViewerInventoryCategory* cat, -//							LLViewerInventoryItem* item); -//protected: -//	LLPointer<LLViewerInventoryItem> mItem; -//}; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLBuddyCollector -// -// Simple class that collects calling cards that are not null, and not -// the agent. Duplicates are possible. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLBuddyCollector : public LLInventoryCollectFunctor -{ -public: -	LLBuddyCollector() {} -	virtual ~LLBuddyCollector() {} -	virtual bool operator()(LLInventoryCategory* cat, -							LLInventoryItem* item); -}; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLUniqueBuddyCollector -// -// Simple class that collects calling cards that are not null, and not -// the agent. Duplicates are discarded. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLUniqueBuddyCollector : public LLInventoryCollectFunctor -{ -public: -	LLUniqueBuddyCollector() {} -	virtual ~LLUniqueBuddyCollector() {} -	virtual bool operator()(LLInventoryCategory* cat, -							LLInventoryItem* item); - -protected: -	std::set<LLUUID> mSeen; -}; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLParticularBuddyCollector -// -// Simple class that collects calling cards that match a particular uuid -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLParticularBuddyCollector : public LLInventoryCollectFunctor -{ -public: -	LLParticularBuddyCollector(const LLUUID& id) : mBuddyID(id) {} -	virtual ~LLParticularBuddyCollector() {} -	virtual bool operator()(LLInventoryCategory* cat, -							LLInventoryItem* item); -protected: -	LLUUID mBuddyID; -}; - - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLNameCategoryCollector -// -// Collects categories based on case-insensitive match of prefix -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLNameCategoryCollector : public LLInventoryCollectFunctor -{ -public: -	LLNameCategoryCollector(const std::string& name) : mName(name) {} -	virtual ~LLNameCategoryCollector() {} -	virtual bool operator()(LLInventoryCategory* cat, -							LLInventoryItem* item); -protected: -	std::string mName; -}; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLFindCOFValidItems -// -// Collects items that can be legitimately linked to in the COF. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLFindCOFValidItems : public LLInventoryCollectFunctor -{ -public: -	LLFindCOFValidItems() {} -	virtual ~LLFindCOFValidItems() {} -	virtual bool operator()(LLInventoryCategory* cat, -							LLInventoryItem* item); -	 -}; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLFindWearables -// -// Collects wearables based on item type. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLFindWearables : public LLInventoryCollectFunctor -{ -public: -	LLFindWearables() {} -	virtual ~LLFindWearables() {} -	virtual bool operator()(LLInventoryCategory* cat, -							LLInventoryItem* item); -}; -  #endif // LL_LLINVENTORYMODEL_H diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index f38659ba5f..83c2d62ee8 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -43,6 +43,7 @@  #include "llimfloater.h"  #include "llimview.h"  #include "llinventorybridge.h" +#include "llinventoryfunctions.h"  #include "llinventorymodelbackgroundfetch.h"  #include "llsidepanelinventory.h"  #include "llsidetray.h" diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index f25d2ef574..7336efb62a 100644 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -36,6 +36,7 @@  #include "roles_constants.h"  #include "llinventory.h" +#include "llinventoryfunctions.h"  #include "lllandmark.h"  #include "llparcel.h"  #include "llregionhandle.h" diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 143a64d08b..3dbe9a7f59 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -36,6 +36,7 @@  #include "llcombobox.h"  #include "lliconctrl.h" +#include "llinventoryfunctions.h"  #include "lllineeditor.h"  #include "lltextbox.h"  #include "lltexteditor.h" diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 77b72dc728..11cde47744 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -42,6 +42,7 @@  #include "llstring.h"  #include "lldir.h"  #include "llfloaterreg.h" +#include "llinventoryfunctions.h"  #include "llinventorymodelbackgroundfetch.h"  #include "llmultigesture.h"  #include "llnotificationsutil.h" diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 4f5eeb254b..394f550f2e 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -50,6 +50,7 @@  #include "llhudeffecttrail.h"  #include "llimview.h"  #include "llinventorybridge.h" +#include "llinventoryfunctions.h"  #include "llmutelist.h"  #include "llpreviewnotecard.h"  #include "llrecentpeople.h" diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 58d02be99a..b42d25c1d8 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -44,6 +44,7 @@  #include "llfolderview.h"  #include "llviewercontrol.h"  #include "llconsole.h" +#include "llinventoryfunctions.h"  #include "llinventorymodel.h"  #include "llinventorymodelbackgroundfetch.h"  #include "llgesturemgr.h" diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index fe924d68a5..3a6aed01ce 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -73,6 +73,7 @@  #include "llhudmanager.h"  #include "llimview.h"  #include "llinventorybridge.h" +#include "llinventoryfunctions.h"  #include "llpanellogin.h"  #include "llpanelblockedlist.h"  #include "llmenucommands.h" diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 42c8b4ee64..6dc0983f10 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -63,6 +63,7 @@  #include "llfloaterpreference.h"  #include "llhudeffecttrail.h"  #include "llhudmanager.h" +#include "llinventoryfunctions.h"  #include "llinventoryobserver.h"  #include "llinventorypanel.h"  #include "llnearbychat.h" diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 9c2e5461b2..fe6990eae9 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -48,6 +48,7 @@  #include "llagentwearables.h"  #include "llhudeffecttrail.h"  #include "llhudmanager.h" +#include "llinventoryfunctions.h"  #include "llselectmgr.h"  #include "lltoolgrab.h"	// for needsRenderBeam  #include "lltoolmgr.h" // for needsRenderBeam | 
