Merge "Fix for the cursor position with the arabic script." into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / renderers / border / border-renderer.h
index c05ea1c..14eaf42 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H__
-#define __DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H__
+#ifndef DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H
+#define DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
@@ -17,8 +17,9 @@
  * limitations under the License.
  *
  */
+
 // EXTERNAL INCLUDES
-#include <dali/devel-api/rendering/geometry.h>
+#include <dali/public-api/rendering/geometry.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
@@ -37,10 +38,11 @@ namespace Internal
  *
  * The following properties are required for create a BorderRender
  *
- * | %Property Name   | Type        |
- * |------------------|-------------|
- * | border-color     | VECTOR4     |
- * | border-size      | FLOAT       |
+ * | %Property Name  | Type        |
+ * |-----------------|-------------|
+ * | borderColor     | VECTOR4     |
+ * | borderSize      | FLOAT       |
+ * | antiAliasing    | BOOLEAN     |
  */
 
 class BorderRenderer : public ControlRenderer
@@ -49,8 +51,10 @@ public:
 
   /**
    * @brief Constructor.
+   *
+   * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
    */
-  BorderRenderer();
+  BorderRenderer( RendererFactoryCache& factoryCache );
 
   /**
    * @brief A reference counted object may only be deleted by calling Unreference().
@@ -60,16 +64,17 @@ public:
 public:  // from ControlRenderer
 
   /**
-   * @copydoc ControlRenderer::Initialize
-   */
-  virtual void Initialize( RendererFactoryCache& factoryCache, const Property::Map& propertyMap );
-
-  /**
    * @copydoc ControlRenderer::SetClipRect
    */
   virtual void SetClipRect( const Rect<int>& clipRect );
 
 protected:
+
+  /**
+   * @copydoc ControlRenderer::DoInitialize
+   */
+  virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
+
   /**
    * @copydoc ControlRenderer::DoSetOnStage
    */
@@ -78,18 +83,11 @@ protected:
   /**
    * @copydoc ControlRenderer::CreatePropertyMap
    */
-  virtual void CreatePropertyMap( Property::Map& map ) const;
+  virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
 public:
 
   /**
-   * Request the geometry and shader from the cache, if not available, create and save to the cache for sharing.
-   *
-   * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
-   */
-  void Initialize( RendererFactoryCache& factoryCache );
-
-  /**
    * Set the color of the border.
    * @param[in] color The border color.
    */
@@ -101,9 +99,26 @@ public:
    */
   void SetBorderSize( float size );
 
+  /**
+   * Enable/Disable the anti-aliasing.
+   * @param[in] enable Whether the anti-aliasing be enabled or not.
+   */
+  void RequireAntiAliasing( bool antiAliasing );
+
 private:
 
   /**
+   * @brief Initialize the renderer with the geometry and shader from the cache, if not available, create and save to the cache for sharing.
+   */
+  void InitializeRenderer();
+
+  /**
+   * Request the border shader from the factory cache. If fail, create tha shader and add it to cache.
+   * @return The border shader.
+   */
+  Shader GetBorderShader();
+
+  /**
    * Create the geometry which presents the border.
    * @return The border geometry
    */
@@ -122,6 +137,8 @@ private:
 
   Property::Index mBorderColorIndex;
   Property::Index mBorderSizeIndex;
+
+  bool mAntiAliasing;
 };
 
 } // namespace Internal
@@ -130,4 +147,4 @@ private:
 
 } // namespace Dali
 
-#endif /* __DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H__ */
+#endif // DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H