SVGAnimatedLength.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/Bindings/PlatformObject.h>
  8. #include <LibWeb/SVG/SVGLength.h>
  9. namespace Web::SVG {
  10. // https://www.w3.org/TR/SVG11/types.html#InterfaceSVGAnimatedLength
  11. class SVGAnimatedLength final : public Bindings::PlatformObject {
  12. WEB_PLATFORM_OBJECT(SVGAnimatedLength, Bindings::PlatformObject);
  13. JS_DECLARE_ALLOCATOR(SVGAnimatedLength);
  14. public:
  15. [[nodiscard]] static JS::NonnullGCPtr<SVGAnimatedLength> create(JS::Realm&, JS::NonnullGCPtr<SVGLength> base_val, JS::NonnullGCPtr<SVGLength> anim_val);
  16. virtual ~SVGAnimatedLength() override;
  17. JS::NonnullGCPtr<SVGLength> base_val() const { return m_base_val; }
  18. JS::NonnullGCPtr<SVGLength> anim_val() const { return m_anim_val; }
  19. private:
  20. SVGAnimatedLength(JS::Realm&, JS::NonnullGCPtr<SVGLength> base_val, JS::NonnullGCPtr<SVGLength> anim_val);
  21. virtual void initialize(JS::Realm&) override;
  22. virtual void visit_edges(Cell::Visitor&) override;
  23. JS::NonnullGCPtr<SVGLength> m_base_val;
  24. JS::NonnullGCPtr<SVGLength> m_anim_val;
  25. };
  26. }