WebGLContextEvent.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 <AK/FlyString.h>
  9. #include <LibWeb/DOM/Event.h>
  10. namespace Web::WebGL {
  11. struct WebGLContextEventInit final : public DOM::EventInit {
  12. String status_message;
  13. };
  14. class WebGLContextEvent final : public DOM::Event {
  15. WEB_PLATFORM_OBJECT(WebGLContextEvent, DOM::Event);
  16. JS_DECLARE_ALLOCATOR(WebGLContextEvent);
  17. public:
  18. [[nodiscard]] static JS::NonnullGCPtr<WebGLContextEvent> create(JS::Realm&, FlyString const& type, WebGLContextEventInit const&);
  19. static WebIDL::ExceptionOr<JS::NonnullGCPtr<WebGLContextEvent>> construct_impl(JS::Realm&, FlyString const& type, WebGLContextEventInit const&);
  20. virtual ~WebGLContextEvent() override;
  21. String const& status_message() const { return m_status_message; }
  22. private:
  23. WebGLContextEvent(JS::Realm&, FlyString const& type, WebGLContextEventInit const& event_init);
  24. virtual void initialize(JS::Realm&) override;
  25. String m_status_message;
  26. };
  27. }