Change-Id: I075dca41b6bd975cd0a682ef62f4296d094334ab
// TODO: This method needs to be removed
void Actor::SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value )
{
// TODO: This method needs to be removed
void Actor::SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value )
{
- OnPropertySet( index, value );
-
switch( entry.type )
{
case Property::BOOLEAN:
switch( entry.type )
{
case Property::BOOLEAN:
{
DALI_ASSERT_ALWAYS(index > Property::INVALID_INDEX && "Property index is out of bounds" );
{
DALI_ASSERT_ALWAYS(index > Property::INVALID_INDEX && "Property index is out of bounds" );
+ bool propertySet( true );
+
if ( index < DEFAULT_PROPERTY_MAX_COUNT )
{
SetDefaultProperty( index, propertyValue );
if ( index < DEFAULT_PROPERTY_MAX_COUNT )
{
SetDefaultProperty( index, propertyValue );
else if ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
{
const TypeInfo* typeInfo( GetTypeInfo() );
else if ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
{
const TypeInfo* typeInfo( GetTypeInfo() );
- if ( typeInfo )
- {
- typeInfo->SetProperty( this, index, propertyValue );
- }
- else
- {
- DALI_LOG_ERROR("Cannot find property index\n");
- }
+ typeInfo->SetProperty( this, index, propertyValue );
}
else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
{
}
else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
{
if(!animatableProperty)
{
const TypeInfo* typeInfo( GetTypeInfo() );
if(!animatableProperty)
{
const TypeInfo* typeInfo( GetTypeInfo() );
- if (!typeInfo)
- {
- DALI_LOG_ERROR("Cannot find property index\n");
- }
- else if ( Property::INVALID_INDEX == RegisterSceneGraphProperty( typeInfo->GetPropertyName( index ), index, propertyValue ) )
+ if ( Property::INVALID_INDEX == RegisterSceneGraphProperty( typeInfo->GetPropertyName( index ), index, propertyValue ) )
{
DALI_LOG_ERROR("Cannot register property\n");
{
DALI_LOG_ERROR("Cannot register property\n");
else if( custom->IsWritable() )
{
custom->value = propertyValue;
else if( custom->IsWritable() )
{
custom->value = propertyValue;
- OnPropertySet(index, propertyValue);
- // trying to set value on read only property is no-op
+ else
+ {
+ // trying to set value on read only property is no-op
+ propertySet = false;
+ }
}
else
{
DALI_LOG_ERROR("Invalid property index\n");
}
else
{
DALI_LOG_ERROR("Invalid property index\n");
+
+ // Let derived classes know that a property has been set
+ // TODO: We should not call this for read-only properties, SetDefaultProperty() && TypeInfo::SetProperty() should return a bool, which would be true if the property is set
+ if ( propertySet )
+ {
+ OnPropertySet(index, propertyValue);
+ }
}
Property::Value Object::GetProperty(Property::Index index) const
}
Property::Value Object::GetProperty(Property::Index index) const
/**
* For use in derived classes.
/**
* For use in derived classes.
- * This is called after a non animatable custom property is set.
+ * This is called after a property is set.
* @param [in] index The index of the property.
* @param [in] propertyValue The value of the property.
*/
* @param [in] index The index of the property.
* @param [in] propertyValue The value of the property.
*/