WebGLContextEvent.h 983 B

1234567891011121314151617181920212223242526272829303132333435
  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. String status_message { String::empty() };
  12. };
  13. class WebGLContextEvent final : public DOM::Event {
  14. WEB_PLATFORM_OBJECT(WebGLContextEvent, DOM::Event);
  15. public:
  16. static WebGLContextEvent* create(JS::Realm&, FlyString const& type, WebGLContextEventInit const& event_init);
  17. static WebGLContextEvent* construct_impl(JS::Realm&, FlyString const& type, WebGLContextEventInit const& event_init);
  18. virtual ~WebGLContextEvent() override;
  19. String const& status_message() const { return m_status_message; }
  20. private:
  21. WebGLContextEvent(JS::Realm&, FlyString const& type, WebGLContextEventInit const& event_init);
  22. String m_status_message { String::empty() };
  23. };
  24. }