forked from enlightenment/enlightenment
Function to save Ecore_X_Icon. To be used for saving ARGB icon before
creating eap. Untested. SVN revision: 24040
This commit is contained in:
parent
e590454a61
commit
457b86c2ce
|
@ -563,6 +563,37 @@ e_util_filename_escape(const char *filename)
|
||||||
return buf;
|
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 */
|
/* local subsystem functions */
|
||||||
static void
|
static void
|
||||||
_e_util_container_fake_mouse_up_cb(void *data)
|
_e_util_container_fake_mouse_up_cb(void *data)
|
||||||
|
|
|
@ -40,6 +40,7 @@ EAPI E_Border *e_util_desk_border_below(E_Border *bd);
|
||||||
EAPI int e_util_edje_collection_exists(const char *file, const char *coll);
|
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 void e_util_dialog_internal(const char *title, const char *txt);
|
||||||
EAPI const char *e_util_filename_escape(const char *filename);
|
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
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue