#include <algorithm> // std::sort
// INTERNAL INCLUDES
-#include <dali/public-api/object/property-buffer.h> // Dali::Internal::PropertyBuffer
+#include <dali/public-api/object/type-registry.h>
+#include <dali/devel-api/object/property-buffer.h> // Dali::Internal::PropertyBuffer
+
#include <dali/internal/event/common/object-impl-helper.h> // Dali::Internal::ObjectHelper
#include <dali/internal/event/common/property-helper.h> // DALI_PROPERTY_TABLE_BEGIN, DALI_PROPERTY, DALI_PROPERTY_TABLE_END
#include <dali/internal/update/common/scene-graph-property-buffer.h>
* |name |type |writable|animatable|constraint-input|enum for index-checking|
*/
DALI_PROPERTY_TABLE_BEGIN
-DALI_PROPERTY( "size", UNSIGNED_INTEGER, true, false, true, Dali::PropertyBuffer::Property::SIZE )
-DALI_PROPERTY( "buffer-format", MAP, false, false, false, Dali::PropertyBuffer::Property::BUFFER_FORMAT )
+DALI_PROPERTY( "size", INTEGER, true, false, true, Dali::PropertyBuffer::Property::SIZE )
+DALI_PROPERTY( "buffer-format", MAP, false, false, false, Dali::PropertyBuffer::Property::BUFFER_FORMAT )
DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
const ObjectImplHelper<DEFAULT_PROPERTY_COUNT> PROPERTY_BUFFER_IMPL = { DEFAULT_PROPERTY_DETAILS };
+BaseHandle Create()
+{
+ return Dali::BaseHandle();
+}
+
+TypeRegistration mType( typeid( Dali::PropertyBuffer ), typeid( Dali::Handle ), Create );
+
/**
* Calculate the alignment requirements of a type
*
switch( propertyType )
{
case Property::NONE:
- case Property::TYPE_COUNT:
case Property::STRING:
case Property::ARRAY:
case Property::MAP:
}
case Property::BOOLEAN:
{
- alignment = sizeof( PropertyImplementationTypeAlignment< Property::BOOLEAN >::VALUE );
+ alignment = PropertyImplementationTypeAlignment< Property::BOOLEAN >::VALUE;
break;
}
case Property::INTEGER:
{
- alignment = sizeof( PropertyImplementationTypeAlignment< Property::INTEGER >::VALUE );
- break;
- }
- case Property::UNSIGNED_INTEGER:
- {
- alignment = sizeof( PropertyImplementationTypeAlignment< Property::UNSIGNED_INTEGER >::VALUE );
+ alignment = PropertyImplementationTypeAlignment< Property::INTEGER >::VALUE;
break;
}
case Property::FLOAT:
{
- alignment = sizeof( PropertyImplementationTypeAlignment< Property::FLOAT >::VALUE );
+ alignment = PropertyImplementationTypeAlignment< Property::FLOAT >::VALUE;
break;
}
case Property::VECTOR2:
{
- alignment = sizeof( PropertyImplementationTypeAlignment< Property::VECTOR2 >::VALUE );
+ alignment = PropertyImplementationTypeAlignment< Property::VECTOR2 >::VALUE;
break;
}
case Property::VECTOR3:
{
- alignment = sizeof( PropertyImplementationTypeAlignment< Property::VECTOR3 >::VALUE );
+ alignment = PropertyImplementationTypeAlignment< Property::VECTOR3 >::VALUE;
break;
}
case Property::VECTOR4:
{
- alignment = sizeof( PropertyImplementationTypeAlignment< Property::VECTOR4 >::VALUE );
+ alignment = PropertyImplementationTypeAlignment< Property::VECTOR4 >::VALUE;
break;
}
case Property::MATRIX3:
{
- alignment = sizeof( PropertyImplementationTypeAlignment< Property::MATRIX3 >::VALUE );
+ alignment = PropertyImplementationTypeAlignment< Property::MATRIX3 >::VALUE;
break;
}
case Property::MATRIX:
{
- alignment = sizeof( PropertyImplementationTypeAlignment< Property::MATRIX >::VALUE );
+ alignment = PropertyImplementationTypeAlignment< Property::MATRIX >::VALUE;
break;
}
case Property::RECTANGLE:
{
- alignment = sizeof( PropertyImplementationTypeAlignment< Property::RECTANGLE >::VALUE );
+ alignment = PropertyImplementationTypeAlignment< Property::RECTANGLE >::VALUE;
break;
}
case Property::ROTATION:
{
- alignment = sizeof( PropertyImplementationTypeAlignment< Property::ROTATION >::VALUE );
+ alignment = PropertyImplementationTypeAlignment< Property::ROTATION >::VALUE;
break;
}
}
new SceneGraph::PropertyBuffer::BufferType( mBuffer ) );
}
-Dali::Property::Index PropertyBuffer::GetPropertyIndex( const std::string name, std::size_t index )
-{
- //TODO: MESH_REWORK
- DALI_ASSERT_ALWAYS( false && "MESH_REWORK" );
- return 0;
-}
-
const SceneGraph::PropertyBuffer* PropertyBuffer::GetPropertyBufferSceneObject() const
{
return mSceneObject;
}
-void PropertyBuffer::SetType( Dali::PropertyBuffer::Type type )
-{
- DALI_ASSERT_DEBUG( mType == Dali::PropertyBuffer::TYPE_COUNT && "Type can only be set once." );
- DALI_ASSERT_DEBUG( type != Dali::PropertyBuffer::TYPE_COUNT && "Type must be set to a valid value." );
-
- mType = type;
-}
-
void PropertyBuffer::SetFormat( Dali::Property::Map& format )
{
DALI_ASSERT_ALWAYS( format.Count() && "Format cannot be empty." );
{
case Dali::PropertyBuffer::Property::SIZE:
{
- value = static_cast<int>( GetSize() ); // @todo MESH_REWORK Add a size_t type to PropertyValue
+ value = static_cast<int>( GetSize() );
break;
}
case Dali::PropertyBuffer::Property::BUFFER_FORMAT:
int PropertyBuffer::GetPropertyComponentIndex( Property::Index index ) const
{
- return PROPERTY_BUFFER_IMPL.GetPropertyComponentIndex( index );
+ return Property::INVALID_COMPONENT_INDEX;
}
bool PropertyBuffer::OnStage() const
PropertyBuffer::~PropertyBuffer()
{
+ if( EventThreadServices::IsCoreRunning() )
+ {
+ EventThreadServices& eventThreadServices = GetEventThreadServices();
+ SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
+ RemoveMessage( updateManager, updateManager.GetPropertyBufferOwner(), *mSceneObject );
+
+ eventThreadServices.UnregisterObject( this );
+ }
}
PropertyBuffer::PropertyBuffer()
: mSceneObject( NULL ),
mBufferFormat( NULL ),
mSize( 0 ),
- mType( Dali::PropertyBuffer::TYPE_COUNT ),
mOnStage( false )
{
}
EventThreadServices& eventThreadServices = GetEventThreadServices();
SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
- DALI_ASSERT_ALWAYS( EventThreadServices::IsCoreRunning() && "Core is not running" );
-
mSceneObject = new SceneGraph::PropertyBuffer();
AddMessage( updateManager, updateManager.GetPropertyBufferOwner(), *mSceneObject );
+
+ eventThreadServices.RegisterObject( this );
}
void PropertyBuffer::FormatChanged()
switch( propertyType )
{
case Property::NONE:
- case Property::TYPE_COUNT:
case Property::STRING:
case Property::ARRAY:
case Property::MAP:
size = sizeof( PropertyImplementationType< Property::INTEGER >::Type );
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- size = sizeof( PropertyImplementationType< Property::UNSIGNED_INTEGER >::Type );
- break;
- }
case Property::FLOAT:
{
size = sizeof( PropertyImplementationType< Property::FLOAT >::Type );