diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2010-06-16 02:30:41 +0200 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2010-06-16 02:30:41 +0200 |
commit | 8dff8642c43a473713d48533974d9c7883bbc5c1 (patch) | |
tree | ea8513c76d38f2612a1202d30abf0f2e768f204c /src/gestures.c | |
parent | 1c73d171b2814bf2809aa48c2d4b683a064a4f7e (diff) | |
download | xorg-input-kobomultitouch-8dff8642c43a473713d48533974d9c7883bbc5c1.tar.gz xorg-input-kobomultitouch-8dff8642c43a473713d48533974d9c7883bbc5c1.tar.bz2 xorg-input-kobomultitouch-8dff8642c43a473713d48533974d9c7883bbc5c1.zip |
refactor: Replace hwdata by mtdev
This patch makes the switch, from using hwdata and the associated
type A parser, to using mtdev and the associated type B parser.
A command-line gesture test program is included.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/gestures.c')
-rw-r--r-- | src/gestures.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/gestures.c b/src/gestures.c index 0cc2e0b..663f1a4 100644 --- a/src/gestures.c +++ b/src/gestures.c @@ -81,8 +81,8 @@ static void extract_movement(struct Gestures *gs, struct MTouch* mt) return; foreach_bit(i, mt->mem.moving) { - xp[i] = mt->state.finger[i].hw.position_x - xpos; - yp[i] = mt->state.finger[i].hw.position_y - ypos; + xp[i] = mt->state.finger[i].position_x - xpos; + yp[i] = mt->state.finger[i].position_y - ypos; xm[i] = mt->mem.dx[i]; ym[i] = mt->mem.dy[i]; mt->mem.dx[i] = 0; @@ -178,3 +178,25 @@ void extract_gestures(struct Gestures *gs, struct MTouch* mt) mt->prev_state = mt->state; } + +void output_gesture(const struct Gestures *gs) +{ + int i; + foreach_bit(i, gs->btmask) + xf86Msg(X_INFO, "button bit: %d %d\n", + i, GETBIT(gs->btdata, i)); + if (GETBIT(gs->type, GS_MOVE)) + xf86Msg(X_INFO, "motion: %d %d\n", gs->dx, gs->dy); + if (GETBIT(gs->type, GS_VSCROLL)) + xf86Msg(X_INFO, "vscroll: %d\n", gs->dy); + if (GETBIT(gs->type, GS_HSCROLL)) + xf86Msg(X_INFO, "hscroll: %d\n", gs->dx); + if (GETBIT(gs->type, GS_VSWIPE)) + xf86Msg(X_INFO, "vswipe: %d\n", gs->dy); + if (GETBIT(gs->type, GS_HSWIPE)) + xf86Msg(X_INFO, "hswipe: %d\n", gs->dx); + if (GETBIT(gs->type, GS_SCALE)) + xf86Msg(X_INFO, "scale: %d\n", gs->scale); + if (GETBIT(gs->type, GS_ROTATE)) + xf86Msg(X_INFO, "rotate: %d\n", gs->rot); +} |