OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 module input_device.mojom; |
| 6 |
| 7 import "ui/gfx/geometry/mojo/geometry.mojom"; |
| 8 |
| 9 enum InputDeviceType { |
| 10 INPUT_DEVICE_INTERNAL, // Internally connected input device. |
| 11 INPUT_DEVICE_EXTERNAL, // Known externally connected input device. |
| 12 INPUT_DEVICE_UNKNOWN, // Device that may or may not be an external device. |
| 13 }; |
| 14 |
| 15 struct InputDevice { |
| 16 // ID of the device. This ID is unique between all input devices. |
| 17 int32 id; |
| 18 |
| 19 // The type of the input device. |
| 20 InputDeviceType type; |
| 21 |
| 22 // Name of the device. |
| 23 string name; |
| 24 |
| 25 // The path to the input device in the sysfs filesystem. |
| 26 string sys_path; |
| 27 |
| 28 // USB-style device identifiers, where available, or 0 if unavailable. |
| 29 uint16 vendor_id; |
| 30 uint16 product_id; |
| 31 }; |
| 32 |
| 33 // TODO(kylechar): Don't repeat all the fields here, maybe just use composition. |
| 34 struct TouchscreenDevice { |
| 35 // ID of the device. This ID is unique between all input devices. |
| 36 int32 id; |
| 37 |
| 38 // The type of the input device. |
| 39 InputDeviceType type; |
| 40 |
| 41 // Name of the device. |
| 42 string name; |
| 43 |
| 44 // The path to the input device in the sysfs filesystem. |
| 45 string sys_path; |
| 46 |
| 47 // USB-style device identifiers, where available, or 0 if unavailable. |
| 48 uint16 vendor_id; |
| 49 uint16 product_id; |
| 50 |
| 51 // Size of the touch screen area. |
| 52 gfx.mojom.Size size; |
| 53 |
| 54 // The number of touch points this device supports, or 0 if unknown. |
| 55 int32 touch_points; |
| 56 }; |
| 57 |
| 58 interface InputDeviceObserverMojo { |
| 59 OnKeyboardDeviceConfigurationChanged(array<InputDevice> devices); |
| 60 OnTouchscreenDeviceConfigurationChanged(array<TouchscreenDevice> devices); |
| 61 OnMouseDeviceConfigurationChanged(array<InputDevice> devices); |
| 62 OnTouchpadDeviceConfigurationChanged(array<InputDevice> devices); |
| 63 OnDeviceListsComplete(); |
| 64 }; |
| 65 |
| 66 interface InputDeviceServer { |
| 67 // Adds an InputDeviceObserverMojo in another process as an observer to get |
| 68 // notified of changes to input-devices over Mojo IPC. |
| 69 AddObserver(InputDeviceObserverMojo observer); |
| 70 }; |
OLD | NEW |