X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Frenderers%2Fcontrol-renderer-impl.h;h=10a13dc7e76fe79b23e65280eacd7501888fbb97;hb=10967b843a1ab64b10f8a8e1c7757657b9ddba9a;hp=7c72734c7a20a82c8964e96a33706887fda3485b;hpb=5a06fb112e597dc2780ade446ae035ae15a5b037;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/renderers/control-renderer-impl.h b/dali-toolkit/internal/controls/renderers/control-renderer-impl.h index 7c72734..10a13dc 100644 --- a/dali-toolkit/internal/controls/renderers/control-renderer-impl.h +++ b/dali-toolkit/internal/controls/renderers/control-renderer-impl.h @@ -21,9 +21,13 @@ // EXTERNAL INCLUDES #include +#include +#include +// INTERNAL INCLUDES #include #include +#include namespace Dali { @@ -34,12 +38,25 @@ namespace Toolkit namespace Internal { -class RendererFactoryCache; - /** * Base class for all Control rendering logic. A control may have multiple control renderers. * * Note: The control renderer responds to the the Actor::COLOR by blending it with the 'Multiply' operator. + * + * The following properties are optional + * + * | %Property Name | Type | + * |---------------------------|------------------| + * | custom-shader | MAP | + * + * where custom-shader is a map with the following properties: + * | %Property Name | Type | + * |---------------------------|------------------| + * | vertex-shader | STRING | + * | fragment-shader | STRING | + * | subdivide-grid-x | INT | + * | subdivide-grid-y | INT | + * | shader-hints | INT | */ class ControlRenderer : public BaseObject { @@ -50,10 +67,9 @@ public: * request the geometry and shader from the cache, if not available, create and save to the cache for sharing; * record the property values. * - * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object * @param[in] propertyMap The properties for the requested ControlRenderer object. */ - virtual void Initialize( RendererFactoryCache& factoryCache, const Property::Map& propertyMap ) = 0; + void Initialize( const Property::Map& propertyMap ); /** * @copydoc Toolkit::ControlRenderer::SetSize @@ -61,6 +77,16 @@ public: virtual void SetSize( const Vector2& size ); /** + * @copydoc Toolkit::ControlRenderer::GetSize + */ + const Vector2& GetSize() const; + + /** + * @copydoc Toolkit::ControlRenderer::GetNaturalSize + */ + virtual void GetNaturalSize( Vector2& naturalSize ) const; + + /** * ToDo: Add this function to Toolkit::ControlRenderer when it is fully implemented. * * Set the clip rectangular of this renderer. @@ -85,27 +111,34 @@ public: void SetDepthIndex( float index ); /** + * @copydoc Toolkit::ControlRenderer::GetDepthIndex + */ + float GetDepthIndex() const; + + /** * @copydoc Toolkit::ControlRenderer::SetOnStage * @pre Impl->mGeometry must be created before this method is called */ void SetOnStage( Actor& actor ); /** - * ToDo: Add this function to Toolkit::ControlRenderer when the Renderer can be removed from actor properly. - * - * Renderer is destroyed when control is off stage. - * This function should be called when the control removes from stage - * - * @param[in] actor The actor applying this renderer. + * @copydoc Toolkit::ControlRenderer::SetOffStage */ void SetOffStage( Actor& actor ); + /** + * @copydoc Toolkit::ControlRenderer::CreatePropertyMap + */ + void CreatePropertyMap( Property::Map& map ) const; + protected: /** * @brief Constructor. + * + * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object */ - ControlRenderer(); + ControlRenderer( RendererFactoryCache& factoryCache ); /** * @brief A reference counted object may only be deleted by calling Unreference(). @@ -113,21 +146,53 @@ protected: virtual ~ControlRenderer(); protected: + /** + * @brief Called by CreatePropertyMap() allowing sub classes to respond to the CreatePropertyMap event + * + * @param[out] map The renderer property map. + */ + virtual void DoCreatePropertyMap( Property::Map& map ) const = 0; + + /** + * @brief Called by Initialize() allowing sub classes to respond to the Initialize event + * + * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object + * @param[in] propertyMap The properties for the requested ControlRenderer object. + */ + virtual void DoInitialize( const Property::Map& propertyMap ) = 0; + + /** + * @brief Initialises a renderer ready to be put on stage. + * + * @param[inout] renderer The Renderer to initialise. If the renderer is not empty then re-initialise the renderer + */ + virtual void InitializeRenderer( Renderer& renderer ) = 0; + +protected: /** - * Called by SetOnStage() allowing sub classes to respond to the SetOnStage event + * @brief Called by SetOnStage() allowing sub classes to respond to the SetOnStage event * * @param[in] actor The actor applying this renderer. */ virtual void DoSetOnStage( Actor& actor ); /** - * Called by SetOffStage() allowing sub classes to respond to the SetOffStage event + * @brief Called by SetOffStage() allowing sub classes to respond to the SetOffStage event * * @param[in] actor The actor applying this renderer. */ virtual void DoSetOffStage( Actor& actor ); +protected: + + /** + * @brief Sets the key to use for caching the renderer. If this is empty then no caching will occur + * + * @param[in] cachedRendererKey The key to use for caching the renderer. + */ + void SetCachedRendererKey( const std::string& cachedRendererKey ); + private: // Undefined @@ -137,9 +202,9 @@ private: ControlRenderer& operator=( const ControlRenderer& renderer ); protected: - struct Impl; Impl* mImpl; + RendererFactoryCache& mFactoryCache; }; } // namespace Internal