X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fvisual-factory%2Fvisual-base.h;h=4e2e0f529a4af4c0a55f2c0aaad02240a4ad09e6;hp=41962766f716649c4ca02fe8628a1b8bfbbe0e8f;hb=7f0a28e0f0da67178997e5a647bdc471e8dcb652;hpb=af10e25bb20325d256ba5aa00aae248cbf7c5baa diff --git a/dali-toolkit/devel-api/visual-factory/visual-base.h b/dali-toolkit/devel-api/visual-factory/visual-base.h index 4196276..4e2e0f5 100644 --- a/dali-toolkit/devel-api/visual-factory/visual-base.h +++ b/dali-toolkit/devel-api/visual-factory/visual-base.h @@ -1,7 +1,7 @@ #ifndef DALI_TOOLKIT_VISUAL_BASE_H #define DALI_TOOLKIT_VISUAL_BASE_H /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -52,27 +52,23 @@ namespace Visual * | 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 | + * | %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). + * | %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 | + * | offsetPolicy | VECTOR2 | No | ( RELATIVE, RELATIVE ) | @sa Dali::Toolkit::DevelVisual::Transform::Policy | + * | sizePolicy | VECTOR2 | No | ( RELATIVE, RELATIVE ) | @sa Dali::Toolkit::DevelVisual::Transform::Policy | * * 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. @@ -128,32 +124,39 @@ public: const std::string& GetName(); /** - * @brief Set the size of the painting area. + * @brief Sets the transform and the control size * - * @param[in] size The size of the painting area. + * @param[in] transform A property map describing the transform + * @param[in] controlSize The size of the parent control for visuals that need to scale internally. */ - void SetSize( const Vector2& size ); + void SetTransformAndSize( const Dali::Property::Map& transform, Size controlSize ); /** - * @brief Get the size of the painting area. + * @brief Returns the height for a given width. * - * @return The size of the visual's painting area. + * @param[in] width Width to use. + * + * @return The height based on the width. */ - const Vector2& GetSize() const; + float GetHeightForWidth( float width ); /** - * @brief Returns the height for a given width. + * @brief Returns the width for a given height. * - * @param[in] width Width to use. + * @param[in] height Height to use. * - * @return The height based on the width. + * @return The width based on the height. */ - float GetHeightForWidth( float width ) const; + float GetWidthForHeight( float height ); /** * @brief Return the natural size of the visual. * - * Deriving classes stipulate the natural size and by default a visual has a ZERO natural size. + * Deriving classes stipulate the natural size and by default a + * visual has a ZERO natural size. + * + * @note A visual may not actually have a natural size until it has + * been placed on stage and acquired all it's resources. * * @param[out] naturalSize The visual's natural size */ @@ -177,38 +180,12 @@ public: float GetDepthIndex() const; /** - * @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. - * - * @param[in] actor The actor to be set off stage. - */ - void RemoveAndReset( Actor& actor ); - - /** * @brief Create the property map representing this visual. * * @param[out] map The visual property map. */ void CreatePropertyMap( Dali::Property::Map& map ) const; - /** - * @brief Sets the value of an existing property. - * - * @param [in] index The index of the property. - * @param [in] propertyValue The new value of the property. - */ - void SetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); - - /** - * @brief Retrieves a property value. - * - * @param [in] index The index of the property. - * - * @return The property value. - */ - Dali::Property::Value GetProperty( Dali::Property::Index index ); - public: // Not intended for application developers explicit DALI_INTERNAL Base(Internal::Visual::Base *impl);