X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Frenderers%2Fcontrol-renderer-impl.h;h=883d4d6b2a638df3ac3509df7ce7de3225423aa8;hb=a073ebfd862b49692c8e6d7dff2b128e62a4f6df;hp=773e7c09428bf84af00746cc47c1548f799e0247;hpb=a41be0bf03293b22c95b2fa206aa87357e0d406a;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 773e7c0..883d4d6 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 | + * |-------------------------|------------------| + * | customShader | MAP | + * + * where custom-shader is a map with the following properties: + * | %Property Name | Type | + * |-------------------------|------------------| + * | vertexShader | STRING | + * | fragmentShader | STRING | + * | subdivideGridX | INT | + * | subdivideGridY | INT | + * | shaderHints | INT | */ class ControlRenderer : public BaseObject { @@ -50,10 +67,10 @@ 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] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor * @param[in] propertyMap The properties for the requested ControlRenderer object. */ - virtual void Initialize( RendererFactoryCache& factoryCache, const Property::Map& propertyMap ) = 0; + void Initialize( Actor& actor, const Property::Map& propertyMap ); /** * @copydoc Toolkit::ControlRenderer::SetSize @@ -113,14 +130,16 @@ public: /** * @copydoc Toolkit::ControlRenderer::CreatePropertyMap */ - virtual void CreatePropertyMap( Property::Map& map ) const = 0; + 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(). @@ -128,21 +147,52 @@ 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; /** - * Called by SetOnStage() allowing sub classes to respond to the SetOnStage event + * @brief Called by Initialize() allowing sub classes to respond to the Initialize event + * + * @param[in] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor + * @param[in] propertyMap The properties for the requested ControlRenderer object. + */ + virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ) = 0; + +protected: + + /** + * @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 Gets the on stage state for this ControlRenderer + * + * @return Returns true if this ControlRenderer is on stage, false if it is off the stage + */ + bool GetIsOnStage() const; + + /** + * @brief Gets whether the Dali::Renderer is from a shared cache (and therefore any modifications will affect other users of that renderer) + * + * @return Returns true if the renderer is from shared cache, false otherwise + */ + bool GetIsFromCache() const; + private: // Undefined @@ -152,9 +202,9 @@ private: ControlRenderer& operator=( const ControlRenderer& renderer ); protected: - struct Impl; Impl* mImpl; + RendererFactoryCache& mFactoryCache; }; } // namespace Internal