Gesture Library
zoom.c File Reference
#include "zoom.h"
#include "math.h"
#include "multidrag.h"

Go to the source code of this file.

Functions

void init_zoom ()
 Initialize zoom data structures. More...
 
void recognize_zoom (const touch_event_t *event)
 Recognize zoom gesture. This gesture locks the number of fingers once any finger starts moving. More...
 
const zoom_tget_zoom ()
 Access array of zoom_t of size MAX_TOUCHES. More...
 
int set_on_zoom (void(*listener)(const zoom_t *))
 Subscribe listener to zoom gesture updates. More...
 

Variables

zoom_t zoom_d [MAX_TOUCHES]
 
void(* on_zoom )(const zoom_t *)=0
 

Function Documentation

◆ get_zoom()

const zoom_t* get_zoom ( )

Access array of zoom_t of size MAX_TOUCHES.

Returns
Pointer to first element of array of zoom_t of size MAX_TOUCHES

Definition at line 54 of file zoom.c.

◆ init_zoom()

void init_zoom ( )

Initialize zoom data structures.

Definition at line 9 of file zoom.c.

◆ recognize_zoom()

void recognize_zoom ( const touch_event_t event)

Recognize zoom gesture. This gesture locks the number of fingers once any finger starts moving.

Parameters
eventtouch event to recognize

Definition at line 19 of file zoom.c.

◆ set_on_zoom()

int set_on_zoom ( void(*)(const zoom_t *)  listener)

Subscribe listener to zoom gesture updates.

Parameters
listeneraccepts a const zoom_t*
Returns
0 if first listener, 1 if replacing existing listener

Definition at line 58 of file zoom.c.

Variable Documentation

◆ on_zoom

void(* on_zoom) (const zoom_t *)=0 ( const zoom_t )

Definition at line 7 of file zoom.c.

◆ zoom_d

Definition at line 6 of file zoom.c.