Merge branch 'master' of git://github.com/Shyotl/SingularityViewer
This commit is contained in:
@@ -307,11 +307,11 @@ std::string LLFastTimer::NamedTimer::getToolTip(S32 history_idx)
|
||||
if (history_idx < 0)
|
||||
{
|
||||
// by default, show average number of call
|
||||
return llformat("%s (%d ms, %d calls)", getName().c_str(), (S32)(getCountAverage() * ms_multiplier), (S32)getCallAverage());
|
||||
return llformat("%s (%.2f ms, %d calls)", getName().c_str(), (F32)((F32)getCountAverage() * ms_multiplier), (S32)getCallAverage());
|
||||
}
|
||||
else
|
||||
{
|
||||
return llformat("%s (%d ms, %d calls)", getName().c_str(), (S32)(getHistoricalCount(history_idx) * ms_multiplier), (S32)getHistoricalCalls(history_idx));
|
||||
return llformat("%s (%.2f ms, %d calls)", getName().c_str(), (F32)((F32)getHistoricalCount(history_idx) * ms_multiplier), (S32)getHistoricalCalls(history_idx));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -498,6 +498,15 @@ void LLFastTimer::NamedTimer::accumulateTimings()
|
||||
}
|
||||
}
|
||||
|
||||
U32 LLFastTimer::NamedTimer::getCountAverage() const
|
||||
{
|
||||
return mCountAverage;// (sCurFrameIndex <= 0 || mCountAverage <= 0) ? 0 : mCountAverage / llmin(sCurFrameIndex,(S32)HISTORY_NUM);
|
||||
}
|
||||
U32 LLFastTimer::NamedTimer::getCallAverage() const
|
||||
{
|
||||
return mCallAverage;// (sCurFrameIndex <= 0 || mCallAverage <= 0) ? 0 : mCallAverage / llmin(sCurFrameIndex,(S32)HISTORY_NUM);
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFastTimer::NamedTimer::resetFrame()
|
||||
{
|
||||
|
||||
@@ -82,8 +82,8 @@ public:
|
||||
void setCollapsed(bool collapsed) { mCollapsed = collapsed; }
|
||||
bool getCollapsed() const { return mCollapsed; }
|
||||
|
||||
U32 getCountAverage() const { return mCountAverage; }
|
||||
U32 getCallAverage() const { return mCallAverage; }
|
||||
U32 getCountAverage() const; //{ return mCountAverage }
|
||||
U32 getCallAverage() const; //{ return mCallAverage }
|
||||
|
||||
U32 getHistoricalCount(S32 history_index = 0) const;
|
||||
U32 getHistoricalCalls(S32 history_index = 0) const;
|
||||
|
||||
@@ -206,14 +206,13 @@ void LLVBOPool::release(U32 name, volatile U8* buffer, U32 size)
|
||||
rec.mGLName = name;
|
||||
rec.mClientData = buffer;
|
||||
|
||||
sBytesPooled += size;
|
||||
|
||||
if (!LLVertexBuffer::sDisableVBOMapping && mUsage == GL_DYNAMIC_DRAW_ARB)
|
||||
{
|
||||
glDeleteBuffersARB(1, &rec.mGLName);
|
||||
}
|
||||
else
|
||||
{
|
||||
sBytesPooled += size;
|
||||
mFreeList[i].push_back(rec);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,6 +262,7 @@ set(viewer_SOURCE_FILES
|
||||
llfloaterwindlight.cpp
|
||||
llfloaterworldmap.cpp
|
||||
llfolderview.cpp
|
||||
llfolderviewitem.cpp
|
||||
llfollowcam.cpp
|
||||
llframestats.cpp
|
||||
llframestatview.cpp
|
||||
@@ -740,6 +741,7 @@ set(viewer_HEADER_FILES
|
||||
llfloaterworldmap.h
|
||||
llfolderview.h
|
||||
llfoldervieweventlistener.h
|
||||
llfolderviewitem.h
|
||||
llfollowcam.h
|
||||
llframestats.h
|
||||
llframestatview.h
|
||||
|
||||
@@ -3561,6 +3561,8 @@ void LLAgent::teleportCancel()
|
||||
|
||||
void LLAgent::teleportViaLocation(const LLVector3d& pos_global)
|
||||
{
|
||||
if(!isAgentAvatarValid())
|
||||
return;
|
||||
// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2010-03-02 (RLVa-1.1.1a) | Modified: RLVa-1.2.0a
|
||||
if (rlv_handler_t::isEnabled())
|
||||
{
|
||||
|
||||
@@ -288,6 +288,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask)
|
||||
// covering region for this new timer, go ahead and unblock
|
||||
// so we can create a new tooltip
|
||||
//LLToolTipMgr::instance().unblockToolTips();
|
||||
gViewerWindow->unblockToolTips();
|
||||
mHoverTimer = (*it);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -41,520 +41,28 @@
|
||||
#ifndef LL_LLFOLDERVIEW_H
|
||||
#define LL_LLFOLDERVIEW_H
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <deque>
|
||||
#include "llfolderviewitem.h" // because LLFolderView is-a LLFolderViewFolder
|
||||
|
||||
#include "lluictrl.h"
|
||||
#include "v4color.h"
|
||||
#include "lldarray.h"
|
||||
//#include "llviewermenu.h"
|
||||
#include "stdenums.h"
|
||||
#include "llfontgl.h"
|
||||
#include "lleditmenuhandler.h"
|
||||
#include "llviewertexture.h"
|
||||
#include "lldepthstack.h"
|
||||
#include "lleditmenuhandler.h"
|
||||
#include "llfontgl.h"
|
||||
#include "lltooldraganddrop.h"
|
||||
#include "llinventoryfilter.h"
|
||||
#include "llviewertexture.h"
|
||||
|
||||
class LLMenuGL;
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLFolderViewEventListener
|
||||
//
|
||||
// This is an abstract base class that users of the folderview classes
|
||||
// would use to catch the useful events emitted from the folder
|
||||
// views.
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
class LLFolderViewItem;
|
||||
class LLFolderView;
|
||||
class LLInventoryModel;
|
||||
class LLFolderViewFunctor;
|
||||
class LLScrollableContainerView;
|
||||
class LLFolderViewEventListener;
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLFolderViewListenerFunctor
|
||||
//
|
||||
// This simple abstract base class can be used to applied to all
|
||||
// listeners in a hierarchy.
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
class LLFolderViewListenerFunctor
|
||||
{
|
||||
public:
|
||||
virtual ~LLFolderViewListenerFunctor() {}
|
||||
virtual void operator()(LLFolderViewEventListener* listener) = 0;
|
||||
};
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLFolderViewFunctor
|
||||
//
|
||||
// Simple abstract base class for applying a functor to folders and
|
||||
// items in a folder view hierarchy. This is suboptimal for algorithms
|
||||
// that only work folders or only work on items, but I'll worry about
|
||||
// that later when it's determined to be too slow.
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
class LLFolderViewFolder;
|
||||
class LLFolderViewItem;
|
||||
class LLFolderViewFolder;
|
||||
|
||||
|
||||
|
||||
|
||||
// These are grouping of inventory types.
|
||||
// Order matters when sorting system folders to the top.
|
||||
enum EInventorySortGroup
|
||||
{
|
||||
SG_SYSTEM_FOLDER,
|
||||
SG_TRASH_FOLDER,
|
||||
SG_NORMAL_FOLDER,
|
||||
SG_ITEM
|
||||
};
|
||||
|
||||
class LLInventorySort
|
||||
{
|
||||
public:
|
||||
LLInventorySort()
|
||||
: mSortOrder(0),
|
||||
mByDate(false),
|
||||
mSystemToTop(false),
|
||||
mFoldersByName(false) { }
|
||||
|
||||
// Returns true if order has changed
|
||||
bool updateSort(U32 order);
|
||||
U32 getSort() { return mSortOrder; }
|
||||
|
||||
bool operator()(const LLFolderViewItem* const& a, const LLFolderViewItem* const& b);
|
||||
private:
|
||||
U32 mSortOrder;
|
||||
bool mByDate;
|
||||
bool mSystemToTop;
|
||||
bool mFoldersByName;
|
||||
};
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLFolderViewItem
|
||||
//
|
||||
// An instance of this class represents a single item in a folder view
|
||||
// such as an inventory item or a file.
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
class LLFontGL;
|
||||
class LLFolderViewFolder;
|
||||
class LLFolderView;
|
||||
|
||||
class LLFolderViewItem : public LLUICtrl
|
||||
{
|
||||
friend class LLFolderViewEventListener;
|
||||
|
||||
private:
|
||||
BOOL mIsSelected;
|
||||
|
||||
protected:
|
||||
static const LLFontGL* sFont;
|
||||
static const LLFontGL* sSmallFont;
|
||||
static LLColor4 sFgColor;
|
||||
static LLColor4 sHighlightBgColor;
|
||||
static LLColor4 sHighlightFgColor;
|
||||
static LLColor4 sFilterBGColor;
|
||||
static LLColor4 sFilterTextColor;
|
||||
static LLColor4 sSuffixColor;
|
||||
static LLColor4 sSearchStatusColor;
|
||||
static LLUIImagePtr sArrowImage;
|
||||
static LLUIImagePtr sBoxImage;
|
||||
|
||||
std::string mLabel;
|
||||
std::string mSearchableLabel;
|
||||
std::string mSearchableLabelDesc;
|
||||
std::string mSearchableLabelCreator;
|
||||
std::string mSearchable;
|
||||
std::string mType;
|
||||
S32 mLabelWidth;
|
||||
U32 mCreationDate;
|
||||
LLFolderViewFolder* mParentFolder;
|
||||
LLFolderViewEventListener* mListener;
|
||||
BOOL mIsCurSelection;
|
||||
BOOL mSelectPending;
|
||||
LLFontGL::StyleFlags mLabelStyle;
|
||||
std::string mLabelSuffix;
|
||||
LLUIImagePtr mIcon;
|
||||
std::string mStatusText;
|
||||
BOOL mHasVisibleChildren;
|
||||
S32 mIndentation;
|
||||
BOOL mFiltered;
|
||||
S32 mLastFilterGeneration;
|
||||
std::string::size_type mStringMatchOffset;
|
||||
F32 mControlLabelRotation;
|
||||
LLFolderView* mRoot;
|
||||
BOOL mDragAndDropTarget;
|
||||
BOOL mIsLoading;
|
||||
LLTimer mTimeSinceRequestStart;
|
||||
|
||||
// helper function to change the selection from the root.
|
||||
void changeSelectionFromRoot(LLFolderViewItem* selection, BOOL selected);
|
||||
|
||||
// helper function to change the selection from the root.
|
||||
void extendSelectionFromRoot(LLFolderViewItem* selection);
|
||||
|
||||
// this is an internal method used for adding items to folders. A
|
||||
// no-op at this leve, but reimplemented in derived classes.
|
||||
virtual BOOL addItem(LLFolderViewItem*) { return FALSE; }
|
||||
virtual BOOL addFolder(LLFolderViewFolder*) { return FALSE; }
|
||||
|
||||
public:
|
||||
// This function clears the currently selected item, and records
|
||||
// the specified selected item appropriately for display and use
|
||||
// in the UI. If open is TRUE, then folders are opened up along
|
||||
// the way to the selection.
|
||||
void setSelectionFromRoot(LLFolderViewItem* selection, BOOL openitem,
|
||||
BOOL take_keyboard_focus = TRUE);
|
||||
|
||||
static void initClass();
|
||||
static void cleanupClass();
|
||||
|
||||
// This function is called when the folder view is dirty. It's
|
||||
// implemented here but called by derived classes when folding the
|
||||
// views.
|
||||
void arrangeFromRoot();
|
||||
void filterFromRoot( void );
|
||||
|
||||
// creation_date is in UTC seconds
|
||||
LLFolderViewItem( const std::string& name, LLUIImagePtr icon, S32 creation_date, LLFolderView* root, LLFolderViewEventListener* listener );
|
||||
virtual ~LLFolderViewItem( void );
|
||||
|
||||
// addToFolder() returns TRUE if it succeeds. FALSE otherwise
|
||||
enum { ARRANGE = TRUE, DO_NOT_ARRANGE = FALSE };
|
||||
virtual BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root);
|
||||
|
||||
virtual EInventorySortGroup getSortGroup() const;
|
||||
|
||||
// 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.
|
||||
virtual S32 arrange( S32* width, S32* height, S32 filter_generation );
|
||||
virtual S32 getItemHeight();
|
||||
|
||||
// applies filters to control visibility of inventory items
|
||||
virtual void filter( LLInventoryFilter& filter);
|
||||
|
||||
// updates filter serial number and optionally propagated value up to root
|
||||
S32 getLastFilterGeneration() { return mLastFilterGeneration; }
|
||||
|
||||
virtual void dirtyFilter();
|
||||
|
||||
// If 'selection' is 'this' then note that otherwise ignore.
|
||||
// Returns TRUE if this item ends up being selected.
|
||||
virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus);
|
||||
|
||||
// This method is used to set the selection state of an item.
|
||||
// If 'selection' is 'this' then note selection.
|
||||
// Returns TRUE if the selection state of this item was changed.
|
||||
virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
|
||||
|
||||
// this method is used to group select items
|
||||
virtual void extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items) { }
|
||||
|
||||
// this method is used to deselect this element
|
||||
void deselectItem();
|
||||
|
||||
// this method is used to select this element
|
||||
void selectItem();
|
||||
|
||||
// gets multiple-element selection
|
||||
virtual BOOL getSelectionList(std::set<LLUUID> &selection){return TRUE;}
|
||||
|
||||
// Returns true is this object and all of its children can be removed (deleted by user)
|
||||
virtual BOOL isRemovable();
|
||||
|
||||
// Returns true is this object and all of its children can be moved
|
||||
virtual BOOL isMovable();
|
||||
|
||||
// destroys this item recursively
|
||||
virtual void destroyView();
|
||||
|
||||
BOOL isSelected() const { return mIsSelected; }
|
||||
|
||||
void setIsCurSelection(BOOL select) { mIsCurSelection = select; }
|
||||
|
||||
BOOL getIsCurSelection() { return mIsCurSelection; }
|
||||
|
||||
BOOL hasVisibleChildren() { return mHasVisibleChildren; }
|
||||
|
||||
// Call through to the viewed object and return true if it can be
|
||||
// removed. Returns true if it's removed.
|
||||
//virtual BOOL removeRecursively(BOOL single_item);
|
||||
BOOL remove();
|
||||
|
||||
// Build an appropriate context menu for the item. Flags unused.
|
||||
void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
|
||||
// This method returns the actual name of the thing being
|
||||
// viewed. This method will ask the viewed object itself.
|
||||
const std::string& getName( void ) const;
|
||||
|
||||
std::string& getSearchableLabel( void );
|
||||
|
||||
// This method returns the label displayed on the view. This
|
||||
// method was primarily added to allow sorting on the folder
|
||||
// contents possible before the entire view has been constructed.
|
||||
const std::string& getLabel() const { return mLabel; }
|
||||
|
||||
// Used for sorting, like getLabel() above.
|
||||
virtual time_t getCreationDate() const { return mCreationDate; }
|
||||
|
||||
LLFolderViewFolder* getParentFolder( void ) { return mParentFolder; }
|
||||
const LLFolderViewFolder* getParentFolder( void ) const { return mParentFolder; }
|
||||
|
||||
LLFolderViewItem* getNextOpenNode( BOOL include_children = TRUE );
|
||||
LLFolderViewItem* getPreviousOpenNode( BOOL include_children = TRUE );
|
||||
|
||||
const LLFolderViewEventListener* getListener( void ) const { return mListener; }
|
||||
LLFolderViewEventListener* getListener( void ) { return mListener; }
|
||||
|
||||
// just rename the object.
|
||||
void rename(const std::string& new_name);
|
||||
|
||||
// open
|
||||
virtual void openItem( void );
|
||||
virtual void preview(void);
|
||||
|
||||
// Show children (unfortunate that this is called "open")
|
||||
virtual void setOpen(BOOL open = TRUE) {};
|
||||
|
||||
virtual BOOL isOpen() { return FALSE; }
|
||||
|
||||
LLFolderView* getRoot();
|
||||
BOOL isDescendantOf( const LLFolderViewFolder* potential_ancestor );
|
||||
S32 getIndentation() { return mIndentation; }
|
||||
|
||||
virtual BOOL potentiallyVisible(); // do we know for a fact that this item has been filtered out?
|
||||
|
||||
virtual BOOL getFiltered();
|
||||
virtual BOOL getFiltered(S32 filter_generation);
|
||||
virtual void setFiltered(BOOL filtered, S32 filter_generation);
|
||||
|
||||
// change the icon
|
||||
void setIcon(LLUIImagePtr icon);
|
||||
|
||||
// refresh information from the object being viewed.
|
||||
void refreshFromListener();
|
||||
virtual void refresh();
|
||||
|
||||
virtual void applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor);
|
||||
|
||||
// LLView functionality
|
||||
virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleHover( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
|
||||
|
||||
// virtual void handleDropped();
|
||||
virtual void draw();
|
||||
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
|
||||
EDragAndDropType cargo_type,
|
||||
void* cargo_data,
|
||||
EAcceptance* accept,
|
||||
std::string& tooltip_msg);
|
||||
};
|
||||
|
||||
|
||||
// function used for sorting.
|
||||
typedef bool (*sort_order_f)(LLFolderViewItem* a, LLFolderViewItem* b);
|
||||
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLFolderViewFolder
|
||||
//
|
||||
// An instance of an LLFolderViewFolder represents a collection of
|
||||
// more folders and items. This is used to build the hierarchy of
|
||||
// items found in the folder view. :)
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
class LLFolderViewFolder : public LLFolderViewItem
|
||||
{
|
||||
public:
|
||||
typedef enum e_trash
|
||||
{
|
||||
UNKNOWN, TRASH, NOT_TRASH
|
||||
} ETrash;
|
||||
|
||||
private:
|
||||
S32 mNumDescendantsSelected;
|
||||
|
||||
public: // Accessed needed by LLFolderViewItem
|
||||
void recursiveIncrementNumDescendantsSelected(S32 increment);
|
||||
S32 numSelected(void) const { return mNumDescendantsSelected + (isSelected() ? 1 : 0); }
|
||||
|
||||
protected:
|
||||
typedef std::list<LLFolderViewItem*> items_t;
|
||||
typedef std::list<LLFolderViewFolder*> folders_t;
|
||||
items_t mItems;
|
||||
folders_t mFolders;
|
||||
LLInventorySort mSortFunction;
|
||||
|
||||
BOOL mIsOpen;
|
||||
BOOL mExpanderHighlighted;
|
||||
F32 mCurHeight;
|
||||
F32 mTargetHeight;
|
||||
F32 mAutoOpenCountdown;
|
||||
time_t mSubtreeCreationDate;
|
||||
mutable ETrash mAmTrash;
|
||||
S32 mLastArrangeGeneration;
|
||||
S32 mLastCalculatedWidth;
|
||||
S32 mCompletedFilterGeneration;
|
||||
S32 mMostFilteredDescendantGeneration;
|
||||
public:
|
||||
typedef enum e_recurse_type
|
||||
{
|
||||
RECURSE_NO,
|
||||
RECURSE_UP,
|
||||
RECURSE_DOWN,
|
||||
RECURSE_UP_DOWN
|
||||
} ERecurseType;
|
||||
|
||||
LLFolderViewFolder( const std::string& name, LLUIImagePtr icon,
|
||||
LLFolderView* root,
|
||||
LLFolderViewEventListener* listener );
|
||||
virtual ~LLFolderViewFolder( void );
|
||||
|
||||
virtual BOOL potentiallyVisible();
|
||||
|
||||
LLFolderViewItem* getNextFromChild( LLFolderViewItem*, BOOL include_children = TRUE );
|
||||
LLFolderViewItem* getPreviousFromChild( LLFolderViewItem*, BOOL include_children = TRUE );
|
||||
|
||||
// addToFolder() returns TRUE if it succeeds. FALSE otherwise
|
||||
virtual BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root);
|
||||
|
||||
// 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.
|
||||
virtual S32 arrange( S32* width, S32* height, S32 filter_generation );
|
||||
|
||||
BOOL needsArrange();
|
||||
|
||||
// Returns the sort group (system, trash, folder) for this folder.
|
||||
virtual EInventorySortGroup getSortGroup() const;
|
||||
|
||||
virtual void setCompletedFilterGeneration(S32 generation, BOOL recurse_up);
|
||||
virtual S32 getCompletedFilterGeneration() { return mCompletedFilterGeneration; }
|
||||
|
||||
BOOL hasFilteredDescendants(S32 filter_generation) { return mMostFilteredDescendantGeneration >= filter_generation; }
|
||||
BOOL hasFilteredDescendants();
|
||||
|
||||
// applies filters to control visibility of inventory items
|
||||
virtual void filter( LLInventoryFilter& filter);
|
||||
virtual void setFiltered(BOOL filtered, S32 filter_generation);
|
||||
virtual void dirtyFilter();
|
||||
|
||||
// Passes selection information on to children and record
|
||||
// selection information if necessary.
|
||||
// Returns TRUE if this object (or a child) ends up being selected.
|
||||
// If 'openitem' is TRUE then folders are opened up along the way to the selection.
|
||||
virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus);
|
||||
|
||||
// This method is used to change the selection of an item.
|
||||
// Recursively traverse all children; if 'selection' is 'this' then change
|
||||
// the select status if necessary.
|
||||
// Returns TRUE if the selection state of this folder, or of a child, was changed.
|
||||
virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
|
||||
|
||||
// this method is used to group select items
|
||||
virtual void extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items);
|
||||
|
||||
// Deselect this folder and all folder/items it contains recursively.
|
||||
void recursiveDeselect(BOOL deselect_self);
|
||||
|
||||
// Returns true is this object and all of its children can be removed.
|
||||
virtual BOOL isRemovable();
|
||||
|
||||
// Returns true is this object and all of its children can be moved
|
||||
virtual BOOL isMovable();
|
||||
|
||||
// destroys this folder, and all children
|
||||
virtual void destroyView();
|
||||
|
||||
// If this folder can be removed, remove all children that can be
|
||||
// removed, return TRUE if this is empty after the operation and
|
||||
// it's viewed folder object can be removed.
|
||||
//virtual BOOL removeRecursively(BOOL single_item);
|
||||
//virtual BOOL remove();
|
||||
|
||||
// remove the specified item (and any children) if
|
||||
// possible. Return TRUE if the item was deleted.
|
||||
BOOL removeItem(LLFolderViewItem* item);
|
||||
|
||||
// simply remove the view (and any children) Don't bother telling
|
||||
// the listeners.
|
||||
void removeView(LLFolderViewItem* item);
|
||||
|
||||
// extractItem() removes the specified item from the folder, but
|
||||
// doesn't delete it.
|
||||
void extractItem( LLFolderViewItem* item );
|
||||
|
||||
// This function is called by a child that needs to be resorted.
|
||||
void resort(LLFolderViewItem* item);
|
||||
|
||||
void setItemSortOrder(U32 ordering);
|
||||
void sortBy(U32);
|
||||
//BOOL (*func)(LLFolderViewItem* a, LLFolderViewItem* b));
|
||||
|
||||
void setAutoOpenCountdown(F32 countdown) { mAutoOpenCountdown = countdown; }
|
||||
|
||||
// folders can be opened. This will usually be called by internal
|
||||
// methods.
|
||||
virtual void toggleOpen();
|
||||
|
||||
// Force a folder open or closed
|
||||
virtual void setOpen(BOOL openitem = TRUE);
|
||||
|
||||
// Called when a child is refreshed.
|
||||
// don't rearrange child folder contents unless explicitly requested
|
||||
virtual void requestArrange(BOOL include_descendants = FALSE);
|
||||
|
||||
// internal method which doesn't update the entire view. This
|
||||
// method was written because the list iterators destroy the state
|
||||
// of other iterations, thus, we can't arrange while iterating
|
||||
// through the children (such as when setting which is selected.
|
||||
virtual void setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse = RECURSE_NO);
|
||||
|
||||
// Get the current state of the folder.
|
||||
virtual BOOL isOpen() { return mIsOpen; }
|
||||
|
||||
// special case if an object is dropped on the child.
|
||||
BOOL handleDragAndDropFromChild(MASK mask,
|
||||
BOOL drop,
|
||||
EDragAndDropType cargo_type,
|
||||
void* cargo_data,
|
||||
EAcceptance* accept,
|
||||
std::string& tooltip_msg);
|
||||
|
||||
void applyFunctorRecursively(LLFolderViewFunctor& functor);
|
||||
virtual void applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor);
|
||||
|
||||
virtual void openItem( void );
|
||||
virtual BOOL addItem(LLFolderViewItem* item);
|
||||
virtual BOOL addFolder( LLFolderViewFolder* folder);
|
||||
|
||||
// LLView functionality
|
||||
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
|
||||
EDragAndDropType cargo_type,
|
||||
void* cargo_data,
|
||||
EAcceptance* accept,
|
||||
std::string& tooltip_msg);
|
||||
virtual void draw();
|
||||
|
||||
time_t getCreationDate() const;
|
||||
bool isTrash() const;
|
||||
S32 getNumSelectedDescendants(void) const { return mNumDescendantsSelected; }
|
||||
};
|
||||
|
||||
class LLInventoryModel;
|
||||
class LLPanel;
|
||||
class LLLineEditor;
|
||||
class LLMenuGL;
|
||||
class LLScrollableContainerView;
|
||||
class LLUICtrl;
|
||||
class LLTextBox;
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLFolderView
|
||||
@@ -579,22 +87,25 @@ public:
|
||||
|
||||
virtual BOOL canFocusChildren() const;
|
||||
|
||||
virtual LLFolderView* getRoot() { return this; }
|
||||
|
||||
// FolderViews default to sort by name. This will change that,
|
||||
// and resort the items if necessary.
|
||||
void setSortOrder(U32 order);
|
||||
void checkTreeResortForModelChanged();
|
||||
void setFilterPermMask(PermissionMask filter_perm_mask) { mFilter.setFilterPermissions(filter_perm_mask); }
|
||||
void setFilterPermMask(PermissionMask filter_perm_mask);
|
||||
void setSelectCallback(SelectCallback callback, void* user_data) { mSelectCallback = callback, mUserData = user_data; }
|
||||
void setAllowMultiSelect(BOOL allow) { mAllowMultiSelect = allow; }
|
||||
|
||||
LLInventoryFilter* getFilter() { return &mFilter; }
|
||||
LLInventoryFilter* getFilter();
|
||||
const std::string getFilterSubString(BOOL trim = FALSE);
|
||||
bool getFilterWorn() const { return mFilter.getFilterWorn(); }
|
||||
U32 getFilterTypes() const { return mFilter.getFilterTypes(); }
|
||||
PermissionMask getFilterPermissions() const { return mFilter.getFilterPermissions(); }
|
||||
LLInventoryFilter::EFolderShow getShowFolderState() { return mFilter.getShowFolderState(); }
|
||||
bool getFilterWorn() const;
|
||||
U32 getFilterTypes() const;
|
||||
PermissionMask getFilterPermissions() const;
|
||||
// *NOTE: use getFilter()->getShowFolderState();
|
||||
//LLInventoryFilter::EFolderShow getShowFolderState();
|
||||
U32 getSortOrder() const;
|
||||
BOOL isFilterModified() { return mFilter.isNotDefault(); }
|
||||
BOOL isFilterModified();
|
||||
BOOL getAllowMultiSelect() { return mAllowMultiSelect; }
|
||||
|
||||
U32 toggleSearchType(std::string toggle);
|
||||
@@ -765,7 +276,7 @@ protected:
|
||||
LLFrameTimer mAutoOpenTimer;
|
||||
LLFrameTimer mSearchTimer;
|
||||
std::string mSearchString;
|
||||
LLInventoryFilter mFilter;
|
||||
LLInventoryFilter* mFilter;
|
||||
BOOL mShowSelectionContext;
|
||||
BOOL mShowSingleSelection;
|
||||
LLFrameTimer mMultiSelectionFadeTimer;
|
||||
|
||||
2555
indra/newview/llfolderviewitem.cpp
Normal file
2555
indra/newview/llfolderviewitem.cpp
Normal file
File diff suppressed because it is too large
Load Diff
541
indra/newview/llfolderviewitem.h
Normal file
541
indra/newview/llfolderviewitem.h
Normal file
@@ -0,0 +1,541 @@
|
||||
/**
|
||||
* @file llfolderviewitem.h
|
||||
* @brief Items and folders that can appear in a hierarchical folder view
|
||||
*
|
||||
* $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 LLFOLDERVIEWITEM_H
|
||||
#define LLFOLDERVIEWITEM_H
|
||||
|
||||
#include "llview.h"
|
||||
#include "lldarray.h" // *TODO: Eliminate, forward declare
|
||||
#include "lluiimage.h"
|
||||
#include "lluictrl.h"
|
||||
|
||||
class LLFontGL;
|
||||
class LLFolderView;
|
||||
class LLFolderViewEventListener;
|
||||
class LLFolderViewFolder;
|
||||
class LLFolderViewFunctor;
|
||||
class LLFolderViewItem;
|
||||
class LLFolderViewListenerFunctor;
|
||||
class LLInventoryFilter;
|
||||
class LLMenuGL;
|
||||
class LLUIImage;
|
||||
class LLViewerInventoryItem;
|
||||
|
||||
// These are grouping of inventory types.
|
||||
// Order matters when sorting system folders to the top.
|
||||
enum EInventorySortGroup
|
||||
{
|
||||
SG_SYSTEM_FOLDER,
|
||||
SG_TRASH_FOLDER,
|
||||
SG_NORMAL_FOLDER,
|
||||
SG_ITEM
|
||||
};
|
||||
|
||||
// *TODO: do we really need one sort object per folder?
|
||||
// can we just have one of these per LLFolderView ?
|
||||
class LLInventorySort
|
||||
{
|
||||
public:
|
||||
LLInventorySort()
|
||||
: mSortOrder(0),
|
||||
mByDate(false),
|
||||
mSystemToTop(false),
|
||||
mFoldersByName(false) { }
|
||||
|
||||
// Returns true if order has changed
|
||||
bool updateSort(U32 order);
|
||||
U32 getSort() { return mSortOrder; }
|
||||
bool isByDate() { return mByDate; }
|
||||
|
||||
bool operator()(const LLFolderViewItem* const& a, const LLFolderViewItem* const& b);
|
||||
private:
|
||||
U32 mSortOrder;
|
||||
bool mByDate;
|
||||
bool mSystemToTop;
|
||||
bool mFoldersByName;
|
||||
};
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLFolderViewItem
|
||||
//
|
||||
// An instance of this class represents a single item in a folder view
|
||||
// such as an inventory item or a file.
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
class LLFolderViewItem : public LLUICtrl
|
||||
{
|
||||
public:
|
||||
static void initClass();
|
||||
static void cleanupClass();
|
||||
friend class LLFolderViewEventListener;
|
||||
|
||||
static const S32 LEFT_PAD = 5;
|
||||
static const S32 LEFT_INDENTATION = 13;
|
||||
static const S32 ICON_PAD = 2;
|
||||
static const S32 ICON_WIDTH = 16;
|
||||
static const S32 TEXT_PAD = 1;
|
||||
static const S32 ARROW_SIZE = 12;
|
||||
static const S32 MAX_FOLDER_ITEM_OVERLAP = 2;
|
||||
// animation parameters
|
||||
static const F32 FOLDER_CLOSE_TIME_CONSTANT;
|
||||
static const F32 FOLDER_OPEN_TIME_CONSTANT;
|
||||
private:
|
||||
BOOL mIsSelected;
|
||||
|
||||
protected:
|
||||
static const LLFontGL* sFont;
|
||||
static const LLFontGL* sSmallFont;
|
||||
static LLColor4 sFgColor;
|
||||
static LLColor4 sHighlightBgColor;
|
||||
static LLColor4 sHighlightFgColor;
|
||||
static LLColor4 sFilterBGColor;
|
||||
static LLColor4 sFilterTextColor;
|
||||
static LLColor4 sSuffixColor;
|
||||
static LLColor4 sSearchStatusColor;
|
||||
static LLUIImagePtr sArrowImage;
|
||||
static LLUIImagePtr sBoxImage;
|
||||
|
||||
std::string mLabel;
|
||||
std::string mSearchableLabel;
|
||||
std::string mSearchableLabelDesc;
|
||||
std::string mSearchableLabelCreator;
|
||||
std::string mSearchable;
|
||||
std::string mType;
|
||||
S32 mLabelWidth;
|
||||
U32 mCreationDate;
|
||||
LLFolderViewFolder* mParentFolder;
|
||||
LLFolderViewEventListener* mListener;
|
||||
BOOL mIsCurSelection;
|
||||
BOOL mSelectPending;
|
||||
LLFontGL::StyleFlags mLabelStyle;
|
||||
std::string mLabelSuffix;
|
||||
LLUIImagePtr mIcon;
|
||||
std::string mStatusText;
|
||||
BOOL mHasVisibleChildren;
|
||||
S32 mIndentation;
|
||||
BOOL mPassedFilter;
|
||||
S32 mLastFilterGeneration;
|
||||
std::string::size_type mStringMatchOffset;
|
||||
F32 mControlLabelRotation;
|
||||
LLFolderView* mRoot;
|
||||
BOOL mDragAndDropTarget;
|
||||
BOOL mIsLoading;
|
||||
LLTimer mTimeSinceRequestStart;
|
||||
|
||||
// helper function to change the selection from the root.
|
||||
void changeSelectionFromRoot(LLFolderViewItem* selection, BOOL selected);
|
||||
|
||||
// helper function to change the selection from the root.
|
||||
void extendSelectionFromRoot(LLFolderViewItem* selection);
|
||||
|
||||
// this is an internal method used for adding items to folders. A
|
||||
// no-op at this leve, but reimplemented in derived classes.
|
||||
virtual BOOL addItem(LLFolderViewItem*) { return FALSE; }
|
||||
virtual BOOL addFolder(LLFolderViewFolder*) { return FALSE; }
|
||||
|
||||
public:
|
||||
// This function clears the currently selected item, and records
|
||||
// the specified selected item appropriately for display and use
|
||||
// in the UI. If open is TRUE, then folders are opened up along
|
||||
// the way to the selection.
|
||||
void setSelectionFromRoot(LLFolderViewItem* selection, BOOL openitem,
|
||||
BOOL take_keyboard_focus = TRUE);
|
||||
|
||||
|
||||
|
||||
// This function is called when the folder view is dirty. It's
|
||||
// implemented here but called by derived classes when folding the
|
||||
// views.
|
||||
void arrangeFromRoot();
|
||||
void filterFromRoot( void );
|
||||
|
||||
// creation_date is in UTC seconds
|
||||
LLFolderViewItem( const std::string& name, LLUIImagePtr icon, S32 creation_date, LLFolderView* root, LLFolderViewEventListener* listener );
|
||||
virtual ~LLFolderViewItem( void );
|
||||
|
||||
// addToFolder() returns TRUE if it succeeds. FALSE otherwise
|
||||
enum { ARRANGE = TRUE, DO_NOT_ARRANGE = FALSE };
|
||||
virtual BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root);
|
||||
|
||||
virtual EInventorySortGroup getSortGroup() const;
|
||||
|
||||
// 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.
|
||||
virtual S32 arrange( S32* width, S32* height, S32 filter_generation );
|
||||
virtual S32 getItemHeight();
|
||||
|
||||
// applies filters to control visibility of inventory items
|
||||
virtual void filter( LLInventoryFilter& filter);
|
||||
|
||||
// updates filter serial number and optionally propagated value up to root
|
||||
S32 getLastFilterGeneration() { return mLastFilterGeneration; }
|
||||
|
||||
virtual void dirtyFilter();
|
||||
|
||||
// If 'selection' is 'this' then note that otherwise ignore.
|
||||
// Returns TRUE if this item ends up being selected.
|
||||
virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus);
|
||||
|
||||
// This method is used to set the selection state of an item.
|
||||
// If 'selection' is 'this' then note selection.
|
||||
// Returns TRUE if the selection state of this item was changed.
|
||||
virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
|
||||
|
||||
// this method is used to group select items
|
||||
virtual void extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items) { }
|
||||
|
||||
// this method is used to deselect this element
|
||||
void deselectItem();
|
||||
|
||||
// this method is used to select this element
|
||||
virtual void selectItem();
|
||||
|
||||
// gets multiple-element selection
|
||||
virtual BOOL getSelectionList(std::set<LLUUID> &selection){return TRUE;}
|
||||
|
||||
// Returns true is this object and all of its children can be removed (deleted by user)
|
||||
virtual BOOL isRemovable();
|
||||
|
||||
// Returns true is this object and all of its children can be moved
|
||||
virtual BOOL isMovable();
|
||||
|
||||
// destroys this item recursively
|
||||
virtual void destroyView();
|
||||
|
||||
BOOL isSelected() const { return mIsSelected; }
|
||||
|
||||
void setIsCurSelection(BOOL select) { mIsCurSelection = select; }
|
||||
|
||||
BOOL getIsCurSelection() { return mIsCurSelection; }
|
||||
|
||||
BOOL hasVisibleChildren() { return mHasVisibleChildren; }
|
||||
|
||||
// Call through to the viewed object and return true if it can be
|
||||
// removed. Returns true if it's removed.
|
||||
//virtual BOOL removeRecursively(BOOL single_item);
|
||||
BOOL remove();
|
||||
|
||||
// Build an appropriate context menu for the item. Flags unused.
|
||||
void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
|
||||
// This method returns the actual name of the thing being
|
||||
// viewed. This method will ask the viewed object itself.
|
||||
const std::string& getName( void ) const;
|
||||
|
||||
std::string& getSearchableLabel( void );
|
||||
|
||||
// This method returns the label displayed on the view. This
|
||||
// method was primarily added to allow sorting on the folder
|
||||
// contents possible before the entire view has been constructed.
|
||||
const std::string& getLabel() const { return mLabel; }
|
||||
|
||||
// Used for sorting, like getLabel() above.
|
||||
virtual time_t getCreationDate() const { return mCreationDate; }
|
||||
|
||||
LLFolderViewFolder* getParentFolder( void ) { return mParentFolder; }
|
||||
const LLFolderViewFolder* getParentFolder( void ) const { return mParentFolder; }
|
||||
|
||||
LLFolderViewItem* getNextOpenNode( BOOL include_children = TRUE );
|
||||
LLFolderViewItem* getPreviousOpenNode( BOOL include_children = TRUE );
|
||||
|
||||
const LLFolderViewEventListener* getListener( void ) const { return mListener; }
|
||||
LLFolderViewEventListener* getListener( void ) { return mListener; }
|
||||
|
||||
// Gets the inventory item if it exists (null otherwise)
|
||||
LLViewerInventoryItem * getInventoryItem(void);
|
||||
|
||||
// just rename the object.
|
||||
void rename(const std::string& new_name);
|
||||
|
||||
// open
|
||||
virtual void openItem( void );
|
||||
virtual void preview(void);
|
||||
|
||||
// Show children (unfortunate that this is called "open")
|
||||
virtual void setOpen(BOOL open = TRUE) {};
|
||||
|
||||
virtual BOOL isOpen() { return FALSE; }
|
||||
|
||||
virtual LLFolderView* getRoot();
|
||||
BOOL isDescendantOf( const LLFolderViewFolder* potential_ancestor );
|
||||
S32 getIndentation() { return mIndentation; }
|
||||
|
||||
virtual BOOL potentiallyVisible(); // do we know for a fact that this item has been filtered out?
|
||||
|
||||
virtual BOOL getFiltered();
|
||||
virtual BOOL getFiltered(S32 filter_generation);
|
||||
virtual void setFiltered(BOOL filtered, S32 filter_generation);
|
||||
|
||||
// change the icon
|
||||
void setIcon(LLUIImagePtr icon);
|
||||
|
||||
// refresh information from the object being viewed.
|
||||
void refreshFromListener();
|
||||
virtual void refresh();
|
||||
|
||||
virtual void applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor);
|
||||
|
||||
// LLView functionality
|
||||
virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleHover( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
|
||||
|
||||
// virtual void handleDropped();
|
||||
virtual void draw();
|
||||
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
|
||||
EDragAndDropType cargo_type,
|
||||
void* cargo_data,
|
||||
EAcceptance* accept,
|
||||
std::string& tooltip_msg);
|
||||
};
|
||||
|
||||
|
||||
// function used for sorting.
|
||||
typedef bool (*sort_order_f)(LLFolderViewItem* a, LLFolderViewItem* b);
|
||||
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLFolderViewFolder
|
||||
//
|
||||
// An instance of an LLFolderViewFolder represents a collection of
|
||||
// more folders and items. This is used to build the hierarchy of
|
||||
// items found in the folder view. :)
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
class LLFolderViewFolder : public LLFolderViewItem
|
||||
{
|
||||
protected:
|
||||
LLFolderViewFolder( const std::string& name, LLUIImagePtr icon,
|
||||
LLFolderView* root,
|
||||
LLFolderViewEventListener* listener );
|
||||
|
||||
friend class LLBuildNewViewsScheduler;
|
||||
friend class LLPanelInventory;
|
||||
friend class LLInventoryPanel;
|
||||
|
||||
public:
|
||||
typedef enum e_trash
|
||||
{
|
||||
UNKNOWN, TRASH, NOT_TRASH
|
||||
} ETrash;
|
||||
|
||||
typedef std::list<LLFolderViewItem*> items_t;
|
||||
typedef std::list<LLFolderViewFolder*> folders_t;
|
||||
|
||||
private:
|
||||
S32 mNumDescendantsSelected;
|
||||
|
||||
public: // Accessed needed by LLFolderViewItem
|
||||
void recursiveIncrementNumDescendantsSelected(S32 increment);
|
||||
S32 numSelected(void) const { return mNumDescendantsSelected + (isSelected() ? 1 : 0); }
|
||||
|
||||
protected:
|
||||
items_t mItems;
|
||||
folders_t mFolders;
|
||||
LLInventorySort mSortFunction;
|
||||
|
||||
BOOL mIsOpen;
|
||||
BOOL mExpanderHighlighted;
|
||||
F32 mCurHeight;
|
||||
F32 mTargetHeight;
|
||||
F32 mAutoOpenCountdown;
|
||||
time_t mSubtreeCreationDate;
|
||||
mutable ETrash mAmTrash;
|
||||
S32 mLastArrangeGeneration;
|
||||
S32 mLastCalculatedWidth;
|
||||
S32 mCompletedFilterGeneration;
|
||||
S32 mMostFilteredDescendantGeneration;
|
||||
public:
|
||||
typedef enum e_recurse_type
|
||||
{
|
||||
RECURSE_NO,
|
||||
RECURSE_UP,
|
||||
RECURSE_DOWN,
|
||||
RECURSE_UP_DOWN
|
||||
} ERecurseType;
|
||||
|
||||
|
||||
virtual ~LLFolderViewFolder( void );
|
||||
|
||||
virtual BOOL potentiallyVisible();
|
||||
|
||||
LLFolderViewItem* getNextFromChild( LLFolderViewItem*, BOOL include_children = TRUE );
|
||||
LLFolderViewItem* getPreviousFromChild( LLFolderViewItem*, BOOL include_children = TRUE );
|
||||
|
||||
// addToFolder() returns TRUE if it succeeds. FALSE otherwise
|
||||
virtual BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root);
|
||||
|
||||
// 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.
|
||||
virtual S32 arrange( S32* width, S32* height, S32 filter_generation );
|
||||
|
||||
BOOL needsArrange();
|
||||
|
||||
// Returns the sort group (system, trash, folder) for this folder.
|
||||
virtual EInventorySortGroup getSortGroup() const;
|
||||
|
||||
virtual void setCompletedFilterGeneration(S32 generation, BOOL recurse_up);
|
||||
virtual S32 getCompletedFilterGeneration() { return mCompletedFilterGeneration; }
|
||||
|
||||
BOOL hasFilteredDescendants(S32 filter_generation) { return mMostFilteredDescendantGeneration >= filter_generation; }
|
||||
BOOL hasFilteredDescendants();
|
||||
|
||||
// applies filters to control visibility of inventory items
|
||||
virtual void filter( LLInventoryFilter& filter);
|
||||
virtual void setFiltered(BOOL filtered, S32 filter_generation);
|
||||
virtual void dirtyFilter();
|
||||
|
||||
// Passes selection information on to children and record
|
||||
// selection information if necessary.
|
||||
// Returns TRUE if this object (or a child) ends up being selected.
|
||||
// If 'openitem' is TRUE then folders are opened up along the way to the selection.
|
||||
virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus);
|
||||
|
||||
// This method is used to change the selection of an item.
|
||||
// Recursively traverse all children; if 'selection' is 'this' then change
|
||||
// the select status if necessary.
|
||||
// Returns TRUE if the selection state of this folder, or of a child, was changed.
|
||||
virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
|
||||
|
||||
// this method is used to group select items
|
||||
virtual void extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items);
|
||||
|
||||
// Deselect this folder and all folder/items it contains recursively.
|
||||
void recursiveDeselect(BOOL deselect_self);
|
||||
|
||||
// Returns true is this object and all of its children can be removed.
|
||||
virtual BOOL isRemovable();
|
||||
|
||||
// Returns true is this object and all of its children can be moved
|
||||
virtual BOOL isMovable();
|
||||
|
||||
// destroys this folder, and all children
|
||||
virtual void destroyView();
|
||||
|
||||
// If this folder can be removed, remove all children that can be
|
||||
// removed, return TRUE if this is empty after the operation and
|
||||
// it's viewed folder object can be removed.
|
||||
//virtual BOOL removeRecursively(BOOL single_item);
|
||||
//virtual BOOL remove();
|
||||
|
||||
// remove the specified item (and any children) if
|
||||
// possible. Return TRUE if the item was deleted.
|
||||
BOOL removeItem(LLFolderViewItem* item);
|
||||
|
||||
// simply remove the view (and any children) Don't bother telling
|
||||
// the listeners.
|
||||
void removeView(LLFolderViewItem* item);
|
||||
|
||||
// extractItem() removes the specified item from the folder, but
|
||||
// doesn't delete it.
|
||||
void extractItem( LLFolderViewItem* item );
|
||||
|
||||
// This function is called by a child that needs to be resorted.
|
||||
void resort(LLFolderViewItem* item);
|
||||
|
||||
void setItemSortOrder(U32 ordering);
|
||||
void sortBy(U32);
|
||||
//BOOL (*func)(LLFolderViewItem* a, LLFolderViewItem* b));
|
||||
|
||||
void setAutoOpenCountdown(F32 countdown) { mAutoOpenCountdown = countdown; }
|
||||
|
||||
// folders can be opened. This will usually be called by internal
|
||||
// methods.
|
||||
virtual void toggleOpen();
|
||||
|
||||
// Force a folder open or closed
|
||||
virtual void setOpen(BOOL openitem = TRUE);
|
||||
|
||||
// Called when a child is refreshed.
|
||||
// don't rearrange child folder contents unless explicitly requested
|
||||
virtual void requestArrange(BOOL include_descendants = FALSE);
|
||||
|
||||
// internal method which doesn't update the entire view. This
|
||||
// method was written because the list iterators destroy the state
|
||||
// of other iterations, thus, we can't arrange while iterating
|
||||
// through the children (such as when setting which is selected.
|
||||
virtual void setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse = RECURSE_NO);
|
||||
|
||||
// Get the current state of the folder.
|
||||
virtual BOOL isOpen() { return mIsOpen; }
|
||||
|
||||
// special case if an object is dropped on the child.
|
||||
BOOL handleDragAndDropFromChild(MASK mask,
|
||||
BOOL drop,
|
||||
EDragAndDropType cargo_type,
|
||||
void* cargo_data,
|
||||
EAcceptance* accept,
|
||||
std::string& tooltip_msg);
|
||||
|
||||
void applyFunctorRecursively(LLFolderViewFunctor& functor);
|
||||
virtual void applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor);
|
||||
|
||||
virtual void openItem( void );
|
||||
virtual BOOL addItem(LLFolderViewItem* item);
|
||||
virtual BOOL addFolder( LLFolderViewFolder* folder);
|
||||
|
||||
// LLView functionality
|
||||
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
|
||||
EDragAndDropType cargo_type,
|
||||
void* cargo_data,
|
||||
EAcceptance* accept,
|
||||
std::string& tooltip_msg);
|
||||
virtual void draw();
|
||||
|
||||
time_t getCreationDate() const;
|
||||
bool isTrash() const;
|
||||
S32 getNumSelectedDescendants(void) const { return mNumDescendantsSelected; }
|
||||
|
||||
folders_t::const_iterator getFoldersBegin() const { return mFolders.begin(); }
|
||||
folders_t::const_iterator getFoldersEnd() const { return mFolders.end(); }
|
||||
folders_t::size_type getFoldersCount() const { return mFolders.size(); }
|
||||
|
||||
items_t::const_iterator getItemsBegin() const { return mItems.begin(); }
|
||||
items_t::const_iterator getItemsEnd() const { return mItems.end(); }
|
||||
items_t::size_type getItemsCount() const { return mItems.size(); }
|
||||
};
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLFolderViewListenerFunctor
|
||||
//
|
||||
// This simple abstract base class can be used to applied to all
|
||||
// listeners in a hierarchy.
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
class LLFolderViewListenerFunctor
|
||||
{
|
||||
public:
|
||||
virtual ~LLFolderViewListenerFunctor() {}
|
||||
virtual void operator()(LLFolderViewEventListener* listener) = 0;
|
||||
};
|
||||
|
||||
#endif // LLFOLDERVIEWITEM_H
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "llfloater.h"
|
||||
#include "llinventory.h"
|
||||
#include "llfolderview.h"
|
||||
#include "llinventoryfilter.h"
|
||||
#include "llinventorymodel.h"
|
||||
#include "llinventoryobserver.h"
|
||||
#include "llmemberlistener.h"
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
#include "llinventorymodel.h"
|
||||
#include "llinventoryicon.h"
|
||||
#include "llinventorybridge.h"
|
||||
#include "llinventoryfilter.h"
|
||||
#include "llmenugl.h"
|
||||
#include "llpreviewanim.h"
|
||||
#include "llpreviewgesture.h"
|
||||
|
||||
@@ -283,7 +283,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
|
||||
stop_glerror();
|
||||
|
||||
gPipeline.disableLights();
|
||||
|
||||
//reset vertex buffers if needed
|
||||
|
||||
gPipeline.doResetVertexBuffers();
|
||||
|
||||
stop_glerror();
|
||||
|
||||
// Don't draw if the window is hidden or minimized.
|
||||
|
||||
@@ -63,7 +63,6 @@ extern PFNGLWEIGHTFVARBPROC glWeightfvARB;
|
||||
extern PFNGLVERTEXBLENDARBPROC glVertexBlendARB;
|
||||
#endif
|
||||
|
||||
static LLPointer<LLVertexBuffer> sRenderBuffer = NULL;
|
||||
static const U32 sRenderMask = LLVertexBuffer::MAP_VERTEX |
|
||||
LLVertexBuffer::MAP_NORMAL |
|
||||
LLVertexBuffer::MAP_TEXCOORD0;
|
||||
|
||||
@@ -158,7 +158,7 @@ extern BOOL gDebugGL;
|
||||
|
||||
// hack counter for rendering a fixed number of frames after toggling
|
||||
// fullscreen to work around DEV-5361
|
||||
static S32 sDelayedVBOEnable = 0;
|
||||
//static S32 sDelayedVBOEnable = 0;
|
||||
|
||||
BOOL gAvatarBacklight = FALSE;
|
||||
|
||||
@@ -555,7 +555,7 @@ void LLPipeline::destroyGL()
|
||||
if (LLVertexBuffer::sEnableVBOs)
|
||||
{
|
||||
// render 30 frames after switching to work around DEV-5361
|
||||
sDelayedVBOEnable = 30;
|
||||
//sDelayedVBOEnable = 30;
|
||||
LLVertexBuffer::sEnableVBOs = FALSE;
|
||||
}
|
||||
}
|
||||
@@ -2308,14 +2308,14 @@ void LLPipeline::updateGeom(F32 max_dtime)
|
||||
|
||||
assertInitialized();
|
||||
|
||||
if (sDelayedVBOEnable > 0)
|
||||
/*if (sDelayedVBOEnable > 0)
|
||||
{
|
||||
if (--sDelayedVBOEnable <= 0)
|
||||
{
|
||||
resetVertexBuffers();
|
||||
LLVertexBuffer::sEnableVBOs = TRUE;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// notify various object types to reset internal cost metrics, etc.
|
||||
// for now, only LLVOVolume does this to throttle LOD changes
|
||||
@@ -5852,7 +5852,7 @@ LLSpatialPartition* LLPipeline::getSpatialPartition(LLViewerObject* vobj)
|
||||
|
||||
void LLPipeline::resetVertexBuffers(LLDrawable* drawable)
|
||||
{
|
||||
if (!drawable || drawable->isDead())
|
||||
if (!drawable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -5866,6 +5866,18 @@ void LLPipeline::resetVertexBuffers(LLDrawable* drawable)
|
||||
|
||||
void LLPipeline::resetVertexBuffers()
|
||||
{
|
||||
mResetVertexBuffers = true;
|
||||
}
|
||||
|
||||
void LLPipeline::doResetVertexBuffers()
|
||||
{
|
||||
if (!mResetVertexBuffers)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mResetVertexBuffers = false;
|
||||
|
||||
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
|
||||
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
|
||||
{
|
||||
@@ -5891,11 +5903,9 @@ void LLPipeline::resetVertexBuffers()
|
||||
|
||||
if (LLVertexBuffer::sGLCount > 0)
|
||||
{
|
||||
llwarns << "VBO wipe failed." << llendl;
|
||||
llwarns << "VBO wipe failed -- " << LLVertexBuffer::sGLCount << " buffers remaining." << llendl;
|
||||
}
|
||||
|
||||
llassert(LLVertexBuffer::sGLCount == 0);
|
||||
|
||||
LLVertexBuffer::unbind();
|
||||
|
||||
sRenderBump = gSavedSettings.getBOOL("RenderObjectBump");
|
||||
|
||||
@@ -110,6 +110,7 @@ public:
|
||||
void destroyGL();
|
||||
void restoreGL();
|
||||
void resetVertexBuffers();
|
||||
void doResetVertexBuffers();
|
||||
void resizeScreenTexture();
|
||||
void releaseGLBuffers();
|
||||
void releaseScreenBuffers();
|
||||
@@ -632,6 +633,8 @@ protected:
|
||||
bool mGroupQ2Locked;
|
||||
bool mGroupQ1Locked;
|
||||
|
||||
bool mResetVertexBuffers; //if true, clear vertex buffers on next update
|
||||
|
||||
LLViewerObject::vobj_list_t mCreateQ;
|
||||
|
||||
LLDrawable::drawable_set_t mRetexturedList;
|
||||
|
||||
Reference in New Issue
Block a user