Merge "[Tizen]Add KeyEventGeneratedSignal for Get KeyEvent normally" into tizen
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / common / adaptor.cpp
index a0747df..a183350 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/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 +44,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;
 }
 
@@ -88,9 +120,15 @@ void Adaptor::RemoveIdle( CallbackBase* callback )
   mImpl->RemoveIdle( callback );
 }
 
-void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
+void Adaptor::ReplaceSurface( Window window, Dali::RenderSurfaceInterface& surface )
 {
-  mImpl->ReplaceSurface(nativeWindow, 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( window, surface );
 }
 
 Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
@@ -103,7 +141,7 @@ Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
   return mImpl->LanguageChangedSignal();
 }
 
-RenderSurface& Adaptor::GetSurface()
+Dali::RenderSurfaceInterface& Adaptor::GetSurface()
 {
   return mImpl->GetSurface();
 }
@@ -158,11 +196,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);
@@ -193,6 +226,16 @@ 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 );
+}
+
 Adaptor::Adaptor()
 : mImpl( NULL )
 {