Clean up the code to build successfully on macOS
[platform/core/uifw/dali-core.git] / dali / devel-api / common / stage.cpp
1 /*
2  * Copyright (c) 2020 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/devel-api/common/stage.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/common/core-impl.h>
23 #include <dali/internal/event/common/stage-impl.h>
24 #include <dali/public-api/actors/actor.h>
25 #include <dali/public-api/actors/layer.h>
26 #include <dali/public-api/object/object-registry.h>
27 #include <dali/public-api/render-tasks/render-task-list.h>
28
29 namespace Dali
30 {
31 using Internal::Core;
32
33 Stage::Stage()
34 {
35 }
36
37 Stage::~Stage()
38 {
39 }
40
41 Stage::Stage(const Stage& handle)
42 : BaseHandle(handle)
43 {
44 }
45
46 Stage& Stage::operator=(const Stage& rhs)
47 {
48   BaseHandle::operator=(rhs);
49   return *this;
50 }
51
52 Stage::Stage(Internal::Stage* internal)
53 : BaseHandle(internal)
54 {
55 }
56
57 Stage Stage::GetCurrent()
58 {
59   Internal::Stage* stage = Internal::Stage::GetCurrent();
60   DALI_ASSERT_ALWAYS(stage && "Stage doesn't exist");
61   return Stage(stage);
62 }
63
64 bool Stage::IsInstalled()
65 {
66   return Internal::Stage::IsInstalled();
67 }
68
69 void Stage::Add(Actor& actor)
70 {
71   GetImplementation(*this).Add(GetImplementation(actor));
72 }
73
74 void Stage::Remove(Actor& actor)
75 {
76   GetImplementation(*this).Remove(GetImplementation(actor));
77 }
78
79 RenderTaskList Stage::GetRenderTaskList() const
80 {
81   return RenderTaskList(&GetImplementation(*this).GetRenderTaskList());
82 }
83
84 Vector2 Stage::GetSize() const
85 {
86   return GetImplementation(*this).GetSize();
87 }
88
89 uint32_t Stage::GetLayerCount() const
90 {
91   return GetImplementation(*this).GetLayerCount();
92 }
93
94 Layer Stage::GetLayer(uint32_t depth) const
95 {
96   return GetImplementation(*this).GetLayer(depth);
97 }
98
99 Layer Stage::GetRootLayer() const
100 {
101   return GetImplementation(*this).GetRootLayer();
102 }
103
104 void Stage::SetBackgroundColor(Vector4 color)
105 {
106   GetImplementation(*this).SetBackgroundColor(color);
107 }
108
109 Vector4 Stage::GetBackgroundColor() const
110 {
111   return GetImplementation(*this).GetBackgroundColor();
112 }
113
114 Vector2 Stage::GetDpi() const
115 {
116   return GetImplementation(*this).GetDpi();
117 }
118
119 ObjectRegistry Stage::GetObjectRegistry() const
120 {
121   Internal::Stage* stage = Internal::Stage::GetCurrent();
122   DALI_ASSERT_ALWAYS(stage && "GetObjectRegistry() : Stage is null");
123
124   Internal::ObjectRegistry& internal = stage->GetObjectRegistry();
125   return ObjectRegistry(&internal);
126 }
127
128 void Stage::KeepRendering(float durationSeconds)
129 {
130   GetImplementation(*this).KeepRendering(durationSeconds);
131 }
132
133 Stage::KeyEventSignalType& Stage::KeyEventSignal()
134 {
135   return GetImplementation(*this).KeyEventSignal();
136 }
137
138 Stage::EventProcessingFinishedSignalType& Stage::EventProcessingFinishedSignal()
139 {
140   return GetImplementation(*this).EventProcessingFinishedSignal();
141 }
142
143 Stage::TouchEventSignalType& Stage::TouchedSignal()
144 {
145   return GetImplementation(*this).TouchedSignal();
146 }
147
148 Stage::WheelEventSignalType& Stage::WheelEventSignal()
149 {
150   return GetImplementation(*this).WheelEventSignal();
151 }
152
153 Stage::ContextStatusSignal& Stage::ContextLostSignal()
154 {
155   return GetImplementation(*this).ContextLostSignal();
156 }
157
158 Stage::ContextStatusSignal& Stage::ContextRegainedSignal()
159 {
160   return GetImplementation(*this).ContextRegainedSignal();
161 }
162
163 Stage::SceneCreatedSignalType& Stage::SceneCreatedSignal()
164 {
165   return GetImplementation(*this).SceneCreatedSignal();
166 }
167
168 } // namespace Dali