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
{
*
* @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.
float GetDepthIndex() const;
/**
- * @brief Visual needs to know when the control is put on to the stage to add the renderer.
- *
- * This function should be called when the control is put on to the stage.
- *
- * @param[in] actor The actor using this visual.
- * @post SetOffStage should be called with the same actor when the control is put off stage otherwise memory will be leaked
- */
- void SetOnStage( Actor& actor );
-
- /**
- * @brief Visual needs to know when the control is removed from the stage to remove the renderer.
- *
- * This function should be called when the control is removed from the stage
- *
- * @param[in] actor The actor using this visual.
- */
- void SetOffStage( Actor& actor );
-
- /**
* @brief Remove the renderer from the actor and reset the visual self.
*
* This function can be called with an empty handle. If the visual is empty, this is a no-op.