e_keyrouter_keygrab: make e_keyrouter_keygrab_intern header file 33/321733/1
authorSooChan Lim <sc1.lim@samsung.com>
Wed, 26 Mar 2025 05:22:01 +0000 (14:22 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Thu, 27 Mar 2025 10:03:35 +0000 (19:03 +0900)
move e_keyrouter_list functions to e_keyrouter_keygrab_intern header files.
and rename the symbols in the header file to put e_keyrouter_keygrab prefix

Change-Id: I5c3a0f80e332eb85f7dfbd3936939dce6f8994aa

src/bin/inputmgr/e_keyrouter_event.c
src/bin/inputmgr/e_keyrouter_intern.h
src/bin/inputmgr/e_keyrouter_keygrab_intern.h [new file with mode: 0644]
src/bin/inputmgr/e_keyrouter_list.c
src/bin/server/e_keyrouter_wl.c

index ebda2d7243ffa7985c262068f3b606081430e083..358cd0e9c3b730dc039e666ad5dd1468a9b35bff 100644 (file)
@@ -8,6 +8,7 @@
 #include "e_config_intern.h"
 #include "e_client_intern.h"
 #include "e_keyrouter_wl_intern.h"
+#include "e_keyrouter_keygrab_intern.h"
 #include "e_keyrouter_hardkeys_intern.h"
 #include "e_zone_intern.h"
 
@@ -560,13 +561,13 @@ _e_keyrouter_send_key_events_focus(int type, struct wl_resource *surface_focus,
      {
         if (key_data->ignored)
           {
-             e_keyrouter_prepend_to_keylist(NULL, NULL, ev->keycode, TIZEN_KEYROUTER_MODE_PRESSED, EINA_TRUE);
+             e_keyrouter_keygrab_prepend_to_keylist(NULL, NULL, ev->keycode, TIZEN_KEYROUTER_MODE_PRESSED, EINA_TRUE);
              return EINA_TRUE;
           }
         else if (key_data->surface)
           {
              *delivered_surface = key_data->surface;
-             e_keyrouter_prepend_to_keylist(key_data->surface, key_data->client, ev->keycode, TIZEN_KEYROUTER_MODE_PRESSED, EINA_TRUE);
+             e_keyrouter_keygrab_prepend_to_keylist(key_data->surface, key_data->client, ev->keycode, TIZEN_KEYROUTER_MODE_PRESSED, EINA_TRUE);
              res = e_keyrouter_wl_key_send(ev, dev, (type==ECORE_EVENT_KEY_DOWN)?EINA_TRUE:EINA_FALSE, key_data->client, key_data->surface, EINA_FALSE);
 
              _e_keyrouter_log_key_event(key_event_log_type, "FOCUS HOOK",
@@ -581,7 +582,7 @@ _e_keyrouter_send_key_events_focus(int type, struct wl_resource *surface_focus,
      }
    else
      {
-        e_keyrouter_prepend_to_keylist(NULL, NULL, ev->keycode, TIZEN_KEYROUTER_MODE_PRESSED, EINA_TRUE);
+        e_keyrouter_keygrab_prepend_to_keylist(NULL, NULL, ev->keycode, TIZEN_KEYROUTER_MODE_PRESSED, EINA_TRUE);
         return EINA_FALSE;
      }
 
@@ -672,7 +673,7 @@ _e_keyrouter_send_key_event(int type, struct wl_resource *surface, struct wl_cli
    if (ECORE_EVENT_KEY_DOWN == type)
      {
         pressed = EINA_TRUE;
-        e_keyrouter_prepend_to_keylist(surface, wc, ev->keycode, TIZEN_KEYROUTER_MODE_PRESSED, focused);
+        e_keyrouter_keygrab_prepend_to_keylist(surface, wc, ev->keycode, TIZEN_KEYROUTER_MODE_PRESSED, focused);
      }
 
    if (e_config->key_input_ttrace_enable)
index 99df20a4eb84a5acf100b8e895f8efc1f848377a..222b8d3cadc34e286ef9d36a895f4489aedd615a 100644 (file)
@@ -93,18 +93,9 @@ extern E_API E_KeyrouterPtr krt;
 EINTERN int e_keyrouter_init(void);
 EINTERN int e_keyrouter_shutdown(void);
 
-EINTERN int e_keyrouter_prepend_to_keylist(struct wl_resource *surface, struct wl_client *wc, uint32_t key, uint32_t mode, Eina_Bool focused);
-EINTERN void e_keyrouter_remove_surface_from_list(struct wl_resource *surface);
-EINTERN void e_keyrouter_remove_client_from_list(struct wl_client *wc);
-EINTERN uint32_t e_keyrouter_find_keygrab_mode_with_surface(struct wl_resource *surface, uint32_t key);
-EINTERN uint32_t e_keyrouter_find_keygrab_mode_with_client(struct wl_client *wc, uint32_t key);
-
 EINTERN int                 e_keyrouter_util_get_pid(struct wl_client *client, struct wl_resource *surface);
 EINTERN char               *e_keyrouter_util_cmd_get_from_pid(int pid);
 EINTERN char               *e_keyrouter_util_process_name_get_from_cmd(char *cmd);
 EINTERN const char         *e_keyrouter_util_mode_to_string(uint32_t mode);
 
-EINTERN int e_keyrouter_keygrab_set(struct wl_client *client, struct wl_resource *surface, int key, int mode);
-EINTERN int e_keyrouter_keygrab_unset(struct wl_client *client, struct wl_resource *surface, int key);
-
 #endif
diff --git a/src/bin/inputmgr/e_keyrouter_keygrab_intern.h b/src/bin/inputmgr/e_keyrouter_keygrab_intern.h
new file mode 100644 (file)
index 0000000..5f353ef
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef E_KEYROUTER_KEYGRAB_INTERN_H
+#define E_KEYROUTER_KEYGRAB_INTERN_H
+
+#include "e_intern.h"
+
+EINTERN int e_keyrouter_keygrab_set(struct wl_client *client, struct wl_resource *surface, int key, int mode);
+EINTERN int e_keyrouter_keygrab_unset(struct wl_client *client, struct wl_resource *surface, int key);
+
+EINTERN int e_keyrouter_keygrab_prepend_to_keylist(struct wl_resource *surface, struct wl_client *wc, uint32_t key, uint32_t mode, Eina_Bool focused);
+EINTERN void e_keyrouter_keygrab_remove_surface_from_list(struct wl_resource *surface);
+EINTERN void e_keyrouter_keygrab_remove_client_from_list(struct wl_client *wc);
+
+EINTERN uint32_t e_keyrouter_keygrab_find_mode_with_surface(struct wl_resource *surface, uint32_t key);
+EINTERN uint32_t e_keyrouter_keygrab_find_mode_with_client(struct wl_client *wc, uint32_t key);
+
+#endif
index 117885c06b964abcdb44cbc34bc88daf5c6f69e4..55fc820694321d52282cdbb4d2bbaaa8f2a43075 100644 (file)
@@ -1,8 +1,8 @@
-#include "e_keyrouter_intern.h"
+#include "e_keyrouter_keygrab_intern.h"
+#include "e_keyrouter_hardkeys_intern.h"
 #include "e_input_thread_client_intern.h"
 #include "e_input_backend_intern.h"
 #include "e_keyrouter_wl_intern.h"
-#include "e_keyrouter_hardkeys_intern.h"
 
 #include <tizen-extension-server-protocol.h>
 
@@ -49,7 +49,7 @@ _e_keyrouter_find_duplicated_grabbed_key(struct wl_resource *surface, struct wl_
 
 /* Function for prepending a new key grab information in the keyrouting list */
 EINTERN int
-e_keyrouter_prepend_to_keylist(struct wl_resource *surface, struct wl_client *wc, uint32_t key, uint32_t mode, Eina_Bool focused)
+e_keyrouter_keygrab_prepend_to_keylist(struct wl_resource *surface, struct wl_client *wc, uint32_t key, uint32_t mode, Eina_Bool focused)
 {
    int res = TIZEN_KEYROUTER_ERROR_NONE;
 
@@ -98,7 +98,7 @@ e_keyrouter_prepend_to_keylist(struct wl_resource *surface, struct wl_client *wc
 }
 
 EINTERN void
-e_keyrouter_remove_surface_from_list(struct wl_resource *surface)
+e_keyrouter_keygrab_remove_surface_from_list(struct wl_resource *surface)
 {
    uint32_t key, mode;
 
@@ -121,7 +121,7 @@ e_keyrouter_remove_surface_from_list(struct wl_resource *surface)
 }
 
 EINTERN void
-e_keyrouter_remove_client_from_list(struct wl_client *client)
+e_keyrouter_keygrab_remove_client_from_list(struct wl_client *client)
 {
    uint32_t key, mode;
 
@@ -144,7 +144,7 @@ e_keyrouter_remove_client_from_list(struct wl_client *client)
 }
 
 EINTERN uint32_t
-e_keyrouter_find_keygrab_mode_with_surface(struct wl_resource *surface, uint32_t key)
+e_keyrouter_keygrab_find_mode_with_surface(struct wl_resource *surface, uint32_t key)
 {
    uint32_t mode;
 
@@ -169,7 +169,7 @@ e_keyrouter_find_keygrab_mode_with_surface(struct wl_resource *surface, uint32_t
 }
 
 EINTERN uint32_t
-e_keyrouter_find_keygrab_mode_with_client(struct wl_client *client, uint32_t key)
+e_keyrouter_keygrab_find_mode_with_client(struct wl_client *client, uint32_t key)
 {
    uint32_t mode;
 
@@ -246,7 +246,7 @@ e_keyrouter_keygrab_set(struct wl_client *client, struct wl_resource *surface, i
         g_rec_mutex_unlock(&krt->grab_key_mutex);
      }
 
-   res = e_keyrouter_prepend_to_keylist(surface,
+   res = e_keyrouter_keygrab_prepend_to_keylist(surface,
                                    surface ? NULL : client,
                                    key,
                                    mode,
index 74fe26667a858386863448da8cc0ad68f506d837..3bf957eecb7e0d14f637089419303123cb249f82 100644 (file)
@@ -10,6 +10,7 @@
 #include "e_input_thread_client_intern.h"
 #include "e_security.h"
 #include "e_keyrouter_intern.h"
+#include "e_keyrouter_keygrab_intern.h"
 #include "e_keyrouter_hardkeys_intern.h"
 #include "e_zone_intern.h"
 
@@ -332,8 +333,8 @@ _e_keyrouter_cb_get_keygrab_status(struct wl_client *client, struct wl_resource
 
    TRACE_INPUT_BEGIN(_e_keyrouter_cb_get_keygrab_status);
 
-   mode = surface ? e_keyrouter_find_keygrab_mode_with_surface(surface, key)
-                  : e_keyrouter_find_keygrab_mode_with_client(client, key);
+   mode = surface ? e_keyrouter_keygrab_find_mode_with_surface(surface, key)
+                  : e_keyrouter_keygrab_find_mode_with_client(client, key);
 
    TRACE_INPUT_END();
    tizen_keyrouter_send_keygrab_notify(resource, surface, key, mode, TIZEN_KEYROUTER_ERROR_NONE);
@@ -534,7 +535,7 @@ _e_keyrouter_wl_client_cb_destroy(struct wl_listener *l, void *data)
    struct wl_client *client = data;
 
    KLDBG("Listener(%p) called: wl_client: %p is died", l, client);
-   e_keyrouter_remove_client_from_list(client);
+   e_keyrouter_keygrab_remove_client_from_list(client);
 
    wl_list_remove(&l->link);
    E_FREE(l);
@@ -548,7 +549,7 @@ _e_keyrouter_wl_surface_cb_destroy(struct wl_listener *l, void *data)
    struct wl_resource *surface = (struct wl_resource *)data;
 
    KLDBG("Listener(%p) called: surface: %p is died", l, surface);
-   e_keyrouter_remove_surface_from_list(surface);
+   e_keyrouter_keygrab_remove_surface_from_list(surface);
 
    wl_list_remove(&l->link);
    E_FREE(l);