DALI_TEST_EQUALS( indices.size(), actor.GetPropertyCount(), TEST_LOCATION );
END_TEST;
}
+
+int UtcDaliHandleRegisterPropertyTypes(void)
+{
+ TestApplication application;
+
+ struct PropertyTypeAnimatable
+ {
+ const char * name;
+ Property::Value value;
+ bool animatable;
+ };
+
+ Property::Array array;
+ Property::Map map;
+
+ PropertyTypeAnimatable properties[] =
+ {
+ { "Property::BOOLEAN", true, true },
+ { "Property::FLOAT", 1.0f, true },
+ { "Property::INTEGER", 1, true },
+ { "Property::UNSIGNED_INTEGER", 1u, false },
+ { "Property::VECTOR2", Vector2::ONE, true },
+ { "Property::VECTOR3", Vector3::ONE, true },
+ { "Property::VECTOR4", Vector4::ONE, true },
+ { "Property::MATRIX3", Matrix3::IDENTITY, true },
+ { "Property::MATRIX", Matrix::IDENTITY, true },
+ { "Property::RECTANGLE", Rect<int>(), false },
+ { "Property::ROTATION", AngleAxis(), true },
+ { "Property::STRING", std::string("Me"), false },
+ { "Property::ARRAY", array, false },
+ { "Property::MAP", map, false },
+ };
+ unsigned int numOfProperties( sizeof( properties ) / sizeof( properties[0] ) );
+
+ for ( unsigned int i = 0; i < numOfProperties; ++i )
+ {
+ tet_printf( "Testing: %s\n", properties[i].name );
+
+ bool exception = false;
+ try
+ {
+ Actor actor = Actor::New();
+ actor.RegisterProperty( "man-from-delmonte", properties[i].value );
+ }
+ catch (Dali::DaliException& e)
+ {
+ exception = true;
+ }
+
+ DALI_TEST_CHECK( properties[i].animatable != exception );
+ }
+ END_TEST;
+}
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() );
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;
+ }
}
}
}