Revert "[Tizen](ATSPI) Fix Native TC fails"
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / common / adaptor.cpp
index a0747df..bde2864 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/accessibility-adaptor.h>
 #include <dali/devel-api/adaptor-framework/style-monitor.h>
 #include <dali/integration-api/render-surface.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/window-system/common/window-impl.h>
+
+#ifdef DALI_ADAPTOR_COMPILATION
+#include <dali/integration-api/scene-holder.h>
+#else
+#include <dali/integration-api/adaptors/scene-holder.h>
+#endif
 
 namespace Dali
 {
@@ -37,19 +43,44 @@ Adaptor& Adaptor::New( Window window )
 
 Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
 {
+  Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window );
+  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), configuration, NULL );
+  return *adaptor;
+}
+
+Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface )
+{
+  return New( window, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
+}
+
+Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
+{
+  Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window );
+  Dali::RenderSurfaceInterface* pSurface = const_cast<Dali::RenderSurfaceInterface *>(&surface);
+  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), pSurface, configuration, NULL );
+  return *adaptor;
+}
+
+Adaptor& Adaptor::New( Dali::Integration::SceneHolder window )
+{
+  return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
+}
+
+Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, Configuration::ContextLoss configuration )
+{
   Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, configuration, NULL );
   return *adaptor;
 }
 
-Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
+Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface )
 {
-  return New( nativeWindow, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
+  return New( window, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
 }
 
-Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration )
+Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
 {
-  Dali::RenderSurface* pSurface = const_cast<Dali::RenderSurface *>(&surface);
-  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration, NULL );
+  Dali::RenderSurfaceInterface* pSurface = const_cast<Dali::RenderSurfaceInterface *>(&surface);
+  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, pSurface, configuration, NULL );
   return *adaptor;
 }
 
@@ -83,14 +114,25 @@ bool Adaptor::AddIdle( CallbackBase* callback, bool hasReturnValue )
   return mImpl->AddIdle( callback, hasReturnValue, false );
 }
 
+bool Adaptor::AddWindow( Dali::Integration::SceneHolder childWindow, const std::string& childWindowName, const std::string& childWindowClassName, bool childWindowMode )
+{
+  return mImpl->AddWindow( childWindow, childWindowName, childWindowClassName, childWindowMode );
+}
+
 void Adaptor::RemoveIdle( CallbackBase* callback )
 {
   mImpl->RemoveIdle( callback );
 }
 
-void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
+void Adaptor::ReplaceSurface( Window window, Dali::RenderSurfaceInterface& surface )
+{
+  Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window );
+  mImpl->ReplaceSurface( Dali::Integration::SceneHolder( sceneHolder ), surface );
+}
+
+void Adaptor::ReplaceSurface( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface& surface )
 {
-  mImpl->ReplaceSurface(nativeWindow, surface);
+  mImpl->ReplaceSurface( window, surface );
 }
 
 Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
@@ -103,7 +145,12 @@ Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
   return mImpl->LanguageChangedSignal();
 }
 
-RenderSurface& Adaptor::GetSurface()
+Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal()
+{
+  return mImpl->WindowCreatedSignal();
+}
+
+Dali::RenderSurfaceInterface& Adaptor::GetSurface()
 {
   return mImpl->GetSurface();
 }
@@ -113,6 +160,11 @@ Any Adaptor::GetNativeWindowHandle()
   return mImpl->GetNativeWindowHandle();
 }
 
+Any Adaptor::GetNativeWindowHandle( Actor actor )
+{
+  return mImpl->GetNativeWindowHandle( actor );
+}
+
 Any Adaptor::GetGraphicsDisplay()
 {
   return mImpl->GetGraphicsDisplay();
@@ -133,11 +185,6 @@ void Adaptor::SetPreRenderCallback( CallbackBase* callback )
   mImpl->SetPreRenderCallback( callback );
 }
 
-void Adaptor::SetUseHardwareVSync(bool useHardware)
-{
-  mImpl->SetUseHardwareVSync( useHardware );
-}
-
 Adaptor& Adaptor::Get()
 {
   return Internal::Adaptor::Adaptor::Get();
@@ -158,11 +205,6 @@ void Adaptor::NotifyLanguageChanged()
   mImpl->NotifyLanguageChanged();
 }
 
-void Adaptor::SetMinimumPinchDistance(float distance)
-{
-  mImpl->SetMinimumPinchDistance(distance);
-}
-
 void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
 {
   mImpl->FeedTouchPoint(point, timeStamp);
@@ -183,6 +225,16 @@ void Adaptor::SceneCreated()
   mImpl->SceneCreated();
 }
 
+void Adaptor::SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
+{
+  mImpl->SurfaceResizePrepare( surface, surfaceSize );
+}
+
+void Adaptor::SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
+{
+  mImpl->SurfaceResizeComplete( surface, surfaceSize );
+}
+
 void Adaptor::RenderOnce()
 {
   mImpl->RenderOnce();
@@ -193,6 +245,31 @@ const LogFactoryInterface& Adaptor::GetLogFactory()
   return mImpl->GetLogFactory();
 }
 
+void Adaptor::RegisterProcessor( Integration::Processor& processor )
+{
+  mImpl->RegisterProcessor( processor );
+}
+
+void Adaptor::UnregisterProcessor( Integration::Processor& processor )
+{
+  mImpl->UnregisterProcessor( processor );
+}
+
+Dali::WindowContainer Adaptor::GetWindows() const
+{
+  return mImpl->GetWindows();
+}
+
+void Adaptor::OnWindowShown()
+{
+  mImpl->OnWindowShown();
+}
+
+void Adaptor::OnWindowHidden()
+{
+  mImpl->OnWindowHidden();
+}
+
 Adaptor::Adaptor()
 : mImpl( NULL )
 {