src/events/SDL_touch_c.h
author Sam Lantinga <slouken@libsdl.org>
Fri, 08 Apr 2011 13:03:26 -0700
changeset 5535 96594ac5fd1a
parent 5262 b530ef003506
child 6138 4c64952a58fb
permissions -rw-r--r--
SDL 1.3 is now under the zlib license.
jim@4640
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@5535
     3
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
jim@4640
     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@4640
     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@4640
    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@4640
    20
*/
jim@4640
    21
#include "SDL_config.h"
jim@4646
    22
#include "../../include/SDL_touch.h"
jim@4640
    23
jim@4640
    24
#ifndef _SDL_touch_c_h
jim@4640
    25
#define _SDL_touch_c_h
jim@4640
    26
jim@4640
    27
jim@4640
    28
jim@4640
    29
/* Initialize the touch subsystem */
jim@4640
    30
extern int SDL_TouchInit(void);
jim@4640
    31
jim@4642
    32
/*Get the touch at an index */
jim@4642
    33
extern SDL_Touch *SDL_GetTouchIndex(int index);
jim@4642
    34
jim@4642
    35
/* Get the touch with id = id */
jimtla@4678
    36
extern SDL_Touch *SDL_GetTouch(SDL_TouchID id);
jim@4642
    37
jim@4642
    38
/*Get the finger at an index */
jim@4642
    39
extern SDL_Finger *SDL_GetFingerIndex(SDL_Touch *touch, int index);
jim@4642
    40
jim@4642
    41
/* Get the finger with id = id */
jimtla@4678
    42
extern SDL_Finger *SDL_GetFinger(SDL_Touch *touch,SDL_FingerID id);
jim@4642
    43
jim@4640
    44
jim@4640
    45
/* Add a touch, possibly reattaching at a particular index (or -1),
jim@4642
    46
   returning the index of the touch, or -1 if there was an error. */
jim@4642
    47
extern int SDL_AddTouch(const SDL_Touch * touch, char *name);
jim@4642
    48
                     
jim@4640
    49
jim@4640
    50
/* Remove a touch at an index, clearing the slot for later */
jimtla@4678
    51
extern void SDL_DelTouch(SDL_TouchID id);
jim@4640
    52
jim@4640
    53
/* Set the touch focus window */
jimtla@4678
    54
extern void SDL_SetTouchFocus(SDL_TouchID id, SDL_Window * window);
jim@4640
    55
jim@4640
    56
/* Send a touch motion event for a touch */
jimtla@4678
    57
extern int SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid,
jimtla@4676
    58
			       int relative, float x, float y, float z);
jim@4640
    59
jimtla@4677
    60
/* Send a touch down/up event for a touch */
jimtla@4678
    61
extern int SDL_SendFingerDown(SDL_TouchID id, SDL_FingerID fingerid, 
jimtla@4678
    62
			      SDL_bool down, float x, float y, float pressure);
jimtla@4677
    63
jim@4640
    64
/* Send a touch button event for a touch */
jimtla@4678
    65
extern int SDL_SendTouchButton(SDL_TouchID id, Uint8 state, Uint8 button);
jim@4640
    66
jim@4640
    67
/* Shutdown the touch subsystem */
jim@4640
    68
extern void SDL_TouchQuit(void);
jim@4640
    69
jimtla@4647
    70
/* Get the index of a touch device */
jimtla@4678
    71
extern int SDL_GetTouchIndexId(SDL_TouchID id);
jim@4640
    72
jimtla@4677
    73
/* Print a debug message for a nonexistent touch */
jimtla@4678
    74
extern int SDL_TouchNotFoundError(SDL_TouchID id);
jimtla@4677
    75
jim@4640
    76
#endif /* _SDL_touch_c_h */
jim@4640
    77
jim@4640
    78
/* vi: set ts=4 sw=4 expandtab: */