Cleanup ecore_x_window_background_color_set().

SVN revision: 32553
This commit is contained in:
Gustavo Sverzut Barbieri 2007-11-10 23:15:03 +00:00
parent ee259f860f
commit 6983cf7503
1 changed files with 9 additions and 7 deletions

View File

@ -1123,24 +1123,26 @@ ecore_x_window_parent_get(Ecore_X_Window win)
/**
* Sets the background color of the given window.
* @param win The given window
* @param color The color to set to (i.e. 0xff0000)
* @param r red value (0...65536, 16 bits)
* @param g green value (0...65536, 16 bits)
* @param b blue value (0...65536, 16 bits)
*/
EAPI void
ecore_x_window_background_color_set(Ecore_X_Window win, unsigned short r,
unsigned short g, unsigned short b)
{
XSetWindowAttributes attr;
Colormap map;
XColor col;
col.red = r;
col.green = g;
col.blue = b;
XAllocColor(_ecore_x_disp, DefaultColormap(_ecore_x_disp,
DefaultScreen(_ecore_x_disp)),
&col);
attr.background_pixel = col.pixel;
map = DefaultColormap(_ecore_x_disp, DefaultScreen(_ecore_x_disp));
XAllocColor(_ecore_x_disp, map, &col);
attr.background_pixel = col.pixel;
XChangeWindowAttributes(_ecore_x_disp, win, CWBackPixel, &attr);
}