CustomPropertyMetadata* custom = FindCustomProperty( index );
if( custom )
{
- return custom->type;
+ return custom->GetType();
}
return Property::NONE;
}
{
BufferIndex bufferIndex( GetEventThreadServices().GetEventBufferIndex() );
- switch ( entry->type )
+ switch ( entry->GetType() )
{
case Property::BOOLEAN:
{
void Object::SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value )
{
- switch ( entry.type )
+ switch ( entry.GetType() )
{
case Property::BOOLEAN:
{
if(animatableProperty)
{
// Create the metadata for the property component.
- mAnimatableProperties.PushBack( new AnimatablePropertyMetadata( index, typeInfo->GetComponentIndex(index), animatableProperty->type, animatableProperty->GetSceneGraphProperty() ) );
+ mAnimatableProperties.PushBack( new AnimatablePropertyMetadata( index, typeInfo->GetComponentIndex(index), animatableProperty->GetType(), animatableProperty->GetSceneGraphProperty() ) );
}
}
/**
* An entry in a property metadata lookup.
- * The type field should be queried, before accessing the scene-graph property:
+ * The value type field should be queried, before accessing the scene-graph property:
*
* @code
* void Example(PropertyEntry entry)
* {
- * if (entry.type == Property::VECTOR3)
+ * if (entry.value.GetType() == Property::VECTOR3)
* {
* SceneGraph::AnimatableProperty<Vector3>* property = dynamic_cast< SceneGraph::AnimatableProperty<Vector3>* >( entry.property );
* ...
* Constructor for an uninitalized property metadata
*/
PropertyMetadata()
- : type(Property::NONE),
- value(),
+ : value(),
componentIndex(Property::INVALID_COMPONENT_INDEX),
mProperty(NULL)
{
* @param [in] newProperty A pointer to the property metadata.
*/
PropertyMetadata(const SceneGraph::PropertyBase* newProperty)
- : type(Property::NONE),
- value(), // value is held by newProperty
+ : value(), // value is held by newProperty
componentIndex(Property::INVALID_COMPONENT_INDEX),
mProperty(newProperty)
{
- DALI_ASSERT_DEBUG(mProperty && "Uninitialized scenegraph property") ;
+ DALI_ASSERT_DEBUG(mProperty && "Uninitialized scenegraph property");
}
/**
* @param [in] newValue The value of the scene-graph owned property.
*/
PropertyMetadata(Property::Value newValue)
- : type(newValue.GetType()),
- value(newValue),
+ : value(newValue),
componentIndex(Property::INVALID_COMPONENT_INDEX),
mProperty(NULL)
{
*/
const SceneGraph::PropertyBase* GetSceneGraphProperty() const
{
- DALI_ASSERT_DEBUG(mProperty && "Accessing uninitialized SceneGraph property") ;
+ DALI_ASSERT_DEBUG(mProperty && "Accessing uninitialized SceneGraph property");
return mProperty;
}
- Property::Type type; ///< The type of the property
+ /*
+ * @return type of the held property value
+ */
+ inline Property::Type GetType() const { return value.GetType(); }
+
Property::Value value; ///< The property value for a non animatable and custom property
int componentIndex; ///< The index of the property component
/**
* An entry in an animatable property metadata lookup.
- * The type field should be queried, before accessing the animatable property:
+ * The value type field should be queried, before accessing the animatable property:
*/
class AnimatablePropertyMetadata : public PropertyMetadata
{
: index(newIndex)
{
componentIndex = newComponentIndex;
- type = newType;
+ value = Property::Value(newType);
mProperty = newProperty;
- DALI_ASSERT_DEBUG(mProperty && "Uninitialized scenegraph property") ;
+ DALI_ASSERT_DEBUG(mProperty && "Uninitialized scenegraph property");
}
/**
: index(newIndex)
{
componentIndex = newComponentIndex;
- type = newValue.GetType();
value = newValue;
}
*/
virtual bool IsWritable(void) const
{
- return true ;
+ return true;
}
Property::Index index; ///< The index of the property
: name(newName),
mAccessMode(Property::ANIMATABLE)
{
- type = newType;
+ value = Property::Value(newType);
mProperty = newProperty;
- DALI_ASSERT_DEBUG(mProperty && "Uninitialized scenegraph property") ;
+ DALI_ASSERT_DEBUG(mProperty && "Uninitialized scenegraph property");
}
/**
: name(newName),
mAccessMode(accessMode)
{
- type = newValue.GetType();
value = newValue;
- DALI_ASSERT_DEBUG(accessMode != Property::ANIMATABLE && "Animatable must have scenegraph property") ;
+ DALI_ASSERT_DEBUG(accessMode != Property::ANIMATABLE && "Animatable must have scenegraph property");
}
/**
*/
virtual bool IsWritable(void) const
{
- return (mAccessMode == Property::ANIMATABLE) || (mAccessMode == Property::READ_WRITE) ;
+ return (mAccessMode == Property::ANIMATABLE) || (mAccessMode == Property::READ_WRITE);
}
std::string name; ///< The name of the property