Gesture Library
rotate.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "gesturelib.h"
4 #include "recognizer.h"
5 
7 typedef struct rotate {
8  // recognizer state
10  // user id of tracked group
11  int uid;
12  // number of tracked strokes
13  int size;
14  // rotation counterclockwise in radians
15  float rotation;
16  // has rotated at some point during the gesture
17  char rotated;
19 
21 void init_rotate();
22 
25 void recognize_rotate(const touch_event_t* event);
26 
29 const rotate_t* get_rotate();
30 
34 int set_on_rotate(void (*listener)(const rotate_t*));
enum state state_t
This represents the state of individual gesture recognizers.
struct rotate rotate_t
Data structure for rotate gesture data.
const rotate_t * get_rotate()
Access array of rotate_t of size MAX_TOUCHES.
Definition: rotate.c:54
void recognize_rotate(const touch_event_t *event)
Recognize rotate gesture. This gesture locks the number of fingers once any finger starts moving.
Definition: rotate.c:19
int set_on_rotate(void(*listener)(const rotate_t *))
Subscribe listener to rotate gesture updates.
Definition: rotate.c:58
void init_rotate()
Initialize rotate data structures.
Definition: rotate.c:9
Data structure for rotate gesture data.
Definition: rotate.h:7
char rotated
Definition: rotate.h:17
float rotation
Definition: rotate.h:15
int size
Definition: rotate.h:13
state_t state
Definition: rotate.h:9
int uid
Definition: rotate.h:11
To use the gesture library, users create touch events and fill in the appropriate fields.
Definition: gesturelib.h:17