Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_check.c ewl_check.h Log Message: - formatting and type checking =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_check.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_check.c 3 Oct 2005 06:43:06 -0000 1.4 +++ ewl_check.c 23 Oct 2005 16:44:43 -0000 1.5 @@ -7,15 +7,16 @@ * @return Returns the newly allocated check on success, NULL on failure. * @brief Allocate and initialize a new check */ -Ewl_Widget *ewl_check_new() +Ewl_Widget * +ewl_check_new(void) { - Ewl_Check *b; + Ewl_Check *b; DENTER_FUNCTION(DLEVEL_STABLE); b = NEW(Ewl_Check, 1); if (!b) - return NULL; + DRETURN_PTR(NULL, DLEVEL_STABLE); if (!ewl_check_init(EWL_CHECK(b))) { ewl_widget_destroy(EWL_WIDGET(b)); @@ -33,11 +34,13 @@ * The internal structures and callbacks of the check are initialized ot * default values. */ -int ewl_check_init(Ewl_Check * cb) +int +ewl_check_init(Ewl_Check *cb) { - Ewl_Widget *w; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR_RET("cb", cb, FALSE); w = EWL_WIDGET(cb); @@ -45,15 +48,15 @@ DRETURN_INT(FALSE, DLEVEL_STABLE); ewl_widget_appearance_set(w, "check"); + ewl_widget_inherit(w, "check"); + ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE); ewl_object_preferred_inner_size_set(EWL_OBJECT(w), 20, 20); - ewl_callback_append(w, EWL_CALLBACK_CLICKED, ewl_check_clicked_cb, - NULL); + ewl_callback_append(w, EWL_CALLBACK_CLICKED, + ewl_check_clicked_cb, NULL); ewl_callback_append(w, EWL_CALLBACK_FOCUS_OUT, - ewl_check_update_check_cb, NULL); - - ewl_widget_inherit(w, "check"); + ewl_check_update_check_cb, NULL); DRETURN_INT(TRUE, DLEVEL_STABLE); } @@ -67,10 +70,12 @@ * Changes the checked status of the check and updates it's appearance to * reflect the change. */ -void ewl_check_checked_set(Ewl_Check * cb, int c) +void +ewl_check_checked_set(Ewl_Check *cb, int c) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("cb", cb); + DCHECK_TYPE("cb", cb, "check"); if (c) cb->checked = 1; @@ -87,45 +92,45 @@ * @return Returns TRUE if the check is checked, FALSE if not. * @brief Determine the check state of the check */ -int ewl_check_is_checked(Ewl_Check * cb) +int +ewl_check_is_checked(Ewl_Check *cb) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("cb", cb, 0); + DCHECK_TYPE_RET("cb", cb, "check", 0); DRETURN_INT(cb->checked, DLEVEL_STABLE); } -void ewl_check_clicked_cb(Ewl_Widget * w, void *ev_data __UNUSED__, - void *user_data __UNUSED__) +void +ewl_check_clicked_cb(Ewl_Widget *w, void *ev_data __UNUSED__, + void *user_data __UNUSED__) { - Ewl_Check *cb; - int oc; + Ewl_Check *cb; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); + DCHECK_TYPE("w", w, "widget"); cb = EWL_CHECK(w); - oc = cb->checked; - cb->checked ^= 1; - ewl_check_update_check_cb(w, NULL, NULL); - ewl_callback_call(w, EWL_CALLBACK_VALUE_CHANGED); DLEAVE_FUNCTION(DLEVEL_STABLE); } -void ewl_check_update_check_cb(Ewl_Widget * w, void *ev_data __UNUSED__, - void *user_data __UNUSED__) +void +ewl_check_update_check_cb(Ewl_Widget *w, void *ev_data __UNUSED__, + void *user_data __UNUSED__) { - Ewl_Check *cb; + Ewl_Check *cb; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); + DCHECK_TYPE("w", w, "widget"); cb = EWL_CHECK(w); - if (cb->checked) ewl_widget_state_set(w, "checked"); else @@ -133,3 +138,4 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } + =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_check.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_check.h 3 Oct 2005 06:43:06 -0000 1.4 +++ ewl_check.h 23 Oct 2005 16:44:43 -0000 1.5 @@ -40,16 +40,16 @@ }; Ewl_Widget *ewl_check_new(void); -int ewl_check_init(Ewl_Check * c); -int ewl_check_is_checked(Ewl_Check * c); -void ewl_check_checked_set(Ewl_Check * c, int checked); +int ewl_check_init(Ewl_Check *c); +int ewl_check_is_checked(Ewl_Check *c); +void ewl_check_checked_set(Ewl_Check *c, int checked); /* * Internally used callbacks. */ -void ewl_check_clicked_cb(Ewl_Widget * w, void *ev_data, +void ewl_check_clicked_cb(Ewl_Widget *w, void *ev_data, void *user_data); -void ewl_check_update_check_cb(Ewl_Widget * w, void *ev_data, +void ewl_check_update_check_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