summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.h
blob: 92e2d206ce0d5fe9d9e603b8403d08b2499fc609 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibWeb/Geometry/DOMPoint.h>
#include <LibWeb/SVG/SVGGraphicsElement.h>

namespace Web::SVG {

// https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
class SVGGeometryElement : public SVGGraphicsElement {
    WEB_PLATFORM_OBJECT(SVGGeometryElement, SVGGraphicsElement);

public:
    virtual RefPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;

    virtual Gfx::Path& get_path() = 0;

    float get_total_length();
    JS::NonnullGCPtr<Geometry::DOMPoint> get_point_at_length(float distance);

protected:
    SVGGeometryElement(DOM::Document& document, DOM::QualifiedName qualified_name);
};

}

WRAPPER_HACK(SVGGeometryElement, Web::SVG)