SDL Library
SDL_touch.h@0:7fb6877b5d7c, 2016-09-22 (annotated)
- Committer:
- miruga27
- Date:
- Thu Sep 22 00:03:09 2016 +0000
- Revision:
- 0:7fb6877b5d7c
SDL
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
miruga27 | 0:7fb6877b5d7c | 1 | /* |
miruga27 | 0:7fb6877b5d7c | 2 | Simple DirectMedia Layer |
miruga27 | 0:7fb6877b5d7c | 3 | Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org> |
miruga27 | 0:7fb6877b5d7c | 4 | |
miruga27 | 0:7fb6877b5d7c | 5 | This software is provided 'as-is', without any express or implied |
miruga27 | 0:7fb6877b5d7c | 6 | warranty. In no event will the authors be held liable for any damages |
miruga27 | 0:7fb6877b5d7c | 7 | arising from the use of this software. |
miruga27 | 0:7fb6877b5d7c | 8 | |
miruga27 | 0:7fb6877b5d7c | 9 | Permission is granted to anyone to use this software for any purpose, |
miruga27 | 0:7fb6877b5d7c | 10 | including commercial applications, and to alter it and redistribute it |
miruga27 | 0:7fb6877b5d7c | 11 | freely, subject to the following restrictions: |
miruga27 | 0:7fb6877b5d7c | 12 | |
miruga27 | 0:7fb6877b5d7c | 13 | 1. The origin of this software must not be misrepresented; you must not |
miruga27 | 0:7fb6877b5d7c | 14 | claim that you wrote the original software. If you use this software |
miruga27 | 0:7fb6877b5d7c | 15 | in a product, an acknowledgment in the product documentation would be |
miruga27 | 0:7fb6877b5d7c | 16 | appreciated but is not required. |
miruga27 | 0:7fb6877b5d7c | 17 | 2. Altered source versions must be plainly marked as such, and must not be |
miruga27 | 0:7fb6877b5d7c | 18 | misrepresented as being the original software. |
miruga27 | 0:7fb6877b5d7c | 19 | 3. This notice may not be removed or altered from any source distribution. |
miruga27 | 0:7fb6877b5d7c | 20 | */ |
miruga27 | 0:7fb6877b5d7c | 21 | |
miruga27 | 0:7fb6877b5d7c | 22 | /** |
miruga27 | 0:7fb6877b5d7c | 23 | * \file SDL_touch.h |
miruga27 | 0:7fb6877b5d7c | 24 | * |
miruga27 | 0:7fb6877b5d7c | 25 | * Include file for SDL touch event handling. |
miruga27 | 0:7fb6877b5d7c | 26 | */ |
miruga27 | 0:7fb6877b5d7c | 27 | |
miruga27 | 0:7fb6877b5d7c | 28 | #ifndef _SDL_touch_h |
miruga27 | 0:7fb6877b5d7c | 29 | #define _SDL_touch_h |
miruga27 | 0:7fb6877b5d7c | 30 | |
miruga27 | 0:7fb6877b5d7c | 31 | #include "SDL_stdinc.h" |
miruga27 | 0:7fb6877b5d7c | 32 | #include "SDL_error.h" |
miruga27 | 0:7fb6877b5d7c | 33 | #include "SDL_video.h" |
miruga27 | 0:7fb6877b5d7c | 34 | |
miruga27 | 0:7fb6877b5d7c | 35 | #include "begin_code.h" |
miruga27 | 0:7fb6877b5d7c | 36 | /* Set up for C function definitions, even when using C++ */ |
miruga27 | 0:7fb6877b5d7c | 37 | #ifdef __cplusplus |
miruga27 | 0:7fb6877b5d7c | 38 | extern "C" { |
miruga27 | 0:7fb6877b5d7c | 39 | #endif |
miruga27 | 0:7fb6877b5d7c | 40 | |
miruga27 | 0:7fb6877b5d7c | 41 | typedef Sint64 SDL_TouchID; |
miruga27 | 0:7fb6877b5d7c | 42 | typedef Sint64 SDL_FingerID; |
miruga27 | 0:7fb6877b5d7c | 43 | |
miruga27 | 0:7fb6877b5d7c | 44 | typedef struct SDL_Finger |
miruga27 | 0:7fb6877b5d7c | 45 | { |
miruga27 | 0:7fb6877b5d7c | 46 | SDL_FingerID id; |
miruga27 | 0:7fb6877b5d7c | 47 | float x; |
miruga27 | 0:7fb6877b5d7c | 48 | float y; |
miruga27 | 0:7fb6877b5d7c | 49 | float pressure; |
miruga27 | 0:7fb6877b5d7c | 50 | } SDL_Finger; |
miruga27 | 0:7fb6877b5d7c | 51 | |
miruga27 | 0:7fb6877b5d7c | 52 | /* Used as the device ID for mouse events simulated with touch input */ |
miruga27 | 0:7fb6877b5d7c | 53 | #define SDL_TOUCH_MOUSEID ((Uint32)-1) |
miruga27 | 0:7fb6877b5d7c | 54 | |
miruga27 | 0:7fb6877b5d7c | 55 | |
miruga27 | 0:7fb6877b5d7c | 56 | /* Function prototypes */ |
miruga27 | 0:7fb6877b5d7c | 57 | |
miruga27 | 0:7fb6877b5d7c | 58 | /** |
miruga27 | 0:7fb6877b5d7c | 59 | * \brief Get the number of registered touch devices. |
miruga27 | 0:7fb6877b5d7c | 60 | */ |
miruga27 | 0:7fb6877b5d7c | 61 | extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); |
miruga27 | 0:7fb6877b5d7c | 62 | |
miruga27 | 0:7fb6877b5d7c | 63 | /** |
miruga27 | 0:7fb6877b5d7c | 64 | * \brief Get the touch ID with the given index, or 0 if the index is invalid. |
miruga27 | 0:7fb6877b5d7c | 65 | */ |
miruga27 | 0:7fb6877b5d7c | 66 | extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); |
miruga27 | 0:7fb6877b5d7c | 67 | |
miruga27 | 0:7fb6877b5d7c | 68 | /** |
miruga27 | 0:7fb6877b5d7c | 69 | * \brief Get the number of active fingers for a given touch device. |
miruga27 | 0:7fb6877b5d7c | 70 | */ |
miruga27 | 0:7fb6877b5d7c | 71 | extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); |
miruga27 | 0:7fb6877b5d7c | 72 | |
miruga27 | 0:7fb6877b5d7c | 73 | /** |
miruga27 | 0:7fb6877b5d7c | 74 | * \brief Get the finger object of the given touch, with the given index. |
miruga27 | 0:7fb6877b5d7c | 75 | */ |
miruga27 | 0:7fb6877b5d7c | 76 | extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); |
miruga27 | 0:7fb6877b5d7c | 77 | |
miruga27 | 0:7fb6877b5d7c | 78 | /* Ends C function definitions when using C++ */ |
miruga27 | 0:7fb6877b5d7c | 79 | #ifdef __cplusplus |
miruga27 | 0:7fb6877b5d7c | 80 | } |
miruga27 | 0:7fb6877b5d7c | 81 | #endif |
miruga27 | 0:7fb6877b5d7c | 82 | #include "close_code.h" |
miruga27 | 0:7fb6877b5d7c | 83 | |
miruga27 | 0:7fb6877b5d7c | 84 | #endif /* _SDL_touch_h */ |
miruga27 | 0:7fb6877b5d7c | 85 | |
miruga27 | 0:7fb6877b5d7c | 86 | /* vi: set ts=4 sw=4 expandtab: */ |