OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_INFO_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_INFO_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_INFO_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_INFO_H_ |
7 | 7 |
8 #include <limits.h> | 8 #include <limits.h> |
9 #include <linux/input.h> | 9 #include <linux/input.h> |
10 | 10 |
| 11 #include <string> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
14 #include "ui/events/ozone/evdev/event_device_util.h" | 15 #include "ui/events/ozone/evdev/event_device_util.h" |
15 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 16 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
16 | 17 |
17 #if !defined(ABS_MT_TOOL_Y) | 18 #if !defined(ABS_MT_TOOL_Y) |
18 #define ABS_MT_TOOL_Y 0x3d | 19 #define ABS_MT_TOOL_Y 0x3d |
19 #endif | 20 #endif |
20 | 21 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // Properties of absolute axes. | 74 // Properties of absolute axes. |
74 int32_t GetAbsMinimum(unsigned int code) const; | 75 int32_t GetAbsMinimum(unsigned int code) const; |
75 int32_t GetAbsMaximum(unsigned int code) const; | 76 int32_t GetAbsMaximum(unsigned int code) const; |
76 int32_t GetAbsValue(unsigned int code) const; | 77 int32_t GetAbsValue(unsigned int code) const; |
77 uint32_t GetAbsMtSlotCount() const; | 78 uint32_t GetAbsMtSlotCount() const; |
78 int32_t GetAbsMtSlotValue(unsigned int code, unsigned int slot) const; | 79 int32_t GetAbsMtSlotValue(unsigned int code, unsigned int slot) const; |
79 int32_t GetAbsMtSlotValueWithDefault(unsigned int code, | 80 int32_t GetAbsMtSlotValueWithDefault(unsigned int code, |
80 unsigned int slot, | 81 unsigned int slot, |
81 int32_t default_value) const; | 82 int32_t default_value) const; |
82 | 83 |
| 84 // Device identification. |
| 85 const std::string& name() const { return name_; } |
| 86 uint16_t vendor_id() const { return vendor_id_; } |
| 87 uint16_t product_id() const { return product_id_; } |
| 88 |
83 // Check input device properties. | 89 // Check input device properties. |
84 bool HasProp(unsigned int code) const; | 90 bool HasProp(unsigned int code) const; |
85 | 91 |
86 // Has absolute X & Y axes (excludes MT) | 92 // Has absolute X & Y axes (excludes MT) |
87 bool HasAbsXY() const; | 93 bool HasAbsXY() const; |
88 | 94 |
89 // Has MT absolute X & Y events. | 95 // Has MT absolute X & Y events. |
90 bool HasMTAbsXY() const; | 96 bool HasMTAbsXY() const; |
91 | 97 |
92 // Has relative X & Y axes. | 98 // Has relative X & Y axes. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 unsigned long msc_bits_[EVDEV_BITS_TO_LONGS(MSC_CNT)]; | 149 unsigned long msc_bits_[EVDEV_BITS_TO_LONGS(MSC_CNT)]; |
144 unsigned long sw_bits_[EVDEV_BITS_TO_LONGS(SW_CNT)]; | 150 unsigned long sw_bits_[EVDEV_BITS_TO_LONGS(SW_CNT)]; |
145 unsigned long led_bits_[EVDEV_BITS_TO_LONGS(LED_CNT)]; | 151 unsigned long led_bits_[EVDEV_BITS_TO_LONGS(LED_CNT)]; |
146 unsigned long prop_bits_[EVDEV_BITS_TO_LONGS(INPUT_PROP_CNT)]; | 152 unsigned long prop_bits_[EVDEV_BITS_TO_LONGS(INPUT_PROP_CNT)]; |
147 | 153 |
148 struct input_absinfo abs_info_[ABS_CNT]; | 154 struct input_absinfo abs_info_[ABS_CNT]; |
149 | 155 |
150 // Store the values for the multi-touch properties for each slot. | 156 // Store the values for the multi-touch properties for each slot. |
151 std::vector<int32_t> slot_values_[EVDEV_ABS_MT_COUNT]; | 157 std::vector<int32_t> slot_values_[EVDEV_ABS_MT_COUNT]; |
152 | 158 |
| 159 // Device identification. |
| 160 std::string name_; |
| 161 uint16_t vendor_id_; |
| 162 uint16_t product_id_; |
| 163 |
153 DISALLOW_COPY_AND_ASSIGN(EventDeviceInfo); | 164 DISALLOW_COPY_AND_ASSIGN(EventDeviceInfo); |
154 }; | 165 }; |
155 | 166 |
156 } // namspace ui | 167 } // namspace ui |
157 | 168 |
158 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_INFO_H_ | 169 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_INFO_H_ |
OLD | NEW |