From b5a5e98632fabdf1562dd29938cdbe43f278667f Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 4 Aug 2015 18:54:17 -0400 Subject: [PATCH] make wl data device util function EINTERN e_comp_wl_data_find_for_client() --- src/bin/e_comp_wl_data.c | 39 ++++++++++++++++++--------------------- src/bin/e_comp_wl_data.h | 2 +- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/src/bin/e_comp_wl_data.c b/src/bin/e_comp_wl_data.c index 30e1a337e..b2632a900 100644 --- a/src/bin/e_comp_wl_data.c +++ b/src/bin/e_comp_wl_data.c @@ -1,21 +1,6 @@ #define E_COMP_WL #include "e.h" -static struct wl_resource * -_e_comp_wl_data_find_for_client(Eina_List *list, struct wl_client *client) -{ - Eina_List *l; - struct wl_resource *res; - - EINA_LIST_FOREACH(list, l, res) - { - if (wl_resource_get_client(res) == client) - return res; - } - - return NULL; -} - static void _e_comp_wl_data_offer_cb_accept(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t serial, const char *mime_type) { @@ -174,8 +159,7 @@ _e_comp_wl_data_device_destroy_selection_data_source(struct wl_listener *listene if (focus) { data_device_res = - _e_comp_wl_data_find_for_client(e_comp->wl_comp_data->mgr.data_resources, - wl_resource_get_client(source->resource)); + e_comp_wl_data_find_for_client(wl_resource_get_client(source->resource)); if (data_device_res) wl_data_device_send_selection(data_device_res, NULL); @@ -259,8 +243,7 @@ _e_comp_wl_data_device_selection_set(void *data EINA_UNUSED, E_Comp_Wl_Data_Sour if (focus) { data_device_res = - _e_comp_wl_data_find_for_client(e_comp->wl_comp_data->mgr.data_resources, - wl_resource_get_client(focus)); + e_comp_wl_data_find_for_client(wl_resource_get_client(focus)); if ((data_device_res) && (source)) { offer_res = @@ -679,8 +662,7 @@ e_comp_wl_data_device_keyboard_focus_set(void) } data_device_res = - _e_comp_wl_data_find_for_client(e_comp->wl_comp_data->mgr.data_resources, - wl_resource_get_client(focus)); + e_comp_wl_data_find_for_client(wl_resource_get_client(focus)); if (!data_device_res) return; source = (E_Comp_Wl_Data_Source*)e_comp->wl_comp_data->selection.data_source; @@ -727,3 +709,18 @@ e_comp_wl_data_manager_shutdown(void) wl_list_remove(&e_comp->wl_comp_data->clipboard.listener.link); } + +EINTERN struct wl_resource * +e_comp_wl_data_find_for_client(struct wl_client *client) +{ + Eina_List *l; + struct wl_resource *res; + + EINA_LIST_FOREACH(e_comp->wl_comp_data->mgr.data_resources, l, res) + { + if (wl_resource_get_client(res) == client) + return res; + } + + return NULL; +} diff --git a/src/bin/e_comp_wl_data.h b/src/bin/e_comp_wl_data.h index 10814d858..69a9efc0b 100644 --- a/src/bin/e_comp_wl_data.h +++ b/src/bin/e_comp_wl_data.h @@ -53,6 +53,6 @@ struct _E_Comp_Wl_Clipboard_Offer EINTERN void e_comp_wl_data_device_keyboard_focus_set(void); EINTERN Eina_Bool e_comp_wl_data_manager_init(void); EINTERN void e_comp_wl_data_manager_shutdown(void); - +EINTERN struct wl_resource *e_comp_wl_data_find_for_client(struct wl_client *client); # endif #endif