src/events/SDL_mouse.c
branchgsoc2008_manymouse
changeset 3774 8b5b67000dc0
parent 3771 8cc36a399a12
child 3776 a9c2a7071874
     1.1 --- a/src/events/SDL_mouse.c	Mon Aug 04 11:18:10 2008 +0000
     1.2 +++ b/src/events/SDL_mouse.c	Tue Aug 05 14:10:11 2008 +0000
     1.3 @@ -52,7 +52,8 @@
     1.4  }
     1.5  
     1.6  int
     1.7 -SDL_AddMouse(const SDL_Mouse * mouse, int index, char* name,int pressure_max,int pressure_min)
     1.8 +SDL_AddMouse(const SDL_Mouse * mouse, int index, char* name,int pressure_max,\
     1.9 +int pressure_min, int ends)
    1.10  {
    1.11      SDL_Mouse **mice;
    1.12      int selected_mouse;
    1.13 @@ -98,6 +99,8 @@
    1.14  	thanx to that, the users that don't want to use many mouses don't have to
    1.15  	worry about anything*/
    1.16      SDL_mice[index]->relative_mode=SDL_FALSE;
    1.17 +    SDL_mice[index]->current_end=0;
    1.18 +    SDL_mice[index]->total_ends=ends;
    1.19      SDL_SelectMouse(selected_mouse);
    1.20  
    1.21      return index;
    1.22 @@ -460,6 +463,7 @@
    1.23          event.motion.windowID = mouse->focus;
    1.24          event.motion.pressure_max=mouse->pressure_max;
    1.25          event.motion.pressure_min=mouse->pressure_min;
    1.26 +		event.motion.cursor=SDL_mice[index]->current_end;
    1.27          posted = (SDL_PushEvent(&event) > 0);
    1.28      }
    1.29      last_x=x;
    1.30 @@ -796,5 +800,24 @@
    1.31      x_max=x;
    1.32      y_max=y;
    1.33  }
    1.34 +
    1.35 +void SDL_ChangeEnd(int id, int end)
    1.36 +{
    1.37 +	int index=SDL_GetIndexById(id);
    1.38 +	SDL_mice[index]->current_end=end;
    1.39 +}
    1.40 +
    1.41 +int SDL_GetCursorsNumber(int index)
    1.42 +{
    1.43 +	if(index>=SDL_num_mice)
    1.44 +	{
    1.45 +		return -1;
    1.46 +	}
    1.47 +	if(SDL_mice[index]==NULL)
    1.48 +	{
    1.49 +		return -1;
    1.50 +	}
    1.51 +	return SDL_mice[index]->total_ends;
    1.52 +}
    1.53  /* vi: set ts=4 sw=4 expandtab: */
    1.54