1 #ifndef DALI_TOOLKIT_VISUAL_PROPERTIES_H
2 #define DALI_TOOLKIT_VISUAL_PROPERTIES_H
5 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali-toolkit/public-api/toolkit-property-index-ranges.h>
31 * @addtogroup dali_toolkit_visuals
36 * @brief All the visual types
43 * @brief All the visual types.
48 BORDER, ///< Renders a solid color as an internal border to the control's quad. @SINCE_1_1.45
49 COLOR, ///< Renders a solid color to the control's quad. @SINCE_1_1.45
50 GRADIENT, ///< Renders a smooth transition of colors to the control's quad. @SINCE_1_1.45
51 IMAGE, ///< Renders an image into the control's quad. @SINCE_1_1.45
52 MESH, ///< Renders a mesh using an "obj" file, optionally with textures provided by an "mtl" file. @SINCE_1_1.45
53 PRIMITIVE, ///< Renders a simple 3D shape, such as a cube or sphere. @SINCE_1_1.45
54 WIREFRAME, ///< Renders a simple wire-frame outlining a quad. @SINCE_1_2_2
55 TEXT, ///< Renders text @SINCE_1_2.60
56 N_PATCH, ///< Renders an n-patch image. @SINCE_1_2.60
57 SVG, ///< Renders an SVG image. @SINCE_1_2.60
58 ANIMATED_IMAGE, ///< Renders a animated image. @SINCE_1_2.60
62 * @brief Visual Property
69 * @brief Visual Property
75 * @brief The index for the visual type.
76 * @details Name "visualType", type [Type](@ref Dali::Toolkit::Visual::Type) (Property::INTEGER) or Property::STRING.
81 TYPE = VISUAL_PROPERTY_BASE_START_INDEX,
84 * @brief The shader to use in the visual.
85 * @details Name "shader", type Property::MAP.
88 * @note Will override the existing shaders.
89 * @see Shader::Property
94 * @brief The transform used by the visual.
95 * @details Name "transform", type Property::MAP.
98 * @see DevelVisual::Transform::Property
103 * @brief Enables/disables premultiplied alpha.
104 * @details Name "premultipliedAlpha", type Property::BOOLEAN.
107 * @note The premultiplied alpha is false by default unless this behaviour is modified
108 * by the derived Visual type.
113 * @brief Mix color is a blend color for any visual.
114 * @details Name "mixColor", type Property::VECTOR3 or Property::VECTOR4.
121 * @brief Opacity is the alpha component of the mixColor, above.
122 * @details Name "opacity", type Property::FLOAT.
129 } // namespace Property
135 * @brief Policies used by the transform for the offset or size.
144 RELATIVE = 0, ///< Relative to the control (percentage [0.0f to 1.0f] of the control).
145 ABSOLUTE = 1 ///< Absolute value in world units.
148 } // namespace Policy
156 * @brief Offset of the visual, which can be either relative (percentage [0.0f to 1.0f] of the parent) or absolute (in world units).
157 * @details Name "offset", type Property::VECTOR2.
165 * @brief Size of the visual, which can be either relative (percentage [0.0f to 1.0f] of the parent) or absolute (in world units).
166 * @details Name "size", type Property::VECTOR2.
172 * @brief The origin of the visual within its control area.
173 * @details Name "origin", type Align::Type (Property::INTEGER) or Property::STRING.
174 * @see Toolkit::Align
176 * @note The default is Align::TOP_BEGIN.
181 * @brief The anchor-point of the visual
182 * @details Name "anchorPoint", type Align::Type (Property::INTEGER) or Property::STRING.
183 * @see Toolkit::Align
185 * @note The default is Align::TOP_BEGIN.
190 * @brief Whether the x or y OFFSET values are relative (percentage [0.0f to 1.0f] of the control) or absolute (in world units).
191 * @details Name "offsetPolicy", type Vector2 or Property::ARRAY of Property::STRING.
192 * If Property::ARRAY then 2 strings expected for the x and y.
196 * control.SetProperty( ..., // Some visual based property
197 * Property::Map().Add( ... ) // Properties to set up visual
198 * .Add( Visual::Property::TRANSFORM,
199 * Property::Array().Add( DevelVisual::Transform::Property::OFFSET_POLICY, Vector2( Policy::ABSOLUTE, Policy::RELATIVE ) ) )
200 * .Add( DevelVisual::Transform::Property::OFFSET, Vector2( 10, 1.0f ) ) );
209 * "offsetPolicy" : [ "ABSOLUTE", "RELATIVE" ],
210 * "offset" : [ 10, 1.0 ]
218 * @note By default, both the x and the y offset is RELATIVE.
223 * @brief Whether the width or height SIZE values are relative (percentage [0.0f to 1.0f] of the control) or absolute (in world units).
224 * @details Name "sizePolicy", type Vector2 or Property::ARRAY of Property::STRING.
225 * If Property::ARRAY then 2 strings expected for the width and height.
228 * @see OFFSET_POLICY for example
230 * @note By default, both the width and the height is RELATIVE to the control's size.
235 } // namespace Property
237 } // namespace Transform
240 * @brief Shader for Visuals
247 * @brief Shader Property
254 * @brief The type of Shader
260 * @brief The vertex shader.
261 * @details Name "vertexShader", type Property::STRING or Property::ARRAY of Property::STRING.
262 * A Property::ARRAY of Property::STRING values can be used to split the shader string over multiple lines.
265 * @note If not supplied, the visual's already set vertex shader is used.
270 * @brief The fragment shader.
271 * @details Name "fragmentShader", type Property::STRING or Property::ARRAY of Property::STRING.
272 * A Property::ARRAY of Property::STRING values can be used to split the shader string over multiple lines.
275 * @note If not supplied, the visual's already set fragment shader is used.
280 * @brief How to subdivide the grid along the X-Axis.
281 * @details Name "subdivideGridX", type Property::INTEGER.
284 * @note If not supplied, the default is 1.
285 * @note Value should be greater than or equal to 1.
290 * @brief How to subdivide the grid along the Y-Axis.
291 * @details Name "subdivideGridY", type Property::INTEGER.
294 * @note If not supplied, the default is 1.
295 * @note Value should be greater than or equal to 1.
300 * @brief Hints for rendering.
301 * @details Name "hints", type Dali::Shader::Hint (Property::INTEGER), Property::STRING or Property::ARRAY of Property::STRING.
304 * @note If not supplied, the default is Dali::Shader::Hint::NONE.
309 } // namespace Property
311 } // namespace Shader
313 } // namespace Visual
319 } // namespace Toolkit
323 #endif // DALI_TOOLKIT_VISUAL_PROPERTIES_H