Path2D.h 802 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/RefCounted.h>
  8. #include <LibGfx/Path.h>
  9. #include <LibWeb/Bindings/PlatformObject.h>
  10. #include <LibWeb/HTML/Canvas/CanvasPath.h>
  11. namespace Web::HTML {
  12. // https://html.spec.whatwg.org/multipage/canvas.html#path2d
  13. class Path2D final
  14. : public Bindings::PlatformObject
  15. , public CanvasPath {
  16. WEB_PLATFORM_OBJECT(Path2D, Bindings::PlatformObject);
  17. public:
  18. static JS::NonnullGCPtr<Path2D> create_with_global_object(HTML::Window&, Optional<Variant<JS::Handle<Path2D>, String>> const& path);
  19. virtual ~Path2D() override;
  20. private:
  21. Path2D(HTML::Window&, Optional<Variant<JS::Handle<Path2D>, String>> const&);
  22. };
  23. }
  24. WRAPPER_HACK(Path2D, Web::HTML)