Add auxiliary message for window
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / canvas-renderer-shape.h
index ddd621c..281d772 100644 (file)
@@ -105,6 +105,30 @@ public:
     EVEN_ODD     ///< Draw a horizontal line from the point to a location outside the shape, and count the number of intersections. If the number of intersections is an odd number, the point is inside the shape.
   };
 
+  /**
+   * @brief Enumeration specifying the values of the path commands.
+   * Not to be confused with the path commands from the svg path element (like M, L, Q, H and many others).
+   */
+  enum class PathCommandType
+  {
+    CLOSE = 0, ///< Ends the current sub-path and connects it with its initial point. This command doesn't expect any points.
+    MOVE_TO,   ///< Sets a new initial point of the sub-path and a new current point. This command expects 1 point: the starting position.
+    LINE_TO,   ///< Draws a line from the current point to the given point and sets a new value of the current point. This command expects 1 point: the end-position of the line.
+    CUBIC_TO   ///< Draws a cubic Bezier curve from the current point to the given point using two given control points and sets a new value of the current point. This command expects 3 points: the 1st control-point, the 2nd control-point, the end-point of the curve.
+  };
+
+  /**
+   * @brief Structure that contains information about a list of path commands.
+   * For each command from the mCommands array, an appropriate number of points in mPoints array should be specified.
+   */
+  struct PathCommands
+  {
+    PathCommandType* mCommands;     ///< Set of each PathComand.
+    uint32_t         mCommandCount; ///< The number of command array.
+    float*           mPoints;       ///< Set of each Point
+    uint32_t         mPointCount;   ///< The number of point array.
+  };
+
 public:
   /**
    * @brief Append the given rectangle with rounded corner to the path.
@@ -171,6 +195,16 @@ public:
   bool AddCubicTo(Vector2 controlPoint1, Vector2 controlPoint2, Vector2 endPoint);
 
   /**
+   * @brief Appends a given sub-path to the path.
+   * The current point value is set to the last point from the sub-path.
+   * @param[in] pathCommand The command object that contain sub-path information. (This command information is copied internally.)
+   * @return Returns True when it's successful. False otherwise.
+   * @note The interface is designed for optimal path setting if the caller has a completed path commands already.
+   *
+   */
+  bool AddPath(PathCommands& pathCommand);
+
+  /**
    * @brief Closes the current subpath by drawing a line to the beginning of the
    * subpath, automatically starting a new path. The current point of the
    * new path is (0, 0).
@@ -180,6 +214,13 @@ public:
   bool Close();
 
   /**
+   * @brief Reset the added path(rect, circle, path, etc...) information.
+   * Color and Stroke information are keeped.
+   * @return Returns True when it's successful. False otherwise.
+   */
+  bool ResetPath();
+
+  /**
    * @brief Set the color to use for filling the path.
    * @param[in] color The color value.
    * @return Returns True when it's successful. False otherwise.
@@ -193,6 +234,19 @@ public:
   Vector4 GetFillColor() const;
 
   /**
+   * @brief Set the gradient to use for filling the path.
+   * @param[in] gradient The gradient object.
+   * @return Returns True when it's successful. False otherwise.
+   */
+  bool SetFillGradient(CanvasRenderer::Gradient& gradient);
+
+  /**
+   * @brief Get the gradient to use for filling the path.
+   * @return Returns The gradient object.
+   */
+  CanvasRenderer::Gradient GetFillGradient() const;
+
+  /**
    * @brief Set the fill rule.
    * @param[in] rule The current fill rule of the shape.
    * @return Returns True when it's successful. False otherwise.
@@ -232,6 +286,19 @@ public:
   Vector4 GetStrokeColor() const;
 
   /**
+   * @brief Set the gradient to use for stroking the path.
+   * @param[in] gradient The gradient object.
+   * @return Returns True when it's successful. False otherwise.
+   */
+  bool SetStrokeGradient(CanvasRenderer::Gradient& gradient);
+
+  /**
+   * @brief Get the gradient to use for stroking the path.
+   * @return Returns The gradient object.
+   */
+  CanvasRenderer::Gradient GetStrokeGradient() const;
+
+  /**
    * @brief Sets the stroke dash pattern. The dash pattern is specified dash pattern.
    * @param[in] dashPattern Lenght and a gap list.
    * @return Returns True when it's successful. False otherwise.