omniGlass
Classes | Typedefs | Enumerations | Functions
platform.h File Reference

interface with touchpad drivers More...

#include <stdbool.h>
#include <lua.h>
#include "omniglass.h"

Go to the source code of this file.

Classes

struct  touch_point
 
struct  extended_touch_parameter
 
struct  multitouch_report
 
struct  touchpad_params
 

Typedefs

typedef struct touch_point touch_point
 
typedef enum touchParameter touch_parameter
 
typedef unsigned int touch_pressure
 
typedef unsigned int touch_area
 
typedef unsigned int touch_distance_to_surface
 
typedef struct extended_touch_parameter extended_touch_parameter
 
typedef struct multitouch_report multitouch_report
 
typedef struct touchpad_params touchpad_params
 

Enumerations

enum  touchParameter { PRESSURE , AREA , DISTANCE_TO_SURFACE }
 

Functions

omniglass_init_result platform_init (struct platform **platform, lua_State *vm)
 
int multitouch_next_report (struct multitouch_report *report)
 
void get_touchpad_parameters (struct omniglass *handle, struct touchpad_params *destination)
 
int platform_parse_events (lua_State *vm)
 
int platform_get_last_report (lua_State *vm)
 

Detailed Description

interface with touchpad drivers

Touchpad enumeration, selection and multitouch report generation are implemented by the platform layer.

Initialization of this subsystem happens on the C-side, however most functions here are expected to be called from the lua-side, be it directly or through userdata metatable indexing.

Typedef Documentation

◆ extended_touch_parameter

an extended parameter associated with a touch point. parameters must be associated to their parent points. raw data associated to a parameter must be casted to its corresponding type.

◆ multitouch_report

central data structure for touch tracking. this data structure contains position data associated to each point. NOTE: Exact number of touches on every multitouch report is per-session, computed at initialization time.

◆ touch_parameter

type identification for extended parameters of a touch contact (might eventually include crazy stuff like material type, distance to actual surface, etc) @

◆ touch_point

typedef struct touch_point touch_point

Touch point in left-to-right x and bottom-to-top y. Touch points include a touch ID;

◆ touchpad_params

internal touchpad parameters straight from the drivers. do not mistake this for the public touchpad specification from the API, which has normalized dimensions!

Enumeration Type Documentation

◆ touchParameter

type identification for extended parameters of a touch contact (might eventually include crazy stuff like material type, distance to actual surface, etc) @

Enumerator
PRESSURE 

pressure (unknown metric)

AREA 

area of the touch being tracked, in cm^2

DISTANCE_TO_SURFACE 

(note: only Galaxy S5 mini digitizers are reported to have this feature) distance between object extremity and the sensitive surface, in millimters accross the surface normal.

Function Documentation

◆ platform_get_last_report()

int platform_get_last_report ( lua_State *  vm)

(LUA-FACING) called by the lua VM to get the last touch report generated.

(LUA-FACING) push latest report from the platform into lua

◆ platform_init()

omniglass_init_result platform_init ( struct platform **  handle,
lua_State *  vm 
)

initialize the platform. you MUST call the platform init before using any other platform function. you MUST ensure any lua state passed into the other functions has been passed to this function first.

Parameters
platforma pointer to a pointer of a platform.
vmthe lua state that will use platform functions.

this function pushes the entire platform internal API and state into a lua table

Parameters
handlea pointer to a pointer of a handle to create.
vman already-initialized lua state to be injected with the internal platform API

◆ platform_parse_events()

int platform_parse_events ( lua_State *  vm)

(LUA-FACING) called by the lua VM to convert the latest events into a touch report.

(LUA-FACING) this function is where the linux touchpad implementation gets its touch points from the evdev interface