remove (unnecessarily) exported signal and action names
[platform/core/uifw/dali-core.git] / dali / public-api / common / stage.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/common/stage.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/actors/actor.h>
23 #include <dali/public-api/render-tasks/render-task-list.h>
24 #include <dali/internal/event/common/stage-impl.h>
25 #include <dali/internal/common/core-impl.h>
26 #include <dali/public-api/actors/layer.h>
27 #include <dali/public-api/object/object-registry.h>
28
29 #include <dali/public-api/dynamics/dynamics-world.h>
30 #include <dali/public-api/dynamics/dynamics-world-config.h>
31
32 #ifdef DYNAMICS_SUPPORT
33 #include <dali/internal/event/dynamics/dynamics-declarations.h>
34 #include <dali/internal/event/dynamics/dynamics-world-config-impl.h>
35 #include <dali/internal/event/dynamics/dynamics-world-impl.h>
36 #endif
37
38 namespace Dali
39 {
40
41 using Internal::Core;
42
43 const Vector4 Stage::DEFAULT_BACKGROUND_COLOR(0.0f, 0.0f, 0.0f, 1.0f);
44 const Vector4 Stage::DEBUG_BACKGROUND_COLOR(0.2f, 0.5f, 0.2f, 1.0f);
45
46 Stage::Stage()
47 {
48 }
49
50 Stage::~Stage()
51 {
52 }
53
54 Stage::Stage(const Stage& handle)
55 : BaseHandle(handle)
56 {
57 }
58
59 Stage& Stage::operator=(const Stage& rhs)
60 {
61   BaseHandle::operator=(rhs);
62   return *this;
63 }
64
65 Stage::Stage(Internal::Stage* internal)
66 : BaseHandle(internal)
67 {
68 }
69
70 Stage Stage::GetCurrent()
71 {
72   return Stage(Internal::Stage::GetCurrent());
73 }
74
75 bool Stage::IsInstalled()
76 {
77   return Internal::Stage::IsInstalled();
78 }
79
80 void Stage::Add(Actor& actor)
81 {
82   GetImplementation(*this).Add(GetImplementation(actor));
83 }
84
85 void Stage::Remove(Actor& actor)
86 {
87   GetImplementation(*this).Remove(GetImplementation(actor));
88 }
89
90 RenderTaskList Stage::GetRenderTaskList() const
91 {
92   return RenderTaskList( &GetImplementation(*this).GetRenderTaskList() );
93 }
94
95 Vector2 Stage::GetSize() const
96 {
97   return GetImplementation(*this).GetSize();
98 }
99
100 unsigned int Stage::GetLayerCount() const
101 {
102   return GetImplementation(*this).GetLayerCount();
103 }
104
105 Layer Stage::GetLayer(unsigned int depth) const
106 {
107   return GetImplementation(*this).GetLayer(depth);
108 }
109
110 Layer Stage::GetRootLayer() const
111 {
112   return GetImplementation(*this).GetRootLayer();
113 }
114
115 void Stage::SetBackgroundColor(Vector4 color)
116 {
117   GetImplementation(*this).SetBackgroundColor(color);
118 }
119
120 Vector4 Stage::GetBackgroundColor() const
121 {
122   return GetImplementation(*this).GetBackgroundColor();
123 }
124
125 Vector2 Stage::GetDpi() const
126 {
127   return GetImplementation(*this).GetDpi();
128 }
129
130 ObjectRegistry Stage::GetObjectRegistry() const
131 {
132   Internal::ObjectRegistry& internal = Internal::Stage::GetCurrent()->GetObjectRegistry();
133
134   return ObjectRegistry(&internal);
135 }
136
137 DynamicsWorld Stage::InitializeDynamics(DynamicsWorldConfig config)
138 {
139 #ifdef DYNAMICS_SUPPORT
140   Internal::DynamicsWorldConfigPtr configImpl( &(GetImplementation(config)) );
141
142   return DynamicsWorld( GetImplementation(*this).InitializeDynamics(configImpl).Get() );
143 #else
144   return DynamicsWorld();
145 #endif
146 }
147
148 DynamicsWorld Stage::GetDynamicsWorld()
149 {
150 #ifdef DYNAMICS_SUPPORT
151   return DynamicsWorld( GetImplementation(*this).GetDynamicsWorld().Get() );
152 #else
153   return DynamicsWorld();
154 #endif
155 }
156
157 void Stage::TerminateDynamics()
158 {
159 #ifdef DYNAMICS_SUPPORT
160   GetImplementation(*this).TerminateDynamics();
161 #endif
162 }
163
164 void Stage::KeepRendering( float durationSeconds )
165 {
166   GetImplementation(*this).KeepRendering( durationSeconds );
167 }
168
169 Stage::KeyEventSignalType& Stage::KeyEventSignal()
170 {
171   return GetImplementation(*this).KeyEventSignal();
172 }
173
174 Stage::EventProcessingFinishedSignalType& Stage::EventProcessingFinishedSignal()
175 {
176   return GetImplementation(*this).EventProcessingFinishedSignal();
177 }
178
179 Stage::TouchedSignalType& Stage::TouchedSignal()
180 {
181   return GetImplementation(*this).TouchedSignal();
182 }
183
184 Stage::ContextStatusSignal& Stage::ContextLostSignal()
185 {
186   return GetImplementation(*this).ContextLostSignal();
187 }
188
189 Stage::ContextStatusSignal& Stage::ContextRegainedSignal()
190 {
191   return GetImplementation(*this).ContextRegainedSignal();
192 }
193
194 Stage::SceneCreatedSignalType& Stage::SceneCreatedSignal()
195 {
196   return GetImplementation(*this).SceneCreatedSignal();
197 }
198
199 } // namespace Dali