include/SDL_touch.h
author Jim Grandpre <jim.tla@gmail.com>
Fri, 18 Jun 2010 01:43:02 -0400
changeset 4655 4c94f2023d62
parent 4649 35a80b0791aa
child 4659 063b9455bd1a
permissions -rw-r--r--
Fixed bugs in input, cleaned up $1
     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 
    45 struct SDL_Finger {
    46   int id;
    47   int x;
    48   int y;
    49   int z;                      /* for future use */
    50   int xdelta;
    51   int ydelta;
    52   int last_x, last_y,last_pressure;  /* the last reported coordinates */
    53   SDL_bool down;
    54   int pressure;
    55 };
    56 
    57 typedef struct SDL_Touch SDL_Touch;
    58 typedef struct SDL_Finger SDL_Finger;
    59 
    60 
    61 struct SDL_Touch {
    62   
    63   /* Free the touch when it's time */
    64   void (*FreeTouch) (SDL_Touch * touch);
    65   
    66   /* data common for tablets */
    67   int pressure_max, pressure_min;
    68   int x_max,x_min;
    69   int y_max,y_min;
    70   int xres,yres,pressureres;
    71   int tilt;                   /* for future use */
    72   int rotation;               /* for future use */
    73   
    74   /* Data common to all touch */
    75   int id;
    76   SDL_Window *focus;
    77   
    78   char *name;
    79   Uint8 buttonstate;
    80   SDL_bool relative_mode;
    81   SDL_bool flush_motion;
    82 
    83   int num_fingers;
    84   int max_fingers;
    85   SDL_Finger** fingers;
    86     
    87   void *driverdata;
    88 };
    89 
    90 
    91 
    92 /* Function prototypes */
    93 
    94 /**
    95  *  \brief Get the touch object at the given id.
    96  *
    97  *
    98  */
    99   extern DECLSPEC SDL_Touch* SDLCALL SDL_GetTouch(int id);
   100 
   101 
   102 
   103 /**
   104  *  \brief Get the finger object of the given touch, at the given id.
   105  *
   106  *
   107  */
   108   extern DECLSPEC SDL_Finger* SDLCALL SDL_GetFinger(SDL_Touch *touch, int id);
   109 
   110 /* Ends C function definitions when using C++ */
   111 #ifdef __cplusplus
   112 /* *INDENT-OFF* */
   113 }
   114 /* *INDENT-ON* */
   115 #endif
   116 #include "close_code.h"
   117 
   118 #endif /* _SDL_mouse_h */
   119 
   120 /* vi: set ts=4 sw=4 expandtab: */