2022-06-04 04:18:32 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
|
2024-10-04 13:19:50 +02:00
|
|
|
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
|
2022-06-04 04:18:32 +01:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-03-05 11:01:48 +01:00
|
|
|
#include <AK/FlyString.h>
|
2022-06-04 04:18:32 +01:00
|
|
|
#include <LibWeb/DOM/Event.h>
|
|
|
|
|
|
|
|
namespace Web::WebGL {
|
|
|
|
|
|
|
|
struct WebGLContextEventInit final : public DOM::EventInit {
|
2023-03-05 11:01:48 +01:00
|
|
|
String status_message;
|
2022-06-04 04:18:32 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class WebGLContextEvent final : public DOM::Event {
|
2022-08-28 13:42:07 +02:00
|
|
|
WEB_PLATFORM_OBJECT(WebGLContextEvent, DOM::Event);
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DECLARE_ALLOCATOR(WebGLContextEvent);
|
2022-08-08 22:29:40 +02:00
|
|
|
|
2022-06-04 04:18:32 +01:00
|
|
|
public:
|
2024-11-15 04:01:23 +13:00
|
|
|
[[nodiscard]] static GC::Ref<WebGLContextEvent> create(JS::Realm&, FlyString const& type, WebGLContextEventInit const&);
|
|
|
|
static WebIDL::ExceptionOr<GC::Ref<WebGLContextEvent>> construct_impl(JS::Realm&, FlyString const& type, WebGLContextEventInit const&);
|
2022-06-04 04:18:32 +01:00
|
|
|
|
2022-08-08 22:29:40 +02:00
|
|
|
virtual ~WebGLContextEvent() override;
|
2022-06-04 04:18:32 +01:00
|
|
|
|
2023-03-05 11:01:48 +01:00
|
|
|
String const& status_message() const { return m_status_message; }
|
2022-06-04 04:18:32 +01:00
|
|
|
|
|
|
|
private:
|
2023-03-05 11:01:48 +01:00
|
|
|
WebGLContextEvent(JS::Realm&, FlyString const& type, WebGLContextEventInit const& event_init);
|
2022-09-25 18:12:50 -06:00
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2023-01-10 06:28:20 -05:00
|
|
|
|
2023-03-05 11:01:48 +01:00
|
|
|
String m_status_message;
|
2022-06-04 04:18:32 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|