summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-08-19 13:07:57 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-09-23 08:34:19 +1000
commit7bbf4624b8be1bcac7a782057b9c2db5e8bbcc75 (patch)
tree1dd8c7dcbffba61eb32e02b8ef70a15919bd5870
parent4d082915a7f178c4d656fc1f56033b758adef97f (diff)
Support the new Scroll class
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
-rw-r--r--configure.ac5
-rw-r--r--src/list.c24
-rw-r--r--src/test_xi2.c11
3 files changed, 39 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 37f998f..5a64837 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,9 +45,12 @@ PKG_CHECK_MODULES(XI2, [xi >= 1.2.99.2] [inputproto >= 1.9.99.15],
HAVE_XI2="yes"; AC_DEFINE(HAVE_XI2, 1, [XI2 available]),
HAVE_XI2="no");
AM_CONDITIONAL(HAVE_XI2, [ test "$HAVE_XI2" = "yes" ])
-
AC_SUBST(HAVE_XI2)
+# XI2.1 support
+PKG_CHECK_MODULES(XI21, [xi >= 1.4.99.1] [inputproto >= 2.0.99.1],
+ AC_DEFINE(HAVE_XI21, 1, [XI2.1 available]));
+
AC_OUTPUT([Makefile
src/Makefile
man/Makefile])
diff --git a/src/list.c b/src/list.c
index 236011e..64848e3 100644
--- a/src/list.c
+++ b/src/list.c
@@ -201,6 +201,30 @@ print_classes_xi2(Display* display, XIAnyClassInfo **classes,
XFree(name);
}
break;
+#if HAVE_XI21
+ case XIScrollClass:
+ {
+ XIScrollClassInfo *s = (XIScrollClassInfo*)classes[i];
+
+ printf("XIScrollClass\n");
+ printf("\t\tScroll info for Valuator %d\n", s->number);
+ printf("\t\t type: %d (%s)\n", s->scroll_type,
+ (s->scroll_type == XIScrollTypeHorizontal) ? "horizontal" :
+ (s->scroll_type == XIScrollTypeVertical) ? "vertical" : "unknown");
+ printf("\t\t increment: %f\n", s->increment);
+ printf("\t\t flags: 0x%x", s->flags);
+ if (s->flags) {
+ printf(" (");
+ if (s->flags & XIScrollFlagNoEmulation)
+ printf(" no-emulation ");
+ if (s->flags & XIScrollFlagPreferred)
+ printf(" preferred ");
+ printf(")");
+ }
+ printf("\n");
+ }
+ break;
+#endif
}
}
diff --git a/src/test_xi2.c b/src/test_xi2.c
index 92c88da..4a6c3b6 100644
--- a/src/test_xi2.c
+++ b/src/test_xi2.c
@@ -53,11 +53,13 @@ static void print_deviceevent(XIDeviceEvent* event)
case XI_KeyRelease:
printf(" flags: %s\n", (event->flags & XIKeyRepeat) ? "repeat" : "");
break;
+#if HAVE_XI21
case XI_ButtonPress:
case XI_ButtonRelease:
case XI_Motion:
printf(" flags: %s\n", (event->flags & XIPointerEmulated) ? "emulated" : "");
break;
+#endif
}
printf(" root: %.2f/%.2f\n", event->root_x, event->root_y);
@@ -148,6 +150,15 @@ static void print_rawevent(XIRawEvent *event)
printf(" device: %d\n", event->deviceid);
printf(" detail: %d\n", event->detail);
printf(" valuators:\n");
+#if HAVE_XI21
+ switch(event->evtype) {
+ case XI_RawButtonPress:
+ case XI_RawButtonRelease:
+ case XI_RawMotion:
+ printf(" flags: %s\n", (event->flags & XIPointerEmulated) ? "emulated" : "");
+ break;
+ }
+#endif
val = event->valuators.values;
raw_val = event->raw_values;