1 #ifndef __DALI_INTERNAL_RENDERABLE_ACTOR_H__
2 #define __DALI_INTERNAL_RENDERABLE_ACTOR_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/actors/renderable-actor.h>
23 #include <dali/public-api/common/dali-common.h>
24 #include <dali/internal/event/actors/actor-impl.h>
32 class RenderableAttachment;
35 * An abstract base class for renderable actors
37 class RenderableActor : public Actor
42 * @copydoc Dali::RenderableActor::SetSortModifier()
44 void SetSortModifier(float modifier);
47 * @copydoc Dali::RenderableActor::GetSortModifier()
49 float GetSortModifier() const;
52 * @copydoc Dali::RenderableActor::SetCullFace()
54 void SetCullFace(CullFaceMode mode);
57 * @copydoc Dali::RenderableActor::GetCullFace()
59 CullFaceMode GetCullFace() const;
62 * @copydoc Dali::RenderableActor::SetBlendMode()
64 void SetBlendMode( BlendingMode::Type mode );
67 * @copydoc Dali::RenderableActor::GetBlendMode()
69 BlendingMode::Type GetBlendMode() const;
72 * @copydoc Dali::RenderableActor::SetBlendFunc()
74 void SetBlendFunc( BlendingFactor::Type srcFactorRgba, BlendingFactor::Type destFactorRgba );
77 * @copydoc Dali::RenderableActor::SetBlendFunc()
79 void SetBlendFunc( BlendingFactor::Type srcFactorRgb, BlendingFactor::Type destFactorRgb,
80 BlendingFactor::Type srcFactorAlpha, BlendingFactor::Type destFactorAlpha );
83 * @copydoc Dali::RenderableActor::GetBlendFunc()
85 void GetBlendFunc( BlendingFactor::Type& srcFactorRgb, BlendingFactor::Type& destFactorRgb,
86 BlendingFactor::Type& srcFactorAlpha, BlendingFactor::Type& destFactorAlpha ) const;
89 * @copydoc Dali::RenderableActor::SetBlendEquation()
91 void SetBlendEquation( BlendingEquation::Type equationRgba );
94 * @copydoc Dali::RenderableActor::SetBlendEquation()
96 void SetBlendEquation( BlendingEquation::Type equationRgb, BlendingEquation::Type equationAlpha );
99 * @copydoc Dali::RenderableActor::GetBlendEquation()
101 void GetBlendEquation( BlendingEquation::Type& equationRgb, BlendingEquation::Type& equationAlpha ) const;
104 * @copydoc Dali::RenderableActor::SetBlendColor()
106 void SetBlendColor( const Vector4& color );
109 * @copydoc Dali::RenderableActor::GetBlendColor()
111 const Vector4& GetBlendColor() const;
114 * @copydoc Dali::RenderableActor::SetFilterMode()
116 void SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter );
119 * @copydoc Dali::RenderableActor::GetFilterMode()
121 void GetFilterMode( FilterMode::Type& minFilter, FilterMode::Type& magFilter ) const;
126 * Protected constructor; only derived classes are instantiatable.
131 * A reference counted object may only be deleted by calling Unreference()
133 virtual ~RenderableActor();
135 public: // from Actor, in future not virtual. Accessible also from RenderableActor
138 * @copydoc Actor::SetShaderEffect
140 virtual void SetShaderEffect(ShaderEffect& effect);
143 * @copydoc Actor::GetShaderEffect
145 virtual ShaderEffectPtr GetShaderEffect() const;
148 * @copydoc Actor::RemoveShaderEffect
150 virtual void RemoveShaderEffect();
155 * @return a reference to the renderable attachment
157 virtual RenderableAttachment& GetRenderableAttachment() const = 0;
160 RenderableActor(const RenderableActor&);
162 RenderableActor& operator=(const RenderableActor& rhs);
166 } // namespace Internal
168 // Helpers for public-api forwarding methods
170 inline Internal::RenderableActor& GetImplementation(Dali::RenderableActor& renderable)
172 DALI_ASSERT_ALWAYS( renderable && "RenderableActor handle is empty" );
174 BaseObject& handle = renderable.GetBaseObject();
176 return static_cast<Internal::RenderableActor&>(handle);
179 inline const Internal::RenderableActor& GetImplementation(const Dali::RenderableActor& renderable)
181 DALI_ASSERT_ALWAYS(renderable && "RenderableActor handle is empty" );
183 const BaseObject& handle = renderable.GetBaseObject();
185 return static_cast<const Internal::RenderableActor&>(handle);
190 #endif // __DALI_INTERNAL_RENDERABLE_ACTOR_H__