Make setsu events nicer

This commit is contained in:
Florian Märkl 2020-06-30 10:31:18 +02:00
commit 43dd40e466
No known key found for this signature in database
GPG key ID: 125BC8A5A6A1E857
3 changed files with 87 additions and 43 deletions

View file

@ -18,27 +18,29 @@
#ifndef _SETSU_H
#define _SETSU_H
#include <stdint.h>
typedef struct setsu_t Setsu;
typedef struct setsu_device_t SetsuDevice;
typedef int SetsuTrackingId;
typedef enum {
SETSU_EVENT_DOWN,
SETSU_EVENT_UP,
SETSU_EVENT_POSITION_X,
SETSU_EVENT_POSITION_Y
SETSU_EVENT_POSITION
} SetsuEventType;
typedef struct setsu_event_t {
SetsuDevice *dev;
unsigned int tracking_id;
SetsuTrackingId tracking_id;
SetsuEventType type;
unsigned int value;
uint32_t x, y;
} SetsuEvent;
typedef void (*SetsuEventCb)(SetsuEvent *event, void *user);
Setsu *setsu_new();
void setsu_free(Setsu *setsu);
void setsu_poll(Setsu *setsu, SetsuEventCb cb);
void setsu_poll(Setsu *setsu, SetsuEventCb cb, void *user);
#endif