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>
23 #include <dali/integration-api/core.h>
24 #include <dali/public-api/actors/actor.h>
25 #include <dali/public-api/actors/layer.h>
26 #include <dali/public-api/actors/camera-actor.h>
27 #include <dali/public-api/render-tasks/render-task.h>
28 #include <dali/public-api/render-tasks/render-task-list.h>
29 #include <dali/public-api/rendering/frame-buffer.h>
30 #include <dali/devel-api/adaptor-framework/orientation.h>
31 #include <dali/integration-api/events/touch-event-integ.h>
34 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
35 #include <dali/internal/window-system/common/event-handler.h>
36 #include <dali/internal/window-system/common/orientation-impl.h>
37 #include <dali/internal/window-system/common/render-surface-factory.h>
38 #include <dali/internal/window-system/common/window-factory.h>
39 #include <dali/internal/window-system/common/window-base.h>
40 #include <dali/internal/window-system/common/window-system.h>
41 #include <dali/internal/window-system/common/window-render-surface.h>
42 #include <dali/internal/window-system/common/window-visibility-observer.h>
54 #if defined(DEBUG_ENABLED)
55 Debug::Filter* gWindowLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_WINDOW" );
58 } // unnamed namespace
60 Window* Window::New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
63 return Window::New(surface, positionSize, name, className, isTransparent);
66 Window* Window::New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
68 Window* window = new Window();
69 window->mIsTransparent = isTransparent;
70 window->Initialize(surface, positionSize, name, className);
75 : mWindowSurface( nullptr ),
77 mIsTransparent( false ),
78 mIsFocusAcceptable( true ),
80 mOpaqueState( false ),
81 mResizeEnabled( false ),
82 mType( Dali::Window::NORMAL ),
83 mParentWindow( NULL ),
84 mPreferredAngle( Dali::Window::NO_ORIENTATION_PREFERENCE ),
88 mOrientationMode( Internal::Adaptor::Window::OrientationMode::PORTRAIT ),
89 mNativeWindowId( -1 ),
90 mFocusChangedSignal(),
92 mDeleteRequestSignal(),
95 mVisibilityChangedSignal(),
96 mTransitionEffectEventSignal()
104 mEventHandler->RemoveObserver( *this );
108 void Window::Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className)
110 // Create a window render surface
111 auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
112 mSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, mIsTransparent );
113 mWindowSurface = static_cast<WindowRenderSurface*>( mSurface.get() );
116 mWindowBase = mWindowSurface->GetWindowBase();
119 mWindowBase->IconifyChangedSignal().Connect( this, &Window::OnIconifyChanged );
120 mWindowBase->FocusChangedSignal().Connect( this, &Window::OnFocusChanged );
121 mWindowBase->DeleteRequestSignal().Connect( this, &Window::OnDeleteRequest );
122 mWindowBase->TransitionEffectEventSignal().Connect( this, &Window::OnTransitionEffectEvent );
124 mWindowSurface->OutputTransformedSignal().Connect( this, &Window::OnOutputTransformed );
126 if( !positionSize.IsEmpty() )
128 AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
129 mResizeEnabled = true;
132 SetClass( name, className );
134 mWindowSurface->Map();
136 mOrientation = Orientation::New( this );
138 // Get OrientationMode
139 int screenWidth, screenHeight;
140 WindowSystem::GetScreenSize( screenWidth, screenHeight );
141 if( screenWidth > screenHeight )
143 mOrientationMode = Internal::Adaptor::Window::OrientationMode::LANDSCAPE;
147 mOrientationMode = Internal::Adaptor::Window::OrientationMode::PORTRAIT;
150 mNativeWindowId = mWindowBase->GetNativeWindowId();
153 void Window::OnAdaptorSet(Dali::Adaptor& adaptor)
155 mEventHandler = EventHandlerPtr(new EventHandler( mWindowSurface, *mAdaptor ) );
156 mEventHandler->AddObserver( *this );
159 void Window::OnSurfaceSet( Dali::RenderSurfaceInterface* surface )
161 mWindowSurface = static_cast<WindowRenderSurface*>( surface );
164 void Window::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode )
168 void Window::SetIndicatorBgOpacity( Dali::Window::IndicatorBgOpacity opacityMode )
172 void Window::RotateIndicator( Dali::Window::WindowOrientation orientation )
176 void Window::SetClass( std::string name, std::string className )
179 mClassName = className;
180 mWindowBase->SetClass( name, className );
183 std::string Window::GetClassName() const
190 mWindowBase->Raise();
191 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Raise() \n", this, mNativeWindowId );
196 mWindowBase->Lower();
197 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Lower() \n", this, mNativeWindowId );
200 void Window::Activate()
202 mWindowBase->Activate();
203 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Activate() \n", this, mNativeWindowId );
206 uint32_t Window::GetLayerCount() const
208 return mScene.GetLayerCount();
211 Dali::Layer Window::GetLayer( uint32_t depth ) const
213 return mScene.GetLayer( depth );
216 Dali::RenderTaskList Window::GetRenderTaskList() const
218 return mScene.GetRenderTaskList();
221 void Window::AddAvailableOrientation( Dali::Window::WindowOrientation orientation )
223 if( IsOrientationAvailable( orientation ) == false )
229 int convertedAngle = ConvertToAngle( orientation );
230 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), AddAvailableOrientation: %d\n", this, mNativeWindowId, convertedAngle );
231 for( std::size_t i = 0; i < mAvailableAngles.size(); i++ )
233 if( mAvailableAngles[i] == convertedAngle )
242 mAvailableAngles.push_back( convertedAngle );
243 SetAvailableAnlges( mAvailableAngles );
247 void Window::RemoveAvailableOrientation( Dali::Window::WindowOrientation orientation )
249 if( IsOrientationAvailable( orientation ) == false )
254 int convertedAngle = ConvertToAngle( orientation );
255 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), RemoveAvailableOrientation: %d\n", this, mNativeWindowId, convertedAngle );
256 for( std::vector< int >::iterator iter = mAvailableAngles.begin();
257 iter != mAvailableAngles.end(); ++iter )
259 if( *iter == convertedAngle )
261 mAvailableAngles.erase( iter );
266 SetAvailableAnlges( mAvailableAngles );
269 void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
271 if( orientation < Dali::Window::NO_ORIENTATION_PREFERENCE || orientation > Dali::Window::LANDSCAPE_INVERSE )
273 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::CheckOrientation: Invalid input orientation [%d]\n", orientation );
276 mPreferredAngle = ConvertToAngle( orientation );
277 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), SetPreferredOrientation: %d\n", this, mNativeWindowId, mPreferredAngle );
278 mWindowBase->SetPreferredAngle( mPreferredAngle );
281 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
283 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), GetPreferredOrientation: %d\n", this, mNativeWindowId, mPreferredAngle );
284 Dali::Window::WindowOrientation preferredOrientation = ConvertToOrientation( mPreferredAngle );
285 return preferredOrientation;
288 void Window::SetAvailableAnlges( const std::vector< int >& angles )
290 if( angles.size() > 4 )
292 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetAvailableAnlges: Invalid vector size! [%d]\n", angles.size() );
296 mWindowBase->SetAvailableAnlges( angles );
299 int Window::ConvertToAngle( Dali::Window::WindowOrientation orientation )
301 int convertAngle = static_cast< int >( orientation );
302 if( mOrientationMode == Internal::Adaptor::Window::OrientationMode::LANDSCAPE )
304 switch( orientation )
306 case Dali::Window::LANDSCAPE:
311 case Dali::Window::PORTRAIT:
316 case Dali::Window::LANDSCAPE_INVERSE:
321 case Dali::Window::PORTRAIT_INVERSE:
326 case Dali::Window::NO_ORIENTATION_PREFERENCE:
336 Dali::Window::WindowOrientation Window::ConvertToOrientation( int angle ) const
338 Dali::Window::WindowOrientation orientation = static_cast< Dali::Window::WindowOrientation >( angle );
339 if( mOrientationMode == Internal::Adaptor::Window::OrientationMode::LANDSCAPE )
345 orientation = Dali::Window::LANDSCAPE;
350 orientation = Dali::Window::PORTRAIT;
355 orientation = Dali::Window::LANDSCAPE_INVERSE;
360 orientation = Dali::Window::PORTRAIT_INVERSE;
365 orientation = Dali::Window::NO_ORIENTATION_PREFERENCE;
373 bool Window::IsOrientationAvailable( Dali::Window::WindowOrientation orientation ) const
375 if( orientation <= Dali::Window::NO_ORIENTATION_PREFERENCE || orientation > Dali::Window::LANDSCAPE_INVERSE )
377 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::IsOrientationAvailable: Invalid input orientation [%d]\n", orientation );
383 Dali::Any Window::GetNativeHandle() const
385 return mWindowSurface->GetNativeWindow();
388 void Window::SetAcceptFocus( bool accept )
390 mIsFocusAcceptable = accept;
392 mWindowBase->SetAcceptFocus( accept );
395 bool Window::IsFocusAcceptable() const
397 return mIsFocusAcceptable;
408 WindowVisibilityObserver* observer( mAdaptor );
409 observer->OnWindowShown();
411 Dali::Window handle( this );
412 mVisibilityChangedSignal.Emit( handle, true );
415 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Show(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible );
426 WindowVisibilityObserver* observer( mAdaptor );
427 observer->OnWindowHidden();
429 Dali::Window handle( this );
430 mVisibilityChangedSignal.Emit( handle, false );
433 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Hide(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible );
436 bool Window::IsVisible() const
438 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), IsVisible(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible );
439 return mVisible && !mIconified;
442 unsigned int Window::GetSupportedAuxiliaryHintCount() const
444 return mWindowBase->GetSupportedAuxiliaryHintCount();
447 std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
449 return mWindowBase->GetSupportedAuxiliaryHint( index );
452 unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
454 return mWindowBase->AddAuxiliaryHint( hint, value );
457 bool Window::RemoveAuxiliaryHint( unsigned int id )
459 return mWindowBase->RemoveAuxiliaryHint( id );
462 bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
464 return mWindowBase->SetAuxiliaryHintValue( id, value );
467 std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
469 return mWindowBase->GetAuxiliaryHintValue( id );
472 unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
474 return mWindowBase->GetAuxiliaryHintId( hint );
477 void Window::SetInputRegion( const Rect< int >& inputRegion )
479 mWindowBase->SetInputRegion( inputRegion );
481 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 );
484 void Window::SetType( Dali::Window::Type type )
488 mWindowBase->SetType( type );
494 Dali::Window::Type Window::GetType() const
499 bool Window::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
501 if( mType != Dali::Window::NOTIFICATION )
503 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", mType );
507 return mWindowBase->SetNotificationLevel( level );
510 Dali::Window::NotificationLevel::Type Window::GetNotificationLevel() const
512 if( mType != Dali::Window::NOTIFICATION )
514 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Not supported window type [%d]\n", mType );
515 return Dali::Window::NotificationLevel::NONE;
518 return mWindowBase->GetNotificationLevel();
521 void Window::SetOpaqueState( bool opaque )
523 mOpaqueState = opaque;
525 mWindowBase->SetOpaqueState( opaque );
527 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetOpaqueState: opaque = %d\n", opaque );
530 bool Window::IsOpaqueState() const
535 bool Window::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
537 return mWindowBase->SetScreenOffMode( screenOffMode );
540 Dali::Window::ScreenOffMode::Type Window::GetScreenOffMode() const
542 return mWindowBase->GetScreenOffMode();
545 bool Window::SetBrightness( int brightness )
547 if( brightness < 0 || brightness > 100 )
549 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetBrightness: Invalid brightness value [%d]\n", brightness );
553 return mWindowBase->SetBrightness( brightness );
556 int Window::GetBrightness() const
558 return mWindowBase->GetBrightness();
561 void Window::SetSize( Dali::Window::WindowSize size )
563 if( !mResizeEnabled )
565 AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
566 mResizeEnabled = true;
569 PositionSize oldRect = mSurface->GetPositionSize();
571 mWindowSurface->MoveResize( PositionSize( oldRect.x, oldRect.y, size.GetWidth(), size.GetHeight() ) );
573 PositionSize newRect = mSurface->GetPositionSize();
575 // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
576 if( ( oldRect.width != newRect.width ) || ( oldRect.height != newRect.height ) )
578 Uint16Pair newSize( newRect.width, newRect.height );
582 mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize );
584 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), SetSize(): resize signal [%d x %d]\n", this, mNativeWindowId, newRect.width, newRect.height );
586 Dali::Window handle( this );
587 mResizedSignal.Emit( newSize );
588 mResizeSignal.Emit( handle, newSize );
590 mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
594 Dali::Window::WindowSize Window::GetSize() const
596 PositionSize positionSize = mSurface->GetPositionSize();
598 return Dali::Window::WindowSize( positionSize.width, positionSize.height );
601 void Window::SetPosition( Dali::Window::WindowPosition position )
603 if( !mResizeEnabled )
605 AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
606 mResizeEnabled = true;
609 PositionSize oldRect = mSurface->GetPositionSize();
611 mWindowSurface->MoveResize( PositionSize( position.GetX(), position.GetY(), oldRect.width, oldRect.height ) );
614 Dali::Window::WindowPosition Window::GetPosition() const
616 PositionSize positionSize = mSurface->GetPositionSize();
618 return Dali::Window::WindowPosition( positionSize.x, positionSize.y );
621 void Window::SetPositionSize( PositionSize positionSize )
623 if( !mResizeEnabled )
625 AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
626 mResizeEnabled = true;
629 PositionSize oldRect = mSurface->GetPositionSize();
631 mWindowSurface->MoveResize( positionSize );
633 PositionSize newRect = mSurface->GetPositionSize();
635 // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
636 if( ( oldRect.width != newRect.width ) || ( oldRect.height != newRect.height ) )
638 Uint16Pair newSize( newRect.width, newRect.height );
642 mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize );
644 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), SetPositionSize():resize signal [%d x %d]\n", this, mNativeWindowId, newRect.width, newRect.height );
645 Dali::Window handle( this );
646 mResizedSignal.Emit( newSize );
647 mResizeSignal.Emit( handle, newSize );
648 mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
652 Dali::Layer Window::GetRootLayer() const
654 return mScene.GetRootLayer();
657 void Window::SetTransparency( bool transparent )
659 mWindowSurface->SetTransparency( transparent );
662 bool Window::GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode )
664 return mWindowBase->GrabKey( key, grabMode );
667 bool Window::UngrabKey( Dali::KEY key )
669 return mWindowBase->UngrabKey( key );
672 bool Window::GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result )
674 return mWindowBase->GrabKeyList( key, grabMode, result );
677 bool Window::UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result )
679 return mWindowBase->UngrabKeyList( key, result );
682 void Window::OnIconifyChanged( bool iconified )
690 WindowVisibilityObserver* observer( mAdaptor );
691 observer->OnWindowHidden();
693 Dali::Window handle( this );
694 mVisibilityChangedSignal.Emit( handle, false );
697 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Iconified: visible = %d\n", this, mNativeWindowId, mVisible );
705 WindowVisibilityObserver* observer( mAdaptor );
706 observer->OnWindowShown();
708 Dali::Window handle( this );
709 mVisibilityChangedSignal.Emit( handle, true );
712 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Deiconified: visible = %d\n", this, mNativeWindowId, mVisible );
716 void Window::OnFocusChanged( bool focusIn )
718 Dali::Window handle( this );
719 mFocusChangedSignal.Emit( focusIn );
720 mFocusChangeSignal.Emit( handle, focusIn );
723 void Window::OnOutputTransformed()
725 PositionSize positionSize = mSurface->GetPositionSize();
727 mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
728 mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
731 void Window::OnDeleteRequest()
733 mDeleteRequestSignal.Emit();
736 void Window::OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindow::EffectType type )
738 Dali::Window handle( this );
739 mTransitionEffectEventSignal.Emit( handle, state, type );
742 void Window::OnTouchPoint( Dali::Integration::Point& point, int timeStamp )
744 FeedTouchPoint( point, timeStamp );
747 void Window::OnWheelEvent( Dali::Integration::WheelEvent& wheelEvent )
749 FeedWheelEvent( wheelEvent );
752 void Window::OnKeyEvent( Dali::Integration::KeyEvent& keyEvent )
754 FeedKeyEvent( keyEvent );
757 void Window::OnRotation( const RotationEvent& rotation )
759 mRotationAngle = rotation.angle;
760 mWindowWidth = rotation.width;
761 mWindowHeight = rotation.height;
763 // Notify that the orientation is changed
764 mOrientation->OnOrientationChange( rotation );
766 mWindowSurface->RequestRotation( mRotationAngle, mWindowWidth, mWindowHeight );
770 mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) );
772 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), OnRotation(): resize signal emit [%d x %d]\n", this, mNativeWindowId, mWindowWidth, mWindowHeight );
774 Dali::Window handle( this );
775 mResizedSignal.Emit( Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) );
776 mResizeSignal.Emit( handle, Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) );
778 mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) );
781 void Window::OnPause()
785 mEventHandler->Pause();
789 void Window::OnResume()
793 mEventHandler->Resume();
797 void Window::RecalculateTouchPosition( Integration::Point& point )
799 Vector2 position = point.GetScreenPosition();
800 Vector2 convertedPosition;
802 switch( mRotationAngle )
806 convertedPosition.x = static_cast<float>( mWindowWidth ) - position.y;
807 convertedPosition.y = position.x;
812 convertedPosition.x = static_cast<float>( mWindowWidth ) - position.x;
813 convertedPosition.y = static_cast<float>( mWindowHeight ) - position.y;
818 convertedPosition.x = position.y;
819 convertedPosition.y = static_cast<float>( mWindowHeight ) - position.x;
824 convertedPosition = position;
829 point.SetScreenPosition( convertedPosition );
832 Dali::Window Window::Get( Dali::Actor actor )
834 Internal::Adaptor::Window* windowImpl = nullptr;
836 if ( Internal::Adaptor::Adaptor::IsAvailable() )
838 Dali::Internal::Adaptor::Adaptor& adaptor = Internal::Adaptor::Adaptor::GetImplementation( Internal::Adaptor::Adaptor::Get() );
839 windowImpl = dynamic_cast<Internal::Adaptor::Window*>( adaptor.GetWindow( actor ) );
842 return Dali::Window( windowImpl );
846 return Dali::Window();
849 void Window::SetParent( Dali::Window& parent )
851 if ( DALI_UNLIKELY( parent ) )
853 mParentWindow = parent;
854 Dali::Window self = Dali::Window( this );
855 // check circular parent window setting
856 if ( Dali::DevelWindow::GetParent( parent ) == self )
858 Dali::DevelWindow::Unparent( parent );
860 mWindowBase->SetParent( GetImplementation( mParentWindow ).mWindowBase );
864 void Window::Unparent()
866 mWindowBase->SetParent( nullptr );
867 mParentWindow.Reset();
870 Dali::Window Window::GetParent()
872 return mParentWindow;
875 Dali::Window::WindowOrientation Window::GetCurrentOrientation() const
877 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), GetCurrentOrientation(): %d\n", this, mNativeWindowId, mRotationAngle );
878 return ConvertToOrientation( mRotationAngle );
881 void Window::SetAvailableOrientations( const Dali::Vector<Dali::Window::WindowOrientation>& orientations )
883 Dali::Vector<float>::SizeType count = orientations.Count();
884 for( Dali::Vector<float>::SizeType index = 0; index < count; ++index )
886 if( IsOrientationAvailable( orientations[index] ) == false )
888 DALI_LOG_ERROR("Window::SetAvailableOrientations, invalid orientation: %d\n", orientations[index]);
893 int convertedAngle = ConvertToAngle( orientations[index] );
895 for( std::size_t i = 0; i < mAvailableAngles.size(); i++ )
897 if( mAvailableAngles[i] == convertedAngle )
906 DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), SetAvailableOrientations: %d\n", this, mNativeWindowId, convertedAngle );
907 mAvailableAngles.push_back( convertedAngle );
910 SetAvailableAnlges( mAvailableAngles );