[Tizen] Add Effect Start/End signal
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-impl.cpp
index 78d820c..7e9a4fd 100644 (file)
 #include <dali/devel-api/adaptor-framework/orientation.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 
-#ifdef DALI_ADAPTOR_COMPILATION
-#include <dali/integration-api/render-surface-interface.h>
-#else
-#include <dali/integration-api/adaptors/render-surface-interface.h>
-#endif
-
 // INTERNAL HEADERS
+#include <dali/integration-api/adaptor-framework/render-surface-interface.h>
 #include <dali/internal/window-system/common/event-handler.h>
 #include <dali/internal/window-system/common/orientation-impl.h>
 #include <dali/internal/window-system/common/render-surface-factory.h>
@@ -86,7 +81,9 @@ Window::Window()
   mResizedSignal(),
   mDeleteRequestSignal(),
   mFocusChangeSignal(),
-  mResizeSignal()
+  mResizeSignal(),
+  mVisibilityChangedSignal(),
+  mTransitionEffectEventSignal()
 {
 }
 
@@ -113,6 +110,7 @@ void Window::Initialize(const PositionSize& positionSize, const std::string& nam
   mWindowBase->IconifyChangedSignal().Connect( this, &Window::OnIconifyChanged );
   mWindowBase->FocusChangedSignal().Connect( this, &Window::OnFocusChanged );
   mWindowBase->DeleteRequestSignal().Connect( this, &Window::OnDeleteRequest );
+  mWindowBase->TransitionEffectEventSignal().Connect( this, &Window::OnTransitionEffectEvent );
 
   mWindowSurface->OutputTransformedSignal().Connect( this, &Window::OnOutputTransformed );
 
@@ -291,6 +289,9 @@ void Window::Show()
   {
     WindowVisibilityObserver* observer( mAdaptor );
     observer->OnWindowShown();
+
+    Dali::Window handle( this );
+    mVisibilityChangedSignal.Emit( handle, true );
   }
 
   DALI_LOG_RELEASE_INFO( "Window (%p) Show(): iconified = %d\n", this, mIconified );
@@ -306,6 +307,9 @@ void Window::Hide()
   {
     WindowVisibilityObserver* observer( mAdaptor );
     observer->OnWindowHidden();
+
+    Dali::Window handle( this );
+    mVisibilityChangedSignal.Emit( handle, false );
   }
 
   DALI_LOG_RELEASE_INFO( "Window (%p) Hide(): iconified = %d\n", this, mIconified );
@@ -454,7 +458,13 @@ void Window::SetSize( Dali::Window::WindowSize size )
   {
     Uint16Pair newSize( newRect.width, newRect.height );
 
-    SurfaceResized();
+    bool forceUpdate = false;
+    if( mWindowBase->IsEglWindowRotationSupported() )
+    {
+      forceUpdate = true;
+    }
+
+    SurfaceResized( forceUpdate );
 
     mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize );
 
@@ -512,7 +522,13 @@ void Window::SetPositionSize( PositionSize positionSize )
   {
     Uint16Pair newSize( newRect.width, newRect.height );
 
-    SurfaceResized();
+    bool forceUpdate = false;
+    if( mWindowBase->IsEglWindowRotationSupported() )
+    {
+      forceUpdate = true;
+    }
+
+    SurfaceResized( forceUpdate );
 
     mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize );
 
@@ -563,6 +579,9 @@ void Window::OnIconifyChanged( bool iconified )
     {
       WindowVisibilityObserver* observer( mAdaptor );
       observer->OnWindowHidden();
+
+      Dali::Window handle( this );
+      mVisibilityChangedSignal.Emit( handle, false );
     }
 
     DALI_LOG_RELEASE_INFO( "Window (%p) Iconified: visible = %d\n", this, mVisible );
@@ -575,6 +594,9 @@ void Window::OnIconifyChanged( bool iconified )
     {
       WindowVisibilityObserver* observer( mAdaptor );
       observer->OnWindowShown();
+
+      Dali::Window handle( this );
+      mVisibilityChangedSignal.Emit( handle, true );
     }
 
     DALI_LOG_RELEASE_INFO( "Window (%p) Deiconified: visible = %d\n", this, mVisible );
@@ -590,8 +612,13 @@ void Window::OnFocusChanged( bool focusIn )
 
 void Window::OnOutputTransformed()
 {
+  bool forceUpdate = false;
+  if( mWindowBase->IsEglWindowRotationSupported() )
+  {
+    forceUpdate = true;
+  }
   PositionSize positionSize = mSurface->GetPositionSize();
-  SurfaceResized();
+  SurfaceResized( forceUpdate );
   mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
   mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
 }
@@ -601,6 +628,12 @@ void Window::OnDeleteRequest()
   mDeleteRequestSignal.Emit();
 }
 
+void Window::OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindow::EffectType type )
+{
+  Dali::Window handle( this );
+  mTransitionEffectEventSignal.Emit( handle, state, type );
+}
+
 void Window::OnTouchPoint( Dali::Integration::Point& point, int timeStamp )
 {
   FeedTouchPoint( point, timeStamp );
@@ -627,7 +660,13 @@ void Window::OnRotation( const RotationEvent& rotation )
 
   mWindowSurface->RequestRotation( mRotationAngle, mWindowWidth, mWindowHeight );
 
-  SurfaceResized();
+  bool forceUpdate = false;
+  if( mWindowBase->IsEglWindowRotationSupported() )
+  {
+    forceUpdate = true;
+  }
+
+  SurfaceResized( forceUpdate );
 
   mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) );