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 unsigned int Layer::GetDepth() const
58 return GetImplementation(*this).GetDepth();
63 GetImplementation(*this).Raise();
68 GetImplementation(*this).Lower();
71 void Layer::RaiseAbove( Layer target )
73 GetImplementation(*this).RaiseAbove( GetImplementation( target ) );
76 void Layer::LowerBelow( Layer target )
78 GetImplementation(*this).LowerBelow( GetImplementation( target ) );
81 void Layer::RaiseToTop()
83 GetImplementation(*this).RaiseToTop();
86 void Layer::LowerToBottom()
88 GetImplementation(*this).LowerToBottom();
91 void Layer::MoveAbove( Layer target )
93 GetImplementation(*this).MoveAbove( GetImplementation( target ) );
96 void Layer::MoveBelow( Layer target )
98 GetImplementation(*this).MoveBelow( GetImplementation( target ) );
101 void Layer::SetClipping(bool enabled)
103 GetImplementation(*this).SetClipping(enabled);
106 bool Layer::IsClipping() const
108 return GetImplementation(*this).IsClipping();
111 void Layer::SetClippingBox(int x, int y, int width, int height)
113 GetImplementation(*this).SetClippingBox(x, y, width, height);
116 void Layer::SetClippingBox(ClippingBox box)
118 GetImplementation(*this).SetClippingBox(box.x, box.y, box.width, box.height);
121 ClippingBox Layer::GetClippingBox() const
123 return GetImplementation(*this).GetClippingBox();
126 void Layer::SetDepthTestDisabled( bool disable )
128 GetImplementation(*this).SetDepthTestDisabled( disable );
131 bool Layer::IsDepthTestDisabled() const
133 return GetImplementation(*this).IsDepthTestDisabled();
136 float Layer::ZValue(const Vector3& position, float sortModifier)
138 return Internal::Layer::ZValue( position, sortModifier );
141 void Layer::SetSortFunction(SortFunctionType function)
143 GetImplementation(*this).SetSortFunction(function);
146 void Layer::SetTouchConsumed( bool consume )
148 GetImplementation( *this ).SetTouchConsumed( consume );
151 bool Layer::IsTouchConsumed() const
153 return GetImplementation( *this ).IsTouchConsumed();
156 Layer::Layer(Internal::Layer* internal)