summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/lib/edje/Edje_Eo.h14
-rw-r--r--src/lib/edje/Edje_Legacy.h36
-rw-r--r--src/lib/edje/edje_cache.c30
-rw-r--r--src/lib/edje/edje_load.c79
-rw-r--r--src/lib/edje/edje_private.h5
-rw-r--r--src/lib/edje/edje_smart.c29
8 files changed, 145 insertions, 53 deletions
diff --git a/ChangeLog b/ChangeLog
index 4d4b51852b..4be775c02a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12013-08-09 Cedric Bail
2
3 * Edje: add edje_object_mmap_set().
4
12013-08-08 Tom Hacohen 52013-08-08 Tom Hacohen
2 6
3 * Evas textblock: Make the ellipsis format the same as the surrounding. 7 * Evas textblock: Make the ellipsis format the same as the surrounding.
diff --git a/NEWS b/NEWS
index c717434883..0790089c06 100644
--- a/NEWS
+++ b/NEWS
@@ -128,6 +128,7 @@ Additions:
128 - support edc map color set 128 - support edc map color set
129 - Add threshold support to Edje draggable part. 129 - Add threshold support to Edje draggable part.
130 - Reduce load time of Edje_Object using Evas_Object_Textblock and many styles. 130 - Reduce load time of Edje_Object using Evas_Object_Textblock and many styles.
131 - Add edje_object_mmap_set.
131 * Eeze: 132 * Eeze:
132 - Add a dummy libmount replacement for when libmount is not there. 133 - Add a dummy libmount replacement for when libmount is not there.
133 * Ecore_Con: 134 * Ecore_Con:
diff --git a/src/lib/edje/Edje_Eo.h b/src/lib/edje/Edje_Eo.h
index 941aee4bb8..6678a96d02 100644
--- a/src/lib/edje/Edje_Eo.h
+++ b/src/lib/edje/Edje_Eo.h
@@ -132,6 +132,7 @@ enum
132 EDJE_OBJ_SUB_ID_PART_EXTERNAL_PARAM_TYPE_GET, 132 EDJE_OBJ_SUB_ID_PART_EXTERNAL_PARAM_TYPE_GET,
133 133
134 EDJE_OBJ_SUB_ID_FILE_SET, 134 EDJE_OBJ_SUB_ID_FILE_SET,
135 EDJE_OBJ_SUB_ID_MMAP_SET,
135 EDJE_OBJ_SUB_ID_FILE_GET, 136 EDJE_OBJ_SUB_ID_FILE_GET,
136 EDJE_OBJ_SUB_ID_LOAD_ERROR_GET, 137 EDJE_OBJ_SUB_ID_LOAD_ERROR_GET,
137 138
@@ -612,6 +613,19 @@ enum
612#define edje_obj_file_set(file, group, ret) EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_FILE_SET), EO_TYPECHECK(const char*, file), EO_TYPECHECK(const char *, group), EO_TYPECHECK(Eina_Bool *, ret) 613#define edje_obj_file_set(file, group, ret) EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_FILE_SET), EO_TYPECHECK(const char*, file), EO_TYPECHECK(const char *, group), EO_TYPECHECK(Eina_Bool *, ret)
613 614
614/** 615/**
616 * @def edje_obj_mmap_set
617 * @since 1.8
618 *
619 * @param[in] file in
620 * @param[in] group in
621 * @param[in] nested in
622 * @param[out] ret out
623 *
624 * @see edje_object_file_set
625 */
626#define edje_obj_mmap_set(file, group, ret) EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_MMAP_SET), EO_TYPECHECK(Eina_File*, file), EO_TYPECHECK(const char *, group), EO_TYPECHECK(Eina_Bool *, ret)
627
628/**
615 * @def edje_obj_file_get 629 * @def edje_obj_file_get
616 * @since 1.8 630 * @since 1.8
617 * 631 *
diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h
index 3b0ccabb3c..196e498a39 100644
--- a/src/lib/edje/Edje_Legacy.h
+++ b/src/lib/edje/Edje_Legacy.h
@@ -1770,10 +1770,46 @@ EAPI const char *edje_object_data_get (const Evas_Object *obj, const
1770 * 1770 *
1771 * @see edje_object_add() 1771 * @see edje_object_add()
1772 * @see edje_object_file_get() 1772 * @see edje_object_file_get()
1773 * @see edje_object_mmap_set()
1773 */ 1774 */
1774EAPI Eina_Bool edje_object_file_set (Evas_Object *obj, const char *file, const char *group); 1775EAPI Eina_Bool edje_object_file_set (Evas_Object *obj, const char *file, const char *group);
1775 1776
1776/** 1777/**
1778 * @brief Sets the @b EDJ file (and group within it) to load an Edje
1779 * object's contents from
1780 *
1781 * @param obj A handle to an Edje object
1782 * @param file The Eina_File pointing to the EDJ file to load @p from
1783 * @param group The name of the group, in @p file, which implements an
1784 * Edje object
1785 * @return @c EINA_TRUE, on success or @c EINA_FALSE, on errors (check
1786 * edje_object_load_error_get() after this call to get errors causes)
1787 *
1788 * Edje expects EDJ files, which are theming objects' descriptions and
1789 * resources packed together in an EET file, to read Edje object
1790 * definitions from. They usually are created with the @c .edj
1791 * extension. EDJ files, in turn, are assembled from @b textual object
1792 * description files, where one describes Edje objects declaratively
1793 * -- the EDC files (see @ref edcref "the syntax" for those files).
1794 *
1795 * Those description files were designed so that many Edje object
1796 * definitions -- also called @b groups (or collections) -- could be
1797 * packed together <b>in the same EDJ file</b>, so that a whole
1798 * application's theme could be packed in one file only. This is the
1799 * reason for the @p group argument.
1800 *
1801 * Use this function after you instantiate a new Edje object, so that
1802 * you can "give him life", telling where to get its contents from.
1803 *
1804 * @see edje_object_add()
1805 * @see edje_object_file_get()
1806 * @see edje_object_mmap_set()
1807 * @since 1.8
1808 */
1809EAPI Eina_Bool edje_object_mmap_set(Evas_Object *obj, Eina_File *file, const char *group);
1810
1811
1812/**
1777 * @brief Get the file and group name that a given Edje object is bound to 1813 * @brief Get the file and group name that a given Edje object is bound to
1778 * 1814 *
1779 * @param obj A handle to an Edje object 1815 * @param obj A handle to an Edje object
diff --git a/src/lib/edje/edje_cache.c b/src/lib/edje/edje_cache.c
index aa7e075c5d..100ca556d3 100644
--- a/src/lib/edje/edje_cache.c
+++ b/src/lib/edje/edje_cache.c
@@ -399,32 +399,22 @@ _edje_file_dangling(Edje_File *edf)
399#endif 399#endif
400 400
401Edje_File * 401Edje_File *
402_edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret, Edje *ed) 402_edje_cache_file_coll_open(Eina_File *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret, Edje *ed)
403{ 403{
404 Eina_File *f;
405 Edje_File *edf; 404 Edje_File *edf;
406 Eina_List *l, *hist; 405 Eina_List *l, *hist;
407 Edje_Part_Collection *edc; 406 Edje_Part_Collection *edc;
408 Edje_Part *ep; 407 Edje_Part *ep;
409 408
410 f = eina_file_open(file, EINA_FALSE);
411 if (!f)
412 {
413 *error_ret = EDJE_LOAD_ERROR_DOES_NOT_EXIST;
414 return NULL;
415 }
416
417 if (!_edje_file_hash) 409 if (!_edje_file_hash)
418 { 410 {
419 _edje_file_hash = eina_hash_pointer_new(NULL); 411 _edje_file_hash = eina_hash_pointer_new(NULL);
420 goto find_list; 412 goto find_list;
421 } 413 }
422 414
423 edf = eina_hash_find(_edje_file_hash, f); 415 edf = eina_hash_find(_edje_file_hash, file);
424 if (edf) 416 if (edf)
425 { 417 {
426 eina_file_close(f);
427
428 edf->references++; 418 edf->references++;
429 goto open; 419 goto open;
430 } 420 }
@@ -432,23 +422,17 @@ _edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, E
432find_list: 422find_list:
433 EINA_LIST_FOREACH(_edje_file_cache, l, edf) 423 EINA_LIST_FOREACH(_edje_file_cache, l, edf)
434 { 424 {
435 if (edf->f == f) 425 if (edf->f == file)
436 { 426 {
437 eina_file_close(f);
438
439 edf->references = 1; 427 edf->references = 1;
440 _edje_file_cache = eina_list_remove_list(_edje_file_cache, l); 428 _edje_file_cache = eina_list_remove_list(_edje_file_cache, l);
441 eina_hash_direct_add(_edje_file_hash, f, edf); 429 eina_hash_direct_add(_edje_file_hash, file, edf);
442 goto open; 430 goto open;
443 } 431 }
444 } 432 }
445 433
446 edf = _edje_file_open(f, coll, error_ret, edc_ret, eina_file_mtime_get(f)); 434 edf = _edje_file_open(file, coll, error_ret, edc_ret, eina_file_mtime_get(file));
447 if (!edf) 435 if (!edf) return NULL;
448 {
449 eina_file_close(f);
450 return NULL;
451 }
452 436
453#ifdef HAVE_EIO 437#ifdef HAVE_EIO
454 if (ed) edf->edjes = eina_list_append(edf->edjes, ed); 438 if (ed) edf->edjes = eina_list_append(edf->edjes, ed);
@@ -456,7 +440,7 @@ find_list:
456 (void) ed; 440 (void) ed;
457#endif 441#endif
458 442
459 eina_hash_direct_add(_edje_file_hash, f, edf); 443 eina_hash_direct_add(_edje_file_hash, file, edf);
460 /* return edf; */ 444 /* return edf; */
461 445
462open: 446open:
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index 331dab57be..a65dbd5332 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -24,6 +24,8 @@ struct _Edje_Drag_Items
24 } page; 24 } page;
25}; 25};
26 26
27void _edje_file_add(Edje *ed, Eina_File *f);
28
27/* START - Nested part support */ 29/* START - Nested part support */
28#define _edje_smart_nested_type "Evas_Smart_Nested" 30#define _edje_smart_nested_type "Evas_Smart_Nested"
29typedef struct _Edje_Nested_Support Edje_Nested_Support; 31typedef struct _Edje_Nested_Support Edje_Nested_Support;
@@ -80,6 +82,16 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *group)
80 return ret; 82 return ret;
81} 83}
82 84
85EAPI Eina_Bool
86edje_object_mmap_set(Evas_Object *obj, Eina_File *file, const char *group)
87{
88 if (!obj) return EINA_FALSE;
89 Eina_Bool ret = EINA_FALSE;
90
91 eo_do(obj, edje_obj_mmap_set(file, group, &ret));
92 return ret;
93}
94
83EAPI void 95EAPI void
84edje_object_file_get(const Evas_Object *obj, const char **file, const char **group) 96edje_object_file_get(const Evas_Object *obj, const char **file, const char **group)
85{ 97{
@@ -149,11 +161,14 @@ EAPI Eina_List *
149edje_file_collection_list(const char *file) 161edje_file_collection_list(const char *file)
150{ 162{
151 Eina_List *lst = NULL; 163 Eina_List *lst = NULL;
164 Eina_File *f;
152 Edje_File *edf; 165 Edje_File *edf;
153 int error_ret = 0; 166 int error_ret = 0;
154 167
155 if ((!file) || (!*file)) return NULL; 168 if ((!file) || (!*file)) return NULL;
156 edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL, NULL); 169 f = eina_file_open(file, EINA_FALSE);
170 if (!f) return NULL;
171 edf = _edje_cache_file_coll_open(f, NULL, &error_ret, NULL, NULL);
157 if (edf) 172 if (edf)
158 { 173 {
159 Eina_Iterator *i; 174 Eina_Iterator *i;
@@ -168,6 +183,7 @@ edje_file_collection_list(const char *file)
168 183
169 _edje_cache_file_unref(edf); 184 _edje_cache_file_unref(edf);
170 } 185 }
186 eina_file_close(f);
171 return lst; 187 return lst;
172} 188}
173 189
@@ -185,6 +201,7 @@ EAPI Eina_Bool
185edje_file_group_exists(const char *file, const char *glob) 201edje_file_group_exists(const char *file, const char *glob)
186{ 202{
187 Edje_File *edf; 203 Edje_File *edf;
204 Eina_File *f;
188 int error_ret = 0; 205 int error_ret = 0;
189 Eina_Bool succeed = EINA_FALSE; 206 Eina_Bool succeed = EINA_FALSE;
190 Eina_Bool is_glob = EINA_FALSE; 207 Eina_Bool is_glob = EINA_FALSE;
@@ -193,9 +210,11 @@ edje_file_group_exists(const char *file, const char *glob)
193 if ((!file) || (!*file) || (!glob)) 210 if ((!file) || (!*file) || (!glob))
194 return EINA_FALSE; 211 return EINA_FALSE;
195 212
196 edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL, NULL); 213 f = eina_file_open(file, EINA_FALSE);
197 if (!edf) 214 if (!f) return EINA_FALSE;
198 return EINA_FALSE; 215
216 edf = _edje_cache_file_coll_open(f, NULL, &error_ret, NULL, NULL);
217 if (!edf) goto on_error;
199 218
200 for (p = glob; *p; p++) 219 for (p = glob; *p; p++)
201 { 220 {
@@ -240,6 +259,8 @@ edje_file_group_exists(const char *file, const char *glob)
240 259
241 DBG("edje_file_group_exists: '%s', '%s': %i.", file, glob, succeed); 260 DBG("edje_file_group_exists: '%s', '%s': %i.", file, glob, succeed);
242 261
262 on_error:
263 eina_file_close(f);
243 return succeed; 264 return succeed;
244} 265}
245 266
@@ -248,12 +269,16 @@ EAPI char *
248edje_file_data_get(const char *file, const char *key) 269edje_file_data_get(const char *file, const char *key)
249{ 270{
250 Edje_File *edf; 271 Edje_File *edf;
272 Eina_File *f;
251 char *str = NULL; 273 char *str = NULL;
252 int error_ret = 0; 274 int error_ret = 0;
253 275
254 if (key) 276 if (key)
255 { 277 {
256 edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL, NULL); 278 f = eina_file_open(file, EINA_FALSE);
279 if (!f) return NULL;
280
281 edf = _edje_cache_file_coll_open(f, NULL, &error_ret, NULL, NULL);
257 if (edf) 282 if (edf)
258 { 283 {
259 str = (char*) edje_string_get(eina_hash_find(edf->data, key)); 284 str = (char*) edje_string_get(eina_hash_find(edf->data, key));
@@ -262,6 +287,8 @@ edje_file_data_get(const char *file, const char *key)
262 287
263 _edje_cache_file_unref(edf); 288 _edje_cache_file_unref(edf);
264 } 289 }
290
291 eina_file_close(f);
265 } 292 }
266 return str; 293 return str;
267} 294}
@@ -290,7 +317,7 @@ _edje_physics_world_update_cb(void *data, EPhysics_World *world EINA_UNUSED, voi
290#endif 317#endif
291 318
292int 319int
293_edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *group, const char *parent, Eina_List *group_path, Eina_Array *nested) 320_edje_object_file_set_internal(Evas_Object *obj, Eina_File *file, const char *group, const char *parent, Eina_List *group_path, Eina_Array *nested)
294{ 321{
295 Edje *ed; 322 Edje *ed;
296 Evas *tev; 323 Evas *tev;
@@ -310,18 +337,11 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
310 337
311 ed = _edje_fetch(obj); 338 ed = _edje_fetch(obj);
312 if (!ed) return 0; 339 if (!ed) return 0;
313 if (!file) file = "";
314 if (!group) group = ""; 340 if (!group) group = "";
315 if (((ed->path) && (!strcmp(file, ed->path))) && 341 if ((ed->file) && (ed->file->f == file) &&
316 (ed->group) && (!strcmp(group, ed->group)) && 342 (ed->group) && (!strcmp(group, ed->group)))
317 ed->file)
318 { 343 {
319 struct stat st; 344 return 1;
320
321 if (stat(file, &st) != 0)
322 return 1;
323 if (st.st_mtime == ed->file->mtime)
324 return 1;
325 } 345 }
326 346
327 tev = evas_object_evas_get(obj); 347 tev = evas_object_evas_get(obj);
@@ -343,13 +363,13 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
343 363
344 _edje_file_del(ed); 364 _edje_file_del(ed);
345 365
346 eina_stringshare_replace(&ed->path, file); 366 eina_stringshare_replace(&ed->path, file ? eina_file_filename_get(file) : NULL);
347 eina_stringshare_replace(&ed->group, group); 367 eina_stringshare_replace(&ed->group, group);
348 368
349 ed->parent = eina_stringshare_add(parent); 369 ed->parent = eina_stringshare_add(parent);
350 370
351 ed->load_error = EDJE_LOAD_ERROR_NONE; 371 ed->load_error = EDJE_LOAD_ERROR_NONE;
352 _edje_file_add(ed); 372 _edje_file_add(ed, file);
353 ed->block_break = EINA_FALSE; 373 ed->block_break = EINA_FALSE;
354 374
355 if (ed->file && ed->file->external_dir) 375 if (ed->file && ed->file->external_dir)
@@ -567,7 +587,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
567 break; 587 break;
568 case EDJE_PART_TYPE_GRADIENT: 588 case EDJE_PART_TYPE_GRADIENT:
569 ERR("SPANK ! SPANK ! SPANK ! YOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !! THEY ARE NOW REMOVED !", 589 ERR("SPANK ! SPANK ! SPANK ! YOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !! THEY ARE NOW REMOVED !",
570 ep->name, group, file); 590 ep->name, group, eina_file_filename_get(file));
571 break; 591 break;
572 case EDJE_PART_TYPE_SPACER: 592 case EDJE_PART_TYPE_SPACER:
573 rp->object = NULL; 593 rp->object = NULL;
@@ -834,7 +854,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
834 if (data == group_path_entry) 854 if (data == group_path_entry)
835 { 855 {
836 ERR("recursive loop group '%s' already included inside part '%s' of group '%s' from file '%s'", 856 ERR("recursive loop group '%s' already included inside part '%s' of group '%s' from file '%s'",
837 group_path_entry, rp->part->name, group, file); 857 group_path_entry, rp->part->name, group, eina_file_filename_get(file));
838 ed->load_error = EDJE_LOAD_ERROR_RECURSIVE_REFERENCE; 858 ed->load_error = EDJE_LOAD_ERROR_RECURSIVE_REFERENCE;
839 eina_stringshare_del(group_path_entry); 859 eina_stringshare_del(group_path_entry);
840 goto on_error; 860 goto on_error;
@@ -862,7 +882,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
862 if (!_edje_object_file_set_internal(child_obj, file, source, rp->part->name, group_path, nested)) 882 if (!_edje_object_file_set_internal(child_obj, file, source, rp->part->name, group_path, nested))
863 { 883 {
864 ERR("impossible to set part '%s' of group '%s' from file '%s' to '%s'", 884 ERR("impossible to set part '%s' of group '%s' from file '%s' to '%s'",
865 rp->part->name, group_path_entry, file, source); 885 rp->part->name, group_path_entry, eina_file_filename_get(file), source);
866 ed->load_error = edje_object_load_error_get(child_obj); 886 ed->load_error = edje_object_load_error_get(child_obj);
867 evas_object_del(child_obj); 887 evas_object_del(child_obj);
868 eina_stringshare_del(group_path_entry); 888 eina_stringshare_del(group_path_entry);
@@ -1106,13 +1126,20 @@ on_error:
1106} 1126}
1107 1127
1108void 1128void
1109_edje_file_add(Edje *ed) 1129_edje_file_add(Edje *ed, Eina_File *f)
1110{ 1130{
1111 if (!_edje_edd_edje_file) return; 1131 if (!_edje_edd_edje_file) return;
1112 ed->file = _edje_cache_file_coll_open(ed->path, ed->group, 1132 if (!f)
1113 &(ed->load_error), 1133 {
1114 &(ed->collection), 1134 ed->load_error = EDJE_LOAD_ERROR_DOES_NOT_EXIST;
1115 ed); 1135 }
1136 else
1137 {
1138 ed->file = _edje_cache_file_coll_open(f, ed->group,
1139 &(ed->load_error),
1140 &(ed->collection),
1141 ed);
1142 }
1116 1143
1117 if (!ed->collection) 1144 if (!ed->collection)
1118 { 1145 {
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index b29b469b79..608aa01ccf 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -1967,9 +1967,8 @@ void *_edje_signal_callback_disable(const Edje_Signal_Callback_Group *cgp,
1967EAPI void _edje_edd_init(void); 1967EAPI void _edje_edd_init(void);
1968EAPI void _edje_edd_shutdown(void); 1968EAPI void _edje_edd_shutdown(void);
1969 1969
1970int _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *group, const char *parent, Eina_List *group_path, Eina_Array *nested); 1970int _edje_object_file_set_internal(Evas_Object *obj, Eina_File *file, const char *group, const char *parent, Eina_List *group_path, Eina_Array *nested);
1971 1971
1972void _edje_file_add(Edje *ed);
1973void _edje_file_del(Edje *ed); 1972void _edje_file_del(Edje *ed);
1974void _edje_file_free(Edje_File *edf); 1973void _edje_file_free(Edje_File *edf);
1975void _edje_file_cache_shutdown(void); 1974void _edje_file_cache_shutdown(void);
@@ -2150,7 +2149,7 @@ void _edje_textblock_styles_del(Edje *ed);
2150void _edje_textblock_style_all_update(Edje *ed); 2149void _edje_textblock_style_all_update(Edje *ed);
2151void _edje_textblock_style_parse_and_fix(Edje_File *edf); 2150void _edje_textblock_style_parse_and_fix(Edje_File *edf);
2152void _edje_textblock_style_cleanup(Edje_File *edf); 2151void _edje_textblock_style_cleanup(Edje_File *edf);
2153Edje_File *_edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret, Edje *ed); 2152Edje_File *_edje_cache_file_coll_open(Eina_File *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret, Edje *ed);
2154void _edje_cache_coll_clean(Edje_File *edf); 2153void _edje_cache_coll_clean(Edje_File *edf);
2155void _edje_cache_coll_flush(Edje_File *edf); 2154void _edje_cache_coll_flush(Edje_File *edf);
2156void _edje_cache_coll_unref(Edje_File *edf, Edje_Part_Collection *edc); 2155void _edje_cache_coll_unref(Edje_File *edf, Edje_Part_Collection *edc);
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index e4590fb396..b692a5aba5 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -333,12 +333,37 @@ _edje_smart_file_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
333 const char *file = va_arg(*list, const char *); 333 const char *file = va_arg(*list, const char *);
334 const char *group = va_arg(*list, const char *); 334 const char *group = va_arg(*list, const char *);
335 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 335 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
336 Eina_File *f;
336 Eina_Array *nested; 337 Eina_Array *nested;
338
337 if (ret) *ret = EINA_FALSE; 339 if (ret) *ret = EINA_FALSE;
338 340
341 f = eina_file_open(file, EINA_FALSE);
339 nested = eina_array_new(8); 342 nested = eina_array_new(8);
340 if (_edje_object_file_set_internal(obj, file, group, NULL, NULL, nested)) 343
344 if (_edje_object_file_set_internal(obj, f, group, NULL, NULL, nested))
341 if (ret) *ret = EINA_TRUE; 345 if (ret) *ret = EINA_TRUE;
346
347 eina_array_free(nested);
348 eina_file_close(f);
349 _edje_object_orientation_inform(obj);
350}
351
352static void
353_edje_smart_mmap_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
354{
355 Eina_File *f = va_arg(*list, Eina_File *);
356 const char *group = va_arg(*list, const char *);
357 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
358 Eina_Array *nested;
359
360 if (ret) *ret = EINA_FALSE;
361
362 nested = eina_array_new(8);
363
364 if (_edje_object_file_set_internal(obj, f, group, NULL, NULL, nested))
365 if (ret) *ret = EINA_TRUE;
366
342 eina_array_free(nested); 367 eina_array_free(nested);
343 _edje_object_orientation_inform(obj); 368 _edje_object_orientation_inform(obj);
344} 369}
@@ -481,6 +506,7 @@ _edje_smart_class_constructor(Eo_Class *klass)
481 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_EXTERNAL_CONTENT_GET), _part_external_content_get), 506 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_EXTERNAL_CONTENT_GET), _part_external_content_get),
482 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_EXTERNAL_PARAM_TYPE_GET), _part_external_param_type_get), 507 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_EXTERNAL_PARAM_TYPE_GET), _part_external_param_type_get),
483 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_FILE_SET), _edje_smart_file_set), 508 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_FILE_SET), _edje_smart_file_set),
509 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_MMAP_SET), _edje_smart_mmap_set),
484 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_FILE_GET), _file_get), 510 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_FILE_GET), _file_get),
485 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_LOAD_ERROR_GET), _load_error_get), 511 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_LOAD_ERROR_GET), _load_error_get),
486 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_MESSAGE_SEND), _message_send), 512 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_MESSAGE_SEND), _message_send),
@@ -626,6 +652,7 @@ static const Eo_Op_Description op_desc[] = {
626 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_EXTERNAL_CONTENT_GET, "Get an object contained in an part of type EXTERNAL"), 652 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_EXTERNAL_CONTENT_GET, "Get an object contained in an part of type EXTERNAL"),
627 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_EXTERNAL_PARAM_TYPE_GET, "Facility to query the type of the given parameter of the given part."), 653 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_EXTERNAL_PARAM_TYPE_GET, "Facility to query the type of the given parameter of the given part."),
628 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_FILE_SET, "Sets the @b EDJ file (and group within it) to load an Edje"), 654 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_FILE_SET, "Sets the @b EDJ file (and group within it) to load an Edje"),
655 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_MMAP_SET, "Sets the @b EDJ file (and group within it) to load an Edje"),
629 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_FILE_GET, "Get the file and group name that a given Edje object is bound to"), 656 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_FILE_GET, "Get the file and group name that a given Edje object is bound to"),
630 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_LOAD_ERROR_GET, "Gets the (last) file loading error for a given Edje object"), 657 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_LOAD_ERROR_GET, "Gets the (last) file loading error for a given Edje object"),
631 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_MESSAGE_SEND, "Send an (Edje) message to a given Edje object"), 658 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_MESSAGE_SEND, "Send an (Edje) message to a given Edje object"),