Implemented the Handle assignment operators properly
[platform/core/uifw/dali-core.git] / dali / public-api / actors / renderable-actor.cpp
1 /*
2  * Copyright (c) 2014 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/public-api/actors/renderable-actor.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/event/actors/renderable-actor-impl.h>
23
24 namespace Dali
25 {
26
27 const BlendingMode::Type RenderableActor::DEFAULT_BLENDING_MODE = BlendingMode::AUTO;
28
29 RenderableActor::RenderableActor()
30 {
31 }
32
33 RenderableActor RenderableActor::DownCast( BaseHandle handle )
34 {
35   return RenderableActor( dynamic_cast<Dali::Internal::RenderableActor*>(handle.GetObjectPtr()) );
36 }
37
38 RenderableActor::~RenderableActor()
39 {
40 }
41
42 RenderableActor::RenderableActor(const RenderableActor& copy)
43 : Actor(copy)
44 {
45 }
46
47 RenderableActor& RenderableActor::operator=(const RenderableActor& rhs)
48 {
49   BaseHandle::operator=(rhs);
50   return *this;
51 }
52
53 RenderableActor& RenderableActor::operator=(BaseHandle::NullType* rhs)
54 {
55   DALI_ASSERT_ALWAYS( (rhs == NULL) && "Can only assign NULL pointer to handle");
56   Reset();
57   return *this;
58 }
59
60 void RenderableActor::SetSortModifier(float modifier)
61 {
62   GetImplementation(*this).SetSortModifier(modifier);
63 }
64
65 float RenderableActor::GetSortModifier() const
66 {
67   return GetImplementation(*this).GetSortModifier();
68 }
69
70 void RenderableActor::SetCullFace(const CullFaceMode mode)
71 {
72   GetImplementation(*this).SetCullFace(mode);
73 }
74
75 CullFaceMode RenderableActor::GetCullFace() const
76 {
77   return GetImplementation(*this).GetCullFace();
78 }
79
80 void RenderableActor::SetBlendMode( BlendingMode::Type mode )
81 {
82   GetImplementation(*this).SetBlendMode( mode );
83 }
84
85 BlendingMode::Type RenderableActor::GetBlendMode() const
86 {
87   return GetImplementation(*this).GetBlendMode();
88 }
89
90 void RenderableActor::SetBlendFunc( BlendingFactor::Type srcFactorRgba, BlendingFactor::Type destFactorRgba )
91 {
92   GetImplementation(*this).SetBlendFunc( srcFactorRgba, destFactorRgba );
93 }
94
95 void RenderableActor::SetBlendFunc( BlendingFactor::Type srcFactorRgb,   BlendingFactor::Type destFactorRgb,
96                                     BlendingFactor::Type srcFactorAlpha, BlendingFactor::Type destFactorAlpha )
97 {
98   GetImplementation(*this).SetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
99 }
100
101 void RenderableActor::GetBlendFunc( BlendingFactor::Type& srcFactorRgb,   BlendingFactor::Type& destFactorRgb,
102                                     BlendingFactor::Type& srcFactorAlpha, BlendingFactor::Type& destFactorAlpha ) const
103 {
104   GetImplementation(*this).GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
105 }
106
107 void RenderableActor::SetBlendEquation( BlendingEquation::Type equationRgba )
108 {
109   GetImplementation(*this).SetBlendEquation( equationRgba );
110 }
111
112 void RenderableActor::SetBlendEquation( BlendingEquation::Type equationRgb, BlendingEquation::Type equationAlpha )
113 {
114   GetImplementation(*this).SetBlendEquation( equationRgb, equationAlpha );
115 }
116
117 void RenderableActor::GetBlendEquation( BlendingEquation::Type& equationRgb, BlendingEquation::Type& equationAlpha ) const
118 {
119   GetImplementation(*this).GetBlendEquation( equationRgb, equationAlpha );
120 }
121
122 void RenderableActor::SetBlendColor( const Vector4& color )
123 {
124   GetImplementation(*this).SetBlendColor( color );
125 }
126
127 const Vector4& RenderableActor::GetBlendColor() const
128 {
129   return GetImplementation(*this).GetBlendColor();
130 }
131
132 void RenderableActor::SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter )
133 {
134   GetImplementation(*this).SetFilterMode( minFilter, magFilter );
135 }
136
137 void RenderableActor::GetFilterMode( FilterMode::Type& minFilter, FilterMode::Type& magFilter ) const
138 {
139   GetImplementation(*this).GetFilterMode( minFilter, magFilter );
140 }
141
142 RenderableActor::RenderableActor(Internal::RenderableActor* internal)
143 : Actor(internal)
144 {
145 }
146
147 } // namespace Dali