2 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/window-system/common/window-impl.h>
22 #include <dali/integration-api/core.h>
23 #include <dali/public-api/actors/actor.h>
24 #include <dali/public-api/actors/layer.h>
25 #include <dali/public-api/actors/camera-actor.h>
26 #include <dali/public-api/render-tasks/render-task.h>
27 #include <dali/public-api/render-tasks/render-task-list.h>
28 #include <dali/public-api/rendering/frame-buffer.h>
29 #include <dali/devel-api/adaptor-framework/orientation.h>
30 #include <dali/integration-api/events/touch-event-integ.h>
33 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
34 #include <dali/internal/window-system/common/event-handler.h>
35 #include <dali/internal/window-system/common/orientation-impl.h>
36 #include <dali/internal/window-system/common/render-surface-factory.h>
37 #include <dali/internal/window-system/common/window-factory.h>
38 #include <dali/internal/window-system/common/window-base.h>
39 #include <dali/internal/window-system/common/window-system.h>
40 #include <dali/internal/window-system/common/window-render-surface.h>
41 #include <dali/internal/window-system/common/window-visibility-observer.h>
53 #if defined(DEBUG_ENABLED)
54 Debug::Filter* gWindowLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_WINDOW" );
57 } // unnamed namespace
59 Window* Window::New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
62 return Window::New(surface, positionSize, name, className, isTransparent);
65 Window* Window::New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
67 Window* window = new Window();
68 window->mIsTransparent = isTransparent;
69 window->Initialize(surface, positionSize, name, className);
74 : mWindowSurface( nullptr ),
76 mIsTransparent( false ),
77 mIsFocusAcceptable( true ),
79 mOpaqueState( false ),
80 mResizeEnabled( false ),
81 mType( Dali::Window::NORMAL ),
82 mParentWindow( NULL ),
83 mPreferredAngle( Dali::Window::NO_ORIENTATION_PREFERENCE ),
87 mOrientationMode( Internal::Adaptor::Window::OrientationMode::PORTRAIT ),
88 mNativeWindowId( -1 ),
89 mFocusChangedSignal(),
91 mDeleteRequestSignal(),
94 mVisibilityChangedSignal(),
95 mTransitionEffectEventSignal()
103 mEventHandler->RemoveObserver( *this );
107 void Window::Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className)
109 // Create a window render surface
110 auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
111 mSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, mIsTransparent );
112 mWindowSurface = static_cast<WindowRenderSurface*>( mSurface.get() );
115 mWindowBase = mWindowSurface->GetWindowBase();
118 mWindowBase->IconifyChangedSignal().Connect( this, &Window::OnIconifyChanged );
119 mWindowBase->FocusChangedSignal().Connect( this, &Window::OnFocusChanged );
120 mWindowBase->DeleteRequestSignal().Connect( this, &Window::OnDeleteRequest );
121 mWindowBase->TransitionEffectEventSignal().Connect( this, &Window::OnTransitionEffectEvent );
123 mWindowSurface->OutputTransformedSignal().Connect( this, &Window::OnOutputTransformed );
125 if( !positionSize.IsEmpty() )
127 AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
128 mResizeEnabled = true;
131 SetClass( name, className );
133 mWindowSurface->Map();
135 mOrientation = Orientation::New( this );
137 // Get OrientationMode
138 int screenWidth, screenHeight;
139 WindowSystem::GetScreenSize( screenWidth, screenHeight );
140 if( screenWidth > screenHeight )
142 mOrientationMode = Internal::Adaptor::Window::OrientationMode::LANDSCAPE;
146 mOrientationMode = Internal::Adaptor::Window::OrientationMode::PORTRAIT;
149 mNativeWindowId = mWindowBase->GetNativeWindowId();
152 void Window::OnAdaptorSet(Dali::Adaptor& adaptor)
154 mEventHandler = EventHandlerPtr(new EventHandler( mWindowSurface, *mAdaptor ) );
155 mEventHandler->AddObserver( *this );
158 void Window::OnSurfaceSet( Dali::RenderSurfaceInterface* surface )
160 mWindowSurface = static_cast<WindowRenderSurface*>( surface );
163 void Window::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode )
167 void Window::SetIndicatorBgOpacity( Dali::Window::IndicatorBgOpacity opacityMode )
171 void Window::RotateIndicator( Dali::Window::WindowOrientation orientation )
175 void Window::SetClass( std::string name, std::string className )
178 mClassName = className;
179 mWindowBase->SetClass( name, className );
182 std::string Window::GetClassName() const
189 mWindowBase->Raise();
190 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Raise() \n", this, mNativeWindowId );
195 mWindowBase->Lower();
196 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Lower() \n", this, mNativeWindowId );
199 void Window::Activate()
201 mWindowBase->Activate();
202 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Activate() \n", this, mNativeWindowId );
205 uint32_t Window::GetLayerCount() const
207 return mScene.GetLayerCount();
210 Dali::Layer Window::GetLayer( uint32_t depth ) const
212 return mScene.GetLayer( depth );
215 Dali::RenderTaskList Window::GetRenderTaskList() const
217 return mScene.GetRenderTaskList();
220 void Window::AddAvailableOrientation( Dali::Window::WindowOrientation orientation )
222 if( IsOrientationAvailable( orientation ) == false )
228 int convertedAngle = ConvertToAngle( orientation );
229 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), AddAvailableOrientation: %d\n", this, mNativeWindowId, convertedAngle );
230 for( std::size_t i = 0; i < mAvailableAngles.size(); i++ )
232 if( mAvailableAngles[i] == convertedAngle )
241 mAvailableAngles.push_back( convertedAngle );
242 SetAvailableAnlges( mAvailableAngles );
246 void Window::RemoveAvailableOrientation( Dali::Window::WindowOrientation orientation )
248 if( IsOrientationAvailable( orientation ) == false )
253 int convertedAngle = ConvertToAngle( orientation );
254 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), RemoveAvailableOrientation: %d\n", this, mNativeWindowId, convertedAngle );
255 for( std::vector< int >::iterator iter = mAvailableAngles.begin();
256 iter != mAvailableAngles.end(); ++iter )
258 if( *iter == convertedAngle )
260 mAvailableAngles.erase( iter );
265 SetAvailableAnlges( mAvailableAngles );
268 void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
270 if( orientation < Dali::Window::NO_ORIENTATION_PREFERENCE || orientation > Dali::Window::LANDSCAPE_INVERSE )
272 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::CheckOrientation: Invalid input orientation [%d]\n", orientation );
275 mPreferredAngle = ConvertToAngle( orientation );
276 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), SetPreferredOrientation: %d\n", this, mNativeWindowId, mPreferredAngle );
277 mWindowBase->SetPreferredAngle( mPreferredAngle );
280 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
282 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), GetPreferredOrientation: %d\n", this, mNativeWindowId, mPreferredAngle );
283 Dali::Window::WindowOrientation preferredOrientation = ConvertToOrientation( mPreferredAngle );
284 return preferredOrientation;
287 void Window::SetAvailableAnlges( const std::vector< int >& angles )
289 if( angles.size() > 4 )
291 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetAvailableAnlges: Invalid vector size! [%d]\n", angles.size() );
295 mWindowBase->SetAvailableAnlges( angles );
298 int Window::ConvertToAngle( Dali::Window::WindowOrientation orientation )
300 int convertAngle = static_cast< int >( orientation );
301 if( mOrientationMode == Internal::Adaptor::Window::OrientationMode::LANDSCAPE )
303 switch( orientation )
305 case Dali::Window::LANDSCAPE:
310 case Dali::Window::PORTRAIT:
315 case Dali::Window::LANDSCAPE_INVERSE:
320 case Dali::Window::PORTRAIT_INVERSE:
325 case Dali::Window::NO_ORIENTATION_PREFERENCE:
335 Dali::Window::WindowOrientation Window::ConvertToOrientation( int angle ) const
337 Dali::Window::WindowOrientation orientation = static_cast< Dali::Window::WindowOrientation >( angle );
338 if( mOrientationMode == Internal::Adaptor::Window::OrientationMode::LANDSCAPE )
344 orientation = Dali::Window::LANDSCAPE;
349 orientation = Dali::Window::PORTRAIT;
354 orientation = Dali::Window::LANDSCAPE_INVERSE;
359 orientation = Dali::Window::PORTRAIT_INVERSE;
364 orientation = Dali::Window::NO_ORIENTATION_PREFERENCE;
372 bool Window::IsOrientationAvailable( Dali::Window::WindowOrientation orientation ) const
374 if( orientation <= Dali::Window::NO_ORIENTATION_PREFERENCE || orientation > Dali::Window::LANDSCAPE_INVERSE )
376 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::IsOrientationAvailable: Invalid input orientation [%d]\n", orientation );
382 Dali::Any Window::GetNativeHandle() const
384 return mWindowSurface->GetNativeWindow();
387 void Window::SetAcceptFocus( bool accept )
389 mIsFocusAcceptable = accept;
391 mWindowBase->SetAcceptFocus( accept );
394 bool Window::IsFocusAcceptable() const
396 return mIsFocusAcceptable;
407 WindowVisibilityObserver* observer( mAdaptor );
408 observer->OnWindowShown();
410 Dali::Window handle( this );
411 mVisibilityChangedSignal.Emit( handle, true );
414 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Show(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible );
425 WindowVisibilityObserver* observer( mAdaptor );
426 observer->OnWindowHidden();
428 Dali::Window handle( this );
429 mVisibilityChangedSignal.Emit( handle, false );
432 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Hide(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible );
435 bool Window::IsVisible() const
437 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), IsVisible(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible );
438 return mVisible && !mIconified;
441 unsigned int Window::GetSupportedAuxiliaryHintCount() const
443 return mWindowBase->GetSupportedAuxiliaryHintCount();
446 std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
448 return mWindowBase->GetSupportedAuxiliaryHint( index );
451 unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
453 return mWindowBase->AddAuxiliaryHint( hint, value );
456 bool Window::RemoveAuxiliaryHint( unsigned int id )
458 return mWindowBase->RemoveAuxiliaryHint( id );
461 bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
463 return mWindowBase->SetAuxiliaryHintValue( id, value );
466 std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
468 return mWindowBase->GetAuxiliaryHintValue( id );
471 unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
473 return mWindowBase->GetAuxiliaryHintId( hint );
476 void Window::SetInputRegion( const Rect< int >& inputRegion )
478 mWindowBase->SetInputRegion( inputRegion );
480 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetInputRegion: x = %d, y = %d, w = %d, h = %d\n", inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
483 void Window::SetType( Dali::Window::Type type )
487 mWindowBase->SetType( type );
493 Dali::Window::Type Window::GetType() const
498 bool Window::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
500 if( mType != Dali::Window::NOTIFICATION )
502 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", mType );
506 return mWindowBase->SetNotificationLevel( level );
509 Dali::Window::NotificationLevel::Type Window::GetNotificationLevel() const
511 if( mType != Dali::Window::NOTIFICATION )
513 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Not supported window type [%d]\n", mType );
514 return Dali::Window::NotificationLevel::NONE;
517 return mWindowBase->GetNotificationLevel();
520 void Window::SetOpaqueState( bool opaque )
522 mOpaqueState = opaque;
524 mWindowBase->SetOpaqueState( opaque );
526 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetOpaqueState: opaque = %d\n", opaque );
529 bool Window::IsOpaqueState() const
534 bool Window::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
536 return mWindowBase->SetScreenOffMode( screenOffMode );
539 Dali::Window::ScreenOffMode::Type Window::GetScreenOffMode() const
541 return mWindowBase->GetScreenOffMode();
544 bool Window::SetBrightness( int brightness )
546 if( brightness < 0 || brightness > 100 )
548 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetBrightness: Invalid brightness value [%d]\n", brightness );
552 return mWindowBase->SetBrightness( brightness );
555 int Window::GetBrightness() const
557 return mWindowBase->GetBrightness();
560 void Window::SetSize( Dali::Window::WindowSize size )
562 if( !mResizeEnabled )
564 AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
565 mResizeEnabled = true;
568 PositionSize oldRect = mSurface->GetPositionSize();
570 mWindowSurface->MoveResize( PositionSize( oldRect.x, oldRect.y, size.GetWidth(), size.GetHeight() ) );
572 PositionSize newRect = mSurface->GetPositionSize();
574 // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
575 if( ( oldRect.width != newRect.width ) || ( oldRect.height != newRect.height ) )
577 Uint16Pair newSize( newRect.width, newRect.height );
581 mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize );
583 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), SetSize(): resize signal [%d x %d]\n", this, mNativeWindowId, newRect.width, newRect.height );
585 Dali::Window handle( this );
586 mResizedSignal.Emit( newSize );
587 mResizeSignal.Emit( handle, newSize );
589 mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
593 Dali::Window::WindowSize Window::GetSize() const
595 PositionSize positionSize = mSurface->GetPositionSize();
597 return Dali::Window::WindowSize( positionSize.width, positionSize.height );
600 void Window::SetPosition( Dali::Window::WindowPosition position )
602 if( !mResizeEnabled )
604 AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
605 mResizeEnabled = true;
608 PositionSize oldRect = mSurface->GetPositionSize();
610 mWindowSurface->MoveResize( PositionSize( position.GetX(), position.GetY(), oldRect.width, oldRect.height ) );
613 Dali::Window::WindowPosition Window::GetPosition() const
615 PositionSize positionSize = mSurface->GetPositionSize();
617 return Dali::Window::WindowPosition( positionSize.x, positionSize.y );
620 void Window::SetPositionSize( PositionSize positionSize )
622 if( !mResizeEnabled )
624 AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
625 mResizeEnabled = true;
628 PositionSize oldRect = mSurface->GetPositionSize();
630 mWindowSurface->MoveResize( positionSize );
632 PositionSize newRect = mSurface->GetPositionSize();
634 // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
635 if( ( oldRect.width != newRect.width ) || ( oldRect.height != newRect.height ) )
637 Uint16Pair newSize( newRect.width, newRect.height );
641 mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize );
643 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), SetPositionSize():resize signal [%d x %d]\n", this, mNativeWindowId, newRect.width, newRect.height );
644 Dali::Window handle( this );
645 mResizedSignal.Emit( newSize );
646 mResizeSignal.Emit( handle, newSize );
647 mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
651 Dali::Layer Window::GetRootLayer() const
653 return mScene.GetRootLayer();
656 void Window::SetTransparency( bool transparent )
658 mWindowSurface->SetTransparency( transparent );
661 bool Window::GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode )
663 return mWindowBase->GrabKey( key, grabMode );
666 bool Window::UngrabKey( Dali::KEY key )
668 return mWindowBase->UngrabKey( key );
671 bool Window::GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result )
673 return mWindowBase->GrabKeyList( key, grabMode, result );
676 bool Window::UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result )
678 return mWindowBase->UngrabKeyList( key, result );
681 void Window::OnIconifyChanged( bool iconified )
689 WindowVisibilityObserver* observer( mAdaptor );
690 observer->OnWindowHidden();
692 Dali::Window handle( this );
693 mVisibilityChangedSignal.Emit( handle, false );
696 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Iconified: visible = %d\n", this, mNativeWindowId, mVisible );
704 WindowVisibilityObserver* observer( mAdaptor );
705 observer->OnWindowShown();
707 Dali::Window handle( this );
708 mVisibilityChangedSignal.Emit( handle, true );
711 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Deiconified: visible = %d\n", this, mNativeWindowId, mVisible );
715 void Window::OnFocusChanged( bool focusIn )
717 Dali::Window handle( this );
718 mFocusChangedSignal.Emit( focusIn );
719 mFocusChangeSignal.Emit( handle, focusIn );
722 void Window::OnOutputTransformed()
724 PositionSize positionSize = mSurface->GetPositionSize();
726 mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
727 mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
730 void Window::OnDeleteRequest()
732 mDeleteRequestSignal.Emit();
735 void Window::OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindow::EffectType type )
737 Dali::Window handle( this );
738 mTransitionEffectEventSignal.Emit( handle, state, type );
741 void Window::OnTouchPoint( Dali::Integration::Point& point, int timeStamp )
743 FeedTouchPoint( point, timeStamp );
746 void Window::OnWheelEvent( Dali::Integration::WheelEvent& wheelEvent )
748 FeedWheelEvent( wheelEvent );
751 void Window::OnKeyEvent( Dali::Integration::KeyEvent& keyEvent )
753 FeedKeyEvent( keyEvent );
756 void Window::OnRotation( const RotationEvent& rotation )
758 mRotationAngle = rotation.angle;
759 mWindowWidth = rotation.width;
760 mWindowHeight = rotation.height;
762 // Notify that the orientation is changed
763 mOrientation->OnOrientationChange( rotation );
765 mWindowSurface->RequestRotation( mRotationAngle, mWindowWidth, mWindowHeight );
769 mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) );
771 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), OnRotation(): resize signal emit [%d x %d]\n", this, mNativeWindowId, mWindowWidth, mWindowHeight );
773 Dali::Window handle( this );
774 mResizedSignal.Emit( Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) );
775 mResizeSignal.Emit( handle, Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) );
777 mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) );
780 void Window::OnPause()
784 mEventHandler->Pause();
788 void Window::OnResume()
792 mEventHandler->Resume();
796 void Window::RecalculateTouchPosition( Integration::Point& point )
798 Vector2 position = point.GetScreenPosition();
799 Vector2 convertedPosition;
801 switch( mRotationAngle )
805 convertedPosition.x = static_cast<float>( mWindowWidth ) - position.y;
806 convertedPosition.y = position.x;
811 convertedPosition.x = static_cast<float>( mWindowWidth ) - position.x;
812 convertedPosition.y = static_cast<float>( mWindowHeight ) - position.y;
817 convertedPosition.x = position.y;
818 convertedPosition.y = static_cast<float>( mWindowHeight ) - position.x;
823 convertedPosition = position;
828 point.SetScreenPosition( convertedPosition );
831 Dali::Window Window::Get( Dali::Actor actor )
833 Internal::Adaptor::Window* windowImpl = nullptr;
835 if ( Internal::Adaptor::Adaptor::IsAvailable() )
837 Dali::Internal::Adaptor::Adaptor& adaptor = Internal::Adaptor::Adaptor::GetImplementation( Internal::Adaptor::Adaptor::Get() );
838 windowImpl = dynamic_cast<Internal::Adaptor::Window*>( adaptor.GetWindow( actor ) );
841 return Dali::Window( windowImpl );
845 return Dali::Window();
848 void Window::SetParent( Dali::Window& parent )
850 if ( DALI_UNLIKELY( parent ) )
852 mParentWindow = parent;
853 Dali::Window self = Dali::Window( this );
854 // check circular parent window setting
855 if ( Dali::DevelWindow::GetParent( parent ) == self )
857 Dali::DevelWindow::Unparent( parent );
859 mWindowBase->SetParent( GetImplementation( mParentWindow ).mWindowBase );
863 void Window::Unparent()
865 mWindowBase->SetParent( nullptr );
866 mParentWindow.Reset();
869 Dali::Window Window::GetParent()
871 return mParentWindow;
874 Dali::Window::WindowOrientation Window::GetCurrentOrientation() const
876 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), GetCurrentOrientation(): %d\n", this, mNativeWindowId, mRotationAngle );
877 return ConvertToOrientation( mRotationAngle );
880 void Window::SetAvailableOrientations( const Dali::Vector<Dali::Window::WindowOrientation>& orientations )
882 Dali::Vector<float>::SizeType count = orientations.Count();
883 for( Dali::Vector<float>::SizeType index = 0; index < count; ++index )
885 if( IsOrientationAvailable( orientations[index] ) == false )
887 DALI_LOG_ERROR("Window::SetAvailableOrientations, invalid orientation: %d\n", orientations[index]);
892 int convertedAngle = ConvertToAngle( orientations[index] );
894 for( std::size_t i = 0; i < mAvailableAngles.size(); i++ )
896 if( mAvailableAngles[i] == convertedAngle )
905 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), SetAvailableOrientations: %d\n", this, mNativeWindowId, convertedAngle );
906 mAvailableAngles.push_back( convertedAngle );
909 SetAvailableAnlges( mAvailableAngles );