/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
baseImpl.GetPropertyIndices( indices );
}
- if ( ! mRegisteredProperties.empty() )
+ AppendProperties( indices, mRegisteredProperties );
+}
+
+void TypeInfo::GetChildPropertyIndices( Property::IndexContainer& indices ) const
+{
+ Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
+ if ( base )
+ {
+ const TypeInfo& baseImpl( GetImplementation( base ) );
+ baseImpl.GetChildPropertyIndices( indices );
+ }
+
+ AppendProperties( indices, mRegisteredChildProperties );
+}
+
+/**
+ * Append the indices in RegisteredProperties to the given index container.
+ */
+void TypeInfo::AppendProperties( Dali::Property::IndexContainer& indices,
+ const TypeInfo::RegisteredPropertyContainer& registeredProperties ) const
+{
+ if ( ! registeredProperties.empty() )
{
- indices.Reserve( indices.Size() + mRegisteredProperties.size() );
+ indices.Reserve( indices.Size() + registeredProperties.size() );
- const RegisteredPropertyContainer::const_iterator endIter = mRegisteredProperties.end();
- for ( RegisteredPropertyContainer::const_iterator iter = mRegisteredProperties.begin(); iter != endIter; ++iter )
+ for( auto&& elem : registeredProperties )
{
- indices.PushBack( iter->first );
+ indices.PushBack( elem.first );
}
}
}
}
}
-size_t TypeInfo::GetPropertyCount() const
+uint32_t TypeInfo::GetPropertyCount() const
{
- size_t count( mRegisteredProperties.size() );
+ uint32_t count = static_cast<uint32_t>( mRegisteredProperties.size() );
Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
while ( base )
{
const TypeInfo& baseImpl( GetImplementation(base) );
- count += baseImpl.mRegisteredProperties.size();
+ count += static_cast<uint32_t>( baseImpl.mRegisteredProperties.size() );
base = TypeRegistry::Get()->GetTypeInfo( baseImpl.mBaseTypeName );
}
return GetImplementation(base).GetChildPropertyName( index );
}
- DALI_ASSERT_ALWAYS( ! "Cannot find property index" ); // use the same assert as Object
+ DALI_LOG_WARNING("Cannot find property index");
+
+ static std::string emptyString;
+ return emptyString;
}
Property::Type TypeInfo::GetChildPropertyType( Property::Index index ) const
if ( iter != mRegisteredProperties.end() )
{
- type = iter->second.type;
+ if( iter->second.componentIndex == Property::INVALID_COMPONENT_INDEX )
+ {
+ type = iter->second.type;
+ }
+ else
+ {
+ // If component index is set, then we should return FLOAT
+ type = Property::FLOAT;
+ }
}
else
{