Index: ui/events/ozone/evdev/event_device_test_util.h |
diff --git a/ui/events/ozone/evdev/event_device_test_util.h b/ui/events/ozone/evdev/event_device_test_util.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b02f74a3cf6146557e62a1a7d51742158339c111 |
--- /dev/null |
+++ b/ui/events/ozone/evdev/event_device_test_util.h |
@@ -0,0 +1,75 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_TEST_UTIL_H_ |
+#define UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_TEST_UTIL_H_ |
+ |
+#include <linux/input.h> |
+ |
+namespace ui { |
+ |
+class EventDeviceInfo; |
+ |
+struct DeviceAbsoluteAxis { |
+ unsigned int code; |
+ input_absinfo absinfo; |
+}; |
+ |
+struct DeviceCapabilities { |
+ // Full sysfs path (readlink -f /sys/class/input/event*) |
+ const char* path; |
+ |
+ // EVIOCGNAME (/sys/class/input/*/device/name) |
+ const char* name; |
+ |
+ // EVIOCGPHYS (/sys/class/input/*/device/phys) |
+ const char* phys; |
+ |
+ // EVIOCGUNIQ (/sys/class/input/*/device/uniq) |
+ const char* uniq; |
+ |
+ // EVIOCGID (/sys/class/input/*/device/id) |
+ const char* bustype; |
+ const char* vendor; |
+ const char* product; |
+ const char* version; |
+ |
+ // EVIOCGPROP (/sys/class/input/*/device/properties) |
+ // 64-bit groups. |
+ const char* prop; |
+ |
+ // EVIOCGBIT (/sys/class/input/*/device/capabilities) |
+ // 64-bit groups. |
+ const char* ev; |
+ const char* key; |
+ const char* rel; |
+ const char* abs; |
+ const char* msc; |
+ const char* sw; |
+ const char* led; |
+ const char* ff; |
+ |
+ // EVIOCGABS. |
+ const DeviceAbsoluteAxis* abs_axis; |
+ size_t abs_axis_count; |
+}; |
+ |
+bool CapabilitiesToDeviceInfo(const DeviceCapabilities& capabilities, |
+ EventDeviceInfo* devinfo); |
+ |
+extern const DeviceCapabilities kLinkKeyboard; |
+extern const DeviceCapabilities kLinkTouchscreen; |
+extern const DeviceCapabilities kLinkTouchpad; |
+extern const DeviceCapabilities kHpUsbKeyboard; |
+extern const DeviceCapabilities kHpUsbKeyboard_Extra; |
+extern const DeviceCapabilities kLogitechUsbMouse; |
+extern const DeviceCapabilities kMimoTouch2Touchscreen; |
+extern const DeviceCapabilities kWacomIntuosPtS_Pen; |
+extern const DeviceCapabilities kWacomIntuosPtS_Finger; |
+extern const DeviceCapabilities kLogitechTouchKeyboardK400; |
+extern const DeviceCapabilities kElo_TouchSystems_2700; |
+ |
+} // namspace ui |
+ |
+#endif // UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_TEST_UTIL_H_ |