From acbaab5fa4d07a05597b4eb1cc9e8f409577dc53 Mon Sep 17 00:00:00 2001 From: raster Date: Thu, 7 Apr 2011 04:35:08 +0000 Subject: [PATCH] From: Seunggyun Kim Subject: [E-devel] [Patch] elm_genlist : elm_genlist_realized_items_update api added I added elm_genlist_realized_items_update api. elm_genlist_item_update api already exists. But If the application want to change all realized items using this api, application always have to check genlist all realized items and call elm_genlist_item_update api. This routine is being used at many functions of application. So I made elm_genlist_realized_items_update api. This helps application to update easily all realized items at a time. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@58403 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/Elementary.h.in | 1 + src/lib/elm_genlist.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 5c45fef..e4c3ca5 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -1844,6 +1844,7 @@ extern "C" { EAPI const char *elm_genlist_item_cursor_style_get(const Elm_Genlist_Item *item) EINA_ARG_NONNULL(1); EAPI void elm_genlist_item_cursor_engine_only_set(Elm_Genlist_Item *item, Eina_Bool engine_only) EINA_ARG_NONNULL(1); EAPI Eina_Bool elm_genlist_item_cursor_engine_only_get(const Elm_Genlist_Item *item) EINA_ARG_NONNULL(1); + EAPI void elm_genlist_realized_items_update(const Evas_Object *obj) EINA_ARG_NONNULL(1); /* smart callbacks called: * "clicked,double" - This is called when a user has double-clicked an item. The * event_info parameter is the genlist item that was double-clicked. diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index 38ee1ed..c8c2a17 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -4920,3 +4920,28 @@ elm_genlist_scroller_policy_get(const Evas_Object *obj, if (policy_v) *policy_v = (Elm_Scroller_Policy)s_policy_v; } +/** + * Update the contents of all realized items + * + * This updates all realized items by calling all the item class functions again + * to get the icons, labels and states. Use this when the original + * item data has changed and the changes are desired to be reflected. + * + * @param it The item + * + * @ingroup Genlist + */ +EAPI void +elm_genlist_realized_items_update(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype); + + Eina_List *list, *l; + Elm_Genlist_Item *it; + + list = elm_genlist_realized_items_get(obj); + EINA_LIST_FOREACH(list, l, it) + elm_genlist_item_update(it); +} + + -- 2.7.4