From fc6ba5561ea638312acf854665af3e24b48d2dc4 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Thu, 16 Jun 2016 20:01:32 +0900 Subject: [PATCH] Evas: Move Evas.Load_Error to legacy, use Efl.Image.Load.Error This also disables the unused interface "load_state". --- src/lib/efl/interfaces/efl_gfx_types.eot | 11 +++++++++++ src/lib/efl/interfaces/efl_image_load.eo | 21 +++++---------------- src/lib/evas/Evas_Legacy.h | 2 ++ src/lib/evas/Evas_Loader.h | 18 +++++++++--------- src/lib/evas/canvas/efl_canvas_image.c | 2 +- src/lib/evas/canvas/evas_image_legacy.c | 2 +- 6 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/lib/efl/interfaces/efl_gfx_types.eot b/src/lib/efl/interfaces/efl_gfx_types.eot index 9821784..dfabeec 100644 --- a/src/lib/efl/interfaces/efl_gfx_types.eot +++ b/src/lib/efl/interfaces/efl_gfx_types.eot @@ -193,3 +193,14 @@ enum Efl.Gfx.Size.Hint.Aspect object (never growing it out of those bounds), using the given aspect.]] } + +enum Efl.Image.Load.Error +{ + none = 0, [[No error on load]] + generic = 1, [[A non-specific error occurred]] + does_not_exist = 2, [[File (or file path) does not exist]] + permission_denied = 3, [[Permission denied to an existing file (or path)]] + resource_allocation_failed = 4, [[Allocation of resources failure prevented load]] + corrupt_file = 5, [[File corrupt (but was detected as a known format)]] + unknown_format = 6 [[File is not a known format]] +} diff --git a/src/lib/efl/interfaces/efl_image_load.eo b/src/lib/efl/interfaces/efl_image_load.eo index 38ef297..b373551 100644 --- a/src/lib/efl/interfaces/efl_image_load.eo +++ b/src/lib/efl/interfaces/efl_image_load.eo @@ -1,16 +1,6 @@ -/* FIXME: maybe add error code for "currently running" or "pending" ? */ -enum Efl.Image.Load.Error -{ - none = 0, [[No error on load]] - generic = 1, [[A non-specific error occurred]] - does_not_exist = 2, [[File (or file path) does not exist]] - permission_denied = 3, [[Permission denied to an existing file (or path)]] - resource_allocation_failed = 4, [[Allocation of resources failure prevented load]] - corrupt_file = 5, [[File corrupt (but was detected as a known format)]] - unknown_format = 6 [[File is not a known format]] -} +import efl_gfx_types; -/* FIXME: state or status??? */ +/* enum Efl.Image.Load.State { none = 0, [[Not loading any image.]] @@ -20,8 +10,8 @@ enum Efl.Image.Load.State error = 4, [[Image load has failed. Call @Efl.Image.Load.load_error.get to know why.]] cancelled = 5 [[Image load has been cancelled.]] } +*/ -/* FIXME: Efl.Image.Load */ interface Efl.Image.Load () { [[Common APIs for all loadable 2D images.]] @@ -43,6 +33,7 @@ interface Efl.Image.Load () will be kept in memory. ]] } + /* @property load_state { get { [[Queries information on the current state of load of the image. @@ -55,6 +46,7 @@ interface Efl.Image.Load () state: Efl.Image.Load.State; } } + */ @property load_size { [[The load size of an image. @@ -178,9 +170,6 @@ interface Efl.Image.Load () div: int; [[The scale down dividing factor.]] } } - /* FIXME: do we want this? or only rely on the events? - * what if preload is currently running? - */ @property load_error { get { [[Retrieves a number representing any error that occurred during diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index c149555..cd4b2c3 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -3759,6 +3759,8 @@ EAPI void evas_object_image_load_scale_down_set(Evas_Object *obj, int scale_down */ EAPI int evas_object_image_load_scale_down_get(const Evas_Object *obj); +typedef Efl_Image_Load_Error Evas_Load_Error; + /** * @brief Retrieves a number representing any error that occurred during the * last loading of the given image object's source image. diff --git a/src/lib/evas/Evas_Loader.h b/src/lib/evas/Evas_Loader.h index f8e4da4..62e0d7a 100644 --- a/src/lib/evas/Evas_Loader.h +++ b/src/lib/evas/Evas_Loader.h @@ -123,15 +123,15 @@ typedef Emile_Image_Property Evas_Image_Property; typedef struct _Evas_Image_Load_Func Evas_Image_Load_Func; -typedef Emile_Image_Load_Error Evas_Load_Error; - -#define EVAS_LOAD_ERROR_NONE EMILE_IMAGE_LOAD_ERROR_NONE -#define EVAS_LOAD_ERROR_GENERIC EMILE_IMAGE_LOAD_ERROR_GENERIC -#define EVAS_LOAD_ERROR_DOES_NOT_EXIST EMILE_IMAGE_LOAD_ERROR_DOES_NOT_EXIST -#define EVAS_LOAD_ERROR_PERMISSION_DENIED EMILE_IMAGE_LOAD_ERROR_PERMISSION_DENIED -#define EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED EMILE_IMAGE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED -#define EVAS_LOAD_ERROR_CORRUPT_FILE EMILE_IMAGE_LOAD_ERROR_CORRUPT_FILE -#define EVAS_LOAD_ERROR_UNKNOWN_FORMAT EMILE_IMAGE_LOAD_ERROR_UNKNOWN_FORMAT +typedef Efl_Image_Load_Error Evas_Load_Error; + +#define EVAS_LOAD_ERROR_NONE EFL_IMAGE_LOAD_ERROR_NONE +#define EVAS_LOAD_ERROR_GENERIC EFL_IMAGE_LOAD_ERROR_GENERIC +#define EVAS_LOAD_ERROR_DOES_NOT_EXIST EFL_IMAGE_LOAD_ERROR_DOES_NOT_EXIST +#define EVAS_LOAD_ERROR_PERMISSION_DENIED EFL_IMAGE_LOAD_ERROR_PERMISSION_DENIED +#define EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED EFL_IMAGE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED +#define EVAS_LOAD_ERROR_CORRUPT_FILE EFL_IMAGE_LOAD_ERROR_CORRUPT_FILE +#define EVAS_LOAD_ERROR_UNKNOWN_FORMAT EFL_IMAGE_LOAD_ERROR_UNKNOWN_FORMAT typedef Emile_Image_Animated_Loop_Hint Evas_Image_Animated_Loop_Hint; diff --git a/src/lib/evas/canvas/efl_canvas_image.c b/src/lib/evas/canvas/efl_canvas_image.c index fb4c1dc..bcb3173 100644 --- a/src/lib/evas/canvas/efl_canvas_image.c +++ b/src/lib/evas/canvas/efl_canvas_image.c @@ -119,7 +119,7 @@ _evas_image_load_error_get(const Eo *eo_obj) { Evas_Image_Data *o = eo_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS); - return (Efl_Image_Load_Error) o->load_error; + return o->load_error; } EOLIAN static Efl_Image_Load_Error diff --git a/src/lib/evas/canvas/evas_image_legacy.c b/src/lib/evas/canvas/evas_image_legacy.c index 153991e..08c5b90 100644 --- a/src/lib/evas/canvas/evas_image_legacy.c +++ b/src/lib/evas/canvas/evas_image_legacy.c @@ -329,7 +329,7 @@ EAPI Evas_Load_Error evas_object_image_load_error_get(const Evas_Object *obj) { EVAS_IMAGE_API(obj, EVAS_LOAD_ERROR_GENERIC); - return (Evas_Load_Error) _evas_image_load_error_get(obj); + return _evas_image_load_error_get(obj); } EAPI void -- 2.7.4