aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_object_image.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-04-03 16:23:13 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-04-03 16:23:13 +0200
commitc2e75544e1b8f41353cc66715e9772184c036973 (patch)
tree989170942c19e68027990948f4cea35bbaa453e6 /src/lib/evas/canvas/evas_object_image.c
parentevas: fix warning due to forgotten return. (diff)
downloadefl-c2e75544e1b8f41353cc66715e9772184c036973.tar.gz
efl: move mmap API to be part of Efl_File class.
Diffstat (limited to 'src/lib/evas/canvas/evas_object_image.c')
-rw-r--r--src/lib/evas/canvas/evas_object_image.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 90b3c49aa2..eaf17d6fd4 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -412,7 +412,7 @@ evas_object_image_memfile_set(Evas_Object *eo_obj, void *data, int size, char *f
f = eina_file_virtualize(NULL, data, size, EINA_TRUE);
if (!f) return ;
- eo_do(eo_obj, evas_obj_image_mmap_set(f, key));
+ eo_do(eo_obj, efl_file_mmap_set(f, key));
eina_file_close(f);
}
@@ -544,8 +544,10 @@ _image_done_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o)
evas_object_change(eo_obj, obj);
}
-EOLIAN static void
-_evas_image_mmap_set(Eo *eo_obj, Evas_Image_Data *o, const Eina_File *f, const char *key)
+EOLIAN static Eina_Bool
+_evas_image_efl_file_mmap_set(Eo *eo_obj,
+ Evas_Image_Data *o,
+ const Eina_File *f, const char *key)
{
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
Evas_Image_Load_Opts lo;
@@ -553,18 +555,22 @@ _evas_image_mmap_set(Eo *eo_obj, Evas_Image_Data *o, const Eina_File *f, const c
if (o->cur->u.f == f)
{
if ((!o->cur->key) && (!key))
- return;
+ return EINA_FALSE;
if ((o->cur->key) && (key) && (!strcmp(o->cur->key, key)))
- return;
+ return EINA_FALSE;
}
evas_object_async_block(obj);
_image_init_set(f, NULL, key, eo_obj, obj, o, &lo);
o->engine_data = ENFN->image_mmap(ENDT, o->cur->u.f, o->cur->key, &o->load_error, &lo);
_image_done_set(eo_obj, obj, o);
+
+ return EINA_TRUE;
}
EOLIAN static void
-_evas_image_mmap_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, const Eina_File **f, const char **key)
+_evas_image_efl_file_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;
@@ -4915,6 +4921,17 @@ evas_object_image_file_get(const Eo *obj, const char **file, const char **key)
eo_do((Eo *) obj, efl_file_get(file, key));
}
+EAPI void
+evas_object_image_mmap_set(Evas_Image *obj, const Eina_File *f, const char *key)
+{
+ eo_do((Evas_Image *)obj, efl_file_mmap_set(f, key));
+}
+
+EAPI void
+evas_object_image_mmap_get(const Evas_Image *obj, const Eina_File **f, const char **key)
+{
+ eo_do((Evas_Image *)obj, efl_file_mmap_get(f, key));
+}
EAPI Eina_Bool
evas_object_image_save(const Eo *obj, const char *file, const char *key, const char *flags)