diff options
-rw-r--r-- | indra/llui/llclipboard.cpp | 102 | ||||
-rw-r--r-- | indra/llui/llclipboard.h | 27 | ||||
-rw-r--r-- | indra/newview/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/newview/llfavoritesbar.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llfloatergesture.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llfolderview.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 26 | ||||
-rw-r--r-- | indra/newview/llinventoryclipboard.cpp | 110 | ||||
-rw-r--r-- | indra/newview/llinventoryclipboard.h | 86 | ||||
-rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 1 | ||||
-rw-r--r-- | indra/newview/lltoolbarview.cpp | 1 |
11 files changed, 138 insertions, 250 deletions
diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index 984c4ec5fb..8917dc2d88 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -34,44 +34,104 @@ #include "llview.h" #include "llwindow.h" -// Global singleton -LLClipboard gClipboard; +LLClipboard::LLClipboard() +: mCutMode(false) +{ +} +LLClipboard::~LLClipboard() +{ + reset(); +} -LLClipboard::LLClipboard() +void LLClipboard::add(const LLUUID& object) { + mObjects.put(object); } +void LLClipboard::store(const LLUUID& object) +{ + reset(); + mObjects.put(object); +} -LLClipboard::~LLClipboard() +void LLClipboard::store(const LLDynamicArray<LLUUID>& inv_objects) { + reset(); + S32 count = inv_objects.count(); + for(S32 i = 0; i < count; i++) + { + mObjects.put(inv_objects[i]); + } +} + +void LLClipboard::cut(const LLUUID& object) +{ + if(!mCutMode && !mObjects.empty()) + { + //looks like there are some stored items, reset clipboard state + reset(); + } + mCutMode = true; + add(object); +} +void LLClipboard::retrieve(LLDynamicArray<LLUUID>& inv_objects) const +{ + inv_objects.reset(); + S32 count = mObjects.count(); + for(S32 i = 0; i < count; i++) + { + inv_objects.put(mObjects[i]); + } +} + +void LLClipboard::reset() +{ + mObjects.reset(); + mCutMode = false; +} + +// returns true if the clipboard has something pasteable in it. +BOOL LLClipboard::hasContents() const +{ + return (mObjects.count() > 0); } void LLClipboard::copyFromSubstring(const LLWString &src, S32 pos, S32 len, const LLUUID& source_id ) { - mSourceID = source_id; + reset(); + if (source_id.notNull()) + { + store(source_id); + } mString = src.substr(pos, len); + llinfos << "Merov debug : copyFromSubstring, string = " << wstring_to_utf8str(mString) << ", uuid = " << (hasContents() ? mObjects[0] : LLUUID::null) << llendl; LLView::getWindow()->copyTextToClipboard( mString ); } void LLClipboard::copyFromString(const LLWString &src, const LLUUID& source_id ) { - mSourceID = source_id; + reset(); + if (source_id.notNull()) + { + store(source_id); + } mString = src; + llinfos << "Merov debug : copyFromString, string = " << wstring_to_utf8str(mString) << ", uuid = " << (hasContents() ? mObjects[0] : LLUUID::null) << llendl; LLView::getWindow()->copyTextToClipboard( mString ); } const LLWString& LLClipboard::getPasteWString( LLUUID* source_id ) { - if( mSourceID.notNull() ) + if (hasContents()) { LLWString temp_string; LLView::getWindow()->pasteTextFromClipboard(temp_string); - if( temp_string != mString ) + if (temp_string != mString) { - mSourceID.setNull(); + reset(); mString = temp_string; } } @@ -80,11 +140,13 @@ const LLWString& LLClipboard::getPasteWString( LLUUID* source_id ) LLView::getWindow()->pasteTextFromClipboard(mString); } - if( source_id ) + if (source_id) { - *source_id = mSourceID; + *source_id = (hasContents() ? mObjects[0] : LLUUID::null); } + llinfos << "Merov debug : getPasteWString, string = " << wstring_to_utf8str(mString) << ", uuid = " << (hasContents() ? mObjects[0] : LLUUID::null) << llendl; + return mString; } @@ -97,7 +159,11 @@ BOOL LLClipboard::canPasteString() const void LLClipboard::copyFromPrimarySubstring(const LLWString &src, S32 pos, S32 len, const LLUUID& source_id ) { - mSourceID = source_id; + reset(); + if (source_id.notNull()) + { + store(source_id); + } mString = src.substr(pos, len); LLView::getWindow()->copyTextToPrimary( mString ); } @@ -105,14 +171,14 @@ void LLClipboard::copyFromPrimarySubstring(const LLWString &src, S32 pos, S32 le const LLWString& LLClipboard::getPastePrimaryWString( LLUUID* source_id ) { - if( mSourceID.notNull() ) + if (hasContents()) { LLWString temp_string; LLView::getWindow()->pasteTextFromPrimary(temp_string); - if( temp_string != mString ) + if (temp_string != mString) { - mSourceID.setNull(); + reset(); mString = temp_string; } } @@ -121,11 +187,11 @@ const LLWString& LLClipboard::getPastePrimaryWString( LLUUID* source_id ) LLView::getWindow()->pasteTextFromPrimary(mString); } - if( source_id ) + if (source_id) { - *source_id = mSourceID; + *source_id = (hasContents() ? mObjects[0] : LLUUID::null); } - + return mString; } diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h index 2567eaab48..2cb857145e 100644 --- a/indra/llui/llclipboard.h +++ b/indra/llui/llclipboard.h @@ -34,6 +34,13 @@ #include "llsingleton.h" #include "llinventory.h" +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLClipboard +// +// This class is used to cut/copy/paste text strings and inventory items around +// the world. Use LLClipboard::getInstance()->method() to use its methods. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + class LLClipboard : public LLSingleton<LLClipboard> { public: @@ -45,20 +52,36 @@ public: which is implicitly copied upon selection on platforms which expect this (i.e. X11/Linux). */ + // Text strings management void copyFromSubstring(const LLWString ©_from, S32 pos, S32 len, const LLUUID& source_id = LLUUID::null ); void copyFromString(const LLWString ©_from, const LLUUID& source_id = LLUUID::null ); BOOL canPasteString() const; const LLWString& getPasteWString(LLUUID* source_id = NULL); + // Primary text string management (Linux gtk implementation) void copyFromPrimarySubstring(const LLWString ©_from, S32 pos, S32 len, const LLUUID& source_id = LLUUID::null ); BOOL canPastePrimaryString() const; const LLWString& getPastePrimaryWString(LLUUID* source_id = NULL); // Support clipboard for object known only by their uuid - void setSourceObject(const LLUUID& source_id) { mSourceID = source_id; } + //void setSourceObject(const LLUUID& source_id) { mSourceID = source_id; } + + // Object list management + void add(const LLUUID& object); // Adds to the current list of objects on the clipboard + void store(const LLUUID& object); // Stores a single inventory object + void store(const LLDynamicArray<LLUUID>& inventory_objects); // Stores an array of objects + void cut(const LLUUID& object); // Adds to the current list of cut objects on the clipboard + void retrieve(LLDynamicArray<LLUUID>& inventory_objects) const; // Gets a copy of the objects on the clipboard + void reset(); // Clears the clipboard + BOOL hasContents() const; // true if the clipboard has something pasteable in it + bool isCutMode() const { return mCutMode; } + private: - LLUUID mSourceID; + // *TODO: To know if an asset ID can be serialized, check out LLAssetType::lookupIsAssetIDKnowable(EType asset_type) + LLDynamicArray<LLUUID> mObjects; + bool mCutMode; + LLWString mString; }; diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 69bf1f15a1..325c2a12a6 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -287,7 +287,6 @@ set(viewer_SOURCE_FILES llinspectremoteobject.cpp llinspecttoast.cpp llinventorybridge.cpp - llinventoryclipboard.cpp llinventoryfilter.cpp llinventoryfunctions.cpp llinventoryicon.cpp @@ -842,7 +841,6 @@ set(viewer_HEADER_FILES llinspectremoteobject.h llinspecttoast.h llinventorybridge.h - llinventoryclipboard.h llinventoryfilter.h llinventoryfunctions.h llinventoryicon.h diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 24bd2cf313..c81bff4b5d 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -39,7 +39,7 @@ #include "llagent.h" #include "llclipboard.h" -#include "llinventoryclipboard.h" +#include "llclipboard.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" #include "llfloatersidepanelcontainer.h" @@ -1187,7 +1187,7 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) } else if (action == "copy") { - LLInventoryClipboard::instance().store(mSelectedItemID); + LLClipboard::getInstance()->store(mSelectedItemID); } else if (action == "paste") { @@ -1211,13 +1211,13 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) BOOL LLFavoritesBarCtrl::isClipboardPasteable() const { - if (!LLInventoryClipboard::instance().hasContents()) + if (!LLClipboard::getInstance()->hasContents()) { return FALSE; } LLDynamicArray<LLUUID> objects; - LLInventoryClipboard::instance().retrieve(objects); + LLClipboard::getInstance()->retrieve(objects); S32 count = objects.count(); for(S32 i = 0; i < count; i++) { @@ -1246,7 +1246,7 @@ void LLFavoritesBarCtrl::pastFromClipboard() const { LLInventoryItem* item = NULL; LLDynamicArray<LLUUID> objects; - LLInventoryClipboard::instance().retrieve(objects); + LLClipboard::getInstance()->retrieve(objects); S32 count = objects.count(); LLUUID parent_id(mFavoriteFolderId); for(S32 i = 0; i < count; i++) diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index e025d6edb5..281cafa90d 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -32,7 +32,7 @@ #include "llinventorybridge.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" -#include "llinventoryclipboard.h" +#include "llclipboard.h" #include "llagent.h" #include "llappearancemgr.h" @@ -391,11 +391,11 @@ bool LLFloaterGesture::isActionEnabled(const LLSD& command) std::string command_name = command.asString(); if("paste" == command_name) { - if(!LLInventoryClipboard::instance().hasContents()) + if(!LLClipboard::getInstance()->hasContents()) return false; LLDynamicArray<LLUUID> ids; - LLInventoryClipboard::instance().retrieve(ids); + LLClipboard::getInstance()->retrieve(ids); for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++) { LLInventoryItem* item = gInventory.getItem(*it); @@ -496,21 +496,20 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command) uuid_vec_t ids; getSelectedIds(ids); // make sure that clopboard is empty - LLInventoryClipboard::instance().reset(); + LLClipboard::getInstance()->reset(); for(uuid_vec_t::iterator it = ids.begin(); it != ids.end(); it++) { LLInventoryItem* item = gInventory.getItem(*it); if(item && item->getInventoryType() == LLInventoryType::IT_GESTURE) { - LLInventoryClipboard::instance().add(item->getUUID()); + LLClipboard::getInstance()->add(item->getUUID()); } } } else if ("paste" == command_name) { - LLInventoryClipboard& clipbord = LLInventoryClipboard::instance(); LLDynamicArray<LLUUID> ids; - clipbord.retrieve(ids); + LLClipboard::getInstance()->retrieve(ids); if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID)) return; LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID); @@ -530,7 +529,7 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command) gesture_dir->getUUID(), getString("copy_name", string_args), cb); } } - clipbord.reset(); + LLClipboard::getInstance()->reset(); } else if ("copy_uuid" == command_name) { diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 79c987fa37..438d7e7ae3 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -30,7 +30,7 @@ #include "llcallbacklist.h" #include "llinventorybridge.h" -#include "llinventoryclipboard.h" // *TODO: remove this once hack below gone. +#include "llclipboard.h" // *TODO: remove this once hack below gone. #include "llinventoryfilter.h" #include "llinventoryfunctions.h" #include "llinventorymodelbackgroundfetch.h" @@ -1293,7 +1293,7 @@ BOOL LLFolderView::canCopy() const void LLFolderView::copy() { // *NOTE: total hack to clear the inventory clipboard - LLInventoryClipboard::instance().reset(); + LLClipboard::getInstance()->reset(); S32 count = mSelectedItems.size(); if(getVisible() && getEnabled() && (count > 0)) { @@ -1334,7 +1334,7 @@ BOOL LLFolderView::canCut() const void LLFolderView::cut() { // clear the inventory clipboard - LLInventoryClipboard::instance().reset(); + LLClipboard::getInstance()->reset(); S32 count = mSelectedItems.size(); if(getVisible() && getEnabled() && (count > 0)) { @@ -2111,7 +2111,7 @@ bool LLFolderView::doToSelected(LLInventoryModel* model, const LLSD& userdata) if ("copy" == action) { - LLInventoryClipboard::instance().reset(); + LLClipboard::getInstance()->reset(); } static const std::string change_folder_string = "change_folder_type_"; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 869cb735d5..420b834933 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -47,7 +47,7 @@ #include "llgiveinventory.h" #include "llimfloater.h" #include "llimview.h" -#include "llinventoryclipboard.h" +#include "llclipboard.h" #include "llinventorydefines.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" @@ -212,7 +212,7 @@ void LLInvFVBridge::cutToClipboard() { if(isItemMovable()) { - LLInventoryClipboard::instance().cut(mUUID); + LLClipboard::getInstance()->cut(mUUID); } } // *TODO: make sure this does the right thing @@ -397,7 +397,7 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener* BOOL LLInvFVBridge::isClipboardPasteable() const { - if (!LLInventoryClipboard::instance().hasContents() || !isAgentInventory()) + if (!LLClipboard::getInstance()->hasContents() || !isAgentInventory()) { return FALSE; } @@ -410,7 +410,7 @@ BOOL LLInvFVBridge::isClipboardPasteable() const const LLUUID &agent_id = gAgent.getID(); LLDynamicArray<LLUUID> objects; - LLInventoryClipboard::instance().retrieve(objects); + LLClipboard::getInstance()->retrieve(objects); S32 count = objects.count(); for(S32 i = 0; i < count; i++) { @@ -437,7 +437,7 @@ BOOL LLInvFVBridge::isClipboardPasteable() const BOOL LLInvFVBridge::isClipboardPasteableAsLink() const { - if (!LLInventoryClipboard::instance().hasContents() || !isAgentInventory()) + if (!LLClipboard::getInstance()->hasContents() || !isAgentInventory()) { return FALSE; } @@ -448,7 +448,7 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const } LLDynamicArray<LLUUID> objects; - LLInventoryClipboard::instance().retrieve(objects); + LLClipboard::getInstance()->retrieve(objects); S32 count = objects.count(); for(S32 i = 0; i < count; i++) { @@ -1663,7 +1663,7 @@ BOOL LLItemBridge::copyToClipboard() const { if(isItemCopyable()) { - LLInventoryClipboard::instance().add(mUUID); + LLClipboard::getInstance()->add(mUUID); return TRUE; } return FALSE; @@ -1775,7 +1775,7 @@ BOOL LLFolderBridge::copyToClipboard() const { if(isItemCopyable()) { - LLInventoryClipboard::instance().add(mUUID); + LLClipboard::getInstance()->add(mUUID); return TRUE; } return FALSE; @@ -1796,7 +1796,7 @@ BOOL LLFolderBridge::isClipboardPasteable() const } LLDynamicArray<LLUUID> objects; - LLInventoryClipboard::instance().retrieve(objects); + LLClipboard::getInstance()->retrieve(objects); const LLViewerInventoryCategory *current_cat = getCategory(); // Search for the direct descendent of current Friends subfolder among all pasted items, @@ -1834,7 +1834,7 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const const BOOL is_in_friend_folder = LLFriendCardsManager::instance().isCategoryInFriendFolder( current_cat ); const LLUUID ¤t_cat_id = current_cat->getUUID(); LLDynamicArray<LLUUID> objects; - LLInventoryClipboard::instance().retrieve(objects); + LLClipboard::getInstance()->retrieve(objects); S32 count = objects.count(); for(S32 i = 0; i < count; i++) { @@ -2825,7 +2825,7 @@ void LLFolderBridge::pasteFromClipboard() const LLUUID parent_id(mUUID); LLDynamicArray<LLUUID> objects; - LLInventoryClipboard::instance().retrieve(objects); + LLClipboard::getInstance()->retrieve(objects); for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) @@ -2841,7 +2841,7 @@ void LLFolderBridge::pasteFromClipboard() dropToOutfit(item, move_is_into_current_outfit); } } - else if(LLInventoryClipboard::instance().isCutMode()) + else if (LLClipboard::getInstance()->isCutMode()) { // move_inventory_item() is not enough, //we have to update inventory locally too @@ -2879,7 +2879,7 @@ void LLFolderBridge::pasteLinkFromClipboard() const LLUUID parent_id(mUUID); LLDynamicArray<LLUUID> objects; - LLInventoryClipboard::instance().retrieve(objects); + LLClipboard::getInstance()->retrieve(objects); for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) diff --git a/indra/newview/llinventoryclipboard.cpp b/indra/newview/llinventoryclipboard.cpp deleted file mode 100644 index 53da34f448..0000000000 --- a/indra/newview/llinventoryclipboard.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/** - * @file llinventoryclipboard.cpp - * @brief LLInventoryClipboard class implementation - * - * $LicenseInfo:firstyear=2002&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$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llinventoryclipboard.h" - - -LLInventoryClipboard LLInventoryClipboard::sInstance; - -///---------------------------------------------------------------------------- -/// Local function declarations, constants, enums, and typedefs -///---------------------------------------------------------------------------- - - -///---------------------------------------------------------------------------- -/// Class LLInventoryClipboard -///---------------------------------------------------------------------------- - -LLInventoryClipboard::LLInventoryClipboard() -: mCutMode(false) -{ -} - -LLInventoryClipboard::~LLInventoryClipboard() -{ - reset(); -} - -void LLInventoryClipboard::add(const LLUUID& object) -{ - mObjects.put(object); -} - -// this stores a single inventory object -void LLInventoryClipboard::store(const LLUUID& object) -{ - reset(); - mObjects.put(object); -} - -void LLInventoryClipboard::store(const LLDynamicArray<LLUUID>& inv_objects) -{ - reset(); - S32 count = inv_objects.count(); - for(S32 i = 0; i < count; i++) - { - mObjects.put(inv_objects[i]); - } -} - -void LLInventoryClipboard::cut(const LLUUID& object) -{ - if(!mCutMode && !mObjects.empty()) - { - //looks like there are some stored items, reset clipboard state - reset(); - } - mCutMode = true; - add(object); -} -void LLInventoryClipboard::retrieve(LLDynamicArray<LLUUID>& inv_objects) const -{ - inv_objects.reset(); - S32 count = mObjects.count(); - for(S32 i = 0; i < count; i++) - { - inv_objects.put(mObjects[i]); - } -} - -void LLInventoryClipboard::reset() -{ - mObjects.reset(); - mCutMode = false; -} - -// returns true if the clipboard has something pasteable in it. -BOOL LLInventoryClipboard::hasContents() const -{ - return (mObjects.count() > 0); -} - - -///---------------------------------------------------------------------------- -/// Local function definitions -///---------------------------------------------------------------------------- diff --git a/indra/newview/llinventoryclipboard.h b/indra/newview/llinventoryclipboard.h deleted file mode 100644 index b9f1451e5c..0000000000 --- a/indra/newview/llinventoryclipboard.h +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @file llinventoryclipboard.h - * @brief LLInventoryClipboard class header file - * - * $LicenseInfo:firstyear=2002&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_LLINVENTORYCLIPBOARD_H -#define LL_LLINVENTORYCLIPBOARD_H - -#include "lldarray.h" -#include "lluuid.h" - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryClipboard -// -// This class is used to cut/copy/paste inventory items around the -// world. This class is accessed through a singleton (only one -// inventory clipboard for now) which can be referenced using the -// instance() method. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLInventoryClipboard -{ -public: - // calling this before main() is undefined - static LLInventoryClipboard& instance() { return sInstance; } - - // this method adds to the current list. - void add(const LLUUID& object); - - // this stores a single inventory object - void store(const LLUUID& object); - - // this method stores an array of objects - void store(const LLDynamicArray<LLUUID>& inventory_objects); - - void cut(const LLUUID& object); - // this method gets the objects in the clipboard by copying them - // into the array provided. - void retrieve(LLDynamicArray<LLUUID>& inventory_objects) const; - - // this method empties out the clipboard - void reset(); - - // returns true if the clipboard has something pasteable in it. - BOOL hasContents() const; - bool isCutMode() const { return mCutMode; } - -protected: - static LLInventoryClipboard sInstance; - - LLDynamicArray<LLUUID> mObjects; - bool mCutMode; - -public: - // please don't actually call these - LLInventoryClipboard(); - ~LLInventoryClipboard(); -private: - // please don't implement these - LLInventoryClipboard(const LLInventoryClipboard&); - LLInventoryClipboard& operator=(const LLInventoryClipboard&); -}; - - -#endif // LL_LLINVENTORYCLIPBOARD_H diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index dd92188e9d..ea00474b2a 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -54,7 +54,6 @@ #include "lliconctrl.h" #include "llimview.h" #include "llinventorybridge.h" -#include "llinventoryclipboard.h" #include "llinventorymodel.h" #include "llinventorypanel.h" #include "lllineeditor.h" diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index 8a0b035234..81ad96f39e 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -580,7 +580,6 @@ BOOL LLToolBarView::handleDragTool( S32 x, S32 y, const LLUUID& uuid, LLAssetTyp uuid_vec_t cargo_ids; types.push_back(DAD_WIDGET); cargo_ids.push_back(uuid); - LLClipboard::getInstance()->setSourceObject(uuid); LLToolDragAndDrop::ESource src = LLToolDragAndDrop::SOURCE_VIEWER; LLUUID srcID; LLToolDragAndDrop::getInstance()->beginMultiDrag(types, cargo_ids, src, srcID); |