Revert "[Tizen] Revert "Support multiple window rendering""
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / common / application-impl.cpp
index 47c42d5..8e90b04 100644 (file)
 #include <dali/internal/adaptor/common/framework.h>
 #include <dali/internal/system/common/singleton-service-impl.h>
 #include <dali/internal/adaptor/common/lifecycle-controller-impl.h>
+#include <dali/internal/window-system/common/window-impl.h>
 #include <dali/internal/window-system/common/window-render-surface.h>
 
+#undef Status
+
 namespace Dali
 {
 
@@ -48,6 +51,13 @@ namespace Internal
 namespace Adaptor
 {
 
+namespace
+{
+
+const float DEFAULT_STEREO_BASE( 65.0f );
+
+} // unnamed namespace
+
 ApplicationPtr Application::gPreInitializedApplication( NULL );
 
 ApplicationPtr Application::New(
@@ -101,7 +111,9 @@ Application::Application( int* argc, char** argv[], const std::string& styleshee
   mEnvironmentOptions(),
   mWindowPositionSize( positionSize ),
   mLaunchpadState( Launchpad::NONE ),
-  mSlotDelegate( this )
+  mSlotDelegate( this ),
+  mViewMode( MONO ),
+  mStereoBase( DEFAULT_STEREO_BASE )
 {
   // Get mName from environment options
   mMainWindowName = mEnvironmentOptions.GetWindowName();
@@ -226,17 +238,6 @@ void Application::DoInit()
     mAdaptor->SetUseHardwareVSync(false);
   }
 
-  Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetStereoBase( mCommandLineOptions->stereoBase );
-  if( mCommandLineOptions->viewMode != 0 )
-  {
-    ViewMode viewMode = MONO;
-    if( mCommandLineOptions->viewMode <= STEREO_INTERLACED )
-    {
-      viewMode = static_cast<ViewMode>( mCommandLineOptions->viewMode );
-    }
-    Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetViewMode( viewMode );
-  }
-
   if( ! mStylesheet.empty() )
   {
     Dali::StyleMonitor::Get().SetTheme( mStylesheet );
@@ -411,22 +412,22 @@ Dali::Window Application::GetWindow()
 
 void Application::SetViewMode( ViewMode viewMode )
 {
-  Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetViewMode( viewMode );
+  mViewMode = viewMode;
 }
 
 ViewMode Application::GetViewMode() const
 {
-  return Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).GetViewMode();
+  return mViewMode;
 }
 
 void Application::SetStereoBase( float stereoBase )
 {
-  Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetStereoBase( stereoBase );
+  mStereoBase = stereoBase;
 }
 
 float Application::GetStereoBase() const
 {
-  return Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).GetStereoBase();
+  return mStereoBase;
 }
 
 void Application::ReplaceWindow( const PositionSize& positionSize, const std::string& name )
@@ -441,7 +442,7 @@ void Application::ReplaceWindow( const PositionSize& positionSize, const std::st
     GetImplementation( newWindow ).SetIndicatorVisibleMode( static_cast< Dali::Window::IndicatorVisibleMode >( indicatorVisibleMode ) );
   }
 
-  Dali::RenderSurface* renderSurface = windowImpl.GetSurface();
+  Internal::Adaptor::WindowRenderSurface* renderSurface = windowImpl.GetSurface();
 
   Any nativeWindow = newWindow.GetNativeHandle();
   Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface(nativeWindow, *renderSurface);
@@ -454,6 +455,11 @@ std::string Application::GetResourcePath()
   return Internal::Adaptor::Framework::GetResourcePath();
 }
 
+std::string Application::GetDataPath()
+{
+  return Internal::Adaptor::Framework::GetDataPath();
+}
+
 void Application::SetStyleSheet( const std::string& stylesheet )
 {
   mStylesheet = stylesheet;