XCreateFontCursor(3X11) | XLIB FUNCTIONS | XCreateFontCursor(3X11) |
̾Á°¶
XCreateFontCursor, XCreatePixmapCursor, XCreateGlyphCursor - ¥«¡¼¥½¥ë¤ÎÀ¸À®
½ñ¼°¶
#include <X11/cursorfont.h>
Cursor XCreateFontCursor(display, shape)
Display *display;
unsigned int shape;
Cursor XCreatePixmapCursor(display, source,
mask, foreground_color, background_color, x,
y)
Display *display;
Pixmap source;
Pixmap mask;
XColor *foreground_color;
XColor *background_color;
unsigned int x, y;
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;
°ú¤¿ô¶
- background_color
- ¥½¡¼¥¹¤ÎÇØ·Ê¿§¤ËÂФ¹¤ë RGB Ãͤò»ØÄê¡£
- display
- X ¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤ò»ØÄê¡£
- foreground_color
- ¥½¡¼¥¹¤ÎÁ°·Ê¿§¤ËÂФ¹¤ë RGB Ãͤò»ØÄê¡£
- mask
- ¥«¡¼¥½¥ë¤Î¥½¡¼¥¹¤Î¤¦¤Áɽ¼¨¤µ¤ì¤ë¥Ó¥Ã¥È¡¢¤¢¤ë¤¤¤Ï None ¤ò»ØÄê¡£
- mask_char
- ¥Þ¥¹¥¯¤Î¤¿¤á¤Î¥°¥ê¥Õʸ»ú¤ò»ØÄê¡£
- mask_font
- ¥Þ¥¹¥¯¤Î¥°¥ê¥Õ¤Î¤¿¤á¤Î¥Õ¥©¥ó¥È¤« None ¤ò»ØÄê¡£
- shape
- ¥«¡¼¥½¥ë¤Î·Á¾õ¤ò»ØÄê¡£
- source
- ¥½¡¼¥¹¥«¡¼¥½¥ë¤Î·Á¾õ¤ò»ØÄê¡£
- source_char
- ¥½¡¼¥¹¤ËÂФ¹¤ëʸ»ú¥°¥ê¥Õ¤ò»ØÄê¡£
- source_font
- so-Specifies the font for the source glyph. ¥½¡¼¥¹¥°¥ê¥Õ¤Î¤¿¤á¤Î¥Õ¥©¥ó¥È¤ò»ØÄê¡£
- x
-
- y
- x, y ºÂɸ¤ò»ØÄꤹ¤ë¡£¤³¤ì¤Ï¥½¡¼¥¹¤Î¸¶ÅÀ¤«¤é¤ÎÁêÂкÂɸ¤Ç¥Û¥Ã¥È¥¹¥Ý¥Ã¥È(hotspot)¤ò¼¨¤¹¡£
ÀâÌÀ¶
X ¤Ïɸ½àŪ¤Ê¥«¡¼¥½¥ë·Á¾õ¤Î¥»¥Ã¥È¤òÆüì¤Ê¥Õ¥©¥ó¥È¤È¤·¤ÆÄ󶡤·¤Æ¤¤¤ë¡£ ¤³¤ì¤Ï¥«¡¼¥½¥ë¤È¸Æ¤Ð¤ì¤Æ¤¤¤ë¡£ ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æ¥«¡¼¥½¥ë¤òÍѤ¤¤ë¤È¤è¤¤¡£ ¤Ê¤¼¤Ê¤é¡¢¥Õ¥©¥ó¥È¤Ï¸Ä¡¹¤Î¥Ç¥£¥¹¥×¥ì¥¤¤Î¼ïÎà¤Ë±þ¤¸¤Æ¥«¥¹¥¿¥Þ¥¤¥º¤¹¤ë¤³ ¤È¤¬¤Ç¤¤ë¤«¤é¤Ç¤¢¤ë¡£ °ú¤¿ô shape ¤Ç¤Ïɸ½à¥Õ¥©¥ó¥È¤Î¤É¤Î¥°¥ê¥Õ¤ò»È¤¦¤Î¤«¤ò»ØÄꤹ¤ë¡£
¥Û¥Ã¥È¥¹¥Ý¥Ã¥È¤Ï¥«¡¼¥½¥ë¥Õ¥©¥ó¥È¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤ë¾ðÊ󤫤éÆÀ¤é¤ì¤ë¡£ ¥«¡¼¥½¥ë¤Î½é´ü¾õÂ֤ο§¤Ï¡¢Á°·Ê¿§¤¬¹õ¤ÇÇØ·Ê¿§¤¬Çò¤Ç¤¢¤ë( XRecolorCursor ¤ò»²¾È)¡£
XCreateFontCursor ¤Ï¥¨¥é¡¼ BadAlloc, BadValue ¤òµ¯¤³¤¹¤³¤È¤¬¤¢¤ë¡£
´Ø¿ô XCreatePixmapCursor ¤Ï¥«¡¼¥½¥ë¤òÀ¸À®¤·¡¢¤³¤ì¤ËÂбþ¤¹¤ë¥«¡¼¥½¥ëID¤òÊÖ¤¹¡£ X ¥µ¡¼¥Ð¤¬ StaticGray ¤ä GrayScale ¤Î¥¹¥¯¥ê¡¼¥ó¤·¤«»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢Á°·Ê¿§¤ÈÇØ·Ê¿§¤Î RGB ÃÍ¤Ï foreground_color ¤È background_color ¤ò»È¤Ã¤Æ»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ ¥½¡¼¥¹¥Ô¥Ã¥¯¥¹¥Þ¥Ã¥×Æâ¤Ç1¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¥Ô¥¯¥»¥ë¤ËÂФ·¤Æ¤ÏÁ°·Ê¿§¤¬ »ÈÍѤµ¤ì¡¢0¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¥Ô¥¯¥»¥ë¤ËÂФ·¤Æ¤ÏÇØ·Ê¿§¤¬»ÈÍѤµ¤ì¤ë¡£ »ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢¥½¡¼¥¹¤È¥Þ¥¹¥¯¤Îξ¼Ô¤Ï¿¼¤µ(depth)¤¬1¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê ¤¤(¤µ¤â¤Ê¤¯¤Ð BadMatch ¥¨¥é¡¼¤È¤Ê¤ë)¤¬¡¢¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤ÏǤ°Õ¤Î¤â¤Î¤Ç¤è¤¤¡£ °ú¤¿ô mask ¤Ï¥«¡¼¥½¥ë¤Î·Á¾õ¤òÄêµÁ¤¹¤ë¡£ ¥Þ¥¹¥¯Æâ¤Ç1¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¥Ô¥¯¥»¥ë¤Ï¡¢¥½¡¼¥¹¤Î¤É¤Î¥Ô¥¯¥»¥ë¤¬É½¼¨¤µ ¤ì¤ë¤«¤òÄêµÁ¤·¡¢0¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¥Ô¥¯¥»¥ë¤Ï̵»ë¤µ¤ì¤ë¥Ô¥¯¥»¥ë¤òÄêµÁ ¤¹¤ë¡£ ¥Þ¥¹¥¯¤¬Í¿¤¨¤é¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢¥½¡¼¥¹¤ÎÁ´¤Æ¤Î¥Ô¥¯¥»¥ë¤¬É½¼¨¤µ¤ì¤ë¡£ ¤â¤·¥Þ¥¹¥¯¤òÍ¿¤¨¤ë¤Ê¤é¤Ð¡¢¥Þ¥¹¥¯¤Ï°ú¤¿ô source ¤ÇÄêµÁ¤µ¤ì¤ë¥Ô¥Ã¥¯¥¹¥Þ¥Ã ¥×¤ÈƱ¤¸Â礤µ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¥¨¥é¡¼ BadMatch ¤È¤Ê¤ë¡£ ¥Û¥Ã¥È¥¹¥Ý¥Ã¥È¤Ï¥½¡¼¥¹¤ÎÆâÉô¤ÎÅÀ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¥¨ ¥é¡¼ BadMatch ¤È¤Ê¤ë¡£
¥Ç¥£¥¹¥×¥ì¥¤¤ÎÀ©¸Â¤òËþ¤¿¤¹¤¿¤á¡¢¥«¡¼¥½¥ë¤Î¹½À®Í×ÁǤËÂФ·¤ÆǤ°Õ¤ÎÊÑ´¹¤¬ ¹Ô¤ï¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£ ¥Ô¥Ã¥¯¥¹¥Þ¥Ã¥×¤ÏÌÀ¼¨Åª¤Ê»²¾È¤¬¤½¤ì°Ê¾å¤µ¤ì¤Ê¤¤¤³¤È¤¬Ê¬¤«¤Ã¤¿»þÅÀ¤Ç¡¢¤¹ ¤°¤Ë²òÊü¤·¤Æ¤è¤¤¡£ ¤½¤Î¸å¤Ë¥½¡¼¥¹¤ä¥Þ¥¹¥¯¤Î¥Ô¥Ã¥¯¥¹¥Þ¥Ã¥×¤Ø¤ÎÉÁ²è¤ò¹Ô¤Ã¤¿¾ì¹ç¤Î¥«¡¼¥½¥ë¤Ø ¤Î±Æ¶Á¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£ X ¥µ¡¼¥Ð¤Ï¥Ô¥Ã¥¯¥¹¥Þ¥Ã¥×¤Î¥³¥Ô¡¼¤òºî¤ë¤«¤â¤·¤ì¤Ê¤¤¤·¡¢ºî¤é¤Ê¤¤¤«¤â¤·¤ì ¤Ê¤¤¡£
XCreatePixmapCursor ¤Ï¥¨¥é¡¼ BadAlloc, BadPixmap ¤òµ¯¤³¤¹¤³¤È¤¬¤¢¤ë¡£
´Ø¿ô XCreateGlyphCursor ¤Ï¥½¡¼¥¹¤È¥Þ¥¹¥¯¤Î¥Ó¥Ã¥È¥Þ¥Ã¥×¤ò»ØÄꤷ¤¿¥Õ¥©¥ó¥È¥°¥ê¥Õ¤«¤éÆÀ¤ëÅÀ¤ò½ü¤¡¢ XCreatePixmapCursor ¤ÈƱÍͤδؿô¤Ç¤¢¤ë¡£ source_char ¤Ï source_font ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥°¥ê¥Õ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢¤½ ¤¦¤Ç¤Ê¤±¤ì¤Ð¥¨¥é¡¼ BadValue ¤È¤Ê¤ë¡£ mask_font ¤òÍ¿¤¨¤ë¾ì¹ç¤Ï¡¢mask_char ¤Ï mask_font ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥°¥ê ¥Õ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¥¨¥é¡¼ BadValue ¤È¤Ê¤ë¡£ mask_font ¤È mask_char ¤Ï»ØÄꤷ¤Ê¤¯¤Æ¤â¤«¤Þ¤ï¤Ê¤¤¡£ source_char ¤È(¤â¤·ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤Ê¤é¤Ð)mask_char ¤Î¥°¥ê¥Õ¤Î¸¶ÅÀ¤Ï¡¢°ì Ãפ¹¤ë¤è¤¦ÇÛÃÖ¤µ¤ì¡¢¥Û¥Ã¥È¥¹¥Ý¥Ã¥È¤òÄêµÁ¤¹¤ë¡£ source_char ¤È mask_char ¤È¤Ç¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥Ü¥Ã¥¯¥¹¤ÎÀ£Ë¡¤¬Æ±¤¸¤Ç¤¢¤ë ɬÍפÏ̵¤¯¡¢¥Ð¥¦¥ó¥Ç¥£¥ó¥°¥Ü¥Ã¥¯¥¹¤ËÂФ·¤Æ¤Î¥Û¥Ã¥È¥¹¥Ý¥Ã¥È¤ÎÇÛÃÖ¤ÎÀ©¸Â ¤Ï̵¤¤¡£ mask_char ¤¬Í¿¤¨¤é¤ì¤Ê¤¤¾ì¹ç¡¢¥½¡¼¥¹¤ÎÁ´¤Æ¤Î¥Ô¥Ã¥¯¥¹¥Þ¥Ã¥×¤¬É½¼¨¤µ¤ì¤ë¡£ ¥Õ¥©¥ó¥È¤ÏÌÀ¼¨Åª¤Ê»²¾È¤¬¤½¤ì°Ê¾å¤µ¤ì¤Ê¤¤¤³¤È¤¬Ê¬¤«¤Ã¤¿»þÅÀ¤Ç¡¢¤¹¤°¤Ë XFreeFont ¤ò¸Æ¤Ó½Ð¤·¤Æ²òÊü¤·¤Æ¤è¤¤¡£
2¥Ð¥¤¥È¹ÔÎó·Á¼°¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¥Õ¥©¥ó¥È¤Ë¤Ä¤¤¤Æ¤Ï¡¢16¥Ó¥Ã¥È¤ÎÃÍ¤Ï byte1 ¥á¥ó¥Ð¤¬ºÇ¾å°Ì¥Ð¥¤¥È¤Ç byte2 ¤¬ºÇ²¼°Ì¥Ó¥Ã¥È¤È¤Ê¤ë¤è¤¦¤Ë¤·¤Ê¤±¤ì ¤Ð¤Ê¤é¤Ê¤¤¡£
XCreateGlyphCursor ¤Ï¥¨¥é¡¼ BadAlloc, BadFont, BadValue ¤òµ¯¤³¤¹¤³¤È¤¬¤¢¤ë¡£
ÊÖ¤êÃͶ
- BadAlloc
- Í׵ᤵ¤ì¤¿¥ê¥½¡¼¥¹¤ä¥µ¡¼¥Ð¥á¥â¥ê¤Î³ä¤êÅö¤Æ¤Ë¥µ¡¼¥Ð¤¬¼ºÇÔ¤·¤¿¡£
- BadFont
- °ú¤¿ô Font ¤ä GC ¤ËÂФ¹¤ëÃͤ¬ÄêµÁ¤µ¤ì¤¿ Font ¤Ç¤Ï¤Ê¤¤¡£
- BadMatch
- °ú¤¿ô¤ä°ú¤¿ô¤ÎÁȤÏÀµ¤·¤¤·¿¡¦ÈϰϤò»ý¤Ã¤Æ¤¤¤ë¤¬¡¢¤½¤Î¥ê¥¯¥¨¥¹¥È¤¬Í׵᤹¤ë ¾¤Î¾ò·ï¤ËŬ¹ç¤Ç¤¤Ê¤«¤Ã¤¿¡£
- BadPixmap
- °ú¤¿ô Pixmap ¤ËÂФ¹¤ëÃͤ¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë Pixmap ¤Ç¤Ï¤Ê¤¤¡£
- BadValue
- »ØÄꤵ¤ì¤¿¿ôÃͤˡ¢¥ê¥¯¥¨¥¹¥È¤ÎµöÍÆÈϰϤò±Û¤¨¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ë¡£°ú¤¿ô¤ËÂÐ ¤·¤ÆÆÃÄê¤ÎÈϰϤ¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢°ú¤¿ô¤Î·¿¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤ÎÈÏ °Ï¤¬µö¤µ¤ì¤ë¡£ÁªÂò»è¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë°ú¤¿ô¤Ï¤³¤Î¥¨¥é¡¼¤òµ¯¤³¤¹¤³¤È¤¬ ¤¢¤ë¡£
´ØÏ¢¹àÌܶ
XDefineCursor(3X11), XLoadFont(3X11), XRecolorCursor(3X11)
Xlib - C Language X Interface
Release 6.5 | X Version 11 |