WebGLContextEvent.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. public:
  17. static WebIDL::ExceptionOr<JS::NonnullGCPtr<WebGLContextEvent>> create(JS::Realm&, FlyString const& type, WebGLContextEventInit const& event_init);
  18. static WebIDL::ExceptionOr<JS::NonnullGCPtr<WebGLContextEvent>> construct_impl(JS::Realm&, FlyString const& type, WebGLContextEventInit const& event_init);
  19. virtual ~WebGLContextEvent() override;
  20. String const& status_message() const { return m_status_message; }
  21. private:
  22. WebGLContextEvent(JS::Realm&, FlyString const& type, WebGLContextEventInit const& event_init);
  23. virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
  24. String m_status_message;
  25. };
  26. }