1 #ifndef DALI_TOOLKIT_VISUAL_PROPERTIES_H
2 #define DALI_TOOLKIT_VISUAL_PROPERTIES_H
5 * Copyright (c) 2020 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>
29 * @addtogroup dali_toolkit_visuals
34 * @brief All the visual types.
40 * @brief All the visual types.
45 BORDER, ///< Renders a solid color as an internal border to the control's quad. @SINCE_1_1.45
46 COLOR, ///< Renders a solid color to the control's quad. @SINCE_1_1.45
47 GRADIENT, ///< Renders a smooth transition of colors to the control's quad. @SINCE_1_1.45
48 IMAGE, ///< Renders an image into the control's quad. @SINCE_1_1.45
49 MESH, ///< Renders a mesh using an "obj" file, optionally with textures provided by an "mtl" file. @SINCE_1_1.45
50 PRIMITIVE, ///< Renders a simple 3D shape, such as a cube or sphere. @SINCE_1_1.45
51 WIREFRAME, ///< Renders a simple wire-frame outlining a quad. @SINCE_1_2_2
52 TEXT, ///< Renders text @SINCE_1_2.60
53 N_PATCH, ///< Renders an n-patch image. @SINCE_1_2.60
54 SVG, ///< Renders an SVG image. @SINCE_1_2.60
55 ANIMATED_IMAGE, ///< Renders a animated image. @SINCE_1_2.60
59 * @brief Visual Property.
65 * @brief Enumeration for the instance of properties belonging to the Visual Property.
71 * @brief The index for the visual type.
72 * @details Name "visualType", type [Type](Dali::Toolkit::Visual::Type) (Property::INTEGER) or Property::STRING.
77 TYPE = VISUAL_PROPERTY_BASE_START_INDEX,
80 * @brief The shader to use in the visual.
81 * @details Name "shader", type Property::MAP.
84 * @note Will override the existing shaders.
85 * @see Shader::Property
90 * @brief The transform used by the visual.
91 * @details Name "transform", type Property::MAP.
94 * @see Toolkit::Visual::Transform::Property
99 * @brief Enables/disables premultiplied alpha.
100 * @details Name "premultipliedAlpha", type Property::BOOLEAN.
103 * @note The premultiplied alpha is false by default unless this behaviour is modified
104 * by the derived Visual type.
109 * @brief Mix color is a blend color for any visual.
110 * @details Name "mixColor", type Property::VECTOR3 or Property::VECTOR4, animatable
113 * @note To animate an opacity, OPACITY property should be used.
118 * @brief Opacity is the alpha component of the mixColor, above.
119 * @details Name "opacity", type Property::FLOAT, animatable
126 } // namespace Property
129 * @brief Visual Transform for the offset or size.
135 * @brief Policies used by the transform for the offset or size.
141 * @brief Enumeration for the type of Transform Policy.
146 RELATIVE = 0, ///< Relative to the control (percentage [0.0f to 1.0f] of the control). @SINCE_1_2.60
147 ABSOLUTE = 1 ///< Absolute value in world units. @SINCE_1_2.60
150 } // namespace Policy
153 * @brief Visual Transform Property.
159 * @brief Enumeration for the type of Transform Property.
165 * @brief Offset 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 "offset", type Property::VECTOR2, animatable.
174 * @brief Size of the visual, which can be either relative (percentage [0.0f to 1.0f] of the parent) or absolute (in world units).
175 * @details Name "size", type Property::VECTOR2, animatable.
181 * @brief The origin of the visual within its control area.
182 * @details Name "origin", type Align::Type (Property::INTEGER) or Property::STRING.
183 * @see Toolkit::Align
185 * @note The default is Align::TOP_BEGIN.
190 * @brief The anchor-point of the visual
191 * @details Name "anchorPoint", type Align::Type (Property::INTEGER) or Property::STRING.
192 * @see Toolkit::Align
194 * @note The default is Align::TOP_BEGIN.
199 * @brief Whether the x or y OFFSET values are relative (percentage [0.0f to 1.0f] of the control) or absolute (in world units).
200 * @details Name "offsetPolicy", type Vector2 or Property::ARRAY of Property::STRING.
201 * If Property::ARRAY then 2 strings expected for the x and y.
205 * control.SetProperty( ..., // Some visual based property
206 * Property::Map().Add( ... ) // Properties to set up visual
207 * .Add( Visual::Property::TRANSFORM,
208 * Property::Array().Add( Toolkit::Visual::Transform::Property::OFFSET_POLICY, Vector2( Policy::ABSOLUTE, Policy::RELATIVE ) ) )
209 * .Add( Toolkit::Visual::Transform::Property::OFFSET, Vector2( 10, 1.0f ) ) );
218 * "offsetPolicy" : [ "ABSOLUTE", "RELATIVE" ],
219 * "offset" : [ 10, 1.0 ]
227 * @note By default, both the x and the y offset is RELATIVE.
232 * @brief Whether the width or height SIZE values are relative (percentage [0.0f to 1.0f] of the control) or absolute (in world units).
233 * @details Name "sizePolicy", type Vector2 or Property::ARRAY of Property::STRING.
234 * If Property::ARRAY then 2 strings expected for the width and height.
237 * @see OFFSET_POLICY for example
239 * @note By default, both the width and the height is RELATIVE to the control's size.
244 } // namespace Property
246 } // namespace Transform
249 * @brief Shader for Visuals.
255 * @brief Shader Property.
261 * @brief The type of Shader.
267 * @brief The vertex shader.
268 * @details Name "vertexShader", type Property::STRING or Property::ARRAY of Property::STRING.
269 * A Property::ARRAY of Property::STRING values can be used to split the shader string over multiple lines.
272 * @note If not supplied, the visual's already set vertex shader is used.
277 * @brief The fragment shader.
278 * @details Name "fragmentShader", type Property::STRING or Property::ARRAY of Property::STRING.
279 * A Property::ARRAY of Property::STRING values can be used to split the shader string over multiple lines.
282 * @note If not supplied, the visual's already set fragment shader is used.
287 * @brief How to subdivide the grid along the X-Axis.
288 * @details Name "subdivideGridX", type Property::INTEGER.
291 * @note If not supplied, the default is 1.
292 * @note Value should be greater than or equal to 1.
297 * @brief How to subdivide the grid along the Y-Axis.
298 * @details Name "subdivideGridY", type Property::INTEGER.
301 * @note If not supplied, the default is 1.
302 * @note Value should be greater than or equal to 1.
307 * @brief Hints for rendering.
308 * @details Name "hints", type Dali::Shader::Hint (Property::INTEGER), Property::STRING or Property::ARRAY of Property::STRING.
311 * @note If not supplied, the default is Dali::Shader::Hint::NONE.
316 } // namespace Property
318 } // namespace Shader
321 * @brief Status of resource which is used for visual.
324 enum class ResourceStatus
326 PREPARING, /// Resource is prepared. @SINCE_1_3_5
327 READY, /// Resource is ready. @SINCE_1_3_5
328 FAILED /// Resource is fail to load @SINCE_1_3_5
331 } // namespace Visual
337 } // namespace Toolkit
341 #endif // DALI_TOOLKIT_VISUAL_PROPERTIES_H