| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are met: | 5 * modification, are permitted provided that the following conditions are met: |
| 6 * | 6 * |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
| 23 * DAMAGE. | 23 * DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef Gamepad_h | 26 #ifndef Gamepad_h |
| 27 #define Gamepad_h | 27 #define Gamepad_h |
| 28 | 28 |
| 29 #include "bindings/core/v8/ScriptWrappable.h" | 29 #include "bindings/core/v8/ScriptWrappable.h" |
| 30 #include "modules/gamepad/GamepadButton.h" | 30 #include "modules/gamepad/GamepadButton.h" |
| 31 #include "modules/gamepad/GamepadPose.h" |
| 31 #include "platform/heap/Handle.h" | 32 #include "platform/heap/Handle.h" |
| 32 #include "public/platform/WebGamepad.h" | 33 #include "public/platform/WebGamepad.h" |
| 33 #include "wtf/Vector.h" | 34 #include "wtf/Vector.h" |
| 34 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
| 35 | 36 |
| 36 namespace blink { | 37 namespace blink { |
| 37 | 38 |
| 38 class Gamepad final : public GarbageCollectedFinalized<Gamepad>, public ScriptWr
appable { | 39 class Gamepad final : public GarbageCollectedFinalized<Gamepad>, public ScriptWr
appable { |
| 39 DEFINE_WRAPPERTYPEINFO(); | 40 DEFINE_WRAPPERTYPEINFO(); |
| 40 public: | 41 public: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 60 | 61 |
| 61 const String& mapping() const { return m_mapping; } | 62 const String& mapping() const { return m_mapping; } |
| 62 void setMapping(const String& val) { m_mapping = val; } | 63 void setMapping(const String& val) { m_mapping = val; } |
| 63 | 64 |
| 64 const DoubleVector& axes() const { return m_axes; } | 65 const DoubleVector& axes() const { return m_axes; } |
| 65 void setAxes(unsigned count, const double* data); | 66 void setAxes(unsigned count, const double* data); |
| 66 | 67 |
| 67 const GamepadButtonVector& buttons() const { return m_buttons; } | 68 const GamepadButtonVector& buttons() const { return m_buttons; } |
| 68 void setButtons(unsigned count, const WebGamepadButton* data); | 69 void setButtons(unsigned count, const WebGamepadButton* data); |
| 69 | 70 |
| 71 GamepadPose* pose() const { return m_pose; } |
| 72 void setPose(const WebGamepadPose&); |
| 73 |
| 70 DECLARE_TRACE(); | 74 DECLARE_TRACE(); |
| 71 | 75 |
| 72 private: | 76 private: |
| 73 Gamepad(); | 77 Gamepad(); |
| 74 | 78 |
| 75 String m_id; | 79 String m_id; |
| 76 unsigned m_index; | 80 unsigned m_index; |
| 77 bool m_connected; | 81 bool m_connected; |
| 78 unsigned long long m_timestamp; | 82 unsigned long long m_timestamp; |
| 79 String m_mapping; | 83 String m_mapping; |
| 80 DoubleVector m_axes; | 84 DoubleVector m_axes; |
| 81 GamepadButtonVector m_buttons; | 85 GamepadButtonVector m_buttons; |
| 86 Member<GamepadPose> m_pose; |
| 82 }; | 87 }; |
| 83 | 88 |
| 84 } // namespace blink | 89 } // namespace blink |
| 85 | 90 |
| 86 #endif // Gamepad_h | 91 #endif // Gamepad_h |
| OLD | NEW |