Enlightenment CVS committal Author : rephorm Project : e17 Module : apps/elicit
Dir : e17/apps/elicit/src Modified Files: Makefile.am callbacks.c shots.c swatches.c Log Message: Remove support for old edb configs. (Its been long enough) =================================================================== RCS file: /cvs/e/e17/apps/elicit/src/Makefile.am,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- Makefile.am 22 Mar 2007 12:14:15 -0000 1.11 +++ Makefile.am 22 Apr 2007 22:32:21 -0000 1.12 @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -INCLUDES = @ELICIT_CFLAGS@ @EDB_CFLAGS@ +INCLUDES = @ELICIT_CFLAGS@ bin_PROGRAMS = elicit @@ -15,5 +15,5 @@ spectrum.c spectrum.h \ zoom.c zoom.h -elicit_LDADD = @ELICIT_LIBS@ @EDB_LIBS@ -lesmart_draggies -lesmart_container +elicit_LDADD = @ELICIT_LIBS@ -lesmart_draggies -lesmart_container =================================================================== RCS file: /cvs/e/e17/apps/elicit/src/callbacks.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- callbacks.c 25 Mar 2007 00:28:57 -0000 1.25 +++ callbacks.c 22 Apr 2007 22:32:21 -0000 1.26 @@ -33,7 +33,7 @@ { int w, h; Evas_Coord sw, sh; - Evas_Object *gui, *shot, *draggie; + Evas_Object *gui, *draggie; /* keep the gui the same size as the window */ ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); =================================================================== RCS file: /cvs/e/e17/apps/elicit/src/shots.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- shots.c 11 Jul 2006 05:23:00 -0000 1.14 +++ shots.c 22 Apr 2007 22:32:21 -0000 1.15 @@ -5,8 +5,6 @@ void _elicit_shots_update_scroll_bar(Elicit *el); void _elicit_shots_load_eet(Elicit *el); void _elicit_shots_save_eet(Elicit *el); -void _elicit_shots_load_edb(Elicit *el); -void _elicit_shots_save_edb(Elicit *el); int elicit_shots_init(Elicit *el) @@ -113,96 +111,14 @@ } void -_elicit_shots_save_edb(Elicit *el) -{ -#ifdef HAVE_EDB - Evas_List *l; - E_DB_File *db; - int i = 0; - int old_num = 0, cleanup = 0; - char buf[PATH_MAX]; - - snprintf(buf, PATH_MAX, "%s/.e/apps/%s/shots.db", getenv("HOME"), el->app_name); - - /* open for reading first (to make sure the file exists) */ - db = e_db_open_read(buf); - if (db) - { - cleanup = e_db_int_get(db, "/shots/num", &old_num); - e_db_close(db); - } - - db = e_db_open(buf); - - if (!db) return; - - for (l = esmart_container_elements_get(el->shots.cont); l; l = l->next, i++) - { - Evas_Object *obj; - Elicit_Shot *sh; - void *data; - int iw, ih; - - obj = (Evas_Object *)(l->data); - sh = evas_object_data_get(obj, "shot"); - - snprintf(buf, PATH_MAX, "/shots/%d/name", i); - e_db_str_set(db, buf, sh->name); - - evas_object_image_size_get(sh->shot, &iw, &ih); - data = evas_object_image_data_get(sh->shot, 1); - - snprintf(buf, PATH_MAX, "/shots/%d/w", i); - e_db_int_set(db, buf, iw); - - snprintf(buf, PATH_MAX, "/shots/%d/h", i); - e_db_int_set(db, buf, ih); - - snprintf(buf, PATH_MAX, "/shots/%d/shot", i); - e_db_data_set(db, buf, data, sizeof(data)*iw*ih); - } - e_db_int_set(db, "/shots/num", i); - - if (cleanup) - { - for(; i < old_num; i++) - { - snprintf(buf, PATH_MAX, "/shots/%d/name", i); - e_db_data_del(db, buf); - - snprintf(buf, PATH_MAX, "/shots/%d/shot", i); - e_db_data_del(db, buf); - - snprintf(buf, PATH_MAX, "/shots/%d/w", i); - e_db_data_del(db, buf); - - snprintf(buf, PATH_MAX, "/shots/%d/h", i); - e_db_data_del(db, buf); - } - } - - e_db_close(db); - e_db_flush(); -#endif -} - -void elicit_shots_load(Elicit *el) { char buf[PATH_MAX]; - /* upgrade path -- if eet file doesn't exist, load shots from edb */ snprintf(buf, PATH_MAX, "%s/.e/apps/%s/shots.eet", getenv("HOME"), el->app_name); - if(!ecore_file_exists(buf)) - { - _elicit_shots_load_edb(el); - _elicit_shots_save_eet(el); - } - else - { + if(ecore_file_exists(buf)) _elicit_shots_load_eet(el); - } } void @@ -292,83 +208,6 @@ eet_close(eet); } - -void -_elicit_shots_load_edb(Elicit *el) -{ -#ifdef HAVE_EDB - E_DB_File *db; - int num, ok; - int i; - char buf[PATH_MAX]; - - snprintf(buf, PATH_MAX, "%s/.e/apps/%s/shots.db", getenv("HOME"), el->app_name); - - db = e_db_open_read(buf); - if (db) - ok = e_db_int_get(db, "/shots/num", &num); - else return; - - for (i = 0; i < num; i++) - { - Elicit_Shot *sh; - int iw = 0, ih = 0; - void *data = NULL; - int size = 0; - Evas_Coord mw, mh; - char *theme; - - sh = calloc(1, sizeof(Elicit_Shot)); - - snprintf(buf, PATH_MAX, "/shots/%d/name", i); - sh->name = e_db_str_get(db, buf); - - snprintf(buf, PATH_MAX, "/shots/%d/w", i); - e_db_int_get(db, buf, &iw); - - snprintf(buf, PATH_MAX, "/shots/%d/h", i); - e_db_int_get(db, buf, &ih); - - snprintf(buf, PATH_MAX, "/shots/%d/shot", i); - data = e_db_data_get(db, buf, &size); - - sh->obj = edje_object_add(el->evas); - sh->shot = evas_object_image_add(el->evas); - - theme = elicit_config_theme_get(el); - edje_object_file_set(sh->obj, - elicit_theme_find(theme), - "shot"); - free(theme); - edje_object_size_min_get(sh->obj, &mw, &mh); - if (mw != 0 && mh != 0) - evas_object_resize(sh->obj, mw, mh); - else - evas_object_resize(sh->obj, 20, 20); - - evas_object_show(sh->obj); - evas_object_data_set(sh->obj, "shot", sh); - evas_object_data_set(sh->obj, "elicit", el); - - edje_object_signal_callback_add(sh->obj, "elicit,shot,load", "", elicit_shot_load_cb, sh); - edje_object_signal_callback_add(sh->obj, "elicit,shot,del", "", elicit_shot_del_cb, sh); - edje_object_signal_callback_add(sh->obj, "elicit,shot,name,show", "", elicit_shot_name_show_cb, sh); - - evas_object_image_size_set(sh->shot, iw, ih); - evas_object_image_data_copy_set(sh->shot, data); - free(data); - evas_object_pass_events_set(sh->shot, 1); - evas_object_show(sh->shot); - edje_object_part_swallow(sh->obj, "shot", sh->shot); - esmart_container_element_append(el->shots.cont, sh->obj); - } - - el->shots.length = esmart_container_elements_length_get(el->shots.cont); - - e_db_close(db); -#endif -} - void elicit_shot_free(Elicit_Shot *sh) =================================================================== RCS file: /cvs/e/e17/apps/elicit/src/swatches.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- swatches.c 30 Dec 2005 02:51:08 -0000 1.16 +++ swatches.c 22 Apr 2007 22:32:21 -0000 1.17 @@ -4,9 +4,7 @@ void _elicit_swatches_update_scroll_bar(Elicit *el); -void _elicit_swatches_load_edb(Elicit *el); void _elicit_swatches_load_gpl(Elicit *el); -void _elicit_swatches_save_edb(Elicit *el); void _elicit_swatches_save_gpl(Elicit *el); int @@ -97,87 +95,14 @@ } void -_elicit_swatches_save_edb(Elicit *el) -{ -#ifdef HAVE_EDB - Evas_List *l; - E_DB_File *db; - int i = 0; - int cleanup = 0, old_num = 0; - char buf[PATH_MAX]; - - snprintf(buf, PATH_MAX, "%s/.e/apps/%s/swatches.db", getenv("HOME"), el->app_name); - - db = e_db_open_read(buf); - if (db) - { - cleanup = e_db_int_get(db, "/swatches/num", &old_num); - e_db_close(db); - } - - db = e_db_open(buf); - - if (!db) return; - - for (l = esmart_container_elements_get(el->swatches.cont); l; l = l->next) - { - Evas_Object *obj; - Elicit_Swatch *sw; - - obj = (Evas_Object *)(l->data); - sw = evas_object_data_get(obj, "swatch"); - - snprintf(buf, PATH_MAX, "/swatches/%d/name", i); - e_db_str_set(db, buf, sw->name); - - snprintf(buf, PATH_MAX, "/swatches/%d/r", i); - e_db_int_set(db, buf, sw->r); - snprintf(buf, PATH_MAX, "/swatches/%d/g", i); - e_db_int_set(db, buf, sw->g); - snprintf(buf, PATH_MAX, "/swatches/%d/b", i); - e_db_int_set(db, buf, sw->b); - - i++; - } - - e_db_int_set(db, "/swatches/num", i); - - if (cleanup) - { - for (; i < old_num; i++) - { - snprintf(buf, PATH_MAX, "/swatches/%d/name", i); - e_db_data_del(db, buf); - snprintf(buf, PATH_MAX, "/swatches/%d/r", i); - e_db_data_del(db, buf); - snprintf(buf, PATH_MAX, "/swatches/%d/g", i); - e_db_data_del(db, buf); - snprintf(buf, PATH_MAX, "/swatches/%d/b", i); - e_db_data_del(db, buf); - } - } - e_db_close(db); - e_db_flush(); -#endif -} - -void elicit_swatches_load(Elicit *el) { char buf[PATH_MAX]; - /* upgrade path -- if no gpl file exists, try to load from an old edb file. */ snprintf(buf, PATH_MAX, "%s/.e/apps/%s/swatches.gpl", getenv("HOME"), el->app_name); - if (!ecore_file_exists(buf)) - { - _elicit_swatches_load_edb(el); - _elicit_swatches_save_gpl(el); - } - else - { + if (ecore_file_exists(buf)) _elicit_swatches_load_gpl(el); - } } void @@ -206,45 +131,6 @@ el->swatches.length = esmart_container_elements_length_get(el->swatches.cont); free(name); -} - -void -_elicit_swatches_load_edb(Elicit *el) -{ -#ifdef HAVE_EDB - E_DB_File *db; - int num; - int i; - char buf[PATH_MAX]; - char *name; - int r, g, b; - - snprintf(buf, PATH_MAX, "%s/.e/apps/%s/swatches.db", getenv("HOME"), el->app_name); - - db = e_db_open_read(buf); - if (db) - e_db_int_get(db, "/swatches/num", &num); - else return; - - for (i = 0; i < num; i++) - { - Elicit_Swatch *sw; - - snprintf(buf, PATH_MAX, "/swatches/%d/name", i); - name = e_db_str_get(db, buf); - - snprintf(buf, PATH_MAX, "/swatches/%d/r", i); - e_db_int_get(db, buf, &r); - snprintf(buf, PATH_MAX, "/swatches/%d/g", i); - e_db_int_get(db, buf, &g); - snprintf(buf, PATH_MAX, "/swatches/%d/b", i); - e_db_int_get(db, buf, &b); - - sw = elicit_swatch_new(el, name, r, g, b); - } - el->swatches.length = esmart_container_elements_length_get(el->swatches.cont); - e_db_close(db); -#endif } void ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs