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 |
|
jim@4646
|
45 |
struct SDL_Finger {
|
jimtla@4676
|
46 |
long id;
|
jimtla@4676
|
47 |
float x;
|
jimtla@4676
|
48 |
float y;
|
jimtla@4676
|
49 |
float xdelta;
|
jimtla@4676
|
50 |
float ydelta;
|
jimtla@4676
|
51 |
float last_x, last_y,last_pressure; /* the last reported coordinates */
|
jim@4655
|
52 |
SDL_bool down;
|
jimtla@4676
|
53 |
float pressure;
|
jim@4646
|
54 |
};
|
jim@4646
|
55 |
|
jimtla@4649
|
56 |
typedef struct SDL_Touch SDL_Touch;
|
jimtla@4649
|
57 |
typedef struct SDL_Finger SDL_Finger;
|
jim@4646
|
58 |
|
jimtla@4649
|
59 |
|
jimtla@4649
|
60 |
struct SDL_Touch {
|
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 */
|
jimtla@4676
|
66 |
float pressure_max, pressure_min;
|
jimtla@4676
|
67 |
float x_max,x_min;
|
jimtla@4676
|
68 |
float y_max,y_min;
|
jimtla@4676
|
69 |
float xres,yres,pressureres;
|
jimtla@4676
|
70 |
float tilt; /* for future use */
|
jimtla@4676
|
71 |
float rotation; /* for future use */
|
jim@4646
|
72 |
|
jim@4646
|
73 |
/* Data common to all touch */
|
jimtla@4676
|
74 |
long 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 |
|
jimtla@4649
|
90 |
|
jim@4646
|
91 |
/* Function prototypes */
|
jim@4646
|
92 |
|
jim@4646
|
93 |
/**
|
jim@4646
|
94 |
* \brief Get the touch object at the given id.
|
jim@4646
|
95 |
*
|
jim@4646
|
96 |
*
|
jim@4646
|
97 |
*/
|
jimtla@4676
|
98 |
extern DECLSPEC SDL_Touch* SDLCALL SDL_GetTouch(long id);
|
jim@4646
|
99 |
|
jim@4646
|
100 |
|
jim@4646
|
101 |
|
jim@4646
|
102 |
/**
|
jim@4646
|
103 |
* \brief Get the finger object of the given touch, at the given id.
|
jim@4646
|
104 |
*
|
jim@4646
|
105 |
*
|
jim@4646
|
106 |
*/
|
jimtla@4676
|
107 |
extern DECLSPEC SDL_Finger* SDLCALL SDL_GetFinger(SDL_Touch *touch, long id);
|
jim@4646
|
108 |
|
jim@4646
|
109 |
/* Ends C function definitions when using C++ */
|
jim@4646
|
110 |
#ifdef __cplusplus
|
jim@4646
|
111 |
/* *INDENT-OFF* */
|
jim@4646
|
112 |
}
|
jim@4646
|
113 |
/* *INDENT-ON* */
|
jim@4646
|
114 |
#endif
|
jim@4646
|
115 |
#include "close_code.h"
|
jim@4646
|
116 |
|
jim@4646
|
117 |
#endif /* _SDL_mouse_h */
|
jim@4646
|
118 |
|
jim@4646
|
119 |
/* vi: set ts=4 sw=4 expandtab: */
|