aboutsummaryrefslogtreecommitdiffstats
path: root/src/mtouch.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-04-10 22:57:26 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-04-15 06:10:07 +0200
commit963d6f71bb64125603d59c8bb70eaeec38c6fd72 (patch)
tree87dc34640a4e47cee618ebbc8d665e100e21239f /src/mtouch.c
parent9c24576540ba57449c31bafcb8f4aab41b8623b7 (diff)
downloadxorg-input-kobomultitouch-963d6f71bb64125603d59c8bb70eaeec38c6fd72.tar.gz
xorg-input-kobomultitouch-963d6f71bb64125603d59c8bb70eaeec38c6fd72.tar.bz2
xorg-input-kobomultitouch-963d6f71bb64125603d59c8bb70eaeec38c6fd72.zip
Introduce the MTState
The HWState keeps, for good reason, both touching fingers and fingers going away. However, this implies that additional logic is needed to keep track of the number of actual touching fingers. In particular the test for touching fingers is somewhat misplaced in hwstate.c. Moreover, HWState should only exist in one instance, since it contains data which does not need to be referred to during gesture extraction. This patch introduces the MTState structure, which keeps more digested data for gesture extraction. In particular, it only keeps the actual touches. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/mtouch.c')
-rw-r--r--src/mtouch.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mtouch.c b/src/mtouch.c
index 5bf72ec..e47d69d 100644
--- a/src/mtouch.c
+++ b/src/mtouch.c
@@ -35,8 +35,9 @@ int open_mtouch(struct MTouch *mt, int fd)
int rc;
init_iobuf(&mt->buf);
init_hwdata(&mt->hw);
- init_hwstate(&mt->ohs);
- init_hwstate(&mt->nhs);
+ init_hwstate(&mt->hs);
+ init_mtstate(&mt->prev_state);
+ init_mtstate(&mt->state);
SYSCALL(rc = ioctl(fd, EVIOCGRAB, (pointer)1));
return rc;
}
@@ -59,5 +60,6 @@ int read_synchronized_event(struct MTouch *mt, int fd)
void parse_event(struct MTouch *mt)
{
- modify_hwstate(&mt->nhs, &mt->hw, &mt->caps);
+ modify_hwstate(&mt->hs, &mt->hw, &mt->caps);
+ extract_mtstate(&mt->state, &mt->hs, &mt->caps);
}