|
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"
Include dependency graph for SDL_gesture.c: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 | |
| SDL_GestureTouch * | SDL_gestureTouch |
| int | SDL_numGestureTouches = 0 |
| 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 292 of file SDL_gesture.c.
References dollarDifference(), PHI, SDL_fabs, and SDL_min.
Referenced by dollarRecognize().
|
static |
Definition at line 276 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 331 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 423 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 116 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 203 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 179 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 442 of file SDL_gesture.c.
References SDL_GestureTouch::id, SDL_numGestureTouches, SDL_OutOfMemory, SDL_realloc, and SDL_zero.
Referenced by SDL_AddTouch().
Definition at line 510 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().
|
static |
Definition at line 460 of file SDL_gesture.c.
References i, NULL, and SDL_numGestureTouches.
Referenced by SDL_GestureProcessEvent().
|
static |
Definition at line 104 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 221 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 151 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 163 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 500 of file SDL_gesture.c.
References SDL_GestureTouch::id, SDL_DOLLARRECORD, and SDL_PushEvent.
Referenced by SDL_GestureProcessEvent().
|
static |
Definition at line 484 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().
| int SDL_SendGestureMulti | ( | SDL_GestureTouch * | touch, |
| float | dTheta, | ||
| float | dDist | ||
| ) |
Definition at line 471 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().
| SDL_bool recordAll |
Definition at line 76 of file SDL_gesture.c.
Referenced by SDL_GestureProcessEvent(), and SDL_RecordGesture().
| SDL_GestureTouch* SDL_gestureTouch |
Definition at line 74 of file SDL_gesture.c.
| int SDL_numGestureTouches = 0 |
Definition at line 75 of file SDL_gesture.c.
Referenced by SDL_AddDollarGesture(), SDL_GestureAddTouch(), SDL_GestureProcessEvent(), SDL_GetGestureTouch(), SDL_LoadDollarTemplates(), SDL_RecordGesture(), SDL_SaveAllDollarTemplates(), and SDL_SaveDollarTemplate().