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 a child_count internal function

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_container.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- ewl_container.c     8 Feb 2006 23:30:00 -0000       1.33
+++ ewl_container.c     9 Feb 2006 18:07:53 -0000       1.34
@@ -7,6 +7,7 @@
                                                Ewl_Widget *child, 
                                                int index, 
                                                int skip_internal);
+static int ewl_container_child_count_get_helper(Ewl_Container *c, int skip);
 
 /**
  * @param c: the container to initialize
@@ -396,13 +397,8 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-/**
- * @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)
+static int
+ewl_container_child_count_get_helper(Ewl_Container *c, int skip)
 {
        Ewl_Widget *child = NULL;
        Ewl_Container *container = NULL;
@@ -421,13 +417,51 @@
        ecore_list_goto_first(container->children);
        while ((child = ecore_list_next(container->children)))
        {
-               if (ewl_widget_internal_is(child)) continue;
+               if (skip && ewl_widget_internal_is(child)) continue;
                count++;
        }
 
        DRETURN_INT(count, DLEVEL_STABLE);
 }
 
+/**
+ * @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)
+{
+       int count = 0;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR_RET("c", c, 0);
+       DCHECK_TYPE_RET("c", c, EWL_CONTAINER_TYPE, 0);
+
+       count = ewl_container_child_count_get_helper(c, TRUE);
+
+       DRETURN_INT(count, DLEVEL_STABLE);
+}
+
+/**
+ * @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_internal_get(Ewl_Container *c)
+{
+       int count = 0;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR_RET("c", c, 0);
+       DCHECK_TYPE_RET("c", c, EWL_CONTAINER_TYPE, 0);
+
+       count = ewl_container_child_count_get_helper(c, FALSE);
+
+       DRETURN_INT(count, DLEVEL_STABLE);
+}
+
 static Ewl_Widget *
 ewl_container_child_helper_get(Ewl_Container *parent, int index, 
                                                unsigned int skip)
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_container.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ewl_container.h     8 Feb 2006 23:30:01 -0000       1.15
+++ ewl_container.h     9 Feb 2006 18:07:55 -0000       1.16
@@ -128,6 +128,7 @@
 void            ewl_container_child_iterator_set(Ewl_Container *c,
                                                 Ewl_Container_Iterator i);
 int             ewl_container_child_count_get(Ewl_Container *c);
+int             ewl_container_child_count_internal_get(Ewl_Container *c);
 
 void            ewl_container_destroy(Ewl_Container *c);
 void            ewl_container_reset(Ewl_Container *c);




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to