From 49b72fa7718db3ad207d85fc3559abc3f558e20a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=84=9C=EC=A3=BC=EC=98=81?= Date: Thu, 7 Oct 2010 06:45:36 +0000 Subject: [PATCH] =?UTF-8?q?From:=20=EC=84=9C=EC=A3=BC=EC=98=81=20=20Subject:=20[EFL]=20Small=20Patch=20for=20Genl?= =?UTF-8?q?ist=20:=20elm=5Fgenlist=5Fitem=5Fexpanded=5Fdepth=5Fget()=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I added one API to genlist : elm_genlist_item_expanded_depth_get(). This is used to get an item's expanded depth. I tested this with latest SVN revision 53090. Can you review this patch and apply this to upstream? SVN revision: 53134 --- legacy/elementary/src/lib/Elementary.h.in | 1 + legacy/elementary/src/lib/elm_genlist.c | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/legacy/elementary/src/lib/Elementary.h.in b/legacy/elementary/src/lib/Elementary.h.in index 6b8a3625d8..5403e82452 100644 --- a/legacy/elementary/src/lib/Elementary.h.in +++ b/legacy/elementary/src/lib/Elementary.h.in @@ -1314,6 +1314,7 @@ extern "C" { EAPI Eina_Bool elm_genlist_item_selected_get(const Elm_Genlist_Item *item); EAPI void elm_genlist_item_expanded_set(Elm_Genlist_Item *item, Eina_Bool expanded); EAPI Eina_Bool elm_genlist_item_expanded_get(const Elm_Genlist_Item *item); + EAPI int elm_genlist_item_expanded_depth_get(Elm_Genlist_Item *it); EAPI void elm_genlist_item_disabled_set(Elm_Genlist_Item *item, Eina_Bool disabled); EAPI Eina_Bool elm_genlist_item_disabled_get(const Elm_Genlist_Item *item); EAPI void elm_genlist_item_display_only_set(Elm_Genlist_Item *it, Eina_Bool display_only); diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index 8c775e5cfa..28c3aa33d8 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/src/lib/elm_genlist.c @@ -310,8 +310,6 @@ struct _Elm_Genlist_Item Evas_Coord dx, dy; Elm_Genlist_Item *rel; - int relcount; - int walking; struct { @@ -323,6 +321,10 @@ struct _Elm_Genlist_Item const char *mouse_cursor; + int relcount; + int walking; + int expanded_depth; + Eina_Bool before : 1; Eina_Bool want_unrealize : 1; @@ -1081,6 +1083,7 @@ _item_realize(Elm_Genlist_Item *it, int in, int calc) evas_object_color_set(it->spacer, 0, 0, 0, 0); elm_widget_sub_object_add(it->base.widget, it->spacer); for (it2 = it, depth = 0; it2->parent; it2 = it2->parent) depth += 1; + it->expanded_depth = depth; treesize = edje_object_data_get(it->base.view, "treesize"); if (treesize) tsize = atoi(treesize); evas_object_size_hint_min_set(it->spacer, @@ -1832,6 +1835,7 @@ _item_new(Widget_Data *wd, const Elm_Genlist_Item_Class *itc, it->func.func = func; it->func.data = func_data; it->mouse_cursor = NULL; + it->expanded_depth = 0; return it; } @@ -2742,6 +2746,21 @@ elm_genlist_item_expanded_get(const Elm_Genlist_Item *it) return it->expanded; } +/** + * Get the depth of expanded item + * + * @param it The genlist item object + * @return The depth of expanded item + * + * @ingroup Genlist + */ +EAPI int +elm_genlist_item_expanded_depth_get(Elm_Genlist_Item *it) +{ + if (!it) return 0; + return it->expanded_depth; +} + /** * Sets the disabled state of an item. *