Revert "[Tizen](ATSPI) squashed implementation"
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / common / adaptor.cpp
1 /*
2  * Copyright (c) 2019 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/integration-api/adaptor.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/debug.h>
23
24 // INTERNAL INCLUDES
25 #include <dali/devel-api/adaptor-framework/accessibility-adaptor.h>
26 #include <dali/devel-api/adaptor-framework/style-monitor.h>
27 #include <dali/integration-api/render-surface.h>
28 #include <dali/internal/adaptor/common/adaptor-impl.h>
29 #include <dali/internal/window-system/common/window-impl.h>
30
31 #ifdef DALI_ADAPTOR_COMPILATION
32 #include <dali/integration-api/scene-holder.h>
33 #else
34 #include <dali/integration-api/adaptors/scene-holder.h>
35 #endif
36
37 namespace Dali
38 {
39
40 Adaptor& Adaptor::New( Window window )
41 {
42   return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
43 }
44
45 Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
46 {
47   Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window );
48   Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), configuration, NULL );
49   return *adaptor;
50 }
51
52 Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface )
53 {
54   return New( window, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
55 }
56
57 Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
58 {
59   Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window );
60   Dali::RenderSurfaceInterface* pSurface = const_cast<Dali::RenderSurfaceInterface *>(&surface);
61   Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), pSurface, configuration, NULL );
62   return *adaptor;
63 }
64
65 Adaptor& Adaptor::New( Dali::Integration::SceneHolder window )
66 {
67   return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
68 }
69
70 Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, Configuration::ContextLoss configuration )
71 {
72   Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, configuration, NULL );
73   return *adaptor;
74 }
75
76 Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface )
77 {
78   return New( window, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
79 }
80
81 Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
82 {
83   Dali::RenderSurfaceInterface* pSurface = const_cast<Dali::RenderSurfaceInterface *>(&surface);
84   Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, pSurface, configuration, NULL );
85   return *adaptor;
86 }
87
88 Adaptor::~Adaptor()
89 {
90   delete mImpl;
91 }
92
93 void Adaptor::Start()
94 {
95   mImpl->Start();
96 }
97
98 void Adaptor::Pause()
99 {
100   mImpl->Pause();
101 }
102
103 void Adaptor::Resume()
104 {
105   mImpl->Resume();
106 }
107
108 void Adaptor::Stop()
109 {
110   mImpl->Stop();
111 }
112
113 bool Adaptor::AddIdle( CallbackBase* callback, bool hasReturnValue )
114 {
115   return mImpl->AddIdle( callback, hasReturnValue, false );
116 }
117
118 bool Adaptor::AddWindow( Dali::Integration::SceneHolder childWindow, const std::string& childWindowName, const std::string& childWindowClassName, bool childWindowMode )
119 {
120   return mImpl->AddWindow( childWindow, childWindowName, childWindowClassName, childWindowMode );
121 }
122
123 void Adaptor::RemoveIdle( CallbackBase* callback )
124 {
125   mImpl->RemoveIdle( callback );
126 }
127
128 void Adaptor::ReplaceSurface( Window window, Dali::RenderSurfaceInterface& surface )
129 {
130   Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window );
131   mImpl->ReplaceSurface( Dali::Integration::SceneHolder( sceneHolder ), surface );
132 }
133
134 void Adaptor::ReplaceSurface( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface& surface )
135 {
136   mImpl->ReplaceSurface( window, surface );
137 }
138
139 Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
140 {
141   return mImpl->ResizedSignal();
142 }
143
144 Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
145 {
146   return mImpl->LanguageChangedSignal();
147 }
148
149 Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal()
150 {
151   return mImpl->WindowCreatedSignal();
152 }
153
154 Dali::RenderSurfaceInterface& Adaptor::GetSurface()
155 {
156   return mImpl->GetSurface();
157 }
158
159 Any Adaptor::GetNativeWindowHandle()
160 {
161   return mImpl->GetNativeWindowHandle();
162 }
163
164 Any Adaptor::GetNativeWindowHandle( Actor actor )
165 {
166   return mImpl->GetNativeWindowHandle( actor );
167 }
168
169 Any Adaptor::GetGraphicsDisplay()
170 {
171   return mImpl->GetGraphicsDisplay();
172 }
173
174 void Adaptor::ReleaseSurfaceLock()
175 {
176   mImpl->ReleaseSurfaceLock();
177 }
178
179 void Adaptor::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender )
180 {
181   mImpl->SetRenderRefreshRate( numberOfVSyncsPerRender );
182 }
183
184 void Adaptor::SetPreRenderCallback( CallbackBase* callback )
185 {
186   mImpl->SetPreRenderCallback( callback );
187 }
188
189 Adaptor& Adaptor::Get()
190 {
191   return Internal::Adaptor::Adaptor::Get();
192 }
193
194 bool Adaptor::IsAvailable()
195 {
196   return Internal::Adaptor::Adaptor::IsAvailable();
197 }
198
199 void Adaptor::NotifySceneCreated()
200 {
201   mImpl->NotifySceneCreated();
202 }
203
204 void Adaptor::NotifyLanguageChanged()
205 {
206   mImpl->NotifyLanguageChanged();
207 }
208
209 void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
210 {
211   mImpl->FeedTouchPoint(point, timeStamp);
212 }
213
214 void Adaptor::FeedWheelEvent( WheelEvent& wheelEvent )
215 {
216   mImpl->FeedWheelEvent(wheelEvent);
217 }
218
219 void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
220 {
221   mImpl->FeedKeyEvent(keyEvent);
222 }
223
224 void Adaptor::SceneCreated()
225 {
226   mImpl->SceneCreated();
227 }
228
229 void Adaptor::SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
230 {
231   mImpl->SurfaceResizePrepare( surface, surfaceSize );
232 }
233
234 void Adaptor::SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
235 {
236   mImpl->SurfaceResizeComplete( surface, surfaceSize );
237 }
238
239 void Adaptor::RenderOnce()
240 {
241   mImpl->RenderOnce();
242 }
243
244 const LogFactoryInterface& Adaptor::GetLogFactory()
245 {
246   return mImpl->GetLogFactory();
247 }
248
249 void Adaptor::RegisterProcessor( Integration::Processor& processor )
250 {
251   mImpl->RegisterProcessor( processor );
252 }
253
254 void Adaptor::UnregisterProcessor( Integration::Processor& processor )
255 {
256   mImpl->UnregisterProcessor( processor );
257 }
258
259 Dali::WindowContainer Adaptor::GetWindows() const
260 {
261   return mImpl->GetWindows();
262 }
263
264 void Adaptor::OnWindowShown()
265 {
266   mImpl->OnWindowShown();
267 }
268
269 void Adaptor::OnWindowHidden()
270 {
271   mImpl->OnWindowHidden();
272 }
273
274 Adaptor::Adaptor()
275 : mImpl( NULL )
276 {
277 }
278
279 } // namespace Dali