|
SDL
2.0
|
#include "../SDL_internal.h"#include "SDL_events.h"#include "SDL_events_c.h"#include "../video/SDL_sysvideo.h"
Include dependency graph for SDL_touch.c:Go to the source code of this file.
Macros | |
| #define | SYNTHESIZE_TOUCH_TO_MOUSE 1 |
Variables | |
| static int | SDL_num_touch = 0 |
| static SDL_Touch ** | SDL_touchDevices = NULL |
| static SDL_bool | finger_touching = SDL_FALSE |
| static SDL_FingerID | track_fingerid |
| static SDL_TouchID | track_touchid |
| #define SYNTHESIZE_TOUCH_TO_MOUSE 1 |
Definition at line 35 of file SDL_touch.c.
|
static |
Definition at line 197 of file SDL_touch.c.
References SDL_Touch::fingers, SDL_Finger::id, SDL_Touch::max_fingers, SDL_Touch::num_fingers, SDL_Finger::pressure, SDL_malloc, SDL_OutOfMemory, SDL_realloc, SDL_Finger::x, and SDL_Finger::y.
Referenced by SDL_SendTouch().
| int SDL_AddTouch | ( | SDL_TouchID | touchID, |
| SDL_TouchDeviceType | type, | ||
| const char * | name | ||
| ) |
Definition at line 154 of file SDL_touch.c.
References SDL_Touch::fingers, SDL_Touch::id, SDL_Touch::max_fingers, NULL, SDL_Touch::num_fingers, SDL_GestureAddTouch(), SDL_GetTouchIndex(), SDL_malloc, SDL_num_touch, SDL_OutOfMemory, SDL_realloc, SDL_touchDevices, and SDL_Touch::type.
Referenced by SDL_MouseTouchEventsChanged().
|
static |
Definition at line 224 of file SDL_touch.c.
References SDL_Touch::fingers, SDL_Touch::num_fingers, and SDL_GetFingerIndex().
Referenced by SDL_SendTouch().
| void SDL_DelTouch | ( | SDL_TouchID | id | ) |
Definition at line 440 of file SDL_touch.c.
References SDL_Touch::fingers, i, SDL_Touch::max_fingers, SDL_free, SDL_GestureDelTouch(), SDL_GetTouch(), SDL_GetTouchIndex(), SDL_num_touch, and SDL_touchDevices.
Referenced by SDL_TouchQuit().
|
static |
Definition at line 120 of file SDL_touch.c.
References SDL_Touch::fingers, NULL, SDL_Touch::num_fingers, and SDL_GetFingerIndex().
Referenced by SDL_SendTouch(), and SDL_SendTouchMotion().
|
static |
Definition at line 108 of file SDL_touch.c.
References SDL_Touch::fingers, SDL_Finger::id, and SDL_Touch::num_fingers.
Referenced by SDL_DelFinger(), and SDL_GetFinger().
Get the number of registered touch devices.
Definition at line 51 of file SDL_touch.c.
References SDL_num_touch.
| int SDL_GetNumTouchFingers | ( | SDL_TouchID | touchID | ) |
Get the number of active fingers for a given touch device.
Definition at line 130 of file SDL_touch.c.
References SDL_Touch::num_fingers, and SDL_GetTouch().
| SDL_Touch* SDL_GetTouch | ( | SDL_TouchID | id | ) |
Definition at line 82 of file SDL_touch.c.
References NULL, SDL_VideoDevice::ResetTouch, SDL_GetTouchIndex(), SDL_GetVideoDevice(), SDL_num_touch, SDL_SetError, and SDL_touchDevices.
Referenced by SDL_DelTouch(), SDL_GetNumTouchFingers(), SDL_GetTouchDeviceType(), SDL_GetTouchFinger(), SDL_SendTouch(), and SDL_SendTouchMotion().
| SDL_TouchID SDL_GetTouchDevice | ( | int | index | ) |
Get the touch ID with the given index, or 0 if the index is invalid.
Definition at line 57 of file SDL_touch.c.
References SDL_Touch::id, SDL_num_touch, SDL_SetError, and SDL_touchDevices.
| SDL_TouchDeviceType SDL_GetTouchDeviceType | ( | SDL_TouchID | id | ) |
Get the type of the given touch device.
Definition at line 98 of file SDL_touch.c.
References SDL_GetTouch(), SDL_TOUCH_DEVICE_INVALID, and SDL_Touch::type.
| SDL_Finger* SDL_GetTouchFinger | ( | SDL_TouchID | touchID, |
| int | index | ||
| ) |
Get the finger object of the given touch, with the given index.
Definition at line 140 of file SDL_touch.c.
References SDL_Touch::fingers, NULL, SDL_Touch::num_fingers, SDL_GetTouch(), and SDL_SetError.
|
static |
Definition at line 67 of file SDL_touch.c.
References SDL_Touch::id, SDL_num_touch, and SDL_touchDevices.
Referenced by SDL_AddTouch(), SDL_DelTouch(), and SDL_GetTouch().
| int SDL_SendTouch | ( | SDL_TouchID | id, |
| SDL_FingerID | fingerid, | ||
| SDL_Window * | window, | ||
| SDL_bool | down, | ||
| float | x, | ||
| float | y, | ||
| float | pressure | ||
| ) |
Definition at line 241 of file SDL_touch.c.
References finger_touching, int(), SDL_Mouse::mouse_touch_events, SDL_AddFinger(), SDL_BUTTON_LEFT, SDL_DelFinger(), SDL_ENABLE, SDL_FALSE, SDL_FINGERDOWN, SDL_FINGERUP, SDL_GetEventState, SDL_GetFinger(), SDL_GetMouse(), SDL_GetTouch(), SDL_GetWindowID, SDL_MOUSE_TOUCHID, SDL_PRESSED, SDL_PushEvent, SDL_RELEASED, SDL_SendMouseButton(), SDL_SendMouseMotion(), SDL_TOUCH_MOUSEID, SDL_TRUE, SDL_Mouse::touch_mouse_events, track_fingerid, track_touchid, SDL_Finger::x, and SDL_Finger::y.
Referenced by SDL_PrivateSendMouseButton(), and SDL_SendTouchMotion().
| int SDL_SendTouchMotion | ( | SDL_TouchID | id, |
| SDL_FingerID | fingerid, | ||
| SDL_Window * | window, | ||
| float | x, | ||
| float | y, | ||
| float | pressure | ||
| ) |
Definition at line 355 of file SDL_touch.c.
References finger_touching, int(), SDL_Mouse::mouse_touch_events, SDL_Finger::pressure, SDL_ENABLE, SDL_FINGERMOTION, SDL_GetEventState, SDL_GetFinger(), SDL_GetMouse(), SDL_GetTouch(), SDL_GetWindowID, SDL_MOUSE_TOUCHID, SDL_PushEvent, SDL_SendMouseMotion(), SDL_SendTouch(), SDL_TOUCH_MOUSEID, SDL_TRUE, SDL_Mouse::touch_mouse_events, track_fingerid, track_touchid, SDL_Finger::x, and SDL_Finger::y.
Referenced by SDL_PrivateSendMouseMotion().
Definition at line 464 of file SDL_touch.c.
References i, NULL, SDL_assert, SDL_DelTouch(), SDL_free, SDL_GestureQuit(), SDL_num_touch, and SDL_touchDevices.
Referenced by SDL_VideoQuit().
Definition at line 38 of file SDL_touch.c.
Referenced by SDL_SendTouch(), and SDL_SendTouchMotion().
|
static |
Definition at line 30 of file SDL_touch.c.
Referenced by SDL_AddTouch(), SDL_DelTouch(), SDL_GetNumTouchDevices(), SDL_GetTouch(), SDL_GetTouchDevice(), SDL_GetTouchIndex(), and SDL_TouchQuit().
Definition at line 31 of file SDL_touch.c.
Referenced by SDL_AddTouch(), SDL_DelTouch(), SDL_GetTouch(), SDL_GetTouchDevice(), SDL_GetTouchIndex(), and SDL_TouchQuit().
|
static |
Definition at line 39 of file SDL_touch.c.
Referenced by SDL_SendTouch(), and SDL_SendTouchMotion().
|
static |
Definition at line 40 of file SDL_touch.c.
Referenced by SDL_SendTouch(), and SDL_SendTouchMotion().