From: caro Date: Sat, 25 Apr 2009 07:16:26 +0000 (+0000) Subject: add to the API the function ecore_x_drawable_rectangle_fill() that X-Git-Tag: build/2012-07-04.173327~2581 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c354f01d2f161721aa6951a9af409ab8c318335d;p=profile%2Fivi%2Fecore.git add to the API the function ecore_x_drawable_rectangle_fill() that fills a rectangle on the specified drawable. It will be used in ecore_evas to factorize the code. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@40358 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/ecore_x/Ecore_X.h b/src/lib/ecore_x/Ecore_X.h index f0bac23..04cc139 100644 --- a/src/lib/ecore_x/Ecore_X.h +++ b/src/lib/ecore_x/Ecore_X.h @@ -1211,6 +1211,7 @@ EAPI void ecore_x_drawable_geometry_get_fetch(void); EAPI void ecore_x_drawable_geometry_get(Ecore_X_Drawable d, int *x, int *y, int *w, int *h); EAPI int ecore_x_drawable_border_width_get(Ecore_X_Drawable d); EAPI int ecore_x_drawable_depth_get(Ecore_X_Drawable d); +EAPI void ecore_x_drawable_rectangle_fill(Ecore_X_Drawable d, Ecore_X_GC gc, int x, int y, int width, int height); EAPI int ecore_x_cursor_color_supported_get(void); EAPI Ecore_X_Cursor ecore_x_cursor_new(Ecore_X_Window win, int *pixels, int w, int h, int hot_x, int hot_y); diff --git a/src/lib/ecore_x/xcb/ecore_xcb_drawable.c b/src/lib/ecore_x/xcb/ecore_xcb_drawable.c index 3a1bb5b..75b6911 100644 --- a/src/lib/ecore_x/xcb/ecore_xcb_drawable.c +++ b/src/lib/ecore_x/xcb/ecore_xcb_drawable.c @@ -127,3 +127,24 @@ ecore_x_drawable_depth_get(Ecore_X_Drawable drawable __UNUSED__) return reply->depth; } + +/** + * Fill the specified rectangle on a drawable. + * @param d The given drawable. + * @param gc The graphic context that controls the fill rules. + * @param x The X coordinate of the top-left corner of the rectangle. + * @param y The Y coordinate of the top-left corner of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + */ +EAPI void +ecore_x_drawable_rectangle_fill(Ecore_X_Drawable d, Ecore_X_GC gc, int x, int y, int width, int height) +{ + xcb_rectangle_t rectangle; + + rectangle.x = x; + rectangle.y = y; + rectangle.width = width; + rectangle.height = height; + xcb_poly_fill_rectangle(_ecore_xcb_conn, d, gc, 1, &rectangle); +} diff --git a/src/lib/ecore_x/xlib/ecore_x_drawable.c b/src/lib/ecore_x/xlib/ecore_x_drawable.c index 1da84de..3daa54a 100644 --- a/src/lib/ecore_x/xlib/ecore_x_drawable.c +++ b/src/lib/ecore_x/xlib/ecore_x_drawable.c @@ -86,3 +86,18 @@ ecore_x_drawable_depth_get(Ecore_X_Drawable d) return (int) depth_ret; } + +/** + * Fill the specified rectangle on a drawable. + * @param d The given drawable. + * @param gc The graphic context that controls the fill rules. + * @param x The X coordinate of the top-left corner of the rectangle. + * @param y The Y coordinate of the top-left corner of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + */ +EAPI void +ecore_x_drawable_rectangle_fill(Ecore_X_Drawable d, Ecore_X_GC gc, int x, int y, int width, int height) +{ + XFillRectangle(_ecore_x_disp, d, gc, x, y, width, height); +}