1 #include "ecore_xcb_private.h"
4 * @defgroup Ecore_X_Drawable_Group X Drawable Functions
6 * Functions that operate on drawables.
10 * Fill the specified rectangle on a drawable.
11 * @param d The given drawable.
12 * @param gc The graphic context that controls the fill rules.
13 * @param x The X coordinate of the top-left corner of the rectangle.
14 * @param y The Y coordinate of the top-left corner of the rectangle.
15 * @param width The width of the rectangle.
16 * @param height The height of the rectangle.
19 ecore_x_drawable_rectangle_fill(Ecore_X_Drawable draw, Ecore_X_GC gc, int x, int y, int w, int h)
23 LOGFN(__FILE__, __LINE__, __FUNCTION__);
29 xcb_poly_fill_rectangle(_ecore_xcb_conn, draw, gc, 1,
30 (const xcb_rectangle_t *)&rect);
35 * Retrieves the geometry of the given drawable.
36 * @param d The given drawable.
37 * @param x Pointer to an integer into which the X position is to be stored.
38 * @param y Pointer to an integer into which the Y position is to be stored.
39 * @param w Pointer to an integer into which the width is to be stored.
40 * @param h Pointer to an integer into which the height is to be stored.
41 * @ingroup Ecore_X_Drawable_Group
44 ecore_x_drawable_geometry_get(Ecore_X_Drawable draw, int *x, int *y, int *w, int *h)
46 xcb_get_geometry_cookie_t cookie;
47 xcb_get_geometry_reply_t *reply;
49 LOGFN(__FILE__, __LINE__, __FUNCTION__);
55 cookie = xcb_get_geometry_unchecked(_ecore_xcb_conn, draw);
56 reply = xcb_get_geometry_reply(_ecore_xcb_conn, cookie, NULL);
60 if (w) *w = (int)reply->width;
61 if (h) *h = (int)reply->height;
66 * Retrieves the width of the border of the given drawable.
67 * @param d The given drawable.
68 * @return The border width of the given drawable.
69 * @ingroup Ecore_X_Drawable_Group
72 ecore_x_drawable_border_width_get(Ecore_X_Drawable d)
74 xcb_get_geometry_cookie_t cookie;
75 xcb_get_geometry_reply_t *reply;
78 LOGFN(__FILE__, __LINE__, __FUNCTION__);
80 cookie = xcb_get_geometry_unchecked(_ecore_xcb_conn, d);
81 reply = xcb_get_geometry_reply(_ecore_xcb_conn, cookie, NULL);
83 ret = (int)reply->border_width;
89 * Retrieves the depth of the given drawable.
90 * @param d The given drawable.
91 * @return The depth of the given drawable.
92 * @ingroup Ecore_X_Drawable_Group
95 ecore_x_drawable_depth_get(Ecore_X_Drawable d)
97 xcb_get_geometry_cookie_t cookie;
98 xcb_get_geometry_reply_t *reply;
101 LOGFN(__FILE__, __LINE__, __FUNCTION__);
103 cookie = xcb_get_geometry_unchecked(_ecore_xcb_conn, d);
104 reply = xcb_get_geometry_reply(_ecore_xcb_conn, cookie, NULL);
105 if (!reply) return 0;
106 ret = (int)reply->depth;