2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali/integration-api/adaptor-framework/adaptor.h>
22 #include <dali/integration-api/debug.h>
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>
35 Adaptor& Adaptor::New( Window window )
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 );
41 Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
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 );
49 Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface )
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 );
55 Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
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 );
64 Adaptor& Adaptor::New( Dali::Integration::SceneHolder window )
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 );
70 Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, Configuration::ContextLoss configuration )
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 );
77 Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface )
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 );
83 Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
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 );
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" );
102 void Adaptor::Pause()
107 void Adaptor::Resume()
117 bool Adaptor::AddIdle( CallbackBase* callback, bool hasReturnValue )
119 DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" );
120 return mImpl->AddIdle( callback, hasReturnValue, false );
123 bool Adaptor::AddWindow( Dali::Integration::SceneHolder childWindow, const std::string& childWindowName, const std::string& childWindowClassName, bool childWindowMode )
125 DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" );
126 return mImpl->AddWindow( childWindow, childWindowName, childWindowClassName, childWindowMode );
129 void Adaptor::RemoveIdle( CallbackBase* callback )
131 DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" );
132 mImpl->RemoveIdle( callback );
135 void Adaptor::ProcessIdle()
137 DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" );
138 mImpl->ProcessIdle();
141 void Adaptor::ReplaceSurface( Window window, Dali::RenderSurfaceInterface& surface )
143 Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window );
144 mImpl->ReplaceSurface( Dali::Integration::SceneHolder( sceneHolder ), surface );
147 void Adaptor::ReplaceSurface( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface& surface )
149 mImpl->ReplaceSurface( window, surface );
152 Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
154 return mImpl->ResizedSignal();
157 Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
159 return mImpl->LanguageChangedSignal();
162 Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal()
164 return mImpl->WindowCreatedSignal();
167 Dali::RenderSurfaceInterface& Adaptor::GetSurface()
169 return mImpl->GetSurface();
172 Any Adaptor::GetNativeWindowHandle()
174 return mImpl->GetNativeWindowHandle();
177 Any Adaptor::GetNativeWindowHandle( Actor actor )
179 return mImpl->GetNativeWindowHandle( actor );
182 Any Adaptor::GetGraphicsDisplay()
184 return mImpl->GetGraphicsDisplay();
187 void Adaptor::ReleaseSurfaceLock()
189 mImpl->ReleaseSurfaceLock();
192 void Adaptor::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender )
194 mImpl->SetRenderRefreshRate( numberOfVSyncsPerRender );
197 void Adaptor::SetPreRenderCallback( CallbackBase* callback )
199 mImpl->SetPreRenderCallback( callback );
202 Adaptor& Adaptor::Get()
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();
208 bool Adaptor::IsAvailable()
210 return Internal::Adaptor::Adaptor::IsAvailable();
213 void Adaptor::NotifySceneCreated()
215 mImpl->NotifySceneCreated();
218 void Adaptor::NotifyLanguageChanged()
220 mImpl->NotifyLanguageChanged();
223 void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
225 mImpl->FeedTouchPoint(point, timeStamp);
228 void Adaptor::FeedWheelEvent( WheelEvent& wheelEvent )
230 mImpl->FeedWheelEvent(wheelEvent);
233 void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
235 mImpl->FeedKeyEvent(keyEvent);
238 void Adaptor::SceneCreated()
240 mImpl->SceneCreated();
243 void Adaptor::SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
245 mImpl->SurfaceResizePrepare( surface, surfaceSize );
248 void Adaptor::SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
250 mImpl->SurfaceResizeComplete( surface, surfaceSize );
253 void Adaptor::RenderOnce()
258 const LogFactoryInterface& Adaptor::GetLogFactory()
260 return mImpl->GetLogFactory();
263 void Adaptor::RegisterProcessor( Integration::Processor& processor )
265 mImpl->RegisterProcessor( processor );
268 void Adaptor::UnregisterProcessor( Integration::Processor& processor )
270 mImpl->UnregisterProcessor( processor );
273 Dali::WindowContainer Adaptor::GetWindows() const
275 return mImpl->GetWindows();
278 SceneHolderList Adaptor::GetSceneHolders() const
280 return mImpl->GetSceneHolders();
283 void Adaptor::OnWindowShown()
285 mImpl->OnWindowShown();
288 void Adaptor::OnWindowHidden()
290 mImpl->OnWindowHidden();