From e6ac57ddb60b5b8ab7f524a2c351ef62a8bb7391 Mon Sep 17 00:00:00 2001 From: handyande Date: Tue, 21 Sep 2004 13:19:18 +0000 Subject: [PATCH] Add setting background color of an Ecore_X_Window SVN revision: 11685 --- legacy/ecore/src/lib/ecore_x/Ecore_X.h | 3 +++ legacy/ecore/src/lib/ecore_x/ecore_x_window.c | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/legacy/ecore/src/lib/ecore_x/Ecore_X.h b/legacy/ecore/src/lib/ecore_x/Ecore_X.h index 79236c7ea9..c2019be01d 100644 --- a/legacy/ecore/src/lib/ecore_x/Ecore_X.h +++ b/legacy/ecore/src/lib/ecore_x/Ecore_X.h @@ -790,6 +790,9 @@ int ecore_x_window_visible_get(Ecore_X_Window win); Ecore_X_Window ecore_x_window_at_xy_get(int x, int y); Ecore_X_Window ecore_x_window_parent_get(Ecore_X_Window win); +void ecore_x_window_background_color_set(Ecore_X_Window win, + unsigned long color); + Ecore_X_Atom ecore_x_window_prop_any_type(void); void ecore_x_window_prop_property_set(Ecore_X_Window win, Ecore_X_Atom type, Ecore_X_Atom format, int size, void *data, int number); int ecore_x_window_prop_property_get(Ecore_X_Window win, Ecore_X_Atom property, Ecore_X_Atom type, int size, unsigned char **data, int *num); diff --git a/legacy/ecore/src/lib/ecore_x/ecore_x_window.c b/legacy/ecore/src/lib/ecore_x/ecore_x_window.c index e1f4dbf68c..a536ac10c9 100644 --- a/legacy/ecore/src/lib/ecore_x/ecore_x_window.c +++ b/legacy/ecore/src/lib/ecore_x/ecore_x_window.c @@ -688,3 +688,16 @@ ecore_x_window_parent_get(Ecore_X_Window win) return parent; } +/** + * Sets the background color of the given window. + * @param win The given window + * @param color The color to set to (i.e. 0xff0000) + */ +void +ecore_x_window_background_color_set(Ecore_X_Window win, unsigned long color) +{ + XSetWindowAttributes attr; + + attr.background_pixel = color; + XChangeWindowAttributes(_ecore_x_disp, win, CWBackPixel, &attr); +}