WebGLContextEvent.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
  3. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <LibWeb/DOM/Event.h>
  9. namespace Web::WebGL {
  10. struct WebGLContextEventInit final : public DOM::EventInit {
  11. DeprecatedString status_message { DeprecatedString::empty() };
  12. };
  13. class WebGLContextEvent final : public DOM::Event {
  14. WEB_PLATFORM_OBJECT(WebGLContextEvent, DOM::Event);
  15. public:
  16. static WebIDL::ExceptionOr<JS::NonnullGCPtr<WebGLContextEvent>> create(JS::Realm&, DeprecatedFlyString const& type, WebGLContextEventInit const& event_init);
  17. static WebIDL::ExceptionOr<JS::NonnullGCPtr<WebGLContextEvent>> construct_impl(JS::Realm&, DeprecatedFlyString const& type, WebGLContextEventInit const& event_init);
  18. virtual ~WebGLContextEvent() override;
  19. DeprecatedString const& status_message() const { return m_status_message; }
  20. private:
  21. WebGLContextEvent(JS::Realm&, DeprecatedFlyString const& type, WebGLContextEventInit const& event_init);
  22. virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
  23. DeprecatedString m_status_message { DeprecatedString::empty() };
  24. };
  25. }