include/SDL_touch.h
author Sam Lantinga <slouken@libsdl.org>
Mon, 17 Jan 2011 09:09:15 -0800
changeset 5009 b21ad135d86b
parent 4689 f9ab8df6d45a
child 5262 b530ef003506
permissions -rw-r--r--
Minor documentation consistency cleanup
     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 touch 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 typedef Sint64 SDL_TouchID;
    46 typedef Sint64 SDL_FingerID;
    47 
    48 
    49 struct SDL_Finger {
    50   SDL_FingerID id;
    51   Uint16 x;
    52   Uint16 y;
    53   Uint16 pressure;
    54   Uint16 xdelta;
    55   Uint16 ydelta;
    56   Uint16 last_x, last_y,last_pressure;  /* the last reported coordinates */
    57   SDL_bool down;
    58 };
    59 
    60 typedef struct SDL_Touch SDL_Touch;
    61 typedef struct SDL_Finger SDL_Finger;
    62 
    63 
    64 struct SDL_Touch {
    65   
    66   /* Free the touch when it's time */
    67   void (*FreeTouch) (SDL_Touch * touch);
    68   
    69   /* data common for tablets */
    70   float pressure_max, pressure_min;
    71   float x_max,x_min;
    72   float y_max,y_min;
    73   Uint16 xres,yres,pressureres;
    74   float native_xres,native_yres,native_pressureres;
    75   float tilt;                   /* for future use */
    76   float rotation;               /* for future use */
    77   
    78   /* Data common to all touch */
    79   SDL_TouchID id;
    80   SDL_Window *focus;
    81   
    82   char *name;
    83   Uint8 buttonstate;
    84   SDL_bool relative_mode;
    85   SDL_bool flush_motion;
    86 
    87   int num_fingers;
    88   int max_fingers;
    89   SDL_Finger** fingers;
    90     
    91   void *driverdata;
    92 };
    93 
    94 
    95 
    96 /* Function prototypes */
    97 
    98 /**
    99  *  \brief Get the touch object at the given id.
   100  *
   101  *
   102  */
   103   extern DECLSPEC SDL_Touch* SDLCALL SDL_GetTouch(SDL_TouchID id);
   104 
   105 
   106 
   107 /**
   108  *  \brief Get the finger object of the given touch, at the given id.
   109  *
   110  *
   111  */
   112   extern 
   113   DECLSPEC SDL_Finger* SDLCALL SDL_GetFinger(SDL_Touch *touch, SDL_FingerID id);
   114 
   115 /* Ends C function definitions when using C++ */
   116 #ifdef __cplusplus
   117 /* *INDENT-OFF* */
   118 }
   119 /* *INDENT-ON* */
   120 #endif
   121 #include "close_code.h"
   122 
   123 #endif /* _SDL_mouse_h */
   124 
   125 /* vi: set ts=4 sw=4 expandtab: */