From: Adeel Kazmi Date: Mon, 24 Oct 2016 16:19:37 +0000 (-0700) Subject: Merge "Added bezier curve control points to TransitionData" into devel/master X-Git-Tag: dali_1.2.12~12 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=8c79a1d109b9c8980ed73a364a6a7ffd083cf733;hp=2ce0f3882dcfcbd046642f526ae0f3f481b6a0b5 Merge "Added bezier curve control points to TransitionData" into devel/master --- diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index 7b3f2d6..dcb2901 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -2683,6 +2683,12 @@ void Controller::Impl::ClampHorizontalScroll( const Vector2& layoutSize ) void Controller::Impl::ClampVerticalScroll( const Vector2& layoutSize ) { + if( LayoutEngine::SINGLE_LINE_BOX == mLayoutEngine.GetLayout() ) + { + // Nothing to do if the text is single line. + return; + } + // Clamp between -space & 0. if( layoutSize.height > mVisualModel->mControlSize.height ) { diff --git a/dali-toolkit/internal/visuals/border/border-visual.cpp b/dali-toolkit/internal/visuals/border/border-visual.cpp index ba326d0..764d178 100644 --- a/dali-toolkit/internal/visuals/border/border-visual.cpp +++ b/dali-toolkit/internal/visuals/border/border-visual.cpp @@ -121,7 +121,7 @@ BorderVisual::~BorderVisual() { } -void BorderVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap ) +void BorderVisual::DoSetProperties( const Property::Map& propertyMap ) { Property::Value* color = propertyMap.Find( Toolkit::BorderVisual::Property::COLOR, COLOR_NAME ); if( !( color && color->Get(mBorderColor) ) ) diff --git a/dali-toolkit/internal/visuals/border/border-visual.h b/dali-toolkit/internal/visuals/border/border-visual.h index 3fce5d6..4f999b4 100644 --- a/dali-toolkit/internal/visuals/border/border-visual.h +++ b/dali-toolkit/internal/visuals/border/border-visual.h @@ -75,9 +75,9 @@ protected: virtual ~BorderVisual(); /** - * @copydoc Visual::Base::DoInitialize + * @copydoc Visual::Base::DoSetProperties */ - virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ); + virtual void DoSetProperties( const Property::Map& propertyMap ); /** * @copydoc Visual::Base::DoSetOnStage diff --git a/dali-toolkit/internal/visuals/color/color-visual.cpp b/dali-toolkit/internal/visuals/color/color-visual.cpp index 8736d54..cbe0036 100644 --- a/dali-toolkit/internal/visuals/color/color-visual.cpp +++ b/dali-toolkit/internal/visuals/color/color-visual.cpp @@ -80,7 +80,7 @@ ColorVisual::~ColorVisual() { } -void ColorVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap ) +void ColorVisual::DoSetProperties( const Property::Map& propertyMap ) { Property::Value* color = propertyMap.Find( Toolkit::ColorVisual::Property::MIX_COLOR, COLOR_NAME ); if( !( color && color->Get(mMixColor) ) ) diff --git a/dali-toolkit/internal/visuals/color/color-visual.h b/dali-toolkit/internal/visuals/color/color-visual.h index 6552ac6..cf2b057 100644 --- a/dali-toolkit/internal/visuals/color/color-visual.h +++ b/dali-toolkit/internal/visuals/color/color-visual.h @@ -94,9 +94,9 @@ protected: virtual ~ColorVisual(); /** - * @copydoc Visual::Base::DoInitialize + * @copydoc Visual::Base::DoSetProperties */ - virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ); + virtual void DoSetProperties( const Property::Map& propertyMap ); /** * @copydoc Visual::Base::DoSetOnStage diff --git a/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp b/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp index b662821..ee2b150 100644 --- a/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp +++ b/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp @@ -201,7 +201,7 @@ GradientVisual::~GradientVisual() { } -void GradientVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap ) +void GradientVisual::DoSetProperties( const Property::Map& propertyMap ) { Toolkit::GradientVisual::Units::Type gradientUnits = Toolkit::GradientVisual::Units::OBJECT_BOUNDING_BOX; diff --git a/dali-toolkit/internal/visuals/gradient/gradient-visual.h b/dali-toolkit/internal/visuals/gradient/gradient-visual.h index 5171b12..f7f47ee 100644 --- a/dali-toolkit/internal/visuals/gradient/gradient-visual.h +++ b/dali-toolkit/internal/visuals/gradient/gradient-visual.h @@ -129,9 +129,9 @@ protected: virtual ~GradientVisual(); /** - * @copydoc Visual::Base::DoInitialize + * @copydoc Visual::Base::DoSetProperties */ - virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ); + virtual void DoSetProperties( const Property::Map& propertyMap ); /** * @copydoc Visual::Base::DoSetOnStage diff --git a/dali-toolkit/internal/visuals/image/batch-image-visual.cpp b/dali-toolkit/internal/visuals/image/batch-image-visual.cpp index 973355a..eecef34 100644 --- a/dali-toolkit/internal/visuals/image/batch-image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/batch-image-visual.cpp @@ -102,7 +102,7 @@ BatchImageVisual::~BatchImageVisual() { } -void BatchImageVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap ) +void BatchImageVisual::DoSetProperties( const Property::Map& propertyMap ) { std::string oldImageUrl = mImageUrl; Property::Value* imageURLValue = propertyMap.Find( Dali::Toolkit::ImageVisual::Property::URL, Dali::Toolkit::Internal::IMAGE_URL_NAME ); @@ -127,25 +127,6 @@ void BatchImageVisual::DoInitialize( Actor& actor, const Property::Map& property mDesiredSize = ImageDimensions( desiredWidth, desiredHeight ); } - - // Remove old renderer if exit. - if( mImpl->mRenderer ) - { - if( actor ) // Remove old renderer from actor. - { - actor.RemoveRenderer( mImpl->mRenderer ); - } - if( !oldImageUrl.empty() ) // Clean old renderer from cache. - { - CleanCache( oldImageUrl ); - } - } - - // If actor is on stage, create new renderer and apply to actor. - if( actor && actor.OnStage() ) - { - SetOnStage( actor ); - } } void BatchImageVisual::SetSize( const Vector2& size ) diff --git a/dali-toolkit/internal/visuals/image/batch-image-visual.h b/dali-toolkit/internal/visuals/image/batch-image-visual.h index 7151100..be84aab 100644 --- a/dali-toolkit/internal/visuals/image/batch-image-visual.h +++ b/dali-toolkit/internal/visuals/image/batch-image-visual.h @@ -89,9 +89,9 @@ protected: ~BatchImageVisual(); /** - * @copydoc Visua::Base::DoInitialize + * @copydoc Visua::Base::DoSetProperties */ - virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ); + virtual void DoSetProperties( const Property::Map& propertyMap ); /** * @copydoc Visual::Base::DoSetOnStage diff --git a/dali-toolkit/internal/visuals/image/image-visual.cpp b/dali-toolkit/internal/visuals/image/image-visual.cpp index 02e153b..21bbc63 100644 --- a/dali-toolkit/internal/visuals/image/image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/image-visual.cpp @@ -260,7 +260,7 @@ ImageVisual::~ImageVisual() { } -void ImageVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap ) +void ImageVisual::DoSetProperties( const Property::Map& propertyMap ) { Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME ); if( imageURLValue ) diff --git a/dali-toolkit/internal/visuals/image/image-visual.h b/dali-toolkit/internal/visuals/image/image-visual.h index f3a04b0..c2eca0e 100644 --- a/dali-toolkit/internal/visuals/image/image-visual.h +++ b/dali-toolkit/internal/visuals/image/image-visual.h @@ -174,9 +174,9 @@ protected: virtual ~ImageVisual(); /** - * @copydoc Visual::Base::DoInitialize + * @copydoc Visual::Base::DoSetProperties */ - virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ); + virtual void DoSetProperties( const Property::Map& propertyMap ); /** * @copydoc Visual::Base::DoSetOnStage diff --git a/dali-toolkit/internal/visuals/mesh/mesh-visual.cpp b/dali-toolkit/internal/visuals/mesh/mesh-visual.cpp index 28ff3d1..3e94f9e 100644 --- a/dali-toolkit/internal/visuals/mesh/mesh-visual.cpp +++ b/dali-toolkit/internal/visuals/mesh/mesh-visual.cpp @@ -308,7 +308,7 @@ MeshVisual::~MeshVisual() { } -void MeshVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap ) +void MeshVisual::DoSetProperties( const Property::Map& propertyMap ) { Property::Value* objectUrl = propertyMap.Find( Toolkit::MeshVisual::Property::OBJECT_URL, OBJECT_URL_NAME ); if( !objectUrl || !objectUrl->Get( mObjectUrl ) ) diff --git a/dali-toolkit/internal/visuals/mesh/mesh-visual.h b/dali-toolkit/internal/visuals/mesh/mesh-visual.h index 1762f46..4c0441a 100644 --- a/dali-toolkit/internal/visuals/mesh/mesh-visual.h +++ b/dali-toolkit/internal/visuals/mesh/mesh-visual.h @@ -104,9 +104,9 @@ protected: virtual ~MeshVisual(); /** - * @copydoc Visual::Base::DoInitialize + * @copydoc Visual::Base::DoSetProperties */ - virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ); + virtual void DoSetProperties( const Property::Map& propertyMap ); /** * @copydoc Visual::Base::DoSetOnStage diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp index 036f978..da73b33 100644 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp @@ -242,7 +242,7 @@ NPatchVisual::~NPatchVisual() { } -void NPatchVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap ) +void NPatchVisual::DoSetProperties( const Property::Map& propertyMap ) { Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME ); if( imageURLValue ) diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.h b/dali-toolkit/internal/visuals/npatch/npatch-visual.h index 07918ee..b3210b9 100644 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.h +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.h @@ -123,9 +123,9 @@ protected: virtual ~NPatchVisual(); /** - * @copydoc Visual::Base::DoInitialize + * @copydoc Visual::Base::DoSetProperties */ - virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ); + virtual void DoSetProperties( const Property::Map& propertyMap ); /** * @copydoc Visual::Base::DoSetOnStage diff --git a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp index 6142ad1..6938eef 100644 --- a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp +++ b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp @@ -187,7 +187,7 @@ PrimitiveVisual::~PrimitiveVisual() { } -void PrimitiveVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap ) +void PrimitiveVisual::DoSetProperties( const Property::Map& propertyMap ) { //Find out which shape to renderer. Property::Value* primitiveTypeValue = propertyMap.Find( Toolkit::PrimitiveVisual::Property::SHAPE, PRIMITIVE_SHAPE ); diff --git a/dali-toolkit/internal/visuals/primitive/primitive-visual.h b/dali-toolkit/internal/visuals/primitive/primitive-visual.h index 59979f8..c06d55c 100644 --- a/dali-toolkit/internal/visuals/primitive/primitive-visual.h +++ b/dali-toolkit/internal/visuals/primitive/primitive-visual.h @@ -151,9 +151,9 @@ protected: virtual ~PrimitiveVisual(); /** - * @copydoc Visual::Base::DoInitialize + * @copydoc Visual::Base::DoSetProperties */ - virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ); + virtual void DoSetProperties( const Property::Map& propertyMap ); /** * @copydoc Visual::Base::DoSetOnStage diff --git a/dali-toolkit/internal/visuals/svg/svg-visual.cpp b/dali-toolkit/internal/visuals/svg/svg-visual.cpp index f3ad956..efa3582 100644 --- a/dali-toolkit/internal/visuals/svg/svg-visual.cpp +++ b/dali-toolkit/internal/visuals/svg/svg-visual.cpp @@ -84,7 +84,7 @@ SvgVisual::~SvgVisual() } } -void SvgVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap ) +void SvgVisual::DoSetProperties( const Property::Map& propertyMap ) { Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME ); if( imageURLValue ) diff --git a/dali-toolkit/internal/visuals/svg/svg-visual.h b/dali-toolkit/internal/visuals/svg/svg-visual.h index 5dbd24e..0456bb5 100644 --- a/dali-toolkit/internal/visuals/svg/svg-visual.h +++ b/dali-toolkit/internal/visuals/svg/svg-visual.h @@ -115,9 +115,9 @@ protected: virtual ~SvgVisual(); /** - * @copydoc Visual::Base::DoInitialize + * @copydoc Visual::Base::DoSetProperties */ - virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ); + virtual void DoSetProperties( const Property::Map& propertyMap ); /** * @copydoc Visual::Base::DoSetOnStage diff --git a/dali-toolkit/internal/visuals/text/text-visual.cpp b/dali-toolkit/internal/visuals/text/text-visual.cpp index 3f9dd1e..31dc8bb 100644 --- a/dali-toolkit/internal/visuals/text/text-visual.cpp +++ b/dali-toolkit/internal/visuals/text/text-visual.cpp @@ -259,10 +259,8 @@ TextVisual::~TextVisual() { } -void TextVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap ) +void TextVisual::DoSetProperties( const Property::Map& propertyMap ) { - mSelf = actor; - for( Property::Map::SizeType index = 0u, count = propertyMap.Count(); index < count; ++index ) { const KeyValuePair& keyValue = propertyMap.GetKeyValue( index ); @@ -812,6 +810,13 @@ Dali::Property::Value TextVisual::DoGetProperty( Dali::Property::Index index ) void TextVisual::RenderText() { + Actor self = mSelf.GetHandle(); + if( !self ) + { + // Nothing to do if the handle is not initialized. + return; + } + Actor renderableActor; if( mRenderer ) @@ -828,7 +833,7 @@ void TextVisual::RenderText() const Vector2& scrollOffset = mController->GetScrollPosition(); renderableActor.SetPosition( scrollOffset.x, scrollOffset.y ); - mSelf.Add( renderableActor ); + self.Add( renderableActor ); } mRenderableActor = renderableActor; @@ -849,6 +854,13 @@ void TextVisual::StopTextAutoScrolling() void TextVisual::SetUpAutoScrolling() { + Actor self = mSelf.GetHandle(); + if( !self ) + { + // Nothing to do if the handle is not initialized. + return; + } + const Text::ScrollerData* const data = mController->GetAutoScrollData(); if( NULL != data ) @@ -862,8 +874,8 @@ void TextVisual::SetUpAutoScrolling() mTextScroller->StartScrolling( mRenderableActor, *data ); - mSelf.Add( mTextScroller->GetScrollingText() ); - mSelf.Add( mTextScroller->GetSourceCamera() ); + self.Add( mTextScroller->GetScrollingText() ); + self.Add( mTextScroller->GetSourceCamera() ); } } diff --git a/dali-toolkit/internal/visuals/text/text-visual.h b/dali-toolkit/internal/visuals/text/text-visual.h index c609990..47289d1 100644 --- a/dali-toolkit/internal/visuals/text/text-visual.h +++ b/dali-toolkit/internal/visuals/text/text-visual.h @@ -19,6 +19,7 @@ */ // EXTERNAL INCLUDES +#include #include // INTERNAL INCLUDES @@ -124,9 +125,9 @@ protected: // from Visual::Base /** - * @copydoc Visual::Base::DoInitialize() + * @copydoc Visual::Base::DoSetProperties() */ - virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ); + virtual void DoSetProperties( const Property::Map& propertyMap ); /** * @copydoc Visual::Base::DoSetOnStage() @@ -168,7 +169,7 @@ private: private: Text::ControllerPtr mController; ///< The text's controller. - Actor mSelf; + WeakHandle mSelf; Text::RendererPtr mRenderer; Text::TextScrollerPtr mTextScroller; diff --git a/dali-toolkit/internal/visuals/visual-base-impl.cpp b/dali-toolkit/internal/visuals/visual-base-impl.cpp index 48df29a..d152a7f 100644 --- a/dali-toolkit/internal/visuals/visual-base-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-base-impl.cpp @@ -59,7 +59,7 @@ void Visual::Base::SetCustomShader( const Property::Map& shaderMap ) } } -void Visual::Base::Initialize( Actor& actor, const Property::Map& propertyMap ) +void Visual::Base::SetProperties( const Property::Map& propertyMap ) { Property::Value* customShaderValue = propertyMap.Find( Toolkit::Visual::Property::SHADER, CUSTOM_SHADER ); if( customShaderValue ) @@ -71,7 +71,7 @@ void Visual::Base::Initialize( Actor& actor, const Property::Map& propertyMap ) } } - DoInitialize( actor, propertyMap ); + DoSetProperties( propertyMap ); } void Visual::Base::SetName( const std::string& name ) diff --git a/dali-toolkit/internal/visuals/visual-base-impl.h b/dali-toolkit/internal/visuals/visual-base-impl.h index 475a5fa..432a3f2 100644 --- a/dali-toolkit/internal/visuals/visual-base-impl.h +++ b/dali-toolkit/internal/visuals/visual-base-impl.h @@ -66,14 +66,10 @@ class Base : public BaseObject public: /** - * Initialisation of the visual, this API should only called by the VisualFactory: - * request the geometry and shader from the cache, if not available, create and save to the cache for sharing; - * record the property values. - * - * @param[in] actor The Actor the visual is applied to if, empty if the visual has not been applied to any Actor + * Setting the properties of the visual, this API should only called by the VisualFactory * @param[in] propertyMap The properties for the requested Visual object. */ - void Initialize( Actor& actor, const Property::Map& propertyMap ); + void SetProperties( const Property::Map& propertyMap ); /** * @copydoc Toolkit::Visual::Base::SetName @@ -184,12 +180,11 @@ protected: virtual void DoCreatePropertyMap( Property::Map& map ) const = 0; /** - * @brief Called by Initialize() allowing sub classes to respond to the Initialize event + * @brief Called by SetProperties() allowing sub classes to set their properties * - * @param[in] actor The Actor the visual is applied to if, empty if the visual has not been applied to any Actor * @param[in] propertyMap The properties for the requested Visual object. */ - virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ) {} + virtual void DoSetProperties( const Property::Map& propertyMap ) = 0; protected: diff --git a/dali-toolkit/internal/visuals/visual-factory-impl.cpp b/dali-toolkit/internal/visuals/visual-factory-impl.cpp index c7a9f33..67311b0 100644 --- a/dali-toolkit/internal/visuals/visual-factory-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-factory-impl.cpp @@ -199,8 +199,7 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property if( visualPtr ) { - Actor actor; - visualPtr->Initialize( actor, propertyMap ); + visualPtr->SetProperties( propertyMap ); } else { diff --git a/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp b/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp index 09a7a8d..b65f67c 100644 --- a/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp +++ b/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp @@ -78,6 +78,11 @@ WireframeVisual::~WireframeVisual() { } +void WireframeVisual::DoSetProperties( const Property::Map& propertyMap ) +{ + // no properties supported at the moment +} + void WireframeVisual::DoSetOnStage( Actor& actor ) { InitializeRenderer(); diff --git a/dali-toolkit/internal/visuals/wireframe/wireframe-visual.h b/dali-toolkit/internal/visuals/wireframe/wireframe-visual.h index c4ff5c4..3756e00 100644 --- a/dali-toolkit/internal/visuals/wireframe/wireframe-visual.h +++ b/dali-toolkit/internal/visuals/wireframe/wireframe-visual.h @@ -66,6 +66,11 @@ protected: virtual ~WireframeVisual(); /** + * @copydoc Visual::Base::DoSetProperties() + */ + virtual void DoSetProperties( const Property::Map& propertyMap ); + + /** * @copydoc Visual::Base::DoSetOnStage */ virtual void DoSetOnStage( Actor& actor ); diff --git a/dali-toolkit/public-api/dali-toolkit-version.cpp b/dali-toolkit/public-api/dali-toolkit-version.cpp index c15604b..8c9ed00 100644 --- a/dali-toolkit/public-api/dali-toolkit-version.cpp +++ b/dali-toolkit/public-api/dali-toolkit-version.cpp @@ -31,7 +31,7 @@ namespace Toolkit const unsigned int TOOLKIT_MAJOR_VERSION = 1; const unsigned int TOOLKIT_MINOR_VERSION = 2; -const unsigned int TOOLKIT_MICRO_VERSION = 10; +const unsigned int TOOLKIT_MICRO_VERSION = 11; const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/packaging/dali-addon.spec b/packaging/dali-addon.spec index 0da6d86..b5a63b2 100644 --- a/packaging/dali-addon.spec +++ b/packaging/dali-addon.spec @@ -1,6 +1,6 @@ Name: dali-addon Summary: DALi module for Node.JS -Version: 1.2.10 +Version: 1.2.11 Release: 1 Group: Development/Libraries License: Apache License, Version 2.0 diff --git a/packaging/dali-csharp-wrapper.spec b/packaging/dali-csharp-wrapper.spec index dca178a..788769d 100755 --- a/packaging/dali-csharp-wrapper.spec +++ b/packaging/dali-csharp-wrapper.spec @@ -1,6 +1,6 @@ Name: NDalic Summary: dali wrapper -Version: 1.0.0 +Version: 1.2.11 Release: 1 Group: uifw/graphic License: TO_BE_FILLED_IN diff --git a/packaging/dali-toolkit.spec b/packaging/dali-toolkit.spec index f4e8ae0..bae76d7 100644 --- a/packaging/dali-toolkit.spec +++ b/packaging/dali-toolkit.spec @@ -1,6 +1,6 @@ Name: dali-toolkit Summary: The OpenGLES Canvas Core Library Toolkit -Version: 1.2.10 +Version: 1.2.11 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-2-Clause and MIT diff --git a/plugins/dali-swig/SWIG/dali-operator.i b/plugins/dali-swig/SWIG/dali-operator.i index f6bbe4d..894b34f 100644 --- a/plugins/dali-swig/SWIG/dali-operator.i +++ b/plugins/dali-swig/SWIG/dali-operator.i @@ -252,7 +252,13 @@ * This is because from C# we can't wrap the operator BooleanType() function */ %extend Dali::BaseHandle { - bool IsHandleEmpty() const { + bool HasBody() const { + + // C++ code. DALi uses Handle <-> Body design pattern. + // This function checks the Handle to see if it has a body attached ( possible to have empty handles). + // Handles in DALi can be converted into a boolean type + // to check if the handle has a valid body attached to it. + // Internally checking *$self will checks IntrusivePtr mObjectHandle in BaseHandle; if( *$self ) { return true; @@ -262,6 +268,21 @@ return false; } } + + // Check if two handles point to the same body / ref-object. + bool IsEqual( const BaseHandle& rhs ) const { + + // C++ code. Check if two handles reference the same implemtion + if( *$self == rhs) + { + return true; + } + else + { + return false; + } + } + }; /** @@ -274,21 +295,114 @@ */ %typemap(cscode) Dali::BaseHandle %{ - public static bool operator true(BaseHandle handle) - { - if( handle!= null ) - { - return handle.IsHandleEmpty(); - } - else - { - return false; - } - } - public static bool operator false(BaseHandle handle) - { - return handle.IsHandleEmpty(); - } -%} + // Returns the bool value true to indicate that an operand is true and returns false otherwise. + public static bool operator true(BaseHandle handle) + { + // if the C# object is null, return false + if( BaseHandle.ReferenceEquals( handle, null ) ) + { + return false; + } + // returns true if the handle has a body, false otherwise + return handle.HasBody(); + } + + // Returns the bool false to indicate that an operand is false and returns true otherwise. + public static bool operator false(BaseHandle handle) + { + // if the C# object is null, return true + if( BaseHandle.ReferenceEquals( handle, null ) ) + { + return true; + } + return !handle.HasBody(); + } + + // Explicit conversion from Handle to bool. + public static explicit operator bool(BaseHandle handle) + { + // if the C# object is null, return false + if( BaseHandle.ReferenceEquals( handle, null ) ) + { + return false; + } + // returns true if the handle has a body, false otherwise + return handle.HasBody(); + } + // Equality operator + public static bool operator == (BaseHandle x, BaseHandle y) + { + // if the C# objects are the same return true + if( BaseHandle.ReferenceEquals( x, y ) ) + { + return true; + } + if ( !BaseHandle.ReferenceEquals( x, null ) && !BaseHandle.ReferenceEquals( y, null ) ) + { + // drop into native code to see if both handles point to the same body + return x.IsEqual( y) ; + } + return false; + + } + + // Inequality operator. Returns Null if either operand is Null + public static bool operator !=(BaseHandle x, BaseHandle y) + { + return !(x==y); + } + + // Logical AND operator for && + // It's possible when doing a && this function (opBitwiseAnd) is never called due + // to short circuiting. E.g. + // If you perform x && y What actually is called is + // BaseHandle.op_False( x ) ? BaseHandle.op_True( x ) : BaseHandle.opTrue( BaseHandle.opBitwiseAnd(x,y) ) + // + public static BaseHandle operator &(BaseHandle x, BaseHandle y) + { + if( x == y ) + { + return x; + } + return null; + } + + // Logical OR operator for || + // It's possible when doing a || this function (opBitwiseOr) is never called due + // to short circuiting. E.g. + // If you perform x || y What actually is called is + // BaseHandle.op_True( x ) ? BaseHandle.op_True( x ) : BaseHandle.opTrue( BaseHandle.opBitwiseOr(x,y) ) + public static BaseHandle operator |(BaseHandle x, BaseHandle y) + { + if ( !BaseHandle.ReferenceEquals( x, null ) || !BaseHandle.ReferenceEquals( y, null ) ) + { + if( x.HasBody() ) + { + return x; + } + if( y.HasBody() ) + { + return y; + } + return null; + } + return null; + } + + // Logical ! operator + public static bool operator !(BaseHandle x) + { + // if the C# object is null, return true + if( BaseHandle.ReferenceEquals( x, null ) ) + { + return true; + } + if( x.HasBody() ) + { + return false; + } + return true; + } +%} \ No newline at end of file diff --git a/plugins/dali-swig/SWIG/events/animation-event.i b/plugins/dali-swig/SWIG/events/animation-event.i index e921f76..323a6fc 100644 --- a/plugins/dali-swig/SWIG/events/animation-event.i +++ b/plugins/dali-swig/SWIG/events/animation-event.i @@ -26,6 +26,63 @@ using System.Runtime.InteropServices; %define Animation_EVENTHANDLER_TYPEMAP_HELPER(NameSpace, ClassName) %typemap(cscode) NameSpace::ClassName %{ + public static readonly int PARENT_ORIGIN = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_get(); + public static readonly int PARENT_ORIGIN_X = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_X_get(); + public static readonly int PARENT_ORIGIN_Y = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_Y_get(); + public static readonly int PARENT_ORIGIN_Z = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_Z_get(); + public static readonly int ANCHOR_POINT = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_get(); + public static readonly int ANCHOR_POINT_X = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_X_get(); + public static readonly int ANCHOR_POINT_Y = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_Y_get(); + public static readonly int ANCHOR_POINT_Z = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_Z_get(); + public static readonly int SIZE = NDalicPINVOKE.Actor_Property_SIZE_get(); + public static readonly int SIZE_WIDTH = NDalicPINVOKE.Actor_Property_SIZE_WIDTH_get(); + public static readonly int SIZE_HEIGHT = NDalicPINVOKE.Actor_Property_SIZE_HEIGHT_get(); + public static readonly int SIZE_DEPTH = NDalicPINVOKE.Actor_Property_SIZE_DEPTH_get(); + public static readonly int POSITION = NDalicPINVOKE.Actor_Property_POSITION_get(); + public static readonly int POSITION_X = NDalicPINVOKE.Actor_Property_POSITION_X_get(); + public static readonly int POSITION_Y = NDalicPINVOKE.Actor_Property_POSITION_Y_get(); + public static readonly int POSITION_Z = NDalicPINVOKE.Actor_Property_POSITION_Z_get(); + public static readonly int WORLD_POSITION = NDalicPINVOKE.Actor_Property_WORLD_POSITION_get(); + public static readonly int WORLD_POSITION_X = NDalicPINVOKE.Actor_Property_WORLD_POSITION_X_get(); + public static readonly int WORLD_POSITION_Y = NDalicPINVOKE.Actor_Property_WORLD_POSITION_Y_get(); + public static readonly int WORLD_POSITION_Z = NDalicPINVOKE.Actor_Property_WORLD_POSITION_Z_get(); + public static readonly int ORIENTATION = NDalicPINVOKE.Actor_Property_ORIENTATION_get(); + public static readonly int WORLD_ORIENTATION = NDalicPINVOKE.Actor_Property_WORLD_ORIENTATION_get(); + public static readonly int SCALE = NDalicPINVOKE.Actor_Property_SCALE_get(); + public static readonly int SCALE_X = NDalicPINVOKE.Actor_Property_SCALE_X_get(); + public static readonly int SCALE_Y = NDalicPINVOKE.Actor_Property_SCALE_Y_get(); + public static readonly int SCALE_Z = NDalicPINVOKE.Actor_Property_SCALE_Z_get(); + public static readonly int WORLD_SCALE = NDalicPINVOKE.Actor_Property_WORLD_SCALE_get(); + public static readonly int VISIBLE = NDalicPINVOKE.Actor_Property_VISIBLE_get(); + public static readonly int COLOR = NDalicPINVOKE.Actor_Property_COLOR_get(); + public static readonly int COLOR_RED = NDalicPINVOKE.Actor_Property_COLOR_RED_get(); + public static readonly int COLOR_GREEN = NDalicPINVOKE.Actor_Property_COLOR_GREEN_get(); + public static readonly int COLOR_BLUE = NDalicPINVOKE.Actor_Property_COLOR_BLUE_get(); + public static readonly int COLOR_ALPHA = NDalicPINVOKE.Actor_Property_COLOR_ALPHA_get(); + public static readonly int WORLD_COLOR = NDalicPINVOKE.Actor_Property_WORLD_COLOR_get(); + public static readonly int WORLD_MATRIX = NDalicPINVOKE.Actor_Property_WORLD_MATRIX_get(); + public static readonly int NAME = NDalicPINVOKE.Actor_Property_NAME_get(); + public static readonly int SENSITIVE = NDalicPINVOKE.Actor_Property_SENSITIVE_get(); + public static readonly int LEAVE_REQUIRED = NDalicPINVOKE.Actor_Property_LEAVE_REQUIRED_get(); + public static readonly int INHERIT_ORIENTATION = NDalicPINVOKE.Actor_Property_INHERIT_ORIENTATION_get(); + public static readonly int INHERIT_SCALE = NDalicPINVOKE.Actor_Property_INHERIT_SCALE_get(); + public static readonly int COLOR_MODE = NDalicPINVOKE.Actor_Property_COLOR_MODE_get(); + public static readonly int POSITION_INHERITANCE = NDalicPINVOKE.Actor_Property_POSITION_INHERITANCE_get(); + public static readonly int DRAW_MODE = NDalicPINVOKE.Actor_Property_DRAW_MODE_get(); + public static readonly int SIZE_MODE_FACTOR = NDalicPINVOKE.Actor_Property_SIZE_MODE_FACTOR_get(); + public static readonly int WIDTH_RESIZE_POLICY = NDalicPINVOKE.Actor_Property_WIDTH_RESIZE_POLICY_get(); + public static readonly int HEIGHT_RESIZE_POLICY = NDalicPINVOKE.Actor_Property_HEIGHT_RESIZE_POLICY_get(); + public static readonly int SIZE_SCALE_POLICY = NDalicPINVOKE.Actor_Property_SIZE_SCALE_POLICY_get(); + public static readonly int WIDTH_FOR_HEIGHT = NDalicPINVOKE.Actor_Property_WIDTH_FOR_HEIGHT_get(); + public static readonly int HEIGHT_FOR_WIDTH = NDalicPINVOKE.Actor_Property_HEIGHT_FOR_WIDTH_get(); + public static readonly int PADDING = NDalicPINVOKE.Actor_Property_PADDING_get(); + public static readonly int MINIMUM_SIZE = NDalicPINVOKE.Actor_Property_MINIMUM_SIZE_get(); + public static readonly int MAXIMUM_SIZE = NDalicPINVOKE.Actor_Property_MAXIMUM_SIZE_get(); + public static readonly int INHERIT_POSITION = NDalicPINVOKE.Actor_Property_INHERIT_POSITION_get(); + public static readonly int CLIPPING_MODE = NDalicPINVOKE.Actor_Property_CLIPPING_MODE_get(); + public static readonly int BATCH_PARENT = NDalicPINVOKE.Actor_Property_BATCH_PARENT_get(); + + /** * @brief Event arguments that passed via Finished signal * @@ -150,6 +207,110 @@ using System.Runtime.InteropServices; } } + public void AnimateBy(Actor target, U propertyIndex, T relativeValue) + { + dynamic var = (object)(propertyIndex); + dynamic obj = (object)(relativeValue); + AnimateBy(new Property(target, var), new Property.Value(obj)); + } + + public void AnimateBy(Actor target, U propertyIndex, T relativeValue, AlphaFunction alpha) + { + dynamic var = (object)(propertyIndex); + dynamic obj = (object)(relativeValue); + AnimateBy(new Property(target, var), new Property.Value(obj), alpha); + } + + public void AnimateBy(Actor target, U propertyIndex, T relativeValue, TimePeriod period) + { + dynamic var = (object)(propertyIndex); + dynamic obj = (object)(relativeValue); + AnimateBy(new Property(target, var), new Property.Value(obj), period); + } + + public void AnimateBy(Actor target, U propertyIndex, T relativeValue, AlphaFunction alpha, TimePeriod period) + { + dynamic var = (object)(propertyIndex); + dynamic obj = (object)(relativeValue); + AnimateBy(new Property(target, var), new Property.Value(obj), alpha, period); + } + + public void AnimateTo(Actor target, U propertyIndex, T destinationValue) + { + dynamic var = (object)(propertyIndex); + dynamic obj = (object)(destinationValue); + AnimateTo(new Property(target, var), new Property.Value(obj)); + } + + public void AnimateTo(Actor target, U propertyIndex, T destinationValue, AlphaFunction alpha) + { + dynamic var = (object)(propertyIndex); + dynamic obj = (object)(destinationValue); + AnimateTo(new Property(target, var), new Property.Value(obj), alpha); + } + + public void AnimateTo(Actor target, U propertyIndex, T destinationValue, TimePeriod period) + { + dynamic var = (object)(propertyIndex); + dynamic obj = (object)(destinationValue); + AnimateTo(new Property(target, var), new Property.Value(obj), period); + } + + public void AnimateTo(Actor target, U propertyIndex, T destinationValue, AlphaFunction alpha, TimePeriod period) + { + dynamic var = (object)(propertyIndex); + dynamic obj = (object)(destinationValue); + AnimateTo(new Property(target, var), new Property.Value(obj), alpha, period); + } + + public void AnimateBetween(Actor target, U propertyIndex, KeyFrames keyFrames) + { + dynamic var = (object)(propertyIndex); + AnimateBetween(new Property(target, var), keyFrames); + } + + public void AnimateBetween(Actor target, U propertyIndex, KeyFrames keyFrames, Animation.Interpolation interpolation) + { + dynamic var = (object)(propertyIndex); + AnimateBetween(new Property(target, var), keyFrames, interpolation); + } + + public void AnimateBetween(Actor target, U propertyIndex, KeyFrames keyFrames, AlphaFunction alpha) + { + dynamic var = (object)(propertyIndex); + AnimateBetween(new Property(target, var), keyFrames, alpha); + } + + public void AnimateBetween(Actor target, U propertyIndex, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation) + { + dynamic var = (object)(propertyIndex); + AnimateBetween(new Property(target, var), keyFrames, alpha, interpolation); + } + + public void AnimateBetween(Actor target, U propertyIndex, KeyFrames keyFrames, TimePeriod period) + { + dynamic var = (object)(propertyIndex); + AnimateBetween(new Property(target, var), keyFrames, period); + } + + public void AnimateBetween(Actor target, U propertyIndex, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation) + { + dynamic var = (object)(propertyIndex); + AnimateBetween(new Property(target, var), keyFrames, period, interpolation); + } + + public void AnimateBetween(Actor target, U propertyIndex, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period) + { + dynamic var = (object)(propertyIndex); + AnimateBetween(new Property(target, var), keyFrames, alpha, period); + } + + public void AnimateBetween(Actor target, U propertyIndex, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation) + { + dynamic var = (object)(propertyIndex); + AnimateBetween(new Property(target, var), keyFrames, alpha, period, interpolation); + } + %} %enddef diff --git a/plugins/dali-swig/examples/dali-test.cs b/plugins/dali-swig/examples/dali-test.cs index ac4bc85..491bd95 100644 --- a/plugins/dali-swig/examples/dali-test.cs +++ b/plugins/dali-swig/examples/dali-test.cs @@ -39,6 +39,9 @@ namespace MyCSharpExample public void Initialize(object source, AUIApplicationInitEventArgs e) { + + OperatorTests(); + Handle handle = new Handle(); int myPropertyIndex = handle.RegisterProperty("myProperty", new Property.Value(10.0f), Property.AccessMode.READ_WRITE); float myProperty = 0.0f; @@ -162,6 +165,181 @@ namespace MyCSharpExample Console.WriteLine( " Vector4 r = " + vector4.r + ", g = " + vector4.g + ", b = " + vector4.b + ", a = " + vector4.a ); } + + public void OperatorTests() + { + Actor actor = new Actor(); + Actor differentActor = new Actor(); + Actor actorSame = actor; + Actor nullActor = null; + + // test the true operator + if ( actor ) + { + Console.WriteLine ("BaseHandle Operator true (actor) : test passed "); + } + else + { + Console.WriteLine ("BaseHandle Operator true (actor): test failed "); + } + + Actor parent = actor.GetParent (); + + if ( parent ) + { + Console.WriteLine ("Handle with Empty body :failed "); + } + else + { + Console.WriteLine ("Valid with Empty body :passed "); + } + + actor.Add( differentActor ); + // here we test two different C# objects, which on the native side have the same body/ ref-object + if ( actor == differentActor.GetParent() ) + { + Console.WriteLine ("actor == differentActor.GetParent() :passed "); + } + else + { + Console.WriteLine ("actor == differentActor.GetParent() :failed "); + } + + if ( differentActor == differentActor.GetParent() ) + { + Console.WriteLine ("differentActor == differentActor.GetParent() :failed "); + } + else + { + Console.WriteLine ("differentActor == differentActor.GetParent() :passed "); + } + + + if ( nullActor ) + { + Console.WriteLine ("BaseHandle Operator true (nullActor) : test failed "); + } + else + { + Console.WriteLine ("BaseHandle Operator true (nullActor): test passed "); + } + + // ! operator + if ( !actor ) + { + Console.WriteLine ("BaseHandle Operator !(actor) : test failed "); + } + else + { + Console.WriteLine ("BaseHandle Operator !(actor): test passed "); + } + + if ( !nullActor ) + { + Console.WriteLine ("BaseHandle Operator !(nullActor) : test passed "); + } + else + { + Console.WriteLine ("BaseHandle Operator !(nullActor): test failed "); + } + + // Note: operator false only used inside & operator + // test equality operator == + if ( actor == actorSame ) + { + Console.WriteLine ("BaseHandle Operator (actor == actorSame) : test passed"); + } + else + { + Console.WriteLine ("BaseHandle Operator (actor == actorSame) : test failed"); + } + + if ( actor == differentActor ) + { + Console.WriteLine ("BaseHandle Operator (actor == differentActor) : test failed"); + } + else + { + Console.WriteLine ("BaseHandle Operator (actor == differentActor) : test passed"); + } + + if ( actor == nullActor ) + { + Console.WriteLine ("BaseHandle Operator (actor == nullActor) : test failed"); + } + else + { + Console.WriteLine ("BaseHandle Operator (actor == nullActor) : test passed"); + } + + if ( nullActor == nullActor ) + { + Console.WriteLine ("BaseHandle Operator (nullActor == nullActor) : test passed"); + } + else + { + Console.WriteLine ("BaseHandle Operator (nullActor == nullActor) : test failed"); + } + + // test || operator + if ( actor || actorSame ) + { + Console.WriteLine ("BaseHandle Operator (actor || actorSame) : test passed"); + } + else + { + Console.WriteLine ("BaseHandle Operator (actor || actorSame) : test failed"); + } + + if ( actor || nullActor ) + { + Console.WriteLine ("BaseHandle Operator (actor || nullActor) : test passed"); + } + else + { + Console.WriteLine ("BaseHandle Operator (actor || nullActor) : test failed"); + } + + if ( nullActor || nullActor ) + { + Console.WriteLine ("BaseHandle Operator (nullActor || nullActor) : test failed"); + } + else + { + Console.WriteLine ("BaseHandle Operator (nullActor || nullActor) : test passed"); + } + + + // test && operator + if ( actor && actorSame ) + { + Console.WriteLine ("BaseHandle Operator (actor && actorSame) : test passed"); + } + else + { + Console.WriteLine ("BaseHandle Operator (actor && actorSame) : test failed"); + } + + if ( actor && nullActor ) + { + Console.WriteLine ("BaseHandle Operator (actor && nullActor) : test failed"); + } + else + { + Console.WriteLine ("BaseHandle Operator (actor && nullActor) : test passed"); + } + + if ( nullActor && nullActor ) + { + Console.WriteLine ("BaseHandle Operator (nullActor && nullActor) : test failed"); + } + else + { + Console.WriteLine ("BaseHandle Operator (nullActor && nullActor) : test passed"); + } + + } + public void MainLoop() { _application.MainLoop (); diff --git a/plugins/dali-swig/examples/firstscreen/App.cs b/plugins/dali-swig/examples/firstscreen/App.cs index e96d98d..5f5819f 100644 --- a/plugins/dali-swig/examples/firstscreen/App.cs +++ b/plugins/dali-swig/examples/firstscreen/App.cs @@ -24,7 +24,7 @@ namespace FirstScreen private View _topContainer; private View _bottomContainer; - private EdenEffect _edenEffect; + private FocusEffect _focusEffect; private string _imagePath; private ImageView _keyboardFocusIndicator; @@ -116,7 +116,7 @@ namespace FirstScreen HideBottomContainer(); // Also apply Focus animation on Focused item on Poster ScrollContainer - _postersContainer[_currentPostersContainerID].FocusAnimation(_edenEffect, EdenEffectDirection.BottomToTop); + _postersContainer[_currentPostersContainerID].FocusAnimation(_focusEffect, FocusEffectDirection.BottomToTop); } } else if (e.Direction == View.KeyboardFocus.Direction.DOWN) @@ -130,7 +130,7 @@ namespace FirstScreen _menuContainer.SetFocused(true); // Also apply Focus animation on Focused item on Menu ScrollContainer - _menuContainer.FocusAnimation(_edenEffect, EdenEffectDirection.TopToBottom); + _menuContainer.FocusAnimation(_focusEffect, FocusEffectDirection.TopToBottom); } } else if (e.Direction == View.KeyboardFocus.Direction.LEFT) @@ -337,7 +337,7 @@ namespace FirstScreen } // Add a shadow seperator image between last Launcher icon and Menu ScrollContainer - _launcherSeparator = new ImageView(_imagePath + "/eden_launcher_shadow_n.png"); + _launcherSeparator = new ImageView(_imagePath + "/focus_launcher_shadow_n.png"); _launcherSeparator.Name = "launcherSeparator"; _launcherSeparator.WidthResizePolicy = "USE_NATURAL_SIZE"; _launcherSeparator.HeightResizePolicy = "FILL_TO_PARENT"; @@ -357,7 +357,7 @@ namespace FirstScreen _menuContainer.OffsetX = Constants.LauncherWidth; _menuContainer.Width = _stageSize.width - Constants.LauncherWidth; _menuContainer.Height = _stageSize.height * Constants.MenuContainerHeightFactor; - _menuContainer.ShadowBorder = new ImageView(_imagePath + "/eden_launcher_shadow.9.png"); + _menuContainer.ShadowBorder = new ImageView(_imagePath + "/focus_launcher_shadow.9.png"); _menuContainer.ShadowBorder.Name = "_menuContainer.ShadowBorder"; _menuContainer.ShadowBorder.Size = new Vector3(_menuContainer.ItemSize.width + 40.0f, _menuContainer.ItemSize.height + 50.0f, 0.0f); _menuContainer.ShadowBorder.Position = new Vector3(0.0f, 5.0f, 0.0f); @@ -381,7 +381,7 @@ namespace FirstScreen keyboardFocusManager.SetFocusIndicatorActor(_keyboardFocusIndicator); - _edenEffect = new EdenEffect(); + _focusEffect = new FocusEffect(); // Move Fcous to Bottom Container (Menu ScrollContainer) ShowBottomContainer(); diff --git a/plugins/dali-swig/examples/firstscreen/EdenData.cs b/plugins/dali-swig/examples/firstscreen/FocusData.cs similarity index 83% rename from plugins/dali-swig/examples/firstscreen/EdenData.cs rename to plugins/dali-swig/examples/firstscreen/FocusData.cs index 63e9dfd..b1ee188 100644 --- a/plugins/dali-swig/examples/firstscreen/EdenData.cs +++ b/plugins/dali-swig/examples/firstscreen/FocusData.cs @@ -3,9 +3,9 @@ using System; namespace FirstScreen { - public class EdenData + public class FocusData { - private string _name; // Name used for EdenData object (mainly to differentiate key frame animation ) + private string _name; // Name used for FocusData object (mainly to differentiate key frame animation ) private string _imageName; // Image File Name (to be loaded from disk) used for ImageView used in key frame animation private Vector3 _parentOrigin; // ParentOrigin applied to ImageView private Vector3 _initSize; // InitSize used for key frame animation @@ -15,8 +15,8 @@ namespace FirstScreen private Direction _direction; // Direction used for key frame animation private ImageView _imageFocus; // ImageView used in key frame animation - // Initialize EdenData used for key frame animation - public EdenData(string name, string imageName, Direction direction, Vector3 parentOrigin, Vector3 initSize, + // Initialize FocusData used for key frame animation + public FocusData(string name, string imageName, Direction direction, Vector3 parentOrigin, Vector3 initSize, Vector3 targetSize, float keyFrameStart, float keyFrameEnd) { _name = name; @@ -28,8 +28,8 @@ namespace FirstScreen _keyFrameEnd = keyFrameEnd; _direction = direction; - _imageFocus = new ImageView("./images/edeneffect/" + _imageName); // Desktop -// _imageFocus = new ImageView("/home/owner/apps_rw/org.tizen.firstscreen/res/images/edeneffect/" + _imageName); // Target + _imageFocus = new ImageView("./images/focuseffect/" + _imageName); // Desktop +// _imageFocus = new ImageView("/home/owner/apps_rw/org.tizen.firstscreen/res/images/focuseffect/" + _imageName); // Target _imageFocus.ParentOrigin = _parentOrigin; _imageFocus.AnchorPoint = NDalic.AnchorPointCenter; @@ -42,7 +42,7 @@ namespace FirstScreen Vertical }; - public Direction EdenDirection + public Direction FocusDirection { get {return _direction;} set {_direction = value;} diff --git a/plugins/dali-swig/examples/firstscreen/EdenEffect.cs b/plugins/dali-swig/examples/firstscreen/FocusEffect.cs similarity index 50% rename from plugins/dali-swig/examples/firstscreen/EdenEffect.cs rename to plugins/dali-swig/examples/firstscreen/FocusEffect.cs index 6a84a09..d02e483 100644 --- a/plugins/dali-swig/examples/firstscreen/EdenEffect.cs +++ b/plugins/dali-swig/examples/firstscreen/FocusEffect.cs @@ -5,51 +5,51 @@ using System.Collections.Specialized; namespace FirstScreen { - public class EdenEffect : IEdenEffect + public class FocusEffect : IFocusEffect { private float _frameThickness; - private EdenData[] _edenFocusData; // Each EdenData is used for one key frame animation (total 6 key frame animations needed for EddenEffect) + private FocusData[] _focusData; // Each FocusData is used for one key frame animation (total 6 key frame animations needed for EddenEffect) private Animation _animation; // Animation used to apply all six key frame animations - public EdenEffect() + public FocusEffect() { _frameThickness = 10.0f; float _bottomFrameTime = 0.6f; // complete the halo/bottom animation 60% of the way through float _sideFrameTime = 0.8f; // Start the side frame animation after the bottom animation and complete at 80% of the way through float _topFrameTime = 1.0f; // start the top frame animation after the side frame animation and complete at 100% way through - // Six key frame animations (EdenData objects) needed for EddenEffect + // Six key frame animations (FocusData objects) needed for EddenEffect // Two key frame animations for top horizontal effect // Two key frame animations for bottom horizontal effect // Two key frame animations for vertical horizontal effect - _edenFocusData = new EdenData[6]; + _focusData = new FocusData[6]; - EdenData edenData = new EdenData("halo", "halo.png", EdenData.Direction.Horizontal, NDalic.ParentOriginTopCenter, + FocusData focusData = new FocusData("halo", "halo.png", FocusData.Direction.Horizontal, NDalic.ParentOriginTopCenter, new Vector3(50,20,0), new Vector3(0.0f, 100.0f , 0.0f), 0.0f, _bottomFrameTime); - _edenFocusData[0] = edenData; + _focusData[0] = focusData; - edenData = new EdenData("bottom", "horizontalFrame.png", EdenData.Direction.Horizontal, NDalic.ParentOriginTopCenter, + focusData = new FocusData("bottom", "horizontalFrame.png", FocusData.Direction.Horizontal, NDalic.ParentOriginTopCenter, new Vector3(0.0f, 0.0f, 0.0f), new Vector3(0.0f, _frameThickness, 0.0f), 0.0f, _bottomFrameTime); - _edenFocusData[1] = edenData; + _focusData[1] = focusData; - edenData = new EdenData("left", "verticalFrame.png", EdenData.Direction.Vertical, NDalic.ParentOriginBottomLeft, + focusData = new FocusData("left", "verticalFrame.png", FocusData.Direction.Vertical, NDalic.ParentOriginBottomLeft, new Vector3(0.0f, 0.0f, 0.0f), new Vector3(_frameThickness, 0.0f, 0.0f), _bottomFrameTime, _sideFrameTime); - _edenFocusData[2] = edenData; + _focusData[2] = focusData; - edenData = new EdenData("right", "verticalFrame.png", EdenData.Direction.Vertical, NDalic.ParentOriginBottomRight, + focusData = new FocusData("right", "verticalFrame.png", FocusData.Direction.Vertical, NDalic.ParentOriginBottomRight, new Vector3(0.0f, 0.0f, 0.0f), new Vector3(_frameThickness, 0.0f, 0.0f), _bottomFrameTime, _sideFrameTime); - _edenFocusData[3] = edenData; + _focusData[3] = focusData; - edenData = new EdenData("top-left", "horizontalFrame.png", EdenData.Direction.Horizontal, NDalic.ParentOriginBottomLeft, + focusData = new FocusData("top-left", "horizontalFrame.png", FocusData.Direction.Horizontal, NDalic.ParentOriginBottomLeft, new Vector3(0.0f, 0.0f, 0.0f), new Vector3(0.0f ,_frameThickness, 0.0f), _sideFrameTime, _topFrameTime); - _edenFocusData[4] = edenData; + _focusData[4] = focusData; - edenData = new EdenData("top-right", "horizontalFrame.png", EdenData.Direction.Horizontal, NDalic.ParentOriginBottomRight, + focusData = new FocusData("top-right", "horizontalFrame.png", FocusData.Direction.Horizontal, NDalic.ParentOriginBottomRight, new Vector3(0.0f, 0.0f, 0.0f), new Vector3(0.0f, _frameThickness, 0.0f), _sideFrameTime, _topFrameTime); - _edenFocusData[5] = edenData; + _focusData[5] = focusData; } - public void FocusAnimation(View parentItem, Vector3 itemSize, float duration, EdenEffectDirection direction) + public void FocusAnimation(View parentItem, Vector3 itemSize, float duration, FocusEffectDirection direction) { var itemWidth = itemSize.x + _frameThickness / 2; var itemHeight = itemSize.y + _frameThickness / 3; @@ -61,42 +61,42 @@ namespace FirstScreen } _animation = new Animation(duration); - if (direction == EdenEffectDirection.BottomToTop) + if (direction == FocusEffectDirection.BottomToTop) { - _edenFocusData[0].ParentOrigin = NDalic.ParentOriginBottomCenter; - _edenFocusData[1].ParentOrigin = NDalic.ParentOriginBottomCenter; - _edenFocusData[2].ParentOrigin = NDalic.ParentOriginBottomLeft; - _edenFocusData[3].ParentOrigin = NDalic.ParentOriginBottomRight; - _edenFocusData[4].ParentOrigin = NDalic.ParentOriginTopLeft; - _edenFocusData[5].ParentOrigin = NDalic.ParentOriginTopRight; + _focusData[0].ParentOrigin = NDalic.ParentOriginBottomCenter; + _focusData[1].ParentOrigin = NDalic.ParentOriginBottomCenter; + _focusData[2].ParentOrigin = NDalic.ParentOriginBottomLeft; + _focusData[3].ParentOrigin = NDalic.ParentOriginBottomRight; + _focusData[4].ParentOrigin = NDalic.ParentOriginTopLeft; + _focusData[5].ParentOrigin = NDalic.ParentOriginTopRight; } else { - _edenFocusData[0].ParentOrigin = NDalic.ParentOriginTopCenter; - _edenFocusData[1].ParentOrigin = NDalic.ParentOriginTopCenter; - _edenFocusData[2].ParentOrigin = NDalic.ParentOriginBottomLeft; - _edenFocusData[3].ParentOrigin = NDalic.ParentOriginBottomRight; - _edenFocusData[4].ParentOrigin = NDalic.ParentOriginBottomLeft; - _edenFocusData[5].ParentOrigin = NDalic.ParentOriginBottomRight; + _focusData[0].ParentOrigin = NDalic.ParentOriginTopCenter; + _focusData[1].ParentOrigin = NDalic.ParentOriginTopCenter; + _focusData[2].ParentOrigin = NDalic.ParentOriginBottomLeft; + _focusData[3].ParentOrigin = NDalic.ParentOriginBottomRight; + _focusData[4].ParentOrigin = NDalic.ParentOriginBottomLeft; + _focusData[5].ParentOrigin = NDalic.ParentOriginBottomRight; } - foreach (EdenData edenData in _edenFocusData) + foreach (FocusData focusData in _focusData) { - var currentParent = edenData.ImageItem.GetParent(); + var currentParent = focusData.ImageItem.GetParent(); // first parent the controls if (parentItem != currentParent) { - parentItem.Add(edenData.ImageItem); + parentItem.Add(focusData.ImageItem); } - edenData.ImageItem.Size = new Vector3(100.0f,100.0f, 0.0f); - parentItem.Add(edenData.ImageItem); + focusData.ImageItem.Size = new Vector3(100.0f,100.0f, 0.0f); + parentItem.Add(focusData.ImageItem); - Vector3 targetSize = edenData.TargetSize; - Vector3 initSize = edenData.InitSize; + Vector3 targetSize = focusData.TargetSize; + Vector3 initSize = focusData.InitSize; - if (edenData.EdenDirection == EdenData.Direction.Horizontal) + if (focusData.FocusDirection == FocusData.Direction.Horizontal) { // adjust the width to match the parent targetSize.x = itemWidth; @@ -108,7 +108,7 @@ namespace FirstScreen } // half the size for the top frame as we come out from both left / right sides - if (edenData.Name == "top-right" || edenData.Name == "top-left") + if (focusData.Name == "top-right" || focusData.Name == "top-left") { targetSize.x = itemWidth - _frameThickness; } @@ -116,67 +116,67 @@ namespace FirstScreen KeyFrames keyFrames = new KeyFrames(); keyFrames.Add(0.0f, new Property.Value(initSize)); - keyFrames.Add(edenData.KeyFrameStart, new Property.Value(initSize)); - keyFrames.Add(edenData.KeyFrameEnd, new Property.Value(targetSize)); + keyFrames.Add(focusData.KeyFrameStart, new Property.Value(initSize)); + keyFrames.Add(focusData.KeyFrameEnd, new Property.Value(targetSize)); // for halo add an extra keyframe to shrink it ( in 20% of time after it has finished) - if (edenData.Name =="halo") + if (focusData.Name =="halo") { - keyFrames.Add(edenData.KeyFrameEnd + 0.2f, new Property.Value(initSize)); + keyFrames.Add(focusData.KeyFrameEnd + 0.2f, new Property.Value(initSize)); } - _animation.AnimateBetween(new Property(edenData.ImageItem, Actor.Property.SIZE), keyFrames, + _animation.AnimateBetween(new Property(focusData.ImageItem, Actor.Property.SIZE), keyFrames, new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE)); // Simulate the vertical frame growing from the top. // Vertical items are anchored to the bottom of the parent... so when they grow // we need to move them to the middle of the parent ( otherwise they stick out the bottom) - if (edenData.EdenDirection == EdenData.Direction.Vertical) + if (focusData.FocusDirection == FocusData.Direction.Vertical) { //animate position as well so it looks like animation is coming from bottom KeyFrames keyFramesV = new KeyFrames(); - if (direction == EdenEffectDirection.BottomToTop) + if (direction == FocusEffectDirection.BottomToTop) { keyFramesV.Add(0.0f, new Property.Value(0.0f)); - keyFramesV.Add(edenData.KeyFrameStart, new Property.Value(0.0f)); + keyFramesV.Add(focusData.KeyFrameStart, new Property.Value(0.0f)); } else { keyFramesV.Add(0.0f, new Property.Value(-itemHeight)); - keyFramesV.Add(edenData.KeyFrameStart, new Property.Value(-itemHeight)); + keyFramesV.Add(focusData.KeyFrameStart, new Property.Value(-itemHeight)); } - keyFramesV.Add(edenData.KeyFrameEnd, new Property.Value(-itemHeight / 2)); // animate to halfway up the control + keyFramesV.Add(focusData.KeyFrameEnd, new Property.Value(-itemHeight / 2)); // animate to halfway up the control - _animation.AnimateBetween(new Property(edenData.ImageItem, Actor.Property.POSITION_Y), keyFramesV, + _animation.AnimateBetween(new Property(focusData.ImageItem, Actor.Property.POSITION_Y), keyFramesV, new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE)); } // Simulate the top frame growing from the sides. - if (edenData.Name == "top-left") + if (focusData.Name == "top-left") { KeyFrames keyFramesTL = new KeyFrames(); keyFramesTL.Add(0.0f, new Property.Value(0.0f)); - keyFramesTL.Add(edenData.KeyFrameStart, new Property.Value(0.0f)); - keyFramesTL.Add(edenData.KeyFrameEnd, new Property.Value(itemWidth / 2)); // animate to halfway up the control + keyFramesTL.Add(focusData.KeyFrameStart, new Property.Value(0.0f)); + keyFramesTL.Add(focusData.KeyFrameEnd, new Property.Value(itemWidth / 2)); // animate to halfway up the control // grow these from the left or right - _animation.AnimateBetween(new Property(edenData.ImageItem, Actor.Property.POSITION_X), keyFramesTL, + _animation.AnimateBetween(new Property(focusData.ImageItem, Actor.Property.POSITION_X), keyFramesTL, new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE)); } - if (edenData.Name == "top-right") + if (focusData.Name == "top-right") { KeyFrames keyFramesTR = new KeyFrames(); keyFramesTR.Add(0.0f, new Property.Value(0.0f)); - keyFramesTR.Add(edenData.KeyFrameStart, new Property.Value(0.0f)); - keyFramesTR.Add(edenData.KeyFrameEnd, new Property.Value(-itemWidth / 2)); // animate to halfway up the control + keyFramesTR.Add(focusData.KeyFrameStart, new Property.Value(0.0f)); + keyFramesTR.Add(focusData.KeyFrameEnd, new Property.Value(-itemWidth / 2)); // animate to halfway up the control // grow these from the left or right - _animation.AnimateBetween(new Property(edenData.ImageItem, Actor.Property.POSITION_X), keyFramesTR, + _animation.AnimateBetween(new Property(focusData.ImageItem, Actor.Property.POSITION_X), keyFramesTR, new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE)); } @@ -188,13 +188,13 @@ namespace FirstScreen private void OnAnimationFinished(object source, Animation.FinishedEventArgs e) { - foreach (EdenData edenData in _edenFocusData) + foreach (FocusData focusData in _focusData) { - var currentParent = edenData.ImageItem.GetParent(); + var currentParent = focusData.ImageItem.GetParent(); if (currentParent) { - currentParent.Remove(edenData.ImageItem); + currentParent.Remove(focusData.ImageItem); } } } diff --git a/plugins/dali-swig/examples/firstscreen/IEdenEffect.cs b/plugins/dali-swig/examples/firstscreen/IFocusEffect.cs similarity index 61% rename from plugins/dali-swig/examples/firstscreen/IEdenEffect.cs rename to plugins/dali-swig/examples/firstscreen/IFocusEffect.cs index 88ca3b8..222c2ed 100644 --- a/plugins/dali-swig/examples/firstscreen/IEdenEffect.cs +++ b/plugins/dali-swig/examples/firstscreen/IFocusEffect.cs @@ -3,15 +3,15 @@ using System; namespace FirstScreen { - public enum EdenEffectDirection + public enum FocusEffectDirection { TopToBottom, BottomToTop }; - public interface IEdenEffect + public interface IFocusEffect { - void FocusAnimation(View parentItem, Vector3 itemSize, float duration, EdenEffectDirection direction); + void FocusAnimation(View parentItem, Vector3 itemSize, float duration, FocusEffectDirection direction); } } diff --git a/plugins/dali-swig/examples/firstscreen/ScrollContainer.cs b/plugins/dali-swig/examples/firstscreen/ScrollContainer.cs index c22c712..633af05 100644 --- a/plugins/dali-swig/examples/firstscreen/ScrollContainer.cs +++ b/plugins/dali-swig/examples/firstscreen/ScrollContainer.cs @@ -428,9 +428,9 @@ namespace FirstScreen } // Perform EddenEffect animation on Focused Item specified - public void FocusAnimation(EdenEffect edenEffect, EdenEffectDirection direction) + public void FocusAnimation(FocusEffect focusEffect, FocusEffectDirection direction) { - edenEffect.FocusAnimation(_itemList[_focusedItem], _itemSize, 1.0f, direction); + focusEffect.FocusAnimation(_itemList[_focusedItem], _itemSize, 1.0f, direction); } public void SetFocused(bool focused) diff --git a/plugins/dali-swig/examples/firstscreen/images/eden_launcher_shadow.9.png b/plugins/dali-swig/examples/firstscreen/images/focus_launcher_shadow.9.png similarity index 100% rename from plugins/dali-swig/examples/firstscreen/images/eden_launcher_shadow.9.png rename to plugins/dali-swig/examples/firstscreen/images/focus_launcher_shadow.9.png diff --git a/plugins/dali-swig/examples/firstscreen/images/eden_launcher_shadow_n.png b/plugins/dali-swig/examples/firstscreen/images/focus_launcher_shadow_n.png similarity index 100% rename from plugins/dali-swig/examples/firstscreen/images/eden_launcher_shadow_n.png rename to plugins/dali-swig/examples/firstscreen/images/focus_launcher_shadow_n.png diff --git a/plugins/dali-swig/examples/firstscreen/images/edeneffect/halo.png b/plugins/dali-swig/examples/firstscreen/images/focuseffect/halo.png similarity index 100% rename from plugins/dali-swig/examples/firstscreen/images/edeneffect/halo.png rename to plugins/dali-swig/examples/firstscreen/images/focuseffect/halo.png diff --git a/plugins/dali-swig/examples/firstscreen/images/edeneffect/horizontalFrame.png b/plugins/dali-swig/examples/firstscreen/images/focuseffect/horizontalFrame.png similarity index 100% rename from plugins/dali-swig/examples/firstscreen/images/edeneffect/horizontalFrame.png rename to plugins/dali-swig/examples/firstscreen/images/focuseffect/horizontalFrame.png diff --git a/plugins/dali-swig/examples/firstscreen/images/edeneffect/verticalFrame.png b/plugins/dali-swig/examples/firstscreen/images/focuseffect/verticalFrame.png similarity index 100% rename from plugins/dali-swig/examples/firstscreen/images/edeneffect/verticalFrame.png rename to plugins/dali-swig/examples/firstscreen/images/focuseffect/verticalFrame.png diff --git a/plugins/dali-swig/examples/hello-world.cs b/plugins/dali-swig/examples/hello-world.cs index 28fd1dd..1d35bc1 100755 --- a/plugins/dali-swig/examples/hello-world.cs +++ b/plugins/dali-swig/examples/hello-world.cs @@ -85,8 +85,9 @@ namespace MyCSharpExample _animation = new Animation(1.0f); // 1 second of duration - _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Quaternion( new Radian( new Degree( 180.0f ) ), Vector3.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.LINEAR), new TimePeriod(0.0f, 0.5f)); - _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Quaternion( new Radian( new Degree( 0.0f ) ), Vector3.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.LINEAR), new TimePeriod(0.5f, 0.5f)); + _animation.AnimateTo(_text, Animation.ORIENTATION, new Quaternion( new Radian( new Degree( 180.0f ) ), Vector3.XAXIS ), new AlphaFunction(AlphaFunction.BuiltinFunction.LINEAR), new TimePeriod(0.0f, 0.5f)); + + _animation.AnimateTo(_text, Animation.ORIENTATION, new Quaternion( new Radian( new Degree( 0.0f ) ), Vector3.XAXIS ), new AlphaFunction(AlphaFunction.BuiltinFunction.LINEAR), new TimePeriod(0.5f, 0.5f)); // Connect the signal callback for animaiton finished signal _animation.Finished += AnimationFinished;