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