aboutsummaryrefslogtreecommitdiffstats
path: root/src/state.h
blob: 5a59192a5129596ccc1b8c3b4d858684276aee27 (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
#ifndef MTEVENT_H
#define MTEVENT_H

#include "capabilities.h"
#include "hwdata.h"

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

/* zero id means not mapped (not touching) */
struct FingerState {
	struct FingerData hw;
	int id;
};

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

struct State {
	struct FingerState finger[DIM_FINGER];
	button_t button;
	int nfinger;
	int lastid;
};

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

void init_state(struct State *s);
void modify_state(struct State *s,
		  const struct HWData* hw,
		  const struct Capabilities* caps);
void output_state(const struct State *s);

const struct FingerState *find_finger(const struct State *s, int id);
int count_fingers(const struct State *s);

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

#endif