aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-01-22 09:19:16 +1100
committerPeter Hutterer <peter.hutterer@who-t.net>2009-01-22 14:06:38 +1100
commit3047c25db24becf475b45d13e03a8badd58dcde6 (patch)
tree91c07d65d7b9e2d0941929754e0d382ff0b332d9
parentRequire XKB. (diff)
downloadxf86-input-evdev-3047c25db24becf475b45d13e03a8badd58dcde6.tar.gz
xf86-input-evdev-3047c25db24becf475b45d13e03a8badd58dcde6.tar.bz2
xf86-input-evdev-3047c25db24becf475b45d13e03a8badd58dcde6.zip
Deal with XINPUT ABI 5.
Some XKB stuff has been removed, so let's deal with it.
-rw-r--r--src/evdev.c40
-rw-r--r--src/evdev.h20
2 files changed, 38 insertions, 22 deletions
diff --git a/src/evdev.c b/src/evdev.c
index dc5f055..7506d86 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -839,27 +839,33 @@ EvdevAddKeyClass(DeviceIntPtr device)
/* sorry, no rules change allowed for you */
xf86ReplaceStrOption(pInfo->options, "xkb_rules", "evdev");
- SetXkbOption(pInfo, "xkb_rules", &pEvdev->xkb_rules);
- SetXkbOption(pInfo, "xkb_model", &pEvdev->xkb_model);
- if (!pEvdev->xkb_model)
- SetXkbOption(pInfo, "XkbModel", &pEvdev->xkb_model);
- SetXkbOption(pInfo, "xkb_layout", &pEvdev->xkb_layout);
- if (!pEvdev->xkb_layout)
- SetXkbOption(pInfo, "XkbLayout", &pEvdev->xkb_layout);
- SetXkbOption(pInfo, "xkb_variant", &pEvdev->xkb_variant);
- if (!pEvdev->xkb_variant)
- SetXkbOption(pInfo, "XkbVariant", &pEvdev->xkb_variant);
- SetXkbOption(pInfo, "xkb_options", &pEvdev->xkb_options);
- if (!pEvdev->xkb_options)
- SetXkbOption(pInfo, "XkbOptions", &pEvdev->xkb_options);
-
- XkbSetRulesDflts(pEvdev->xkb_rules, pEvdev->xkb_model,
- pEvdev->xkb_layout, pEvdev->xkb_variant,
- pEvdev->xkb_options);
+ SetXkbOption(pInfo, "xkb_rules", &pEvdev->rmlvo.rules);
+ SetXkbOption(pInfo, "xkb_model", &pEvdev->rmlvo.model);
+ if (!pEvdev->rmlvo.model)
+ SetXkbOption(pInfo, "XkbModel", &pEvdev->rmlvo.model);
+ SetXkbOption(pInfo, "xkb_layout", &pEvdev->rmlvo.layout);
+ if (!pEvdev->rmlvo.layout)
+ SetXkbOption(pInfo, "XkbLayout", &pEvdev->rmlvo.layout);
+ SetXkbOption(pInfo, "xkb_variant", &pEvdev->rmlvo.variant);
+ if (!pEvdev->rmlvo.variant)
+ SetXkbOption(pInfo, "XkbVariant", &pEvdev->rmlvo.variant);
+ SetXkbOption(pInfo, "xkb_options", &pEvdev->rmlvo.options);
+ if (!pEvdev->rmlvo.options)
+ SetXkbOption(pInfo, "XkbOptions", &pEvdev->rmlvo.options);
+
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5
+ XkbSetRulesDflts(&pEvdev->rmlvo);
+ if (!InitKeyboardDeviceStruct(device, &pEvdev->rmlvo, NULL, EvdevKbdCtrl))
+ return !Success;
+#else
+ XkbSetRulesDflts(pEvdev->rmlvo.rules, pEvdev->rmlvo.model,
+ pEvdev->rmlvo.layout, pEvdev->rmlvo.variant,
+ pEvdev->rmlvo.options);
if (!XkbInitKeyboardDeviceStruct(device, &pEvdev->xkbnames,
&keySyms, modMap, NULL,
EvdevKbdCtrl))
return !Success;
+#endif
pInfo->flags |= XI86_KEYBOARD_CAPABLE;
diff --git a/src/evdev.h b/src/evdev.h
index 67fee1d..68ee073 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -62,6 +62,17 @@
#define HAVE_PROPERTIES 1
#endif
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 5
+typedef struct {
+ char *rules;
+ char *model;
+ char *layout;
+ char *variant;
+ char *options;
+} XkbRMLVOSet;
+#endif
+
+
#define LONG_BITS (sizeof(long) * 8)
/* Number of longs needed to hold the given number of bits */
@@ -89,12 +100,11 @@ typedef struct {
BOOL has_pressure;
/* XKB stuff has to be per-device rather than per-driver */
- char *xkb_rules;
- char *xkb_model;
- char *xkb_layout;
- char *xkb_variant;
- char *xkb_options;
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 5
XkbComponentNamesRec xkbnames;
+#endif
+ XkbRMLVOSet rmlvo;
+
/* Middle mouse button emulation */
struct {
BOOL enabled;