X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Ftizen-wayland%2Fecore-wl%2Fwindow-base-ecore-wl.cpp;h=4258b7f57cb626fa2f49e490e6da31b8208991ae;hb=f110d85fb0606f3cfac47ad8d760168078d83148;hp=84b9b2e0843c10f969bd2feff10f21b0b37e0bdc;hpb=e6a6f4026b886e3c37462a37f985766340a5610e;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp index 84b9b2e..4258b7f 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp @@ -268,6 +268,7 @@ static Eina_Bool EcoreEventRotate( void* data, int type, void* event ) WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data ); if( windowBase ) { + DALI_LOG_RELEASE_INFO( "WindowBaseEcoreWl::EcoreEventRotate\n" ); windowBase->OnRotation( data, type, event ); } return ECORE_CALLBACK_PASS_ON; @@ -584,7 +585,10 @@ WindowBaseEcoreWl::WindowBaseEcoreWl( Dali::PositionSize positionSize, Any surfa mBrightness( 0 ), mBrightnessChangeState( 0 ), mBrightnessChangeDone( true ), - mOwnSurface( false ) + mOwnSurface( false ), + mWindowRotationAngle( 0 ), + mScreenRotationAngle( 0 ), + mSupportedPreProtation( 0 ) #ifdef DALI_ELDBUS_AVAILABLE , mSystemConnection( NULL ) #endif @@ -809,7 +813,7 @@ void WindowBaseEcoreWl::OnRotation( void* data, int type, void* event ) if( ev->win == static_cast< unsigned int >( ecore_wl_window_id_get( mEcoreWindow ) ) ) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl::OnRotation\n" ); + DALI_LOG_RELEASE_INFO( "WindowBaseEcoreWl::OnRotation, angle: %d, width: %d, height: %d\n", ev->angle, ev->w, ev->h ); RotationEvent rotationEvent; rotationEvent.angle = ev->angle; @@ -1316,9 +1320,10 @@ bool WindowBaseEcoreWl::IsEglWindowRotationSupported() wl_egl_window_capability capability = static_cast< wl_egl_window_capability >( wl_egl_window_get_capabilities( mEglWindow ) ); if( capability == WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED ) { + mSupportedPreProtation = true; return true; } - + mSupportedPreProtation = false; return false; } @@ -1360,19 +1365,21 @@ void WindowBaseEcoreWl::Activate() ecore_wl_window_activate( mEcoreWindow ); } -void WindowBaseEcoreWl::SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations ) +void WindowBaseEcoreWl::SetAvailableAnlges( const std::vector< int >& angles ) { int rotations[4] = { 0 }; - for( std::size_t i = 0; i < orientations.size(); ++i ) + DALI_LOG_RELEASE_INFO( "WindowBaseEcoreWl::SetAvailableAnlges, angle's count: %d\n", angles.size() ); + for( std::size_t i = 0; i < angles.size(); ++i ) { - rotations[i] = static_cast< int >( orientations[i] ); + rotations[i] = static_cast< int >( angles[i] ); + DALI_LOG_RELEASE_INFO( "%d ", rotations[i] ); } - ecore_wl_window_rotation_available_rotations_set( mEcoreWindow, rotations, orientations.size() ); + ecore_wl_window_rotation_available_rotations_set( mEcoreWindow, rotations, angles.size() ); } -void WindowBaseEcoreWl::SetPreferredOrientation( Dali::Window::WindowOrientation orientation ) +void WindowBaseEcoreWl::SetPreferredAngle( int angle ) { - ecore_wl_window_rotation_preferred_rotation_set( mEcoreWindow, orientation ); + ecore_wl_window_rotation_preferred_rotation_set( mEcoreWindow, angle ); } void WindowBaseEcoreWl::SetAcceptFocus( bool accept ) @@ -2059,6 +2066,16 @@ void WindowBaseEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVe dpiVertical = int( yres + 0.5f ); } +int WindowBaseEcoreWl::GetOrientation() const +{ + int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360; + if( mSupportedPreProtation ) + { + orientation = 0; + } + return orientation; +} + int WindowBaseEcoreWl::GetScreenRotationAngle() { int transform = 0; @@ -2072,14 +2089,21 @@ int WindowBaseEcoreWl::GetScreenRotationAngle() transform = ecore_wl_output_transform_get( ecore_wl_window_output_find( mEcoreWindow ) ); } - return transform * 90; + mScreenRotationAngle = transform * 90; + return mScreenRotationAngle; } void WindowBaseEcoreWl::SetWindowRotationAngle( int degree ) { + mWindowRotationAngle = degree; ecore_wl_window_rotation_set( mEcoreWindow, degree ); } +int WindowBaseEcoreWl::GetWindowRotationAngle() +{ + return mWindowRotationAngle; +} + void WindowBaseEcoreWl::WindowRotationCompleted( int degree, int width, int height ) { ecore_wl_window_rotation_change_done_send( mEcoreWindow );