[Tizen] Add screen and client rotation itself function
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / ubuntu-x11 / window-base-ecore-x.cpp
index e2f650b..77567d4 100755 (executable)
@@ -20,6 +20,7 @@
 
 // INTERNAL HEADERS
 #include <dali/internal/window-system/common/window-impl.h>
+#include <dali/internal/window-system/common/window-system.h>
 #include <dali/internal/window-system/common/window-render-surface.h>
 #include <dali/internal/window-system/ubuntu-x11/ecore-x-types.h>
 
@@ -263,6 +264,8 @@ WindowBaseEcoreX::~WindowBaseEcoreX()
   if( mOwnSurface )
   {
     ecore_x_window_free( mEcoreWindow );
+
+    WindowSystem::Shutdown();
   }
 }
 
@@ -274,6 +277,8 @@ void WindowBaseEcoreX::Initialize( PositionSize positionSize, Any surface, bool
   // if the surface is empty, create a new one.
   if( surfaceId == 0 )
   {
+    WindowSystem::Initialize();
+
     // we own the surface about to created
     mOwnSurface = true;
     CreateWindow( positionSize, isTransparent );
@@ -701,11 +706,11 @@ void WindowBaseEcoreX::Activate()
   ecore_x_netwm_client_active_request( ecore_x_window_root_get( mEcoreWindow ), mEcoreWindow, 1 /* request type, 1:application, 2:pager */, 0 );
 }
 
-void WindowBaseEcoreX::SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations )
+void WindowBaseEcoreX::SetAvailableAnlges( const std::vector< int >& angles )
 {
 }
 
-void WindowBaseEcoreX::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
+void WindowBaseEcoreX::SetPreferredAngle( int angle )
 {
 }
 
@@ -829,6 +834,11 @@ void WindowBaseEcoreX::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVer
   dpiVertical   = ecore_x_dpi_get();
 }
 
+int WindowBaseEcoreX::GetOrientation() const
+{
+  return 0;
+}
+
 int WindowBaseEcoreX::GetScreenRotationAngle()
 {
   return 0;
@@ -838,6 +848,11 @@ void WindowBaseEcoreX::SetWindowRotationAngle( int degree )
 {
 }
 
+int WindowBaseEcoreX::GetWindowRotationAngle()
+{
+  return 0;
+}
+
 void WindowBaseEcoreX::WindowRotationCompleted( int degree, int width, int height )
 {
 }
@@ -888,6 +903,22 @@ void WindowBaseEcoreX::CreateWindow( PositionSize positionSize, bool isTranspare
  }
 }
 
+void WindowBaseEcoreX::SetParent( WindowBase* parentWinBase )
+{
+  Ecore_X_Window ecoreParent = 0;
+  if( parentWinBase )
+  {
+    WindowBaseEcoreX* winBaseEcoreX = static_cast<WindowBaseEcoreX*>( parentWinBase );
+    ecoreParent = winBaseEcoreX->mEcoreWindow;
+    ecore_x_icccm_transient_for_set( mEcoreWindow, ecoreParent );
+  }
+  else
+  {
+    ecoreParent = 0;
+    ecore_x_icccm_transient_for_unset( mEcoreWindow );
+  }
+}
+
 } // namespace Adaptor
 
 } // namespace Internal