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
{
16 uint32_t surfaceDimensions
[2];
17 bool isSurfaceDimensionsValid
;
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_