X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fvisuals%2Fvisual-properties-devel.h;h=adecf3932160796f38929524f60f48cba46b8363;hp=b70d2542119fb6614b5d5a0cd694ea0ad8326085;hb=7f0a28e0f0da67178997e5a647bdc471e8dcb652;hpb=914231e0f3c8642c4ed57fc46c078ba1dd1fe97a diff --git a/dali-toolkit/devel-api/visuals/visual-properties-devel.h b/dali-toolkit/devel-api/visuals/visual-properties-devel.h index b70d254..adecf39 100644 --- a/dali-toolkit/devel-api/visuals/visual-properties-devel.h +++ b/dali-toolkit/devel-api/visuals/visual-properties-devel.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_DEVEL_API_VISUALS_VISUAL_PROPERTIES_DEVEL_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. @@ -35,15 +35,18 @@ namespace DevelVisual */ enum Type { - BORDER = Dali::Toolkit::Visual::BORDER, - COLOR = Dali::Toolkit::Visual::COLOR, - GRADIENT = Dali::Toolkit::Visual::GRADIENT, - IMAGE = Dali::Toolkit::Visual::IMAGE, - MESH = Dali::Toolkit::Visual::MESH, - PRIMITIVE = Dali::Toolkit::Visual::PRIMITIVE, - WIREFRAME = Dali::Toolkit::Visual::WIREFRAME, - - TEXT = WIREFRAME + 1, ///< Renders text. + BORDER = Dali::Toolkit::Visual::BORDER, + COLOR = Dali::Toolkit::Visual::COLOR, + GRADIENT = Dali::Toolkit::Visual::GRADIENT, + IMAGE = Dali::Toolkit::Visual::IMAGE, + MESH = Dali::Toolkit::Visual::MESH, + PRIMITIVE = Dali::Toolkit::Visual::PRIMITIVE, + WIREFRAME = Dali::Toolkit::Visual::WIREFRAME, + + TEXT = WIREFRAME + 1, ///< Renders text. + N_PATCH = WIREFRAME + 2, ///< Renders an n-patch image. + SVG = WIREFRAME + 3, ///< Renders an SVG image. + ANIMATED_IMAGE = WIREFRAME + 4 ///< Renders a animated image. }; namespace Property @@ -91,27 +94,41 @@ enum Type OPACITY = SHADER + 4 }; -} //namespace Property +} // namespace Property namespace Transform { +/** + * @brief Policies used by the transform for the offset or size. + */ +namespace Policy +{ + +enum Type +{ + RELATIVE = 0, ///< Relative to the control (percentage [0.0f to 1.0f] of the control). + ABSOLUTE = 1 ///< Absolute value in world units. +}; + +} // namespace Policy + namespace Property { enum Type { /** - * @brief Offset of the visual. It can be either relative (percentage of the parent) - * or absolute (in world units). + * @brief Offset of the visual, which can be either relative (percentage [0.0f to 1.0f] of the parent) or absolute (in world units). * @details Name "offset", type Property::VECTOR2 + * @see OFFSET_POLICY */ OFFSET, /** - * @brief Size of the visual. It can be either relative (percentage of the parent) - * or absolute (in world units). + * @brief Size of the visual, which can be either relative (percentage [0.0f to 1.0f] of the parent) or absolute (in world units). * @details Name "size", type Property::VECTOR2 + * @see SIZE_POLICY */ SIZE, @@ -130,15 +147,50 @@ enum Type ANCHOR_POINT, /** - * @brief Indicates which components of the offset and size are relative - * (percentage of the parent) or absolute (in world units). - * 0 indicates the component is relative, and 1 absolute. - * @details Name "offsetSizeMode", type Property::VECTOR4 + * @brief Whether the x or y OFFSET values are relative (percentage [0.0f to 1.0f] of the control) or absolute (in world units). + * @details Name "offsetPolicy", type Vector2 or Property::ARRAY of Property::STRING. + * If Property::ARRAY then 2 strings expected for the x and y. + * + * C++: + * @code + * control.SetProperty( ..., // Some visual based property + * Property::Map().Add( ... ) // Properties to set up visual + * .Add( DevelVisual::Property::TRANSFORM, + * Property::Array().Add( DevelVisual::Transform::Property::OFFSET_POLICY, Vector2( Policy::ABSOLUTE, Policy::RELATIVE ) ) ) + * .Add( DevelVisual::Transform::Property::OFFSET, Vector2( 10, 1.0f ) ) ); + * @endcode + * + * JSON: + * @code + * { + * ... + * "transition": + * { + * "offsetPolicy" : [ "ABSOLUTE", "RELATIVE" ], + * "offset" : [ 10, 1.0 ] + * } + * ... + * } + * + * @endcode + * @see Policy::Type + * @note By default, both the x and the y offset is RELATIVE. + */ + OFFSET_POLICY, + + /** + * @brief Whether the width or height SIZE values are relative (percentage [0.0f to 1.0f] of the control) or absolute (in world units). + * @details Name "sizePolicy", type Vector2 or Property::ARRAY of Property::STRING. + * If Property::ARRAY then 2 strings expected for the width and height. + * + * @see Policy::Type + * @see OFFSET_POLICY for example + * @note By default, both the width and the height is RELATIVE to the control's size. */ - OFFSET_SIZE_MODE + SIZE_POLICY, }; -} //namespace Property +} // namespace Property } // namespace Transform