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