3 #endif /* ifdef HAVE_CONFIG_H */
5 #include "ecore_x_private.h"
8 * @defgroup Ecore_X_Drawable_Group X Drawable Functions
9 * @ingroup Ecore_X_Group
11 * Functions that operate on drawables.
15 * Retrieves the geometry of the given drawable.
16 * @param d The given drawable.
17 * @param x Pointer to an integer into which the X position is to be stored.
18 * @param y Pointer to an integer into which the Y position is to be stored.
19 * @param w Pointer to an integer into which the width is to be stored.
20 * @param h Pointer to an integer into which the height is to be stored.
21 * @ingroup Ecore_X_Drawable_Group
24 ecore_x_drawable_geometry_get(Ecore_X_Drawable d,
32 unsigned int ret_w, ret_h, dummy_border, dummy_depth;
34 LOGFN(__FILE__, __LINE__, __FUNCTION__);
35 EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
36 if (!XGetGeometry(_ecore_x_disp, d, &dummy_win, &ret_x, &ret_y,
37 &ret_w, &ret_h, &dummy_border, &dummy_depth))
56 if (_ecore_xlib_sync) ecore_x_sync();
60 * Retrieves the width of the border of the given drawable.
61 * @param d The given drawable.
62 * @return The border width of the given drawable.
63 * @ingroup Ecore_X_Drawable_Group
66 ecore_x_drawable_border_width_get(Ecore_X_Drawable d)
70 unsigned int dummy_w, dummy_h, border_ret, dummy_depth;
72 LOGFN(__FILE__, __LINE__, __FUNCTION__);
73 EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, 0);
74 if (!XGetGeometry(_ecore_x_disp, d, &dummy_win, &dummy_x, &dummy_y,
75 &dummy_w, &dummy_h, &border_ret, &dummy_depth))
77 if (_ecore_xlib_sync) ecore_x_sync();
78 return (int)border_ret;
82 * Retrieves the depth of the given drawable.
83 * @param d The given drawable.
84 * @return The depth of the given drawable.
85 * @ingroup Ecore_X_Drawable_Group
88 ecore_x_drawable_depth_get(Ecore_X_Drawable d)
92 unsigned int dummy_w, dummy_h, dummy_border, depth_ret;
94 LOGFN(__FILE__, __LINE__, __FUNCTION__);
95 EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, 0);
96 if (!XGetGeometry(_ecore_x_disp, d, &dummy_win, &dummy_x, &dummy_y,
97 &dummy_w, &dummy_h, &dummy_border, &depth_ret))
99 if (_ecore_xlib_sync) ecore_x_sync();
100 return (int)depth_ret;
104 * Fill the specified rectangle on a drawable.
105 * @param d The given drawable.
106 * @param gc The graphic context that controls the fill rules.
107 * @param x The X coordinate of the top-left corner of the rectangle.
108 * @param y The Y coordinate of the top-left corner of the rectangle.
109 * @param width The width of the rectangle.
110 * @param height The height of the rectangle.
113 ecore_x_drawable_rectangle_fill(Ecore_X_Drawable d,
120 LOGFN(__FILE__, __LINE__, __FUNCTION__);
121 EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
122 XFillRectangle(_ecore_x_disp, d, gc, x, y, width, height);
123 if (_ecore_xlib_sync) ecore_x_sync();