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