SVGGeometryElement.h 859 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/Geometry/DOMPoint.h>
  8. #include <LibWeb/SVG/SVGGraphicsElement.h>
  9. namespace Web::SVG {
  10. // https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
  11. class SVGGeometryElement : public SVGGraphicsElement {
  12. WEB_PLATFORM_OBJECT(SVGGeometryElement, SVGGraphicsElement);
  13. public:
  14. virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
  15. virtual Gfx::Path& get_path() = 0;
  16. float get_total_length();
  17. JS::NonnullGCPtr<Geometry::DOMPoint> get_point_at_length(float distance);
  18. protected:
  19. SVGGeometryElement(DOM::Document& document, DOM::QualifiedName qualified_name);
  20. virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
  21. };
  22. }