src/events/SDL_touch_c.h
changeset 4640 f068a6dfc858
child 4641 49a97daea6ec
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/events/SDL_touch_c.h	Tue May 25 23:23:23 2010 -0400
     1.3 @@ -0,0 +1,113 @@
     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 +#include "SDL_config.h"
    1.26 +
    1.27 +#ifndef _SDL_touch_c_h
    1.28 +#define _SDL_touch_c_h
    1.29 +
    1.30 +typedef struct SDL_Touch SDL_Touch;
    1.31 +
    1.32 +
    1.33 +struct SDL_Touch
    1.34 +{
    1.35 +    /* Warp the touch to (x,y) */
    1.36 +    void (*WarpTouch) (SDL_Touch * touch, SDL_Window * window, int x,
    1.37 +                       int y);
    1.38 +
    1.39 +    /* Free the touch when it's time */
    1.40 +    void (*FreeTouch) (SDL_Touch * touch);
    1.41 +
    1.42 +    /* data common for tablets */
    1.43 +    int pressure;
    1.44 +    int pressure_max;
    1.45 +    int pressure_min;
    1.46 +    int tilt;                   /* for future use */
    1.47 +    int rotation;               /* for future use */
    1.48 +    int total_ends;
    1.49 +    int current_end;
    1.50 +
    1.51 +    /* Data common to all touch */
    1.52 +    int id;
    1.53 +    SDL_Window *focus;
    1.54 +    int which;
    1.55 +    int x;
    1.56 +    int y;
    1.57 +    int z;                      /* for future use */
    1.58 +    int xdelta;
    1.59 +    int ydelta;
    1.60 +    int last_x, last_y;         /* the last reported x and y coordinates */
    1.61 +    char *name;
    1.62 +    Uint8 buttonstate;
    1.63 +    SDL_bool relative_mode;
    1.64 +    SDL_bool proximity;
    1.65 +    SDL_bool flush_motion;
    1.66 +
    1.67 +    SDL_Cursor *cursors;
    1.68 +    SDL_Cursor *def_cursor;
    1.69 +    SDL_Cursor *cur_cursor;
    1.70 +    SDL_bool cursor_shown;
    1.71 +
    1.72 +    void *driverdata;
    1.73 +};
    1.74 +
    1.75 +/* Initialize the touch subsystem */
    1.76 +extern int SDL_TouchInit(void);
    1.77 +
    1.78 +/* Get the touch at an index */
    1.79 +extern SDL_Touch *SDL_GetTouch(int index);
    1.80 +
    1.81 +/* Add a touch, possibly reattaching at a particular index (or -1),
    1.82 +   returning the index of the touch, or -1 if there was an error.
    1.83 + */
    1.84 +extern int SDL_AddTouch(const SDL_Touch * touch, char *name,
    1.85 +                        int pressure_max, int pressure_min, int ends);
    1.86 +
    1.87 +/* Remove a touch at an index, clearing the slot for later */
    1.88 +extern void SDL_DelTouch(int index);
    1.89 +
    1.90 +/* Clear the button state of a touch at an index */
    1.91 +extern void SDL_ResetTouch(int index);
    1.92 +
    1.93 +/* Set the touch focus window */
    1.94 +extern void SDL_SetTouchFocus(int id, SDL_Window * window);
    1.95 +
    1.96 +/* Send a touch motion event for a touch */
    1.97 +extern int SDL_SendTouchMotion(int id, int relative, int x, int y, int z);
    1.98 +
    1.99 +/* Send a touch button event for a touch */
   1.100 +extern int SDL_SendTouchButton(int id, Uint8 state, Uint8 button);
   1.101 +
   1.102 +/* Send a touch wheel event for a touch */
   1.103 +extern int SDL_SendTouchWheel(int id, int x, int y);
   1.104 +
   1.105 +/* Send a proximity event for a touch */
   1.106 +extern int SDL_SendProximity(int id, int x, int y, int type);
   1.107 +
   1.108 +/* Shutdown the touch subsystem */
   1.109 +extern void SDL_TouchQuit(void);
   1.110 +
   1.111 +/* FIXME: Where do these functions go in this header? */
   1.112 +extern void SDL_ChangeEnd(int id, int end);
   1.113 +
   1.114 +#endif /* _SDL_touch_c_h */
   1.115 +
   1.116 +/* vi: set ts=4 sw=4 expandtab: */