Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_selectionbar.c ewl_selectionbar.h ewl_selectionbook.c 
        ewl_selectionbook.h 


Log Message:
- formatting/ type checking

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_selectionbar.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ewl_selectionbar.c  9 Oct 2005 05:18:39 -0000       1.6
+++ ewl_selectionbar.c  25 Oct 2005 04:27:06 -0000      1.7
@@ -6,8 +6,8 @@
 static int ewl_selectionbar_open_bar_timer(void *ev_data);
 static int ewl_selectionbar_close_bar_timer(void *ev_data);
 
-Ecore_Timer    *open_timer;
-Ecore_Timer    *close_timer;
+static Ecore_Timer *open_timer;
+static Ecore_Timer *close_timer;
 
 /**
  * ewl_selectionbar_new - create a new selectionbar
@@ -15,23 +15,27 @@
  * Returns a pointer to a newly allocated scrollpane on success, NULL on
  * failure.
  */
-Ewl_Widget     *ewl_selectionbar_new(Ewl_Widget * parent)
+Ewl_Widget *
+ewl_selectionbar_new(Ewl_Widget *parent)
 {
        Ewl_Selectionbar *s;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR_RET("parent", parent, NULL);
+       DCHECK_TYPE_RET("parent", parent, "widget", NULL);
 
        s = NEW(Ewl_Selectionbar, 1);
        if (!s)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ewl_selectionbar_init(s, parent);
-
+       if (!ewl_selectionbar_init(s, parent)) {
+               ewl_widget_destroy(EWL_WIDGET(s));
+               s = NULL;
+       }
 
        DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
 }
 
-
 /**
  * ewl_selectionbar_init - initialize a new selectionbar
  * @param s: the selectionbar to initialize
@@ -40,19 +44,25 @@
  * Returns no value. Sets up the default callbacks and values for the
  * the selectionbar
  */
-int ewl_selectionbar_init(Ewl_Selectionbar * s, Ewl_Widget * parent)
+int
+ewl_selectionbar_init(Ewl_Selectionbar *s, Ewl_Widget *parent)
 {
-       Ewl_Widget     *w;
-       Ewl_Embed      *embed;
-
+       Ewl_Widget *w;
+       Ewl_Embed *embed;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET("s", s, FALSE);
-
+       DCHECK_PARAM_PTR_RET("parent", parent, FALSE);
+       DCHECK_TYPE_RET("parent", parent, "widget", FALSE);
 
        w = EWL_WIDGET(s);
 
-       ewl_floater_init(EWL_FLOATER(s));
+       if (!ewl_floater_init(EWL_FLOATER(s)))
+               DRETURN_INT(FALSE, DLEVEL_STABLE);
+
+       ewl_widget_appearance_set(w, "selectionbar");
+       ewl_widget_inherit(w, "selectionbar");
+
        ewl_floater_follow_set(EWL_FLOATER(s), parent);
        ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
                            ewl_selectionbar_configure_cb, NULL);
@@ -68,9 +78,6 @@
        if (!ewl_container_init(EWL_CONTAINER(s->bar)))
                DRETURN_INT(FALSE, DLEVEL_STABLE);
 
-       ewl_widget_appearance_set(w, "selectionbar");
-       ewl_widget_inherit(w, "selectionbar");
-
        ewl_object_fill_policy_set(EWL_OBJECT(s->bar), EWL_FLAG_FILL_HFILL |
                                   EWL_FLAG_FILL_HSHRINK);
        ewl_container_child_append(EWL_CONTAINER(w), EWL_WIDGET(s->bar));
@@ -79,12 +86,10 @@
        ewl_callback_append(EWL_WIDGET(s->bar), EWL_CALLBACK_FOCUS_IN,
                            ewl_selectionbar_focus_in_cb, w);
 
-
        embed = ewl_embed_widget_find(parent);
        ewl_callback_append(EWL_WIDGET(embed), EWL_CALLBACK_CONFIGURE,
                            ewl_selectionbar_parent_configure_cb, w);
 
-
        s->scroller.top = ewl_vbox_new();
        ewl_object_size_request(EWL_OBJECT(s->scroller.top), 30, 10);
        ewl_container_child_append(s->bar, s->scroller.top);
@@ -94,7 +99,6 @@
 */
        ewl_widget_appearance_set(s->scroller.top, 
"/selectionbar/scroller/top");
 
-
        s->scroller.bottom = ewl_vbox_new();
        ewl_object_size_request(EWL_OBJECT(s->scroller.bottom), 30, 10);
        ewl_container_child_append(s->bar, s->scroller.bottom);
@@ -104,34 +108,42 @@
 */
        ewl_widget_appearance_set(s->scroller.bottom, 
"/selectionbar/scroller/bottom");
 
-
        ewl_container_add_notify_set(EWL_CONTAINER(w),
                                 ewl_selectionbar_child_add_cb);
 
        s->OPEN = 1;
        s->mouse_x = 0;
 
-       DRETURN_INT(FALSE, DLEVEL_STABLE);
+       DRETURN_INT(TRUE, DLEVEL_STABLE);
 }
 
-
-void ewl_selectionbar_child_add_cb(Ewl_Container * parent, Ewl_Widget * child)
+void
+ewl_selectionbar_child_add_cb(Ewl_Container *parent, Ewl_Widget *child)
 {
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("parent", parent);
+       DCHECK_PARAM_PTR("child", child);
+       DCHECK_TYPE("parent", parent, "container");
+       DCHECK_TYPE("child", child, "widget");
+
        ewl_container_child_append(EWL_SELECTIONBAR(parent)->bar, child);
        ewl_container_child_remove(parent, child);
 
        ewl_callback_append(child, EWL_CALLBACK_MOUSE_MOVE,
                            ewl_selectionbar_mouse_move_child_cb, parent);
 
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-void ewl_selectionbar_realize_cb(Ewl_Widget * w, void *ev_data __UNUSED__,
+void
+ewl_selectionbar_realize_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
                                                void *user_data __UNUSED__)
 {
        Ewl_Selectionbar *s;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
-
+       DCHECK_PARAM_PTR("w", w);
+       DCHECK_TYPE("w", w, "widget");
 
        s = EWL_SELECTIONBAR(w);
 
@@ -149,33 +161,37 @@
        ewl_widget_show(EWL_WIDGET(EWL_SELECTIONBAR(w)->scroller.bottom));
        ewl_widget_show(EWL_WIDGET(EWL_SELECTIONBAR(w)->bar));
 
-
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-
-void ewl_selectionbar_show_cb(Ewl_Widget * w, void *ev_data __UNUSED__,
-                                               void *user_data __UNUSED__)
+void
+ewl_selectionbar_show_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
+                                       void *user_data __UNUSED__)
 {
        Ewl_Selectionbar *s;
 
-       s = EWL_SELECTIONBAR(w);
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("w", w);
+       DCHECK_TYPE("w", w, "widget");
 
+       s = EWL_SELECTIONBAR(w);
        ecore_timer_add(0.01, ewl_selectionbar_close_bar_timer, s->bar);
-}
 
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
 
 void
-ewl_selectionbar_configure_cb(Ewl_Widget * w, void *ev_data __UNUSED__,
+ewl_selectionbar_configure_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
                                        void *user_data __UNUSED__)
 {
        Ewl_Selectionbar *s;
-       Ecore_List       *children;
+//     Ecore_List *children;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("w", w);
+       DCHECK_TYPE("w", w, "widget");
 
        s = EWL_SELECTIONBAR(w);
-
        if (s->w < CURRENT_W(EWL_OBJECT(EWL_FLOATER(s)->follows)))
                s->w = CURRENT_W(EWL_OBJECT(EWL_FLOATER(s)->follows));
 
@@ -185,12 +201,10 @@
        if (CURRENT_H(EWL_OBJECT(s)) < 5)
                ewl_object_h_request(EWL_OBJECT(s), 5);
 
-
        ewl_widget_configure(EWL_WIDGET(s->bar));
 
-       children = EWL_CONTAINER(EWL_FLOATER(w)->follows)->children;
-
        /*
+       children = EWL_CONTAINER(EWL_FLOATER(w)->follows)->children;
        if (children) {
                ecore_list_goto_first(children);
                while ((child = ecore_list_next(children)) != NULL)
@@ -199,61 +213,56 @@
        }
        */
 
-
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-
 void
-ewl_selectionbar_parent_configure_cb(Ewl_Widget * w __UNUSED__,
+ewl_selectionbar_parent_configure_cb(Ewl_Widget *w __UNUSED__,
                                void *ev_data __UNUSED__, void *user_data)
 {
        Ewl_Selectionbar *s;
-       Ewl_Object     *o;
+       Ewl_Object *o;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
-
+       DCHECK_PARAM_PTR("w", w);
+       DCHECK_TYPE("w", w, "widget");
 
        s = EWL_SELECTIONBAR(user_data);
        o = EWL_OBJECT(s);
 
        printf("bar height: %d\n", CURRENT_H(EWL_OBJECT(s->bar)));
 
-
        ewl_object_size_request(o, s->w, CURRENT_H(EWL_OBJECT(s->bar)));
 
-
        if (CURRENT_H(EWL_OBJECT(s->bar)) < 5)
                ewl_object_size_request(o, s->w, 5);
        ewl_selectionbar_focus_out_cb(EWL_WIDGET(s->bar), NULL, s);
 
-
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
 void
-ewl_selectionbar_focus_in_cb(Ewl_Widget * w, void *ev_data __UNUSED__,
+ewl_selectionbar_focus_in_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
                                                        void *user_data)
 {
        Ewl_Selectionbar *s;
-       Ewl_Object     *o;
-       Ecore_List       *children;
-       Ewl_Widget     *child;
-       int             cum_width;
-
+       Ewl_Object *o;
+       Ecore_List *children;
+       Ewl_Widget *child;
+       int cum_width;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
-
+       DCHECK_PARAM_PTR("w", w);
+       DCHECK_PARAM_PTR("user_data", user_data);
+       DCHECK_TYPE("w", w, "widget");
 
        s = EWL_SELECTIONBAR(user_data);
        o = EWL_OBJECT(w);
        children = EWL_CONTAINER(w)->children;
        cum_width = 0;
 
-
        if (s->OPEN)
-               return;
-
+               DRETURN(DLEVEL_STABLE);
 
        ecore_timer_add(0.01, ewl_selectionbar_open_bar_timer, w);
 
@@ -278,7 +287,6 @@
                        cum_width += CURRENT_W(child) + 5;
                }
        }
-
        s->OPEN = 1;
 
 /*     ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE,
@@ -288,28 +296,30 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-
 void
-ewl_selectionbar_focus_out_cb(Ewl_Widget * w, void *ev_data, void *user_data)
+ewl_selectionbar_focus_out_cb(Ewl_Widget *w, void *ev_data, void *user_data)
 {
        Ewl_Selectionbar *s;
-       Ecore_List       *children;
-       Ewl_Widget     *child;
-       Ewl_Embed      *embed;
-       Ewl_Object     *o;
-       Ewl_Event_Mouse_Out *ev = ev_data;
-
-       int             mx, my;
-       int             wx, wy;
-       int             ww, wh;
+       Ecore_List *children;
+       Ewl_Widget *child;
+       Ewl_Embed *embed;
+       Ewl_Object *o;
+       Ewl_Event_Mouse_Out *ev;
+
+       int mx, my;
+       int wx, wy;
+       int ww, wh;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("w", w);
+       DCHECK_PARAM_PTR("user_data", user_data);
+       DCHECK_TYPE("w", w, "widget");
 
+       ev = ev_data;
        s = EWL_SELECTIONBAR(user_data);
        o = EWL_OBJECT(w);
        children = EWL_CONTAINER(w)->children;
 
-
        /*
         * First check that the mouse left the selectionbar and that
         * focus didn't just go to one of it's children
@@ -324,11 +334,9 @@
        ww = CURRENT_W(o);
        wh = CURRENT_H(o);
 
-
        if ((((mx > wx) && (mx < (wx + ww))) &&
             ((my > wy) && (my < (wy + wh)))))
-               return;
-
+               DRETURN(DLEVEL_STABLE);
 
        ewl_callback_del(w, EWL_CALLBACK_MOUSE_MOVE,
                         ewl_selectionbar_children_animator_cb);
@@ -342,25 +350,23 @@
                    child != EWL_WIDGET(s->scroller.bottom))
                        ewl_widget_hide(child);
 
-
        s->OPEN = 0;
-
        ecore_timer_add(0.01, ewl_selectionbar_close_bar_timer, w);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-
-
-int ewl_selectionbar_open_bar_timer(void *ev_data)
+int
+ewl_selectionbar_open_bar_timer(void *ev_data)
 {
-       Ewl_Widget     *w;
-       Ewl_Object     *o;
-       Ewl_Object     *so;
+       Ewl_Widget *w;
+       Ewl_Object *o;
+       Ewl_Object *so;
        Ewl_Selectionbar *s;
        int retval = 0;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
+
        ecore_timer_del(close_timer);
 
        w = EWL_WIDGET(ev_data);
@@ -387,16 +393,17 @@
        DRETURN_INT(retval, DLEVEL_STABLE);
 }
 
-
-int ewl_selectionbar_close_bar_timer(void *ev_data)
+int
+ewl_selectionbar_close_bar_timer(void *ev_data)
 {
-       Ewl_Widget     *w;
-       Ewl_Object     *o;
-       Ewl_Object     *so;
+       Ewl_Widget *w;
+       Ewl_Object *o;
+       Ewl_Object *so;
        Ewl_Selectionbar *s;
        int retval = 0;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
+
        ecore_timer_del(open_timer);
 
        w = EWL_WIDGET(ev_data);
@@ -419,51 +426,55 @@
        DRETURN_INT(retval, DLEVEL_STABLE);
 }
 
-
 void
-ewl_selectionbar_mouse_move_child_cb(Ewl_Widget * w __UNUSED__, void *ev_data,
+ewl_selectionbar_mouse_move_child_cb(Ewl_Widget *w __UNUSED__, void *ev_data,
                                  void *user_data)
 {
        Ewl_Selectionbar *s;
 
-       s = EWL_SELECTIONBAR(user_data);
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("user_data", user_data);
 
+       s = EWL_SELECTIONBAR(user_data);
        ewl_selectionbar_children_animator_cb(EWL_WIDGET(s->bar), ev_data, s);
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
 void
-ewl_selectionbar_children_animator_cb(Ewl_Widget * w, void *ev_data,
+ewl_selectionbar_children_animator_cb(Ewl_Widget *w, void *ev_data,
                                      void *user_data)
 {
 
-       Ewl_Widget     *child;
-       Ewl_Object     *o;
-       Ecore_List       *children;
+       Ewl_Widget *child;
+       Ewl_Object *o;
+       Ecore_List *children;
        Ewl_Event_Mouse_Move *ev;
        Ewl_Selectionbar *s;
-       int             x, old_x;
+       int x, old_x;
 
-       s = EWL_SELECTIONBAR(user_data);
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("w", w);
+       DCHECK_PARAM_PTR("user_data", user_data);
+       DCHECK_TYPE("w", w, "widget");
 
+       s = EWL_SELECTIONBAR(user_data);
        o = EWL_OBJECT(w);
        children = EWL_CONTAINER(w)->children;
 
        ev = ev_data;
        x = ev->x - CURRENT_X(o);
 
-       if (!s->mouse_x)
-               old_x = x;
-       else
-               old_x = s->mouse_x;
-       s->mouse_x = x;
+       if (!s->mouse_x) old_x = x;
+       else old_x = s->mouse_x;
 
+       s->mouse_x = x;
        ewl_object_position_request(EWL_OBJECT(s->scroller.top), x - 15,
                                    CURRENT_Y(o) + 5);
 
        ewl_object_position_request(EWL_OBJECT(s->scroller.bottom),
                                    x - 15, CURRENT_Y(o) + CURRENT_H(o) - 15);
 
-
        ecore_list_goto_first(children);
        while ((child = ecore_list_next(children)) != NULL) {
                if (child != EWL_WIDGET(s->scroller.bottom) &&
@@ -486,5 +497,5 @@
                                                      CURRENT_H(child)) / 2));
                }
        }
-
 }
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_selectionbar.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_selectionbar.h  17 Feb 2005 19:14:56 -0000      1.3
+++ ewl_selectionbar.h  25 Oct 2005 04:27:06 -0000      1.4
@@ -34,32 +34,31 @@
        int             OPEN;   /* Boolean, open or closed */
 };
 
-Ewl_Widget *ewl_selectionbar_new(Ewl_Widget * parent);
-int         ewl_selectionbar_init(Ewl_Selectionbar * s, Ewl_Widget * parent);
-void        ewl_selectionbar_size_set(Ewl_Selectionbar * s, int w, int h1,
-                                    int h2);
+Ewl_Widget *ewl_selectionbar_new(Ewl_Widget *parent);
+int         ewl_selectionbar_init(Ewl_Selectionbar *s, Ewl_Widget *parent);
+void        ewl_selectionbar_size_set(Ewl_Selectionbar *s, int w, int h1,
+                                                                    int h2);
 
 /*
  * Internally used callbacks, override at your own risk.
  */
-void ewl_selectionbar_realize_cb(Ewl_Widget * w, void *ev_data,
-                                void *user_data);
-void ewl_selectionbar_show_cb(Ewl_Widget * w, void *ev_data,
-                             void *user_data);
-void ewl_selectionbar_configure_cb(Ewl_Widget * w, void *ev_data,
-                                  void *user_data);
-void ewl_selectionbar_parent_configure_cb(Ewl_Widget * w, void *ev_data,
-                                         void *user_data);
-void ewl_selectionbar_focus_in_cb(Ewl_Widget * w, void *ev_data,
-                                 void *user_data);
-void ewl_selectionbar_focus_out_cb(Ewl_Widget * w, void *ev_data,
-                                  void *user_data);
-void ewl_selectionbar_children_animator_cb(Ewl_Widget * w, void *ev_data,
-                                          void *user_data);
-void ewl_selectionbar_mouse_move_child_cb(Ewl_Widget * w, void *user_data,
-                                      void *ev_data);
+void ewl_selectionbar_realize_cb(Ewl_Widget *w, void *ev_data,
+                                               void *user_data);
+void ewl_selectionbar_show_cb(Ewl_Widget *w, void *ev_data, void *user_data);
+void ewl_selectionbar_configure_cb(Ewl_Widget *w, void *ev_data,
+                                               void *user_data);
+void ewl_selectionbar_parent_configure_cb(Ewl_Widget *w, void *ev_data,
+                                               void *user_data);
+void ewl_selectionbar_focus_in_cb(Ewl_Widget *w, void *ev_data,
+                                               void *user_data);
+void ewl_selectionbar_focus_out_cb(Ewl_Widget *w, void *ev_data,
+                                               void *user_data);
+void ewl_selectionbar_children_animator_cb(Ewl_Widget *w, void *ev_data,
+                                               void *user_data);
+void ewl_selectionbar_mouse_move_child_cb(Ewl_Widget *w, void *user_data,
+                                               void *ev_data);
 
-void ewl_selectionbar_child_add_cb(Ewl_Container * parent, Ewl_Widget * child);
+void ewl_selectionbar_child_add_cb(Ewl_Container *parent, Ewl_Widget *child);
 
 /**
  * @}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_selectionbook.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ewl_selectionbook.c 3 Oct 2005 06:43:07 -0000       1.6
+++ ewl_selectionbook.c 25 Oct 2005 04:27:06 -0000      1.7
@@ -8,7 +8,8 @@
  * 
  * Returns a newly allocated selectionbook on success, NULL on failure.
  */
-Ewl_Widget     *ewl_selectionbook_new()
+Ewl_Widget *
+ewl_selectionbook_new(void)
 {
        Ewl_Selectionbook *s;
 
@@ -18,12 +19,14 @@
        if (!s)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ewl_selectionbook_init(s);
+       if (!ewl_selectionbook_init(s)) {
+               ewl_widget_destroy(EWL_WIDGET(s));
+               s = NULL;
+       }
 
        DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
 }
 
-
 /**
  * ewl_selectionbook_init - initialize a selectionbook widget
  * @param s: the selectionbook widget
@@ -31,15 +34,16 @@
  * Returns no value. Sets the fields and callbacks of the selectionbook
  * @a s to their default values.
  */
-int ewl_selectionbook_init(Ewl_Selectionbook * s)
+int
+ewl_selectionbook_init(Ewl_Selectionbook *s)
 {
-       Ewl_Widget     *w;
+       Ewl_Widget *w;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR_RET("s", s, FALSE);
 
        w = EWL_WIDGET(s);
 
-
        /*
         * Initialize the inherited box fields
         */
@@ -59,18 +63,15 @@
        ewl_callback_append(w, EWL_CALLBACK_DESTROY,
                            ewl_selectionbook_destroy_cb, NULL);
 
-
        s->tab_bar = ewl_selectionbar_new(w);
 
        s->pages = ecore_list_new();
        s->current_page = NULL;
        s->num_pages = 0;
 
-
        DRETURN_INT(TRUE, DLEVEL_STABLE);
 }
 
-
 /**
  * @param s: The selection book to add the page too
  * @param tab: the tab name to give the page
@@ -78,19 +79,22 @@
  * @return Returns no value.
  */
 void
-ewl_selectionbook_page_add(Ewl_Selectionbook * s, Ewl_Widget * tab,
-                          Ewl_Widget * page)
+ewl_selectionbook_page_add(Ewl_Selectionbook *s, Ewl_Widget *tab,
+                                               Ewl_Widget *page)
 {
-       Ewl_SbookPage  *p;
+       Ewl_Selectionbook_Page  *p;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("s", s);
        DCHECK_PARAM_PTR("tab", tab);
        DCHECK_PARAM_PTR("page", page);
+       DCHECK_TYPE("s", s, "selectionbook");
+       DCHECK_TYPE("tab", tab, "widget");
+       DCHECK_TYPE("page", page, "widget");
 
-       p = NEW(Ewl_SbookPage, 1);
+       p = NEW(Ewl_Selectionbook_Page, 1);
        if (!p)
-               return;
+               DRETURN(DLEVEL_STABLE);
 
        p->tab = tab;
        p->page = page;
@@ -120,26 +124,27 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-
 /**
  * @param s: The selection book to remove the page from
  * @param num: The page number to remove
  * @param destroy: Should the page be destroyed
  * @return Returns no value
  */
-void ewl_selectionbook_page_rem(Ewl_Selectionbook * s, int num,
+void
+ewl_selectionbook_page_rem(Ewl_Selectionbook *s, int num,
                                        int destroy __UNUSED__)
 {
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("s", s);
+       DCHECK_TYPE("s", s, "selectionbook");
 
        if (s->num_pages < num)
-               return;
+               DRETURN(DLEVEL_STABLE);
 
 /*
        ecore_list_goto_index(s->pages, num);
 
-       p = (Ewl_SbookPage *) ecore_list_remove(s->pages);
+       p = (Ewl_Selectionbook_Page *) ecore_list_remove(s->pages);
 
        if (s->current_page == p) {
                if (num == 1) {
@@ -185,20 +190,22 @@
  * @brief Removes the current page from the selection book, destroying it if
  * desired                        
  */
-void ewl_selectionbook_current_page_rem(Ewl_Selectionbook * s,
+void
+ewl_selectionbook_current_page_rem(Ewl_Selectionbook *s,
                                        int destroy __UNUSED__)
 {
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("s", s);
+       DCHECK_TYPE("s", s, "selectionbook");
 
 /*
        p = s->current_page;
        ecore_list_goto_first(s->pages);
-       s->current_page = (Ewl_SbookPage *) ecore_list_current(s->pages);
+       s->current_page = (Ewl_Selectionbook_Page *) 
ecore_list_current(s->pages);
 
        if (s->current_page == p)
                s->current_page =
-                   (Ewl_SbookPage *) ecore_list_next(s->pages);
+                   (Ewl_Selectionbook_Page *) ecore_list_next(s->pages);
 
 
        ewl_container_remove_child(EWL_CONTAINER(s->panel), p->page);
@@ -222,31 +229,33 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-
 void
-ewl_selectionbook_realize_cb(Ewl_Widget * w, void *ev_data __UNUSED__,
+ewl_selectionbook_realize_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
                                                void *user_data __UNUSED__)
 {
-       Ewl_Selectionbook *s;
+       Ewl_Selectionbook *s = NULL;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("s", s);
+       DCHECK_TYPE("w", w, "widget");
 
        s = EWL_SELECTIONBOOK(w);
 
 //      ewl_container_remove_child(EWL_CONTAINER(s), s->tab_bar);
        ewl_widget_show(s->tab_bar);
 
-
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
 void
-ewl_selectionbook_configure_cb(Ewl_Widget * w, void *ev_data __UNUSED__,
+ewl_selectionbook_configure_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
                                                void *user_data __UNUSED__)
 {
        Ewl_Selectionbook *s;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("w", w);
+       DCHECK_TYPE("w", w, "widget");
 
        s = EWL_SELECTIONBOOK(w);
 
@@ -260,27 +269,27 @@
                                            CURRENT_H(EWL_OBJECT(s)));
        }
 
-
        ewl_widget_configure(s->tab_bar);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-
 void
-ewl_selectionbook_destroy_cb(Ewl_Widget * w, void *ev_data __UNUSED__,
+ewl_selectionbook_destroy_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
                                                void *user_data __UNUSED__)
 {
        Ewl_Selectionbook *s;
-       Ewl_SbookPage  *p;
+       Ewl_Selectionbook_Page  *p;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("w", w);
+       DCHECK_TYPE("w", w, "widget");
 
        s = EWL_SELECTIONBOOK(w);
 
        if (s->pages) {
                ecore_list_goto_first(s->pages);
-               while ((p = (Ewl_SbookPage *) ecore_list_next(s->pages)) != 
NULL)
+               while ((p = (Ewl_Selectionbook_Page *) 
ecore_list_next(s->pages)) != NULL)
                        ewl_widget_destroy(p->page);
        }
 
@@ -292,16 +301,16 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-
-
 void
-ewl_selectionbook_page_switch_cb(Ewl_Widget * w, void *ev_data __UNUSED__,
+ewl_selectionbook_page_switch_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
                                                        void *user_data)
 {
        Ewl_Selectionbook *s;
-       Ewl_SbookPage  *p;
+       Ewl_Selectionbook_Page  *p;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("w", w);
+       DCHECK_TYPE("w", w, "widget");
 
        s = EWL_SELECTIONBOOK(user_data);
        p = s->current_page;
@@ -315,7 +324,7 @@
                //ewl_widget_hide(p->page);
        }
 
-       s->current_page = (Ewl_SbookPage *) ewl_widget_data_get(w, (void *) s);
+       s->current_page = (Ewl_Selectionbook_Page *) ewl_widget_data_get(w, 
(void *) s);
 
        p = s->current_page;
        ewl_callback_del(p->tab, EWL_CALLBACK_CLICKED,
@@ -325,6 +334,6 @@
 
        ewl_widget_configure(EWL_WIDGET(s));
 
-
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_selectionbook.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ewl_selectionbook.h 3 Oct 2005 06:43:07 -0000       1.4
+++ ewl_selectionbook.h 25 Oct 2005 04:27:06 -0000      1.5
@@ -1,4 +1,3 @@
-
 #ifndef __EWL_SELECTIONBOOK_H__
 #define __EWL_SELECTIONBOOK_H__
 
@@ -13,19 +12,19 @@
  * @themekey /selectionbook/group
  */
 
-typedef struct _ewl_sbook_page Ewl_SbookPage;
+typedef struct Ewl_Selectionbook_Page Ewl_Selectionbook_Page;
 
-#define EWL_SBOOKPAGE(sbook_page) ((Ewl_SbookPage *) sbook_page)
-struct _ewl_sbook_page
+#define EWL_SELECTIONBOOK_PAGE(sbook_page) ((Ewl_Selectionbook_Page *) 
sbook_page)
+struct Ewl_Selectionbook_Page
 {
        Ewl_Widget     *tab;
        Ewl_Widget     *page;
 };
 
-typedef struct _ewl_selectionbook Ewl_Selectionbook;
+typedef struct Ewl_Selectionbook Ewl_Selectionbook;
 
 #define EWL_SELECTIONBOOK(sbook) ((Ewl_Selectionbook *) sbook)
-struct _ewl_selectionbook
+struct Ewl_Selectionbook
 {
        Ewl_Box         box;
 
@@ -33,31 +32,30 @@
        Ewl_Widget     *panel;  /* vbox */
 
        Ecore_List     *pages;
-       Ewl_SbookPage  *current_page;
+       Ewl_Selectionbook_Page  *current_page;
 
        int             num_pages;      /* number of pages */
 };
 
-
 Ewl_Widget     *ewl_selectionbook_new(void);
-int             ewl_selectionbook_init(Ewl_Selectionbook * s);
-void            ewl_selectionbook_page_add(Ewl_Selectionbook * s,
-                                          Ewl_Widget * tab, Ewl_Widget * page);
-void            ewl_selectionbook_page_rem(Ewl_Selectionbook * s, int num,
+int             ewl_selectionbook_init(Ewl_Selectionbook *s);
+void            ewl_selectionbook_page_add(Ewl_Selectionbook *s,
+                                          Ewl_Widget *tab, Ewl_Widget * page);
+void            ewl_selectionbook_page_rem(Ewl_Selectionbook *s, int num,
                                           int destroy);
-void            ewl_selectionbook_current_page_rem(Ewl_Selectionbook * s,
+void            ewl_selectionbook_current_page_rem(Ewl_Selectionbook *s,
                                                   int destroy);
 
 /*
  * Internally used callbacks, override at your own risk.
  */
-void            ewl_selectionbook_configure_cb(Ewl_Widget * w, void *ev_data,
+void ewl_selectionbook_configure_cb(Ewl_Widget *w, void *ev_data,
                                               void *user_data);
-void            ewl_selectionbook_realize_cb(Ewl_Widget * w, void *ev_data,
+void ewl_selectionbook_realize_cb(Ewl_Widget *w, void *ev_data,
                                             void *user_data);
-void            ewl_selectionbook_destroy_cb(Ewl_Widget * w, void *ev_data,
+void ewl_selectionbook_destroy_cb(Ewl_Widget *w, void *ev_data,
                                             void *user_data);
-void            ewl_selectionbook_page_switch_cb(Ewl_Widget * w, void *ev_data,
+void ewl_selectionbook_page_switch_cb(Ewl_Widget *w, void *ev_data,
                                                 void *user_data);
 
 /**




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to