2010-05-25 23:23:23 -04:00
|
|
|
/*
|
|
|
|
SDL - Simple DirectMedia Layer
|
2011-02-11 22:37:15 -08:00
|
|
|
Copyright (C) 1997-2011 Sam Lantinga
|
2010-05-25 23:23:23 -04:00
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
|
|
|
Sam Lantinga
|
|
|
|
slouken@libsdl.org
|
|
|
|
*/
|
|
|
|
#include "SDL_config.h"
|
2010-06-01 02:54:33 -04:00
|
|
|
#include "../../include/SDL_touch.h"
|
2010-05-25 23:23:23 -04:00
|
|
|
|
|
|
|
#ifndef _SDL_touch_c_h
|
|
|
|
#define _SDL_touch_c_h
|
|
|
|
|
|
|
|
|
2010-05-27 01:21:37 -04:00
|
|
|
|
2010-05-25 23:23:23 -04:00
|
|
|
/* Initialize the touch subsystem */
|
|
|
|
extern int SDL_TouchInit(void);
|
|
|
|
|
2010-05-28 01:26:52 -04:00
|
|
|
/*Get the touch at an index */
|
|
|
|
extern SDL_Touch *SDL_GetTouchIndex(int index);
|
|
|
|
|
|
|
|
/* Get the touch with id = id */
|
2010-07-31 20:02:54 +04:00
|
|
|
extern SDL_Touch *SDL_GetTouch(SDL_TouchID id);
|
2010-05-28 01:26:52 -04:00
|
|
|
|
|
|
|
/*Get the finger at an index */
|
|
|
|
extern SDL_Finger *SDL_GetFingerIndex(SDL_Touch *touch, int index);
|
|
|
|
|
|
|
|
/* Get the finger with id = id */
|
2010-07-31 20:02:54 +04:00
|
|
|
extern SDL_Finger *SDL_GetFinger(SDL_Touch *touch,SDL_FingerID id);
|
2010-05-28 01:26:52 -04:00
|
|
|
|
2010-05-25 23:23:23 -04:00
|
|
|
|
|
|
|
/* Add a touch, possibly reattaching at a particular index (or -1),
|
2010-05-28 01:26:52 -04:00
|
|
|
returning the index of the touch, or -1 if there was an error. */
|
|
|
|
extern int SDL_AddTouch(const SDL_Touch * touch, char *name);
|
|
|
|
|
2010-05-25 23:23:23 -04:00
|
|
|
|
|
|
|
/* Remove a touch at an index, clearing the slot for later */
|
2010-07-31 20:02:54 +04:00
|
|
|
extern void SDL_DelTouch(SDL_TouchID id);
|
2010-05-25 23:23:23 -04:00
|
|
|
|
|
|
|
/* Set the touch focus window */
|
2010-07-31 20:02:54 +04:00
|
|
|
extern void SDL_SetTouchFocus(SDL_TouchID id, SDL_Window * window);
|
2010-05-25 23:23:23 -04:00
|
|
|
|
|
|
|
/* Send a touch motion event for a touch */
|
2010-07-31 20:02:54 +04:00
|
|
|
extern int SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid,
|
2010-07-30 23:18:35 +04:00
|
|
|
int relative, float x, float y, float z);
|
2010-05-25 23:23:23 -04:00
|
|
|
|
2010-07-31 01:24:50 +04:00
|
|
|
/* Send a touch down/up event for a touch */
|
2010-07-31 20:02:54 +04:00
|
|
|
extern int SDL_SendFingerDown(SDL_TouchID id, SDL_FingerID fingerid,
|
|
|
|
SDL_bool down, float x, float y, float pressure);
|
2010-07-31 01:24:50 +04:00
|
|
|
|
2010-05-25 23:23:23 -04:00
|
|
|
/* Send a touch button event for a touch */
|
2010-07-31 20:02:54 +04:00
|
|
|
extern int SDL_SendTouchButton(SDL_TouchID id, Uint8 state, Uint8 button);
|
2010-05-25 23:23:23 -04:00
|
|
|
|
|
|
|
/* Shutdown the touch subsystem */
|
|
|
|
extern void SDL_TouchQuit(void);
|
|
|
|
|
2010-06-03 11:08:17 -04:00
|
|
|
/* Get the index of a touch device */
|
2010-07-31 20:02:54 +04:00
|
|
|
extern int SDL_GetTouchIndexId(SDL_TouchID id);
|
2010-05-25 23:23:23 -04:00
|
|
|
|
2010-07-31 01:24:50 +04:00
|
|
|
/* Print a debug message for a nonexistent touch */
|
2010-07-31 20:02:54 +04:00
|
|
|
extern int SDL_TouchNotFoundError(SDL_TouchID id);
|
2010-07-31 01:24:50 +04:00
|
|
|
|
2010-05-25 23:23:23 -04:00
|
|
|
#endif /* _SDL_touch_c_h */
|
|
|
|
|
|
|
|
/* vi: set ts=4 sw=4 expandtab: */
|