/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
deviceSubclass = Device::Subclass::TRACKBALL;
break;
}
-#ifdef OVER_TIZEN_VERSION_4
case ECORE_DEVICE_SUBCLASS_REMOCON:
{
deviceSubclass = Device::Subclass::REMOCON;
deviceSubclass = Device::Subclass::VIRTUAL_KEYBOARD;
break;
}
-#endif
default:
{
deviceSubclass = Device::Subclass::NONE;
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;
}
/////////////////////////////////////////////////////////////////////////////////////////////////
-// Indicator Callbacks
-/////////////////////////////////////////////////////////////////////////////////////////////////
-
-#if defined (DALI_PROFILE_MOBILE)
- /**
- * Called when the Ecore indicator event is received.
- */
- static Eina_Bool EcoreEventIndicator( void* data, int type, void* event )
- {
- WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
- if( windowBase )
- {
- windowBase->OnIndicatorFlicked( data, type, event );
- }
- return ECORE_CALLBACK_PASS_ON;
- }
-#endif // DALI_PROFILE_MOBILE
-
-/////////////////////////////////////////////////////////////////////////////////////////////////
// Font Callbacks
/////////////////////////////////////////////////////////////////////////////////////////////////
mBrightness( 0 ),
mBrightnessChangeState( 0 ),
mBrightnessChangeDone( true ),
- mOwnSurface( false )
+ mOwnSurface( false ),
+ mWindowRotationAngle( 0 ),
+ mScreenRotationAngle( 0 ),
+ mSupportedPreProtation( 0 )
#ifdef DALI_ELDBUS_AVAILABLE
, mSystemConnection( NULL )
#endif
mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_DATA_SOURCE_SEND, EcoreEventDataSend, this ) );
mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_SELECTION_DATA_READY, EcoreEventDataReceive, this ) );
-#if defined (DALI_PROFILE_MOBILE)
- // Register indicator event
- mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_INDICATOR_FLICK, EcoreEventIndicator, this ) );
-#endif
-
// Register Vconf notify - font name and size
vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged, this );
vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged, this );
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;
{
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 );
}
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 );
}
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 );
}
{
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( "" );
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 );
}
mSelectionDataReceivedSignal.Emit( event );
}
-void WindowBaseEcoreWl::OnIndicatorFlicked( void* data, int type, void* event )
-{
- mIndicatorFlickedSignal.Emit();
-}
-
void WindowBaseEcoreWl::OnFontNameChanged()
{
mStyleChangedSignal.Emit( StyleChange::DEFAULT_FONT_CHANGE );
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;
}
ecore_wl_window_update_size( mEcoreWindow, positionSize.width, positionSize.height );
}
-void WindowBaseEcoreWl::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode, Dali::Window::IndicatorBgOpacity opacityMode )
-{
- DALI_LOG_TRACE_METHOD_FMT( gWindowBaseLogFilter, "visible : %d\n", visibleMode );
-
- if( visibleMode == Dali::Window::VISIBLE )
- {
- // when the indicator is visible, set proper mode for indicator server according to bg mode
- if( opacityMode == Dali::Window::OPAQUE )
- {
- ecore_wl_window_indicator_opacity_set( mEcoreWindow, ECORE_WL_INDICATOR_OPAQUE );
- }
- else if( opacityMode == Dali::Window::TRANSLUCENT )
- {
- ecore_wl_window_indicator_opacity_set( mEcoreWindow, ECORE_WL_INDICATOR_TRANSLUCENT );
- }
- else if( opacityMode == Dali::Window::TRANSPARENT )
- {
- ecore_wl_window_indicator_opacity_set( mEcoreWindow, ECORE_WL_INDICATOR_OPAQUE );
- }
- }
- else
- {
- // when the indicator is not visible, set TRANSPARENT mode for indicator server
- ecore_wl_window_indicator_opacity_set( mEcoreWindow, ECORE_WL_INDICATOR_TRANSPARENT); // it means hidden indicator
- }
-}
-
-void WindowBaseEcoreWl::SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation )
-{
- if( isShow )
- {
- ecore_wl_window_indicator_state_set( mEcoreWindow, ECORE_WL_INDICATOR_STATE_ON );
- }
- else
- {
- ecore_wl_window_indicator_state_set( mEcoreWindow, ECORE_WL_INDICATOR_STATE_OFF );
- }
-}
-
-void WindowBaseEcoreWl::IndicatorTypeChanged( IndicatorInterface::Type type )
-{
-#if defined(DALI_PROFILE_MOBILE)
- switch( type )
- {
- case IndicatorInterface::INDICATOR_TYPE_1:
- {
- ecore_wl_indicator_visible_type_set( mEcoreWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_SHOWN );
- break;
- }
- case IndicatorInterface::INDICATOR_TYPE_2:
- {
- ecore_wl_indicator_visible_type_set( mEcoreWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_HIDDEN );
- break;
- }
- case IndicatorInterface::INDICATOR_TYPE_UNKNOWN:
- default:
- {
- break;
- }
- }
-#endif //MOBILE
-}
-
void WindowBaseEcoreWl::SetClass( const std::string& name, const std::string& className )
{
ecore_wl_window_title_set( mEcoreWindow, name.c_str() );
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 )
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;
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 );
}
}
+void WindowBaseEcoreWl::SetParent( WindowBase* parentWinBase )
+{
+ Ecore_Wl_Window* ecoreParent = NULL;
+ if( parentWinBase )
+ {
+ WindowBaseEcoreWl* winBaseEcore = static_cast<WindowBaseEcoreWl*>( parentWinBase );
+ ecoreParent = winBaseEcore->mEcoreWindow;
+ }
+ ecore_wl_window_parent_set( mEcoreWindow, ecoreParent );
+}
+
+int WindowBaseEcoreWl::CreateFrameRenderedSyncFence()
+{
+ return -1;
+}
+
+int WindowBaseEcoreWl::CreateFramePresentedSyncFence()
+{
+ return -1;
+}
+
} // namespace Adaptor
} // namespace Internal