From 0ec8d0aacf47913ab8fd30d8424fa7146f135d15 Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Fri, 13 Nov 2009 15:51:22 +0200 Subject: implemented major task EXT-1897 Ctl + G Gestures floater should show ALL gestures from inventory, not just Active Gestures refactoring of gesture's manager --HG-- branch : product-engine --- indra/newview/llgesturemgr.h | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'indra/newview/llgesturemgr.h') diff --git a/indra/newview/llgesturemgr.h b/indra/newview/llgesturemgr.h index 947773d66d..7c3b742780 100644 --- a/indra/newview/llgesturemgr.h +++ b/indra/newview/llgesturemgr.h @@ -57,6 +57,12 @@ public: class LLGestureManager : public LLSingleton, public LLInventoryCompletionObserver { public: + + typedef boost::function gesture_loaded_callback_t; + // Maps inventory item_id to gesture + typedef std::map item_map_t; + typedef std::map callback_map_t; + LLGestureManager(); ~LLGestureManager(); @@ -97,6 +103,7 @@ public: BOOL isGesturePlaying(const LLUUID& item_id); + const item_map_t& getActiveGestures() const { return mActive; } // Force a gesture to be played, for example, if it is being // previewed. void playGesture(LLMultiGesture* gesture); @@ -106,7 +113,15 @@ public: // Also remove from playing list void stopGesture(LLMultiGesture* gesture); void stopGesture(const LLUUID& item_id); - + /** + * Add cb into callbackMap. + * Note: + * Manager will call cb after gesture will be loaded and will remove cb automatically. + */ + void setGestureLoadedCallback(LLUUID inv_item_id, gesture_loaded_callback_t cb) + { + mCallbackMap[inv_item_id] = cb; + } // Trigger the first gesture that matches this key. // Returns TRUE if it finds a gesture bound to that key. BOOL triggerGesture(KEY key, MASK mask); @@ -144,13 +159,7 @@ protected: LLAssetType::EType type, void* user_data, S32 status, LLExtStat ext_status); -public: - BOOL mValid; - std::vector mPlaying; - - // Maps inventory item_id to gesture - typedef std::map item_map_t; - +private: // Active gestures. // NOTE: The gesture pointer CAN BE NULL. This means that // there is a gesture with that item_id, but the asset data @@ -159,8 +168,11 @@ public: S32 mLoadingCount; std::string mDeactivateSimilarNames; - + std::vector mObservers; + callback_map_t mCallbackMap; + std::vector mPlaying; + BOOL mValid; }; #endif -- cgit v1.2.3