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