(Properties) Specify which properties can be registered as animatable
[platform/core/uifw/dali-core.git] / dali / internal / event / common / proxy-object.cpp
index 0085d20..126d020 100644 (file)
@@ -612,6 +612,17 @@ Property::Index ProxyObject::RegisterProperty( std::string name, const Property:
       break;
     }
 
+    case Property::UNSIGNED_INTEGER:
+    case Property::RECTANGLE:
+    case Property::STRING:
+    case Property::ARRAY:
+    case Property::MAP:
+    {
+      DALI_LOG_WARNING( "Property Type %d\n", propertyValue.GetType() );
+      DALI_ASSERT_ALWAYS( false && "PropertyType is not animatable" );
+      break;
+    }
+
     default:
     {
       DALI_LOG_WARNING( "Property Type %d\n", propertyValue.GetType() );
@@ -804,102 +815,105 @@ ActiveConstraintBase* ProxyObject::DoApplyConstraint( Constraint& constraint, Da
 
 void ProxyObject::SetCustomProperty( Property::Index index, const CustomProperty& entry, const Property::Value& value )
 {
-  switch ( entry.type )
+  if( entry.IsAnimatable() )
   {
-    case Property::BOOLEAN:
+    switch ( entry.type )
     {
-      AnimatableProperty<bool>* property = dynamic_cast< AnimatableProperty<bool>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      case Property::BOOLEAN:
+      {
+        AnimatableProperty<bool>* property = dynamic_cast< AnimatableProperty<bool>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( NULL != property );
 
-      // property is being used in a separate thread; queue a message to set the property
-      BakeMessage<bool>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<bool>() );
-      break;
-    }
+        // property is being used in a separate thread; queue a message to set the property
+        BakeMessage<bool>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<bool>() );
+        break;
+      }
 
-    case Property::FLOAT:
-    {
-      AnimatableProperty<float>* property = dynamic_cast< AnimatableProperty<float>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      case Property::FLOAT:
+      {
+        AnimatableProperty<float>* property = dynamic_cast< AnimatableProperty<float>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( NULL != property );
 
-      // property is being used in a separate thread; queue a message to set the property
-      BakeMessage<float>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<float>() );
-      break;
-    }
+        // property is being used in a separate thread; queue a message to set the property
+        BakeMessage<float>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<float>() );
+        break;
+      }
 
-    case Property::INTEGER:
-    {
-      AnimatableProperty<int>* property = dynamic_cast< AnimatableProperty<int>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      case Property::INTEGER:
+      {
+        AnimatableProperty<int>* property = dynamic_cast< AnimatableProperty<int>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( NULL != property );
 
-      // property is being used in a separate thread; queue a message to set the property
-      BakeMessage<int>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<int>() );
-      break;
-    }
+        // property is being used in a separate thread; queue a message to set the property
+        BakeMessage<int>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<int>() );
+        break;
+      }
 
-    case Property::VECTOR2:
-    {
-      AnimatableProperty<Vector2>* property = dynamic_cast< AnimatableProperty<Vector2>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      case Property::VECTOR2:
+      {
+        AnimatableProperty<Vector2>* property = dynamic_cast< AnimatableProperty<Vector2>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( NULL != property );
 
-      // property is being used in a separate thread; queue a message to set the property
-      BakeMessage<Vector2>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<Vector2>() );
-      break;
-    }
+        // property is being used in a separate thread; queue a message to set the property
+        BakeMessage<Vector2>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<Vector2>() );
+        break;
+      }
 
-    case Property::VECTOR3:
-    {
-      AnimatableProperty<Vector3>* property = dynamic_cast< AnimatableProperty<Vector3>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      case Property::VECTOR3:
+      {
+        AnimatableProperty<Vector3>* property = dynamic_cast< AnimatableProperty<Vector3>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( NULL != property );
 
-      // property is being used in a separate thread; queue a message to set the property
-      BakeMessage<Vector3>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<Vector3>() );
-      break;
-    }
+        // property is being used in a separate thread; queue a message to set the property
+        BakeMessage<Vector3>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<Vector3>() );
+        break;
+      }
 
-    case Property::VECTOR4:
-    {
-      AnimatableProperty<Vector4>* property = dynamic_cast< AnimatableProperty<Vector4>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      case Property::VECTOR4:
+      {
+        AnimatableProperty<Vector4>* property = dynamic_cast< AnimatableProperty<Vector4>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( NULL != property );
 
-      // property is being used in a separate thread; queue a message to set the property
-      BakeMessage<Vector4>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<Vector4>() );
-      break;
-    }
+        // property is being used in a separate thread; queue a message to set the property
+        BakeMessage<Vector4>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<Vector4>() );
+        break;
+      }
 
-    case Property::ROTATION:
-    {
-      AnimatableProperty<Quaternion>* property = dynamic_cast< AnimatableProperty<Quaternion>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      case Property::ROTATION:
+      {
+        AnimatableProperty<Quaternion>* property = dynamic_cast< AnimatableProperty<Quaternion>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( NULL != property );
 
-      // property is being used in a separate thread; queue a message to set the property
-      BakeMessage<Quaternion>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<Quaternion>() );
-      break;
-    }
+        // property is being used in a separate thread; queue a message to set the property
+        BakeMessage<Quaternion>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<Quaternion>() );
+        break;
+      }
 
-    case Property::MATRIX:
-    {
-      AnimatableProperty<Matrix>* property = dynamic_cast< AnimatableProperty<Matrix>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      case Property::MATRIX:
+      {
+        AnimatableProperty<Matrix>* property = dynamic_cast< AnimatableProperty<Matrix>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( NULL != property );
 
-      // property is being used in a separate thread; queue a message to set the property
-      BakeMessage<Matrix>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<Matrix>() );
-      break;
-    }
+        // property is being used in a separate thread; queue a message to set the property
+        BakeMessage<Matrix>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<Matrix>() );
+        break;
+      }
 
-    case Property::MATRIX3:
-    {
-      AnimatableProperty<Matrix3>* property = dynamic_cast< AnimatableProperty<Matrix3>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      case Property::MATRIX3:
+      {
+        AnimatableProperty<Matrix3>* property = dynamic_cast< AnimatableProperty<Matrix3>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( NULL != property );
 
-      // property is being used in a separate thread; queue a message to set the property
-      BakeMessage<Matrix3>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<Matrix3>() );
-      break;
-    }
+        // property is being used in a separate thread; queue a message to set the property
+        BakeMessage<Matrix3>( Stage::GetCurrent()->GetUpdateInterface(), *property, value.Get<Matrix3>() );
+        break;
+      }
 
-    default:
-    {
-      DALI_ASSERT_ALWAYS(false && "Property type enumeration out of bounds"); // should not come here
-      break;
+      default:
+      {
+        DALI_ASSERT_ALWAYS(false && "Property type enumeration out of bounds"); // should not come here
+        break;
+      }
     }
   }
 }