omniGlass
platform.h
Go to the documentation of this file.
1 /*
2 OmniGlass: touchpad gesture detection engine.
3 Copyright (C) 2023 Felipe Choi
4 
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 
29 #include <stdbool.h>
30 
31 #include <lua.h>
32 
33 #include "omniglass.h"
34 
35 
36 struct platform;
37 
44 omniglass_init_result platform_init(struct platform **platform, lua_State *vm);
45 
50 typedef struct touch_point{
51  int x;
52  int y;
53  bool touched;
55 
61 typedef enum touchParameter {
63  AREA,
66 
67 //extended parameters (many touchpad drivers may not support any of these.)
68 typedef unsigned int touch_pressure; //pressure applied on a contact point.
69 typedef unsigned int touch_area; //combined area of all the intersection belonging to an identified contact region centered around a point.
70 typedef unsigned int touch_distance_to_surface; //distance in millimeters;
71 
76 typedef struct extended_touch_parameter{
78  void *data;
80 
85 typedef struct multitouch_report{
89 
90 int multitouch_next_report(struct multitouch_report *report);
91 
95 typedef struct touchpad_params{
96  int min_x;
97  int max_x;
98  int min_y;
99  int max_y;
100  int touch_count;
101  int extended_touch_parameter_count;
103 
104 void get_touchpad_parameters(struct omniglass *handle, struct touchpad_params *destination);
105 
109 int platform_parse_events(lua_State *vm);
110 
114 int platform_get_last_report(lua_State *vm);
omniglass_init_result
Definition: constants.h:23
the omniglass public API definition.
struct touch_point touch_point
omniglass_init_result platform_init(struct platform **platform, lua_State *vm)
Definition: platform_linux.c:291
struct multitouch_report multitouch_report
struct extended_touch_parameter extended_touch_parameter
touchParameter
Definition: platform.h:61
@ DISTANCE_TO_SURFACE
Definition: platform.h:64
@ AREA
Definition: platform.h:63
@ PRESSURE
Definition: platform.h:62
int platform_get_last_report(lua_State *vm)
Definition: platform_linux.c:237
struct touchpad_params touchpad_params
int platform_parse_events(lua_State *vm)
Definition: platform_linux.c:177
enum touchParameter touch_parameter
Definition: platform.h:76
touch_parameter type
Definition: platform.h:77
void * data
Definition: platform.h:78
Definition: platform.h:85
touch_point * touches
Definition: platform.h:86
extended_touch_parameter ** extended_touch_parameters
Definition: platform.h:87
Definition: omniglass.c:17
Definition: platform_linux.c:41
Definition: platform.h:50
Definition: platform.h:95