Bug fix which makes applications crash when adding a renderer to an on stage actor
[platform/core/uifw/dali-core.git] / dali / public-api / actors / renderable-actor.h
1 #ifndef __DALI_RENDERABLE_ACTOR_H__
2 #define __DALI_RENDERABLE_ACTOR_H__
3
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21
22 // INTERNAL INCLUDES
23 #include <dali/public-api/actors/actor.h>
24 #include <dali/public-api/shader-effects/shader-effect.h>
25 #include <dali/public-api/actors/blending.h>
26 #include <dali/public-api/actors/sampling.h>
27
28 namespace Dali
29 {
30 namespace Internal DALI_INTERNAL
31 {
32 class RenderableActor;
33 }
34
35 /**
36  * @brief Face culling modes.
37  */
38 enum CullFaceMode
39 {
40   CullNone,                 ///< Face culling disabled
41   CullFront,                ///< Cull front facing polygons
42   CullBack,                 ///< Cull back facing polygons
43   CullFrontAndBack          ///< Cull front and back facing polygons
44 };
45
46
47
48 /**
49  * @brief A base class for renderable actors.
50  */
51 class DALI_IMPORT_API RenderableActor : public Actor
52 {
53 public:
54
55   static const BlendingMode::Type DEFAULT_BLENDING_MODE; ///< default value is BlendingMode::AUTO
56
57   /**
58    * @brief Create an uninitialized actor.
59    *
60    * Calling member functions with an uninitialized Dali::Object is not allowed.
61    */
62   RenderableActor();
63
64   /**
65    * @brief Downcast an Object handle to RenderableActor.
66    *
67    * If handle points to a RenderableActor the
68    * downcast produces valid handle. If not the returned handle is left uninitialized.
69    * @param[in] handle to An object
70    * @return handle to a RenderableActor or an uninitialized handle
71    */
72   static RenderableActor DownCast( BaseHandle handle );
73
74   /**
75    * @brief Destructor
76    *
77    * This is non-virtual since derived Handle types must not contain data or virtual methods.
78    */
79   ~RenderableActor();
80
81   /**
82    * @brief Copy constructor
83    *
84    * @param [in] copy The actor to copy.
85    */
86   RenderableActor(const RenderableActor& copy);
87
88   /**
89    * @brief Assignment operator
90    *
91    * @param [in] rhs The actor to copy.
92    */
93   RenderableActor& operator=(const RenderableActor& rhs);
94
95 public: // Not intended for application developers
96
97   /**
98    * @brief This constructor is used by Dali New() methods
99    *
100    * @param [in] actor A pointer to a newly allocated Dali resource
101    */
102   explicit DALI_INTERNAL RenderableActor(Internal::RenderableActor* actor);
103 };
104
105
106 } // namespace Dali
107
108 #endif // __DALI_RENDERABLE_ACTOR_H__