jim@4646
|
1 |
/*
|
slouken@5535
|
2 |
Simple DirectMedia Layer
|
slouken@8149
|
3 |
Copyright (C) 1997-2014 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
|
slouken@7191
|
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 |
extern "C" {
|
jim@4646
|
39 |
#endif
|
jim@4646
|
40 |
|
slouken@4679
|
41 |
typedef Sint64 SDL_TouchID;
|
slouken@4679
|
42 |
typedef Sint64 SDL_FingerID;
|
jimtla@4678
|
43 |
|
slouken@6950
|
44 |
typedef struct SDL_Finger
|
slouken@6950
|
45 |
{
|
slouken@6950
|
46 |
SDL_FingerID id;
|
slouken@6951
|
47 |
float x;
|
slouken@6951
|
48 |
float y;
|
slouken@6951
|
49 |
float pressure;
|
slouken@6950
|
50 |
} SDL_Finger;
|
jimtla@4678
|
51 |
|
slouken@6950
|
52 |
/* Used as the device ID for mouse events simulated with touch input */
|
slouken@6950
|
53 |
#define SDL_TOUCH_MOUSEID ((Uint32)-1)
|
jim@4646
|
54 |
|
jimtla@4649
|
55 |
|
jim@4646
|
56 |
/* Function prototypes */
|
jim@4646
|
57 |
|
jim@4646
|
58 |
/**
|
slouken@6951
|
59 |
* \brief Get the number of registered touch devices.
|
jim@4646
|
60 |
*/
|
philipp@7170
|
61 |
extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
|
jim@4646
|
62 |
|
jim@4646
|
63 |
/**
|
slouken@6951
|
64 |
* \brief Get the touch ID with the given index, or 0 if the index is invalid.
|
jim@4646
|
65 |
*/
|
slouken@6951
|
66 |
extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
|
slouken@6951
|
67 |
|
slouken@6951
|
68 |
/**
|
slouken@6951
|
69 |
* \brief Get the number of active fingers for a given touch device.
|
slouken@6951
|
70 |
*/
|
slouken@6951
|
71 |
extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
|
slouken@6951
|
72 |
|
slouken@6951
|
73 |
/**
|
slouken@6951
|
74 |
* \brief Get the finger object of the given touch, with the given index.
|
slouken@6951
|
75 |
*/
|
slouken@6951
|
76 |
extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
|
jim@4646
|
77 |
|
jim@4646
|
78 |
/* Ends C function definitions when using C++ */
|
jim@4646
|
79 |
#ifdef __cplusplus
|
jim@4646
|
80 |
}
|
jim@4646
|
81 |
#endif
|
jim@4646
|
82 |
#include "close_code.h"
|
jim@4646
|
83 |
|
slouken@6342
|
84 |
#endif /* _SDL_touch_h */
|
jim@4646
|
85 |
|
jim@4646
|
86 |
/* vi: set ts=4 sw=4 expandtab: */
|