


XDrawRectangle(3X11)					 XDrawRectangle(3X11)
X11R5									X11R5



NAME
  XDrawRectangle, XDrawRectangles, XRectangle -	draw rectangles	and rectan-
  gles structure

SYNTAX
  XDrawRectangle(_d_i_s_p_l_a_y, _d, _g_c, _x, _y, _w_i_d_t_h, _h_e_i_g_h_t)
	Display	*_d_i_s_p_l_a_y;
	Drawable _d;
	GC _g_c;
	int _x, _y;
	unsigned int _w_i_d_t_h, _h_e_i_g_h_t;

  XDrawRectangles(_d_i_s_p_l_a_y, _d, _g_c, _r_e_c_t_a_n_g_l_e_s, _n_r_e_c_t_a_n_g_l_e_s)
	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 coordi-
  nates	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	delim off

































