Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: E.h draw.c mod-misc.c Log Message: Fix move/resize color. =================================================================== RCS file: /cvs/e/e16/e/src/E.h,v retrieving revision 1.585 retrieving revision 1.586 diff -u -3 -r1.585 -r1.586 --- E.h 15 Jun 2007 19:42:41 -0000 1.585 +++ E.h 16 Jun 2007 11:16:17 -0000 1.586 @@ -320,6 +320,7 @@ int mode_move; int mode_resize; int mode_info; + unsigned int color; char old_mode; char update_while_moving; char enable_sync_request; =================================================================== RCS file: /cvs/e/e16/e/src/draw.c,v retrieving revision 1.101 retrieving revision 1.102 diff -u -3 -r1.101 -r1.102 --- draw.c 16 Jun 2007 08:41:53 -0000 1.101 +++ draw.c 16 Jun 2007 11:16:17 -0000 1.102 @@ -664,6 +664,31 @@ rl[3].x = _x + _w - 1; rl[3].y = _y + 1; rl[3].width = 1; rl[3].height = _h - 2; \ } while(0) +#define _R(x) (((x) >> 16) & 0xff) +#define _G(x) (((x) >> 8) & 0xff) +#define _B(x) (((x) ) & 0xff) + +static unsigned int +_ShapeGetColor(void) +{ + static char color_valid = 0; + static unsigned int color_value = 0; + static unsigned int color_pixel; + XColor xc; + + if (color_valid && color_value == Conf.movres.color) + goto done; + + color_value = Conf.movres.color; + ESetColor(&xc, _R(color_value), _G(color_value), _B(color_value)); + EAllocColor(VRoot.cmap, &xc); + color_pixel = xc.pixel; + color_valid = 1; + + done: + return color_pixel; +} + static EObj * _ShapeCreateWin(void) { @@ -674,7 +699,7 @@ return NULL; eo->shadow = 0; eo->fade = 0; - ESetWindowBackground(EobjGetWin(eo), 0xff0000); /* FIXME - Allocate color */ + ESetWindowBackground(EobjGetWin(eo), _ShapeGetColor()); #ifdef xxShapeInput /* Should really check server too */ XShapeCombineRectangles(disp, EobjGetXwin(eo), ShapeInput, 0, 0, NULL, 0, ShapeSet, Unsorted); =================================================================== RCS file: /cvs/e/e16/e/src/mod-misc.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -3 -r1.56 -r1.57 --- mod-misc.c 15 Jun 2007 20:33:10 -0000 1.56 +++ mod-misc.c 16 Jun 2007 11:16:17 -0000 1.57 @@ -148,6 +148,7 @@ CFG_ITEM_INT(Conf, movres.mode_move, 0), CFG_ITEM_INT(Conf, movres.mode_resize, 2), CFG_ITEM_INT(Conf, movres.mode_info, 1), + CFG_ITEM_HEX(Conf, movres.color, 0x00ff0000), CFG_ITEM_INT(Conf, movres.old_mode, 0), CFG_ITEM_BOOL(Conf, movres.update_while_moving, 0), CFG_ITEM_BOOL(Conf, movres.enable_sync_request, 0), ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs