| 
									
										
										
										
											2024-03-31 14:41:00 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2024, MacDue <macdue@dueutil.tech> | 
					
						
							| 
									
										
										
										
											2024-05-06 11:39:17 +01:00
										 |  |  |  * Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org> | 
					
						
							| 
									
										
										
										
											2024-03-31 14:41:00 +01:00
										 |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibWeb/Bindings/PlatformObject.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::SVG { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // FIXME: This class is just a stub.
 | 
					
						
							|  |  |  | // https://svgwg.org/svg2-draft/single-page.html#coords-InterfaceSVGTransform
 | 
					
						
							|  |  |  | class SVGTransform final : public Bindings::PlatformObject { | 
					
						
							|  |  |  |     WEB_PLATFORM_OBJECT(SVGTransform, Bindings::PlatformObject); | 
					
						
							|  |  |  |     JS_DECLARE_ALLOCATOR(SVGTransform); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     [[nodiscard]] static JS::NonnullGCPtr<SVGTransform> create(JS::Realm& realm); | 
					
						
							|  |  |  |     virtual ~SVGTransform() override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-06 11:39:17 +01:00
										 |  |  |     enum class Type : u16 { | 
					
						
							|  |  |  |         Unknown = 0, | 
					
						
							|  |  |  |         Matrix = 1, | 
					
						
							|  |  |  |         Translate = 2, | 
					
						
							|  |  |  |         Scale = 3, | 
					
						
							|  |  |  |         Rotate = 4, | 
					
						
							|  |  |  |         SkewX = 5, | 
					
						
							|  |  |  |         SkewY = 6, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Type type(); | 
					
						
							| 
									
										
										
										
											2024-05-06 12:06:54 +01:00
										 |  |  |     float angle(); | 
					
						
							| 
									
										
										
										
											2024-05-06 11:39:17 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-06 12:16:24 +01:00
										 |  |  |     void set_translate(float tx, float ty); | 
					
						
							| 
									
										
										
										
											2024-05-06 12:19:07 +01:00
										 |  |  |     void set_scale(float sx, float sy); | 
					
						
							| 
									
										
										
										
											2024-05-06 12:16:24 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-31 14:41:00 +01:00
										 |  |  | private: | 
					
						
							|  |  |  |     SVGTransform(JS::Realm& realm); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     virtual void initialize(JS::Realm& realm) override; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |