LLGestureManager Class Reference

#include <llgesturemgr.h>

Collaboration diagram for LLGestureManager:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::map< LLUUID,
LLMultiGesture * > 
item_map_t

Public Member Functions

 LLGestureManager ()
 ~LLGestureManager ()
void init ()
void update ()
void activateGesture (const LLUUID &item_id)
void activateGestures (LLViewerInventoryItem::item_array_t &items)
void replaceGesture (const LLUUID &item_id, LLMultiGesture *new_gesture, const LLUUID &asset_id)
void replaceGesture (const LLUUID &item_id, const LLUUID &asset_id)
void activateGestureWithAsset (const LLUUID &item_id, const LLUUID &asset_id, BOOL inform_server, BOOL deactivate_similar)
void deactivateGesture (const LLUUID &item_id)
void deactivateSimilarGestures (LLMultiGesture *gesture, const LLUUID &in_item_id)
BOOL isGestureActive (const LLUUID &item_id)
BOOL isGesturePlaying (const LLUUID &item_id)
void playGesture (LLMultiGesture *gesture)
void playGesture (const LLUUID &item_id)
void stopGesture (LLMultiGesture *gesture)
void stopGesture (const LLUUID &item_id)
BOOL triggerGesture (KEY key, MASK mask)
BOOL triggerAndReviseString (const std::string &str, std::string *revised_string=NULL)
BOOL isKeyBound (KEY key, MASK mask)
S32 getPlayingCount () const
void addObserver (LLGestureManagerObserver *observer)
void removeObserver (LLGestureManagerObserver *observer)
void notifyObservers ()
BOOL matchPrefix (const std::string &in_str, std::string *out_str)
void getItemIDs (std::vector< LLUUID > *ids)

Public Attributes

BOOL mValid
std::vector< LLMultiGesture * > mPlaying
item_map_t mActive
S32 mLoadingCount
std::string mDeactivateSimilarNames
std::vector< LLGestureManagerObserver * > mObservers

Protected Member Functions

void stepGesture (LLMultiGesture *gesture)
void runStep (LLMultiGesture *gesture, LLGestureStep *step)

Static Protected Member Functions

static void onLoadComplete (LLVFS *vfs, const LLUUID &asset_uuid, LLAssetType::EType type, void *user_data, S32 status, LLExtStat ext_status)

Detailed Description

Definition at line 54 of file llgesturemgr.h.


Member Typedef Documentation

typedef std::map<LLUUID, LLMultiGesture*> LLGestureManager::item_map_t

Definition at line 146 of file llgesturemgr.h.


Constructor & Destructor Documentation

LLGestureManager::LLGestureManager (  ) 

Definition at line 68 of file llgesturemgr.cpp.

LLGestureManager::~LLGestureManager (  ) 

Definition at line 77 of file llgesturemgr.cpp.

References mActive, and NULL.


Member Function Documentation

void LLGestureManager::activateGesture ( const LLUUID item_id  ) 

Definition at line 98 of file llgesturemgr.cpp.

References activateGestureWithAsset(), FALSE, LLInventoryItem::getAssetUUID(), LLInventoryModel::getItem(), gInventory, mDeactivateSimilarNames, mLoadingCount, and TRUE.

Referenced by activateGestures(), LLToolDragAndDrop::dad3dActivateGesture(), ActivateGestureCallback::fire(), LLPreviewGesture::onCommitActive(), and LLGestureBridge::performAction().

void LLGestureManager::activateGestures ( LLViewerInventoryItem::item_array_t items  ) 

Definition at line 114 of file llgesturemgr.cpp.

References activateGesture(), activateGestureWithAsset(), count, FALSE, gAgent, LLAgent::getID(), LLAgent::getSessionID(), gMessageSystem, isGestureActive(), mDeactivateSimilarNames, mLoadingCount, MTUBYTES, S32, LLAgent::sendReliableMessage(), and TRUE.

Referenced by wear_inventory_category_on_avatar_step2().

void LLGestureManager::activateGestureWithAsset ( const LLUUID item_id,
const LLUUID asset_id,
BOOL  inform_server,
BOOL  deactivate_similar 
)

Definition at line 207 of file llgesturemgr.cpp.

References LLAssetType::AT_GESTURE, gAssetStorage, LLAssetStorage::getAssetData(), isGestureActive(), llendl, llwarns, mActive, notifyObservers(), LLUUID::notNull(), NULL, onLoadComplete(), and TRUE.

Referenced by activateGesture(), activateGestures(), and idle_startup().

void LLGestureManager::addObserver ( LLGestureManagerObserver observer  ) 

Definition at line 1079 of file llgesturemgr.cpp.

References mObservers.

Referenced by LLFloaterGesture::LLFloaterGesture(), and LLChatBar::setGestureCombo().

void LLGestureManager::deactivateGesture ( const LLUUID item_id  ) 

Definition at line 256 of file llgesturemgr.cpp.

References LLInventoryModel::addChangedMask(), LLMessageSystem::addU32(), LLMessageSystem::addUUID(), gAgent, LLAgent::getID(), LLAgent::getSessionID(), gInventory, gMessageSystem, LLInventoryObserver::LABEL, llendl, llwarns, mActive, LLMessageSystem::newMessage(), LLMessageSystem::nextBlock(), notifyObservers(), NULL, LLAgent::sendReliableMessage(), and stopGesture().

Referenced by LLFolderBridge::dragCategoryIntoFolder(), LLFolderBridge::dragItemIntoFolder(), LLPreviewGesture::onCommitActive(), LLGestureBridge::performAction(), remove_inventory_category_from_avatar_step2(), LLGestureBridge::removeItem(), and LLFolderBridge::removeItem().

void LLGestureManager::deactivateSimilarGestures ( LLMultiGesture gesture,
const LLUUID in_item_id 
)

Definition at line 298 of file llgesturemgr.cpp.

References LLInventoryModel::addChangedMask(), LLMessageSystem::addU32(), LLMessageSystem::addUUID(), FALSE, gAgent, LLMessageSystem::getCurrentSendTotal(), LLAgent::getID(), LLInventoryModel::getItem(), LLAgent::getSessionID(), gInventory, gMessageSystem, KEY_NONE, LLInventoryObserver::LABEL, mActive, mDeactivateSimilarNames, LLMultiGesture::mKey, LLMultiGesture::mMask, LLMultiGesture::mTrigger, MTUBYTES, LLMessageSystem::newMessage(), LLMessageSystem::nextBlock(), notifyObservers(), NULL, LLAgent::sendReliableMessage(), stopGesture(), and TRUE.

Referenced by onLoadComplete().

void LLGestureManager::getItemIDs ( std::vector< LLUUID > *  ids  ) 

Definition at line 1142 of file llgesturemgr.cpp.

References mActive.

S32 LLGestureManager::getPlayingCount (  )  const

Definition at line 623 of file llgesturemgr.cpp.

References mPlaying.

void LLGestureManager::init (  ) 

Definition at line 90 of file llgesturemgr.cpp.

BOOL LLGestureManager::isGestureActive ( const LLUUID item_id  ) 

Definition at line 384 of file llgesturemgr.cpp.

References mActive.

Referenced by activateGestures(), activateGestureWithAsset(), LLFolderBridge::dragCategoryIntoFolder(), LLFolderBridge::dragItemIntoFolder(), LLGestureBridge::getLabelStyle(), LLGestureBridge::getLabelSuffix(), LLPreviewGesture::onCommitActive(), LLPreviewGesture::refresh(), remove_inventory_category_from_avatar_step2(), LLFolderBridge::removeItem(), LLPreviewGesture::saveIfNeeded(), and LLUpdateAgentInventoryResponder::uploadComplete().

BOOL LLGestureManager::isGesturePlaying ( const LLUUID item_id  ) 

Definition at line 391 of file llgesturemgr.cpp.

References FALSE, mActive, and LLMultiGesture::mPlaying.

Referenced by LLFloaterGesture::onClickPlay(), and LLFloaterGesture::onCommitList().

BOOL LLGestureManager::isKeyBound ( KEY  key,
MASK  mask 
)

BOOL LLGestureManager::matchPrefix ( const std::string &  in_str,
std::string *  out_str 
)

Definition at line 1111 of file llgesturemgr.cpp.

References LLStringBase< char >::compareInsensitive(), FALSE, mActive, S32, TRUE, and LLStringBase< char >::truncate().

Referenced by LLChatBar::onInputEditorKeystroke().

void LLGestureManager::notifyObservers (  ) 

Definition at line 1097 of file llgesturemgr.cpp.

References lldebugs, llendl, and mObservers.

Referenced by activateGestureWithAsset(), deactivateGesture(), deactivateSimilarGestures(), onLoadComplete(), playGesture(), replaceGesture(), stopGesture(), and update().

void LLGestureManager::onLoadComplete ( LLVFS vfs,
const LLUUID asset_uuid,
LLAssetType::EType  type,
void user_data,
S32  status,
LLExtStat  ext_status 
) [static, protected]

Definition at line 913 of file llgesturemgr.cpp.

References LLInventoryModel::addChangedMask(), LLMessageSystem::addU32(), LLMessageSystem::addUUID(), deactivateSimilarGestures(), LLMultiGesture::deserialize(), gAgent, LLAgent::getID(), LLAgent::getSessionID(), LLVFile::getSize(), gGestureManager, gInventory, gMessageSystem, gViewerStats, LLViewerStats::incStat(), LLInventoryObserver::LABEL, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_ERR_FILE_EMPTY, llendl, llerrs, llwarns, mActive, LLLoadInfo::mDeactivateSimilar, mDeactivateSimilarNames, LLLoadInfo::mInformServer, LLLoadInfo::mItemID, mLoadingCount, LLMessageSystem::newMessage(), LLMessageSystem::nextBlock(), notifyObservers(), NULL, LLVFile::read(), LLVFile::READ, S32, LLAgent::sendReliableMessage(), LLNotifyBox::showXml(), size, and LLViewerStats::ST_DOWNLOAD_FAILED.

Referenced by activateGestureWithAsset(), and replaceGesture().

void LLGestureManager::playGesture ( const LLUUID item_id  ) 

Definition at line 475 of file llgesturemgr.cpp.

References mActive, and playGesture().

void LLGestureManager::playGesture ( LLMultiGesture gesture  ) 

Definition at line 456 of file llgesturemgr.cpp.

References LLMultiGesture::mCurrentStep, mPlaying, LLMultiGesture::mPlaying, notifyObservers(), stepGesture(), and TRUE.

Referenced by LLFloaterGesture::onClickPlay(), LLPreviewGesture::onClickPreview(), playGesture(), triggerAndReviseString(), and triggerGesture().

void LLGestureManager::removeObserver ( LLGestureManagerObserver observer  ) 

Definition at line 1084 of file llgesturemgr.cpp.

References mObservers.

Referenced by LLFloaterGesture::~LLFloaterGesture().

void LLGestureManager::replaceGesture ( const LLUUID item_id,
const LLUUID asset_id 
)

Definition at line 442 of file llgesturemgr.cpp.

References gGestureManager, llendl, llwarns, mActive, and replaceGesture().

void LLGestureManager::replaceGesture ( const LLUUID item_id,
LLMultiGesture new_gesture,
const LLUUID asset_id 
)

Definition at line 402 of file llgesturemgr.cpp.

References LLAssetType::AT_GESTURE, FALSE, gAssetStorage, LLAssetStorage::getAssetData(), llendl, llwarns, mActive, LLLoadInfo::mDeactivateSimilar, mDeactivateSimilarNames, LLLoadInfo::mInformServer, LLLoadInfo::mItemID, mLoadingCount, notifyObservers(), LLUUID::notNull(), NULL, onLoadComplete(), stopGesture(), and TRUE.

Referenced by replaceGesture(), LLPreviewGesture::saveIfNeeded(), and LLUpdateAgentInventoryResponder::uploadComplete().

void LLGestureManager::runStep ( LLMultiGesture gesture,
LLGestureStep step 
) [protected]

Definition at line 828 of file llgesturemgr.cpp.

References ANIM_FLAG_STOP, ANIM_REQUEST_START, ANIM_REQUEST_STOP, CHAT_TYPE_NORMAL, FALSE, gAgent, gChatBar, LLGestureStep::getType(), LLGestureStepChat::mChatText, LLMultiGesture::mCurrentStep, LLGestureStepWait::mFlags, LLMultiGesture::mRequestedAnimIDs, LLGestureStepSound::mSoundAssetID, LLMultiGesture::mWaitingAnimations, LLMultiGesture::mWaitingTimer, LLMultiGesture::mWaitTimer, LLFrameTimer::reset(), send_sound_trigger(), LLAgent::sendAnimationRequest(), LLChatBar::sendChatFromViewer(), STEP_ANIMATION, STEP_CHAT, STEP_SOUND, STEP_WAIT, TRUE, WAIT_FLAG_ALL_ANIM, and WAIT_FLAG_TIME.

Referenced by stepGesture().

void LLGestureManager::stepGesture ( LLMultiGesture gesture  )  [protected]

Definition at line 680 of file llgesturemgr.cpp.

References FALSE, gAgent, LLAgent::getAvatarObject(), LLFrameTimer::getElapsedTimeF32(), llassert, llendl, llinfos, MAX_WAIT_ANIM_SECS, LLMultiGesture::mCurrentStep, LLMultiGesture::mPlaying, LLMultiGesture::mPlayingAnimIDs, LLMultiGesture::mRequestedAnimIDs, LLVOAvatar::mSignaledAnimations, LLMultiGesture::mSteps, LLMultiGesture::mWaitingAnimations, LLMultiGesture::mWaitingAtEnd, LLMultiGesture::mWaitingTimer, LLGestureStepWait::mWaitSeconds, LLMultiGesture::mWaitTimer, NULL, runStep(), S32, and TRUE.

Referenced by playGesture(), and update().

void LLGestureManager::stopGesture ( const LLUUID item_id  ) 

Definition at line 1067 of file llgesturemgr.cpp.

References mActive, and stopGesture().

void LLGestureManager::stopGesture ( LLMultiGesture gesture  ) 

Definition at line 1027 of file llgesturemgr.cpp.

References ANIM_REQUEST_STOP, gAgent, LLMultiGesture::mCallbackData, LLMultiGesture::mDoneCallback, mPlaying, LLMultiGesture::mPlayingAnimIDs, LLMultiGesture::mRequestedAnimIDs, notifyObservers(), NULL, LLMultiGesture::reset(), and LLAgent::sendAnimationRequest().

Referenced by deactivateGesture(), deactivateSimilarGestures(), LLPreviewGesture::handleSaveChangesDialog(), LLFloaterGesture::onClickPlay(), LLPreviewGesture::onClickPreview(), LLPreviewGesture::onClose(), replaceGesture(), and stopGesture().

BOOL LLGestureManager::triggerAndReviseString ( const std::string &  str,
std::string *  revised_string = NULL 
)

Definition at line 490 of file llgesturemgr.cpp.

References FALSE, ll_rand(), mActive, LLMultiGesture::mReplaceText, LLMultiGesture::mTrigger, NULL, playGesture(), S32, LLStringBase< char >::toLower(), and TRUE.

Referenced by LLVOAvatar::idleUpdate(), LLChatBar::onCommitGesture(), and LLChatBar::sendChat().

BOOL LLGestureManager::triggerGesture ( KEY  key,
MASK  mask 
)

Definition at line 589 of file llgesturemgr.cpp.

References FALSE, ll_rand(), mActive, playGesture(), and TRUE.

Referenced by LLViewerWindow::handleKey().

void LLGestureManager::update (  ) 

Definition at line 637 of file llgesturemgr.cpp.

References i, mPlaying, notifyObservers(), NULL, S32, and stepGesture().

Referenced by idle().


Member Data Documentation

item_map_t LLGestureManager::mActive

Definition at line 152 of file llgesturemgr.h.

Referenced by activateGestureWithAsset(), LLFloaterGesture::buildGestureList(), deactivateGesture(), deactivateSimilarGestures(), getItemIDs(), isGestureActive(), isGesturePlaying(), matchPrefix(), onLoadComplete(), playGesture(), LLChatBar::refreshGestures(), replaceGesture(), stopGesture(), triggerAndReviseString(), triggerGesture(), and ~LLGestureManager().

std::string LLGestureManager::mDeactivateSimilarNames

Definition at line 155 of file llgesturemgr.h.

Referenced by activateGesture(), activateGestures(), deactivateSimilarGestures(), onLoadComplete(), and replaceGesture().

S32 LLGestureManager::mLoadingCount

Definition at line 154 of file llgesturemgr.h.

Referenced by activateGesture(), activateGestures(), onLoadComplete(), and replaceGesture().

std::vector<LLGestureManagerObserver*> LLGestureManager::mObservers

Definition at line 157 of file llgesturemgr.h.

Referenced by addObserver(), notifyObservers(), and removeObserver().

std::vector<LLMultiGesture*> LLGestureManager::mPlaying

Definition at line 143 of file llgesturemgr.h.

Referenced by getPlayingCount(), playGesture(), stopGesture(), and update().

BOOL LLGestureManager::mValid

Definition at line 142 of file llgesturemgr.h.


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:23 2010 for Second Life Viewer by  doxygen 1.4.7