1 #ifndef DALI_DEFAULT_PROPERTY_METADATA_H
2 #define DALI_DEFAULT_PROPERTY_METADATA_H
5 * Copyright (c) 2018 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 <string_view>
25 #include <dali/public-api/object/property.h>
30 * @addtogroup dali_core_object
35 * @brief Structure for setting up default properties and their details.
37 struct PropertyDetails
39 std::string_view name; ///< The name of the property.
40 Property::Index enumIndex; ///< Used to check the index is correct within a debug build.
41 Property::Type type; ///< The property type.
42 bool writable; ///< Whether the property is writable
43 bool animatable; ///< Whether the property is animatable.
44 bool constraintInput; ///< Whether the property can be used as an input to a constraint.
48 * Struct to capture the address of the default property table and count of them.
50 struct DefaultPropertyMetadata
52 const PropertyDetails* propertyTable; ///< address of the table defining property meta-data.
53 const Property::Index propertyCount; ///< count of the default properties.
56 inline constexpr bool CheckPropertyMetadata(const DefaultPropertyMetadata& table, Property::Index startIndex) noexcept
58 for(int i = 0; i < table.propertyCount; i++)
60 if(table.propertyTable[i].enumIndex != startIndex + i)
67 inline constexpr DefaultPropertyMetadata GeneratePropertyMetadata(const PropertyDetails (&array)[N]) noexcept
74 #endif // DALI_DEFAULT_PROPERTY_METADATA_H