X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Flayouting%2Flayout-transition-data-impl.h;h=dec0b769805f18a2cb81a2361e29817b440a073d;hp=eb9e9d946fdc3a4ebe78117d0d6d096a9aff2a42;hb=c5406d4b38f8b7fc3595cc5f6c9e13919fe30ea1;hpb=8a313bb71bb0d1b443e2b5d7f383155433d385e0 diff --git a/dali-toolkit/internal/layouting/layout-transition-data-impl.h b/dali-toolkit/internal/layouting/layout-transition-data-impl.h index eb9e9d9..dec0b76 100644 --- a/dali-toolkit/internal/layouting/layout-transition-data-impl.h +++ b/dali-toolkit/internal/layouting/layout-transition-data-impl.h @@ -37,9 +37,11 @@ namespace Internal struct LayoutTransition { - LayoutTransition( LayoutItem& layoutItem, int layoutTransitionType ) + LayoutTransition( LayoutItem& layoutItem, int layoutTransitionType, Actor gainedChild, Actor lostChild ) : layoutItem( &layoutItem ) , layoutTransitionType( layoutTransitionType ) + , gainedChild( gainedChild ) + , lostChild( lostChild ) { } @@ -50,11 +52,16 @@ struct LayoutTransition bool operator==( const LayoutTransition& rhs ) { - return ( ( layoutItem.Get() == rhs.layoutItem.Get() ) && layoutTransitionType == rhs.layoutTransitionType ); + return ( layoutItem.Get() == rhs.layoutItem.Get() + && layoutTransitionType == rhs.layoutTransitionType + && gainedChild == rhs.gainedChild + && lostChild == rhs.lostChild ); } LayoutItemPtr layoutItem; int layoutTransitionType; + Actor gainedChild; + Actor lostChild; }; const float DEFAULT_TRANSITION_DURATION( 0.5f ); @@ -111,16 +118,10 @@ using LayoutPositionDataArray = std::vector< LayoutPositionData >; struct LayoutDataElement { LayoutDataElement() - : propertyIndex( Property::INVALID_KEY ), animatorIndex( -1 ), positionDataIndex(-1 ) - { - }; - - LayoutDataElement( Actor actor, Property::Index propertyIndex, Property::Value value ) - : handle( actor ), - propertyIndex( propertyIndex ), - targetValue( value ), + : propertyIndex( Property::INVALID_KEY ), animatorIndex( -1 ), - positionDataIndex( -1 ) + positionDataIndex(-1 ), + condition( Dali::Toolkit::LayoutTransitionData::Condition::NONE ) { }; @@ -130,6 +131,7 @@ struct LayoutDataElement Property::Value targetValue; int animatorIndex; int positionDataIndex; + int condition; }; class LayoutTransitionData; @@ -166,22 +168,86 @@ public: LayoutTransitionData( const LayoutTransitionData& ) = delete; LayoutTransitionData& operator=( const LayoutTransitionData& ) = delete; + /** + * @brief Add a property animator for an actor in the transition + * @param[in] actor The actor + * @param[in] map The map containing the transition animator keys + * + * This will add the property animator to the list of animators related to this transition + */ void AddPropertyAnimator( Actor actor, Property::Map map ); + + /** + * @brief Add a property animator for an actor in the transition + * @param[in] actor The actor + * @param[in] map The map containing the transition animator keys + * @param[in] keyFrames The key frames used by the property animator + * @param[in] interpolation The interpolation used by the property animator + * + * This will add the property animator to the list of animators related to this transition + */ void AddPropertyAnimator( Actor actor, Property::Map map, KeyFrames keyFrames, Animation::Interpolation interpolation ); + + /** + * @brief Add a property animator for an actor in the transition + * @param[in] actor The actor + * @param[in] map The map containing the transition animator keys + * @param[in] path The path for the property animator + * @param[in] forward The forward vector for the property animator + * + * This will add the property animator to the list of animators related to this transition + */ void AddPropertyAnimator( Actor actor, Property::Map map, Path path, Vector3 forward ); + /** + * @brief Convert the transition property animators to the layout data elements + * @param[in] actor The actor the transition property animators are applied to + * @param[in] layoutData The layout data containing layout data elements array for the layout update + * + * This will parse the property animators and add the layout data elements to the layout data elements array + */ void ConvertToLayoutDataElements( Actor, LayoutData& layoutData ); /** - * @copydoc Dali::Animation::FinishedSignal() + * @brief Convert the transition children property animators to the layout data elements + * @param[in] actor The actor the transition property animators are applied to + * @param[in] layoutData The layout data containing layout data elements array for the layout update + * + * This will parse the children property animators and add the layout data elements to the layout data elements array + */ + static void ConvertChildrenAnimatorsToLayoutDataElements( Actor, LayoutData& layoutData ); + + /** + * @copydoc Dali::Toolkit::LayoutTransitionData::FinishedSignal() */ Dali::Toolkit::LayoutTransitionData::LayoutTransitionSignalType& FinishedSignal(); + /** + * @brief Emit the transition finish signal + * @param[in] layoutTransitionType The transition type + */ void EmitSignalFinish( int layoutTransitionType ); private: - bool ConvertToLayoutAnimator( const Property::Map& animatorData, const PropertyAnimator& propertyAnimator, LayoutDataAnimator& layoutAnimator ); - bool ConvertToLayoutDataElement( const PropertyAnimator& propertyAnimator, LayoutDataElement& layoutDataElement, LayoutData& layoutData ); + /** + * @brief Convert the property animator data to the layout data animator + * @param[in] animatorData The animator data map + * @param[in] propertyAnimator The property animator + * @param[in] layoutAnimator The layout animator + * + * This will parse the property animator data and add the layout data element animator + */ + static bool ConvertToLayoutAnimator( const Property::Map& animatorData, const PropertyAnimator& propertyAnimator, LayoutDataAnimator& layoutAnimator ); + + /** + * @brief Convert the property animator to the layout data element + * @param[in] propertyAnimator The property animator + * @param[in] layoutDataElement The layout data element + * @param[in] layoutDataElement The layout data + * + * This will parse the children property animators and add the layout data elements to the layout data elements array + */ + static bool ConvertToLayoutDataElement( const PropertyAnimator& propertyAnimator, LayoutDataElement& layoutDataElement, LayoutData& layoutData ); PropertyAnimatorArray mPropertyAnimators;