summaryrefslogtreecommitdiffstats
path: root/dom/gamepad/ipc/GamepadEventTypes.ipdlh
diff options
context:
space:
mode:
Diffstat (limited to 'dom/gamepad/ipc/GamepadEventTypes.ipdlh')
-rw-r--r--dom/gamepad/ipc/GamepadEventTypes.ipdlh59
1 files changed, 59 insertions, 0 deletions
diff --git a/dom/gamepad/ipc/GamepadEventTypes.ipdlh b/dom/gamepad/ipc/GamepadEventTypes.ipdlh
new file mode 100644
index 000000000..68ca36016
--- /dev/null
+++ b/dom/gamepad/ipc/GamepadEventTypes.ipdlh
@@ -0,0 +1,59 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+using mozilla::dom::GamepadServiceType from "mozilla/dom/GamepadMessageUtils.h";
+using mozilla::dom::GamepadPoseState from "mozilla/dom/GamepadMessageUtils.h";
+
+
+namespace mozilla {
+namespace dom {
+
+struct GamepadAdded {
+ nsString id;
+ uint32_t index;
+ // Ideally, mapping should be a GamepadMappingType
+ // But, we have dependency problems in non MOZ_GAMEPAD
+ // platforms. Therefore, we make it as an uint32_t here.
+ uint32_t mapping;
+ GamepadServiceType service_type;
+ uint32_t num_buttons;
+ uint32_t num_axes;
+};
+
+struct GamepadRemoved {
+ uint32_t index;
+ GamepadServiceType service_type;
+};
+
+struct GamepadAxisInformation {
+ uint32_t index;
+ GamepadServiceType service_type;
+ uint32_t axis;
+ double value;
+};
+
+struct GamepadButtonInformation {
+ uint32_t index;
+ GamepadServiceType service_type;
+ uint32_t button;
+ bool pressed;
+ double value;
+};
+
+struct GamepadPoseInformation {
+ uint32_t index;
+ GamepadServiceType service_type;
+ GamepadPoseState pose_state;
+};
+
+union GamepadChangeEvent {
+ GamepadAdded;
+ GamepadRemoved;
+ GamepadAxisInformation;
+ GamepadButtonInformation;
+ GamepadPoseInformation;
+};
+
+} // namespace dom
+} // namespace mozilla \ No newline at end of file