#include "gestureparams.h"
#include "stdint.h"
Go to the source code of this file.
|
struct | touch_event |
| To use the gesture library, users create touch events and fill in the appropriate fields. More...
|
|
struct | gesture_recognizer |
| The user may create their own gesture recognizer to add to the library. More...
|
|
◆ event_type_t
This is the type of touch event. There are only 3 supported types.
◆ gesture_recognizer_t
The user may create their own gesture recognizer to add to the library.
◆ touch_event_t
To use the gesture library, users create touch events and fill in the appropriate fields.
◆ event_type
This is the type of touch event. There are only 3 supported types.
Enumerator |
---|
TOUCH_EVENT_DOWN | |
TOUCH_EVENT_MOVE | |
TOUCH_EVENT_UP | |
Definition at line 7 of file gesturelib.h.
◆ add_recognizer()
int add_recognizer |
( |
void(*)(const touch_event_t *) |
recognizer, |
|
|
void(*)(void) |
init |
|
) |
| |
Register a recognizer via a recognition function.
- Parameters
-
recognize | The recognition function to add. |
init | Recognizer initialization function, pass 0 or NULL for none. |
- Returns
- Which index the recognizer is saved to. -1 if the recognizer could not be saved.
Definition at line 111 of file gesturelib.c.
◆ disable_recognizer()
int disable_recognizer |
( |
int |
recognizer | ) |
|
Disable a recognizer already in the library.
- Parameters
-
recognizer | Index of the recognizer to disable. |
- Returns
- 0 if an invalid index is provided, 1 otherwise.
Definition at line 148 of file gesturelib.c.
◆ enable_recognizer()
int enable_recognizer |
( |
int |
recognizer | ) |
|
Enable a recognizer already in the library.
- Parameters
-
recognizer | Index of the recognizer to enable. |
- Returns
- 0 if an invalid index is provided, 1 otherwise.
Definition at line 137 of file gesturelib.c.
◆ 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.
◆ process_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.
- Parameters
-
Definition at line 51 of file gesturelib.c.
◆ remove_recognizer()
Remove a recognizer in the library.
- Parameters
-
recognizer | Index of the recognizer to remove. |
- Returns
- The removed recognizer. If an invalid index is provided, will return an empty recognizer with null recognize and init functions.
Definition at line 123 of file gesturelib.c.
◆ latest_touch_events
set containing most recent touch within finger group
Definition at line 19 of file gesturelib.c.
◆ num_recognizers