Files
ladybird/Libraries/LibWeb/Internals/FakeXRDevice.h
Shannon Booth fd44da6829 LibWeb/Bindings: Emit one bindings header and cpp per IDL
Previously, the LibWeb bindings generator would output multiple per
interface files like Prototype/Constructor/Namespace/GlobalMixin
depending on the contents of that IDL file.

This complicates the build system as it means that it does not know
what files will be generated without knowledge of the contents of that
IDL file.

Instead, for each IDL file only generate a single Bindings/<IDLFile>.h
and Bindings/<IDLFile>.cpp.
2026-04-21 07:36:13 +02:00

41 lines
966 B
C++

/*
* Copyright (c) 2025, Psychpsyo <psychpsyo@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Bindings/XRSystem.h>
#include <LibWeb/Internals/InternalsBase.h>
#include <LibWeb/WebXR/XRSession.h>
namespace Web::Internals {
struct FakeXRDeviceInit {
Optional<Vector<Bindings::XRSessionMode>> supported_modes;
Optional<Vector<String>> supported_features;
};
// https://github.com/immersive-web/webxr-test-api/blob/main/explainer.md
class WEB_API FakeXRDevice final : public InternalsBase {
WEB_PLATFORM_OBJECT(FakeXRDevice, InternalsBase);
GC_DECLARE_ALLOCATOR(FakeXRDevice);
public:
static GC::Ref<FakeXRDevice> create(JS::Realm&);
virtual ~FakeXRDevice() override;
void simulate_user_activation(GC::Ref<WebIDL::CallbackType>) const;
GC::Ref<WebIDL::Promise> disconnect() const;
private:
explicit FakeXRDevice(JS::Realm&);
virtual void initialize(JS::Realm&) override;
};
}