


XDrawLine(3X11)						      XDrawLine(3X11)
X11R5									X11R5



NAME
  XDrawLine, XDrawLines, XDrawSegments,	XSegment - draw	lines, polygons, and
  line structure

SYNTAX
  XDrawLine(_d_i_s_p_l_a_y, _d,	_g_c, _x_1,	_y_1, _x_2,	_y_2)
	Display	*_d_i_s_p_l_a_y;
	Drawable _d;
	GC _g_c;
	int _x_1,	_y_1, _x_2,	_y_2;

  XDrawLines(_d_i_s_p_l_a_y, _d, _g_c, _p_o_i_n_t_s, _n_p_o_i_n_t_s, _m_o_d_e)
	Display	*_d_i_s_p_l_a_y;
	Drawable _d;
	GC _g_c;
	XPoint *_p_o_i_n_t_s;
	int _n_p_o_i_n_t_s;
	int _m_o_d_e;

  XDrawSegments(_d_i_s_p_l_a_y, _d, _g_c,	_s_e_g_m_e_n_t_s, _n_s_e_g_m_e_n_t_s)
	Display	*_d_i_s_p_l_a_y;
	Drawable _d;
	GC _g_c;
	XSegment *_s_e_g_m_e_n_t_s;
	int _n_s_e_g_m_e_n_t_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.

  _m_o_d_e	    Specifies the coordinate mode. You can pass	_C_o_o_r_d_M_o_d_e_O_r_i_g_i_n	or
	    _C_o_o_r_d_M_o_d_e_P_r_e_v_i_o_u_s.

  _n_p_o_i_n_t_s   Specifies the number of points in the array.

  _n_s_e_g_m_e_n_t_s Specifies the number of segments in	the array.

  _p_o_i_n_t_s    Specifies an array of points.

  _s_e_g_m_e_n_t_s  Specifies an array of segments.

  _x_1
  _y_1
  _x_2
  _y_2	    Specify the	points (x1, y1)	and (x2, y2) to	be connected.



DESCRIPTION
  The _X_D_r_a_w_L_i_n_e	function uses the components of	the specified GC to draw a
  line between the specified set of points (x1,	y1) and	(x2, y2).  It does
  not perform joining at coincident endpoints.	For any	given line, _X_D_r_a_w_L_i_n_e
  does not draw	a pixel	more than once.	 If lines intersect, the intersecting
  pixels are drawn multiple times.

  The _X_D_r_a_w_L_i_n_e_s function uses the components of the specified GC to draw
  npoints-1 lines between each pair of points (point[i], point[i+1]) in	the
  array	of _X_P_o_i_n_t structures.  It draws	the lines in the order listed in the
  array.  The lines join correctly at all intermediate points, and if the
  first	and last points	coincide, the first and	last lines also	join
  correctly.  For any given line, _X_D_r_a_w_L_i_n_e_s does not draw a pixel more	than
  once.	 If thin (zero line-width) lines intersect, the	intersecting pixels
  are drawn multiple times.  If	wide lines intersect, the intersecting pixels
  are drawn only once, as though the entire _P_o_l_y_L_i_n_e protocol request were a
  single, filled shape.	 _C_o_o_r_d_M_o_d_e_O_r_i_g_i_n treats	all coordinates	as relative
  to the origin, and _C_o_o_r_d_M_o_d_e_P_r_e_v_i_o_u_s treats all coordinates after the	first
  as relative to the previous point.

  The _X_D_r_a_w_S_e_g_m_e_n_t_s function draws multiple, unconnected lines.	For each seg-
  ment,	_X_D_r_a_w_S_e_g_m_e_n_t_s draws a line between (x1,	y1) and	(x2, y2).  It draws
  the lines in the order listed	in the array of	_X_S_e_g_m_e_n_t structures and	does
  not perform joining at coincident endpoints.	For any	given line, _X_D_r_a_w_S_e_g_-
  _m_e_n_t_s	does not draw a	pixel more than	once. If lines intersect, the inter-
  secting pixels are drawn multiple times.

  All three functions use these	GC components: function, plane-mask, line-
  width, line-style, cap-style,	fill-style, subwindow-mode, clip-x-origin,
  clip-y-origin, and clip-mask.	 The _X_D_r_a_w_L_i_n_e_s	function also uses the join-
  style	GC component.  All three functions 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_L_i_n_e, _X_D_r_a_w_L_i_n_e_s, and _X_D_r_a_w_S_e_g_m_e_n_t_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.	_X_D_r_a_w_L_i_n_e_s can also generate a _B_a_d_V_a_l_u_e	error.

STRUCTURES
  The _X_S_e_g_m_e_n_t structure contains:

  typedef struct {
	  short	x1, y1,	x2, y2;
  } XSegment;

  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.

  _B_a_d_V_a_l_u_e  Some numeric value falls outside the range of values accepted by
	    the	request.  Unless a specific range is specified for an argu-
	    ment, the full range defined by the	argument's type	is accepted.
	    Any	argument defined as a set of alternatives can generate this
	    error.

SEE ALSO
  XDrawArc(3X11), XDrawPoint(3X11), XDrawRectangle(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

