Serenity Operating System
1#import <Geometry/DOMMatrix.idl>
2
3// https://drafts.fxtf.org/geometry/#dommatrixreadonly
4[Exposed=(Window,Worker), Serializable, UseNewAKString]
5interface DOMMatrixReadOnly {
6 constructor(optional (DOMString or sequence<unrestricted double>) init);
7
8 // FIXME: [NewObject] static DOMMatrixReadOnly fromMatrix(optional DOMMatrixInit other = {});
9 // FIXME: [NewObject] static DOMMatrixReadOnly fromFloat32Array(Float32Array array32);
10 // FIXME: [NewObject] static DOMMatrixReadOnly fromFloat64Array(Float64Array array64);
11
12 // These attributes are simple aliases for certain elements of the 4x4 matrix
13 readonly attribute unrestricted double a;
14 readonly attribute unrestricted double b;
15 readonly attribute unrestricted double c;
16 readonly attribute unrestricted double d;
17 readonly attribute unrestricted double e;
18 readonly attribute unrestricted double f;
19
20 readonly attribute unrestricted double m11;
21 readonly attribute unrestricted double m12;
22 readonly attribute unrestricted double m13;
23 readonly attribute unrestricted double m14;
24 readonly attribute unrestricted double m21;
25 readonly attribute unrestricted double m22;
26 readonly attribute unrestricted double m23;
27 readonly attribute unrestricted double m24;
28 readonly attribute unrestricted double m31;
29 readonly attribute unrestricted double m32;
30 readonly attribute unrestricted double m33;
31 readonly attribute unrestricted double m34;
32 readonly attribute unrestricted double m41;
33 readonly attribute unrestricted double m42;
34 readonly attribute unrestricted double m43;
35 readonly attribute unrestricted double m44;
36
37 readonly attribute boolean is2D;
38 readonly attribute boolean isIdentity;
39
40 // Immutable transform methods
41 // FIXME: [NewObject] DOMMatrix translate(optional unrestricted double tx = 0, optional unrestricted double ty = 0, optional unrestricted double tz = 0);
42 // FIXME: [NewObject] DOMMatrix scale(optional unrestricted double scaleX = 1, optional unrestricted double scaleY, optional unrestricted double scaleZ = 1, optional unrestricted double originX = 0, optional unrestricted double originY = 0, optional unrestricted double originZ = 0);
43 // FIXME: [NewObject] DOMMatrix scaleNonUniform(optional unrestricted double scaleX = 1, optional unrestricted double scaleY = 1);
44 // FIXME: [NewObject] DOMMatrix scale3d(optional unrestricted double scale = 1, optional unrestricted double originX = 0, optional unrestricted double originY = 0, optional unrestricted double originZ = 0);
45 // FIXME: [NewObject] DOMMatrix rotate(optional unrestricted double rotX = 0, optional unrestricted double rotY, optional unrestricted double rotZ);
46 // FIXME: [NewObject] DOMMatrix rotateFromVector(optional unrestricted double x = 0, optional unrestricted double y = 0);
47 // FIXME: [NewObject] DOMMatrix rotateAxisAngle(optional unrestricted double x = 0, optional unrestricted double y = 0, optional unrestricted double z = 0, optional unrestricted double angle = 0);
48 // FIXME: [NewObject] DOMMatrix skewX(optional unrestricted double sx = 0);
49 // FIXME: [NewObject] DOMMatrix skewY(optional unrestricted double sy = 0);
50 // FIXME: [NewObject] DOMMatrix multiply(optional DOMMatrixInit other = {});
51 // FIXME: [NewObject] DOMMatrix flipX();
52 // FIXME: [NewObject] DOMMatrix flipY();
53 [NewObject] DOMMatrix inverse();
54
55 // FIXME: [NewObject] DOMPoint transformPoint(optional DOMPointInit point = {});
56 // FIXME: [NewObject] Float32Array toFloat32Array();
57 // FIXME: [NewObject] Float64Array toFloat64Array();
58
59 [Exposed=Window] stringifier;
60 // FIXME: [Default] object toJSON();
61};
62
63dictionary DOMMatrix2DInit {
64 unrestricted double a;
65 unrestricted double b;
66 unrestricted double c;
67 unrestricted double d;
68 unrestricted double e;
69 unrestricted double f;
70 unrestricted double m11;
71 unrestricted double m12;
72 unrestricted double m21;
73 unrestricted double m22;
74 unrestricted double m41;
75 unrestricted double m42;
76};
77
78dictionary DOMMatrixInit : DOMMatrix2DInit {
79 unrestricted double m13 = 0;
80 unrestricted double m14 = 0;
81 unrestricted double m23 = 0;
82 unrestricted double m24 = 0;
83 unrestricted double m31 = 0;
84 unrestricted double m32 = 0;
85 unrestricted double m33 = 1;
86 unrestricted double m34 = 0;
87 unrestricted double m43 = 0;
88 unrestricted double m44 = 1;
89 boolean is2D;
90};