diff options
author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-05-22 19:04:52 +0200 |
---|---|---|
committer | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-05-22 19:04:52 +0200 |
commit | 1b67dd855c41f5a0cda7ec2a68d98071986ca703 (patch) | |
tree | ab243607f74f78200787bba5b9b88f07ef1b966f /indra/newview/lltooldraganddrop.h | |
parent | 6d6eabca44d08d5b97bfe3e941d2b9687c2246ea (diff) | |
parent | e1623bb276f83a43ce7a197e388720c05bdefe61 (diff) |
Merge remote-tracking branch 'origin/main' into DRTVWR-600-maint-A
# Conflicts:
# autobuild.xml
# indra/cmake/CMakeLists.txt
# indra/cmake/GoogleMock.cmake
# indra/llaudio/llaudioengine_fmodstudio.cpp
# indra/llaudio/llaudioengine_fmodstudio.h
# indra/llaudio/lllistener_fmodstudio.cpp
# indra/llaudio/lllistener_fmodstudio.h
# indra/llaudio/llstreamingaudio_fmodstudio.cpp
# indra/llaudio/llstreamingaudio_fmodstudio.h
# indra/llcharacter/llmultigesture.cpp
# indra/llcharacter/llmultigesture.h
# indra/llimage/llimage.cpp
# indra/llimage/llimagepng.cpp
# indra/llimage/llimageworker.cpp
# indra/llimage/tests/llimageworker_test.cpp
# indra/llmessage/tests/llmockhttpclient.h
# indra/llprimitive/llgltfmaterial.h
# indra/llrender/llfontfreetype.cpp
# indra/llui/llcombobox.cpp
# indra/llui/llfolderview.cpp
# indra/llui/llfolderviewmodel.h
# indra/llui/lllineeditor.cpp
# indra/llui/lllineeditor.h
# indra/llui/lltextbase.cpp
# indra/llui/lltextbase.h
# indra/llui/lltexteditor.cpp
# indra/llui/lltextvalidate.cpp
# indra/llui/lltextvalidate.h
# indra/llui/lluictrl.h
# indra/llui/llview.cpp
# indra/llwindow/llwindowmacosx.cpp
# indra/newview/app_settings/settings.xml
# indra/newview/llappearancemgr.cpp
# indra/newview/llappearancemgr.h
# indra/newview/llavatarpropertiesprocessor.cpp
# indra/newview/llavatarpropertiesprocessor.h
# indra/newview/llbreadcrumbview.cpp
# indra/newview/llbreadcrumbview.h
# indra/newview/llbreastmotion.cpp
# indra/newview/llbreastmotion.h
# indra/newview/llconversationmodel.h
# indra/newview/lldensityctrl.cpp
# indra/newview/lldensityctrl.h
# indra/newview/llface.inl
# indra/newview/llfloatereditsky.cpp
# indra/newview/llfloatereditwater.cpp
# indra/newview/llfloateremojipicker.h
# indra/newview/llfloaterimsessiontab.cpp
# indra/newview/llfloaterprofiletexture.cpp
# indra/newview/llfloaterprofiletexture.h
# indra/newview/llgesturemgr.cpp
# indra/newview/llgesturemgr.h
# indra/newview/llimpanel.cpp
# indra/newview/llimpanel.h
# indra/newview/llinventorybridge.cpp
# indra/newview/llinventorybridge.h
# indra/newview/llinventoryclipboard.cpp
# indra/newview/llinventoryclipboard.h
# indra/newview/llinventoryfunctions.cpp
# indra/newview/llinventoryfunctions.h
# indra/newview/llinventorygallery.cpp
# indra/newview/lllistbrowser.cpp
# indra/newview/lllistbrowser.h
# indra/newview/llpanelobjectinventory.cpp
# indra/newview/llpanelprofile.cpp
# indra/newview/llpanelprofile.h
# indra/newview/llpreviewgesture.cpp
# indra/newview/llsavedsettingsglue.cpp
# indra/newview/llsavedsettingsglue.h
# indra/newview/lltooldraganddrop.cpp
# indra/newview/llurllineeditorctrl.cpp
# indra/newview/llvectorperfoptions.cpp
# indra/newview/llvectorperfoptions.h
# indra/newview/llviewerparceloverlay.cpp
# indra/newview/llviewertexlayer.cpp
# indra/newview/llviewertexturelist.cpp
# indra/newview/macmain.h
# indra/test/test.cpp
Diffstat (limited to 'indra/newview/lltooldraganddrop.h')
-rw-r--r-- | indra/newview/lltooldraganddrop.h | 646 |
1 files changed, 323 insertions, 323 deletions
diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index d918a70267..8406928f18 100644 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -1,323 +1,323 @@ -/** - * @file lltooldraganddrop.h - * @brief LLToolDragAndDrop class header file - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_TOOLDRAGANDDROP_H -#define LL_TOOLDRAGANDDROP_H - -#include "lldictionary.h" -#include "lltool.h" -#include "llview.h" -#include "lluuid.h" -#include "llassetstorage.h" -#include "llpermissions.h" -#include "llwindow.h" -#include "llviewerinventory.h" - -class LLToolDragAndDrop; -class LLViewerRegion; -class LLVOAvatar; -class LLPickInfo; - -class LLToolDragAndDrop : public LLTool, public LLSingleton<LLToolDragAndDrop> -{ - LLSINGLETON(LLToolDragAndDrop); -public: - typedef boost::signals2::signal<void ()> enddrag_signal_t; - - // overridden from LLTool - virtual bool handleMouseUp(S32 x, S32 y, MASK mask) override; - virtual bool handleHover(S32 x, S32 y, MASK mask) override; - virtual bool handleKey(KEY key, MASK mask) override; - virtual bool handleToolTip(S32 x, S32 y, MASK mask) override; - virtual void onMouseCaptureLost() override; - virtual void handleDeselect() override; - - void setDragStart( S32 x, S32 y ); // In screen space - bool isOverThreshold( S32 x, S32 y ); // In screen space - - enum ESource - { - SOURCE_AGENT, - SOURCE_WORLD, - SOURCE_NOTECARD, - SOURCE_LIBRARY, - SOURCE_VIEWER, - SOURCE_PEOPLE - }; - - void beginDrag(EDragAndDropType type, - const LLUUID& cargo_id, - ESource source, - const LLUUID& source_id = LLUUID::null, - const LLUUID& object_id = LLUUID::null); - void beginMultiDrag(const std::vector<EDragAndDropType> types, - const uuid_vec_t& cargo_ids, - ESource source, - const LLUUID& source_id = LLUUID::null); - void endDrag(); - ESource getSource() const { return mSource; } - const LLUUID& getSourceID() const { return mSourceID; } - const LLUUID& getObjectID() const { return mObjectID; } - EAcceptance getLastAccept() { return mLastAccept; } - - boost::signals2::connection setEndDragCallback( const enddrag_signal_t::slot_type& cb ) { return mEndDragSignal.connect(cb); } - - void setCargoCount(U32 count) { mCargoCount = count; } - void resetCargoCount() { mCargoCount = 0; } - U32 getCargoCount() const { return (mCargoCount > 0) ? mCargoCount : mCargoIDs.size(); } - S32 getCargoIndex() const { return mCurItemIndex; } - - static S32 getOperationId() { return sOperationId; } - - // deal with permissions of object, etc. returns true if drop can - // proceed, otherwise false. - static bool handleDropMaterialProtections(LLViewerObject* hit_obj, - LLInventoryItem* item, - LLToolDragAndDrop::ESource source, - const LLUUID& src_id); - -protected: - enum EDropTarget - { - DT_NONE = 0, - DT_SELF = 1, - DT_AVATAR = 2, - DT_OBJECT = 3, - DT_LAND = 4, - DT_COUNT = 5 - }; - -protected: - // dragOrDrop3dImpl points to a member of LLToolDragAndDrop that - // takes parameters (LLViewerObject* obj, S32 face, MASK, bool - // drop) and returns a bool if drop is ok - typedef EAcceptance (LLToolDragAndDrop::*dragOrDrop3dImpl) - (LLViewerObject*, S32, MASK, bool); - - void dragOrDrop(S32 x, S32 y, MASK mask, bool drop, - EAcceptance* acceptance); - void dragOrDrop3D(S32 x, S32 y, MASK mask, bool drop, - EAcceptance* acceptance); - - static void pickCallback(const LLPickInfo& pick_info); - void pick(const LLPickInfo& pick_info); - -protected: - - U32 mCargoCount; - - S32 mDragStartX; - S32 mDragStartY; - - std::vector<EDragAndDropType> mCargoTypes; - //void* mCargoData; - uuid_vec_t mCargoIDs; - ESource mSource; - LLUUID mSourceID; - LLUUID mObjectID; - - static S32 sOperationId; - - LLVector3d mLastCameraPos; - LLVector3d mLastHitPos; - - ECursorType mCursor; - EAcceptance mLastAccept; - bool mDrop; - S32 mCurItemIndex; - std::string mToolTipMsg; - std::string mCustomMsg; - - enddrag_signal_t mEndDragSignal; - -protected: - // 3d drop functions. these call down into the static functions - // named drop<ThingToDrop> if drop is true and permissions allow - // that behavior. - EAcceptance dad3dNULL(LLViewerObject*, S32, MASK, bool); - EAcceptance dad3dRezObjectOnLand(LLViewerObject* obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dRezObjectOnObject(LLViewerObject* obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dRezCategoryOnObject(LLViewerObject* obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dRezScript(LLViewerObject* obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dTextureObject(LLViewerObject* obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dMaterialObject(LLViewerObject* obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dMeshObject(LLViewerObject* obj, S32 face, - MASK mask, bool drop); -// EAcceptance dad3dTextureSelf(LLViewerObject* obj, S32 face, -// MASK mask, bool drop); - EAcceptance dad3dWearItem(LLViewerObject* obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dWearCategory(LLViewerObject* obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dUpdateInventory(LLViewerObject* obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dUpdateInventoryCategory(LLViewerObject* obj, - S32 face, - MASK mask, - bool drop); - EAcceptance dad3dGiveInventoryObject(LLViewerObject* obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dGiveInventory(LLViewerObject* obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dGiveInventoryCategory(LLViewerObject* obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dRezFromObjectOnLand(LLViewerObject* obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dRezFromObjectOnObject(LLViewerObject* obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dRezAttachmentFromInv(LLViewerObject* obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dCategoryOnLand(LLViewerObject *obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dAssetOnLand(LLViewerObject *obj, S32 face, - MASK mask, bool drop); - EAcceptance dad3dActivateGesture(LLViewerObject *obj, S32 face, - MASK mask, bool drop); - - // helper called by methods above to handle "application" of an item - // to an object (texture applied to face, mesh applied to shape, etc.) - EAcceptance dad3dApplyToObject(LLViewerObject* obj, S32 face, MASK mask, bool drop, EDragAndDropType cargo_type); - - - // set the LLToolDragAndDrop's cursor based on the given acceptance - ECursorType acceptanceToCursor( EAcceptance acceptance ); - - // This method converts mCargoID to an inventory item or - // folder. If no item or category is found, both pointers will be - // returned NULL. - LLInventoryObject* locateInventory(LLViewerInventoryItem*& item, - LLViewerInventoryCategory*& cat); - - //LLInventoryObject* locateMultipleInventory( - // LLViewerInventoryCategory::cat_array_t& cats, - // LLViewerInventoryItem::item_array_t& items); - - void dropObject(LLViewerObject* raycast_target, - bool bypass_sim_raycast, - bool from_task_inventory, - bool remove_from_inventory); - - // accessor that looks at permissions, copyability, and names of - // inventory items to determine if a drop would be ok. - static EAcceptance willObjectAcceptInventory(LLViewerObject* obj, LLInventoryItem* item, EDragAndDropType type = DAD_NONE); - -public: - // helper functions - static bool isInventoryDropAcceptable(LLViewerObject* obj, LLInventoryItem* item) { return (ACCEPT_YES_COPY_SINGLE <= willObjectAcceptInventory(obj, item)); } - - bool dadUpdateInventory(LLViewerObject* obj, bool drop); - bool dadUpdateInventoryCategory(LLViewerObject* obj, bool drop); - - // methods that act on the simulator state. - static void dropScript(LLViewerObject* hit_obj, - LLInventoryItem* item, - bool active, - ESource source, - const LLUUID& src_id); - static void dropTexture(LLViewerObject* hit_obj, - S32 hit_face, - LLInventoryItem* item, - ESource source, - const LLUUID& src_id, - bool all_faces, - bool replace_pbr, - S32 tex_channel = -1); - static void dropTextureOneFace(LLViewerObject* hit_obj, - S32 hit_face, - LLInventoryItem* item, - ESource source, - const LLUUID& src_id, - bool remove_pbr, - S32 tex_channel = -1); - static void dropTextureAllFaces(LLViewerObject* hit_obj, - LLInventoryItem* item, - ESource source, - const LLUUID& src_id, - bool remove_pbr); - static void dropMaterial(LLViewerObject* hit_obj, - S32 hit_face, - LLInventoryItem* item, - ESource source, - const LLUUID& src_id, - bool all_faces); - static void dropMaterialOneFace(LLViewerObject* hit_obj, - S32 hit_face, - LLInventoryItem* item, - ESource source, - const LLUUID& src_id); - static void dropMaterialAllFaces(LLViewerObject* hit_obj, - LLInventoryItem* item, - ESource source, - const LLUUID& src_id); - static void dropMesh(LLViewerObject* hit_obj, - LLInventoryItem* item, - ESource source, - const LLUUID& src_id); - - //static void dropTextureOneFaceAvatar(LLVOAvatar* avatar,S32 hit_face, - // LLInventoryItem* item) - - static void dropInventory(LLViewerObject* hit_obj, - LLInventoryItem* item, - ESource source, - const LLUUID& src_id); - - static bool handleGiveDragAndDrop(LLUUID agent, LLUUID session, bool drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - const LLSD& dest = LLSD()); - - // Classes used for determining 3d drag and drop types. -private: - struct DragAndDropEntry : public LLDictionaryEntry - { - DragAndDropEntry(dragOrDrop3dImpl f_none, - dragOrDrop3dImpl f_self, - dragOrDrop3dImpl f_avatar, - dragOrDrop3dImpl f_object, - dragOrDrop3dImpl f_land); - dragOrDrop3dImpl mFunctions[DT_COUNT]; - }; - class LLDragAndDropDictionary : public LLSingleton<LLDragAndDropDictionary>, - public LLDictionary<EDragAndDropType, DragAndDropEntry> - { - LLSINGLETON(LLDragAndDropDictionary); - public: - dragOrDrop3dImpl get(EDragAndDropType dad_type, EDropTarget drop_target); - }; -}; - -// utility functions -void pack_permissions_slam(LLMessageSystem* msg, U32 flags, const LLPermissions& perms); - -#endif // LL_TOOLDRAGANDDROP_H +/**
+ * @file lltooldraganddrop.h
+ * @brief LLToolDragAndDrop class header file
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_TOOLDRAGANDDROP_H
+#define LL_TOOLDRAGANDDROP_H
+
+#include "lldictionary.h"
+#include "lltool.h"
+#include "llview.h"
+#include "lluuid.h"
+#include "llassetstorage.h"
+#include "llpermissions.h"
+#include "llwindow.h"
+#include "llviewerinventory.h"
+
+class LLToolDragAndDrop;
+class LLViewerRegion;
+class LLVOAvatar;
+class LLPickInfo;
+
+class LLToolDragAndDrop : public LLTool, public LLSingleton<LLToolDragAndDrop>
+{
+ LLSINGLETON(LLToolDragAndDrop);
+public:
+ typedef boost::signals2::signal<void ()> enddrag_signal_t;
+
+ // overridden from LLTool
+ virtual bool handleMouseUp(S32 x, S32 y, MASK mask) override;
+ virtual bool handleHover(S32 x, S32 y, MASK mask) override;
+ virtual bool handleKey(KEY key, MASK mask) override;
+ virtual bool handleToolTip(S32 x, S32 y, MASK mask) override;
+ virtual void onMouseCaptureLost() override;
+ virtual void handleDeselect() override;
+
+ void setDragStart( S32 x, S32 y ); // In screen space
+ bool isOverThreshold( S32 x, S32 y ); // In screen space
+
+ enum ESource
+ {
+ SOURCE_AGENT,
+ SOURCE_WORLD,
+ SOURCE_NOTECARD,
+ SOURCE_LIBRARY,
+ SOURCE_VIEWER,
+ SOURCE_PEOPLE
+ };
+
+ void beginDrag(EDragAndDropType type,
+ const LLUUID& cargo_id,
+ ESource source,
+ const LLUUID& source_id = LLUUID::null,
+ const LLUUID& object_id = LLUUID::null);
+ void beginMultiDrag(const std::vector<EDragAndDropType> types,
+ const uuid_vec_t& cargo_ids,
+ ESource source,
+ const LLUUID& source_id = LLUUID::null);
+ void endDrag();
+ ESource getSource() const { return mSource; }
+ const LLUUID& getSourceID() const { return mSourceID; }
+ const LLUUID& getObjectID() const { return mObjectID; }
+ EAcceptance getLastAccept() { return mLastAccept; }
+
+ boost::signals2::connection setEndDragCallback( const enddrag_signal_t::slot_type& cb ) { return mEndDragSignal.connect(cb); }
+
+ void setCargoCount(U32 count) { mCargoCount = count; }
+ void resetCargoCount() { mCargoCount = 0; }
+ U32 getCargoCount() const { return (mCargoCount > 0) ? mCargoCount : mCargoIDs.size(); }
+ S32 getCargoIndex() const { return mCurItemIndex; }
+
+ static S32 getOperationId() { return sOperationId; }
+
+ // deal with permissions of object, etc. returns true if drop can
+ // proceed, otherwise false.
+ static bool handleDropMaterialProtections(LLViewerObject* hit_obj,
+ LLInventoryItem* item,
+ LLToolDragAndDrop::ESource source,
+ const LLUUID& src_id);
+
+protected:
+ enum EDropTarget
+ {
+ DT_NONE = 0,
+ DT_SELF = 1,
+ DT_AVATAR = 2,
+ DT_OBJECT = 3,
+ DT_LAND = 4,
+ DT_COUNT = 5
+ };
+
+protected:
+ // dragOrDrop3dImpl points to a member of LLToolDragAndDrop that
+ // takes parameters (LLViewerObject* obj, S32 face, MASK, bool
+ // drop) and returns a bool if drop is ok
+ typedef EAcceptance (LLToolDragAndDrop::*dragOrDrop3dImpl)
+ (LLViewerObject*, S32, MASK, bool);
+
+ void dragOrDrop(S32 x, S32 y, MASK mask, bool drop,
+ EAcceptance* acceptance);
+ void dragOrDrop3D(S32 x, S32 y, MASK mask, bool drop,
+ EAcceptance* acceptance);
+
+ static void pickCallback(const LLPickInfo& pick_info);
+ void pick(const LLPickInfo& pick_info);
+
+protected:
+
+ U32 mCargoCount;
+
+ S32 mDragStartX;
+ S32 mDragStartY;
+
+ std::vector<EDragAndDropType> mCargoTypes;
+ //void* mCargoData;
+ uuid_vec_t mCargoIDs;
+ ESource mSource;
+ LLUUID mSourceID;
+ LLUUID mObjectID;
+
+ static S32 sOperationId;
+
+ LLVector3d mLastCameraPos;
+ LLVector3d mLastHitPos;
+
+ ECursorType mCursor;
+ EAcceptance mLastAccept;
+ bool mDrop;
+ S32 mCurItemIndex;
+ std::string mToolTipMsg;
+ std::string mCustomMsg;
+
+ enddrag_signal_t mEndDragSignal;
+
+protected:
+ // 3d drop functions. these call down into the static functions
+ // named drop<ThingToDrop> if drop is true and permissions allow
+ // that behavior.
+ EAcceptance dad3dNULL(LLViewerObject*, S32, MASK, bool);
+ EAcceptance dad3dRezObjectOnLand(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dRezObjectOnObject(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dRezCategoryOnObject(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dRezScript(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dTextureObject(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dMaterialObject(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dMeshObject(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+// EAcceptance dad3dTextureSelf(LLViewerObject* obj, S32 face,
+// MASK mask, bool drop);
+ EAcceptance dad3dWearItem(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dWearCategory(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dUpdateInventory(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dUpdateInventoryCategory(LLViewerObject* obj,
+ S32 face,
+ MASK mask,
+ bool drop);
+ EAcceptance dad3dGiveInventoryObject(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dGiveInventory(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dGiveInventoryCategory(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dRezFromObjectOnLand(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dRezFromObjectOnObject(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dRezAttachmentFromInv(LLViewerObject* obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dCategoryOnLand(LLViewerObject *obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dAssetOnLand(LLViewerObject *obj, S32 face,
+ MASK mask, bool drop);
+ EAcceptance dad3dActivateGesture(LLViewerObject *obj, S32 face,
+ MASK mask, bool drop);
+
+ // helper called by methods above to handle "application" of an item
+ // to an object (texture applied to face, mesh applied to shape, etc.)
+ EAcceptance dad3dApplyToObject(LLViewerObject* obj, S32 face, MASK mask, bool drop, EDragAndDropType cargo_type);
+
+
+ // set the LLToolDragAndDrop's cursor based on the given acceptance
+ ECursorType acceptanceToCursor( EAcceptance acceptance );
+
+ // This method converts mCargoID to an inventory item or
+ // folder. If no item or category is found, both pointers will be
+ // returned NULL.
+ LLInventoryObject* locateInventory(LLViewerInventoryItem*& item,
+ LLViewerInventoryCategory*& cat);
+
+ //LLInventoryObject* locateMultipleInventory(
+ // LLViewerInventoryCategory::cat_array_t& cats,
+ // LLViewerInventoryItem::item_array_t& items);
+
+ void dropObject(LLViewerObject* raycast_target,
+ bool bypass_sim_raycast,
+ bool from_task_inventory,
+ bool remove_from_inventory);
+
+ // accessor that looks at permissions, copyability, and names of
+ // inventory items to determine if a drop would be ok.
+ static EAcceptance willObjectAcceptInventory(LLViewerObject* obj, LLInventoryItem* item, EDragAndDropType type = DAD_NONE);
+
+public:
+ // helper functions
+ static bool isInventoryDropAcceptable(LLViewerObject* obj, LLInventoryItem* item) { return (ACCEPT_YES_COPY_SINGLE <= willObjectAcceptInventory(obj, item)); }
+
+ bool dadUpdateInventory(LLViewerObject* obj, bool drop);
+ bool dadUpdateInventoryCategory(LLViewerObject* obj, bool drop);
+
+ // methods that act on the simulator state.
+ static void dropScript(LLViewerObject* hit_obj,
+ LLInventoryItem* item,
+ bool active,
+ ESource source,
+ const LLUUID& src_id);
+ static void dropTexture(LLViewerObject* hit_obj,
+ S32 hit_face,
+ LLInventoryItem* item,
+ ESource source,
+ const LLUUID& src_id,
+ bool all_faces,
+ bool replace_pbr,
+ S32 tex_channel = -1);
+ static void dropTextureOneFace(LLViewerObject* hit_obj,
+ S32 hit_face,
+ LLInventoryItem* item,
+ ESource source,
+ const LLUUID& src_id,
+ bool remove_pbr,
+ S32 tex_channel = -1);
+ static void dropTextureAllFaces(LLViewerObject* hit_obj,
+ LLInventoryItem* item,
+ ESource source,
+ const LLUUID& src_id,
+ bool remove_pbr);
+ static void dropMaterial(LLViewerObject* hit_obj,
+ S32 hit_face,
+ LLInventoryItem* item,
+ ESource source,
+ const LLUUID& src_id,
+ bool all_faces);
+ static void dropMaterialOneFace(LLViewerObject* hit_obj,
+ S32 hit_face,
+ LLInventoryItem* item,
+ ESource source,
+ const LLUUID& src_id);
+ static void dropMaterialAllFaces(LLViewerObject* hit_obj,
+ LLInventoryItem* item,
+ ESource source,
+ const LLUUID& src_id);
+ static void dropMesh(LLViewerObject* hit_obj,
+ LLInventoryItem* item,
+ ESource source,
+ const LLUUID& src_id);
+
+ //static void dropTextureOneFaceAvatar(LLVOAvatar* avatar,S32 hit_face,
+ // LLInventoryItem* item)
+
+ static void dropInventory(LLViewerObject* hit_obj,
+ LLInventoryItem* item,
+ ESource source,
+ const LLUUID& src_id);
+
+ static bool handleGiveDragAndDrop(LLUUID agent, LLUUID session, bool drop,
+ EDragAndDropType cargo_type,
+ void* cargo_data,
+ EAcceptance* accept,
+ const LLSD& dest = LLSD());
+
+ // Classes used for determining 3d drag and drop types.
+private:
+ struct DragAndDropEntry : public LLDictionaryEntry
+ {
+ DragAndDropEntry(dragOrDrop3dImpl f_none,
+ dragOrDrop3dImpl f_self,
+ dragOrDrop3dImpl f_avatar,
+ dragOrDrop3dImpl f_object,
+ dragOrDrop3dImpl f_land);
+ dragOrDrop3dImpl mFunctions[DT_COUNT];
+ };
+ class LLDragAndDropDictionary : public LLSingleton<LLDragAndDropDictionary>,
+ public LLDictionary<EDragAndDropType, DragAndDropEntry>
+ {
+ LLSINGLETON(LLDragAndDropDictionary);
+ public:
+ dragOrDrop3dImpl get(EDragAndDropType dad_type, EDropTarget drop_target);
+ };
+};
+
+// utility functions
+void pack_permissions_slam(LLMessageSystem* msg, U32 flags, const LLPermissions& perms);
+
+#endif // LL_TOOLDRAGANDDROP_H
|