aboutsummaryrefslogtreecommitdiffstats
path: root/src/hwdata.h
blob: a5f9bf5f8d4f2fa858d0cc94657553745c32a4bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef HWDATA_H
#define HWDATA_H

#include "common.h"

#define DIM_BUTTON 3

#define MT_BUTTON_LEFT 0
#define MT_BUTTON_MIDDLE 1
#define MT_BUTTON_RIGHT 2

typedef unsigned int button_t;

////////////////////////////////////////////////////////

struct FingerData {
	int touch_major, touch_minor;
	int width_major, width_minor;
	int orientation;
	int position_x, position_y;
};

////////////////////////////////////////////////////////

struct HWData {
	struct FingerData finger[DIM_FINGER];
	button_t button;
	int nfinger;
	bool in_packet, in_finger;
};

////////////////////////////////////////////////////////

void init_hwdata(struct HWData *hw);
bool read_hwdata(struct HWData *hw, const struct input_event* ev);
void output_hwdata(const struct HWData *hw);

////////////////////////////////////////////////////////

#endif