Revert "License conversion from Flora to Apache 2.0"
[platform/core/uifw/dali-core.git] / dali / public-api / common / constants.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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
7 //
8 //     http://floralicense.org/license/
9 //
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.
15 //
16
17 // CLASS HEADER
18 #include <dali/public-api/common/constants.h>
19
20 // INTERNAL INCLUDES
21 #include <dali/public-api/math/compile-time-math.h>
22 #include <dali/public-api/math/degree.h>
23
24 namespace Dali
25 {
26
27 const float ParentOrigin::TOP     = 0.0f;
28 const float ParentOrigin::BOTTOM  = 1.0f;
29 const float ParentOrigin::LEFT    = 0.0f;
30 const float ParentOrigin::RIGHT   = 1.0f;
31 const float ParentOrigin::MIDDLE  = 0.5f;
32
33 const Vector3 ParentOrigin::BACK_TOP_LEFT     (0.0f, 0.0f, 0.0f);
34 const Vector3 ParentOrigin::BACK_TOP_CENTER   (0.5f, 0.0f, 0.0f);
35 const Vector3 ParentOrigin::BACK_TOP_RIGHT    (1.0f, 0.0f, 0.0f);
36 const Vector3 ParentOrigin::BACK_CENTER_LEFT  (0.0f, 0.5f, 0.0f);
37 const Vector3 ParentOrigin::BACK_CENTER       (0.5f, 0.5f, 0.0f);
38 const Vector3 ParentOrigin::BACK_CENTER_RIGHT (1.0f, 0.5f, 0.0f);
39 const Vector3 ParentOrigin::BACK_BOTTOM_LEFT  (0.0f, 1.0f, 0.0f);
40 const Vector3 ParentOrigin::BACK_BOTTOM_CENTER(0.5f, 1.0f, 0.0f);
41 const Vector3 ParentOrigin::BACK_BOTTOM_RIGHT (1.0f, 1.0f, 0.0f);
42
43 const Vector3 ParentOrigin::TOP_LEFT     (0.0f, 0.0f, 0.5f);
44 const Vector3 ParentOrigin::TOP_CENTER   (0.5f, 0.0f, 0.5f);
45 const Vector3 ParentOrigin::TOP_RIGHT    (1.0f, 0.0f, 0.5f);
46 const Vector3 ParentOrigin::CENTER_LEFT  (0.0f, 0.5f, 0.5f);
47 const Vector3 ParentOrigin::CENTER       (0.5f, 0.5f, 0.5f);
48 const Vector3 ParentOrigin::CENTER_RIGHT (1.0f, 0.5f, 0.5f);
49 const Vector3 ParentOrigin::BOTTOM_LEFT  (0.0f, 1.0f, 0.5f);
50 const Vector3 ParentOrigin::BOTTOM_CENTER(0.5f, 1.0f, 0.5f);
51 const Vector3 ParentOrigin::BOTTOM_RIGHT (1.0f, 1.0f, 0.5f);
52
53 const Vector3 ParentOrigin::FRONT_TOP_LEFT     (0.0f, 0.0f, 1.0f);
54 const Vector3 ParentOrigin::FRONT_TOP_CENTER   (0.5f, 0.0f, 1.0f);
55 const Vector3 ParentOrigin::FRONT_TOP_RIGHT    (1.0f, 0.0f, 1.0f);
56 const Vector3 ParentOrigin::FRONT_CENTER_LEFT  (0.0f, 0.5f, 1.0f);
57 const Vector3 ParentOrigin::FRONT_CENTER       (0.5f, 0.5f, 1.0f);
58 const Vector3 ParentOrigin::FRONT_CENTER_RIGHT (1.0f, 0.5f, 1.0f);
59 const Vector3 ParentOrigin::FRONT_BOTTOM_LEFT  (0.0f, 1.0f, 1.0f);
60 const Vector3 ParentOrigin::FRONT_BOTTOM_CENTER(0.5f, 1.0f, 1.0f);
61 const Vector3 ParentOrigin::FRONT_BOTTOM_RIGHT (1.0f, 1.0f, 1.0f);
62
63 const Vector3 ParentOrigin::DEFAULT( ParentOrigin::TOP_LEFT );
64
65 const float AnchorPoint::TOP     = 0.0f;
66 const float AnchorPoint::BOTTOM  = 1.0f;
67 const float AnchorPoint::LEFT    = 0.0f;
68 const float AnchorPoint::RIGHT   = 1.0f;
69 const float AnchorPoint::MIDDLE  = 0.5f;
70
71 const Vector3 AnchorPoint::BACK_TOP_LEFT     (0.0f, 0.0f, 0.0f);
72 const Vector3 AnchorPoint::BACK_TOP_CENTER   (0.5f, 0.0f, 0.0f);
73 const Vector3 AnchorPoint::BACK_TOP_RIGHT    (1.0f, 0.0f, 0.0f);
74 const Vector3 AnchorPoint::BACK_CENTER_LEFT  (0.0f, 0.5f, 0.0f);
75 const Vector3 AnchorPoint::BACK_CENTER       (0.5f, 0.5f, 0.0f);
76 const Vector3 AnchorPoint::BACK_CENTER_RIGHT (1.0f, 0.5f, 0.0f);
77 const Vector3 AnchorPoint::BACK_BOTTOM_LEFT  (0.0f, 1.0f, 0.0f);
78 const Vector3 AnchorPoint::BACK_BOTTOM_CENTER(0.5f, 1.0f, 0.0f);
79 const Vector3 AnchorPoint::BACK_BOTTOM_RIGHT (1.0f, 1.0f, 0.0f);
80
81 const Vector3 AnchorPoint::TOP_LEFT     (0.0f, 0.0f, 0.5f);
82 const Vector3 AnchorPoint::TOP_CENTER   (0.5f, 0.0f, 0.5f);
83 const Vector3 AnchorPoint::TOP_RIGHT    (1.0f, 0.0f, 0.5f);
84 const Vector3 AnchorPoint::CENTER_LEFT  (0.0f, 0.5f, 0.5f);
85 const Vector3 AnchorPoint::CENTER       (0.5f, 0.5f, 0.5f);
86 const Vector3 AnchorPoint::CENTER_RIGHT (1.0f, 0.5f, 0.5f);
87 const Vector3 AnchorPoint::BOTTOM_LEFT  (0.0f, 1.0f, 0.5f);
88 const Vector3 AnchorPoint::BOTTOM_CENTER(0.5f, 1.0f, 0.5f);
89 const Vector3 AnchorPoint::BOTTOM_RIGHT (1.0f, 1.0f, 0.5f);
90
91 const Vector3 AnchorPoint::FRONT_TOP_LEFT     (0.0f, 0.0f, 1.0f);
92 const Vector3 AnchorPoint::FRONT_TOP_CENTER   (0.5f, 0.0f, 1.0f);
93 const Vector3 AnchorPoint::FRONT_TOP_RIGHT    (1.0f, 0.0f, 1.0f);
94 const Vector3 AnchorPoint::FRONT_CENTER_LEFT  (0.0f, 0.5f, 1.0f);
95 const Vector3 AnchorPoint::FRONT_CENTER       (0.5f, 0.5f, 1.0f);
96 const Vector3 AnchorPoint::FRONT_CENTER_RIGHT (1.0f, 0.5f, 1.0f);
97 const Vector3 AnchorPoint::FRONT_BOTTOM_LEFT  (0.0f, 1.0f, 1.0f);
98 const Vector3 AnchorPoint::FRONT_BOTTOM_CENTER(0.5f, 1.0f, 1.0f);
99 const Vector3 AnchorPoint::FRONT_BOTTOM_RIGHT (1.0f, 1.0f, 1.0f);
100
101 const Vector3 AnchorPoint::DEFAULT( AnchorPoint::CENTER );
102
103 const Vector4 Color::BLACK( 0.0f, 0.0f, 0.0f, 1.0f );
104 const Vector4 Color::WHITE( 1.0f, 1.0f, 1.0f, 1.0f );
105
106 const Vector4 Color::RED(   1.0f, 0.0f, 0.0f, 1.0f );
107 const Vector4 Color::GREEN( 0.0f, 1.0f, 0.0f, 1.0f );
108 const Vector4 Color::BLUE(  0.0f, 0.0f, 1.0f, 1.0f );
109
110 const Vector4 Color::YELLOW(  1.0f, 1.0f, 0.0f, 1.0f );
111 const Vector4 Color::MAGENTA( 1.0f, 0.0f, 1.0f, 1.0f );
112 const Vector4 Color::CYAN(    0.0f, 1.0f, 1.0f, 1.0f );
113
114 const Vector4 Color::TRANSPARENT( 0.0f, 0.0f, 0.0f, 0.0f );
115
116 // epsilon constants
117 const float Math::MACHINE_EPSILON_0     = Epsilon<0>::value;
118 const float Math::MACHINE_EPSILON_1     = Epsilon<1>::value;
119 const float Math::MACHINE_EPSILON_10    = Epsilon<10>::value;
120 const float Math::MACHINE_EPSILON_100   = Epsilon<100>::value;
121 const float Math::MACHINE_EPSILON_1000  = Epsilon<1000>::value;
122 const float Math::MACHINE_EPSILON_10000 = Epsilon<10000>::value;
123
124 const std::string String::EMPTY("");
125
126 } // namespace Dali