X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fwindow-impl.cpp;h=fbf04ca1326122f7dde255e67bf8763249be1ae6;hb=4a9e4c30b48b78a9767fe0810fad00ba9169e36d;hp=981ede0748435eb04ff5763dcf6ae96e2627ad47;hpb=eec8bf0f012b76a127f148f2f77daf2f2ddf20ea;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index 981ede0..fbf04ca 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -77,13 +77,18 @@ Window::Window() mOpaqueState( false ), mResizeEnabled( false ), mType( Dali::Window::NORMAL ), + mParentWindow( NULL ), mPreferredOrientation( Dali::Window::PORTRAIT ), mRotationAngle( 0 ), mWindowWidth( 0 ), mWindowHeight( 0 ), mFocusChangedSignal(), mResizedSignal(), - mDeleteRequestSignal() + mDeleteRequestSignal(), + mFocusChangeSignal(), + mResizeSignal(), + mVisibilityChangedSignal(), + mTransitionEffectEventSignal() { } @@ -110,6 +115,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 ); @@ -288,6 +294,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 ); @@ -303,6 +312,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 ); @@ -451,9 +463,19 @@ void Window::SetSize( Dali::Window::WindowSize size ) { Uint16Pair newSize( newRect.width, newRect.height ); + bool forceUpdate = false; + if( mWindowBase->IsEglWindowRotationSupported() ) + { + forceUpdate = true; + } + + SurfaceResized( forceUpdate ); + mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize ); + Dali::Window handle( this ); mResizedSignal.Emit( newSize ); + mResizeSignal.Emit( handle, newSize ); mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize ); } @@ -505,10 +527,19 @@ void Window::SetPositionSize( PositionSize positionSize ) { Uint16Pair newSize( newRect.width, newRect.height ); + bool forceUpdate = false; + if( mWindowBase->IsEglWindowRotationSupported() ) + { + forceUpdate = true; + } + + SurfaceResized( forceUpdate ); + mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize ); + Dali::Window handle( this ); mResizedSignal.Emit( newSize ); - + mResizeSignal.Emit( handle, newSize ); mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize ); } } @@ -553,6 +584,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 ); @@ -565,6 +599,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 ); @@ -573,12 +610,20 @@ void Window::OnIconifyChanged( bool iconified ) void Window::OnFocusChanged( bool focusIn ) { + Dali::Window handle( this ); mFocusChangedSignal.Emit( focusIn ); + mFocusChangeSignal.Emit( handle, focusIn ); } void Window::OnOutputTransformed() { + bool forceUpdate = false; + if( mWindowBase->IsEglWindowRotationSupported() ) + { + forceUpdate = true; + } PositionSize positionSize = mSurface->GetPositionSize(); + SurfaceResized( forceUpdate ); mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); } @@ -588,6 +633,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 ); @@ -614,12 +665,22 @@ void Window::OnRotation( const RotationEvent& rotation ) mWindowSurface->RequestRotation( mRotationAngle, mWindowWidth, mWindowHeight ); - mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mRotationAngle, mWindowHeight ) ); + bool forceUpdate = false; + if( mWindowBase->IsEglWindowRotationSupported() ) + { + forceUpdate = true; + } + + SurfaceResized( forceUpdate ); + + mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) ); // Emit signal - mResizedSignal.Emit( Dali::Window::WindowSize( mRotationAngle, mWindowHeight ) ); + Dali::Window handle( this ); + mResizedSignal.Emit( Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) ); + mResizeSignal.Emit( handle, Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) ); - mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( mRotationAngle, mWindowHeight ) ); + mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) ); } void Window::OnPause() @@ -686,6 +747,32 @@ Dali::Window Window::Get( Dali::Actor actor ) return Dali::Window( windowImpl ); } +void Window::SetParent( Dali::Window& parent ) +{ + if ( DALI_UNLIKELY( parent ) ) + { + mParentWindow = parent; + Dali::Window self = Dali::Window( this ); + // check circular parent window setting + if ( Dali::DevelWindow::GetParent( parent ) == self ) + { + Dali::DevelWindow::Unparent( parent ); + } + mWindowBase->SetParent( GetImplementation( mParentWindow ).mWindowBase ); + } +} + +void Window::Unparent() +{ + mWindowBase->SetParent( nullptr ); + mParentWindow.Reset(); +} + +Dali::Window Window::GetParent() +{ + return mParentWindow; +} + } // Adaptor } // Internal