LECTURE 18 ¶ë·Á¤Ç¤Ê¤¤¥¦¥£¥ó¥É¥¦¤Îɽ¼¨

¡û ¤Ï¤¸¤á¤Ë

ÆÍÁ³¤Ç¤¹¤¬¡¢¤³¤ì¤Þ¤Ç¤Ëɽ¼¨¤·¤Æ¤­¤¿¥¦¥£¥ó¥É¥¦¤ÏÁ´¤Æ»Í³Ñ·Ï¤Ç¤·¤¿¡£¤Þ¤¢º¤¤ë¤³¤È¤Ï¤½¤ó¤Ê¤Ë̵¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¡¢Î㤨¤Ð´Ý¤¤¥Ü¥¿¥ó¤ò¥¦¥£¥ó¥É¥¦¤È¤·¤Æºî¤ì¤Ê¤¤¤Î¤«¡©¤È¤«¡¢¤¢¤Î´Ý¤¤»þ·×¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤É¤¦¤ä¤Ã¤Æ¤¢¤Î·Á¤Î¥¦¥£¥ó¥É¥¦¤òɽ¼¨¤·¤Æ¤¤¤ë¤Î¤«¡© ¤Ê¤É¤È¤¤¤Ã¤¿¤Õ¤È¤·¤¿µ¿Ì䤬ͯ¤¤¤ÆÍè¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¤«¡©

X ¤Ë¤Ï³ÈÄ¥µ¡Ç½¤È¸Æ¤Ð¤ì¤ëµ¡Ç½¤¬¤¢¤Ã¤Æ¡¢¤½¤ÎÃæ¤Î°ì¤Ä¤Ç¤¢¤ë SHAPE Extension ¤È¤¤¤¦µ¡Ç½¤ò»È¤¦¤³¤È¤Ç»Í³Ñ·Á°Ê³°¤Î¥¦¥£¥ó¥É¥¦¤òɽ¼¨¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£

¤³¤³¤Ç¤Ï¡¢SHAPE Extension ¤ò»ÈÍѤ¹¤ëºÝ¤ÎÁ°Äó»ö¹à¤ò¤Þ¤ºÀâÌÀ¤·¤¿¸å¤Ë SHAPE Extension ¤Î»È¤¤Êý¤òÀâÌÀ¤·¤Þ¤¹¡£

¡û bounding region ¤È clip region

SHAPE extension ¤«¤éƳÆþ¤µ¤ì¤¿¹Í¤¨Êý¤Ç¤¹¤¬¡¢Á´¤Æ¤Î Window ¤Ï bounding region ¤È clip region ¤È¸Æ¤Ð¤ì¤ëÎΰ褫¤é¹½À®¤µ¤ì¤Þ¤¹¡£

bounding region ¤È¤Ï¡¢¥Ü¡¼¥À¤ò´Þ¤ó¤À Window ¤Î·Á¤òɽ¤¹Îΰè¤òɽ¤·¤Þ¤¹¡£clip region ¤Ï bounding region ¤Î°ìÉô¤Ç¤¢¤ê¡¢¥°¥é¥Õ¥£¥Ã¥¯¥¹¤òÉÁ²è¤·¤¿¤ê»Ò¥¦¥£¥ó¥É¥¦¤òɽ¼¨¤·¤¿¤ê¤Ç¤­¤ëÎΰè¤òɽ¤·¤Þ¤¹¡£¤è¤Ã¤Æ bounding region ¤È clip region ¤Î´Ö¤Ë¶´¤Þ¤ì¤ëÎΰ褬¥Ü¡¼¥À¤È¤Ê¤ê¤Þ¤¹¡£

018region.jpg

Ä̾ï¤Î Window ¤Ç¤Ï bounding region ¤ª¤è¤Ó clip region ¶¦¤Ë¶ë·Á¤Ç¤¢¤ë¤È¹Í¤¨¤ì¤Ð¡¢Á´¤Æ¤Î·Á¤Î Window ¤Ë¤Ä¤¤¤ÆƱÍͤ˹ͤ¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤Ê¤ª¡¢¶ë·Á¤Î Window ¤Î bounding region ¤ª¤è¤Ó clip region ¤ò¤½¤ì¤¾¤ì¥Ç¥Õ¥©¥ë¥È¤Î bounding region¡¢clip region ¤È¸Æ¤Ó¤Þ¤¹¡£

bounding region ¤ª¤è¤Ó clip region ¤Ï¼«Í³¤ËÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£²¾¤Ë¡¢ºîÀ®¤·¤¿ Window ¤è¤ê¤âÂ礭¤¤Îΰè¤ò bounding region ¤ª¤è¤Ó clip region ¤È¤·¤ÆÀßÄꤷ¤¿¾ì¹ç¡¢Window ¤«¤é¤Ï¤ß½Ð¤ëÉôʬ¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£¤·¤«¤· Window ¤Îɽ¼¨Îΰè¤ÏưŪ¤Ë·×»»¤µ¤ì¤ë¤¿¤á¡¢Window ¤ÎÂ礭¤µ¤ò¥Þ¥¦¥¹¤Î¥É¥é¥Ã¥°¤Ê¤É¤ÇÂ礭¤¯¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¤è¤êÂ礭¤Ê region ¤¬É½¼¨¤µ¤ì¤ëÍͤˤʤê¤Þ¤¹¡£

¡û ¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à

Èó¶ë·Á¤Î¥¦¥£¥ó¥É¥¦¤ò¥Ü¥¿¥ó¤È¤·¤Æɽ¼¨¤·¡¢¥¯¥ê¥Ã¥¯¤¹¤ëÅ٤˥ܥ¿¥ó¤Îɽ¼¨¿§¤òÊѲ½¤µ¤»¤ë¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à xshape.c ¤Ç¤¹¡£¤Þ¤¿¡¢»ÈÍѤ·¤Æ¤¤¤ë X11 ¥Ó¥Ã¥È¥Þ¥Ã¥× btn_bd.h ¤ª¤è¤Ó btn_cl.h ¤âÊ»¤»¤Æ¥ê¥ó¥¯¤·¤Æ¤ª¤­¤Þ¤¹¡£¥Ö¥é¥¦¥¶¾å¤Ï¥Ø¥Ã¥À¤ÎÆâÍƤǤϤʤ¯¥Ó¥Ã¥È¥Þ¥Ã¥×¥¤¥á¡¼¥¸¤¬É½¼¨¤µ¤ì¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£¤½¤Î¾ì¹ç¤Ï¥½¡¼¥¹¤ò¸«¤ë¤Ê¤É¤·¤Æ²¼¤µ¤¤¡£¤Ï¤¸¤á¤Ë ¤Î¥Ú¡¼¥¸¤«¤é¡¢Á´¤Æ¤Î¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¸Ç¤á¤¿ tar ¥Ü¡¼¥ë¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£

¤³¤ì¤Þ¤Ç¤Î¥µ¥ó¥×¥ë¤Ç¤Ï X ¤Î¥é¥¤¥Ö¥é¥ê¤Î¥ê¥ó¥¯»ØÄê¤Ï -lX11 ¤Î¤ß¤ÇÎɤ«¤Ã¤¿¤Î¤Ç¤¹¤¬¡¢¤³¤³¤Ç¤Ï³ÈÄ¥µ¡Ç½¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Î¤Ç¡¢-lXext ¤âƱ»þ¤Ë»ØÄꤷ¤Æ²¼¤µ¤¤¡£

gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o xshape xshape.c -lX11 -lXext

X11 ¥Ó¥Ã¥È¥Þ¥Ã¥×¥Ç¡¼¥¿¤Ï bitmap ¥³¥Þ¥ó¥É¤Çºî¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤¬¡¢ËͤÏÌÌÅݤÀ¤Ã¤¿¤Î¤Ç¡¢¤Þ¤º Xlib ¤Ç±ß¤ÈĹÊý·Á¤ò»È¤Ã¤Æ¥Ü¥¿¥ó¤Î·Á¤òɽ¼¨¤·¤¿¥¦¥£¥ó¥É¥¦¤òºî¤Ã¤Æ¤½¤ì¤ò²èÁü¥Ä¡¼¥ë¤Ç¥À¥ó¥×¤·¡¢Çò¹õ 2 ¿§¤Î X11 ¥Ó¥Ã¥È¥Þ¥Ã¥×¤È¤·¤ÆÊݸ¤·¤Þ¤·¤¿¡£

¼Â¹Ôľ¸å¤Ï¡¢ÇØ·Ê¿§¤¬ÀĤΥ¦¥£¥ó¥É¥¦¾å¤ËÇò¿§¤ÇÈó¶ë·Á¤Î¥¦¥£¥ó¥É¥¦ ( ¥Ü¥¿¥ó ) ¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£¥Ü¥¿¥ó¤ò¥Þ¥¦¥¹¤Îº¸¥Ü¥¿¥ó¤Ç¥¯¥ê¥Ã¥¯¤¹¤ëÅ٤ˡ¢Çò=>ÀÖ¡¢ÀÖ=>Çò¤Èɽ¼¨¿§¤¬ÊѲ½¤·¤Þ¤¹¡£¥¦¥£¥ó¥É¥¦¤Ë´Ø¤ï¤é¤º¡¢¥Þ¥¦¥¹¤Î±¦¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È½ªÎ»¤·¤Þ¤¹¡£

018white.jpg

¢¬¤È¢­¤¬¸ò¸ß¤ËÀÚ¤êÂؤï¤ê¤Þ¤¹¡£

018red.jpg

--- xshape.c ---

    1	/*
    2	 * Shape Extension ¤ò»È¤Ã¤Æ¶ë·Á¤Ç¤Ï¤Ê¤¤ Window ¤òɽ¼¨¤¹¤ë¥µ¥ó¥×¥ë¥³¡¼¥É
    3	 */
    4	
    5	#include <stdio.h>
    6	#include <X11/Xlib.h>
    7	#include <X11/Xutil.h>             /* shape.h ¤ÎÁ°¤ËɬÍ× */
    8	#include <X11/extensions/shape.h>  /* Shape Extension    */
    9	
   10	
   11	/*
   12	 * bounding Îΰ褪¤è¤Ó clip Îΰè¤òɽ¤¹ X11 ·Á¼°¤Î¥Ó¥Ã¥È¥Þ¥Ã¥×¥Ç¡¼¥¿
   13	 */
   14	#include "btn_bd.h"
   15	#include "btn_cl.h"
   16	
   17	
   18	#define WIN_X 100
   19	#define WIN_Y 100
   20	
   21	#define SPC_X  25
   22	#define SPC_Y  25
   23	
   24	#define WIN_W ( btn_bd_width  + SPC_X * 2 )
   25	#define WIN_H ( btn_bd_height + SPC_Y * 2 )
   26	
   27	
   28	int 
   29	main( void )
   30	{
   31		Display* dpy;
   32		int      screen;
   33	
   34		Window   base;
   35		Window   button;
   36		GC       gc;
   37	
   38		Pixmap   pixmap_bounding;   /* bounding Îΰè¤ò·èÄꤹ¤ë¥Ó¥Ã¥È¥Þ¥Ã¥× */
   39		Pixmap   pixmap_clip;       /* clip     Îΰè¤ò·èÄꤹ¤ë¥Ó¥Ã¥È¥Þ¥Ã¥× */
   40		int      event_no_base;     /* ShapeNotify ¥¤¥Ù¥ó¥È¤ÎÈÖ¹æ */
   41		int      error_no_base;     /* Shape Extension ¤ÇȯÀ¸¤¹¤ë¥¨¥é¡¼¤ÎºÇ½é¤ÎÈÖ¹æ */
   42	
   43		unsigned long white, black, blue, red;
   44	
   45	
   46		dpy    = XOpenDisplay( NULL );
   47		screen = DefaultScreen( dpy );
   48	
   49	
   50		/*
   51		 * Àܳ¤·¤¿ X ¥µ¡¼¥Ð¤¬¡¢Shape Extension ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤«
   52		 * ¤É¤¦¤«¤òÄ´¤Ù¤ë¡£
   53		 */
   54		if ( ! XShapeQueryExtension( dpy, &event_no_base, &error_no_base ) ) {
   55			fprintf( stderr, "Shape extension is not available\n" );
   56			XCloseDisplay( dpy );
   57			return 1;
   58		}
   59	
   60	
   61		/*
   62		 * ¿§ÀßÄê
   63		 */
   64		{
   65			XColor   color, exact; 
   66			Colormap cmap;
   67	
   68			white  = WhitePixel( dpy, screen );
   69			black  = BlackPixel( dpy, screen );
   70	
   71			cmap   = DefaultColormap( dpy, screen );
   72	
   73			XAllocNamedColor( dpy, cmap, "blue", &color, &exact );
   74			blue = color.pixel;
   75	
   76			XAllocNamedColor( dpy, cmap, "red",  &color, &exact );
   77			red  = color.pixel;
   78		}
   79	
   80	
   81		/*
   82		 * Window ºîÀ®
   83		 */
   84		{
   85			/*
   86			 * base Window ¤òºîÀ®¤¹¤ë¡£
   87			 */
   88			base = XCreateSimpleWindow( dpy, DefaultRootWindow( dpy ),
   89						    WIN_X, WIN_Y,
   90						    WIN_W, WIN_H,
   91						    0, black, blue );
   92			XStoreName( dpy, base, "Button" );
   93		
   94	
   95			/*
   96			 * bounding ¥Ó¥Ã¥È¥Þ¥Ã¥×¤ÎÉý¤È¹â¤µ¤ò»È¤Ã¤Æ button Window ¤òºîÀ®¤¹¤ë¡£
   97			 */
   98			button = XCreateSimpleWindow( dpy, base, 
   99						      SPC_X, SPC_Y,
  100						      btn_bd_width, btn_bd_height,
  101						      0, black, white );
  102	
  103			gc = XCreateGC( dpy, button, 0, NULL );
  104			XSetBackground( dpy, gc, white );
  105		}
  106	
  107	
  108		/*
  109		 * bounding Îΰ褪¤è¤Ó clip Îΰè¤ÎÀßÄê
  110		 */
  111		{
  112			/*
  113			 * bounding Îΰ褪¤è¤Ó clip Îΰè¤òɽ¸½¤¹¤ë¥Ó¥Ã¥È¥Þ¥Ã¥×¤òºîÀ®¤¹¤ë¡£
  114			 */
  115			pixmap_bounding = XCreateBitmapFromData( 
  116				dpy, button,
  117				( char* )btn_bd_bits,
  118				btn_bd_width, btn_bd_height );
  119	
  120			pixmap_clip     = XCreateBitmapFromData(
  121				dpy, button,
  122				( char* )btn_cl_bits,
  123				btn_cl_width, btn_cl_height );
  124	
  125			/*
  126			 * bounding Îΰ褪¤è¤Ó clip Îΰè¤òÀßÄꤹ¤ë¡£
  127			 */
  128			XShapeCombineMask( dpy, button, ShapeBounding, 
  129					   0, 0, pixmap_bounding, ShapeSet );
  130	
  131			XShapeCombineMask( dpy, button, ShapeClip,     
  132					   0, 0, pixmap_clip,     ShapeSet );
  133		}
  134	
  135	
  136		XSelectInput( dpy, base,   ButtonPressMask );
  137		XSelectInput( dpy, button, ButtonPressMask );
  138	
  139		XMapWindow( dpy, base );
  140		XMapSubwindows( dpy, base );
  141	
  142	
  143		/*
  144		 * ¿¿Ãæ¤Î Window Æâ¤Ç¥Þ¥¦¥¹¤Îº¸¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ëÅ٤ˡ¢
  145		 * ɽ¼¨¿§¤ò ÀÖ<==>Çò ¤ÇÀÚÂؤ¨¤ë¡£
  146		 * Window ¤Ë´Ø·¸Ìµ¤¯¡¢±¦¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È½ªÎ»¤¹¤ë¡£
  147		 */
  148		while ( 1 ) {
  149			static XEvent event;
  150			static char flag = 0;
  151	
  152			XNextEvent( dpy, &event );
  153	
  154			switch ( event.type ) {
  155			case ButtonPress:
  156				switch ( event.xbutton.button ) {
  157				case Button1:  /* Left   Button */
  158					if ( event.xbutton.window == button ) {
  159						if ( ! flag ) {
  160							XSetForeground( dpy, gc, red );
  161							flag ++;
  162						}
  163						else {
  164							XSetForeground( dpy, gc, white );
  165							flag --;
  166						}
  167	
  168						XFillRectangle( dpy, button, gc, 
  169							0, 0, btn_bd_width, btn_bd_height );
  170					}
  171					break;
  172	
  173				case Button3:  /* Right  Button */
  174					XFreeGC( dpy, gc );
  175					XDestroyWindow( dpy, base );
  176					XCloseDisplay( dpy );
  177					return 0;
  178				}
  179	
  180			default:
  181				break;
  182			}
  183		}
  184	}
  185	
  186	
  187	/* End of xshape.c */

--- btn_bd.h ---

    1   #define btn_bd_width 101
    2   #define btn_bd_height 51
    3   static unsigned char btn_bd_bits[] = {
    4      0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00,
    5      0xe0, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
    6      0x00, 0xe0, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    7      0x7f, 0x00, 0xe0, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    8      0xff, 0xff, 0x01, 0xe0, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    9      0xff, 0xff, 0xff, 0x07, 0xe0, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff,
   10      0xff, 0xff, 0xff, 0xff, 0x0f, 0xe0, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff,
   11      0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0x80, 0xff, 0xff, 0xff, 0xff,
   12      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0xc0, 0xff, 0xff, 0xff,
   13      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xe0, 0xe0, 0xff, 0xff,
   14      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xf0, 0xff,
   15      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe1, 0xf0,
   16      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe1,
   17      0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   18      0xe3, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   19      0xff, 0xe3, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   20      0xff, 0xff, 0xe7, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   21      0xff, 0xff, 0xff, 0xe7, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   22      0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   23      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   24      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   25      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   26      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   27      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   28      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   29      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   30      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   31      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   32      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   33      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   34      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   35      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   36      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   37      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   38      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   39      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   40      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff,
   41      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xfc,
   42      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7,
   43      0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   44      0xe7, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   45      0xff, 0xe3, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   46      0xff, 0xff, 0xe3, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   47      0xff, 0xff, 0xff, 0xe1, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   48      0xff, 0xff, 0xff, 0xff, 0xe1, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   49      0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff,
   50      0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xe0, 0x80, 0xff, 0xff, 0xff, 0xff,
   51      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0x80, 0xff, 0xff, 0xff,
   52      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0x00, 0xfe, 0xff,
   53      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xe0, 0x00, 0xfc,
   54      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xe0, 0x00,
   55      0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xe0,
   56      0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
   57      0xe0, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
   58      0x00, 0xe0, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   59      0x07, 0x00, 0xe0};

--- btn_cl.h ---

    1   #define btn_cl_width 101
    2   #define btn_cl_height 51
    3   static unsigned char btn_cl_bits[] = {
    4      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    5      0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    6      0x00, 0xe0, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    7      0x1f, 0x00, 0xe0, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    8      0xff, 0x3f, 0x00, 0xe0, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    9      0xff, 0xff, 0x7f, 0x00, 0xe0, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
   10      0xff, 0xff, 0xff, 0xff, 0x01, 0xe0, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff,
   11      0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xe0, 0x00, 0xfe, 0xff, 0xff, 0xff,
   12      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xe0, 0x80, 0xff, 0xff, 0xff,
   13      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0x80, 0xff, 0xff,
   14      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0xc0, 0xff,
   15      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xe0, 0xe0,
   16      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0,
   17      0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   18      0xe1, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   19      0xff, 0xe1, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   20      0xff, 0xff, 0xe3, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   21      0xff, 0xff, 0xff, 0xe3, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   22      0xff, 0xff, 0xff, 0xff, 0xe7, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   23      0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff,
   24      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xfc, 0xff, 0xff, 0xff, 0xff,
   25      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xfc, 0xff, 0xff, 0xff,
   26      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xfc, 0xff, 0xff,
   27      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xfc, 0xff,
   28      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xfc,
   29      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7,
   30      0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   31      0xe7, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   32      0xff, 0xe7, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   33      0xff, 0xff, 0xe7, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   34      0xff, 0xff, 0xff, 0xe7, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   35      0xff, 0xff, 0xff, 0xff, 0xe7, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   36      0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff,
   37      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xfc, 0xff, 0xff, 0xff, 0xff,
   38      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xfc, 0xff, 0xff, 0xff,
   39      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xfc, 0xff, 0xff,
   40      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xfc, 0xff,
   41      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xf8,
   42      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3,
   43      0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   44      0xe3, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   45      0xff, 0xe1, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   46      0xff, 0xff, 0xe1, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   47      0xff, 0xff, 0xff, 0xe0, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   48      0xff, 0xff, 0xff, 0x7f, 0xe0, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   49      0xff, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff,
   50      0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0x00, 0xfe, 0xff, 0xff, 0xff,
   51      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xe0, 0x00, 0xfc, 0xff, 0xff,
   52      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xe0, 0x00, 0xf0, 0xff,
   53      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xe0, 0x00, 0xc0,
   54      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x00,
   55      0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xe0,
   56      0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00,
   57      0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   58      0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   59      0x00, 0x00, 0xe0};

¡û ¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ÎÀâÌÀ

¤Ç¤Ï¡¢¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤¤¤­¤Þ¤¹¡£

  • 8 ¹ÔÌÜ

    SHAPE extension ¤ò»ÈÍѤ¹¤ë¤¿¤á¤ËɬÍ×¤Ê <X11/extensions/shape.h> ¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ¤¤¤Þ¤¹¡£

  • 14 ¡Á 15 ¹ÔÌÜ

    bounding Îΰ褪¤è¤Ó clip Îΰè¤òɽ¤¹ X11 ·Á¼°¤Î¥Ó¥Ã¥È¥Þ¥Ã¥×¥Ç¡¼¥¿¤ò¥¤¥ó¥¯¥ë¡¼¥É ¤·¤Æ¤¤¤Þ¤¹¡£X11 ·Á¼°¤Î¥Ó¥Ã¥È¥Þ¥Ã¥×¥Ç¡¼¥¿¤Ï C ¸À¸ì¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î·Á¼°¤Ç¤¢¤ë¤¿¤á¡¢ ¤³¤ÎÍͤˤ·¤Æ»ÈÍѤ·¤Þ¤¹¡£

  • 24 ¡Á 25 ¹ÔÌÜ

    ¥Ó¥Ã¥È¥Þ¥Ã¥×¥Ç¡¼¥¿¤ÎÃæ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Ó¥Ã¥È¥Þ¥Ã¥×¤ÎÉý¤È¹â¤µ¤ò»È¤Ã¤Æ¡¢ ¥Ü¥¿¥ó¤òɽ¼¨¤¹¤ë¥¦¥£¥ó¥É¥¦¤ÎÉý¤ò·è¤á¤Æ¤¤¤Þ¤¹¡£

  • 38 ¡Á 41 ¹ÔÌÜ

    SHAPE extension ¤ò»È¤¦ºÝ¤ËɬÍפȤʤë bounding region ¤ª¤è¤Ó clip region ¤ò³ÊǼ¤¹¤ë¤¿¤á¤Î Pixmap ¤È¡¢¤½¤Î¾¤ÎÊÑ¿ô¤òÄêµÁ¤·¤Æ¤¤¤Þ¤¹¡£event_no_base ¤È error_no_base ¤Ë¤Ä¤¤¤Æ¤Ï¸åÄøÀâÌÀ¤·¤Þ¤¹¡£

  • 50 ¡Á 58 ¹ÔÌÜ

    X ¥µ¡¼¥Ð¤ËÀܳ¤·¤¿Ä¾¸å¤Ë¡¢¤Þ¤º SHAPE extension ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò XShapeQueryExtension() ¤ò»È¤Ã¤ÆÌ䤤¹ç¤ï¤»¤Æ¤¤¤Þ¤¹¡£¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢ ¥×¥í¥°¥é¥à¤ò½ªÎ»¤·¤Æ¤¤¤Þ¤¹¡£

      Bool XShapeQueryExtension( Display* display,
                                 int*     event_basep,
                                 int*     error_basep 
                               );
    
      event_basep : ShapeNotify ¥¤¥Ù¥ó¥È¤òɽ¤¹Èֹ椬³ÊǼ¤µ¤ì¤ë
      error_basep : SHAPE extension ¤ÇȯÀ¸¤¹¤ë¥¨¥é¡¼ÈÖ¹æ¤ÎºÇ½é¤ÎÈֹ椬³ÊǼ¤µ¤ì¤ë
    
    

    SHAPE extension ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï True¡¢¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï False ¤òÊÖ¤·¤Þ¤¹¡£¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï event_basep ¤Ë ShapeNotify ¥¤¥Ù¥ó¥È¤òɽ¤¹Èֹ椬³ÊǼ¤µ¤ì¤Þ¤¹¡£¤Þ¤¿¡¢error_basep ¤Ë¡¢SHAPE extension ¤ÇȯÀ¸¤¹¤ë¥¨¥é¡¼ÈÖ¹æ¤ÎºÇ½é¤ÎÈֹ椬³ÊǼ¤µ¤ì¤Þ¤¹¡£

    ShapeNotify ¥¤¥Ù¥ó¥È¤Ë¤Ä¤¤¤Æ¤Ï¸å½Ò¤·¤Þ¤¹¡£

  • 61 ¡Á 78 ¹ÔÌÜ

    ¥Ù¡¼¥¹¤È¤Ê¤ë¥¦¥£¥ó¥É¥¦¤È¥Ü¥¿¥ó¥¦¥£¥ó¥É¥¦¤Îɽ¼¨¿§¤È¤Ê¤ë¡¢ÀÄ¡¢ÀÖ¡¢Çò¡¢¹õ ¤Î¥Ô¥¯¥»¥ëÃͤò¼èÆÀ¤·¤Æ¤¤¤Þ¤¹¡£

  • 81 ¡Á 105 ¹ÔÌÜ

    ¥Ù¡¼¥¹¥¦¥£¥ó¥É¥¦¤È¥Ü¥¿¥ó¥¦¥£¥ó¥É¥¦¤òºîÀ®¤·¤Æ¤¤¤Þ¤¹¡£¥Ü¥¿¥ó¥¦¥£¥ó¥É¥¦¤Ï¡¢ ¥Ó¥Ã¥È¥Þ¥Ã¥×¥Ç¡¼¥¿¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ëÉý¤È¹â¤µ¤ò»È¤Ã¤ÆºîÀ®¤·¤Æ¤¤¤Þ¤¹¡£ ¤Þ¤¿¡¢¥Ü¥¿¥ó¥¦¥£¥ó¥É¥¦¤Îɽ¼¨¿§¤òÊѤ¨¤ëºÝ¤Ë»ÈÍѤ¹¤ë GC ¤òºîÀ®¤·¤Æ¡¢ ºÇ½é¤Îɽ¼¨¿§¤òÀßÄꤷ¤Æ¤¤¤Þ¤¹¡£

    ¥Ù¡¼¥¹¥¦¥£¥ó¥É¥¦¤ÎºîÀ®¤Ç»ÈÍѤ·¤Æ¤¤¤ë XStoreName() ¤Ï¡¢¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¤ËÂФ·¤Æ ¥¿¥¤¥È¥ë¥Ð¡¼¤Ëɽ¼¨¤¹¤ëʸ»úÎó¤òÄÌÃΤ¹¤ë´Ø¿ô¤Ç¤¹¡£¤³¤³¤Þ¤Ç¤ËÀâÌÀ¤·¤¿µ­²±¤¬Ìµ¤¤¤Î¤Ç ¤³¤³¤Ç¤¢¤é¤¿¤á¤Æ¡£

       XStoreName( Display* display, Window win, char* name );
    
       name : ¥¿¥¤¥È¥ë¥Ð¡¼¤Ëɽ¼¨¤¹¤ëʸ»úÎó
    
    

  • 108 ¡Á 133 ¹ÔÌÜ

    ¤³¤³¤¬ËÜÂê¤Ç¤¹¡£ºîÀ®¤·¤¿¤Ð¤«¤ê¤Î¥¦¥£¥ó¥É¥¦¤Î bounding region ¤È clip region ¤Ï¥Ç¥Õ¥©¥ë¥È¾õÂ֤Ǥ¹¤¬¡¢¤³¤ì¤òÊѹ¹¤·¤Þ¤¹¡£ ¤Þ¤º¡¢¥Ó¥Ã¥È¥Þ¥Ã¥×¥Ç¡¼¥¿¤ò»È¤Ã¤Æ region ¤Î»ØÄê¤Ë»ÈÍѤ¹¤ë Pixmap ¤ò XCreateBitmapFromData() ¤ò»È¤Ã¤ÆºîÀ®¤·¤Þ¤¹¡£XCreateBitmapFromData() ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ Appendix ( ÉÕÏ¿ ) ¤ÇÀâÌÀ¤·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢ ¤½¤Á¤é¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£

    ºîÀ®¤·¤¿ Pixmap ¤ò¡¢XShapeCombineMask() ¤ò»È¤Ã¤Æ bounding region ¤ª¤è¤Ó clip region ¤È¤·¤ÆÀßÄꤷ¤Þ¤¹¡£

      XShapeCombineMask( Display* display,
                         Window   dst,
                         int      dst_kind, x_off, y_off,
                         Pixmap   src,
                         int      op
                       );
    
      dst          : region ¤òÀßÄꤹ¤ëÂоݤȤʤë Window
    
      dst_kind     : bounding region ¤òÀßÄꤹ¤ë¾ì¹ç¤Ï ShapeBounding
                     clip region     ¤òÀßÄꤹ¤ë¾ì¹ç¤Ï ShapeClip ¤ò»ØÄê
    
      x_off, y_off : src ¤ò¤½¤ÎÉý¤È¹â¤µ¤Çɽ¤µ¤ì¤ë»Í³Ñ·Á¤È¹Í¤¨¤¿¾ì¹ç¤Ë¡¢º¸¾å¤Î³Ñ¤ò
                     dst ¾å¤Î¤É¤Î°ÌÃ֤ˤª¤¤¤ÆÀßÄꤹ¤ë¤«¤ò»ØÄê
    
      src          : region ¤ÎÀßÄê¤Ë»ÈÍѤ¹¤ë Pixmap
                     ¥Ç¥Õ¥©¥ë¥È¤ËÌ᤹¾ì¹ç¤Ï None ¤ò»ØÄꤹ¤ë
    
      op           : src ¤È dst ¤Ë¤è¤ë region ·èÄê¤Î±é»»ÊýË¡¤ò»ØÄê
    
    

    op ¤Ë¤Ï ShapeSet¡¢ShapeUnion¡¢ShapeIntersect¡¢ShapeSubtract¡¢ShapeInvert ¤¬ÀßÄê¤Ç¤­¤Þ¤¹¡£

    • ShapeSet

      src ¤ò dst_kind ¤Ç»ØÄꤷ¤¿ region ¤È¤·¤ÆÀßÄꤹ¤ë

    • ShapeUnion

      dst ¤ª¤è¤Ó src ¤ò¹ç¤ï¤»¤¿Îΰè¤ò¡¢dst_kind ¤Ç»ØÄꤷ¤¿ region ¤È¤·¤ÆÀßÄꤹ¤ë

    • ShapeIntersect

      dst ¤ª¤è¤Ó src ¤Î½Å¤Ê¤ëÎΰè¤ò¡¢dst_kind ¤Ç»ØÄꤷ¤¿ region ¤È¤·¤ÆÀßÄꤹ¤ë

    • ShapeSubtract

      dst ¤«¤é src ¤ò½ü¤¤¤¿Îΰè¤ò¡¢dst_kind ¤Ç»ØÄꤷ¤¿ region ¤È¤·¤ÆÀßÄꤹ¤ë

    • ShapeInvert

      src ¤«¤é dst ¤ò½ü¤¤¤¿Îΰè¤ò¡¢dst_kind ¤Ç»ØÄꤷ¤¿ region ¤È¤·¤ÆÀßÄꤹ¤ë

    ¤Á¤Ê¤ß¤Ë xshape.c ¤Ç ShapeSet ¤ÎÂå¤ï¤ê¤Ë ShapeUnion ¤ª¤è¤Ó ShapeSubtract ¤ò»ØÄꤷ¤¿¾ì¹ç¤Îɽ¼¨¤Ï°Ê²¼¤ÎÍͤˤʤê¤Þ¤¹¡£ ShapeIntersect ¤È ShapeInvert ¤Ï³Æ¼«¤Ç²¿¤«ºî¤Ã¤Æɽ¼¨¤·¤Æ¤ß¤Æ²¼¤µ¤¤ ! ( ¼«Ê¬¤Ç¤ä¤ë¤Î¤¬ÌÌÅݤÀ¤Ã¤¿¤À¤±¤Ç¤¹¡£¡£¡£m(__)m )

    --- ShapeUnion ---

    018union.jpg

    --- ShapeSubtract ---

    018subtract.jpg

    ¢¬Çò¤¤²Õ½ê¤¬¥Ü¥¿¥ó¥¦¥£¥ó¥É¥¦¤Ê¤Î¤Ç¡¢ShapeSubtract ¤Î¾ì¹çÌÌÇò¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤Þ¤¹¡£ 4 ¤Ä¤Î¥¦¥£¥ó¥É¥¦¤¬¤¢¤ë¤«¤ÎÍͤǤ¹¤Í¡ª

  • 143 ¡Á 183 ¹ÔÌÜ

    ¥¤¥Ù¥ó¥È¥ë¡¼¥×¤Ç¤¹¡£¥Þ¥¦¥¹¤Îº¸¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤¿¾ì¹ç¡¢¥Ü¥¿¥ó¥¦¥£¥ó¥É¥¦¤Ç¤¢¤ì¤Ð ( 158 ¹ÔÌÜ ) flag ¤ÎÃͤˤè¤Ã¤Æɽ¼¨¿§¤ò GC ¤ËÀßÄꤷ¤Æ¡¢168 ¹ÔÌܤΠXFillRectangle() ¤Ç¥Ü¥¿¥ó¥¦¥£¥ó¥É¥¦¤òÅɤê¤Ä¤Ö¤·¤Æ¤¤¤Þ¤¹¡£XFillRectangle() ¤ÇĹÊý·ÁÎΰè¤òÅɤê¤Ä¤Ö¤·¤Æ¤â¡¢ ɽ¼¨¤µ¤ì¤ëÎΰè¤Ï¤³¤ì¤Þ¤Ç¤ÈÊѤï¤ê¤Þ¤»¤ó¡£

    ¥Þ¥¦¥¹¤Î±¦¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤¿¾ì¹ç¤Ï¡¢¥ê¥½¡¼¥¹¤ò²òÊü¤·¤Æ½ªÎ»¤·¤Þ¤¹¡£

°Ê¾å¤Ç xshape.c ¤Î²òÀâ¤Ï½ª¤ï¤ê¤Ç¤¹¡£ ¤³¤ì¤òµ¡¤Ë¡¢¤¹¤´¤¯ÊѤï¤Ã¤¿·Á¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤âºî¤Ã¤Æ¤ß¤Æ¤Ï¤¤¤«¤¬¤Ç¤·¤ç¤¦¡©

¡û SHAPE extension ¤Ç»ÈÍѤǤ­¤ë¤½¤Î¾¤Î´Ø¿ô

¤³¤³¤Ç¤Ï SHAPE extension ¤Ç»ÈÍѤǤ­¤ë¤½¤Î¾¤Î´Ø¿ô¤Î¤¦¤Á¤Î¤¤¤¯¤Ä¤«¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹¡£

  • XShapeQueryVersion()

    SHAPE extension ¤Î¥Ð¡¼¥¸¥ç¥ó¤ò¼èÆÀ¤·¤Þ¤¹¡£ ¼Â¹Ô¤¹¤ë¤È¡¢major ¤ª¤è¤Ó minor ¤Ë»ØÄꤷ¤¿ÊÑ¿ô¤ËÈֹ椬³ÊǼ¤µ¤ì¤Þ¤¹¡£

      Status XShapeQueryVersion( Display* display, int* major, int* minor );
    
      major : ¥á¥¸¥ã¡¼ÈÖ¹æ
      minor : ¥Þ¥¤¥Ê¡¼ÈÖ¹æ
    
    

  • XShapeCombineRectangles()

    XRectangle ¤ÎÇÛÎó¤ò»È¤Ã¤Æ¡¢region ¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡£

      XShapeCombineRectangles( Display*     display,
                               Window       dst,
                               int          dst_kind, x_off, y_off,
                               XRectangles* rectangles,
                               int          n_rects, op, ordering
                             );
    
      dst          : region ¤òÀßÄꤹ¤ëÂоݤȤʤë Window
    
      dst_kind     : bounding region ¤òÀßÄꤹ¤ë¾ì¹ç¤Ï ShapeBounding
                     clip region     ¤òÀßÄꤹ¤ë¾ì¹ç¤Ï ShapeClip ¤ò»ØÄê
    
      x_off, y_off : rectangles ¤Ë¤è¤ë region ¤ÎÀßÄê¤ò¡¢
                     dst ¾å¤Î¤É¤Î°ÌÃ֤ˤª¤¤¤ÆÀßÄꤹ¤ë¤«¤ò»ØÄê
    
      rectangles   : region ¤ÎÀßÄê¤Ë»ÈÍѤ¹¤ëÎΰè¤ò XRectangle ¤ÎÇÛÎó¤Ç»ØÄꤹ¤ë
    
      n_rects      : rectangles ¤Ë»ØÄꤷ¤¿ XRectangle ¤Î¿ô
      op           : src ¤È dst ¤Ë¤è¤ë region ·èÄê¤Î±é»»ÊýË¡¤ò»ØÄê(XShapeCombineMask()¤ÈƱ¤¸)
    
      ordering     : rectangles ¤Ë»ØÄꤷ¤¿ XRectangle ¤ÎʤÓÊý¤ò»ØÄê
    
    

    ordering ¤Ë¤Ï Expose ¥¤¥Ù¥ó¥È ¤ÇÀâÌÀ¤·¤¿ XSetClipRectangles() ¤Î ordering ¤Ë»ÈÍѤǤ­¤ëÄê¿ô¤ò»È¤¤¤Þ¤¹¡£

  • XShapeCombineShape()

    Pixmap ¤Ç¤Ï¤Ê¤¯¡¢Window ¤ò»È¤Ã¤Æ region ¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡£

      XShapeCombineShape( Display* display,
                          Window   dst,
                          int      dst_kind, x_off, y_off,
                          Window   src,
                          int      src_kind, op
                        );
    
      dst          : region ¤òÀßÄꤹ¤ëÂоݤȤʤë Window
    
      dst_kind     : bounding region ¤òÀßÄꤹ¤ë¾ì¹ç¤Ï ShapeBounding
                     clip region     ¤òÀßÄꤹ¤ë¾ì¹ç¤Ï ShapeClip ¤ò»ØÄê
    
      x_off, y_off : src ¤ò¤½¤ÎÉý¤È¹â¤µ¤Çɽ¤µ¤ì¤ë»Í³Ñ·Á¤È¹Í¤¨¤¿¾ì¹ç¤Ë¡¢º¸¾å¤Î³Ñ¤ò
                     dst ¾å¤Î¤É¤Î°ÌÃ֤ˤª¤¤¤ÆÀßÄꤹ¤ë¤«¤ò»ØÄê
    
      src          : region ¤ÎÀßÄê¤Ë»ÈÍѤ¹¤ë Window
    
      src_kind     : bounding region ¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ï ShapeBounding
                     clip region     ¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ï ShapeClip ¤ò»ØÄê
    
      op           : src ¤È dst ¤Ë¤è¤ë region ·èÄê¤Î±é»»ÊýË¡¤ò»ØÄê(XShapeCombineMask ¤ÈƱ¤¸)
    
    

  • XShapeOffsetShape()

    ¸½ºßÀßÄꤵ¤ì¤Æ¤¤¤ë region ¤ò»ØÄêÎ̤À¤±°ÜÆ°¤µ¤»¤Þ¤¹¡£

      XShapeOffsetShape( Display* display, Window dst, int dst_kind, int x_off, int y_off );
    
      dst_kind     : bounding region ¤òÀßÄꤹ¤ë¾ì¹ç¤Ï ShapeBounding
                     clip region     ¤òÀßÄꤹ¤ë¾ì¹ç¤Ï ShapeClip ¤ò»ØÄê
    
      x_off, y_off : region ¤Î°ÜÆ°Î̤ò X ¤ª¤è¤Ó Y ºÂɸ¤½¤ì¤¾¤ì¤Ë¤Ä¤¤¤Æ»ØÄê
    
    

  • XShapeQueryExtents()

    ¸½ºßÀßÄꤵ¤ì¤Æ¤¤¤ë bounding region ¤ª¤è¤Ó clip region ¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¼èÆÀ¤·¤Þ¤¹¡£

      Status XShapeQueryExtents( Display* display, 
                                 Window   win,
                                 Bool     *bounding,
                                 int      *x_bounding, *y_bounding, *w_bounding, *h_bounding,
                                 Bool     *clip,
                                 int      *x_clip, *y_clip, *w_clip, *h_clip
                               );
    
      bounding               : bounding region ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë True ¤¬³ÊǼ¤µ¤ì¤ë
      x_bounding, y_bounding : bounding region ¤Îº¸¾å³Ñ¤ÎºÂɸ¤¬³ÊǼ¤µ¤ì¤ë
      w_bounding, h_bounding : bounding region ¤ÎÉý¤È¹â¤µ¤¬³ÊǼ¤µ¤ì¤ë
    
      clip                   : clip region ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë True ¤¬³ÊǼ¤µ¤ì¤ë
      x_clip, y_clip         : clip region ¤Îº¸¾å³Ñ¤ÎºÂɸ¤¬³ÊǼ¤µ¤ì¤ë
      w_clip, h_clip         : clip region ¤ÎÉý¤È¹â¤µ¤¬³ÊǼ¤µ¤ì¤ë
    
    

  • XShapeSelectInput()

    bounding region ¤â¤·¤¯¤Ï clip region ¤ËÊѲ½¤¬¤¢¤Ã¤¿¾ì¹ç¤Ë¡¢ShapeNotify ¥¤¥Ù¥ó¥È¤òÁ÷¤Ã¤Æ¤â¤é¤¦ÍÍ¤Ë X ¥µ¡¼¥Ð¤ËÄÌÃΤ·¤Þ¤¹¡£

      XShapeSelectInput( Display* display, Window win, unsigned long mask );
    
      mask : ShapeNotifyMask ¤ò»ØÄê
    
    

    ShapeNotify ¥¤¥Ù¥ó¥È¹½Â¤ÂΤϰʲ¼¤ÎÍͤËÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£

      typedef struct {
        int           type;            /* ¥¤¥Ù¥ó¥È¤Î¼ïÎà */
        unsigned long serial;          /* ¥µ¡¼¥Ð¤¬½èÍý¤·¤¿ºÇ¸å¤Î¥ê¥¯¥¨¥¹¥ÈÈÖ¹æ */
        Bool          send_event;      /* ¥¯¥é¥¤¥¢¥ó¥È¤«¤éÁ÷¤é¤ì¤¿¥¤¥Ù¥ó¥È¤Ê¤é True */
        Display*      display;         /* ¥¤¥Ù¥ó¥È¤¬Æɤ߹þ¤Þ¤ì¤¿display */
        Window        window;          /* ¥¤¥Ù¥ó¥È¤¬µ¯¤³¤Ã¤¿ window ¤ÎID */
        int           kind;            /* ShapeBounding ¤â¤·¤¯¤Ï ShapeClip */
        int           x, y;            /* ¿·¤·¤¤ region ¤Îº¸¾å³Ñ¤ÎºÂɸ */
        unsigned      width, height;   /* ¿·¤·¤¤ region ¤ÎÉý¤È¹â¤µ */
        Time          time;            /* region ¤¬Êѹ¹¤µ¤ì¤¿»þ¹ï */
        Bool          shaped;          /* region ¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ï True */
      } XShapeEvent;
    
    

  • XShapeInputSelected()

    ShapeNotify ¥¤¥Ù¥ó¥È¤òÁ÷¤Ã¤Æ¤â¤é¤¦ÍÍ¤Ë XShapeSelectInput() ¤Ç»ØÄꤷ¤¿¾ì¹ç¤Ë ShapeNotifyMask ¤ò¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤·¤Þ¤¹¡£

      unsigned long XShapeInputSelected( Display* display, Window win );
    
    

  • XShapeGetRectangles()

    ¸½ºß¤Î bounding region ¤¢¤ë¤¤¤Ï clip region ¤òɽ¸½¤¹¤ë XRectangle ¤ÎÇÛÎó¤ò¼èÆÀ¤·¤Þ¤¹¡£ XShapeCombineRectangles() ¤ÎµÕÁàºî¤ÎÍͤʤâ¤Î¤Ç¤¹¡£

      XRectangle* XShapeGetRectangles( Display*  display,
                                       Window    win,
                                       int       kind,
                                       int*      count, 
                                       int*      ordering
                                     );
    
      kind     : bounding region ¤ò»ØÄꤹ¤ë¾ì¹ç¤Ï ShapeBounding
                 clip region     ¤ò»ØÄꤹ¤ë¾ì¹ç¤Ï ShapeClip ¤ò»ØÄê
    
      count    : ÊÖµÑÃͤËÀßÄꤵ¤ì¤Æ¤¤¤ë XRectangle ¤Î¿ô
    
      ordering : ÊÖµÑÃͤËÀßÄꤵ¤ì¤Æ¤¤¤ë XRectangle ¤ÎʤÓÊý
                 XSetClipRectangles() ¤Î ordering ¤Ë»ÈÍѤǤ­¤ëÄê¿ô