X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fcommon%2Fproperty-owner.h;h=f4329fa862ad393887a91678431016a1c9c0a31a;hb=5de727a5d6b9ef995c93eff4d4e47a086784a332;hp=2e6c7da6f1dc42d117808bafde18f1cf9dc745b3;hpb=a97484aeeca88cff822ffa6a389d98f89337dcd4;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/common/property-owner.h b/dali/internal/update/common/property-owner.h index 2e6c7da..f4329fa 100644 --- a/dali/internal/update/common/property-owner.h +++ b/dali/internal/update/common/property-owner.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_SCENE_GRAPH_PROPERTY_OWNER_H /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -19,25 +19,21 @@ */ // INTERNAL INCLUDES -#include #include +#include #include +#include #include #include #include -#include -#include - +#include namespace Dali { - namespace Internal { - namespace SceneGraph { - class PropertyOwner; using OwnedPropertyContainer = OwnerContainer; @@ -50,23 +46,21 @@ using OwnedPropertyIter = OwnedPropertyContainer::Iterator; class PropertyOwner { public: - class Observer { public: - /** * Called when the observable object is connected to the scene graph. * @param[in] owner A reference to the connected PropertyOwner */ - virtual void PropertyOwnerConnected( PropertyOwner& owner ) = 0; + virtual void PropertyOwnerConnected(PropertyOwner& owner) = 0; /** * Called when the observable object is disconnected from the scene graph. * @param[in] currentBufferIndex The buffer to reset. * @param[in] owner A reference to the disconnected PropertyOwner */ - virtual void PropertyOwnerDisconnected( BufferIndex updateBufferIndex, PropertyOwner& owner ) = 0; + virtual void PropertyOwnerDisconnected(BufferIndex updateBufferIndex, PropertyOwner& owner) = 0; /** * Called shortly before the observable object is destroyed. @@ -74,10 +68,9 @@ public: * @note Cleanup should be done in both this and PropertyOwnerDisconnected as PropertyOwnerDisconnected * may not be called (i.e. when shutting down). */ - virtual void PropertyOwnerDestroyed( PropertyOwner& owner ) = 0; + virtual void PropertyOwnerDestroyed(PropertyOwner& owner) = 0; protected: - /** * Virtual destructor, no deletion through this interface */ @@ -133,14 +126,19 @@ public: * This occurs when the object is disconnected from the scene-graph during UpdateManager::Update(). * @param[in] currentBufferIndex The current update buffer. */ - void DisconnectFromSceneGraph( BufferIndex updateBufferIndex ); + void DisconnectFromSceneGraph(BufferIndex updateBufferIndex); + + /** + * Reserve the given number of properties + */ + void ReserveProperties(int propertyCount); /** * Install a custom property. * @post The PropertyOwner takes ownership of the property. * @param[in] property A pointer to a newly allocated property. */ - void InstallCustomProperty( OwnerPointer& property ); + void InstallCustomProperty(OwnerPointer& property); /** * Retrieve the custom properties owned by the object. @@ -164,7 +162,7 @@ public: * Mark an property owner with the updated flag. * @param[in] updated The updated flag */ - virtual void SetUpdated(bool updated) + void SetUpdated(bool updated) { mUpdated = updated; } @@ -184,13 +182,13 @@ public: * Apply a constraint. * @param[in] constraint The constraint to apply. */ - void ApplyConstraint( OwnerPointer& constraint ); + void ApplyConstraint(OwnerPointer& constraint); /** * Begin removal of constraints. * @param[in] constraint The constraint to remove. */ - void RemoveConstraint( ConstraintBase* constraint ); + void RemoveConstraint(ConstraintBase* constraint); /** * Retrieve the constraints that are currently applied. @@ -206,7 +204,7 @@ public: /** * @copydoc UniformMap::Remove */ - virtual void RemoveUniformMapping( const ConstString& uniformName ); + virtual void RemoveUniformMapping(const ConstString& uniformName); /** * Get the mappings table @@ -216,12 +214,12 @@ public: /** * @copydoc UniformMap::AddUniformMapObserver */ - void AddUniformMapObserver( UniformMap::Observer& observer ); + void AddUniformMapObserver(UniformMap::Observer& observer); /** * @copydoc UniformMap::RemoveUniformMapObserver */ - void RemoveUniformMapObserver( UniformMap::Observer& observer ); + void RemoveUniformMapObserver(UniformMap::Observer& observer); /** * Query whether playing an animation is possible or not. @@ -233,14 +231,12 @@ public: } protected: - /** * Protected constructor. */ PropertyOwner(); private: - // Undefined PropertyOwner(const PropertyOwner&); @@ -248,10 +244,9 @@ private: PropertyOwner& operator=(const PropertyOwner& rhs); protected: - OwnedPropertyContainer mCustomProperties; ///< Properties provided with InstallCustomProperty() - UniformMap mUniformMaps; ///< Container of owned uniform maps - bool mUpdated; + UniformMap mUniformMaps; ///< Container of owned uniform maps + bool mUpdated; bool mIsConnectedToSceneGraph; private: