include/SDL_touch.h
changeset 4646 eea1bf53effa
child 4649 35a80b0791aa
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/include/SDL_touch.h	Tue Jun 01 02:54:33 2010 -0400
     1.3 @@ -0,0 +1,118 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997-2010 Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Lesser General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2.1 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Lesser General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Lesser General Public
    1.19 +    License along with this library; if not, write to the Free Software
    1.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@libsdl.org
    1.24 +*/
    1.25 +
    1.26 +/**
    1.27 + *  \file SDL_touch.h
    1.28 + *  
    1.29 + *  Include file for SDL mouse event handling.
    1.30 + */
    1.31 +
    1.32 +#ifndef _SDL_touch_h
    1.33 +#define _SDL_touch_h
    1.34 +
    1.35 +#include "SDL_stdinc.h"
    1.36 +#include "SDL_error.h"
    1.37 +#include "SDL_video.h"
    1.38 +
    1.39 +#include "begin_code.h"
    1.40 +/* Set up for C function definitions, even when using C++ */
    1.41 +#ifdef __cplusplus
    1.42 +/* *INDENT-OFF* */
    1.43 +extern "C" {
    1.44 +/* *INDENT-ON* */
    1.45 +#endif
    1.46 +
    1.47 +typedef struct SDL_Touch SDL_Touch;
    1.48 +typedef struct SDL_Finger SDL_Finger;
    1.49 +
    1.50 +struct SDL_Finger {
    1.51 +  int id;
    1.52 +  int x;
    1.53 +  int y;
    1.54 +  int z;                      /* for future use */
    1.55 +  int xdelta;
    1.56 +  int ydelta;
    1.57 +  int last_x, last_y,last_pressure;  /* the last reported coordinates */
    1.58 +  int pressure;
    1.59 +};
    1.60 +
    1.61 +
    1.62 +struct SDL_Touch
    1.63 +{
    1.64 +  
    1.65 +  /* Free the touch when it's time */
    1.66 +  void (*FreeTouch) (SDL_Touch * touch);
    1.67 +  
    1.68 +  /* data common for tablets */
    1.69 +  int pressure_max, pressure_min;
    1.70 +  int x_max,x_min;
    1.71 +  int y_max,y_min;
    1.72 +  int xres,yres,pressureres;
    1.73 +  int tilt;                   /* for future use */
    1.74 +  int rotation;               /* for future use */
    1.75 +  
    1.76 +  /* Data common to all touch */
    1.77 +  int id;
    1.78 +  SDL_Window *focus;
    1.79 +  
    1.80 +  char *name;
    1.81 +  Uint8 buttonstate;
    1.82 +  SDL_bool relative_mode;
    1.83 +  SDL_bool flush_motion;
    1.84 +
    1.85 +  int num_fingers;
    1.86 +  int max_fingers;
    1.87 +  SDL_Finger** fingers;
    1.88 +    
    1.89 +  void *driverdata;
    1.90 +};
    1.91 +
    1.92 +
    1.93 +/* Function prototypes */
    1.94 +
    1.95 +/**
    1.96 + *  \brief Get the touch object at the given id.
    1.97 + *
    1.98 + *
    1.99 + */
   1.100 +  extern DECLSPEC SDL_Touch* SDLCALL SDL_GetTouch(int id);
   1.101 +
   1.102 +
   1.103 +
   1.104 +/**
   1.105 + *  \brief Get the finger object of the given touch, at the given id.
   1.106 + *
   1.107 + *
   1.108 + */
   1.109 +  extern DECLSPEC SDL_Finger* SDLCALL SDL_GetFinger(SDL_Touch *touch, int id);
   1.110 +
   1.111 +/* Ends C function definitions when using C++ */
   1.112 +#ifdef __cplusplus
   1.113 +/* *INDENT-OFF* */
   1.114 +}
   1.115 +/* *INDENT-ON* */
   1.116 +#endif
   1.117 +#include "close_code.h"
   1.118 +
   1.119 +#endif /* _SDL_mouse_h */
   1.120 +
   1.121 +/* vi: set ts=4 sw=4 expandtab: */