include/SDL_touch.h
changeset 6950 1ddb72193079
parent 6885 700f1b25f77f
child 6951 7833f01322b3
     1.1 --- a/include/SDL_touch.h	Sat Mar 02 17:51:32 2013 -0800
     1.2 +++ b/include/SDL_touch.h	Sat Mar 02 20:44:16 2013 -0800
     1.3 @@ -40,30 +40,25 @@
     1.4  /* *INDENT-ON* */
     1.5  #endif
     1.6  
     1.7 -
     1.8  typedef Sint64 SDL_TouchID;
     1.9  typedef Sint64 SDL_FingerID;
    1.10  
    1.11 +typedef struct SDL_Finger
    1.12 +{
    1.13 +    SDL_FingerID id;
    1.14 +    Uint16 x;
    1.15 +    Uint16 y;
    1.16 +    Uint16 pressure;
    1.17 +    Uint16 xdelta;
    1.18 +    Uint16 ydelta;
    1.19 +    Uint16 last_x, last_y,last_pressure;  /* the last reported coordinates */
    1.20 +    SDL_bool down;
    1.21 +} SDL_Finger;
    1.22  
    1.23 -struct SDL_Finger {
    1.24 -  SDL_FingerID id;
    1.25 -  Uint16 x;
    1.26 -  Uint16 y;
    1.27 -  Uint16 pressure;
    1.28 -  Uint16 xdelta;
    1.29 -  Uint16 ydelta;
    1.30 -  Uint16 last_x, last_y,last_pressure;  /* the last reported coordinates */
    1.31 -  SDL_bool down;
    1.32 -};
    1.33 -
    1.34 -typedef struct SDL_Touch SDL_Touch;
    1.35 -typedef struct SDL_Finger SDL_Finger;
    1.36 -
    1.37 -
    1.38 -struct SDL_Touch {
    1.39 -  
    1.40 +typedef struct SDL_Touch
    1.41 +{
    1.42    /* Free the touch when it's time */
    1.43 -  void (*FreeTouch) (SDL_Touch * touch);
    1.44 +  void (*FreeTouch) (struct SDL_Touch * touch);
    1.45    
    1.46    /* data common for tablets */
    1.47    float pressure_max, pressure_min;
    1.48 @@ -89,28 +84,23 @@
    1.49    SDL_Finger** fingers;
    1.50      
    1.51    void *driverdata;
    1.52 -};
    1.53 +} SDL_Touch;
    1.54  
    1.55 +/* Used as the device ID for mouse events simulated with touch input */
    1.56 +#define SDL_TOUCH_MOUSEID ((Uint32)-1)
    1.57  
    1.58  
    1.59  /* Function prototypes */
    1.60  
    1.61  /**
    1.62 - *  \brief Get the touch object at the given id.
    1.63 - *
    1.64 - *
    1.65 + *  \brief Get the touch object with the given id.
    1.66   */
    1.67 -  extern DECLSPEC SDL_Touch* SDLCALL SDL_GetTouch(SDL_TouchID id);
    1.68 -
    1.69 -
    1.70 +extern DECLSPEC SDL_Touch* SDLCALL SDL_GetTouch(SDL_TouchID id);
    1.71  
    1.72  /**
    1.73 - *  \brief Get the finger object of the given touch, at the given id.
    1.74 - *
    1.75 - *
    1.76 + *  \brief Get the finger object of the given touch, with the given id.
    1.77   */
    1.78 -  extern 
    1.79 -  DECLSPEC SDL_Finger* SDLCALL SDL_GetFinger(SDL_Touch *touch, SDL_FingerID id);
    1.80 +extern DECLSPEC SDL_Finger* SDLCALL SDL_GetFinger(SDL_Touch *touch, SDL_FingerID id);
    1.81  
    1.82  /* Ends C function definitions when using C++ */
    1.83  #ifdef __cplusplus