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=1b2c93fa4df4dfaca0873cf6e0c804b51b6a4db1;hb=aa19ec5a3944989bb2eed21eb6c316775cafd38a;hp=ac6879d4118c0a6fc07e5c4c7f876855dfdfd8b2;hpb=0a170dd5b908a2316989ba82ca5c62ecfc347cee;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 ac6879d..1b2c93f 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 @@ -585,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 @@ -944,7 +947,7 @@ void WindowBaseEcoreWl::OnMouseWheel( void* data, int type, void* event ) { DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z ); - WheelEvent wheelEvent( WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2( mouseWheelEvent->x, mouseWheelEvent->y ), mouseWheelEvent->z, mouseWheelEvent->timestamp ); + Integration::WheelEvent wheelEvent( Integration::WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2( mouseWheelEvent->x, mouseWheelEvent->y ), mouseWheelEvent->z, mouseWheelEvent->timestamp ); mWheelEventSignal.Emit( wheelEvent ); } @@ -959,7 +962,7 @@ void WindowBaseEcoreWl::OnDetentRotation( void* data, int type, void* event ) int direction = ( detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE ) ? 1 : -1; int timeStamp = detentEvent->timestamp; - WheelEvent wheelEvent( WheelEvent::CUSTOM_WHEEL, 0, 0, Vector2( 0.0f, 0.0f ), direction, timeStamp ); + Integration::WheelEvent wheelEvent( Integration::WheelEvent::CUSTOM_WHEEL, 0, 0, Vector2( 0.0f, 0.0f ), direction, timeStamp ); mWheelEventSignal.Emit( wheelEvent ); } @@ -1012,7 +1015,7 @@ void WindowBaseEcoreWl::OnKeyDown( void* data, int type, void* event ) GetDeviceClass( ecore_device_class_get( keyEvent->dev ), deviceClass ); GetDeviceSubclass( ecore_device_subclass_get( keyEvent->dev ), deviceSubclass ); - Integration::KeyEvent keyEvent( keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, compose, deviceName, deviceClass, deviceSubclass ); + Integration::KeyEvent keyEvent( keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::DOWN, compose, deviceName, deviceClass, deviceSubclass ); mKeyEventSignal.Emit( keyEvent ); } @@ -1026,6 +1029,15 @@ void WindowBaseEcoreWl::OnKeyUp( void* data, int type, void* event ) { DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyUp\n" ); +#if defined(ECORE_VERSION_MAJOR) && (ECORE_VERSION_MAJOR >= 1) && defined(ECORE_VERSION_MINOR) && (ECORE_VERSION_MINOR >= 23) + // Cancel processing flag is sent because this key event will combine with the previous key. So, the event should not actually perform anything. + if( keyEvent->event_flags & ECORE_EVENT_FLAG_CANCEL ) + { + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyUp: This event flag indicates the event is canceled. \n" ); + return; + } +#endif // Since ecore 1.23 version + std::string keyName( keyEvent->keyname ); std::string logicalKey( "" ); std::string keyString( "" ); @@ -1066,7 +1078,7 @@ void WindowBaseEcoreWl::OnKeyUp( void* data, int type, void* event ) GetDeviceClass( ecore_device_class_get( keyEvent->dev ), deviceClass ); GetDeviceSubclass( ecore_device_subclass_get( keyEvent->dev ), deviceSubclass ); - Integration::KeyEvent keyEvent( keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, compose, deviceName, deviceClass, deviceSubclass ); + Integration::KeyEvent keyEvent( keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::UP, compose, deviceName, deviceClass, deviceSubclass ); mKeyEventSignal.Emit( keyEvent ); } @@ -1317,9 +1329,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; } @@ -2062,6 +2075,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; @@ -2075,14 +2098,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 );