NAME
XDrawRectangle, XDrawRectangles, XRectangle - draw rectangles and rectangles structure
SYNTAX
int XDrawRectangle(Display *_d_i_s_p_l_a_y, Drawable _d, GC
_g_c, int _x, int _y, unsigned int _w_i_d_t_h, unsigned
int _h_e_i_g_h_t);
int XDrawRectangles(Display *_d_i_s_p_l_a_y, Drawable _d, GC
_g_c, XRectangle _r_e_c_t_a_n_g_l_e_s[], int _n_r_e_c_t_a_n_g_l_e_s);
ARGUMENTS
-
_d
Specifies the drawable.
-
-
_d_i_s_p_l_a_y
Specifies the connection to the X server.
-
-
_g_c
Specifies the GC.
-
-
_n_r_e_c_t_a_n_g_l_e_s
Specifies the number of rectangles in the array.
-
-
_r_e_c_t_a_n_g_l_e_s
Specifies an array of rectangles.
-
-
_w_i_d_t_h
-
-
_h_e_i_g_h_t
Specify the width and height, which specify the dimensions of the rectangle.
-
-
_x
-
-
_y
Specify the x and y coordinates, which specify the upper-left corner of the rectangle.
-
DESCRIPTION
The
_X_D_r_a_w_R_e_c_t_a_n_g_l_e
and
_X_D_r_a_w_R_e_c_t_a_n_g_l_e_s
functions draw the outlines of the specified rectangle or rectangles as
if a five-point
_P_o_l_y_L_i_n_e
protocol request were specified for each rectangle:
-
[x,y] [x+width,y] [x+width,y+height] [x,y+height] [x,y]
-
For the specified rectangle or rectangles,
these functions do not draw a pixel more than once.
_X_D_r_a_w_R_e_c_t_a_n_g_l_e_s
draws the rectangles in the order listed in the array.
If rectangles intersect,
the intersecting pixels are drawn multiple times.
Both functions use these GC components:
function, plane-mask, line-width,
line-style, cap-style, join-style, fill-style,
subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
They also use these GC mode-dependent components:
foreground, background, tile, stipple, tile-stipple-x-origin,
tile-stipple-y-origin, dash-offset, and dash-list.
_X_D_r_a_w_R_e_c_t_a_n_g_l_e
and
_X_D_r_a_w_R_e_c_t_a_n_g_l_e_s
can generate
_B_a_d_D_r_a_w_a_b_l_e,
_B_a_d_G_C,
and
_B_a_d_M_a_t_c_h
errors.
STRUCTURES
The
_X_R_e_c_t_a_n_g_l_e
structure contains:
typedef struct {
short x, y;
unsigned short width, height;
} XRectangle;
All x and y members are signed integers.
The width and height members are 16-bit unsigned integers.
You should be careful not to generate coordinates and sizes
out of the 16-bit ranges, because the protocol only has 16-bit fields
for these values.
DIAGNOSTICS
-
_B_a_d_D_r_a_w_a_b_l_e
-
A value for a Drawable argument does not name a defined Window or Pixmap.
-
_B_a_d_G_C
-
A value for a GContext argument does not name a defined GContext.
-
_B_a_d_M_a_t_c_h
-
An
_I_n_p_u_t_O_n_l_y
window is used as a Drawable.
-
_B_a_d_M_a_t_c_h
-
Some argument or pair of arguments has the correct type and range but fails
to match in some other way required by the request.
SEE ALSO
XDrawArc(3X11),
XDrawLine(3X11),
XDrawPoint(3X11)
_X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e