summaryrefslogtreecommitdiff
path: root/src
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 /src
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>
Diffstat (limited to 'src')
-rw-r--r--src/list.c24
-rw-r--r--src/test_xi2.c11
2 files changed, 35 insertions, 0 deletions
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;