omniGlass
Classes | Typedefs | Functions
omniglass.h File Reference

the omniglass public API definition. More...

#include <stdbool.h>
#include "constants.h"
#include "config.h"

Go to the source code of this file.

Classes

struct  omniglass_raw_touchpoint
 
struct  omniglass_raw_report
 
struct  omniglass_raw_specifications
 

Typedefs

typedef struct omniglass_raw_touchpoint omniglass_raw_touchpoint
 
typedef struct omniglass_raw_report omniglass_raw_report
 
typedef struct omniglass_raw_specifications omniglass_raw_specifications
 
typedef void(* omniglass_callback_touches_changed) (omniglass_raw_report *, void *)
 
typedef void(* omniglass_callback_slide) (double, double, void *)
 
typedef void(* omniglass_callback_pressed) (int)
 
typedef void(* omniglass_callback_released) (int)
 
typedef void(* omniglass_callback_edge) (double, void *)
 

Functions

omniglass_operation_results omniglass_init (struct omniglass **handle)
 
int omniglass_step (struct omniglass *handle)
 
omniglass_operation_results omniglass_get_raw_report (struct omniglass *handle, omniglass_raw_report **report)
 
omniglass_operation_results omniglass_get_touchpad_specifications (struct omniglass *handle, omniglass_raw_specifications **specs)
 
int omniglass_register_callback (struct omniglass *handle, void(*callback)(), omniglass_touchpad_edge edge)
 
omniglass_operation_results omniglass_listen_gesture_touches_changed (struct omniglass *handle, omniglass_callback_touches_changed callback, void *passthrough)
 
omniglass_gesture_operation_result omniglass_listen_gesture_slide (struct omniglass *handle, omniglass_callback_slide callback, void *passthrough)
 
void omniglass_disable_gesture_slide (struct omniglass *handle)
 
omniglass_gesture_operation_result omniglass_listen_gesture_edge (struct omniglass *handle, omniglass_callback_edge callback, omniglass_touchpad_edge edge, void *passthrough)
 
void omniglass_disable_gesture_edge (struct omniglass *handle)
 
omniglass_gesture_operation_result omniglass_listen_gesture_edge_left (struct omniglass *handle, omniglass_callback_edge callback, void *passthrough)
 
omniglass_gesture_operation_result omniglass_listen_gesture_edge_right (struct omniglass *handle, omniglass_callback_edge callback, void *passthrough)
 
omniglass_gesture_operation_result omniglass_listen_gesture_edge_top (struct omniglass *handle, omniglass_callback_edge callback, void *passthrough)
 
omniglass_gesture_operation_result omniglass_listen_gesture_edge_bottom (struct omniglass *handle, omniglass_callback_edge callback, void *passthrough)
 
omniglass_gesture_operation_result omniglass_enable_parameter_swipe (struct omniglass *handle, double *swipe_x, double *swipe_y)
 

Detailed Description

the omniglass public API definition.

the omniglass API gives applications means to detect and probe for gesture events on touchpad devices.

Typedef Documentation

◆ omniglass_raw_report

a report of contact points, barely filtered from the latest input events acquired from the platform

◆ omniglass_raw_specifications

a representation of the touchpad's capabilities relevant to gesture detection.

◆ omniglass_raw_touchpoint

representation of a potential contact point between a finger and the touchpad.

Function Documentation

◆ omniglass_disable_gesture_edge()

void omniglass_disable_gesture_edge ( struct omniglass handle)

disable all edge scroll detection callbacks.

Parameters
[in]handlethe omniglass handle.

◆ omniglass_disable_gesture_slide()

void omniglass_disable_gesture_slide ( struct omniglass handle)

remove the listener for touch slide gestures.

Parameters
[in]handlea handle to omniglass.

◆ omniglass_get_raw_report()

omniglass_operation_results omniglass_get_raw_report ( struct omniglass handle,
omniglass_raw_report **  report 
)

get the address of the report for raw touch points get the address of the memory region where the touch report from the active touchpad is located.

Parameters
[in]handlethe handle to omniglass
[out]report(output) after executing this function, the content of report will be a pointer to the raw multitouch report of the active touchpad.

◆ omniglass_get_touchpad_specifications()

omniglass_operation_results omniglass_get_touchpad_specifications ( struct omniglass handle,
omniglass_raw_specifications **  specs 
)

get address of touchpad specifications. get the address of the memory region where the width, height and other parameters from the active touchpad are defined.

Parameters
[in]handlethe handle to omniglass.
[out]specs(output) after executing this function the content of specs will be a pointer to the raw specifications of the active touchpad.

◆ omniglass_init()

omniglass_operation_results omniglass_init ( struct omniglass **  handle)

make sure to call this initializer before anything else

Parameters
[in]handlea pointer to a pointer of an omniglass handle.

◆ omniglass_listen_gesture_edge()

omniglass_gesture_operation_result omniglass_listen_gesture_edge ( struct omniglass handle,
omniglass_callback_edge  callback,
omniglass_touchpad_edge  edge,
void *  passthrough 
)

schedule a function to be called whenever fingers have dragged accross a certain edge.

Parameters
[in]handlethe omniglass handle.
[in]callbackthis function is called upon edge scroll
[in]edgeone of the touchpad's 4 edges where the dragging will be scanned for
[in,out]passthroughthis arbitrary data is forwarded to the callback function.

◆ omniglass_listen_gesture_slide()

omniglass_gesture_operation_result omniglass_listen_gesture_slide ( struct omniglass handle,
omniglass_callback_slide  callback,
void *  passthrough 
)

set a callback function for finger slide. whenever at least one finger has been in contact accross the surface and its contact position has moved since the last call to omniglass_step(), this callback is triggered.

Parameters
[in]handlethe handle to omniGlass.
[in,out]callbackthe function that will be called when a slide has happen

register a listener for touch slide gestures.

Parameters
handlea handle to omniglass.
callbackthis function will be called whenever a slide gesture is detected.
passthroughan optional pointer containing data that can be used by the callback.

◆ omniglass_listen_gesture_touches_changed()

omniglass_operation_results omniglass_listen_gesture_touches_changed ( struct omniglass handle,
omniglass_callback_touches_changed  callback,
void *  passthrough 
)

set a callback function for points touched. if the number of appendages contacting the surface changes, this callback is triggered. the callback function is called.

Parameters
[in]handlethe omniglass handle.
[in]callbackthe callback for the event.
[in,out]passthroughwhatever pointer is placed here will be forwarded unchanged to the callback.

(PUBLIC) register callback for touch started

◆ omniglass_step()

int omniglass_step ( struct omniglass handle)

this function must be called at ~100hz in the application's main loop in non-blocking mode, or as soon as possible in a separate thread.

Parameters
[in]handlethe handle to omniglass

step function. user code must schedule to call this at ~100hz or more for responsiveness