1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5[Pref="dom.gamepad.test.enabled"]
6interface GamepadServiceTest
7{
8  readonly attribute GamepadMappingType noMapping;
9  readonly attribute GamepadMappingType standardMapping;
10  readonly attribute GamepadHand noHand;
11  readonly attribute GamepadHand leftHand;
12  readonly attribute GamepadHand rightHand;
13
14  [Throws]
15  Promise<unsigned long> addGamepad(DOMString id,
16                                    GamepadMappingType mapping,
17                                    GamepadHand hand,
18                                    unsigned long numButtons,
19                                    unsigned long numAxes,
20                                    unsigned long numHaptics);
21
22  void removeGamepad(unsigned long index);
23
24  void newButtonEvent(unsigned long index,
25                      unsigned long button,
26                      boolean pressed,
27                      boolean touched);
28
29  void newButtonValueEvent(unsigned long index,
30                           unsigned long button,
31                           boolean pressed,
32                           boolean touched,
33                           double value);
34
35  void newAxisMoveEvent(unsigned long index,
36                        unsigned long axis,
37                        double value);
38  void newPoseMove(unsigned long index,
39                   Float32Array? orient,
40                   Float32Array? pos,
41                   Float32Array? angVelocity,
42                   Float32Array? angAcceleration,
43                   Float32Array? linVelocity,
44                   Float32Array? linAcceleration);
45};