mSizeSet( Vector3::ZERO ),
mTargetSize( Vector3::ZERO ),
mNego( false ),
- mDepth(0u)
+ mDepth(0u),
+ develProp6( 10.0f )
{
}
mDaliProperty( Property::INVALID_INDEX ),
mSizeSet( Vector3::ZERO ),
mTargetSize( Vector3::ZERO ),
- mNego( nego )
+ mNego( nego ),
+ develProp6( 10.0f )
{
}
/**
{
return Property::Value(actorImpl.develProp5);
}
+ case Test::DevelTestCustomActor::Property::DEVEL_TEST_PROPERTY6:
+ {
+ return Property::Value(actorImpl.develProp6);
+ }
}
}
return Property::Value();
DALI_DEVEL_PROPERTY_REGISTRATION( Test, TestCustomActor, "develTestProperty3", VECTOR4, DEVEL_TEST_PROPERTY3)
DALI_DEVEL_PROPERTY_REGISTRATION( Test, TestCustomActor, "develTestProperty4", INTEGER, DEVEL_TEST_PROPERTY4)
DALI_DEVEL_PROPERTY_REGISTRATION( Test, TestCustomActor, "develTestProperty5", FLOAT, DEVEL_TEST_PROPERTY5)
+DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Test, TestCustomActor, "develTestProperty6", FLOAT, DEVEL_TEST_PROPERTY6)
DALI_TYPE_REGISTRATION_END()
TEST_PROPERTY2 = Test::TestCustomActor::Property::TEST_PROPERTY2,
DEVEL_TEST_PROPERTY3 = TEST_PROPERTY2+1,
DEVEL_TEST_PROPERTY4 = TEST_PROPERTY2+2,
- DEVEL_TEST_PROPERTY5 = TEST_PROPERTY2+3
+ DEVEL_TEST_PROPERTY5 = TEST_PROPERTY2+3,
+ DEVEL_TEST_PROPERTY6 = TEST_PROPERTY2+4
};
} // Namespace Property
Dali::Vector4 develProp3;
int develProp4;
float develProp5;
+ float develProp6;
};
inline TestCustomActor& GetImpl( Test::TestCustomActor& handle )
/*
- * Copyright (c) 2016 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.
value = actor.GetProperty( Test::DevelTestCustomActor::Property::DEVEL_TEST_PROPERTY5 );
DALI_TEST_EQUALS( value.Get<float>(), 40.0f, 0.001f, TEST_LOCATION );
+ // Get read-only property
+ value = actor.GetProperty( Test::DevelTestCustomActor::Property::DEVEL_TEST_PROPERTY6 );
+ DALI_TEST_EQUALS( value.Get<float>(), 10.0f, 0.001f, TEST_LOCATION );
+
+ // Attempt to set read-only property and then ensure value hasn't changed
+ actor.SetProperty( Test::DevelTestCustomActor::Property::DEVEL_TEST_PROPERTY6, 40.0f );
+ DALI_TEST_EQUALS( value.Get<float>(), 10.0f, 0.001f, TEST_LOCATION );
+
END_TEST;
}
#define __DALI_PROPERTY_HELPER_DEVEL_H__
/*
- * Copyright (c) 2016 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.
DALI_COMPILE_TIME_ASSERT( ( objectNamespace:: develNamespace ::Property::enumIndex - objectNamespace::objectType::PROPERTY_START_INDEX ) == count );
/**
+ * @copydoc DALI_DEVEL_PROPERTY_REGISTRATION_INTERNAL
+ */
+#define DALI_DEVEL_PROPERTY_REGISTRATION_INTERNAL_READ_ONLY( count, typeRegistrationObject, objectNamespace, objectType, develNamespace, text, valueType, enumIndex ) \
+ Dali::PropertyRegistration DALI_TOKEN_PASTE( property, count ) ( typeRegistrationObject, text, objectNamespace:: develNamespace ::Property::enumIndex, Dali::Property::valueType, NULL, &objectType::GetProperty ); \
+ DALI_COMPILE_TIME_ASSERT( ( objectNamespace:: develNamespace ::Property::enumIndex - objectNamespace::objectType::PROPERTY_START_INDEX ) == count );
+
+/**
* @brief These macros are used to define properties for implementations of CustomActor.
*
* These macros should be used when defining devel properties
#define DALI_DEVEL_PROPERTY_REGISTRATION( objectNamespace, objectType, text, valueType, enumIndex ) \
DALI_DEVEL_PROPERTY_REGISTRATION_INTERNAL( __COUNTER__, typeRegistration, objectNamespace, objectType, DALI_TOKEN_PASTE( Devel, objectType ), text, valueType, enumIndex )
+/**
+ * @copydoc DALI_DEVEL_PROPERTY_REGISTRATION
+ *
+ * @note For Read Only properties
+ */
+#define DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( objectNamespace, objectType, text, valueType, enumIndex ) \
+ DALI_DEVEL_PROPERTY_REGISTRATION_INTERNAL_READ_ONLY( __COUNTER__, typeRegistration, objectNamespace, objectType, DALI_TOKEN_PASTE( Devel, objectType ), text, valueType, enumIndex )
+
#endif // __DALI_PROPERTY_HELPER_DEVEL_H__