forked from enlightenment/enlightenment
e_gadcon_client_find now takes an optional gadcon param to speed it up where possible
SVN revision: 74512
This commit is contained in:
parent
66d61b1778
commit
71ce826982
|
@ -853,13 +853,18 @@ e_gadcon_client_config_del(E_Config_Gadcon *cf_gc, E_Config_Gadcon_Client *cf_gc
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI E_Gadcon_Client *
|
EAPI E_Gadcon_Client *
|
||||||
e_gadcon_client_find(E_Config_Gadcon_Client *cf_gcc)
|
e_gadcon_client_find(E_Gadcon *gc, E_Config_Gadcon_Client *cf_gcc)
|
||||||
{
|
{
|
||||||
E_Gadcon *gc;
|
|
||||||
E_Gadcon_Client *gcc;
|
E_Gadcon_Client *gcc;
|
||||||
Eina_List *l, *ll;
|
Eina_List *l, *ll;
|
||||||
|
|
||||||
if (!cf_gcc) return NULL;
|
if (!cf_gcc) return NULL;
|
||||||
|
if (gc)
|
||||||
|
{
|
||||||
|
EINA_LIST_FOREACH(gc->clients, ll, gcc)
|
||||||
|
if (gcc->cf == cf_gcc) return gcc;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
EINA_LIST_FOREACH(gadcons, l, gc)
|
EINA_LIST_FOREACH(gadcons, l, gc)
|
||||||
EINA_LIST_FOREACH(gc->clients, ll, gcc)
|
EINA_LIST_FOREACH(gc->clients, ll, gcc)
|
||||||
if (gcc->cf == cf_gcc) return gcc;
|
if (gcc->cf == cf_gcc) return gcc;
|
||||||
|
|
|
@ -278,7 +278,7 @@ EAPI void e_gadcon_shelf_set(E_Gadcon *gc, E_Shelf *shelf);
|
||||||
EAPI E_Shelf *e_gadcon_shelf_get(E_Gadcon *gc);
|
EAPI E_Shelf *e_gadcon_shelf_get(E_Gadcon *gc);
|
||||||
EAPI void e_gadcon_toolbar_set(E_Gadcon *gc, E_Toolbar *toolbar);
|
EAPI void e_gadcon_toolbar_set(E_Gadcon *gc, E_Toolbar *toolbar);
|
||||||
EAPI E_Toolbar *e_gadcon_toolbar_get(E_Gadcon *gc);
|
EAPI E_Toolbar *e_gadcon_toolbar_get(E_Gadcon *gc);
|
||||||
EAPI E_Gadcon_Client *e_gadcon_client_find(E_Config_Gadcon_Client *cf_gcc);
|
EAPI E_Gadcon_Client *e_gadcon_client_find(E_Gadcon *gc, E_Config_Gadcon_Client *cf_gcc);
|
||||||
EAPI E_Config_Gadcon_Client *e_gadcon_client_config_new(E_Gadcon *gc, const char *name);
|
EAPI E_Config_Gadcon_Client *e_gadcon_client_config_new(E_Gadcon *gc, const char *name);
|
||||||
EAPI void e_gadcon_client_config_del(E_Config_Gadcon *cf_gc, E_Config_Gadcon_Client *cf_gcc);
|
EAPI void e_gadcon_client_config_del(E_Config_Gadcon *cf_gc, E_Config_Gadcon_Client *cf_gcc);
|
||||||
EAPI E_Gadcon_Client *e_gadcon_client_new(E_Gadcon *gc, const char *name, const char *id, const char *style, Evas_Object *base_obj);
|
EAPI E_Gadcon_Client *e_gadcon_client_new(E_Gadcon *gc, const char *name, const char *id, const char *style, Evas_Object *base_obj);
|
||||||
|
|
|
@ -164,7 +164,7 @@ gadman_populate_class(void *data, E_Gadcon *gc, const E_Gadcon_Client_Class *cc)
|
||||||
{
|
{
|
||||||
if ((!strcmp(cf_gcc->name, cc->name)) && (gc->cf->zone == gc->zone->num))
|
if ((!strcmp(cf_gcc->name, cc->name)) && (gc->cf->zone == gc->zone->num))
|
||||||
{
|
{
|
||||||
gcc = e_gadcon_client_find(cf_gcc);
|
gcc = e_gadcon_client_find(gc, cf_gcc);
|
||||||
ll = eina_hash_find(_gadman_gadgets, cc->name);
|
ll = eina_hash_find(_gadman_gadgets, cc->name);
|
||||||
if ((!gcc) || (ll && (!eina_list_data_find(ll, cf_gcc))))
|
if ((!gcc) || (ll && (!eina_list_data_find(ll, cf_gcc))))
|
||||||
gadman_gadget_place(gcc, cc, cf_gcc, layer, gc->zone);
|
gadman_gadget_place(gcc, cc, cf_gcc, layer, gc->zone);
|
||||||
|
@ -410,7 +410,7 @@ gadman_gadgets_show(void)
|
||||||
/* Showing top gadgets */
|
/* Showing top gadgets */
|
||||||
EINA_LIST_FOREACH_SAFE(Man->gadgets[GADMAN_LAYER_TOP], l, ll, cf_gcc)
|
EINA_LIST_FOREACH_SAFE(Man->gadgets[GADMAN_LAYER_TOP], l, ll, cf_gcc)
|
||||||
{
|
{
|
||||||
gcc = e_gadcon_client_find(cf_gcc);
|
gcc = e_gadcon_client_find(NULL, cf_gcc);
|
||||||
if (!gcc)
|
if (!gcc)
|
||||||
{
|
{
|
||||||
Man->gadgets[GADMAN_LAYER_TOP] = eina_list_remove_list(Man->gadgets[GADMAN_LAYER_TOP], l);
|
Man->gadgets[GADMAN_LAYER_TOP] = eina_list_remove_list(Man->gadgets[GADMAN_LAYER_TOP], l);
|
||||||
|
@ -456,7 +456,7 @@ gadman_gadgets_hide(void)
|
||||||
/* Hiding top gadgets */
|
/* Hiding top gadgets */
|
||||||
EINA_LIST_FOREACH_SAFE(Man->gadgets[GADMAN_LAYER_TOP], l, ll, cf_gcc)
|
EINA_LIST_FOREACH_SAFE(Man->gadgets[GADMAN_LAYER_TOP], l, ll, cf_gcc)
|
||||||
{
|
{
|
||||||
gcc = e_gadcon_client_find(cf_gcc);
|
gcc = e_gadcon_client_find(NULL, cf_gcc);
|
||||||
if (!gcc)
|
if (!gcc)
|
||||||
{
|
{
|
||||||
Man->gadgets[GADMAN_LAYER_TOP] = eina_list_remove_list(Man->gadgets[GADMAN_LAYER_TOP], l);
|
Man->gadgets[GADMAN_LAYER_TOP] = eina_list_remove_list(Man->gadgets[GADMAN_LAYER_TOP], l);
|
||||||
|
@ -1479,7 +1479,7 @@ _gadman_module_cb(void *d __UNUSED__, int type __UNUSED__, E_Event_Module_Update
|
||||||
if (!l) return ECORE_CALLBACK_RENEW;
|
if (!l) return ECORE_CALLBACK_RENEW;
|
||||||
EINA_LIST_FREE(l, cf_gcc)
|
EINA_LIST_FREE(l, cf_gcc)
|
||||||
{
|
{
|
||||||
gcc = e_gadcon_client_find(cf_gcc);
|
gcc = e_gadcon_client_find(NULL, cf_gcc);
|
||||||
if (!gcc) continue;
|
if (!gcc) continue;
|
||||||
gcc->cf = NULL;
|
gcc->cf = NULL;
|
||||||
gadman_gadget_del(gcc);
|
gadman_gadget_del(gcc);
|
||||||
|
|
Loading…
Reference in New Issue