jim@4646
|
1 |
/*
|
slouken@5535
|
2 |
Simple DirectMedia Layer
|
slouken@6138
|
3 |
Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
|
jim@4646
|
4 |
|
slouken@5535
|
5 |
This software is provided 'as-is', without any express or implied
|
slouken@5535
|
6 |
warranty. In no event will the authors be held liable for any damages
|
slouken@5535
|
7 |
arising from the use of this software.
|
jim@4646
|
8 |
|
slouken@5535
|
9 |
Permission is granted to anyone to use this software for any purpose,
|
slouken@5535
|
10 |
including commercial applications, and to alter it and redistribute it
|
slouken@5535
|
11 |
freely, subject to the following restrictions:
|
jim@4646
|
12 |
|
slouken@5535
|
13 |
1. The origin of this software must not be misrepresented; you must not
|
slouken@5535
|
14 |
claim that you wrote the original software. If you use this software
|
slouken@5535
|
15 |
in a product, an acknowledgment in the product documentation would be
|
slouken@5535
|
16 |
appreciated but is not required.
|
slouken@5535
|
17 |
2. Altered source versions must be plainly marked as such, and must not be
|
slouken@5535
|
18 |
misrepresented as being the original software.
|
slouken@5535
|
19 |
3. This notice may not be removed or altered from any source distribution.
|
jim@4646
|
20 |
*/
|
jim@4646
|
21 |
|
jim@4646
|
22 |
/**
|
jim@4646
|
23 |
* \file SDL_touch.h
|
jim@4646
|
24 |
*
|
jim@4659
|
25 |
* Include file for SDL touch event handling.
|
jim@4646
|
26 |
*/
|
jim@4646
|
27 |
|
jim@4646
|
28 |
#ifndef _SDL_touch_h
|
jim@4646
|
29 |
#define _SDL_touch_h
|
jim@4646
|
30 |
|
jim@4646
|
31 |
#include "SDL_stdinc.h"
|
jim@4646
|
32 |
#include "SDL_error.h"
|
jim@4646
|
33 |
#include "SDL_video.h"
|
jim@4646
|
34 |
|
jim@4646
|
35 |
#include "begin_code.h"
|
jim@4646
|
36 |
/* Set up for C function definitions, even when using C++ */
|
jim@4646
|
37 |
#ifdef __cplusplus
|
jim@4646
|
38 |
/* *INDENT-OFF* */
|
jim@4646
|
39 |
extern "C" {
|
jim@4646
|
40 |
/* *INDENT-ON* */
|
jim@4646
|
41 |
#endif
|
jim@4646
|
42 |
|
jim@4646
|
43 |
|
slouken@4679
|
44 |
typedef Sint64 SDL_TouchID;
|
slouken@4679
|
45 |
typedef Sint64 SDL_FingerID;
|
jimtla@4678
|
46 |
|
jimtla@4678
|
47 |
|
jim@4646
|
48 |
struct SDL_Finger {
|
jimtla@4678
|
49 |
SDL_FingerID id;
|
jimtla@4678
|
50 |
Uint16 x;
|
jimtla@4678
|
51 |
Uint16 y;
|
jim@4689
|
52 |
Uint16 pressure;
|
jimtla@4678
|
53 |
Uint16 xdelta;
|
jimtla@4678
|
54 |
Uint16 ydelta;
|
jimtla@4678
|
55 |
Uint16 last_x, last_y,last_pressure; /* the last reported coordinates */
|
jim@4655
|
56 |
SDL_bool down;
|
jim@4646
|
57 |
};
|
jim@4646
|
58 |
|
jimtla@4649
|
59 |
typedef struct SDL_Touch SDL_Touch;
|
jimtla@4649
|
60 |
typedef struct SDL_Finger SDL_Finger;
|
jim@4646
|
61 |
|
jimtla@4649
|
62 |
|
jimtla@4649
|
63 |
struct SDL_Touch {
|
jim@4646
|
64 |
|
jim@4646
|
65 |
/* Free the touch when it's time */
|
jim@4646
|
66 |
void (*FreeTouch) (SDL_Touch * touch);
|
jim@4646
|
67 |
|
jim@4646
|
68 |
/* data common for tablets */
|
jimtla@4676
|
69 |
float pressure_max, pressure_min;
|
jimtla@4676
|
70 |
float x_max,x_min;
|
jimtla@4676
|
71 |
float y_max,y_min;
|
jimtla@4678
|
72 |
Uint16 xres,yres,pressureres;
|
jimtla@4678
|
73 |
float native_xres,native_yres,native_pressureres;
|
jimtla@4676
|
74 |
float tilt; /* for future use */
|
jimtla@4676
|
75 |
float rotation; /* for future use */
|
jim@4646
|
76 |
|
jim@4646
|
77 |
/* Data common to all touch */
|
jimtla@4678
|
78 |
SDL_TouchID id;
|
jim@4646
|
79 |
SDL_Window *focus;
|
jim@4646
|
80 |
|
jim@4646
|
81 |
char *name;
|
jim@4646
|
82 |
Uint8 buttonstate;
|
jim@4646
|
83 |
SDL_bool relative_mode;
|
jim@4646
|
84 |
SDL_bool flush_motion;
|
jim@4646
|
85 |
|
jim@4646
|
86 |
int num_fingers;
|
jim@4646
|
87 |
int max_fingers;
|
jim@4646
|
88 |
SDL_Finger** fingers;
|
jim@4646
|
89 |
|
jim@4646
|
90 |
void *driverdata;
|
jim@4646
|
91 |
};
|
jim@4646
|
92 |
|
jim@4646
|
93 |
|
jimtla@4649
|
94 |
|
jim@4646
|
95 |
/* Function prototypes */
|
jim@4646
|
96 |
|
jim@4646
|
97 |
/**
|
jim@4646
|
98 |
* \brief Get the touch object at the given id.
|
jim@4646
|
99 |
*
|
jim@4646
|
100 |
*
|
jim@4646
|
101 |
*/
|
jimtla@4678
|
102 |
extern DECLSPEC SDL_Touch* SDLCALL SDL_GetTouch(SDL_TouchID id);
|
jim@4646
|
103 |
|
jim@4646
|
104 |
|
jim@4646
|
105 |
|
jim@4646
|
106 |
/**
|
jim@4646
|
107 |
* \brief Get the finger object of the given touch, at the given id.
|
jim@4646
|
108 |
*
|
jim@4646
|
109 |
*
|
jim@4646
|
110 |
*/
|
jimtla@4678
|
111 |
extern
|
jimtla@4678
|
112 |
DECLSPEC SDL_Finger* SDLCALL SDL_GetFinger(SDL_Touch *touch, SDL_FingerID id);
|
jim@4646
|
113 |
|
jim@4646
|
114 |
/* Ends C function definitions when using C++ */
|
jim@4646
|
115 |
#ifdef __cplusplus
|
jim@4646
|
116 |
/* *INDENT-OFF* */
|
jim@4646
|
117 |
}
|
jim@4646
|
118 |
/* *INDENT-ON* */
|
jim@4646
|
119 |
#endif
|
jim@4646
|
120 |
#include "close_code.h"
|
jim@4646
|
121 |
|
jim@4646
|
122 |
#endif /* _SDL_mouse_h */
|
jim@4646
|
123 |
|
jim@4646
|
124 |
/* vi: set ts=4 sw=4 expandtab: */
|