Some spring cleaning.

This commit is contained in:
Shyotl
2012-03-21 02:22:27 -05:00
parent 896f7f5b9b
commit 0fdab061b9
22 changed files with 344 additions and 561 deletions

View File

@@ -28,7 +28,7 @@
#ifndef LL_LLATTACHMENTSMGR_H
#define LL_LLATTACHMENTSMGR_H
#include "llmemory.h"
#include "llsingleton.h"
class LLViewerInventoryItem;

View File

@@ -2,31 +2,25 @@
* @file llflexibleobject.cpp
* @brief Flexible object implementation
*
* $LicenseInfo:firstyear=2006&license=viewergpl$
*
* Copyright (c) 2006-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* 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.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* 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$
*/

View File

@@ -2134,7 +2134,6 @@ LLFolderViewFolder* LLFolderView::getFolderByID(const LLUUID& id)
static LLFastTimer::DeclareTimer FTM_AUTO_SELECT("Open and Select");
static LLFastTimer::DeclareTimer FTM_INVENTORY("Inventory");
extern std::set<LLFolderViewItem*> sFolderViewItems; //dumb hack
// Main idle routine
void LLFolderView::doIdle()
{
@@ -2174,19 +2173,7 @@ void LLFolderView::doIdle()
LLFastTimer t3(FTM_AUTO_SELECT);
// select new item only if a filtered item not currently selected
LLFolderViewItem* selected_itemp = mSelectedItems.empty() ? NULL : mSelectedItems.back();
/*if (selected_itemp != NULL && sFolderViewItems.count(selected_itemp) == 0)
{
// There is a crash bug due to a race condition: when a folder view item is
// destroyed, its address may still appear in mSelectedItems a couple of doIdle()
// later, even if you explicitely clear this list and dirty the filters in the
// destructor...
// This code avoids the crash bug.
llwarns << "Invalid folder view item (" << selected_itemp << ") in selection: clearing the latter." << llendl;
dirtyFilter();
clearSelection();
requestArrange();
}
else */if ((selected_itemp && !selected_itemp->getFiltered()) && !mAutoSelectOverride)
if ((selected_itemp && !selected_itemp->getFiltered()) && !mAutoSelectOverride)
{
// select first filtered item
LLSelectFirstFilteredItem filter;

View File

@@ -85,11 +85,11 @@ public:
virtual LLInventoryType::EType getInventoryType() const = 0;
virtual void performAction(LLInventoryModel* model, std::string action) = 0;
virtual LLWearableType::EType getWearableType() const = 0;
// This method should be called when a drag begins. returns TRUE
// if the drag can begin, otherwise FALSE.
virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const = 0;
// This method will be called to determine if a drop can be
// performed, and will set drop to TRUE if a drop is
// requested. Returns TRUE if a drop is possible/happened,
@@ -97,12 +97,6 @@ public:
virtual BOOL dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data) = 0;
// This method is called when the object being referenced by the
// bridge is actually dropped. This allows for cleanup of the old
// view, reference counting, etc.
// virtual void dropped() = 0;
};
#endif

View File

@@ -53,9 +53,6 @@ const F32 LLFolderViewItem::FOLDER_OPEN_TIME_CONSTANT = 0.03f;
LLUIImagePtr LLFolderViewItem::sArrowImage;
LLUIImagePtr LLFolderViewItem::sBoxImage;
// This is used to keep track of existing folder view items and
// avoid a crash bug due to a race condition (see in doIdle()).
std::set<LLFolderViewItem*> sFolderViewItems;
//static
LLFontGL* LLFolderViewItem::getLabelFontForStyle(U8 style)
@@ -111,7 +108,6 @@ LLFolderViewItem::LLFolderViewItem( const std::string& name, LLUIImagePtr icon,
mLastFilterGeneration(-1),
mStringMatchOffset(std::string::npos),
mControlLabelRotation(0.f),
mDragAndDropTarget(FALSE),
mIsLoading(FALSE),
mLabel( name ),
@@ -122,14 +118,8 @@ LLFolderViewItem::LLFolderViewItem( const std::string& name, LLUIImagePtr icon,
mIconOverlay(icon_overlay),
mListener(listener),
mShowLoadStatus(true),
mSearchType(0)
{
sFolderViewItems.insert(this);
/*S32 icon_height = mIcon.notNull() ? mIcon->getHeight() : 0;
S32 label_height = llround(sFont->getLineHeight());*/
postBuild();//Not parsing xml file yet.
}
@@ -143,7 +133,6 @@ BOOL LLFolderViewItem::postBuild()
// Destroys the object
LLFolderViewItem::~LLFolderViewItem( void )
{
sFolderViewItems.erase(this);
delete mListener;
mListener = NULL;
}
@@ -174,7 +163,7 @@ LLFolderViewItem* LLFolderViewItem::getNextOpenNode(BOOL include_children)
{
return NULL;
}
LLFolderViewItem* itemp = mParentFolder->getNextFromChild( this, include_children );
while(itemp && !itemp->getVisible())
{
@@ -196,7 +185,7 @@ LLFolderViewItem* LLFolderViewItem::getPreviousOpenNode(BOOL include_children)
{
return NULL;
}
LLFolderViewItem* itemp = mParentFolder->getPreviousFromChild( this, include_children );
// Skip over items that are invisible or are hidden from the UI.
@@ -302,7 +291,7 @@ void LLFolderViewItem::updateExtraSearchCriteria()
void LLFolderViewItem::refresh()
{
refreshFromListener();
std::string searchable_label(mLabel);
searchable_label.append(mLabelSuffix);
LLStringUtil::toUpper(searchable_label);
@@ -584,8 +573,6 @@ BOOL LLFolderViewItem::remove()
return TRUE;
}
// Build an appropriate context menu for the item.
void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags)
{
@@ -965,10 +952,14 @@ void LLFolderViewItem::draw()
focus_bottom + 1,
getRect().getWidth() - 2,
0,
sHighlightBgColor, TRUE);
sHighlightBgColor, TRUE);
}
}
}
//--------------------------------------------------------------------------------//
// Draw DragNDrop highlight
//
if (mDragAndDropTarget)
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -1025,18 +1016,18 @@ void LLFolderViewItem::draw()
//
if (getRoot()->getDebugFilters())
{
if (!getFiltered() && !possibly_has_children)
{
color.mV[VALPHA] *= 0.5f;
}
LLColor4 filter_color = mLastFilterGeneration >= getRoot()->getFilter()->getCurrentGeneration() ?
if (!getFiltered() && !possibly_has_children)
{
color.mV[VALPHA] *= 0.5f;
}
LLColor4 filter_color = mLastFilterGeneration >= getRoot()->getFilter()->getCurrentGeneration() ?
LLColor4(0.5f, 0.8f, 0.5f, 1.f) :
LLColor4(0.8f, 0.5f, 0.5f, 1.f);
LLFontGL::getFontMonospace()->renderUTF8(mStatusText, 0, text_left, y, filter_color,
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
S32_MAX, S32_MAX, &right_x, FALSE );
text_left = right_x;
}
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
S32_MAX, S32_MAX, &right_x, FALSE );
text_left = right_x;
}
//--------------------------------------------------------------------------------//
// Draw the actual label text
//
@@ -1078,6 +1069,9 @@ void LLFolderViewItem::draw()
S32_MAX, S32_MAX, &right_x, FALSE );
}
//--------------------------------------------------------------------------------//
// Highlight string match
//
if (sBoxImage.notNull() && mStringMatchOffset != std::string::npos)
{
// don't draw backgrounds for zero-length strings
@@ -1167,8 +1161,8 @@ BOOL LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder, LLFolderView* r
return folder->addFolder(this);
}
// Finds width and height of this object and it's children. Also
// makes sure that this view and it's children are the right size.
// Finds width and height of this object and its children. Also
// makes sure that this view and its children are the right size.
S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation)
{
// sort before laying out contents
@@ -1275,12 +1269,12 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation)
if (llabs(mCurHeight - mTargetHeight) > 1.f)
{
mCurHeight = lerp(mCurHeight, mTargetHeight, LLCriticalDamp::getInterpolant(mIsOpen ? FOLDER_OPEN_TIME_CONSTANT : FOLDER_CLOSE_TIME_CONSTANT));
requestArrange();
// hide child elements that fall out of current animated height
for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();)
iter != mFolders.end();)
{
folders_t::iterator fit = iter++;
// number of pixels that bottom of folder label is from top of parent folder
@@ -1293,7 +1287,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation)
}
for (items_t::iterator iter = mItems.begin();
iter != mItems.end();)
iter != mItems.end();)
{
items_t::iterator iit = iter++;
// number of pixels that bottom of item label is from top of parent folder
@@ -1329,6 +1323,7 @@ void LLFolderViewFolder::requestSort()
// whenever item order changes, we need to lay things out again
requestArrange();
}
void LLFolderViewFolder::setCompletedFilterGeneration(S32 generation, BOOL recurse_up)
{
mMostFilteredDescendantGeneration = llmin(mMostFilteredDescendantGeneration, generation);
@@ -1367,7 +1362,7 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter)
// go ahead and flag this folder as done
mLastFilterGeneration = filter_generation;
}
else
else // filter self only on first pass through
{
// filter against folder rules
filterFolder(filter);
@@ -1486,7 +1481,7 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter)
requestArrange();
}
}
// if we didn't use all filter iterations
// that means we filtered all of our descendants
// instead of exhausting the filter count for this frame
@@ -1553,9 +1548,10 @@ BOOL LLFolderViewFolder::getFiltered(S32 filter_generation)
{
return getFilteredFolder(filter_generation) && LLFolderViewItem::getFiltered(filter_generation);
}
BOOL LLFolderViewFolder::hasFilteredDescendants(S32 filter_generation)
{
return mMostFilteredDescendantGeneration >= filter_generation;
{
return mMostFilteredDescendantGeneration >= filter_generation;
}
@@ -1567,12 +1563,12 @@ BOOL LLFolderViewFolder::hasFilteredDescendants()
// Passes selection information on to children and record selection
// information if necessary.
BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem,
BOOL take_keyboard_focus)
BOOL take_keyboard_focus)
{
BOOL rv = FALSE;
if( selection == this )
if (selection == this)
{
if (!isSelected())
if (!isSelected())
{
selectItem();
}
@@ -1580,16 +1576,16 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem
}
else
{
if (isSelected())
if (isSelected())
{
deselectItem();
}
rv = FALSE;
}
BOOL child_selected = FALSE;
for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();)
iter != mFolders.end();)
{
folders_t::iterator fit = iter++;
if((*fit)->setSelection(selection, openitem, take_keyboard_focus))
@@ -1599,7 +1595,7 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem
}
}
for (items_t::iterator iter = mItems.begin();
iter != mItems.end();)
iter != mItems.end();)
{
items_t::iterator iit = iter++;
if((*iit)->setSelection(selection, openitem, take_keyboard_focus))
@@ -1627,7 +1623,7 @@ BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection, BOOL selec
if (isSelected() != selected)
{
rv = TRUE;
if (selected)
if (selected)
{
selectItem();
}
@@ -1639,19 +1635,19 @@ BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection, BOOL selec
}
for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();)
iter != mFolders.end();)
{
folders_t::iterator fit = iter++;
if ((*fit)->changeSelection(selection, selected))
if((*fit)->changeSelection(selection, selected))
{
rv = TRUE;
}
}
for (items_t::iterator iter = mItems.begin();
iter != mItems.end();)
iter != mItems.end();)
{
items_t::iterator iit = iter++;
if ((*iit)->changeSelection(selection, selected))
if((*iit)->changeSelection(selection, selected))
{
rv = TRUE;
}
@@ -1659,7 +1655,6 @@ BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection, BOOL selec
return rv;
}
LLFolderViewFolder* LLFolderViewFolder::getCommonAncestor(LLFolderViewItem* item_a, LLFolderViewItem* item_b, bool& reverse)
{
if (!item_a->getParentFolder() || !item_b->getParentFolder()) return NULL;
@@ -1935,7 +1930,7 @@ void LLFolderViewFolder::destroyView()
}
//deleteAllChildren();
if (mParentFolder)
{
mParentFolder->removeView(this);
@@ -2018,9 +2013,9 @@ void LLFolderViewFolder::sortBy(U32 order)
return;
}
// Propegate this change to sub folders
// Propagate this change to sub folders
for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();)
iter != mFolders.end();)
{
folders_t::iterator fit = iter++;
(*fit)->sortBy(order);
@@ -2036,7 +2031,7 @@ void LLFolderViewFolder::sortBy(U32 order)
if (order & LLInventoryFilter::SO_DATE)
{
time_t latest = 0;
if (!mItems.empty())
{
LLFolderViewItem* item = *(mItems.begin());
@@ -2099,7 +2094,7 @@ BOOL LLFolderViewFolder::isMovable()
}
for (items_t::iterator iter = mItems.begin();
iter != mItems.end();)
iter != mItems.end();)
{
items_t::iterator iit = iter++;
if(!(*iit)->isMovable())
@@ -2109,7 +2104,7 @@ BOOL LLFolderViewFolder::isMovable()
}
for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();)
iter != mFolders.end();)
{
folders_t::iterator fit = iter++;
if(!(*fit)->isMovable())
@@ -2132,7 +2127,7 @@ BOOL LLFolderViewFolder::isRemovable()
}
for (items_t::iterator iter = mItems.begin();
iter != mItems.end();)
iter != mItems.end();)
{
items_t::iterator iit = iter++;
if(!(*iit)->isRemovable())
@@ -2142,7 +2137,7 @@ BOOL LLFolderViewFolder::isRemovable()
}
for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();)
iter != mFolders.end();)
{
folders_t::iterator fit = iter++;
if(!(*fit)->isRemovable())
@@ -2273,7 +2268,7 @@ void LLFolderViewFolder::setOpenArrangeRecursively(BOOL openitem, ERecurseType r
if (recurse == RECURSE_DOWN || recurse == RECURSE_UP_DOWN)
{
for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();)
iter != mFolders.end();)
{
folders_t::iterator fit = iter++;
(*fit)->setOpenArrangeRecursively(openitem, RECURSE_DOWN); /* Flawfinder: ignore */
@@ -2293,11 +2288,11 @@ void LLFolderViewFolder::setOpenArrangeRecursively(BOOL openitem, ERecurseType r
}
BOOL LLFolderViewFolder::handleDragAndDropFromChild(MASK mask,
BOOL drop,
EDragAndDropType c_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg)
BOOL drop,
EDragAndDropType c_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg)
{
BOOL accepted = mListener && mListener->dragOrDrop(mask,drop,c_type,cargo_data);
if (accepted)
@@ -2342,13 +2337,13 @@ void LLFolderViewFolder::applyFunctorRecursively(LLFolderViewFunctor& functor)
functor.doFolder(this);
for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();)
iter != mFolders.end();)
{
folders_t::iterator fit = iter++;
(*fit)->applyFunctorRecursively(functor);
}
for (items_t::iterator iter = mItems.begin();
iter != mItems.end();)
iter != mItems.end();)
{
items_t::iterator iit = iter++;
functor.doItem((*iit));
@@ -2359,13 +2354,13 @@ void LLFolderViewFolder::applyListenerFunctorRecursively(LLFolderViewListenerFun
{
functor(mListener);
for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();)
iter != mFolders.end();)
{
folders_t::iterator fit = iter++;
(*fit)->applyListenerFunctorRecursively(functor);
}
for (items_t::iterator iter = mItems.begin();
iter != mItems.end();)
iter != mItems.end();)
{
items_t::iterator iit = iter++;
(*iit)->applyListenerFunctorRecursively(functor);
@@ -2407,16 +2402,16 @@ BOOL LLFolderViewFolder::handleDragAndDropToThisFolder(MASK mask,
BOOL accepted = mListener && mListener->dragOrDrop(mask, drop, cargo_type, cargo_data);
if (accepted)
{
mDragAndDropTarget = TRUE;
*accept = ACCEPT_YES_MULTI;
}
else
{
*accept = ACCEPT_NO;
}
if (!drop && accepted)
{
mDragAndDropTarget = TRUE;
*accept = ACCEPT_YES_MULTI;
}
else
{
*accept = ACCEPT_NO;
}
if (!drop && accepted)
{
getRoot()->autoOpenTest(this);
}
@@ -2431,7 +2426,7 @@ BOOL LLFolderViewFolder::handleRightMouseDown( S32 x, S32 y, MASK mask )
// fetch contents of this folder, as context menu can depend on contents
// still, user would have to open context menu again to see the changes
gInventory.fetchDescendentsOf(mListener->getUUID());
if( mIsOpen )
{
handled = childrenHandleRightMouseDown( x, y, mask ) != NULL;
@@ -2529,18 +2524,18 @@ void LLFolderViewFolder::draw()
{
possibly_has_children = true;
}
BOOL loading = (mIsOpen
&& possibly_has_children
&& !up_to_date );
if ( loading && !mIsLoading )
{
// Measure how long we've been in the loading state
mTimeSinceRequestStart.reset();
}
mIsLoading = loading;
LLFolderViewItem::draw();
@@ -2645,7 +2640,7 @@ LLFolderViewItem* LLFolderViewFolder::getNextFromChild( LLFolderViewItem* item,
// turn on downwards traversal for next folder
++fit;
}
if (fit != fend)
{
result = (*fit);
@@ -2675,7 +2670,6 @@ LLFolderViewItem* LLFolderViewFolder::getNextFromChild( LLFolderViewItem* item,
return result;
}
// this does postfix traversal, as folders are listed above their contents
LLFolderViewItem* LLFolderViewFolder::getPreviousFromChild( LLFolderViewItem* item, BOOL include_children )
{
@@ -2743,7 +2737,7 @@ LLFolderViewItem* LLFolderViewFolder::getPreviousFromChild( LLFolderViewItem* it
{
++iit;
}
if (iit != iend)
{
// we found an appropriate item
@@ -2782,6 +2776,7 @@ LLFolderViewItem* LLFolderViewFolder::getPreviousFromChild( LLFolderViewItem* it
return result;
}
bool LLInventorySort::updateSort(U32 order)
{
if (order != mSortOrder)
@@ -2829,8 +2824,8 @@ bool LLInventorySort::operator()(const LLFolderViewItem* const& a, const LLFolde
// OR if these are folders and we are sorting folders by name.
bool by_name = (!mByDate
|| (mFoldersByName
&& (a->getSortGroup() != SG_ITEM)));
&& (a->getSortGroup() != SG_ITEM)));
if (a->getSortGroup() != b->getSortGroup())
{
if (mSystemToTop)

View File

@@ -169,7 +169,6 @@ void remove_inventory_category_from_avatar(LLInventoryCategory* category);
void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_id);
bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv*);
bool confirm_attachment_rez(const LLSD& notification, const LLSD& response);
void teleport_via_landmark(const LLUUID& asset_id);
static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit);
// Helper functions
@@ -434,7 +433,7 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*
--update[cat->getParentUUID()];
++update[trash_id];
// <edit>
if(!gInventory.isObjectDescendentOf(cat->getUUID(), gSystemFolderRoot))
if(!gInventory.isObjectDescendentOf(cat->getUUID(), gSystemFolderRoot)) //Avoid fake items.
{
// </edit>
if(start_new_message)
@@ -1506,8 +1505,7 @@ BOOL LLItemBridge::removeItem()
// Already in trash
if (model->isObjectDescendentOf(mUUID, trash_id)) return FALSE;
//Is this needed? What does it fix? Ascent has bad commenting.
/* // <edit> trash problem
// <edit> trash problem
if(gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot))
{
LLInventoryModel::LLCategoryUpdate up(item->getParentUUID(), -1);
@@ -1515,7 +1513,7 @@ BOOL LLItemBridge::removeItem()
gInventory.accountForUpdate(up);
gInventory.notifyObservers();
}
// </edit> */
// </edit>
LLNotification::Params params("ConfirmItemDeleteHasLinks");
params.functor(boost::bind(&LLItemBridge::confirmRemoveItem, this, _1, _2));

View File

@@ -2,31 +2,25 @@
* @file llinventorybridge.h
* @brief Implementation of the Inventory-Folder-View-Bridge classes.
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* 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.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* 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$
*/
@@ -38,7 +32,6 @@
#include "llfoldervieweventlistener.h"
#include "llinventorymodel.h"
#include "llinventoryobserver.h"
//#include "llinventoryview.h"
#include "llviewercontrol.h"
#include "llwearable.h"
@@ -59,7 +52,7 @@ typedef std::vector<std::string> menuentry_vec_t;
//
// You'll want to call LLInvItemFVELister::createBridge() to actually create
// an instance of this class. This helps encapsulate the
// funcationality a bit. (except for folders, you can create those
// functionality a bit. (except for folders, you can create those
// manually...)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class LLInvFVBridge : public LLFolderViewEventListener
@@ -126,6 +119,9 @@ public:
virtual LLInventoryType::EType getInventoryType() const { return mInvType; }
virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; }
//--------------------------------------------------------------------
// Convenience functions for adding various common menu options.
//--------------------------------------------------------------------
protected:
virtual void addTrashContextMenuOptions(menuentry_vec_t &items,
menuentry_vec_t &disabled_items);
@@ -140,8 +136,7 @@ protected:
BOOL isLinkedObjectInTrash() const; // Is this obj or its baseobj in the trash?
BOOL isLinkedObjectMissing() const; // Is this a linked obj whose baseobj is not in inventory?
// return true if the item is in agent inventory. if false, it
// must be lost or in the inventory library.
BOOL isAgentInventory() const; // false if lost or in the inventory library
BOOL isCOFFolder() const; // true if COF or descendent of
virtual BOOL isItemPermissive() const;
@@ -157,7 +152,7 @@ protected:
protected:
LLHandle<LLPanel> mInventoryPanel;
LLFolderView* mRoot;
LLUUID mUUID; // item id
const LLUUID mUUID; // item id
LLInventoryType::EType mInvType;
BOOL mIsLink;
void purgeItem(LLInventoryModel *model, const LLUUID &uuid);
@@ -278,10 +273,12 @@ public:
protected:
void buildContextMenuBaseOptions(U32 flags);
void buildContextMenuFolderOptions(U32 flags);
// menu callbacks
//--------------------------------------------------------------------
// Menu callbacks
//--------------------------------------------------------------------
static void pasteClipboard(void* user_data);
static void createNewCategory(void* user_data);
static void createNewShirt(void* user_data);
static void createNewPants(void* user_data);
static void createNewShoes(void* user_data);
@@ -459,7 +456,7 @@ public:
virtual BOOL renameItem(const std::string& new_name);
LLInventoryObject* getObject() const;
protected:
static LLUUID sContextMenuItemID; // Only valid while the context menu is open.
static LLUUID sContextMenuItemID; // Only valid while the context menu is open.
U32 mAttachPt;
BOOL mIsMultiObject;
};
@@ -475,7 +472,6 @@ public:
virtual void openItem();
};
class LLWearableBridge : public LLItemBridge
{
public:

View File

@@ -2,31 +2,25 @@
* @file lltexlayer.cpp
* @brief A texture layer. Used for avatars.
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* 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.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* 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$
*/

View File

@@ -1,32 +1,26 @@
/**
* @file lltexlayer.h
* @brief A texture layer. Used for avatars.
* @brief Texture layer classes. Used for avatars.
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* 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.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* 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$
*/

View File

@@ -2,31 +2,25 @@
* @file llviewerinventory.cpp
* @brief Implementation of the viewer side inventory objects.
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* 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.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* 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$
*/
@@ -209,6 +203,13 @@ void LLViewerInventoryItem::updateServer(BOOL is_new) const
LLNotificationsUtil::add("IncompleteInventoryItem");
return;
}
if(gAgent.getID() != mPermissions.getOwner())
{
// *FIX: deal with this better.
llwarns << "LLViewerInventoryItem::updateServer() - for unowned item"
<< llendl;
return;
}
LLInventoryModel::LLCategoryUpdate up(mParentUUID, is_new ? 1 : 0);
gInventory.accountForUpdate(up);
@@ -1345,7 +1346,7 @@ private:
/**
* Returns true if specified item is not found among inventory items
*//
*/
bool operator()(const sort_index_map_t::value_type& id_index_pair) const
{
LLPointer<LLViewerInventoryItem> item = gInventory.getItem(id_index_pair.first);

View File

@@ -51,10 +51,10 @@ extern LLPipeline gPipeline;
// LLViewerJointAttachment()
//-----------------------------------------------------------------------------
LLViewerJointAttachment::LLViewerJointAttachment() :
mVisibleInFirst(FALSE),
mGroup(0),
mIsHUDAttachment(FALSE),
mPieSlice(-1)
mVisibleInFirst(FALSE),
mGroup(0),
mIsHUDAttachment(FALSE),
mPieSlice(-1)
{
mValid = FALSE;
mUpdateXform = FALSE;
@@ -160,6 +160,7 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object)
{
object->extractAttachmentItemID();
// Same object reattached
if (isObjectAttached(object))
{
llinfos << "(same object re-attached)" << llendl;
@@ -202,7 +203,7 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object)
}
calcLOD();
mUpdateXform = TRUE;
return TRUE;
}
@@ -237,7 +238,7 @@ void LLViewerJointAttachment::removeObject(LLViewerObject *object)
//if object is active, make it static
if(object->mDrawable->isActive())
{
object->mDrawable->makeStatic(FALSE) ;
object->mDrawable->makeStatic(FALSE);
}
LLVector3 cur_position = object->getRenderPosition();
@@ -402,7 +403,6 @@ BOOL LLViewerJointAttachment::updateLOD(F32 pixel_area, BOOL activate)
return res;
}
BOOL LLViewerJointAttachment::isObjectAttached(const LLViewerObject *viewer_object) const
{
for (attachedobjs_vec_t::const_iterator iter = mAttachedObjects.begin();

View File

@@ -2,31 +2,25 @@
* @file llviewerjointattachment.h
* @brief Implementation of LLViewerJointAttachment class
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* 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.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* 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$
*/
@@ -76,21 +70,15 @@ public:
void setOriginalPosition(LLVector3 &position);
void setAttachmentVisibility(BOOL visible);
void setIsHUDAttachment(BOOL is_hud) { mIsHUDAttachment = is_hud; }
// BOOL getIsHUDAttachment() { return mIsHUDAttachment; }
// [RLVa:KB] - Checked: 2010-09-26 (RLVa-1.3.0a) | Added: RLVa-1.3.0a
BOOL getIsHUDAttachment() const { return mIsHUDAttachment; }
// [/RLVa:KB]
/*virtual*/ BOOL isAnimatable() const { return FALSE; }
BOOL isAnimatable() const { return FALSE; }
// S32 getGroup() { return mGroup; }
// S32 getPieSlice() { return mPieSlice; }
// S32 getNumObjects() { return mAttachedObjects.size(); }
// [RLVa:KB] - Checked: 2010-09-26 (RLVa-1.3.0a) | Added: RLVa-1.3.0a
S32 getGroup() const { return mGroup; }
S32 getPieSlice() const { return mPieSlice; }
S32 getNumObjects() const { return mAttachedObjects.size(); }
// [/RLVa:KB]
S32 getNumObjects() const { return mAttachedObjects.size(); }
void clampObjectPosition();
//
// unique methods
@@ -98,8 +86,6 @@ public:
BOOL addObject(LLViewerObject* object);
void removeObject(LLViewerObject *object);
void clampObjectPosition();
//
// attachments operations
//

View File

@@ -2704,7 +2704,7 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data)
LLPointer<LLInventoryObject> obj;
obj = new LLInventoryObject(object->mID, LLUUID::null,
LLAssetType::AT_CATEGORY,
std::string("Contents"));
"Contents");
object->mInventory->push_front(obj);
object->doInventoryCallback();
delete ft;

View File

@@ -1,32 +1,26 @@
/**
* @file llvoavatar.cpp
* @brief Implementation of LLVOAvatar class which is a derivation fo LLViewerObject
* @File llvoavatar.cpp
* @brief Implementation of LLVOAvatar class which is a derivation of LLViewerObject
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* 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.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* 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$
*/
@@ -2930,66 +2924,6 @@ void LLVOAvatar::idleUpdateBoobEffect()
mBoobState = newBoobState;
}
/*
if(mFirstSetActualButtGravRan)
{
// BUTT
EmeraldBoobInputs buttInputs;
buttInputs.type = 1;
buttInputs.chestPosition = mPelvisp->getWorldPosition();
buttInputs.chestRotation = mPelvisp->getWorldRotation();
buttInputs.elapsedTime = mBoobBounceTimer.getElapsedTimeF32();
buttInputs.appearanceFlag = getAppearanceFlag();
EmeraldBoobState newButtState = EmeraldBoobUtils::idleUpdate(sBoobConfig, mLocalBoobConfig, mButtState, buttInputs);
if(mButtState.boobGrav != newButtState.boobGrav)
{
LLVisualParam *param;
param = getVisualParam(795);
ESex avatar_sex = getSex();
param->stopAnimating(FALSE);
param->setWeight(newButtState.boobGrav*0.3f+getActualButtGrav(), FALSE);
param->apply(avatar_sex);
updateVisualParams();
}
mButtState = newButtState;
}
if(mFirstSetActualFatGravRan)
{
// FAT
EmeraldBoobInputs fatInputs;
fatInputs.type = 2;
fatInputs.chestPosition = mPelvisp->getWorldPosition();
fatInputs.chestRotation = mPelvisp->getWorldRotation();
fatInputs.elapsedTime = mBoobBounceTimer.getElapsedTimeF32();
fatInputs.appearanceFlag = getAppearanceFlag();
EmeraldBoobState newFatState = EmeraldBoobUtils::idleUpdate(sBoobConfig, mLocalBoobConfig, mFatState, fatInputs);
if(mFatState.boobGrav != newFatState.boobGrav)
{
LLVisualParam *param;
param = getVisualParam(157);
ESex avatar_sex = getSex();
param->stopAnimating(FALSE);
param->setWeight(newFatState.boobGrav*0.3f+getActualFatGrav(), FALSE);
param->apply(avatar_sex);
updateVisualParams();
}
mFatState = newFatState;
}
*/
}
void LLVOAvatar::idleUpdateLipSync(bool voice_enabled)
@@ -6863,6 +6797,7 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o
// <edit> testzone attachpt
if(!attachment)
{
llwarns << "Failed to find attachment." << llendl;
S32 attachmentID = ATTACHMENT_ID_FROM_STATE(viewer_object->getState());
LLUUID item_id;
LLNameValue* item_id_nv = viewer_object->getNVPair("AttachItemID");
@@ -7286,6 +7221,7 @@ LLVOAvatar* LLVOAvatar::findAvatarFromAttachment( LLViewerObject* obj )
return NULL;
}
// warning: order(N) not order(1)
S32 LLVOAvatar::getAttachmentCount()
{
S32 count = mAttachmentPoints.size();
@@ -8699,7 +8635,6 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
// static
void LLVOAvatar::dumpArchetypeXML( void* )
{
LLVOAvatar* avatar = gAgentAvatarp;
LLAPRFile outfile(gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER, "new archetype.xml"), LL_APR_WB);
apr_file_t* file = outfile.getFileHandle() ;
if( !file )
@@ -8732,7 +8667,8 @@ void LLVOAvatar::dumpArchetypeXML( void* )
{
if( LLVOAvatarDictionary::getTEWearableType((ETextureIndex)te) == type )
{
LLViewerTexture* te_image = avatar->getTEImage((ETextureIndex)te);
// MULTIPLE_WEARABLES: extend to multiple wearables?
LLViewerTexture* te_image = ((LLVOAvatar *)(gAgentAvatarp))->getImage((ETextureIndex)te, 0);
if( te_image )
{
std::string uuid_str;

View File

@@ -2,31 +2,25 @@
* @file llvoinventorylistener.cpp
* @brief Interface for classes that wish to receive updates about viewer object inventory
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* 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.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* 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$
*/

View File

@@ -2,31 +2,25 @@
* @file llvoinventorylistener.h
* @brief Interface for classes that wish to receive updates about viewer object inventory
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* 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.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* 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$
*/

View File

@@ -2,31 +2,25 @@
* @file llwearable.cpp
* @brief LLWearable class implementation
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* 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.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* 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$
*/
@@ -528,7 +522,7 @@ BOOL LLWearable::isOldVersion() const
param;
param = (LLViewerVisualParam*) gAgentAvatarp->getNextVisualParam() )
{
if( (param->getWearableType() == mType) && (param->isTweakable()) )
if( (param->getWearableType() == mType) && (param->isTweakable() ) )
{
param_count++;
if( !is_in_map(mVisualParamIndexMap, param->getID() ) )
@@ -708,13 +702,7 @@ void LLWearable::writeToAvatar()
//ZOMG: When switching shapes from inventory
if(param_id == 507)
gAgentAvatarp->setActualBoobGrav(weight);
/*if(param_id == 795)
gAgentAvatarp->setActualButtGrav(weight);
if(param_id == 157)
gAgentAvatarp->setActualFatGrav(weight);
*/
// only animate with user-originated changes
gAgentAvatarp->setVisualParamWeight( param_id, weight, FALSE );
}
}
@@ -850,11 +838,6 @@ void LLWearable::copyDataFrom(const LLWearable* src)
//pretty sure right
if(id == 507)
gAgentAvatarp->setActualBoobGrav(weight);
/*if(id == 795)
gAgentAvatarp->setActualButtGrav(weight);
if(id == 157)
gAgentAvatarp->setActualFatGrav(weight);
*/
mSavedVisualParamMap[id] = weight;
}
@@ -1059,7 +1042,6 @@ void LLWearable::revertValues()
LLVisualParam *param = getVisualParam(id);
if(param && !dynamic_cast<LLDriverParam*>(param) )
{
//param->setAnimationTarget(value, TRUE);
setVisualParamWeight(id, value, TRUE);
}
}
@@ -1072,7 +1054,6 @@ void LLWearable::revertValues()
LLVisualParam *param = getVisualParam(id);
if(param && dynamic_cast<LLDriverParam*>(param) )
{
//param->setAnimationTarget(value, TRUE);
setVisualParamWeight(id, value, TRUE);
}
}
@@ -1335,7 +1316,7 @@ void LLWearable::saveNewAsset() const
{
llinfos << "Update Agent Inventory via capability" << llendl;
LLSD body;
body["folder_id"] = gInventory.findCategoryUUIDForType(getAssetType());
body["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::assetToFolderType(getAssetType()));
body["asset_type"] = LLAssetType::lookup(getAssetType());
body["inventory_type"] = LLInventoryType::lookup(LLInventoryType::IT_WEARABLE);
body["name"] = getName();
@@ -1412,7 +1393,7 @@ std::ostream& operator<<(std::ostream &s, const LLWearable &w)
}
std::string terse_F32_to_string( F32 f )
std::string terse_F32_to_string(F32 f)
{
std::string r = llformat("%.2f", f);
S32 len = r.length();

View File

@@ -2,31 +2,25 @@
* @file llwearable.h
* @brief LLWearable class header file
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* 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.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* 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$
*/
@@ -55,7 +49,7 @@ class LLWearable
// Constructors and destructors
//--------------------------------------------------------------------
private:
// Private constructor used by LLWearableList
// Private constructors used by LLWearableList
LLWearable(const LLTransactionID& transactionID);
LLWearable(const LLAssetID& assetID);
public:

View File

@@ -2,31 +2,25 @@
* @file llwearablelist.cpp
* @brief LLWearableList class implementation
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* 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.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* 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$
*/
@@ -64,8 +58,6 @@ struct LLWearableArrivedData
S32 mRetries;
};
////////////////////////////////////////////////////////////////////////////
// LLWearableList
@@ -80,7 +72,7 @@ void LLWearableList::cleanup()
mList.clear();
}
void LLWearableList::getAsset( const LLAssetID& assetID, const std::string& wearable_name, LLAssetType::EType asset_type, void(*asset_arrived_callback)(LLWearable*, void* userdata), void* userdata )
void LLWearableList::getAsset(const LLAssetID& assetID, const std::string& wearable_name, LLAssetType::EType asset_type, void(*asset_arrived_callback)(LLWearable*, void* userdata), void* userdata)
{
llassert( (asset_type == LLAssetType::AT_CLOTHING) || (asset_type == LLAssetType::AT_BODYPART) );
LLWearable* instance = get_if_there(mList, assetID, (LLWearable*)NULL );
@@ -212,45 +204,6 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID
}
// Creates a new wearable just like the old_wearable but with data copied over from item
LLWearable* LLWearableList::createWearableMatchedToInventoryItem( LLWearable* old_wearable, LLViewerInventoryItem* item )
{
lldebugs << "LLWearableList::createWearableMatchedToInventoryItem()" << llendl;
LLWearable* wearable = generateNewWearable();
wearable->copyDataFrom( old_wearable );
wearable->setName( item->getName() );
wearable->setDescription( item->getDescription() );
wearable->setPermissions( item->getPermissions() );
wearable->setSaleInfo( item->getSaleInfo() );
// Send to the dataserver
wearable->saveNewAsset();
return wearable;
}
/*LLWearable* LLWearableList::createCopyFromAvatar( LLWearable* old_wearable, const std::string& new_name )
{
lldebugs << "LLWearableList::createCopyFromAvatar()" << llendl;
LLWearable* wearable = generateNewWearable();
wearable->copyDataFrom( old_wearable );
LLPermissions perm(old_wearable->getPermissions());
perm.setOwnerAndGroup(LLUUID::null, gAgent.getID(), LLUUID::null, true);
wearable->setPermissions(perm);
wearable->readFromAvatar(); // update from the avatar
if (!new_name.empty()) wearable->setName(new_name);
// Send to the dataserver
wearable->saveNewAsset();
return wearable;
}*/
LLWearable* LLWearableList::createCopy(const LLWearable* old_wearable, const std::string& new_name)
{
lldebugs << "LLWearableList::createCopy()" << llendl;

View File

@@ -2,31 +2,25 @@
* @file llwearablelist.h
* @brief LLWearableList class header file
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* 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.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* 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$
*/
@@ -52,7 +46,7 @@ public:
~LLWearableList();
void cleanup() ;
S32 getLength() { return mList.size(); }
S32 getLength() const { return mList.size(); }
void getAsset(const LLAssetID& assetID,
const std::string& wearable_name,
@@ -60,10 +54,8 @@ public:
void(*asset_arrived_callback)(LLWearable*, void* userdata),
void* userdata);
LLWearable* createWearableMatchedToInventoryItem( LLWearable* old_wearable, LLViewerInventoryItem* item );
//LLWearable* createCopyFromAvatar( LLWearable* old_wearable, const std::string& new_name = std::string() );
LLWearable* createCopy(const LLWearable* old_wearable, const std::string& new_name = std::string());
LLWearable* createNewWearable( LLWearableType::EType type );
LLWearable* createNewWearable(LLWearableType::EType type);
// Callback
static void processGetAssetReply(const char* filename, const LLAssetID& assetID, void* user_data, S32 status, LLExtStat ext_status);

View File

@@ -40,6 +40,7 @@ struct WearableEntry : public LLDictionaryEntry
LLDictionaryEntry(name),
mAssetType(assetType),
mDefaultNewName(default_new_name),
//*TODO:Translate
mLabel(/*LLTrans::getString*/(name)),
mIconName(iconName),
mDisableCameraSwitch(disable_camera_switch),

View File

@@ -37,23 +37,23 @@ class LLWearableType
public:
enum EType
{
WT_SHAPE = 0,
WT_SKIN = 1,
WT_HAIR = 2,
WT_EYES = 3,
WT_SHIRT = 4,
WT_PANTS = 5,
WT_SHOES = 6,
WT_SOCKS = 7,
WT_JACKET = 8,
WT_GLOVES = 9,
WT_SHAPE = 0,
WT_SKIN = 1,
WT_HAIR = 2,
WT_EYES = 3,
WT_SHIRT = 4,
WT_PANTS = 5,
WT_SHOES = 6,
WT_SOCKS = 7,
WT_JACKET = 8,
WT_GLOVES = 9,
WT_UNDERSHIRT = 10,
WT_UNDERPANTS = 11,
WT_SKIRT = 12,
WT_ALPHA = 13,
WT_TATTOO = 14,
WT_PHYSICS = 15,
WT_COUNT = 16,
WT_SKIRT = 12,
WT_ALPHA = 13,
WT_TATTOO = 14,
WT_PHYSICS = 15,
WT_COUNT = 16,
WT_INVALID = 255,
WT_NONE = -1,
@@ -73,5 +73,4 @@ protected:
~LLWearableType() {}
};
#endif // LL_LLWEARABLETYPE_H