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