OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_BROWSER_GAMEPAD_RAW_INPUT_DATA_FETCHER_WIN_H_ | 5 #ifndef CONTENT_BROWSER_GAMEPAD_RAW_INPUT_DATA_FETCHER_WIN_H_ |
6 #define CONTENT_BROWSER_GAMEPAD_RAW_INPUT_DATA_FETCHER_WIN_H_ | 6 #define CONTENT_BROWSER_GAMEPAD_RAW_INPUT_DATA_FETCHER_WIN_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
| 10 #include <stdint.h> |
10 #include <stdlib.h> | 11 #include <stdlib.h> |
11 #include <Unknwn.h> | 12 #include <Unknwn.h> |
12 #include <WinDef.h> | 13 #include <WinDef.h> |
13 #include <windows.h> | 14 #include <windows.h> |
14 | 15 |
15 #include <hidsdi.h> | 16 #include <hidsdi.h> |
16 #include <map> | 17 #include <map> |
17 #include <vector> | 18 #include <vector> |
18 | 19 |
| 20 #include "base/macros.h" |
19 #include "base/memory/scoped_ptr.h" | 21 #include "base/memory/scoped_ptr.h" |
20 #include "base/memory/weak_ptr.h" | 22 #include "base/memory/weak_ptr.h" |
21 #include "base/message_loop/message_loop.h" | 23 #include "base/message_loop/message_loop.h" |
22 #include "base/scoped_native_library.h" | 24 #include "base/scoped_native_library.h" |
23 #include "base/win/message_window.h" | 25 #include "base/win/message_window.h" |
24 #include "content/browser/gamepad/gamepad_data_fetcher.h" | 26 #include "content/browser/gamepad/gamepad_data_fetcher.h" |
25 #include "content/browser/gamepad/gamepad_standard_mappings.h" | 27 #include "content/browser/gamepad/gamepad_standard_mappings.h" |
26 #include "third_party/WebKit/public/platform/WebGamepads.h" | 28 #include "third_party/WebKit/public/platform/WebGamepads.h" |
27 | 29 |
28 namespace content { | 30 namespace content { |
29 | 31 |
30 struct RawGamepadAxis { | 32 struct RawGamepadAxis { |
31 HIDP_VALUE_CAPS caps; | 33 HIDP_VALUE_CAPS caps; |
32 float value; | 34 float value; |
33 bool active; | 35 bool active; |
34 unsigned long bitmask; | 36 unsigned long bitmask; |
35 }; | 37 }; |
36 | 38 |
37 struct RawGamepadInfo { | 39 struct RawGamepadInfo { |
38 RawGamepadInfo(); | 40 RawGamepadInfo(); |
39 ~RawGamepadInfo(); | 41 ~RawGamepadInfo(); |
40 | 42 |
41 HANDLE handle; | 43 HANDLE handle; |
42 scoped_ptr<uint8[]> ppd_buffer; | 44 scoped_ptr<uint8_t[]> ppd_buffer; |
43 PHIDP_PREPARSED_DATA preparsed_data; | 45 PHIDP_PREPARSED_DATA preparsed_data; |
44 | 46 |
45 uint32_t report_id; | 47 uint32_t report_id; |
46 uint32_t vendor_id; | 48 uint32_t vendor_id; |
47 uint32_t product_id; | 49 uint32_t product_id; |
48 | 50 |
49 wchar_t id[blink::WebGamepad::idLengthCap]; | 51 wchar_t id[blink::WebGamepad::idLengthCap]; |
50 | 52 |
51 uint32_t buttons_length; | 53 uint32_t buttons_length; |
52 bool buttons[blink::WebGamepad::buttonsLengthCap]; | 54 bool buttons[blink::WebGamepad::buttonsLengthCap]; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 HidPGetUsageValueFunc hidp_get_usage_value_; | 136 HidPGetUsageValueFunc hidp_get_usage_value_; |
135 HidPGetScaledUsageValueFunc hidp_get_scaled_usage_value_; | 137 HidPGetScaledUsageValueFunc hidp_get_scaled_usage_value_; |
136 HidDGetStringFunc hidd_get_product_string_; | 138 HidDGetStringFunc hidd_get_product_string_; |
137 | 139 |
138 DISALLOW_COPY_AND_ASSIGN(RawInputDataFetcher); | 140 DISALLOW_COPY_AND_ASSIGN(RawInputDataFetcher); |
139 }; | 141 }; |
140 | 142 |
141 } // namespace content | 143 } // namespace content |
142 | 144 |
143 #endif // CONTENT_BROWSER_GAMEPAD_RAW_INPUT_DATA_FETCHER_WIN_H_ | 145 #endif // CONTENT_BROWSER_GAMEPAD_RAW_INPUT_DATA_FETCHER_WIN_H_ |
OLD | NEW |