comparison src/events/SDL_mouse.c @ 3774:8b5b67000dc0 gsoc2008_manymouse

Cursor support added
author Szymon Wilczek <kazeuser@gmail.com>
date Tue, 05 Aug 2008 14:10:11 +0000
parents 8cc36a399a12
children a9c2a7071874
comparison
equal deleted inserted replaced
3773:3b5691f85c0d 3774:8b5b67000dc0
50 } 50 }
51 return SDL_mice[index]; 51 return SDL_mice[index];
52 } 52 }
53 53
54 int 54 int
55 SDL_AddMouse(const SDL_Mouse * mouse, int index, char* name,int pressure_max,int pressure_min) 55 SDL_AddMouse(const SDL_Mouse * mouse, int index, char* name,int pressure_max,\
56 int pressure_min, int ends)
56 { 57 {
57 SDL_Mouse **mice; 58 SDL_Mouse **mice;
58 int selected_mouse; 59 int selected_mouse;
59 int length; 60 int length;
60 61
96 SDL_mice[index]->proximity=SDL_TRUE; 97 SDL_mice[index]->proximity=SDL_TRUE;
97 /*we're assuming that all mouses are working in the absolute position mode 98 /*we're assuming that all mouses are working in the absolute position mode
98 thanx to that, the users that don't want to use many mouses don't have to 99 thanx to that, the users that don't want to use many mouses don't have to
99 worry about anything*/ 100 worry about anything*/
100 SDL_mice[index]->relative_mode=SDL_FALSE; 101 SDL_mice[index]->relative_mode=SDL_FALSE;
102 SDL_mice[index]->current_end=0;
103 SDL_mice[index]->total_ends=ends;
101 SDL_SelectMouse(selected_mouse); 104 SDL_SelectMouse(selected_mouse);
102 105
103 return index; 106 return index;
104 } 107 }
105 108
458 event.motion.xrel = xrel; 461 event.motion.xrel = xrel;
459 event.motion.yrel = yrel; 462 event.motion.yrel = yrel;
460 event.motion.windowID = mouse->focus; 463 event.motion.windowID = mouse->focus;
461 event.motion.pressure_max=mouse->pressure_max; 464 event.motion.pressure_max=mouse->pressure_max;
462 event.motion.pressure_min=mouse->pressure_min; 465 event.motion.pressure_min=mouse->pressure_min;
466 event.motion.cursor=SDL_mice[index]->current_end;
463 posted = (SDL_PushEvent(&event) > 0); 467 posted = (SDL_PushEvent(&event) > 0);
464 } 468 }
465 last_x=x; 469 last_x=x;
466 last_y=y; 470 last_y=y;
467 return posted; 471 return posted;
794 void SDL_UpdateCoordinates(int x, int y) 798 void SDL_UpdateCoordinates(int x, int y)
795 { 799 {
796 x_max=x; 800 x_max=x;
797 y_max=y; 801 y_max=y;
798 } 802 }
803
804 void SDL_ChangeEnd(int id, int end)
805 {
806 int index=SDL_GetIndexById(id);
807 SDL_mice[index]->current_end=end;
808 }
809
810 int SDL_GetCursorsNumber(int index)
811 {
812 if(index>=SDL_num_mice)
813 {
814 return -1;
815 }
816 if(SDL_mice[index]==NULL)
817 {
818 return -1;
819 }
820 return SDL_mice[index]->total_ends;
821 }
799 /* vi: set ts=4 sw=4 expandtab: */ 822 /* vi: set ts=4 sw=4 expandtab: */
800 823