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::SetBehavior( Behavior behavior )
108 GetImplementation(*this).SetBehavior( behavior );
111 Layer::Behavior Layer::GetBehavior() const
113 return GetImplementation(*this).GetBehavior();
116 void Layer::SetClipping(bool enabled)
118 GetImplementation(*this).SetClipping(enabled);
121 bool Layer::IsClipping() const
123 return GetImplementation(*this).IsClipping();
126 void Layer::SetClippingBox(int x, int y, int width, int height)
128 GetImplementation(*this).SetClippingBox(x, y, width, height);
131 void Layer::SetClippingBox(ClippingBox box)
133 GetImplementation(*this).SetClippingBox(box.x, box.y, box.width, box.height);
136 ClippingBox Layer::GetClippingBox() const
138 return GetImplementation(*this).GetClippingBox();
141 void Layer::SetDepthTestDisabled( bool disable )
143 GetImplementation(*this).SetDepthTestDisabled( disable );
146 bool Layer::IsDepthTestDisabled() const
148 return GetImplementation(*this).IsDepthTestDisabled();
151 void Layer::SetSortFunction(SortFunctionType function)
153 GetImplementation(*this).SetSortFunction(function);
156 void Layer::SetTouchConsumed( bool consume )
158 GetImplementation( *this ).SetTouchConsumed( consume );
161 bool Layer::IsTouchConsumed() const
163 return GetImplementation( *this ).IsTouchConsumed();
166 void Layer::SetHoverConsumed( bool consume )
168 GetImplementation( *this ).SetHoverConsumed( consume );
171 bool Layer::IsHoverConsumed() const
173 return GetImplementation( *this ).IsHoverConsumed();
176 Layer::Layer(Internal::Layer* internal)