Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xcb_create_glyph_cursor_checked(3) [centos man page]

xcb_create_glyph_cursor(3)					   XCB Requests 					xcb_create_glyph_cursor(3)

NAME
xcb_create_glyph_cursor - create cursor SYNOPSIS
#include <xcb/xproto.h> Request function xcb_void_cookie_t xcb_create_glyph_cursor(xcb_connection_t *conn, xcb_cursor_t cid, xcb_font_t source_font, xcb_font_t mask_font, uint16_t source_char, uint16_t mask_char, uint16_t fore_red, uint16_t fore_green, uint16_t fore_blue, uint16_t back_red, uint16_t back_green, uint16_t back_blue); REQUEST ARGUMENTS
conn The XCB connection to X11. cid The ID with which you will refer to the cursor, created by xcb_generate_id. source_font In which font to look for the cursor glyph. mask_font In which font to look for the mask glyph. source_char The glyph of source_font to use. mask_char The glyph of mask_font to use as a mask: Pixels which are set to 1 define which source pixels are displayed. All pixels which are set to 0 are not displayed. fore_red The red value of the foreground color. fore_green The green value of the foreground color. fore_blue The blue value of the foreground color. back_red The red value of the background color. back_green The green value of the background color. back_blue The blue value of the background color. DESCRIPTION
Creates a cursor from a font glyph. 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. All pixels which are set to 1 in the source will use the foreground color (as specified by fore_red, fore_green and fore_blue). All pixels set to 0 will use the background color (as specified by back_red, back_green and back_blue). RETURN VALUE
Returns an xcb_void_cookie_t. Errors (if any) have to be handled in the event loop. If you want to handle errors directly with xcb_request_check instead, use xcb_create_glyph_cursor_checked. See xcb-requests(3) for details. ERRORS
xcb_alloc_error_t The X server could not allocate the requested resources (no memory?). xcb_font_error_t The specified source_font or mask_font does not exist. xcb_value_error_t Either source_char or mask_char are not defined in source_font or mask_font, respectively. SEE ALSO
xcb-requests(3) AUTHOR
Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. XCB
2014-06-10 xcb_create_glyph_cursor(3)

Check Out this Related Man Page

XCreateGlyphCursor()													      XCreateGlyphCursor()

Name
  XCreateGlyphCursor - create a cursor from font glyphs.

Synopsis
  Cursor XCreateGlyphCursor(display, source_font, mask_font, source_char, mask_char, foreground_color,	background_color)
 Display *display;
 Font source_font, mask_font;
 unsigned int source_char, mask_char;
 XColor *foreground_color;
 XColor *background_color;

Arguments
  display   Specifies a connection to an X server; returned from XOpenDisplay().

  source_font
	    Specifies the font from which a character is to be used for the cursor.

  mask_font Specifies the mask font or None.

  source_char
	    Specifies the index into the cursor shape font.

  mask_char Specifies the index into the mask shape font.  Optional; specify 0 if not needed.

  foreground_color
	    Specifies the red, green, and blue (RGB) values for the foreground.

  background_color
	    Specifies the red, green, and blue (RGB) values for the background.

Returns
  The created cursor.

Description
  XCreateGlyphCursor()	is similar to XCreatePixmapCursor(), but the source and mask bitmaps are obtained from separate font characters, per-
  haps in separate fonts.  The mask font and character are optional.  If mask_char is not specified, all pixels of the source are displayed.

  The x offset for the hotspot of the created cursor is the left-bearing for the source character, and the y offset is the ascent, each  mea-
  sured from the upper-left corner of the bounding rectangle of the character.

  The  origins	of the source and mask (if it is defined) characters are positioned coincidently and define the hotspot.  The source and mask
  need not have the same bounding box metrics, and there is no restriction on the placement of the hotspot relative to the bounding boxes.

  Note that source_char and mask_char are of type unsigned int, not of type XChar2b.  For two-byte matrix fonts,  source_char  and  mask_char
  should be formed with the byte1 member in the most significant byte and the byte2 member in the least significant byte.

  You can free the fonts with XFreeFont() if they are no longer needed after creating the glyph cursor.

  For more information on fonts and cursors, see Volume One, Chapter 6, Drawing Graphics and Text.

Structures
     typedef struct {
	 unsigned long pixel;
	 unsigned short red, green, blue;
	 char flags;		/* DoRed, DoGreen, DoBlue */
	 char pad;
     } XColor;

Errors
  BadAlloc

  BadFont

  BadValue  source_char not defined in source_font.
	    mask_char not defined in mask_font (if mask_font defined).

See Also
  XCreateFontCursor(),	XCreatePixmapCursor(), XDefineCursor(), XFreeCursor(), XQueryBestCursor(), XQueryBestSize(), XRecolorCursor(), XUnde-
  fineCursor().

Xlib - Cursors														      XCreateGlyphCursor()
Man Page