From e64bfe7cf1f129f8a532771e48f10e75fe3c1525 Mon Sep 17 00:00:00 2001 From: Seunggyun Kim 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. SVN revision: 58403 --- legacy/elementary/src/lib/Elementary.h.in | 1 + legacy/elementary/src/lib/elm_genlist.c | 25 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/legacy/elementary/src/lib/Elementary.h.in b/legacy/elementary/src/lib/Elementary.h.in index 5c45feffa3..e4c3ca5d19 100644 --- a/legacy/elementary/src/lib/Elementary.h.in +++ b/legacy/elementary/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/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index 38ee1ed742..c8c2a17b41 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/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); +} + +