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>
25 #include <dali/internal/event/effects/shader-declarations.h>
33 class RenderableAttachment;
36 * An abstract base class for renderable actors
38 class RenderableActor : public Actor
43 * @copydoc Dali::RenderableActor::SetSortModifier()
45 void SetSortModifier(float modifier);
48 * @copydoc Dali::RenderableActor::GetSortModifier()
50 float GetSortModifier() const;
53 * @copydoc Dali::RenderableActor::SetCullFace()
55 void SetCullFace(CullFaceMode mode);
58 * @copydoc Dali::RenderableActor::GetCullFace()
60 CullFaceMode GetCullFace() const;
63 * @copydoc Dali::RenderableActor::SetBlendMode()
65 void SetBlendMode( BlendingMode::Type mode );
68 * @copydoc Dali::RenderableActor::GetBlendMode()
70 BlendingMode::Type GetBlendMode() const;
73 * @copydoc Dali::RenderableActor::SetBlendFunc()
75 void SetBlendFunc( BlendingFactor::Type srcFactorRgba, BlendingFactor::Type destFactorRgba );
78 * @copydoc Dali::RenderableActor::SetBlendFunc()
80 void SetBlendFunc( BlendingFactor::Type srcFactorRgb, BlendingFactor::Type destFactorRgb,
81 BlendingFactor::Type srcFactorAlpha, BlendingFactor::Type destFactorAlpha );
84 * @copydoc Dali::RenderableActor::GetBlendFunc()
86 void GetBlendFunc( BlendingFactor::Type& srcFactorRgb, BlendingFactor::Type& destFactorRgb,
87 BlendingFactor::Type& srcFactorAlpha, BlendingFactor::Type& destFactorAlpha ) const;
90 * @copydoc Dali::RenderableActor::SetBlendEquation()
92 void SetBlendEquation( BlendingEquation::Type equationRgba );
95 * @copydoc Dali::RenderableActor::SetBlendEquation()
97 void SetBlendEquation( BlendingEquation::Type equationRgb, BlendingEquation::Type equationAlpha );
100 * @copydoc Dali::RenderableActor::GetBlendEquation()
102 void GetBlendEquation( BlendingEquation::Type& equationRgb, BlendingEquation::Type& equationAlpha ) const;
105 * @copydoc Dali::RenderableActor::SetBlendColor()
107 void SetBlendColor( const Vector4& color );
110 * @copydoc Dali::RenderableActor::GetBlendColor()
112 const Vector4& GetBlendColor() const;
115 * @copydoc Dali::RenderableActor::SetFilterMode()
117 void SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter );
120 * @copydoc Dali::RenderableActor::GetFilterMode()
122 void GetFilterMode( FilterMode::Type& minFilter, FilterMode::Type& magFilter ) const;
127 * Protected constructor; only derived classes are instantiatable.
132 * A reference counted object may only be deleted by calling Unreference()
134 virtual ~RenderableActor();
136 public: // from Actor, in future not virtual. Accessible also from RenderableActor
139 * @copydoc Actor::SetShaderEffect
141 virtual void SetShaderEffect(ShaderEffect& effect);
144 * @copydoc Actor::GetShaderEffect
146 virtual ShaderEffectPtr GetShaderEffect() const;
149 * @copydoc Actor::RemoveShaderEffect
151 virtual void RemoveShaderEffect();
156 * @return a reference to the renderable attachment
158 virtual RenderableAttachment& GetRenderableAttachment() const = 0;
161 RenderableActor(const RenderableActor&);
163 RenderableActor& operator=(const RenderableActor& rhs);
167 } // namespace Internal
169 // Helpers for public-api forwarding methods
171 inline Internal::RenderableActor& GetImplementation(Dali::RenderableActor& renderable)
173 DALI_ASSERT_ALWAYS( renderable && "RenderableActor handle is empty" );
175 BaseObject& handle = renderable.GetBaseObject();
177 return static_cast<Internal::RenderableActor&>(handle);
180 inline const Internal::RenderableActor& GetImplementation(const Dali::RenderableActor& renderable)
182 DALI_ASSERT_ALWAYS(renderable && "RenderableActor handle is empty" );
184 const BaseObject& handle = renderable.GetBaseObject();
186 return static_cast<const Internal::RenderableActor&>(handle);
191 #endif // __DALI_INTERNAL_RENDERABLE_ACTOR_H__