ladybird/Libraries/LibWeb/Gamepad/GamepadButton.cpp
ayeteadoe 454e6a6f7f LibWeb/Gamepad: Forward declare SDL components to fix Windows build
We have to prevent from including any SDL headers in LibWeb headers.
Otherwise there will be transitive Windows.h includes that will
re-declare some of our existing forward decls/defines in
LibCore/SocketAddressWindows.h
2025-09-02 11:11:12 +01:00

45 lines
868 B
C++

/*
* Copyright (c) 2025, Luke Wilde <luke@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/GamepadButtonPrototype.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/Gamepad/GamepadButton.h>
#include <SDL3/SDL_gamepad.h>
namespace Web::Gamepad {
GC_DEFINE_ALLOCATOR(GamepadButton);
GamepadButton::GamepadButton(JS::Realm& realm)
: Bindings::PlatformObject(realm)
{
}
GamepadButton::~GamepadButton() = default;
void GamepadButton::initialize(JS::Realm& realm)
{
WEB_SET_PROTOTYPE_FOR_INTERFACE(GamepadButton);
Base::initialize(realm);
}
void GamepadButton::set_pressed(Badge<Gamepad>, bool value)
{
m_pressed = value;
}
void GamepadButton::set_touched(Badge<Gamepad>, bool value)
{
m_touched = value;
}
void GamepadButton::set_value(Badge<Gamepad>, double value)
{
m_value = value;
}
}