Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_gadcon.c e_gadcon.h e_int_gadcon_config.c Log Message: gadcon config generates new id's for new gadcon clients... properly. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_gadcon.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- e_gadcon.c 7 May 2006 09:49:37 -0000 1.24 +++ e_gadcon.c 19 May 2006 12:56:47 -0000 1.25 @@ -1004,6 +1004,23 @@ evas_object_event_callback_add(gcc->o_base, EVAS_CALLBACK_MOUSE_DOWN, _e_gadcon_client_cb_mouse_down, gcc); } +EAPI E_Gadcon_Client * +e_gadcon_client_find(E_Gadcon *gc, char *name, char *id) +{ + Evas_List *l; + + for (l = gc->clients; l; l = l->next) + { + E_Gadcon_Client *gcc; + + gcc = l->data; + if ((gcc->name) && (gcc->id) && + (!strcmp(name, gcc->name)) && (!strcmp(id, gcc->id))) + return gcc; + } + return NULL; +} + /* local subsystem functions */ static void _e_gadcon_free(E_Gadcon *gc) @@ -1167,7 +1184,9 @@ for (l = e_config->gadcons; l; l = l->next) { cf_gc = l->data; - if ((!strcmp(cf_gc->name, gcc->gadcon->name)) && + if ((cf_gc->name) && (gcc->gadcon->name) && + (cf_gc->id) && (gcc->gadcon->id) && + (!strcmp(cf_gc->name, gcc->gadcon->name)) && (!strcmp(cf_gc->id, gcc->gadcon->id))) { ok++; @@ -1175,7 +1194,9 @@ { cf_gcc = l2->data; - if ((!strcmp(cf_gcc->name, gcc->name)) && + if ((cf_gcc->name) && (gcc->name) && + (cf_gcc->id) && (gcc->id) && + (!strcmp(cf_gcc->name, gcc->name)) && (!strcmp(cf_gcc->id, gcc->id))) { cf_gcc->geom.pos = gcc->config.pos; =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_gadcon.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- e_gadcon.h 9 May 2006 13:02:47 -0000 1.19 +++ e_gadcon.h 19 May 2006 12:56:47 -0000 1.20 @@ -160,5 +160,7 @@ EAPI void e_gadcon_client_util_menu_items_append(E_Gadcon_Client *gcc, E_Menu *menu, int flags); EAPI void e_gadcon_client_util_menu_attach(E_Gadcon_Client *gcc); +EAPI E_Gadcon_Client *e_gadcon_client_find(E_Gadcon *gc, char *name, char *id); + #endif #endif =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_int_gadcon_config.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- e_int_gadcon_config.c 9 May 2006 13:02:47 -0000 1.4 +++ e_int_gadcon_config.c 19 May 2006 12:56:47 -0000 1.5 @@ -77,10 +77,11 @@ static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) { - Evas_List *l; - E_Config_Gadcon *cf_gc; - E_Config_Gadcon_Client *cf_gcc; - int ok = 0; + Evas_List *l, *l2; + E_Config_Gadcon *cf_gc, *cf_gc2; + E_Config_Gadcon_Client *cf_gcc, *cf_gcc2; + int i, ok = 0; + char buf[256]; cfdata->gc->config_dialog = cfd; for (l = e_config->gadcons; l; l = l->next) @@ -113,9 +114,31 @@ return 1; /* Apply was OK */ } } + snprintf(buf, sizeof(buf), "default"); + for (i = 0; ; i++) + { + ok = 1; + for (l = e_config->gadcons; l; l = l->next) + { + cf_gc2 = l->data; + for (l2 = cf_gc2->clients; l2; l2 = l2->next) + { + cf_gcc2 = l2->data; + if ((!cf_gcc2->name) || (!cf_gcc2->id)) continue; + if ((!strcmp(cf_gcc2->name, cfdata->cname)) && (!strcmp(cf_gcc2->id, buf))) + { + ok = 0; + break; + } + } + if (!ok) break; + } + if (ok) break; + snprintf(buf, sizeof(buf), "other-%i", ok); + } cf_gcc = E_NEW(E_Config_Gadcon_Client, 1); cf_gcc->name = evas_stringshare_add(cfdata->cname); - cf_gcc->id = evas_stringshare_add("default"); + cf_gcc->id = evas_stringshare_add(buf); cf_gcc->geom.res = 800; cf_gcc->geom.size = 80; cf_gcc->geom.pos = cf_gcc->geom.res - cf_gcc->geom.size; ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs