[4.0] Supports screen rotation.
[platform/core/uifw/dali-adaptor.git] / adaptors / ecore / wayland / window-impl-ecore-wl.cpp
old mode 100644 (file)
new mode 100755 (executable)
index b3343f8..8437a6b
@@ -227,10 +227,10 @@ struct Window::EventHandler
       ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) );
       if( wlSurface )
       {
-        wlSurface->OutputTransformed();
+        int orientation = wlSurface->OutputTransformed();
 
         PositionSize positionSize = wlSurface->GetPositionSize();
-        handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+        handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ), orientation );
         handler->mWindow->mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
       }
     }
@@ -251,10 +251,10 @@ struct Window::EventHandler
       ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) );
       if( wlSurface )
       {
-        wlSurface->OutputTransformed();
+        int orientation = wlSurface->OutputTransformed();
 
         PositionSize positionSize = wlSurface->GetPositionSize();
-        handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+        handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ), orientation );
         handler->mWindow->mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
       }
     }
@@ -780,16 +780,22 @@ void Window::Raise()
 {
   // Use ecore_wl_window_activate to prevent the window shown without rendering
   ecore_wl_window_activate( mEventHandler->mEcoreWindow );
+
+  DALI_LOG_RELEASE_INFO( "Window::Raise is called.\n" );
 }
 
 void Window::Lower()
 {
   ecore_wl_window_lower( mEventHandler->mEcoreWindow );
+
+  DALI_LOG_RELEASE_INFO( "Window::Lower is called.\n" );
 }
 
 void Window::Activate()
 {
   ecore_wl_window_activate( mEventHandler->mEcoreWindow );
+
+  DALI_LOG_RELEASE_INFO( "Window::Activate is called.\n" );
 }
 
 Dali::DragAndDropDetector Window::GetDragAndDropDetector() const
@@ -849,11 +855,11 @@ void Window::AddAvailableOrientation(Dali::Window::WindowOrientation orientation
 {
   bool found = false;
 
-  if ((orientation >= Dali::Window::PORTRAIT) && (orientation <= Dali::Window::LANDSCAPE_INVERSE))
+  if ( orientation <= Dali::Window::LANDSCAPE_INVERSE )
   {
-    for( std::size_t i=0; i<mAvailableOrientations.size(); i++ )
+    for( std::size_t i = 0; i < mAvailableOrientations.size(); i++ )
     {
-      if(mAvailableOrientations[i] == orientation)
+      if( mAvailableOrientations[i] == orientation )
       {
         found = true;
         break;
@@ -884,7 +890,7 @@ void Window::RemoveAvailableOrientation(Dali::Window::WindowOrientation orientat
 
 void Window::SetAvailableOrientations(const std::vector<Dali::Window::WindowOrientation>& orientations)
 {
-  int rotations[4];
+  int rotations[4] = { 0 };
   for( std::size_t i = 0; i < mAvailableOrientations.size(); ++i )
   {
     rotations[i] = static_cast< int >( mAvailableOrientations[i] );
@@ -926,7 +932,7 @@ void Window::Show()
   mVisible = true;
   ecore_wl_window_show( mEventHandler->mEcoreWindow );
 
-  DALI_LOG_RELEASE_INFO( "Window::Show: mIconified [%d]\n", mIconified );
+  DALI_LOG_RELEASE_INFO( "Window::Show is called : mIconified [%d]\n", mIconified );
 
   if( !mIconified )
   {
@@ -943,7 +949,7 @@ void Window::Hide()
   mVisible = false;
   ecore_wl_window_hide( mEventHandler->mEcoreWindow );
 
-  DALI_LOG_RELEASE_INFO( "Window::Hide: mIconified [%d]\n", mIconified );
+  DALI_LOG_RELEASE_INFO( "Window::Hide is called : mIconified [%d]\n", mIconified );
 
   if( !mIconified )
   {