Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_container.c ewl_container.h Log Message: - add call to get the count of the number of children in the container =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_container.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- ewl_container.c 2 Apr 2005 07:20:20 -0000 1.5 +++ ewl_container.c 23 Jun 2005 04:37:16 -0000 1.6 @@ -313,6 +313,35 @@ } /** + * @param c: The container to get the child count from + * @return Returns the number of child widgets + * @brief Returns the number of child widgets in the container + */ +int +ewl_container_child_count_get(Ewl_Container *c) +{ + Ewl_Widget *child = NULL; + Ewl_Container *container = NULL; + int count = 0; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR_RET("c", c, 0); + + ecore_list_goto_first(c->children); + while ((child = ecore_list_next(c->children))) + { + if (ewl_widget_internal_is(child)) continue; + count ++; + } + + container = c->redirect; + while (container->redirect) container = container->redirect; + count += ewl_container_child_count_get(container); + + DRETURN_INT(count, DLEVEL_STABEL); +} + +/** * @param w: the child widget that has had it's preferred size changed * @param size: the amount of change in size * @param o: the orientation of the size change =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_container.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ewl_container.h 17 Feb 2005 19:14:54 -0000 1.3 +++ ewl_container.h 23 Jun 2005 04:37:16 -0000 1.4 @@ -117,6 +117,7 @@ Ewl_Widget *ewl_container_child_next(Ewl_Container *c); void ewl_container_child_iterator_set(Ewl_Container *c, Ewl_Container_Iterator i); +int ewl_container_child_count_get(Ewl_Container *c); void ewl_container_destroy(Ewl_Container * c); void ewl_container_reset(Ewl_Container * c); ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs