From ac0055db7eefd314f26532cbb4599361c1a1086f Mon Sep 17 00:00:00 2001 From: moom Date: Thu, 3 Aug 2006 02:14:53 +0000 Subject: [PATCH] * Add evas_object_smart_parent_get() to get the smart parent of an Evas_Object * Add evas_object_smart_members_get() to get a list of the member objects of a smart object SVN revision: 24374 --- legacy/evas/src/lib/Evas.h | 2 + .../evas/src/lib/canvas/evas_object_smart.c | 38 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/legacy/evas/src/lib/Evas.h b/legacy/evas/src/lib/Evas.h index 8d0bb11c27..f7de1d065e 100644 --- a/legacy/evas/src/lib/Evas.h +++ b/legacy/evas/src/lib/Evas.h @@ -660,6 +660,8 @@ tile_mode); EAPI Evas_Object *evas_object_smart_add (Evas *e, Evas_Smart *s); EAPI void evas_object_smart_member_add (Evas_Object *obj, Evas_Object *smart_obj); EAPI void evas_object_smart_member_del (Evas_Object *obj); + EAPI Evas_Object *evas_object_smart_parent_get (Evas_Object *obj); + EAPI Evas_List *evas_object_smart_members_get (Evas_Object *obj); EAPI Evas_Smart *evas_object_smart_smart_get (Evas_Object *obj); EAPI void *evas_object_smart_data_get (Evas_Object *obj); EAPI void evas_object_smart_data_set (Evas_Object *obj, void *data); diff --git a/legacy/evas/src/lib/canvas/evas_object_smart.c b/legacy/evas/src/lib/canvas/evas_object_smart.c index d37023925b..0b6462a9b9 100644 --- a/legacy/evas/src/lib/canvas/evas_object_smart.c +++ b/legacy/evas/src/lib/canvas/evas_object_smart.c @@ -183,6 +183,44 @@ evas_object_smart_member_del(Evas_Object *obj) evas_object_change(obj); } +/** + * Gets the smart parent of an Evas_Object + * @param obj the Evas_Object you want to get the parent + * @return Returns the smart parent of @a obj, or NULL if @a obj is not a smart member of another Evas_Object + */ +EAPI Evas_Object * +evas_object_smart_parent_get(Evas_Object *obj) +{ + MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); + return NULL; + MAGIC_CHECK_END(); + + return obj->smart.parent; +} + +/** + * Gets the list of the member objects of an Evas_Object + * @param obj the Evas_Object you want to get the list of member objects + * @return Returns the list of the member objects of @a obj. + * The returned list should be freed with evas_list_free() when you no longer need it + */ +EAPI Evas_List * +evas_object_smart_members_get(Evas_Object *obj) +{ + Evas_List *members; + Evas_Object_List *member; + + MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); + return NULL; + MAGIC_CHECK_END(); + + members = NULL; + for (member = obj->smart.contained; member; member = member->next) + members = evas_list_append(members, member); + + return members; +} + /** * To be documented. *