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=5b67e2698e7c761c7a52bae5541a5529d36a5b0c;hb=c3916fe1fb10465161a98b77d2bc92786f10e4eb;hp=6af5474f1a786fb837e9d1e11e4d02b934bcb954;hpb=116fbd0c8799b78ecfe44724bd0ee24b3d8d9340;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 6af5474..5b67e26 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 @@ -1,5 +1,5 @@ /* - * 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. @@ -178,7 +178,6 @@ void GetDeviceSubclass( Ecore_Device_Subclass ecoreDeviceSubclass, Device::Subcl deviceSubclass = Device::Subclass::TRACKBALL; break; } -#ifdef OVER_TIZEN_VERSION_4 case ECORE_DEVICE_SUBCLASS_REMOCON: { deviceSubclass = Device::Subclass::REMOCON; @@ -189,7 +188,6 @@ void GetDeviceSubclass( Ecore_Device_Subclass ecoreDeviceSubclass, Device::Subcl deviceSubclass = Device::Subclass::VIRTUAL_KEYBOARD; break; } -#endif default: { deviceSubclass = Device::Subclass::NONE; @@ -419,25 +417,6 @@ static Eina_Bool EcoreEventDataReceive( void* data, int type, void* event ) } ///////////////////////////////////////////////////////////////////////////////////////////////// -// 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 ///////////////////////////////////////////////////////////////////////////////////////////////// @@ -705,11 +684,6 @@ void WindowBaseEcoreWl::Initialize( PositionSize positionSize, Any surface, bool 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 ); @@ -998,6 +972,7 @@ void WindowBaseEcoreWl::OnKeyDown( void* data, int type, void* event ) DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyDown\n" ); std::string keyName( keyEvent->keyname ); + std::string logicalKey( "" ); std::string keyString( "" ); std::string compose( "" ); @@ -1007,6 +982,12 @@ void WindowBaseEcoreWl::OnKeyDown( void* data, int type, void* event ) compose = keyEvent->compose; } + // Ensure key symbol is not NULL as keys like SHIFT have a null string. + if( keyEvent->key ) + { + logicalKey = keyEvent->key; + } + int keyCode = KeyLookup::GetDaliKeyCode( keyEvent->keyname ); keyCode = ( keyCode == -1 ) ? 0 : keyCode; int modifier( keyEvent->modifiers ); @@ -1030,7 +1011,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, 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 ); } @@ -1045,6 +1026,7 @@ void WindowBaseEcoreWl::OnKeyUp( void* data, int type, void* event ) DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyUp\n" ); std::string keyName( keyEvent->keyname ); + std::string logicalKey( "" ); std::string keyString( "" ); std::string compose( "" ); @@ -1054,6 +1036,12 @@ void WindowBaseEcoreWl::OnKeyUp( void* data, int type, void* event ) compose = keyEvent->compose; } + // Ensure key symbol is not NULL as keys like SHIFT have a null string. + if( keyEvent->key ) + { + logicalKey = keyEvent->key; + } + int keyCode = KeyLookup::GetDaliKeyCode( keyEvent->keyname ); keyCode = ( keyCode == -1 ) ? 0 : keyCode; int modifier( keyEvent->modifiers ); @@ -1077,7 +1065,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, 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 ); } @@ -1093,11 +1081,6 @@ void WindowBaseEcoreWl::OnDataReceive( void* data, int type, void* event ) mSelectionDataReceivedSignal.Emit( event ); } -void WindowBaseEcoreWl::OnIndicatorFlicked( void* data, int type, void* event ) -{ - mIndicatorFlickedSignal.Emit(); -} - void WindowBaseEcoreWl::OnFontNameChanged() { mStyleChangedSignal.Emit( StyleChange::DEFAULT_FONT_CHANGE ); @@ -1355,69 +1338,6 @@ void WindowBaseEcoreWl::MoveResize( PositionSize positionSize ) 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() ); @@ -2139,10 +2059,6 @@ void WindowBaseEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVe dpiVertical = int( yres + 0.5f ); } -void WindowBaseEcoreWl::SetViewMode( ViewMode viewMode ) -{ -} - int WindowBaseEcoreWl::GetScreenRotationAngle() { int transform = 0; @@ -2216,6 +2132,37 @@ void WindowBaseEcoreWl::CreateWindow( PositionSize positionSize ) } } +void WindowBaseEcoreWl::SetParent( Any parent ) +{ + Ecore_Wl_Window* mEcoreParent; + if( parent.Empty() == false ) + { + // check we have a valid type + DALI_ASSERT_ALWAYS( ( parent.GetType() == typeid (Ecore_Wl_Window *) ) && "Parent's surface type is invalid" ); + mEcoreParent = AnyCast< Ecore_Wl_Window* >( parent ); + } + else + { + mEcoreParent = NULL; + } + ecore_wl_window_parent_set( mEcoreWindow, mEcoreParent ); +} + +bool WindowBaseEcoreWl::IsMatchedWindow( Any window ) +{ + bool ret = false; + if ( window.Empty() == false ) + { + // check we have a valid type + DALI_ASSERT_ALWAYS( ( window.GetType() == typeid (Ecore_Wl_Window *) ) && "Window's surface type is invalid" ); + if ( AnyCast< Ecore_Wl_Window* >( window ) == mEcoreWindow ) + { + ret = true; + } + } + return ret; +} + } // namespace Adaptor } // namespace Internal