jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6c5399266833a94ba3585fd09a1c8e6f32126c2e
commit 6c5399266833a94ba3585fd09a1c8e6f32126c2e Author: Jean-Philippe Andre <jp.an...@samsung.com> Date: Wed Nov 29 12:05:10 2017 +0900 edje: Implement Efl.File.load_error Don't create a new function with the same name, it's absurd. --- src/lib/edje/edje_legacy.c | 13 +++++++++++++ src/lib/edje/edje_load.c | 17 ++--------------- src/lib/edje/edje_object.eo | 17 +---------------- src/lib/efl/interfaces/efl_file.eo | 14 ++++---------- 4 files changed, 20 insertions(+), 41 deletions(-) diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c index d3f19ea9cd..a4520ba0b5 100644 --- a/src/lib/edje/edje_legacy.c +++ b/src/lib/edje/edje_legacy.c @@ -2,6 +2,19 @@ #include "edje_private.h" +EAPI Edje_Load_Error +edje_object_load_error_get(const Eo *obj) +{ + Efl_Image_Load_Error p = efl_file_load_error_get(obj); + Edje *ed; + + if (p != EFL_IMAGE_LOAD_ERROR_NONE) return EDJE_LOAD_ERROR_DOES_NOT_EXIST; + + ed = _edje_fetch(obj); + if (!ed) return EDJE_LOAD_ERROR_GENERIC; + return ed->load_error; +} + EAPI Eina_Bool edje_object_part_geometry_get(const Edje_Object *obj, const char *part, int *x, int *y, int *w, int *h) { diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c index 94f8c0e401..59b1e18ce2 100644 --- a/src/lib/edje/edje_load.c +++ b/src/lib/edje/edje_load.c @@ -167,9 +167,9 @@ _edje_object_efl_file_file_get(Eo *obj EINA_UNUSED, Edje *ed, const char **file, } EOLIAN Efl_Image_Load_Error -_edje_object_load_error_get(Eo *obj, Edje *ed) +_edje_object_efl_file_load_error_get(Eo *obj, Edje *ed) { - Efl_Image_Load_Error p = efl_file_load_error_get(obj); + Efl_Image_Load_Error p = efl_file_load_error_get(efl_super(obj, EDJE_OBJECT_CLASS)); if (p != EFL_IMAGE_LOAD_ERROR_NONE) return p; switch (ed->load_error) @@ -188,19 +188,6 @@ _edje_object_load_error_get(Eo *obj, Edje *ed) } } -EAPI Edje_Load_Error -edje_object_load_error_get(const Eo *obj) -{ - Efl_Image_Load_Error p = efl_file_load_error_get(obj); - Edje *ed; - - if (p != EFL_IMAGE_LOAD_ERROR_NONE) return EDJE_LOAD_ERROR_DOES_NOT_EXIST; - - ed = _edje_fetch(obj); - if (!ed) return EDJE_LOAD_ERROR_GENERIC; - return ed->load_error; -} - EAPI const char * edje_load_error_str(Edje_Load_Error error) { diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo index 53f2b6a4cc..99121aaaa4 100644 --- a/src/lib/edje/edje_object.eo +++ b/src/lib/edje/edje_object.eo @@ -85,22 +85,6 @@ class Edje.Object (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part, $true will remove it (if it was issued before).]] } } - @property load_error { - get { - [[Gets the (last) file loading error for a given Edje object - - This function is meant to be used after an Edje EDJ file - loading, what takes place with the $file_set() function. If that - function does not return $true, one should check for the reason - of failure with this one. - ]] - legacy: null; - } - values { - error: Efl.Image.Load.Error(Efl.Image.Load.Error.generic); - [[The load error code.]] - } - } access_part_iterate @beta { [[Iterates over all accessibility-enabled part names.]] @@ -204,6 +188,7 @@ class Edje.Object (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part, Efl.Ui.Base.language { set; get; } Efl.Ui.Base.scale { set; get; } Efl.Ui.Base.base_scale { get; } + Efl.File.load_error { get; } Efl.File.mmap { get; set; } Efl.Container.content_remove; Efl.Part.part; [[Returns @Efl.Canvas.Layout.Part.]] diff --git a/src/lib/efl/interfaces/efl_file.eo b/src/lib/efl/interfaces/efl_file.eo index 35ac1fa4ec..e351a5eaa3 100644 --- a/src/lib/efl/interfaces/efl_file.eo +++ b/src/lib/efl/interfaces/efl_file.eo @@ -6,13 +6,7 @@ mixin Efl.File { methods { @property load_error { get { - [[Gets the (last) file loading error for a given Edje object - - This function is meant to be used after an Edje EDJ file - loading, what takes place with the $file_set() function. If that - function does not return $true, one should check for the reason - of failure with this one. - ]] + [[Gets the (last) file loading error for a given object.]] } values { error: Efl.Image.Load.Error(Efl.Image.Load.Error.none); [[The load error code.]] @@ -105,9 +99,8 @@ mixin Efl.File { You can specify some flags when saving the image. Currently acceptable flags are $quality and $compress. Eg.: - "quality=100 compress=9"]] - - return: bool; [[$true on success, $false otherwise]] + "quality=100 compress=9". + ]] params { @in file: string @nonull; [[The filename to be used to save the image (extension obligatory).]] @@ -116,6 +109,7 @@ mixin Efl.File { @in flags: string; [[String containing the flags to be used ($null for none).]] } + return: bool; [[$true on success, $false otherwise]] } } } --