| 
									
										
										
										
											2022-07-12 20:06:50 +02:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2024-10-04 13:19:50 +02:00
										 |  |  |  * Copyright (c) 2022, Andreas Kling <andreas@ladybird.org> | 
					
						
							| 
									
										
										
										
											2022-10-06 15:25:08 +01:00
										 |  |  |  * Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org> | 
					
						
							| 
									
										
										
										
											2024-03-09 23:02:22 +01:00
										 |  |  |  * Copyright (c) 2024, Kenneth Myhra <kennethmyhra@serenityos.org> | 
					
						
							| 
									
										
										
										
											2022-07-12 20:06:50 +02:00
										 |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibGfx/Point.h>
 | 
					
						
							| 
									
										
										
										
											2022-09-03 21:32:14 +02:00
										 |  |  | #include <LibWeb/Bindings/PlatformObject.h>
 | 
					
						
							| 
									
										
										
										
											2024-03-09 23:02:22 +01:00
										 |  |  | #include <LibWeb/Bindings/Serializable.h>
 | 
					
						
							| 
									
										
										
										
											2022-07-12 20:06:50 +02:00
										 |  |  | #include <LibWeb/Forward.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::Geometry { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-06 15:25:08 +01:00
										 |  |  | struct DOMPointInit { | 
					
						
							|  |  |  |     double x { 0 }; | 
					
						
							|  |  |  |     double y { 0 }; | 
					
						
							|  |  |  |     double z { 0 }; | 
					
						
							|  |  |  |     double w { 1 }; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-12 20:06:50 +02:00
										 |  |  | // https://drafts.fxtf.org/geometry/#dompointreadonly
 | 
					
						
							| 
									
										
										
										
											2024-03-09 23:02:22 +01:00
										 |  |  | class DOMPointReadOnly | 
					
						
							|  |  |  |     : public Bindings::PlatformObject | 
					
						
							|  |  |  |     , public Bindings::Serializable { | 
					
						
							| 
									
										
										
										
											2022-09-03 21:32:14 +02:00
										 |  |  |     WEB_PLATFORM_OBJECT(DOMPointReadOnly, Bindings::PlatformObject); | 
					
						
							| 
									
										
										
										
											2023-11-19 19:47:52 +01:00
										 |  |  |     JS_DECLARE_ALLOCATOR(DOMPointReadOnly); | 
					
						
							| 
									
										
										
										
											2022-07-12 20:06:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-03 21:32:14 +02:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2023-08-15 13:16:09 +02:00
										 |  |  |     static JS::NonnullGCPtr<DOMPointReadOnly> construct_impl(JS::Realm&, double x = 0, double y = 0, double z = 0, double w = 1); | 
					
						
							| 
									
										
										
										
											2024-03-09 23:02:22 +01:00
										 |  |  |     static JS::NonnullGCPtr<DOMPointReadOnly> create(JS::Realm&); | 
					
						
							| 
									
										
										
										
											2022-07-12 20:06:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-15 13:16:09 +02:00
										 |  |  |     static JS::NonnullGCPtr<DOMPointReadOnly> from_point(JS::VM&, DOMPointInit const&); | 
					
						
							| 
									
										
										
										
											2022-10-06 15:25:08 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-03 21:32:14 +02:00
										 |  |  |     virtual ~DOMPointReadOnly() override; | 
					
						
							| 
									
										
										
										
											2022-07-12 20:06:50 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     double x() const { return m_x; } | 
					
						
							|  |  |  |     double y() const { return m_y; } | 
					
						
							|  |  |  |     double z() const { return m_z; } | 
					
						
							|  |  |  |     double w() const { return m_w; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-15 13:16:45 +02:00
										 |  |  |     WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMPoint>> matrix_transform(DOMMatrixInit&) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-09 23:02:22 +01:00
										 |  |  |     virtual StringView interface_name() const override { return "DOMPointReadOnly"sv; } | 
					
						
							| 
									
										
										
										
											2024-03-10 19:13:45 +01:00
										 |  |  |     virtual WebIDL::ExceptionOr<void> serialization_steps(HTML::SerializationRecord&, bool for_storage, HTML::SerializationMemory&) override; | 
					
						
							| 
									
										
										
										
											2024-03-10 19:48:33 +01:00
										 |  |  |     virtual WebIDL::ExceptionOr<void> deserialization_steps(ReadonlySpan<u32> const&, size_t& position, HTML::DeserializationMemory&) override; | 
					
						
							| 
									
										
										
										
											2024-03-09 23:02:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-12 20:06:50 +02:00
										 |  |  | protected: | 
					
						
							| 
									
										
										
										
											2022-09-25 18:03:02 -06:00
										 |  |  |     DOMPointReadOnly(JS::Realm&, double x, double y, double z, double w); | 
					
						
							| 
									
										
										
										
											2024-03-09 23:02:22 +01:00
										 |  |  |     explicit DOMPointReadOnly(JS::Realm&); | 
					
						
							| 
									
										
										
										
											2022-07-12 20:06:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-07 08:41:28 +02:00
										 |  |  |     virtual void initialize(JS::Realm&) override; | 
					
						
							| 
									
										
										
										
											2023-01-10 06:28:20 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-12 20:06:50 +02:00
										 |  |  |     double m_x; | 
					
						
							|  |  |  |     double m_y; | 
					
						
							|  |  |  |     double m_z; | 
					
						
							|  |  |  |     double m_w; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |