From 6225293d2ec7c82074cb2818487cd9ead06df863 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Wed, 29 Nov 2017 13:45:58 +0900 Subject: [PATCH] edje: Move "preload" to legacy only EO file API is still in flux, especially wrt. async loading. Let's just keep this in legacy for now. A few more patches and Edje.Object will reach its final form. Ref T5315 --- src/lib/edje/Edje_Legacy.h | 19 +++++++++++++++++++ src/lib/edje/edje_object.eo | 20 -------------------- src/lib/edje/edje_util.c | 6 ++++-- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h index edd30e2..018ef46 100644 --- a/src/lib/edje/Edje_Legacy.h +++ b/src/lib/edje/Edje_Legacy.h @@ -52,6 +52,25 @@ EAPI Evas_Object *edje_object_add (Evas *evas); /** + * @brief Preloads the images on the Edje Object in the background. + * + * This function requests the preload of all data images (on the given object) + * in the background. The work is queued before being processed (because there + * might be other pending requests of this type). It emits a signal + * "preload,done" when finished. + * + * @note Use @c true on scenarios where you don't need the image data preloaded + * anymore. + * + * @param[in] obj The object. + * @param[in] cancel @c false will add it the preloading work queue, @c true + * will remove it (if it was issued before). + * + * @return @c false if obj was not a valid Edje object otherwise @c true + */ +EAPI Eina_Bool edje_object_preload(Evas_Object *obj, Eina_Bool cancel); + +/** * @brief Adds a callback for an arriving Edje signal, emitted by a given Edje * object. * diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo index 99121aa..b8b83fe 100644 --- a/src/lib/edje/edje_object.eo +++ b/src/lib/edje/edje_object.eo @@ -66,26 +66,6 @@ class Edje.Object (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part, } } - // TODO: Legacy only. EO may rely on futures. - preload { - [[Preloads the images on the Edje Object in the background. - - This function requests the preload of all data images (on the given - object) in the background. The work is queued before being processed - (because there might be other pending requests of this type). - It emits a signal "preload,done" when finished. - - Note: Use $true on scenarios where you don't need - the image data preloaded anymore.]] - - return: bool; [[$false if obj was not a valid Edje object - otherwise $true]] - params { - @in cancel: bool; [[$false will add it the preloading work queue, - $true will remove it (if it was issued before).]] - } - } - access_part_iterate @beta { [[Iterates over all accessibility-enabled part names.]] legacy: null; diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index 9b43647..d26774b 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -4944,12 +4944,14 @@ _edje_object_perspective_get(Eo *obj EINA_UNUSED, Edje *ed) #define EDJE_PRELOAD_EMISSION "preload,done" #define EDJE_PRELOAD_SOURCE NULL -EOLIAN Eina_Bool -_edje_object_preload(Eo *obj, Edje *ed, Eina_Bool cancel) +EAPI Eina_Bool +edje_object_preload(Eo *obj, Eina_Bool cancel) { unsigned short count; unsigned short i; + Edje *ed; + ed = _edje_fetch(obj); if (!ed) return EINA_FALSE; _edje_recalc_do(ed); -- 2.7.4