Gesture Library
drag.c File Reference
#include "drag.h"
#include "math.h"
#include "stroke.h"
#include "utils.h"

Go to the source code of this file.

Functions

void init_drag ()
 Initialize drag data structures. More...
 
void recognize_drag (const touch_event_t *event)
 Recognize drag gesture. More...
 
const drag_tget_drag ()
 Access drag data array of size MAX_TOUCHES. More...
 
int set_on_drag (void(*listener)(const drag_t *))
 Subscribe listener to drag gesture updates. More...
 

Variables

drag_t drag_d [MAX_TOUCHES]
 
void(* on_drag )(const drag_t *)=0
 

Function Documentation

◆ get_drag()

const drag_t* get_drag ( )

Access drag data array of size MAX_TOUCHES.

Returns
Address of first element of drag data array of size MAX_TOUCHES

Definition at line 30 of file drag.c.

◆ init_drag()

void init_drag ( )

Initialize drag data structures.

Definition at line 10 of file drag.c.

◆ recognize_drag()

void recognize_drag ( const touch_event_t event)

Recognize drag gesture.

Parameters
eventtouch event to recognize

Definition at line 23 of file drag.c.

◆ set_on_drag()

int set_on_drag ( void(*)(const drag_t *)  listener)

Subscribe listener to drag gesture updates.

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

Definition at line 34 of file drag.c.

Variable Documentation

◆ drag_d

Definition at line 7 of file drag.c.

◆ on_drag

void(* on_drag) (const drag_t *)=0 ( const drag_t )

Definition at line 8 of file drag.c.