summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-29 12:05:10 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-29 15:36:44 +0900
commit6c5399266833a94ba3585fd09a1c8e6f32126c2e (patch)
treea890a71db42a1343291df84b7dd5a7858f6b02fe /src/lib
parent4b18e754de9070c748a0ce5a7f4a3c6aa42a92ad (diff)
edje: Implement Efl.File.load_error
Don't create a new function with the same name, it's absurd.
Diffstat (limited to '')
-rw-r--r--src/lib/edje/edje_legacy.c13
-rw-r--r--src/lib/edje/edje_load.c17
-rw-r--r--src/lib/edje/edje_object.eo17
-rw-r--r--src/lib/efl/interfaces/efl_file.eo14
4 files changed, 20 insertions, 41 deletions
diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c
index d3f19ea..a4520ba 100644
--- a/src/lib/edje/edje_legacy.c
+++ b/src/lib/edje/edje_legacy.c
@@ -2,6 +2,19 @@
2 2
3#include "edje_private.h" 3#include "edje_private.h"
4 4
5EAPI Edje_Load_Error
6edje_object_load_error_get(const Eo *obj)
7{
8 Efl_Image_Load_Error p = efl_file_load_error_get(obj);
9 Edje *ed;
10
11 if (p != EFL_IMAGE_LOAD_ERROR_NONE) return EDJE_LOAD_ERROR_DOES_NOT_EXIST;
12
13 ed = _edje_fetch(obj);
14 if (!ed) return EDJE_LOAD_ERROR_GENERIC;
15 return ed->load_error;
16}
17
5EAPI Eina_Bool 18EAPI Eina_Bool
6edje_object_part_geometry_get(const Edje_Object *obj, const char *part, int *x, int *y, int *w, int *h) 19edje_object_part_geometry_get(const Edje_Object *obj, const char *part, int *x, int *y, int *w, int *h)
7{ 20{
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index 94f8c0e..59b1e18 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,
167} 167}
168 168
169EOLIAN Efl_Image_Load_Error 169EOLIAN Efl_Image_Load_Error
170_edje_object_load_error_get(Eo *obj, Edje *ed) 170_edje_object_efl_file_load_error_get(Eo *obj, Edje *ed)
171{ 171{
172 Efl_Image_Load_Error p = efl_file_load_error_get(obj); 172 Efl_Image_Load_Error p = efl_file_load_error_get(efl_super(obj, EDJE_OBJECT_CLASS));
173 173
174 if (p != EFL_IMAGE_LOAD_ERROR_NONE) return p; 174 if (p != EFL_IMAGE_LOAD_ERROR_NONE) return p;
175 switch (ed->load_error) 175 switch (ed->load_error)
@@ -188,19 +188,6 @@ _edje_object_load_error_get(Eo *obj, Edje *ed)
188 } 188 }
189} 189}
190 190
191EAPI Edje_Load_Error
192edje_object_load_error_get(const Eo *obj)
193{
194 Efl_Image_Load_Error p = efl_file_load_error_get(obj);
195 Edje *ed;
196
197 if (p != EFL_IMAGE_LOAD_ERROR_NONE) return EDJE_LOAD_ERROR_DOES_NOT_EXIST;
198
199 ed = _edje_fetch(obj);
200 if (!ed) return EDJE_LOAD_ERROR_GENERIC;
201 return ed->load_error;
202}
203
204EAPI const char * 191EAPI const char *
205edje_load_error_str(Edje_Load_Error error) 192edje_load_error_str(Edje_Load_Error error)
206{ 193{
diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo
index 53f2b6a..99121aa 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,
85 $true will remove it (if it was issued before).]] 85 $true will remove it (if it was issued before).]]
86 } 86 }
87 } 87 }
88 @property load_error {
89 get {
90 [[Gets the (last) file loading error for a given Edje object
91
92 This function is meant to be used after an Edje EDJ file
93 loading, what takes place with the $file_set() function. If that
94 function does not return $true, one should check for the reason
95 of failure with this one.
96 ]]
97 legacy: null;
98 }
99 values {
100 error: Efl.Image.Load.Error(Efl.Image.Load.Error.generic);
101 [[The load error code.]]
102 }
103 }
104 88
105 access_part_iterate @beta { 89 access_part_iterate @beta {
106 [[Iterates over all accessibility-enabled part names.]] 90 [[Iterates over all accessibility-enabled part names.]]
@@ -204,6 +188,7 @@ class Edje.Object (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part,
204 Efl.Ui.Base.language { set; get; } 188 Efl.Ui.Base.language { set; get; }
205 Efl.Ui.Base.scale { set; get; } 189 Efl.Ui.Base.scale { set; get; }
206 Efl.Ui.Base.base_scale { get; } 190 Efl.Ui.Base.base_scale { get; }
191 Efl.File.load_error { get; }
207 Efl.File.mmap { get; set; } 192 Efl.File.mmap { get; set; }
208 Efl.Container.content_remove; 193 Efl.Container.content_remove;
209 Efl.Part.part; [[Returns @Efl.Canvas.Layout.Part.]] 194 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 35ac1fa..e351a5e 100644
--- a/src/lib/efl/interfaces/efl_file.eo
+++ b/src/lib/efl/interfaces/efl_file.eo
@@ -6,13 +6,7 @@ mixin Efl.File {
6 methods { 6 methods {
7 @property load_error { 7 @property load_error {
8 get { 8 get {
9 [[Gets the (last) file loading error for a given Edje object 9 [[Gets the (last) file loading error for a given object.]]
10
11 This function is meant to be used after an Edje EDJ file
12 loading, what takes place with the $file_set() function. If that
13 function does not return $true, one should check for the reason
14 of failure with this one.
15 ]]
16 } 10 }
17 values { 11 values {
18 error: Efl.Image.Load.Error(Efl.Image.Load.Error.none); [[The load error code.]] 12 error: Efl.Image.Load.Error(Efl.Image.Load.Error.none); [[The load error code.]]
@@ -105,9 +99,8 @@ mixin Efl.File {
105 99
106 You can specify some flags when saving the image. Currently 100 You can specify some flags when saving the image. Currently
107 acceptable flags are $quality and $compress. Eg.: 101 acceptable flags are $quality and $compress. Eg.:
108 "quality=100 compress=9"]] 102 "quality=100 compress=9".
109 103 ]]
110 return: bool; [[$true on success, $false otherwise]]
111 params { 104 params {
112 @in file: string @nonull; [[The filename to be used to save the image (extension 105 @in file: string @nonull; [[The filename to be used to save the image (extension
113 obligatory).]] 106 obligatory).]]
@@ -116,6 +109,7 @@ mixin Efl.File {
116 @in flags: string; [[String containing the flags to be used ($null for 109 @in flags: string; [[String containing the flags to be used ($null for
117 none).]] 110 none).]]
118 } 111 }
112 return: bool; [[$true on success, $false otherwise]]
119 } 113 }
120 } 114 }
121} 115}