Bumping manifests a=b2g-bump
[gecko.git] / dom / webidl / Gamepad.webidl
blob9779c71b85b5d1445d1f866fe74ff6c861687fd8
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 [Pref="dom.gamepad.enabled"]
7 interface GamepadButton {
8   readonly    attribute boolean pressed;
9   readonly    attribute double  value;
12 enum GamepadMappingType {
13   "",
14   "standard"
17 [Pref="dom.gamepad.enabled"]
18 interface Gamepad {
19   /**
20    * An identifier, unique per type of device.
21    */
22   readonly attribute DOMString id;
24   /**
25    * The game port index for the device. Unique per device
26    * attached to this system.
27    */
28   readonly attribute unsigned long index;
30   /**
31    * The mapping in use for this device. The empty string
32    * indicates that no mapping is in use.
33    */
34   readonly attribute GamepadMappingType mapping;
36   /**
37    * true if this gamepad is currently connected to the system.
38    */
39   readonly attribute boolean connected;
41   /**
42    * The current state of all buttons on the device, an
43    * array of GamepadButton.
44    */
45   [Pure, Cached, Frozen]
46   readonly attribute sequence<GamepadButton> buttons;
48   /**
49    * The current position of all axes on the device, an
50    * array of doubles.
51    */
52   [Pure, Cached, Frozen]
53   readonly attribute sequence<double> axes;
55   /**
56    * Timestamp from when the data of this device was last updated.
57    */
58   readonly attribute DOMHighResTimeStamp timestamp;