Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_utils.c e_utils.h Log Message: Function to save Ecore_X_Icon. To be used for saving ARGB icon before creating eap. Untested. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_utils.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -3 -r1.45 -r1.46 --- e_utils.c 9 Jun 2006 12:53:27 -0000 1.45 +++ e_utils.c 19 Jul 2006 01:39:43 -0000 1.46 @@ -563,6 +563,37 @@ return buf; } +EAPI int +e_util_save_icon(Ecore_X_Icon *icon, const char *filename) +{ + Ecore_Evas *ee; + Evas *evas; + Evas_Object *im; + int ret; + + ee = ecore_evas_buffer_new(icon->width, icon->height); + if (!ee) return 0; + evas = ecore_evas_get(ee); + evas_image_cache_set(evas, 0); + evas_font_cache_set(evas, 0); + + im = evas_object_image_add(evas); + if (!im) + { + ecore_evas_free(ee); + return 0; + } + evas_object_move(im, 0, 0); + 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_show(im); + ret = evas_object_image_save(im, filename, NULL, NULL); + evas_object_del(im); + ecore_evas_free(ee); + return ret; +} + /* local subsystem functions */ static void _e_util_container_fake_mouse_up_cb(void *data) =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_utils.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -3 -r1.23 -r1.24 --- e_utils.h 13 May 2006 15:20:15 -0000 1.23 +++ e_utils.h 19 Jul 2006 01:39:43 -0000 1.24 @@ -40,6 +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); #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