Index: components/mus/input_devices/public/interfaces/input_devices.mojom |
diff --git a/components/mus/input_devices/public/interfaces/input_devices.mojom b/components/mus/input_devices/public/interfaces/input_devices.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..378f3bddff9c80cd4099f4fb7d823aa28cf848dc |
--- /dev/null |
+++ b/components/mus/input_devices/public/interfaces/input_devices.mojom |
@@ -0,0 +1,70 @@ |
+// Copyright 2016 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. |
+ |
+module input_device.mojom; |
Ben Goodger (Google)
2016/06/02 18:06:44
this dir should be in:
components/mus/public/inte
|
+ |
+import "ui/gfx/geometry/mojo/geometry.mojom"; |
+ |
+enum InputDeviceType { |
+ INPUT_DEVICE_INTERNAL, // Internally connected input device. |
+ INPUT_DEVICE_EXTERNAL, // Known externally connected input device. |
+ INPUT_DEVICE_UNKNOWN, // Device that may or may not be an external device. |
+}; |
+ |
+struct InputDevice { |
+ // ID of the device. This ID is unique between all input devices. |
+ int32 id; |
+ |
+ // The type of the input device. |
+ InputDeviceType type; |
+ |
+ // Name of the device. |
+ string name; |
+ |
+ // The path to the input device in the sysfs filesystem. |
+ string sys_path; |
+ |
+ // USB-style device identifiers, where available, or 0 if unavailable. |
+ uint16 vendor_id; |
+ uint16 product_id; |
+}; |
+ |
+// TODO(kylechar): Don't repeat all the fields here, maybe just use composition. |
+struct TouchscreenDevice { |
+ // ID of the device. This ID is unique between all input devices. |
+ int32 id; |
+ |
+ // The type of the input device. |
+ InputDeviceType type; |
+ |
+ // Name of the device. |
+ string name; |
+ |
+ // The path to the input device in the sysfs filesystem. |
+ string sys_path; |
+ |
+ // USB-style device identifiers, where available, or 0 if unavailable. |
+ uint16 vendor_id; |
+ uint16 product_id; |
+ |
+ // Size of the touch screen area. |
+ mojo.Size size; |
+ |
+ // The number of touch points this device supports, or 0 if unknown. |
+ int32 touch_points; |
+}; |
+ |
+interface InputDeviceObserverMojo { |
+ OnKeyboardDeviceConfigurationChanged(array<InputDevice> devices); |
+ OnTouchscreenDeviceConfigurationChanged(array<TouchscreenDevice> devices); |
+ OnMouseDeviceConfigurationChanged(array<InputDevice> devices); |
+ OnTouchpadDeviceConfigurationChanged(array<InputDevice> devices); |
+ OnDeviceListsComplete(); |
+}; |
+ |
+interface InputDeviceServer { |
+ // Adds an InputDeviceObserverMojo in another process as an observer to get |
+ // notified of changes to input-devices over Mojo IPC. |
+ AddObserver(InputDeviceObserverMojo observer); |
+}; |