Binding ecore_wl2_window_keyboard_grab and ecore_wl2_window_keyboard_ungrab api 28/297828/1
authorjoogab.yun <joogab.yun@samsung.com>
Fri, 25 Aug 2023 04:49:32 +0000 (13:49 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Fri, 25 Aug 2023 04:49:32 +0000 (13:49 +0900)
Change-Id: I844fc244b91468549649e801ac49b3ddcbebbe87

18 files changed:
dali/devel-api/adaptor-framework/window-devel.cpp
dali/devel-api/adaptor-framework/window-devel.h
dali/internal/window-system/android/window-base-android.cpp
dali/internal/window-system/android/window-base-android.h
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/macos/window-base-mac.h
dali/internal/window-system/macos/window-base-mac.mm
dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.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
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h
dali/internal/window-system/windows/window-base-win.cpp
dali/internal/window-system/windows/window-base-win.h
dali/internal/window-system/x11/window-base-x.cpp
dali/internal/window-system/x11/window-base-x.h

index e5ef80f..fdde5a7 100644 (file)
@@ -329,6 +329,16 @@ void CursorVisibleSet(Window window, bool visible)
   GetImplementation(window).CursorVisibleSet(visible);
 }
 
+bool KeyboardGrab(Window window, Device::Subclass::Type deviceSubclass)
+{
+  return GetImplementation(window).KeyboardGrab(deviceSubclass);
+}
+
+bool KeyboardUnGrab(Window window)
+{
+  return GetImplementation(window).KeyboardUnGrab();
+}
+
 InterceptKeyEventSignalType& InterceptKeyEventSignal(Window window)
 {
   return GetImplementation(window).InterceptKeyEventSignal();
index 994ea50..ace275e 100644 (file)
@@ -592,6 +592,23 @@ DALI_ADAPTOR_API bool PointerWarp(Window window, int32_t x, int32_t y);
 DALI_ADAPTOR_API void CursorVisibleSet(Window window, bool visible);
 
 /**
+ * @brief Requests grab key events according to the requested device subtype
+ *
+ * @param[in] window The window instance.
+ * @param[in] deviceSubclass The deviceSubclass type.
+ * @return Returns true if KeyboardGrab succeeds.
+ */
+DALI_ADAPTOR_API bool KeyboardGrab(Window window, Device::Subclass::Type deviceSubclass);
+
+/**
+ * @brief Requests ungrab key events
+ *
+ * @param[in] window The window instance.
+ * @return Returns true if KeyboardUnGrab succeeds.
+ */
+DALI_ADAPTOR_API bool KeyboardUnGrab(Window window);
+
+/**
  * @brief The user would connect to this signal to intercept a KeyEvent at window.
  *
  * Intercepts KeyEvents in the window before dispatching KeyEvents to the control.
index 7355b7f..c2cbdf4 100644 (file)
@@ -459,6 +459,16 @@ void WindowBaseAndroid::CursorVisibleSet(bool visible)
 {
 }
 
+bool WindowBaseAndroid::KeyboardGrab(Device::Subclass::Type deviceSubclass)
+{
+  return false;
+}
+
+bool WindowBaseAndroid::KeyboardUnGrab()
+{
+  return false;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index abd3de4..c2a183c 100644 (file)
@@ -484,6 +484,16 @@ public:
    */
   void CursorVisibleSet(bool visible) override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardGrab()
+   */
+  bool KeyboardGrab(Device::Subclass::Type deviceSubclass) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardUnGrab()
+   */
+  bool KeyboardUnGrab() override;
+
 private:
   /**
    * Second stage initialization
index 204fdad..d9aca61 100644 (file)
@@ -513,6 +513,22 @@ public:
    */
   virtual void CursorVisibleSet(bool visible) = 0;
 
+  /**
+   * @brief Requests grab key events according to the requested device subtype
+   *
+   * @param[in] deviceSubclass The deviceSubclass type.
+   * @return Returns true if KeyboardGrab succeeds.
+   */
+  virtual bool KeyboardGrab(Device::Subclass::Type deviceSubclass) = 0;
+
+  /**
+   * @brief Requests ungrab key events
+   *
+   * @param[in] window The window instance.
+   * @return Returns true if KeyboardUnGrab succeeds.
+   */
+  virtual bool KeyboardUnGrab() = 0;
+
   // Signals
 
   /**
index 332bbd4..ed618c2 100644 (file)
@@ -1435,6 +1435,16 @@ void Window::CursorVisibleSet(bool visible)
   mWindowBase->CursorVisibleSet(visible);
 }
 
+bool Window::KeyboardGrab(Device::Subclass::Type deviceSubclass)
+{
+  return mWindowBase->KeyboardGrab(deviceSubclass);
+}
+
+bool Window::KeyboardUnGrab()
+{
+  return mWindowBase->KeyboardUnGrab();
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 2b9b367..c9f558e 100644 (file)
@@ -541,6 +541,16 @@ public: // Dali::Internal::Adaptor::SceneHolder
    */
   void CursorVisibleSet(bool visible);
 
+  /**
+   * @copydoc Dali::DevelWindow::KeyboardGrab()
+   */
+  bool KeyboardGrab(Device::Subclass::Type deviceSubclass);
+
+  /**
+   * @copydoc Dali::DevelWindow::KeyboardUnGrab()
+   */
+  bool KeyboardUnGrab();
+
 private:
   /**
    * @brief Enumeration for orietation mode.
index 4a3390a..0cfa0cc 100644 (file)
@@ -417,6 +417,16 @@ public:
    */
   void CursorVisibleSet(bool visible) override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardGrab()
+   */
+  bool KeyboardGrab(Device::Subclass::Type deviceSubclass) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardUnGrab()
+   */
+  bool KeyboardUnGrab() override;
+
 private:
   // Undefined
   WindowBaseCocoa(const WindowBaseCocoa&) = delete;
index 43cc053..588c62a 100644 (file)
@@ -750,6 +750,16 @@ void WindowBaseCocoa::CursorVisibleSet(bool visible)
 {
 }
 
+bool WindowBaseCocoa::KeyboardGrab(Device::Subclass::Type deviceSubclass)
+{
+  return false;
+}
+
+bool WindowBaseCocoa::KeyboardUnGrab()
+{
+  return false;
+}
+
 } // namespace Dali::Internal::Adaptor
 
 @implementation CocoaView
index 177ea76..9621acd 100644 (file)
@@ -539,6 +539,16 @@ public:
    */
   void CursorVisibleSet(bool visible) override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardGrab()
+   */
+  bool KeyboardGrab(Device::Subclass::Type deviceSubclass) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardUnGrab()
+   */
+  bool KeyboardUnGrab() override;
+
 private:
   /**
    * Second stage initialization
index 3120694..34e019e 100644 (file)
@@ -3413,6 +3413,43 @@ void WindowBaseEcoreWl2::CursorVisibleSet(bool visible)
   ecore_wl2_window_cursor_visible_set(mEcoreWindow, visible);
 }
 
+// Request grab key events according to the requested device subtype
+//(For now, subtype could be '0'/'11'/'12' which equals to ECORE_DEVICE_SUBCLASS_NONE/REMOCON/VIRTUAL_KEYBOARD)
+bool WindowBaseEcoreWl2::KeyboardGrab(Device::Subclass::Type deviceSubclass)
+{
+  Ecore_Device_Subclass ecoreDeviceSubclass;
+  switch(deviceSubclass)
+  {
+    case Device::Subclass::NONE:
+    {
+      ecoreDeviceSubclass = ECORE_DEVICE_SUBCLASS_NONE;
+      break;
+    }
+    case Device::Subclass::REMOCON:
+    {
+      ecoreDeviceSubclass = ECORE_DEVICE_SUBCLASS_REMOCON;
+      break;
+    }
+    case Device::Subclass::VIRTUAL_KEYBOARD:
+    {
+      ecoreDeviceSubclass = ECORE_DEVICE_SUBCLASS_VIRTUAL_KEYBOARD;
+      break;
+    }
+    default:
+    {
+      DALI_LOG_ERROR("deviceSubclass : %d type is not support, subtype could be 'NONE', 'REMOCON', 'VIRTUAL_KEYBOARD'\n");
+      return false;
+    }
+  }
+  return ecore_wl2_window_keyboard_grab(mEcoreWindow, ecoreDeviceSubclass);
+}
+
+// Request ungrab key events
+bool WindowBaseEcoreWl2::KeyboardUnGrab()
+{
+  return ecore_wl2_window_keyboard_ungrab(mEcoreWindow);
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 7240bff..271c518 100644 (file)
@@ -616,6 +616,16 @@ public:
    */
   void CursorVisibleSet(bool visible) override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardGrab()
+   */
+  bool KeyboardGrab(Device::Subclass::Type deviceSubclass) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardUnGrab()
+   */
+  bool KeyboardUnGrab() override;
+
 private:
   /**
    * Second stage initialization
index e0b6e23..1b91b48 100644 (file)
@@ -1046,6 +1046,16 @@ void WindowBaseEcoreX::CursorVisibleSet(bool visible)
 {
 }
 
+bool WindowBaseEcoreX::KeyboardGrab(Device::Subclass::Type deviceSubclass)
+{
+  return false;
+}
+
+bool WindowBaseEcoreX::KeyboardUnGrab()
+{
+  return false;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 493a74b..b5330f4 100644 (file)
@@ -489,6 +489,16 @@ public:
    */
   void CursorVisibleSet(bool visible) override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardGrab()
+   */
+  bool KeyboardGrab(Device::Subclass::Type deviceSubclass) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardUnGrab()
+   */
+  bool KeyboardUnGrab() override;
+
 private:
   /**
    * Second stage initialization
index 7d71d49..8f78ca7 100644 (file)
@@ -681,6 +681,16 @@ void WindowBaseWin::CursorVisibleSet(bool visible)
 {
 }
 
+bool WindowBaseWin::KeyboardGrab(Device::Subclass::Type deviceSubclass)
+{
+  return false;
+}
+
+bool WindowBaseWin::KeyboardUnGrab()
+{
+  return false;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 6006907..d615730 100644 (file)
@@ -471,6 +471,16 @@ public:
    */
   void CursorVisibleSet(bool visible) override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardGrab()
+   */
+  bool KeyboardGrab(Device::Subclass::Type deviceSubclass) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardUnGrab()
+   */
+  bool KeyboardUnGrab() override;
+
 private:
   /**
    * Second stage initialization
index 7a66fb5..1f21851 100644 (file)
@@ -982,6 +982,16 @@ void WindowBaseX::CursorVisibleSet(bool visible)
 {
 }
 
+bool WindowBaseX::KeyboardGrab(Device::Subclass::Type deviceSubclass)
+{
+  return false;
+}
+
+bool WindowBaseX::KeyboardUnGrab()
+{
+  return false;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index aa60298..f102627 100644 (file)
@@ -493,6 +493,16 @@ public:
    */
   void CursorVisibleSet(bool visible) override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardGrab()
+   */
+  bool KeyboardGrab(Device::Subclass::Type deviceSubclass) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardUnGrab()
+   */
+  bool KeyboardUnGrab() override;
+
 private:
   /**
    * Second stage initialization