no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / dom / gamepad / GamepadTouchState.h
blob0af81a645140d22824e46b4cb61982823a0a2d00
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_gamepad_GamepadTouchState_h_
8 #define mozilla_dom_gamepad_GamepadTouchState_h_
10 namespace mozilla::dom {
12 struct GamepadTouchState {
13 uint32_t touchId;
14 uint32_t surfaceId;
15 float position[2];
16 uint32_t surfaceDimensions[2];
17 bool isSurfaceDimensionsValid;
19 GamepadTouchState()
20 : touchId(0),
21 surfaceId(0),
22 position{0, 0},
23 surfaceDimensions{0, 0},
24 isSurfaceDimensionsValid(false) {}
26 bool operator==(const GamepadTouchState& aTouch) const {
27 return touchId == aTouch.touchId && surfaceId == aTouch.surfaceId &&
28 position[0] == aTouch.position[0] &&
29 position[1] == aTouch.position[1] &&
30 surfaceDimensions[0] == aTouch.surfaceDimensions[0] &&
31 surfaceDimensions[1] == aTouch.surfaceDimensions[1] &&
32 isSurfaceDimensionsValid == aTouch.isSurfaceDimensionsValid;
35 bool operator!=(const GamepadTouchState& aTouch) const {
36 return !(*this == aTouch);
40 } // namespace mozilla::dom
42 #endif // mozilla_dom_gamepad_GamepadTouchState_h_