2 * Copyright (c) 2015 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>
36 Internal::LayerPtr internal = Internal::Layer::New();
38 return Layer(internal.Get());
41 Layer Layer::DownCast( BaseHandle handle )
43 return Layer( dynamic_cast<Dali::Internal::Layer*>(handle.GetObjectPtr()) );
50 Layer::Layer(const Layer& copy)
55 Layer& Layer::operator=(const Layer& rhs)
57 BaseHandle::operator=(rhs);
61 unsigned int Layer::GetDepth() const
63 return GetImplementation(*this).GetDepth();
68 GetImplementation(*this).Raise();
73 GetImplementation(*this).Lower();
76 void Layer::RaiseAbove( Layer target )
78 GetImplementation(*this).RaiseAbove( GetImplementation( target ) );
81 void Layer::LowerBelow( Layer target )
83 GetImplementation(*this).LowerBelow( GetImplementation( target ) );
86 void Layer::RaiseToTop()
88 GetImplementation(*this).RaiseToTop();
91 void Layer::LowerToBottom()
93 GetImplementation(*this).LowerToBottom();
96 void Layer::MoveAbove( Layer target )
98 GetImplementation(*this).MoveAbove( GetImplementation( target ) );
101 void Layer::MoveBelow( Layer target )
103 GetImplementation(*this).MoveBelow( GetImplementation( target ) );
106 void Layer::SetClipping(bool enabled)
108 GetImplementation(*this).SetClipping(enabled);
111 bool Layer::IsClipping() const
113 return GetImplementation(*this).IsClipping();
116 void Layer::SetClippingBox(int x, int y, int width, int height)
118 GetImplementation(*this).SetClippingBox(x, y, width, height);
121 void Layer::SetClippingBox(ClippingBox box)
123 GetImplementation(*this).SetClippingBox(box.x, box.y, box.width, box.height);
126 ClippingBox Layer::GetClippingBox() const
128 return GetImplementation(*this).GetClippingBox();
131 void Layer::SetDepthTestDisabled( bool disable )
133 GetImplementation(*this).SetDepthTestDisabled( disable );
136 bool Layer::IsDepthTestDisabled() const
138 return GetImplementation(*this).IsDepthTestDisabled();
141 float Layer::ZValue(const Vector3& position, float sortModifier)
143 return Internal::Layer::ZValue( position, sortModifier );
146 void Layer::SetSortFunction(SortFunctionType function)
148 GetImplementation(*this).SetSortFunction(function);
151 void Layer::SetTouchConsumed( bool consume )
153 GetImplementation( *this ).SetTouchConsumed( consume );
156 bool Layer::IsTouchConsumed() const
158 return GetImplementation( *this ).IsTouchConsumed();
161 void Layer::SetHoverConsumed( bool consume )
163 GetImplementation( *this ).SetHoverConsumed( consume );
166 bool Layer::IsHoverConsumed() const
168 return GetImplementation( *this ).IsHoverConsumed();
171 Layer::Layer(Internal::Layer* internal)