src/events/SDL_gesture.c
changeset 4678 f8431f66613d
parent 4665 c2493813a2f4
child 4681 5378f2d0754f
     1.1 --- a/src/events/SDL_gesture.c	Sat Jul 31 01:24:50 2010 +0400
     1.2 +++ b/src/events/SDL_gesture.c	Sat Jul 31 20:02:54 2010 +0400
     1.3 @@ -46,7 +46,7 @@
     1.4  typedef struct {
     1.5    Point p;
     1.6    float pressure;
     1.7 -  int id;
     1.8 +  SDL_FingerID id;
     1.9  } Finger;
    1.10  
    1.11  
    1.12 @@ -71,7 +71,7 @@
    1.13  } DollarTemplate;
    1.14  
    1.15  typedef struct {
    1.16 -  int id;
    1.17 +  SDL_GestureID id;
    1.18    Point res;
    1.19    Point centroid;
    1.20    TouchPoint gestureLast[MAXFINGERS];
    1.21 @@ -87,7 +87,7 @@
    1.22  int numGestureTouches = 0;
    1.23  SDL_bool recordAll;
    1.24  
    1.25 -int SDL_RecordGesture(int touchId) {
    1.26 +int SDL_RecordGesture(SDL_TouchID touchId) {
    1.27    int i;
    1.28    if(touchId < 0) recordAll = SDL_TRUE;
    1.29    for(i = 0;i < numGestureTouches; i++) {
    1.30 @@ -143,7 +143,7 @@
    1.31    return rtrn;  
    1.32  }
    1.33  
    1.34 -int SDL_SaveDollarTemplate(unsigned long gestureId, SDL_RWops *src) {
    1.35 +int SDL_SaveDollarTemplate(SDL_GestureID gestureId, SDL_RWops *src) {
    1.36    int i,j;
    1.37    for(i = 0; i < numGestureTouches; i++) {
    1.38      GestureTouch* touch = &gestureTouch[i];
    1.39 @@ -185,7 +185,7 @@
    1.40    return -1;
    1.41  }
    1.42  
    1.43 -int SDL_LoadDollarTemplates(int touchId, SDL_RWops *src) {
    1.44 +int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src) {
    1.45    if(src == NULL) return 0;
    1.46    int i,loaded = 0;
    1.47    GestureTouch *touch = NULL;
    1.48 @@ -394,7 +394,7 @@
    1.49    return 0;
    1.50  }
    1.51  
    1.52 -GestureTouch * SDL_GetGestureTouch(int id) {
    1.53 +GestureTouch * SDL_GetGestureTouch(SDL_TouchID id) {
    1.54    int i;
    1.55    for(i = 0;i < numGestureTouches; i++) {
    1.56      //printf("%i ?= %i\n",gestureTouch[i].id,id);
    1.57 @@ -414,7 +414,8 @@
    1.58    return SDL_PushEvent(&event) > 0;
    1.59  }
    1.60  
    1.61 -int SDL_SendGestureDollar(GestureTouch* touch,int gestureId,float error) {
    1.62 +int SDL_SendGestureDollar(GestureTouch* touch,
    1.63 +			  SDL_GestureID gestureId,float error) {
    1.64    SDL_Event event;
    1.65    event.dgesture.type = SDL_DOLLARGESTURE;
    1.66    event.dgesture.touchId = touch->id;
    1.67 @@ -429,7 +430,7 @@
    1.68  }
    1.69  
    1.70  
    1.71 -int SDL_SendDollarRecord(GestureTouch* touch,int gestureId) {
    1.72 +int SDL_SendDollarRecord(GestureTouch* touch,SDL_GestureID gestureId) {
    1.73    SDL_Event event;
    1.74    event.dgesture.type = SDL_DOLLARRECORD;
    1.75    event.dgesture.touchId = touch->id;
    1.76 @@ -489,7 +490,7 @@
    1.77  				  &bestTempl,inTouch);
    1.78  	  if(bestTempl >= 0){
    1.79  	    //Send Event
    1.80 -	    int gestureId = inTouch->dollarTemplate[bestTempl].hash;
    1.81 +	    unsigned long gestureId = inTouch->dollarTemplate[bestTempl].hash;
    1.82  	    SDL_SendGestureDollar(inTouch,gestureId,error);
    1.83  	    printf("Dollar error: %f\n",error);
    1.84  	  }