summaryrefslogtreecommitdiff
path: root/src/lib/edje
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-09-12 17:21:32 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-12 17:27:02 +0900
commit8d7dc6ae241d9184764cfea3e18dd60223957ea2 (patch)
tree83fa7b33efa076e1d447d1ece860351dd2e5c157 /src/lib/edje
parent9c78628908c8db332378a097f86174b5634a89f9 (diff)
edje: Add legacy compatibility code
This affects: - edje_object_part_swallow - edje_object_part_swallow_get Fixes T5944 @fix
Diffstat (limited to 'src/lib/edje')
-rw-r--r--src/lib/edje/edje_util.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index 74d9dc4d9d..2c0249cec9 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -5989,9 +5989,34 @@ _edje_real_part_mask_flags_set(Edje *ed EINA_UNUSED, Edje_Real_Part *rp, Evas_Ev
5989 5989
5990/* Legacy APIs */ 5990/* Legacy APIs */
5991 5991
5992static inline Eina_Bool
5993_edje_part_fetch(const Edje_Object *obj, const char *part, Edje **ped, Edje_Real_Part **prp)
5994{
5995 if (!part) return EINA_FALSE;
5996
5997 *ped = _edje_fetch(obj);
5998 if (!*ped) return EINA_FALSE;
5999
6000 *prp = _edje_real_part_recursive_get(ped, part);
6001 if (!*prp) return EINA_FALSE;
6002
6003 return EINA_TRUE;
6004}
6005
5992EAPI Eina_Bool 6006EAPI Eina_Bool
5993edje_object_part_swallow(Edje_Object *obj, const char *part, Evas_Object *obj_swallow) 6007edje_object_part_swallow(Edje_Object *obj, const char *part, Evas_Object *obj_swallow)
5994{ 6008{
6009 Edje_Real_Part *rp;
6010 Edje *ed;
6011
6012 if (!_edje_part_fetch(obj, part, &ed, &rp)) return EINA_FALSE;
6013
6014 if (rp->part->type != EDJE_PART_TYPE_SWALLOW)
6015 {
6016 ERR("Invalid call on a non-swallow part: '%s' in group '%s'", part, ed->group);
6017 return EINA_FALSE;
6018 }
6019
5995 return efl_content_set(efl_part(obj, part), obj_swallow); 6020 return efl_content_set(efl_part(obj, part), obj_swallow);
5996} 6021}
5997 6022
@@ -6004,6 +6029,24 @@ edje_object_part_unswallow(Edje_Object *obj, Evas_Object *obj_swallow)
6004EAPI Evas_Object * 6029EAPI Evas_Object *
6005edje_object_part_swallow_get(const Edje_Object *obj, const char *part) 6030edje_object_part_swallow_get(const Edje_Object *obj, const char *part)
6006{ 6031{
6032 Edje_Real_Part *rp;
6033 Edje *ed;
6034
6035 if (!_edje_part_fetch(obj, part, &ed, &rp)) return NULL;
6036
6037 if (rp->part->type != EDJE_PART_TYPE_SWALLOW)
6038 {
6039 // Legacy compatibility: return swallowed_object on non-swallow parts
6040 if ((rp->type == EDJE_RP_TYPE_SWALLOW) && rp->typedata.swallow)
6041 {
6042 INF("Part is not a swallow: '%s' in group '%s'", part, ed->group);
6043 return rp->typedata.swallow->swallowed_object;
6044 }
6045
6046 ERR("Invalid call on a non-swallow part: '%s' in group '%s'", part, ed->group);
6047 return NULL;
6048 }
6049
6007 return efl_content_get(efl_part(obj, part)); 6050 return efl_content_get(efl_part(obj, part));
6008} 6051}
6009 6052