Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_eap_editor.c e_int_border_menu.c e_utils.c e_utils.h Log Message: Save image from ARGB coming along. Not done yet. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_eap_editor.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -3 -r1.28 -r1.29 --- e_eap_editor.c 5 Jun 2006 15:36:02 -0000 1.28 +++ e_eap_editor.c 19 Jul 2006 11:59:22 -0000 1.29 @@ -30,6 +30,8 @@ int wait_exit; /*- common -*/ char *image; + int width; + int height; E_App_Edit *editor; }; @@ -103,6 +105,11 @@ IFDUP(cfdata->editor->eap->icon_class, cfdata->iclass); cfdata->startup_notify = cfdata->editor->eap->startup_notify; cfdata->wait_exit = cfdata->editor->eap->wait_exit; + /*- COMMON -*/ + IFDUP(cfdata->editor->eap->image, cfdata->image); + cfdata->height = cfdata->editor->eap->height; + cfdata->width = cfdata->editor->eap->width; + if (cfdata->image) cfdata->editor->img_set = 1; } static void * @@ -157,8 +164,10 @@ eap->wait_exit = data->wait_exit; /* FIXME: hardcoded until the eap editor provides fields to change it */ - eap->width = 128; - eap->height = 128; + if (data->width) eap->width = data->width; + else eap->width = 128; + if (data->height) eap->height = data->height; + else eap->height = 128; if ((eap->name) && (eap->exe)) e_app_fields_save(eap); @@ -205,9 +214,11 @@ if (data->iclass) eap->icon_class = evas_stringshare_add(data->iclass); /* FIXME: hardcoded until the eap editor provides fields to change it */ - eap->width = 128; - eap->height = 128; - + if (data->width) eap->width = data->width; + else eap->width = 128; + if (data->height) eap->height = data->height; + else eap->height = 128; + if ((eap->name) && (eap->exe)) e_app_fields_save(eap); return 1; =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_int_border_menu.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- e_int_border_menu.c 19 Jul 2006 11:05:31 -0000 1.30 +++ e_int_border_menu.c 19 Jul 2006 11:59:22 -0000 1.31 @@ -556,6 +556,26 @@ if (bname) a->exe = evas_stringshare_add(bname); if (bd->client.netwm.startup_id > 0) a->startup_notify = 1; + if (bd->client.netwm.icons) + { + /* FIXME: Find the icon with the best size */ + const char *tmp; + + tmp = getenv("TMPDIR"); + if (!tmp) tmp = getenv("TMP"); + if (!tmp) tmp = "/tmp"; + snprintf(path, sizeof(path), "%s/%s-%.6f.jpg", tmp, bname, ecore_time_get()); + if (e_util_icon_save(&(bd->client.netwm.icons[0]), path)) + { + a->image = evas_stringshare_add(path); + a->width = bd->client.netwm.icons[0].width; + a->height = bd->client.netwm.icons[0].height; + } + else + { + fprintf(stderr, "Could not save file from ARGB: %s\n", path); + } + } bd->app = a; e_object_ref(E_OBJECT(bd->app)); } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_utils.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -3 -r1.46 -r1.47 --- e_utils.c 19 Jul 2006 01:39:43 -0000 1.46 +++ e_utils.c 19 Jul 2006 11:59:22 -0000 1.47 @@ -564,7 +564,7 @@ } EAPI int -e_util_save_icon(Ecore_X_Icon *icon, const char *filename) +e_util_icon_save(Ecore_X_Icon *icon, const char *filename) { Ecore_Evas *ee; Evas *evas; @@ -587,6 +587,7 @@ evas_object_resize(im, icon->width, icon->height); evas_object_image_size_set(im, icon->width, icon->height); evas_object_image_data_copy_set(im, icon->data); + evas_object_image_alpha_set(im, 1); evas_object_show(im); ret = evas_object_image_save(im, filename, NULL, NULL); evas_object_del(im); =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_utils.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- e_utils.h 19 Jul 2006 01:39:43 -0000 1.24 +++ e_utils.h 19 Jul 2006 11:59:22 -0000 1.25 @@ -40,7 +40,7 @@ EAPI int e_util_edje_collection_exists(const char *file, const char *coll); EAPI void e_util_dialog_internal(const char *title, const char *txt); EAPI const char *e_util_filename_escape(const char *filename); -EAPI int e_util_save_icon(Ecore_X_Icon *icon, const char *filename); +EAPI int e_util_icon_save(Ecore_X_Icon *icon, const char *filename); #endif #endif ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs