Align data members, pointers first, classes then, next built in types and flags last...
[platform/core/uifw/dali-core.git] / dali / internal / event / actors / renderable-actor-impl.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/internal/event/actors/renderable-actor-impl.h>
19
20 // INTERNAL INCLUDES
21 #include <dali/public-api/object/type-registry.h>
22 #include <dali/internal/event/actor-attachments/renderable-attachment-impl.h>
23
24 namespace // unnamed namespace
25 {
26
27 using namespace Dali;
28
29 /*
30  * This may look like a no-op but maintains TypeRegistry chain of classes.
31  * ie if a child actor declares its base as RenderableActor, RenderableActor must exist
32  * in TypeRegistry otherwise it doesnt know that child is related to Actor.
33  */
34 BaseHandle Create()
35 {
36   return BaseHandle();
37 }
38
39 TypeRegistration mType( typeid(Dali::RenderableActor), typeid(Dali::Actor), Create );
40
41 } // unnamed namespace
42
43 namespace Dali
44 {
45
46 namespace Internal
47 {
48
49 void RenderableActor::SetSortModifier(float modifier)
50 {
51   GetRenderableAttachment().SetSortModifier(modifier);
52 }
53
54 float RenderableActor::GetSortModifier() const
55 {
56   return GetRenderableAttachment().GetSortModifier();
57 }
58
59 void RenderableActor::SetCullFace(CullFaceMode mode)
60 {
61   GetRenderableAttachment().SetCullFace( mode );
62 }
63
64 CullFaceMode RenderableActor::GetCullFace() const
65 {
66   return GetRenderableAttachment().GetCullFace();
67 }
68
69 void RenderableActor::SetBlendMode( BlendingMode::Type mode )
70 {
71   GetRenderableAttachment().SetBlendMode( mode );
72 }
73
74 BlendingMode::Type RenderableActor::GetBlendMode() const
75 {
76   return GetRenderableAttachment().GetBlendMode();
77 }
78
79 void RenderableActor::SetBlendFunc( BlendingFactor::Type srcFactorRgba,   BlendingFactor::Type destFactorRgba )
80 {
81   GetRenderableAttachment().SetBlendFunc( srcFactorRgba, destFactorRgba, srcFactorRgba, destFactorRgba );
82 }
83
84 void RenderableActor::SetBlendFunc( BlendingFactor::Type srcFactorRgb,   BlendingFactor::Type destFactorRgb,
85                                     BlendingFactor::Type srcFactorAlpha, BlendingFactor::Type destFactorAlpha )
86 {
87   GetRenderableAttachment().SetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
88 }
89
90 void RenderableActor::GetBlendFunc( BlendingFactor::Type& srcFactorRgb,   BlendingFactor::Type& destFactorRgb,
91                                     BlendingFactor::Type& srcFactorAlpha, BlendingFactor::Type& destFactorAlpha ) const
92 {
93   GetRenderableAttachment().GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
94 }
95
96 void RenderableActor::SetBlendEquation( BlendingEquation::Type equationRgba )
97 {
98   GetRenderableAttachment().SetBlendEquation( equationRgba, equationRgba );
99 }
100
101 void RenderableActor::SetBlendEquation( BlendingEquation::Type equationRgb, BlendingEquation::Type equationAlpha )
102 {
103   GetRenderableAttachment().SetBlendEquation( equationRgb, equationAlpha );
104 }
105
106 void RenderableActor::GetBlendEquation( BlendingEquation::Type& equationRgb, BlendingEquation::Type& equationAlpha ) const
107 {
108   GetRenderableAttachment().GetBlendEquation( equationRgb, equationAlpha );
109 }
110
111 void RenderableActor::SetBlendColor( const Vector4& color )
112 {
113   GetRenderableAttachment().SetBlendColor( color );
114 }
115
116 const Vector4& RenderableActor::GetBlendColor() const
117 {
118   return GetRenderableAttachment().GetBlendColor();
119 }
120
121 RenderableActor::RenderableActor()
122 : Actor( Actor::RENDERABLE )
123 {
124 }
125
126 RenderableActor::~RenderableActor()
127 {
128 }
129
130 } // namespace Internal
131
132 } // namespace Dali