From: Kimmo Hoikka Date: Fri, 29 May 2015 17:38:53 +0000 (-0700) Subject: Merge "Changes for std::vector removal from api" into tizen X-Git-Tag: dali_1.0.43~10 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=511ab5d892c68a8bbbc3846e85fc5ec8f7323470;hp=eff9a302f2e5999932743f5d5341e315f627793e Merge "Changes for std::vector removal from api" into tizen --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp index d1f6925..f3aa937 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp @@ -199,17 +199,17 @@ int UtcDaliControlImplDisableGestureDetector(void) TapGestureDetector tap = dummyImpl.GetTapGestureDetector(); LongPressGestureDetector longPress = dummyImpl.GetLongPressGestureDetector(); - DALI_TEST_EQUALS( pinch.GetAttachedActors().empty(), false, TEST_LOCATION ); - DALI_TEST_EQUALS( pan.GetAttachedActors().empty(), false, TEST_LOCATION ); - DALI_TEST_EQUALS( tap.GetAttachedActors().empty(), false, TEST_LOCATION ); - DALI_TEST_EQUALS( longPress.GetAttachedActors().empty(), false, TEST_LOCATION ); + DALI_TEST_EQUALS( 0 == pinch.GetAttachedActorCount(), false, TEST_LOCATION ); + DALI_TEST_EQUALS( 0 == pan.GetAttachedActorCount(), false, TEST_LOCATION ); + DALI_TEST_EQUALS( 0 == tap.GetAttachedActorCount(), false, TEST_LOCATION ); + DALI_TEST_EQUALS( 0 == longPress.GetAttachedActorCount(), false, TEST_LOCATION ); dummyImpl.DisableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) ); - DALI_TEST_EQUALS( pinch.GetAttachedActors().empty(), true, TEST_LOCATION ); - DALI_TEST_EQUALS( pan.GetAttachedActors().empty(), true, TEST_LOCATION ); - DALI_TEST_EQUALS( tap.GetAttachedActors().empty(), true, TEST_LOCATION ); - DALI_TEST_EQUALS( longPress.GetAttachedActors().empty(), true, TEST_LOCATION ); + DALI_TEST_EQUALS( 0 == pinch.GetAttachedActorCount(), true, TEST_LOCATION ); + DALI_TEST_EQUALS( 0 == pan.GetAttachedActorCount(), true, TEST_LOCATION ); + DALI_TEST_EQUALS( 0 == tap.GetAttachedActorCount(), true, TEST_LOCATION ); + DALI_TEST_EQUALS( 0 == longPress.GetAttachedActorCount(), true, TEST_LOCATION ); } END_TEST; } @@ -921,7 +921,7 @@ int UtcDaliControlImplOnAccessibilityActivatedP(void) BaseHandle handle = type.CreateInstance(); DALI_TEST_CHECK( handle ); - std::vector attributes; + Property::Map attributes; DALI_TEST_EQUALS( false, handle.DoAction("control-activated", attributes), TEST_LOCATION ); END_TEST; diff --git a/dali-toolkit/internal/builder/builder-signals.cpp b/dali-toolkit/internal/builder/builder-signals.cpp index 804deb3..32c43d4 100644 --- a/dali-toolkit/internal/builder/builder-signals.cpp +++ b/dali-toolkit/internal/builder/builder-signals.cpp @@ -54,7 +54,7 @@ struct ChildActorAction std::string actorName; std::string actionName; std::string childName; - PropertyValueContainer parameters; + Property::Map parameters; void operator()(void) { @@ -115,7 +115,7 @@ struct GenericAction { std::string actorName; std::string actionName; - PropertyValueContainer parameters; + Property::Map parameters; void operator()(void) { @@ -376,25 +376,17 @@ Property::Value GetPropertyValue(const TreeNode &child) * Gets Parmeter list from child * params is be cleared before insertion */ -void GetParameters(const TreeNode& child, PropertyValueContainer& params) +void GetParameters(const TreeNode& child, Property::Map& params) { if( OptionalChild c = IsChild(child, "parameters") ) { const TreeNode& node = *c; - if(0 == node.Size()) - { - GetPropertyValue(node); - } - else - { - params.clear(); - params.reserve(node.Size()); + params.Clear(); - for(TreeNode::ConstIterator iter(node.CBegin()); iter != node.CEnd(); ++iter) - { - params.push_back( GetPropertyValue( (*iter).second ) ); - } + for(TreeNode::ConstIterator iter(node.CBegin()); iter != node.CEnd(); ++iter) + { + params[ (*iter).first ] = GetPropertyValue( (*iter).second ); } } } diff --git a/dali-toolkit/internal/controls/buttons/button-impl.cpp b/dali-toolkit/internal/controls/buttons/button-impl.cpp index 1c31fe5..c0d52ca 100644 --- a/dali-toolkit/internal/controls/buttons/button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/button-impl.cpp @@ -905,7 +905,7 @@ Actor& Button::GetDisabledBackgroundImage() return mDisabledBackgroundContent; } -bool Button::DoAction( BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes ) + bool Button::DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes ) { bool ret = false; @@ -924,7 +924,7 @@ bool Button::DoAction( BaseObject* object, const std::string& actionName, const return ret; } -void Button::DoClickAction( const PropertyValueContainer& attributes ) + void Button::DoClickAction( const Property::Map& attributes ) { // Prevents the button signals from doing a recursive loop by sending an action // and re-emitting the signals. @@ -1210,7 +1210,7 @@ void Button::OnInitialize() void Button::OnActivated() { // When the button is activated, it performs the click action - PropertyValueContainer attributes; + Property::Map attributes; DoClickAction( attributes ); } diff --git a/dali-toolkit/internal/controls/buttons/button-impl.h b/dali-toolkit/internal/controls/buttons/button-impl.h index 5197aca..02b1360 100644 --- a/dali-toolkit/internal/controls/buttons/button-impl.h +++ b/dali-toolkit/internal/controls/buttons/button-impl.h @@ -260,7 +260,7 @@ public: * @param[in] attributes The attributes with which to perfrom this action. * @return true if action has been accepted by this control */ - static bool DoAction( BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes ); + static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes ); protected: @@ -280,7 +280,7 @@ private: * Perform the click action to click the button. * @param[in] attributes The attributes to perfrom this action. */ - void DoClickAction( const PropertyValueContainer& attributes ); + void DoClickAction( const Property::Map& attributes ); /** * This method is called after the button initialization. diff --git a/dali-toolkit/public-api/controls/control-impl.cpp b/dali-toolkit/public-api/controls/control-impl.cpp index bb2732c..1c7d294 100644 --- a/dali-toolkit/public-api/controls/control-impl.cpp +++ b/dali-toolkit/public-api/controls/control-impl.cpp @@ -67,7 +67,7 @@ BaseHandle Create() * @return true if action has been accepted by this control */ const char* ACTION_CONTROL_ACTIVATED = "control-activated"; -static bool DoAction( BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes ) + static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes ) { bool ret = false;