|
Gesture Library
|
#include "gesturelib.h"#include "double.h"#include "drag.h"#include "hold.h"#include "hold_and_drag.h"#include "multidrag.h"#include "multistroke.h"#include "rotate.h"#include "stroke.h"#include "tap.h"#include "utils.h"#include "zoom.h"Go to the source code of this file.
Functions | |
| int | init_gesturelib () |
| This function should be called by the user before passing touch events to the library. Calling process_touch_event before library initialization results in undefined behavior. More... | |
| void | process_touch_event (touch_event_t *touch_event) |
| Users call this function with a generated touch event to let the library process it. To obtain recognized gestures, users call the accessor function of their desired recognizer or register a listener to their desired recognizer before processing touch events. More... | |
| int | add_recognizer (void(*recognize)(const touch_event_t *), void(*init)(void)) |
| Register a recognizer via a recognition function. More... | |
| gesture_recognizer_t | remove_recognizer (int recognizer) |
| Remove a recognizer in the library. More... | |
| int | enable_recognizer (int recognizer) |
| Enable a recognizer already in the library. More... | |
| int | disable_recognizer (int recognizer) |
| Disable a recognizer already in the library. More... | |
Variables | |
| gesture_recognizer_t | recognizers [MAX_RECOGNIZERS] |
| int | num_recognizers = 0 |
| touch_event_t | latest_touch_events [MAX_TOUCHES] |
| set containing most recent touch within finger group More... | |
| touch_event_t | empty_touch_event = {.type = TOUCH_EVENT_UP, .x = 0, .y = 0, .t = 0, .group = TOUCH_GROUP_UNDEFINED} |
| int add_recognizer | ( | void(*)(const touch_event_t *) | recognizer, |
| void(*)(void) | init | ||
| ) |
Register a recognizer via a recognition function.
| recognize | The recognition function to add. |
| init | Recognizer initialization function, pass 0 or NULL for none. |
Definition at line 111 of file gesturelib.c.
| int disable_recognizer | ( | int | recognizer | ) |
Disable a recognizer already in the library.
| recognizer | Index of the recognizer to disable. |
Definition at line 148 of file gesturelib.c.
| int enable_recognizer | ( | int | recognizer | ) |
Enable a recognizer already in the library.
| recognizer | Index of the recognizer to enable. |
Definition at line 137 of file gesturelib.c.
| int init_gesturelib | ( | ) |
This function should be called by the user before passing touch events to the library. Calling process_touch_event before library initialization results in undefined behavior.
Definition at line 29 of file gesturelib.c.
| void process_touch_event | ( | touch_event_t * | touch_event | ) |
Users call this function with a generated touch event to let the library process it. To obtain recognized gestures, users call the accessor function of their desired recognizer or register a listener to their desired recognizer before processing touch events.
| touch_event | The user generated touch event to process. |
Definition at line 51 of file gesturelib.c.
| gesture_recognizer_t remove_recognizer | ( | int | recognizer | ) |
Remove a recognizer in the library.
| recognizer | Index of the recognizer to remove. |
Definition at line 123 of file gesturelib.c.
| touch_event_t empty_touch_event = {.type = TOUCH_EVENT_UP, .x = 0, .y = 0, .t = 0, .group = TOUCH_GROUP_UNDEFINED} |
Definition at line 20 of file gesturelib.c.
| touch_event_t latest_touch_events[MAX_TOUCHES] |
set containing most recent touch within finger group
Definition at line 19 of file gesturelib.c.
| int num_recognizers = 0 |
Definition at line 16 of file gesturelib.c.
| gesture_recognizer_t recognizers[MAX_RECOGNIZERS] |
Definition at line 15 of file gesturelib.c.