2022-08-11 16:50:23 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/RefCounted.h>
|
|
|
|
#include <LibGfx/Path.h>
|
2022-09-02 23:35:06 +02:00
|
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
2022-08-11 16:50:23 +01:00
|
|
|
#include <LibWeb/HTML/Canvas/CanvasPath.h>
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/canvas.html#path2d
|
2022-09-02 23:35:06 +02:00
|
|
|
class Path2D final
|
|
|
|
: public Bindings::PlatformObject
|
2022-08-11 16:50:23 +01:00
|
|
|
, public CanvasPath {
|
|
|
|
|
2022-09-02 23:35:06 +02:00
|
|
|
WEB_PLATFORM_OBJECT(Path2D, Bindings::PlatformObject);
|
2022-08-11 16:50:23 +01:00
|
|
|
|
|
|
|
public:
|
2023-02-15 19:24:06 +01:00
|
|
|
static WebIDL::ExceptionOr<JS::NonnullGCPtr<Path2D>> construct_impl(JS::Realm&, Optional<Variant<JS::Handle<Path2D>, DeprecatedString>> const& path);
|
2022-08-11 16:50:23 +01:00
|
|
|
|
2022-09-02 23:35:06 +02:00
|
|
|
virtual ~Path2D() override;
|
2022-08-11 16:50:23 +01:00
|
|
|
|
|
|
|
private:
|
2022-12-04 18:02:33 +00:00
|
|
|
Path2D(JS::Realm&, Optional<Variant<JS::Handle<Path2D>, DeprecatedString>> const&);
|
2023-01-10 06:28:20 -05:00
|
|
|
|
2023-01-28 12:33:35 -05:00
|
|
|
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
2022-08-11 16:50:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|