Files
ladybird/Libraries/LibWeb/CSS/CSSMatrixComponent.h
Shannon Booth 5adfd1c43a LibWeb/Bindings: Generate struct definitions from IDL dictionaries
Previously we were inconsistent by generating code for enum definitions
but not generating code for dictionaries. With future changes to the
IDL generator to expose helpers to convert to and from IDL values
this produced circular depdendencies. To solve this problem, also
generate the dictionary definitions in bindings headers.
2026-05-09 10:49:49 +02:00

44 lines
1.5 KiB
C++

/*
* Copyright (c) 2025, Sam Atkins <sam@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Bindings/CSSMatrixComponent.h>
#include <LibWeb/CSS/CSSTransformComponent.h>
namespace Web::CSS {
// https://drafts.css-houdini.org/css-typed-om-1/#cssmatrixcomponent
class CSSMatrixComponent final : public CSSTransformComponent {
WEB_PLATFORM_OBJECT(CSSMatrixComponent, CSSTransformComponent);
GC_DECLARE_ALLOCATOR(CSSMatrixComponent);
public:
[[nodiscard]] static GC::Ref<CSSMatrixComponent> create(JS::Realm&, Is2D, GC::Ref<Geometry::DOMMatrix>);
static WebIDL::ExceptionOr<GC::Ref<CSSMatrixComponent>> construct_impl(JS::Realm&, GC::Ref<Geometry::DOMMatrixReadOnly>, Optional<Bindings::CSSMatrixComponentOptions> = {});
virtual ~CSSMatrixComponent() override;
virtual WebIDL::ExceptionOr<Utf16String> to_string() const override;
virtual WebIDL::ExceptionOr<GC::Ref<Geometry::DOMMatrix>> to_matrix() const override;
GC::Ref<Geometry::DOMMatrix> matrix() const { return m_matrix; }
WebIDL::ExceptionOr<void> set_matrix(GC::Ref<Geometry::DOMMatrix> matrix);
virtual WebIDL::ExceptionOr<NonnullRefPtr<TransformationStyleValue const>> create_style_value(PropertyNameAndID const&) const override;
private:
explicit CSSMatrixComponent(JS::Realm&, Is2D, GC::Ref<Geometry::DOMMatrix>);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Visitor&) override;
GC::Ref<Geometry::DOMMatrix> m_matrix;
};
}