[SRUK] Initial copy from Tizen 2.2 version
[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 Flora License, Version 1.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://floralicense.org/license/
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 // CLASS HEADER
18 #include <dali/public-api/actors/layer.h>
19
20 // INTERNAL INCLUDES
21 #include <dali/internal/event/actors/layer-impl.h>
22 #include <dali/internal/event/images/frame-buffer-image-impl.h>
23
24 namespace Dali
25 {
26
27 using Dali::Layer;
28
29 const char* const Layer::ACTION_RAISE = "raise";
30 const char* const Layer::ACTION_LOWER = "lower";
31 const char* const Layer::ACTION_RAISE_TO_TOP = "raise-to-top";
32 const char* const Layer::ACTION_LOWER_TO_BOTTOM = "lower-to-bottom";
33
34
35 Layer::Layer()
36 {
37 }
38
39 Layer Layer::New()
40 {
41   Internal::LayerPtr internal = Internal::Layer::New();
42
43   return Layer(internal.Get());
44 }
45
46 Layer Layer::DownCast( BaseHandle handle )
47 {
48   return Layer( dynamic_cast<Dali::Internal::Layer*>(handle.GetObjectPtr()) );
49 }
50
51 Layer::~Layer()
52 {
53 }
54
55 unsigned int Layer::GetDepth() const
56 {
57   return GetImplementation(*this).GetDepth();
58 }
59
60 void Layer::Raise()
61 {
62   GetImplementation(*this).Raise();
63 }
64
65 void Layer::Lower()
66 {
67   GetImplementation(*this).Lower();
68 }
69
70 void Layer::RaiseAbove( Layer target )
71 {
72   GetImplementation(*this).RaiseAbove( GetImplementation( target ) );
73 }
74
75 void Layer::LowerBelow( Layer target )
76 {
77   GetImplementation(*this).LowerBelow( GetImplementation( target ) );
78 }
79
80 void Layer::RaiseToTop()
81 {
82   GetImplementation(*this).RaiseToTop();
83 }
84
85 void Layer::LowerToBottom()
86 {
87   GetImplementation(*this).LowerToBottom();
88 }
89
90 void Layer::MoveAbove( Layer target )
91 {
92   GetImplementation(*this).MoveAbove( GetImplementation( target ) );
93 }
94
95 void Layer::MoveBelow( Layer target )
96 {
97   GetImplementation(*this).MoveBelow( GetImplementation( target ) );
98 }
99
100 void Layer::SetClipping(bool enabled)
101 {
102   GetImplementation(*this).SetClipping(enabled);
103 }
104
105 bool Layer::IsClipping() const
106 {
107   return GetImplementation(*this).IsClipping();
108 }
109
110 void Layer::SetClippingBox(int x, int y, int width, int height)
111 {
112   GetImplementation(*this).SetClippingBox(x, y, width, height);
113 }
114
115 void Layer::SetClippingBox(ClippingBox box)
116 {
117   GetImplementation(*this).SetClippingBox(box.x, box.y, box.width, box.height);
118 }
119
120 ClippingBox Layer::GetClippingBox() const
121 {
122   return GetImplementation(*this).GetClippingBox();
123 }
124
125 void Layer::SetDepthTestDisabled( bool disable )
126 {
127   GetImplementation(*this).SetDepthTestDisabled( disable );
128 }
129
130 bool Layer::IsDepthTestDisabled() const
131 {
132   return GetImplementation(*this).IsDepthTestDisabled();
133 }
134
135 void Layer::SetSortFunction(SortFunctionType function)
136 {
137   GetImplementation(*this).SetSortFunction(function);
138 }
139
140 Layer::Layer(Internal::Layer* internal)
141 : Actor(internal)
142 {
143 }
144
145 } // namespace Dali
146