Merge "Updated test harness code to enable styling through links." into tizen
[platform/core/uifw/dali-core.git] / dali / public-api / actors / layer.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/actors/layer.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/event/actors/layer-impl.h>
23 #include <dali/internal/event/images/frame-buffer-image-impl.h>
24
25 namespace Dali
26 {
27
28 using Dali::Layer;
29
30 const char* const Layer::ACTION_RAISE = "raise";
31 const char* const Layer::ACTION_LOWER = "lower";
32 const char* const Layer::ACTION_RAISE_TO_TOP = "raise-to-top";
33 const char* const Layer::ACTION_LOWER_TO_BOTTOM = "lower-to-bottom";
34
35
36 Layer::Layer()
37 {
38 }
39
40 Layer Layer::New()
41 {
42   Internal::LayerPtr internal = Internal::Layer::New();
43
44   return Layer(internal.Get());
45 }
46
47 Layer Layer::DownCast( BaseHandle handle )
48 {
49   return Layer( dynamic_cast<Dali::Internal::Layer*>(handle.GetObjectPtr()) );
50 }
51
52 Layer::~Layer()
53 {
54 }
55
56 Layer::Layer(const Layer& copy)
57 : Actor(copy)
58 {
59 }
60
61 Layer& Layer::operator=(const Layer& rhs)
62 {
63   BaseHandle::operator=(rhs);
64   return *this;
65 }
66
67 unsigned int Layer::GetDepth() const
68 {
69   return GetImplementation(*this).GetDepth();
70 }
71
72 void Layer::Raise()
73 {
74   GetImplementation(*this).Raise();
75 }
76
77 void Layer::Lower()
78 {
79   GetImplementation(*this).Lower();
80 }
81
82 void Layer::RaiseAbove( Layer target )
83 {
84   GetImplementation(*this).RaiseAbove( GetImplementation( target ) );
85 }
86
87 void Layer::LowerBelow( Layer target )
88 {
89   GetImplementation(*this).LowerBelow( GetImplementation( target ) );
90 }
91
92 void Layer::RaiseToTop()
93 {
94   GetImplementation(*this).RaiseToTop();
95 }
96
97 void Layer::LowerToBottom()
98 {
99   GetImplementation(*this).LowerToBottom();
100 }
101
102 void Layer::MoveAbove( Layer target )
103 {
104   GetImplementation(*this).MoveAbove( GetImplementation( target ) );
105 }
106
107 void Layer::MoveBelow( Layer target )
108 {
109   GetImplementation(*this).MoveBelow( GetImplementation( target ) );
110 }
111
112 void Layer::SetClipping(bool enabled)
113 {
114   GetImplementation(*this).SetClipping(enabled);
115 }
116
117 bool Layer::IsClipping() const
118 {
119   return GetImplementation(*this).IsClipping();
120 }
121
122 void Layer::SetClippingBox(int x, int y, int width, int height)
123 {
124   GetImplementation(*this).SetClippingBox(x, y, width, height);
125 }
126
127 void Layer::SetClippingBox(ClippingBox box)
128 {
129   GetImplementation(*this).SetClippingBox(box.x, box.y, box.width, box.height);
130 }
131
132 ClippingBox Layer::GetClippingBox() const
133 {
134   return GetImplementation(*this).GetClippingBox();
135 }
136
137 void Layer::SetDepthTestDisabled( bool disable )
138 {
139   GetImplementation(*this).SetDepthTestDisabled( disable );
140 }
141
142 bool Layer::IsDepthTestDisabled() const
143 {
144   return GetImplementation(*this).IsDepthTestDisabled();
145 }
146
147 float Layer::ZValue(const Vector3& position, float sortModifier)
148 {
149   return Internal::Layer::ZValue( position, sortModifier );
150 }
151
152 void Layer::SetSortFunction(SortFunctionType function)
153 {
154   GetImplementation(*this).SetSortFunction(function);
155 }
156
157 void Layer::SetTouchConsumed( bool consume )
158 {
159   GetImplementation( *this ).SetTouchConsumed( consume );
160 }
161
162 bool Layer::IsTouchConsumed() const
163 {
164   return GetImplementation( *this ).IsTouchConsumed();
165 }
166
167 void Layer::SetHoverConsumed( bool consume )
168 {
169   GetImplementation( *this ).SetHoverConsumed( consume );
170 }
171
172 bool Layer::IsHoverConsumed() const
173 {
174   return GetImplementation( *this ).IsHoverConsumed();
175 }
176
177 Layer::Layer(Internal::Layer* internal)
178 : Actor(internal)
179 {
180 }
181
182 } // namespace Dali
183