summaryrefslogtreecommitdiff
path: root/src/state.c
blob: 46b7fef684e7c846cfc54e2bba34ea5c75c33378 (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
#include "state.h"

/******************************************************/

void init_state(struct State *s)
{
	memset(s, 0, sizeof(struct State));
}

/******************************************************/

void modify_state(struct State *s, const struct HWData* hw)
{
	int i;
	if (s->button[0] != hw->button[0])
		xf86Msg(X_INFO, "multitouch: button changed\n");
	for (i = 0; i < DIM_BUTTON; i++)
		s->button[i] = hw->button[i];
}

/******************************************************/

const struct FingerState *find_finger(const struct State *s, int id)
{
	int i;
	for (i = 0; i < s->nfinger; i++)
		if (s->finger[i].id == id)
			return s->finger+i;
	return NULL;
}

/******************************************************/

void output_state(const struct State *s)
{
}

/******************************************************/