Revert "[Tizen] Stage's default background color change to transparent"
[platform/core/uifw/dali-core.git] / dali / public-api / common / stage.cpp
1 /*
2  * Copyright (c) 2015 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 namespace Dali
30 {
31
32 using Internal::Core;
33
34 const Vector4 Stage::DEFAULT_BACKGROUND_COLOR(0.0f, 0.0f, 0.0f, 1.0f);
35 const Vector4 Stage::DEBUG_BACKGROUND_COLOR(0.2f, 0.5f, 0.2f, 1.0f);
36
37 Stage::Stage()
38 {
39 }
40
41 Stage::~Stage()
42 {
43 }
44
45 Stage::Stage(const Stage& handle)
46 : BaseHandle(handle)
47 {
48 }
49
50 Stage& Stage::operator=(const Stage& rhs)
51 {
52   BaseHandle::operator=(rhs);
53   return *this;
54 }
55
56 Stage::Stage(Internal::Stage* internal)
57 : BaseHandle(internal)
58 {
59 }
60
61 Stage Stage::GetCurrent()
62 {
63   Internal::Stage* stage = Internal::Stage::GetCurrent();
64   DALI_ASSERT_ALWAYS( stage && "Stage doesn't exist" );
65   return Stage( stage );
66 }
67
68 bool Stage::IsInstalled()
69 {
70   return Internal::Stage::IsInstalled();
71 }
72
73 void Stage::Add(Actor& actor)
74 {
75   GetImplementation(*this).Add(GetImplementation(actor));
76 }
77
78 void Stage::Remove(Actor& actor)
79 {
80   GetImplementation(*this).Remove(GetImplementation(actor));
81 }
82
83 RenderTaskList Stage::GetRenderTaskList() const
84 {
85   return RenderTaskList( &GetImplementation(*this).GetRenderTaskList() );
86 }
87
88 Vector2 Stage::GetSize() const
89 {
90   return GetImplementation(*this).GetSize();
91 }
92
93 unsigned int Stage::GetLayerCount() const
94 {
95   return GetImplementation(*this).GetLayerCount();
96 }
97
98 Layer Stage::GetLayer(unsigned int depth) const
99 {
100   return GetImplementation(*this).GetLayer(depth);
101 }
102
103 Layer Stage::GetRootLayer() const
104 {
105   return GetImplementation(*this).GetRootLayer();
106 }
107
108 void Stage::SetBackgroundColor(Vector4 color)
109 {
110   GetImplementation(*this).SetBackgroundColor(color);
111 }
112
113 Vector4 Stage::GetBackgroundColor() const
114 {
115   return GetImplementation(*this).GetBackgroundColor();
116 }
117
118 Vector2 Stage::GetDpi() const
119 {
120   return GetImplementation(*this).GetDpi();
121 }
122
123 ObjectRegistry Stage::GetObjectRegistry() const
124 {
125   Internal::Stage* stage = Internal::Stage::GetCurrent();
126   DALI_ASSERT_ALWAYS( stage && "GetObjectRegistry() : Stage is null" );
127
128   Internal::ObjectRegistry& internal = stage->GetObjectRegistry();
129   return ObjectRegistry(&internal);
130 }
131
132 void Stage::KeepRendering( float durationSeconds )
133 {
134   GetImplementation(*this).KeepRendering( durationSeconds );
135 }
136
137 Stage::KeyEventSignalType& Stage::KeyEventSignal()
138 {
139   return GetImplementation(*this).KeyEventSignal();
140 }
141
142 Stage::EventProcessingFinishedSignalType& Stage::EventProcessingFinishedSignal()
143 {
144   return GetImplementation(*this).EventProcessingFinishedSignal();
145 }
146
147 Stage::TouchedSignalType& Stage::TouchedSignal()
148 {
149   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: TouchedSignal() is deprecated and will be removed from next release. Use TouchSignal() instead.\n" );
150
151   return GetImplementation(*this).TouchedSignal();
152 }
153
154 Stage::TouchSignalType& Stage::TouchSignal()
155 {
156   return GetImplementation( *this ).TouchSignal();
157 }
158
159 Stage::WheelEventSignalType& Stage::WheelEventSignal()
160 {
161   return GetImplementation(*this).WheelEventSignal();
162 }
163
164 Stage::ContextStatusSignal& Stage::ContextLostSignal()
165 {
166   return GetImplementation(*this).ContextLostSignal();
167 }
168
169 Stage::ContextStatusSignal& Stage::ContextRegainedSignal()
170 {
171   return GetImplementation(*this).ContextRegainedSignal();
172 }
173
174 Stage::SceneCreatedSignalType& Stage::SceneCreatedSignal()
175 {
176   return GetImplementation(*this).SceneCreatedSignal();
177 }
178
179 } // namespace Dali