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