include/SDL_touch.h
author Jim Grandpre <jim.tla@gmail.com>
Tue, 01 Jun 2010 02:54:33 -0400
changeset 4646 eea1bf53effa
child 4649 35a80b0791aa
permissions -rw-r--r--
Added include/touch.h Now reading in resolution of touch pad.
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2010 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 
    23 /**
    24  *  \file SDL_touch.h
    25  *  
    26  *  Include file for SDL mouse event handling.
    27  */
    28 
    29 #ifndef _SDL_touch_h
    30 #define _SDL_touch_h
    31 
    32 #include "SDL_stdinc.h"
    33 #include "SDL_error.h"
    34 #include "SDL_video.h"
    35 
    36 #include "begin_code.h"
    37 /* Set up for C function definitions, even when using C++ */
    38 #ifdef __cplusplus
    39 /* *INDENT-OFF* */
    40 extern "C" {
    41 /* *INDENT-ON* */
    42 #endif
    43 
    44 typedef struct SDL_Touch SDL_Touch;
    45 typedef struct SDL_Finger SDL_Finger;
    46 
    47 struct SDL_Finger {
    48   int id;
    49   int x;
    50   int y;
    51   int z;                      /* for future use */
    52   int xdelta;
    53   int ydelta;
    54   int last_x, last_y,last_pressure;  /* the last reported coordinates */
    55   int pressure;
    56 };
    57 
    58 
    59 struct SDL_Touch
    60 {
    61   
    62   /* Free the touch when it's time */
    63   void (*FreeTouch) (SDL_Touch * touch);
    64   
    65   /* data common for tablets */
    66   int pressure_max, pressure_min;
    67   int x_max,x_min;
    68   int y_max,y_min;
    69   int xres,yres,pressureres;
    70   int tilt;                   /* for future use */
    71   int rotation;               /* for future use */
    72   
    73   /* Data common to all touch */
    74   int id;
    75   SDL_Window *focus;
    76   
    77   char *name;
    78   Uint8 buttonstate;
    79   SDL_bool relative_mode;
    80   SDL_bool flush_motion;
    81 
    82   int num_fingers;
    83   int max_fingers;
    84   SDL_Finger** fingers;
    85     
    86   void *driverdata;
    87 };
    88 
    89 
    90 /* Function prototypes */
    91 
    92 /**
    93  *  \brief Get the touch object at the given id.
    94  *
    95  *
    96  */
    97   extern DECLSPEC SDL_Touch* SDLCALL SDL_GetTouch(int id);
    98 
    99 
   100 
   101 /**
   102  *  \brief Get the finger object of the given touch, at the given id.
   103  *
   104  *
   105  */
   106   extern DECLSPEC SDL_Finger* SDLCALL SDL_GetFinger(SDL_Touch *touch, int id);
   107 
   108 /* Ends C function definitions when using C++ */
   109 #ifdef __cplusplus
   110 /* *INDENT-OFF* */
   111 }
   112 /* *INDENT-ON* */
   113 #endif
   114 #include "close_code.h"
   115 
   116 #endif /* _SDL_mouse_h */
   117 
   118 /* vi: set ts=4 sw=4 expandtab: */