summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2014-11-25 15:33:25 +0200
committerYakov Goldberg <yakov.g@samsung.com>2014-12-08 19:12:12 +0200
commit6b88d746eb0fac94e556407096a7322efc394f0c (patch)
treed7337d1abd92710551bb90fb5dd760b74c1ca5e9
parent61bcd12adee1988d310b0e876d0b13fc39fd65d1 (diff)
add API to get idx of an object packed into container
-rw-r--r--src/lib/gui_widget.c29
-rw-r--r--src/lib/gui_widget.h3
2 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/gui_widget.c b/src/lib/gui_widget.c
index 3467b1c..311998e 100644
--- a/src/lib/gui_widget.c
+++ b/src/lib/gui_widget.c
@@ -1756,6 +1756,35 @@ wdg_obj_container_item_get(const Gui_Widget *wdg, int idx, const char* name)
1756 return eina_list_nth(c->container_items, idx); 1756 return eina_list_nth(c->container_items, idx);
1757} 1757}
1758 1758
1759int
1760wdg_obj_container_item_idx_get(const Gui_Widget *wdg, Dep_Id *dep_id, Eina_Bool active_only)
1761{
1762 const Object_Container *c = wdg_obj_container_get(wdg);
1763 Object_Container_Item *ci;
1764 Eina_List *itr;
1765 int ret = -1, active = -1, all = -1;
1766
1767 EINA_LIST_FOREACH(c->container_items, itr, ci)
1768 {
1769 all++;
1770 if (wdg_get(ci->dep_id)) active++;
1771 if (dep_id == ci->dep_id)
1772 {
1773 if (active_only && wdg_get(ci->dep_id))
1774 {
1775 ret = active;
1776 break;
1777 }
1778 else if (!active_only)
1779 {
1780 ret = all;
1781 break;
1782 }
1783 }
1784 }
1785 return ret;
1786}
1787
1759Eina_Bool 1788Eina_Bool
1760wdg_obj_container_content_reorder(const Gui_Widget *wdg, int visual_idx, intptr_t dir_pos) 1789wdg_obj_container_content_reorder(const Gui_Widget *wdg, int visual_idx, intptr_t dir_pos)
1761{ 1790{
diff --git a/src/lib/gui_widget.h b/src/lib/gui_widget.h
index 0538bf6..fd656f2 100644
--- a/src/lib/gui_widget.h
+++ b/src/lib/gui_widget.h
@@ -455,6 +455,9 @@ wdg_obj_container_contents_list_get(const Gui_Widget *wdg);
455Object_Container_Item* 455Object_Container_Item*
456wdg_obj_container_item_get(const Gui_Widget *wdg, int idx, const char* name); 456wdg_obj_container_item_get(const Gui_Widget *wdg, int idx, const char* name);
457 457
458int
459wdg_obj_container_item_idx_get(const Gui_Widget *wdg, Dep_Id *dep_id, Eina_Bool active_only);
460
458Object_Container* 461Object_Container*
459wdg_obj_container_unset(Gui_Widget *wdg); 462wdg_obj_container_unset(Gui_Widget *wdg);
460 463