diff --git a/src/bin/e_gadcon.h b/src/bin/e_gadcon.h index bbc4f4217..0c1cb0eb9 100644 --- a/src/bin/e_gadcon.h +++ b/src/bin/e_gadcon.h @@ -315,5 +315,29 @@ EAPI void e_gadcon_location_unregister (E_Gadcon_Location *loc); EAPI void e_gadcon_location_set_icon_name(E_Gadcon_Location *loc, const char *name); EAPI void e_gadcon_client_add_location_menu(E_Gadcon_Client *gcc, E_Menu *menu); +#define GADCON_CLIENT_CONFIG_GET(_type, _items, _gc_class, _id) \ + if (!_id) \ + { \ + char buf[128]; \ + int num = 0; \ + _type *ci; \ + if (_items) \ + { \ + const char *p; \ + ci = eina_list_last(_items)->data; \ + p = strrchr (ci->id, '.'); \ + if (p) num = atoi (p + 1) + 1; \ + } \ + snprintf (buf, sizeof (buf), "%s.%d", _gc_class.name, num); \ + _id = buf; \ + } \ + else \ + { \ + Eina_List *l; \ + _type *ci; \ + EINA_LIST_FOREACH(_items, l, ci) \ + if ((ci->id) && (!strcmp(ci->id, id))) return ci; \ + } + #endif #endif