Merge branch 'devel/master (1.2.31)' into tizen 78/119678/1 accepted/tizen/common/20170320.173913 accepted/tizen/ivi/20170320.223046 accepted/tizen/mobile/20170320.222701 accepted/tizen/tv/20170320.222917 accepted/tizen/unified/20170320.223126 accepted/tizen/wearable/20170320.223003 submit/tizen/20170320.091401
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 20 Mar 2017 01:51:52 +0000 (10:51 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 20 Mar 2017 01:52:46 +0000 (10:52 +0900)
Change-Id: I88bc17e9fcf8bcc520ef0d3196323ba00373746f

dali/internal/event/animation/animator-connector-base.h
dali/internal/event/animation/animator-connector.h
dali/public-api/dali-core-version.cpp
packaging/dali.spec

index 9c49d14..5a54bc8 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // INTERNAL INCLUDES
+#include <dali/internal/event/common/object-impl.h>
 #include <dali/internal/common/owner-pointer.h>
 #include <dali/devel-api/common/owner-container.h>
 #include <dali/public-api/animation/alpha-function.h>
@@ -43,19 +44,31 @@ typedef AnimatorConnectorContainer::ConstIterator AnimatorConnectorConstIter;
 
 /**
  * An abstract base class for animator connectors.
+ *
+ * The scene-graph objects are created by a Object e.g. Actor is a proxy for SceneGraph::Node.
+ * AnimatorConnectorBase observes the proxy object, in order to detect when a scene-graph object is created.
  */
-class AnimatorConnectorBase
+class AnimatorConnectorBase: public Object::Observer
 {
 public:
 
   /**
    * Constructor.
    */
-  AnimatorConnectorBase(AlphaFunction alpha, const TimePeriod& period)
-  : mParent(NULL),
+  AnimatorConnectorBase(
+      Object& object,
+      Property::Index propertyIndex,
+      int componentIndex,
+      AlphaFunction alpha,
+      const TimePeriod& period)
+  : mParent( NULL ),
+    mObject( &object ),
     mAlphaFunction(alpha),
-    mTimePeriod(period)
+    mTimePeriod(period),
+    mPropertyIndex( propertyIndex ),
+    mComponentIndex( componentIndex )
   {
+    object.AddObserver( *this );
   }
 
   /**
@@ -81,12 +94,56 @@ public:
     return mParent;
   }
 
+  Object* GetObject() const
+  {
+    return mObject;
+  }
+
+  Property::Index GetPropertyIndex() const
+  {
+    return mPropertyIndex;
+  }
+
+  int GetComponentIndex() const
+  {
+    return mComponentIndex;
+  }
+
+private:
+
+  /**
+   * From Object::Observer
+   */
+  virtual void SceneObjectAdded( Object& object )
+  {
+  }
+
+  /**
+   * From Object::Observer
+   */
+  virtual void SceneObjectRemoved( Object& object )
+  {
+  }
+
+  /**
+   * From Object::Observer
+   */
+  virtual void ObjectDestroyed( Object& object )
+  {
+    mObject = NULL;
+  }
+
 protected:
 
   Animation* mParent; ///< The parent owns the connector.
+  Object* mObject; ///< Not owned by the animator connector. Valid until ObjectDestroyed() is called.
 
   AlphaFunction mAlphaFunction;
   TimePeriod mTimePeriod;
+
+  Property::Index mPropertyIndex;
+  int mComponentIndex;
+
 };
 
 } // namespace Internal
index e06225d..d672329 100644 (file)
  */
 
 // INTERNAL INCLUDES
-#include <dali/internal/event/common/object-impl.h>
 #include <dali/internal/event/animation/animator-connector-base.h>
 #include <dali/internal/event/animation/animation-impl.h>
 #include <dali/internal/update/common/property-owner.h>
 #include <dali/internal/update/animation/property-accessor.h>
 #include <dali/internal/update/animation/property-component-accessor.h>
-#include <dali/internal/update/animation/scene-graph-animator.h>
 #include <dali/internal/update/manager/update-manager.h>
 
 namespace Dali
@@ -37,14 +35,11 @@ namespace Internal
 /**
  * AnimatorConnector is used to connect SceneGraph::Animators for newly created scene-graph objects.
  *
- * The scene-graph objects are created by a Object e.g. Actor is a proxy for SceneGraph::Node.
- * AnimatorConnector observes the proxy object, in order to detect when a scene-graph object is created.
- *
  * SceneGraph::Animators weakly reference scene objects, and are automatically deleted when orphaned.
  * Therefore the AnimatorConnector is NOT responsible for disconnecting animators.
  */
 template < typename PropertyType >
-class AnimatorConnector : public AnimatorConnectorBase, public Object::Observer
+class AnimatorConnector : public AnimatorConnectorBase
 {
 public:
 
@@ -121,14 +116,10 @@ private:
                      Internal::AnimatorFunctionBase* animatorFunction,
                      AlphaFunction alpha,
                      const TimePeriod& period )
-  : AnimatorConnectorBase( alpha, period ),
-    mObject( &object ),
+  : AnimatorConnectorBase( object, propertyIndex, componentIndex, alpha, period ),
     mAnimator(0),
-    mPropertyIndex( propertyIndex ),
-    mComponentIndex( componentIndex ),
     mAnimatorFunction( animatorFunction )
   {
-    object.AddObserver( *this );
   }
 
   // Undefined
@@ -143,27 +134,12 @@ private:
   virtual void SceneObjectAdded( Object& object )
   {
     //If the animator has not been created yet, create it now.
-    if( !mAnimator )
+    if( !mAnimator && mObject )
     {
       CreateAnimator();
     }
   }
 
-  /**
-   * From Object::Observer
-   */
-  virtual void SceneObjectRemoved( Object& object )
-  {
-  }
-
-  /**
-   * From Object::Observer
-   */
-  virtual void ObjectDestroyed( Object& object )
-  {
-    mObject = NULL;
-  }
-
    /**
    * Helper function to create a Scenegraph::Animator and add it to its correspondent SceneGraph::Animation.
    * @note This function will only be called the first time the object is added to the scene or at creation time if
@@ -390,12 +366,8 @@ private:
 
 protected:
 
-  Object* mObject; ///< Not owned by the animator connector. Valid until ObjectDestroyed() is called.
   SceneGraph::AnimatorBase* mAnimator;
 
-  Property::Index mPropertyIndex;
-  int mComponentIndex;
-
   Internal::AnimatorFunctionBase* mAnimatorFunction;  ///< Owned by the animator connector until an Scenegraph::Animator is created
 };
 
index 57c23d3..33988a2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ namespace Dali
 
 const unsigned int CORE_MAJOR_VERSION = 1;
 const unsigned int CORE_MINOR_VERSION = 2;
-const unsigned int CORE_MICRO_VERSION = 30;
+const unsigned int CORE_MICRO_VERSION = 31;
 const char * const CORE_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifndef EMSCRIPTEN
index 64e3215..1a74661 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali
 Summary:    The OpenGLES Canvas Core Library
-Version:    1.2.30
+Version:    1.2.31
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT