src/video/x11/SDL_x11xinput2.c
changeset 6375 93f9a24d1c02
parent 6318 49b2cb56db6e
child 6432 de49d33b829e
     1.1 --- a/src/video/x11/SDL_x11xinput2.c	Fri Jul 20 13:32:34 2012 -0400
     1.2 +++ b/src/video/x11/SDL_x11xinput2.c	Fri Jul 20 13:33:15 2012 -0400
     1.3 @@ -29,16 +29,19 @@
     1.4  
     1.5  #define MAX_AXIS 16
     1.6  
     1.7 +#if SDL_VIDEO_DRIVER_X11_XINPUT2
     1.8  static int xinput2_initialized = 0;
     1.9 +
    1.10 +#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
    1.11  static int xinput2_multitouch_supported = 0;
    1.12 -/* Opcode returned XQueryExtension 
    1.13 +#endif
    1.14 +
    1.15 +/* Opcode returned XQueryExtension
    1.16   * It will be used in event processing
    1.17   * to know that the event came from
    1.18   * this extension */ 
    1.19  static int xinput2_opcode;
    1.20  
    1.21 -
    1.22 -#if SDL_VIDEO_DRIVER_X11_XINPUT2
    1.23  static void parse_valuators(const double *input_values,unsigned char *mask,int mask_len,
    1.24                              double *output_values,int output_values_len) {
    1.25      int i = 0,z = 0;
    1.26 @@ -237,12 +240,20 @@
    1.27  
    1.28  int 
    1.29  X11_Xinput2IsInitialized() {
    1.30 +#if SDL_VIDEO_DRIVER_X11_XINPUT2
    1.31      return xinput2_initialized;
    1.32 +#else
    1.33 +    return 0;
    1.34 +#endif
    1.35  }
    1.36  
    1.37  int
    1.38  X11_Xinput2IsMutitouchSupported() {
    1.39 +#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
    1.40      return xinput2_initialized && xinput2_multitouch_supported;
    1.41 +#else
    1.42 +    return 0;
    1.43 +#endif
    1.44  }
    1.45  
    1.46  #endif /* SDL_VIDEO_DRIVER_X11 */