From: Gwanglim Lee Date: Tue, 15 Jan 2019 00:54:59 +0000 (+0900) Subject: remote_surface: added a way to get a list of tizen remote surface providers X-Git-Tag: submit/tizen/20190124.034806~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9aa931e6838645d7c577b9899e124b4e39f9deb7;p=platform%2Fupstream%2Fenlightenment.git remote_surface: added a way to get a list of tizen remote surface providers Change-Id: I99fcb17424d3c03c8c79dd06144c15d9b52074cd --- diff --git a/src/bin/e_comp_wl_rsm.c b/src/bin/e_comp_wl_rsm.c index 66679cf32c..de9891e73a 100644 --- a/src/bin/e_comp_wl_rsm.c +++ b/src/bin/e_comp_wl_rsm.c @@ -3886,6 +3886,62 @@ e_comp_wl_remote_surface_debug_info_get(Eldbus_Message_Iter *iter) #endif } +/** + * Get a list of e_clients of tizen remote surface providers which is used in given ec + * NB: caller must free returned Eina_List object after using it. + */ +E_API Eina_List * +e_comp_wl_remote_surface_providers_get(E_Client *ec) +{ + E_Comp_Wl_Remote_Provider *prov; + E_Comp_Wl_Remote_Source *src; + E_Comp_Wl_Remote_Surface *rs; + Eina_Iterator *it; + Eina_List *l; + Eina_List *provs = NULL; /* result list */ + E_Client *owner_ec; + + /* remote surface providers */ + it = eina_hash_iterator_data_new(_rsm->provider_hash); + EINA_ITERATOR_FOREACH(it, prov) + { + EINA_LIST_FOREACH(prov->common.surfaces, l, rs) + { + owner_ec = rs->owner; + if (!owner_ec) owner_ec = rs->bind_ec; + + if (!owner_ec) continue; + if (owner_ec != ec) continue; + + /* append provider's ec to result list */ + provs = eina_list_append(provs, prov->common.ec); + break; + } + } + eina_iterator_free(it); + + /* remote sources i.e., normal window */ + it = eina_hash_iterator_data_new(_rsm->source_hash); + EINA_ITERATOR_FOREACH(it, src) + { + EINA_LIST_FOREACH(src->common.surfaces, l, rs) + { + owner_ec = rs->owner; + if (!owner_ec) owner_ec = rs->bind_ec; + + if (!owner_ec) continue; + if (owner_ec != ec) continue; + + /* append source's ec to result list */ + provs = eina_list_append(provs, src->common.ec); + break; + } + } + eina_iterator_free(it); + + return provs; +} + #undef E_CLIENT_HOOK_APPEND #define E_CLIENT_HOOK_APPEND(l, t, cb, d) \ do \ diff --git a/src/bin/e_comp_wl_rsm.h b/src/bin/e_comp_wl_rsm.h index 29e3e38604..18bf6534c2 100644 --- a/src/bin/e_comp_wl_rsm.h +++ b/src/bin/e_comp_wl_rsm.h @@ -4,14 +4,20 @@ typedef struct _E_Event_Remote_Surface_Provider E_Event_Remote_Surface_Provider; # ifndef E_COMP_WL_RSM_H # define E_COMP_WL_RSM_H -EINTERN void e_comp_wl_remote_surface_init(void); -EINTERN void e_comp_wl_remote_surface_shutdown(void); -EINTERN Eina_Bool e_comp_wl_remote_surface_commit(E_Client *ec); -E_API void e_comp_wl_remote_surface_image_save(E_Client *ec); -E_API void e_comp_wl_remote_surface_image_save_skip_set(E_Client *ec, Eina_Bool set); -E_API Eina_Bool e_comp_wl_remote_surface_image_save_skip_get(E_Client *ec); -EINTERN void e_comp_wl_remote_surface_debug_info_get(Eldbus_Message_Iter *iter); -E_API E_Client *e_comp_wl_remote_surface_bound_provider_ec_get(E_Client *ec); +EINTERN void e_comp_wl_remote_surface_init(void); +EINTERN void e_comp_wl_remote_surface_shutdown(void); +EINTERN Eina_Bool e_comp_wl_remote_surface_commit(E_Client *ec); +E_API void e_comp_wl_remote_surface_image_save(E_Client *ec); +E_API void e_comp_wl_remote_surface_image_save_skip_set(E_Client *ec, Eina_Bool set); +E_API Eina_Bool e_comp_wl_remote_surface_image_save_skip_get(E_Client *ec); +EINTERN void e_comp_wl_remote_surface_debug_info_get(Eldbus_Message_Iter *iter); +E_API E_Client *e_comp_wl_remote_surface_bound_provider_ec_get(E_Client *ec); + +/** + * Get a list of e_clients of tizen remote surface providers which is used in given ec + * NB: caller must free returned Eina_List object after using it. + */ +E_API Eina_List *e_comp_wl_remote_surface_providers_get(E_Client *ec); E_API extern int E_EVENT_REMOTE_SURFACE_PROVIDER_VISIBILITY_CHANGE;