Gesture Library
drag.h File Reference
#include "gesturelib.h"
#include "recognizer.h"

Go to the source code of this file.

Data Structures

struct  drag
 Data structure for drag gesture data. More...
 

Typedefs

typedef struct drag drag_t
 Data structure for drag gesture data. More...
 

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...
 

Typedef Documentation

◆ drag_t

typedef struct drag drag_t

Data structure for drag gesture data.

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.