Enlightenment CVS committal Author : ningerso Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_object.c ewl_object.h Log Message: Minor change to flag checking, a mask will now match any of the flags being set rather than requiring all of the flags. This is more useful for checking multiple possible properties. API addition to handle the original case. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_object.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- ewl_object.c 6 Feb 2007 13:42:17 -0000 1.18 +++ ewl_object.c 5 Mar 2007 13:29:21 -0000 1.19 @@ -1458,11 +1458,27 @@ * @param o: the object to check for a specified flags * @param flags: the bitmask of flags to check on the object * @param mask: get only the flags specified in mask - * @return Returns TRUE if the specified flags are set, FALSE otherwise. + * @return Returns TRUE if any of the specified flags are set, FALSE otherwise. * @brief Determines if an object has the requested @a flags set. */ unsigned int ewl_object_flags_has(Ewl_Object *o, unsigned int flags, unsigned int mask) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR_RET("o", o, 0); + + DRETURN_INT(!!(o->flags & (flags & mask)), DLEVEL_STABLE); +} + +/** + * @param o: the object to check for a specified flags + * @param flags: the bitmask of flags to check on the object + * @param mask: get only the flags specified in mask + * @return Returns TRUE if the specified flags are set, FALSE otherwise. + * @brief Determines if an object has all of the requested @a flags set. + */ +unsigned int +ewl_object_flags_has_all(Ewl_Object *o, unsigned int flags, unsigned int mask) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("o", o, 0); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_object.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- ewl_object.h 2 Mar 2007 04:39:46 -0000 1.18 +++ ewl_object.h 5 Mar 2007 13:29:21 -0000 1.19 @@ -177,6 +177,8 @@ unsigned int mask); unsigned int ewl_object_flags_has(Ewl_Object *o, unsigned int flags, unsigned int mask); +unsigned int ewl_object_flags_has_all(Ewl_Object *o, unsigned int flags, + unsigned int mask); unsigned int ewl_object_flags_get(Ewl_Object *o, unsigned int mask); /** ------------------------------------------------------------------------- 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