Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_shadow.c ewl_shadow.h Log Message: - cleanup =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_shadow.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_shadow.c 13 Sep 2006 19:47:30 -0000 1.2 +++ ewl_shadow.c 26 Sep 2006 18:02:44 -0000 1.3 @@ -7,7 +7,6 @@ * @return Returns a new shadow container on success, NULL on failure. * @brief Allocate and initialize a new shadow container */ - Ewl_Widget * ewl_shadow_new(void) { @@ -16,11 +15,14 @@ DENTER_FUNCTION(DLEVEL_STABLE); s = NEW(Ewl_Shadow, 1); - if (!s) { + if (!s) DRETURN_PTR(NULL, DLEVEL_STABLE); - } - ewl_shadow_init(s); + if (!ewl_shadow_init(s)) + { + ewl_widget_destroy(EWL_WIDGET(s)); + s = NULL; + } DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE); } @@ -31,23 +33,20 @@ * @brief Initialize a shadow container to default values */ int -ewl_shadow_init(Ewl_Shadow * s) +ewl_shadow_init(Ewl_Shadow *s) { - Ewl_Widget *w; - DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("s", s, FALSE); - w = EWL_WIDGET(s); - - if (!ewl_box_init(EWL_BOX(w))) { + if (!ewl_box_init(EWL_BOX(s))) DRETURN_INT(FALSE, DLEVEL_STABLE); - } - ewl_box_orientation_set(EWL_BOX(w), EWL_ORIENTATION_VERTICAL); - ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_SHRINK); + + ewl_box_orientation_set(EWL_BOX(s), EWL_ORIENTATION_VERTICAL); + ewl_object_fill_policy_set(EWL_OBJECT(s), EWL_FLAG_FILL_SHRINK); ewl_widget_appearance_set(EWL_WIDGET(s), EWL_SHADOW_TYPE); ewl_widget_inherit(EWL_WIDGET(s), EWL_SHADOW_TYPE); DRETURN_INT(TRUE, DLEVEL_STABLE); } + =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_shadow.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_shadow.h 13 Sep 2006 19:47:30 -0000 1.2 +++ ewl_shadow.h 26 Sep 2006 18:02:44 -0000 1.3 @@ -37,14 +37,15 @@ */ struct Ewl_Shadow { - Ewl_Box box; /**< Inherit from Ewl_Box */ + Ewl_Box box; /**< Inherit from Ewl_Box */ }; Ewl_Widget *ewl_shadow_new(void); -int ewl_shadow_init(Ewl_Shadow * s); +int ewl_shadow_init(Ewl_Shadow *s); /** * @} */ #endif + ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs