Enlightenment CVS committal Author : xcomputerman Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_x Modified Files: ecore_x_window_prop.c Log Message: Slight change to opacity API: - Use a 0 - 255 range instead, keeping consistent with 8-bit RGBA conventions - Clip supplied value if not in bounds =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_window_prop.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- ecore_x_window_prop.c 6 Jan 2004 16:45:31 -0000 1.19 +++ ecore_x_window_prop.c 9 Jan 2004 08:38:39 -0000 1.20 @@ -1088,7 +1088,7 @@ * This only has an effect if the Composite extension is present and * a compositing manager is running. This hint is still pending approval * as part of the EWMH specification. The value supplied should be an - * integer between 0 and 100, with 100 representing full opacity. + * integer between 0 and 255, with 255 representing full opacity. * <hr><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> */ void ecore_x_window_prop_window_opacity_set(Ecore_X_Window win, int opacity) @@ -1096,7 +1096,12 @@ unsigned long o_val; double tmp; - tmp = (double) opacity/100. * 4294967295.; + if (opacity < 0) + opacity = 0; + else if (opacity > 255) + opacity = 255; + + tmp = (double) opacity/255. * 4294967295.; o_val = (unsigned long) tmp; ecore_x_window_prop_property_set(win, _ecore_x_atom_net_wm_window_opacity, XA_CARDINAL, 32, &o_val, 1); @@ -1105,7 +1110,7 @@ /** * Get the current opacity value of the window * @param win The window whose opacity is being requested - * @return An int between 0 and 100 representing the window's opacity value, + * @return An int between 0 and 255 representing the window's opacity value, * or -1 if the property is not found. * <hr><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> */ @@ -1122,7 +1127,7 @@ if (data && num) { lval = *(unsigned long *) data; - ret_val = (int) ((double) lval / 4294967295. * 100.); + ret_val = (int) ((double) lval / 4294967295. * 255.); } } ------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs