| OLD | NEW |
| 1 // Copyright (C) 2011, Google Inc. All rights reserved. | 1 // Copyright (C) 2011, Google Inc. All rights reserved. |
| 2 // | 2 // |
| 3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
| 4 // modification, are permitted provided that the following conditions are met: | 4 // modification, are permitted provided that the following conditions are met: |
| 5 // | 5 // |
| 6 // 1. Redistributions of source code must retain the above copyright | 6 // 1. Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // 2. Redistributions in binary form must reproduce the above copyright | 8 // 2. Redistributions in binary form must reproduce the above copyright |
| 9 // notice, this list of conditions and the following disclaimer in the | 9 // notice, this list of conditions and the following disclaimer in the |
| 10 // documentation and/or other materials provided with the distribution. | 10 // documentation and/or other materials provided with the distribution. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // memory between hardware polling threads and the rest of the browser. See | 83 // memory between hardware polling threads and the rest of the browser. See |
| 84 // also WebGamepads.h. | 84 // also WebGamepads.h. |
| 85 class WebGamepad { | 85 class WebGamepad { |
| 86 public: | 86 public: |
| 87 static const size_t idLengthCap = 128; | 87 static const size_t idLengthCap = 128; |
| 88 static const size_t mappingLengthCap = 16; | 88 static const size_t mappingLengthCap = 16; |
| 89 static const size_t axesLengthCap = 16; | 89 static const size_t axesLengthCap = 16; |
| 90 static const size_t buttonsLengthCap = 32; | 90 static const size_t buttonsLengthCap = 32; |
| 91 | 91 |
| 92 WebGamepad() | 92 WebGamepad() |
| 93 : connected(false), timestamp(0), axesLength(0), buttonsLength(0) { | 93 : connected(false), |
| 94 timestamp(0), |
| 95 axesLength(0), |
| 96 buttonsLength(0), |
| 97 displayId(0) { |
| 94 id[0] = 0; | 98 id[0] = 0; |
| 95 mapping[0] = 0; | 99 mapping[0] = 0; |
| 96 } | 100 } |
| 97 | 101 |
| 98 // Is there a gamepad connected at this index? | 102 // Is there a gamepad connected at this index? |
| 99 bool connected; | 103 bool connected; |
| 100 | 104 |
| 101 // Device identifier (based on manufacturer, model, etc.). | 105 // Device identifier (based on manufacturer, model, etc.). |
| 102 WebUChar id[idLengthCap]; | 106 WebUChar id[idLengthCap]; |
| 103 | 107 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 124 | 128 |
| 125 WebGamepadHand hand; | 129 WebGamepadHand hand; |
| 126 | 130 |
| 127 unsigned displayId; | 131 unsigned displayId; |
| 128 }; | 132 }; |
| 129 | 133 |
| 130 #pragma pack(pop) | 134 #pragma pack(pop) |
| 131 } | 135 } |
| 132 | 136 |
| 133 #endif // WebGamepad_h | 137 #endif // WebGamepad_h |
| OLD | NEW |