summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-03-04 13:36:57 -0500
committerMike Blumenkrantz <zmike@samsung.com>2019-03-04 13:36:57 -0500
commit6b046ec845b6e0dc5d87f8d6f6524d1794678727 (patch)
tree66db8c4a8432bdbfd0c46b1410986657f263d999 /src
parentc388e853f879191e7e76d567a5f96aa07492fa72 (diff)
efl.gfx: remove Efl.Gfx.Image_Load_Error
Summary: this is now implemented through Eina.Error ref T7718 Depends on D8066 Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl_api Maniphest Tasks: T7718 Differential Revision: https://phab.enlightenment.org/D8067
Diffstat (limited to 'src')
-rw-r--r--src/lib/edje/edje_load.c2
-rw-r--r--src/lib/edje/efl_canvas_layout.eo2
-rw-r--r--src/lib/efl/interfaces/efl_gfx_image.eo2
-rw-r--r--src/lib/efl/interfaces/efl_gfx_image_load_controller.eo2
-rw-r--r--src/lib/efl/interfaces/efl_gfx_types.eot28
-rw-r--r--src/lib/evas/canvas/efl_canvas_image.c10
-rw-r--r--src/lib/evas/canvas/efl_canvas_proxy.c2
-rw-r--r--src/lib/evas/canvas/efl_canvas_scene3d.c4
-rw-r--r--src/lib/evas/canvas/evas_image_legacy.c21
-rw-r--r--src/lib/evas/canvas/evas_image_private.h2
-rw-r--r--src/lib/evas/canvas/evas_main.c97
-rw-r--r--src/lib/evas/canvas/evas_object_image.c20
-rw-r--r--src/lib/evas/include/evas_common_private.h2
-rw-r--r--src/lib/evas/include/evas_private.h5
-rw-r--r--src/lib/evas/vg/evas_vg_cache.c2
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_image.c8
-rw-r--r--src/modules/evas/vg_savers/eet/evas_vg_save_eet.c2
-rw-r--r--src/modules/evas/vg_savers/svg/evas_vg_save_svg.c4
18 files changed, 162 insertions, 53 deletions
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index 9256d43acf..a323f93a9f 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -171,7 +171,7 @@ _efl_canvas_layout_efl_file_group_get(Eo *obj EINA_UNUSED, Edje *ed)
171 return ed->group; 171 return ed->group;
172} 172}
173 173
174EOLIAN Efl_Gfx_Image_Load_Error 174EOLIAN Eina_Error
175_efl_canvas_layout_layout_load_error_get(const Eo *obj EINA_UNUSED, Edje *ed) 175_efl_canvas_layout_layout_load_error_get(const Eo *obj EINA_UNUSED, Edje *ed)
176{ 176{
177 switch (ed->load_error) 177 switch (ed->load_error)
diff --git a/src/lib/edje/efl_canvas_layout.eo b/src/lib/edje/efl_canvas_layout.eo
index 5886c8ec20..8bcc728717 100644
--- a/src/lib/edje/efl_canvas_layout.eo
+++ b/src/lib/edje/efl_canvas_layout.eo
@@ -77,7 +77,7 @@ class @beta Efl.Canvas.Layout extends Efl.Canvas.Group implements Efl.File, Efl.
77 [[Gets the (last) file loading error for a given object.]] 77 [[Gets the (last) file loading error for a given object.]]
78 } 78 }
79 values { 79 values {
80 error: Efl.Gfx.Image_Load_Error(Efl.Gfx.Image_Load_Error.none); [[The load error code.]] 80 error: Eina.Error; [[The load error code.]]
81 } 81 }
82 } 82 }
83 content_remove { 83 content_remove {
diff --git a/src/lib/efl/interfaces/efl_gfx_image.eo b/src/lib/efl/interfaces/efl_gfx_image.eo
index eb23f3fe30..5d42432aba 100644
--- a/src/lib/efl/interfaces/efl_gfx_image.eo
+++ b/src/lib/efl/interfaces/efl_gfx_image.eo
@@ -208,7 +208,7 @@ interface @beta Efl.Gfx.Image
208 [[Gets the (last) file loading error for a given object.]] 208 [[Gets the (last) file loading error for a given object.]]
209 } 209 }
210 values { 210 values {
211 error: Efl.Gfx.Image_Load_Error(Efl.Gfx.Image_Load_Error.none); [[The load error code.]] 211 error: Eina.Error; [[The load error code.]]
212 } 212 }
213 } 213 }
214 } 214 }
diff --git a/src/lib/efl/interfaces/efl_gfx_image_load_controller.eo b/src/lib/efl/interfaces/efl_gfx_image_load_controller.eo
index 4771be1478..1727e578e6 100644
--- a/src/lib/efl/interfaces/efl_gfx_image_load_controller.eo
+++ b/src/lib/efl/interfaces/efl_gfx_image_load_controller.eo
@@ -180,6 +180,6 @@ interface @beta Efl.Gfx.Image_Load_Controller
180 } 180 }
181 events { 181 events {
182 load,done: void; [[Called when he image was loaded]] 182 load,done: void; [[Called when he image was loaded]]
183 load,error: Efl.Gfx.Image_Load_Error; [[Called when an error happened during image loading]] 183 load,error: Eina.Error; [[Called when an error happened during image loading]]
184 } 184 }
185} 185}
diff --git a/src/lib/efl/interfaces/efl_gfx_types.eot b/src/lib/efl/interfaces/efl_gfx_types.eot
index 6f64ce30f0..283c9286dd 100644
--- a/src/lib/efl/interfaces/efl_gfx_types.eot
+++ b/src/lib/efl/interfaces/efl_gfx_types.eot
@@ -188,22 +188,6 @@ enum Efl.Gfx.Hint_Aspect
188 aspect.]] 188 aspect.]]
189} 189}
190 190
191enum Efl.Gfx.Image_Load_Error
192{
193 [[Image or Edje load error type]]
194 none = 0, [[No error on load]]
195 generic = 1, [[A non-specific error occurred]]
196 does_not_exist = 2, [[File (or file path) does not exist]]
197 permission_denied = 3, [[Permission denied to an existing file (or path)]]
198 resource_allocation_failed = 4, [[Allocation of resources failure prevented load]]
199 corrupt_file = 5, [[File corrupt (but was detected as a known format)]]
200 unknown_format = 6, [[File is not a known format]]
201 cancelled = 7, [[Reading operation has been cancelled during decoding]]
202 incompatible_file = 8, [[(Edje only) The file pointed to is incompatible, i.e., it doesn't match the library's current version's format.]]
203 unknown_collection = 9, [[(Edje only) The group/collection set to load from was not found in the file]]
204 recursive_reference = 10 [[(Edje only) The group/collection set to load from had recursive references on its components]]
205}
206
207enum Efl.Gfx.Color_Class_Layer { 191enum Efl.Gfx.Color_Class_Layer {
208 [[Efl Gfx Color Class layer enum]] 192 [[Efl Gfx Color Class layer enum]]
209 normal = 0, [[Default color]] 193 normal = 0, [[Default color]]
@@ -212,3 +196,15 @@ enum Efl.Gfx.Color_Class_Layer {
212} 196}
213 197
214type Efl.Font.Size: int; [[Efl font size type]] 198type Efl.Font.Size: int; [[Efl font size type]]
199
200var Efl.Gfx.Image.Load_Error.NONE: Eina.Error; [[No error on load]]
201var Efl.Gfx.Image.Load_Error.GENERIC: Eina.Error; [[A non-specific error occurred]]
202var Efl.Gfx.Image.Load_Error.DOES_NOT_EXIST: Eina.Error; [[File (or file path) does not exist]]
203var Efl.Gfx.Image.Load_Error.PERMISSION_DENIED: Eina.Error; [[Permission denied to an existing file (or path)]]
204var Efl.Gfx.Image.Load_Error.RESOURCE_ALLOCATION_FAILED: Eina.Error; [[Allocation of resources failure prevented load]]
205var Efl.Gfx.Image.Load_Error.CORRUPT_FILE: Eina.Error; [[File corrupt (but was detected as a known format)]]
206var Efl.Gfx.Image.Load_Error.UNKNOWN_FORMAT: Eina.Error; [[File is not a known format]]
207var Efl.Gfx.Image.Load_Error.CANCELLED: Eina.Error; [[Reading operation has been cancelled during decoding]]
208var Efl.Gfx.Image.Load_Error.INCOMPATIBLE_FILE: Eina.Error; [[(Edje only) The file pointed to is incompatible, i.e., it doesn't match the library's current version's format.]]
209var Efl.Gfx.Image.Load_Error.UNKNOWN_COLLECTION: Eina.Error; [[(Edje only) The group/collection set to load from was not found in the file]]
210var Efl.Gfx.Image.Load_Error.RECURSIVE_REFERENCE: Eina.Error; [[(Edje only) The group/collection set to load from had recursive references on its components]]
diff --git a/src/lib/evas/canvas/efl_canvas_image.c b/src/lib/evas/canvas/efl_canvas_image.c
index 0d95f2f17e..c89ee213f8 100644
--- a/src/lib/evas/canvas/efl_canvas_image.c
+++ b/src/lib/evas/canvas/efl_canvas_image.c
@@ -12,6 +12,7 @@ _evas_image_file_load(Eo *eo_obj)
12 Evas_Image_Load_Opts lo; 12 Evas_Image_Load_Opts lo;
13 const Eina_File *f = efl_file_mmap_get(eo_obj); 13 const Eina_File *f = efl_file_mmap_get(eo_obj);
14 const char *key = efl_file_key_get(eo_obj); 14 const char *key = efl_file_key_get(eo_obj);
15 int load_error;
15 16
16 EINA_SAFETY_ON_NULL_RETURN_VAL(f, EINA_FALSE); 17 EINA_SAFETY_ON_NULL_RETURN_VAL(f, EINA_FALSE);
17 18
@@ -26,7 +27,8 @@ _evas_image_file_load(Eo *eo_obj)
26 obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 27 obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
27 evas_object_async_block(obj); 28 evas_object_async_block(obj);
28 _evas_image_init_set(f, key, eo_obj, obj, o, &lo); 29 _evas_image_init_set(f, key, eo_obj, obj, o, &lo);
29 o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &o->load_error, &lo); 30 o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &load_error, &lo);
31 o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error);
30 o->buffer_data_set = EINA_FALSE; 32 o->buffer_data_set = EINA_FALSE;
31 _evas_image_done_set(eo_obj, obj, o); 33 _evas_image_done_set(eo_obj, obj, o);
32 o->file_size.w = o->cur->image.w; 34 o->file_size.w = o->cur->image.w;
@@ -787,11 +789,11 @@ _efl_canvas_image_efl_object_dbg_info_get(Eo *obj, void *pd EINA_UNUSED, Efl_Dbg
787 (root)) 789 (root))
788 { 790 {
789 Efl_Dbg_Info *group = EFL_DBG_INFO_LIST_APPEND(root, MY_CLASS_NAME); 791 Efl_Dbg_Info *group = EFL_DBG_INFO_LIST_APPEND(root, MY_CLASS_NAME);
790 Evas_Load_Error error = EVAS_LOAD_ERROR_GENERIC; 792 Eina_Error error = EFL_GFX_IMAGE_LOAD_ERROR_GENERIC;
791 793
792 error = (Evas_Load_Error) efl_gfx_image_load_error_get(obj); 794 error = efl_gfx_image_load_error_get(obj);
793 EFL_DBG_INFO_APPEND(group, "Load Error", EINA_VALUE_TYPE_STRING, 795 EFL_DBG_INFO_APPEND(group, "Load Error", EINA_VALUE_TYPE_STRING,
794 evas_load_error_str(error)); 796 eina_error_msg_get(error));
795 } 797 }
796} 798}
797 799
diff --git a/src/lib/evas/canvas/efl_canvas_proxy.c b/src/lib/evas/canvas/efl_canvas_proxy.c
index 734b8bc689..c8368eaed6 100644
--- a/src/lib/evas/canvas/efl_canvas_proxy.c
+++ b/src/lib/evas/canvas/efl_canvas_proxy.c
@@ -229,7 +229,7 @@ _evas_image_proxy_set(Evas_Object *eo_proxy, Evas_Object *eo_src)
229 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) 229 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
230 state_write->source = eo_src; 230 state_write->source = eo_src;
231 EINA_COW_IMAGE_STATE_WRITE_END(o, state_write); 231 EINA_COW_IMAGE_STATE_WRITE_END(o, state_write);
232 o->load_error = EVAS_LOAD_ERROR_NONE; 232 o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_NONE;;
233 o->proxyerror = 0; 233 o->proxyerror = 0;
234 234
235 EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, src->proxy, Evas_Object_Proxy_Data, proxy_src_write) 235 EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, src->proxy, Evas_Object_Proxy_Data, proxy_src_write)
diff --git a/src/lib/evas/canvas/efl_canvas_scene3d.c b/src/lib/evas/canvas/efl_canvas_scene3d.c
index 3dff89783a..513a68ba94 100644
--- a/src/lib/evas/canvas/efl_canvas_scene3d.c
+++ b/src/lib/evas/canvas/efl_canvas_scene3d.c
@@ -9,12 +9,14 @@ _efl_canvas_scene3d_scene3d_set(Eo *eo_obj, void *pd EINA_UNUSED, Evas_Canvas3D_
9 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 9 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
10 Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS); 10 Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
11 Evas_Image_Load_Opts lo; 11 Evas_Image_Load_Opts lo;
12 int load_error;
12 13
13 if (o->cur->scene == scene) return; 14 if (o->cur->scene == scene) return;
14 15
15 evas_object_async_block(obj); 16 evas_object_async_block(obj);
16 _evas_image_init_set(NULL, NULL, eo_obj, obj, o, &lo); 17 _evas_image_init_set(NULL, NULL, eo_obj, obj, o, &lo);
17 o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &o->load_error, &lo); 18 o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &load_error, &lo);
19 o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error);
18 _evas_image_done_set(eo_obj, obj, o); 20 _evas_image_done_set(eo_obj, obj, o);
19 21
20 if (scene) _evas_image_3d_set(eo_obj, scene); 22 if (scene) _evas_image_3d_set(eo_obj, scene);
diff --git a/src/lib/evas/canvas/evas_image_legacy.c b/src/lib/evas/canvas/evas_image_legacy.c
index 88052a7deb..81e5af7926 100644
--- a/src/lib/evas/canvas/evas_image_legacy.c
+++ b/src/lib/evas/canvas/evas_image_legacy.c
@@ -393,7 +393,7 @@ EAPI Evas_Load_Error
393evas_object_image_load_error_get(const Evas_Object *obj) 393evas_object_image_load_error_get(const Evas_Object *obj)
394{ 394{
395 EVAS_IMAGE_API(obj, EVAS_LOAD_ERROR_GENERIC); 395 EVAS_IMAGE_API(obj, EVAS_LOAD_ERROR_GENERIC);
396 return efl_gfx_image_load_error_get(obj); 396 return _efl_gfx_image_load_error_to_evas_load_error(efl_gfx_image_load_error_get(obj));
397} 397}
398 398
399EAPI void 399EAPI void
@@ -542,7 +542,7 @@ evas_object_image_native_surface_set(Evas_Object *eo_obj, Evas_Native_Surface *s
542 { 542 {
543 Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS); 543 Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
544 544
545 o->load_error = EVAS_LOAD_ERROR_GENERIC; 545 o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_GENERIC;
546 } 546 }
547} 547}
548 548
@@ -669,7 +669,7 @@ evas_object_image_data_set(Eo *eo_obj, void *data)
669 o->changed = EINA_TRUE; 669 o->changed = EINA_TRUE;
670 evas_object_change(eo_obj, obj); 670 evas_object_change(eo_obj, obj);
671 } 671 }
672 o->load_error = EVAS_LOAD_ERROR_NONE; 672 o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_NONE;
673 if ((o->cur->image.w != 0) || (o->cur->image.h != 0)) 673 if ((o->cur->image.w != 0) || (o->cur->image.h != 0))
674 resize_call = EINA_TRUE; 674 resize_call = EINA_TRUE;
675 675
@@ -718,6 +718,7 @@ evas_object_image_data_get(const Eo *eo_obj, Eina_Bool for_writing)
718 void *pixels = NULL; 718 void *pixels = NULL;
719 int stride = 0; 719 int stride = 0;
720 DATA32 *data; 720 DATA32 *data;
721 int load_error;
721 722
722 if (!o->engine_data) return NULL; 723 if (!o->engine_data) return NULL;
723 724
@@ -731,7 +732,8 @@ evas_object_image_data_get(const Eo *eo_obj, Eina_Bool for_writing)
731 ENFN->image_scale_hint_set(ENC, o->engine_data, o->scale_hint); 732 ENFN->image_scale_hint_set(ENC, o->engine_data, o->scale_hint);
732 if (ENFN->image_content_hint_set) 733 if (ENFN->image_content_hint_set)
733 ENFN->image_content_hint_set(ENC, o->engine_data, o->content_hint); 734 ENFN->image_content_hint_set(ENC, o->engine_data, o->content_hint);
734 pixels = ENFN->image_data_get(ENC, o->engine_data, for_writing, &data, &o->load_error, &tofree); 735 pixels = ENFN->image_data_get(ENC, o->engine_data, for_writing, &data, &load_error, &tofree);
736 o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error);
735 737
736 /* if we fail to get engine_data, we have to return NULL */ 738 /* if we fail to get engine_data, we have to return NULL */
737 if (!pixels || !data) goto error; 739 if (!pixels || !data) goto error;
@@ -1110,6 +1112,7 @@ evas_object_image_data_convert(Evas_Object *eo_obj, Evas_Colorspace to_cspace)
1110 void *engine_data; 1112 void *engine_data;
1111 DATA32 *data; 1113 DATA32 *data;
1112 void* result = NULL; 1114 void* result = NULL;
1115 int load_error;
1113 1116
1114 static int warned = 0; 1117 static int warned = 0;
1115 if (!warned) 1118 if (!warned)
@@ -1130,7 +1133,8 @@ evas_object_image_data_convert(Evas_Object *eo_obj, Evas_Colorspace to_cspace)
1130 ENFN->image_data_preload_cancel(ENC, o->engine_data, eo_obj, EINA_TRUE); 1133 ENFN->image_data_preload_cancel(ENC, o->engine_data, eo_obj, EINA_TRUE);
1131 } 1134 }
1132 data = NULL; 1135 data = NULL;
1133 engine_data = ENFN->image_data_get(ENC, o->engine_data, 0, &data, &o->load_error, NULL); 1136 engine_data = ENFN->image_data_get(ENC, o->engine_data, 0, &data, &load_error, NULL);
1137 o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error);
1134 result = _evas_image_data_convert_internal(o, data, to_cspace); 1138 result = _evas_image_data_convert_internal(o, data, to_cspace);
1135 if (engine_data) 1139 if (engine_data)
1136 o->engine_data = ENFN->image_data_put(ENC, engine_data, data); 1140 o->engine_data = ENFN->image_data_put(ENC, engine_data, data);
@@ -1184,6 +1188,7 @@ evas_object_image_pixels_import(Evas_Object *eo_obj, Evas_Pixel_Import_Source *p
1184 1188
1185 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 1189 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
1186 Evas_Image_Data *o; 1190 Evas_Image_Data *o;
1191 int load_error;
1187 1192
1188 static int warned = 0; 1193 static int warned = 0;
1189 if (!warned) 1194 if (!warned)
@@ -1211,7 +1216,8 @@ evas_object_image_pixels_import(Evas_Object *eo_obj, Evas_Pixel_Import_Source *p
1211 o->engine_data, 1216 o->engine_data,
1212 1, 1217 1,
1213 &image_pixels, 1218 &image_pixels,
1214 &o->load_error); 1219 &load_error);
1220 o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error);
1215/* FIXME: need to actualyl support this */ 1221/* FIXME: need to actualyl support this */
1216/* memcpy(image_pixels, pixels->rows, o->cur->image.w * o->cur->image.h * 4);*/ 1222/* memcpy(image_pixels, pixels->rows, o->cur->image.w * o->cur->image.h * 4);*/
1217 if (o->engine_data) 1223 if (o->engine_data)
@@ -1232,7 +1238,8 @@ evas_object_image_pixels_import(Evas_Object *eo_obj, Evas_Pixel_Import_Source *p
1232 { 1238 {
1233 DATA32 *image_pixels = NULL; 1239 DATA32 *image_pixels = NULL;
1234 1240
1235 o->engine_data = ENFN->image_data_get(ENC, o->engine_data, 1, &image_pixels,&o->load_error, NULL); 1241 o->engine_data = ENFN->image_data_get(ENC, o->engine_data, 1, &image_pixels, &load_error, NULL);
1242 o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error);
1236 if (image_pixels) 1243 if (image_pixels)
1237 evas_common_convert_yuv_422p_601_rgba((DATA8 **) pixels->rows, (DATA8 *) image_pixels, o->cur->image.w, o->cur->image.h); 1244 evas_common_convert_yuv_422p_601_rgba((DATA8 **) pixels->rows, (DATA8 *) image_pixels, o->cur->image.w, o->cur->image.h);
1238 if (o->engine_data) 1245 if (o->engine_data)
diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h
index 7c197717a5..230bf5e002 100644
--- a/src/lib/evas/canvas/evas_image_private.h
+++ b/src/lib/evas/canvas/evas_image_private.h
@@ -111,7 +111,7 @@ struct _Evas_Image_Data
111 void *plane; 111 void *plane;
112 112
113 int pixels_checked_out; 113 int pixels_checked_out;
114 int load_error; 114 Eina_Error load_error; /* Efl.Gfx.Image.Load_Error */
115 115
116 Efl_Gfx_Image_Scale_Hint scale_hint; 116 Efl_Gfx_Image_Scale_Hint scale_hint;
117 Efl_Gfx_Image_Content_Hint content_hint; 117 Efl_Gfx_Image_Content_Hint content_hint;
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index c38b7e5151..95e7ac4a9b 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -25,6 +25,101 @@ EAPI int lockmax = 0;
25static int _evas_init_count = 0; 25static int _evas_init_count = 0;
26int _evas_log_dom_global = -1; 26int _evas_log_dom_global = -1;
27 27
28EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_NONE = 0;
29EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_GENERIC = 0;
30EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST = 0;
31EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_PERMISSION_DENIED = 0;
32EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 0;
33EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_CORRUPT_FILE = 0;
34EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_UNKNOWN_FORMAT = 0;
35EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_CANCELLED = 0;
36EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_INCOMPATIBLE_FILE = 0;
37EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_UNKNOWN_COLLECTION = 0;
38EAPI Eina_Error EFL_GFX_IMAGE_LOAD_ERROR_RECURSIVE_REFERENCE = 0;
39
40#define NUM_ERRORS 11
41
42const char *efl_gfx_image_load_error_msgs[] = {
43 "No error on load" ,
44 "A non-specific error occurred" ,
45 "File (or file path) does not exist" ,
46 "Permission denied to an existing file (or path)" ,
47 "Allocation of resources failure prevented load" ,
48 "File corrupt (but was detected as a known format)" ,
49 "File is not a known format" ,
50 "Reading operation has been cancelled during decoding" ,
51 "(Edje only) The file pointed to is incompatible, i.e., it doesn't match the library's current version's format." ,
52 "(Edje only) The group/collection set to load from was not found in the file" ,
53 "(Edje only) The group/collection set to load from had recursive references on its components"
54};
55
56static void
57_efl_gfx_image_load_error_init(void)
58{
59 Eina_Error *table[] = {
60 &EFL_GFX_IMAGE_LOAD_ERROR_NONE,
61 &EFL_GFX_IMAGE_LOAD_ERROR_GENERIC,
62 &EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST,
63 &EFL_GFX_IMAGE_LOAD_ERROR_PERMISSION_DENIED,
64 &EFL_GFX_IMAGE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED,
65 &EFL_GFX_IMAGE_LOAD_ERROR_CORRUPT_FILE,
66 &EFL_GFX_IMAGE_LOAD_ERROR_UNKNOWN_FORMAT,
67 &EFL_GFX_IMAGE_LOAD_ERROR_CANCELLED,
68 &EFL_GFX_IMAGE_LOAD_ERROR_INCOMPATIBLE_FILE,
69 &EFL_GFX_IMAGE_LOAD_ERROR_UNKNOWN_COLLECTION,
70 &EFL_GFX_IMAGE_LOAD_ERROR_RECURSIVE_REFERENCE
71 };
72 unsigned int i;
73
74 if (EFL_GFX_IMAGE_LOAD_ERROR_GENERIC) return;
75 /* skip EFL_GFX_IMAGE_LOAD_ERROR_NONE: this should always be 0 */
76 for (i = 1; i < NUM_ERRORS; i++)
77 *(table[i]) = eina_error_msg_static_register(efl_gfx_image_load_error_msgs[i]);
78#undef TABLE_ENTRY
79}
80
81Eina_Error
82_evas_load_error_to_efl_gfx_image_load_error(Evas_Load_Error err)
83{
84#define TABLE_ENTRY(NAME) [EVAS_LOAD_ERROR_##NAME] = &EFL_GFX_IMAGE_LOAD_ERROR_##NAME
85 Eina_Error *table[] = {
86 TABLE_ENTRY(NONE),
87 TABLE_ENTRY(GENERIC),
88 TABLE_ENTRY(DOES_NOT_EXIST),
89 TABLE_ENTRY(PERMISSION_DENIED),
90 TABLE_ENTRY(RESOURCE_ALLOCATION_FAILED),
91 TABLE_ENTRY(CORRUPT_FILE),
92 TABLE_ENTRY(UNKNOWN_FORMAT),
93 TABLE_ENTRY(CANCELLED),
94 //TABLE_ENTRY(INCOMPATIBLE_FILE),
95 //TABLE_ENTRY(UNKNOWN_COLLECTION),
96 //TABLE_ENTRY(RECURSIVE_REFERENCE)
97 };
98 if (err > EVAS_LOAD_ERROR_CANCELLED) return err;
99 return *table[err];
100#undef TABLE_ENTRY
101}
102
103Evas_Load_Error
104_efl_gfx_image_load_error_to_evas_load_error(Eina_Error err)
105{
106 if (err && (err < EFL_GFX_IMAGE_LOAD_ERROR_GENERIC)) return EVAS_LOAD_ERROR_GENERIC;
107#define CONVERT_ERR(NAME) if (err == EFL_GFX_IMAGE_LOAD_ERROR_##NAME) return EVAS_LOAD_ERROR_##NAME
108 CONVERT_ERR(NONE);
109 CONVERT_ERR(GENERIC);
110 CONVERT_ERR(DOES_NOT_EXIST);
111 CONVERT_ERR(PERMISSION_DENIED);
112 CONVERT_ERR(RESOURCE_ALLOCATION_FAILED);
113 CONVERT_ERR(CORRUPT_FILE);
114 CONVERT_ERR(UNKNOWN_FORMAT);
115 CONVERT_ERR(CANCELLED);
116 //CONVERT_ERR(INCOMPATIBLE_FILE);
117 //CONVERT_ERR(UNKNOWN_COLLECTION);
118 //CONVERT_ERR(RECURSIVE_REFERENCE);
119 return EVAS_LOAD_ERROR_GENERIC;
120}
121
122
28EAPI int 123EAPI int
29evas_init(void) 124evas_init(void)
30{ 125{
@@ -81,6 +176,8 @@ evas_init(void)
81 _efl_gfx_mapping_init(); 176 _efl_gfx_mapping_init();
82 evas_focus_init(); 177 evas_focus_init();
83 178
179 _efl_gfx_image_load_error_init();
180
84 return _evas_init_count; 181 return _evas_init_count;
85 182
86 shutdown_filter: 183 shutdown_filter:
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 1053451ee8..1d0e128dd1 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -283,7 +283,7 @@ _evas_image_init_set(const Eina_File *f, const char *key,
283 } 283 }
284 ENFN->image_free(ENC, o->engine_data); 284 ENFN->image_free(ENC, o->engine_data);
285 } 285 }
286 o->load_error = EVAS_LOAD_ERROR_NONE; 286 o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_NONE;
287 lo->emile.scale_down_by = o->load_opts->scale_down_by; 287 lo->emile.scale_down_by = o->load_opts->scale_down_by;
288 lo->emile.dpi = o->load_opts->dpi; 288 lo->emile.dpi = o->load_opts->dpi;
289 lo->emile.w = o->load_opts->w; 289 lo->emile.w = o->load_opts->w;
@@ -340,8 +340,8 @@ _evas_image_done_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Dat
340 } 340 }
341 else 341 else
342 { 342 {
343 if (o->load_error == EVAS_LOAD_ERROR_NONE) 343 if (o->load_error == EFL_GFX_IMAGE_LOAD_ERROR_NONE)
344 o->load_error = EVAS_LOAD_ERROR_GENERIC; 344 o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_GENERIC;
345 345
346 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) 346 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
347 { 347 {
@@ -854,7 +854,7 @@ _efl_canvas_image_internal_efl_gfx_image_ratio_get(const Eo *eo_obj EINA_UNUSED,
854 return (double)o->cur->image.w / (double)o->cur->image.h; 854 return (double)o->cur->image.w / (double)o->cur->image.h;
855} 855}
856 856
857EOLIAN static Efl_Gfx_Image_Load_Error 857EOLIAN static Eina_Error
858_efl_canvas_image_internal_efl_gfx_image_image_load_error_get(const Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) 858_efl_canvas_image_internal_efl_gfx_image_image_load_error_get(const Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
859{ 859{
860 return o->load_error; 860 return o->load_error;
@@ -1121,7 +1121,7 @@ _evas_image_unload(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bo
1121 ENFN->image_free(ENC, o->engine_data); 1121 ENFN->image_free(ENC, o->engine_data);
1122 } 1122 }
1123 o->engine_data = NULL; 1123 o->engine_data = NULL;
1124 o->load_error = EVAS_LOAD_ERROR_NONE; 1124 o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_NONE;
1125 1125
1126 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) 1126 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
1127 { 1127 {
@@ -1140,6 +1140,7 @@ void
1140_evas_image_load(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o) 1140_evas_image_load(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o)
1141{ 1141{
1142 Evas_Image_Load_Opts lo; 1142 Evas_Image_Load_Opts lo;
1143 int load_error = 0;
1143 1144
1144 if (o->engine_data) return; 1145 if (o->engine_data) return;
1145 1146
@@ -1162,7 +1163,8 @@ _evas_image_load(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Imag
1162 lo.emile.orientation = o->load_opts->orientation; 1163 lo.emile.orientation = o->load_opts->orientation;
1163 lo.emile.degree = 0; 1164 lo.emile.degree = 0;
1164 lo.skip_head = o->skip_head; 1165 lo.skip_head = o->skip_head;
1165 o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &o->load_error, &lo); 1166 o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &load_error, &lo);
1167 o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error);
1166 1168
1167 if (o->engine_data) 1169 if (o->engine_data)
1168 { 1170 {
@@ -1191,7 +1193,7 @@ _evas_image_load(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Imag
1191 } 1193 }
1192 else 1194 else
1193 { 1195 {
1194 o->load_error = EVAS_LOAD_ERROR_GENERIC; 1196 o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_GENERIC;
1195 } 1197 }
1196} 1198}
1197 1199
@@ -1230,12 +1232,12 @@ _evas_image_load_post_update(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
1230 1232
1231 //preloading error check 1233 //preloading error check
1232 if (ENFN->image_load_error_get) 1234 if (ENFN->image_load_error_get)
1233 o->load_error = ENFN->image_load_error_get(ENC, o->engine_data); 1235 o->load_error = _evas_load_error_to_efl_gfx_image_load_error(ENFN->image_load_error_get(ENC, o->engine_data));
1234 } 1236 }
1235 else 1237 else
1236 { 1238 {
1237 o->preload = EVAS_IMAGE_PRELOAD_NONE; 1239 o->preload = EVAS_IMAGE_PRELOAD_NONE;
1238 o->load_error = EVAS_LOAD_ERROR_GENERIC; 1240 o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_GENERIC;
1239 } 1241 }
1240} 1242}
1241 1243
diff --git a/src/lib/evas/include/evas_common_private.h b/src/lib/evas/include/evas_common_private.h
index 7fe19b7b9a..53c9fef2ec 100644
--- a/src/lib/evas/include/evas_common_private.h
+++ b/src/lib/evas/include/evas_common_private.h
@@ -636,7 +636,7 @@ struct _Image_Entry
636 int server_id; 636 int server_id;
637 int connect_num; 637 int connect_num;
638 int channel; 638 int channel;
639 int load_error; 639 Evas_Load_Error load_error;
640}; 640};
641 641
642struct _Engine_Image_Entry 642struct _Engine_Image_Entry
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 208f0e1000..1c06b5b9df 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1530,7 +1530,7 @@ struct _Evas_Vg_Load_Func
1530 1530
1531struct _Evas_Vg_Save_Func 1531struct _Evas_Vg_Save_Func
1532{ 1532{
1533 int (*file_save) (Vg_File_Data *vfd, const char *file, const char *key, int compress); 1533 Evas_Load_Error (*file_save) (Vg_File_Data *vfd, const char *file, const char *key, int compress);
1534}; 1534};
1535 1535
1536#ifdef __cplusplus 1536#ifdef __cplusplus
@@ -1918,6 +1918,9 @@ extern Eina_Cow *evas_object_image_state_cow;
1918extern Eina_Cow *evas_object_mask_cow; 1918extern Eina_Cow *evas_object_mask_cow;
1919extern Eina_Cow *evas_object_events_cow; 1919extern Eina_Cow *evas_object_events_cow;
1920 1920
1921Eina_Error _evas_load_error_to_efl_gfx_image_load_error(Evas_Load_Error err);
1922Evas_Load_Error _efl_gfx_image_load_error_to_evas_load_error(Eina_Error err);
1923
1921# define EINA_COW_STATE_WRITE_BEGIN(Obj, Write, State) \ 1924# define EINA_COW_STATE_WRITE_BEGIN(Obj, Write, State) \
1922 EINA_COW_WRITE_BEGIN(evas_object_state_cow, Obj->State, \ 1925 EINA_COW_WRITE_BEGIN(evas_object_state_cow, Obj->State, \
1923 Evas_Object_Protected_State, Write) 1926 Evas_Object_Protected_State, Write)
diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c
index e3a5d60529..6022982557 100644
--- a/src/lib/evas/vg/evas_vg_cache.c
+++ b/src/lib/evas/vg/evas_vg_cache.c
@@ -171,7 +171,7 @@ _vg_file_save(Vg_File_Data *vfd, const char *file, const char *key, const Efl_Fi
171{ 171{
172 Evas_Module *em; 172 Evas_Module *em;
173 Evas_Vg_Save_Func *saver; 173 Evas_Vg_Save_Func *saver;
174 int error = EVAS_LOAD_ERROR_GENERIC; 174 Evas_Load_Error error = EVAS_LOAD_ERROR_GENERIC;
175 int compress = 9; 175 int compress = 9;
176 176
177 if (!file) return EINA_FALSE; 177 if (!file) return EINA_FALSE;
diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c
index 03f4f1f8c2..c7a854f34d 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -811,8 +811,8 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
811 evas_cache_image_unload_data(ie); 811 evas_cache_image_unload_data(ie);
812 } 812 }
813 else if (!im->tex && 813 else if (!im->tex &&
814 ((ie->load_error == EFL_GFX_IMAGE_LOAD_ERROR_NONE) || 814 ((ie->load_error == EVAS_LOAD_ERROR_NONE) ||
815 (ie->load_error == EFL_GFX_IMAGE_LOAD_ERROR_CANCELLED))) 815 (ie->load_error == EVAS_LOAD_ERROR_CANCELLED)))
816 { 816 {
817 ie->load_error = evas_cache_image_load_data(ie); 817 ie->load_error = evas_cache_image_load_data(ie);
818 im->tex = evas_gl_common_texture_new(gc, im->im, im->disable_atlas); 818 im->tex = evas_gl_common_texture_new(gc, im->im, im->disable_atlas);
@@ -829,8 +829,8 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
829 evas_cache_image_unload_data(ie); 829 evas_cache_image_unload_data(ie);
830 } 830 }
831 else if (!im->tex && 831 else if (!im->tex &&
832 ((ie->load_error == EFL_GFX_IMAGE_LOAD_ERROR_NONE) || 832 ((ie->load_error == EVAS_LOAD_ERROR_NONE) ||
833 (ie->load_error == EFL_GFX_IMAGE_LOAD_ERROR_CANCELLED))) 833 (ie->load_error == EVAS_LOAD_ERROR_CANCELLED)))
834 { 834 {
835 ie->load_error = evas_cache_image_load_data(ie); 835 ie->load_error = evas_cache_image_load_data(ie);
836 im->tex = evas_gl_common_texture_rgb_a_pair_new(gc, im->im); 836 im->tex = evas_gl_common_texture_rgb_a_pair_new(gc, im->im);
diff --git a/src/modules/evas/vg_savers/eet/evas_vg_save_eet.c b/src/modules/evas/vg_savers/eet/evas_vg_save_eet.c
index 54f35e1127..a7a1bf36ae 100644
--- a/src/modules/evas/vg_savers/eet/evas_vg_save_eet.c
+++ b/src/modules/evas/vg_savers/eet/evas_vg_save_eet.c
@@ -12,7 +12,7 @@ static int _evas_vg_saver_eet_log_dom = -1;
12#endif 12#endif
13#define INF(...) EINA_LOG_DOM_INFO(_evas_vg_saver_eet_log_dom, __VA_ARGS__) 13#define INF(...) EINA_LOG_DOM_INFO(_evas_vg_saver_eet_log_dom, __VA_ARGS__)
14 14
15int 15Evas_Load_Error
16evas_vg_save_file_eet(Vg_File_Data *evg_data, const char *file, const char *key, int compress) 16evas_vg_save_file_eet(Vg_File_Data *evg_data, const char *file, const char *key, int compress)
17{ 17{
18 Eet_Data_Descriptor *svg_node_eet; 18 Eet_Data_Descriptor *svg_node_eet;
diff --git a/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c b/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c
index cf7854d80b..e900432d9a 100644
--- a/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c
+++ b/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c
@@ -129,7 +129,7 @@ _svg_node_printf(Svg_Node *parent, Eina_Strbuf *buf)
129 } 129 }
130} 130}
131 131
132int 132Evas_Load_Error
133evas_vg_save_file_svg(Vg_File_Data *evg_data, const char *file, const char *key EINA_UNUSED, int compress EINA_UNUSED) 133evas_vg_save_file_svg(Vg_File_Data *evg_data, const char *file, const char *key EINA_UNUSED, int compress EINA_UNUSED)
134{ 134{
135 Eina_Strbuf *buf = NULL; 135 Eina_Strbuf *buf = NULL;
@@ -138,7 +138,7 @@ evas_vg_save_file_svg(Vg_File_Data *evg_data, const char *file, const char *key
138 if (!f) 138 if (!f)
139 { 139 {
140 ERR("Cannot open file '%s' for SVG save", file); 140 ERR("Cannot open file '%s' for SVG save", file);
141 return EFL_GFX_IMAGE_LOAD_ERROR_GENERIC; 141 return EVAS_LOAD_ERROR_GENERIC;
142 } 142 }
143 143
144 root = vg_common_svg_create_svg_node(evg_data); 144 root = vg_common_svg_create_svg_node(evg_data);