include/SDL_touch.h
author Ozkan Sezer <sezeroz@gmail.com>
Mon, 26 Nov 2018 19:55:01 +0300
changeset 12432 defbd51902c3
parent 12404 eb60e952b13f
child 12503 806492103856
permissions -rw-r--r--
SDL_touch.h (SDL_TouchDeviceType): remove comma at end of enumerator list.
jim@4646
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@11811
     3
  Copyright (C) 1997-2018 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
slouken@10638
    28
#ifndef SDL_touch_h_
slouken@10638
    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
slime73@12404
    44
typedef enum
slime73@12404
    45
{
slime73@12404
    46
    SDL_TOUCH_DEVICE_INVALID = -1,
slime73@12404
    47
    SDL_TOUCH_DEVICE_DIRECT,            /* touch screen with window-relative coordinates */
slime73@12404
    48
    SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */
sezeroz@12432
    49
    SDL_TOUCH_DEVICE_INDIRECT_RELATIVE  /* trackpad with screen cursor-relative coordinates */
slime73@12404
    50
} SDL_TouchDeviceType;
slime73@12404
    51
slouken@6950
    52
typedef struct SDL_Finger
slouken@6950
    53
{
slouken@6950
    54
    SDL_FingerID id;
slouken@6951
    55
    float x;
slouken@6951
    56
    float y;
slouken@6951
    57
    float pressure;
slouken@6950
    58
} SDL_Finger;
jimtla@4678
    59
slouken@6950
    60
/* Used as the device ID for mouse events simulated with touch input */
slouken@6950
    61
#define SDL_TOUCH_MOUSEID ((Uint32)-1)
jim@4646
    62
jimtla@4649
    63
jim@4646
    64
/* Function prototypes */
jim@4646
    65
jim@4646
    66
/**
slouken@6951
    67
 *  \brief Get the number of registered touch devices.
jim@4646
    68
 */
philipp@7170
    69
extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
jim@4646
    70
jim@4646
    71
/**
slouken@6951
    72
 *  \brief Get the touch ID with the given index, or 0 if the index is invalid.
jim@4646
    73
 */
slouken@6951
    74
extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
slouken@6951
    75
slouken@6951
    76
/**
slime73@12404
    77
 * \brief Get the type of the given touch device.
slime73@12404
    78
 */
slime73@12404
    79
extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID);
slime73@12404
    80
slime73@12404
    81
/**
slouken@6951
    82
 *  \brief Get the number of active fingers for a given touch device.
slouken@6951
    83
 */
slouken@6951
    84
extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
slouken@6951
    85
slouken@6951
    86
/**
slouken@6951
    87
 *  \brief Get the finger object of the given touch, with the given index.
slouken@6951
    88
 */
slouken@6951
    89
extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
jim@4646
    90
jim@4646
    91
/* Ends C function definitions when using C++ */
jim@4646
    92
#ifdef __cplusplus
jim@4646
    93
}
jim@4646
    94
#endif
jim@4646
    95
#include "close_code.h"
jim@4646
    96
slouken@10638
    97
#endif /* SDL_touch_h_ */
jim@4646
    98
jim@4646
    99
/* vi: set ts=4 sw=4 expandtab: */