Revert "[Tizen] Revert "Support screen rotation""
[platform/core/uifw/dali-adaptor.git] / adaptors / common / adaptor.cpp
index 944650c..847f42e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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 <accessibility-manager.h>
+#include <accessibility-adaptor.h>
 #include <imf-manager.h>
 #include <style-monitor.h>
-#include <window.h>
 #include <render-surface.h>
 #include <adaptor-impl.h>
-#include <window-impl.h>
 
 namespace Dali
 {
@@ -40,11 +38,7 @@ Adaptor& Adaptor::New( Window window )
 
 Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
 {
-  Any winId = window.GetNativeHandle();
-
-  Internal::Adaptor::Window& windowImpl = GetImplementation(window);
-  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( winId, windowImpl.GetSurface(), configuration );
-  windowImpl.SetAdaptor(*adaptor);
+  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, configuration, NULL );
   return *adaptor;
 }
 
@@ -56,7 +50,7 @@ Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
 Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration )
 {
   Dali::RenderSurface* pSurface = const_cast<Dali::RenderSurface *>(&surface);
-  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration );
+  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration, NULL );
   return *adaptor;
 }
 
@@ -90,6 +84,11 @@ bool Adaptor::AddIdle( CallbackBase* callback )
   return mImpl->AddIdle( callback );
 }
 
+void Adaptor::RemoveIdle( CallbackBase* callback )
+{
+  mImpl->RemoveIdle( callback );
+}
+
 void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
 {
   mImpl->ReplaceSurface(nativeWindow, surface);
@@ -110,6 +109,11 @@ RenderSurface& Adaptor::GetSurface()
   return mImpl->GetSurface();
 }
 
+Any Adaptor::GetNativeWindowHandle()
+{
+  return mImpl->GetNativeWindowHandle();
+}
+
 void Adaptor::ReleaseSurfaceLock()
 {
   mImpl->ReleaseSurfaceLock();
@@ -135,6 +139,11 @@ bool Adaptor::IsAvailable()
   return Internal::Adaptor::Adaptor::IsAvailable();
 }
 
+void Adaptor::NotifySceneCreated()
+{
+  mImpl->NotifySceneCreated();
+}
+
 void Adaptor::NotifyLanguageChanged()
 {
   mImpl->NotifyLanguageChanged();
@@ -160,6 +169,21 @@ void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
   mImpl->FeedKeyEvent(keyEvent);
 }
 
+void Adaptor::SceneCreated()
+{
+  mImpl->SceneCreated();
+}
+
+void Adaptor::SetViewMode( ViewMode mode )
+{
+  mImpl->SetViewMode( mode );
+}
+
+void Adaptor::SetStereoBase(  float stereoBase )
+{
+  mImpl->SetStereoBase( stereoBase );
+}
+
 Adaptor::Adaptor()
 : mImpl( NULL )
 {