mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:17:44 +00:00
LibWeb: Introduce the WebGL namespace and add WebGLContextEvent
This commit is contained in:
parent
7d1fcb0cb3
commit
b0c2aee2e4
8 changed files with 74 additions and 1 deletions
45
Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.h
Normal file
45
Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.h
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
|
||||
namespace Web::WebGL {
|
||||
|
||||
struct WebGLContextEventInit final : public DOM::EventInit {
|
||||
String status_message { String::empty() };
|
||||
};
|
||||
|
||||
class WebGLContextEvent final : public DOM::Event {
|
||||
public:
|
||||
using WrapperType = Bindings::WebGLContextEventWrapper;
|
||||
|
||||
static NonnullRefPtr<WebGLContextEvent> create(FlyString const& type, WebGLContextEventInit const& event_init)
|
||||
{
|
||||
return adopt_ref(*new WebGLContextEvent(type, event_init));
|
||||
}
|
||||
|
||||
static NonnullRefPtr<WebGLContextEvent> create_with_global_object(Bindings::WindowObject&, FlyString const& type, WebGLContextEventInit const& event_init)
|
||||
{
|
||||
return adopt_ref(*new WebGLContextEvent(type, event_init));
|
||||
}
|
||||
|
||||
virtual ~WebGLContextEvent() override = default;
|
||||
|
||||
String const& status_message() const { return m_status_message; }
|
||||
|
||||
private:
|
||||
WebGLContextEvent(FlyString const& type, WebGLContextEventInit const& event_init)
|
||||
: DOM::Event(type, event_init)
|
||||
, m_status_message(event_init.status_message)
|
||||
{
|
||||
}
|
||||
|
||||
String m_status_message { String::empty() };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue