[dali_1.1.28] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / shadow-view / shadow-view.cpp
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
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
18 // CLASS HEADER
19 #include <dali-toolkit/devel-api/controls/shadow-view/shadow-view.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/internal/controls/shadow-view/shadow-view-impl.h>
23
24 namespace
25 {
26
27 const float GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_WIDTH_SCALE = 1.0f;
28 const float GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_HEIGHT_SCALE = 1.0f;
29
30 } // namespace
31
32 namespace Dali
33 {
34
35 namespace Toolkit
36 {
37
38 ShadowView::ShadowView()
39 {
40 }
41
42 ShadowView::~ShadowView()
43 {
44 }
45
46 ShadowView::ShadowView(const ShadowView& handle)
47   : Control( handle )
48 {
49 }
50
51 ShadowView& ShadowView::operator=(const ShadowView& rhs)
52 {
53   if( &rhs != this )
54   {
55     Control::operator=(rhs);
56   }
57   return *this;
58 }
59
60 ShadowView ShadowView::New()
61 {
62   return Internal::ShadowView::New(GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_WIDTH_SCALE,
63                                    GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_HEIGHT_SCALE);
64 }
65
66 ShadowView ShadowView::New(float downsampleWidthScale, float downsampleHeightScale)
67 {
68   return Internal::ShadowView::New(downsampleWidthScale, downsampleHeightScale);
69 }
70
71 ShadowView::ShadowView( Internal::ShadowView& implementation )
72 : Control( implementation )
73 {
74 }
75
76 ShadowView::ShadowView( Dali::Internal::CustomActor* internal )
77 : Control( internal )
78 {
79   VerifyCustomActorPointer<Internal::ShadowView>(internal);
80 }
81
82 ShadowView ShadowView::DownCast( BaseHandle handle )
83 {
84   return Control::DownCast<ShadowView, Internal::ShadowView>(handle);
85 }
86
87 void ShadowView::SetShadowPlaneBackground(Actor shadowPlaneBackground)
88 {
89   GetImpl(*this).SetShadowPlaneBackground(shadowPlaneBackground);
90 }
91
92 void ShadowView::SetPointLight(Actor pointLight)
93 {
94   GetImpl(*this).SetPointLight(pointLight);
95 }
96
97 void ShadowView::SetPointLightFieldOfView(float fieldOfView)
98 {
99   GetImpl(*this).SetPointLightFieldOfView(fieldOfView);
100 }
101
102 void ShadowView::SetShadowColor(Vector4 color)
103 {
104   GetImpl(*this).SetShadowColor(color);
105 }
106
107 void ShadowView::Activate()
108 {
109   GetImpl(*this).Activate();
110 }
111
112 void ShadowView::Deactivate()
113 {
114   GetImpl(*this).Deactivate();
115 }
116
117 Property::Index ShadowView::GetBlurStrengthPropertyIndex() const
118 {
119   return GetImpl(*this).GetBlurStrengthPropertyIndex();
120 }
121
122 Property::Index ShadowView::GetShadowColorPropertyIndex() const
123 {
124   return GetImpl(*this).GetShadowColorPropertyIndex();
125 }
126
127 } // namespace Toolkit
128
129 } // namespace Dali