Add Keyboard repeat setting changed signal to Window 05/238805/5
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Fri, 17 Jul 2020 10:18:50 +0000 (19:18 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 28 Jul 2020 01:32:18 +0000 (10:32 +0900)
- 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 <seoyeon2.kim@samsung.com>
dali/devel-api/adaptor-framework/window-devel.cpp
dali/devel-api/adaptor-framework/window-devel.h
dali/internal/window-system/common/window-base.cpp
dali/internal/window-system/common/window-base.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-impl.h
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h

index 62904ec0bf75c246d46b29cb5835476ee15f2cbf..3cd89e2d02fa318f331f52563b39c871a63dd285 100644 (file)
@@ -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 );
index 2f837021f56796bd5fba7ad043af709345d1a95c..af4ca19f2a0788bd9b7461b9d5e31db7c5d0d17f 100644 (file)
@@ -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.
  *
@@ -154,6 +156,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.
  *
index f3101b689aa352f428c734eaeef21314349f94c8..6400c5adc97309d6a0e8f7e65db8a97fdeb4b47c 100644 (file)
@@ -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
index a5daaa2369198d3800906211f8b92e461e42be16..0857c8bd5abc78a2dac3bc7fc2df6ea894c302ce 100644 (file)
@@ -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
index 8ff97f8b83bc492ca9bacdb73ddaa45fed2ca2fd..748b67ea45806590dd8d3f82bad07a55e73a4baf 100755 (executable)
@@ -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 );
index 4a266f50f97392602186b1599b28694eec9c2835..5bc3bb9287e9351f0bbdf9c4a25cc1938b28910c 100755 (executable)
@@ -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;
 
   /**
@@ -419,6 +420,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.
    */
@@ -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
index db4fa5080597824e4508a2b7f9809a7c5937ad0c..ca4e05153adc735a76e87f8829c460535c357383 100755 (executable)
@@ -504,6 +504,23 @@ static Eina_Bool EcoreEventEffectEnd(void *data, int type, void *event)
   return ECORE_CALLBACK_PASS_ON;
 }
 
+/////////////////////////////////////////////////////////////////////////////////////////////////
+// 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<Ecore_Wl2_Event_Seat_Keyboard_Repeat_Changed*>( 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<Ecore_Wl2_Event_Seat_Keymap_Changed*>( event );
index dad079d3c02993f1043bc2a78d334a12b0e4c9a6..e22359105122eebf066224ddb58c76c89a347466 100644 (file)
@@ -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.