DOMPoint.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/Geometry/DOMPointReadOnly.h>
  8. namespace Web::Geometry {
  9. // https://drafts.fxtf.org/geometry/#DOMPoint
  10. class DOMPoint final : public DOMPointReadOnly {
  11. WEB_PLATFORM_OBJECT(DOMPoint, DOMPointReadOnly);
  12. public:
  13. static JS::NonnullGCPtr<DOMPoint> construct_impl(JS::Realm&, double x = 0, double y = 0, double z = 0, double w = 0);
  14. static JS::NonnullGCPtr<DOMPoint> create_with_global_object(HTML::Window&, double x = 0, double y = 0, double z = 0, double w = 0);
  15. virtual ~DOMPoint() override;
  16. double x() const { return m_x; }
  17. double y() const { return m_y; }
  18. double z() const { return m_z; }
  19. double w() const { return m_w; }
  20. void set_x(double x) { m_x = x; }
  21. void set_y(double y) { m_y = y; }
  22. void set_z(double z) { m_z = z; }
  23. void set_w(double w) { m_w = w; }
  24. private:
  25. DOMPoint(JS::Realm&, double x, double y, double z, double w);
  26. };
  27. }