


XCreateGC(3X11)						      XCreateGC(3X11)
X11R5									X11R5



NAME
  XCreateGC, XCopyGC, XChangeGC, XGetGCValues, XFreeGC,	XGContextFromGC,
  XGCValues - create or	free graphics contexts and graphics context structure

SYNTAX
  GC XCreateGC(_d_i_s_p_l_a_y,	_d, _v_a_l_u_e_m_a_s_k, _v_a_l_u_e_s)
	Display	*_d_i_s_p_l_a_y;
	Drawable _d;
	unsigned long _v_a_l_u_e_m_a_s_k;
	XGCValues *_v_a_l_u_e_s;

  XCopyGC(_d_i_s_p_l_a_y, _s_r_c,	_v_a_l_u_e_m_a_s_k, _d_e_s_t)
	Display	*_d_i_s_p_l_a_y;
	GC _s_r_c,	_d_e_s_t;
	unsigned long _v_a_l_u_e_m_a_s_k;

  XChangeGC(_d_i_s_p_l_a_y, _g_c, _v_a_l_u_e_m_a_s_k, _v_a_l_u_e_s)
	Display	*_d_i_s_p_l_a_y;
	GC _g_c;
	unsigned long _v_a_l_u_e_m_a_s_k;
	XGCValues *_v_a_l_u_e_s;

  Status XGetGCValues(_d_i_s_p_l_a_y, _g_c, _v_a_l_u_e_m_a_s_k, _v_a_l_u_e_s__r_e_t_u_r_n)
	Display	*_d_i_s_p_l_a_y;
	GC _g_c;
	unsigned long _v_a_l_u_e_m_a_s_k;
	XGCValues *_v_a_l_u_e_s__r_e_t_u_r_n;

  XFreeGC(_d_i_s_p_l_a_y, _g_c)
	Display	*_d_i_s_p_l_a_y;
	GC _g_c;

  GContext XGContextFromGC(_g_c)
	GC _g_c;

ARGUMENTS

  _d	    Specifies the drawable.

  _d_e_s_t	    Specifies the destination GC.

  _d_i_s_p_l_a_y   Specifies the connection to	the X server.

  _g_c	    Specifies the GC.

  _s_r_c	    Specifies the components of	the source GC.

  _v_a_l_u_e_m_a_s_k Specifies which components in the GC are to	be set,	copied,
	    changed, or	returned.  This	argument is the	bitwise	inclusive OR
	    of zero or more of the valid GC component mask bits.

  _v_a_l_u_e_s    Specifies any values as specified by the valuemask.

  _v_a_l_u_e_s__r_e_t_u_r_n
	    Returns the	GC values in the specified _X_G_C_V_a_l_u_e_s structure.



DESCRIPTION
  The _X_C_r_e_a_t_e_G_C	function creates a graphics context and	returns	a GC.  The GC
  can be used with any destination drawable having the same root and depth as
  the specified	drawable.  Use with other drawables results in a _B_a_d_M_a_t_c_h
  error.

  _X_C_r_e_a_t_e_G_C can	generate _B_a_d_A_l_l_o_c, _B_a_d_D_r_a_w_a_b_l_e,	_B_a_d_F_o_n_t, _B_a_d_M_a_t_c_h, _B_a_d_P_i_x_m_a_p,
  and _B_a_d_V_a_l_u_e errors.

  The _X_C_o_p_y_G_C function copies the specified components from the	source GC to
  the destination GC.  The source and destination GCs must have	the same root
  and depth, or	a _B_a_d_M_a_t_c_h error results.  The valuemask specifies which com-
  ponent to copy, as for _X_C_r_e_a_t_e_G_C.

  _X_C_o_p_y_G_C can generate _B_a_d_A_l_l_o_c, _B_a_d_G_C,	and _B_a_d_M_a_t_c_h errors.

  The _X_C_h_a_n_g_e_G_C	function changes the components	specified by valuemask for
  the specified	GC.  The values	argument contains the values to	be set.	 The
  values and restrictions are the same as for _X_C_r_e_a_t_e_G_C.  Changing the clip-
  mask overrides any previous _X_S_e_t_C_l_i_p_R_e_c_t_a_n_g_l_e_s request on the	context.
  Changing the dash-offset or dash-list	overrides any previous _X_S_e_t_D_a_s_h_e_s
  request on the context.  The order in	which components are verified and
  altered is server dependent.	If an error is generated, a subset of the
  components may have been altered.

  _X_C_h_a_n_g_e_G_C can	generate _B_a_d_A_l_l_o_c, _B_a_d_F_o_n_t, _B_a_d_G_C, _B_a_d_M_a_t_c_h, _B_a_d_P_i_x_m_a_p,	and
  _B_a_d_V_a_l_u_e errors.

  The _X_G_e_t_G_C_V_a_l_u_e_s function returns the	components specified by	valuemask for
  the specified	GC.  If	the valuemask contains a valid set of GC mask bits
  (_G_C_F_u_n_c_t_i_o_n, _G_C_P_l_a_n_e_M_a_s_k, _G_C_F_o_r_e_g_r_o_u_n_d, _G_C_B_a_c_k_g_r_o_u_n_d,	_G_C_L_i_n_e_W_i_d_t_h, _G_C_L_i_n_e_S_-
  _t_y_l_e,	_G_C_C_a_p_S_t_y_l_e, _G_C_J_o_i_n_S_t_y_l_e, _G_C_F_i_l_l_S_t_y_l_e, _G_C_F_i_l_l_R_u_l_e, _G_C_T_i_l_e, _G_C_S_t_i_p_p_l_e,
  _G_C_T_i_l_e_S_t_i_p_X_O_r_i_g_i_n, _G_C_T_i_l_e_S_t_i_p_Y_O_r_i_g_i_n,	_G_C_F_o_n_t,	_G_C_S_u_b_w_i_n_d_o_w_M_o_d_e, _G_C_G_r_a_-
  _p_h_i_c_s_E_x_p_o_s_u_r_e_s, _G_C_C_l_i_p_X_O_r_i_g_i_n, _G_C_C_L_i_p_Y_O_r_i_g_i_n,	_G_C_D_a_s_h_O_f_f_s_e_t, or _G_C_A_r_c_M_o_d_e)
  and no error occur, _X_G_e_t_G_C_V_a_l_u_e_s sets	the requested components in
  values_return	and returns a nonzero status.  Otherwise, it returns a zero
  status.  Note	that the clip-mask and dash-list (represented by the _G_C_C_l_i_p_-
  _M_a_s_k and _G_C_D_a_s_h_L_i_s_t bits, respectively, in the valuemask) cannot be
  requested.  Also note	that an	invalid	resource ID (with one or more of the
  three	most-significant bits set to one) will be returned for _G_C_F_o_n_t,
  _G_C_T_i_l_e, and _G_C_S_t_i_p_p_l_e	if the component has never been	explicitly set by the
  client.

  The _X_F_r_e_e_G_C function destroys	the specified GC as well as all	the associ-
  ated storage.

  _X_F_r_e_e_G_C can generate a _B_a_d_G_C error.

STRUCTURES
  The _X_G_C_V_a_l_u_e_s	structure contains:

  /* GC	attribute value	mask bits */ tab(); l l	l.  #defineT{ _G_C_F_u_n_c_t_i_o_n T}T{
  (1L<<0) T} #defineT{ _G_C_P_l_a_n_e_M_a_s_k T}T{	(1L<<1)	T} #defineT{ _G_C_F_o_r_e_g_r_o_u_n_d
  T}T{ (1L<<2) T} #defineT{ _G_C_B_a_c_k_g_r_o_u_n_d T}T{ (1L<<3) T} #defineT{
  _G_C_L_i_n_e_W_i_d_t_h T}T{ (1L<<4) T} #defineT{	_G_C_L_i_n_e_S_t_y_l_e T}T{ (1L<<5) T} #defineT{
  _G_C_C_a_p_S_t_y_l_e T}T{ (1L<<6) T} #defineT{ _G_C_J_o_i_n_S_t_y_l_e T}T{	(1L<<7)	T} #defineT{
  _G_C_F_i_l_l_S_t_y_l_e T}T{ (1L<<8) T} #defineT{	_G_C_F_i_l_l_R_u_l_e T}T{	(1L<<9)	T} #defineT{
  _G_C_T_i_l_e T}T{ (1L<<10) T} #defineT{ _G_C_S_t_i_p_p_l_e T}T{ (1L<<11) T} #defineT{
  _G_C_T_i_l_e_S_t_i_p_X_O_r_i_g_i_n T}T{ (1L<<12) T} #defineT{ _G_C_T_i_l_e_S_t_i_p_Y_O_r_i_g_i_n T}T{
  (1L<<13) T} #defineT{	_G_C_F_o_n_t T}T{ (1L<<14) T}	#defineT{ _G_C_S_u_b_w_i_n_d_o_w_M_o_d_e
  T}T{ (1L<<15)	T} #defineT{ _G_C_G_r_a_p_h_i_c_s_E_x_p_o_s_u_r_e_s T}T{ (1L<<16) T} #defineT{
  _G_C_C_l_i_p_X_O_r_i_g_i_n	T}T{ (1L<<17) T} #defineT{ _G_C_C_l_i_p_Y_O_r_i_g_i_n T}T{ (1L<<18) T}
  #defineT{ _G_C_C_l_i_p_M_a_s_k T}T{ (1L<<19) T}	#defineT{ _G_C_D_a_s_h_O_f_f_s_e_t T}T{ (1L<<20)
  T} #defineT{ _G_C_D_a_s_h_L_i_s_t T}T{ (1L<<21)	T} #defineT{ _G_C_A_r_c_M_o_d_e T}T{ (1L<<22)
  T}

  /* Values */

  typedef struct {
	  int function;	  /* logical operation */
	  unsigned long	plane_mask;	  /* plane mask	*/
	  unsigned long	foreground;	  /* foreground	pixel */
	  unsigned long	background;	  /* background	pixel */
	  int line_width; /* line width	(in pixels) */
	  int line_style; /* LineSolid,	LineOnOffDash, LineDoubleDash */
	  int cap_style;  /* CapNotLast, CapButt, CapRound, CapProjecting */
	  int join_style; /* JoinMiter,	JoinRound, JoinBevel */
	  int fill_style; /* FillSolid,	FillTiled, FillStippled	FillOpaqueStippled*/
	  int fill_rule;  /* EvenOddRule, WindingRule */
	  int arc_mode;	  /* ArcChord, ArcPieSlice */
	  Pixmap tile;	  /* tile pixmap for tiling operations */
	  Pixmap stipple; /* stipple 1 plane pixmap for	stippling */
	  int ts_x_origin;	  /* offset for	tile or	stipple	operations */
	  int ts_y_origin;
	  Font font;	  /* default text font for text	operations */
	  int subwindow_mode;	  /* ClipByChildren, IncludeInferiors */
	  Bool graphics_exposures;	  /* boolean, should exposures be generated */
	  int clip_x_origin;	  /* origin for	clipping */
	  int clip_y_origin;
	  Pixmap clip_mask;	  /* bitmap clipping; other calls for rects */
	  int dash_offset;	  /* patterned/dashed line information */
	  char dashes;
  } XGCValues;

  The function attributes of a GC are used when	you update a section of	a
  drawable (the	destination) with bits from somewhere else (the	source).  The
  function in a	GC defines how the new destination bits	are to be computed
  from the source bits and the old destination bits.  _G_X_c_o_p_y is	typically the
  most useful because it will work on a	color display, but special applica-
  tions	may use	other functions, particularly in concert with particular
  planes of a color display.  The 16 GC	functions, defined in <_X_1_1/_X._h>, are:
  tab(); l c l.	 _
  FFuunnccttiioonn NNaammee	  VVaalluuee	  OOppeerraattiioonn
  _
  T{ _G_X_c_l_e_a_r T}T{ 0x0 T}T{ 0 T}	T{ _G_X_a_n_d T}T{ 0x1 T}T{ src AND dst T} T{
  _G_X_a_n_d_R_e_v_e_r_s_e T}T{ 0x2	T}T{ src AND NOT dst T}	T{ _G_X_c_o_p_y T}T{ 0x3 T}T{	src
  T} T{	_G_X_a_n_d_I_n_v_e_r_t_e_d T}T{ 0x4 T}T{ (NOT src) AND dst T} T{ _G_X_n_o_o_p T}T{	0x5
  T}T{ dst T} T{ _G_X_x_o_r T}T{ 0x6	T}T{ src XOR dst T} T{ _G_X_o_r T}T{ 0x7 T}T{ src
  OR dst T} T{ _G_X_n_o_r T}T{ 0x8 T}T{ (NOT	src) AND (NOT dst) T} T{ _G_X_e_q_u_i_v T}T{
  0x9 T}T{ (NOT	src) XOR dst T}	T{ _G_X_i_n_v_e_r_t T}T{ 0xa T}T{ NOT dst T} T{
  _G_X_o_r_R_e_v_e_r_s_e T}T{ 0xb T}T{ src	OR (NOT	dst) T}	T{ _G_X_c_o_p_y_I_n_v_e_r_t_e_d T}T{ 0xc
  T}T{ NOT src T} T{ _G_X_o_r_I_n_v_e_r_t_e_d T}T{ 0xd T}T{	(NOT src) OR dst T} T{ _G_X_n_a_n_d
  T}T{ 0xe T}T{	(NOT src) OR (NOT dst) T} T{ _G_X_s_e_t T}T{	0xf T}T{ 1 T}
  _

  Many graphics	operations depend on either pixel values or planes in a	GC.
  The planes attribute is of type long,	and it specifies which planes of the
  destination are to be	modified, one bit per plane.  A	monochrome display
  has only one plane and will be the least-significant bit of the word.	 As
  planes are added to the display hardware, they will occupy more significant
  bits in the plane mask.

  In graphics operations, given	a source and destination pixel,	the result is
  computed bitwise on corresponding bits of the	pixels.	 That is, a Boolean
  operation is performed in each bit plane.  The plane_mask restricts the
  operation to a subset	of planes.  A macro constant _A_l_l_P_l_a_n_e_s can be used to
  refer	to all planes of the screen simultaneously.  The result	is computed
  by the following:

  ((src	FUNC dst) AND plane-mask) OR (dst AND (NOT plane-mask))


  Range	checking is not	performed on the values	for foreground,	background,
  or plane_mask.  They are simply truncated to the appropriate number of
  bits.	 The line-width	is measured in pixels and either can be	greater	than
  or equal to one (wide	line) or can be	the special value zero (thin line).

  Wide lines are drawn centered	on the path described by the graphics
  request.  Unless otherwise specified by the join-style or cap-style, the
  bounding box of a wide line with endpoints [x1, y1], [x2, y2]	and width w
  is a rectangle with vertices at the following	real coordinates:

  [x1-(w*sn/2),	y1+(w*cs/2)], [x1+(w*sn/2), y1-(w*cs/2)],
  [x2-(w*sn/2),	y2+(w*cs/2)], [x2+(w*sn/2), y2-(w*cs/2)]

  Here sn is the sine of the angle of the line,	and cs is the cosine of	the
  angle	of the line.  A	pixel is part of the line and so is drawn if the
  center of the	pixel is fully inside the bounding box (which is viewed	as
  having infinitely thin edges).  If the center	of the pixel is	exactly	on
  the bounding box, it is part of the line if and only if the interior is
  immediately to its right (x increasing direction).  Pixels with centers on
  a horizontal edge are	a special case and are part of the line	if and only
  if the interior or the boundary is immediately below (y increasing direc-
  tion)	and the	interior or the	boundary is immediately	to the right (x
  increasing direction).

  Thin lines (zero line-width) are one-pixel-wide lines	drawn using an
  unspecified, device-dependent	algorithm.  There are only two constraints on
  this algorithm.

  11..   If a line is drawn unclipped from [x1,y1] to [x2,y2] and	if another
       line is drawn unclipped from [x1+dx,y1+dy] to [x2+dx,y2+dy], a point
       [x,y] is	touched	by drawing the first line if and only if the point
       [x+dx,y+dy] is touched by drawing the second line.

  22..   The effective set of points comprising a	line cannot be affected	by
       clipping.  That is, a point is touched in a clipped line	if and only
       if the point lies inside	the clipping region and	the point would	be
       touched by the line when	drawn unclipped.

  A wide line drawn from [x1,y1] to [x2,y2] always draws the same pixels as a
  wide line drawn from [x2,y2] to [x1,y1], not counting	cap-style and join-
  style.  It is	recommended that this property be true for thin	lines, but
  this is not required.	 A line-width of zero may differ from a	line-width of
  one in which pixels are drawn.  This permits the use of many manufacturers'
  line drawing hardware, which may run many times faster than the more pre-
  cisely specified wide	lines.

  In general, drawing a	thin line will be faster than drawing a	wide line of
  width	one.  However, because of their	different drawing algorithms, thin
  lines	may not	mix well aesthetically with wide lines.	 If it is desirable
  to obtain precise and	uniform	results	across all displays, a client should
  always use a line-width of one rather	than a line-width of zero.

  The line-style defines which sections	of a line are drawn: tab(); l l.  T{
  _L_i_n_e_S_o_l_i_d T}T{ The full path of the line is drawn.  T}
  T{ _L_i_n_e_D_o_u_b_l_e_D_a_s_h T}T{ The full path of the line is drawn, but the even
  dashes are filled differently	than the odd dashes (see fill-style) with
  _C_a_p_B_u_t_t style	used where even	and odd	dashes meet.  T}
  T{ _L_i_n_e_O_n_O_f_f_D_a_s_h T}T{	Only the even dashes are drawn,	and cap-style applies
  to all internal ends of the individual dashes, except	_C_a_p_N_o_t_L_a_s_t is treated
  as _C_a_p_B_u_t_t.  T}

  The cap-style	defines	how the	endpoints of a path are	drawn: tab(); l	l.
  T{ _C_a_p_N_o_t_L_a_s_t	T}T{ This is equivalent	to _C_a_p_B_u_t_t except that for a line-
  width	of zero	the final endpoint is not drawn.  T}
  T{ _C_a_p_B_u_t_t T}T{ The line is square at	the endpoint (perpendicular to the
  slope	of the line) with no projection	beyond.	 T}
  T{ _C_a_p_R_o_u_n_d T}T{ The line has	a circular arc with the	diameter equal to the
  line-width, centered on the endpoint.	 (This is equivalent to	_C_a_p_B_u_t_t	for
  line-width of	zero).	T}
  T{ _C_a_p_P_r_o_j_e_c_t_i_n_g T}T{	The line is square at the end, but the path continues
  beyond the endpoint for a distance equal to half the line-width.  (This is
  equivalent to	_C_a_p_B_u_t_t	for line-width of zero).  T}

  The join-style defines how corners are drawn for wide	lines: tab(); l	l.
  T{ _J_o_i_n_M_i_t_e_r T}T{ The	outer edges of two lines extend	to meet	at an angle.
  However, if the angle	is less	than 11	degrees, then a	_J_o_i_n_B_e_v_e_l join-style
  is used instead.  T}
  T{ _J_o_i_n_R_o_u_n_d T}T{ The	corner is a circular arc with the diameter equal to
  the line-width, centered on the joinpoint.  T}
  T{ _J_o_i_n_B_e_v_e_l T}T{ The	corner has _C_a_p_B_u_t_t endpoint styles with	the triangu-
  lar notch filled.  T}

  For a	line with coincident endpoints (x1=x2, y1=y2), when the	cap-style is
  applied to both endpoints, the semantics depends on the line-width and the
  cap-style: tab(); l l	l.  T{ _C_a_p_N_o_t_L_a_s_t T}T{ thin T}T{ The results are
  device-dependent, but	the desired effect is that nothing is drawn.  T}
  T{ _C_a_p_B_u_t_t T}T{ thin T}T{ The	results	are device-dependent, but the desired
  effect is that a single pixel	is drawn.  T}
  T{ _C_a_p_R_o_u_n_d T}T{ thin	T}T{ The results are the same as for _C_a_p_B_u_t_t/thin.
  T}
  T{ _C_a_p_P_r_o_j_e_c_t_i_n_g T}T{	thin T}T{ The results are the same as for
  _C_a_p_B_u_t_t/thin.	 T}
  T{ _C_a_p_B_u_t_t T}T{ wide T}T{ Nothing is drawn.  T}
  T{ _C_a_p_R_o_u_n_d T}T{ wide	T}T{ The closed	path is	a circle, centered at the
  endpoint, and	with the diameter equal	to the line-width.  T}
  T{ _C_a_p_P_r_o_j_e_c_t_i_n_g T}T{	wide T}T{ The closed path is a square, aligned with
  the coordinate axes, centered	at the endpoint, and with the sides equal to
  the line-width.  T}

  For a	line with coincident endpoints (x1=x2, y1=y2), when the	join-style is
  applied at one or both endpoints, the	effect is as if	the line was removed
  from the overall path.  However, if the total	path consists of or is
  reduced to a single point joined with	itself,	the effect is the same as
  when the cap-style is	applied	at both	endpoints.

  The tile/stipple represents an infinite 2D plane, with the tile/stipple
  replicated in	all dimensions.	 When that plane is superimposed on the	draw-
  able for use in a graphics operation,	the upper left corner of some
  instance of the tile/stipple is at the coordinates within the	drawable
  specified by the tile/stipple	origin.	 The tile/stipple and clip origins
  are interpreted relative to the origin of whatever destination drawable is
  specified in a graphics request.  The	tile pixmap must have the same root
  and depth as the GC, or a _B_a_d_M_a_t_c_h error results.  The stipple pixmap	must
  have depth one and must have the same	root as	the GC,	or a _B_a_d_M_a_t_c_h error
  results.  For	stipple	operations where the fill-style	is _F_i_l_l_S_t_i_p_p_l_e_d	but
  not _F_i_l_l_O_p_a_q_u_e_S_t_i_p_p_l_e_d, the stipple pattern is tiled in a single plane and
  acts as an additional	clip mask to be	ANDed with the clip-mask.  Although
  some sizes may be faster to use than others, any size	pixmap can be used
  for tiling or	stippling.

  The fill-style defines the contents of the source for	line, text, and	fill
  requests.  For all text and fill requests (for example, _X_D_r_a_w_T_e_x_t,
  _X_D_r_a_w_T_e_x_t_1_6, _X_F_i_l_l_R_e_c_t_a_n_g_l_e, _X_F_i_l_l_P_o_l_y_g_o_n, and _X_F_i_l_l_A_r_c); for	line requests
  with line-style _L_i_n_e_S_o_l_i_d (for example, _X_D_r_a_w_L_i_n_e, _X_D_r_a_w_S_e_g_m_e_n_t_s, _X_D_r_a_w_R_e_c_-
  _t_a_n_g_l_e, _X_D_r_a_w_A_r_c); and for the even dashes for line requests with line-
  style	_L_i_n_e_O_n_O_f_f_D_a_s_h or _L_i_n_e_D_o_u_b_l_e_D_a_s_h, the following apply: tab(); l l.  T{
  _F_i_l_l_S_o_l_i_d T}T{ Foreground T}
  T{ _F_i_l_l_T_i_l_e_d T}T{ Tile T}
  T{ _F_i_l_l_O_p_a_q_u_e_S_t_i_p_p_l_e_d	T}T{ A tile with the same width	and height as stip-
  ple, but with	background everywhere stipple has a zero and with foreground
  everywhere stipple has a one T}
  T{ _F_i_l_l_S_t_i_p_p_l_e_d T}T{ Foreground masked by stipple T}

  When drawing lines with line-style _L_i_n_e_D_o_u_b_l_e_D_a_s_h, the odd dashes are	con-
  trolled by the fill-style in the following manner: tab(); l l.  T{ _F_i_l_l_S_o_-
  _l_i_d T}T{ Background T}
  T{ _F_i_l_l_T_i_l_e_d T}T{ Same as for	even dashes T}
  T{ _F_i_l_l_O_p_a_q_u_e_S_t_i_p_p_l_e_d	T}T{ Same as for even dashes T}
  T{ _F_i_l_l_S_t_i_p_p_l_e_d T}T{ Background masked by stipple T}

  Storing a pixmap in a	GC might or might not result in	a copy being made.
  If the pixmap	is later used as the destination for a graphics	request, the
  change might or might	not be reflected in the	GC.  If	the pixmap is used
  simultaneously in a graphics request both as a destination and as a tile or
  stipple, the results are undefined.

  For optimum performance, you should draw as much as possible with the	same
  GC (without changing its components).	 The costs of changing GC components
  relative to using different GCs depend upon the display hardware and the
  server implementation.  It is	quite likely that some amount of GC informa-
  tion will be cached in display hardware and that such	hardware can only
  cache	a small	number of GCs.

  The dashes value is actually a simplified form of the	more general patterns
  that can be set with _X_S_e_t_D_a_s_h_e_s.  Specifying a value of N is equivalent to
  specifying the two-element list [N, N] in _X_S_e_t_D_a_s_h_e_s.	 The value must	be
  nonzero, or a	_B_a_d_V_a_l_u_e error results.

  The clip-mask	restricts writes to the	destination drawable.  If the clip-
  mask is set to a pixmap, it must have	depth one and have the same root as
  the GC, or a _B_a_d_M_a_t_c_h	error results.	If clip-mask is	set to _N_o_n_e, the pix-
  els are always drawn regardless of the clip origin.  The clip-mask also can
  be set by calling the	_X_S_e_t_C_l_i_p_R_e_c_t_a_n_g_l_e_s or _X_S_e_t_R_e_g_i_o_n functions.  Only
  pixels where the clip-mask has a bit set to 1	are drawn.  Pixels are not
  drawn	outside	the area covered by the	clip-mask or where the clip-mask has
  a bit	set to 0.  The clip-mask affects all graphics requests.	 The clip-
  mask does not	clip sources.  The clip-mask origin is interpreted relative
  to the origin	of whatever destination	drawable is specified in a graphics
  request.

  You can set the subwindow-mode to _C_l_i_p_B_y_C_h_i_l_d_r_e_n or _I_n_c_l_u_d_e_I_n_f_e_r_i_o_r_s.	 For
  _C_l_i_p_B_y_C_h_i_l_d_r_e_n, both source and destination windows are additionally
  clipped by all viewable _I_n_p_u_t_O_u_t_p_u_t children.	 For _I_n_c_l_u_d_e_I_n_f_e_r_i_o_r_s, nei-
  ther source nor destination window is	clipped	by inferiors.  This will
  result in including subwindow	contents in the	source and drawing through
  subwindow boundaries of the destination.  The	use of _I_n_c_l_u_d_e_I_n_f_e_r_i_o_r_s	on a
  window of one	depth with mapped inferiors of differing depth is not ille-
  gal, but the semantics are undefined by the core protocol.

  The fill-rule	defines	what pixels are	inside (drawn) for paths given in
  _X_F_i_l_l_P_o_l_y_g_o_n requests	and can	be set to _E_v_e_n_O_d_d_R_u_l_e or _W_i_n_d_i_n_g_R_u_l_e.  For
  _E_v_e_n_O_d_d_R_u_l_e, a point is inside if an infinite	ray with the point as origin
  crosses the path an odd number of times.  For	_W_i_n_d_i_n_g_R_u_l_e, a point is
  inside if an infinite	ray with the point as origin crosses an	unequal
  number of clockwise and counterclockwise directed path segments.  A clock-
  wise directed	path segment is	one that crosses the ray from left to right
  as observed from the point.  A counterclockwise segment is one that crosses
  the ray from right to	left as	observed from the point.  The case where a
  directed line	segment	is coincident with the ray is uninteresting because
  you can simply choose	a different ray	that is	not coincident with a seg-
  ment.

  For both _E_v_e_n_O_d_d_R_u_l_e and _W_i_n_d_i_n_g_R_u_l_e,	a point	is infinitely small, and the
  path is an infinitely	thin line.  A pixel is inside if the center point of
  the pixel is inside and the center point is not on the boundary.  If the
  center point is on the boundary, the pixel is	inside if and only if the
  polygon interior is immediately to its right (x increasing direction).
  Pixels with centers on a horizontal edge are a special case and are inside
  if and only if the polygon interior is immediately below (y increasing
  direction).

  The arc-mode controls	filling	in the _X_F_i_l_l_A_r_c_s function and can be set to
  _A_r_c_P_i_e_S_l_i_c_e or _A_r_c_C_h_o_r_d.  For	_A_r_c_P_i_e_S_l_i_c_e, the arcs are pie-slice filled.
  For _A_r_c_C_h_o_r_d,	the arcs are chord filled.

  The graphics-exposure	flag controls _G_r_a_p_h_i_c_s_E_x_p_o_s_e event generation for
  _X_C_o_p_y_A_r_e_a and	_X_C_o_p_y_P_l_a_n_e requests (and any similar requests defined by
  extensions).

DIAGNOSTICS

  _B_a_d_A_l_l_o_c  The	server failed to allocate the requested	resource or server
	    memory.

  _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_F_o_n_t   A value for	a Font or GContext argument does not name a defined
	    Font.

  _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_P_i_x_m_a_p A value for	a Pixmap argument does not name	a defined Pixmap.

  _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
  AllPlanes(3X11), XCopyArea(3X11), XCreateRegion(3X11), XDrawArc(3X11),
  XDrawLine(3X11), XDrawRectangle(3X11), XDrawText(3X11),
  XFillRectangle(3X11),	XQueryBestSize(3X11), XSetArcMode(3X11),
  XSetClipOrigin(3X11),	XSetFillStyle(3X11), XSetFont(3X11),
  XSetLineAttributes(3X11), XSetState(3X11), XSetTile(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





















