SDL
2.0
|
#include "../SDL_internal.h"
#include "SDL_events.h"
#include "SDL_endian.h"
#include "SDL_events_c.h"
#include "SDL_gesture_c.h"
Go to the source code of this file.
Data Structures | |
struct | SDL_FloatPoint |
struct | SDL_DollarPath |
struct | SDL_DollarTemplate |
struct | SDL_GestureTouch |
Macros | |
#define | MAXPATHSIZE 1024 |
#define | DOLLARNPOINTS 64 |
#define | DOLLARSIZE 256 |
#define | ENABLE_DOLLAR |
#define | PHI 0.618033989 |
Variables | |
static SDL_GestureTouch * | SDL_gestureTouch |
static int | SDL_numGestureTouches = 0 |
static SDL_bool | recordAll |
#define DOLLARNPOINTS 64 |
Definition at line 39 of file SDL_gesture.c.
Referenced by dollarDifference(), dollarNormalize(), dollarRecognize(), SaveTemplate(), SDL_AddDollarGesture_one(), SDL_GestureProcessEvent(), SDL_HashDollar(), and SDL_LoadDollarTemplates().
#define DOLLARSIZE 256 |
Definition at line 40 of file SDL_gesture.c.
Referenced by dollarNormalize().
#define ENABLE_DOLLAR |
Definition at line 42 of file SDL_gesture.c.
#define MAXPATHSIZE 1024 |
Definition at line 37 of file SDL_gesture.c.
Referenced by SDL_GestureProcessEvent().
#define PHI 0.618033989 |
Definition at line 44 of file SDL_gesture.c.
Referenced by bestDollarDifference().
|
static |
Definition at line 298 of file SDL_gesture.c.
References dollarDifference(), PHI, SDL_fabs, and SDL_min.
Referenced by dollarRecognize().
|
static |
Definition at line 282 of file SDL_gesture.c.
References DOLLARNPOINTS, i, SDL_cos, SDL_sin, SDL_sqrt, SDL_FloatPoint::x, and SDL_FloatPoint::y.
Referenced by bestDollarDifference().
|
static |
Definition at line 337 of file SDL_gesture.c.
References d, DOLLARNPOINTS, DOLLARSIZE, i, SDL_DollarPath::length, SDL_DollarPath::numPoints, SDL_DollarPath::p, SDL_atan2, SDL_cos, SDL_SetError, SDL_sin, SDL_sqrt, SDL_FloatPoint::x, and SDL_FloatPoint::y.
Referenced by dollarRecognize(), and SDL_GestureProcessEvent().
|
static |
Definition at line 429 of file SDL_gesture.c.
References bestDollarDifference(), dollarNormalize(), DOLLARNPOINTS, SDL_GestureTouch::dollarTemplate, i, SDL_GestureTouch::numDollarTemplates, SDL_DollarTemplate::path, and SDL_memset.
Referenced by SDL_GestureProcessEvent().
|
static |
Definition at line 122 of file SDL_gesture.c.
References DOLLARNPOINTS, i, NULL, SDL_DollarTemplate::path, SDL_RWwrite, SDL_SwapFloatLE, SDL_FloatPoint::x, and SDL_FloatPoint::y.
Referenced by SDL_SaveAllDollarTemplates(), and SDL_SaveDollarTemplate().
|
static |
Definition at line 209 of file SDL_gesture.c.
References i, NULL, SDL_AddDollarGesture_one(), SDL_numGestureTouches, and SDL_SetError.
Referenced by SDL_GestureProcessEvent(), and SDL_LoadDollarTemplates().
|
static |
Definition at line 185 of file SDL_gesture.c.
References DOLLARNPOINTS, SDL_GestureTouch::dollarTemplate, SDL_DollarTemplate::hash, SDL_GestureTouch::numDollarTemplates, SDL_DollarTemplate::path, SDL_HashDollar(), SDL_memcpy, SDL_OutOfMemory, and SDL_realloc.
Referenced by SDL_AddDollarGesture().
int SDL_GestureAddTouch | ( | SDL_TouchID | touchId | ) |
Definition at line 448 of file SDL_gesture.c.
References SDL_GestureTouch::id, SDL_numGestureTouches, SDL_OutOfMemory, SDL_realloc, and SDL_zero.
Referenced by SDL_AddTouch().
int SDL_GestureDelTouch | ( | SDL_TouchID | touchId | ) |
Definition at line 466 of file SDL_gesture.c.
References i, SDL_free, SDL_memcpy, SDL_numGestureTouches, and SDL_zero.
Referenced by SDL_DelTouch().
Definition at line 538 of file SDL_gesture.c.
References SDL_GestureTouch::centroid, dollarNormalize(), DOLLARNPOINTS, SDL_GestureTouch::dollarPath, dollarRecognize(), SDL_GestureTouch::dollarTemplate, SDL_DollarTemplate::hash, i, SDL_DollarPath::length, MAXPATHSIZE, NULL, SDL_GestureTouch::numDownFingers, SDL_DollarPath::numPoints, SDL_DollarPath::p, recordAll, SDL_GestureTouch::recording, SDL_AddDollarGesture(), SDL_atan2, SDL_FALSE, SDL_FINGERDOWN, SDL_FINGERMOTION, SDL_FINGERUP, SDL_GetGestureTouch(), SDL_numGestureTouches, SDL_SendDollarRecord(), SDL_SendGestureDollar(), SDL_SendGestureMulti(), SDL_sqrt, SDL_Event::tfinger, SDL_TouchFingerEvent::touchId, SDL_Event::type, SDL_FloatPoint::x, and SDL_FloatPoint::y.
Referenced by SDL_PushEvent().
Definition at line 104 of file SDL_gesture.c.
References NULL, and SDL_free.
Referenced by SDL_TouchQuit().
|
static |
Definition at line 488 of file SDL_gesture.c.
References i, NULL, and SDL_numGestureTouches.
Referenced by SDL_GestureProcessEvent().
|
static |
Definition at line 110 of file SDL_gesture.c.
References DOLLARNPOINTS, and i.
Referenced by SDL_AddDollarGesture_one().
int SDL_LoadDollarTemplates | ( | SDL_TouchID | touchId, |
SDL_RWops * | src | ||
) |
Load Dollar Gesture templates from a file.
Definition at line 227 of file SDL_gesture.c.
References DOLLARNPOINTS, i, NULL, SDL_DollarTemplate::path, SDL_AddDollarGesture(), SDL_numGestureTouches, SDL_RWread, SDL_SetError, SDL_SwapFloatLE, SDL_FloatPoint::x, and SDL_FloatPoint::y.
int SDL_RecordGesture | ( | SDL_TouchID | touchId | ) |
Begin Recording a gesture on the specified touch, or all touches (-1)
Definition at line 90 of file SDL_gesture.c.
References i, recordAll, SDL_GestureTouch::recording, SDL_numGestureTouches, and SDL_TRUE.
int SDL_SaveAllDollarTemplates | ( | SDL_RWops * | dst | ) |
Save all currently loaded Dollar Gesture templates.
Definition at line 157 of file SDL_gesture.c.
References SDL_GestureTouch::dollarTemplate, i, j, SDL_GestureTouch::numDollarTemplates, SaveTemplate(), and SDL_numGestureTouches.
int SDL_SaveDollarTemplate | ( | SDL_GestureID | gestureId, |
SDL_RWops * | dst | ||
) |
Save a currently loaded Dollar Gesture template.
Definition at line 169 of file SDL_gesture.c.
References SDL_GestureTouch::dollarTemplate, SDL_DollarTemplate::hash, i, j, SDL_GestureTouch::numDollarTemplates, SaveTemplate(), SDL_numGestureTouches, and SDL_SetError.
|
static |
Definition at line 528 of file SDL_gesture.c.
References SDL_GestureTouch::id, SDL_DOLLARRECORD, and SDL_PushEvent.
Referenced by SDL_GestureProcessEvent().
|
static |
Definition at line 512 of file SDL_gesture.c.
References SDL_GestureTouch::centroid, SDL_GestureTouch::id, SDL_GestureTouch::numDownFingers, SDL_DOLLARGESTURE, SDL_PushEvent, SDL_FloatPoint::x, and SDL_FloatPoint::y.
Referenced by SDL_GestureProcessEvent().
|
static |
Definition at line 499 of file SDL_gesture.c.
References SDL_GestureTouch::centroid, SDL_GestureTouch::id, SDL_GestureTouch::numDownFingers, SDL_MULTIGESTURE, SDL_PushEvent, SDL_FloatPoint::x, and SDL_FloatPoint::y.
Referenced by SDL_GestureProcessEvent().
|
static |
Definition at line 76 of file SDL_gesture.c.
Referenced by SDL_GestureProcessEvent(), and SDL_RecordGesture().
|
static |
Definition at line 74 of file SDL_gesture.c.
|
static |
Definition at line 75 of file SDL_gesture.c.
Referenced by SDL_AddDollarGesture(), SDL_GestureAddTouch(), SDL_GestureDelTouch(), SDL_GestureProcessEvent(), SDL_GetGestureTouch(), SDL_LoadDollarTemplates(), SDL_RecordGesture(), SDL_SaveAllDollarTemplates(), and SDL_SaveDollarTemplate().