/* * Copyright (c) 2023, Luke Wilde * Copyright (c) 2023, Bastiaan van der Plaat * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include namespace Web::Geometry { // https://drafts.fxtf.org/geometry/#dommatrix class DOMMatrix : public DOMMatrixReadOnly { WEB_PLATFORM_OBJECT(DOMMatrix, Bindings::PlatformObject); public: static WebIDL::ExceptionOr> construct_impl(JS::Realm&, Optional>> const& init); static WebIDL::ExceptionOr> create_from_dom_matrix_2d_init(JS::Realm&, DOMMatrix2DInit& init); static JS::NonnullGCPtr create_from_dom_matrix_read_only(JS::Realm&, DOMMatrixReadOnly const& read_only_matrix); virtual ~DOMMatrix() override; static WebIDL::ExceptionOr> from_matrix(JS::VM&, DOMMatrixInit other = {}); void set_m11(double value); void set_m12(double value); void set_m13(double value); void set_m14(double value); void set_m21(double value); void set_m22(double value); void set_m23(double value); void set_m24(double value); void set_m31(double value); void set_m32(double value); void set_m33(double value); void set_m34(double value); void set_m41(double value); void set_m42(double value); void set_m43(double value); void set_m44(double value); void set_a(double value); void set_b(double value); void set_c(double value); void set_d(double value); void set_e(double value); void set_f(double value); WebIDL::ExceptionOr> multiply_self(DOMMatrixInit other = {}); WebIDL::ExceptionOr> pre_multiply_self(DOMMatrixInit other = {}); JS::NonnullGCPtr translate_self(Optional tx, Optional ty, Optional tz); JS::NonnullGCPtr skew_x_self(double sx = 0); JS::NonnullGCPtr skew_y_self(double sy = 0); JS::NonnullGCPtr invert_self(); private: DOMMatrix(JS::Realm&, double m11, double m12, double m21, double m22, double m41, double m42); DOMMatrix(JS::Realm&, Optional>> const& init); DOMMatrix(JS::Realm&, DOMMatrixReadOnly const& read_only_matrix); virtual void initialize(JS::Realm&) override; }; }