


XCreateFontCursor(3X11)				      XCreateFontCursor(3X11)
X11R5									X11R5



NAME
  XCreateFontCursor, XCreatePixmapCursor, XCreateGlyphCursor - create cursors

SYNTAX
  #include <X11/cursorfont.h>
  Cursor XCreateFontCursor(_d_i_s_p_l_a_y, _s_h_a_p_e)
	Display	*_d_i_s_p_l_a_y;
	unsigned int _s_h_a_p_e;

  Cursor XCreatePixmapCursor(_d_i_s_p_l_a_y, _s_o_u_r_c_e, _m_a_s_k, _f_o_r_e_g_r_o_u_n_d__c_o_l_o_r,
  _b_a_c_k_g_r_o_u_n_d__c_o_l_o_r, _x, _y)
	Display	*_d_i_s_p_l_a_y;
	Pixmap _s_o_u_r_c_e;
	Pixmap _m_a_s_k;
	XColor *_f_o_r_e_g_r_o_u_n_d__c_o_l_o_r;
	XColor *_b_a_c_k_g_r_o_u_n_d__c_o_l_o_r;
	unsigned int _x,	_y;

  Cursor XCreateGlyphCursor(_d_i_s_p_l_a_y, _s_o_u_r_c_e__f_o_n_t, _m_a_s_k__f_o_n_t, _s_o_u_r_c_e__c_h_a_r,
  _m_a_s_k__c_h_a_r,
			     _f_o_r_e_g_r_o_u_n_d__c_o_l_o_r, _b_a_c_k_g_r_o_u_n_d__c_o_l_o_r)
	Display	*_d_i_s_p_l_a_y;
	Font _s_o_u_r_c_e__f_o_n_t, _m_a_s_k__f_o_n_t;
	unsigned int _s_o_u_r_c_e__c_h_a_r, _m_a_s_k__c_h_a_r;
	XColor *_f_o_r_e_g_r_o_u_n_d__c_o_l_o_r;
	XColor *_b_a_c_k_g_r_o_u_n_d__c_o_l_o_r;

ARGUMENTS

  _b_a_c_k_g_r_o_u_n_d__c_o_l_o_r
	    Specifies the RGB values for the background	of the source.

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

  _f_o_r_e_g_r_o_u_n_d__c_o_l_o_r
	    Specifies the RGB values for the foreground	of the source.

  _m_a_s_k	    Specifies the cursor's source bits to be displayed or _N_o_n_e.

  _m_a_s_k__c_h_a_r Specifies the glyph	character for the mask.

  _m_a_s_k__f_o_n_t Specifies the font for the mask glyph or _N_o_n_e.

  _s_h_a_p_e	    Specifies the shape	of the cursor.

  _s_o_u_r_c_e    Specifies the shape	of the source cursor.

  _s_o_u_r_c_e__c_h_a_r
	    Specifies the character glyph for the source.

  _s_o_u_r_c_e__f_o_n_t
	    Specifies the font for the source glyph.

  _x
  _y	    Specify the	x and y	coordinates, which indicate the	hotspot	rela-
	    tive to the	source's origin.


DESCRIPTION
  X provides a set of standard cursor shapes in	a special font named cursor.
  Applications are encouraged to use this interface for	their cursors because
  the font can be customized for the individual	display	type.  The shape
  argument specifies which glyph of the	standard fonts to use.

  The hotspot comes from the information stored	in the cursor font.  The ini-
  tial colors of a cursor are a	black foreground and a white background	(see
  _X_R_e_c_o_l_o_r_C_u_r_s_o_r).

  _X_C_r_e_a_t_e_F_o_n_t_C_u_r_s_o_r can	generate _B_a_d_A_l_l_o_c and _B_a_d_V_a_l_u_e errors.

  The _X_C_r_e_a_t_e_P_i_x_m_a_p_C_u_r_s_o_r function creates a cursor and	returns	the cursor ID
  associated with it.  The foreground and background RGB values	must be
  specified using foreground_color and background_color, even if the X server
  only has a _S_t_a_t_i_c_G_r_a_y	or _G_r_a_y_S_c_a_l_e screen.  The foreground color is used
  for the pixels set to	1 in the source, and the background color is used for
  the pixels set to 0.	Both source and	mask, if specified, must have depth
  one (or a _B_a_d_M_a_t_c_h error results) but	can have any root.  The	mask argument
  defines the shape of the cursor.  The	pixels set to 1	in the mask define
  which	source pixels are displayed, and the pixels set	to 0 define which
  pixels are ignored.  If no mask is given, all	pixels of the source are
  displayed.  The mask,	if present, must be the	same size as the pixmap
  defined by the source	argument, or a _B_a_d_M_a_t_c_h	error results.	The hotspot
  must be a point within the source, or	a _B_a_d_M_a_t_c_h error results.

  The components of the	cursor can be transformed arbitrarily to meet display
  limitations.	The pixmaps can	be freed immediately if	no further explicit
  references to	them are to be made.  Subsequent drawing in the	source or
  mask pixmap has an undefined effect on the cursor.  The X server might or
  might	not make a copy	of the pixmap.

  _X_C_r_e_a_t_e_P_i_x_m_a_p_C_u_r_s_o_r can generate _B_a_d_A_l_l_o_c and	_B_a_d_P_i_x_m_a_p errors.

  The _X_C_r_e_a_t_e_G_l_y_p_h_C_u_r_s_o_r function is similar to	_X_C_r_e_a_t_e_P_i_x_m_a_p_C_u_r_s_o_r except
  that the source and mask bitmaps are obtained	from the specified font
  glyphs.  The source_char must	be a defined glyph in source_font, or a	_B_a_d_-
  _V_a_l_u_e	error results.	If mask_font is	given, mask_char must be a defined
  glyph	in mask_font, or a _B_a_d_V_a_l_u_e error results.  The	mask_font and charac-
  ter are optional.  The origins of the	source_char and	mask_char (if
  defined) glyphs are positioned coincidentally	and define the hotspot.	The
  source_char and mask_char need not have the same bounding box	metrics, and
  there	is no restriction on the placement of the hotspot relative to the
  bounding boxes. If no	mask_char is given, all	pixels of the source are
  displayed.  You can free the fonts immediately by calling _X_F_r_e_e_F_o_n_t if no
  further explicit references to them are to be	made.

  For 2-byte matrix fonts, the 16-bit value should be formed with the byte1
  member in the	most-significant byte and the byte2 member in the least-
  significant byte.

  _X_C_r_e_a_t_e_G_l_y_p_h_C_u_r_s_o_r can generate _B_a_d_A_l_l_o_c, _B_a_d_F_o_n_t, and _B_a_d_V_a_l_u_e errors.

DIAGNOSTICS

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

  _B_a_d_F_o_n_t   A value for	a Font or GContext argument does not name a defined
	    Font.

  _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
  XDefineCursor(3X11), XLoadFont(3X11),	XRecolorCursor(3X11)
  _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e

























































