omniGlass
omniglass.h
Go to the documentation of this file.
1 
7 #ifndef OMNIGLASS_PUBLIC_API_INCLUDED
8 #define OMNIGLASS_PUBLIC_API_INCLUDED
9 
10 
11 #include <stdbool.h>
12 #include "constants.h"
13 #include "config.h"
15 struct omniglass;
16 
21 
26 int omniglass_step(struct omniglass *handle);
27 
30 typedef struct omniglass_raw_touchpoint {
31  bool is_touching;
32  double x;
33  double y;
35 
37 typedef struct omniglass_raw_report {
38  int points_max;
41 
48 
52  double width;
53  double height;
54  int max_points;
56 
63 
64 /* CALLBACK SECTION (listen, remove listener, define gestures)
65  *
66  * most callbacks accept a "passthrough" void pointer that the user can provide at register-time.
67  * this allows passing to each callback the data it needs without using global variables.
68 */
69 typedef void (*omniglass_callback_touches_changed)(omniglass_raw_report*, void*);
70 typedef void (*omniglass_callback_slide)(double, double, void*);
71 typedef void (*omniglass_callback_pressed)(int);
72 typedef void (*omniglass_callback_released)(int);
73 typedef void (*omniglass_callback_edge)(double, void*);
74 
75 int omniglass_register_callback(struct omniglass *handle, void (*callback) (), omniglass_touchpad_edge edge);
76 
84 omniglass_operation_results omniglass_listen_gesture_touches_changed(struct omniglass *handle, omniglass_callback_touches_changed callback, void *passthrough);
85 
91 omniglass_gesture_operation_result omniglass_listen_gesture_slide(struct omniglass *handle, omniglass_callback_slide callback, void *passthrough);
92 
96 void omniglass_disable_gesture_slide(struct omniglass *handle);
97 
104 omniglass_gesture_operation_result omniglass_listen_gesture_edge(struct omniglass *handle, omniglass_callback_edge callback, omniglass_touchpad_edge edge, void *passthrough);
105 
109 void omniglass_disable_gesture_edge(struct omniglass *handle);
110 
111 omniglass_gesture_operation_result omniglass_listen_gesture_edge_left(struct omniglass *handle, omniglass_callback_edge callback, void * passthrough);
112 omniglass_gesture_operation_result omniglass_listen_gesture_edge_right(struct omniglass *handle, omniglass_callback_edge callback, void *passthrough);
113 omniglass_gesture_operation_result omniglass_listen_gesture_edge_top(struct omniglass *handle, omniglass_callback_edge callback, void *passthrough);
114 omniglass_gesture_operation_result omniglass_listen_gesture_edge_bottom(struct omniglass *handle, omniglass_callback_edge callback, void *passthrough);
115 
116 omniglass_gesture_operation_result omniglass_enable_parameter_swipe(struct omniglass *handle, double *swipe_x, double *swipe_y);
117 
118 #endif
mostly enumerations for use in flow control
omniglass_touchpad_edge
Definition: constants.h:37
omniglass_operation_results
Definition: constants.h:8
omniglass_gesture_operation_result
Definition: constants.h:30
omniglass_operation_results omniglass_listen_gesture_touches_changed(struct omniglass *handle, omniglass_callback_touches_changed callback, void *passthrough)
Definition: omniglass.c:131
omniglass_operation_results omniglass_get_touchpad_specifications(struct omniglass *handle, omniglass_raw_specifications **specs)
Definition: omniglass.c:228
int omniglass_step(struct omniglass *handle)
Definition: omniglass.c:35
struct omniglass_raw_touchpoint omniglass_raw_touchpoint
omniglass_gesture_operation_result omniglass_listen_gesture_edge(struct omniglass *handle, omniglass_callback_edge callback, omniglass_touchpad_edge edge, void *passthrough)
Definition: omniglass.c:81
omniglass_gesture_operation_result omniglass_listen_gesture_slide(struct omniglass *handle, omniglass_callback_slide callback, void *passthrough)
Definition: omniglass.c:49
void omniglass_disable_gesture_edge(struct omniglass *handle)
Definition: omniglass.c:109
struct omniglass_raw_specifications omniglass_raw_specifications
omniglass_operation_results omniglass_init(struct omniglass **handle)
Definition: omniglass.c:255
void omniglass_disable_gesture_slide(struct omniglass *handle)
Definition: omniglass.c:60
struct omniglass_raw_report omniglass_raw_report
omniglass_operation_results omniglass_get_raw_report(struct omniglass *handle, omniglass_raw_report **report)
Definition: omniglass.c:237
Definition: omniglass.h:37
int points_max
Definition: omniglass.h:38
omniglass_raw_touchpoint * points
Definition: omniglass.h:39
Definition: omniglass.h:51
Definition: omniglass.h:30
double y
Definition: omniglass.h:33
double x
Definition: omniglass.h:32
bool is_touching
Definition: omniglass.h:31
Definition: omniglass.c:17