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