Rename of Control Renderers to Visuals
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / renderers / visual-impl.h
@@ -1,5 +1,5 @@
-#ifndef DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H
-#define DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H
+#ifndef DALI_TOOLKIT_INTERNAL_VISUAL_H
+#define DALI_TOOLKIT_INTERNAL_VISUAL_H
 
 /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
@@ -24,9 +24,9 @@
 #include <dali/public-api/rendering/shader.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/devel-api/controls/renderer-factory/control-renderer.h>
-#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
-#include <dali-toolkit/internal/controls/renderers/renderer-factory-cache.h>
+#include <dali-toolkit/devel-api/controls/visual-factory/visual-factory.h>
+#include <dali-toolkit/internal/controls/renderers/visual-factory-cache.h>
+#include "../../../devel-api/controls/visual-factory/visual.h"
 
 namespace Dali
 {
@@ -38,9 +38,9 @@ namespace Internal
 {
 
 /**
- * Base class for all Control rendering logic. A control may have multiple control renderers.
+ * Base class for all Control rendering logic. A control may have multiple visuals.
  *
- * Note: The control renderer responds to the the Actor::COLOR by blending it with the 'Multiply' operator.
+ * Note: The visual responds to the the Actor::COLOR by blending it with the 'Multiply' operator.
  *
  * The following properties are optional
  *
@@ -57,77 +57,77 @@ namespace Internal
  * | subdivideGridY          | INT              |
  * | shaderHints             | INT              |
  */
-class ControlRenderer : public BaseObject
+class Visual : public BaseObject
 {
 public:
 
   /**
-   * Initialisation of the renderer, this API should only called by the RendererFactory:
+   * Initialisation of the visual, this API should only called by the VisualFactory:
    *  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] 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.
+   * @param[in] actor The Actor the visual is applied to if, empty if the visual has not been applied to any Actor
+   * @param[in] propertyMap The properties for the requested Visual object.
    */
   void Initialize( Actor& actor, const Property::Map& propertyMap );
 
   /**
-   * @copydoc Toolkit::ControlRenderer::SetSize
+   * @copydoc Toolkit::Visual::SetSize
    */
   virtual void SetSize( const Vector2& size );
 
   /**
-   * @copydoc Toolkit::ControlRenderer::GetSize
+   * @copydoc Toolkit::Visual::GetSize
    */
   const Vector2& GetSize() const;
 
   /**
-   * @copydoc Toolkit::ControlRenderer::GetNaturalSize
+   * @copydoc Toolkit::Visual::GetNaturalSize
    */
   virtual void GetNaturalSize( Vector2& naturalSize ) const;
 
   /**
-   * ToDo: Add this function to Toolkit::ControlRenderer when it is fully implemented.
+   * ToDo: Add this function to Toolkit::Visual when it is fully implemented.
    *
-   * Set the clip rectangular of this renderer.
-   * The contents of the renderer will not be visible outside this rectangular.
+   * Set the clip rectangular of this visual.
+   * The contents of the visual will not be visible outside this rectangular.
    *
    * @param [in] clipRect The clipping rectangular.
    */
   virtual void SetClipRect( const Rect<int>& clipRect );
 
   /**
-   *ToDo: Add this function to Toolkit::ControlRenderer when it is fully implemented.
+   *ToDo: Add this function to Toolkit::Visual when it is fully implemented.
    *
-   * Reposition this renderer with a 2D offset.
+   * Reposition this visual with a 2D offset.
    *
-   * @param[in] offset The offset to reposition the renderer.
+   * @param[in] offset The offset to reposition the visual.
    */
   virtual void SetOffset( const Vector2& offset );
 
   /**
-   * @copydoc Toolkit::ControlRenderer::SetDepthIndex
+   * @copydoc Toolkit::Visual::SetDepthIndex
    */
   void SetDepthIndex( float index );
 
   /**
-   * @copydoc Toolkit::ControlRenderer::GetDepthIndex
+   * @copydoc Toolkit::Visual::GetDepthIndex
    */
   float GetDepthIndex() const;
 
   /**
-   * @copydoc Toolkit::ControlRenderer::SetOnStage
+   * @copydoc Toolkit::Visual::SetOnStage
    * @pre Impl->mGeometry must be created before this method is called
    */
   void SetOnStage( Actor& actor );
 
   /**
-   * @copydoc Toolkit::ControlRenderer::SetOffStage
+   * @copydoc Toolkit::Visual::SetOffStage
    */
   void SetOffStage( Actor& actor );
 
   /**
-   * @copydoc Toolkit::ControlRenderer::CreatePropertyMap
+   * @copydoc Toolkit::Visual::CreatePropertyMap
    */
   void CreatePropertyMap( Property::Map& map ) const;
 
@@ -156,28 +156,28 @@ protected:
   /**
    * @brief Constructor.
    *
-   * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
+   * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
    */
-  ControlRenderer( RendererFactoryCache& factoryCache );
+  Visual( VisualFactoryCache& factoryCache );
 
   /**
    * @brief A reference counted object may only be deleted by calling Unreference().
    */
-  virtual ~ControlRenderer();
+  virtual ~Visual();
 
 protected:
   /**
    * @brief Called by CreatePropertyMap() allowing sub classes to respond to the CreatePropertyMap event
    *
-   * @param[out] map The renderer property map.
+   * @param[out] map The visual 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] 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.
+   * @param[in] actor The Actor the visual is applied to if, empty if the visual has not been applied to any Actor
+   * @param[in] propertyMap The properties for the requested Visual object.
    */
   virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ) {};
 
@@ -186,22 +186,22 @@ protected:
   /**
    * @brief Called by SetOnStage() allowing sub classes to respond to the SetOnStage event
    *
-   * @param[in] actor The actor applying this renderer.
+   * @param[in] actor The actor applying this visual.
    */
   virtual void DoSetOnStage( Actor& actor );
 
   /**
    * @brief Called by SetOffStage() allowing sub classes to respond to the SetOffStage event
    *
-   * @param[in] actor The actor applying this renderer.
+   * @param[in] actor The actor applying this visual.
    */
   virtual void DoSetOffStage( Actor& actor );
 
 protected:
   /**
-   * @brief Gets the on stage state for this ControlRenderer
+   * @brief Gets the on stage state for this Visual
    *
-   * @return Returns true if this ControlRenderer is on stage, false if it is off the stage
+   * @return Returns true if this Visual is on stage, false if it is off the stage
    */
   bool GetIsOnStage() const;
 
@@ -215,39 +215,39 @@ protected:
 private:
 
   // Undefined
-  ControlRenderer( const ControlRenderer& renderer );
+  Visual( const Visual& visual );
 
   // Undefined
-  ControlRenderer& operator=( const ControlRenderer& renderer );
+  Visual& operator=( const Visual& visual );
 
 protected:
   struct Impl;
   Impl* mImpl;
-  RendererFactoryCache& mFactoryCache;
+  VisualFactoryCache& mFactoryCache;
 };
 
 } // namespace Internal
 
-inline const Internal::ControlRenderer& GetImplementation(const Toolkit::ControlRenderer& renderer)
+inline const Internal::Visual& GetImplementation(const Toolkit::Visual& visual)
 {
-  DALI_ASSERT_ALWAYS( renderer && "ControlRenderer handle is empty" );
+  DALI_ASSERT_ALWAYS( visual && "Visual handle is empty" );
 
-  const BaseObject& handle = renderer.GetBaseObject();
+  const BaseObject& handle = visual.GetBaseObject();
 
-  return static_cast<const Internal::ControlRenderer&>(handle);
+  return static_cast<const Internal::Visual&>(handle);
 }
 
-inline Internal::ControlRenderer& GetImplementation(Toolkit::ControlRenderer& renderer)
+inline Internal::Visual& GetImplementation(Toolkit::Visual& visual)
 {
-  DALI_ASSERT_ALWAYS( renderer && "ControlRenderer handle is empty" );
+  DALI_ASSERT_ALWAYS( visual && "Visual handle is empty" );
 
-  BaseObject& handle = renderer.GetBaseObject();
+  BaseObject& handle = visual.GetBaseObject();
 
-  return static_cast<Internal::ControlRenderer&>(handle);
+  return static_cast<Internal::Visual&>(handle);
 }
 
 } // namespace Toolkit
 
 } // namespace Dali
 
-#endif // DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H
+#endif // DALI_TOOLKIT_INTERNAL_VISUAL_H