X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fwindow-impl.cpp;h=2ef09622963b2d151c19cbc603e7a933eeca488e;hb=94544683debb6c663293c39eac5e091f27e1a4e7;hp=981ede0748435eb04ff5763dcf6ae96e2627ad47;hpb=333492a99055df20f141a5160471b469ebb05a2c;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..2ef0962 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -43,6 +43,7 @@ #include #include #include +#include namespace Dali { @@ -77,18 +78,32 @@ 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() { } Window::~Window() { + if ( mAdaptor ) + { + auto bridge = Accessibility::Bridge::GetCurrentBridge(); + auto accessible2 = mScene.GetRootLayer(); + auto accessible = Accessibility::Accessible::Get( accessible2 ); + bridge->RemoveTopLevelWindow( accessible ); + + mAdaptor->RemoveWindow( this ); + mAdaptor = NULL; + } + if ( mEventHandler ) { mEventHandler->RemoveObserver( *this ); @@ -130,6 +145,14 @@ void Window::OnAdaptorSet(Dali::Adaptor& adaptor) { mEventHandler = EventHandlerPtr(new EventHandler( mWindowSurface, *mAdaptor ) ); mEventHandler->AddObserver( *this ); + + auto bridge = Accessibility::Bridge::GetCurrentBridge(); + auto v = mScene.GetRootLayer(); + auto accessible = Accessibility::Accessible::Get( v, true ); + bridge->AddTopLevelWindow( accessible ); + + //FIXME: line below is temporary solution for missing "activate" signal and should be removed + Show(); } void Window::OnSurfaceSet( Dali::RenderSurfaceInterface* surface ) @@ -451,9 +474,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 +538,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 ); } } @@ -573,12 +615,32 @@ void Window::OnIconifyChanged( bool iconified ) void Window::OnFocusChanged( bool focusIn ) { + Dali::Window handle( this ); mFocusChangedSignal.Emit( focusIn ); + mFocusChangeSignal.Emit( handle, focusIn ); + + if (auto b = Dali::Accessibility::Bridge::GetCurrentBridge()) + { + if (focusIn) + { + b->ApplicationShown(); + } + else + { + b->ApplicationHidden(); + } + } } 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 ) ); } @@ -614,12 +676,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 +758,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 grandParent = Dali::DevelWindow::GetParent( parent ); + // check circular parent window setting + if ( DALI_UNLIKELY( grandParent ) && mWindowBase->IsMatchedWindow( grandParent.GetNativeHandle() ) ) + { + Dali::DevelWindow::Unparent( parent ); + } + mWindowBase->SetParent( parent.GetNativeHandle() ); + } +} + +void Window::Unparent() +{ + Any parent; + mWindowBase->SetParent( parent ); +} + +Dali::Window Window::GetParent() +{ + return mParentWindow; +} + } // Adaptor } // Internal