From 9575bc8f8b50d1958efca604142dca65d93e7019 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Mon, 29 May 2017 22:33:28 +0900 Subject: [PATCH] edje: Remove external_object_get from EO This will be replaced by a trick: composition on the part object itself! --- src/lib/edje/Edje_Legacy.h | 23 +++++++++++++++++++++++ src/lib/edje/edje_external.c | 4 ++-- src/lib/edje/edje_legacy.c | 7 +++++++ src/lib/edje/edje_object.eo | 21 --------------------- src/lib/edje/edje_private.h | 1 + 5 files changed, 33 insertions(+), 23 deletions(-) diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h index 70fccb5..3a802d4 100644 --- a/src/lib/edje/Edje_Legacy.h +++ b/src/lib/edje/Edje_Legacy.h @@ -481,6 +481,29 @@ EAPI Eina_Bool edje_object_part_external_param_set(Edje_Object *obj, const char EAPI Eina_Bool edje_object_part_external_param_get(const Edje_Object *obj, const char *part, Edje_External_Param *param); /** + * @brief Gets the object created by this external part. + * + * Parts of type external creates the part object using information provided by + * external plugins. It's somehow like "swallow" (edje_object_part_swallow()), + * but it's all set automatically. + * + * This function returns the part created by such external plugins and being + * currently managed by this Edje. + * + * @note Almost all swallow rules apply: you should not move, resize, hide, + * show, set the color or clipper of such part. It's a bit more restrictive as + * one must never delete this object! + * + * @param[in] part The part name + * + * @return The externally created object, or @c null if there is none or part + * is not an external. + * + * @ingroup Edje_Object + */ +EAPI Evas_Object *edje_object_part_external_object_get(const Edje_Object *obj, const char * part); + +/** * @brief Gets an object contained in an part of type EXTERNAL * * The content string must not be @c null. Its actual value depends on the code diff --git a/src/lib/edje/edje_external.c b/src/lib/edje/edje_external.c index b067b5c..87ef983 100644 --- a/src/lib/edje/edje_external.c +++ b/src/lib/edje/edje_external.c @@ -28,8 +28,8 @@ edje_external_param_type_str(Edje_External_Param_Type type) } } -EOLIAN Evas_Object * -_edje_object_part_external_object_get(Eo *obj EINA_UNUSED, Edje *ed, const char *part) +Evas_Object * +_edje_object_part_external_object_get(Edje *ed, const char *part) { Edje_Real_Part *rp; diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c index 5bbb384..5773b58 100644 --- a/src/lib/edje/edje_legacy.c +++ b/src/lib/edje/edje_legacy.c @@ -119,6 +119,13 @@ edje_object_part_external_param_type_get(const Eo *obj, const char *part, const return _edje_object_part_external_param_type_get(ed, part, param); } +EAPI Evas_Object * +edje_object_part_external_object_get(const Edje_Object *obj, const char *part) +{ + Edje *ed = _edje_fetch(obj); + return _edje_object_part_external_object_get(ed, part); +} + /* Legacy only. Shall we deprecate this API? */ EAPI Evas_Object * edje_object_part_external_content_get(const Edje_Object *obj, const char *part, const char *content) diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo index 84482c5..7db36ce 100644 --- a/src/lib/edje/edje_object.eo +++ b/src/lib/edje/edje_object.eo @@ -1006,27 +1006,6 @@ class Edje.Object (Efl.Canvas.Group.Clipped, Efl.File, Efl.Container, Efl.Part, @in dy: double; [[The y step]] } } - @property part_external_object { - get { - [[Gets the object created by this external part. - - Parts of type external creates the part object using information - provided by external plugins. It's somehow like "swallow" - (edje_object_part_swallow()), but it's all set automatically. - - This function returns the part created by such external plugins and - being currently managed by this Edje. - - Note: Almost all swallow rules apply: you should not move, resize, - hide, show, set the color or clipper of such part. It's a bit - more restrictive as one must never delete this object!]] - return: Efl.Canvas.Object; [[The externally created object, or $null if there is none or - part is not an external.]] - } - keys { - part: string; [[The part name]] - } - } @property text_change_cb { set { [[Sets the object text callback. diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index 531ec16..347873a 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -3125,6 +3125,7 @@ Eo *_edje_external_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part Eina_Bool _edje_object_part_external_param_set(Edje *ed, const char *part, const Edje_External_Param *param); Eina_Bool _edje_object_part_external_param_get(Edje *ed, const char *part, Edje_External_Param *param); Edje_External_Param_Type _edje_object_part_external_param_type_get(Edje *ed, const char *part, const char *param); +Evas_Object *_edje_object_part_external_object_get(Edje *ed, const char *part); Evas_Object *_edje_object_part_external_content_get(Edje *ed, const char *part, const char *content); void _edje_internal_proxy_shutdown(void); -- 2.7.4