android: work around android's linux/input.h being retarded.
authorRobin Burchell <robin.burchell@collabora.co.uk>
Thu, 5 Jul 2012 12:37:21 +0000 (14:37 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 5 Jul 2012 22:37:39 +0000 (00:37 +0200)
It seemingly doesn't include many of the required defines for evdev, so do what
everyone else seems to do, and work around it.

Change-Id: I4a6ffb548c7370f675c736177b63220f034d06b8
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
src/platformsupport/devicediscovery/qdevicediscovery_static.cpp
src/platformsupport/input/evdevtouch/qevdevtouch.cpp

index 2d89493..9b063ce 100644 (file)
 #include <linux/input.h>
 #include <fcntl.h>
 
+/* android (and perhaps some other linux-derived stuff) don't define everything
+ * in linux/input.h, so we'll need to do that ourselves.
+ */
+#ifndef KEY_CNT
+#define KEY_CNT                 (KEY_MAX+1)
+#endif
+#ifndef REL_CNT
+#define REL_CNT                 (REL_MAX+1)
+#endif
+#ifndef ABS_CNT
+#define ABS_CNT                 (ABS_MAX+1)
+#endif
+
+
 //#define QT_QPA_DEVICE_DISCOVERY_DEBUG
 
 #ifdef QT_QPA_DEVICE_DISCOVERY_DEBUG
index 76314b3..5668215 100644 (file)
@@ -57,9 +57,30 @@ extern "C" {
 
 QT_BEGIN_NAMESPACE
 
+/* android (and perhaps some other linux-derived stuff) don't define everything
+ * in linux/input.h, so we'll need to do that ourselves.
+ */
+#ifndef ABS_MT_TOUCH_MAJOR
+#define ABS_MT_TOUCH_MAJOR      0x30    /* Major axis of touching ellipse */
+#endif
+#ifndef ABS_MT_POSITION_X
+#define ABS_MT_POSITION_X 0x35    /* Center X ellipse position */
+#endif
+#ifndef ABS_MT_POSITION_Y
+#define ABS_MT_POSITION_Y       0x36    /* Center Y ellipse position */
+#endif
 #ifndef ABS_MT_SLOT
 #define ABS_MT_SLOT 0x2f
 #endif
+#ifndef ABS_CNT
+#define ABS_CNT                 (ABS_MAX+1)
+#endif
+#ifndef ABS_MT_TRACKING_ID
+#define ABS_MT_TRACKING_ID      0x39    /* Unique ID of initiated contact */
+#endif
+#ifndef SYN_MT_REPORT
+#define SYN_MT_REPORT           2
+#endif
 
 class QEvdevTouchScreenData
 {