summaryrefslogtreecommitdiff
path: root/src/grail-inserter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/grail-inserter.h')
-rw-r--r--src/grail-inserter.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/grail-inserter.h b/src/grail-inserter.h
new file mode 100644
index 0000000..3ffacec
--- /dev/null
+++ b/src/grail-inserter.h
@@ -0,0 +1,71 @@
1/*****************************************************************************
2 *
3 * grail - Gesture Recognition And Instantiation Library
4 *
5 * Copyright (C) 2010 Canonical Ltd.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * Authors:
21 * Henrik Rydberg <rydberg@bitmath.org>
22 *
23 ****************************************************************************/
24
25#ifndef _GRAIL_INSERTER_H
26#define _GRAIL_INSERTER_H
27
28#include <grail-touch.h>
29#include <grail.h>
30#include "gebuf.h"
31
32#define DIM_EV_TYPE EV_CNT
33#define DIM_EV_TYPE_BYTES ((DIM_EV_TYPE + 7) >> 3)
34
35#define DIM_INSTANCE 32
36#define DIM_INSTANCE_BYTES ((DIM_INSTANCE + 7) >> 3)
37
38#define DIM_CLIENT 32
39
40struct slot_state {
41 int type;
42 int priority;
43 int id;
44 int status;
45 int nclient;
46 struct grail_client_id client_id[DIM_CLIENT];
47 grail_mask_t span[DIM_TOUCH_BYTES];
48 struct gebuf buf;
49};
50
51int gin_init(struct grail *ge);
52void gin_destroy(struct grail *ge);
53
54void gin_frame_begin(struct grail *ge, const struct touch_frame *frame);
55void gin_frame_end(struct grail *ge, grail_mask_t *filtered, int max_filtered,
56 const struct touch_frame *frame);
57
58int gin_gid_begin_select(struct grail *ge, int type, int priority,
59 const grail_mask_t *span, int nspan);
60int gin_gid_begin(struct grail *ge, int type, int priority,
61 const struct touch_frame *frame);
62void gin_gid_discard(struct grail *ge, int gid);
63
64void gin_gid_event(struct grail *ge, int gid,
65 float x, float y, int ntouch,
66 const grail_prop_t *prop, int nprop,
67 int status);
68void gin_gid_end(struct grail *ge, int gid,
69 float x, float y, int ntouch);
70
71#endif