X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fcommon%2Fproperty-buffer-impl.h;h=2f57eafd7899c99f2d70c2e7303f6d428a3ebb9a;hb=db9cfcd683be8e4b3a1f83f6378e493770eb9533;hp=122ae7da2a5accbd8806e7544beb0aa863611f20;hpb=174599e5921a33ac4b457369d9d96cc204741970;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/common/property-buffer-impl.h b/dali/internal/event/common/property-buffer-impl.h index 122ae7d..2f57eaf 100644 --- a/dali/internal/event/common/property-buffer-impl.h +++ b/dali/internal/event/common/property-buffer-impl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_PROPERTY_BUFFER_H /* - * Copyright (c) 2015 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. @@ -18,32 +18,18 @@ * */ -// EXTERNAL INCLUDES -#include // std::pair - // INTERNAL INCLUDES #include // DALI_ASSERT_ALWAYS #include // Dali::IntrusivePtr +#include #include // Dali::Property::Map -#include // Dali::PropertyBuffer -#include // Dali::Internal::Connectable -#include // Dali::Internal::ObjectConnector -#include // Dali::Internal::Object +#include +#include namespace Dali { namespace Internal { -namespace SceneGraph -{ -class PropertyBuffer; - -namespace PropertyBufferMetadata -{ -struct Format; -} // namespace PropertyBufferMetadata - -} // namespace SceneGraph class PropertyBuffer; typedef IntrusivePtr PropertyBufferPtr; @@ -52,148 +38,33 @@ typedef IntrusivePtr PropertyBufferPtr; * PropertyBuffer is an object that contains an array of structures of values that * can be accessed as properties. */ -class PropertyBuffer : public Object, public Connectable +class PropertyBuffer : public BaseObject { public: /** * @copydoc PropertBuffer::New() */ - static PropertyBufferPtr New(); - - /** - * @copydoc PropertBuffer::SetSize() - */ - void SetSize( std::size_t size ); - - /** - * @copydoc PropertBuffer::GetSize() - */ - std::size_t GetSize() const; + static PropertyBufferPtr New( Dali::Property::Map& format ); /** * @copydoc PropertBuffer::SetData() */ - void SetData( const void* data ); - - /** - * @copydoc PropertBuffer::GetPropertyIndex() - */ - Dali::Property::Index GetPropertyIndex( const std::string name, std::size_t index ); + void SetData( const void* data, uint32_t size ); /** - * @brief Get the propertyBuffer scene object - * - * @return the propertyBuffer scene object - */ - const SceneGraph::PropertyBuffer* GetPropertyBufferSceneObject() const; - - /** - * @brief Set the format of the PropertyBuffer - * - * @pre Has not been set yet - * - * @param[in] format of the PropertyBuffer + * @copydoc PropertBuffer::GetSize() */ - void SetFormat( Dali::Property::Map& format ); + uint32_t GetSize() const; public: // Default property extensions from Object /** - * @copydoc Dali::Internal::Object::GetDefaultPropertyCount() - */ - virtual unsigned int GetDefaultPropertyCount() const; - - /** - * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices() - */ - virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const; - - /** - * @copydoc Dali::Internal::Object::GetDefaultPropertyName() - */ - virtual const char* GetDefaultPropertyName(Property::Index index) const; - - /** - * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex() - */ - virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const; - - /** - * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable() - */ - virtual bool IsDefaultPropertyWritable(Property::Index index) const; - - /** - * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable() - */ - virtual bool IsDefaultPropertyAnimatable(Property::Index index) const; - - /** - * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput() - */ - virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const; - - /** - * @copydoc Dali::Internal::Object::GetDefaultPropertyType() - */ - virtual Property::Type GetDefaultPropertyType(Property::Index index) const; - - /** - * @copydoc Dali::Internal::Object::SetDefaultProperty() - */ - virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue); - - /** - * @copydoc Dali::Internal::Object::SetSceneGraphProperty() - */ - virtual void SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value ); - - /** - * @copydoc Dali::Internal::Object::GetDefaultProperty() - */ - virtual Property::Value GetDefaultProperty( Property::Index index ) const; - - /** - * @copydoc Dali::Internal::Object::GetPropertyOwner() - */ - virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const; - - /** - * @copydoc Dali::Internal::Object::GetSceneObject() - */ - virtual const SceneGraph::PropertyOwner* GetSceneObject() const; - - /** - * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty() - */ - virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const; - - /** - * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty() - */ - virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const; - - /** - * @copydoc Dali::Internal::Object::GetPropertyComponentIndex() - */ - virtual int GetPropertyComponentIndex( Property::Index index ) const; - -public: // Functions from Connectable - /** - * @copydoc Dali::Internal::Connectable::OnStage() - */ - virtual bool OnStage() const; - - /** - * @copydoc Dali::Internal::Connectable::Contnect() - */ - virtual void Connect(); - - /** - * @copydoc Dali::Internal::Connectable::Disconnect() + * @brief Get the render thread side of the PropertyBuffer + * + * @return The render thread side of this PropertyBuffer */ - virtual void Disconnect(); + const Render::PropertyBuffer* GetRenderObject() const; protected: /** @@ -210,31 +81,17 @@ private: // implementation /** * Second stage initialization */ - void Initialize(); - - /** - * Update the buffer when the format changes - */ - void FormatChanged(); - - /** - * Update the buffer when the size changes - */ - void SizeChanged(); + void Initialize( Dali::Property::Map& format ); private: // unimplemented methods PropertyBuffer( const PropertyBuffer& ); PropertyBuffer& operator=( const PropertyBuffer& ); private: // data - SceneGraph::PropertyBuffer* mSceneObject; ///< Update side object - - Property::Map mFormat; ///< Format of the property buffer - const SceneGraph::PropertyBufferMetadata::Format* mBufferFormat; ///< Metadata for the format of the property buffer - unsigned int mSize; ///< Number of elements in the buffer - Dali::Vector< char > mBuffer; // Data of the property-buffer - - bool mOnStage; ///< Flag to know if the object is on stage + EventThreadServices& mEventThreadServices; /// struct PropertyImplementationType template<> struct PropertyImplementationType< Property::BOOLEAN > { typedef bool Type; }; template<> struct PropertyImplementationType< Property::FLOAT > { typedef float Type; }; template<> struct PropertyImplementationType< Property::INTEGER > { typedef int Type; }; -template<> struct PropertyImplementationType< Property::UNSIGNED_INTEGER > { typedef unsigned int Type; }; template<> struct PropertyImplementationType< Property::VECTOR2 > { typedef Vector2 Type; }; template<> struct PropertyImplementationType< Property::VECTOR3 > { typedef Vector3 Type; }; template<> struct PropertyImplementationType< Property::VECTOR4 > { typedef Vector4 Type; }; @@ -256,7 +112,7 @@ template<> struct PropertyImplementationType< Property::MATRIX > { typedef Matri template<> struct PropertyImplementationType< Property::RECTANGLE > { typedef Rect Type; }; template<> struct PropertyImplementationType< Property::ROTATION > { typedef Quaternion Type; }; -unsigned int GetPropertyImplementationSize( Property::Type& propertyType ); +uint32_t GetPropertyImplementationSize( Property::Type& propertyType ); } // namespace Internal