From: Seoyeon Kim Date: Fri, 17 Jul 2020 10:18:50 +0000 (+0900) Subject: Add Keyboard repeat setting changed signal to Window X-Git-Tag: dali_1.9.24~6^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=d6f38dadcefb4a766c84094cd099fa758fadb176 Add Keyboard repeat setting changed signal to Window - Added DevelWindow signal to register the keyboard repeat event below : ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED - This signal is emitted when the values of keyboard repeat, such as delay and rate, are changed globally. Change-Id: Ic6e5651aca42551639e204205191472afda25405 Signed-off-by: Seoyeon Kim --- diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index 62904ec..3cd89e2 100644 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -98,6 +98,11 @@ TransitionEffectEventSignalType& TransitionEffectEventSignal( Window window ) return GetImplementation( window ).TransitionEffectEventSignal(); } +KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal( Window window ) +{ + return GetImplementation( window ).KeyboardRepeatSettingsChangedSignal(); +} + void SetParent( Window window, Window parent ) { GetImplementation( window ).SetParent( parent ); diff --git a/dali/devel-api/adaptor-framework/window-devel.h b/dali/devel-api/adaptor-framework/window-devel.h index 2f83702..af4ca19 100644 --- a/dali/devel-api/adaptor-framework/window-devel.h +++ b/dali/devel-api/adaptor-framework/window-devel.h @@ -66,6 +66,8 @@ typedef Signal< void ( Window, bool ) > VisibilityChangedSignalType; ///< Visibi typedef Signal< void (Window, EffectState, EffectType) > TransitionEffectEventSignalType; ///< Effect signal type and state +typedef Signal< void () > KeyboardRepeatSettingsChangedSignalType; ///< Keyboard repeat settings changed signal type + /** * @brief Creates an initialized handle to a new Window. * @@ -155,6 +157,14 @@ DALI_ADAPTOR_API VisibilityChangedSignalType& VisibilityChangedSignal( Window wi DALI_ADAPTOR_API TransitionEffectEventSignalType& TransitionEffectEventSignal( Window window ); /** + * @brief This signal is emitted just after the keyboard repeat setting is changed globally. + * + * @param[in] window The window instance + * @return The signal to connect to + */ +DALI_ADAPTOR_API KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal( Window window ); + +/** * @brief Sets parent window of the window. * * After setting that, these windows do together when raise-up, lower and iconified/deiconified. diff --git a/dali/internal/window-system/common/window-base.cpp b/dali/internal/window-system/common/window-base.cpp index f3101b6..6400c5a 100644 --- a/dali/internal/window-system/common/window-base.cpp +++ b/dali/internal/window-system/common/window-base.cpp @@ -41,7 +41,8 @@ WindowBase::WindowBase() mSelectionDataReceivedSignal(), mStyleChangedSignal(), mAccessibilitySignal(), - mTransitionEffectEventSignal() + mTransitionEffectEventSignal(), + mKeyboardRepeatSettingsChangedSignal() { } @@ -119,6 +120,11 @@ WindowBase::TransitionEffectEventSignalType& WindowBase::TransitionEffectEventSi return mTransitionEffectEventSignal; } +WindowBase::KeyboardRepeatSettingsChangedSignalType& WindowBase::KeyboardRepeatSettingsChangedSignal() +{ + return mKeyboardRepeatSettingsChangedSignal; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index a5daaa2..0857c8b 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -71,6 +71,7 @@ public: typedef Signal< void ( const DamageArea& ) > DamageSignalType; typedef Signal< void ( const RotationEvent& ) > RotationSignalType; typedef Signal< void ( DevelWindow::EffectState, DevelWindow::EffectType ) > TransitionEffectEventSignalType; + typedef Signal< void ( ) > KeyboardRepeatSettingsChangedSignalType; // Input events typedef Signal< void ( Integration::Point&, uint32_t ) > TouchEventSignalType; @@ -419,6 +420,11 @@ public: */ TransitionEffectEventSignalType& TransitionEffectEventSignal(); + /** + * @brief This signal is emitted when the keyboard repeat is changed. + */ + KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal(); + protected: // Undefined @@ -429,20 +435,21 @@ protected: protected: - IconifySignalType mIconifyChangedSignal; - FocusSignalType mFocusChangedSignal; - OutputSignalType mOutputTransformedSignal; - DeleteSignalType mDeleteRequestSignal; - DamageSignalType mWindowDamagedSignal; - RotationSignalType mRotationSignal; - TouchEventSignalType mTouchEventSignal; - WheelEventSignalType mWheelEventSignal; - KeyEventSignalType mKeyEventSignal; - SelectionSignalType mSelectionDataSendSignal; - SelectionSignalType mSelectionDataReceivedSignal; - StyleSignalType mStyleChangedSignal; - AccessibilitySignalType mAccessibilitySignal; - TransitionEffectEventSignalType mTransitionEffectEventSignal; + IconifySignalType mIconifyChangedSignal; + FocusSignalType mFocusChangedSignal; + OutputSignalType mOutputTransformedSignal; + DeleteSignalType mDeleteRequestSignal; + DamageSignalType mWindowDamagedSignal; + RotationSignalType mRotationSignal; + TouchEventSignalType mTouchEventSignal; + WheelEventSignalType mWheelEventSignal; + KeyEventSignalType mKeyEventSignal; + SelectionSignalType mSelectionDataSendSignal; + SelectionSignalType mSelectionDataReceivedSignal; + StyleSignalType mStyleChangedSignal; + AccessibilitySignalType mAccessibilitySignal; + TransitionEffectEventSignalType mTransitionEffectEventSignal; + KeyboardRepeatSettingsChangedSignalType mKeyboardRepeatSettingsChangedSignal; }; } // namespace Adaptor diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index 8ff97f8..748b67e 100755 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -93,7 +93,8 @@ Window::Window() mFocusChangeSignal(), mResizeSignal(), mVisibilityChangedSignal(), - mTransitionEffectEventSignal() + mTransitionEffectEventSignal(), + mKeyboardRepeatSettingsChangedSignal() { } @@ -120,6 +121,7 @@ void Window::Initialize(Any surface, const PositionSize& positionSize, const std mWindowBase->FocusChangedSignal().Connect( this, &Window::OnFocusChanged ); mWindowBase->DeleteRequestSignal().Connect( this, &Window::OnDeleteRequest ); mWindowBase->TransitionEffectEventSignal().Connect( this, &Window::OnTransitionEffectEvent ); + mWindowBase->KeyboardRepeatSettingsChangedSignal().Connect( this, &Window::OnKeyboardRepeatSettingsChanged ); mWindowSurface->OutputTransformedSignal().Connect( this, &Window::OnOutputTransformed ); @@ -807,6 +809,12 @@ void Window::OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindo mTransitionEffectEventSignal.Emit( handle, state, type ); } +void Window::OnKeyboardRepeatSettingsChanged() +{ + Dali::Window handle( this ); + mKeyboardRepeatSettingsChangedSignal.Emit(); +} + void Window::OnTouchPoint( Dali::Integration::Point& point, int timeStamp ) { FeedTouchPoint( point, timeStamp ); diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index 4a266f5..5bc3bb9 100755 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -63,6 +63,7 @@ public: typedef Dali::Window::ResizeSignalType ResizeSignalType; typedef Dali::DevelWindow::VisibilityChangedSignalType VisibilityChangedSignalType; typedef Dali::DevelWindow::TransitionEffectEventSignalType TransitionEffectEventSignalType; + typedef Dali::DevelWindow::KeyboardRepeatSettingsChangedSignalType KeyboardRepeatSettingsChangedSignalType; typedef Signal< void () > SignalType; /** @@ -420,6 +421,11 @@ private: void OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindow::EffectType type ); /** + * @brief Called when window receives a keyboard repeat event. + */ + void OnKeyboardRepeatSettingsChanged(); + + /** * @brief Set available orientation to window base. */ void SetAvailableAnlges( const std::vector< int >& angles ); @@ -524,6 +530,11 @@ public: // Signals */ TransitionEffectEventSignalType& TransitionEffectEventSignal() { return mTransitionEffectEventSignal; } + /** + * @copydoc Dali::DevelWindow::KeyboardRepeatSettingsChangedSignal() + */ + KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal() { return mKeyboardRepeatSettingsChangedSignal; } + private: WindowRenderSurface* mWindowSurface; ///< The window rendering surface @@ -553,12 +564,13 @@ private: int mNativeWindowId; ///< The Native Window Id // Signals - ResizedSignalType mResizedSignal; - SignalType mDeleteRequestSignal; - FocusChangeSignalType mFocusChangeSignal; - ResizeSignalType mResizeSignal; - VisibilityChangedSignalType mVisibilityChangedSignal; - TransitionEffectEventSignalType mTransitionEffectEventSignal; + ResizedSignalType mResizedSignal; + SignalType mDeleteRequestSignal; + FocusChangeSignalType mFocusChangeSignal; + ResizeSignalType mResizeSignal; + VisibilityChangedSignalType mVisibilityChangedSignal; + TransitionEffectEventSignalType mTransitionEffectEventSignal; + KeyboardRepeatSettingsChangedSignalType mKeyboardRepeatSettingsChangedSignal; }; } // namespace Adaptor diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index db4fa50..ca4e051 100755 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -505,6 +505,23 @@ static Eina_Bool EcoreEventEffectEnd(void *data, int type, void *event) } ///////////////////////////////////////////////////////////////////////////////////////////////// +// Keyboard Repeat Settings Changed Callbacks +///////////////////////////////////////////////////////////////////////////////////////////////// + +static Eina_Bool EcoreEventSeatKeyboardRepeatChanged(void *data, int type, void *event) +{ + Ecore_Wl2_Event_Seat_Keyboard_Repeat_Changed *keyboardRepeat = static_cast( event ); + WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventSeatKeyboardRepeatChanged, id[ %d ]\n", keyboardRepeat->id ); + if( windowBase ) + { + windowBase->OnKeyboardRepeatSettingsChanged(); + } + + return ECORE_CALLBACK_RENEW; +} + +///////////////////////////////////////////////////////////////////////////////////////////////// // Keymap Changed Callbacks ///////////////////////////////////////////////////////////////////////////////////////////////// @@ -763,41 +780,44 @@ void WindowBaseEcoreWl2::Initialize( PositionSize positionSize, Any surface, boo SetTransparency( isTransparent ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_WINDOW_ICONIFY_STATE_CHANGE, EcoreEventWindowIconifyStateChanged, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_FOCUS_IN, EcoreEventWindowFocusIn, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_FOCUS_OUT, EcoreEventWindowFocusOut, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_OUTPUT_TRANSFORM, EcoreEventOutputTransform, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_IGNORE_OUTPUT_TRANSFORM, EcoreEventIgnoreOutputTransform, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_WINDOW_ICONIFY_STATE_CHANGE, EcoreEventWindowIconifyStateChanged, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_FOCUS_IN, EcoreEventWindowFocusIn, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_FOCUS_OUT, EcoreEventWindowFocusOut, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_OUTPUT_TRANSFORM, EcoreEventOutputTransform, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_IGNORE_OUTPUT_TRANSFORM, EcoreEventIgnoreOutputTransform, this ) ); // Register Rotate event - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_WINDOW_ROTATE, EcoreEventRotate, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_WINDOW_ROTATE, EcoreEventRotate, this ) ); // Register Configure event - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_WINDOW_CONFIGURE, EcoreEventConfigure, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_WINDOW_CONFIGURE, EcoreEventConfigure, this ) ); // Register Touch events - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_DOWN, EcoreEventMouseButtonDown, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_UP, EcoreEventMouseButtonUp, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_MOVE, EcoreEventMouseButtonMove, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_CANCEL, EcoreEventMouseButtonCancel, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_DOWN, EcoreEventMouseButtonDown, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_UP, EcoreEventMouseButtonUp, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_MOVE, EcoreEventMouseButtonMove, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_CANCEL, EcoreEventMouseButtonCancel, this ) ); // Register Mouse wheel events - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_WHEEL, EcoreEventMouseWheel, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_WHEEL, EcoreEventMouseWheel, this ) ); // Register Detent event - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_DETENT_ROTATE, EcoreEventDetentRotation, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_DETENT_ROTATE, EcoreEventDetentRotation, this ) ); // Register Key events - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_KEY_DOWN, EcoreEventKeyDown, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_KEY_UP, EcoreEventKeyUp, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_KEY_DOWN, EcoreEventKeyDown, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_KEY_UP, EcoreEventKeyUp, this ) ); // Register Selection event - clipboard selection - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_DATA_SOURCE_SEND, EcoreEventDataSend, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_SELECTION_DATA_READY, EcoreEventDataReceive, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_DATA_SOURCE_SEND, EcoreEventDataSend, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_SELECTION_DATA_READY, EcoreEventDataReceive, this ) ); // Register Effect Start/End event - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_EFFECT_START, EcoreEventEffectStart, this ) ); - mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_EFFECT_END, EcoreEventEffectEnd, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_EFFECT_START, EcoreEventEffectStart, this ) ); + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_EFFECT_END, EcoreEventEffectEnd, this ) ); + + // Register Keyboard repeat event + mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED, EcoreEventSeatKeyboardRepeatChanged, this ) ); // Register Vconf notify - font name and size vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged, this ); @@ -1272,6 +1292,11 @@ void WindowBaseEcoreWl2::OnTransitionEffectEvent( DevelWindow::EffectState state mTransitionEffectEventSignal.Emit( state, type ); } +void WindowBaseEcoreWl2::OnKeyboardRepeatSettingsChanged() +{ + mKeyboardRepeatSettingsChangedSignal.Emit(); +} + void WindowBaseEcoreWl2::KeymapChanged(void *data, int type, void *event) { Ecore_Wl2_Event_Seat_Keymap_Changed *changed = static_cast( event ); diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index dad079d..e223591 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -161,6 +161,11 @@ public: */ void OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindow::EffectType type ); + /** + * @brief Called when a keyboard repeat event is changed. + */ + void OnKeyboardRepeatSettingsChanged(); + #ifdef DALI_ELDBUS_AVAILABLE /** * @brief Called when Ecore ElDBus accessibility event is received.