(Programming Guide) Updated Custom Control Creation section
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / visual-factory / visual-base.h
index 2cbb0b7..49e8cf0 100644 (file)
@@ -38,11 +38,47 @@ class Base;
 namespace Visual
 {
 /**
- * @brief Visual provides a renderer for rendering the controls. A control may have multiple visuals.
+ * @brief A Visual provides a renderer for drawing a control component. A control may have multiple visuals.
  *
- * Visuals reuses geometry, shader etc. across controls and manages the renderer and texture sets to exist only when control is on-stage.
- * It also responds to actor size and color change, and provides the clipping at the renderer level.
+ * Visuals reuse geometry, shader etc. across controls. They ensure that the renderer and texture sets exist only when control is on-stage.
+ * Each visual also responds to actor size and color change, and provides clipping at the renderer level.
  * Note: The visual responds to the the Actor::COLOR by blending it with the 'Multiply' operator.
+ *
+ * The following properties are optional, but can be supplied in the property map to Dali::Toolkit::VisualFactory::CreateVisual().
+ *
+ * | %Property Name          | Type             |
+ * |-------------------------|------------------|
+ * | customShader            | MAP              |
+ * | transform               | MAP              |
+ *
+ * where \b customShader is a map with at least one of the following properties:
+ * | %Property Name          | Type             | Required | Default | Description |
+ * |-------------------------|------------------|----------|---------|-------------|
+ * | vertexShader            | STRING           | No | "" | Vertex shader code|
+ * | fragmentShader          | STRING           | No | "" | Fragment shader code|
+ * | subdivideGridX          | INTEGER          | No | 1 | How to subdivide the grid along X |
+ * | subdivideGridY          | INTEGER          | No | 1 | How to subdivide the grid along Y |
+ * | shaderHints             | INTEGER or ARRAY of STRING | No | NONE | Bitmask of hints @sa Dali::Shader::Hint |
+ *
+ * and \b transform is a map with the following properties:
+ * | %Property Name          | Type             | Required | Default |Description |
+ * |-------------------------|------------------|----------|---------|------------|
+ * | offset                  | VECTOR2          | No | (0,0) | Offset of visual from origin |
+ * | size                    | VECTOR2          | No | (1,1) | size of visual |
+ * | origin                  | INTEGER or STRING | No | CENTER | origin of the visual @sa Dali::Toolkit::Align |
+ * | anchorPoint             | INTEGER or STRING | No | CENTER | anchor point of the visual @sa Dali::Toolkit::Align |
+ * | offsetSizeMode          | VECTOR4          | No | (0,0,0,0) | See below |
+ *
+ *
+ * offsetSizeMode describes whether the offset and the size are
+ * relative or absolute by using 0 or 1 respectively in the corresponding
+ * components (offsetSizeMode.xy for offset.xy; offsetSizeMode.zw for size.xy).
+ *
+ * Relative means that the component describes a factor of the parent control size;
+ * size.x = 1 means full width; size.y = 0.5 means half height.
+ *
+ * Absolute means that the component describes world units (equivalent to pixels)
+ *
  */
 class DALI_IMPORT_API Base : public BaseHandle
 {
@@ -121,7 +157,7 @@ public:
    *
    * @param[out] naturalSize The visual's natural size
    */
-  void GetNaturalSize( Vector2& naturalSize ) const;
+  void GetNaturalSize( Vector2& naturalSize );
 
   /**
    * @brief Set the depth index of this visual.