2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/public-api/object/property-types.h>
21 namespace Dali DALI_EXPORT_API
24 namespace PropertyTypes
27 static const char* PROPERTY_TYPE_NAMES[Property::TYPE_COUNT] =
46 const char* GetName(Property::Type type)
48 if (type < Property::TYPE_COUNT)
50 return PROPERTY_TYPE_NAMES[type];
53 return PROPERTY_TYPE_NAMES[Property::NONE];
56 template <typename T> Property::Type Get() { return Property::NONE; }
57 template <> Property::Type Get<bool>() { return Property::BOOLEAN; }
58 template <> Property::Type Get<float>() { return Property::FLOAT; }
59 template <> Property::Type Get<int>() { return Property::INTEGER; }
60 template <> Property::Type Get<unsigned int>(){ return Property::UNSIGNED_INTEGER; }
61 template <> Property::Type Get<Vector2>() { return Property::VECTOR2; }
62 template <> Property::Type Get<Vector3>() { return Property::VECTOR3; }
63 template <> Property::Type Get<Vector4>() { return Property::VECTOR4; }
64 template <> Property::Type Get<Matrix3>() { return Property::MATRIX3; }
65 template <> Property::Type Get<Matrix>() { return Property::MATRIX; }
66 template <> Property::Type Get<AngleAxis>() { return Property::ROTATION; } // Rotation has two representations
67 template <> Property::Type Get<Quaternion>() { return Property::ROTATION; } // Rotation has two representations
68 template <> Property::Type Get<std::string>(){ return Property::STRING; }
69 template <> Property::Type Get<Dali::Rect<int> >(){ return Property::RECTANGLE; }
70 template <> Property::Type Get<Property::Map>() { return Property::MAP; }
71 template <> Property::Type Get<Property::Array>() { return Property::ARRAY; }
74 }; // namespace PropertyTypes