diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index 15085442b3..ea10ba2d3f 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -3989,6 +3989,23 @@ EAPI void evas_object_image_file_set(Evas_Object *obj, */ EAPI void evas_object_image_mmap_set(Evas_Object *obj, const Eina_File *f, const char *key); +/** + * Get the source mmaped file from where an image object must fetch the real + * image data (it must be an Eina_File). + * + * @param obj The given image object. + * @param f The mmaped file + * @param key The image key in @p file (if its an Eet one), or @c + * NULL, otherwise. + * + * If the file supports multiple data stored in it (as Eet files do), + * you can get the key to be used as the index of the image in + * this file. + * + * @since 1.10 + */ +EAPI void evas_object_image_mmap_get(const Evas_Object *obj, const Eina_File **f, const char **key); + /** * Retrieve the source file from where an image object is to fetch the * real image data (it may be an Eet file, besides pure image ones). diff --git a/src/lib/evas/canvas/evas_image.eo b/src/lib/evas/canvas/evas_image.eo index 7cec701306..20f9c3db95 100644 --- a/src/lib/evas/canvas/evas_image.eo +++ b/src/lib/evas/canvas/evas_image.eo @@ -775,6 +775,17 @@ class Evas_Image (Evas_Object) @since 1.8 */ } + get { + /*@ + Get the source mmaped file from where an image object must fetch the real + image data (it must be an Eina_File). + + If the file supports multiple data stored in it (as Eet files do), + you can get the key to be used as the index of the image in + this file. + + @since 1.10 */ + } values { const Eina_File *f; /*@ The mmaped file */ const char *key; /*@ The image key in @p file (if its an Eet one), or @c @@ -1151,4 +1162,4 @@ class Evas_Image (Evas_Object) Eo_Base::destructor; Eo_Base::dbg_info_get; } -} \ No newline at end of file +} diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 009014b278..287ad1a199 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -542,6 +542,15 @@ _evas_image_mmap_set(Eo *eo_obj, Evas_Image_Data *o, const Eina_File *f, const c _image_done_set(eo_obj, obj, o); } +EOLIAN static void +_evas_image_mmap_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, const Eina_File **f, const char **key) +{ + if (f) + *f = o->cur->mmaped_source ? o->cur->u.f : NULL; + if (key) + *key = o->cur->key; +} + EOLIAN static void _evas_image_file_set(Eo *eo_obj, Evas_Image_Data *o, const char *file, const char *key) {