Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_container.c ewl_container.h 


Log Message:
Container changes towards an abstracted child iterator, doesn't work yet.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_container.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -3 -r1.62 -r1.63
--- ewl_container.c     18 Mar 2004 03:41:23 -0000      1.62
+++ ewl_container.c     19 Mar 2004 13:25:04 -0000      1.63
@@ -519,6 +519,45 @@
 }
 
 /**
+ * @param c: the container to begin iterating over it's children
+ * @return Returns no value.
+ * @brief Prepare the container to iterate over it's children.
+ *
+ * Notifies the container that it will need to start from the beginning of
+ * it's child list. Do not call this if you want to begin iteration where it
+ * was last left off, but be warned it's possible this won't be where you
+ * expect.
+ */
+void ewl_container_child_iterate_begin(Ewl_Container *c)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("c", c);
+
+       ewd_list_goto_first(c->children);
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param c: the container to change child iterator functions
+ * @param i: the iterator function for the container
+ * @return Returns no value.
+ * @brief Changes the iterator function for a container.
+ *
+ * Do not use this unless you know are writing a custom container of your own.
+ */
+void
+ewl_container_set_child_iterator(Ewl_Container *c, Ewl_Container_Iterator i)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("c", c);
+
+       c->iterator = i;
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
  * @param c: the container to intercept the callback
  * @param t: the type of callback to intercept
  * @return Returns no value.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_container.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- ewl_container.h     18 Mar 2004 06:16:31 -0000      1.32
+++ ewl_container.h     19 Mar 2004 13:25:04 -0000      1.33
@@ -58,6 +58,14 @@
 typedef void    (*Ewl_Child_Hide) (Ewl_Container * c, Ewl_Widget * w);
 
 /**
+ * A typedef to shorten the definition of the child iterator callbacks. This
+ * callback is container specific and is usually set in the container's init
+ * function. This is used to pick the next child in the list of children for
+ * the container.
+ */
+typedef Ewl_Widget *(*Ewl_Container_Iterator) (Ewl_Widget * w);
+
+/**
  * @struct Ewl_Container
  * Inherits from the Ewl_Widget and expands to allow for placing child widgets
  * within the available space. Also adds notifiers for various child events.
@@ -70,13 +78,15 @@
 
        Evas_Object     *clip_box; /**< Clip box to bound widgets inside. */
 
-       Ewl_Container   *redirect; /**< Non-internal widgets placed here */
+       Ewl_Container   *redirect; /**< Alternate parent for children */
 
        Ewl_Child_Add    child_add; /**< Function called on child add */
        Ewl_Child_Remove child_remove; /**< Function called on child remove */
        Ewl_Child_Resize child_resize; /**< Function called on child resize */
        Ewl_Child_Show   child_show; /**< Function called on child hide */
        Ewl_Child_Hide   child_hide; /**< Function called on child hide */
+
+       Ewl_Container_Iterator iterator; /**< Function to find next child */
 };
 
 int             ewl_container_init(Ewl_Container * container, char *appearance);




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to