+evas_object_image_mmap_get()

This commit is contained in:
zmike 2014-03-29 16:19:01 -04:00
parent 2e7565b7c3
commit e5d207fc25
3 changed files with 38 additions and 1 deletions

View File

@ -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).

View File

@ -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;
}
}
}

View File

@ -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)
{