[Tizen] Add deprecated logs to Adaptor and Application
[platform/core/uifw/dali-adaptor-legacy.git] / dali / internal / adaptor / common / adaptor.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/integration-api/adaptor-framework/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/adaptor-framework/render-surface-interface.h>
28 #include <dali/integration-api/adaptor-framework/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   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" );
38   return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
39 }
40
41 Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
42 {
43   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" );
44   Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window );
45   Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), configuration, NULL );
46   return *adaptor;
47 }
48
49 Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface )
50 {
51   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" );
52   return New( window, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
53 }
54
55 Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
56 {
57   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" );
58   Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window );
59   Dali::RenderSurfaceInterface* pSurface = const_cast<Dali::RenderSurfaceInterface *>(&surface);
60   Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), pSurface, configuration, NULL );
61   return *adaptor;
62 }
63
64 Adaptor& Adaptor::New( Dali::Integration::SceneHolder window )
65 {
66   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" );
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   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" );
73   Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, configuration, NULL );
74   return *adaptor;
75 }
76
77 Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface )
78 {
79   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" );
80   return New( window, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
81 }
82
83 Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
84 {
85   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" );
86   Dali::RenderSurfaceInterface* pSurface = const_cast<Dali::RenderSurfaceInterface *>(&surface);
87   Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, pSurface, configuration, NULL );
88   return *adaptor;
89 }
90
91 Adaptor::~Adaptor()
92 {
93   delete mImpl;
94 }
95
96 void Adaptor::Start()
97 {
98   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" );
99   mImpl->Start();
100 }
101
102 void Adaptor::Pause()
103 {
104   mImpl->Pause();
105 }
106
107 void Adaptor::Resume()
108 {
109   mImpl->Resume();
110 }
111
112 void Adaptor::Stop()
113 {
114   mImpl->Stop();
115 }
116
117 bool Adaptor::AddIdle( CallbackBase* callback, bool hasReturnValue )
118 {
119   DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" );
120   return mImpl->AddIdle( callback, hasReturnValue, false );
121 }
122
123 bool Adaptor::AddWindow( Dali::Integration::SceneHolder childWindow, const std::string& childWindowName, const std::string& childWindowClassName, bool childWindowMode )
124 {
125   DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" );
126   return mImpl->AddWindow( childWindow, childWindowName, childWindowClassName, childWindowMode );
127 }
128
129 void Adaptor::RemoveIdle( CallbackBase* callback )
130 {
131   DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" );
132   mImpl->RemoveIdle( callback );
133 }
134
135 void Adaptor::ProcessIdle()
136 {
137   DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" );
138   mImpl->ProcessIdle();
139 }
140
141 void Adaptor::ReplaceSurface( Window window, Dali::RenderSurfaceInterface& surface )
142 {
143   Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window );
144   mImpl->ReplaceSurface( Dali::Integration::SceneHolder( sceneHolder ), surface );
145 }
146
147 void Adaptor::ReplaceSurface( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface& surface )
148 {
149   mImpl->ReplaceSurface( window, surface );
150 }
151
152 Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
153 {
154   return mImpl->ResizedSignal();
155 }
156
157 Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
158 {
159   return mImpl->LanguageChangedSignal();
160 }
161
162 Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal()
163 {
164   return mImpl->WindowCreatedSignal();
165 }
166
167 Dali::RenderSurfaceInterface& Adaptor::GetSurface()
168 {
169   return mImpl->GetSurface();
170 }
171
172 Any Adaptor::GetNativeWindowHandle()
173 {
174   return mImpl->GetNativeWindowHandle();
175 }
176
177 Any Adaptor::GetNativeWindowHandle( Actor actor )
178 {
179   return mImpl->GetNativeWindowHandle( actor );
180 }
181
182 Any Adaptor::GetGraphicsDisplay()
183 {
184   return mImpl->GetGraphicsDisplay();
185 }
186
187 void Adaptor::ReleaseSurfaceLock()
188 {
189   mImpl->ReleaseSurfaceLock();
190 }
191
192 void Adaptor::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender )
193 {
194   mImpl->SetRenderRefreshRate( numberOfVSyncsPerRender );
195 }
196
197 void Adaptor::SetPreRenderCallback( CallbackBase* callback )
198 {
199   mImpl->SetPreRenderCallback( callback );
200 }
201
202 Adaptor& Adaptor::Get()
203 {
204   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" );
205   return Internal::Adaptor::Adaptor::Get();
206 }
207
208 bool Adaptor::IsAvailable()
209 {
210   return Internal::Adaptor::Adaptor::IsAvailable();
211 }
212
213 void Adaptor::NotifySceneCreated()
214 {
215   mImpl->NotifySceneCreated();
216 }
217
218 void Adaptor::NotifyLanguageChanged()
219 {
220   mImpl->NotifyLanguageChanged();
221 }
222
223 void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
224 {
225   mImpl->FeedTouchPoint(point, timeStamp);
226 }
227
228 void Adaptor::FeedWheelEvent( WheelEvent& wheelEvent )
229 {
230   mImpl->FeedWheelEvent(wheelEvent);
231 }
232
233 void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
234 {
235   mImpl->FeedKeyEvent(keyEvent);
236 }
237
238 void Adaptor::SceneCreated()
239 {
240   mImpl->SceneCreated();
241 }
242
243 void Adaptor::SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
244 {
245   mImpl->SurfaceResizePrepare( surface, surfaceSize );
246 }
247
248 void Adaptor::SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
249 {
250   mImpl->SurfaceResizeComplete( surface, surfaceSize );
251 }
252
253 void Adaptor::RenderOnce()
254 {
255   mImpl->RenderOnce();
256 }
257
258 const LogFactoryInterface& Adaptor::GetLogFactory()
259 {
260   return mImpl->GetLogFactory();
261 }
262
263 void Adaptor::RegisterProcessor( Integration::Processor& processor )
264 {
265   mImpl->RegisterProcessor( processor );
266 }
267
268 void Adaptor::UnregisterProcessor( Integration::Processor& processor )
269 {
270   mImpl->UnregisterProcessor( processor );
271 }
272
273 Dali::WindowContainer Adaptor::GetWindows() const
274 {
275   return mImpl->GetWindows();
276 }
277
278 SceneHolderList Adaptor::GetSceneHolders() const
279 {
280   return mImpl->GetSceneHolders();
281 }
282
283 void Adaptor::OnWindowShown()
284 {
285   mImpl->OnWindowShown();
286 }
287
288 void Adaptor::OnWindowHidden()
289 {
290   mImpl->OnWindowHidden();
291 }
292
293 Adaptor::Adaptor()
294 : mImpl( NULL )
295 {
296 }
297
298 } // namespace Dali