add to the API the function ecore_x_drawable_rectangle_fill() that
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 25 Apr 2009 07:16:26 +0000 (07:16 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 25 Apr 2009 07:16:26 +0000 (07:16 +0000)
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

src/lib/ecore_x/Ecore_X.h
src/lib/ecore_x/xcb/ecore_xcb_drawable.c
src/lib/ecore_x/xlib/ecore_x_drawable.c

index f0bac23..04cc139 100644 (file)
@@ -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);
index 3a1bb5b..75b6911 100644 (file)
@@ -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);
+}
index 1da84de..3daa54a 100644 (file)
@@ -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);
+}