annotate modules/javafx.web/src/main/native/Source/WebCore/testing/MockGamepad.h @ 11208:db2c977a840b

8220147: Cherry pick GTK WebKit 2.22.7 changes Reviewed-by: mbilla, kcr
author arajkumar
date Fri, 08 Mar 2019 14:03:47 +0530
parents
children
rev   line source
arajkumar@10587 1 /*
arajkumar@10587 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
arajkumar@10587 3 *
arajkumar@10587 4 * Redistribution and use in source and binary forms, with or without
arajkumar@10587 5 * modification, are permitted provided that the following conditions
arajkumar@10587 6 * are met:
arajkumar@10587 7 * 1. Redistributions of source code must retain the above copyright
arajkumar@10587 8 * notice, this list of conditions and the following disclaimer.
arajkumar@10587 9 * 2. Redistributions in binary form must reproduce the above copyright
arajkumar@10587 10 * notice, this list of conditions and the following disclaimer in the
arajkumar@10587 11 * documentation and/or other materials provided with the distribution.
arajkumar@10587 12 *
arajkumar@10587 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
arajkumar@10587 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
arajkumar@10587 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
arajkumar@10587 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
arajkumar@10587 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
arajkumar@10587 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
arajkumar@10587 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
arajkumar@10587 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
arajkumar@10587 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
arajkumar@10587 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
arajkumar@10587 23 * THE POSSIBILITY OF SUCH DAMAGE.
arajkumar@10587 24 */
arajkumar@10587 25
arajkumar@10587 26 #pragma once
arajkumar@10587 27
arajkumar@10587 28 #if ENABLE(GAMEPAD)
arajkumar@10587 29
arajkumar@10587 30 #include "PlatformGamepad.h"
arajkumar@10587 31
arajkumar@10587 32 namespace WebCore {
arajkumar@10587 33
arajkumar@10587 34 class MockGamepad : public PlatformGamepad {
arajkumar@10587 35 public:
arajkumar@10587 36 MockGamepad(unsigned index, const String& gamepadID, unsigned axisCount, unsigned buttonCount);
arajkumar@10587 37
arajkumar@10587 38 const Vector<double>& axisValues() const final { return m_axisValues; }
arajkumar@10587 39 const Vector<double>& buttonValues() const final { return m_buttonValues; }
arajkumar@10587 40
arajkumar@10587 41 void updateDetails(const String& gamepadID, unsigned axisCount, unsigned buttonCount);
arajkumar@10587 42 bool setAxisValue(unsigned index, double value);
arajkumar@10587 43 bool setButtonValue(unsigned index, double value);
arajkumar@10587 44
arajkumar@10587 45 private:
arajkumar@10587 46 Vector<double> m_axisValues;
arajkumar@10587 47 Vector<double> m_buttonValues;
arajkumar@10587 48 };
arajkumar@10587 49
arajkumar@10587 50 }
arajkumar@10587 51
arajkumar@10587 52 #endif // ENABLE(GAMEPAD)