src/video/x11/SDL_x11mouse.c
changeset 7191 75360622e65f
parent 7071 82f17e656125
child 7827 a03ec8de0426
equal deleted inserted replaced
7190:11612d544fcd 7191:75360622e65f
   192     mask_pixmap = XCreateBitmapFromData(display, DefaultRootWindow(display),
   192     mask_pixmap = XCreateBitmapFromData(display, DefaultRootWindow(display),
   193                                         (char*)mask_bits,
   193                                         (char*)mask_bits,
   194                                         surface->w, surface->h);
   194                                         surface->w, surface->h);
   195     cursor = XCreatePixmapCursor(display, data_pixmap, mask_pixmap,
   195     cursor = XCreatePixmapCursor(display, data_pixmap, mask_pixmap,
   196                                  &fg, &bg, hot_x, hot_y);
   196                                  &fg, &bg, hot_x, hot_y);
   197 	XFreePixmap(display, data_pixmap);
   197     XFreePixmap(display, data_pixmap);
   198 	XFreePixmap(display, mask_pixmap);
   198     XFreePixmap(display, mask_pixmap);
   199 
   199 
   200     return cursor;
   200     return cursor;
   201 }
   201 }
   202 
   202 
   203 static SDL_Cursor *
   203 static SDL_Cursor *
   234     switch(id)
   234     switch(id)
   235     {
   235     {
   236     default:
   236     default:
   237         SDL_assert(0);
   237         SDL_assert(0);
   238         return NULL;
   238         return NULL;
   239 	// X Font Cursors reference:
   239     /* X Font Cursors reference: */
   240 	//   http://tronche.com/gui/x/xlib/appendix/b/
   240     /*   http://tronche.com/gui/x/xlib/appendix/b/ */
   241     case SDL_SYSTEM_CURSOR_ARROW:     shape = XC_left_ptr; break;
   241     case SDL_SYSTEM_CURSOR_ARROW:     shape = XC_left_ptr; break;
   242     case SDL_SYSTEM_CURSOR_IBEAM:     shape = XC_xterm; break;
   242     case SDL_SYSTEM_CURSOR_IBEAM:     shape = XC_xterm; break;
   243     case SDL_SYSTEM_CURSOR_WAIT:      shape = XC_watch; break;
   243     case SDL_SYSTEM_CURSOR_WAIT:      shape = XC_watch; break;
   244     case SDL_SYSTEM_CURSOR_CROSSHAIR: shape = XC_tcross; break;
   244     case SDL_SYSTEM_CURSOR_CROSSHAIR: shape = XC_tcross; break;
   245     case SDL_SYSTEM_CURSOR_WAITARROW: shape = XC_watch; break;
   245     case SDL_SYSTEM_CURSOR_WAITARROW: shape = XC_watch; break;
   334 X11_InitMouse(_THIS)
   334 X11_InitMouse(_THIS)
   335 {
   335 {
   336     SDL_Mouse *mouse = SDL_GetMouse();
   336     SDL_Mouse *mouse = SDL_GetMouse();
   337 
   337 
   338     mouse->CreateCursor = X11_CreateCursor;
   338     mouse->CreateCursor = X11_CreateCursor;
   339 	mouse->CreateSystemCursor = X11_CreateSystemCursor;
   339     mouse->CreateSystemCursor = X11_CreateSystemCursor;
   340     mouse->ShowCursor = X11_ShowCursor;
   340     mouse->ShowCursor = X11_ShowCursor;
   341     mouse->FreeCursor = X11_FreeCursor;
   341     mouse->FreeCursor = X11_FreeCursor;
   342     mouse->WarpMouse = X11_WarpMouse;
   342     mouse->WarpMouse = X11_WarpMouse;
   343     mouse->SetRelativeMouseMode = X11_SetRelativeMouseMode;
   343     mouse->SetRelativeMouseMode = X11_SetRelativeMouseMode;
   344 
   344