Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_separator.c ewl_separator.h Log Message: - formatting/type checking =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_separator.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- ewl_separator.c 15 Oct 2005 04:56:02 -0000 1.9 +++ ewl_separator.c 25 Oct 2005 04:32:24 -0000 1.10 @@ -7,7 +7,8 @@ * @return Returns pointer to new separator widget on success, NULL on failure. * @brief Allocate a new separator widget with default (horizontal) orientation */ -Ewl_Widget *ewl_separator_new() +Ewl_Widget * +ewl_separator_new(void) { Ewl_Separator *s; @@ -17,7 +18,10 @@ if (!s) DRETURN_PTR(NULL, DLEVEL_STABLE); - ewl_separator_init(s); + if (!ewl_separator_init(s)) { + ewl_widget_destroy(EWL_WIDGET(s)); + s = NULL; + } DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE); } @@ -26,7 +30,8 @@ * @return Returns pointer to new separator widget on success, NULL on failure. * @brief Allocate a new separator widget with horizontal orientation */ -Ewl_Widget *ewl_hseparator_new() +Ewl_Widget * +ewl_hseparator_new(void) { Ewl_Widget *s; @@ -44,7 +49,8 @@ * @return Returns pointer to new separator widget on success, NULL on failure. * @brief Allocate a new separator widget with vertical orientation */ -Ewl_Widget *ewl_vseparator_new() +Ewl_Widget * +ewl_vseparator_new(void) { Ewl_Widget *s; @@ -66,20 +72,22 @@ * Clears the contents of the separator and stores the * default values. */ -int ewl_separator_init(Ewl_Separator * s) +int +ewl_separator_init(Ewl_Separator *s) { - Ewl_Widget *w; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR_RET("s", s, FALSE); w = EWL_WIDGET(s); if (!ewl_widget_init(w)) DRETURN_INT(FALSE, DLEVEL_STABLE); + ewl_widget_inherit(w, "separator"); ewl_widget_appearance_set(EWL_WIDGET(s), "hseparator"); ewl_object_fill_policy_set(EWL_OBJECT(s), EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_SHRINK); - ewl_widget_inherit(w, "separator"); ewl_object_alignment_set(EWL_OBJECT(s), EWL_FLAG_ALIGN_LEFT); @@ -92,8 +100,8 @@ ewl_separator_orientation_set(Ewl_Separator *s, Ewl_Orientation o) { DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("s", s); + DCHECK_TYPE("s", s, "separator"); if (s->orientation == o) DRETURN(DLEVEL_STABLE); @@ -122,8 +130,9 @@ ewl_separator_orientation_get(Ewl_Separator *s) { DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("s", s, EWL_ORIENTATION_HORIZONTAL); + DCHECK_TYPE_RET("s", s, "separator", EWL_ORIENTATION_HORIZONTAL); DRETURN_INT(s->orientation, DLEVEL_STABLE); } + =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_separator.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- ewl_separator.h 24 Oct 2005 04:39:57 -0000 1.6 +++ ewl_separator.h 25 Oct 2005 04:32:24 -0000 1.7 @@ -1,4 +1,3 @@ - #ifndef __EWL_SEPARATOR_H__ #define __EWL_SEPARATOR_H__ @@ -43,7 +42,7 @@ Ewl_Widget *ewl_separator_new(void); Ewl_Widget *ewl_hseparator_new(void); Ewl_Widget *ewl_vseparator_new(void); -int ewl_separator_init(Ewl_Separator * s); +int ewl_separator_init(Ewl_Separator *s); void ewl_separator_orientation_set(Ewl_Separator *s, Ewl_Orientation o); Ewl_Orientation ewl_separator_orientation_get(Ewl_Separator *s); ------------------------------------------------------- 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