-void Window::RotationDone( int orientation, int width, int height )
-{
- mSurface->RequestRotation( orientation, width, height );
-
- mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( width, height ) );
-
- // Emit signal
- mResizedSignal.Emit( Dali::Window::WindowSize( width, height ) );
-
- mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( width, height ) );
-}
-
-void Window::DoShowIndicator( Dali::Window::WindowOrientation lastOrientation )
-{
- if( mIndicator == NULL )
- {
- if( mIndicatorVisible != Dali::Window::INVISIBLE )
- {
- auto windowFactory = Dali::Internal::Adaptor::GetWindowFactory();
- mIndicator = windowFactory->CreateIndicator( mAdaptor, mIndicatorOrientation, this );
- if( mIndicator )
- {
- mIndicator->SetOpacityMode( mIndicatorOpacityMode );
- Dali::Actor actor = mIndicator->GetActor();
- SetIndicatorActorRotation();
- }
- }
- // else don't create a hidden indicator
- }
- else // Already have indicator
- {
- if( mIndicatorVisible == Dali::Window::VISIBLE )
- {
- // If we are resuming, and rotation has changed,
- if( mIndicatorIsShown == false && mIndicatorOrientation != mNextIndicatorOrientation )
- {
- // then close current indicator and open new one
- mShowRotatedIndicatorOnClose = true;
- mIndicator->Close(); // May synchronously call IndicatorClosed() callback & 1 level of recursion
- // Don't show actor - will contain indicator for old orientation.
- }
- }
- }
-
- // set indicator visible mode
- if( mIndicator != NULL )
- {
- mIndicator->SetVisible( mIndicatorVisible );
- }
-
- bool show = (mIndicatorVisible != Dali::Window::INVISIBLE );
- SetIndicatorProperties( show, lastOrientation );
- mIndicatorIsShown = show;
-}
-
-void Window::DoRotateIndicator( Dali::Window::WindowOrientation orientation )
-{
- if( mIndicatorIsShown )
- {
- mShowRotatedIndicatorOnClose = true;
- mNextIndicatorOrientation = orientation;
- if( mIndicator )
- {
- mIndicator->Close(); // May synchronously call IndicatorClosed() callback
- }
- }
- else
- {
- // Save orientation for when the indicator is next shown
- mShowRotatedIndicatorOnClose = false;
- mNextIndicatorOrientation = orientation;
- }
-}
-
-void Window::SetIndicatorActorRotation()
-{
- DALI_LOG_TRACE_METHOD( gWindowLogFilter );
- if( mIndicator )
- {
- Dali::Actor actor = mIndicator->GetActor();
- switch( mIndicatorOrientation )
- {
- case Dali::Window::PORTRAIT:
- actor.SetParentOrigin( ParentOrigin::TOP_CENTER );
- actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- actor.SetOrientation( Degree(0), Vector3::ZAXIS );
- break;
- case Dali::Window::PORTRAIT_INVERSE:
- actor.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- actor.SetOrientation( Degree(180), Vector3::ZAXIS );
- break;
- case Dali::Window::LANDSCAPE:
- actor.SetParentOrigin( ParentOrigin::CENTER_LEFT );
- actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- actor.SetOrientation( Degree(270), Vector3::ZAXIS );
- break;
- case Dali::Window::LANDSCAPE_INVERSE:
- actor.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
- actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- actor.SetOrientation( Degree(90), Vector3::ZAXIS );
- break;
- }
- }
-}
-
-void Window::SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation )
-{
- mWindowBase->SetIndicatorProperties( isShow, lastOrientation );
-}
-