| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DATA_FETCHER_MAC_H_ | 5 #ifndef CONTENT_BROWSER_GAMEPAD_DATA_FETCHER_MAC_H_ |
| 6 #define CONTENT_BROWSER_GAMEPAD_DATA_FETCHER_MAC_H_ | 6 #define CONTENT_BROWSER_GAMEPAD_DATA_FETCHER_MAC_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/mac/scoped_cftyperef.h" | 11 #include "base/mac/scoped_cftyperef.h" |
| 12 #include "content/browser/gamepad/data_fetcher.h" | 12 #include "content/browser/gamepad/data_fetcher.h" |
| 13 #include "content/browser/gamepad/gamepad_standard_mappings.h" |
| 13 #include "content/common/gamepad_hardware_buffer.h" | 14 #include "content/common/gamepad_hardware_buffer.h" |
| 14 | 15 |
| 15 #include <CoreFoundation/CoreFoundation.h> | 16 #include <CoreFoundation/CoreFoundation.h> |
| 16 #include <IOKit/hid/IOHIDManager.h> | 17 #include <IOKit/hid/IOHIDManager.h> |
| 17 | 18 |
| 18 #if defined(__OBJC__) | 19 #if defined(__OBJC__) |
| 19 @class NSArray; | 20 @class NSArray; |
| 20 #else | 21 #else |
| 21 class NSArray; | 22 class NSArray; |
| 22 #endif | 23 #endif |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 WebKit::WebGamepads data_; | 60 WebKit::WebGamepads data_; |
| 60 | 61 |
| 61 // Side-band data that's not passed to the consumer, but we need to maintain | 62 // Side-band data that's not passed to the consumer, but we need to maintain |
| 62 // to update data_. | 63 // to update data_. |
| 63 struct AssociatedData { | 64 struct AssociatedData { |
| 64 IOHIDDeviceRef device_ref; | 65 IOHIDDeviceRef device_ref; |
| 65 IOHIDElementRef button_elements[WebKit::WebGamepad::buttonsLengthCap]; | 66 IOHIDElementRef button_elements[WebKit::WebGamepad::buttonsLengthCap]; |
| 66 IOHIDElementRef axis_elements[WebKit::WebGamepad::buttonsLengthCap]; | 67 IOHIDElementRef axis_elements[WebKit::WebGamepad::buttonsLengthCap]; |
| 67 CFIndex axis_minimums[WebKit::WebGamepad::axesLengthCap]; | 68 CFIndex axis_minimums[WebKit::WebGamepad::axesLengthCap]; |
| 68 CFIndex axis_maximums[WebKit::WebGamepad::axesLengthCap]; | 69 CFIndex axis_maximums[WebKit::WebGamepad::axesLengthCap]; |
| 70 // Function to map from device data to standard layout, if available. May |
| 71 // be null if no mapping is available. |
| 72 GamepadStandardMappingFunction mapper; |
| 69 }; | 73 }; |
| 70 AssociatedData associated_[WebKit::WebGamepads::itemsLengthCap]; | 74 AssociatedData associated_[WebKit::WebGamepads::itemsLengthCap]; |
| 71 }; | 75 }; |
| 72 | 76 |
| 73 } // namespace content | 77 } // namespace content |
| 74 | 78 |
| 75 #endif // CONTENT_BROWSER_GAMEPAD_DATA_FETCHER_MAC_H_ | 79 #endif // CONTENT_BROWSER_GAMEPAD_DATA_FETCHER_MAC_H_ |
| OLD | NEW |