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/actors/layer.h>
22 #include <dali/internal/event/actors/layer-impl.h>
23 #include <dali/internal/event/images/frame-buffer-image-impl.h>
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";
42 Internal::LayerPtr internal = Internal::Layer::New();
44 return Layer(internal.Get());
47 Layer Layer::DownCast( BaseHandle handle )
49 return Layer( dynamic_cast<Dali::Internal::Layer*>(handle.GetObjectPtr()) );
56 Layer::Layer(const Layer& copy)
61 Layer& Layer::operator=(const Layer& rhs)
63 BaseHandle::operator=(rhs);
67 unsigned int Layer::GetDepth() const
69 return GetImplementation(*this).GetDepth();
74 GetImplementation(*this).Raise();
79 GetImplementation(*this).Lower();
82 void Layer::RaiseAbove( Layer target )
84 GetImplementation(*this).RaiseAbove( GetImplementation( target ) );
87 void Layer::LowerBelow( Layer target )
89 GetImplementation(*this).LowerBelow( GetImplementation( target ) );
92 void Layer::RaiseToTop()
94 GetImplementation(*this).RaiseToTop();
97 void Layer::LowerToBottom()
99 GetImplementation(*this).LowerToBottom();
102 void Layer::MoveAbove( Layer target )
104 GetImplementation(*this).MoveAbove( GetImplementation( target ) );
107 void Layer::MoveBelow( Layer target )
109 GetImplementation(*this).MoveBelow( GetImplementation( target ) );
112 void Layer::SetClipping(bool enabled)
114 GetImplementation(*this).SetClipping(enabled);
117 bool Layer::IsClipping() const
119 return GetImplementation(*this).IsClipping();
122 void Layer::SetClippingBox(int x, int y, int width, int height)
124 GetImplementation(*this).SetClippingBox(x, y, width, height);
127 void Layer::SetClippingBox(ClippingBox box)
129 GetImplementation(*this).SetClippingBox(box.x, box.y, box.width, box.height);
132 ClippingBox Layer::GetClippingBox() const
134 return GetImplementation(*this).GetClippingBox();
137 void Layer::SetDepthTestDisabled( bool disable )
139 GetImplementation(*this).SetDepthTestDisabled( disable );
142 bool Layer::IsDepthTestDisabled() const
144 return GetImplementation(*this).IsDepthTestDisabled();
147 float Layer::ZValue(const Vector3& position, float sortModifier)
149 return Internal::Layer::ZValue( position, sortModifier );
152 void Layer::SetSortFunction(SortFunctionType function)
154 GetImplementation(*this).SetSortFunction(function);
157 void Layer::SetTouchConsumed( bool consume )
159 GetImplementation( *this ).SetTouchConsumed( consume );
162 bool Layer::IsTouchConsumed() const
164 return GetImplementation( *this ).IsTouchConsumed();
167 void Layer::SetHoverConsumed( bool consume )
169 GetImplementation( *this ).SetHoverConsumed( consume );
172 bool Layer::IsHoverConsumed() const
174 return GetImplementation( *this ).IsHoverConsumed();
177 Layer::Layer(Internal::Layer* internal)