EINTERN int e_keyrouter_set_keygrab_in_list(struct wl_resource *surface, struct wl_client *client, uint32_t key, uint32_t mode);
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_find_and_remove_client_from_list(struct wl_resource *surface, struct wl_client *wc, uint32_t key, uint32_t mode);
+
EINTERN void e_keyrouter_grabbed_key_client_node_data_remove(struct wl_client *wc, uint32_t key, uint32_t mode);
EINTERN void e_keyrouter_grabbed_key_surface_node_data_remove(struct wl_resource *surface, uint32_t key, uint32_t mode);
+
EINTERN void e_keyrouter_remove_client_from_list(struct wl_resource *surface, struct wl_client *wc);
EINTERN int e_keyrouter_find_key_in_list(struct wl_resource *surface, struct wl_client *wc, uint32_t key);
EINTERN Eina_Bool e_keyrouter_process_key_event(void *event, int type);
EINTERN int e_keyrouter_cb_picture_off(const int option, void *data);
EINTERN int e_keyrouter_keygrab_set(struct wl_client *client, struct wl_resource *surface, int key, int mode);
-EINTERN void e_keyrouter_keygrab_unset(struct wl_client *client, struct wl_resource *surface, int key);
+
EINTERN void e_keyrouter_client_keygrab_unset(struct wl_client *client, int key);
EINTERN void e_keyrouter_surface_keygrab_unset(struct wl_resource *surface, int key);
/* remove key grab info from the list */
void
-e_keyrouter_find_and_remove_client_from_list(struct wl_resource *surface, struct wl_client *wc, uint32_t key, uint32_t mode)
-{
- Eina_List **list = NULL;
- Eina_List *l = NULL, *l_next = NULL;
- E_Keyrouter_Key_List_NodePtr key_node_data = NULL;
-
- g_rec_mutex_lock(&krt->grab_key_mutex);
- list = _e_keyrouter_get_list(mode, key);
- if (!list)
- {
- g_rec_mutex_unlock(&krt->grab_key_mutex);
- return;
- }
-
- EINA_LIST_FOREACH_SAFE(*list, l, l_next, key_node_data)
- {
- if (!key_node_data) continue;
-
- if (surface)
- {
- if (surface == key_node_data->surface)
- {
- if (mode == TIZEN_KEYROUTER_MODE_PRESSED)
- {
- key_node_data->status = E_KRT_CSTAT_UNGRAB;
- }
- else
- {
- *list = eina_list_remove_list(*list, l);
- E_FREE(key_node_data);
- }
- KLDBG("Remove a %s Mode Grabbed key(%d) by surface(%p)", e_keyrouter_mode_to_string(mode), key, surface);
- }
- }
- else if ((wc == key_node_data->wc))
- {
- if (mode == TIZEN_KEYROUTER_MODE_PRESSED)
- {
- key_node_data->status = E_KRT_CSTAT_UNGRAB;
- }
- else
- {
- *list = eina_list_remove_list(*list, l);
- E_FREE(key_node_data);
- }
- KLDBG("Remove a %s Mode Grabbed key(%d) by wc(%p)", e_keyrouter_mode_to_string(mode), key, wc);
- }
- }
-
- g_rec_mutex_unlock(&krt->grab_key_mutex);
-}
-
-void
e_keyrouter_grabbed_key_client_node_data_remove(struct wl_client *wc, uint32_t key, uint32_t mode)
{
Eina_List **list = NULL;
return res;
}
-void
-e_keyrouter_keygrab_unset(struct wl_client *client, struct wl_resource *surface, int key)
-{
- /* Ungrab top position grabs first. This grab mode do not need privilege */
- if (!surface)
- e_keyrouter_find_and_remove_client_from_list(NULL, client, key, TIZEN_KEYROUTER_MODE_TOPMOST);
- else
- e_keyrouter_find_and_remove_client_from_list(surface, client, key, TIZEN_KEYROUTER_MODE_TOPMOST);
-
- if (!surface)
- {
- /* EXCLUSIVE grab */
- e_keyrouter_find_and_remove_client_from_list(NULL, client, key, TIZEN_KEYROUTER_MODE_EXCLUSIVE);
-
- /* OVERRIDABLE_EXCLUSIVE grab */
- e_keyrouter_find_and_remove_client_from_list(NULL, client, key, TIZEN_KEYROUTER_MODE_OVERRIDABLE_EXCLUSIVE);
-
- /* SHARED grab */
- e_keyrouter_find_and_remove_client_from_list(NULL, client, key, TIZEN_KEYROUTER_MODE_SHARED);
-
- /* Press List */
- e_keyrouter_find_and_remove_client_from_list(NULL, client, key, TIZEN_KEYROUTER_MODE_PRESSED);
- }
- else
- {
- /* EXCLUSIVE grab */
- e_keyrouter_find_and_remove_client_from_list(surface, client, key, TIZEN_KEYROUTER_MODE_EXCLUSIVE);
-
- /* OVERRIDABLE_EXCLUSIVE grab */
- e_keyrouter_find_and_remove_client_from_list(surface, client, key, TIZEN_KEYROUTER_MODE_OVERRIDABLE_EXCLUSIVE);
-
- /* SHARED grab */
- e_keyrouter_find_and_remove_client_from_list(surface, client, key, TIZEN_KEYROUTER_MODE_SHARED);
-
- /* Press List */
- e_keyrouter_find_and_remove_client_from_list(surface, client, key, TIZEN_KEYROUTER_MODE_PRESSED);
- }
-}
-
EINTERN void
e_keyrouter_client_keygrab_unset(struct wl_client *client, int key)
{