Compare commits
505 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f41edc2ea4 | ||
|
|
30ab4442cf | ||
|
|
90e556be6e | ||
|
|
e9ff6a93fb | ||
|
|
5879ad7ec4 | ||
|
|
731d186b01 | ||
|
|
47d98500cf | ||
|
|
2561fd92f9 | ||
|
|
9129cdef0d | ||
|
|
613ee337aa | ||
|
|
bd6595e40a | ||
|
|
d827e51ba4 | ||
|
|
77fd5c5a3f | ||
|
|
a2e5b73107 | ||
|
|
4e42f61faa | ||
|
|
3a04d14872 | ||
|
|
e18e912d11 | ||
|
|
15478751db | ||
|
|
d715a4299d | ||
|
|
09d450aef4 | ||
|
|
e5fd79e4c1 | ||
|
|
86fc6689fb | ||
|
|
d6ba15df55 | ||
|
|
86e9447dd0 | ||
|
|
29e919caad | ||
|
|
88e5149a9f | ||
|
|
33c0b24731 | ||
|
|
d4c443607e | ||
|
|
6422d7faca | ||
|
|
1468612a78 | ||
|
|
bbb0951525 | ||
|
|
47083b4a86 | ||
|
|
5a51e2748b | ||
|
|
93dbf25938 | ||
|
|
898c7f58c9 | ||
|
|
b7d503fd39 | ||
|
|
95da509b83 | ||
|
|
34c8f511d9 | ||
|
|
3f0d00c83c | ||
|
|
79433a5c83 | ||
|
|
abc1d2cf64 | ||
|
|
f7c4d5dfae | ||
|
|
2305b7072b | ||
|
|
643eff4a90 | ||
|
|
e2e06ca027 | ||
|
|
a7df290d58 | ||
|
|
123524d126 | ||
|
|
28b98b055a | ||
|
|
76743cd414 | ||
|
|
9fcc5e99d3 | ||
|
|
4a55d9ec45 | ||
|
|
7d690dc75d | ||
|
|
2ece6d5375 | ||
|
|
421929c147 | ||
|
|
755156c19a | ||
|
|
43deec1c9e | ||
|
|
e20517430e | ||
|
|
16940eca53 | ||
|
|
37d000ee44 | ||
|
|
0db724d40c | ||
|
|
1da7ae6de3 | ||
|
|
1b3478e0cb | ||
|
|
11bf45466d | ||
|
|
b36caeddd2 | ||
|
|
f606ebdd72 | ||
|
|
0f9ad1e028 | ||
|
|
fcdbfb07c3 | ||
|
|
06637c6c0f | ||
|
|
c28fd5d5c3 | ||
|
|
d450841001 | ||
|
|
5191892950 | ||
|
|
bfa531f1f4 | ||
|
|
6aa3f00fa3 | ||
|
|
f3d7d73acc | ||
|
|
880ea7c998 | ||
|
|
bc9bf12e11 | ||
|
|
02f901ddf1 | ||
|
|
cbb3f99dfa | ||
|
|
7bf97ef618 | ||
|
|
1d92cc8f3e | ||
|
|
9faf63d5d3 | ||
|
|
7dcbc32540 | ||
|
|
387555f3c0 | ||
|
|
10ebd00cde | ||
|
|
fda93e9dd5 | ||
|
|
23759b1aaa | ||
|
|
165bb820bc | ||
|
|
83e9c09690 | ||
|
|
b7476a4ea1 | ||
|
|
38b12759c6 | ||
|
|
c6d30f8f9f | ||
|
|
4f40510248 | ||
|
|
c733a41d10 | ||
|
|
81c31f4de3 | ||
|
|
ac1c118ae3 | ||
|
|
7d2dfc1cf2 | ||
|
|
0c2cf50362 | ||
|
|
a485be9c1e | ||
|
|
e2ccec9ba3 | ||
|
|
7d8fb77481 | ||
|
|
4c5ccadfc7 | ||
|
|
69d0e2e3cd | ||
|
|
733c24e6cd | ||
|
|
4155a1f586 | ||
|
|
34ce565bb8 | ||
|
|
d805c7c66d | ||
|
|
3291216bbb | ||
|
|
eb6754fe8a | ||
|
|
b4c9c0d51b | ||
|
|
8058433031 | ||
|
|
c877a2814e | ||
|
|
2865212937 | ||
|
|
ed7da32952 | ||
|
|
a0b53f2e0c | ||
|
|
714bdcbdbb | ||
|
|
a2fd884543 | ||
|
|
93c6c121f6 | ||
|
|
dab7eee4ad | ||
|
|
f90ae67864 | ||
|
|
ddb560abbf | ||
|
|
5de4210cfb | ||
|
|
daf730efd5 | ||
|
|
c61c9c085d | ||
|
|
e0dfc94363 | ||
|
|
9b451ecac3 | ||
|
|
26736d06c8 | ||
|
|
01d3c03fb2 | ||
|
|
b783bbe6d6 | ||
|
|
640c77dd56 | ||
|
|
b6ae8ad1cc | ||
|
|
c5e2485e0e | ||
|
|
de2ce99fdd | ||
|
|
0867b96302 | ||
|
|
78895a002f | ||
|
|
9f9e61289b | ||
|
|
69dea9c4c8 | ||
|
|
94ce790891 | ||
|
|
21ed97037a | ||
|
|
1ab7d13b96 | ||
|
|
47b3d514bb | ||
|
|
e653c3ad1d | ||
|
|
0e33e39759 | ||
|
|
d11ed993ee | ||
|
|
8d4a7f2d00 | ||
|
|
06528cdd67 | ||
|
|
0d71db9b24 | ||
|
|
05a5fdd539 | ||
|
|
b35f386e46 | ||
|
|
59a4f4abb4 | ||
|
|
7ae4a5cb7e | ||
|
|
2dc8319b50 | ||
|
|
eea4f6fe30 | ||
|
|
c44d40b2e5 | ||
|
|
88b2fcbcd1 | ||
|
|
f7f86d5cfa | ||
|
|
2b2d2a65b2 | ||
|
|
123123605c | ||
|
|
710cfa3d31 | ||
|
|
05c690dcd9 | ||
|
|
fa52c674ef | ||
|
|
8ce6dde45b | ||
|
|
bfd45b3a54 | ||
|
|
8ddc4172cd | ||
|
|
81eeaa3a20 | ||
|
|
47c00fabc1 | ||
|
|
3bbb7da6e7 | ||
|
|
c4d9a93e56 | ||
|
|
f92bd65407 | ||
|
|
c91856641c | ||
|
|
3479606f83 | ||
|
|
797835ad79 | ||
|
|
96b3cbe594 | ||
|
|
3ada99b201 | ||
|
|
bd6b127358 | ||
|
|
481062423e | ||
|
|
328dcea8c8 | ||
|
|
f8ed7d3a78 | ||
|
|
12d79a62da | ||
|
|
c7b2e4c8b7 | ||
|
|
91d652ed84 | ||
|
|
590385339c | ||
|
|
44bb1e5f0e | ||
|
|
a4a961666a | ||
|
|
7af718b834 | ||
|
|
8060a631b1 | ||
|
|
01096abede | ||
|
|
8110982412 | ||
|
|
4429959fed | ||
|
|
920e64404d | ||
|
|
87af1db2bc | ||
|
|
391971f80b | ||
|
|
5aab3ed97d | ||
|
|
e6f838375a | ||
|
|
907acb5ad2 | ||
|
|
b6fc24d6e0 | ||
|
|
1b399ef5be | ||
|
|
c3c597df4d | ||
|
|
25f529757e | ||
|
|
edf437f056 | ||
|
|
8c79f3d093 | ||
|
|
55217146ae | ||
|
|
456824c504 | ||
|
|
4f0f64884d | ||
|
|
1f11f1cf8b | ||
|
|
d81b781d1f | ||
|
|
053fc9dc65 | ||
|
|
11c33771c2 | ||
|
|
5fd23f0ba3 | ||
|
|
c209fe2adc | ||
|
|
940351acbe | ||
|
|
f7a4a4d3d1 | ||
|
|
e81b5ae658 | ||
|
|
588093519a | ||
|
|
3a83a7fe62 | ||
|
|
b5a9f30d34 | ||
|
|
25026a55f7 | ||
|
|
467231d4b7 | ||
|
|
3aeb4b09bf | ||
|
|
9eed41ecd8 | ||
|
|
25e0d61e01 | ||
|
|
080bb3626d | ||
|
|
c26a194694 | ||
|
|
a577689cd4 | ||
|
|
d3f6d6d092 | ||
|
|
87e6531c65 | ||
|
|
faa6adcb23 | ||
|
|
880a8433cb | ||
|
|
f319a24ad3 | ||
|
|
17462abae7 | ||
|
|
978526c4e6 | ||
|
|
2901d09d01 | ||
|
|
af64c4820f | ||
|
|
0d01354737 | ||
|
|
d04364a186 | ||
|
|
4a66c65034 | ||
|
|
4eebad6f5f | ||
|
|
281a89508b | ||
|
|
f38c50724d | ||
|
|
76d737340e | ||
|
|
6edf90ee97 | ||
|
|
1b1647892d | ||
|
|
7863875641 | ||
|
|
39edc4e382 | ||
|
|
3f26303d6e | ||
|
|
37fed9dde7 | ||
|
|
d5800fd92f | ||
|
|
a1070a7c26 | ||
|
|
8549a4e1de | ||
|
|
06d735fe89 | ||
|
|
bcd1f8ea0b | ||
|
|
e6d01fc7f5 | ||
|
|
4adef0a280 | ||
|
|
b8a94d8db5 | ||
|
|
1bc346d22c | ||
|
|
1d2a0a6f47 | ||
|
|
f4e0ca1677 | ||
|
|
b5d7e957cf | ||
|
|
2b26ea4ddd | ||
|
|
52d122583e | ||
|
|
8e0e4568fe | ||
|
|
a59274c371 | ||
|
|
d0e9f67a25 | ||
|
|
b2485f6133 | ||
|
|
953b553089 | ||
|
|
4db29780e0 | ||
|
|
69e6d8d6e2 | ||
|
|
5b8eef255d | ||
|
|
a77d2d67f6 | ||
|
|
8f7bde6e0a | ||
|
|
b7ad6ed815 | ||
|
|
99978de2ab | ||
|
|
37cefe6d61 | ||
|
|
6c016c5913 | ||
|
|
a684544982 | ||
|
|
006d35914a | ||
|
|
c85120054e | ||
|
|
3fe8f17f94 | ||
|
|
273254ff4e | ||
|
|
8cad4a51e4 | ||
|
|
371b95608d | ||
|
|
f13673bff1 | ||
|
|
2ac83ca857 | ||
|
|
f1b9665c53 | ||
|
|
bd0804d443 | ||
|
|
107b57849e | ||
|
|
7803f64630 | ||
|
|
94c3315bf0 | ||
|
|
7710efd4db | ||
|
|
c31c67f69e | ||
|
|
f50f08f40d | ||
|
|
d9f035ef44 | ||
|
|
6b4f0160d5 | ||
|
|
ec1529061b | ||
|
|
65db04d3f9 | ||
|
|
9b96a443ce | ||
|
|
2e0bcc158f | ||
|
|
91a2161776 | ||
|
|
7a894873d1 | ||
|
|
8b6abd75f8 | ||
|
|
4c8610a960 | ||
|
|
31e3abb041 | ||
|
|
43a7da75cd | ||
|
|
0b5ee00b58 | ||
|
|
f1725b991e | ||
|
|
fd02942f4d | ||
|
|
30ce474aab | ||
|
|
e6ea691385 | ||
|
|
2ceed980b4 | ||
|
|
fa0d3959b6 | ||
|
|
446b7327e4 | ||
|
|
27e3bc1c6d | ||
|
|
8956692e9b | ||
|
|
979989e166 | ||
|
|
5c368b66e4 | ||
|
|
7bcbe2f01d | ||
|
|
0bd0cf9e65 | ||
|
|
fc64e7af99 | ||
|
|
9946dfa568 | ||
|
|
92b7a9b798 | ||
|
|
738590b631 | ||
|
|
5c62cdcc8a | ||
|
|
107c4c4a76 | ||
|
|
fa08aecbc2 | ||
|
|
ca792e2c7f | ||
|
|
c54826de6a | ||
|
|
a79ff1fd38 | ||
|
|
3cb3424250 | ||
|
|
f4d656d8ef | ||
|
|
29aed42c67 | ||
|
|
fed9590a2c | ||
|
|
01aff3edf4 | ||
|
|
3fadf33113 | ||
|
|
b0570fcdc5 | ||
|
|
ea984897b9 | ||
|
|
2b74e3cd77 | ||
|
|
bf026f6d7d | ||
|
|
d3bd896c49 | ||
|
|
cb5cab493e | ||
|
|
af3a081a81 | ||
|
|
d2b8174476 | ||
|
|
558086655f | ||
|
|
4ea054084c | ||
|
|
ad134527d4 | ||
|
|
8962d6b4cf | ||
|
|
cab30f4822 | ||
|
|
a0b28d00e8 | ||
|
|
4c5f4890f6 | ||
|
|
c33c375fb2 | ||
|
|
3ef59ba3ba | ||
|
|
2f8bd4d281 | ||
|
|
fa7ddaa531 | ||
|
|
1bd0a5ca10 | ||
|
|
f8a3f4186c | ||
|
|
a98f76f6e3 | ||
|
|
b4c8cf61e7 | ||
|
|
4215695759 | ||
|
|
69d2bfa1ba | ||
|
|
17239ae5cf | ||
|
|
2ab8484794 | ||
|
|
4a0d1f09f6 | ||
|
|
5f2bc51bbc | ||
|
|
e8c97e1938 | ||
|
|
527a18a1e5 | ||
|
|
e0cddc9a7b | ||
|
|
a746c341ae | ||
|
|
300925260e | ||
|
|
0043c50f32 | ||
|
|
d01aaa0e1f | ||
|
|
e1906ff533 | ||
|
|
7836aadd71 | ||
|
|
cca5baa447 | ||
|
|
e5d8c5cb48 | ||
|
|
44e64b007b | ||
|
|
c54822686e | ||
|
|
1d5e322c39 | ||
|
|
8856611706 | ||
|
|
7037da7834 | ||
|
|
672a0a98e8 | ||
|
|
62b4e94b91 | ||
|
|
f48eaa0e04 | ||
|
|
e09333c948 | ||
|
|
117be556cf | ||
|
|
3e0d2c35cd | ||
|
|
cf0877c777 | ||
|
|
72f6733cfe | ||
|
|
3f258453da | ||
|
|
4d4589a1b8 | ||
|
|
73dcc40929 | ||
|
|
7b8a3b8088 | ||
|
|
0ec2b3f2cb | ||
|
|
5e241f43b0 | ||
|
|
05ba79d185 | ||
|
|
6bc7f12746 | ||
|
|
de688c6f7f | ||
|
|
e283488256 | ||
|
|
c499645797 | ||
|
|
e0dad876ec | ||
|
|
a6b200b44a | ||
|
|
adeac3e16b | ||
|
|
f15f55d20a | ||
|
|
f62bff78c9 | ||
|
|
42804bf56d | ||
|
|
8b6b66e766 | ||
|
|
cf4e221fdf | ||
|
|
67a7302595 | ||
|
|
3b53e8b69d | ||
|
|
d80d27a10c | ||
|
|
38b8c9536d | ||
|
|
c7428f2d55 | ||
|
|
d7060f3256 | ||
|
|
50f43d955a | ||
|
|
d1cabf3a4d | ||
|
|
c57a6048cf | ||
|
|
dda2debf36 | ||
|
|
863e72a256 | ||
|
|
8d435bc1b1 | ||
|
|
22b28f8cd4 | ||
|
|
c37b23eca9 | ||
|
|
b9f2035b7c | ||
|
|
f01f8b4fca | ||
|
|
5c840fe9ba | ||
|
|
86b8dd966e | ||
|
|
b53cd1cb2b | ||
|
|
65da42e1f3 | ||
|
|
2359ca8838 | ||
|
|
8e574ba33d | ||
|
|
e1e9858876 | ||
|
|
3b521eb57f | ||
|
|
66a4b3b68b | ||
|
|
ee260724ae | ||
|
|
645b7c2e7c | ||
|
|
953d057876 | ||
|
|
1d33eec01f | ||
|
|
114d20d97a | ||
|
|
257a9c73d1 | ||
|
|
01e8fa5407 | ||
|
|
fc3a12c7aa | ||
|
|
a454a7dafe | ||
|
|
c742712f6f | ||
|
|
110cb80e82 | ||
|
|
efdbb3e6c7 | ||
|
|
86c3ef089c | ||
|
|
bbf3cfd9bd | ||
|
|
1bb7296d53 | ||
|
|
b3dc796d73 | ||
|
|
a513680769 | ||
|
|
7b04f14c2a | ||
|
|
ded3c79d50 | ||
|
|
2795a051eb | ||
|
|
35c6f57a89 | ||
|
|
f7d554fea5 | ||
|
|
8f3cae7792 | ||
|
|
ae342db18d | ||
|
|
32638ce7d4 | ||
|
|
c2d25d7a28 | ||
|
|
90743d5b78 | ||
|
|
07d70e6321 | ||
|
|
57cf0d4836 | ||
|
|
9e1e8e576c | ||
|
|
07aae3b04a | ||
|
|
beee2bd39a | ||
|
|
850ee61614 | ||
|
|
ce4931ca06 | ||
|
|
070c5362c3 | ||
|
|
88f5eafb45 | ||
|
|
954f3fdef5 | ||
|
|
98edc7cc1b | ||
|
|
3a056a21ae | ||
|
|
82cef67c71 | ||
|
|
8bc23853fc | ||
|
|
92f64c4645 | ||
|
|
b4637a808b | ||
|
|
9cc5865a0d | ||
|
|
be3f728e3a | ||
|
|
b0c924f9c7 | ||
|
|
aa7bbfc26f | ||
|
|
5415fa3576 | ||
|
|
cf7d241b51 | ||
|
|
ab6c28166e | ||
|
|
d6d19ad3cf | ||
|
|
07ac11c6ab | ||
|
|
b09b1cf0e0 | ||
|
|
5244a15e70 | ||
|
|
4f43a92380 | ||
|
|
96399541b6 | ||
|
|
bd44c40fdf | ||
|
|
f7c386f480 | ||
|
|
06d322e6cf | ||
|
|
7228dacb91 | ||
|
|
1234027472 | ||
|
|
7004064567 | ||
|
|
c47f788094 | ||
|
|
c97efce5f6 | ||
|
|
87e4045a75 | ||
|
|
dbe84e64b9 | ||
|
|
902b0df117 | ||
|
|
7ded999868 | ||
|
|
5014eceaad | ||
|
|
db5258ea45 | ||
|
|
815c48bfcc | ||
|
|
d162be7e4a | ||
|
|
fda267bd77 | ||
|
|
4065ee315a | ||
|
|
41cb7231f1 | ||
|
|
596a23670f |
@ -211,6 +211,197 @@
|
|||||||
"contributions": [
|
"contributions": [
|
||||||
"code"
|
"code"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "Solant",
|
||||||
|
"name": "Solant",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/5971578?v=4",
|
||||||
|
"profile": "https://github.com/Solant",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "shubhamzanwar",
|
||||||
|
"name": "Shubham Zanwar",
|
||||||
|
"avatar_url": "https://avatars0.githubusercontent.com/u/15626155?v=4",
|
||||||
|
"profile": "https://github.com/shubhamzanwar",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "Singha360",
|
||||||
|
"name": "Singha360",
|
||||||
|
"avatar_url": "https://avatars1.githubusercontent.com/u/35334787?v=4",
|
||||||
|
"profile": "https://github.com/Singha360",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "MihkelBaranov",
|
||||||
|
"name": "Mihkel",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/3790782?v=4",
|
||||||
|
"profile": "http://wellenline.com",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "stevo2588",
|
||||||
|
"name": "Stephen A",
|
||||||
|
"avatar_url": "https://avatars1.githubusercontent.com/u/3278045?v=4",
|
||||||
|
"profile": "https://github.com/stevo2588",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "jardenliu",
|
||||||
|
"name": "流君酱",
|
||||||
|
"avatar_url": "https://avatars1.githubusercontent.com/u/15191056?v=4",
|
||||||
|
"profile": "http://liujunjiang.com",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "agg23",
|
||||||
|
"name": "Adam Gastineau",
|
||||||
|
"avatar_url": "https://avatars1.githubusercontent.com/u/238679?v=4",
|
||||||
|
"profile": "https://github.com/agg23",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "swittk",
|
||||||
|
"name": "swittk",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/5000572?v=4",
|
||||||
|
"profile": "https://github.com/swittk",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "craftingmod",
|
||||||
|
"name": "craftingmod",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/9389278?v=4",
|
||||||
|
"profile": "https://github.com/craftingmod",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "dooglio",
|
||||||
|
"name": "Doug Barbieri",
|
||||||
|
"avatar_url": "https://avatars1.githubusercontent.com/u/643129?v=4",
|
||||||
|
"profile": "http://www.m2osw.com",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "NeryHenrique",
|
||||||
|
"name": "HENRIQUE DE SOUZA NERY",
|
||||||
|
"avatar_url": "https://avatars0.githubusercontent.com/u/6879141?v=4",
|
||||||
|
"profile": "https://github.com/NeryHenrique",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "ruslang02",
|
||||||
|
"name": "Ruslan Garifullin",
|
||||||
|
"avatar_url": "https://avatars0.githubusercontent.com/u/25264730?v=4",
|
||||||
|
"profile": "https://ruslang.xyz",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "ran-j",
|
||||||
|
"name": "Ranieri",
|
||||||
|
"avatar_url": "https://avatars0.githubusercontent.com/u/17410205?v=4",
|
||||||
|
"profile": "https://github.com/ran-j",
|
||||||
|
"contributions": [
|
||||||
|
"code",
|
||||||
|
"doc"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "NathanaelA",
|
||||||
|
"name": "Nathanael Anderson",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/850871?v=4",
|
||||||
|
"profile": "https://master-technology.com",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "rocbear",
|
||||||
|
"name": "Ross",
|
||||||
|
"avatar_url": "https://avatars0.githubusercontent.com/u/4415071?v=4",
|
||||||
|
"profile": "https://ubiq.co.za",
|
||||||
|
"contributions": [
|
||||||
|
"code",
|
||||||
|
"doc"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "4h7l",
|
||||||
|
"name": "4h7l",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/69183283?v=4",
|
||||||
|
"profile": "https://github.com/4h7l",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "Maks-s",
|
||||||
|
"name": "Maks",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/26678512?v=4",
|
||||||
|
"profile": "https://github.com/Maks-s",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "zhb124404",
|
||||||
|
"name": "zhb124404",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/16805041?v=4",
|
||||||
|
"profile": "https://github.com/zhb124404",
|
||||||
|
"contributions": [
|
||||||
|
"doc"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "wkirby",
|
||||||
|
"name": "Wyatt Kirby",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/579688?v=4",
|
||||||
|
"profile": "http://www.apsis.io",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "stvkoch",
|
||||||
|
"name": "Steven Koch",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/14454?v=4",
|
||||||
|
"profile": "https://stvkoch.github.io.",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "sedwards2009",
|
||||||
|
"name": "Simon Edwards",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/6926644?v=4",
|
||||||
|
"profile": "https://github.com/sedwards2009",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"contributorsPerLine": 7,
|
"contributorsPerLine": 7,
|
||||||
|
|||||||
@ -12,7 +12,6 @@ module.exports = {
|
|||||||
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
|
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
|
||||||
extends: [
|
extends: [
|
||||||
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
|
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
|
||||||
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
|
|
||||||
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
|
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
|
||||||
],
|
],
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
@ -23,6 +22,7 @@ module.exports = {
|
|||||||
'@typescript-eslint/camelcase': 0,
|
'@typescript-eslint/camelcase': 0,
|
||||||
'@typescript-eslint/no-var-requires': 0,
|
'@typescript-eslint/no-var-requires': 0,
|
||||||
'@typescript-eslint/no-explicit-any': 0,
|
'@typescript-eslint/no-explicit-any': 0,
|
||||||
|
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
9
.github/FUNDING.yml
vendored
9
.github/FUNDING.yml
vendored
@ -1,9 +0,0 @@
|
|||||||
# These are supported funding model platforms
|
|
||||||
|
|
||||||
github: [master-atul] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
|
||||||
patreon: # Replace with a single Patreon username
|
|
||||||
open_collective: # Replace with a single Open Collective username
|
|
||||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
|
||||||
issuehunt: nodegui/nodegui
|
|
||||||
ko_fi: atul94 # Replace with a single Ko-fi username
|
|
||||||
custom: # Replace with a single custom sponsorship URL
|
|
||||||
46
.github/workflows/docs.yml
vendored
Normal file
46
.github/workflows/docs.yml
vendored
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
name: documentation
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
gh-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '16.x'
|
||||||
|
- name: Add key to allow access to repository
|
||||||
|
env:
|
||||||
|
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
ssh-keyscan github.com >> ~/.ssh/known_hosts
|
||||||
|
echo "${{ secrets.GH_PAGES_DEPLOY }}" > ~/.ssh/id_rsa
|
||||||
|
chmod 600 ~/.ssh/id_rsa
|
||||||
|
cat <<EOT >> ~/.ssh/config
|
||||||
|
Host github.com
|
||||||
|
HostName github.com
|
||||||
|
IdentityFile ~/.ssh/id_rsa
|
||||||
|
EOT
|
||||||
|
- name: Release to GitHub Pages
|
||||||
|
env:
|
||||||
|
USE_SSH: true
|
||||||
|
GIT_USER: git
|
||||||
|
run: |
|
||||||
|
git config --global user.email "actions@gihub.com"
|
||||||
|
git config --global user.name "gh-actions"
|
||||||
|
yarn install --ignore-scripts
|
||||||
|
npm run docs
|
||||||
|
cd website
|
||||||
|
if [ -e yarn.lock ]; then
|
||||||
|
yarn install --frozen-lockfile
|
||||||
|
elif [ -e package-lock.json ]; then
|
||||||
|
npm ci
|
||||||
|
else
|
||||||
|
npm i
|
||||||
|
fi
|
||||||
|
yarn deploy
|
||||||
15
.github/workflows/latest.yml
vendored
15
.github/workflows/latest.yml
vendored
@ -7,17 +7,20 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-18.04]
|
os: [ubuntu-20.04]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@master
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '13.x'
|
node-version: '16.x'
|
||||||
|
- name: Install ubuntu deps
|
||||||
|
if: contains(matrix.os, 'ubuntu-20.04')
|
||||||
|
run: sudo apt install mesa-common-dev libglu1-mesa-dev libegl1 libopengl-dev
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: npm install --ignore-scripts
|
run: npm install
|
||||||
- name: Build nodegui
|
- name: Build nodegui
|
||||||
run: npx tsc
|
run: npm run build
|
||||||
- name: Archive using npm pack
|
- name: Archive using npm pack
|
||||||
run: npm --no-git-tag-version version 0.0.0-latest-master && npm pack
|
run: npm --no-git-tag-version version 0.0.0-latest-master && npm pack
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
|
|||||||
35
.github/workflows/prebuild.yml
vendored
35
.github/workflows/prebuild.yml
vendored
@ -1,35 +0,0 @@
|
|||||||
on:
|
|
||||||
repository_dispatch:
|
|
||||||
types: [on-demand-build]
|
|
||||||
release:
|
|
||||||
types: [published, created, prereleased]
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-18.04, windows-latest, macos-latest]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
ref: ${{ github.ref }}
|
|
||||||
- uses: actions/setup-node@master
|
|
||||||
with:
|
|
||||||
node-version: '13.x'
|
|
||||||
- name: Install deps
|
|
||||||
run: npm install
|
|
||||||
env:
|
|
||||||
SKIP_BUILD: 1
|
|
||||||
- name: Change version if master
|
|
||||||
if: contains(github.event.client_payload.tag, '0.0.0-latest-master')
|
|
||||||
run: npm --no-git-tag-version version 0.0.0-latest-master
|
|
||||||
- name: Prebuild binary
|
|
||||||
run: npx prebuild --all --backend=cmake-js --strip --runtime=napi --include-regex="\.[n,e,l][a-z]*$"
|
|
||||||
- name: Release
|
|
||||||
uses: softprops/action-gh-release@master
|
|
||||||
with:
|
|
||||||
files: prebuilds/@nodegui/*.tar.gz
|
|
||||||
tag_name: ${{ github.event.release.tag_name || github.event.client_payload.tag }}
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
97
.github/workflows/release.yml
vendored
Normal file
97
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
name: Build and Deploy to npm
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
precompile:
|
||||||
|
if: contains(github.event.release.tag_name, 'v0.0.0-latest-master') == false
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
platform: linux
|
||||||
|
arch: x64
|
||||||
|
- os: windows-latest
|
||||||
|
platform: win32
|
||||||
|
arch: x64
|
||||||
|
- os: macos-latest
|
||||||
|
platform: darwin
|
||||||
|
arch: x64
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
env:
|
||||||
|
ARCHIVE_FILENAME: nodegui-binary-${{github.event.release.tag_name}}-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '16.x'
|
||||||
|
|
||||||
|
- name: Install ubuntu deps
|
||||||
|
if: contains(matrix.os, 'ubuntu-20.04')
|
||||||
|
run: sudo apt install mesa-common-dev libglu1-mesa-dev libegl1 libopengl-dev
|
||||||
|
|
||||||
|
- name: Install deps
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Build nodegui
|
||||||
|
run: npm run build
|
||||||
|
env:
|
||||||
|
CMAKE_BUILD_PARALLEL_LEVEL: 8
|
||||||
|
|
||||||
|
- name: Compress files
|
||||||
|
if: ${{!contains(matrix.os, 'windows-latest')}}
|
||||||
|
uses: a7ul/tar-action@v1.0.2
|
||||||
|
id: compress
|
||||||
|
with:
|
||||||
|
command: c
|
||||||
|
cwd: ./build/Release
|
||||||
|
files: |
|
||||||
|
./nodegui_core.node
|
||||||
|
outPath: ${{ env.ARCHIVE_FILENAME }}
|
||||||
|
|
||||||
|
- name: Compress files (Windows)
|
||||||
|
if: contains(matrix.os, 'windows-latest')
|
||||||
|
uses: a7ul/tar-action@v1.0.2
|
||||||
|
id: compress-windows
|
||||||
|
with:
|
||||||
|
command: c
|
||||||
|
cwd: ./build/Release
|
||||||
|
files: |
|
||||||
|
./nodegui_core.node
|
||||||
|
./nodegui_core.lib
|
||||||
|
./nodegui_core.exp
|
||||||
|
outPath: ${{ env.ARCHIVE_FILENAME }}
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: ${{ env.ARCHIVE_FILENAME }}
|
||||||
|
path: ${{ env.ARCHIVE_FILENAME }}
|
||||||
|
|
||||||
|
- name: Upload release binaries
|
||||||
|
uses: alexellis/upload-assets@0.2.2
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
with:
|
||||||
|
asset_paths: '["${{ env.ARCHIVE_FILENAME }}"]'
|
||||||
|
|
||||||
|
publish-npm-package:
|
||||||
|
needs: precompile
|
||||||
|
if: contains(github.event.release.tag_name, 'v0.0.0-latest-master') == false
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '16.x'
|
||||||
|
- name: Install ubuntu deps
|
||||||
|
run: sudo apt update
|
||||||
|
- run: sudo apt install mesa-common-dev libglu1-mesa-dev
|
||||||
|
- run: npm install
|
||||||
|
- run: echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
|
||||||
|
- run: npm publish --access=public
|
||||||
|
env:
|
||||||
|
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||||
|
CMAKE_BUILD_PARALLEL_LEVEL: 8
|
||||||
13
.github/workflows/test.yml
vendored
13
.github/workflows/test.yml
vendored
@ -6,17 +6,22 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-18.04, windows-latest, macos-latest]
|
os: [ubuntu-20.04, windows-latest, macos-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@master
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '13.x'
|
node-version: '16.x'
|
||||||
|
- name: Install ubuntu deps
|
||||||
|
if: contains(matrix.os, 'ubuntu-20.04')
|
||||||
|
run: sudo apt install mesa-common-dev libglu1-mesa-dev libegl1 libopengl-dev
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: npm install
|
run: npm install
|
||||||
- name: Build nodegui
|
- name: Build nodegui
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
env:
|
||||||
|
CMAKE_BUILD_PARALLEL_LEVEL: 8
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm run test
|
run: npm run test
|
||||||
- name: Run linters for cpp
|
- name: Run linters for cpp
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -8,3 +8,5 @@ coverage
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
/.idea/
|
/.idea/
|
||||||
/prebuilds
|
/prebuilds
|
||||||
|
miniqt
|
||||||
|
cmake-build-debug
|
||||||
|
|||||||
@ -8,3 +8,4 @@ extras/*
|
|||||||
src/*
|
src/*
|
||||||
!src/cpp
|
!src/cpp
|
||||||
prebuilds/*
|
prebuilds/*
|
||||||
|
miniqt/
|
||||||
119
CMakeLists.txt
119
CMakeLists.txt
@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.1)
|
|||||||
include(./config/common.cmake)
|
include(./config/common.cmake)
|
||||||
include(./config/qt.cmake)
|
include(./config/qt.cmake)
|
||||||
include(./config/napi.cmake)
|
include(./config/napi.cmake)
|
||||||
|
include(./config/qode.cmake)
|
||||||
|
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
|
|
||||||
@ -10,11 +11,16 @@ set(CORE_WIDGETS_ADDON "nodegui_core")
|
|||||||
|
|
||||||
project(${CORE_WIDGETS_ADDON})
|
project(${CORE_WIDGETS_ADDON})
|
||||||
|
|
||||||
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
|
||||||
|
|
||||||
|
# Note: CMake+moc also use this list when finding files which `moc` applied.
|
||||||
|
|
||||||
add_library(${CORE_WIDGETS_ADDON} SHARED
|
add_library(${CORE_WIDGETS_ADDON} SHARED
|
||||||
"${CMAKE_JS_SRC}"
|
"${CMAKE_JS_SRC}"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/main.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/main.cpp"
|
||||||
# core internals
|
# core internals
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/Extras/Utils/nutils.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/Extras/Utils/nutils.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/Integration/integration.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/FlexLayout/flexutils.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/FlexLayout/flexutils.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/FlexLayout/flexlayout.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/FlexLayout/flexlayout.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/FlexLayout/flexitem.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/FlexLayout/flexitem.cpp"
|
||||||
@ -22,6 +28,8 @@ add_library(${CORE_WIDGETS_ADDON} SHARED
|
|||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/Events/eventsmap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/Events/eventsmap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/Events/eventwidget.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/Events/eventwidget.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/YogaWidget/yogawidget.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/YogaWidget/yogawidget.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/core/WrapperCache/wrappercache.h"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/WrapperCache/wrappercache.cpp"
|
||||||
# core deps
|
# core deps
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/deps/yoga/log.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/deps/yoga/log.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/deps/yoga/Utils.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/deps/yoga/Utils.cpp"
|
||||||
@ -36,58 +44,102 @@ add_library(${CORE_WIDGETS_ADDON} SHARED
|
|||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/deps/yoga/event/event.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/deps/yoga/event/event.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/deps/yoga/internal/experiments.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/deps/yoga/internal/experiments.cpp"
|
||||||
# wrapped cpps
|
# wrapped cpps
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QBrush/qbrush_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QPen/qpen_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QColor/qcolor_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QColor/qcolor_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QApplication/qapplication_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QApplication/qapplication_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QClipboard/qclipboard_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QClipboard/qclipboard_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QDrag/qdrag_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QMouseEvent/qmouseevent_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QMouseEvent/qmouseevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QMoveEvent/qmoveevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QWheelEvent/qwheelevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QNativeGestureEvent/qnativegestureevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QPaintEvent/qpaintevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QTabletEvent/qtabletevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QTimerEvent/qtimerevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QDropEvent/qdropevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QDragMoveEvent/qdragmoveevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QDragLeaveEvent/qdragleaveevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QResizeEvent/qresizeevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QInputMethodEvent/qinputmethodevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QInputMethodQueryEvent/qinputmethodqueryevent_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QFontDatabase/qfontdatabase_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QFontDatabase/qfontdatabase_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QFontMetrics/qfontmetrics_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QFontMetricsF/qfontmetricsf_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QPicture/qpicture_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QPixmap/qpixmap_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QPixmap/qpixmap_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QIcon/qicon_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QIcon/qicon_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QImage/qimage_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QFont/qfont_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QFont/qfont_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QCursor/qcursor_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QCursor/qcursor_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QKeySequence/qkeysequence_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QKeySequence/qkeysequence_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QMovie/qmovie_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QMovie/qmovie_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QPalette/qpalette_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QScreen/qscreen_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QStyle/qstyle_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QStyle/qstyle_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QWindow/qwindow_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QAbstractItemModel/qabstractitemmodel_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QDate/qdate_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QDate/qdate_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QDateTime/qdatetime_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QDateTime/qdatetime_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QItemSelectionModel/qitemselectionmodel_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QModelIndex/qmodelindex_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QModelIndex/qmodelindex_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QObject/qobject_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QObject/qobject_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QVariant/qvariant_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QVariant/qvariant_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QSize/qsize_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QSize/qsize_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QSizeF/qsizef_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QSettings/qsettings_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QRect/qrect_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QRect/qrect_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QRectF/qrectf_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QPoint/qpoint_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QPoint/qpoint_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QPointF/qpointf_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QTime/qtime_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QTime/qtime_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QUrl/qurl_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QUrl/qurl_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QMimeData/qmimedata_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QWidget/qwidget_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QWidget/qwidget_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QDialog/qdialog_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QDialog/qdialog_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QBoxLayout/qboxlayout_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QBoxLayout/qboxlayout_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QCalendarWidget/qcalendarwidget_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QCalendarWidget/qcalendarwidget_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QColorDialog/qcolordialog_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QComboBox/qcombobox_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QComboBox/qcombobox_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QDateEdit/qdateedit_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QDateEdit/qdateedit_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QDateTimeEdit/qdatetimeedit_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QDateTimeEdit/qdatetimeedit_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QDoubleSpinBox/qdoublespinbox_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QErrorMessage/qerrormessage_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QFileDialog/qfiledialog_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QFileDialog/qfiledialog_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QFontDialog/qfontdialog_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QFrame/qframe_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QGraphicsBlurEffect/qgraphicsblureffect_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QGraphicsDropShadowEffect/qgraphicsdropshadoweffect_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QHeaderView/qheaderview_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QListView/qlistview_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QListWidget/qlistwidget_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QListWidget/qlistwidget_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QListWidgetItem/qlistwidgetitem_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QListWidgetItem/qlistwidgetitem_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QTableView/qtableview_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QTableWidget/qtablewidget_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QTableWidget/qtablewidget_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QTableWidgetItem/qtablewidgetitem_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QTableWidgetItem/qtablewidgetitem_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QPainter/qpainter_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QPainter/qpainter_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QPainterPath/qpainterpath_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QGridLayout/qgridlayout_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QGridLayout/qgridlayout_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QDial/qdial_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QDial/qdial_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QLabel/qlabel_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QLabel/qlabel_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QLayout/qlayout_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QLayout/qlayout_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QLCDNumber/qlcdnumber_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QMainWindow/qmainwindow_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QMainWindow/qmainwindow_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QPushButton/qpushbutton_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QPushButton/qpushbutton_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QToolButton/qtoolbutton_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QToolButton/qtoolbutton_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QSpinBox/qspinbox_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QSpinBox/qspinbox_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QCheckBox/qcheckbox_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QCheckBox/qcheckbox_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QProgressBar/qprogressbar_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QProgressBar/qprogressbar_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QProgressDialog/qprogressdialog_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QRadioButton/qradiobutton_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QRadioButton/qradiobutton_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QStackedWidget/qstackedwidget_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QStackedWidget/qstackedwidget_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QTabBar/qtabbar_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QTabWidget/qtabwidget_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QTabWidget/qtabwidget_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QLineEdit/qlineedit_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QLineEdit/qlineedit_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QPlainTextEdit/qplaintextedit_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QPlainTextEdit/qplaintextedit_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QScrollArea/qscrollarea_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QScrollArea/qscrollarea_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QScrollBar/qscrollbar_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QSystemTrayIcon/qsystemtrayicon_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QSystemTrayIcon/qsystemtrayicon_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QAction/qaction_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QAction/qaction_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QShortcut/qshortcut_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QShortcut/qshortcut_wrap.cpp"
|
||||||
@ -103,24 +155,47 @@ add_library(${CORE_WIDGETS_ADDON} SHARED
|
|||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QButtonGroup/qbuttongroup_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QButtonGroup/qbuttongroup_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QStatusBar/qstatusbar_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QStatusBar/qstatusbar_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/FlexLayout/flexlayout_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/FlexLayout/flexlayout_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QTextBrowser/qtextbrowser_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QTextEdit/qtextedit_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QStandardItemModel/qstandarditemmodel_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QStandardItem/qstandarditem_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QSvgWidget/qsvgwidget_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QStyleFactory/qstylefactory_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QSplitter/qsplitter_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QAbstractItemDelegate/qabstractitemdelegate_wrap.cpp"
|
||||||
# Custom widgets (include them for automoc since they contain Q_OBJECT)
|
# Custom widgets (include them for automoc since they contain Q_OBJECT)
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtCore/QAbstractItemModel/nabstractitemmodel.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtCore/QItemSelectionModel/nitemselectionmodel.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtCore/QObject/nobject.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtCore/QObject/nobject.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/core/FlexLayout/flexlayout.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/core/FlexLayout/flexlayout.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtGui/QMovie/nmovie.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtGui/QMovie/nmovie.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtGui/QApplication/napplication.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtGui/QDrag/ndrag.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QWidget/nwidget.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QWidget/nwidget.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QDialog/ndialog.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QDialog/ndialog.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QLabel/nlabel.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QLabel/nlabel.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QCalendarWidget/ncalendarwidget.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QCalendarWidget/ncalendarwidget.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QCheckBox/ncheckbox.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QCheckBox/ncheckbox.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QColorDialog/ncolordialog.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QDateEdit/ndateedit.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QDateEdit/ndateedit.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QDateTimeEdit/ndatetimeedit.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QDateTimeEdit/ndatetimeedit.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QDial/ndial.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QDial/ndial.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QDoubleSpinBox/ndoublespinbox.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QErrorMessage/nerrormessage.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QFileDialog/nfiledialog.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QFileDialog/nfiledialog.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QFontDialog/nfontdialog.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QFrame/nframe.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QGraphicsBlurEffect/ngraphicsblureffect.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QGraphicsDropShadowEffect/ngraphicsdropshadoweffect.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QLCDNumber/nlcdnumber.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QListView/nlistview.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QListWidget/nlistwidget.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QListWidget/nlistwidget.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QTableView/ntableview.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QTableWidget/ntablewidget.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QTableWidget/ntablewidget.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QLineEdit/nlineedit.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QLineEdit/nlineedit.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QMainWindow/nmainwindow.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QMainWindow/nmainwindow.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QProgressBar/nprogressbar.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QProgressBar/nprogressbar.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QProgressDialog/nprogressdialog.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QPushButton/npushbutton.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QPushButton/npushbutton.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QMessageBox/nmessagebox.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QMessageBox/nmessagebox.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QInputDialog/ninputdialog.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QInputDialog/ninputdialog.hpp"
|
||||||
@ -129,7 +204,9 @@ add_library(${CORE_WIDGETS_ADDON} SHARED
|
|||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QRadioButton/nradiobutton.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QRadioButton/nradiobutton.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QPlainTextEdit/nplaintextedit.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QPlainTextEdit/nplaintextedit.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QScrollArea/nscrollarea.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QScrollArea/nscrollarea.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QScrollBar/nscrollbar.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QStackedWidget/nstackedwidget.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QStackedWidget/nstackedwidget.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QTabBar/ntabbar.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QTabWidget/ntabwidget.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QTabWidget/ntabwidget.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QSystemTrayIcon/nsystemtrayicon.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QSystemTrayIcon/nsystemtrayicon.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QAction/naction.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QAction/naction.hpp"
|
||||||
@ -146,12 +223,23 @@ add_library(${CORE_WIDGETS_ADDON} SHARED
|
|||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QTreeWidget/ntreewidget.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QTreeWidget/ntreewidget.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QButtonGroup/nbuttongroup.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QButtonGroup/nbuttongroup.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QStatusBar/nstatusbar.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QStatusBar/nstatusbar.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QStandardItemModel/nstandarditemmodel.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QTextBrowser/ntextbrowser.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QTextEdit/ntextedit.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QSvgWidget/nsvgwidget.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QHeaderView/nheaderview.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QSplitter/nsplitter.hpp"
|
||||||
|
|
||||||
|
# Test
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/test/CacheTestQObject.h"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/test/CacheTestQObject.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/test/cachetestqobject_wrap.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
AddCommonConfig(${CORE_WIDGETS_ADDON})
|
AddCommonConfig(${CORE_WIDGETS_ADDON})
|
||||||
AddQtSupport(${CORE_WIDGETS_ADDON})
|
AddQtSupport(${CORE_WIDGETS_ADDON})
|
||||||
AddNapiSupport(${CORE_WIDGETS_ADDON})
|
AddNapiSupport(${CORE_WIDGETS_ADDON})
|
||||||
|
AddQodeSupport(${CORE_WIDGETS_ADDON})
|
||||||
|
|
||||||
target_include_directories(${CORE_WIDGETS_ADDON} PRIVATE
|
target_include_directories(${CORE_WIDGETS_ADDON} PRIVATE
|
||||||
"${CMAKE_JS_INC}"
|
"${CMAKE_JS_INC}"
|
||||||
@ -162,15 +250,34 @@ target_include_directories(${CORE_WIDGETS_ADDON} PRIVATE
|
|||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(${CORE_WIDGETS_ADDON} PRIVATE
|
|
||||||
"${CMAKE_JS_LIB}"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
add_definitions(/bigobj)
|
||||||
target_compile_definitions(${CORE_WIDGETS_ADDON} PRIVATE
|
target_compile_definitions(${CORE_WIDGETS_ADDON} PRIVATE
|
||||||
ENABLE_DLL_EXPORT=1
|
ENABLE_DLL_EXPORT=1
|
||||||
)
|
)
|
||||||
target_compile_options(${CORE_WIDGETS_ADDON} PRIVATE "/MP4")
|
target_compile_options(${CORE_WIDGETS_ADDON} PRIVATE "/MP")
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (UNIX AND NOT APPLE)
|
||||||
|
# Set the RPATH in the binary to a relative one to allow it to find our Qt
|
||||||
|
# libraries regardless of where the base installation directory is.
|
||||||
|
file(RELATIVE_PATH QT_LIBRARY_REL_PATH "${CMAKE_BINARY_DIR}/Release" "${QT_CMAKE_HOME_DIR}/../..")
|
||||||
|
set_target_properties(${CORE_WIDGETS_ADDON} PROPERTIES INSTALL_RPATH "\$ORIGIN/${QT_LIBRARY_REL_PATH}")
|
||||||
|
set_target_properties(${CORE_WIDGETS_ADDON} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
set(CMAKE_MACOSX_RPATH ON)
|
||||||
|
file(RELATIVE_PATH QT_LIBRARY_REL_PATH "${CMAKE_BINARY_DIR}/Release" "${QT_CMAKE_HOME_DIR}/../..")
|
||||||
|
set_target_properties(${CORE_WIDGETS_ADDON} PROPERTIES INSTALL_RPATH "@loader_path/${QT_LIBRARY_REL_PATH}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(${CORE_WIDGETS_ADDON} PRIVATE
|
||||||
|
"${CMAKE_JS_LIB}"
|
||||||
|
Qt6::Widgets
|
||||||
|
Qt6::Core
|
||||||
|
Qt6::Gui
|
||||||
|
Qt6::Svg
|
||||||
|
Qt6::SvgWidgets
|
||||||
|
)
|
||||||
|
|||||||
250
README.md
250
README.md
@ -1,18 +1,21 @@
|
|||||||
# NodeGui
|
# NodeGui
|
||||||
|
|
||||||
[](https://spectrum.chat/nodegui)
|
[](#contributors)
|
||||||
[](#contributors)
|
|
||||||
[](https://changelog.com/jsparty/96)
|
[](https://changelog.com/jsparty/96)
|
||||||
|
|
||||||
[](https://github.com/nodegui/nodegui/actions)
|
[](https://github.com/nodegui/nodegui/actions)
|
||||||
|
[](https://github.com/nodegui/nodegui/discussions)
|
||||||
|
|
||||||
Build **performant**, **native** and **cross-platform** desktop applications with **Node.js** and **CSS like styling**.🚀
|
Build **performant**, **native** and **cross-platform** desktop applications with **Node.js** and **CSS like styling**.🚀
|
||||||
|
|
||||||
NodeGUI is powered by **Qt5** 💚 which makes it CPU and memory efficient as compared to other chromium based solutions like electron.
|
NodeGUI is powered by **Qt6** 💚 which makes it CPU and memory efficient as compared to other chromium based solutions like Electron.
|
||||||
|
|
||||||
If you are looking for **React** based version, check out: **[React NodeGUI](https://github.com/nodegui/react-nodegui)**.
|
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/React-icon.svg/1024px-React-icon.svg.png" alt="" width="25"> If you are looking for **React** based version, check out: **[React NodeGUI](https://github.com/nodegui/react-nodegui)**.
|
||||||
|
|
||||||
Visit: https://nodegui.github.io/nodegui for docs.
|
<img src="https://vuejs.org/images/logo.png" alt="" width="25" /> If you are looking for **Vue** based version, check out: **[Vue NodeGUI](https://github.com/nodegui/vue-nodegui)**.
|
||||||
|
|
||||||
|
<img src="https://github.com/sveltejs/branding/raw/master/svelte-logo.png" alt="" width="25" /> If you are looking for **Svelte** based version, check out: **[Svelte NodeGUI](https://github.com/nodegui/svelte-nodegui)**
|
||||||
|
|
||||||
|
Visit https://nodegui.github.io/nodegui for docs.
|
||||||
|
|
||||||
<img alt="logo" src="https://github.com/nodegui/nodegui/raw/master/extras/logo/nodegui.png" height="200" />
|
<img alt="logo" src="https://github.com/nodegui/nodegui/raw/master/extras/logo/nodegui.png" height="200" />
|
||||||
|
|
||||||
@ -27,9 +30,7 @@ Visit: https://nodegui.github.io/nodegui for docs.
|
|||||||
<div style="display:inline; margin: 0 auto;"><img alt="kitchen" src="https://github.com/nodegui/nodegui/raw/master/extras/assets/kitchen.png" height="280" /><img alt="demo_mac" src="https://github.com/nodegui/examples/raw/master/react-nodegui/weather-app-widget/weather_widget_mac.png" height="280" /><img alt="demo_win" src="https://github.com/nodegui/examples/raw/master/react-nodegui/image-view/image_view_win.jpg" height="280" />
|
<div style="display:inline; margin: 0 auto;"><img alt="kitchen" src="https://github.com/nodegui/nodegui/raw/master/extras/assets/kitchen.png" height="280" /><img alt="demo_mac" src="https://github.com/nodegui/examples/raw/master/react-nodegui/weather-app-widget/weather_widget_mac.png" height="280" /><img alt="demo_win" src="https://github.com/nodegui/examples/raw/master/react-nodegui/image-view/image_view_win.jpg" height="280" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
**More screenshots?**
|
### Code Examples
|
||||||
|
|
||||||
### More Examples:
|
|
||||||
|
|
||||||
https://github.com/nodegui/examples
|
https://github.com/nodegui/examples
|
||||||
|
|
||||||
@ -37,33 +38,35 @@ https://github.com/nodegui/examples
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- 🧬 Cross platform. Should work on major Linux flavours, Windows and MacOS.
|
- 🧬 **Cross platform.** Works on major Linux flavours, Windows, and MacOS.
|
||||||
- 📉 Low CPU and memory footprint. Current CPU stays at 0% on idle and memory usage is under 20mb for a hello world program.
|
- 📉 **Low CPU and memory** footprint. Current CPU stays at 0% on idle and memory usage is under 20MB for a Hello World program.
|
||||||
- 💅 Styling with CSS (includes actual cascading). Also has full support for Flexbox layout (thanks to Yoga).
|
- 💅 **Styling with CSS** (includes actual cascading). Also has full support for Flexbox layout (thanks to Yoga).
|
||||||
- ✅ Complete Nodejs api support (Currently runs on Node v12.x - and is easily upgradable). Hence has access to all nodejs compatible npm modules.
|
- ✅ **Complete Nodejs API support** (Currently runs on Node v16.x - and is easily upgradable). Hence has access to all Nodejs compatible NPM modules.
|
||||||
- 🎪 Native widget event listener support. Supports all events available from Qt / NodeJs.
|
- 🎪 **Native widget event listener support.** Supports all events available from Qt / NodeJs.
|
||||||
- 💸 Can be used for Commercial applications.
|
- 💸 **Can be used for Commercial applications.**
|
||||||
- 🕵️♂️ Good Devtools support.
|
- 🕵️♂️ **Good Devtools support.**
|
||||||
- 📚 Good documentation and website.
|
- 📚 **Good documentation and website.**
|
||||||
- 🧙♂️ Good documentation for contributors.
|
- 🧙♂️ **Good documentation for contributors.**
|
||||||
- 🦹🏻♀️ Good support for dark mode (Thanks to QT).
|
- 🦹🏻♀️ **Good support for dark mode (Thanks to Qt).**
|
||||||
- 🏅First class Typescript support. (Works on regular JS projects too 😉).
|
- 🏅**First class Typescript support.** (Works on regular JS projects too 😉).
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
- Check out [nodegui-starter](https://github.com/nodegui/nodegui-starter) to get up and running with your own React NodeGUI app!
|
- Check out [nodegui-starter](https://github.com/nodegui/nodegui-starter) to get up and running with your own React NodeGUI app!
|
||||||
- Read through the [docs](https://nodegui.github.io/nodegui).
|
- Read through the [docs](https://nodegui.github.io/nodegui).
|
||||||
- Checkout the examples: https://github.com/nodegui/examples .
|
- Checkout the examples: https://github.com/nodegui/examples .
|
||||||
|
- [Tutorial: Build a native Meme Search Desktop app with Javascript (NodeGui) and Giphy API](https://www.sitepoint.com/build-native-desktop-gif-searcher-app-using-nodegui/)
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
#### To install latest stable release:
|
To install latest stable release:
|
||||||
|
|
||||||
```
|
```
|
||||||
npm install @nodegui/nodegui
|
npm install @nodegui/nodegui
|
||||||
```
|
```
|
||||||
|
|
||||||
#### To install the latest version available on master branch:
|
To install the latest version available on master branch:
|
||||||
|
|
||||||
```
|
```
|
||||||
npm install https://github.com/nodegui/nodegui/releases/download/v0.0.0-latest-master/nodegui-master.tgz
|
npm install https://github.com/nodegui/nodegui/releases/download/v0.0.0-latest-master/nodegui-master.tgz
|
||||||
@ -75,12 +78,25 @@ or a shorter version:
|
|||||||
npm i http://master-release.nodegui.org
|
npm i http://master-release.nodegui.org
|
||||||
```
|
```
|
||||||
|
|
||||||
**Community guides**
|
If the installation fails to download the Qt binaries, a mirror can be used by setting the following environment variable and running the install command again:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
QT_LINK_MIRROR=<alternative domain> # eg. QT_LINK_MIRROR=https://qt-mirror.dannhauer.de
|
||||||
|
|
||||||
|
npm install @nodegui/nodegui
|
||||||
|
```
|
||||||
|
|
||||||
|
See [FAQs](https://github.com/nodegui/nodegui/tree/master/website/docs/faq.md#why-does-installation-fail-at-minimal-qt-setup) for more details.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Community guides
|
||||||
|
|
||||||
|
- [Tutorial: Build a native Meme Search Desktop app with Javascript (NodeGui) and Giphy API](https://www.sitepoint.com/build-native-desktop-gif-searcher-app-using-nodegui/)
|
||||||
- https://blog.logrocket.com/electron-alternatives-exploring-nodegui-and-react-nodegui/ - Electron alternatives: Exploring NodeGUI and React NodeGUI by [Siegfried Grimbeek](https://blog.logrocket.com/author/siegfriedgrimbeek/).
|
- https://blog.logrocket.com/electron-alternatives-exploring-nodegui-and-react-nodegui/ - Electron alternatives: Exploring NodeGUI and React NodeGUI by [Siegfried Grimbeek](https://blog.logrocket.com/author/siegfriedgrimbeek/).
|
||||||
- https://hibbard.eu/node-gui/ - Excellent guide from [James Hibbard](https://github.com/jameshibbard).
|
- https://hibbard.eu/node-gui/ - Excellent guide from [James Hibbard](https://github.com/jameshibbard).
|
||||||
|
|
||||||
**Talks/Podcasts**
|
## Talks/Podcasts
|
||||||
|
|
||||||
- [NodeGui and React NodeGui at KarmaJS Nov 2019 meetup: https://www.youtube.com/watch?v=8jH5gaEEDv4](https://www.youtube.com/watch?v=8jH5gaEEDv4)
|
- [NodeGui and React NodeGui at KarmaJS Nov 2019 meetup: https://www.youtube.com/watch?v=8jH5gaEEDv4](https://www.youtube.com/watch?v=8jH5gaEEDv4)
|
||||||
|
|
||||||
@ -96,15 +112,116 @@ Looking to contribute? If you wish to implement a new widget/add more features a
|
|||||||
|
|
||||||
Please read https://github.com/nodegui/.github/blob/master/CONTRIBUTING.md
|
Please read https://github.com/nodegui/.github/blob/master/CONTRIBUTING.md
|
||||||
|
|
||||||
## Building
|
|
||||||
|
|
||||||
`npm run build`
|
## Building from source
|
||||||
|
|
||||||
Optionally set `QT_INSTALL_DIR='/path/to/qt'` environment variable to build using your own version of Qt.
|
This section is useful for those wanting to work on NodeGui itself.
|
||||||
|
|
||||||
|
### Required tooling
|
||||||
|
|
||||||
|
NodeGui requires CMake and Compilation Tools as it is a wrapper for a native C++ widget toolkit QT.
|
||||||
|
Detailed instructions here: https://www.sitepoint.com/build-native-desktop-gif-searcher-app-using-nodegui/
|
||||||
|
|
||||||
|
TL;DR:
|
||||||
|
|
||||||
|
**MacOS**
|
||||||
|
|
||||||
|
```
|
||||||
|
brew install cmake
|
||||||
|
brew install make
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
**Windows**
|
||||||
|
|
||||||
|
https://cmake.org/download/
|
||||||
|
|
||||||
|
**Linux (Debian/Ubuntu)**
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo apt-get install pkg-config build-essential
|
||||||
|
sudo apt-get install cmake make
|
||||||
|
sudo apt-get install mesa-common-dev libglu1-mesa-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
**Linux (Fedora/RHEL/CentOS)**
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo dnf groupinstall "Development Tools" "Development Libraries"
|
||||||
|
sudo dnf groupinstall "C Development Tools and Libraries"
|
||||||
|
sudo dnf install mesa-libGL mesa-libGL-devel
|
||||||
|
```
|
||||||
|
|
||||||
|
### Building
|
||||||
|
|
||||||
|
Once you have cloned this git repository, run this to build:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
The last step will takes some time to run as it builds the C++ binaries at the core of NodeGui.
|
||||||
|
|
||||||
|
|
||||||
|
### Using your own custom Qt installation (Optional)
|
||||||
|
|
||||||
|
**Compiling Qt from source**
|
||||||
|
|
||||||
|
You will need to download and install Qt from source since there are no binaries from Qt for M1 yet.
|
||||||
|
|
||||||
|
(https://www.reddit.com/r/QtFramework/comments/ll58wg/how_to_build_qt_creator_for_macos_arm64_a_guide/)
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone git://code.qt.io/qt/qt5.git
|
||||||
|
cd qt5
|
||||||
|
git checkout 5.15
|
||||||
|
|
||||||
|
./init-repository --module-subset=essential -f
|
||||||
|
git submodule init qtsvg
|
||||||
|
git submodule update qtsvg
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
mkdir qt5-5.15-macOS-release
|
||||||
|
cd qt5-5.15-macOS-release
|
||||||
|
|
||||||
|
../qt5/configure -release QMAKE_APPLE_DEVICE_ARCHS=arm64 -opensource -confirm-license -nomake examples -nomake tests -skip qt3d -skip webengine -skip qtactiveqt -skip qtcanvas3d -skip qtdeclarative -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtcharts -skip qtgraphicaleffects -skip qtlocation -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtremoteobjects -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtscript
|
||||||
|
|
||||||
|
make -j15
|
||||||
|
|
||||||
|
make install
|
||||||
|
```
|
||||||
|
|
||||||
|
This should install Qt into something like this `/usr/local/Qt-5.15.3` (your directory can change. This will be displayed when running make)
|
||||||
|
|
||||||
|
**Pointing nodegui to use your custom Qt installation**
|
||||||
|
|
||||||
|
Now just set `export QT_INSTALL_DIR=<your qt path>` . In the above example it would look something like this `export QT_INSTALL_DIR=/usr/local/Qt-5.15.3`. Add this in your .zshrc or .bashrc so that you dont need to repeat this process again.
|
||||||
|
|
||||||
|
Now just `rm -rf node_modules` and do `npm install` again.
|
||||||
|
|
||||||
|
The logs should say something like `CustomQt detected at <your qt path>. Hence, skipping Mini Qt installation`.
|
||||||
|
|
||||||
|
|
||||||
|
### Running example programs
|
||||||
|
|
||||||
|
A number of small programs to show different parts of the Qt API are in `src/examples`. They can be run directly with:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm run qode dist/examples/modelview_1_readonly.js
|
||||||
|
```
|
||||||
|
|
||||||
|
## Updating docs
|
||||||
|
|
||||||
|
`npm run docs`
|
||||||
|
|
||||||
|
then followed by:
|
||||||
|
|
||||||
|
`cd website && GIT_USER=<your_git_username> yarn deploy`
|
||||||
|
|
||||||
## Funding
|
## Funding
|
||||||
|
|
||||||
NodeGUI is an open source project and requires your support. If you like this project, please consider supporting my work by clicking on the Sponsor button on this Github repository or via Ko-Fi.
|
NodeGui is an open source project and requires your support. If you like this project, please consider supporting my work by clicking on the Sponsor button on this Github repository or via Ko-Fi.
|
||||||
Alternatively, Issues on NodeGui can be funded by anyone via Issuehunt and the amount will be distributed to respective contributors.
|
Alternatively, Issues on NodeGui can be funded by anyone via Issuehunt and the amount will be distributed to respective contributors.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@ -146,7 +263,7 @@ People maintaining this project.
|
|||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center"><a href="https://blog.atulr.com"><img src="https://avatars2.githubusercontent.com/u/4029423?v=4" width="100px;" alt="Atul R"/><br /><sub><b>Atul R</b></sub></a></td>
|
<td align="center"><a href="https://blog.atulr.com"><img src="https://avatars2.githubusercontent.com/u/4029423?v=4" width="100px;" alt="Atul R"/><br /><sub><b>Atul R</b></sub></a></td>
|
||||||
<td align="center"><a href="https://github.com/dimitarnestorov"><img src="https://avatars3.githubusercontent.com/u/8790386?s=460&v=4" width="100px;" alt="Dimitar"/><br /><sub><b>Dimitar Nestorov</b></sub></a></td>
|
<td align="center"><a href="https://github.com/sedwards2009"><img src="https://avatars.githubusercontent.com/u/6926644?v=4" width="100px;" alt="Simon Edwards"/><br /><sub><b>Simon Edwards</b></sub></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@ -159,39 +276,66 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|||||||
<!-- markdownlint-disable -->
|
<!-- markdownlint-disable -->
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center"><a href="https://lramage.gitlab.io"><img src="https://avatars1.githubusercontent.com/u/43783393?v=4" width="100px;" alt=""/><br /><sub><b>Lucas Ramage</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=oxr463" title="Documentation">📖</a></td>
|
<td align="center"><a href="https://lramage.gitlab.io"><img src="https://avatars1.githubusercontent.com/u/43783393?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Lucas Ramage</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=oxr463" title="Documentation">📖</a></td>
|
||||||
<td align="center"><a href="https://github.com/gamtiq"><img src="https://avatars3.githubusercontent.com/u/1177323?v=4" width="100px;" alt=""/><br /><sub><b>Denis Sikuler</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=gamtiq" title="Documentation">📖</a></td>
|
<td align="center"><a href="https://github.com/gamtiq"><img src="https://avatars3.githubusercontent.com/u/1177323?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Denis Sikuler</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=gamtiq" title="Documentation">📖</a></td>
|
||||||
<td align="center"><a href="https://twitter.com/nahueljo"><img src="https://avatars1.githubusercontent.com/u/1612488?v=4" width="100px;" alt=""/><br /><sub><b>Nahuel José</b></sub></a><br /><a href="#question-Naahuel" title="Answering Questions">💬</a></td>
|
<td align="center"><a href="https://twitter.com/nahueljo"><img src="https://avatars1.githubusercontent.com/u/1612488?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nahuel José</b></sub></a><br /><a href="#question-Naahuel" title="Answering Questions">💬</a></td>
|
||||||
<td align="center"><a href="https://github.com/kakulgupta"><img src="https://avatars3.githubusercontent.com/u/10727047?v=4" width="100px;" alt=""/><br /><sub><b>Kakul Gupta</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=kakulgupta" title="Code">💻</a></td>
|
<td align="center"><a href="https://github.com/kakulgupta"><img src="https://avatars3.githubusercontent.com/u/10727047?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kakul Gupta</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=kakulgupta" title="Code">💻</a></td>
|
||||||
<td align="center"><a href="http://rahulgaba.com"><img src="https://avatars3.githubusercontent.com/u/7898942?v=4" width="100px;" alt=""/><br /><sub><b>Rahul Gaba</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=rgabs" title="Code">💻</a></td>
|
<td align="center"><a href="http://rahulgaba.com"><img src="https://avatars3.githubusercontent.com/u/7898942?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Rahul Gaba</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=rgabs" title="Code">💻</a></td>
|
||||||
<td align="center"><a href="http://uriziel.pl"><img src="https://avatars1.githubusercontent.com/u/568207?v=4" width="100px;" alt=""/><br /><sub><b>Paweł Borecki</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=Uriziel01" title="Code">💻</a></td>
|
<td align="center"><a href="http://uriziel.pl"><img src="https://avatars1.githubusercontent.com/u/568207?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Paweł Borecki</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=Uriziel01" title="Code">💻</a></td>
|
||||||
<td align="center"><a href="http://marcus-sa.me"><img src="https://avatars0.githubusercontent.com/u/8391194?v=4" width="100px;" alt=""/><br /><sub><b>Marcus S. Abildskov</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=marcus-sa" title="Tests">⚠️</a></td>
|
<td align="center"><a href="http://marcus-sa.me"><img src="https://avatars0.githubusercontent.com/u/8391194?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Marcus S. Abildskov</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=marcus-sa" title="Tests">⚠️</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center"><a href="http://www.mad3linux.org"><img src="https://avatars3.githubusercontent.com/u/508624?v=4" width="100px;" alt=""/><br /><sub><b>Átila Camurça Alves</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=atilacamurca" title="Documentation">📖</a></td>
|
<td align="center"><a href="http://www.mad3linux.org"><img src="https://avatars3.githubusercontent.com/u/508624?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Átila Camurça Alves</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=atilacamurca" title="Documentation">📖</a></td>
|
||||||
<td align="center"><a href="http://hibbard.eu"><img src="https://avatars2.githubusercontent.com/u/1940994?v=4" width="100px;" alt=""/><br /><sub><b>James Hibbard</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=jameshibbard" title="Code">💻</a></td>
|
<td align="center"><a href="http://hibbard.eu"><img src="https://avatars2.githubusercontent.com/u/1940994?v=4?s=100" width="100px;" alt=""/><br /><sub><b>James Hibbard</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=jameshibbard" title="Code">💻</a></td>
|
||||||
<td align="center"><a href="https://github.com/soonoo"><img src="https://avatars2.githubusercontent.com/u/5436405?v=4" width="100px;" alt=""/><br /><sub><b>Soonwoo Hong</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=soonoo" title="Code">💻</a></td>
|
<td align="center"><a href="https://github.com/soonoo"><img src="https://avatars2.githubusercontent.com/u/5436405?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Soonwoo Hong</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=soonoo" title="Code">💻</a></td>
|
||||||
<td align="center"><a href="https://github.com/illBeRoy"><img src="https://avatars2.githubusercontent.com/u/6681893?v=4" width="100px;" alt=""/><br /><sub><b>Roy Sommer</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=illBeRoy" title="Code">💻</a></td>
|
<td align="center"><a href="https://github.com/illBeRoy"><img src="https://avatars2.githubusercontent.com/u/6681893?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Roy Sommer</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=illBeRoy" title="Code">💻</a></td>
|
||||||
<td align="center"><a href="https://github.com/paulocoghi"><img src="https://avatars1.githubusercontent.com/u/378397?v=4" width="100px;" alt=""/><br /><sub><b>Paulo Coghi</b></sub></a><br /><a href="#ideas-paulocoghi" title="Ideas, Planning, & Feedback">🤔</a></td>
|
<td align="center"><a href="https://github.com/paulocoghi"><img src="https://avatars1.githubusercontent.com/u/378397?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Paulo Coghi</b></sub></a><br /><a href="#ideas-paulocoghi" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||||
<td align="center"><a href="https://balthild.com"><img src="https://avatars2.githubusercontent.com/u/2662758?v=4" width="100px;" alt=""/><br /><sub><b>Balthild Ires</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=balthild" title="Code">💻</a></td>
|
<td align="center"><a href="https://balthild.com"><img src="https://avatars2.githubusercontent.com/u/2662758?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Balthild Ires</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=balthild" title="Code">💻</a></td>
|
||||||
<td align="center"><a href="https://dimitarnestorov.com"><img src="https://avatars0.githubusercontent.com/u/8790386?v=4" width="100px;" alt=""/><br /><sub><b>Dimitar Nestorov</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=dimitarnestorov" title="Code">💻</a></td>
|
<td align="center"><a href="https://dimitarnestorov.com"><img src="https://avatars0.githubusercontent.com/u/8790386?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Dimitar Nestorov</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=dimitarnestorov" title="Code">💻</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center"><a href="https://www.greatapes.fi"><img src="https://avatars3.githubusercontent.com/u/3404389?v=4" width="100px;" alt=""/><br /><sub><b>Mikko Sairio</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=msairio" title="Code">💻</a></td>
|
<td align="center"><a href="https://www.greatapes.fi"><img src="https://avatars3.githubusercontent.com/u/3404389?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mikko Sairio</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=msairio" title="Code">💻</a></td>
|
||||||
<td align="center"><a href="http://blog.pepf.nl"><img src="https://avatars1.githubusercontent.com/u/1265435?v=4" width="100px;" alt=""/><br /><sub><b>Pepijn</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=pepf" title="Code">💻</a></td>
|
<td align="center"><a href="http://blog.pepf.nl"><img src="https://avatars1.githubusercontent.com/u/1265435?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pepijn</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=pepf" title="Code">💻</a></td>
|
||||||
<td align="center"><a href="https://github.com/slidinghotdog"><img src="https://avatars3.githubusercontent.com/u/33790211?v=4" width="100px;" alt=""/><br /><sub><b>slidinghotdog</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=slidinghotdog" title="Code">💻</a></td>
|
<td align="center"><a href="https://github.com/slidinghotdog"><img src="https://avatars3.githubusercontent.com/u/33790211?v=4?s=100" width="100px;" alt=""/><br /><sub><b>slidinghotdog</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=slidinghotdog" title="Code">💻</a></td>
|
||||||
<td align="center"><a href="http://www.bundyo.org"><img src="https://avatars1.githubusercontent.com/u/98318?v=4" width="100px;" alt=""/><br /><sub><b>Bundyo (Kamen Bundev)</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=bundyo" title="Code">💻</a></td>
|
<td align="center"><a href="http://www.bundyo.org"><img src="https://avatars1.githubusercontent.com/u/98318?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Bundyo (Kamen Bundev)</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=bundyo" title="Code">💻</a></td>
|
||||||
<td align="center"><a href="https://github.com/feng8848"><img src="https://avatars2.githubusercontent.com/u/40539968?v=4" width="100px;" alt=""/><br /><sub><b>feng8848</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=feng8848" title="Code">💻</a></td>
|
<td align="center"><a href="https://github.com/feng8848"><img src="https://avatars2.githubusercontent.com/u/40539968?v=4?s=100" width="100px;" alt=""/><br /><sub><b>feng8848</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=feng8848" title="Code">💻</a></td>
|
||||||
<td align="center"><a href="https://karelov.info"><img src="https://avatars3.githubusercontent.com/u/2384454?v=4" width="100px;" alt=""/><br /><sub><b>Maksim Karelov</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=Ty3uK" title="Code">💻</a></td>
|
<td align="center"><a href="https://karelov.info"><img src="https://avatars3.githubusercontent.com/u/2384454?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Maksim Karelov</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=Ty3uK" title="Code">💻</a></td>
|
||||||
<td align="center"><a href="https://github.com/mspencer92"><img src="https://avatars2.githubusercontent.com/u/1910455?v=4" width="100px;" alt=""/><br /><sub><b>mspencer92</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=mspencer92" title="Code">💻</a></td>
|
<td align="center"><a href="https://github.com/mspencer92"><img src="https://avatars2.githubusercontent.com/u/1910455?v=4?s=100" width="100px;" alt=""/><br /><sub><b>mspencer92</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=mspencer92" title="Code">💻</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center"><a href="https://github.com/blncd2020"><img src="https://avatars1.githubusercontent.com/u/59541979?v=4" width="100px;" alt=""/><br /><sub><b>blncd2020</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=blncd2020" title="Documentation">📖</a></td>
|
<td align="center"><a href="https://github.com/blncd2020"><img src="https://avatars1.githubusercontent.com/u/59541979?v=4?s=100" width="100px;" alt=""/><br /><sub><b>blncd2020</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=blncd2020" title="Documentation">📖</a></td>
|
||||||
<td align="center"><a href="https://github.com/gluaxspeed"><img src="https://avatars2.githubusercontent.com/u/16431709?v=4" width="100px;" alt=""/><br /><sub><b>gluaxspeed</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=gluaxspeed" title="Code">💻</a></td>
|
<td align="center"><a href="https://github.com/gluaxspeed"><img src="https://avatars2.githubusercontent.com/u/16431709?v=4?s=100" width="100px;" alt=""/><br /><sub><b>gluaxspeed</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=gluaxspeed" title="Code">💻</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/Solant"><img src="https://avatars2.githubusercontent.com/u/5971578?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Solant</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=Solant" title="Code">💻</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/shubhamzanwar"><img src="https://avatars0.githubusercontent.com/u/15626155?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Shubham Zanwar</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=shubhamzanwar" title="Code">💻</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/Singha360"><img src="https://avatars1.githubusercontent.com/u/35334787?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Singha360</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=Singha360" title="Code">💻</a></td>
|
||||||
|
<td align="center"><a href="http://wellenline.com"><img src="https://avatars3.githubusercontent.com/u/3790782?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mihkel</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=MihkelBaranov" title="Code">💻</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/stevo2588"><img src="https://avatars1.githubusercontent.com/u/3278045?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Stephen A</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=stevo2588" title="Code">💻</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><a href="http://liujunjiang.com"><img src="https://avatars1.githubusercontent.com/u/15191056?v=4?s=100" width="100px;" alt=""/><br /><sub><b>流君酱</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=jardenliu" title="Code">💻</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/agg23"><img src="https://avatars1.githubusercontent.com/u/238679?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Adam Gastineau</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=agg23" title="Code">💻</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/swittk"><img src="https://avatars2.githubusercontent.com/u/5000572?v=4?s=100" width="100px;" alt=""/><br /><sub><b>swittk</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=swittk" title="Code">💻</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/craftingmod"><img src="https://avatars2.githubusercontent.com/u/9389278?v=4?s=100" width="100px;" alt=""/><br /><sub><b>craftingmod</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=craftingmod" title="Code">💻</a></td>
|
||||||
|
<td align="center"><a href="http://www.m2osw.com"><img src="https://avatars1.githubusercontent.com/u/643129?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Doug Barbieri</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=dooglio" title="Code">💻</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/NeryHenrique"><img src="https://avatars0.githubusercontent.com/u/6879141?v=4?s=100" width="100px;" alt=""/><br /><sub><b>HENRIQUE DE SOUZA NERY</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=NeryHenrique" title="Code">💻</a></td>
|
||||||
|
<td align="center"><a href="https://ruslang.xyz"><img src="https://avatars0.githubusercontent.com/u/25264730?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ruslan Garifullin</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=ruslang02" title="Code">💻</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><a href="https://github.com/ran-j"><img src="https://avatars0.githubusercontent.com/u/17410205?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ranieri</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=ran-j" title="Code">💻</a> <a href="https://github.com/nodegui/nodegui/commits?author=ran-j" title="Documentation">📖</a></td>
|
||||||
|
<td align="center"><a href="https://master-technology.com"><img src="https://avatars3.githubusercontent.com/u/850871?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nathanael Anderson</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=NathanaelA" title="Code">💻</a></td>
|
||||||
|
<td align="center"><a href="https://ubiq.co.za"><img src="https://avatars0.githubusercontent.com/u/4415071?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ross</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=rocbear" title="Code">💻</a> <a href="https://github.com/nodegui/nodegui/commits?author=rocbear" title="Documentation">📖</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/4h7l"><img src="https://avatars.githubusercontent.com/u/69183283?v=4?s=100" width="100px;" alt=""/><br /><sub><b>4h7l</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=4h7l" title="Code">💻</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/Maks-s"><img src="https://avatars.githubusercontent.com/u/26678512?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Maks</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=Maks-s" title="Code">💻</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/zhb124404"><img src="https://avatars.githubusercontent.com/u/16805041?v=4?s=100" width="100px;" alt=""/><br /><sub><b>zhb124404</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=zhb124404" title="Documentation">📖</a></td>
|
||||||
|
<td align="center"><a href="http://www.apsis.io"><img src="https://avatars.githubusercontent.com/u/579688?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Wyatt Kirby</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=wkirby" title="Code">💻</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><a href="https://stvkoch.github.io."><img src="https://avatars.githubusercontent.com/u/14454?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Steven Koch</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=stvkoch" title="Code">💻</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/sedwards2009"><img src="https://avatars.githubusercontent.com/u/6926644?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Simon Edwards</b></sub></a><br /><a href="https://github.com/nodegui/nodegui/commits?author=sedwards2009" title="Code">💻</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<!-- markdownlint-enable -->
|
<!-- markdownlint-restore -->
|
||||||
<!-- prettier-ignore-end -->
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||||
|
|||||||
@ -1,15 +1,21 @@
|
|||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
find_program(CCACHE_PROGRAM ccache)
|
find_program(CCACHE_PROGRAM ccache)
|
||||||
if(CCACHE_PROGRAM)
|
if(CCACHE_PROGRAM)
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum OS X deployment version")
|
||||||
|
|
||||||
function(AddCommonConfig addonName)
|
function(AddCommonConfig addonName)
|
||||||
target_compile_features(${addonName} PRIVATE
|
target_compile_features(${addonName} PRIVATE
|
||||||
|
cxx_constexpr
|
||||||
cxx_inheriting_constructors
|
cxx_inheriting_constructors
|
||||||
cxx_lambdas
|
cxx_lambdas
|
||||||
cxx_auto_type
|
cxx_auto_type
|
||||||
cxx_variadic_templates
|
cxx_variadic_templates
|
||||||
cxx_variable_templates
|
cxx_variable_templates
|
||||||
|
cxx_std_17
|
||||||
)
|
)
|
||||||
|
|
||||||
if(napi_build_version)
|
if(napi_build_version)
|
||||||
|
|||||||
@ -11,7 +11,7 @@ include("${PLUGIN_CMAKE_DIR}/common.cmake")
|
|||||||
include("${PLUGIN_CMAKE_DIR}/qt.cmake")
|
include("${PLUGIN_CMAKE_DIR}/qt.cmake")
|
||||||
include("${PLUGIN_CMAKE_DIR}/napi.cmake")
|
include("${PLUGIN_CMAKE_DIR}/napi.cmake")
|
||||||
|
|
||||||
function(AddPluginConfig addonName)
|
macro(AddPluginConfig addonName)
|
||||||
AddCommonConfig(${addonName})
|
AddCommonConfig(${addonName})
|
||||||
AddQtSupport(${addonName})
|
AddQtSupport(${addonName})
|
||||||
AddNapiSupport(${addonName})
|
AddNapiSupport(${addonName})
|
||||||
@ -29,5 +29,5 @@ function(AddPluginConfig addonName)
|
|||||||
"${NODEGUI_ROOT}/src/cpp/include/nodegui"
|
"${NODEGUI_ROOT}/src/cpp/include/nodegui"
|
||||||
)
|
)
|
||||||
|
|
||||||
endfunction(AddPluginConfig addonName)
|
endmacro(AddPluginConfig addonName)
|
||||||
|
|
||||||
|
|||||||
24
config/qode.cmake
Normal file
24
config/qode.cmake
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Adds Qode shared binary support
|
||||||
|
|
||||||
|
set(QODE_CONFIG_FILE @nodegui/qode/src/config.js)
|
||||||
|
|
||||||
|
macro(AddQodeSupport addonName)
|
||||||
|
if (WIN32)
|
||||||
|
|
||||||
|
execute_process(COMMAND node -p "require('${QODE_CONFIG_FILE}').extractDir"
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
|
OUTPUT_VARIABLE QODE_BINARY_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
string(REPLACE "\n" "" QODE_BINARY_DIR "${QODE_BINARY_DIR}")
|
||||||
|
string(REPLACE "\"" "" QODE_BINARY_DIR "${QODE_BINARY_DIR}")
|
||||||
|
|
||||||
|
message(STATUS "Using Qode installation for ${addonName} QODE_BINARY_DIR:${QODE_BINARY_DIR}")
|
||||||
|
|
||||||
|
target_link_libraries(${CORE_WIDGETS_ADDON} PRIVATE
|
||||||
|
"${QODE_BINARY_DIR}\\node.lib"
|
||||||
|
)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endmacro(AddQodeSupport addonName)
|
||||||
@ -1,79 +1,25 @@
|
|||||||
# Adds Qt support
|
# Adds Qt support
|
||||||
# make sure you include this at the top of whichever Cmakelist file you are going to use.
|
# make sure you include this at the top of whichever Cmakelist file you are going to use.
|
||||||
# Need for automatic moc. Moc executable path is set in qt.cmake
|
# Need for automatic moc.
|
||||||
set(CMAKE_AUTOMOC ON)
|
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
||||||
set(QT_VERSION_MAJOR 5)
|
|
||||||
set(QT_VERSION_MINOR 13)
|
|
||||||
add_executable(Qt5::moc IMPORTED)
|
|
||||||
|
|
||||||
function(AddQtSupport addonName)
|
set(CMAKE_AUTOMOC ON)
|
||||||
execute_process(COMMAND node -p "require('@nodegui/qode').qtHome"
|
set(CMAKE_AUTORCC ON)
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
|
||||||
|
set(QTCONFIG_FILE ${CMAKE_CURRENT_LIST_DIR}/qtConfig.js)
|
||||||
|
|
||||||
|
macro(AddQtSupport addonName)
|
||||||
|
execute_process(COMMAND node -p "require('${QTCONFIG_FILE}').qtCmakeDir"
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
OUTPUT_VARIABLE QT_HOME_DIR
|
OUTPUT_VARIABLE QT_CMAKE_HOME_DIR
|
||||||
)
|
)
|
||||||
|
|
||||||
if(DEFINED ENV{QT_INSTALL_DIR})
|
string(REPLACE "\n" "" QT_CMAKE_HOME_DIR "${QT_CMAKE_HOME_DIR}")
|
||||||
# Allows to use custom Qt installation via QT_INSTALL_DIR env variable
|
string(REPLACE "\"" "" QT_CMAKE_HOME_DIR "${QT_CMAKE_HOME_DIR}")
|
||||||
message(STATUS "Using Custom QT installation for ${addonName} QT_INSTALL_DIR:$ENV{QT_INSTALL_DIR}")
|
|
||||||
set(QT_HOME_DIR "$ENV{QT_INSTALL_DIR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
string(REPLACE "\n" "" QT_HOME_DIR "${QT_HOME_DIR}")
|
message(STATUS "Using Qt installation for ${addonName} QT_CMAKE_HOME_DIR:${QT_CMAKE_HOME_DIR}")
|
||||||
string(REPLACE "\"" "" QT_HOME_DIR "${QT_HOME_DIR}")
|
|
||||||
|
|
||||||
if(APPLE)
|
list(APPEND CMAKE_PREFIX_PATH "${QT_CMAKE_HOME_DIR}/../../..")
|
||||||
set(CUSTOM_QT_MOC_PATH "${QT_HOME_DIR}/bin/moc")
|
find_package(Qt6 REQUIRED COMPONENTS Widgets Gui Core Svg SvgWidgets)
|
||||||
|
|
||||||
target_include_directories(${addonName} PRIVATE
|
endmacro(AddQtSupport addonName)
|
||||||
"${QT_HOME_DIR}/include"
|
|
||||||
"${QT_HOME_DIR}/lib/QtCore.framework/Versions/5/Headers"
|
|
||||||
"${QT_HOME_DIR}/lib/QtGui.framework/Versions/5/Headers"
|
|
||||||
"${QT_HOME_DIR}/lib/QtWidgets.framework/Versions/5/Headers"
|
|
||||||
)
|
|
||||||
target_link_libraries(${addonName} PRIVATE
|
|
||||||
"${QT_HOME_DIR}/lib/QtCore.framework/Versions/5/QtCore"
|
|
||||||
"${QT_HOME_DIR}/lib/QtGui.framework/Versions/5/QtGui"
|
|
||||||
"${QT_HOME_DIR}/lib/QtWidgets.framework/Versions/5/QtWidgets"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
set(CUSTOM_QT_MOC_PATH "${QT_HOME_DIR}\\bin\\moc.exe")
|
|
||||||
|
|
||||||
target_include_directories(${addonName} PRIVATE
|
|
||||||
"${QT_HOME_DIR}\\include"
|
|
||||||
"${QT_HOME_DIR}\\include\\QtCore"
|
|
||||||
"${QT_HOME_DIR}\\include\\QtGui"
|
|
||||||
"${QT_HOME_DIR}\\include\\QtWidgets"
|
|
||||||
)
|
|
||||||
target_link_libraries(${addonName} PRIVATE
|
|
||||||
"${QT_HOME_DIR}\\lib\\Qt5Core.lib"
|
|
||||||
"${QT_HOME_DIR}\\lib\\Qt5Gui.lib"
|
|
||||||
"${QT_HOME_DIR}\\lib\\Qt5Widgets.lib"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
|
||||||
set(LINUX TRUE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(LINUX)
|
|
||||||
set(CUSTOM_QT_MOC_PATH "${QT_HOME_DIR}/bin/moc")
|
|
||||||
target_include_directories(${addonName} PRIVATE
|
|
||||||
"${QT_HOME_DIR}/include"
|
|
||||||
"${QT_HOME_DIR}/include/QtCore"
|
|
||||||
"${QT_HOME_DIR}/include/QtGui"
|
|
||||||
"${QT_HOME_DIR}/include/QtWidgets"
|
|
||||||
)
|
|
||||||
target_link_libraries(${addonName} PRIVATE
|
|
||||||
"${QT_HOME_DIR}/lib/libQt5Core.so"
|
|
||||||
"${QT_HOME_DIR}/lib/libQt5Gui.so"
|
|
||||||
"${QT_HOME_DIR}/lib/libQt5Widgets.so"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# set custom moc executable location
|
|
||||||
set_target_properties(Qt5::moc PROPERTIES IMPORTED_LOCATION "${CUSTOM_QT_MOC_PATH}")
|
|
||||||
|
|
||||||
endfunction(AddQtSupport addonName)
|
|
||||||
|
|||||||
102
config/qtConfig.js
Normal file
102
config/qtConfig.js
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
const os = require('os');
|
||||||
|
const path = require('path');
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
|
const SETUP_DIR = path.resolve(__dirname, '..', 'miniqt');
|
||||||
|
const QT_VERSION = '6.4.1';
|
||||||
|
const MIRROR = Boolean(process.env.QT_LINK_MIRROR) ? process.env.QT_LINK_MIRROR : 'https://download.qt.io';
|
||||||
|
|
||||||
|
const checkIfExists = (fullPath) => {
|
||||||
|
return () => fs.existsSync(fullPath);
|
||||||
|
};
|
||||||
|
|
||||||
|
function getMiniQtConfig() {
|
||||||
|
switch (os.platform()) {
|
||||||
|
case 'darwin': {
|
||||||
|
const qtHome = path.resolve(SETUP_DIR, QT_VERSION, 'macos');
|
||||||
|
return {
|
||||||
|
qtHome,
|
||||||
|
artifacts: [
|
||||||
|
{
|
||||||
|
name: 'Qt Base',
|
||||||
|
link: `${MIRROR}/online/qtsdkrepository/mac_x64/desktop/qt6_641/qt.qt6.641.clang_64/6.4.1-0-202211101256qtbase-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64.7z`,
|
||||||
|
skipSetup: checkIfExists(path.resolve(qtHome, 'plugins', 'platforms', 'libqcocoa.dylib')),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Qt Svg',
|
||||||
|
link: `${MIRROR}/online/qtsdkrepository/mac_x64/desktop/qt6_641/qt.qt6.641.clang_64/6.4.1-0-202211101256qtsvg-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64.7z`,
|
||||||
|
skipSetup: checkIfExists(path.resolve(qtHome, 'lib', 'QtSvg.framework', 'QtSvg')),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Qt Tools',
|
||||||
|
link: `${MIRROR}/online/qtsdkrepository/mac_x64/desktop/qt6_641/qt.qt6.641.clang_64/6.4.1-0-202211101256qttools-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64.7z`,
|
||||||
|
skipSetup: checkIfExists(path.resolve(qtHome, 'bin', 'macdeployqt')),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
case 'win32': {
|
||||||
|
const qtHome = path.resolve(SETUP_DIR, QT_VERSION, 'msvc2019_64');
|
||||||
|
return {
|
||||||
|
qtHome,
|
||||||
|
artifacts: [
|
||||||
|
{
|
||||||
|
name: 'Qt Base',
|
||||||
|
link: `${MIRROR}/online/qtsdkrepository/windows_x86/desktop/qt6_641/qt.qt6.641.win64_msvc2019_64/6.4.1-0-202211101254qtbase-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64.7z`,
|
||||||
|
skipSetup: checkIfExists(path.resolve(qtHome, 'bin', 'Qt6Core.dll')),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Qt SVG',
|
||||||
|
link: `${MIRROR}/online/qtsdkrepository/windows_x86/desktop/qt6_641/qt.qt6.641.win64_msvc2019_64/6.4.1-0-202211101254qtsvg-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64.7z`,
|
||||||
|
skipSetup: checkIfExists(path.resolve(qtHome, 'bin', 'Qt6Svg.dll')),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Qt Tools',
|
||||||
|
link: `${MIRROR}/online/qtsdkrepository/windows_x86/desktop/qt6_641/qt.qt6.641.win64_msvc2019_64/6.4.1-0-202211101254qttools-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64.7z`,
|
||||||
|
skipSetup: checkIfExists(path.resolve(qtHome, 'bin', 'windeployqt.exe')),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
case 'linux': {
|
||||||
|
const qtHome = path.resolve(SETUP_DIR, QT_VERSION, 'gcc_64');
|
||||||
|
return {
|
||||||
|
qtHome,
|
||||||
|
artifacts: [
|
||||||
|
{
|
||||||
|
name: 'Qt Base',
|
||||||
|
link: `${MIRROR}/online/qtsdkrepository/linux_x64/desktop/qt6_641/qt.qt6.641.gcc_64/6.4.1-0-202211101305qtbase-Linux-RHEL_8_4-GCC-Linux-RHEL_8_4-X86_64.7z`,
|
||||||
|
skipSetup: checkIfExists(path.resolve(qtHome, 'bin', 'moc')),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Qt SVG',
|
||||||
|
link: `${MIRROR}/online/qtsdkrepository/linux_x64/desktop/qt6_641/qt.qt6.641.gcc_64/6.4.1-0-202211101305qtsvg-Linux-RHEL_8_4-GCC-Linux-RHEL_8_4-X86_64.7z`,
|
||||||
|
skipSetup: checkIfExists(path.resolve(qtHome, 'lib', 'libQt6Svg.so')),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Qt ICU',
|
||||||
|
link: `${MIRROR}/online/qtsdkrepository/linux_x64/desktop/qt6_641/qt.qt6.641.gcc_64/6.4.1-0-202211101305icu-linux-Rhel7.2-x64.7z`,
|
||||||
|
skipSetup: checkIfExists(path.resolve(qtHome, 'lib', 'libicuuc.so')),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const miniQt = {
|
||||||
|
...getMiniQtConfig(),
|
||||||
|
version: QT_VERSION,
|
||||||
|
setupDir: SETUP_DIR,
|
||||||
|
};
|
||||||
|
|
||||||
|
const useCustomQt = Boolean(process.env.QT_INSTALL_DIR);
|
||||||
|
const qtHome = useCustomQt ? process.env.QT_INSTALL_DIR : miniQt.qtHome;
|
||||||
|
const qtCmakeDir = path.resolve(qtHome, 'lib', 'cmake', 'Qt6');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
qtHome,
|
||||||
|
miniQt,
|
||||||
|
qtCmakeDir,
|
||||||
|
useCustomQt,
|
||||||
|
};
|
||||||
@ -11,6 +11,6 @@ module.exports = {
|
|||||||
transform: {
|
transform: {
|
||||||
'^.+\\.tsx?$': 'ts-jest',
|
'^.+\\.tsx?$': 'ts-jest',
|
||||||
},
|
},
|
||||||
globalSetup: './config/tests/setup.js',
|
globalSetup: './scripts/tests/setup.js',
|
||||||
globalTeardown: './config/tests/teardown.js',
|
globalTeardown: './scripts/tests/teardown.js',
|
||||||
};
|
};
|
||||||
|
|||||||
16330
package-lock.json
generated
16330
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
89
package.json
89
package.json
@ -1,54 +1,71 @@
|
|||||||
{
|
{
|
||||||
"name": "@nodegui/nodegui",
|
"name": "@nodegui/nodegui",
|
||||||
"version": "0.13.3",
|
"version": "0.59.0",
|
||||||
"description": "A cross platform library to build native desktop apps.",
|
"description": "A cross-platform library to build native desktop apps.",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
"author": "Atul R <atulanand94@gmail.com>",
|
"author": "Atul R <atulanand94@gmail.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"private": false,
|
"private": false,
|
||||||
"scripts": {
|
"bin": {
|
||||||
"dev": "npm run build && qode dist/demo.js",
|
"qode": "scripts/qode.js"
|
||||||
"build": "tsc && npm run build:addon",
|
|
||||||
"postinstall": "cross-env node ./scripts/skip.js || npm run prebuild:install || npm run build:addon",
|
|
||||||
"build:addon": "cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile",
|
|
||||||
"prebuild:install": "prebuild-install --backend=cmake-js --runtime=napi --verbose",
|
|
||||||
"test": "qode ./node_modules/jest/bin/jest -i",
|
|
||||||
"lint:cpp": "clang-format -i --glob=src/cpp/**/*.[h,c]*",
|
|
||||||
"lint:ts": "tsc --noEmit && cross-env eslint './src/**/*.{ts,tsx,js,jsx}' --fix",
|
|
||||||
"docs": "typedoc && node ./website/docs/scripts/fixdocs.js"
|
|
||||||
},
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/a7ul"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"dev": "npm run build && node ./scripts/qode.js dist/demo.js",
|
||||||
|
"demo": "node ./scripts/qode.js dist/demo.js",
|
||||||
|
"build": "tsc && npm run build:addon",
|
||||||
|
"install": "npm run setupqt && (node ./scripts/skip.js || npm run setupbinary || npm run build:addon)",
|
||||||
|
"setupqt": "node ./scripts/setupMiniQt.js",
|
||||||
|
"setupbinary": "node ./scripts/setupBinary.js",
|
||||||
|
"build:addon": "cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile",
|
||||||
|
"test": "node ./scripts/qode.js ./node_modules/jest/bin/jest -i",
|
||||||
|
"lint:cpp": "clang-format -i --glob=src/cpp/**/*.[h,c]*",
|
||||||
|
"lint:ts": "tsc --noEmit && eslint ./src --fix",
|
||||||
|
"docs": "typedoc && node ./website/docs/scripts/fixdocs.js",
|
||||||
|
"qode": "node ./scripts/qode.js",
|
||||||
|
"prepublishOnly": "npm run build"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.x.x"
|
||||||
|
},
|
||||||
|
"engineStrict": false,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodegui/qode": "^1.0.6",
|
"@nodegui/artifact-installer": "^1.1.0",
|
||||||
"cmake-js": "^6.0.0",
|
"@nodegui/qode": "^18.12.1",
|
||||||
"cross-env": "^7.0.0",
|
"cmake-js": "^6.2.1",
|
||||||
"cuid": "^2.1.6",
|
"cross-env": "^7.0.3",
|
||||||
"node-addon-api": "^2.0.0",
|
"cuid": "^2.1.8",
|
||||||
|
"manage-path": "^2.0.0",
|
||||||
|
"memoize-one": "^5.2.1",
|
||||||
|
"node-addon-api": "^4.0.0",
|
||||||
|
"postcss": "^7.0.17",
|
||||||
"postcss-nodegui-autoprefixer": "0.0.7",
|
"postcss-nodegui-autoprefixer": "0.0.7",
|
||||||
"prebuild-install": "^5.3.3"
|
"tar": "^6.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bindings": "^1.3.0",
|
"@types/bindings": "^1.5.1",
|
||||||
"@types/jest": "^24.0.18",
|
"@types/jest": "29.2.4",
|
||||||
"@types/node": "^13.1.2",
|
"@types/node": "^16.4.13",
|
||||||
"@typescript-eslint/eslint-plugin": "^2.10.0",
|
"@typescript-eslint/eslint-plugin": "^4.29.0",
|
||||||
"@typescript-eslint/parser": "^2.10.0",
|
"@typescript-eslint/parser": "^4.29.0",
|
||||||
"clang-format": "^1.3.0",
|
"clang-format": "^1.5.0",
|
||||||
"eslint": "^6.6.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-config-prettier": "^6.5.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-prettier": "^3.1.1",
|
"eslint-plugin-prettier": "^3.4.0",
|
||||||
"husky": "^4.0.10",
|
"husky": "^7.0.1",
|
||||||
"jest": "^25.1.0",
|
"jest": "29.3.1",
|
||||||
"prebuild": "^10.0.0",
|
"prettier": "^2.3.2",
|
||||||
"prettier": "^1.18.2",
|
"ts-jest": "29.0.3",
|
||||||
"ts-jest": "^25.0.0",
|
"typedoc": "^0.17.8",
|
||||||
"typedoc": "^0.16.7",
|
"typedoc-plugin-markdown": "^2.4.2",
|
||||||
"typedoc-plugin-markdown": "^2.2.14",
|
"typescript": "^4.3.5"
|
||||||
"typescript": "^3.7.3"
|
|
||||||
},
|
},
|
||||||
"binary": {
|
"binary": {
|
||||||
"napi_versions": [
|
"napi_versions": [
|
||||||
3
|
4
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
|
|||||||
40
scripts/qode.js
Executable file
40
scripts/qode.js
Executable file
@ -0,0 +1,40 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
var os = require('os');
|
||||||
|
var path = require('path');
|
||||||
|
var qodeConfig = require('@nodegui/qode');
|
||||||
|
var managePath = require('manage-path');
|
||||||
|
var qtConfig = require('../config/qtConfig');
|
||||||
|
|
||||||
|
var proc = require('child_process');
|
||||||
|
|
||||||
|
// Add Qt's bin to the path of Qode so that it can find the dll's
|
||||||
|
var alterPath = managePath(process.env);
|
||||||
|
alterPath.unshift(path.join(qtConfig.qtHome, 'bin'));
|
||||||
|
|
||||||
|
// Add Qt's lib to LD_LIBRARY_PATH so linux can find the libs when bundled with webpack
|
||||||
|
if(os.platform == 'linux') {
|
||||||
|
var oldLD_PATH = process.env.LD_LIBRARY_PATH ?? "";
|
||||||
|
process.env.LD_LIBRARY_PATH = oldLD_PATH + ":" + path.join(qtConfig.qtHome, 'lib');
|
||||||
|
}
|
||||||
|
|
||||||
|
var child = proc.spawn(qodeConfig.qodePath, process.argv.slice(2), {
|
||||||
|
stdio: 'inherit',
|
||||||
|
windowsHide: false,
|
||||||
|
env: process.env,
|
||||||
|
});
|
||||||
|
|
||||||
|
child.on('close', function(code) {
|
||||||
|
process.exit(code);
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleTerminationSignal = function(signal) {
|
||||||
|
process.on(signal, function signalHandler() {
|
||||||
|
if (!child.killed) {
|
||||||
|
child.kill(signal);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
handleTerminationSignal('SIGINT');
|
||||||
|
handleTerminationSignal('SIGTERM');
|
||||||
39
scripts/setupBinary.js
Normal file
39
scripts/setupBinary.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const os = require('os');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
const { setupArtifact } = require('@nodegui/artifact-installer');
|
||||||
|
const tar = require('tar');
|
||||||
|
const SETUP_DIR = path.resolve(__dirname, '..', 'build', 'Release');
|
||||||
|
const packageJson = require('../package');
|
||||||
|
|
||||||
|
async function setupBinary() {
|
||||||
|
const packageVersion = packageJson.version;
|
||||||
|
const tarballName = `nodegui-binary-v${packageVersion}-${os.platform()}-${os.arch()}.tar.gz`;
|
||||||
|
const url = `https://github.com/nodegui/nodegui/releases/download/v${packageVersion}/${tarballName}`;
|
||||||
|
|
||||||
|
await setupArtifact({
|
||||||
|
outDir: SETUP_DIR,
|
||||||
|
id: 'nodegui-core',
|
||||||
|
displayName: `Precompiled NodeGui binary`,
|
||||||
|
downloadLink: url,
|
||||||
|
skipSetup: () => false,
|
||||||
|
});
|
||||||
|
const tarPath = path.join(SETUP_DIR, tarballName.slice(0, -3));
|
||||||
|
tar.extract({
|
||||||
|
cwd: SETUP_DIR,
|
||||||
|
file: tarPath,
|
||||||
|
sync: true,
|
||||||
|
});
|
||||||
|
fs.unlinkSync(tarPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
setupBinary()
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
process.exit(1);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
29
scripts/setupMiniQt.js
Normal file
29
scripts/setupMiniQt.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const { setupArtifact } = require('@nodegui/artifact-installer');
|
||||||
|
const { miniQt, useCustomQt, qtHome } = require('../config/qtConfig');
|
||||||
|
|
||||||
|
async function setupQt() {
|
||||||
|
return Promise.all(
|
||||||
|
miniQt.artifacts.map(async (artifact) =>
|
||||||
|
setupArtifact({
|
||||||
|
outDir: miniQt.setupDir,
|
||||||
|
id: 'nodegui-mini-qt',
|
||||||
|
displayName: `${artifact.name} for Minimal Qt: ${miniQt.version} installation`,
|
||||||
|
downloadLink: artifact.link,
|
||||||
|
skipSetup: artifact.skipSetup,
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!useCustomQt) {
|
||||||
|
console.log(`Minimal Qt ${miniQt.version} setup:`);
|
||||||
|
|
||||||
|
setupQt().catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log(`CustomQt detected at ${qtHome} . Hence, skipping Mini Qt installation...`);
|
||||||
|
}
|
||||||
67
src/cpp/include/deps/yoga/BitUtils.h
Normal file
67
src/cpp/include/deps/yoga/BitUtils.h
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
#include "YGEnums.h"
|
||||||
|
|
||||||
|
namespace facebook {
|
||||||
|
namespace yoga {
|
||||||
|
|
||||||
|
namespace detail {
|
||||||
|
|
||||||
|
constexpr size_t log2ceilFn(size_t n) {
|
||||||
|
return n < 1 ? 0 : (1 + log2ceilFn(n / 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr int mask(size_t bitWidth, size_t index) {
|
||||||
|
return ((1 << bitWidth) - 1) << index;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The number of bits necessary to represent enums defined with YG_ENUM_SEQ_DECL
|
||||||
|
template <typename Enum>
|
||||||
|
constexpr size_t bitWidthFn() {
|
||||||
|
static_assert(enums::count<Enum>() > 0,
|
||||||
|
"Enums must have at least one entries");
|
||||||
|
return log2ceilFn(enums::count<Enum>() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Enum>
|
||||||
|
constexpr Enum getEnumData(int flags, size_t index) {
|
||||||
|
return static_cast<Enum>((flags & mask(bitWidthFn<Enum>(), index)) >> index);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Enum>
|
||||||
|
void setEnumData(uint32_t& flags, size_t index, int newValue) {
|
||||||
|
flags = (flags & ~mask(bitWidthFn<Enum>(), index)) |
|
||||||
|
((newValue << index) & (mask(bitWidthFn<Enum>(), index)));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Enum>
|
||||||
|
void setEnumData(uint8_t& flags, size_t index, int newValue) {
|
||||||
|
flags = (flags & ~mask(bitWidthFn<Enum>(), index)) |
|
||||||
|
((newValue << index) & (mask(bitWidthFn<Enum>(), index)));
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr bool getBooleanData(int flags, size_t index) {
|
||||||
|
return (flags >> index) & 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void setBooleanData(uint8_t& flags, size_t index, bool value) {
|
||||||
|
if (value) {
|
||||||
|
flags |= 1 << index;
|
||||||
|
} else {
|
||||||
|
flags &= ~(1 << index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace detail
|
||||||
|
} // namespace yoga
|
||||||
|
} // namespace facebook
|
||||||
@ -1,144 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <yoga/YGEnums.h>
|
|
||||||
|
|
||||||
#include <cstddef>
|
|
||||||
#include <limits>
|
|
||||||
#include <type_traits>
|
|
||||||
|
|
||||||
namespace facebook {
|
|
||||||
namespace yoga {
|
|
||||||
|
|
||||||
namespace detail {
|
|
||||||
|
|
||||||
constexpr size_t log2ceil(size_t n) {
|
|
||||||
return n < 1 ? 0 : (1 + log2ceil(n / 2));
|
|
||||||
}
|
|
||||||
|
|
||||||
// The number of bits necessary to represent enums defined with YG_ENUM_SEQ_DECL
|
|
||||||
template <typename Enum>
|
|
||||||
constexpr size_t bitWidth() {
|
|
||||||
static_assert(enums::count<Enum>() > 0,
|
|
||||||
"Enums must have at least one entries");
|
|
||||||
return log2ceil(enums::count<Enum>() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Number of bits needed for a boolean
|
|
||||||
template <>
|
|
||||||
constexpr size_t bitWidth<bool>() {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename U, typename... Ts>
|
|
||||||
struct BitTraits {};
|
|
||||||
|
|
||||||
template <typename U>
|
|
||||||
struct BitTraits<U> {
|
|
||||||
// Base cases
|
|
||||||
static constexpr size_t width(size_t) { return 0; }
|
|
||||||
static constexpr size_t shift(size_t) { return 0; }
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename U, typename T, typename... Ts>
|
|
||||||
struct BitTraits<U, T, Ts...> {
|
|
||||||
using Rest = BitTraits<U, Ts...>;
|
|
||||||
|
|
||||||
static constexpr size_t width(size_t idx) {
|
|
||||||
return idx == 0 ? bitWidth<T>() : Rest::width(idx - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static constexpr size_t shift(size_t idx) {
|
|
||||||
return idx == 0 ? Rest::width(0) + Rest::shift(0) : Rest::shift(idx - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static constexpr U mask(size_t idx) {
|
|
||||||
return ((U{1} << width(idx)) - 1) << shift(idx);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <size_t Idx, typename T, typename... Ts>
|
|
||||||
struct IndexedType {
|
|
||||||
using Type = typename IndexedType<Idx - 1, Ts...>::Type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T, typename... Ts>
|
|
||||||
struct IndexedType<0, T, Ts...> {
|
|
||||||
using Type = T;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
template <typename Storage, typename... Fields>
|
|
||||||
class Bitfield {
|
|
||||||
static_assert(std::is_integral<Storage>::value,
|
|
||||||
"Bitfield needs an integral storage type");
|
|
||||||
static_assert(std::is_unsigned<Storage>::value,
|
|
||||||
"Bitfield needs an unsigned storage type");
|
|
||||||
static_assert(sizeof...(Fields) > 0, "Bitfield needs at least one member");
|
|
||||||
|
|
||||||
using BitTraits = detail::BitTraits<Storage, Fields...>;
|
|
||||||
|
|
||||||
#if !defined(_MSC_VER) || _MSC_VER > 1914
|
|
||||||
static_assert(BitTraits::shift(0) + BitTraits::width(0) <=
|
|
||||||
std::numeric_limits<Storage>::digits,
|
|
||||||
"Specified storage type is too narrow to hold all types");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <size_t Idx>
|
|
||||||
using TypeAt = typename detail::IndexedType<Idx, Fields...>::Type;
|
|
||||||
|
|
||||||
template <size_t Idx, typename Value, typename... Values>
|
|
||||||
static constexpr Storage initStorage(Value value, Values... values) {
|
|
||||||
return ((value << BitTraits::shift(Idx)) & BitTraits::mask(Idx)) |
|
|
||||||
initStorage<Idx + 1, Values...>(values...);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <size_t Idx>
|
|
||||||
static constexpr Storage initStorage() {
|
|
||||||
return Storage{0};
|
|
||||||
}
|
|
||||||
|
|
||||||
Storage storage_ = 0;
|
|
||||||
|
|
||||||
public:
|
|
||||||
template <size_t Idx>
|
|
||||||
class Ref {
|
|
||||||
Bitfield& bitfield_;
|
|
||||||
|
|
||||||
public:
|
|
||||||
Ref(Bitfield& bitfield) : bitfield_(bitfield) {}
|
|
||||||
Ref& operator=(TypeAt<Idx> value) {
|
|
||||||
bitfield_.storage_ =
|
|
||||||
(bitfield_.storage_ & ~BitTraits::mask(Idx)) |
|
|
||||||
((value << BitTraits::shift(Idx)) & BitTraits::mask(Idx));
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
operator TypeAt<Idx>() const {
|
|
||||||
return const_cast<const Bitfield&>(bitfield_).at<Idx>();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
constexpr Bitfield() = default;
|
|
||||||
constexpr Bitfield(Fields... values) : storage_{initStorage<0>(values...)} {}
|
|
||||||
|
|
||||||
template <size_t Idx>
|
|
||||||
constexpr TypeAt<Idx> at() const {
|
|
||||||
return static_cast<TypeAt<Idx>>((storage_ & BitTraits::mask(Idx)) >>
|
|
||||||
BitTraits::shift(Idx));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <size_t Idx>
|
|
||||||
Ref<Idx> at() {
|
|
||||||
return {*this};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace yoga
|
|
||||||
} // namespace facebook
|
|
||||||
@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
|
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
using namespace facebook;
|
using namespace facebook;
|
||||||
|
|
||||||
YGFlexDirection YGFlexDirectionCross(const YGFlexDirection flexDirection,
|
YGFlexDirection YGFlexDirectionCross(const YGFlexDirection flexDirection,
|
||||||
@ -51,6 +53,13 @@ bool YGFloatsEqual(const float a, const float b) {
|
|||||||
return yoga::isUndefined(a) && yoga::isUndefined(b);
|
return yoga::isUndefined(a) && yoga::isUndefined(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool YGDoubleEqual(const double a, const double b) {
|
||||||
|
if (!yoga::isUndefined(a) && !yoga::isUndefined(b)) {
|
||||||
|
return fabs(a - b) < 0.0001f;
|
||||||
|
}
|
||||||
|
return yoga::isUndefined(a) && yoga::isUndefined(b);
|
||||||
|
}
|
||||||
|
|
||||||
float YGFloatSanitize(const float val) {
|
float YGFloatSanitize(const float val) {
|
||||||
return yoga::isUndefined(val) ? 0 : val;
|
return yoga::isUndefined(val) ? 0 : val;
|
||||||
}
|
}
|
||||||
@ -64,3 +73,7 @@ YGFloatOptional YGFloatOptionalMax(YGFloatOptional op1, YGFloatOptional op2) {
|
|||||||
}
|
}
|
||||||
return op1.isUndefined() ? op2 : op1;
|
return op1.isUndefined() ? op2 : op1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void throwLogicalErrorWithMessage(const char* message) {
|
||||||
|
throw std::logic_error(message);
|
||||||
|
}
|
||||||
|
|||||||
@ -63,6 +63,8 @@ inline bool YGValueEqual(facebook::yoga::detail::CompactValue a,
|
|||||||
// difference between two floats is less than 0.0001f or both are undefined.
|
// difference between two floats is less than 0.0001f or both are undefined.
|
||||||
bool YGFloatsEqual(const float a, const float b);
|
bool YGFloatsEqual(const float a, const float b);
|
||||||
|
|
||||||
|
bool YGDoubleEqual(const double a, const double b);
|
||||||
|
|
||||||
float YGFloatMax(const float a, const float b);
|
float YGFloatMax(const float a, const float b);
|
||||||
|
|
||||||
YGFloatOptional YGFloatOptionalMax(const YGFloatOptional op1,
|
YGFloatOptional YGFloatOptionalMax(const YGFloatOptional op1,
|
||||||
@ -133,3 +135,5 @@ inline YGFloatOptional YGResolveValueMargin(yoga::detail::CompactValue value,
|
|||||||
const float ownerSize) {
|
const float ownerSize) {
|
||||||
return value.isAuto() ? YGFloatOptional{0} : YGResolveValue(value, ownerSize);
|
return value.isAuto() ? YGFloatOptional{0} : YGResolveValue(value, ownerSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void throwLogicalErrorWithMessage(const char* message);
|
||||||
|
|||||||
@ -179,6 +179,8 @@ const char* YGOverflowToString(const YGOverflow value) {
|
|||||||
|
|
||||||
const char* YGPositionTypeToString(const YGPositionType value) {
|
const char* YGPositionTypeToString(const YGPositionType value) {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
|
case YGPositionTypeStatic:
|
||||||
|
return "static";
|
||||||
case YGPositionTypeRelative:
|
case YGPositionTypeRelative:
|
||||||
return "relative";
|
return "relative";
|
||||||
case YGPositionTypeAbsolute:
|
case YGPositionTypeAbsolute:
|
||||||
|
|||||||
@ -90,7 +90,8 @@ YG_ENUM_SEQ_DECL(YGNodeType, YGNodeTypeDefault, YGNodeTypeText)
|
|||||||
YG_ENUM_SEQ_DECL(YGOverflow, YGOverflowVisible, YGOverflowHidden,
|
YG_ENUM_SEQ_DECL(YGOverflow, YGOverflowVisible, YGOverflowHidden,
|
||||||
YGOverflowScroll)
|
YGOverflowScroll)
|
||||||
|
|
||||||
YG_ENUM_SEQ_DECL(YGPositionType, YGPositionTypeRelative, YGPositionTypeAbsolute)
|
YG_ENUM_SEQ_DECL(YGPositionType, YGPositionTypeStatic, YGPositionTypeRelative,
|
||||||
|
YGPositionTypeAbsolute)
|
||||||
|
|
||||||
YG_ENUM_DECL(YGPrintOptions, YGPrintOptionsLayout = 1, YGPrintOptionsStyle = 2,
|
YG_ENUM_DECL(YGPrintOptions, YGPrintOptionsLayout = 1, YGPrintOptionsStyle = 2,
|
||||||
YGPrintOptionsChildren = 4)
|
YGPrintOptionsChildren = 4)
|
||||||
|
|||||||
@ -6,10 +6,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Bitfield.h"
|
#include "BitUtils.h"
|
||||||
#include "YGFloatOptional.h"
|
#include "YGFloatOptional.h"
|
||||||
#include "Yoga-internal.h"
|
#include "Yoga-internal.h"
|
||||||
|
|
||||||
|
using namespace facebook::yoga;
|
||||||
|
|
||||||
struct YGLayout {
|
struct YGLayout {
|
||||||
std::array<float, 4> position = {};
|
std::array<float, 4> position = {};
|
||||||
std::array<float, 2> dimensions = {{YGUndefined, YGUndefined}};
|
std::array<float, 2> dimensions = {{YGUndefined, YGUndefined}};
|
||||||
@ -18,12 +20,14 @@ struct YGLayout {
|
|||||||
std::array<float, 4> padding = {};
|
std::array<float, 4> padding = {};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr size_t directionIdx = 0;
|
static constexpr size_t directionOffset = 0;
|
||||||
static constexpr size_t didUseLegacyFlagIdx = 1;
|
static constexpr size_t didUseLegacyFlagOffset =
|
||||||
static constexpr size_t doesLegacyStretchFlagAffectsLayoutIdx = 2;
|
directionOffset + facebook::yoga::detail::bitWidthFn<YGDirection>();
|
||||||
static constexpr size_t hadOverflowIdx = 3;
|
static constexpr size_t doesLegacyStretchFlagAffectsLayoutOffset =
|
||||||
facebook::yoga::Bitfield<uint8_t, YGDirection, bool, bool, bool> flags_ = {
|
didUseLegacyFlagOffset + 1;
|
||||||
YGDirectionInherit, false, false, false};
|
static constexpr size_t hadOverflowOffset =
|
||||||
|
doesLegacyStretchFlagAffectsLayoutOffset + 1;
|
||||||
|
uint8_t flags = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
uint32_t computedFlexBasisGeneration = 0;
|
uint32_t computedFlexBasisGeneration = 0;
|
||||||
@ -32,7 +36,7 @@ struct YGLayout {
|
|||||||
// Instead of recomputing the entire layout every single time, we cache some
|
// Instead of recomputing the entire layout every single time, we cache some
|
||||||
// information to break early when nothing changed
|
// information to break early when nothing changed
|
||||||
uint32_t generationCount = 0;
|
uint32_t generationCount = 0;
|
||||||
YGDirection lastOwnerDirection = (YGDirection)-1;
|
YGDirection lastOwnerDirection = YGDirectionInherit;
|
||||||
|
|
||||||
uint32_t nextCachedMeasurementsIndex = 0;
|
uint32_t nextCachedMeasurementsIndex = 0;
|
||||||
std::array<YGCachedMeasurement, YG_MAX_CACHED_RESULT_COUNT>
|
std::array<YGCachedMeasurement, YG_MAX_CACHED_RESULT_COUNT>
|
||||||
@ -41,27 +45,41 @@ struct YGLayout {
|
|||||||
|
|
||||||
YGCachedMeasurement cachedLayout = YGCachedMeasurement();
|
YGCachedMeasurement cachedLayout = YGCachedMeasurement();
|
||||||
|
|
||||||
YGDirection direction() const { return flags_.at<directionIdx>(); }
|
YGDirection direction() const {
|
||||||
decltype(flags_)::Ref<directionIdx> direction() {
|
return facebook::yoga::detail::getEnumData<YGDirection>(flags,
|
||||||
return flags_.at<directionIdx>();
|
directionOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool didUseLegacyFlag() const { return flags_.at<didUseLegacyFlagIdx>(); }
|
void setDirection(YGDirection direction) {
|
||||||
decltype(flags_)::Ref<didUseLegacyFlagIdx> didUseLegacyFlag() {
|
facebook::yoga::detail::setEnumData<YGDirection>(flags, directionOffset,
|
||||||
return flags_.at<didUseLegacyFlagIdx>();
|
direction);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool didUseLegacyFlag() const {
|
||||||
|
return facebook::yoga::detail::getBooleanData(flags,
|
||||||
|
didUseLegacyFlagOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
void setDidUseLegacyFlag(bool val) {
|
||||||
|
facebook::yoga::detail::setBooleanData(flags, didUseLegacyFlagOffset, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool doesLegacyStretchFlagAffectsLayout() const {
|
bool doesLegacyStretchFlagAffectsLayout() const {
|
||||||
return flags_.at<doesLegacyStretchFlagAffectsLayoutIdx>();
|
return facebook::yoga::detail::getBooleanData(
|
||||||
}
|
flags, doesLegacyStretchFlagAffectsLayoutOffset);
|
||||||
decltype(flags_)::Ref<doesLegacyStretchFlagAffectsLayoutIdx>
|
|
||||||
doesLegacyStretchFlagAffectsLayout() {
|
|
||||||
return flags_.at<doesLegacyStretchFlagAffectsLayoutIdx>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hadOverflow() const { return flags_.at<hadOverflowIdx>(); }
|
void setDoesLegacyStretchFlagAffectsLayout(bool val) {
|
||||||
decltype(flags_)::Ref<hadOverflowIdx> hadOverflow() {
|
facebook::yoga::detail::setBooleanData(
|
||||||
return flags_.at<hadOverflowIdx>();
|
flags, doesLegacyStretchFlagAffectsLayoutOffset, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool hadOverflow() const {
|
||||||
|
return facebook::yoga::detail::getBooleanData(flags, hadOverflowOffset);
|
||||||
|
}
|
||||||
|
void setHadOverflow(bool hadOverflow) {
|
||||||
|
facebook::yoga::detail::setBooleanData(flags, hadOverflowOffset,
|
||||||
|
hadOverflow);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(YGLayout layout) const;
|
bool operator==(YGLayout layout) const;
|
||||||
|
|||||||
@ -18,7 +18,7 @@ using facebook::yoga::detail::CompactValue;
|
|||||||
|
|
||||||
YGNode::YGNode(YGNode&& node) {
|
YGNode::YGNode(YGNode&& node) {
|
||||||
context_ = node.context_;
|
context_ = node.context_;
|
||||||
flags_ = node.flags_;
|
flags = node.flags;
|
||||||
measure_ = node.measure_;
|
measure_ = node.measure_;
|
||||||
baseline_ = node.baseline_;
|
baseline_ = node.baseline_;
|
||||||
print_ = node.print_;
|
print_ = node.print_;
|
||||||
@ -31,7 +31,7 @@ YGNode::YGNode(YGNode&& node) {
|
|||||||
config_ = node.config_;
|
config_ = node.config_;
|
||||||
resolvedDimensions_ = node.resolvedDimensions_;
|
resolvedDimensions_ = node.resolvedDimensions_;
|
||||||
for (auto c : children_) {
|
for (auto c : children_) {
|
||||||
c->setOwner(c);
|
c->setOwner(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ YGNode::YGNode(const YGNode& node, YGConfigRef config) : YGNode{node} {
|
|||||||
|
|
||||||
void YGNode::print(void* printContext) {
|
void YGNode::print(void* printContext) {
|
||||||
if (print_.noContext != nullptr) {
|
if (print_.noContext != nullptr) {
|
||||||
if (flags_.at<printUsesContext_>()) {
|
if (facebook::yoga::detail::getBooleanData(flags, printUsesContext_)) {
|
||||||
print_.withContext(this, printContext);
|
print_.withContext(this, printContext);
|
||||||
} else {
|
} else {
|
||||||
print_.noContext(this);
|
print_.noContext(this);
|
||||||
@ -140,14 +140,14 @@ YGFloatOptional YGNode::getMarginForAxis(const YGFlexDirection axis,
|
|||||||
|
|
||||||
YGSize YGNode::measure(float width, YGMeasureMode widthMode, float height,
|
YGSize YGNode::measure(float width, YGMeasureMode widthMode, float height,
|
||||||
YGMeasureMode heightMode, void* layoutContext) {
|
YGMeasureMode heightMode, void* layoutContext) {
|
||||||
return flags_.at<measureUsesContext_>()
|
return facebook::yoga::detail::getBooleanData(flags, measureUsesContext_)
|
||||||
? measure_.withContext(this, width, widthMode, height, heightMode,
|
? measure_.withContext(this, width, widthMode, height, heightMode,
|
||||||
layoutContext)
|
layoutContext)
|
||||||
: measure_.noContext(this, width, widthMode, height, heightMode);
|
: measure_.noContext(this, width, widthMode, height, heightMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
float YGNode::baseline(float width, float height, void* layoutContext) {
|
float YGNode::baseline(float width, float height, void* layoutContext) {
|
||||||
return flags_.at<baselineUsesContext_>()
|
return facebook::yoga::detail::getBooleanData(flags, baselineUsesContext_)
|
||||||
? baseline_.withContext(this, width, height, layoutContext)
|
? baseline_.withContext(this, width, height, layoutContext)
|
||||||
: baseline_.noContext(this, width, height);
|
: baseline_.noContext(this, width, height);
|
||||||
}
|
}
|
||||||
@ -158,7 +158,7 @@ void YGNode::setMeasureFunc(decltype(YGNode::measure_) measureFunc) {
|
|||||||
if (measureFunc.noContext == nullptr) {
|
if (measureFunc.noContext == nullptr) {
|
||||||
// TODO: t18095186 Move nodeType to opt-in function and mark appropriate
|
// TODO: t18095186 Move nodeType to opt-in function and mark appropriate
|
||||||
// places in Litho
|
// places in Litho
|
||||||
flags_.at<nodeType_>() = YGNodeTypeDefault;
|
setNodeType(YGNodeTypeDefault);
|
||||||
} else {
|
} else {
|
||||||
YGAssertWithNode(
|
YGAssertWithNode(
|
||||||
this, children_.size() == 0,
|
this, children_.size() == 0,
|
||||||
@ -173,14 +173,14 @@ void YGNode::setMeasureFunc(decltype(YGNode::measure_) measureFunc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void YGNode::setMeasureFunc(YGMeasureFunc measureFunc) {
|
void YGNode::setMeasureFunc(YGMeasureFunc measureFunc) {
|
||||||
flags_.at<measureUsesContext_>() = false;
|
facebook::yoga::detail::setBooleanData(flags, measureUsesContext_, false);
|
||||||
decltype(YGNode::measure_) m;
|
decltype(YGNode::measure_) m;
|
||||||
m.noContext = measureFunc;
|
m.noContext = measureFunc;
|
||||||
setMeasureFunc(m);
|
setMeasureFunc(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
YOGA_EXPORT void YGNode::setMeasureFunc(MeasureWithContextFn measureFunc) {
|
YOGA_EXPORT void YGNode::setMeasureFunc(MeasureWithContextFn measureFunc) {
|
||||||
flags_.at<measureUsesContext_>() = true;
|
facebook::yoga::detail::setBooleanData(flags, measureUsesContext_, true);
|
||||||
decltype(YGNode::measure_) m;
|
decltype(YGNode::measure_) m;
|
||||||
m.withContext = measureFunc;
|
m.withContext = measureFunc;
|
||||||
setMeasureFunc(m);
|
setMeasureFunc(m);
|
||||||
@ -199,10 +199,10 @@ void YGNode::insertChild(YGNodeRef child, uint32_t index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void YGNode::setDirty(bool isDirty) {
|
void YGNode::setDirty(bool isDirty) {
|
||||||
if (isDirty == flags_.at<isDirty_>()) {
|
if (isDirty == facebook::yoga::detail::getBooleanData(flags, isDirty_)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
flags_.at<isDirty_>() = isDirty;
|
facebook::yoga::detail::setBooleanData(flags, isDirty_, isDirty);
|
||||||
if (isDirty && dirtied_) {
|
if (isDirty && dirtied_) {
|
||||||
dirtied_(this);
|
dirtied_(this);
|
||||||
}
|
}
|
||||||
@ -223,7 +223,7 @@ void YGNode::removeChild(uint32_t index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void YGNode::setLayoutDirection(YGDirection direction) {
|
void YGNode::setLayoutDirection(YGDirection direction) {
|
||||||
layout_.direction() = direction;
|
layout_.setDirection(direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
void YGNode::setLayoutMargin(float margin, int index) {
|
void YGNode::setLayoutMargin(float margin, int index) {
|
||||||
@ -261,7 +261,7 @@ void YGNode::setLayoutMeasuredDimension(float measuredDimension, int index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void YGNode::setLayoutHadOverflow(bool hadOverflow) {
|
void YGNode::setLayoutHadOverflow(bool hadOverflow) {
|
||||||
layout_.hadOverflow() = hadOverflow;
|
layout_.setHadOverflow(hadOverflow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void YGNode::setLayoutDimension(float dimension, int index) {
|
void YGNode::setLayoutDimension(float dimension, int index) {
|
||||||
@ -294,6 +294,9 @@ void YGNode::setPosition(const YGDirection direction, const float mainSize,
|
|||||||
const YGFlexDirection crossAxis =
|
const YGFlexDirection crossAxis =
|
||||||
YGFlexDirectionCross(mainAxis, directionRespectingRoot);
|
YGFlexDirectionCross(mainAxis, directionRespectingRoot);
|
||||||
|
|
||||||
|
// Here we should check for `YGPositionTypeStatic` and in this case zero inset
|
||||||
|
// properties (left, right, top, bottom, begin, end).
|
||||||
|
// https://www.w3.org/TR/css-position-3/#valdef-position-static
|
||||||
const YGFloatOptional relativePositionMain =
|
const YGFloatOptional relativePositionMain =
|
||||||
relativePosition(mainAxis, mainSize);
|
relativePosition(mainAxis, mainSize);
|
||||||
const YGFloatOptional relativePositionCross =
|
const YGFloatOptional relativePositionCross =
|
||||||
@ -338,7 +341,9 @@ YGValue YGNode::resolveFlexBasisPtr() const {
|
|||||||
return flexBasis;
|
return flexBasis;
|
||||||
}
|
}
|
||||||
if (!style_.flex().isUndefined() && style_.flex().unwrap() > 0.0f) {
|
if (!style_.flex().isUndefined() && style_.flex().unwrap() > 0.0f) {
|
||||||
return flags_.at<useWebDefaults_>() ? YGValueAuto : YGValueZero;
|
return facebook::yoga::detail::getBooleanData(flags, useWebDefaults_)
|
||||||
|
? YGValueAuto
|
||||||
|
: YGValueZero;
|
||||||
}
|
}
|
||||||
return YGValueAuto;
|
return YGValueAuto;
|
||||||
}
|
}
|
||||||
@ -377,7 +382,7 @@ void YGNode::cloneChildrenIfNeeded(void* cloneContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void YGNode::markDirtyAndPropogate() {
|
void YGNode::markDirtyAndPropogate() {
|
||||||
if (!flags_.at<isDirty_>()) {
|
if (!facebook::yoga::detail::getBooleanData(flags, isDirty_)) {
|
||||||
setDirty(true);
|
setDirty(true);
|
||||||
setLayoutComputedFlexBasis(YGFloatOptional());
|
setLayoutComputedFlexBasis(YGFloatOptional());
|
||||||
if (owner_) {
|
if (owner_) {
|
||||||
@ -387,7 +392,7 @@ void YGNode::markDirtyAndPropogate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void YGNode::markDirtyAndPropogateDownwards() {
|
void YGNode::markDirtyAndPropogateDownwards() {
|
||||||
flags_.at<isDirty_>() = true;
|
facebook::yoga::detail::setBooleanData(flags, isDirty_, true);
|
||||||
for_each(children_.begin(), children_.end(), [](YGNodeRef childNode) {
|
for_each(children_.begin(), children_.end(), [](YGNodeRef childNode) {
|
||||||
childNode->markDirtyAndPropogateDownwards();
|
childNode->markDirtyAndPropogateDownwards();
|
||||||
});
|
});
|
||||||
@ -414,16 +419,17 @@ float YGNode::resolveFlexShrink() const {
|
|||||||
if (!style_.flexShrink().isUndefined()) {
|
if (!style_.flexShrink().isUndefined()) {
|
||||||
return style_.flexShrink().unwrap();
|
return style_.flexShrink().unwrap();
|
||||||
}
|
}
|
||||||
if (!flags_.at<useWebDefaults_>() && !style_.flex().isUndefined() &&
|
if (!facebook::yoga::detail::getBooleanData(flags, useWebDefaults_) &&
|
||||||
style_.flex().unwrap() < 0.0f) {
|
!style_.flex().isUndefined() && style_.flex().unwrap() < 0.0f) {
|
||||||
return -style_.flex().unwrap();
|
return -style_.flex().unwrap();
|
||||||
}
|
}
|
||||||
return flags_.at<useWebDefaults_>() ? kWebDefaultFlexShrink
|
return facebook::yoga::detail::getBooleanData(flags, useWebDefaults_)
|
||||||
: kDefaultFlexShrink;
|
? kWebDefaultFlexShrink
|
||||||
|
: kDefaultFlexShrink;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool YGNode::isNodeFlexible() {
|
bool YGNode::isNodeFlexible() {
|
||||||
return ((style_.positionType() == YGPositionTypeRelative) &&
|
return ((style_.positionType() != YGPositionTypeAbsolute) &&
|
||||||
(resolveFlexGrow() != 0 || resolveFlexShrink() != 0));
|
(resolveFlexGrow() != 0 || resolveFlexShrink() != 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -518,11 +524,11 @@ bool YGNode::didUseLegacyFlag() {
|
|||||||
|
|
||||||
void YGNode::setLayoutDoesLegacyFlagAffectsLayout(
|
void YGNode::setLayoutDoesLegacyFlagAffectsLayout(
|
||||||
bool doesLegacyFlagAffectsLayout) {
|
bool doesLegacyFlagAffectsLayout) {
|
||||||
layout_.doesLegacyStretchFlagAffectsLayout() = doesLegacyFlagAffectsLayout;
|
layout_.setDoesLegacyStretchFlagAffectsLayout(doesLegacyFlagAffectsLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void YGNode::setLayoutDidUseLegacyFlag(bool didUseLegacyFlag) {
|
void YGNode::setLayoutDidUseLegacyFlag(bool didUseLegacyFlag) {
|
||||||
layout_.didUseLegacyFlag() = didUseLegacyFlag;
|
layout_.setDidUseLegacyFlag(didUseLegacyFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool YGNode::isLayoutTreeEqualToNode(const YGNode& node) const {
|
bool YGNode::isLayoutTreeEqualToNode(const YGNode& node) const {
|
||||||
@ -557,7 +563,8 @@ void YGNode::reset() {
|
|||||||
|
|
||||||
clearChildren();
|
clearChildren();
|
||||||
|
|
||||||
auto webDefaults = flags_.at<useWebDefaults_>();
|
auto webDefaults =
|
||||||
|
facebook::yoga::detail::getBooleanData(flags, useWebDefaults_);
|
||||||
*this = YGNode{getConfig()};
|
*this = YGNode{getConfig()};
|
||||||
if (webDefaults) {
|
if (webDefaults) {
|
||||||
useWebDefaults();
|
useWebDefaults();
|
||||||
|
|||||||
@ -6,11 +6,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#include "Bitfield.h"
|
#include "BitUtils.h"
|
||||||
#include "CompactValue.h"
|
#include "CompactValue.h"
|
||||||
#include "YGConfig.h"
|
#include "YGConfig.h"
|
||||||
#include "YGLayout.h"
|
#include "YGLayout.h"
|
||||||
@ -37,10 +40,7 @@ struct YOGA_EXPORT YGNode {
|
|||||||
static constexpr size_t useWebDefaults_ = 7;
|
static constexpr size_t useWebDefaults_ = 7;
|
||||||
|
|
||||||
void* context_ = nullptr;
|
void* context_ = nullptr;
|
||||||
using Flags = facebook::yoga::Bitfield<uint8_t, bool, bool, bool, YGNodeType,
|
uint8_t flags = 1;
|
||||||
bool, bool, bool, bool>;
|
|
||||||
Flags flags_ = {true, false, false, YGNodeTypeDefault,
|
|
||||||
false, false, false, false};
|
|
||||||
uint8_t reserved_ = 0;
|
uint8_t reserved_ = 0;
|
||||||
union {
|
union {
|
||||||
YGMeasureFunc noContext;
|
YGMeasureFunc noContext;
|
||||||
@ -71,13 +71,13 @@ struct YOGA_EXPORT YGNode {
|
|||||||
void setBaselineFunc(decltype(baseline_));
|
void setBaselineFunc(decltype(baseline_));
|
||||||
|
|
||||||
void useWebDefaults() {
|
void useWebDefaults() {
|
||||||
flags_.at<useWebDefaults_>() = true;
|
facebook::yoga::detail::setBooleanData(flags, useWebDefaults_, true);
|
||||||
style_.flexDirection() = YGFlexDirectionRow;
|
style_.flexDirection() = YGFlexDirectionRow;
|
||||||
style_.alignContent() = YGAlignStretch;
|
style_.alignContent() = YGAlignStretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DANGER DANGER DANGER!
|
// DANGER DANGER DANGER!
|
||||||
// If the the node assigned to has children, we'd either have to deallocate
|
// If the node assigned to has children, we'd either have to deallocate
|
||||||
// them (potentially incorrect) or ignore them (danger of leaks). Only ever
|
// them (potentially incorrect) or ignore them (danger of leaks). Only ever
|
||||||
// use this after checking that there are no children.
|
// use this after checking that there are no children.
|
||||||
// DO NOT CHANGE THE VISIBILITY OF THIS METHOD!
|
// DO NOT CHANGE THE VISIBILITY OF THIS METHOD!
|
||||||
@ -115,9 +115,13 @@ struct YOGA_EXPORT YGNode {
|
|||||||
|
|
||||||
void print(void*);
|
void print(void*);
|
||||||
|
|
||||||
bool getHasNewLayout() const { return flags_.at<hasNewLayout_>(); }
|
bool getHasNewLayout() const {
|
||||||
|
return facebook::yoga::detail::getBooleanData(flags, hasNewLayout_);
|
||||||
|
}
|
||||||
|
|
||||||
YGNodeType getNodeType() const { return flags_.at<nodeType_>(); }
|
YGNodeType getNodeType() const {
|
||||||
|
return facebook::yoga::detail::getEnumData<YGNodeType>(flags, nodeType_);
|
||||||
|
}
|
||||||
|
|
||||||
bool hasMeasureFunc() const noexcept { return measure_.noContext != nullptr; }
|
bool hasMeasureFunc() const noexcept { return measure_.noContext != nullptr; }
|
||||||
|
|
||||||
@ -143,7 +147,9 @@ struct YOGA_EXPORT YGNode {
|
|||||||
|
|
||||||
uint32_t getLineIndex() const { return lineIndex_; }
|
uint32_t getLineIndex() const { return lineIndex_; }
|
||||||
|
|
||||||
bool isReferenceBaseline() { return flags_.at<isReferenceBaseline_>(); }
|
bool isReferenceBaseline() {
|
||||||
|
return facebook::yoga::detail::getBooleanData(flags, isReferenceBaseline_);
|
||||||
|
}
|
||||||
|
|
||||||
// returns the YGNodeRef that owns this YGNode. An owner is used to identify
|
// returns the YGNodeRef that owns this YGNode. An owner is used to identify
|
||||||
// the YogaTree that a YGNode belongs to. This method will return the parent
|
// the YogaTree that a YGNode belongs to. This method will return the parent
|
||||||
@ -176,7 +182,9 @@ struct YOGA_EXPORT YGNode {
|
|||||||
|
|
||||||
YGConfigRef getConfig() const { return config_; }
|
YGConfigRef getConfig() const { return config_; }
|
||||||
|
|
||||||
bool isDirty() const { return flags_.at<isDirty_>(); }
|
bool isDirty() const {
|
||||||
|
return facebook::yoga::detail::getBooleanData(flags, isDirty_);
|
||||||
|
}
|
||||||
|
|
||||||
std::array<YGValue, 2> getResolvedDimensions() const {
|
std::array<YGValue, 2> getResolvedDimensions() const {
|
||||||
return resolvedDimensions_;
|
return resolvedDimensions_;
|
||||||
@ -215,19 +223,22 @@ struct YOGA_EXPORT YGNode {
|
|||||||
|
|
||||||
void setPrintFunc(YGPrintFunc printFunc) {
|
void setPrintFunc(YGPrintFunc printFunc) {
|
||||||
print_.noContext = printFunc;
|
print_.noContext = printFunc;
|
||||||
flags_.at<printUsesContext_>() = false;
|
facebook::yoga::detail::setBooleanData(flags, printUsesContext_, false);
|
||||||
}
|
}
|
||||||
void setPrintFunc(PrintWithContextFn printFunc) {
|
void setPrintFunc(PrintWithContextFn printFunc) {
|
||||||
print_.withContext = printFunc;
|
print_.withContext = printFunc;
|
||||||
flags_.at<printUsesContext_>() = true;
|
facebook::yoga::detail::setBooleanData(flags, printUsesContext_, true);
|
||||||
}
|
}
|
||||||
void setPrintFunc(std::nullptr_t) { setPrintFunc(YGPrintFunc{nullptr}); }
|
void setPrintFunc(std::nullptr_t) { setPrintFunc(YGPrintFunc{nullptr}); }
|
||||||
|
|
||||||
void setHasNewLayout(bool hasNewLayout) {
|
void setHasNewLayout(bool hasNewLayout) {
|
||||||
flags_.at<hasNewLayout_>() = hasNewLayout;
|
facebook::yoga::detail::setBooleanData(flags, hasNewLayout_, hasNewLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setNodeType(YGNodeType nodeType) { flags_.at<nodeType_>() = nodeType; }
|
void setNodeType(YGNodeType nodeType) {
|
||||||
|
return facebook::yoga::detail::setEnumData<YGNodeType>(flags, nodeType_,
|
||||||
|
nodeType);
|
||||||
|
}
|
||||||
|
|
||||||
void setMeasureFunc(YGMeasureFunc measureFunc);
|
void setMeasureFunc(YGMeasureFunc measureFunc);
|
||||||
void setMeasureFunc(MeasureWithContextFn);
|
void setMeasureFunc(MeasureWithContextFn);
|
||||||
@ -236,11 +247,11 @@ struct YOGA_EXPORT YGNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setBaselineFunc(YGBaselineFunc baseLineFunc) {
|
void setBaselineFunc(YGBaselineFunc baseLineFunc) {
|
||||||
flags_.at<baselineUsesContext_>() = false;
|
facebook::yoga::detail::setBooleanData(flags, baselineUsesContext_, false);
|
||||||
baseline_.noContext = baseLineFunc;
|
baseline_.noContext = baseLineFunc;
|
||||||
}
|
}
|
||||||
void setBaselineFunc(BaselineWithContextFn baseLineFunc) {
|
void setBaselineFunc(BaselineWithContextFn baseLineFunc) {
|
||||||
flags_.at<baselineUsesContext_>() = true;
|
facebook::yoga::detail::setBooleanData(flags, baselineUsesContext_, true);
|
||||||
baseline_.withContext = baseLineFunc;
|
baseline_.withContext = baseLineFunc;
|
||||||
}
|
}
|
||||||
void setBaselineFunc(std::nullptr_t) {
|
void setBaselineFunc(std::nullptr_t) {
|
||||||
@ -256,7 +267,8 @@ struct YOGA_EXPORT YGNode {
|
|||||||
void setLineIndex(uint32_t lineIndex) { lineIndex_ = lineIndex; }
|
void setLineIndex(uint32_t lineIndex) { lineIndex_ = lineIndex; }
|
||||||
|
|
||||||
void setIsReferenceBaseline(bool isReferenceBaseline) {
|
void setIsReferenceBaseline(bool isReferenceBaseline) {
|
||||||
flags_.at<isReferenceBaseline_>() = isReferenceBaseline;
|
facebook::yoga::detail::setBooleanData(flags, isReferenceBaseline_,
|
||||||
|
isReferenceBaseline);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setOwner(YGNodeRef owner) { owner_ = owner; }
|
void setOwner(YGNodeRef owner) { owner_ = owner; }
|
||||||
@ -310,3 +322,5 @@ struct YOGA_EXPORT YGNode {
|
|||||||
bool isLayoutTreeEqualToNode(const YGNode& node) const;
|
bool isLayoutTreeEqualToNode(const YGNode& node) const;
|
||||||
void reset();
|
void reset();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@ -6,12 +6,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#include "Bitfield.h"
|
#include "BitUtils.h"
|
||||||
#include "CompactValue.h"
|
#include "CompactValue.h"
|
||||||
#include "YGEnums.h"
|
#include "YGEnums.h"
|
||||||
#include "YGFloatOptional.h"
|
#include "YGFloatOptional.h"
|
||||||
@ -28,6 +31,19 @@ class YOGA_EXPORT YGStyle {
|
|||||||
using Dimensions = Values<YGDimension>;
|
using Dimensions = Values<YGDimension>;
|
||||||
using Edges = Values<YGEdge>;
|
using Edges = Values<YGEdge>;
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct BitfieldRef {
|
||||||
|
YGStyle& style;
|
||||||
|
size_t offset;
|
||||||
|
operator T() const {
|
||||||
|
return facebook::yoga::detail::getEnumData<T>(style.flags, offset);
|
||||||
|
}
|
||||||
|
BitfieldRef<T>& operator=(T x) {
|
||||||
|
facebook::yoga::detail::setEnumData<T>(style.flags, offset, x);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template <typename T, T YGStyle::*Prop>
|
template <typename T, T YGStyle::*Prop>
|
||||||
struct Ref {
|
struct Ref {
|
||||||
YGStyle& style;
|
YGStyle& style;
|
||||||
@ -56,35 +72,41 @@ class YOGA_EXPORT YGStyle {
|
|||||||
style.*Prop = values;
|
style.*Prop = values;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
operator const Values<Idx>&() const { return style.*Prop; }
|
operator const Values<Idx> &() const { return style.*Prop; }
|
||||||
Ref operator[](Idx idx) { return {style, idx}; }
|
Ref operator[](Idx idx) { return {style, idx}; }
|
||||||
CompactValue operator[](Idx idx) const { return (style.*Prop)[idx]; }
|
CompactValue operator[](Idx idx) const { return (style.*Prop)[idx]; }
|
||||||
};
|
};
|
||||||
|
|
||||||
YGStyle() = default;
|
YGStyle() {
|
||||||
|
alignContent() = YGAlignFlexStart;
|
||||||
|
alignItems() = YGAlignStretch;
|
||||||
|
}
|
||||||
~YGStyle() = default;
|
~YGStyle() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr size_t directionIdx = 0;
|
static constexpr size_t directionOffset = 0;
|
||||||
static constexpr size_t flexDirectionIdx = 1;
|
static constexpr size_t flexdirectionOffset =
|
||||||
static constexpr size_t justifyContentIdx = 2;
|
directionOffset + facebook::yoga::detail::bitWidthFn<YGDirection>();
|
||||||
static constexpr size_t alignContentIdx = 3;
|
static constexpr size_t justifyContentOffset =
|
||||||
static constexpr size_t alignItemsIdx = 4;
|
flexdirectionOffset +
|
||||||
static constexpr size_t alignSelfIdx = 5;
|
facebook::yoga::detail::bitWidthFn<YGFlexDirection>();
|
||||||
static constexpr size_t positionTypeIdx = 6;
|
static constexpr size_t alignContentOffset =
|
||||||
static constexpr size_t flexWrapIdx = 7;
|
justifyContentOffset + facebook::yoga::detail::bitWidthFn<YGJustify>();
|
||||||
static constexpr size_t overflowIdx = 8;
|
static constexpr size_t alignItemsOffset =
|
||||||
static constexpr size_t displayIdx = 9;
|
alignContentOffset + facebook::yoga::detail::bitWidthFn<YGAlign>();
|
||||||
using Flags =
|
static constexpr size_t alignSelfOffset =
|
||||||
facebook::yoga::Bitfield<uint32_t, YGDirection, YGFlexDirection,
|
alignItemsOffset + facebook::yoga::detail::bitWidthFn<YGAlign>();
|
||||||
YGJustify, YGAlign, YGAlign, YGAlign,
|
static constexpr size_t positionTypeOffset =
|
||||||
YGPositionType, YGWrap, YGOverflow, YGDisplay>;
|
alignSelfOffset + facebook::yoga::detail::bitWidthFn<YGAlign>();
|
||||||
|
static constexpr size_t flexWrapOffset =
|
||||||
|
positionTypeOffset + facebook::yoga::detail::bitWidthFn<YGPositionType>();
|
||||||
|
static constexpr size_t overflowOffset =
|
||||||
|
flexWrapOffset + facebook::yoga::detail::bitWidthFn<YGWrap>();
|
||||||
|
static constexpr size_t displayOffset =
|
||||||
|
overflowOffset + facebook::yoga::detail::bitWidthFn<YGOverflow>();
|
||||||
|
|
||||||
|
uint32_t flags = 0;
|
||||||
|
|
||||||
Flags flags_ = {YGDirectionInherit, YGFlexDirectionColumn,
|
|
||||||
YGJustifyFlexStart, YGAlignFlexStart,
|
|
||||||
YGAlignStretch, YGAlignAuto,
|
|
||||||
YGPositionTypeRelative, YGWrapNoWrap,
|
|
||||||
YGOverflowVisible, YGDisplayFlex};
|
|
||||||
YGFloatOptional flex_ = {};
|
YGFloatOptional flex_ = {};
|
||||||
YGFloatOptional flexGrow_ = {};
|
YGFloatOptional flexGrow_ = {};
|
||||||
YGFloatOptional flexShrink_ = {};
|
YGFloatOptional flexShrink_ = {};
|
||||||
@ -103,45 +125,68 @@ class YOGA_EXPORT YGStyle {
|
|||||||
// for library users needing a type
|
// for library users needing a type
|
||||||
using ValueRepr = std::remove_reference<decltype(margin_[0])>::type;
|
using ValueRepr = std::remove_reference<decltype(margin_[0])>::type;
|
||||||
|
|
||||||
YGDirection direction() const { return flags_.at<directionIdx>(); }
|
YGDirection direction() const {
|
||||||
Flags::Ref<directionIdx> direction() { return flags_.at<directionIdx>(); }
|
return facebook::yoga::detail::getEnumData<YGDirection>(flags,
|
||||||
|
directionOffset);
|
||||||
|
}
|
||||||
|
BitfieldRef<YGDirection> direction() { return {*this, directionOffset}; }
|
||||||
|
|
||||||
YGFlexDirection flexDirection() const {
|
YGFlexDirection flexDirection() const {
|
||||||
return flags_.at<flexDirectionIdx>();
|
return facebook::yoga::detail::getEnumData<YGFlexDirection>(
|
||||||
|
flags, flexdirectionOffset);
|
||||||
}
|
}
|
||||||
Flags::Ref<flexDirectionIdx> flexDirection() {
|
BitfieldRef<YGFlexDirection> flexDirection() {
|
||||||
return flags_.at<flexDirectionIdx>();
|
return {*this, flexdirectionOffset};
|
||||||
}
|
}
|
||||||
|
|
||||||
YGJustify justifyContent() const { return flags_.at<justifyContentIdx>(); }
|
YGJustify justifyContent() const {
|
||||||
Flags::Ref<justifyContentIdx> justifyContent() {
|
return facebook::yoga::detail::getEnumData<YGJustify>(flags,
|
||||||
return flags_.at<justifyContentIdx>();
|
justifyContentOffset);
|
||||||
|
}
|
||||||
|
BitfieldRef<YGJustify> justifyContent() {
|
||||||
|
return {*this, justifyContentOffset};
|
||||||
}
|
}
|
||||||
|
|
||||||
YGAlign alignContent() const { return flags_.at<alignContentIdx>(); }
|
YGAlign alignContent() const {
|
||||||
Flags::Ref<alignContentIdx> alignContent() {
|
return facebook::yoga::detail::getEnumData<YGAlign>(flags,
|
||||||
return flags_.at<alignContentIdx>();
|
alignContentOffset);
|
||||||
|
}
|
||||||
|
BitfieldRef<YGAlign> alignContent() { return {*this, alignContentOffset}; }
|
||||||
|
|
||||||
|
YGAlign alignItems() const {
|
||||||
|
return facebook::yoga::detail::getEnumData<YGAlign>(flags,
|
||||||
|
alignItemsOffset);
|
||||||
|
}
|
||||||
|
BitfieldRef<YGAlign> alignItems() { return {*this, alignItemsOffset}; }
|
||||||
|
|
||||||
|
YGAlign alignSelf() const {
|
||||||
|
return facebook::yoga::detail::getEnumData<YGAlign>(flags, alignSelfOffset);
|
||||||
|
}
|
||||||
|
BitfieldRef<YGAlign> alignSelf() { return {*this, alignSelfOffset}; }
|
||||||
|
|
||||||
|
YGPositionType positionType() const {
|
||||||
|
return facebook::yoga::detail::getEnumData<YGPositionType>(
|
||||||
|
flags, positionTypeOffset);
|
||||||
|
}
|
||||||
|
BitfieldRef<YGPositionType> positionType() {
|
||||||
|
return {*this, positionTypeOffset};
|
||||||
}
|
}
|
||||||
|
|
||||||
YGAlign alignItems() const { return flags_.at<alignItemsIdx>(); }
|
YGWrap flexWrap() const {
|
||||||
Flags::Ref<alignItemsIdx> alignItems() { return flags_.at<alignItemsIdx>(); }
|
return facebook::yoga::detail::getEnumData<YGWrap>(flags, flexWrapOffset);
|
||||||
|
|
||||||
YGAlign alignSelf() const { return flags_.at<alignSelfIdx>(); }
|
|
||||||
Flags::Ref<alignSelfIdx> alignSelf() { return flags_.at<alignSelfIdx>(); }
|
|
||||||
|
|
||||||
YGPositionType positionType() const { return flags_.at<positionTypeIdx>(); }
|
|
||||||
Flags::Ref<positionTypeIdx> positionType() {
|
|
||||||
return flags_.at<positionTypeIdx>();
|
|
||||||
}
|
}
|
||||||
|
BitfieldRef<YGWrap> flexWrap() { return {*this, flexWrapOffset}; }
|
||||||
|
|
||||||
YGWrap flexWrap() const { return flags_.at<flexWrapIdx>(); }
|
YGOverflow overflow() const {
|
||||||
Flags::Ref<flexWrapIdx> flexWrap() { return flags_.at<flexWrapIdx>(); }
|
return facebook::yoga::detail::getEnumData<YGOverflow>(flags,
|
||||||
|
overflowOffset);
|
||||||
|
}
|
||||||
|
BitfieldRef<YGOverflow> overflow() { return {*this, overflowOffset}; }
|
||||||
|
|
||||||
YGOverflow overflow() const { return flags_.at<overflowIdx>(); }
|
YGDisplay display() const {
|
||||||
Flags::Ref<overflowIdx> overflow() { return flags_.at<overflowIdx>(); }
|
return facebook::yoga::detail::getEnumData<YGDisplay>(flags, displayOffset);
|
||||||
|
}
|
||||||
YGDisplay display() const { return flags_.at<displayIdx>(); }
|
BitfieldRef<YGDisplay> display() { return {*this, displayOffset}; }
|
||||||
Flags::Ref<displayIdx> display() { return flags_.at<displayIdx>(); }
|
|
||||||
|
|
||||||
YGFloatOptional flex() const { return flex_; }
|
YGFloatOptional flex() const { return flex_; }
|
||||||
Ref<YGFloatOptional, &YGStyle::flex_> flex() { return {*this}; }
|
Ref<YGFloatOptional, &YGStyle::flex_> flex() { return {*this}; }
|
||||||
@ -189,3 +234,5 @@ YOGA_EXPORT bool operator==(const YGStyle& lhs, const YGStyle& rhs);
|
|||||||
YOGA_EXPORT inline bool operator!=(const YGStyle& lhs, const YGStyle& rhs) {
|
YOGA_EXPORT inline bool operator!=(const YGStyle& lhs, const YGStyle& rhs) {
|
||||||
return !(lhs == rhs);
|
return !(lhs == rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@ -12,6 +12,13 @@
|
|||||||
#include "YGEnums.h"
|
#include "YGEnums.h"
|
||||||
#include "YGMacros.h"
|
#include "YGMacros.h"
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && defined(__clang__)
|
||||||
|
#define COMPILING_WITH_CLANG_ON_WINDOWS
|
||||||
|
#endif
|
||||||
|
#if defined(COMPILING_WITH_CLANG_ON_WINDOWS)
|
||||||
|
#include <limits>
|
||||||
|
constexpr float YGUndefined = std::numeric_limits<float>::quiet_NaN();
|
||||||
|
#else
|
||||||
YG_EXTERN_C_BEGIN
|
YG_EXTERN_C_BEGIN
|
||||||
|
|
||||||
// Not defined in MSVC++
|
// Not defined in MSVC++
|
||||||
@ -21,6 +28,7 @@ static const uint32_t __nan = 0x7fc00000;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define YGUndefined NAN
|
#define YGUndefined NAN
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct YGValue {
|
typedef struct YGValue {
|
||||||
float value;
|
float value;
|
||||||
@ -31,7 +39,10 @@ YOGA_EXPORT extern const YGValue YGValueAuto;
|
|||||||
YOGA_EXPORT extern const YGValue YGValueUndefined;
|
YOGA_EXPORT extern const YGValue YGValueUndefined;
|
||||||
YOGA_EXPORT extern const YGValue YGValueZero;
|
YOGA_EXPORT extern const YGValue YGValueZero;
|
||||||
|
|
||||||
|
#if !defined(COMPILING_WITH_CLANG_ON_WINDOWS)
|
||||||
YG_EXTERN_C_END
|
YG_EXTERN_C_END
|
||||||
|
#endif
|
||||||
|
#undef COMPILING_WITH_CLANG_ON_WINDOWS
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
|||||||
@ -51,10 +51,10 @@ struct YGCachedMeasurement {
|
|||||||
float computedHeight;
|
float computedHeight;
|
||||||
|
|
||||||
YGCachedMeasurement()
|
YGCachedMeasurement()
|
||||||
: availableWidth(0),
|
: availableWidth(-1),
|
||||||
availableHeight(0),
|
availableHeight(-1),
|
||||||
widthMeasureMode((YGMeasureMode)-1),
|
widthMeasureMode(YGMeasureModeUndefined),
|
||||||
heightMeasureMode((YGMeasureMode)-1),
|
heightMeasureMode(YGMeasureModeUndefined),
|
||||||
computedWidth(-1),
|
computedWidth(-1),
|
||||||
computedHeight(-1) {}
|
computedHeight(-1) {}
|
||||||
|
|
||||||
|
|||||||
@ -228,9 +228,6 @@ YOGA_EXPORT YGNodeRef YGNodeClone(YGNodeRef oldNode) {
|
|||||||
static YGConfigRef YGConfigClone(const YGConfig& oldConfig) {
|
static YGConfigRef YGConfigClone(const YGConfig& oldConfig) {
|
||||||
const YGConfigRef config = new YGConfig(oldConfig);
|
const YGConfigRef config = new YGConfig(oldConfig);
|
||||||
YGAssert(config != nullptr, "Could not allocate memory for config");
|
YGAssert(config != nullptr, "Could not allocate memory for config");
|
||||||
if (config == nullptr) {
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
gConfigInstanceCount++;
|
gConfigInstanceCount++;
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
@ -354,6 +351,12 @@ YOGA_EXPORT void YGNodeInsertChild(const YGNodeRef owner, const YGNodeRef child,
|
|||||||
owner->markDirtyAndPropogate();
|
owner->markDirtyAndPropogate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
YOGA_EXPORT void YGNodeSwapChild(const YGNodeRef owner, const YGNodeRef child,
|
||||||
|
const uint32_t index) {
|
||||||
|
owner->replaceChild(child, index);
|
||||||
|
child->setOwner(owner);
|
||||||
|
}
|
||||||
|
|
||||||
YOGA_EXPORT void YGNodeRemoveChild(const YGNodeRef owner,
|
YOGA_EXPORT void YGNodeRemoveChild(const YGNodeRef owner,
|
||||||
const YGNodeRef excludedChild) {
|
const YGNodeRef excludedChild) {
|
||||||
if (YGNodeGetChildCount(owner) == 0) {
|
if (YGNodeGetChildCount(owner) == 0) {
|
||||||
@ -1018,7 +1021,7 @@ static bool YGIsBaselineLayout(const YGNodeRef node) {
|
|||||||
const uint32_t childCount = YGNodeGetChildCount(node);
|
const uint32_t childCount = YGNodeGetChildCount(node);
|
||||||
for (uint32_t i = 0; i < childCount; i++) {
|
for (uint32_t i = 0; i < childCount; i++) {
|
||||||
const YGNodeRef child = YGNodeGetChild(node, i);
|
const YGNodeRef child = YGNodeGetChild(node, i);
|
||||||
if (child->getStyle().positionType() == YGPositionTypeRelative &&
|
if (child->getStyle().positionType() != YGPositionTypeAbsolute &&
|
||||||
child->getStyle().alignSelf() == YGAlignBaseline) {
|
child->getStyle().alignSelf() == YGAlignBaseline) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1474,22 +1477,29 @@ static void YGNodeAbsoluteLayoutChild(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void YGNodeWithMeasureFuncSetMeasuredDimensions(
|
static void YGNodeWithMeasureFuncSetMeasuredDimensions(
|
||||||
const YGNodeRef node, const float availableWidth,
|
const YGNodeRef node, float availableWidth, float availableHeight,
|
||||||
const float availableHeight, const YGMeasureMode widthMeasureMode,
|
const YGMeasureMode widthMeasureMode, const YGMeasureMode heightMeasureMode,
|
||||||
const YGMeasureMode heightMeasureMode, const float ownerWidth,
|
const float ownerWidth, const float ownerHeight,
|
||||||
const float ownerHeight, LayoutData& layoutMarkerData,
|
LayoutData& layoutMarkerData, void* const layoutContext,
|
||||||
void* const layoutContext, const LayoutPassReason reason) {
|
const LayoutPassReason reason) {
|
||||||
YGAssertWithNode(node, node->hasMeasureFunc(),
|
YGAssertWithNode(node, node->hasMeasureFunc(),
|
||||||
"Expected node to have custom measure function");
|
"Expected node to have custom measure function");
|
||||||
|
|
||||||
|
if (widthMeasureMode == YGMeasureModeUndefined) {
|
||||||
|
availableWidth = YGUndefined;
|
||||||
|
}
|
||||||
|
if (heightMeasureMode == YGMeasureModeUndefined) {
|
||||||
|
availableHeight = YGUndefined;
|
||||||
|
}
|
||||||
|
|
||||||
const float paddingAndBorderAxisRow =
|
const float paddingAndBorderAxisRow =
|
||||||
YGNodePaddingAndBorderForAxis(node, YGFlexDirectionRow, availableWidth);
|
YGNodePaddingAndBorderForAxis(node, YGFlexDirectionRow, ownerWidth);
|
||||||
const float paddingAndBorderAxisColumn = YGNodePaddingAndBorderForAxis(
|
const float paddingAndBorderAxisColumn =
|
||||||
node, YGFlexDirectionColumn, availableWidth);
|
YGNodePaddingAndBorderForAxis(node, YGFlexDirectionColumn, ownerWidth);
|
||||||
const float marginAxisRow =
|
const float marginAxisRow =
|
||||||
node->getMarginForAxis(YGFlexDirectionRow, availableWidth).unwrap();
|
node->getMarginForAxis(YGFlexDirectionRow, ownerWidth).unwrap();
|
||||||
const float marginAxisColumn =
|
const float marginAxisColumn =
|
||||||
node->getMarginForAxis(YGFlexDirectionColumn, availableWidth).unwrap();
|
node->getMarginForAxis(YGFlexDirectionColumn, ownerWidth).unwrap();
|
||||||
|
|
||||||
// We want to make sure we don't call measure with negative size
|
// We want to make sure we don't call measure with negative size
|
||||||
const float innerWidth = YGFloatIsUndefined(availableWidth)
|
const float innerWidth = YGFloatIsUndefined(availableWidth)
|
||||||
@ -1641,15 +1651,17 @@ static void YGZeroOutLayoutRecursivly(const YGNodeRef node,
|
|||||||
static float YGNodeCalculateAvailableInnerDim(const YGNodeConstRef node,
|
static float YGNodeCalculateAvailableInnerDim(const YGNodeConstRef node,
|
||||||
YGFlexDirection axis,
|
YGFlexDirection axis,
|
||||||
float availableDim,
|
float availableDim,
|
||||||
float ownerDim) {
|
float ownerDim,
|
||||||
|
float ownerDimForMarginPadding) {
|
||||||
YGFlexDirection direction =
|
YGFlexDirection direction =
|
||||||
YGFlexDirectionIsRow(axis) ? YGFlexDirectionRow : YGFlexDirectionColumn;
|
YGFlexDirectionIsRow(axis) ? YGFlexDirectionRow : YGFlexDirectionColumn;
|
||||||
YGDimension dimension =
|
YGDimension dimension =
|
||||||
YGFlexDirectionIsRow(axis) ? YGDimensionWidth : YGDimensionHeight;
|
YGFlexDirectionIsRow(axis) ? YGDimensionWidth : YGDimensionHeight;
|
||||||
|
|
||||||
const float margin = node->getMarginForAxis(direction, ownerDim).unwrap();
|
const float margin =
|
||||||
|
node->getMarginForAxis(direction, ownerDimForMarginPadding).unwrap();
|
||||||
const float paddingAndBorder =
|
const float paddingAndBorder =
|
||||||
YGNodePaddingAndBorderForAxis(node, direction, ownerDim);
|
YGNodePaddingAndBorderForAxis(node, direction, ownerDimForMarginPadding);
|
||||||
|
|
||||||
float availableInnerDim = availableDim - margin - paddingAndBorder;
|
float availableInnerDim = availableDim - margin - paddingAndBorder;
|
||||||
// Max dimension overrides predefined dimension value; Min dimension in turn
|
// Max dimension overrides predefined dimension value; Min dimension in turn
|
||||||
@ -2043,7 +2055,8 @@ static void YGDistributeFreeSpaceFirstPass(
|
|||||||
// first and second passes.
|
// first and second passes.
|
||||||
deltaFreeSpace += boundMainSize - childFlexBasis;
|
deltaFreeSpace += boundMainSize - childFlexBasis;
|
||||||
collectedFlexItemsValues.totalFlexShrinkScaledFactors -=
|
collectedFlexItemsValues.totalFlexShrinkScaledFactors -=
|
||||||
flexShrinkScaledFactor;
|
(-currentRelativeChild->resolveFlexShrink() *
|
||||||
|
currentRelativeChild->getLayout().computedFlexBasis.unwrap());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (!YGFloatIsUndefined(
|
} else if (!YGFloatIsUndefined(
|
||||||
@ -2172,7 +2185,7 @@ static void YGJustifyMainAxis(
|
|||||||
for (uint32_t i = startOfLineIndex;
|
for (uint32_t i = startOfLineIndex;
|
||||||
i < collectedFlexItemsValues.endOfLineIndex; i++) {
|
i < collectedFlexItemsValues.endOfLineIndex; i++) {
|
||||||
const YGNodeRef child = node->getChild(i);
|
const YGNodeRef child = node->getChild(i);
|
||||||
if (child->getStyle().positionType() == YGPositionTypeRelative) {
|
if (child->getStyle().positionType() != YGPositionTypeAbsolute) {
|
||||||
if (child->marginLeadingValue(mainAxis).unit == YGUnitAuto) {
|
if (child->marginLeadingValue(mainAxis).unit == YGUnitAuto) {
|
||||||
numberOfAutoMarginsOnCurrentLine++;
|
numberOfAutoMarginsOnCurrentLine++;
|
||||||
}
|
}
|
||||||
@ -2255,7 +2268,7 @@ static void YGJustifyMainAxis(
|
|||||||
// Now that we placed the element, we need to update the variables.
|
// Now that we placed the element, we need to update the variables.
|
||||||
// We need to do that only for relative elements. Absolute elements do not
|
// We need to do that only for relative elements. Absolute elements do not
|
||||||
// take part in that phase.
|
// take part in that phase.
|
||||||
if (childStyle.positionType() == YGPositionTypeRelative) {
|
if (childStyle.positionType() != YGPositionTypeAbsolute) {
|
||||||
if (child->marginLeadingValue(mainAxis).unit == YGUnitAuto) {
|
if (child->marginLeadingValue(mainAxis).unit == YGUnitAuto) {
|
||||||
collectedFlexItemsValues.mainDim +=
|
collectedFlexItemsValues.mainDim +=
|
||||||
collectedFlexItemsValues.remainingFreeSpace /
|
collectedFlexItemsValues.remainingFreeSpace /
|
||||||
@ -2549,9 +2562,9 @@ static void YGNodelayoutImpl(
|
|||||||
// STEP 2: DETERMINE AVAILABLE SIZE IN MAIN AND CROSS DIRECTIONS
|
// STEP 2: DETERMINE AVAILABLE SIZE IN MAIN AND CROSS DIRECTIONS
|
||||||
|
|
||||||
float availableInnerWidth = YGNodeCalculateAvailableInnerDim(
|
float availableInnerWidth = YGNodeCalculateAvailableInnerDim(
|
||||||
node, YGFlexDirectionRow, availableWidth, ownerWidth);
|
node, YGFlexDirectionRow, availableWidth, ownerWidth, ownerWidth);
|
||||||
float availableInnerHeight = YGNodeCalculateAvailableInnerDim(
|
float availableInnerHeight = YGNodeCalculateAvailableInnerDim(
|
||||||
node, YGFlexDirectionColumn, availableHeight, ownerHeight);
|
node, YGFlexDirectionColumn, availableHeight, ownerHeight, ownerWidth);
|
||||||
|
|
||||||
float availableInnerMainDim =
|
float availableInnerMainDim =
|
||||||
isMainAxisRow ? availableInnerWidth : availableInnerHeight;
|
isMainAxisRow ? availableInnerWidth : availableInnerHeight;
|
||||||
@ -2895,7 +2908,7 @@ static void YGNodelayoutImpl(
|
|||||||
if (child->getStyle().display() == YGDisplayNone) {
|
if (child->getStyle().display() == YGDisplayNone) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (child->getStyle().positionType() == YGPositionTypeRelative) {
|
if (child->getStyle().positionType() != YGPositionTypeAbsolute) {
|
||||||
if (child->getLineIndex() != i) {
|
if (child->getLineIndex() != i) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2937,7 +2950,7 @@ static void YGNodelayoutImpl(
|
|||||||
if (child->getStyle().display() == YGDisplayNone) {
|
if (child->getStyle().display() == YGDisplayNone) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (child->getStyle().positionType() == YGPositionTypeRelative) {
|
if (child->getStyle().positionType() != YGPositionTypeAbsolute) {
|
||||||
switch (YGNodeAlignItem(node, child)) {
|
switch (YGNodeAlignItem(node, child)) {
|
||||||
case YGAlignFlexStart: {
|
case YGAlignFlexStart: {
|
||||||
child->setLayoutPosition(
|
child->setLayoutPosition(
|
||||||
@ -3108,7 +3121,7 @@ static void YGNodelayoutImpl(
|
|||||||
if (performLayout && node->getStyle().flexWrap() == YGWrapWrapReverse) {
|
if (performLayout && node->getStyle().flexWrap() == YGWrapWrapReverse) {
|
||||||
for (uint32_t i = 0; i < childCount; i++) {
|
for (uint32_t i = 0; i < childCount; i++) {
|
||||||
const YGNodeRef child = YGNodeGetChild(node, i);
|
const YGNodeRef child = YGNodeGetChild(node, i);
|
||||||
if (child->getStyle().positionType() == YGPositionTypeRelative) {
|
if (child->getStyle().positionType() != YGPositionTypeAbsolute) {
|
||||||
child->setLayoutPosition(
|
child->setLayoutPosition(
|
||||||
node->getLayout().measuredDimensions[dim[crossAxis]] -
|
node->getLayout().measuredDimensions[dim[crossAxis]] -
|
||||||
child->getLayout().position[pos[crossAxis]] -
|
child->getLayout().position[pos[crossAxis]] -
|
||||||
@ -3210,14 +3223,14 @@ static inline bool YGMeasureModeNewMeasureSizeIsStricterAndStillValid(
|
|||||||
(lastComputedSize <= size || YGFloatsEqual(size, lastComputedSize));
|
(lastComputedSize <= size || YGFloatsEqual(size, lastComputedSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
YOGA_EXPORT float YGRoundValueToPixelGrid(const float value,
|
YOGA_EXPORT float YGRoundValueToPixelGrid(const double value,
|
||||||
const float pointScaleFactor,
|
const double pointScaleFactor,
|
||||||
const bool forceCeil,
|
const bool forceCeil,
|
||||||
const bool forceFloor) {
|
const bool forceFloor) {
|
||||||
double scaledValue = ((double)value) * pointScaleFactor;
|
double scaledValue = ((double)value) * pointScaleFactor;
|
||||||
// We want to calculate `fractial` such that `floor(scaledValue) = scaledValue
|
// We want to calculate `fractial` such that `floor(scaledValue) = scaledValue
|
||||||
// - fractial`.
|
// - fractial`.
|
||||||
float fractial = fmodf(scaledValue, 1.0f);
|
double fractial = fmod(scaledValue, 1.0f);
|
||||||
if (fractial < 0) {
|
if (fractial < 0) {
|
||||||
// This branch is for handling negative numbers for `value`.
|
// This branch is for handling negative numbers for `value`.
|
||||||
//
|
//
|
||||||
@ -3236,10 +3249,10 @@ YOGA_EXPORT float YGRoundValueToPixelGrid(const float value,
|
|||||||
// - Finding the `floor`: -2.2 - fractial2 = -2.2 - 0.8 = -3
|
// - Finding the `floor`: -2.2 - fractial2 = -2.2 - 0.8 = -3
|
||||||
++fractial;
|
++fractial;
|
||||||
}
|
}
|
||||||
if (YGFloatsEqual(fractial, 0)) {
|
if (YGDoubleEqual(fractial, 0)) {
|
||||||
// First we check if the value is already rounded
|
// First we check if the value is already rounded
|
||||||
scaledValue = scaledValue - fractial;
|
scaledValue = scaledValue - fractial;
|
||||||
} else if (YGFloatsEqual(fractial, 1.0f)) {
|
} else if (YGDoubleEqual(fractial, 1.0f)) {
|
||||||
scaledValue = scaledValue - fractial + 1.0f;
|
scaledValue = scaledValue - fractial + 1.0f;
|
||||||
} else if (forceCeil) {
|
} else if (forceCeil) {
|
||||||
// Next we check if we need to use forced rounding
|
// Next we check if we need to use forced rounding
|
||||||
@ -3250,7 +3263,7 @@ YOGA_EXPORT float YGRoundValueToPixelGrid(const float value,
|
|||||||
// Finally we just round the value
|
// Finally we just round the value
|
||||||
scaledValue = scaledValue - fractial +
|
scaledValue = scaledValue - fractial +
|
||||||
(!YGFloatIsUndefined(fractial) &&
|
(!YGFloatIsUndefined(fractial) &&
|
||||||
(fractial > 0.5f || YGFloatsEqual(fractial, 0.5f))
|
(fractial > 0.5f || YGDoubleEqual(fractial, 0.5f))
|
||||||
? 1.0f
|
? 1.0f
|
||||||
: 0.0f);
|
: 0.0f);
|
||||||
}
|
}
|
||||||
@ -3350,8 +3363,10 @@ bool YGLayoutNodeInternal(
|
|||||||
if (needToVisitNode) {
|
if (needToVisitNode) {
|
||||||
// Invalidate the cached results.
|
// Invalidate the cached results.
|
||||||
layout->nextCachedMeasurementsIndex = 0;
|
layout->nextCachedMeasurementsIndex = 0;
|
||||||
layout->cachedLayout.widthMeasureMode = (YGMeasureMode)-1;
|
layout->cachedLayout.availableWidth = -1;
|
||||||
layout->cachedLayout.heightMeasureMode = (YGMeasureMode)-1;
|
layout->cachedLayout.availableHeight = -1;
|
||||||
|
layout->cachedLayout.widthMeasureMode = YGMeasureModeUndefined;
|
||||||
|
layout->cachedLayout.heightMeasureMode = YGMeasureModeUndefined;
|
||||||
layout->cachedLayout.computedWidth = -1;
|
layout->cachedLayout.computedWidth = -1;
|
||||||
layout->cachedLayout.computedHeight = -1;
|
layout->cachedLayout.computedHeight = -1;
|
||||||
}
|
}
|
||||||
@ -3552,24 +3567,24 @@ YOGA_EXPORT void YGConfigSetPointScaleFactor(const YGConfigRef config,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void YGRoundToPixelGrid(const YGNodeRef node,
|
static void YGRoundToPixelGrid(const YGNodeRef node,
|
||||||
const float pointScaleFactor,
|
const double pointScaleFactor,
|
||||||
const float absoluteLeft,
|
const double absoluteLeft,
|
||||||
const float absoluteTop) {
|
const double absoluteTop) {
|
||||||
if (pointScaleFactor == 0.0f) {
|
if (pointScaleFactor == 0.0f) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const float nodeLeft = node->getLayout().position[YGEdgeLeft];
|
const double nodeLeft = node->getLayout().position[YGEdgeLeft];
|
||||||
const float nodeTop = node->getLayout().position[YGEdgeTop];
|
const double nodeTop = node->getLayout().position[YGEdgeTop];
|
||||||
|
|
||||||
const float nodeWidth = node->getLayout().dimensions[YGDimensionWidth];
|
const double nodeWidth = node->getLayout().dimensions[YGDimensionWidth];
|
||||||
const float nodeHeight = node->getLayout().dimensions[YGDimensionHeight];
|
const double nodeHeight = node->getLayout().dimensions[YGDimensionHeight];
|
||||||
|
|
||||||
const float absoluteNodeLeft = absoluteLeft + nodeLeft;
|
const double absoluteNodeLeft = absoluteLeft + nodeLeft;
|
||||||
const float absoluteNodeTop = absoluteTop + nodeTop;
|
const double absoluteNodeTop = absoluteTop + nodeTop;
|
||||||
|
|
||||||
const float absoluteNodeRight = absoluteNodeLeft + nodeWidth;
|
const double absoluteNodeRight = absoluteNodeLeft + nodeWidth;
|
||||||
const float absoluteNodeBottom = absoluteNodeTop + nodeHeight;
|
const double absoluteNodeBottom = absoluteNodeTop + nodeHeight;
|
||||||
|
|
||||||
// If a node has a custom measure function we never want to round down its
|
// If a node has a custom measure function we never want to round down its
|
||||||
// size as this could lead to unwanted text truncation.
|
// size as this could lead to unwanted text truncation.
|
||||||
@ -3587,11 +3602,11 @@ static void YGRoundToPixelGrid(const YGNodeRef node,
|
|||||||
// whole number, we don't have any fraction To verify if the result is close
|
// whole number, we don't have any fraction To verify if the result is close
|
||||||
// to whole number we want to check both floor and ceil numbers
|
// to whole number we want to check both floor and ceil numbers
|
||||||
const bool hasFractionalWidth =
|
const bool hasFractionalWidth =
|
||||||
!YGFloatsEqual(fmodf(nodeWidth * pointScaleFactor, 1.0), 0) &&
|
!YGDoubleEqual(fmod(nodeWidth * pointScaleFactor, 1.0), 0) &&
|
||||||
!YGFloatsEqual(fmodf(nodeWidth * pointScaleFactor, 1.0), 1.0);
|
!YGDoubleEqual(fmod(nodeWidth * pointScaleFactor, 1.0), 1.0);
|
||||||
const bool hasFractionalHeight =
|
const bool hasFractionalHeight =
|
||||||
!YGFloatsEqual(fmodf(nodeHeight * pointScaleFactor, 1.0), 0) &&
|
!YGDoubleEqual(fmod(nodeHeight * pointScaleFactor, 1.0), 0) &&
|
||||||
!YGFloatsEqual(fmodf(nodeHeight * pointScaleFactor, 1.0), 1.0);
|
!YGDoubleEqual(fmod(nodeHeight * pointScaleFactor, 1.0), 1.0);
|
||||||
|
|
||||||
node->setLayoutDimension(
|
node->setLayoutDimension(
|
||||||
YGRoundValueToPixelGrid(absoluteNodeRight, pointScaleFactor,
|
YGRoundValueToPixelGrid(absoluteNodeRight, pointScaleFactor,
|
||||||
@ -3773,6 +3788,7 @@ YOGA_EXPORT void YGConfigSetShouldDiffLayoutWithoutLegacyStretchBehaviour(
|
|||||||
void YGAssert(const bool condition, const char* message) {
|
void YGAssert(const bool condition, const char* message) {
|
||||||
if (!condition) {
|
if (!condition) {
|
||||||
Log::log(YGNodeRef{nullptr}, YGLogLevelFatal, nullptr, "%s\n", message);
|
Log::log(YGNodeRef{nullptr}, YGLogLevelFatal, nullptr, "%s\n", message);
|
||||||
|
throwLogicalErrorWithMessage(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3780,6 +3796,7 @@ void YGAssertWithNode(const YGNodeRef node, const bool condition,
|
|||||||
const char* message) {
|
const char* message) {
|
||||||
if (!condition) {
|
if (!condition) {
|
||||||
Log::log(node, YGLogLevelFatal, nullptr, "%s\n", message);
|
Log::log(node, YGLogLevelFatal, nullptr, "%s\n", message);
|
||||||
|
throwLogicalErrorWithMessage(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3787,6 +3804,7 @@ void YGAssertWithConfig(const YGConfigRef config, const bool condition,
|
|||||||
const char* message) {
|
const char* message) {
|
||||||
if (!condition) {
|
if (!condition) {
|
||||||
Log::log(config, YGLogLevelFatal, nullptr, "%s\n", message);
|
Log::log(config, YGLogLevelFatal, nullptr, "%s\n", message);
|
||||||
|
throwLogicalErrorWithMessage(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* This source code is licensed under the MIT license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
// v1.18.0
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -59,6 +59,9 @@ WIN_EXPORT void YGNodeReset(YGNodeRef node);
|
|||||||
WIN_EXPORT void YGNodeInsertChild(YGNodeRef node, YGNodeRef child,
|
WIN_EXPORT void YGNodeInsertChild(YGNodeRef node, YGNodeRef child,
|
||||||
uint32_t index);
|
uint32_t index);
|
||||||
|
|
||||||
|
WIN_EXPORT void YGNodeSwapChild(YGNodeRef node, YGNodeRef child,
|
||||||
|
uint32_t index);
|
||||||
|
|
||||||
WIN_EXPORT void YGNodeRemoveChild(YGNodeRef node, YGNodeRef child);
|
WIN_EXPORT void YGNodeRemoveChild(YGNodeRef node, YGNodeRef child);
|
||||||
WIN_EXPORT void YGNodeRemoveAllChildren(YGNodeRef node);
|
WIN_EXPORT void YGNodeRemoveAllChildren(YGNodeRef node);
|
||||||
WIN_EXPORT YGNodeRef YGNodeGetChild(YGNodeRef node, uint32_t index);
|
WIN_EXPORT YGNodeRef YGNodeGetChild(YGNodeRef node, uint32_t index);
|
||||||
@ -298,7 +301,7 @@ WIN_EXPORT YGConfigRef YGConfigGetDefault(void);
|
|||||||
WIN_EXPORT void YGConfigSetContext(YGConfigRef config, void* context);
|
WIN_EXPORT void YGConfigSetContext(YGConfigRef config, void* context);
|
||||||
WIN_EXPORT void* YGConfigGetContext(YGConfigRef config);
|
WIN_EXPORT void* YGConfigGetContext(YGConfigRef config);
|
||||||
|
|
||||||
WIN_EXPORT float YGRoundValueToPixelGrid(float value, float pointScaleFactor,
|
WIN_EXPORT float YGRoundValueToPixelGrid(double value, double pointScaleFactor,
|
||||||
bool forceCeil, bool forceFloor);
|
bool forceCeil, bool forceFloor);
|
||||||
|
|
||||||
YG_EXTERN_C_END
|
YG_EXTERN_C_END
|
||||||
|
|||||||
@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <stdexcept>
|
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace yoga {
|
namespace yoga {
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <yoga/YGEnums.h>
|
#include <yoga/YGEnums.h>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|||||||
@ -21,10 +21,6 @@ void vlog(YGConfig* config, YGNode* node, YGLogLevel level, void* context,
|
|||||||
const char* format, va_list args) {
|
const char* format, va_list args) {
|
||||||
YGConfig* logConfig = config != nullptr ? config : YGConfigGetDefault();
|
YGConfig* logConfig = config != nullptr ? config : YGConfigGetDefault();
|
||||||
logConfig->log(logConfig, node, level, context, format, args);
|
logConfig->log(logConfig, node, level, context, format, args);
|
||||||
|
|
||||||
if (level == YGLogLevelFatal) {
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|||||||
10
src/cpp/include/nodegui/Extras/Export/export.h
Normal file
10
src/cpp/include/nodegui/Extras/Export/export.h
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
#ifdef _WINDLL
|
||||||
|
#ifdef ENABLE_DLL_EXPORT
|
||||||
|
#define DLL_EXPORT __declspec(dllexport)
|
||||||
|
#else
|
||||||
|
#define DLL_EXPORT __declspec(dllimport)
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define DLL_EXPORT
|
||||||
|
#endif
|
||||||
@ -1,20 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef _WINDLL
|
|
||||||
#ifdef ENABLE_DLL_EXPORT
|
|
||||||
#define DLL_EXPORT __declspec(dllexport)
|
|
||||||
#else
|
|
||||||
#define DLL_EXPORT __declspec(dllimport)
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define DLL_EXPORT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <napi.h>
|
#include <napi.h>
|
||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
#include "core/FlexLayout/flexutils.h"
|
#include "core/FlexLayout/flexutils.h"
|
||||||
#include "deps/yoga/YGNode.h"
|
#include "deps/yoga/YGNode.h"
|
||||||
|
|
||||||
@ -22,18 +13,17 @@ namespace extrautils {
|
|||||||
DLL_EXPORT QVariant* convertToQVariant(Napi::Env& env, Napi::Value& value);
|
DLL_EXPORT QVariant* convertToQVariant(Napi::Env& env, Napi::Value& value);
|
||||||
DLL_EXPORT bool isNapiValueInt(Napi::Env& env, Napi::Value& num);
|
DLL_EXPORT bool isNapiValueInt(Napi::Env& env, Napi::Value& num);
|
||||||
DLL_EXPORT std::string getNapiObjectClassName(Napi::Object& object);
|
DLL_EXPORT std::string getNapiObjectClassName(Napi::Object& object);
|
||||||
DLL_EXPORT void* configureQWidget(QWidget* widget, YGNodeRef node,
|
DLL_EXPORT void* configureQWidget(QWidget* widget, bool isLeafNode = false);
|
||||||
bool isLeafNode = false);
|
|
||||||
DLL_EXPORT void* configureQObject(QObject* object);
|
DLL_EXPORT void* configureQObject(QObject* object);
|
||||||
DLL_EXPORT void* configureComponent(void* component);
|
DLL_EXPORT void* configureComponent(void* component);
|
||||||
|
DLL_EXPORT uint64_t hashPointerTo53bit(const void* input);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void safeDelete(QPointer<T>& component) {
|
void safeDelete(QPointer<T>& component) {
|
||||||
if (!component.isNull()) {
|
if (!component.isNull() && component->QObject::parent() == nullptr) {
|
||||||
delete component;
|
delete component;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void initAppSettings();
|
|
||||||
} // namespace extrautils
|
} // namespace extrautils
|
||||||
|
|
||||||
class DLL_EXPORT NUtilsWrap : public Napi::ObjectWrap<NUtilsWrap> {
|
class DLL_EXPORT NUtilsWrap : public Napi::ObjectWrap<NUtilsWrap> {
|
||||||
|
|||||||
@ -0,0 +1,217 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <QAbstractItemModel>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtCore/QModelIndex/qmodelindex_wrap.h"
|
||||||
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
#include "core/NodeWidget/nodewidget.h"
|
||||||
|
#include "napi.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT NAbstractItemModel : public QAbstractItemModel,
|
||||||
|
public EventWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
EVENTWIDGET_IMPLEMENTATIONS(QAbstractItemModel)
|
||||||
|
public:
|
||||||
|
Napi::FunctionReference dispatchOnNode;
|
||||||
|
|
||||||
|
virtual void connectSignalsToEventEmitter(){
|
||||||
|
// Qt Connects: Implement all signal connects here
|
||||||
|
QOBJECT_SIGNALS}
|
||||||
|
|
||||||
|
QModelIndex index(int row, int column,
|
||||||
|
const QModelIndex& parent = QModelIndex()) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto parentModelIndexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(parent))});
|
||||||
|
Napi::Value modelIndexNapiWrap = this->dispatchOnNode.Call(
|
||||||
|
{Napi::String::New(env, "index"), Napi::Value::From(env, row),
|
||||||
|
Napi::Value::From(env, column), parentModelIndexWrap});
|
||||||
|
|
||||||
|
QModelIndexWrap* modelIndexWrap = Napi::ObjectWrap<QModelIndexWrap>::Unwrap(
|
||||||
|
modelIndexNapiWrap.As<Napi::Object>());
|
||||||
|
QModelIndex* newIndex = modelIndexWrap->getInternalInstance();
|
||||||
|
return *newIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
QObject* parent() const { return nullptr; }
|
||||||
|
|
||||||
|
QModelIndex parent(const QModelIndex& child) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto childModelIndexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(child))});
|
||||||
|
Napi::Value modelIndexNapiWrap = this->dispatchOnNode.Call(
|
||||||
|
{Napi::String::New(env, "parent"), childModelIndexWrap});
|
||||||
|
|
||||||
|
QModelIndexWrap* modelIndexWrap = Napi::ObjectWrap<QModelIndexWrap>::Unwrap(
|
||||||
|
modelIndexNapiWrap.As<Napi::Object>());
|
||||||
|
QModelIndex* parentIndex = modelIndexWrap->getInternalInstance();
|
||||||
|
return *parentIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
int rowCount(const QModelIndex& parent = QModelIndex()) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto modelIndexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(parent))});
|
||||||
|
Napi::Value result = this->dispatchOnNode.Call(
|
||||||
|
{Napi::String::New(env, "rowCount"), modelIndexWrap});
|
||||||
|
|
||||||
|
return result.As<Napi::Number>().Int32Value();
|
||||||
|
}
|
||||||
|
|
||||||
|
int columnCount(const QModelIndex& parent = QModelIndex()) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto modelIndexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(parent))});
|
||||||
|
Napi::Value result = this->dispatchOnNode.Call(
|
||||||
|
{Napi::String::New(env, "columnCount"), modelIndexWrap});
|
||||||
|
return result.As<Napi::Number>().Int32Value();
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant data(const QModelIndex& index,
|
||||||
|
int role = Qt::DisplayRole) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto modelIndexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(index))});
|
||||||
|
auto roleValue = Napi::Value::From(env, role);
|
||||||
|
Napi::Value variantJsObject = this->dispatchOnNode.Call(
|
||||||
|
{Napi::String::New(env, "data"), modelIndexWrap, roleValue});
|
||||||
|
|
||||||
|
QVariantWrap* variantWrap = Napi::ObjectWrap<QVariantWrap>::Unwrap(
|
||||||
|
variantJsObject.As<Napi::Object>());
|
||||||
|
QVariant* variant = variantWrap->getInternalInstance();
|
||||||
|
return *variant;
|
||||||
|
}
|
||||||
|
|
||||||
|
Qt::ItemFlags flags(const QModelIndex& index) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto modelIndexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(index))});
|
||||||
|
Napi::Value numberJs = this->dispatchOnNode.Call(
|
||||||
|
{Napi::String::New(env, "flags"), modelIndexWrap});
|
||||||
|
|
||||||
|
auto result =
|
||||||
|
static_cast<Qt::ItemFlags>(numberJs.As<Napi::Number>().Uint32Value());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant headerData(int section, Qt::Orientation orientation,
|
||||||
|
int role = Qt::DisplayRole) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto sectionValue = Napi::Value::From(env, static_cast<int>(section));
|
||||||
|
auto orientationValue =
|
||||||
|
Napi::Value::From(env, static_cast<int>(orientation));
|
||||||
|
auto roleValue = Napi::Value::From(env, static_cast<int>(role));
|
||||||
|
|
||||||
|
Napi::Value variantJsObject =
|
||||||
|
this->dispatchOnNode.Call({Napi::String::New(env, "headerData"),
|
||||||
|
sectionValue, orientationValue, roleValue});
|
||||||
|
|
||||||
|
QVariantWrap* variantWrap = Napi::ObjectWrap<QVariantWrap>::Unwrap(
|
||||||
|
variantJsObject.As<Napi::Object>());
|
||||||
|
QVariant* variant = variantWrap->getInternalInstance();
|
||||||
|
return *variant;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool setData(const QModelIndex& index, const QVariant& value,
|
||||||
|
int role = Qt::EditRole) override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto modelIndexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(index))});
|
||||||
|
auto valueWrap = QVariantWrap::constructor.New(
|
||||||
|
{Napi::External<QVariant>::New(env, new QVariant(value))});
|
||||||
|
auto roleValue = Napi::Value::From(env, role);
|
||||||
|
|
||||||
|
Napi::Value booleanJs =
|
||||||
|
this->dispatchOnNode.Call({Napi::String::New(env, "setData"),
|
||||||
|
modelIndexWrap, valueWrap, roleValue});
|
||||||
|
|
||||||
|
return booleanJs.As<Napi::Boolean>().Value();
|
||||||
|
}
|
||||||
|
|
||||||
|
QModelIndex _protected_createIndex(int row, int column) const {
|
||||||
|
return createIndex(row, column);
|
||||||
|
}
|
||||||
|
|
||||||
|
QModelIndex buddy(const QModelIndex& index) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto indexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(index))});
|
||||||
|
Napi::Value buddyIndexNapiWrap =
|
||||||
|
this->dispatchOnNode.Call({Napi::String::New(env, "buddy"), indexWrap});
|
||||||
|
|
||||||
|
QModelIndexWrap* buddyIndexWrap = Napi::ObjectWrap<QModelIndexWrap>::Unwrap(
|
||||||
|
buddyIndexNapiWrap.As<Napi::Object>());
|
||||||
|
QModelIndex* buddyIndex = buddyIndexWrap->getInternalInstance();
|
||||||
|
return *buddyIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
void _protected_beginResetModel() { beginResetModel(); }
|
||||||
|
|
||||||
|
void _protected_endResetModel() { endResetModel(); }
|
||||||
|
|
||||||
|
void _protected_beginInsertColumns(const QModelIndex& parent, int first,
|
||||||
|
int last) {
|
||||||
|
beginInsertColumns(parent, first, last);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _protected_beginInsertRows(const QModelIndex& parent, int first,
|
||||||
|
int last) {
|
||||||
|
beginInsertRows(parent, first, last);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _protected_beginMoveColumns(const QModelIndex& sourceParent,
|
||||||
|
int sourceFirst, int sourceLast,
|
||||||
|
const QModelIndex& destinationParent,
|
||||||
|
int destinationChild) {
|
||||||
|
return beginMoveColumns(sourceParent, sourceFirst, sourceLast,
|
||||||
|
destinationParent, destinationChild);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _protected_beginMoveRows(const QModelIndex& sourceParent,
|
||||||
|
int sourceFirst, int sourceLast,
|
||||||
|
const QModelIndex& destinationParent,
|
||||||
|
int destinationChild) {
|
||||||
|
return beginMoveRows(sourceParent, sourceFirst, sourceLast,
|
||||||
|
destinationParent, destinationChild);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _protected_beginRemoveColumns(const QModelIndex& parent, int first,
|
||||||
|
int last) {
|
||||||
|
beginRemoveColumns(parent, first, last);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _protected_beginRemoveRows(const QModelIndex& parent, int first,
|
||||||
|
int last) {
|
||||||
|
beginRemoveRows(parent, first, last);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _protected_endInsertColumns() { endInsertColumns(); }
|
||||||
|
|
||||||
|
void _protected_endInsertRows() { endInsertRows(); }
|
||||||
|
|
||||||
|
void _protected_endMoveColumns() { endMoveColumns(); }
|
||||||
|
|
||||||
|
void _protected_endMoveRows() { endMoveRows(); }
|
||||||
|
|
||||||
|
void _protected_endRemoveColumns() { endRemoveColumns(); }
|
||||||
|
|
||||||
|
void _protected_endRemoveRows() { endRemoveRows(); }
|
||||||
|
};
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
#include "nabstractitemmodel.hpp"
|
||||||
|
|
||||||
|
class DLL_EXPORT QAbstractItemModelWrap
|
||||||
|
: public Napi::ObjectWrap<QAbstractItemModelWrap> {
|
||||||
|
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QPointer<NAbstractItemModel> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QAbstractItemModelWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QAbstractItemModelWrap();
|
||||||
|
NAbstractItemModel* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value initNodeDispatcher(const Napi::CallbackInfo& info);
|
||||||
|
|
||||||
|
Napi::Value hasIndex(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value createIndex(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value _super_flags(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value emitDataChanged(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value checkIndex(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value _super_buddy(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value beginInsertColumns(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value beginInsertRows(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value beginMoveColumns(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value beginMoveRows(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value beginRemoveColumns(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value beginRemoveRows(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value beginResetModel(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value endResetModel(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value endInsertColumns(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value endInsertRows(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value endMoveColumns(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value endMoveRows(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value endRemoveColumns(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value endRemoveRows(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QDateWrap : public Napi::ObjectWrap<QDateWrap> {
|
class DLL_EXPORT QDateWrap : public Napi::ObjectWrap<QDateWrap> {
|
||||||
@ -43,5 +43,6 @@ DLL_EXPORT Napi::Value currentDate(const Napi::CallbackInfo& info);
|
|||||||
DLL_EXPORT Napi::Value fromJulianDay(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value fromJulianDay(const Napi::CallbackInfo& info);
|
||||||
DLL_EXPORT Napi::Value isLeapYear(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value isLeapYear(const Napi::CallbackInfo& info);
|
||||||
DLL_EXPORT Napi::Value isValid(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value isValid(const Napi::CallbackInfo& info);
|
||||||
|
DLL_EXPORT Napi::Value fromString(const Napi::CallbackInfo& info);
|
||||||
DLL_EXPORT Napi::Value fromQVariant(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value fromQVariant(const Napi::CallbackInfo& info);
|
||||||
} // namespace StaticDateWrapMethods
|
} // namespace StaticDateWrapMethods
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QDateTimeWrap : public Napi::ObjectWrap<QDateTimeWrap> {
|
class DLL_EXPORT QDateTimeWrap : public Napi::ObjectWrap<QDateTimeWrap> {
|
||||||
@ -55,5 +55,6 @@ DLL_EXPORT Napi::Value currentDateTime(const Napi::CallbackInfo& info);
|
|||||||
DLL_EXPORT Napi::Value currentDateTimeUtc(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value currentDateTimeUtc(const Napi::CallbackInfo& info);
|
||||||
DLL_EXPORT Napi::Value currentMSecsSinceEpoch(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value currentMSecsSinceEpoch(const Napi::CallbackInfo& info);
|
||||||
DLL_EXPORT Napi::Value currentSecsSinceEpoch(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value currentSecsSinceEpoch(const Napi::CallbackInfo& info);
|
||||||
|
DLL_EXPORT Napi::Value fromString(const Napi::CallbackInfo& info);
|
||||||
DLL_EXPORT Napi::Value fromQVariant(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value fromQVariant(const Napi::CallbackInfo& info);
|
||||||
} // namespace StaticDateTimeWrapMethods
|
} // namespace StaticDateTimeWrapMethods
|
||||||
|
|||||||
@ -0,0 +1,20 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <QItemSelectionModel>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
#include "core/NodeWidget/nodewidget.h"
|
||||||
|
#include "napi.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT NItemSelectionModel : public QItemSelectionModel,
|
||||||
|
public EventWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
EVENTWIDGET_IMPLEMENTATIONS(QItemSelectionModel)
|
||||||
|
public:
|
||||||
|
Napi::FunctionReference dispatchOnNode;
|
||||||
|
|
||||||
|
virtual void connectSignalsToEventEmitter() {
|
||||||
|
// Qt Connects: Implement all signal connects here
|
||||||
|
QOBJECT_SIGNALS
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
#include "nitemselectionmodel.hpp"
|
||||||
|
|
||||||
|
class DLL_EXPORT QItemSelectionModelWrap
|
||||||
|
: public Napi::ObjectWrap<QItemSelectionModelWrap> {
|
||||||
|
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QPointer<QItemSelectionModel> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QItemSelectionModelWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QItemSelectionModelWrap();
|
||||||
|
QItemSelectionModel* getInternalInstance();
|
||||||
|
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value columnIntersectsSelection(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value currentIndex(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value hasSelection(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isColumnSelected(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isRowSelected(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isSelected(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value rowIntersectsSelection(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value clear(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value clearCurrentIndex(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value clearSelection(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value reset(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value select(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setCurrentIndex(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value selectedColumns(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value selectedIndexes(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value selectedRows(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
43
src/cpp/include/nodegui/QtCore/QMimeData/qmimedata_wrap.h
Normal file
43
src/cpp/include/nodegui/QtCore/QMimeData/qmimedata_wrap.h
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QMimeData>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QMimeDataWrap : public Napi::ObjectWrap<QMimeDataWrap> {
|
||||||
|
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QPointer<QMimeData> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QMimeDataWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QMimeDataWrap();
|
||||||
|
QMimeData* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
|
||||||
|
static void cloneFromMimeDataToData(QMimeData* fromData, QMimeData* toData);
|
||||||
|
void cloneFromMimeData(QMimeData* data);
|
||||||
|
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value clear(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value hasColor(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value hasHtml(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value hasImage(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value hasText(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value hasUrls(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value html(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value removeFormat(const Napi::CallbackInfo& info);
|
||||||
|
// Will need implementation with Buffer or UInt8Array
|
||||||
|
// Napi::Value setData(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setHtml(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setText(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setUrls(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value text(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value urls(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <QModelIndex>
|
#include <QModelIndex>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QModelIndexWrap : public Napi::ObjectWrap<QModelIndexWrap> {
|
class DLL_EXPORT QModelIndexWrap : public Napi::ObjectWrap<QModelIndexWrap> {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "QtCore/QObject/qobject_macro.h"
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
#include "core/Events/eventwidget.h"
|
#include "core/Events/eventwidget.h"
|
||||||
#include "core/Events/eventwidget_macro.h"
|
#include "core/Events/eventwidget_macro.h"
|
||||||
@ -12,5 +12,5 @@ class DLL_EXPORT NObject : public QObject, public EventWidget {
|
|||||||
public:
|
public:
|
||||||
using QObject::QObject;
|
using QObject::QObject;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() { QOBJECT_SIGNALS }
|
virtual void connectSignalsToEventEmitter() { QOBJECT_SIGNALS }
|
||||||
};
|
};
|
||||||
|
|||||||
@ -5,28 +5,33 @@
|
|||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Utils/nutils.h"
|
||||||
#include "QtCore/QVariant/qvariant_wrap.h"
|
#include "QtCore/QVariant/qvariant_wrap.h"
|
||||||
#include "core/Events/eventwidget_macro.h"
|
#include "core/Events/eventwidget_macro.h"
|
||||||
/*
|
#include "core/WrapperCache/wrappercache.h"
|
||||||
|
|
||||||
This macro adds common QObject exported methods
|
/*
|
||||||
The exported methods are taken into this macro to avoid writing them in each
|
This macro adds common QObject exported methods
|
||||||
and every widget we export.
|
The exported methods are taken into this macro to avoid writing them in each
|
||||||
|
and every widget we export.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QOBJECT_WRAPPED_METHODS_DECLARATION
|
#ifndef QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE
|
||||||
#define QOBJECT_WRAPPED_METHODS_DECLARATION \
|
#define QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE(source) \
|
||||||
\
|
\
|
||||||
EVENTWIDGET_WRAPPED_METHODS_DECLARATION \
|
EVENTWIDGET_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE(source) \
|
||||||
\
|
\
|
||||||
|
Napi::Value __id__(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
return Napi::Value::From( \
|
||||||
|
env, extrautils::hashPointerTo53bit( \
|
||||||
|
static_cast<QObject*>(this->instance.data()))); \
|
||||||
|
} \
|
||||||
Napi::Value inherits(const Napi::CallbackInfo& info) { \
|
Napi::Value inherits(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
Napi::String className = info[0].As<Napi::String>(); \
|
Napi::String className = info[0].As<Napi::String>(); \
|
||||||
bool doesIt = this->instance->inherits(className.Utf8Value().c_str()); \
|
bool doesIt = this->instance->inherits(className.Utf8Value().c_str()); \
|
||||||
return Napi::Value::From(env, doesIt); \
|
return Napi::Value::From(env, doesIt); \
|
||||||
} \
|
} \
|
||||||
Napi::Value setProperty(const Napi::CallbackInfo& info) { \
|
Napi::Value setProperty(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
Napi::String name = info[0].As<Napi::String>(); \
|
Napi::String name = info[0].As<Napi::String>(); \
|
||||||
Napi::Value value = info[1]; \
|
Napi::Value value = info[1]; \
|
||||||
auto variant = \
|
auto variant = \
|
||||||
@ -37,7 +42,6 @@
|
|||||||
} \
|
} \
|
||||||
Napi::Value property(const Napi::CallbackInfo& info) { \
|
Napi::Value property(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
Napi::String name = info[0].As<Napi::String>(); \
|
Napi::String name = info[0].As<Napi::String>(); \
|
||||||
Napi::Value value = info[1]; \
|
Napi::Value value = info[1]; \
|
||||||
QVariant* variant = \
|
QVariant* variant = \
|
||||||
@ -48,7 +52,6 @@
|
|||||||
} \
|
} \
|
||||||
Napi::Value setObjectName(const Napi::CallbackInfo& info) { \
|
Napi::Value setObjectName(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
Napi::String objectName = info[0].As<Napi::String>(); \
|
Napi::String objectName = info[0].As<Napi::String>(); \
|
||||||
this->instance->setObjectName( \
|
this->instance->setObjectName( \
|
||||||
QString::fromStdString(objectName.Utf8Value())); \
|
QString::fromStdString(objectName.Utf8Value())); \
|
||||||
@ -56,29 +59,120 @@
|
|||||||
} \
|
} \
|
||||||
Napi::Value objectName(const Napi::CallbackInfo& info) { \
|
Napi::Value objectName(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
QString objectName = this->instance->objectName(); \
|
QString objectName = this->instance->objectName(); \
|
||||||
return Napi::String::New(env, objectName.toStdString()); \
|
return Napi::String::New(env, objectName.toStdString()); \
|
||||||
|
} \
|
||||||
|
Napi::Value dumpObjectTree(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
this->instance->dumpObjectTree(); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value dumpObjectInfo(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
this->instance->dumpObjectInfo(); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value __external_qobject__(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
return Napi::External<QObject>::New( \
|
||||||
|
env, static_cast<QObject*>(this->instance)); \
|
||||||
|
} \
|
||||||
|
Napi::Value startTimer(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int interval = info[0].As<Napi::Number>().Int32Value(); \
|
||||||
|
Qt::TimerType timerType = \
|
||||||
|
static_cast<Qt::TimerType>(info[1].As<Napi::Number>().Int32Value()); \
|
||||||
|
int result = this->instance->startTimer(interval, timerType); \
|
||||||
|
return Napi::Value::From(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value killTimer(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int id = info[0].As<Napi::Number>().Int32Value(); \
|
||||||
|
this->instance->killTimer(id); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value parent(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QObject* parent = this->instance->parent(); \
|
||||||
|
if (parent) { \
|
||||||
|
return WrapperCache::instance.getWrapper(env, parent); \
|
||||||
|
} else { \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
Napi::Value deleteLater(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
this->instance->deleteLater(); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value deleteObject(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
delete static_cast<QObject*>(this->instance); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value children(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QObjectList children = this->instance->children(); \
|
||||||
|
Napi::Array resultArrayNapi = Napi::Array::New(env, children.size()); \
|
||||||
|
for (int i = 0; i < children.size(); i++) { \
|
||||||
|
resultArrayNapi[i] = \
|
||||||
|
WrapperCache::instance.getWrapper(env, children[i]); \
|
||||||
|
} \
|
||||||
|
return resultArrayNapi; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ideally this macro below should go in
|
||||||
|
// QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE but some wrappers
|
||||||
|
// need their own setParent()` implementation which handles different
|
||||||
|
// arguments.
|
||||||
|
#define QOBJECT_SET_PARENT_IMPL \
|
||||||
|
Napi::Value setParent(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
if (info[0].IsNull()) { \
|
||||||
|
this->instance->setParent(nullptr); \
|
||||||
|
} else { \
|
||||||
|
QObject* parentObject = info[0].As<Napi::External<QObject>>().Data(); \
|
||||||
|
this->instance->setParent(parentObject); \
|
||||||
|
} \
|
||||||
|
return env.Null(); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE
|
||||||
|
|
||||||
|
#ifndef QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
|
#define QOBJECT_WRAPPED_METHODS_DECLARATION \
|
||||||
|
QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE(this->instance.data()) \
|
||||||
|
QOBJECT_SET_PARENT_IMPL
|
||||||
#endif // QOBJECT_WRAPPED_METHODS_DECLARATION
|
#endif // QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
#ifndef QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE
|
#ifndef QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
#define QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE(ComponentWrapName) \
|
#define QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE(ComponentWrapName) \
|
||||||
\
|
\
|
||||||
EVENTWIDGET_WRAPPED_METHODS_EXPORT_DEFINE(ComponentWrapName) \
|
EVENTWIDGET_WRAPPED_METHODS_EXPORT_DEFINE(ComponentWrapName) \
|
||||||
\
|
\
|
||||||
InstanceMethod("inherits", &ComponentWrapName::inherits), \
|
InstanceMethod("__id__", &ComponentWrapName::__id__), \
|
||||||
InstanceMethod("setProperty", &ComponentWrapName::setProperty), \
|
InstanceMethod("__external_qobject__", \
|
||||||
InstanceMethod("property", &ComponentWrapName::property), \
|
&ComponentWrapName::__external_qobject__), \
|
||||||
InstanceMethod("setObjectName", &ComponentWrapName::setObjectName), \
|
InstanceMethod("inherits", &ComponentWrapName::inherits), \
|
||||||
InstanceMethod("objectName", &ComponentWrapName::objectName),
|
InstanceMethod("setProperty", &ComponentWrapName::setProperty), \
|
||||||
|
InstanceMethod("property", &ComponentWrapName::property), \
|
||||||
|
InstanceMethod("setObjectName", &ComponentWrapName::setObjectName), \
|
||||||
|
InstanceMethod("objectName", &ComponentWrapName::objectName), \
|
||||||
|
InstanceMethod("dumpObjectTree", &ComponentWrapName::dumpObjectTree), \
|
||||||
|
InstanceMethod("dumpObjectInfo", &ComponentWrapName::dumpObjectInfo), \
|
||||||
|
InstanceMethod("setParent", &ComponentWrapName::setParent), \
|
||||||
|
InstanceMethod("startTimer", &ComponentWrapName::startTimer), \
|
||||||
|
InstanceMethod("killTimer", &ComponentWrapName::killTimer), \
|
||||||
|
InstanceMethod("parent", &ComponentWrapName::parent), \
|
||||||
|
InstanceMethod("deleteLater", &ComponentWrapName::deleteLater), \
|
||||||
|
InstanceMethod("delete", &ComponentWrapName::deleteObject), \
|
||||||
|
InstanceMethod("children", &ComponentWrapName::children),
|
||||||
|
|
||||||
#endif // QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE
|
#endif // QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
|
|
||||||
#ifndef QOBJECT_SIGNALS
|
#ifndef QOBJECT_SIGNALS_ON_TARGET
|
||||||
#define QOBJECT_SIGNALS \
|
#define QOBJECT_SIGNALS_ON_TARGET(target) \
|
||||||
QObject::connect(this, &QObject::objectNameChanged, \
|
QObject::connect(target, &QObject::objectNameChanged, \
|
||||||
[=](const QString& objectName) { \
|
[=](const QString& objectName) { \
|
||||||
Napi::Env env = this->emitOnNode.Env(); \
|
Napi::Env env = this->emitOnNode.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
Napi::HandleScope scope(env); \
|
||||||
@ -86,5 +180,28 @@
|
|||||||
{Napi::String::New(env, "objectNameChanged"), \
|
{Napi::String::New(env, "objectNameChanged"), \
|
||||||
Napi::Value::From(env, objectName.toStdString())}); \
|
Napi::Value::From(env, objectName.toStdString())}); \
|
||||||
});
|
});
|
||||||
|
#endif // QOBJECT_SIGNALS_ON_TARGET
|
||||||
|
|
||||||
|
#ifndef QOBJECT_SIGNALS
|
||||||
|
#define QOBJECT_SIGNALS QOBJECT_SIGNALS_ON_TARGET(this)
|
||||||
#endif // QOBJECT_SIGNALS
|
#endif // QOBJECT_SIGNALS
|
||||||
|
|
||||||
|
/*
|
||||||
|
Macro to register a function to wrap QObject pointers of a
|
||||||
|
given subclass to wrapper instances. First parameter is the
|
||||||
|
plain name of the QObject subclass (no quotes), seconds is the
|
||||||
|
name of the wrapper class.
|
||||||
|
*/
|
||||||
|
#ifndef QOBJECT_REGISTER_WRAPPER
|
||||||
|
#define QOBJECT_REGISTER_WRAPPER(qobjectType, ComponentWrapName) \
|
||||||
|
WrapperCache::instance.registerWrapper( \
|
||||||
|
QString(#qobjectType), \
|
||||||
|
[](Napi::Env env, QObject* qobject) -> Napi::Object { \
|
||||||
|
qobjectType* exactQObject = dynamic_cast<qobjectType*>(qobject); \
|
||||||
|
Napi::Object wrapper = ComponentWrapName::constructor.New( \
|
||||||
|
{Napi::External<QObject>::New(env, exactQObject)}); \
|
||||||
|
return wrapper; \
|
||||||
|
});
|
||||||
|
#endif // QOBJECT_REGISTER_WRAPPER
|
||||||
|
|
||||||
|
#include "QtCore/QObject/qobject_wrap.h"
|
||||||
|
|||||||
@ -4,21 +4,22 @@
|
|||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "QtCore/QObject/nobject.hpp"
|
#include "QtCore/QObject/nobject.hpp"
|
||||||
#include "QtCore/QObject/qobject_macro.h"
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QObjectWrap : public Napi::ObjectWrap<QObjectWrap> {
|
class DLL_EXPORT QObjectWrap : public Napi::ObjectWrap<QObjectWrap> {
|
||||||
QOBJECT_WRAPPED_METHODS_DECLARATION
|
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NObject> instance;
|
QPointer<QObject> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QObjectWrap(const Napi::CallbackInfo& info);
|
QObjectWrap(const Napi::CallbackInfo& info);
|
||||||
~QObjectWrap();
|
~QObjectWrap();
|
||||||
NObject* getInternalInstance();
|
QObject* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
|
static Napi::Object wrapFunc(Napi::Env env, QObject* qobject);
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
};
|
};
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QPointWrap : public Napi::ObjectWrap<QPointWrap> {
|
class DLL_EXPORT QPointWrap : public Napi::ObjectWrap<QPointWrap> {
|
||||||
@ -23,6 +23,9 @@ class DLL_EXPORT QPointWrap : public Napi::ObjectWrap<QPointWrap> {
|
|||||||
Napi::Value setY(const Napi::CallbackInfo& info);
|
Napi::Value setY(const Napi::CallbackInfo& info);
|
||||||
Napi::Value x(const Napi::CallbackInfo& info);
|
Napi::Value x(const Napi::CallbackInfo& info);
|
||||||
Napi::Value y(const Napi::CallbackInfo& info);
|
Napi::Value y(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isNull(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value manhattanLength(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value transposed(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace StaticQPointWrapMethods {
|
namespace StaticQPointWrapMethods {
|
||||||
|
|||||||
38
src/cpp/include/nodegui/QtCore/QPointF/qpointf_wrap.h
Normal file
38
src/cpp/include/nodegui/QtCore/QPointF/qpointf_wrap.h
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QPointF>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QPointFWrap : public Napi::ObjectWrap<QPointFWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unique_ptr<QPointF> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QPointFWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QPointFWrap();
|
||||||
|
QPointF* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value dotProduct(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isNull(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value manhattanLength(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setX(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setY(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value toPoint(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value transposed(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value x(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value y(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace StaticQPointFWrapMethods {
|
||||||
|
DLL_EXPORT Napi::Value dotProduct(const Napi::CallbackInfo& info);
|
||||||
|
} // namespace StaticQPointFWrapMethods
|
||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <QRect>
|
#include <QRect>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QRectWrap : public Napi::ObjectWrap<QRectWrap> {
|
class DLL_EXPORT QRectWrap : public Napi::ObjectWrap<QRectWrap> {
|
||||||
|
|||||||
82
src/cpp/include/nodegui/QtCore/QRectF/qrectf_wrap.h
Normal file
82
src/cpp/include/nodegui/QtCore/QRectF/qrectf_wrap.h
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QRectF>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QRectFWrap : public Napi::ObjectWrap<QRectFWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unique_ptr<QRectF> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QRectFWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QRectFWrap();
|
||||||
|
QRectF* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value adjust(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value adjusted(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value bottom(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value bottomLeft(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value bottomRight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value center(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value contains(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value contains_QRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value contains_QPoint(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value height(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value intersected(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value intersects(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isEmpty(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isNull(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isValid(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value left(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value moveBottom(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value moveBottomLeft(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value moveBottomRight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value moveCenter(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value moveLeft(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value moveRight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value moveTo(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value moveTo_QPoint(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value moveTop(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value moveTopLeft(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value moveTopRight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value normalized(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value right(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setBottom(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setBottomLeft(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setBottomRight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setCoords(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setHeight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setLeft(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setRight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setTop(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setTopLeft(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setTopRight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setWidth(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setX(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setY(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value toAlignedRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value toRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value top(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value topLeft(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value topRight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value translate(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value translate_QPoint(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value translated(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value translated_QPoint(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value transposed(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value united(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value width(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value x(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value y(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
25
src/cpp/include/nodegui/QtCore/QSettings/qsettings_wrap.h
Normal file
25
src/cpp/include/nodegui/QtCore/QSettings/qsettings_wrap.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QSettings>
|
||||||
|
|
||||||
|
#include "Extras/Utils/nutils.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QSettingsWrap : public Napi::ObjectWrap<QSettingsWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unique_ptr<QSettings> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
~QSettingsWrap();
|
||||||
|
QSettings* getInternalInstance();
|
||||||
|
QSettingsWrap(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value sync(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setValue(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value value(const Napi::CallbackInfo& info);
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
};
|
||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <QSize>
|
#include <QSize>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QSizeWrap : public Napi::ObjectWrap<QSizeWrap> {
|
class DLL_EXPORT QSizeWrap : public Napi::ObjectWrap<QSizeWrap> {
|
||||||
@ -19,9 +19,18 @@ class DLL_EXPORT QSizeWrap : public Napi::ObjectWrap<QSizeWrap> {
|
|||||||
~QSizeWrap();
|
~QSizeWrap();
|
||||||
QSize* getInternalInstance();
|
QSize* getInternalInstance();
|
||||||
// Wrapped methods
|
// Wrapped methods
|
||||||
|
Napi::Value boundedTo(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value expandedTo(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value height(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isEmpty(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isNull(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isValid(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value scale(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value scaled(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setHeight(const Napi::CallbackInfo& info);
|
Napi::Value setHeight(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setWidth(const Napi::CallbackInfo& info);
|
Napi::Value setWidth(const Napi::CallbackInfo& info);
|
||||||
Napi::Value height(const Napi::CallbackInfo& info);
|
Napi::Value transpose(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value transposed(const Napi::CallbackInfo& info);
|
||||||
Napi::Value width(const Napi::CallbackInfo& info);
|
Napi::Value width(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
40
src/cpp/include/nodegui/QtCore/QSizeF/qsizef_wrap.h
Normal file
40
src/cpp/include/nodegui/QtCore/QSizeF/qsizef_wrap.h
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QSizeF>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QSizeFWrap : public Napi::ObjectWrap<QSizeFWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
private:
|
||||||
|
std::unique_ptr<QSizeF> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QSizeFWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QSizeFWrap();
|
||||||
|
QSizeF* getInternalInstance();
|
||||||
|
// Wrapped methods
|
||||||
|
Napi::Value boundedTo(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value expandedTo(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value height(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isEmpty(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isNull(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isValid(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value scale(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value scaled(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setHeight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setWidth(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value toSize(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value transpose(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value transposed(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value width(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace StaticQSizeFWrapMethods {
|
||||||
|
DLL_EXPORT Napi::Value fromQVariant(const Napi::CallbackInfo& info);
|
||||||
|
} // namespace StaticQSizeFWrapMethods
|
||||||
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QTimeWrap : public Napi::ObjectWrap<QTimeWrap> {
|
class DLL_EXPORT QTimeWrap : public Napi::ObjectWrap<QTimeWrap> {
|
||||||
@ -42,5 +42,6 @@ namespace StaticTimeWrapMethods {
|
|||||||
DLL_EXPORT Napi::Value currentTime(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value currentTime(const Napi::CallbackInfo& info);
|
||||||
DLL_EXPORT Napi::Value fromMSecsSinceStartOfDay(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value fromMSecsSinceStartOfDay(const Napi::CallbackInfo& info);
|
||||||
DLL_EXPORT Napi::Value isValid(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value isValid(const Napi::CallbackInfo& info);
|
||||||
|
DLL_EXPORT Napi::Value fromString(const Napi::CallbackInfo& info);
|
||||||
DLL_EXPORT Napi::Value fromQVariant(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value fromQVariant(const Napi::CallbackInfo& info);
|
||||||
} // namespace StaticTimeWrapMethods
|
} // namespace StaticTimeWrapMethods
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QUrlWrap : public Napi::ObjectWrap<QUrlWrap> {
|
class DLL_EXPORT QUrlWrap : public Napi::ObjectWrap<QUrlWrap> {
|
||||||
@ -21,8 +21,49 @@ class DLL_EXPORT QUrlWrap : public Napi::ObjectWrap<QUrlWrap> {
|
|||||||
// Wrapped methods
|
// Wrapped methods
|
||||||
Napi::Value setUrl(const Napi::CallbackInfo& info);
|
Napi::Value setUrl(const Napi::CallbackInfo& info);
|
||||||
Napi::Value toString(const Napi::CallbackInfo& info);
|
Napi::Value toString(const Napi::CallbackInfo& info);
|
||||||
|
|
||||||
|
Napi::Value adjusted(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value authority(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value clear(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value errorString(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value fileName(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value fragment(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value hasFragment(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value hasQuery(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value host(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isEmpty(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isLocalFile(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isParentOf(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isRelative(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isValid(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value matches(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value password(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value path(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value port(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value query(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value resolved(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value scheme(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setAuthority(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setFragment(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setHost(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setPassword(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setPath(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setPort(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setQuery(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setScheme(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setUserInfo(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setUserName(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value swap(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value toDisplayString(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value toLocalFile(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value toString_withOpts(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value url(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value userInfo(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value userName(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace StaticQUrlWrapMethods {
|
namespace StaticQUrlWrapMethods {
|
||||||
DLL_EXPORT Napi::Value fromQVariant(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value fromQVariant(const Napi::CallbackInfo& info);
|
||||||
|
DLL_EXPORT Napi::Value fromLocalFile(const Napi::CallbackInfo& info);
|
||||||
|
DLL_EXPORT Napi::Value fromUserInput(const Napi::CallbackInfo& info);
|
||||||
} // namespace StaticQUrlWrapMethods
|
} // namespace StaticQUrlWrapMethods
|
||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QVariantWrap : public Napi::ObjectWrap<QVariantWrap> {
|
class DLL_EXPORT QVariantWrap : public Napi::ObjectWrap<QVariantWrap> {
|
||||||
@ -22,9 +22,10 @@ class DLL_EXPORT QVariantWrap : public Napi::ObjectWrap<QVariantWrap> {
|
|||||||
Napi::Value toInt(const Napi::CallbackInfo& info);
|
Napi::Value toInt(const Napi::CallbackInfo& info);
|
||||||
Napi::Value toDouble(const Napi::CallbackInfo& info);
|
Napi::Value toDouble(const Napi::CallbackInfo& info);
|
||||||
Napi::Value toBool(const Napi::CallbackInfo& info);
|
Napi::Value toBool(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value toStringList(const Napi::CallbackInfo& info);
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace StaticQVariantWrapMethods {
|
namespace StaticQVariantWrapMethods {
|
||||||
DLL_EXPORT Napi::Value converToQVariant(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value convertToQVariant(const Napi::CallbackInfo& info);
|
||||||
} // namespace StaticQVariantWrapMethods
|
} // namespace StaticQVariantWrapMethods
|
||||||
67
src/cpp/include/nodegui/QtGui/QApplication/napplication.hpp
Normal file
67
src/cpp/include/nodegui/QtGui/QApplication/napplication.hpp
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QGuiApplication>
|
||||||
|
#include <QWindow>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
#include "QtGui/QScreen/qscreen_wrap.h"
|
||||||
|
#include "core/WrapperCache/wrappercache.h"
|
||||||
|
#include "napi.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT NApplication : public QApplication, public EventWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
EVENTWIDGET_IMPLEMENTATIONS(QApplication)
|
||||||
|
public:
|
||||||
|
using QApplication::QApplication; // inherit all constructors of QApplication
|
||||||
|
virtual void connectSignalsToEventEmitter() {
|
||||||
|
// Qt Connects: Implement all signal connects here
|
||||||
|
QOBJECT_SIGNALS
|
||||||
|
|
||||||
|
QObject::connect(
|
||||||
|
this, &QGuiApplication::applicationDisplayNameChanged, [=]() {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
this->emitOnNode.Call(
|
||||||
|
{Napi::String::New(env, "applicationDisplayNameChanged")});
|
||||||
|
});
|
||||||
|
|
||||||
|
QObject::connect(
|
||||||
|
this, &QGuiApplication::focusWindowChanged, [=](QWindow* focusWindow) {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
this->emitOnNode.Call({Napi::String::New(env, "focusWindowChanged")});
|
||||||
|
});
|
||||||
|
|
||||||
|
QObject::connect(this, &QGuiApplication::lastWindowClosed, [=]() {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
this->emitOnNode.Call({Napi::String::New(env, "lastWindowClosed")});
|
||||||
|
});
|
||||||
|
|
||||||
|
QObject::connect(
|
||||||
|
this, &QGuiApplication::primaryScreenChanged, [=](QScreen* screen) {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
auto instance = WrapperCache::instance.getWrapper(env, screen, true);
|
||||||
|
this->emitOnNode.Call(
|
||||||
|
{Napi::String::New(env, "primaryScreenChanged"), instance});
|
||||||
|
});
|
||||||
|
|
||||||
|
QObject::connect(this, &QGuiApplication::screenAdded, [=](QScreen* screen) {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
auto instance = WrapperCache::instance.getWrapper(env, screen, true);
|
||||||
|
this->emitOnNode.Call({Napi::String::New(env, "screenAdded"), instance});
|
||||||
|
});
|
||||||
|
|
||||||
|
QObject::connect(
|
||||||
|
this, &QGuiApplication::screenRemoved, [=](QScreen* screen) {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
auto instance = WrapperCache::instance.getWrapper(env, screen, true);
|
||||||
|
this->emitOnNode.Call(
|
||||||
|
{Napi::String::New(env, "screenRemoved"), instance});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -2,19 +2,17 @@
|
|||||||
|
|
||||||
#include <napi.h>
|
#include <napi.h>
|
||||||
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
#include "napplication.hpp"
|
||||||
|
|
||||||
class DLL_EXPORT QApplicationWrap : public Napi::ObjectWrap<QApplicationWrap> {
|
class DLL_EXPORT QApplicationWrap : public Napi::ObjectWrap<QApplicationWrap> {
|
||||||
COMPONENT_WRAPPED_METHODS_DECLARATION
|
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<QApplication> instance;
|
QPointer<NApplication> instance;
|
||||||
static int argc;
|
|
||||||
static char** argv;
|
|
||||||
bool _wasManuallyCreated = false;
|
bool _wasManuallyCreated = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -22,7 +20,7 @@ class DLL_EXPORT QApplicationWrap : public Napi::ObjectWrap<QApplicationWrap> {
|
|||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QApplicationWrap(const Napi::CallbackInfo& info);
|
QApplicationWrap(const Napi::CallbackInfo& info);
|
||||||
~QApplicationWrap();
|
~QApplicationWrap();
|
||||||
QApplication* getInternalInstance();
|
NApplication* getInternalInstance();
|
||||||
// Wrapped methods
|
// Wrapped methods
|
||||||
Napi::Value processEvents(const Napi::CallbackInfo& info);
|
Napi::Value processEvents(const Napi::CallbackInfo& info);
|
||||||
Napi::Value exec(const Napi::CallbackInfo& info);
|
Napi::Value exec(const Napi::CallbackInfo& info);
|
||||||
@ -30,10 +28,16 @@ class DLL_EXPORT QApplicationWrap : public Napi::ObjectWrap<QApplicationWrap> {
|
|||||||
Napi::Value exit(const Napi::CallbackInfo& info);
|
Napi::Value exit(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setQuitOnLastWindowClosed(const Napi::CallbackInfo& info);
|
Napi::Value setQuitOnLastWindowClosed(const Napi::CallbackInfo& info);
|
||||||
Napi::Value quitOnLastWindowClosed(const Napi::CallbackInfo& info);
|
Napi::Value quitOnLastWindowClosed(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value palette(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setStyleSheet(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value devicePixelRatio(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace StaticQApplicationWrapMethods {
|
namespace StaticQApplicationWrapMethods {
|
||||||
DLL_EXPORT Napi::Value instance(const Napi::CallbackInfo& info);
|
|
||||||
DLL_EXPORT Napi::Value clipboard(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value clipboard(const Napi::CallbackInfo& info);
|
||||||
|
DLL_EXPORT Napi::Value instance(const Napi::CallbackInfo& info);
|
||||||
|
DLL_EXPORT Napi::Value primaryScreen(const Napi::CallbackInfo& info);
|
||||||
|
DLL_EXPORT Napi::Value screens(const Napi::CallbackInfo& info);
|
||||||
|
DLL_EXPORT Napi::Value setStyle(const Napi::CallbackInfo& info);
|
||||||
DLL_EXPORT Napi::Value style(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value style(const Napi::CallbackInfo& info);
|
||||||
} // namespace StaticQApplicationWrapMethods
|
} // namespace StaticQApplicationWrapMethods
|
||||||
|
|||||||
33
src/cpp/include/nodegui/QtGui/QBrush/qbrush_wrap.h
Normal file
33
src/cpp/include/nodegui/QtGui/QBrush/qbrush_wrap.h
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QBrush>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QBrushWrap : public Napi::ObjectWrap<QBrushWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
private:
|
||||||
|
std::unique_ptr<QBrush> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QBrushWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QBrushWrap();
|
||||||
|
QBrush* getInternalInstance();
|
||||||
|
// Wrapped methods
|
||||||
|
Napi::Value isOpaque(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setColor(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value color(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setStyle(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value style(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setTexture(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value texture(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace StaticQBrushWrapMethods {
|
||||||
|
Napi::Value fromQVariant(const Napi::CallbackInfo& info);
|
||||||
|
} // namespace StaticQBrushWrapMethods
|
||||||
@ -3,23 +3,34 @@
|
|||||||
#include <napi.h>
|
#include <napi.h>
|
||||||
|
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QClipboardWrap : public Napi::ObjectWrap<QClipboardWrap> {
|
class DLL_EXPORT QClipboardWrap : public Napi::ObjectWrap<QClipboardWrap>,
|
||||||
COMPONENT_WRAPPED_METHODS_DECLARATION
|
public EventWidget {
|
||||||
|
QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE(this)
|
||||||
|
// Note: We don't use EVENTWIDGET_IMPLEMENTATIONS() here because this class
|
||||||
|
// doesn't handle any QEvents.
|
||||||
|
QOBJECT_SET_PARENT_IMPL
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QClipboard* instance;
|
QPointer<QClipboard> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
|
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QClipboardWrap(const Napi::CallbackInfo& info);
|
QClipboardWrap(const Napi::CallbackInfo& info);
|
||||||
QClipboard* getInternalInstance();
|
QClipboard* getInternalInstance();
|
||||||
|
|
||||||
|
virtual void connectSignalsToEventEmitter();
|
||||||
|
|
||||||
// Wrapped methods
|
// Wrapped methods
|
||||||
Napi::Value clear(const Napi::CallbackInfo& info);
|
Napi::Value clear(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setText(const Napi::CallbackInfo& info);
|
Napi::Value setText(const Napi::CallbackInfo& info);
|
||||||
Napi::Value text(const Napi::CallbackInfo& info);
|
Napi::Value text(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setPixmap(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value pixmap(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QColorWrap : public Napi::ObjectWrap<QColorWrap> {
|
class DLL_EXPORT QColorWrap : public Napi::ObjectWrap<QColorWrap> {
|
||||||
@ -27,6 +27,8 @@ class DLL_EXPORT QColorWrap : public Napi::ObjectWrap<QColorWrap> {
|
|||||||
Napi::Value blue(const Napi::CallbackInfo& info);
|
Napi::Value blue(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setAlpha(const Napi::CallbackInfo& info);
|
Napi::Value setAlpha(const Napi::CallbackInfo& info);
|
||||||
Napi::Value alpha(const Napi::CallbackInfo& info);
|
Napi::Value alpha(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value rgb(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value rgba(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace StaticQColorWrapMethods {
|
namespace StaticQColorWrapMethods {
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QCursorWrap : public Napi::ObjectWrap<QCursorWrap> {
|
class DLL_EXPORT QCursorWrap : public Napi::ObjectWrap<QCursorWrap> {
|
||||||
|
|||||||
25
src/cpp/include/nodegui/QtGui/QDrag/ndrag.hpp
Normal file
25
src/cpp/include/nodegui/QtGui/QDrag/ndrag.hpp
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <QDrag>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
#include "core/Events/eventwidget.h"
|
||||||
|
#include "core/Events/eventwidget_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT NDrag : public QDrag, public EventWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
EVENTWIDGET_IMPLEMENTATIONS(QDrag)
|
||||||
|
public:
|
||||||
|
using QDrag::QDrag;
|
||||||
|
|
||||||
|
virtual void connectSignalsToEventEmitter() {
|
||||||
|
QOBJECT_SIGNALS
|
||||||
|
QObject::connect(this, &QDrag::actionChanged, [=](Qt::DropAction action) {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
this->emitOnNode.Call(
|
||||||
|
{Napi::String::New(env, "actionChanged"),
|
||||||
|
Napi::Number::From(env, static_cast<int>(action))});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
53
src/cpp/include/nodegui/QtGui/QDrag/qdrag_wrap.h
Normal file
53
src/cpp/include/nodegui/QtGui/QDrag/qdrag_wrap.h
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QDrag>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QDrag/ndrag.hpp"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
- Note that setMimeData() assigns ownership of the QMimeData object to the QDrag
|
||||||
|
object.
|
||||||
|
- The QDrag must be constructed on the heap with a parent QObject to ensure that
|
||||||
|
Qt can clean up after the drag and drop operation has been completed
|
||||||
|
*/
|
||||||
|
class DLL_EXPORT QDragWrap : public Napi::ObjectWrap<QDragWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
// A guarded pointer, QPointer<T>, behaves like a normal C++ pointer T *,
|
||||||
|
// except that it is automatically cleared when the referenced object is
|
||||||
|
// destroyed (unlike normal C++ pointers, which become "dangling pointers" in
|
||||||
|
// such cases). T must be a subclass of QObject.
|
||||||
|
QPointer<QDrag> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QDragWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QDragWrap();
|
||||||
|
QDrag* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value defaultAction(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value dragCursor(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value exec(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value hotSpot(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value pixmap(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setDragCursor(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setHotSpot(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setPixmap(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value supportedActions(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value mimeData(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setMimeData(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value source(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value target(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace StaticQDragWrapMethods {
|
||||||
|
DLL_EXPORT Napi::Value cancel(const Napi::CallbackInfo& info);
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QDragLeaveEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QDragLeaveEventWrap
|
||||||
|
: public Napi::ObjectWrap<QDragLeaveEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QDragLeaveEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QDragLeaveEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QDragLeaveEventWrap();
|
||||||
|
QDragLeaveEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods (none)
|
||||||
|
};
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QDragMoveEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QDragMoveEventWrap
|
||||||
|
: public Napi::ObjectWrap<QDragMoveEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QDragMoveEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QDragMoveEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QDragMoveEventWrap();
|
||||||
|
QDragMoveEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
|
||||||
|
// methods of QDragMoveEvent itself
|
||||||
|
// Napi::Value accept(const Napi::CallbackInfo& info); //already in qevent
|
||||||
|
Napi::Value answerRect(const Napi::CallbackInfo& info);
|
||||||
|
// Napi::Value ignore(const Napi::CallbackInfo& info); //already in qevent
|
||||||
|
|
||||||
|
// methods copied from QDropEvent
|
||||||
|
Napi::Value acceptProposedAction(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value dropAction(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value keyboardModifiers(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value mouseButtons(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value mimeData(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value pos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value possibleActions(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value proposedAction(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setDropAction(const Napi::CallbackInfo& info);
|
||||||
|
|
||||||
|
// Methods from QEvent (Not using macro because accept and ignore are
|
||||||
|
// overloaded)
|
||||||
|
Napi::Value accept(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value ignore(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isAccepted(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setAccepted(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value spontaneous(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value _type(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QDropEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QDropEventWrap : public Napi::ObjectWrap<QDropEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QDropEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QDropEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QDropEventWrap();
|
||||||
|
QDropEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value acceptProposedAction(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value dropAction(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value keyboardModifiers(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value mouseButtons(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value mimeData(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value pos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value possibleActions(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value proposedAction(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setDropAction(const Napi::CallbackInfo& info);
|
||||||
|
|
||||||
|
// Methods from QEvent
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
};
|
||||||
46
src/cpp/include/nodegui/QtGui/QEvent/QEvent/qevent_macro.h
Normal file
46
src/cpp/include/nodegui/QtGui/QEvent/QEvent/qevent_macro.h
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
#ifndef QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
#define QEVENT_WRAPPED_METHODS_DECLARATION \
|
||||||
|
Napi::Value accept(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
this->instance->accept(); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value ignore(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
this->instance->ignore(); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value isAccepted(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
bool v = this->instance->isAccepted(); \
|
||||||
|
return Napi::Boolean::From(env, v); \
|
||||||
|
} \
|
||||||
|
Napi::Value setAccepted(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
bool v = info[0].As<Napi::Boolean>().Value(); \
|
||||||
|
this->instance->setAccepted(v); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value spontaneous(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
bool v = this->instance->spontaneous(); \
|
||||||
|
return Napi::Boolean::From(env, v); \
|
||||||
|
} \
|
||||||
|
Napi::Value _type(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int v = static_cast<int>(this->instance->type()); \
|
||||||
|
return Napi::Number::From(env, v); \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef QEVENT_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
|
#define QEVENT_WRAPPED_METHODS_EXPORT_DEFINE(WidgetWrapName) \
|
||||||
|
InstanceMethod("accept", &WidgetWrapName::accept), \
|
||||||
|
InstanceMethod("ignore", &WidgetWrapName::ignore), \
|
||||||
|
InstanceMethod("isAccepted", &WidgetWrapName::isAccepted), \
|
||||||
|
InstanceMethod("setAccepted", &WidgetWrapName::setAccepted), \
|
||||||
|
InstanceMethod("spontaneous", &WidgetWrapName::spontaneous), \
|
||||||
|
InstanceMethod( \
|
||||||
|
"_type", \
|
||||||
|
&WidgetWrapName::_type), // Rename to _type to prevent conflict
|
||||||
|
#endif
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
#ifndef QINPUTEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
#define QINPUTEVENT_WRAPPED_METHODS_DECLARATION \
|
||||||
|
Napi::Value modifiers(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
uint v = static_cast<uint>(this->instance->modifiers()); \
|
||||||
|
return Napi::Number::From(env, v); \
|
||||||
|
} \
|
||||||
|
Napi::Value timestamp(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
ulong timestamp = this->instance->timestamp(); \
|
||||||
|
return Napi::Number::From(env, timestamp); \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef QINPUTEVENT_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
|
#define QINPUTEVENT_WRAPPED_METHODS_EXPORT_DEFINE(WidgetWrapName) \
|
||||||
|
InstanceMethod("modifiers", &WidgetWrapName::modifiers), \
|
||||||
|
InstanceMethod("timestamp", &WidgetWrapName::timestamp),
|
||||||
|
#endif
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QInputMethodEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QInputMethodEventWrap
|
||||||
|
: public Napi::ObjectWrap<QInputMethodEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QInputMethodEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QInputMethodEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QInputMethodEventWrap();
|
||||||
|
QInputMethodEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value commitString(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value preeditString(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value replacementLength(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value replacementStart(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setCommitString(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QInputMethodQueryEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QInputMethodQueryEventWrap
|
||||||
|
: public Napi::ObjectWrap<QInputMethodQueryEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QInputMethodQueryEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QInputMethodQueryEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QInputMethodQueryEventWrap();
|
||||||
|
QInputMethodQueryEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value queries(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setValue(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value value(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -4,11 +4,15 @@
|
|||||||
|
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "QtGui/QEvent/QInputEvent/qinputevent_macro.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QKeyEventWrap : public Napi::ObjectWrap<QKeyEventWrap> {
|
class DLL_EXPORT QKeyEventWrap : public Napi::ObjectWrap<QKeyEventWrap> {
|
||||||
COMPONENT_WRAPPED_METHODS_DECLARATION
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QINPUTEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QKeyEvent* instance;
|
QKeyEvent* instance;
|
||||||
@ -23,7 +27,6 @@ class DLL_EXPORT QKeyEventWrap : public Napi::ObjectWrap<QKeyEventWrap> {
|
|||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value text(const Napi::CallbackInfo& info);
|
Napi::Value text(const Napi::CallbackInfo& info);
|
||||||
Napi::Value key(const Napi::CallbackInfo& info);
|
Napi::Value key(const Napi::CallbackInfo& info);
|
||||||
Napi::Value modifiers(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value count(const Napi::CallbackInfo& info);
|
Napi::Value count(const Napi::CallbackInfo& info);
|
||||||
Napi::Value isAutoRepeat(const Napi::CallbackInfo& info);
|
Napi::Value isAutoRepeat(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
@ -4,11 +4,15 @@
|
|||||||
|
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "QtGui/QEvent/QInputEvent/qinputevent_macro.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QMouseEventWrap : public Napi::ObjectWrap<QMouseEventWrap> {
|
class DLL_EXPORT QMouseEventWrap : public Napi::ObjectWrap<QMouseEventWrap> {
|
||||||
COMPONENT_WRAPPED_METHODS_DECLARATION
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QINPUTEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMouseEvent* instance;
|
QMouseEvent* instance;
|
||||||
@ -22,6 +26,7 @@ class DLL_EXPORT QMouseEventWrap : public Napi::ObjectWrap<QMouseEventWrap> {
|
|||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value button(const Napi::CallbackInfo& info);
|
Napi::Value button(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value buttons(const Napi::CallbackInfo& info);
|
||||||
Napi::Value x(const Napi::CallbackInfo& info);
|
Napi::Value x(const Napi::CallbackInfo& info);
|
||||||
Napi::Value y(const Napi::CallbackInfo& info);
|
Napi::Value y(const Napi::CallbackInfo& info);
|
||||||
Napi::Value globalX(const Napi::CallbackInfo& info);
|
Napi::Value globalX(const Napi::CallbackInfo& info);
|
||||||
|
|||||||
@ -0,0 +1,28 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QMoveEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QMoveEventWrap : public Napi::ObjectWrap<QMoveEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QMoveEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QMoveEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QMoveEventWrap();
|
||||||
|
QMoveEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value oldPos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value pos(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QNativeGestureEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "QtGui/QEvent/QInputEvent/qinputevent_macro.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QNativeGestureEventWrap
|
||||||
|
: public Napi::ObjectWrap<QNativeGestureEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QINPUTEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QNativeGestureEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QNativeGestureEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QNativeGestureEventWrap();
|
||||||
|
QNativeGestureEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value gestureType(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value globalPos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value localPos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value pos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value screenPos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value windowPos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value value(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QPaintEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QPaintEventWrap : public Napi::ObjectWrap<QPaintEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QPaintEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QPaintEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QPaintEventWrap();
|
||||||
|
QPaintEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value rect(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QResizeEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QResizeEventWrap : public Napi::ObjectWrap<QResizeEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QResizeEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QResizeEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QResizeEventWrap();
|
||||||
|
QResizeEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value oldSize(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value size(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QTabletEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "QtGui/QEvent/QInputEvent/qinputevent_macro.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QTabletEventWrap : public Napi::ObjectWrap<QTabletEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QINPUTEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QTabletEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QTabletEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QTabletEventWrap();
|
||||||
|
QTabletEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value button(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value buttons(const Napi::CallbackInfo& info);
|
||||||
|
// Somehow this method isn't found on build?
|
||||||
|
// Napi::Value deviceType(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value globalPos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value globalPosF(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value globalX(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value globalY(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value pointerType(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value pos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value posF(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value pressure(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value rotation(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value tangentialPressure(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value uniqueId(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value x(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value xTilt(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value y(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value yTilt(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value z(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QTimerEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QTimerEventWrap : public Napi::ObjectWrap<QTimerEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QTimerEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QTimerEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QTimerEventWrap();
|
||||||
|
QTimerEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value timerId(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QWheelEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "QtGui/QEvent/QInputEvent/qinputevent_macro.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QWheelEventWrap : public Napi::ObjectWrap<QWheelEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QINPUTEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QWheelEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QWheelEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QWheelEventWrap();
|
||||||
|
QWheelEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value angleDelta(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value buttons(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value globalPosition(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value inverted(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value phase(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value pixelDelta(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value position(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QFontWrap : public Napi::ObjectWrap<QFontWrap> {
|
class DLL_EXPORT QFontWrap : public Napi::ObjectWrap<QFontWrap> {
|
||||||
@ -18,11 +18,15 @@ class DLL_EXPORT QFontWrap : public Napi::ObjectWrap<QFontWrap> {
|
|||||||
~QFontWrap();
|
~QFontWrap();
|
||||||
QFont* getInternalInstance();
|
QFont* getInternalInstance();
|
||||||
// Wrapped methods
|
// Wrapped methods
|
||||||
|
Napi::Value bold(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setBold(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setCapitalization(const Napi::CallbackInfo& info);
|
Napi::Value setCapitalization(const Napi::CallbackInfo& info);
|
||||||
Napi::Value capitalization(const Napi::CallbackInfo& info);
|
Napi::Value capitalization(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setFamily(const Napi::CallbackInfo& info);
|
Napi::Value setFamily(const Napi::CallbackInfo& info);
|
||||||
Napi::Value family(const Napi::CallbackInfo& info);
|
Napi::Value family(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setPixelSize(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setPointSize(const Napi::CallbackInfo& info);
|
Napi::Value setPointSize(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value pixelSize(const Napi::CallbackInfo& info);
|
||||||
Napi::Value pointSize(const Napi::CallbackInfo& info);
|
Napi::Value pointSize(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setStretch(const Napi::CallbackInfo& info);
|
Napi::Value setStretch(const Napi::CallbackInfo& info);
|
||||||
Napi::Value stretch(const Napi::CallbackInfo& info);
|
Napi::Value stretch(const Napi::CallbackInfo& info);
|
||||||
@ -30,6 +34,7 @@ class DLL_EXPORT QFontWrap : public Napi::ObjectWrap<QFontWrap> {
|
|||||||
Napi::Value weight(const Napi::CallbackInfo& info);
|
Napi::Value weight(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setItalic(const Napi::CallbackInfo& info);
|
Napi::Value setItalic(const Napi::CallbackInfo& info);
|
||||||
Napi::Value italic(const Napi::CallbackInfo& info);
|
Napi::Value italic(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setStyleName(const Napi::CallbackInfo& info);
|
||||||
Napi::Value toString(const Napi::CallbackInfo& info);
|
Napi::Value toString(const Napi::CallbackInfo& info);
|
||||||
COMPONENT_WRAPPED_METHODS_DECLARATION
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
};
|
};
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <QFontDatabase>
|
#include <QFontDatabase>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QFontDatabaseWrap
|
class DLL_EXPORT QFontDatabaseWrap
|
||||||
@ -21,11 +21,15 @@ class DLL_EXPORT QFontDatabaseWrap
|
|||||||
QFontDatabase* getInternalInstance();
|
QFontDatabase* getInternalInstance();
|
||||||
// Wrapped methods
|
// Wrapped methods
|
||||||
Napi::Value bold(const Napi::CallbackInfo& info);
|
Napi::Value bold(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value families(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isFixedPitch(const Napi::CallbackInfo& info);
|
||||||
Napi::Value italic(const Napi::CallbackInfo& info);
|
Napi::Value italic(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value styles(const Napi::CallbackInfo& info);
|
||||||
Napi::Value weight(const Napi::CallbackInfo& info);
|
Napi::Value weight(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace StaticQFontDatabaseWrapMethods {
|
namespace StaticQFontDatabaseWrapMethods {
|
||||||
DLL_EXPORT Napi::Value addApplicationFont(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value addApplicationFont(const Napi::CallbackInfo& info);
|
||||||
|
DLL_EXPORT Napi::Value applicationFontFamilies(const Napi::CallbackInfo& info);
|
||||||
DLL_EXPORT Napi::Value removeApplicationFont(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value removeApplicationFont(const Napi::CallbackInfo& info);
|
||||||
} // namespace StaticQFontDatabaseWrapMethods
|
} // namespace StaticQFontDatabaseWrapMethods
|
||||||
|
|||||||
@ -0,0 +1,48 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QFontMetrics>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QFontMetricsWrap : public Napi::ObjectWrap<QFontMetricsWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unique_ptr<QFontMetrics> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QFontMetricsWrap(const Napi::CallbackInfo& info);
|
||||||
|
QFontMetrics* getInternalInstance();
|
||||||
|
// Wrapped methods
|
||||||
|
Napi::Value ascent(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value averageCharWidth(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value capHeight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value descent(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value fontDpi(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value height(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value horizontalAdvance(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value inFont(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value leading(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value leftBearing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value lineSpacing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value lineWidth(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value overlinePos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value rightBearing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value size(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value strikeOutPos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value swap(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value underlinePos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value xHeight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value maxWidth(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value minLeftBearing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value minRightBearing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value inFontUcs4(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value boundingRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value tightBoundingRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value elidedText(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QFontMetricsF>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QFontMetricsFWrap
|
||||||
|
: public Napi::ObjectWrap<QFontMetricsFWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unique_ptr<QFontMetricsF> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QFontMetricsFWrap(const Napi::CallbackInfo& info);
|
||||||
|
QFontMetricsF* getInternalInstance();
|
||||||
|
// Wrapped methods
|
||||||
|
Napi::Value ascent(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value averageCharWidth(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value capHeight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value descent(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value fontDpi(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value height(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value horizontalAdvance(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value inFont(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value leading(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value leftBearing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value lineSpacing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value lineWidth(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value overlinePos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value rightBearing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value size(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value strikeOutPos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value swap(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value underlinePos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value xHeight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value maxWidth(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value minLeftBearing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value minRightBearing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value inFontUcs4(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value boundingRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value tightBoundingRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value elidedText(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QIconWrap : public Napi::ObjectWrap<QIconWrap> {
|
class DLL_EXPORT QIconWrap : public Napi::ObjectWrap<QIconWrap> {
|
||||||
@ -20,10 +20,18 @@ class DLL_EXPORT QIconWrap : public Napi::ObjectWrap<QIconWrap> {
|
|||||||
~QIconWrap();
|
~QIconWrap();
|
||||||
QIcon* getInternalInstance();
|
QIcon* getInternalInstance();
|
||||||
// Wrapped methods
|
// Wrapped methods
|
||||||
|
Napi::Value actualSize(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value addFile(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value addPixmap(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value availableSizes(const Napi::CallbackInfo& info);
|
||||||
Napi::Value pixmap(const Napi::CallbackInfo& info);
|
Napi::Value pixmap(const Napi::CallbackInfo& info);
|
||||||
Napi::Value isMask(const Napi::CallbackInfo& info);
|
Napi::Value isMask(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isNull(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value name(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value paint(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setIsMask(const Napi::CallbackInfo& info);
|
Napi::Value setIsMask(const Napi::CallbackInfo& info);
|
||||||
Napi::Value cacheKey(const Napi::CallbackInfo& info);
|
Napi::Value cacheKey(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value swap(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace StaticQIconWrapMethods {
|
namespace StaticQIconWrapMethods {
|
||||||
|
|||||||
78
src/cpp/include/nodegui/QtGui/QImage/qimage_wrap.h
Normal file
78
src/cpp/include/nodegui/QtGui/QImage/qimage_wrap.h
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QImage>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QImageWrap : public Napi::ObjectWrap<QImageWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unique_ptr<QImage> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QImageWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QImageWrap();
|
||||||
|
QImage* getInternalInstance();
|
||||||
|
|
||||||
|
Napi::Value allGray(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value bitPlaneCount(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value bytesPerLine(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value cacheKey(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value color(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value colorCount(const Napi::CallbackInfo& info);
|
||||||
|
void convertTo(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value convertToFormat(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value copy(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value createAlphaMask(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value createHeuristicMask(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value depth(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value devicePixelRatio(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value dotsPerMeterX(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value dotsPerMeterY(const Napi::CallbackInfo& info);
|
||||||
|
void fill(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value format(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value hasAlphaChannel(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value height(const Napi::CallbackInfo& info);
|
||||||
|
void invertPixels(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isGrayscale(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isNull(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value load(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value loadFromData(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value mirrored(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value offset(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value pixelColor(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value pixelIndex(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value rect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value reinterpretAsFormat(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value save(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value scaled(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value scaledToHeight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value scaledToWidth(const Napi::CallbackInfo& info);
|
||||||
|
void setAlphaChannel(const Napi::CallbackInfo& info);
|
||||||
|
void setColor(const Napi::CallbackInfo& info);
|
||||||
|
void setColorCount(const Napi::CallbackInfo& info);
|
||||||
|
void setDevicePixelRatio(const Napi::CallbackInfo& info);
|
||||||
|
void setDotsPerMeterX(const Napi::CallbackInfo& info);
|
||||||
|
void setDotsPerMeterY(const Napi::CallbackInfo& info);
|
||||||
|
void setOffset(const Napi::CallbackInfo& info);
|
||||||
|
void setPixel(const Napi::CallbackInfo& info);
|
||||||
|
void setPixelColor(const Napi::CallbackInfo& info);
|
||||||
|
void setText(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value size(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value sizeInBytes(const Napi::CallbackInfo& info);
|
||||||
|
void swap(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value text(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value textKeys(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value valid(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value width(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace StaticQImageWrapMethods {
|
||||||
|
DLL_EXPORT Napi::Value fromQVariant(const Napi::CallbackInfo& info);
|
||||||
|
} // namespace StaticQImageWrapMethods
|
||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <QKeySequence>
|
#include <QKeySequence>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QKeySequenceWrap : public Napi::ObjectWrap<QKeySequenceWrap> {
|
class DLL_EXPORT QKeySequenceWrap : public Napi::ObjectWrap<QKeySequenceWrap> {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <QMovie>
|
#include <QMovie>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "QtCore/QObject/qobject_macro.h"
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
#include "QtCore/QRect/qrect_wrap.h"
|
#include "QtCore/QRect/qrect_wrap.h"
|
||||||
#include "QtCore/QSize/qsize_wrap.h"
|
#include "QtCore/QSize/qsize_wrap.h"
|
||||||
@ -14,7 +14,7 @@ class DLL_EXPORT NMovie : public QMovie, public EventWidget {
|
|||||||
public:
|
public:
|
||||||
using QMovie::QMovie;
|
using QMovie::QMovie;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
QOBJECT_SIGNALS
|
QOBJECT_SIGNALS
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
QObject::connect(this, &QMovie::error,
|
QObject::connect(this, &QMovie::error,
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
|
||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "QtCore/QObject/qobject_macro.h"
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
#include "nmovie.hpp"
|
#include "nmovie.hpp"
|
||||||
|
|
||||||
|
|||||||
24
src/cpp/include/nodegui/QtGui/QPalette/qpalette_wrap.h
Normal file
24
src/cpp/include/nodegui/QtGui/QPalette/qpalette_wrap.h
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QPalette>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QPaletteWrap : public Napi::ObjectWrap<QPaletteWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
private:
|
||||||
|
std::unique_ptr<QPalette> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QPaletteWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QPaletteWrap();
|
||||||
|
QPalette* getInternalInstance();
|
||||||
|
|
||||||
|
// Wrapped methods
|
||||||
|
Napi::Value color(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
28
src/cpp/include/nodegui/QtGui/QPen/qpen_wrap.h
Normal file
28
src/cpp/include/nodegui/QtGui/QPen/qpen_wrap.h
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QPen>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QPenWrap : public Napi::ObjectWrap<QPenWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
private:
|
||||||
|
std::unique_ptr<QPen> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QPenWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QPenWrap();
|
||||||
|
QPen* getInternalInstance();
|
||||||
|
// Wrapped methods
|
||||||
|
Napi::Value setColor(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value color(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setStyle(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value style(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setCapStyle(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setWidth(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user