Compare commits
626 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81e5690b2c | ||
|
|
222afe9e9b | ||
|
|
b38ceb52eb | ||
|
|
ced4f2a61f | ||
|
|
5e8d053adf | ||
|
|
9fa5216263 | ||
|
|
27154b632c | ||
|
|
9003f4a9e3 | ||
|
|
1e91569763 | ||
|
|
df3cf24db4 | ||
|
|
b6db434c21 | ||
|
|
19f769f1d7 | ||
|
|
dacca6eeb8 | ||
|
|
eaacde6722 | ||
|
|
762c0a3274 | ||
|
|
f6fe3dcc8c | ||
|
|
011f105038 | ||
|
|
aaf4ee95f1 | ||
|
|
7740085a08 | ||
|
|
0aefab358b | ||
|
|
b639ddc3bc | ||
|
|
c03ffd7c3c | ||
|
|
32b2381168 | ||
|
|
60be7c1cee | ||
|
|
3dbaa25911 | ||
|
|
a637f415d7 | ||
|
|
680d537607 | ||
|
|
c9b97feea8 | ||
|
|
bb2d633e33 | ||
|
|
873551bb5e | ||
|
|
31622a811d | ||
|
|
bc25998c5b | ||
|
|
febe314b3b | ||
|
|
9ca4ffd64d | ||
|
|
8e93df38a1 | ||
|
|
d6ca15a749 | ||
|
|
49124b4ef0 | ||
|
|
486053012d | ||
|
|
47ad247988 | ||
|
|
c083d19b52 | ||
|
|
f170e1d2ec | ||
|
|
138fcfec79 | ||
|
|
595bb0b062 | ||
|
|
c20d5d81f2 | ||
|
|
0f0c2790fb | ||
|
|
81b13bf3b6 | ||
|
|
18444e5ce3 | ||
|
|
52ba06a228 | ||
|
|
6e862b0f83 | ||
|
|
923f989b39 | ||
|
|
b66600d0c8 | ||
|
|
a2e9f03eda | ||
|
|
57df8f4175 | ||
|
|
4cff14f823 | ||
|
|
1a04b54f2b | ||
|
|
6ae11b7a46 | ||
|
|
0d52a60200 | ||
|
|
c988b68605 | ||
|
|
4249b9edc5 | ||
|
|
7d3a6c8de4 | ||
|
|
2aba361ebd | ||
|
|
636ea46a44 | ||
|
|
c094773b89 | ||
|
|
0e2c83813f | ||
|
|
0bd48925dc | ||
|
|
ccc847e975 | ||
|
|
4b14785e40 | ||
|
|
cabbaf093c | ||
|
|
a82e6b89e8 | ||
|
|
d31304a1cc | ||
|
|
955ad6fe96 | ||
|
|
6de31e9ffc | ||
|
|
295d3b42bd | ||
|
|
e457c33dc2 | ||
|
|
045163cc1d | ||
|
|
9bb7ff30ec | ||
|
|
b9e415fef0 | ||
|
|
f0fd2b757f | ||
|
|
68def59570 | ||
|
|
97f1493202 | ||
|
|
c8ca027fc6 | ||
|
|
20975a2290 | ||
|
|
684442d2f3 | ||
|
|
7dc3262855 | ||
|
|
6ecf888dbb | ||
|
|
0110a1888d | ||
|
|
843e5f4236 | ||
|
|
74564b7c7e | ||
|
|
e12eedc0e3 | ||
|
|
b391c64434 | ||
|
|
a4eab49e94 | ||
|
|
509a56fde9 | ||
|
|
8cd07b6ff5 | ||
|
|
ae2fbdb9ef | ||
|
|
8aaff10bd5 | ||
|
|
e3ad7918e2 | ||
|
|
ffe9ae5311 | ||
|
|
e66f19e5ce | ||
|
|
95394e2b2f | ||
|
|
8ed224fd63 | ||
|
|
e0eb79043f | ||
|
|
998ad66c84 | ||
|
|
70a9e486c6 | ||
|
|
83c55c2a64 | ||
|
|
ac910f278a | ||
|
|
6ed420e043 | ||
|
|
0159438692 | ||
|
|
de44f74522 | ||
|
|
f948f2dcf8 | ||
|
|
ed5f91ab72 | ||
|
|
853dc6bd79 | ||
|
|
e5f58151ac | ||
|
|
7d9f30face | ||
|
|
26ab373b43 | ||
|
|
ce9ba8220f | ||
|
|
3dbee9b584 | ||
|
|
dcef7b8b92 | ||
|
|
56a48e0173 | ||
|
|
aba10b0170 | ||
|
|
d09b52bc61 | ||
|
|
f0c52b3511 | ||
|
|
ab66ee0270 | ||
|
|
6dd1884228 | ||
|
|
b7a02e130a | ||
|
|
20d56ee6e9 | ||
|
|
d33d816632 | ||
|
|
196bcb9b0e | ||
|
|
aca9512213 | ||
|
|
cee779a56d | ||
|
|
f532be9051 | ||
|
|
53fd7ec37b | ||
|
|
07b6d93de4 | ||
|
|
ffdabfd16d | ||
|
|
091174069d | ||
|
|
6d063ba3aa | ||
|
|
43ed3eb1f4 | ||
|
|
1661d5ede8 | ||
|
|
c4d978fa6f | ||
|
|
5236ad0f9b | ||
|
|
0ca874bc49 | ||
|
|
3d22dc5722 | ||
|
|
89555372e8 | ||
|
|
62d21734d9 | ||
|
|
7f15d06a2e | ||
|
|
cd69be12d1 | ||
|
|
5e2dee26cd | ||
|
|
1b83855c72 | ||
|
|
2ea03e3745 | ||
|
|
5a88573fdb | ||
|
|
243145d8c9 | ||
|
|
c8ff9f1d5c | ||
|
|
cb021a425a | ||
|
|
cb3ab5daa7 | ||
|
|
b0fecc6bb2 | ||
|
|
4e177e01ea | ||
|
|
2bf91dbbb5 | ||
|
|
aac672e88b | ||
|
|
93d7bd4cf5 | ||
|
|
67369eed22 | ||
|
|
57c2201386 | ||
|
|
9e72cb0000 | ||
|
|
0ea6bcd40c | ||
|
|
9b579f3fad | ||
|
|
417e32b4df | ||
|
|
0a7f6a6331 | ||
|
|
b04dea5971 | ||
|
|
e90ce9d4b7 | ||
|
|
5fc66822b9 | ||
|
|
e2d7fa4477 | ||
|
|
b565a69c76 | ||
|
|
861f07bb77 | ||
|
|
6d4de78756 | ||
|
|
a905be4f90 | ||
|
|
99bb4cb8f1 | ||
|
|
03d2d10f17 | ||
|
|
b80f1dbf14 | ||
|
|
b9aff01102 | ||
|
|
ba5ee315e9 | ||
|
|
568c2ee688 | ||
|
|
2aad9aaebd | ||
|
|
4f6fb723ef | ||
|
|
2c0ca03319 | ||
|
|
51f95f3286 | ||
|
|
bf08ff444e | ||
|
|
41b1a7ea15 | ||
|
|
4e5b262401 | ||
|
|
c52482efa2 | ||
|
|
5b09c3879d | ||
|
|
e43d6da389 | ||
|
|
73f4156aad | ||
|
|
bc2ca71bf5 | ||
|
|
b1a7dbadcd | ||
|
|
1b37ee8873 | ||
|
|
9c5fec9b79 | ||
|
|
65f7ff66d5 | ||
|
|
dded9b383a | ||
|
|
3c55dfb672 | ||
|
|
9797c555c0 | ||
|
|
87e26d4997 | ||
|
|
6c62a8eeb5 | ||
|
|
4853eacfa4 | ||
|
|
48a676f404 | ||
|
|
2f6eaa516c | ||
|
|
5e8581a345 | ||
|
|
d6d5903be1 | ||
|
|
313f7f30a7 | ||
|
|
89eca30da8 | ||
|
|
819f01c930 | ||
|
|
8cd738eaa1 | ||
|
|
d6dd6199f3 | ||
|
|
9d0335f38c | ||
|
|
82fdfb34c0 | ||
|
|
a2535fe6f1 | ||
|
|
fa49f35b14 | ||
|
|
bc369de6fa | ||
|
|
3d81bb40da | ||
|
|
5848aa59e5 | ||
|
|
68300a5dec | ||
|
|
07a95b5b33 | ||
|
|
d90cbe92de | ||
|
|
45599c2c2a | ||
|
|
85b3e8766f | ||
|
|
07c63b8ad3 | ||
|
|
8361d89a55 | ||
|
|
510bc7ca11 | ||
|
|
440c79e40c | ||
|
|
baa1f848b1 | ||
|
|
522e975a4e | ||
|
|
e511fe53c9 | ||
|
|
4903bdb908 | ||
|
|
6b99545e50 | ||
|
|
70438d158d | ||
|
|
52f52397cb | ||
|
|
94a25b86a8 | ||
|
|
3979024660 | ||
|
|
16567f5705 | ||
|
|
0b79b1690f | ||
|
|
4f0beee01b | ||
|
|
d018558134 | ||
|
|
6060d4d1f6 | ||
|
|
0c6a627b92 | ||
|
|
54883792e1 | ||
|
|
e2f96b9007 | ||
|
|
20fef93fea | ||
|
|
63dfe9e8e3 | ||
|
|
0ae70c027b | ||
|
|
3e404b1583 | ||
|
|
43771fa2f7 | ||
|
|
34635da14c | ||
|
|
b79d615ae8 | ||
|
|
af27c16793 | ||
|
|
945f5900d5 | ||
|
|
24340fa927 | ||
|
|
a7c4fc410a | ||
|
|
08fcf03c3f | ||
|
|
93138759a9 | ||
|
|
380df4578e | ||
|
|
71619aa8f6 | ||
|
|
a07583331e | ||
|
|
2afd887fdf | ||
|
|
1bc1d278eb | ||
|
|
fc5709d04c | ||
|
|
b3c9096830 | ||
|
|
74efc2e73e | ||
|
|
85c5e786a4 | ||
|
|
8a489b3a8e | ||
|
|
b19fb8620f | ||
|
|
2d986871c9 | ||
|
|
ef81e0fbc3 | ||
|
|
b00628e77d | ||
|
|
d110731409 | ||
|
|
92c75a6e8c | ||
|
|
2f40ca37df | ||
|
|
112c894e73 | ||
|
|
5035c0c780 | ||
|
|
f42afb1c52 | ||
|
|
4f9869fc7e | ||
|
|
f915b4cfb6 | ||
|
|
06ae6be9d4 | ||
|
|
b62ddf8f64 | ||
|
|
b05aaaeb6b | ||
|
|
47687fc252 | ||
|
|
a85ed5b949 | ||
|
|
929d9f7a57 | ||
|
|
20d034c279 | ||
|
|
23aec1e1ce | ||
|
|
0931bb6cae | ||
|
|
d487acd7cc | ||
|
|
380b59fddd | ||
|
|
6d92d084f7 | ||
|
|
16678b78bc | ||
|
|
8f14c31bc9 | ||
|
|
a2b4bbcd2a | ||
|
|
20f901f9e3 | ||
|
|
85c8014880 | ||
|
|
b5ddf8d19d | ||
|
|
b3cca917df | ||
|
|
6bae5c7af5 | ||
|
|
4dafa10017 | ||
|
|
622472387c | ||
|
|
6e9714c545 | ||
|
|
6e12abe015 | ||
|
|
8788317bb1 | ||
|
|
f9da89d77d | ||
|
|
def8e047af | ||
|
|
6b59b1f706 | ||
|
|
cc921dae17 | ||
|
|
ae0d498cf6 | ||
|
|
18ae2fe7fb | ||
|
|
c19a4ad568 | ||
|
|
54a8a4ba33 | ||
|
|
b3bfa3c58b | ||
|
|
9d7ba3fcb1 | ||
|
|
b44ddb5b64 | ||
|
|
1a66a485f9 | ||
|
|
d6c87cb753 | ||
|
|
bd59dafa42 | ||
|
|
51a522c8d3 | ||
|
|
120d579c88 | ||
|
|
200d3aa26d | ||
|
|
e6a4860d96 | ||
|
|
c03160abc2 | ||
|
|
232d6a5530 | ||
|
|
757df9eb89 | ||
|
|
63ea07c0ab | ||
|
|
aec831d277 | ||
|
|
d3cafedb65 | ||
|
|
16a4023abf | ||
|
|
9c78f86880 | ||
|
|
6fb4235c66 | ||
|
|
8627389837 | ||
|
|
64c68ec25b | ||
|
|
5e1b08131b | ||
|
|
62a21e912c | ||
|
|
df49f8656d | ||
|
|
eb2ad01a89 | ||
|
|
3d4284b02c | ||
|
|
0dd1dc41be | ||
|
|
4ca5d4e86d | ||
|
|
6f41624b14 | ||
|
|
55d78e1f92 | ||
|
|
dcaa2e037f | ||
|
|
cf8e40fcbe | ||
|
|
8d9c0bd9b2 | ||
|
|
e32b3bf13b | ||
|
|
8c0ab944af | ||
|
|
77b4bd597b | ||
|
|
79433deeb8 | ||
|
|
8a54450984 | ||
|
|
ddb4ae8685 | ||
|
|
5a946fc3f4 | ||
|
|
489f426b27 | ||
|
|
8cddd4bdab | ||
|
|
b1b233d249 | ||
|
|
c4f8959e65 | ||
|
|
5347779e50 | ||
|
|
68629c725a | ||
|
|
a81a8b8d3e | ||
|
|
20363b09e6 | ||
|
|
4d620d3771 | ||
|
|
6d120b1f7f | ||
|
|
5d0c00a201 | ||
|
|
9a029a1784 | ||
|
|
cb5ad1e9d3 | ||
|
|
4d614e60ef | ||
|
|
6fcfe72df6 | ||
|
|
e1f222d04f | ||
|
|
de7cb0fa71 | ||
|
|
56c4cab228 | ||
|
|
0429c501b7 | ||
|
|
5d91c24723 | ||
|
|
8ec2030cab | ||
|
|
6e48cde2f1 | ||
|
|
73c0bf6439 | ||
|
|
9ec4b61417 | ||
|
|
28c9cf0aa5 | ||
|
|
6c426aa855 | ||
|
|
2b47542bbd | ||
|
|
c804fadf40 | ||
|
|
d9c75f61c5 | ||
|
|
1ee9c13a1d | ||
|
|
0b5f414ca8 | ||
|
|
0266244c58 | ||
|
|
beda277316 | ||
|
|
f1a198bd93 | ||
|
|
63c4b43a57 | ||
|
|
1d50bc962d | ||
|
|
ec616da1ac | ||
|
|
fff3a00de2 | ||
|
|
6f312e34e3 | ||
|
|
faf50714a1 | ||
|
|
3c9468a621 | ||
|
|
e41bc28817 | ||
|
|
8b6bb63795 | ||
|
|
0de2cc9a8e | ||
|
|
3d8a19a0ca | ||
|
|
bc626dc9d0 | ||
|
|
38a9426135 | ||
|
|
6b24c949f1 | ||
|
|
44709caf6f | ||
|
|
e557b0fbac | ||
|
|
b124f4d7e0 | ||
|
|
3dabec4cae | ||
|
|
4092c71a45 | ||
|
|
78ecdd1f1d | ||
|
|
4c2c1dd8bd | ||
|
|
e33e1df4af | ||
|
|
4c7a2ae0b7 | ||
|
|
96478a0c3e | ||
|
|
61437e793a | ||
|
|
86ddaf90a7 | ||
|
|
8394d92fac | ||
|
|
fc2206105b | ||
|
|
b049b7e1f6 | ||
|
|
cf1ca20750 | ||
|
|
34e0fefeb3 | ||
|
|
a12d54855f | ||
|
|
6d1a72b522 | ||
|
|
f37cbafad6 | ||
|
|
79d72f9286 | ||
|
|
e7bb0382c4 | ||
|
|
0b1590d9ac | ||
|
|
d14e642fc7 | ||
|
|
535c3d506f | ||
|
|
8bed30db34 | ||
|
|
f6df9b490e | ||
|
|
5770a09e73 | ||
|
|
c2c130889d | ||
|
|
ed90f36984 | ||
|
|
540856a8bc | ||
|
|
8c824b265e | ||
|
|
f1690be7fc | ||
|
|
5a0006cd3c | ||
|
|
25bd804724 | ||
|
|
07746a78d5 | ||
|
|
a24e3f619f | ||
|
|
5be1fcadca | ||
|
|
03c526514d | ||
|
|
8ff5e23378 | ||
|
|
ef0c8690e4 | ||
|
|
ce11b4c71c | ||
|
|
0d62025e2c | ||
|
|
f0fc45eb52 | ||
|
|
115314b140 | ||
|
|
ffd9b872d9 | ||
|
|
22fbde4501 | ||
|
|
71669c252c | ||
|
|
672537dcc2 | ||
|
|
a45ff2c574 | ||
|
|
6b06ac4b72 | ||
|
|
2f7369e771 | ||
|
|
b2d201dba7 | ||
|
|
695d8e5462 | ||
|
|
2b49a7eb28 | ||
|
|
0b3759201f | ||
|
|
23f5a11340 | ||
|
|
a590f91fd0 | ||
|
|
686a3b5271 | ||
|
|
27eb84667f | ||
|
|
1508320aa8 | ||
|
|
ea16ce5dd0 | ||
|
|
eb056315c3 | ||
|
|
64a4fff635 | ||
|
|
ddf33b2fd9 | ||
|
|
e9476f4767 | ||
|
|
04e2b94c06 | ||
|
|
f2bd86ed7c | ||
|
|
39f4c15876 | ||
|
|
783dc6be9a | ||
|
|
39f1b363fd | ||
|
|
18db4d83bc | ||
|
|
458046b9b0 | ||
|
|
23ba19d068 | ||
|
|
0576300981 | ||
|
|
4d87007c95 | ||
|
|
2415f99a20 | ||
|
|
77fd862b3f | ||
|
|
1c930dc8fb | ||
|
|
259907b788 | ||
|
|
83c9145072 | ||
|
|
02afe7f82c | ||
|
|
94a6dc08d8 | ||
|
|
5ef1df9357 | ||
|
|
a81574543b | ||
|
|
cbd3393d7c | ||
|
|
7def9a9bb2 | ||
|
|
1067d04c03 | ||
|
|
b09d5a846c | ||
|
|
33dbc82a0c | ||
|
|
2820cf897f | ||
|
|
18a4869e62 | ||
|
|
adce9d72fc | ||
|
|
d90f5d0144 | ||
|
|
9461e48998 | ||
|
|
565643e883 | ||
|
|
132e6d11b4 | ||
|
|
7756d70705 | ||
|
|
dbbf4a406f | ||
|
|
be4f7a76d4 | ||
|
|
537456cea5 | ||
|
|
d547d8afe1 | ||
|
|
fb6e3518ea | ||
|
|
2614d1342e | ||
|
|
0287b759ac | ||
|
|
3c6741b11c | ||
|
|
9b953abbd2 | ||
|
|
ac52762c20 | ||
|
|
9093395478 | ||
|
|
dc0f9253d4 | ||
|
|
c5bacff2fa | ||
|
|
b60714a710 | ||
|
|
5a6da9a2ef | ||
|
|
38e4e5d385 | ||
|
|
d99ea10213 | ||
|
|
59791a8e2f | ||
|
|
f4cdea6a0d | ||
|
|
5566935a5d | ||
|
|
f874b61bd3 | ||
|
|
b947465da1 | ||
|
|
efb0ca04a0 | ||
|
|
d44b8d47d3 | ||
|
|
eb79d9263c | ||
|
|
96e0de063a | ||
|
|
3994a5425d | ||
|
|
81ec2d1b10 | ||
|
|
de1d6b2581 | ||
|
|
e4a1a800d1 | ||
|
|
55d05c2eb3 | ||
|
|
160d92ba69 | ||
|
|
e236cf7f73 | ||
|
|
17fd875f4b | ||
|
|
38cf5c0b3e | ||
|
|
3d0c5f7207 | ||
|
|
e2183750f2 | ||
|
|
c55b165150 | ||
|
|
50b5e3c477 | ||
|
|
1b3e1c4331 | ||
|
|
3f36139469 | ||
|
|
125e6e95f6 | ||
|
|
1f8450b453 | ||
|
|
1c96215db9 | ||
|
|
c683a3612d | ||
|
|
42cdab2e98 | ||
|
|
50594851f6 | ||
|
|
6f8f293241 | ||
|
|
a2685363e8 | ||
|
|
893c53476c | ||
|
|
a8e3fc594e | ||
|
|
3247a10f2c | ||
|
|
8b7ffccd64 | ||
|
|
b87ca71824 | ||
|
|
c94f9358d1 | ||
|
|
49052a7f06 | ||
|
|
966ff9d186 | ||
|
|
81884401d2 | ||
|
|
715b40fb3f | ||
|
|
b87d16fc6e | ||
|
|
75ca0e6e2e | ||
|
|
b1c43d329d | ||
|
|
4073e43e34 | ||
|
|
710ec7d417 | ||
|
|
c73004caef | ||
|
|
176eb9fd46 | ||
|
|
dc500aa19e | ||
|
|
a6150ea78f | ||
|
|
366c3abdff | ||
|
|
35c7197d1c | ||
|
|
2074146b30 | ||
|
|
15e692d596 | ||
|
|
1ab87eda09 | ||
|
|
804c3c7994 | ||
|
|
1b638565b0 | ||
|
|
61fa7eed6b | ||
|
|
0596088544 | ||
|
|
1cc17f7888 | ||
|
|
85bd12a794 | ||
|
|
4613811c45 | ||
|
|
9ce57485ab | ||
|
|
03c3838605 | ||
|
|
1d875eaa22 | ||
|
|
b4a8a21d26 | ||
|
|
6bfba0e02a | ||
|
|
fb6e7deadf | ||
|
|
bc80633a0d | ||
|
|
d941461052 | ||
|
|
0104d436e9 | ||
|
|
3d32290ee4 | ||
|
|
6932b6c1da | ||
|
|
6d7bd355ed | ||
|
|
beb3d40d24 | ||
|
|
1906a623fb | ||
|
|
ca9c36e081 | ||
|
|
b7baa01bc1 | ||
|
|
5ee4d14788 | ||
|
|
5d02b27b1f | ||
|
|
eb7f0d8eeb | ||
|
|
d4e40fce63 | ||
|
|
6e000c97f8 | ||
|
|
8df8700bed | ||
|
|
c17f2f7e84 | ||
|
|
c3953f478f | ||
|
|
cb5faa64ac | ||
|
|
832000ad34 | ||
|
|
6772ceb7e2 | ||
|
|
d9afdb5316 | ||
|
|
350269c3d4 | ||
|
|
7ca806ddff | ||
|
|
c8be0df768 | ||
|
|
36433c2144 | ||
|
|
2224ce95cb | ||
|
|
9a2d2b5392 | ||
|
|
3ea4418727 | ||
|
|
12b1f1f590 | ||
|
|
a1f47e9051 | ||
|
|
ff357db938 | ||
|
|
2f26d0a511 | ||
|
|
5f35e46be8 | ||
|
|
75a0a5e6d6 | ||
|
|
fef3a069d6 | ||
|
|
24c2921c21 | ||
|
|
001fabbb18 | ||
|
|
41d093ea76 | ||
|
|
8990544b42 | ||
|
|
148e6d12fd | ||
|
|
187f4be2ee | ||
|
|
6023bb4372 |
@@ -4,4 +4,3 @@ indent_size = 4
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
|
||||
14
.github/ISSUE_TEMPLATE/all-other-issues.md
vendored
14
.github/ISSUE_TEMPLATE/all-other-issues.md
vendored
@@ -1,14 +0,0 @@
|
||||
---
|
||||
name: All other issues
|
||||
about: Questions and enhancement requests should go to the forum.
|
||||
title: ''
|
||||
labels: not-template
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# All enhancement requests or questions should be directed to the Forum.
|
||||
|
||||
|
||||
We use GitHub issues for development related discussions.
|
||||
Please use the [forum](https://forum.littlevgl.com/) to ask questions.
|
||||
40
.github/ISSUE_TEMPLATE/bug-report.md
vendored
40
.github/ISSUE_TEMPLATE/bug-report.md
vendored
@@ -1,29 +1,43 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
about: Create a bug report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
> # Important: issues that don't use this template will be ignored/closed.
|
||||
<!--
|
||||
IMPORTANT
|
||||
Issues that don't use this template will be ignored and closed.
|
||||
-->
|
||||
|
||||
**Describe the bug**
|
||||
### Perform all steps below and tick them with [x]
|
||||
- [ ] Check the related part of the [Documentation](https://docs.lvgl.io/)
|
||||
- [ ] Update lvgl to the latest version
|
||||
- [ ] Reproduce the issue in a [Simulator](https://docs.lvgl.io/latest/en/html/get-started/pc-simulator.html)
|
||||
|
||||
### Describe the bug
|
||||
<!--
|
||||
A clear and concise description of what the bug is.
|
||||
-->
|
||||
|
||||
**To Reproduce**
|
||||
|
||||
Please provide a small, independent code sample that can be used to reproduce the issue. Ideally this should work in the PC simulator unless the problem is specific to one platform.
|
||||
|
||||
**Expected behavior**
|
||||
### To Reproduce
|
||||
<!--
|
||||
Provide a small, independent code sample that can be used to reproduce the issue.
|
||||
Ideally this should work in the PC simulator unless the problem is specific to a platform.
|
||||
Format the code like this:
|
||||
```c
|
||||
your code here
|
||||
```
|
||||
-->
|
||||
|
||||
### Expected behavior
|
||||
<!--
|
||||
A clear and concise description of what you expected to happen.
|
||||
-->
|
||||
|
||||
**Screenshots**
|
||||
### Screenshots or video
|
||||
<!--
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Additional context**
|
||||
|
||||
Add any other context about the problem here.
|
||||
-->
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -5,7 +5,7 @@ contact_links:
|
||||
about: Be sure to read to documentation first
|
||||
- name: Forum
|
||||
url: https://forum.lvgl.io
|
||||
about: For how-to questions use the forum
|
||||
about: For topics like How-to, Getting started, Feature request
|
||||
- name: CONTIBUTING.md
|
||||
url: https://github.com/lvgl/lvgl/blob/master/docs/CONTRIBUTING.md#faq-about-contributing
|
||||
about: The basic rules of contributing
|
||||
|
||||
29
.github/ISSUE_TEMPLATE/dev-discussion.md
vendored
Normal file
29
.github/ISSUE_TEMPLATE/dev-discussion.md
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
name: Development discussion
|
||||
about: Discussion strictly related to the development of the LVGL.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
<!--
|
||||
IMPORTANT
|
||||
Issues that don't use this template will be ignored and closed.
|
||||
|
||||
Normal Feature requests should go to the Forum: https://forum.lvgl.io/c/feature-request/9
|
||||
-->
|
||||
|
||||
### Introduce the problem
|
||||
<!--
|
||||
A clear and concise description of the problem.
|
||||
-->
|
||||
|
||||
### Examples and cases
|
||||
<!--
|
||||
Mention some examples and cases where the problem or the missing feature is relevant
|
||||
-->
|
||||
|
||||
### Suggested solution
|
||||
<!--
|
||||
If you already have an idea about the solution share it here
|
||||
-->
|
||||
12
.github/auto-comment.yml
vendored
12
.github/auto-comment.yml
vendored
@@ -1,12 +1,12 @@
|
||||
# Comment to a new issue.
|
||||
pullRequestOpened: |
|
||||
Thank you for raising your pull request.
|
||||
|
||||
To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin).
|
||||
|
||||
|
||||
To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin).
|
||||
|
||||
The text of DCO can be read here: https://developercertificate.org/
|
||||
For a more detailed description see the [Documentation](https://docs.lvgl.io/latest/en/html/contributing/index.html#developer-certification-of-origin-dco) site.
|
||||
|
||||
|
||||
By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO.
|
||||
|
||||
No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comment.
|
||||
|
||||
No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comment.
|
||||
|
||||
8
.github/pull_request_template.md
vendored
Normal file
8
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
### Description of the feature or fix
|
||||
|
||||
A clear and concise description of what the bug or new feature is.
|
||||
|
||||
### Checkpoints
|
||||
- [ ] Follow the [styling guide](https://github.com/lvgl/lvgl/blob/master/docs/CODING_STYLE.md)
|
||||
- [ ] Update CHANGELOG.md
|
||||
- [ ] Update the documentation
|
||||
2
.github/stale.yml
vendored
2
.github/stale.yml
vendored
@@ -7,7 +7,7 @@ exemptLabels:
|
||||
- architecture
|
||||
- pinned
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
staleLabel: stale
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue or pull request has been automatically marked as stale because it has not had
|
||||
|
||||
41
.github/workflows/build_micropython.yml
vendored
Normal file
41
.github/workflows/build_micropython.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: Build Micropython with LVGL submodule
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, dev ]
|
||||
pull_request:
|
||||
branches: [ master, dev ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Install SDL
|
||||
run: |
|
||||
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
|
||||
sudo apt-get update -y -qq
|
||||
sudo apt-get install libsdl2-dev
|
||||
- name: Clone lv_micropython
|
||||
run: git clone https://github.com/lvgl/lv_micropython.git .
|
||||
- name: Update submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: Checkout LVGL submodule
|
||||
working-directory: ./lib/lv_bindings/lvgl
|
||||
run: |
|
||||
git fetch --force ${{ github.event.repository.git_url }} "+refs/heads/*:refs/remotes/origin/*"
|
||||
git fetch --force ${{ github.event.repository.git_url }} "+refs/pull/*:refs/remotes/origin/pr/*"
|
||||
git checkout ${{ github.sha }} || git checkout ${{ github.event.pull_request.head.sha }}
|
||||
git submodule update --init --recursive
|
||||
- name: Build mpy-cross
|
||||
run: make -j $(nproc) -C mpy-cross
|
||||
- name: Build the unix port
|
||||
run: make -j $(nproc) -C ports/unix
|
||||
- name: Run advanced_demo
|
||||
run: >
|
||||
echo "import gc,utime;
|
||||
utime.sleep(5);
|
||||
gc.collect();
|
||||
utime.sleep(5)" |
|
||||
ports/unix/micropython -i lib/lv_bindings/examples/advanced_demo.py
|
||||
16
.github/workflows/main.yml
vendored
Normal file
16
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
on:
|
||||
issues:
|
||||
types: [opened, edited]
|
||||
|
||||
jobs:
|
||||
auto_close_issues:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
- name: Automatically close issues that don't follow the issue template
|
||||
uses: lucasbento/auto-close-issues@v1.0.2
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-close-message: "@${issue.user.login}: hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template." # optional property
|
||||
closed-issues-label: "not-template"
|
||||
27
.github/workflows/release.yml
vendored
Normal file
27
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
on:
|
||||
push:
|
||||
# Sequence of patterns matched against refs/tags
|
||||
tags:
|
||||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
||||
|
||||
name: Create Release
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
body: |
|
||||
See the [CHANGELOG](https://github.com/lvgl/lvgl/blob/master/CHANGELOG.md)
|
||||
draft: false
|
||||
prerelease: false
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
scripts/release/__pycache__
|
||||
**/*.o
|
||||
**/*bin
|
||||
**/*.swp
|
||||
|
||||
184
CHANGELOG.md
184
CHANGELOG.md
@@ -1,5 +1,146 @@
|
||||
# Changelog
|
||||
|
||||
## v7.10.0 (Planned for 02.02.2021)
|
||||
|
||||
### New features
|
||||
- feat(indev) allow input events to be passed to disabled objects
|
||||
- feat(spinbox) add inline get_step function for MicroPython support
|
||||
|
||||
### Bugfixes
|
||||
- fix(btnmatrix) fix lv_btnmatrix_get_active_btn_text() when used in a group
|
||||
|
||||
## v7.9.1
|
||||
|
||||
### Bugfixes
|
||||
- fix(cpicker) fix division by zero
|
||||
- fix(dropdown) fix selecting options after the last one
|
||||
- fix(msgbox) use the animation time provided
|
||||
- fix(gpu_nxp_pxp) fix incorrect define name
|
||||
- fix(indev) don't leave edit mode if there is only one object in the group
|
||||
- fix(draw_rect) fix draw pattern stack-use-after-scope error
|
||||
|
||||
|
||||
## v7.9.0
|
||||
|
||||
### New features
|
||||
- feat(chart) add lv_chart_remove_series and lv_chart_hide_series
|
||||
- feat(img_cahce) allow disabling image caching
|
||||
- calendar: make get_day_of_week() public
|
||||
- Added support for Zephyr integration
|
||||
|
||||
### Bugfixes
|
||||
- fix(draw_rect) free buffer used for arabic processing
|
||||
- fix(win) arabic process the title of the window
|
||||
- fix(dropdown) arabic process the option in lv_dropdown_add_option
|
||||
- fix(textarea) buffer overflow in password mode with UTF-8 characters
|
||||
- fix(textarea) cursor position after hiding character in password mode
|
||||
- fix(linemeter) draw critical lines with correct color
|
||||
- fix(kconfig) handle disable sprintf float correctly.
|
||||
- fix(layout) stop layout after recursion threshold is reached
|
||||
- fix(gauge) fix redraw with image needle
|
||||
|
||||
## v7.8.1
|
||||
|
||||
### Bugfixes
|
||||
- fix(lv_scr_load_anim) fix when multiple screen are loaded at tsame time with delay
|
||||
- fix(page) fix LV_SCOLLBAR_MODE_DRAG
|
||||
|
||||
## v7.8.0 (01.12.2020)
|
||||
|
||||
### New features
|
||||
- make DMA2D non blocking
|
||||
- add unscii-16 built-in font
|
||||
- add KConfig
|
||||
- add lv_refr_get_fps_avg()
|
||||
|
||||
### Bugfixes
|
||||
- fix(btnmatrix) handle arabic texts in button matrices
|
||||
- fix(indev) disabled object shouldn't absorb clicks but let the parent to be clicked
|
||||
- fix(arabic) support processing again already processed texts with _lv_txt_ap_proc
|
||||
- fix(textarea) support Arabic letter connections
|
||||
- fix(dropdown) support Arabic letter connections
|
||||
- fix(value_str) support Arabic letter connections in value string property
|
||||
- fix(indev) in LV_INDEV_TYPE_BUTTON recognize 1 cycle long presses too
|
||||
- fix(arc) make arc work with encoder
|
||||
- fix(slider) adjusting the left knob too with encoder
|
||||
- fix reference to LV_DRAW_BUF_MAX_NUM in lv_mem.c
|
||||
- fix(polygon draw) join adjacent points if they are on the same coordinate
|
||||
- fix(linemeter) fix invalidation when setting new value
|
||||
- fix(table) add missing invalidation when changing cell type
|
||||
- refactor(roller) rename LV_ROLLER_MODE_INIFINITE -> LV_ROLLER_MODE_INFINITE
|
||||
|
||||
## v7.7.2 (17.11.2020)
|
||||
### Bugfixes
|
||||
- fix(draw_triangle): fix polygon/triangle drawing when the order of points is counter-clockwise
|
||||
- fix(btnmatrix): fix setting the same map with modified pointers
|
||||
- fix(arc) fix and improve arc dragging
|
||||
- label: Repair calculate back `dot` character logical error which cause infinite loop.
|
||||
- fix(theme_material): remove the bottom border from tabview header
|
||||
- fix(imgbtn) guess a the closest available state with valid src
|
||||
- fix(spinbox) update cursor position in lv_spinbox_set_step
|
||||
|
||||
## v7.7.1 (03.11.2020)
|
||||
### Bugfixes
|
||||
- Respect btnmatrix's `one_check` in `lv_btnmatrix_set_btn_ctrl`
|
||||
- Gauge: make the needle images to use the styles from `LV_GAUGE_PART_PART`
|
||||
- Group: fix in `lv_group_remove_obj` to handle deleting hidden obejcts correctly
|
||||
|
||||
## v7.7.0 (20.10.2020)
|
||||
|
||||
### New features
|
||||
- Add PXP GPU support (for NXP MCUs)
|
||||
- Add VG-Lite GPU support (for NXP MCUs)
|
||||
- Allow max. 16 cell types for table
|
||||
- Add `lv_table_set_text_fmt()`
|
||||
- Use margin on calendar header to set distances and padding to the size of the header
|
||||
- Add `text_sel_bg` style property
|
||||
|
||||
### Bugfixes
|
||||
- Theme update to support text selection background
|
||||
- Fix imgbtn state change
|
||||
- Support RTL in table (draw columns right to left)
|
||||
- Support RTL in pretty layout (draw columns right to left)
|
||||
- Skip objects in groups if they are in disabled state
|
||||
- Fix dropdown selection with RTL basedirection
|
||||
- Fix rectangle border drawing with large width
|
||||
- Fix `lv_win_clean()`
|
||||
|
||||
## v7.6.1 (06.10.2020)
|
||||
|
||||
### Bugfixes
|
||||
- Fix BIDI support in dropdown list
|
||||
- Fix copying base dir in `lv_obj_create`
|
||||
- Handle sub pixel rendering in font loader
|
||||
- Fix transitions with style caching
|
||||
- Fix click focus
|
||||
- Fix imgbtn image switching with empty style
|
||||
- Material theme: do not set the text font to allow easy global font change
|
||||
|
||||
## v7.6.0 (22.09.2020)
|
||||
|
||||
### New features
|
||||
- Check whether any style property has changed on a state change to decide if any redraw is required
|
||||
|
||||
### Bugfixes
|
||||
- Fix selection of options with non-ASCII letters in dropdown list
|
||||
- Fix font loader to support LV_FONT_FMT_TXT_LARGE
|
||||
|
||||
## v7.5.0 (15.09.2020)
|
||||
|
||||
### New features
|
||||
- Add `clean_dcache_cb` and `lv_disp_clean_dcache` to enable users to use their own cache management function
|
||||
- Add `gpu_wait_cb` to wait until the GPU is working. It allows to run CPU a wait only when the rendered data is needed.
|
||||
- Add 10px and 8ox built in fonts
|
||||
|
||||
### Bugfixes
|
||||
- Fix unexpected DEFOCUS on lv_page when clicking to bg after the scrollable
|
||||
- Fix `lv_obj_del` and `lv_obj_clean` if the children list changed during deletion.
|
||||
- Adjust button matrix button width to include padding when spanning multiple units.
|
||||
- Add rounding to btnmatrix line height calculation
|
||||
- Add `decmopr_buf` to GC roots
|
||||
- Fix divisioin by zero in draw_pattern (lv_draw_rect.c) if the image or letter is not found
|
||||
- Fix drawing images with 1 px height or width
|
||||
|
||||
## v7.4.0 (01.09.2020)
|
||||
|
||||
The main new features of v7.4 are run-time font loading, style caching and arc knob with value setting by click.
|
||||
@@ -7,10 +148,10 @@ The main new features of v7.4 are run-time font loading, style caching and arc k
|
||||
### New features
|
||||
- Add `lv_font_load()` function - Loads a `lv_font_t` object from a binary font file
|
||||
- Add `lv_font_free()` function - Frees the memory allocated by the `lv_font_load()` function
|
||||
- Add style caching to reduce acces time of properties with default value
|
||||
- Add style caching to reduce access time of properties with default value
|
||||
- arc: add set value by click feature
|
||||
- arc: add `LV_ARC_PART_KNOB` similarly to slider
|
||||
- send gestures even is the the obejct was dragged. User can check dragging with `lv_indev_is_dragging(lv_indev_act())` in the event function.
|
||||
- send gestures event if the object was dragged. User can check dragging with `lv_indev_is_dragging(lv_indev_act())` in the event function.
|
||||
|
||||
### Bugfixes
|
||||
- Fix color bleeding on border drawing
|
||||
@@ -28,7 +169,7 @@ The main new features of v7.4 are run-time font loading, style caching and arc k
|
||||
- Rename `lv_chart_clear_serie` to `lv_chart_clear_series` and `lv_obj_align_origo` to `lv_obj_align_mid`
|
||||
- Add linemeter's mirror feature again
|
||||
- Fix text decor (udnerline strikethrough) with older versions of font converter
|
||||
- Fix setting local style property multiple times
|
||||
- Fix setting local style property multiple times
|
||||
- Add missing background drawing and radius handling to image button
|
||||
- Allow adding extra label to list buttons
|
||||
- Fix crash if `lv_table_set_col_cnt` is called before `lv_table_set_row_cnt` for the first time
|
||||
@@ -58,7 +199,6 @@ The main new features of v7.4 are run-time font loading, style caching and arc k
|
||||
- gauge: fix image needle drawing
|
||||
- fix using freed memory in _lv_style_list_remove_style
|
||||
|
||||
|
||||
## v7.2.0 (21.07.2020)
|
||||
|
||||
### New features
|
||||
@@ -81,7 +221,7 @@ The main new features of v7.4 are run-time font loading, style caching and arc k
|
||||
|
||||
### Bugfixes
|
||||
- `tileview` fix navigation when not screen sized
|
||||
- Use 14px font by default to for better compatibility with smaller displays
|
||||
- Use 14px font by default to for better compatibility with smaller displays
|
||||
- `linemeter` fix conversation of current value to "level"
|
||||
- Fix drawing on right border
|
||||
- Set the cursor image non clickable by default
|
||||
@@ -95,7 +235,7 @@ The main new features of v7.4 are run-time font loading, style caching and arc k
|
||||
- Add lv_btnmatrix_set/get_align capability
|
||||
- DMA2D: Remove dependency on ST CubeMX HAL
|
||||
- Added `max_used` propriety to `lv_mem_monitor_t` struct
|
||||
- In `lv_init` test if the the strings are UTF-8 encoded.
|
||||
- In `lv_init` test if the strings are UTF-8 encoded.
|
||||
- Add `user_data` to themes
|
||||
- Add LV_BIG_ENDIAN_SYSTEM flag to lv_conf.h in order to fix displaying images on big endian systems.
|
||||
- Add inline function lv_checkbox_get_state(const lv_obj_t * cb) to extend the checkbox functionality.
|
||||
@@ -138,7 +278,7 @@ The main new features of v7.4 are run-time font loading, style caching and arc k
|
||||
|
||||
### Bugfixes
|
||||
- Make the Microptyhon working by adding the required variables as GC_ROOT
|
||||
- Prefix some internal API functions with `_` to reduce the API of LVGL
|
||||
- Prefix some internal API functions with `_` to reduce the API of LVGL
|
||||
- Fix built-in SimSun CJK font
|
||||
- Fix UTF-8 encoding when `LV_USE_ARABIC_PERSIAN_CHARS` is enabled
|
||||
- Fix DMA2D usage when 32 bit images directly blended
|
||||
@@ -149,7 +289,7 @@ The main new features of v7.4 are run-time font loading, style caching and arc k
|
||||
- Remove memcpy from `lv_ll` (caused issues with some optimization settings)
|
||||
- `lv_chart` fix X tick drawing
|
||||
- Fix vertical dashed line drawing
|
||||
- Some additonal minor fixes and formattings
|
||||
- Some additional minor fixes and formattings
|
||||
|
||||
## v7.0.0 (18.05.2020)
|
||||
|
||||
@@ -162,30 +302,28 @@ The name of the project is changed to LVGL and the new website is on https://lvg
|
||||
|
||||
LVGL remains free under the same conditions (MIT license) and a company is created to manage LVGL and offer services.
|
||||
|
||||
|
||||
### New drawing system
|
||||
Complete rework of LVGL's draw engine to use "masks" for more advanced and higher quality graphical effects.
|
||||
Complete rework of LVGL's draw engine to use "masks" for more advanced and higher quality graphical effects.
|
||||
A possible use-case of this system is to remove the overflowing content from the rounded edges.
|
||||
It also allows drawing perfectly anti-aliased circles, lines, and arcs.
|
||||
Internally, the drawings happen by defining masks (such as rounded rectangle, line, angle).
|
||||
When something is drawn the currently active masks can make some pixels transparent.
|
||||
For example, rectangle borders are drawn by using 2 rectangle masks: one mask removes the inner part and another the outer part.
|
||||
Internally, the drawings happen by defining masks (such as rounded rectangle, line, angle).
|
||||
When something is drawn the currently active masks can make some pixels transparent.
|
||||
For example, rectangle borders are drawn by using 2 rectangle masks: one mask removes the inner part and another the outer part.
|
||||
|
||||
The API in this regard remained the same but some new functions were added:
|
||||
- `lv_img_set_zoom`: set image object's zoom factor
|
||||
- `lv_img_set_angle`: set image object's angle without using canvas
|
||||
- `lv_img_set_pivot`: set the pivot point of rotation
|
||||
|
||||
|
||||
The new drawing engine brought new drawing features too. They are highlighted in the "style" section.
|
||||
|
||||
### New style system
|
||||
The old style system is replaced with a new more flexible and lightweighted one.
|
||||
It uses an approach similar to CSS: support cascading styles, inheriting properties and local style properties per object.
|
||||
As part of these updates, a lot of objects were reworked and the APIs have been changed.
|
||||
The old style system is replaced with a new more flexible and lightweighted one.
|
||||
It uses an approach similar to CSS: support cascading styles, inheriting properties and local style properties per object.
|
||||
As part of these updates, a lot of objects were reworked and the APIs have been changed.
|
||||
|
||||
- more shadows options: *offset* and *spread*
|
||||
- gradient stop position to shift the gradient area and horizontal gradient
|
||||
- gradient stop position to shift the gradient area and horizontal gradient
|
||||
- `LV_BLEND_MODE_NORMAL/ADDITIVE/SUBTRACTIVE` blending modes
|
||||
- *clip corner*: crop the content on the rounded corners
|
||||
- *text underline* and *strikethrough*
|
||||
@@ -229,16 +367,16 @@ The following object types are renamed:
|
||||
- `linemeter`, `gauge`: can have background if the related style properties are set. Padding makes the scale/lines smaller. scale_border_width and scale_end_border_width allow to draw an arc on the outer part of the scale lines.
|
||||
- `gauge`: `lv_gauge_set_needle_img` allows use image as needle
|
||||
- `canvas`: allow drawing to true color alpha and alpha only canvas, add `lv_canvas_blur_hor/ver` and rename `lv_canvas_rotate` to `lv_canvas_transform`
|
||||
- `textarea`: If available in the font use bullet (`U+2022`) character in text area password
|
||||
- `textarea`: If available in the font use bullet (`U+2022`) character in text area password
|
||||
|
||||
### New object types
|
||||
- `lv_objmask`: masks can be added to it. The children will be masked accordingly.
|
||||
- `lv_objmask`: masks can be added to it. The children will be masked accordingly.
|
||||
|
||||
### Others
|
||||
- Change the built-in fonts to [Montserrat](https://fonts.google.com/specimen/Montserrat) and add built-in fonts from 12 px to 48 px for every 2nd size.
|
||||
- Add example CJK and Arabic/Persian/Hebrew built-in font
|
||||
- Add ° and "bullet" to the built-in fonts
|
||||
- Add Arabic/Persian script support: change the character according to its position in the text.
|
||||
- Add Arabic/Persian script support: change the character according to its position in the text.
|
||||
- Add `playback_time` to animations.
|
||||
- Add `repeat_count` to animations instead of the current "repeat forever".
|
||||
- Replace `LV_LAYOUT_PRETTY` with `LV_LAYOUT_PRETTY_TOP/MID/BOTTOM`
|
||||
@@ -252,7 +390,7 @@ The following object types are renamed:
|
||||
- Merge new features and fixes directly into `master` and release a patch or minor releases every 2 weeks.
|
||||
|
||||
### Migrating from v6 to v7
|
||||
- First and foremost, create a new `lv_conf.h` based on `lv_conf_templ.h`.
|
||||
- First and foremost, create a new `lv_conf.h` based on `lv_conf_template.h`.
|
||||
- To try the new version it suggested using a simulator project and see the examples.
|
||||
- If you have a running project, the most difficult part of the migration is updating to the new style system. Unfortunately, there is no better way than manually updating to the new format.
|
||||
- The other parts are mainly minor renames and refactoring as described above.
|
||||
- The other parts are mainly minor renames and refactoring as described above.
|
||||
|
||||
64
CMakeLists.txt
Normal file
64
CMakeLists.txt
Normal file
@@ -0,0 +1,64 @@
|
||||
if(ESP_PLATFORM)
|
||||
|
||||
file(GLOB_RECURSE SOURCES src/*.c)
|
||||
|
||||
idf_component_register(SRCS ${SOURCES}
|
||||
INCLUDE_DIRS . src
|
||||
REQUIRES main)
|
||||
|
||||
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_CONF_INCLUDE_SIMPLE")
|
||||
|
||||
if (CONFIG_LV_MEM_CUSTOM)
|
||||
if (CONFIG_LV_MEM_CUSTOM_ALLOC)
|
||||
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_MEM_CUSTOM_ALLOC=${CONFIG_LV_MEM_CUSTOM_ALLOC}")
|
||||
endif()
|
||||
|
||||
if (CONFIG_LV_MEM_CUSTOM_FREE)
|
||||
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_MEM_CUSTOM_FREE=${CONFIG_LV_MEM_CUSTOM_FREE}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (CONFIG_LV_TICK_CUSTOM)
|
||||
if (CONFIG_LV_TICK_CUSTOM_SYS_TIME_EXPR)
|
||||
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_TICK_CUSTOM_SYS_TIME_EXPR=${CONFIG_LV_TICK_CUSTOM_SYS_TIME_EXPR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (CONFIG_LV_USER_DATA_FREE)
|
||||
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_USER_DATA_FREE=${CONFIG_LV_USER_DATA_FREE}")
|
||||
endif()
|
||||
|
||||
if (CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM)
|
||||
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_ATTRIBUTE_FAST_MEM=IRAM_ATTR")
|
||||
endif()
|
||||
|
||||
elseif(ZEPHYR_BASE)
|
||||
|
||||
if(CONFIG_LVGL)
|
||||
|
||||
zephyr_include_directories(${ZEPHYR_BASE}/lib/gui/lvgl)
|
||||
|
||||
target_include_directories(lvgl INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
zephyr_compile_definitions(LV_CONF_KCONFIG_EXTERNAL_INCLUDE=<autoconf.h>)
|
||||
|
||||
zephyr_compile_definitions_ifdef(CONFIG_LV_MEM_CUSTOM
|
||||
LV_MEM_CUSTOM_ALLOC=${CONFIG_LV_MEM_CUSTOM_ALLOC}
|
||||
)
|
||||
zephyr_compile_definitions_ifdef(CONFIG_LV_MEM_CUSTOM
|
||||
LV_MEM_CUSTOM_FREE=${CONFIG_LV_MEM_CUSTOM_FREE}
|
||||
)
|
||||
zephyr_compile_definitions_ifdef(CONFIG_LV_TICK_CUSTOM
|
||||
LV_TICK_CUSTOM_SYS_TIME_EXPR=${CONFIG_LV_TICK_CUSTOM_SYS_TIME_EXPR}
|
||||
)
|
||||
|
||||
zephyr_library()
|
||||
|
||||
file(GLOB_RECURSE SOURCES src/*.c)
|
||||
zephyr_library_sources(${SOURCES})
|
||||
|
||||
endif() # CONFIG_LVGL
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown platform.")
|
||||
endif()
|
||||
27
README.md
27
README.md
@@ -5,13 +5,14 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
LVGL provides everything you need to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint.
|
||||
LVGL provides everything you need to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint.
|
||||
</p>
|
||||
|
||||
<h4 align="center">
|
||||
<a href="https://lvgl.io">Website </a> ·
|
||||
<a href="https://lvgl.io/demos">Online demo</a> ·
|
||||
<a href="https://docs.lvgl.io/">Docs</a> ·
|
||||
<a href="https://lvgl.io">Website </a> ·
|
||||
<a href="https://lvgl.io/demos">Online demo</a> ·
|
||||
<a href="https://lvgl.github.io/lv_examples/">Nightly demos</a> ·
|
||||
<a href="https://docs.lvgl.io/">Docs</a> ·
|
||||
<a href="https://forum.lvgl.io">Forum</a>
|
||||
</h4>
|
||||
|
||||
@@ -52,37 +53,37 @@ Basically, every modern controller (which is able to drive a display) is suitabl
|
||||
<td> > 16 MHz </td>
|
||||
<td> > 48 MHz</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td> <strong>Flash/ROM</strong></td>
|
||||
<td> > 64 kB </td>
|
||||
<td> > 180 kB</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td> <strong>Static RAM</strong></td>
|
||||
<td> > 2 kB </td>
|
||||
<td> > 4 kB</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td> <strong>Stack</strong></td>
|
||||
<td> > 2 kB </td>
|
||||
<td> > 8 kB</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td> <strong>Heap</strong></td>
|
||||
<td> > 2 kB </td>
|
||||
<td> > 8 kB</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td> <strong>Display buffer</strong></td>
|
||||
<td> > 1 × <em>hor. res.</em> pixels </td>
|
||||
<td> > 10 × <em>hor. res.</em> pixels </td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td> <strong>Compiler</strong></td>
|
||||
<td colspan="2"> C99 or newer </td>
|
||||
@@ -113,15 +114,15 @@ This list shows the recommended way of learning the library:
|
||||
7. Read the [Overview](https://docs.lvgl.io/latest/en/html/overview/index.html) page to get a better understanding of the library (2-3 hours)
|
||||
8. Check the documentation of the [Widgets](https://docs.lvgl.io/latest/en/html/widgets/index.html) to see their features and usage
|
||||
9. If you have questions go to the [Forum](http://forum.lvgl.io/)
|
||||
10. Read the [Contributing](https://docs.lvgl.io/latest/en/html/contributing/index.html) guide to see how you can help to improve LVGL (15 minutes)
|
||||
10. Read the [Contributing](https://docs.lvgl.io/latest/en/html/contributing/index.html) guide to see how you can help to improve LVGL (15 minutes)
|
||||
|
||||
## Examples
|
||||
## Examples
|
||||
|
||||
For more examples see the [lv_examples](https://github.com/lvgl/lv_examples) repository.
|
||||
|
||||
### Button with label
|
||||
```c
|
||||
lv_obj_t * btn = lv_btn_create(lv_scr_act(), NULL); /*Add a button the current screen*/
|
||||
lv_obj_t * btn = lv_btn_create(lv_scr_act(), NULL); /*Add a button to the current screen*/
|
||||
lv_obj_set_pos(btn, 10, 10); /*Set its position*/
|
||||
lv_obj_set_size(btn, 100, 50); /*Set its size*/
|
||||
lv_obj_set_event_cb(btn, btn_event_cb); /*Assign a callback to the button*/
|
||||
|
||||
29
a.patch
29
a.patch
@@ -1,29 +0,0 @@
|
||||
diff --git a/scripts/release.py b/scripts/release.py
|
||||
index 28370c66..bc5234e7 100755
|
||||
--- a/scripts/release.py
|
||||
+++ b/scripts/release.py
|
||||
@@ -395,12 +395,12 @@ def docs_update_dev_version():
|
||||
os.chdir("../")
|
||||
|
||||
|
||||
-def publish_dev():
|
||||
+def publish_dev_and_master():
|
||||
pub_cmd = "git checkout dev; git push origin dev"
|
||||
cmd("cd lvgl; " + pub_cmd)
|
||||
+ pub_cmd = "git checkout master; git push origin master"
|
||||
+ cmd("cd lvgl; " + pub_cmd)
|
||||
|
||||
- pub_cmd = "git checkout dev; git push origin dev"
|
||||
- cmd("cd docs; " + pub_cmd)
|
||||
cmd("cd docs; git checkout master; ./update.py latest dev")
|
||||
|
||||
def cleanup():
|
||||
@@ -463,7 +463,7 @@ if __name__ == '__main__':
|
||||
|
||||
lvgl_update_dev_version()
|
||||
docs_update_dev_version()
|
||||
- publish_dev()
|
||||
+ publish_dev_and_master()
|
||||
|
||||
cleanup()
|
||||
|
||||
@@ -11,19 +11,19 @@ Use [lv_misc/lv_templ.c](https://github.com/lvgl/lvgl/blob/master/src/lv_misc/lv
|
||||
* starts with *lv*
|
||||
* followed by module name: *btn*, *label*, *style* etc.
|
||||
* followed by the action (for functions): *set*, *get*, *refr* etc.
|
||||
* closed with the subject: *name*, *size*, *state* etc.
|
||||
* closed with the subject: *name*, *size*, *state* etc.
|
||||
* Typedefs
|
||||
* prefer `typedef struct` and `typedef enum` instead of `struct name` and `enum name`
|
||||
* always end `typedef struct` and `typedef enum` type names with `_t`
|
||||
* Abbreviations:
|
||||
* Only words longer or equal than 6 characters can be abbreviated.
|
||||
* Only words longer or equal than 6 characters can be abbreviated.
|
||||
* Abbreviate only if it makes the word at least half as long
|
||||
* Use only very straightforward and well-known abbreviations (e.g. pos: position, def: default, btn: button)
|
||||
* Use only very straightforward and well-known abbreviations (e.g. pos: position, def: default, btn: button)
|
||||
|
||||
## Coding guide
|
||||
* Functions:
|
||||
* Try to write function shorter than is 50 lines
|
||||
* Always shorter than 200 lines (except very straightforwards)
|
||||
* Try to write function shorter than is 50 lines
|
||||
* Always shorter than 200 lines (except very straightforwards)
|
||||
* Variables:
|
||||
* One line, one declaration (BAD: char x, y;)
|
||||
* Use `<stdint.h>` (*uint8_t*, *int32_t* etc)
|
||||
@@ -41,16 +41,16 @@ Before every function have a comment like this:
|
||||
* @param obj pointer to an object
|
||||
* @return pointer to a screen
|
||||
*/
|
||||
lv_obj_t * lv_obj_get_scr(lv_obj_t * obj);
|
||||
lv_obj_t * lv_obj_get_scr(lv_obj_t * obj);
|
||||
```
|
||||
|
||||
Always use `/* Something */` format and NOT `//Something`
|
||||
|
||||
Write readable code to avoid descriptive comments like:
|
||||
`x++; /* Add 1 to x */`.
|
||||
Write readable code to avoid descriptive comments like:
|
||||
`x++; /* Add 1 to x */`.
|
||||
The code should show clearly what you are doing.
|
||||
|
||||
You should write **why** have you done this:
|
||||
You should write **why** have you done this:
|
||||
`x++; /*Because of closing '\0' of the string */`
|
||||
|
||||
Short "code summaries" of a few lines are accepted. E.g. `/*Calculate the new coordinates*/`
|
||||
@@ -67,19 +67,19 @@ Here is example to show bracket placing and using of white spaces:
|
||||
*/
|
||||
void lv_label_set_text(lv_obj_t * label, const char * text)
|
||||
{ /* Main brackets of functions in new line*/
|
||||
|
||||
|
||||
if(label == NULL) return; /*No bracket only if the command is inline with the if statement*/
|
||||
|
||||
|
||||
lv_obj_inv(label);
|
||||
|
||||
|
||||
lv_label_ext_t * ext = lv_obj_get_ext(label);
|
||||
|
||||
/*Comment before a section */
|
||||
if(text == ext->txt || text == NULL) { /*Bracket of statements start inline*/
|
||||
lv_label_refr_text(label);
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Contributing to LVGL
|
||||
|
||||
Thank you for considering contributing to LVGL.
|
||||
Thank you for considering contributing to LVGL.
|
||||
|
||||
For a detailed description of contribution opportunities, please visit the [Contributing](https://docs.lvgl.io/latest/en/html/contributing/index.html) section of the documentation.
|
||||
|
||||
@@ -1,38 +1,63 @@
|
||||
# Roadmap
|
||||
|
||||
This is a summary for thenew fatures of the major releases and a collection of ideas.
|
||||
This is a summary for thenew fatures of the major releases and a collection of ideas.
|
||||
|
||||
This list indicates only the current intention and can be changed.
|
||||
|
||||
## v8
|
||||
Planned to September/October 2020
|
||||
Planned to November/December 2020
|
||||
- Create an `lv_components` repository for compley widgets
|
||||
- It makes the core LVGL leaner
|
||||
- In `lv_components` we can have a lot and specific widgets
|
||||
- Good place for contribution
|
||||
- New scrolling:
|
||||
- See [feat/new-scroll](https://github.com/lvgl/lvgl/tree/feat/new-scroll) branch and [#1614](https://github.com/lvgl/lvgl/issues/1614)) issue.
|
||||
- Remove `lv_page` and support scrolling on `lv_obj`
|
||||
- Support "elastic" scrolling when scrolled in
|
||||
- Support scroll chaining among any objects types (not only `lv_pages`s)
|
||||
- Remove `lv_drag`. Similar effect can be achieved by setting the position in `LV_EVENT_PRESSING`
|
||||
- Add snapping?
|
||||
- Add snapping
|
||||
- Add snap stop to scroll max 1 snap point
|
||||
- Already working
|
||||
- New layouts:
|
||||
- See [#1615](https://github.com/lvgl/lvgl/issues/1615) issue
|
||||
- [CSS Grid](https://css-tricks.com/snippets/css/a-guide-to-grid/)-like layout support
|
||||
- [CSS Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/)-like layout support
|
||||
- Besides setting width/height in `px` add support to `partent percentage` and `screen percentage`.
|
||||
- Work in progress
|
||||
- Remove `lv_cont` and support layouts on `lv_obj`
|
||||
- Simplified File system interface ([feat/new_fs_api](https://github.com/lvgl/lvgl/tree/feat/new-fs-api) branch) to make porting easier
|
||||
- Work in progress
|
||||
- Remove the align parameter from `lv_canvas_draw_text`
|
||||
- Make the copy parameter obsolate in create functions
|
||||
- Optimize and simplifie styles [#1832](https://github.com/lvgl/lvgl/issues/1832)
|
||||
- Use a more generic inheritenace [#1919](https://github.com/lvgl/lvgl/issues/1919)
|
||||
|
||||
## v8.x
|
||||
- Add radio button widget
|
||||
- Unit testing (gtest?). See [#1658](https://github.com/lvgl/lvgl/issues/1658)
|
||||
- Benchmarking (gem5?). See [#1660](https://github.com/lvgl/lvgl/issues/1660)
|
||||
- chart: pre-delete `X` pint after the lastly set
|
||||
- chart: autoscroll to the right
|
||||
|
||||
## v9
|
||||
- Simplify `group`s. Discussion is [here](https://forum.lvgl.io/t/lv-group-tabindex/2927/3).
|
||||
- Consider direct binary font format support
|
||||
- Optimize line and circle drawing and masking
|
||||
- Reconsider color format management for run time color format setting, and custom color format usage. (Also [RGB888](https://github.com/lvgl/lvgl/issues/1722))
|
||||
- 9-patch support for `lv_imgbtn`.
|
||||
- Handle stride. See [#1858](https://github.com/lvgl/lvgl/issues/1858)
|
||||
- Make gradients more versatile
|
||||
- Make image transformations more versatile
|
||||
- Allow snapshoting object to tranfrom them to images
|
||||
|
||||
## Ideas
|
||||
- Unit testing (gtest?). See [#1658](https://github.com/lvgl/lvgl/issues/1658)
|
||||
- Benchmarking (gem5?). See [#1660](https://github.com/lvgl/lvgl/issues/1660)
|
||||
- Use [generate-changelog](https://github.com/lob/generate-changelog) to automatically generate changelog
|
||||
- lv_mem_alloc_aligned(size, align)
|
||||
- Text node. See [#1701](https://github.com/lvgl/lvgl/issues/1701#issuecomment-699479408)
|
||||
- CPP binding. See [Forum](https://forum.lvgl.io/t/is-it-possible-to-officially-support-optional-cpp-api/2736)
|
||||
- Optmize font decompression
|
||||
- Optimize font decompression
|
||||
- Switch to RGBA colors in styles
|
||||
- Need coverage report for tests
|
||||
- Need static analize (via coverity.io or somehing else)
|
||||
- Need static analyze (via coverity.io or somehing else)
|
||||
- Support dot_begin and dot_middle long modes for labels
|
||||
- Add new label alignment modes. [#1656](https://github.com/lvgl/lvgl/issues/1656)
|
||||
- Support larger images: [#1892](https://github.com/lvgl/lvgl/issues/1892)
|
||||
|
||||
@@ -36,36 +36,20 @@ bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
|
||||
|
||||
bool touched = tft.getTouch(&touchX, &touchY, 600);
|
||||
|
||||
if(!touched)
|
||||
{
|
||||
if(!touched) {
|
||||
data->state = LV_INDEV_STATE_REL;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
data->state = LV_INDEV_STATE_PR;
|
||||
}
|
||||
|
||||
if(touchX>screenWidth || touchY > screenHeight)
|
||||
{
|
||||
Serial.println("Y or y outside of expected parameters..");
|
||||
Serial.print("y:");
|
||||
Serial.print(touchX);
|
||||
Serial.print(" x:");
|
||||
Serial.print(touchY);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
/*Set the coordinates*/
|
||||
data->point.x = touchX;
|
||||
data->point.y = touchY;
|
||||
|
||||
|
||||
Serial.print("Data x");
|
||||
Serial.println(touchX);
|
||||
|
||||
|
||||
Serial.print("Data y");
|
||||
Serial.println(touchY);
|
||||
|
||||
}
|
||||
|
||||
return false; /*Return `false` because we are not buffering and no more data to read*/
|
||||
@@ -86,7 +70,7 @@ void setup()
|
||||
|
||||
uint16_t calData[5] = { 275, 3620, 264, 3532, 1 };
|
||||
tft.setTouch(calData);
|
||||
|
||||
|
||||
lv_disp_buf_init(&disp_buf, buf, NULL, LV_HOR_RES_MAX * 10);
|
||||
|
||||
/*Initialize the display*/
|
||||
@@ -110,7 +94,6 @@ void setup()
|
||||
lv_ex_btn_1();
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
# Example for lv_arduino using a slider
|
||||
|
||||
This example has the screen set to 320x480 (ILI9488), change this by altering the following lines in the main ino file:
|
||||
|
||||
```C
|
||||
int screenWidth = 480;
|
||||
int screenHeight = 320;
|
||||
```
|
||||
|
||||
## Backlight
|
||||
|
||||
Change pin 32 to your preferred backlight pin using a PNP transistor (2N3906) or remove the following code and connect directly to +ve:
|
||||
|
||||
```C
|
||||
ledcSetup(10, 5000/*freq*/, 10 /*resolution*/);
|
||||
ledcAttachPin(32, 10);
|
||||
analogReadResolution(10);
|
||||
ledcWrite(10,768);
|
||||
```
|
||||
|
||||
## Theme selection
|
||||
|
||||
Change the following to change the theme:
|
||||
|
||||
```C
|
||||
lv_theme_t * th = lv_theme_night_init(210, NULL); //Set a HUE value and a Font for the Night Theme
|
||||
lv_theme_set_current(th);
|
||||
```
|
||||
|
||||
## Calibration
|
||||
|
||||
This is using the bodmer tft_espi driver for touch. To correctly set the calibration load the calibration sketch and replace the following with your values:
|
||||
|
||||
```C
|
||||
uint16_t calData[5] = { 275, 3620, 264, 3532, 1 };
|
||||
```
|
||||
|
||||
## Screen rotation
|
||||
|
||||
Check the following if you need to alter your screen rotation:
|
||||
|
||||
```C
|
||||
tft.setRotation(3);
|
||||
```
|
||||
@@ -1,37 +0,0 @@
|
||||
# LVGL Arduino examples
|
||||
|
||||
LVGL can be installed via Arduino IDE Library Manager or as an .ZIP library.
|
||||
It will install [lv_exmaples](https://github.com/lvgl/lv_examples) which contains a lot of examples and demos to try LVGL.
|
||||
|
||||
## Example
|
||||
|
||||
There are simple examples which use the [TFT_eSPI](https://github.com/Bodmer/TFT_eSPI) library as a TFT driver to simplify testing.
|
||||
To get all this to work you have to setup TFT_eSPI to work with your TFT display type via editing the `User_Setup.h` file in TFT_eSPI library folder, or by selecting your own configurtion in the `User_Setup_Select.h` file in TFT_eSPI library folder.
|
||||
|
||||
LVGL library has its own configuration file called `lv_conf.h`. When LVGL is installed to followings needs to be done to configure it:
|
||||
1. Go to directory of the installed Arduno libraries
|
||||
2. Go to `lvgl` and copy `lv_conf_template.h` as `lv_conf.h` next to the `src` folder.
|
||||
3. Open `lv_conf.h` and change the first `#if 0` to `#if 1`
|
||||
4. Set the resolution of your display in `LV_HOR_RES_MAX` and `LV_VER_RES_MAX`
|
||||
5. Set the color depth of you display in `LV_COLOR_DEPTH`
|
||||
6. Set `LV_TICK_CUSTOM 1`
|
||||
|
||||
## Debugging
|
||||
|
||||
In case of trouble there are debug informations inside LVGL. In the `ESP32_TFT_eSPI` example there is `my_print` method, which allow to send this debug informations to the serial interface. To enable this feature you have to edit `lv_conf.h` file and enable logging in section `log settings`:
|
||||
|
||||
```c
|
||||
/*Log settings*/
|
||||
#define USE_LV_LOG 1 /*Enable/disable the log module*/
|
||||
#if LV_USE_LOG
|
||||
/* How important log should be added:
|
||||
* LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
|
||||
* LV_LOG_LEVEL_INFO Log important events
|
||||
* LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
|
||||
* LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
|
||||
* LV_LOG_LEVEL_NONE Do not log anything
|
||||
*/
|
||||
# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
|
||||
```
|
||||
|
||||
After enabling log module and setting LV_LOG_LEVEL accordingly the output log is sent to the `Serial` port @ 115200 Bd.
|
||||
@@ -54,41 +54,42 @@ void lv_port_disp_init(void)
|
||||
* Create a buffer for drawing
|
||||
*----------------------------*/
|
||||
|
||||
/* LVGL requires a buffer where it draws the objects. The buffer's has to be greater than 1 display row
|
||||
/* LVGL requires a buffer where it internally draws the widgets.
|
||||
* Later this buffer will passed your display drivers `flush_cb` to copy its content to your display.
|
||||
* The buffer has to be greater than 1 display row
|
||||
*
|
||||
* There are three buffering configurations:
|
||||
* 1. Create ONE buffer with some rows:
|
||||
* 1. Create ONE buffer with some rows:
|
||||
* LVGL will draw the display's content here and writes it to your display
|
||||
*
|
||||
* 2. Create TWO buffer with some rows:
|
||||
*
|
||||
* 2. Create TWO buffer with some rows:
|
||||
* LVGL will draw the display's content to a buffer and writes it your display.
|
||||
* You should use DMA to write the buffer's content to the display.
|
||||
* It will enable LVGL to draw the next part of the screen to the other buffer while
|
||||
* the data is being sent form the first buffer. It makes rendering and flushing parallel.
|
||||
*
|
||||
* 3. Create TWO screen-sized buffer:
|
||||
*
|
||||
* 3. Create TWO screen-sized buffer:
|
||||
* Similar to 2) but the buffer have to be screen sized. When LVGL is ready it will give the
|
||||
* whole frame to display. This way you only need to change the frame buffer's address instead of
|
||||
* copying the pixels.
|
||||
* */
|
||||
|
||||
/* Example for 1) */
|
||||
static lv_disp_buf_t disp_buf_1;
|
||||
static lv_color_t buf1_1[LV_HOR_RES_MAX * 10]; /*A buffer for 10 rows*/
|
||||
lv_disp_buf_init(&disp_buf_1, buf1_1, NULL, LV_HOR_RES_MAX * 10); /*Initialize the display buffer*/
|
||||
static lv_disp_buf_t draw_buf_dsc_1;
|
||||
static lv_color_t draw_buf_1[LV_HOR_RES_MAX * 10]; /*A buffer for 10 rows*/
|
||||
lv_disp_buf_init(&draw_buf_dsc_1, draw_buf_1, NULL, LV_HOR_RES_MAX * 10); /*Initialize the display buffer*/
|
||||
|
||||
/* Example for 2) */
|
||||
static lv_disp_buf_t disp_buf_2;
|
||||
static lv_color_t buf2_1[LV_HOR_RES_MAX * 10]; /*A buffer for 10 rows*/
|
||||
static lv_color_t buf2_2[LV_HOR_RES_MAX * 10]; /*An other buffer for 10 rows*/
|
||||
lv_disp_buf_init(&disp_buf_2, buf2_1, buf2_2, LV_HOR_RES_MAX * 10); /*Initialize the display buffer*/
|
||||
static lv_disp_buf_t draw_buf_dsc_2;
|
||||
static lv_color_t draw_buf_2_1[LV_HOR_RES_MAX * 10]; /*A buffer for 10 rows*/
|
||||
static lv_color_t draw_buf_2_1[LV_HOR_RES_MAX * 10]; /*An other buffer for 10 rows*/
|
||||
lv_disp_buf_init(&draw_buf_dsc_2, draw_buf_2_1, draw_buf_2_1, LV_HOR_RES_MAX * 10); /*Initialize the display buffer*/
|
||||
|
||||
/* Example for 3) */
|
||||
static lv_disp_buf_t disp_buf_3;
|
||||
static lv_color_t buf3_1[LV_HOR_RES_MAX * LV_VER_RES_MAX]; /*A screen sized buffer*/
|
||||
static lv_color_t buf3_2[LV_HOR_RES_MAX * LV_VER_RES_MAX]; /*An other screen sized buffer*/
|
||||
lv_disp_buf_init(&disp_buf_3, buf3_1, buf3_2, LV_HOR_RES_MAX * LV_VER_RES_MAX); /*Initialize the display buffer*/
|
||||
|
||||
static lv_disp_buf_t draw_buf_dsc_3;
|
||||
static lv_color_t draw_buf_3_1[LV_HOR_RES_MAX * LV_VER_RES_MAX]; /*A screen sized buffer*/
|
||||
static lv_color_t draw_buf_3_1[LV_HOR_RES_MAX * LV_VER_RES_MAX]; /*An other screen sized buffer*/
|
||||
lv_disp_buf_init(&draw_buf_dsc_3, draw_buf_3_1, draw_buf_3_2, LV_HOR_RES_MAX * LV_VER_RES_MAX); /*Initialize the display buffer*/
|
||||
|
||||
/*-----------------------------------
|
||||
* Register the display in LVGL
|
||||
@@ -107,7 +108,7 @@ void lv_port_disp_init(void)
|
||||
disp_drv.flush_cb = disp_flush;
|
||||
|
||||
/*Set a display buffer*/
|
||||
disp_drv.buffer = &disp_buf_2;
|
||||
disp_drv.buffer = &draw_buf_dsc_1;
|
||||
|
||||
#if LV_USE_GPU
|
||||
/*Optionally add functions to access the GPU. (Only in buffered mode, LV_VDB_SIZE != 0)*/
|
||||
@@ -155,7 +156,6 @@ static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_colo
|
||||
lv_disp_flush_ready(disp_drv);
|
||||
}
|
||||
|
||||
|
||||
/*OPTIONAL: GPU INTERFACE*/
|
||||
#if LV_USE_GPU
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ extern "C" {
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
@@ -36,7 +36,6 @@ typedef struct {
|
||||
uint32_t dummy2;
|
||||
}dir_t;
|
||||
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
@@ -81,7 +80,7 @@ void lv_port_fs_init(void)
|
||||
fs_init();
|
||||
|
||||
/*---------------------------------------------------
|
||||
* Register the file system interface in LVGL
|
||||
* Register the file system interface in LVGL
|
||||
*--------------------------------------------------*/
|
||||
|
||||
/* Add a simple drive to open images */
|
||||
@@ -118,7 +117,7 @@ void lv_port_fs_init(void)
|
||||
/* Initialize your Storage device and File system. */
|
||||
static void fs_init(void)
|
||||
{
|
||||
/*E.g. for FatFS initalize the SD card and FatFS itself*/
|
||||
/*E.g. for FatFS initialize the SD card and FatFS itself*/
|
||||
|
||||
/*You code here*/
|
||||
}
|
||||
@@ -157,7 +156,6 @@ static lv_fs_res_t fs_open (lv_fs_drv_t * drv, void * file_p, const char * path,
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Close an opened file
|
||||
* @param drv pointer to a driver where this function belongs
|
||||
@@ -264,7 +262,7 @@ static lv_fs_res_t fs_tell (lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p)
|
||||
* Delete a file
|
||||
* @param drv pointer to a driver where this function belongs
|
||||
* @param path path of the file to delete
|
||||
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
|
||||
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
|
||||
*/
|
||||
static lv_fs_res_t fs_remove (lv_fs_drv_t * drv, const char *path)
|
||||
{
|
||||
@@ -325,9 +323,9 @@ static lv_fs_res_t fs_free (lv_fs_drv_t * drv, uint32_t * total_p, uint32_t * fr
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize a 'fs_read_dir_t' variable for directory reading
|
||||
* Initialize a 'lv_fs_dir_t' variable for directory reading
|
||||
* @param drv pointer to a driver where this function belongs
|
||||
* @param rddir_p pointer to a 'fs_read_dir_t' variable
|
||||
* @param rddir_p pointer to a 'lv_fs_dir_t' variable
|
||||
* @param path path to a directory
|
||||
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
|
||||
*/
|
||||
@@ -344,7 +342,7 @@ static lv_fs_res_t fs_dir_open (lv_fs_drv_t * drv, void * rddir_p, const char *p
|
||||
* Read the next filename form a directory.
|
||||
* The name of the directories will begin with '/'
|
||||
* @param drv pointer to a driver where this function belongs
|
||||
* @param rddir_p pointer to an initialized 'fs_read_dir_t' variable
|
||||
* @param rddir_p pointer to an initialized 'lv_fs_dir_t' variable
|
||||
* @param fn pointer to a buffer to store the filename
|
||||
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
|
||||
*/
|
||||
@@ -360,7 +358,7 @@ static lv_fs_res_t fs_dir_read (lv_fs_drv_t * drv, void * rddir_p, char *fn)
|
||||
/**
|
||||
* Close the directory reading
|
||||
* @param drv pointer to a driver where this function belongs
|
||||
* @param rddir_p pointer to an initialized 'fs_read_dir_t' variable
|
||||
* @param rddir_p pointer to an initialized 'lv_fs_dir_t' variable
|
||||
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
|
||||
*/
|
||||
static lv_fs_res_t fs_dir_close (lv_fs_drv_t * drv, void * rddir_p)
|
||||
|
||||
@@ -34,7 +34,6 @@ extern "C" {
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
@@ -79,7 +79,6 @@ void lv_port_indev_init(void)
|
||||
* You should shape them according to your hardware
|
||||
*/
|
||||
|
||||
|
||||
lv_indev_drv_t indev_drv;
|
||||
|
||||
/*------------------
|
||||
@@ -174,8 +173,6 @@ void lv_port_indev_init(void)
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
|
||||
|
||||
/*------------------
|
||||
* Touchpad
|
||||
* -----------------*/
|
||||
@@ -225,7 +222,6 @@ static void touchpad_get_xy(lv_coord_t * x, lv_coord_t * y)
|
||||
(*y) = 0;
|
||||
}
|
||||
|
||||
|
||||
/*------------------
|
||||
* Mouse
|
||||
* -----------------*/
|
||||
@@ -361,7 +357,6 @@ static void encoder_handler(void)
|
||||
encoder_state = LV_INDEV_STATE_REL;
|
||||
}
|
||||
|
||||
|
||||
/*------------------
|
||||
* Button
|
||||
* -----------------*/
|
||||
|
||||
@@ -35,7 +35,6 @@ extern "C" {
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lvgl",
|
||||
"version": "7.4.0",
|
||||
"version": "7.10.0",
|
||||
"keywords": "graphics, gui, embedded, tft, lvgl",
|
||||
"description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.",
|
||||
"repository": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name=lvgl
|
||||
version=7.4.0
|
||||
version=7.10.0
|
||||
author=kisvegabor
|
||||
maintainer=kisvegabor,embeddedt,pete-pjb
|
||||
sentence=Full-featured Graphics Library for Embedded Systems
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file lv_conf.h
|
||||
* Configuration file for v7.4.0-dev
|
||||
* Configuration file for v7.10.0
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -82,7 +82,7 @@ typedef int16_t lv_coord_t;
|
||||
/* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
|
||||
# define LV_MEM_SIZE (32U * 1024U)
|
||||
|
||||
/* Complier prefix for a big array declaration */
|
||||
/* Compiler prefix for a big array declaration */
|
||||
# define LV_MEM_ATTR
|
||||
|
||||
/* Set an address for the memory pool instead of allocating it as an array.
|
||||
@@ -127,14 +127,13 @@ typedef int16_t lv_coord_t;
|
||||
#define LV_INDEV_DEF_DRAG_THROW 10
|
||||
|
||||
/* Long press time in milliseconds.
|
||||
* Time to send `LV_EVENT_LONG_PRESSSED`) */
|
||||
* Time to send `LV_EVENT_LONG_PRESSED`) */
|
||||
#define LV_INDEV_DEF_LONG_PRESS_TIME 400
|
||||
|
||||
/* Repeated trigger period in long press [ms]
|
||||
* Time between `LV_EVENT_LONG_PRESSED_REPEAT */
|
||||
#define LV_INDEV_DEF_LONG_PRESS_REP_TIME 100
|
||||
|
||||
|
||||
/* Gesture threshold in pixels */
|
||||
#define LV_INDEV_DEF_GESTURE_LIMIT 50
|
||||
|
||||
@@ -195,6 +194,19 @@ typedef void * lv_group_user_data_t;
|
||||
e.g. "stm32f769xx.h" or "stm32f429xx.h" */
|
||||
#define LV_GPU_DMA2D_CMSIS_INCLUDE
|
||||
|
||||
/*1: Use PXP for CPU off-load on NXP RTxxx platforms */
|
||||
#define LV_USE_GPU_NXP_PXP 0
|
||||
|
||||
/*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c)
|
||||
* and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol FSL_RTOS_FREE_RTOS
|
||||
* has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected.
|
||||
*0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init()
|
||||
* */
|
||||
#define LV_USE_GPU_NXP_PXP_AUTO_INIT 0
|
||||
|
||||
/*1: Use VG-Lite for CPU offload on NXP RTxxx platforms */
|
||||
#define LV_USE_GPU_NXP_VG_LITE 0
|
||||
|
||||
/* 1: Enable file system (might be required for images */
|
||||
#define LV_USE_FILESYSTEM 1
|
||||
#if LV_USE_FILESYSTEM
|
||||
@@ -227,7 +239,7 @@ typedef void * lv_fs_drv_user_data_t;
|
||||
* (I.e. no new image decoder is added)
|
||||
* With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images.
|
||||
* However the opened images might consume additional RAM.
|
||||
* LV_IMG_CACHE_DEF_SIZE must be >= 1 */
|
||||
* Set it to 0 to disable caching */
|
||||
#define LV_IMG_CACHE_DEF_SIZE 1
|
||||
|
||||
/*Declare the type of the user data of image decoder (can be e.g. `void *`, `int`, `struct`)*/
|
||||
@@ -249,9 +261,14 @@ typedef void * lv_img_decoder_user_data_t;
|
||||
/* Define a custom attribute to `lv_disp_flush_ready` function */
|
||||
#define LV_ATTRIBUTE_FLUSH_READY
|
||||
|
||||
/* Required alignment size for buffers */
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE
|
||||
|
||||
/* With size optimization (-Os) the compiler might not align data to
|
||||
* 4 or 8 byte boundary. This alignment will be explicitly applied where needed.
|
||||
* E.g. __attribute__((aligned(4))) */
|
||||
* 4 or 8 byte boundary. Some HW may need even 32 or 64 bytes.
|
||||
* This alignment will be explicitly applied where needed.
|
||||
* LV_ATTRIBUTE_MEM_ALIGN_SIZE should be used to specify required align size.
|
||||
* E.g. __attribute__((aligned(LV_ATTRIBUTE_MEM_ALIGN_SIZE))) */
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN
|
||||
|
||||
/* Attribute to mark large constant arrays for example
|
||||
@@ -318,7 +335,7 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
|
||||
* If an invalid parameter is found an error log message is printed and
|
||||
* the MCU halts at the error. (`LV_USE_LOG` should be enabled)
|
||||
* If you are debugging the MCU you can pause
|
||||
* the debugger to see exactly where the issue is.
|
||||
* the debugger to see exactly where the issue is.
|
||||
*
|
||||
* The behavior of asserts can be overwritten by redefining them here.
|
||||
* E.g. #define LV_ASSERT_MEM(p) <my_assert_code>
|
||||
@@ -353,7 +370,7 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
|
||||
* FONT USAGE
|
||||
*===================*/
|
||||
|
||||
/* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel.
|
||||
/* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel.
|
||||
* The symbols are available via `LV_SYMBOL_...` defines
|
||||
* More info about fonts: https://docs.lvgl.io/v7/en/html/overview/font.html
|
||||
* To create a new font go to: https://lvgl.com/ttf-font-to-c-array
|
||||
@@ -361,6 +378,8 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
|
||||
|
||||
/* Montserrat fonts with bpp = 4
|
||||
* https://fonts.google.com/specimen/Montserrat */
|
||||
#define LV_FONT_MONTSERRAT_8 0
|
||||
#define LV_FONT_MONTSERRAT_10 0
|
||||
#define LV_FONT_MONTSERRAT_12 0
|
||||
#define LV_FONT_MONTSERRAT_14 1
|
||||
#define LV_FONT_MONTSERRAT_16 0
|
||||
@@ -390,6 +409,7 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
|
||||
/*Pixel perfect monospace font
|
||||
* http://pelulamu.net/unscii/ */
|
||||
#define LV_FONT_UNSCII_8 0
|
||||
#define LV_FONT_UNSCII_16 0
|
||||
|
||||
/* Optionally declare your custom fonts here.
|
||||
* You can use these fonts as default font too
|
||||
@@ -430,11 +450,11 @@ typedef void * lv_font_user_data_t;
|
||||
|
||||
/* No theme, you can apply your styles as you need
|
||||
* No flags. Set LV_THEME_DEFAULT_FLAG 0 */
|
||||
#define LV_USE_THEME_EMPTY 1
|
||||
#define LV_USE_THEME_EMPTY 1
|
||||
|
||||
/*Simple to the create your theme based on it
|
||||
* No flags. Set LV_THEME_DEFAULT_FLAG 0 */
|
||||
#define LV_USE_THEME_TEMPLATE 1
|
||||
#define LV_USE_THEME_TEMPLATE 1
|
||||
|
||||
/* A fast and impressive theme.
|
||||
* Flags:
|
||||
@@ -443,14 +463,14 @@ typedef void * lv_font_user_data_t;
|
||||
* LV_THEME_MATERIAL_FLAG_NO_TRANSITION: disable transitions (state change animations)
|
||||
* LV_THEME_MATERIAL_FLAG_NO_FOCUS: disable indication of focused state)
|
||||
* */
|
||||
#define LV_USE_THEME_MATERIAL 1
|
||||
#define LV_USE_THEME_MATERIAL 1
|
||||
|
||||
/* Mono-color theme for monochrome displays.
|
||||
* If LV_THEME_DEFAULT_COLOR_PRIMARY is LV_COLOR_BLACK the
|
||||
* texts and borders will be black and the background will be
|
||||
* white. Else the colors are inverted.
|
||||
* No flags. Set LV_THEME_DEFAULT_FLAG 0 */
|
||||
#define LV_USE_THEME_MONO 1
|
||||
#define LV_USE_THEME_MONO 1
|
||||
|
||||
#define LV_THEME_DEFAULT_INCLUDE <stdint.h> /*Include a header for the init. function*/
|
||||
#define LV_THEME_DEFAULT_INIT lv_theme_material_init
|
||||
@@ -493,7 +513,7 @@ typedef void * lv_font_user_data_t;
|
||||
|
||||
/* Support bidirectional texts.
|
||||
* Allows mixing Left-to-Right and Right-to-Left texts.
|
||||
* The direction will be processed according to the Unicode Bidirectioanl Algorithm:
|
||||
* The direction will be processed according to the Unicode Bidirectional Algorithm:
|
||||
* https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
|
||||
#define LV_USE_BIDI 0
|
||||
#if LV_USE_BIDI
|
||||
@@ -653,7 +673,7 @@ typedef void * lv_obj_user_data_t;
|
||||
* 1: Some extra precision
|
||||
* 2: Best precision
|
||||
*/
|
||||
# define LV_LINEMETER_PRECISE 0
|
||||
# define LV_LINEMETER_PRECISE 1
|
||||
#endif
|
||||
|
||||
/*Mask (dependencies: -)*/
|
||||
@@ -687,9 +707,6 @@ typedef void * lv_obj_user_data_t;
|
||||
# define LV_ROLLER_INF_PAGES 7
|
||||
#endif
|
||||
|
||||
/*Rotary (dependencies: lv_arc, lv_btn)*/
|
||||
#define LV_USE_ROTARY 1
|
||||
|
||||
/*Slider (dependencies: lv_bar)*/
|
||||
#define LV_USE_SLIDER 1
|
||||
|
||||
@@ -710,6 +727,7 @@ typedef void * lv_obj_user_data_t;
|
||||
#define LV_USE_TABLE 1
|
||||
#if LV_USE_TABLE
|
||||
# define LV_TABLE_COL_MAX 12
|
||||
# define LV_TABLE_CELL_STYLE_CNT 4
|
||||
#endif
|
||||
|
||||
/*Tab (dependencies: lv_page, lv_btnm)*/
|
||||
|
||||
34
lvgl.h
34
lvgl.h
@@ -2,7 +2,7 @@
|
||||
* @file lvgl.h
|
||||
* Include all LittleV GL related headers
|
||||
*/
|
||||
|
||||
|
||||
#ifndef LVGL_H
|
||||
#define LVGL_H
|
||||
|
||||
@@ -10,13 +10,12 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/***************************
|
||||
* CURRENT VERSION OF LVGL
|
||||
***************************/
|
||||
#define LVGL_VERSION_MAJOR 7
|
||||
#define LVGL_VERSION_MINOR 4
|
||||
#define LVGL_VERSION_PATCH 0
|
||||
#define LVGL_VERSION_MAJOR 7
|
||||
#define LVGL_VERSION_MINOR 10
|
||||
#define LVGL_VERSION_PATCH 0
|
||||
#define LVGL_VERSION_INFO ""
|
||||
|
||||
/*********************
|
||||
@@ -82,8 +81,6 @@ extern "C" {
|
||||
|
||||
#include "src/lv_api_map.h"
|
||||
|
||||
//#define LV_BUILD_TEST 1
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
@@ -123,6 +120,29 @@ extern "C" {
|
||||
* */
|
||||
#define LV_VERSION_CHECK(x,y,z) (x == LVGL_VERSION_MAJOR && (y < LVGL_VERSION_MINOR || (y == LVGL_VERSION_MINOR && z <= LVGL_VERSION_PATCH)))
|
||||
|
||||
/**
|
||||
* Wrapper functions for VERSION macros
|
||||
*/
|
||||
|
||||
static inline int lv_version_major(void)
|
||||
{
|
||||
return LVGL_VERSION_MAJOR;
|
||||
}
|
||||
|
||||
static inline int lv_version_minor(void)
|
||||
{
|
||||
return LVGL_VERSION_MINOR;
|
||||
}
|
||||
|
||||
static inline int lv_version_patch(void)
|
||||
{
|
||||
return LVGL_VERSION_PATCH;
|
||||
}
|
||||
|
||||
static inline const char *lv_version_info(void)
|
||||
{
|
||||
return LVGL_VERSION_INFO;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
2
lvgl.mk
2
lvgl.mk
@@ -6,5 +6,3 @@ include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_misc/lv_misc.mk
|
||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_themes/lv_themes.mk
|
||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_draw/lv_draw.mk
|
||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_gpu/lv_gpu.mk
|
||||
|
||||
|
||||
|
||||
@@ -7,40 +7,40 @@ import sys
|
||||
|
||||
parser = argparse.ArgumentParser(description="""Create fonts for LittelvGL including the built-in symbols. lv_font_conv needs to be installed. See https://github.com/littlevgl/lv_font_conv
|
||||
Example: python built_in_font_gen.py --size 16 -o lv_font_roboto_16.c --bpp 4 -r 0x20-0x7F""", formatter_class=RawTextHelpFormatter)
|
||||
parser.add_argument('-s', '--size',
|
||||
type=int,
|
||||
metavar = 'px',
|
||||
nargs='?',
|
||||
parser.add_argument('-s', '--size',
|
||||
type=int,
|
||||
metavar = 'px',
|
||||
nargs='?',
|
||||
help='Size of the font in px')
|
||||
parser.add_argument('--bpp',
|
||||
type=int,
|
||||
metavar = '1,2,4',
|
||||
nargs='?',
|
||||
parser.add_argument('--bpp',
|
||||
type=int,
|
||||
metavar = '1,2,4',
|
||||
nargs='?',
|
||||
help='Bit per pixel')
|
||||
parser.add_argument('-r', '--range',
|
||||
nargs='+',
|
||||
metavar = 'start-end',
|
||||
default=['0x20-0x7F,0xB0,0x2022'],
|
||||
parser.add_argument('-r', '--range',
|
||||
nargs='+',
|
||||
metavar = 'start-end',
|
||||
default=['0x20-0x7F,0xB0,0x2022'],
|
||||
help='Ranges and/or characters to include. Default is 0x20-7F (ASCII). E.g. -r 0x20-0x7F, 0x200, 324')
|
||||
parser.add_argument('--symbols',
|
||||
nargs='+',
|
||||
metavar = 'sym',
|
||||
parser.add_argument('--symbols',
|
||||
nargs='+',
|
||||
metavar = 'sym',
|
||||
default=[''],
|
||||
help=u'Symbols to include. E.g. -s ÁÉŐ'.encode('utf-8'))
|
||||
parser.add_argument('--font',
|
||||
metavar = 'file',
|
||||
nargs='?',
|
||||
default='Montserrat-Medium.ttf',
|
||||
parser.add_argument('--font',
|
||||
metavar = 'file',
|
||||
nargs='?',
|
||||
default='Montserrat-Medium.ttf',
|
||||
help='A TTF or WOFF file')
|
||||
parser.add_argument('-o', '--output',
|
||||
nargs='?',
|
||||
metavar='file',
|
||||
parser.add_argument('-o', '--output',
|
||||
nargs='?',
|
||||
metavar='file',
|
||||
help='Output file name. E.g. my_font_20.c')
|
||||
parser.add_argument('--compressed', action='store_true',
|
||||
help='Compress the bitmaps')
|
||||
parser.add_argument('--subpx', action='store_true',
|
||||
help='3 times wider letters for sub pixel rendering')
|
||||
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.compressed == False:
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
|
||||
import os
|
||||
|
||||
print("\nGenerating 16 px CJK")
|
||||
os.system(u"./built_in_font_gen.py --size 16 -o lv_font_simsun_16_cjk.c --bpp 4 --font SimSun.woff -r 0x20-0x7f --symbols 一在有個我不這了他也就人都說而我們你了要會對及和與以很種的大能著她那上但年還可以最自己為來所他們兩各可為或好等又將因為於由從更被才已者每次把三什麼問題其讓此做再所以只與則台灣卻並位想去呢學生表示到公司將如果社會看小天因此新但是它中使工作全覺得使用這些裡並由於時候知道這樣一認為時間事過向可能中國美國到和幾系統政府大家國家許多生活跟已經大學研究因本二活動該世界應四希望方式內項啊下環境一些必須文化高孩子沒有不能如開始元不同仍網路日本用中心來對雖然重要地方進行關係市場太老師提供學校應該指出經濟其他家發展教育成為多非常便方面很多吃然後未發現電腦一樣而且心不過無法企業正服務較不會臺灣曾嗎空間看到五如何國內們無對於以及之後可是當人員比先產品資訊資料比較先生地除了大陸需要像在給歲請月些名另若亦地區技術至特別其實國際不要發生參加一定其中問台北包括講造成看像常即喜歡去沒出現政治話走單位一直吧是否當然整處理歷史了解那怎麼機會家聽所有只要朋友令甚至用真六呀情況還是錢方法點任何經驗藝術你們十主要媽媽增加提出為什麼以您計畫作利用東西在條設計找之間成長能夠決定學習誰見半時代完成帶相當同學件能力別人生命下來場會議容易開發民眾事情書事實有關自組織言多愛建立相關均產生多業者解決完全的話接受知約一般推動過程管理功能手打水要求小朋友教授難我國告訴內容結果調查家庭成立選擇經營然而父母寫人類至於買尤其配合進入例如得討論依作品情形資源原因啦妳運動觀念給軟體品質經過如此嗯精神影響之過好像成參與以後於是部分另外公園透過訓練努力研究具有共同所謂下行為合作經合作目標起來考慮長意見辦法音樂連受廠商隻受到一切或是中央某女性教學極獲得真的路來快國小部份工程女人舉行句只是段根據現象人民土地面對注意這裡新聞繼續相信政策變成計劃強調學人士前前存在制度意義代表課程該沒至需求人生那些成功爸爸產業負責民間雖影響直接幾乎分實際團體價值使得類形成科技這麼當七不但往本身標準似乎應用或者動物電話態度建設事業老那麼常常字坐舉辦自我有的具目的塊條件即使好十分多少放又電影科學執行邊委員會溝通開一起張針對員工引起自然那麼安全總統此外擁有並且事件設計研究所語言嚴重故事學術片設備之外車基本實在久套達到改善死結構住皆改變拿小組支持座醫院既僅值得學者八交通階段就是申請主管申請同感覺電視母親嘛香港記者壓力快樂喝敢院也許人們談生產怕就身體規定程度積極知識作為機構而是鼓勵角色狀況專家據清楚不僅比賽玩效果越保護共開放附近上父親專業經費曾經工作願意分別重視不少歡迎小孩小時中國人顯示中共出男人避免屬於實施聲音主義行動不可只有校園興趣山表現得回來主任裡面經常不再電子受思想頭終於謝謝協助除當地正式真正低性份因素推出上價格去認識方向責任說明工業大量做逐漸心理一點供須簡單運用觀察往往規劃減少重新業務報導仍然感到開放領域有效女要從事發揮人才反而行政銀行公共媒體提高代自然社區力量啊教育部愈超過維持家長結合校長通常缺乏委員特色結果有時教師之前遠控制本否則法少原則要臉通過建議工具作業達節目智慧來自而變化同樣形式站以為健康擔任人口規劃剛特殊原來道分傳統總是前往投資加強不斷對象追求加上比思考製作台北市取得出來加入台安排兒童國中範圍老人雙方牠北京年輕結束教程式婦女找到彼此全球成本回到部而已之下等變期間非小姐整體採用根本叫歐洲正在加以充滿系列隨著早等等頗不足總分析深報告不錯在於旁笑故消費者意識公尺民族為主大眾到底願度大概對方官員發表進一步自由正確豐富國民黨戰爭怎麼樣只好明顯改革表達肯定強高興哪樹適合茶別國外關心蘇聯成績人物聽到創造不必不論尚居民不管美麗伊拉克帶來有般永遠感情兒子這樣子起全部".encode('utf-8'))
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_simsun_16_cjk.c')
|
||||
print("Generating 8 px")
|
||||
os.system("./built_in_font_gen.py --size 8 -o lv_font_montserrat_8.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_8.c')
|
||||
|
||||
exit()
|
||||
print("\nGenerating 10 px")
|
||||
os.system("./built_in_font_gen.py --size 10 -o lv_font_montserrat_10.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_10.c')
|
||||
|
||||
print("Generating 12 px")
|
||||
print("\nGenerating 12 px")
|
||||
os.system("./built_in_font_gen.py --size 12 -o lv_font_montserrat_12.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_12.c')
|
||||
|
||||
@@ -96,8 +98,6 @@ print("\nGenerating 16 px CJK")
|
||||
os.system(u"./built_in_font_gen.py --size 16 -o lv_font_simsun_16_cjk.c --bpp 4 --font SimSun.woff -r 0x20-0x7f --symbols 一在有個我不這了他也就人都說而我們你了要會對及和與以很種的大能著她那上但年還可以最自己為來所他們兩各可為或好等又將因為於由從更被才已者每次把三什麼問題其讓此做再所以只與則台灣卻並位想去呢學生表示到公司將如果社會看小天因此新但是它中使工作全覺得使用這些裡並由於時候知道這樣一認為時間事過向可能中國美國到和幾系統政府大家國家許多生活跟已經大學研究因本二活動該世界應四希望方式內項啊下環境一些必須文化高孩子沒有不能如開始元不同仍網路日本用中心來對雖然重要地方進行關係市場太老師提供學校應該指出經濟其他家發展教育成為多非常便方面很多吃然後未發現電腦一樣而且心不過無法企業正服務較不會臺灣曾嗎空間看到五如何國內們無對於以及之後可是當人員比先產品資訊資料比較先生地除了大陸需要像在給歲請月些名另若亦地區技術至特別其實國際不要發生參加一定其中問台北包括講造成看像常即喜歡去沒出現政治話走單位一直吧是否當然整處理歷史了解那怎麼機會家聽所有只要朋友令甚至用真六呀情況還是錢方法點任何經驗藝術你們十主要媽媽增加提出為什麼以您計畫作利用東西在條設計找之間成長能夠決定學習誰見半時代完成帶相當同學件能力別人生命下來場會議容易開發民眾事情書事實有關自組織言多愛建立相關均產生多業者解決完全的話接受知約一般推動過程管理功能手打水要求小朋友教授難我國告訴內容結果調查家庭成立選擇經營然而父母寫人類至於買尤其配合進入例如得討論依作品情形資源原因啦妳運動觀念給軟體品質經過如此嗯精神影響之過好像成參與以後於是部分另外公園透過訓練努力研究具有共同所謂下行為合作經合作目標起來考慮長意見辦法音樂連受廠商隻受到一切或是中央某女性教學極獲得真的路來快國小部份工程女人舉行句只是段根據現象人民土地面對注意這裡新聞繼續相信政策變成計劃強調學人士前前存在制度意義代表課程該沒至需求人生那些成功爸爸產業負責民間雖影響直接幾乎分實際團體價值使得類形成科技這麼當七不但往本身標準似乎應用或者動物電話態度建設事業老那麼常常字坐舉辦自我有的具目的塊條件即使好十分多少放又電影科學執行邊委員會溝通開一起張針對員工引起自然那麼安全總統此外擁有並且事件設計研究所語言嚴重故事學術片設備之外車基本實在久套達到改善死結構住皆改變拿小組支持座醫院既僅值得學者八交通階段就是申請主管申請同感覺電視母親嘛香港記者壓力快樂喝敢院也許人們談生產怕就身體規定程度積極知識作為機構而是鼓勵角色狀況專家據清楚不僅比賽玩效果越保護共開放附近上父親專業經費曾經工作願意分別重視不少歡迎小孩小時中國人顯示中共出男人避免屬於實施聲音主義行動不可只有校園興趣山表現得回來主任裡面經常不再電子受思想頭終於謝謝協助除當地正式真正低性份因素推出上價格去認識方向責任說明工業大量做逐漸心理一點供須簡單運用觀察往往規劃減少重新業務報導仍然感到開放領域有效女要從事發揮人才反而行政銀行公共媒體提高代自然社區力量啊教育部愈超過維持家長結合校長通常缺乏委員特色結果有時教師之前遠控制本否則法少原則要臉通過建議工具作業達節目智慧來自而變化同樣形式站以為健康擔任人口規劃剛特殊原來道分傳統總是前往投資加強不斷對象追求加上比思考製作台北市取得出來加入台安排兒童國中範圍老人雙方牠北京年輕結束教程式婦女找到彼此全球成本回到部而已之下等變期間非小姐整體採用根本叫歐洲正在加以充滿系列隨著早等等頗不足總分析深報告不錯在於旁笑故消費者意識公尺民族為主大眾到底願度大概對方官員發表進一步自由正確豐富國民黨戰爭怎麼樣只好明顯改革表達肯定強高興哪樹適合茶別國外關心蘇聯成績人物聽到創造不必不論尚居民不管美麗伊拉克帶來有般永遠感情兒子這樣子起全部".encode('utf-8'))
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_simsun_16_cjk.c')
|
||||
|
||||
print("Generating 16 px Hebrew, Persian")
|
||||
print("\nGenerating 16 px Hebrew, Persian")
|
||||
os.system("./built_in_font_gen.py --size 16 -o lv_font_dejavu_16_persian_hebrew.c --bpp 4 --font DejaVuSans.ttf -r 0x20-0x7f,0x5d0-0x5ea,0x600-0x6FF,0xFB50-0xFDFF,0xFE70-0xFEFF")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_dejavu_16_persian_hebrew.c')
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
--suffix=none
|
||||
--preserve-date
|
||||
--formatted
|
||||
--exclude=lv_conf_internal.h
|
||||
--exclude=lv_conf_internal.h
|
||||
--exclude=../src/lv_font/lv_font_montserrat_12.c
|
||||
--exclude=../src/lv_font/lv_font_montserrat_14.c
|
||||
--exclude=../src/lv_font/lv_font_montserrat_16.c
|
||||
@@ -47,4 +47,3 @@
|
||||
--exclude=../src/lv_font/lv_font_montserrat_28_compressed.c
|
||||
--exclude=../src/lv_font/lv_font_simsun_16_cjk.c
|
||||
--exclude=../src/lv_font/lv_font_dejavu_16_persian_hebrew.c
|
||||
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
cppcheck -j8 --template="{severity}\t{file}:{line}\t{id}: {message}" --enable=all ../src/ --output-file=cppcheck_res.txt --suppress=unusedFunction --suppress=preprocessorErrorDirective --force
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
# https://github.com/facebook/infer
|
||||
#
|
||||
# Install:
|
||||
# Install:
|
||||
# VERSION=0.17.0; \
|
||||
# curl -sSL "https://github.com/facebook/infer/releases/download/v$VERSION/infer-linux64-v$VERSION.tar.xz" \
|
||||
# | sudo tar -C /opt -xJ && \
|
||||
# sudoln -s "/opt/infer-linux64-v$VERSION/bin/infer" /usr/local/bin/infer
|
||||
|
||||
|
||||
infer run -- make -j8
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
'''
|
||||
Generates a checker file for lv_conf.h from lv_conf_templ.h define all the not defined values
|
||||
Generates a checker file for lv_conf.h from lv_conf_template.h define all the not defined values
|
||||
'''
|
||||
|
||||
|
||||
import sys
|
||||
import re
|
||||
|
||||
@@ -15,7 +14,6 @@ if sys.version_info < (3,6,0):
|
||||
fin = open("../lv_conf_template.h", "r")
|
||||
fout = open("../src/lv_conf_internal.h", "w")
|
||||
|
||||
|
||||
fout.write(
|
||||
'''/**
|
||||
* GENERATED FILE, DO NOT EDIT IT!
|
||||
@@ -29,16 +27,41 @@ fout.write(
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(LV_CONF_PATH)
|
||||
#define __LV_TO_STR_AUX(x) #x
|
||||
#define __LV_TO_STR(x) __LV_TO_STR_AUX(x)
|
||||
#include __LV_TO_STR(LV_CONF_PATH)
|
||||
#undef __LV_TO_STR_AUX
|
||||
#undef __LV_TO_STR
|
||||
#elif defined(LV_CONF_INCLUDE_SIMPLE)
|
||||
#include "lv_conf.h"
|
||||
#else
|
||||
#include "../../lv_conf.h"
|
||||
/* Add ESP-IDF related includes */
|
||||
#if defined (ESP_PLATFORM)
|
||||
# include "sdkconfig.h"
|
||||
# include "esp_attr.h"
|
||||
#endif
|
||||
|
||||
/* Handle special Kconfig options */
|
||||
#include "lv_conf_kconfig.h"
|
||||
|
||||
#ifdef CONFIG_LV_CONF_SKIP
|
||||
#define LV_CONF_SKIP
|
||||
#endif
|
||||
|
||||
/* If "lv_conf.h" is available from here try to use it later.*/
|
||||
#if defined __has_include
|
||||
# if __has_include("lv_conf.h")
|
||||
# ifndef LV_CONF_INCLUDE_SIMPLE
|
||||
# define LV_CONF_INCLUDE_SIMPLE
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*If lv_conf.h is not skipped include it*/
|
||||
#if !defined(LV_CONF_SKIP)
|
||||
# if defined(LV_CONF_PATH) /*If there is a path defined for lv_conf.h use it*/
|
||||
# define __LV_TO_STR_AUX(x) #x
|
||||
# define __LV_TO_STR(x) __LV_TO_STR_AUX(x)
|
||||
# include __LV_TO_STR(LV_CONF_PATH)
|
||||
# undef __LV_TO_STR_AUX
|
||||
# undef __LV_TO_STR
|
||||
# elif defined(LV_CONF_INCLUDE_SIMPLE) /*Or simply include lv_conf.h is enabled*/
|
||||
# include "lv_conf.h"
|
||||
# else
|
||||
# include "../../lv_conf.h" /*Else assume lv_conf.h is next to the lvgl folder */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
'''
|
||||
@@ -57,23 +80,70 @@ for i in fin.read().splitlines():
|
||||
if '/*--END OF LV_CONF_H--*/' in i: break
|
||||
|
||||
r = re.search(r'^ *# *define ([^\s]+).*$', i)
|
||||
|
||||
|
||||
#ifndef LV_USE_BTN /*Only if not defined in lv_conf.h*/
|
||||
# ifdef CONFIG_LV_USE_BTN /*Use KConfig value if set*/
|
||||
# define LV_USE_BTN CONFIG_LV_USE_BTN
|
||||
# else
|
||||
# define LV_USE_BTN 1 /*Use default value*/
|
||||
# endif
|
||||
#endif
|
||||
|
||||
if r:
|
||||
line = re.sub('\(.*?\)', '', r[1], 1) #remove parentheses from macros
|
||||
dr = re.sub('.*# *define', '', i, 1)
|
||||
d = "# define " + dr
|
||||
|
||||
fout.write(
|
||||
f'#ifndef {line}\n'
|
||||
f'{i}\n'
|
||||
'#endif\n'
|
||||
f'# ifdef CONFIG_{line.upper()}\n'
|
||||
f'# define {line} CONFIG_{line.upper()}\n'
|
||||
f'# else\n'
|
||||
f'{d}\n'
|
||||
f'# endif\n'
|
||||
f'#endif\n'
|
||||
)
|
||||
elif re.search('^ *typedef .*;.*$', i):
|
||||
continue #ignore typedefs to avoide redeclaration
|
||||
else:
|
||||
fout.write(f'{i}\n')
|
||||
|
||||
|
||||
fout.write(
|
||||
'''
|
||||
#endif /*LV_CONF_CHECKER_H*/
|
||||
|
||||
/*If running without lv_conf.h add typdesf with default value*/
|
||||
#if defined(LV_CONF_SKIP)
|
||||
|
||||
/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
|
||||
typedef int16_t lv_coord_t;
|
||||
|
||||
# if LV_USE_ANIMATION
|
||||
/*Declare the type of the user data of animations (can be e.g. `void *`, `int`, `struct`)*/
|
||||
typedef void * lv_anim_user_data_t;
|
||||
# endif
|
||||
|
||||
# if LV_USE_GROUP
|
||||
typedef void * lv_group_user_data_t;
|
||||
# endif
|
||||
|
||||
# if LV_USE_FILESYSTEM
|
||||
typedef void * lv_fs_drv_user_data_t;
|
||||
# endif
|
||||
|
||||
typedef void * lv_img_decoder_user_data_t;
|
||||
|
||||
typedef void * lv_disp_drv_user_data_t; /*Type of user data in the display driver*/
|
||||
typedef void * lv_indev_drv_user_data_t; /*Type of user data in the input device driver*/
|
||||
|
||||
typedef void * lv_font_user_data_t;
|
||||
|
||||
# if LV_USE_USER_DATA
|
||||
typedef void * lv_obj_user_data_t;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /*LV_CONF_INTERNAL_H*/
|
||||
'''
|
||||
)
|
||||
|
||||
|
||||
@@ -1,525 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Release lvgl, lv_examples, lv_drivers. docs, blog and prepare the development of the next major, minoror bugfix release
|
||||
# Usage: ./release,py bugfix | minor | major
|
||||
# The option means what type of versin to prepare for development after release
|
||||
#
|
||||
# STEPS:
|
||||
# - clone all 5 repos
|
||||
# - get the version numnber from lvgl.h
|
||||
# - set release branch (e.g. "release/v7")
|
||||
# - prepare lvgl
|
||||
# - run lv_conf_internal.py
|
||||
# - run code formatter
|
||||
# - clear LVGL_VERSION_INFO (set to "")
|
||||
# - run Doxygen
|
||||
# - update the version in lvgl's library.json, library.properties, lv_conf_template.h
|
||||
# - update CHANGELOG.md
|
||||
# - commit changes
|
||||
# - prepare lv_examples
|
||||
# - upadte the required LVGL version in lv_examples.h (LV_VERSION_CHECK)
|
||||
# - update the version in lv_ex_conf_template.h
|
||||
# - prepare lv_drivers
|
||||
# - update the version in library.json, lv_drv_conf_template.h
|
||||
# - prepare docs
|
||||
# - update API XML
|
||||
# - clear the versiopn info (should be plain vx.y.z)
|
||||
# - tag all repos with the new version
|
||||
# - merge to release branches
|
||||
# - blog: add release post
|
||||
# - push tags and commits
|
||||
# - docs: run ./updade.py release/vX
|
||||
#
|
||||
# If --patch
|
||||
# - merge master to dev branches
|
||||
# - increment patch version by 1 and append "-dev". E.g. "vX.Y.(Z+1)-dev"
|
||||
# - update version numbers in lvgl and docs
|
||||
# - commit and push
|
||||
# - docs: run ./updade.py latest dev
|
||||
#
|
||||
# Else (not --patch)
|
||||
# - merge master to dev
|
||||
# - merge the dev to master
|
||||
# - increment version number like "vX.(Y+1).0-dev"
|
||||
# - apply the new version in dev branches of lvgl, lv_examples, lv_drivers, docs
|
||||
# - commit and push to dev branches
|
||||
# - docs: run ./updade.py latest dev
|
||||
|
||||
import re
|
||||
import os, fnmatch
|
||||
import os.path
|
||||
from os import path
|
||||
from datetime import date
|
||||
import sys
|
||||
|
||||
upstream_org_url = "https://github.com/lvgl/"
|
||||
workdir = "./release_tmp"
|
||||
proj_list = [ "lv_sim_eclipse_sdl"]
|
||||
|
||||
ver_major = -1
|
||||
ver_minor = -1
|
||||
ver_patch = -1
|
||||
|
||||
ver_str = ""
|
||||
dev_ver_str = ""
|
||||
release_br = ""
|
||||
release_note = ""
|
||||
|
||||
prepare_type = ['major', 'minor', 'bugfix']
|
||||
|
||||
dev_prepare = 'minor'
|
||||
|
||||
def upstream(repo):
|
||||
return upstream_org_url + repo + ".git"
|
||||
|
||||
def cmd(c, exit_on_err = True):
|
||||
print("\n" + c)
|
||||
r = os.system(c)
|
||||
if r:
|
||||
print("### Error: " + str(r))
|
||||
if exit_on_err: exit(int(r))
|
||||
|
||||
def define_set(fn, name, value):
|
||||
print("In " + fn + " set " + name + " to " + value)
|
||||
|
||||
new_content = ""
|
||||
s = r'^ *# *define +' + str(name).rstrip()
|
||||
|
||||
f = open(fn, "r")
|
||||
for i in f.read().splitlines():
|
||||
r = re.search(s, i)
|
||||
if r:
|
||||
d = i.split("define")
|
||||
i = d[0] + "define " + name + " " + value
|
||||
new_content += i + '\n'
|
||||
|
||||
f.close()
|
||||
|
||||
f = open(fn, "w")
|
||||
f.write(new_content)
|
||||
f.close()
|
||||
|
||||
def clone_repos():
|
||||
cmd("rm -fr " + workdir)
|
||||
cmd("mkdir " + workdir)
|
||||
os.chdir(workdir)
|
||||
|
||||
#For debuging just copy the repos
|
||||
#cmd("cp -a ../repos/. .")
|
||||
#return
|
||||
|
||||
cmd("git clone " + upstream("lvgl") + "; cd lvgl; git checkout master")
|
||||
cmd("git clone " + upstream("lv_examples") + "; cd lv_examples; git checkout master")
|
||||
cmd("git clone " + upstream("lv_drivers") + "; cd lv_drivers; git checkout master")
|
||||
cmd("git clone --recurse-submodules " + upstream("docs") + "; cd docs; git checkout master")
|
||||
cmd("git clone " + upstream("blog") + "; cd blog; git checkout master")
|
||||
|
||||
for p in proj_list:
|
||||
cmd("git clone " + upstream(p) + " --recurse-submodules ; cd " + p + "; git checkout master")
|
||||
|
||||
|
||||
def get_lvgl_version(br):
|
||||
print("Get LVGL's version")
|
||||
|
||||
global ver_str, ver_major, ver_minor, ver_patch, release_br
|
||||
|
||||
os.chdir("./lvgl")
|
||||
|
||||
cmd("git checkout " + br)
|
||||
|
||||
f = open("./lvgl.h", "r")
|
||||
|
||||
lastNum = re.compile(r'(?:[^\d]*(\d+)[^\d]*)+')
|
||||
for i in f.read().splitlines():
|
||||
r = re.search(r'^#define LVGL_VERSION_MAJOR ', i)
|
||||
if r:
|
||||
m = lastNum.search(i)
|
||||
if m: ver_major = m.group(1)
|
||||
|
||||
r = re.search(r'^#define LVGL_VERSION_MINOR ', i)
|
||||
if r:
|
||||
m = lastNum.search(i)
|
||||
if m: ver_minor = m.group(1)
|
||||
|
||||
r = re.search(r'^#define LVGL_VERSION_PATCH ', i)
|
||||
if r:
|
||||
m = lastNum.search(i)
|
||||
if m: ver_patch = m.group(1)
|
||||
|
||||
f.close()
|
||||
|
||||
cmd("git checkout master")
|
||||
|
||||
ver_str = "v" + str(ver_major) + "." + str(ver_minor) + "." + str(ver_patch)
|
||||
print("New version:" + ver_str)
|
||||
|
||||
release_br = "release/v" + ver_major
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def update_version():
|
||||
templ = fnmatch.filter(os.listdir('.'), '*templ*')
|
||||
|
||||
if templ[0]:
|
||||
print("Updating version in " + templ[0])
|
||||
cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+/"+ ver_str +"/' " + templ[0])
|
||||
|
||||
if os.path.exists("library.json"):
|
||||
print("Updating version in library.json")
|
||||
cmd("sed -i -r 's/[0-9]+\.[0-9]+\.[0-9]+/"+ ver_str[1:] +"/' library.json")
|
||||
|
||||
if path.exists("library.properties"):
|
||||
print("Updating version in library.properties")
|
||||
cmd("sed -i -r 's/version=[0-9]+\.[0-9]+\.[0-9]+/"+ "version=" + ver_str[1:] + "/' library.properties")
|
||||
|
||||
def lvgl_prepare():
|
||||
print("Prepare lvgl")
|
||||
|
||||
global ver_str, ver_major, ver_minor, ver_patch
|
||||
|
||||
os.chdir("./lvgl")
|
||||
define_set("./lvgl.h", "LVGL_VERSION_INFO", '\"\"')
|
||||
|
||||
# Run some scripts
|
||||
os.chdir("./scripts")
|
||||
cmd("./code-format.sh")
|
||||
cmd("./lv_conf_checker.py")
|
||||
cmd("doxygen")
|
||||
os.chdir("../")
|
||||
|
||||
update_version()
|
||||
|
||||
#update CHANGLELOG
|
||||
new_content = ""
|
||||
f = open("./CHANGELOG.md", "r")
|
||||
|
||||
global release_note
|
||||
release_note = ""
|
||||
note_state = 0
|
||||
for i in f.read().splitlines():
|
||||
if note_state == 0:
|
||||
r = re.search(r'^## ' + ver_str, i)
|
||||
if r:
|
||||
i = i.replace("planned on ", "")
|
||||
note_state+=1
|
||||
|
||||
elif note_state == 1:
|
||||
r = re.search(r'^## ', i)
|
||||
if r:
|
||||
note_state+=1
|
||||
else:
|
||||
release_note += i + '\n'
|
||||
|
||||
new_content += i + '\n'
|
||||
|
||||
f.close()
|
||||
|
||||
f = open("./CHANGELOG.md", "w")
|
||||
f.write(new_content)
|
||||
f.close()
|
||||
|
||||
cmd('git commit -am "prepare to release ' + ver_str + '"')
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
|
||||
def lv_examples_prepare():
|
||||
print("Prepare lv_examples")
|
||||
global ver_str, ver_major, ver_minor, ver_patch
|
||||
|
||||
os.chdir("./lv_examples")
|
||||
|
||||
update_version()
|
||||
|
||||
cmd("sed -i -r 's/LV_VERSION_CHECK\([0-9]+, *[0-9]+, *[0-9]+\)/"+ "LV_VERSION_CHECK(" + ver_major + ", " + ver_minor + ", " + ver_patch + ")/' lv_examples.h")
|
||||
|
||||
cmd('git commit -am "prepare to release ' + ver_str + '"')
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def lv_drivers_prepare():
|
||||
print("Prepare lv_drivers")
|
||||
global ver_str, ver_major, ver_minor, ver_patch
|
||||
|
||||
os.chdir("./lv_drivers")
|
||||
|
||||
update_version()
|
||||
|
||||
cmd('git commit -am "prepare to release ' + ver_str + '"')
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def docs_prepare():
|
||||
print("Prepare docs")
|
||||
global ver_str, ver_major, ver_minor, ver_patch
|
||||
|
||||
os.chdir("./docs")
|
||||
|
||||
cmd("git co latest --")
|
||||
cmd("rm -rf xml");
|
||||
cmd("cp -r ../lvgl/docs/api_doc/xml .");
|
||||
cmd("git add xml");
|
||||
|
||||
cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + ver_str + "'/\" conf.py")
|
||||
|
||||
cmd('git commit -am "prepare to release ' + ver_str + '"')
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def blog_add_post():
|
||||
global ver_str, release_note
|
||||
|
||||
os.chdir("./blog/_posts")
|
||||
|
||||
post = "---\nlayout: post\ntitle: " + ver_str + " is released\nauthor: \"kisvegabor\"\ncover: /assets/release_cover.png\n---\n\n"
|
||||
post += release_note
|
||||
|
||||
today = date.today()
|
||||
d = today.strftime("%Y-%m-%d")
|
||||
|
||||
f = open(d + "-release_" + ver_str + ".md", "w")
|
||||
f.write(post)
|
||||
f.close()
|
||||
|
||||
cmd("git add .")
|
||||
cmd("git commit -am 'Add " + ver_str + " release post'")
|
||||
|
||||
os.chdir("../../")
|
||||
|
||||
def add_tags():
|
||||
global ver_str
|
||||
tag_cmd = " git tag -a " + ver_str + " -m 'Release " + ver_str + "' "
|
||||
cmd("cd lvgl; " + tag_cmd)
|
||||
cmd("cd lv_examples; " + tag_cmd)
|
||||
cmd("cd lv_drivers; " + tag_cmd)
|
||||
cmd("cd docs; " + tag_cmd)
|
||||
|
||||
def update_release_branches():
|
||||
global release_br
|
||||
merge_cmd = " git checkout " + release_br + "; git pull origin " + release_br + "; git merge master -X ours; git push origin " + release_br + "; git checkout master"
|
||||
cmd("cd lvgl; " + merge_cmd)
|
||||
cmd("cd lv_examples; " + merge_cmd)
|
||||
cmd("cd lv_drivers; " + merge_cmd)
|
||||
|
||||
merge_cmd = " git checkout " + release_br + "; git pull origin " + release_br + "; git merge latest -X ours; git push origin " + release_br + "; git checkout latest"
|
||||
cmd("cd docs; " + merge_cmd)
|
||||
|
||||
def publish_master():
|
||||
|
||||
#Merge LVGL master to dev first to avoid "merge-to-dev.yml" running asynchronous
|
||||
os.chdir("./lvgl")
|
||||
cmd("git checkout dev")
|
||||
cmd("git merge master -X theirs")
|
||||
cmd("git add .")
|
||||
cmd("git commit -am 'Merge master'")
|
||||
cmd("git push origin dev")
|
||||
cmd("git checkout master")
|
||||
os.chdir("../")
|
||||
|
||||
pub_cmd = "git push origin master; git push origin " + ver_str
|
||||
cmd("cd lvgl; " + pub_cmd)
|
||||
cmd("cd lv_examples; " + pub_cmd)
|
||||
cmd("cd lv_drivers; " + pub_cmd)
|
||||
|
||||
pub_cmd = "git push origin latest; git push origin " + ver_str
|
||||
cmd("cd docs; " + pub_cmd)
|
||||
cmd("cd docs; git checkout master; ./update.py " + release_br)
|
||||
|
||||
pub_cmd = "git push origin master"
|
||||
cmd("cd blog; " + pub_cmd)
|
||||
|
||||
|
||||
def merge_to_dev():
|
||||
merge_cmd = "git checkout dev; git pull origin dev; git merge master -X ours; git checkout master"
|
||||
cmd("cd lvgl; " + merge_cmd)
|
||||
|
||||
merge_cmd = "git checkout dev --; git pull origin dev; git merge latest -X ours; git checkout master"
|
||||
cmd("cd docs; " + merge_cmd)
|
||||
|
||||
|
||||
def merge_from_dev():
|
||||
merge_cmd = "git checkout master; git merge dev;"
|
||||
cmd("cd lvgl; " + merge_cmd)
|
||||
|
||||
merge_cmd = "git checkout latest -- ; git merge dev;"
|
||||
cmd("cd docs; " + merge_cmd)
|
||||
|
||||
|
||||
def lvgl_update_master_version():
|
||||
global ver_major, ver_minor, ver_patch, ver_str
|
||||
|
||||
os.chdir("./lvgl")
|
||||
|
||||
cmd("git checkout master")
|
||||
define_set("./lvgl.h", "LVGL_VERSION_MAJOR", ver_major)
|
||||
define_set("./lvgl.h", "LVGL_VERSION_MINOR", ver_minor)
|
||||
define_set("./lvgl.h", "LVGL_VERSION_PATCH", ver_patch)
|
||||
define_set("./lvgl.h", "LVGL_VERSION_INFO", "dev")
|
||||
|
||||
templ = fnmatch.filter(os.listdir('.'), '*templ*')
|
||||
if templ[0]:
|
||||
print("Updating version in " + templ[0])
|
||||
cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+.*/"+ ver_str +"/' " + templ[0])
|
||||
|
||||
|
||||
cmd("git commit -am 'Update version'")
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def docs_update_latest_version():
|
||||
global ver_str
|
||||
|
||||
os.chdir("./docs")
|
||||
cmd("git checkout latest --")
|
||||
cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + ver_str + "'/\" conf.py")
|
||||
cmd("git commit -am 'Update version'")
|
||||
cmd("git checkout master --")
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
|
||||
def lvgl_update_dev_version():
|
||||
global ver_major, ver_minor, ver_patch, dev_ver_str
|
||||
|
||||
os.chdir("./lvgl")
|
||||
|
||||
cmd("git checkout dev")
|
||||
define_set("./lvgl.h", "LVGL_VERSION_MAJOR", ver_major)
|
||||
define_set("./lvgl.h", "LVGL_VERSION_MINOR", ver_minor)
|
||||
define_set("./lvgl.h", "LVGL_VERSION_PATCH", ver_patch)
|
||||
define_set("./lvgl.h", "LVGL_VERSION_INFO", "\"dev\"")
|
||||
|
||||
templ = fnmatch.filter(os.listdir('.'), '*templ*')
|
||||
if templ[0]:
|
||||
print("Updating version in " + templ[0])
|
||||
cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+.*/"+ dev_ver_str +"/' " + templ[0])
|
||||
|
||||
|
||||
cmd("git commit -am 'Update dev version'")
|
||||
cmd("git checkout master")
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def docs_update_dev_version():
|
||||
global dev_ver_str
|
||||
|
||||
os.chdir("./docs")
|
||||
cmd("git checkout dev --")
|
||||
cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + dev_ver_str + "'/\" conf.py")
|
||||
cmd("git commit -am 'Update dev version'")
|
||||
cmd("git checkout master --")
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
|
||||
def publish_dev_and_master():
|
||||
pub_cmd = "git checkout dev; git push origin dev"
|
||||
cmd("cd lvgl; " + pub_cmd)
|
||||
pub_cmd = "git checkout master; git push origin master"
|
||||
cmd("cd lvgl; " + pub_cmd)
|
||||
|
||||
cmd("cd docs; git checkout master; ./update.py latest dev")
|
||||
|
||||
def projs_update():
|
||||
global proj_list, release_br, ver_str
|
||||
for p in proj_list:
|
||||
os.chdir("./" + p)
|
||||
cmd('git checkout master')
|
||||
print(p + ": upadte lvgl");
|
||||
cmd("cd lvgl; git co " + release_br + "; git pull origin " + release_br)
|
||||
cmd("cp -f lvgl/lv_conf_template.h lv_conf.h")
|
||||
cmd("sed -i -r 's/#if 0/#if 1/' lv_conf.h") # Enable lv_conf.h
|
||||
d = {}
|
||||
with open("confdef.txt") as f:
|
||||
for line in f:
|
||||
(key, val) = line.rstrip().split('\t')
|
||||
d[key] = val
|
||||
|
||||
for k,v in d.items():
|
||||
define_set("lv_conf.h", str(k), str(v))
|
||||
|
||||
if os.path.exists("lv_examples"):
|
||||
print(p + ": upadte lv_examples");
|
||||
cmd("cd lv_examples; git co " + release_br + "; git pull origin " + release_br)
|
||||
|
||||
if os.path.exists("lv_drivers"):
|
||||
print(p + ": upadte lv_drivers");
|
||||
cmd("cd lv_drivers " + release_br + "; git pull origin " + release_br)
|
||||
|
||||
msg = 'Update to ' + ver_str
|
||||
cmd("git add .")
|
||||
cmd('git commit -am "' + msg + '"')
|
||||
cmd('git push origin master')
|
||||
cmd("git tag -a " + ver_str + " -m '" + msg + "' " )
|
||||
cmd('git push origin ' + ver_str)
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
|
||||
def cleanup():
|
||||
os.chdir("../")
|
||||
cmd("rm -fr " + workdir)
|
||||
|
||||
if __name__ == '__main__':
|
||||
dev_prepare = 'minor'
|
||||
if(len(sys.argv) != 2):
|
||||
print("Missing argument. Usage ./release.py bugfix | minor | major")
|
||||
print("Use minor by deafult")
|
||||
else:
|
||||
dev_prepare = sys.argv[1]
|
||||
|
||||
if not (dev_prepare in prepare_type):
|
||||
print("Invalid argument. Usage ./release.py bugfix | minor | major")
|
||||
exit(1)
|
||||
|
||||
clone_repos()
|
||||
get_lvgl_version("master")
|
||||
lvgl_prepare()
|
||||
lv_examples_prepare()
|
||||
lv_drivers_prepare()
|
||||
docs_prepare()
|
||||
blog_add_post()
|
||||
add_tags()
|
||||
update_release_branches()
|
||||
publish_master()
|
||||
|
||||
if dev_prepare == 'bugfix':
|
||||
ver_patch = str(int(ver_patch) + 1)
|
||||
ver_str = "v" + ver_major + "." + ver_minor + "." + ver_patch + "-dev"
|
||||
|
||||
print("Prepare bugfix version " + ver_str)
|
||||
|
||||
lvgl_update_master_version()
|
||||
docs_update_latest_version()
|
||||
|
||||
get_lvgl_version("dev")
|
||||
dev_ver_str = "v" + ver_major + "." + ver_minor + "." + ver_patch + "-dev"
|
||||
merge_to_dev()
|
||||
|
||||
lvgl_update_dev_version()
|
||||
docs_update_dev_version()
|
||||
publish_dev()
|
||||
else:
|
||||
get_lvgl_version("dev")
|
||||
if dev_prepare == 'minor':
|
||||
ver_minor = str(int(ver_minor) + 1)
|
||||
ver_patch = "0"
|
||||
else:
|
||||
ver_major = str(int(ver_major) + 1)
|
||||
ver_minor = "0"
|
||||
ver_patch = "0"
|
||||
|
||||
dev_ver_str = "v" + ver_major + "." + ver_minor + "." + ver_patch + "-dev"
|
||||
|
||||
print("Prepare minor version " + ver_str)
|
||||
|
||||
merge_to_dev()
|
||||
merge_from_dev()
|
||||
|
||||
lvgl_update_dev_version()
|
||||
docs_update_dev_version()
|
||||
publish_dev_and_master()
|
||||
|
||||
projs_update()
|
||||
cleanup()
|
||||
|
||||
110
scripts/release/com.py
Executable file
110
scripts/release/com.py
Executable file
@@ -0,0 +1,110 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import os.path
|
||||
from os import path
|
||||
import os, fnmatch
|
||||
import re
|
||||
import subprocess
|
||||
import com
|
||||
|
||||
def cmd(c, ask_on_err = True):
|
||||
print("\n" + c)
|
||||
r = os.system(c)
|
||||
if r:
|
||||
print("### Error: " + str(r))
|
||||
if ask_on_err:
|
||||
input("Press Enter to continue execution...")
|
||||
|
||||
def define_set(fn, name, value):
|
||||
print("In " + fn + " set " + name + " to " + value)
|
||||
|
||||
new_content = ""
|
||||
s = r'^ *# *define +' + str(name).rstrip() + ' +'
|
||||
|
||||
f = open(fn, "r")
|
||||
for i in f.read().splitlines():
|
||||
r = re.search(s, i)
|
||||
if r:
|
||||
d = i.split("define")
|
||||
i = d[0] + "define " + name + " " + value
|
||||
new_content += i + '\n'
|
||||
|
||||
f.close()
|
||||
|
||||
f = open(fn, "w")
|
||||
f.write(new_content)
|
||||
f.close()
|
||||
|
||||
def ver_format(ver):
|
||||
s = "v" + str(ver[0]) + "." + str(ver[1]) + "." + str(ver[2])
|
||||
if(ver[3] != ""): s = s + "-" + ver[3]
|
||||
return s
|
||||
|
||||
def get_lvgl_version(br):
|
||||
print("Get LVGL's version")
|
||||
|
||||
ver = [0, 0, 0, ""]
|
||||
|
||||
os.chdir("./lvgl")
|
||||
|
||||
com.cmd("git checkout " + br)
|
||||
|
||||
f = open("./lvgl.h", "r")
|
||||
|
||||
lastNum = re.compile(r'(?:[^\d]*(\d+)[^\d]*)+')
|
||||
for i in f.read().splitlines():
|
||||
r = re.search(r'^#define LVGL_VERSION_MAJOR ', i)
|
||||
if r:
|
||||
m = lastNum.search(i)
|
||||
if m: ver[0] = m.group(1)
|
||||
|
||||
r = re.search(r'^#define LVGL_VERSION_MINOR ', i)
|
||||
if r:
|
||||
m = lastNum.search(i)
|
||||
if m: ver[1] = m.group(1)
|
||||
|
||||
r = re.search(r'^#define LVGL_VERSION_PATCH ', i)
|
||||
if r:
|
||||
m = lastNum.search(i)
|
||||
if m: ver[2] = m.group(1)
|
||||
|
||||
f.close()
|
||||
|
||||
com.cmd("git checkout master")
|
||||
|
||||
os.chdir("../")
|
||||
return ver
|
||||
|
||||
def push(c):
|
||||
cmd("git push " + c)
|
||||
|
||||
def update_version(ver):
|
||||
ver_str = ver_format(ver)
|
||||
ver_num = ver[0] + "." + ver[1] + "." + ver[2]
|
||||
|
||||
templ = fnmatch.filter(os.listdir('.'), '*_templ*.h')
|
||||
|
||||
if len(templ) > 0 and templ[0]:
|
||||
print("Updating version in " + templ[0])
|
||||
cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+.*/"+ "v" + ver_num + "/' " + templ[0])
|
||||
|
||||
if os.path.exists("library.json"):
|
||||
print("Updating version in library.json")
|
||||
cmd("sed -i -r 's/[0-9]+\.[0-9]+\.[0-9]+/"+ ver_num +"/' library.json")
|
||||
|
||||
if path.exists("library.properties"):
|
||||
print("Updating version in library.properties")
|
||||
cmd("sed -i -r 's/version=[0-9]+\.[0-9]+\.[0-9]+/"+ "version=" + ver_num + "/' library.properties")
|
||||
|
||||
if path.exists("conf.py"):
|
||||
cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + ver_str + "'/\" conf.py")
|
||||
|
||||
if path.exists("Kconfig"):
|
||||
cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + ver_str + "'/\" Kconfig")
|
||||
|
||||
if path.exists("lvgl.h"):
|
||||
define_set("./lvgl.h", "LVGL_VERSION_MAJOR", str(ver[0]))
|
||||
define_set("./lvgl.h", "LVGL_VERSION_MINOR", str(ver[1]))
|
||||
define_set("./lvgl.h", "LVGL_VERSION_PATCH", str(ver[2]))
|
||||
define_set("./lvgl.h", "LVGL_VERSION_INFO", "\"" + ver[3] + "\"")
|
||||
72
scripts/release/dev.py
Executable file
72
scripts/release/dev.py
Executable file
@@ -0,0 +1,72 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import re
|
||||
import os, fnmatch
|
||||
import os.path
|
||||
from os import path
|
||||
from datetime import date
|
||||
import com
|
||||
|
||||
def lvgl_update_ver(ver, br):
|
||||
os.chdir("./lvgl")
|
||||
|
||||
com.cmd("git checkout " + br)
|
||||
com.update_version(ver)
|
||||
com.cmd("git commit -am 'Update " + br + " version'")
|
||||
com.push("origin " + br)
|
||||
com.cmd("git checkout master")
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def docs_update_ver(ver, br):
|
||||
os.chdir("./docs")
|
||||
com.cmd("git checkout " + br + " --")
|
||||
com.update_version(ver)
|
||||
com.cmd("git commit -am 'Update " + br + " version'")
|
||||
com.push("origin " + br)
|
||||
com.cmd("git checkout master --")
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def merge_dev_to_master():
|
||||
os.chdir("./lvgl")
|
||||
com.cmd("git checkout master")
|
||||
com.cmd("git merge dev")
|
||||
com.push("origin master")
|
||||
os.chdir("../")
|
||||
|
||||
os.chdir("./docs")
|
||||
com.cmd("git checkout dev -- ") #'dev' sometimes is not recognized so switch to it first
|
||||
com.cmd("git checkout latest --")
|
||||
com.cmd("git merge dev -X theirs --no-edit;")
|
||||
com.push("origin latest")
|
||||
os.chdir("../")
|
||||
|
||||
def make(mode):
|
||||
if(mode == "bugfix"):
|
||||
ver = com.get_lvgl_version("master")
|
||||
ver[3] = "dev"
|
||||
ver[2] = str(int(ver[2]) + 1)
|
||||
lvgl_update_ver(ver, "master")
|
||||
docs_update_ver(ver, "latest")
|
||||
else:
|
||||
ver = com.get_lvgl_version("dev")
|
||||
ver[3] = "dev"
|
||||
merge_dev_to_master()
|
||||
if(mode == "major"):
|
||||
ver[0] = str(int(ver[0]) + 1)
|
||||
ver[1] = '0'
|
||||
ver[2] = '0'
|
||||
if(mode == "minor"):
|
||||
ver[1] = str(int(ver[1]) + 1)
|
||||
ver[2] = '0'
|
||||
|
||||
lvgl_update_ver(ver, "dev")
|
||||
docs_update_ver(ver, "dev")
|
||||
|
||||
if __name__ == '__main__':
|
||||
if(len(sys.argv) != 2):
|
||||
print("Missing argument. Usage ./dev.py major | minor | bugfix")
|
||||
print("E.g. ./dev.py minor")
|
||||
else:
|
||||
make(sys.argv[1])
|
||||
65
scripts/release/main.py
Executable file
65
scripts/release/main.py
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os.path
|
||||
from os import path
|
||||
from datetime import date
|
||||
import sys
|
||||
import com
|
||||
import release
|
||||
import dev
|
||||
import proj
|
||||
|
||||
upstream_org_url = "https://github.com/lvgl/"
|
||||
workdir = "./release_tmp"
|
||||
proj_list = [ "lv_sim_eclipse_sdl", "lv_sim_emscripten"]
|
||||
|
||||
def upstream(repo):
|
||||
return upstream_org_url + repo + ".git"
|
||||
|
||||
def clone(repo):
|
||||
com.cmd("git clone --recurse-submodules " + upstream(repo))
|
||||
os.chdir("./" + repo)
|
||||
com.cmd("git checkout master")
|
||||
com.cmd("git remote update origin --prune")
|
||||
com.cmd("git pull origin --tags")
|
||||
os.chdir("..")
|
||||
|
||||
def clone_repos():
|
||||
com.cmd("rm -fr " + workdir)
|
||||
com.cmd("mkdir " + workdir)
|
||||
os.chdir(workdir)
|
||||
clone("lvgl")
|
||||
clone("lv_examples")
|
||||
clone("lv_drivers")
|
||||
clone("docs")
|
||||
clone("blog")
|
||||
|
||||
for p in proj_list:
|
||||
clone(p)
|
||||
|
||||
def cleanup():
|
||||
os.chdir("../")
|
||||
com.cmd("rm -fr " + workdir)
|
||||
|
||||
if __name__ == '__main__':
|
||||
prepare_type = ['major', 'minor', 'bugfix']
|
||||
dev_prepare = 'minor'
|
||||
|
||||
# if(len(sys.argv) != 2):
|
||||
# print("Missing argument. Usage ./release.py bugfix | minor | major")
|
||||
# print("Use minor by default")
|
||||
# else:
|
||||
# dev_prepare = sys.argv[1]
|
||||
|
||||
if not (dev_prepare in prepare_type):
|
||||
print("Invalid argument. Usage ./release.py bugfix | minor | major")
|
||||
exit(1)
|
||||
|
||||
#os.chdir(workdir)
|
||||
clone_repos()
|
||||
release.make()
|
||||
for p in proj_list:
|
||||
proj.make(p, True)
|
||||
|
||||
dev.make(dev_prepare)
|
||||
#cleanup()
|
||||
62
scripts/release/proj.py
Executable file
62
scripts/release/proj.py
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import os.path
|
||||
from os import path
|
||||
import re
|
||||
import subprocess
|
||||
import com
|
||||
|
||||
def make(repo_path, auto_push = False):
|
||||
os.chdir("./" + repo_path)
|
||||
com.cmd('git checkout master')
|
||||
print("Update lvgl");
|
||||
os.chdir("./lvgl")
|
||||
com.cmd("git checkout master")
|
||||
com.cmd("git pull origin --tags")
|
||||
|
||||
out = subprocess.Popen(['git', 'tag', '--sort=-creatordate'],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT)
|
||||
stdout,stderr = out.communicate()
|
||||
|
||||
ver_str = stdout.decode("utf-8").split('\n')[0]
|
||||
release_br = ver_str[1:] #trim "v"
|
||||
release_br = release_br.split('.')[0] # get the first number
|
||||
release_br = "release/v" + release_br
|
||||
|
||||
com.cmd("git checkout " + release_br + "; git pull origin " + release_br)
|
||||
|
||||
os.chdir("..")
|
||||
|
||||
com.cmd("cp -f lvgl/lv_conf_template.h lv_conf.h")
|
||||
com.cmd("sed -i -r 's/#if 0/#if 1/' lv_conf.h") # Enable lv_conf.h
|
||||
with open("confdef.txt") as f:
|
||||
for line in f:
|
||||
(key, val) = line.rstrip().split('\t')
|
||||
com.define_set("lv_conf.h", str(key), str(val))
|
||||
|
||||
if os.path.exists("lv_examples"):
|
||||
print("Update lv_examples");
|
||||
com.cmd("cd lv_examples; git co " + release_br + "; git pull origin " + release_br)
|
||||
|
||||
if os.path.exists("lv_drivers"):
|
||||
print("update lv_drivers");
|
||||
com.cmd("cd lv_drivers " + release_br + "; git pull origin " + release_br)
|
||||
|
||||
msg = 'Update to ' + ver_str
|
||||
com.cmd("git add .")
|
||||
com.cmd('git commit -am "' + msg + '"')
|
||||
com.cmd("git tag -a " + ver_str + " -m '" + msg + "' " )
|
||||
if auto_push:
|
||||
com.push("origin --tags")
|
||||
com.push("origin master")
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
if __name__ == '__main__':
|
||||
if(len(sys.argv) != 2):
|
||||
print("Missing argument. Usage ./projs_update.py repo_path")
|
||||
print("E.g. ./projs_update.py ./lv_sim_eclipse_sdl")
|
||||
else:
|
||||
make(sys.argv[1], sys.argv[2])
|
||||
173
scripts/release/release.py
Executable file
173
scripts/release/release.py
Executable file
@@ -0,0 +1,173 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os.path
|
||||
from os import path
|
||||
from datetime import date
|
||||
import sys
|
||||
import com
|
||||
import re
|
||||
|
||||
def update_release_branch(release_br, master_br = "master"):
|
||||
com.cmd("git checkout " + release_br)
|
||||
com.cmd("git pull origin " + release_br)
|
||||
com.cmd("git merge "+ master_br +" -X ours");
|
||||
com.push("origin " + release_br);
|
||||
com.cmd("git checkout master");
|
||||
|
||||
def lvgl_release(ver):
|
||||
print("Release lvgl")
|
||||
|
||||
ver_str = com.ver_format(ver)
|
||||
release_br = "release/v" + str(ver[0])
|
||||
|
||||
os.chdir("./lvgl")
|
||||
com.define_set("./lvgl.h", "LVGL_VERSION_INFO", '\"\"')
|
||||
|
||||
# Run some scripts
|
||||
os.chdir("./scripts")
|
||||
com.cmd("./code-format.sh")
|
||||
com.cmd("./lv_conf_checker.py")
|
||||
com.cmd("doxygen")
|
||||
os.chdir("../")
|
||||
|
||||
com.update_version(ver)
|
||||
|
||||
#update CHANGLELOG
|
||||
new_content = ""
|
||||
f = open("./CHANGELOG.md", "r")
|
||||
|
||||
release_note = ""
|
||||
note_state = 0
|
||||
for i in f.read().splitlines():
|
||||
if note_state == 0:
|
||||
r = re.search(r'^## ' + ver_str, i)
|
||||
if r:
|
||||
i = i.replace("planned on ", "")
|
||||
note_state+=1
|
||||
|
||||
elif note_state == 1:
|
||||
r = re.search(r'^## ', i)
|
||||
if r:
|
||||
note_state+=1
|
||||
else:
|
||||
release_note += i + '\n'
|
||||
|
||||
new_content += i + '\n'
|
||||
|
||||
f.close()
|
||||
|
||||
f = open("./CHANGELOG.md", "w")
|
||||
f.write(new_content)
|
||||
f.close()
|
||||
|
||||
com.cmd('git commit -am "Release ' + ver_str + '"')
|
||||
|
||||
com.cmd('git checkout dev')
|
||||
com.cmd("git merge master -X ours")
|
||||
com.cmd("git add .")
|
||||
com.cmd("git commit -am 'Merge master'", False)
|
||||
com.push('origin dev')
|
||||
com.cmd('git checkout master')
|
||||
com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ")
|
||||
com.push('origin master')
|
||||
com.push('origin --tags')
|
||||
|
||||
update_release_branch(release_br)
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
return release_note
|
||||
|
||||
def lv_examples_release(ver):
|
||||
print("Release lv_examples")
|
||||
|
||||
os.chdir("./lv_examples")
|
||||
release_br = "release/v" + str(ver[0])
|
||||
ver_str = com.ver_format(ver)
|
||||
|
||||
com.update_version(ver)
|
||||
|
||||
com.cmd("sed -i -r 's/LV_VERSION_CHECK\([0-9]+, *[0-9]+, *[0-9]+\)/"+ "LV_VERSION_CHECK\(" + str(ver[0]) + ", " + str(ver[1]) + ", " + str(ver[2]) + ")/' lv_examples.h")
|
||||
|
||||
com.cmd('git commit -am "Release ' + ver_str + '"')
|
||||
com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ")
|
||||
com.push('origin master')
|
||||
com.push('origin --tags')
|
||||
|
||||
update_release_branch(release_br)
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def lv_drivers_release(ver):
|
||||
print("Release lv_drivers")
|
||||
|
||||
os.chdir("./lv_drivers")
|
||||
release_br = "release/v" + str(ver[0])
|
||||
ver_str = com.ver_format(ver)
|
||||
|
||||
com.update_version(ver)
|
||||
|
||||
com.cmd('git commit -am "Release ' + ver_str + '"')
|
||||
com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ")
|
||||
com.push('origin master')
|
||||
com.push('origin --tags')
|
||||
|
||||
update_release_branch(release_br)
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def docs_release(ver):
|
||||
print("Release docs")
|
||||
|
||||
os.chdir("./docs")
|
||||
release_br = "release/v" + str(ver[0])
|
||||
ver_str = com.ver_format(ver)
|
||||
|
||||
com.cmd("git co latest --")
|
||||
com.cmd("rm -rf xml");
|
||||
com.cmd("cp -r ../lvgl/docs/api_doc/xml .");
|
||||
com.cmd("git add xml");
|
||||
|
||||
com.update_version(ver)
|
||||
|
||||
com.cmd('git commit -am "Release ' + ver_str + '"')
|
||||
com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ")
|
||||
com.push('origin master')
|
||||
com.push('origin --tags')
|
||||
|
||||
update_release_branch(release_br, "latest")
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def blog_release(ver, release_note):
|
||||
|
||||
os.chdir("./blog/_posts")
|
||||
|
||||
ver_str = com.ver_format(ver)
|
||||
|
||||
post = "---\nlayout: post\ntitle: " + ver_str + " is released\nauthor: \"kisvegabor\"\ncover: /assets/release_cover.png\n---\n\n"
|
||||
post += release_note
|
||||
|
||||
today = date.today()
|
||||
d = today.strftime("%Y-%m-%d")
|
||||
|
||||
f = open(d + "-release_" + ver_str + ".md", "w")
|
||||
f.write(post)
|
||||
f.close()
|
||||
|
||||
com.cmd("git add .")
|
||||
com.cmd("git commit -am 'Add " + ver_str + " release post'")
|
||||
com.push('origin master')
|
||||
|
||||
os.chdir("../../")
|
||||
|
||||
def make():
|
||||
ver = com.get_lvgl_version("master")
|
||||
release_note = lvgl_release(ver)
|
||||
lv_examples_release(ver)
|
||||
lv_drivers_release(ver)
|
||||
docs_release(ver)
|
||||
blog_release(ver, release_note)
|
||||
|
||||
if __name__ == '__main__':
|
||||
make()
|
||||
@@ -49,7 +49,6 @@ static inline void lv_task_once(lv_task_t * task)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if LV_USE_DROPDOWN
|
||||
|
||||
static inline void lv_dropdown_set_draw_arrow(lv_obj_t * ddlist, bool en)
|
||||
@@ -145,10 +144,8 @@ static inline void lv_roller_set_fix_width(lv_obj_t * roller, lv_coord_t w)
|
||||
lv_obj_set_width(roller, w);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if LV_USE_PAGE
|
||||
#define lv_scrlbar_mode_t lv_scrollbar_mode_t
|
||||
|
||||
@@ -159,7 +156,6 @@ static inline void lv_roller_set_fix_width(lv_obj_t * roller, lv_coord_t w)
|
||||
#define LV_SCRLBAR_MODE_HIDE LV_SCROLLBAR_MODE_HIDE
|
||||
#define LV_SCRLBAR_MODE_UNHIDE LV_SCROLLBAR_MODE_UNHIDE
|
||||
|
||||
|
||||
static inline void lv_page_set_scrlbar_mode(lv_obj_t * page, lv_scrlbar_mode_t sb_mode)
|
||||
{
|
||||
lv_page_set_scrollbar_mode(page, sb_mode);
|
||||
@@ -169,23 +165,23 @@ static inline lv_scrollbar_mode_t lv_page_get_scrlbar_mode(lv_obj_t * page)
|
||||
return lv_page_get_scrollbar_mode(page);
|
||||
}
|
||||
|
||||
|
||||
static inline lv_obj_t * lv_page_get_scrl(lv_obj_t * page)
|
||||
{
|
||||
return lv_page_get_scrollable(page);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /*LV_USE_API_EXTENSION_V6*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*---------------------
|
||||
* V7.0 COMPATIBILITY
|
||||
*--------------------*/
|
||||
#if LV_USE_API_EXTENSION_V7
|
||||
|
||||
#if LV_USE_ROLLER
|
||||
#define LV_ROLLER_MODE_INIFINITE LV_ROLLER_MODE_INFINITE
|
||||
#endif
|
||||
|
||||
#if LV_USE_WIN
|
||||
|
||||
static inline lv_obj_t * lv_win_add_btn(lv_obj_t * win, const void * img_src)
|
||||
@@ -201,7 +197,6 @@ static inline void lv_chart_set_range(lv_obj_t * chart, lv_coord_t ymin, lv_coor
|
||||
lv_chart_set_y_range(chart, LV_CHART_AXIS_PRIMARY_Y, ymin, ymax);
|
||||
}
|
||||
|
||||
|
||||
static inline void lv_chart_clear_serie(lv_obj_t * chart, lv_chart_series_t * series)
|
||||
{
|
||||
lv_chart_clear_series(chart, series);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
420
src/lv_conf_kconfig.h
Normal file
420
src/lv_conf_kconfig.h
Normal file
@@ -0,0 +1,420 @@
|
||||
/**
|
||||
* @file lv_conf_kconfig.h
|
||||
* Configs that needs special handling when LVGL is used with Kconfig
|
||||
*/
|
||||
|
||||
#ifndef LV_CONF_KCONFIG_H
|
||||
#define LV_CONF_KCONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef LV_CONF_KCONFIG_EXTERNAL_INCLUDE
|
||||
# include LV_CONF_KCONFIG_EXTERNAL_INCLUDE
|
||||
#else
|
||||
|
||||
# if defined ESP_PLATFORM
|
||||
# include "sdkconfig.h"
|
||||
# include "esp_attr.h"
|
||||
# endif
|
||||
|
||||
# ifdef __NuttX__
|
||||
# include <nuttx/config.h>
|
||||
# endif
|
||||
|
||||
#endif /*LV_CONF_KCONFIG_EXTERNAL_INCLUDE*/
|
||||
|
||||
/*******************
|
||||
* LV_MEM_SIZE
|
||||
*******************/
|
||||
|
||||
#ifndef LV_MEM_SIZE
|
||||
#if defined (CONFIG_LV_MEM_SIZE_KILOBYTES)
|
||||
#define CONFIG_LV_MEM_SIZE (CONFIG_LV_MEM_SIZE_KILOBYTES * 1024U)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*******************
|
||||
* LV COLOR TRANSP
|
||||
*******************/
|
||||
|
||||
#ifndef LV_COLOR_TRANSP
|
||||
#if defined (CONFIG_LV_COLOR_TRANSP_HEX)
|
||||
#define CONFIG_LV_COLOR_TRANSP lv_color_hex(CONFIG_LV_COLOR_TRANSP_HEX)
|
||||
#else
|
||||
#define CONFIG_LV_COLOR_TRANSP LV_COLOR_LIME
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*******************
|
||||
* THEME SELECTION
|
||||
*******************/
|
||||
|
||||
#ifndef LV_THEME_DEFAULT_INIT
|
||||
#if defined (CONFIG_LV_THEME_DEFAULT_INIT_EMPTY)
|
||||
#define CONFIG_LV_THEME_DEFAULT_INIT lv_theme_empty_init
|
||||
#elif defined (CONFIG_LV_THEME_DEFAULT_INIT_TEMPLATE)
|
||||
#define CONFIG_LV_THEME_DEFAULT_INIT lv_theme_template_init
|
||||
#elif defined (CONFIG_LV_THEME_DEFAULT_INIT_MATERIAL)
|
||||
#define CONFIG_LV_THEME_DEFAULT_INIT lv_theme_material_init
|
||||
#elif defined (CONFIG_LV_THEME_DEFAULT_INIT_MONO)
|
||||
#define LV_THEME_DEFAULT_INIT lv_theme_mono_init
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*******************
|
||||
* COLOR SELECTION
|
||||
*******************/
|
||||
|
||||
#ifndef LV_THEME_DEFAULT_COLOR_PRIMARY
|
||||
#ifdef CONFIG_LV_THEME_DEFAULT_COLOR_PRIMARY
|
||||
#define LV_THEME_DEFAULT_COLOR_PRIMARY lv_color_hex(CONFIG_LV_THEME_DEFAULT_COLOR_PRIMARY)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef LV_THEME_DEFAULT_COLOR_SECONDARY
|
||||
#ifdef CONFIG_LV_THEME_DEFAULT_COLOR_SECONDARY
|
||||
#define LV_THEME_DEFAULT_COLOR_SECONDARY lv_color_hex(CONFIG_LV_THEME_DEFAULT_COLOR_SECONDARY)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/********************
|
||||
* FONT SELECTION
|
||||
*******************/
|
||||
|
||||
/* NOTE: In Kconfig instead of `LV_THEME_DEFAULT_FONT_SMALL`
|
||||
* `CONFIG_LV_THEME_DEFAULT_FONT_SMALL_<font_name>` is defined
|
||||
* hence the large selection with if-s
|
||||
*/
|
||||
|
||||
/*------------------
|
||||
* SMALL FONT
|
||||
*-----------------*/
|
||||
#ifndef LV_THEME_DEFAULT_FONT_SMALL
|
||||
#if defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_8
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_8
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_10
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_10
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_12
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_12
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_14
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_14
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_16
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_16
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_18
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_18
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_20
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_20
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_22
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_22
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_24
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_24
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_26
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_26
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_28
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_28
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_30
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_30
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_32
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_32
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_34
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_34
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_36
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_36
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_38
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_38
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_40
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_40
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_42
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_42
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_44
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_44
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_46
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_46
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_48
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_48
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_UNSCII_8
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_unscii_8
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_UNSCII_16
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_unscii_16
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT12SUBPX
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_12_subpx
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT28COMPRESSED
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_28_compressed
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_DEJAVU_16_PERSIAN_HEBREW
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_dejavu_16_persian_hebrew
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_SIMSUN_16_CJK
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_simsun_16_cjk
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*------------------
|
||||
* NORMAL FONT
|
||||
*-----------------*/
|
||||
#ifndef LV_THEME_DEFAULT_FONT_NORMAL
|
||||
#if defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_8
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_8
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_10
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_10
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_12
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_12
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_14
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_14
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_16
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_16
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_18
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_18
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_20
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_20
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_22
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_22
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_24
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_24
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_26
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_26
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_28
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_28
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_30
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_30
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_32
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_32
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_34
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_34
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_36
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_36
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_38
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_38
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_40
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_40
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_42
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_42
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_44
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_44
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_46
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_46
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_48
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_48
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_UNSCII_8
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_unscii_8
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_UNSCII_16
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_unscii_16
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT12SUBPX
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_12_subpx
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT28COMPRESSED
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_28_compressed
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_DEJAVU_16_PERSIAN_HEBREW
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_dejavu_16_persian_hebrew
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_SIMSUN_16_CJK
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_simsun_16_cjk
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*------------------
|
||||
* SUBTITLE FONT
|
||||
*-----------------*/
|
||||
#ifndef LV_THEME_DEFAULT_FONT_SUBTITLE
|
||||
#if defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_8
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_8
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_10
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_10
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_12
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_12
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_14
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_14
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_16
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_16
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_18
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_18
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_20
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_20
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_22
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_22
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_24
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_24
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_26
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_26
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_28
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_28
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_30
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_30
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_32
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_32
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_34
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_34
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_36
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_36
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_38
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_38
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_40
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_40
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_42
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_42
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_44
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_44
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_46
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_46
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_48
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_48
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_UNSCII_8
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_unscii_8
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_UNSCII_16
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_unscii_16
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT12SUBPX
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_12_subpx
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT28COMPRESSED
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_28_compressed
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_DEJAVU_16_PERSIAN_HEBREW
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_dejavu_16_persian_hebrew
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_SIMSUN_16_CJK
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_simsun_16_cjk
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*------------------
|
||||
* TITLE FONT
|
||||
*-----------------*/
|
||||
#ifndef LV_THEME_DEFAULT_FONT_TITLE
|
||||
#if defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_8
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_8
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_10
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_10
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_12
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_12
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_14
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_14
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_16
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_16
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_18
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_18
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_20
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_20
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_22
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_22
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_24
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_24
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_26
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_26
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_28
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_28
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_30
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_30
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_32
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_32
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_34
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_34
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_36
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_36
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_38
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_38
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_40
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_40
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_42
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_42
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_44
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_44
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_46
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_46
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_48
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_48
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_UNSCII_8
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_unscii_8
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_UNSCII_16
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_unscii_16
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT12SUBPX
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_12_subpx
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT28COMPRESSED
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_28_compressed
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_DEJAVU_16_PERSIAN_HEBREW
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_dejavu_16_persian_hebrew
|
||||
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_SIMSUN_16_CJK
|
||||
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_simsun_16_cjk
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*------------------
|
||||
* TEXT ENCODING
|
||||
*-----------------*/
|
||||
#ifndef LV_TEXT_ENC
|
||||
#ifdef CONFIG_LV_TXT_ENC_UTF8
|
||||
#define CONFIG_LV_TXT_ENC LV_TXT_ENC_UTF8
|
||||
#elif defined CONFIG_LV_TXT_ENC_ASCII
|
||||
#define CONFIG_LV_TXT_ENC LV_TXT_ENC_ASCII
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*------------------
|
||||
* BIDI DIRECTION
|
||||
*-----------------*/
|
||||
|
||||
#ifndef LV_BIDI_BASE_DIR_DEF
|
||||
#ifdef CONFIG_LV_BIDI_DIR_LTR
|
||||
#define CONFIG_LV_BIDI_BASE_DIR_DEF LV_BIDI_DIR_LTR
|
||||
#elif defined CONFIG_LV_BIDI_DIR_RTL
|
||||
#define CONFIG_LV_BIDI_BASE_DIR_DEF LV_BIDI_DIR_RTL
|
||||
#elif defined CONFIG_LV_BIDI_DIR_AUTO
|
||||
#define CONFIG_LV_BIDI_BASE_DIR_DEF LV_BIDI_DIR_AUTO
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*------------------
|
||||
* EXT CLICK AREA
|
||||
*-----------------*/
|
||||
|
||||
#ifndef LV_USE_EXT_CLICK_AREA
|
||||
#ifdef CONFIG_LV_USE_EXT_CLICK_AREA_OFF
|
||||
#define CONFIG_LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_OFF
|
||||
#elif defined CONFIG_LV_USE_EXT_CLICK_AREA_TINY
|
||||
#define CONFIG_LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_TINY
|
||||
#elif defined CONFIG_LV_USE_EXT_CLICK_AREA_FULL
|
||||
#define CONFIG_LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_FULL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*------------------
|
||||
* LINEMETER PRECISE
|
||||
*-----------------*/
|
||||
|
||||
#ifndef LV_LINEMETER_PRECISE
|
||||
#ifdef CONFIG_LV_LINEMETER_PRECISE_NO_EXTRA_PRECISION
|
||||
#define CONFIG_LV_LINEMETER_PRECISE 0
|
||||
#elif defined CONFIG_LV_LINEMETER_PRECISE_SOME_EXTRA_PRECISION
|
||||
#define CONFIG_LV_LINEMETER_PRECISE 1
|
||||
#elif defined CONFIG_LV_LINEMETER_PRECISE_BEST_PRECISION
|
||||
#define CONFIG_LV_LINEMETER_PRECISE 2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*------------------
|
||||
* SPINNER DEF ANIM
|
||||
*-----------------*/
|
||||
|
||||
#ifndef LV_SPINNER_DEF_ANIM
|
||||
#ifdef CONFIG_LV_SPINNER_TYPE_SPINNING_ARC
|
||||
#define CONFIG_LV_SPINNER_DEF_ANIM LV_SPINNER_TYPE_SPINNING_ARC
|
||||
#elif defined CONFIG_LV_SPINNER_TYPE_FILLSPIN_ARC
|
||||
#define CONFIG_LV_SPINNER_DEF_ANIM LV_SPINNER_TYPE_FILLSPIN_ARC
|
||||
#elif defined CONFIG_LV_SPINNER_TYPE_CONSTANT_ARC
|
||||
#define CONFIG_LV_SPINNER_DEF_ANIM LV_SPINNER_TYPE_CONSTANT_ARC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*------------------
|
||||
* SPRINTF DISABLE FLOAT
|
||||
*-----------------*/
|
||||
|
||||
#if defined(CONFIG_LV_CONF_SKIP) || defined(LV_CONF_SKIP)
|
||||
# ifndef LV_SPRINTF_DISABLE_FLOAT
|
||||
# ifndef CONFIG_LV_SPRINTF_DISABLE_FLOAT
|
||||
# define LV_SPRINTF_DISABLE_FLOAT 0
|
||||
# else
|
||||
# define LV_SPRINTF_DISABLE_FLOAT 1
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_CONF_KCONFIG_H*/
|
||||
@@ -106,7 +106,7 @@ lv_obj_t * lv_disp_get_layer_top(lv_disp_t * disp)
|
||||
/**
|
||||
* Return with the sys. layer. (Same on every screen and it is above the normal screen and the top
|
||||
* layer)
|
||||
* @param disp pointer to display which sys. layer should be get. (NULL to use the default screen)
|
||||
* @param disp pointer to display which sys. layer should be get. (NULL to use the default screen)
|
||||
* @return pointer to the sys layer object (transparent screen sized lv_obj)
|
||||
*/
|
||||
lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp)
|
||||
@@ -120,7 +120,6 @@ lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp)
|
||||
return disp->sys_layer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Assign a screen to a display.
|
||||
* @param disp pointer to a display where to assign the screen
|
||||
@@ -181,7 +180,6 @@ void lv_disp_set_bg_image(lv_disp_t * disp, const void * img_src)
|
||||
_lv_inv_area(disp, &a);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Opacity of the background
|
||||
* @param disp pointer to a display
|
||||
@@ -215,6 +213,19 @@ void lv_disp_set_bg_opa(lv_disp_t * disp, lv_opa_t opa)
|
||||
void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t time, uint32_t delay, bool auto_del)
|
||||
{
|
||||
lv_disp_t * d = lv_obj_get_disp(new_scr);
|
||||
lv_obj_t * act_scr = lv_scr_act();
|
||||
|
||||
if(d->del_prev && act_scr != d->scr_to_load && d->scr_to_load) {
|
||||
lv_obj_del(act_scr);
|
||||
lv_disp_load_scr(d->scr_to_load);
|
||||
lv_anim_del(d->scr_to_load, NULL);
|
||||
lv_obj_set_pos(d->scr_to_load, 0, 0);
|
||||
lv_style_remove_prop(lv_obj_get_local_style(d->scr_to_load, LV_OBJ_PART_MAIN), LV_STYLE_OPA_SCALE);
|
||||
|
||||
act_scr = d->scr_to_load;
|
||||
}
|
||||
|
||||
d->scr_to_load = new_scr;
|
||||
|
||||
if(d->prev_scr && d->del_prev) {
|
||||
lv_obj_del(d->prev_scr);
|
||||
@@ -317,12 +328,6 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t
|
||||
*/
|
||||
uint32_t lv_disp_get_inactive_time(const lv_disp_t * disp)
|
||||
{
|
||||
if(!disp) disp = lv_disp_get_default();
|
||||
if(!disp) {
|
||||
LV_LOG_WARN("lv_disp_get_inactive_time: no display registered");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(disp) return lv_tick_elaps(disp->last_activity_time);
|
||||
|
||||
lv_disp_t * d;
|
||||
@@ -352,6 +357,21 @@ void lv_disp_trig_activity(lv_disp_t * disp)
|
||||
disp->last_activity_time = lv_tick_get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean any CPU cache that is related to the display.
|
||||
* @param disp pointer to an display (NULL to use the default display)
|
||||
*/
|
||||
void lv_disp_clean_dcache(lv_disp_t * disp)
|
||||
{
|
||||
if(!disp) disp = lv_disp_get_default();
|
||||
if(!disp) {
|
||||
LV_LOG_WARN("lv_disp_clean_dcache: no display registered");
|
||||
return;
|
||||
}
|
||||
|
||||
if(disp->driver.clean_dcache_cb)
|
||||
disp->driver.clean_dcache_cb(&disp->driver);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a pointer to the screen refresher task to
|
||||
@@ -388,13 +408,13 @@ static void opa_scale_anim(lv_obj_t * obj, lv_anim_value_t v)
|
||||
lv_obj_set_style_local_opa_scale(obj, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, v);
|
||||
}
|
||||
|
||||
|
||||
static void scr_anim_ready(lv_anim_t * a)
|
||||
{
|
||||
lv_disp_t * d = lv_obj_get_disp(a->var);
|
||||
|
||||
if(d->prev_scr && d->del_prev) lv_obj_del(d->prev_scr);
|
||||
d->prev_scr = NULL;
|
||||
d->scr_to_load = NULL;
|
||||
lv_style_remove_prop(lv_obj_get_local_style(a->var, LV_OBJ_PART_MAIN), LV_STYLE_OPA_SCALE);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -73,7 +73,7 @@ lv_obj_t * lv_disp_get_layer_top(lv_disp_t * disp);
|
||||
/**
|
||||
* Return with the sys. layer. (Same on every screen and it is above the normal screen and the top
|
||||
* layer)
|
||||
* @param disp pointer to display which sys. layer should be get. (NULL to use the default screen)
|
||||
* @param disp pointer to display which sys. layer should be get. (NULL to use the default screen)
|
||||
* @return pointer to the sys layer object (transparent screen sized lv_obj)
|
||||
*/
|
||||
lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp);
|
||||
@@ -85,7 +85,6 @@ lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp);
|
||||
*/
|
||||
void lv_disp_assign_screen(lv_disp_t * disp, lv_obj_t * scr);
|
||||
|
||||
|
||||
/**
|
||||
* Set the background color of a display
|
||||
* @param disp pointer to a display
|
||||
@@ -133,6 +132,12 @@ uint32_t lv_disp_get_inactive_time(const lv_disp_t * disp);
|
||||
*/
|
||||
void lv_disp_trig_activity(lv_disp_t * disp);
|
||||
|
||||
/**
|
||||
* Clean any CPU cache that is related to the display.
|
||||
* @param disp pointer to an display (NULL to use the default display)
|
||||
*/
|
||||
void lv_disp_clean_dcache(lv_disp_t * disp);
|
||||
|
||||
/**
|
||||
* Get a pointer to the screen refresher task to
|
||||
* modify its parameters with `lv_task_...` functions.
|
||||
@@ -156,7 +161,7 @@ static inline lv_obj_t * lv_scr_act(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the top layer of the default display
|
||||
* Get the top layer of the default display
|
||||
* @return pointer to the top layer
|
||||
*/
|
||||
static inline lv_obj_t * lv_layer_top(void)
|
||||
@@ -166,7 +171,7 @@ static inline lv_obj_t * lv_layer_top(void)
|
||||
|
||||
/**
|
||||
* Get the active screen of the default display
|
||||
* @return pointer to the sys layer
|
||||
* @return pointer to the sys layer
|
||||
*/
|
||||
static inline lv_obj_t * lv_layer_sys(void)
|
||||
{
|
||||
@@ -178,7 +183,6 @@ static inline void lv_scr_load(lv_obj_t * scr)
|
||||
lv_disp_load_scr(scr);
|
||||
}
|
||||
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
@@ -202,7 +206,6 @@ static inline void lv_scr_load(lv_obj_t * scr)
|
||||
#define LV_VER_RES lv_disp_get_ver_res(lv_disp_get_default())
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Same as Android's DIP. (Different name is chosen to avoid mistype between LV_DPI and LV_DIP)
|
||||
* 1 dip is 1 px on a 160 DPI screen
|
||||
@@ -220,4 +223,4 @@ static inline lv_coord_t lv_dpx(lv_coord_t n)
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_TEMPL_H*/
|
||||
#endif /*LV_DISP_H*/
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
#include "../lv_themes/lv_theme.h"
|
||||
#include "../lv_misc/lv_gc.h"
|
||||
|
||||
#if defined(LV_GC_INCLUDE)
|
||||
#include LV_GC_INCLUDE
|
||||
#endif /* LV_ENABLE_GC */
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
@@ -85,7 +81,7 @@ lv_group_t * lv_group_create(void)
|
||||
*/
|
||||
void lv_group_del(lv_group_t * group)
|
||||
{
|
||||
/*Defocus the the currently focused object*/
|
||||
/*Defocus the currently focused object*/
|
||||
if(group->obj_focus != NULL) {
|
||||
(*group->obj_focus)->signal_cb(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
|
||||
lv_obj_invalidate(*group->obj_focus);
|
||||
@@ -149,7 +145,6 @@ void lv_group_remove_obj(lv_obj_t * obj)
|
||||
{
|
||||
lv_group_t * g = obj->group_p;
|
||||
if(g == NULL) return;
|
||||
if(g->obj_focus == NULL) return; /*Just to be sure (Not possible if there is at least one object in the group)*/
|
||||
|
||||
/*Focus on the next object*/
|
||||
if(*g->obj_focus == obj) {
|
||||
@@ -190,7 +185,7 @@ void lv_group_remove_obj(lv_obj_t * obj)
|
||||
*/
|
||||
void lv_group_remove_all_objs(lv_group_t * group)
|
||||
{
|
||||
/*Defocus the the currently focused object*/
|
||||
/*Defocus the currently focused object*/
|
||||
if(group->obj_focus != NULL) {
|
||||
(*group->obj_focus)->signal_cb(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
|
||||
lv_obj_invalidate(*group->obj_focus);
|
||||
@@ -218,7 +213,7 @@ void lv_group_focus_obj(lv_obj_t * obj)
|
||||
|
||||
if(g->frozen != 0) return;
|
||||
|
||||
if(obj == *g->obj_focus) return;
|
||||
if(g->obj_focus != NULL && obj == *g->obj_focus) return;
|
||||
|
||||
/*On defocus edit mode must be leaved*/
|
||||
lv_group_set_editing(g, false);
|
||||
@@ -332,9 +327,9 @@ void lv_group_set_editing(lv_group_t * group, bool edit)
|
||||
focused->signal_cb(focused, LV_SIGNAL_FOCUS, NULL); /*Focus again to properly leave/open edit/navigate mode*/
|
||||
lv_res_t res = lv_event_send(*group->obj_focus, LV_EVENT_FOCUSED, NULL);
|
||||
if(res != LV_RES_OK) return;
|
||||
}
|
||||
|
||||
lv_obj_invalidate(focused);
|
||||
lv_obj_invalidate(focused);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -488,8 +483,9 @@ static void focus_next_core(lv_group_t * group, void * (*begin)(const lv_ll_t *)
|
||||
can_move = true;
|
||||
|
||||
if(obj_next == NULL) continue;
|
||||
if(lv_obj_get_state(*obj_next, LV_OBJ_PART_MAIN) & LV_STATE_DISABLED) continue;
|
||||
|
||||
/*Hidden objects don't receive focus*/
|
||||
/*Hidden and disabled objects don't receive focus*/
|
||||
if(!lv_obj_get_hidden(*obj_next)) break;
|
||||
}
|
||||
|
||||
|
||||
@@ -541,7 +541,7 @@ static void indev_keypad_proc(lv_indev_t * i, lv_indev_data_t * data)
|
||||
lv_group_focus_prev(g);
|
||||
if(indev_reset_check(&i->proc)) return;
|
||||
}
|
||||
/*Just send other keys again to the object (e.g. 'A' or `LV_GORUP_KEY_RIGHT)*/
|
||||
/*Just send other keys again to the object (e.g. 'A' or `LV_GROUP_KEY_RIGHT)*/
|
||||
else {
|
||||
lv_group_send_data(g, data->key);
|
||||
if(indev_reset_check(&i->proc)) return;
|
||||
@@ -597,7 +597,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data)
|
||||
}
|
||||
|
||||
/* Save the last keys before anything else.
|
||||
* They need to be already saved if the the function returns for any reason*/
|
||||
* They need to be already saved if the function returns for any reason*/
|
||||
lv_indev_state_t last_state = i->proc.types.keypad.last_state;
|
||||
i->proc.types.keypad.last_state = data->state;
|
||||
i->proc.types.keypad.last_key = data->key;
|
||||
@@ -669,7 +669,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data)
|
||||
/*On enter long press toggle edit mode.*/
|
||||
if(editable) {
|
||||
/*Don't leave edit mode if there is only one object (nowhere to navigate)*/
|
||||
if(_lv_ll_is_empty(&g->obj_ll) == false) {
|
||||
if(_lv_ll_get_len(&g->obj_ll) > 1) {
|
||||
lv_group_set_editing(g, lv_group_get_editing(g) ? false : true); /*Toggle edit mode on long press*/
|
||||
}
|
||||
}
|
||||
@@ -735,7 +735,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data)
|
||||
/*An object is being edited and the button is released. */
|
||||
else if(g->editing) {
|
||||
/*Ignore long pressed enter release because it comes from mode switch*/
|
||||
if(!i->proc.long_pr_sent || _lv_ll_is_empty(&g->obj_ll)) {
|
||||
if(!i->proc.long_pr_sent || _lv_ll_get_len(&g->obj_ll) <= 1) {
|
||||
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_RELEASED, NULL);
|
||||
if(indev_reset_check(&i->proc)) return;
|
||||
|
||||
@@ -803,29 +803,38 @@ static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data)
|
||||
{
|
||||
/* Die gracefully if i->btn_points is NULL */
|
||||
if(i->btn_points == NULL) {
|
||||
LV_LOG_WARN("indev_button_proc: btn_points was NULL");
|
||||
LV_LOG_WARN("indev_button_proc: btn_points was NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
i->proc.types.pointer.act_point.x = i->btn_points[data->btn_id].x;
|
||||
i->proc.types.pointer.act_point.y = i->btn_points[data->btn_id].y;
|
||||
lv_coord_t x = i->btn_points[data->btn_id].x;
|
||||
lv_coord_t y = i->btn_points[data->btn_id].y;
|
||||
|
||||
/*Still the same point is pressed*/
|
||||
if(i->proc.types.pointer.last_point.x == i->proc.types.pointer.act_point.x &&
|
||||
i->proc.types.pointer.last_point.y == i->proc.types.pointer.act_point.y && data->state == LV_INDEV_STATE_PR) {
|
||||
indev_proc_press(&i->proc);
|
||||
}
|
||||
else {
|
||||
/*If a new point comes always make a release*/
|
||||
indev_proc_release(&i->proc);
|
||||
/*If a new point comes always make a release*/
|
||||
if(data->state == LV_INDEV_STATE_PR) {
|
||||
if(i->proc.types.pointer.last_point.x != x ||
|
||||
i->proc.types.pointer.last_point.y != y) {
|
||||
indev_proc_release(&i->proc);
|
||||
}
|
||||
}
|
||||
|
||||
if(indev_reset_check(&i->proc)) return;
|
||||
|
||||
/*Save the new points*/
|
||||
i->proc.types.pointer.act_point.x = x;
|
||||
i->proc.types.pointer.act_point.y = y;
|
||||
|
||||
if(data->state == LV_INDEV_STATE_PR) indev_proc_press(&i->proc);
|
||||
else indev_proc_release(&i->proc);
|
||||
|
||||
if(indev_reset_check(&i->proc)) return;
|
||||
|
||||
i->proc.types.pointer.last_point.x = i->proc.types.pointer.act_point.x;
|
||||
i->proc.types.pointer.last_point.y = i->proc.types.pointer.act_point.y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the pressed state of LV_INDEV_TYPE_POINER input devices
|
||||
* Process the pressed state of LV_INDEV_TYPE_POINTER input devices
|
||||
* @param indev pointer to an input device 'proc'
|
||||
* @return LV_RES_OK: no indev reset required; LV_RES_INV: indev reset is required
|
||||
*/
|
||||
@@ -868,11 +877,6 @@ static void indev_proc_press(lv_indev_proc_t * proc)
|
||||
indev_drag_throw(proc);
|
||||
}
|
||||
|
||||
/*Do not use disabled objects*/
|
||||
if(indev_obj_act && (lv_obj_get_state(indev_obj_act, LV_OBJ_PART_MAIN) & LV_STATE_DISABLED)) {
|
||||
indev_obj_act = proc->types.pointer.act_obj;
|
||||
}
|
||||
|
||||
/*If a new object was found reset some variables and send a pressed signal*/
|
||||
if(indev_obj_act != proc->types.pointer.act_obj) {
|
||||
proc->types.pointer.last_point.x = proc->types.pointer.act_point.x;
|
||||
@@ -1000,7 +1004,7 @@ static void indev_proc_press(lv_indev_proc_t * proc)
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the released state of LV_INDEV_TYPE_POINER input devices
|
||||
* Process the released state of LV_INDEV_TYPE_POINTER input devices
|
||||
* @param proc pointer to an input device 'proc'
|
||||
*/
|
||||
static void indev_proc_release(lv_indev_proc_t * proc)
|
||||
@@ -1144,7 +1148,12 @@ lv_obj_t * lv_indev_search_obj(lv_obj_t * obj, lv_point_t * point)
|
||||
hidden_i = lv_obj_get_parent(hidden_i);
|
||||
}
|
||||
/*No parent found with hidden == true*/
|
||||
if(hidden_i == NULL) found_p = obj;
|
||||
if(lv_obj_is_protected(obj, LV_PROTECT_EVENT_TO_DISABLED) == false) {
|
||||
if(hidden_i == NULL && (lv_obj_get_state(obj, LV_OBJ_PART_MAIN) & LV_STATE_DISABLED) == false) found_p = obj;
|
||||
}
|
||||
else {
|
||||
if(hidden_i == NULL) found_p = obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1162,14 +1171,14 @@ static void indev_click_focus(lv_indev_proc_t * proc)
|
||||
if(lv_obj_is_protected(indev_obj_act, LV_PROTECT_CLICK_FOCUS) == false &&
|
||||
proc->types.pointer.last_pressed != obj_to_focus) {
|
||||
#if LV_USE_GROUP
|
||||
lv_group_t * g_act = lv_obj_get_group(indev_obj_act);
|
||||
lv_group_t * g_act = lv_obj_get_group(obj_to_focus);
|
||||
lv_group_t * g_prev = proc->types.pointer.last_pressed ? lv_obj_get_group(proc->types.pointer.last_pressed) : NULL;
|
||||
|
||||
/*If both the last and act. obj. are in the same group (or no group but it's also the same) */
|
||||
if(g_act == g_prev) {
|
||||
/*The objects are in a group*/
|
||||
if(g_act) {
|
||||
lv_group_focus_obj(indev_obj_act);
|
||||
lv_group_focus_obj(obj_to_focus);
|
||||
if(indev_reset_check(proc)) return;
|
||||
}
|
||||
/*The object are not in group*/
|
||||
@@ -1181,9 +1190,9 @@ static void indev_click_focus(lv_indev_proc_t * proc)
|
||||
if(indev_reset_check(proc)) return;
|
||||
}
|
||||
|
||||
lv_signal_send(indev_obj_act, LV_SIGNAL_FOCUS, NULL);
|
||||
lv_signal_send(obj_to_focus, LV_SIGNAL_FOCUS, NULL);
|
||||
if(indev_reset_check(proc)) return;
|
||||
lv_event_send(indev_obj_act, LV_EVENT_FOCUSED, NULL);
|
||||
lv_event_send(obj_to_focus, LV_EVENT_FOCUSED, NULL);
|
||||
if(indev_reset_check(proc)) return;
|
||||
}
|
||||
}
|
||||
@@ -1218,13 +1227,13 @@ static void indev_click_focus(lv_indev_proc_t * proc)
|
||||
|
||||
/*Focus to the act. in its group*/
|
||||
if(g_act) {
|
||||
lv_group_focus_obj(indev_obj_act);
|
||||
lv_group_focus_obj(obj_to_focus);
|
||||
if(indev_reset_check(proc)) return;
|
||||
}
|
||||
else {
|
||||
lv_signal_send(indev_obj_act, LV_SIGNAL_FOCUS, NULL);
|
||||
lv_signal_send(obj_to_focus, LV_SIGNAL_FOCUS, NULL);
|
||||
if(indev_reset_check(proc)) return;
|
||||
lv_event_send(indev_obj_act, LV_EVENT_FOCUSED, NULL);
|
||||
lv_event_send(obj_to_focus, LV_EVENT_FOCUSED, NULL);
|
||||
if(indev_reset_check(proc)) return;
|
||||
}
|
||||
}
|
||||
@@ -1236,9 +1245,9 @@ static void indev_click_focus(lv_indev_proc_t * proc)
|
||||
if(indev_reset_check(proc)) return;
|
||||
}
|
||||
|
||||
lv_signal_send(indev_obj_act, LV_SIGNAL_FOCUS, NULL);
|
||||
lv_signal_send(obj_to_focus, LV_SIGNAL_FOCUS, NULL);
|
||||
if(indev_reset_check(proc)) return;
|
||||
lv_event_send(indev_obj_act, LV_EVENT_FOCUSED, NULL);
|
||||
lv_event_send(obj_to_focus, LV_EVENT_FOCUSED, NULL);
|
||||
if(indev_reset_check(proc)) return;
|
||||
#endif
|
||||
proc->types.pointer.last_pressed = obj_to_focus;
|
||||
@@ -1259,7 +1268,6 @@ static void indev_drag(lv_indev_proc_t * proc)
|
||||
|
||||
if(lv_obj_get_drag(drag_obj) == false) return;
|
||||
|
||||
|
||||
lv_drag_dir_t allowed_dirs = lv_obj_get_drag_dir(drag_obj);
|
||||
|
||||
/*Count the movement by drag*/
|
||||
@@ -1465,7 +1473,6 @@ static void indev_drag_throw(lv_indev_proc_t * proc)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the really dragged object by taking `drag_parent` into account.
|
||||
* @param obj the start object
|
||||
@@ -1482,7 +1489,6 @@ static lv_obj_t * get_dragged_obj(lv_obj_t * obj)
|
||||
return drag_obj;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handle the gesture of indev_proc_p->types.pointer.act_obj
|
||||
* @param indev pointer to a input device state
|
||||
@@ -1501,7 +1507,6 @@ static void indev_gesture(lv_indev_proc_t * proc)
|
||||
|
||||
if(gesture_obj == NULL) return;
|
||||
|
||||
|
||||
if((LV_MATH_ABS(proc->types.pointer.vect.x) < indev_act->driver.gesture_min_velocity) &&
|
||||
(LV_MATH_ABS(proc->types.pointer.vect.y) < indev_act->driver.gesture_min_velocity)) {
|
||||
proc->types.pointer.gesture_sum.x = 0;
|
||||
@@ -1537,7 +1542,6 @@ static void indev_gesture(lv_indev_proc_t * proc)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the reset_query flag has been set. If so, perform necessary global indev cleanup actions
|
||||
* @param proc pointer to an input device 'proc'
|
||||
|
||||
@@ -149,7 +149,6 @@ lv_res_t lv_indev_finish_drag(lv_indev_t * indev);
|
||||
*/
|
||||
void lv_indev_wait_release(lv_indev_t * indev);
|
||||
|
||||
|
||||
/**
|
||||
* Gets a pointer to the currently active object in indev proc functions.
|
||||
* NULL if no object is currently being handled or if groups aren't used.
|
||||
|
||||
@@ -20,17 +20,15 @@
|
||||
#include "../lv_misc/lv_fs.h"
|
||||
#include "../lv_misc/lv_gc.h"
|
||||
#include "../lv_misc/lv_math.h"
|
||||
#include "../lv_misc/lv_gc.h"
|
||||
#include "../lv_misc/lv_math.h"
|
||||
#include "../lv_misc/lv_log.h"
|
||||
#include "../lv_hal/lv_hal.h"
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(LV_GC_INCLUDE)
|
||||
#include LV_GC_INCLUDE
|
||||
#endif /* LV_ENABLE_GC */
|
||||
|
||||
#if LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT
|
||||
#include "../lv_gpu/lv_gpu_nxp_pxp.h"
|
||||
#include "../lv_gpu/lv_gpu_nxp_pxp_osa.h"
|
||||
#endif
|
||||
|
||||
#if defined(LV_USER_DATA_FREE_INCLUDE)
|
||||
#include LV_USER_DATA_FREE_INCLUDE
|
||||
@@ -76,6 +74,42 @@ typedef struct {
|
||||
} end_value;
|
||||
} lv_style_trans_t;
|
||||
|
||||
typedef struct {
|
||||
lv_draw_rect_dsc_t rect;
|
||||
lv_draw_label_dsc_t label;
|
||||
lv_draw_line_dsc_t line;
|
||||
lv_draw_img_dsc_t img;
|
||||
lv_style_int_t pad_top;
|
||||
lv_style_int_t pad_bottom;
|
||||
lv_style_int_t pad_right;
|
||||
lv_style_int_t pad_left;
|
||||
lv_style_int_t pad_inner;
|
||||
lv_style_int_t margin_top;
|
||||
lv_style_int_t margin_bottom;
|
||||
lv_style_int_t margin_left;
|
||||
lv_style_int_t margin_right;
|
||||
lv_style_int_t size;
|
||||
lv_style_int_t transform_width;
|
||||
lv_style_int_t transform_height;
|
||||
lv_style_int_t transform_angle;
|
||||
lv_style_int_t transform_zoom;
|
||||
lv_style_int_t scale_width;
|
||||
lv_style_int_t scale_border_width;
|
||||
lv_style_int_t scale_end_border_width;
|
||||
lv_style_int_t scale_end_line_width;
|
||||
lv_color_t scale_grad_color;
|
||||
lv_color_t scale_end_color;
|
||||
lv_opa_t opa_scale;
|
||||
uint32_t clip_corner : 1;
|
||||
uint32_t border_post : 1;
|
||||
} style_snapshot_t;
|
||||
|
||||
typedef enum {
|
||||
STYLE_COMPARE_SAME,
|
||||
STYLE_COMPARE_VISUAL_DIFF,
|
||||
STYLE_COMPARE_DIFF,
|
||||
} style_snapshot_res_t;
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
@@ -106,6 +140,9 @@ static void obj_del_core(lv_obj_t * obj);
|
||||
static void update_style_cache(lv_obj_t * obj, uint8_t part, uint16_t prop);
|
||||
static void update_style_cache_children(lv_obj_t * obj);
|
||||
static void invalidate_style_cache(lv_obj_t * obj, uint8_t part, lv_style_property_t prop);
|
||||
static void style_snapshot(lv_obj_t * obj, uint8_t part, style_snapshot_t * shot);
|
||||
static style_snapshot_res_t style_snapshot_compare(style_snapshot_t * shot1, style_snapshot_t * shot2);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
@@ -155,6 +192,13 @@ void lv_init(void)
|
||||
lv_gpu_stm32_dma2d_init();
|
||||
#endif
|
||||
|
||||
#if LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT
|
||||
if(lv_gpu_nxp_pxp_init(&pxp_default_cfg) != LV_RES_OK) {
|
||||
LV_LOG_ERROR("PXP init error. STOP.\n");
|
||||
for(; ;) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
_lv_ll_init(&LV_GC_ROOT(_lv_obj_style_trans_ll), sizeof(lv_style_trans_t));
|
||||
|
||||
_lv_ll_init(&LV_GC_ROOT(_lv_disp_ll), sizeof(lv_disp_t));
|
||||
@@ -172,8 +216,9 @@ void lv_init(void)
|
||||
_lv_indev_init();
|
||||
|
||||
_lv_img_decoder_init();
|
||||
#if LV_IMG_CACHE_DEF_SIZE
|
||||
lv_img_cache_set_size(LV_IMG_CACHE_DEF_SIZE);
|
||||
|
||||
#endif
|
||||
/*Test if the IDE has UTF-8 encoding*/
|
||||
char * txt = "Á";
|
||||
|
||||
@@ -291,10 +336,8 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_lv_ll_init(&(new_obj->child_ll), sizeof(lv_obj_t));
|
||||
|
||||
|
||||
new_obj->ext_draw_pad = 0;
|
||||
|
||||
#if LV_USE_EXT_CLICK_AREA == LV_EXT_CLICK_AREA_FULL
|
||||
@@ -318,10 +361,8 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||
_lv_memset_00(&new_obj->user_data, sizeof(lv_obj_user_data_t));
|
||||
#endif
|
||||
|
||||
|
||||
#if LV_USE_GROUP
|
||||
new_obj->group_p = NULL;
|
||||
|
||||
#endif
|
||||
|
||||
/*Set attributes*/
|
||||
@@ -344,7 +385,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||
lv_style_list_init(&new_obj->style_list);
|
||||
if(copy == NULL) {
|
||||
if(parent != NULL) lv_theme_apply(new_obj, LV_THEME_OBJ);
|
||||
else lv_theme_apply(new_obj, LV_THEME_SCR);
|
||||
else lv_theme_apply(new_obj, LV_THEME_SCR);
|
||||
}
|
||||
else {
|
||||
lv_style_list_copy(&new_obj->style_list, ©->style_list);
|
||||
@@ -366,6 +407,8 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||
_lv_memcpy(&new_obj->user_data, ©->user_data, sizeof(lv_obj_user_data_t));
|
||||
#endif
|
||||
|
||||
new_obj->base_dir = copy->base_dir;
|
||||
|
||||
/*Copy realign*/
|
||||
#if LV_USE_OBJ_REALIGN
|
||||
new_obj->realign.align = copy->realign.align;
|
||||
@@ -392,6 +435,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy)
|
||||
|
||||
new_obj->protect = copy->protect;
|
||||
new_obj->gesture_parent = copy->gesture_parent;
|
||||
new_obj->focus_parent = copy->focus_parent;
|
||||
|
||||
#if LV_USE_GROUP
|
||||
/*Add to the same group*/
|
||||
@@ -438,7 +482,6 @@ lv_res_t lv_obj_del(lv_obj_t * obj)
|
||||
if(disp->act_scr == obj) act_scr_del = true;
|
||||
}
|
||||
|
||||
|
||||
obj_del_core(obj);
|
||||
|
||||
/*Send a signal to the parent to notify it about the child delete*/
|
||||
@@ -485,13 +528,9 @@ void lv_obj_clean(lv_obj_t * obj)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
|
||||
lv_obj_t * child = lv_obj_get_child(obj, NULL);
|
||||
lv_obj_t * child_next;
|
||||
while(child) {
|
||||
/* Read the next child before deleting the current
|
||||
* because the next couldn't be read from a deleted (invalid) node*/
|
||||
child_next = lv_obj_get_child(obj, child);
|
||||
lv_obj_del(child);
|
||||
child = child_next;
|
||||
child = lv_obj_get_child(obj, NULL); /*Get the new first child*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -543,7 +582,7 @@ bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area)
|
||||
{
|
||||
if(lv_obj_get_hidden(obj)) return false;
|
||||
|
||||
/*Invalidate the object only if it belongs to the curent or previous'*/
|
||||
/*Invalidate the object only if it belongs to the current or previous'*/
|
||||
lv_obj_t * obj_scr = lv_obj_get_screen(obj);
|
||||
lv_disp_t * disp = lv_obj_get_disp(obj_scr);
|
||||
if(obj_scr == lv_disp_get_scr_act(disp) ||
|
||||
@@ -646,7 +685,6 @@ void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent)
|
||||
_lv_ll_chg_list(&obj->parent->child_ll, &parent->child_ll, obj, true);
|
||||
obj->parent = parent;
|
||||
|
||||
|
||||
if(new_base_dir != LV_BIDI_DIR_RTL) {
|
||||
lv_obj_set_pos(obj, old_pos.x, old_pos.y);
|
||||
}
|
||||
@@ -733,7 +771,6 @@ void lv_obj_set_pos(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
|
||||
y = y + par->coords.y1;
|
||||
}
|
||||
|
||||
|
||||
/*Calculate and set the movement*/
|
||||
lv_point_t diff;
|
||||
diff.x = x - obj->coords.x1;
|
||||
@@ -986,7 +1023,7 @@ void lv_obj_align_y(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_
|
||||
|
||||
LV_ASSERT_OBJ(base, LV_OBJX_NAME);
|
||||
|
||||
obj_align_core(obj, base, align, true, false, 0, y_ofs);
|
||||
obj_align_core(obj, base, align, false, true, 0, y_ofs);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1007,7 +1044,6 @@ void lv_obj_align_mid(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, l
|
||||
|
||||
LV_ASSERT_OBJ(base, LV_OBJX_NAME);
|
||||
|
||||
|
||||
obj_align_mid_core(obj, base, align, true, true, x_ofs, y_ofs);
|
||||
|
||||
#if LV_USE_OBJ_REALIGN
|
||||
@@ -1037,11 +1073,9 @@ void lv_obj_align_mid_x(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align,
|
||||
|
||||
LV_ASSERT_OBJ(base, LV_OBJX_NAME);
|
||||
|
||||
|
||||
obj_align_mid_core(obj, base, align, true, false, x_ofs, 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Align an object's middle point to an other object vertically.
|
||||
* @param obj pointer to an object to align
|
||||
@@ -1059,8 +1093,7 @@ void lv_obj_align_mid_y(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align,
|
||||
|
||||
LV_ASSERT_OBJ(base, LV_OBJX_NAME);
|
||||
|
||||
|
||||
obj_align_mid_core(obj, base, align, true, false, 0, y_ofs);
|
||||
obj_align_mid_core(obj, base, align, false, true, 0, y_ofs);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1101,7 +1134,6 @@ void lv_obj_set_auto_realign(lv_obj_t * obj, bool en)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the size of an extended clickable area
|
||||
* If TINY mode is used, only the largest of the horizontal and vertical padding
|
||||
@@ -1190,7 +1222,7 @@ void lv_obj_remove_style(lv_obj_t * obj, uint8_t part, lv_style_t * style)
|
||||
* Release all used memories and cancel pending related transitions.
|
||||
* Typically used in `LV_SIGN_CLEAN_UP.
|
||||
* @param obj pointer to an object
|
||||
* @param part the part of the object which style list should be reseted.
|
||||
* @param part the part of the object which style list should be reset.
|
||||
* E.g. `LV_OBJ_PART_MAIN`, `LV_BTN_PART_MAIN`, `LV_SLIDER_PART_KNOB`
|
||||
*/
|
||||
void lv_obj_clean_style_list(lv_obj_t * obj, uint8_t part)
|
||||
@@ -1212,7 +1244,7 @@ void lv_obj_clean_style_list(lv_obj_t * obj, uint8_t part)
|
||||
* Release all used memories and cancel pending related transitions.
|
||||
* Also notifies the object about the style change.
|
||||
* @param obj pointer to an object
|
||||
* @param part the part of the object which style list should be reseted.
|
||||
* @param part the part of the object which style list should be reset.
|
||||
* E.g. `LV_OBJ_PART_MAIN`, `LV_BTN_PART_MAIN`, `LV_SLIDER_PART_KNOB`
|
||||
*/
|
||||
void lv_obj_reset_style_list(lv_obj_t * obj, uint8_t part)
|
||||
@@ -1429,7 +1461,7 @@ void lv_obj_report_style_mod(lv_style_t * style)
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable/disable the use of style cahche for an object
|
||||
* Enable/disable the use of style cache for an object
|
||||
* @param obj pointer to an object
|
||||
* @param dis true: disable; false: enable (re-enable)
|
||||
*/
|
||||
@@ -1609,7 +1641,8 @@ void lv_obj_set_parent_event(lv_obj_t * obj, bool en)
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the base direction of the object
|
||||
* Set the base direction of the object.
|
||||
* @note This only works if LV_USE_BIDI is enabled.
|
||||
* @param obj pointer to an object
|
||||
* @param dir the new base direction. `LV_BIDI_DIR_LTR/RTL/AUTO/INHERIT`
|
||||
*/
|
||||
@@ -1668,14 +1701,40 @@ void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state)
|
||||
|
||||
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
|
||||
|
||||
#if LV_USE_ANIMATION == 0
|
||||
obj->state = new_state;
|
||||
lv_obj_refresh_style(obj, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||
#else
|
||||
lv_state_t prev_state = obj->state;
|
||||
style_snapshot_res_t cmp_res = STYLE_COMPARE_SAME;
|
||||
uint8_t part;
|
||||
for(part = 0; part < _LV_OBJ_PART_REAL_FIRST; part++) {
|
||||
lv_style_list_t * style_list = lv_obj_get_style_list(obj, part);
|
||||
if(style_list == NULL) break; /*No more style lists*/
|
||||
obj->state = prev_state;
|
||||
style_snapshot_t shot_pre;
|
||||
style_snapshot(obj, part, &shot_pre);
|
||||
obj->state = new_state;
|
||||
style_snapshot_t shot_post;
|
||||
style_snapshot(obj, part, &shot_post);
|
||||
|
||||
style_snapshot_res_t r = style_snapshot_compare(&shot_pre, &shot_post);
|
||||
if(r == STYLE_COMPARE_DIFF) {
|
||||
cmp_res = STYLE_COMPARE_DIFF;
|
||||
break;
|
||||
}
|
||||
if(r == STYLE_COMPARE_VISUAL_DIFF) {
|
||||
cmp_res = STYLE_COMPARE_VISUAL_DIFF;
|
||||
}
|
||||
}
|
||||
|
||||
obj->state = new_state;
|
||||
|
||||
uint8_t part;
|
||||
if(cmp_res == STYLE_COMPARE_SAME) {
|
||||
return;
|
||||
}
|
||||
|
||||
#if LV_USE_ANIMATION == 0
|
||||
if(cmp_res == STYLE_COMPARE_DIFF) lv_obj_refresh_style(obj, part, LV_STYLE_PROP_ALL);
|
||||
else if(cmp_res == STYLE_COMPARE_VISUAL_DIFF) lv_obj_refresh_style(obj, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||
#else
|
||||
|
||||
for(part = 0; part < _LV_OBJ_PART_REAL_LAST; part++) {
|
||||
lv_style_list_t * style_list = lv_obj_get_style_list(obj, part);
|
||||
if(style_list == NULL) break; /*No more style lists*/
|
||||
@@ -1721,10 +1780,18 @@ void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state)
|
||||
|
||||
}
|
||||
}
|
||||
lv_obj_refresh_style(obj, part, LV_STYLE_PROP_ALL);
|
||||
}
|
||||
#endif
|
||||
if(cmp_res == STYLE_COMPARE_DIFF) lv_obj_refresh_style(obj, part, LV_STYLE_PROP_ALL);
|
||||
|
||||
if(cmp_res == STYLE_COMPARE_VISUAL_DIFF) {
|
||||
invalidate_style_cache(obj, part, LV_STYLE_PROP_ALL);
|
||||
}
|
||||
}
|
||||
|
||||
if(cmp_res == STYLE_COMPARE_VISUAL_DIFF) {
|
||||
lv_obj_invalidate(obj);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -1816,7 +1883,7 @@ lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, const void * data)
|
||||
|
||||
/**
|
||||
* Send LV_EVENT_REFRESH event to an object
|
||||
* @param obj point to an obejct. (Can NOT be NULL)
|
||||
* @param obj point to an object. (Can NOT be NULL)
|
||||
* @return LV_RES_OK: success, LV_RES_INV: to object become invalid (e.g. deleted) due to this event.
|
||||
*/
|
||||
lv_res_t lv_event_send_refresh(lv_obj_t * obj)
|
||||
@@ -1859,7 +1926,6 @@ void lv_event_send_refresh_recursive(lv_obj_t * obj)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Call an event function with an object, event, and data.
|
||||
* @param event_xcb an event callback function. If `NULL` `LV_RES_OK` will return without any actions.
|
||||
@@ -2322,7 +2388,7 @@ lv_coord_t lv_obj_get_width_margin(lv_obj_t * obj)
|
||||
* Set that width reduced by the left and right padding of the parent.
|
||||
* @param obj pointer to an object
|
||||
* @param div indicates how many columns are assumed.
|
||||
* If 1 the width will be set the the parent's width
|
||||
* If 1 the width will be set the parent's width
|
||||
* If 2 only half parent width - inner padding of the parent
|
||||
* If 3 only third parent width - 2 * inner padding of the parent
|
||||
* @param span how many columns are combined
|
||||
@@ -2343,7 +2409,7 @@ lv_coord_t lv_obj_get_width_grid(lv_obj_t * obj, uint8_t div, uint8_t span)
|
||||
* Get that height reduced by the top and bottom padding of the parent.
|
||||
* @param obj pointer to an object
|
||||
* @param div indicates how many rows are assumed.
|
||||
* If 1 the height will be set the the parent's height
|
||||
* If 1 the height will be set the parent's height
|
||||
* If 2 only half parent height - inner padding of the parent
|
||||
* If 3 only third parent height - 2 * inner padding of the parent
|
||||
* @param span how many rows are combined
|
||||
@@ -2363,7 +2429,7 @@ lv_coord_t lv_obj_get_height_grid(lv_obj_t * obj, uint8_t div, uint8_t span)
|
||||
/**
|
||||
* Get the automatic realign property of the object.
|
||||
* @param obj pointer to an object
|
||||
* @return true: auto realign is enabled; false: auto realign is disabled
|
||||
* @return true: auto realign is enabled; false: auto realign is disabled
|
||||
*/
|
||||
bool lv_obj_get_auto_realign(const lv_obj_t * obj)
|
||||
{
|
||||
@@ -2516,9 +2582,6 @@ lv_style_int_t _lv_obj_get_style_int(const lv_obj_t * obj, uint8_t part, lv_styl
|
||||
|
||||
bool def = false;
|
||||
switch(prop & (~LV_STYLE_STATE_MASK)) {
|
||||
case LV_STYLE_BG_GRAD_DIR:
|
||||
if(list->bg_grad_dir_none) def = true;
|
||||
break;
|
||||
case LV_STYLE_CLIP_CORNER:
|
||||
if(list->clip_corner_off) def = true;
|
||||
break;
|
||||
@@ -2556,6 +2619,12 @@ lv_style_int_t _lv_obj_get_style_int(const lv_obj_t * obj, uint8_t part, lv_styl
|
||||
case LV_STYLE_PAD_RIGHT:
|
||||
if(list->pad_all_zero) def = true;
|
||||
break;
|
||||
case LV_STYLE_MARGIN_TOP:
|
||||
case LV_STYLE_MARGIN_BOTTOM:
|
||||
case LV_STYLE_MARGIN_LEFT:
|
||||
case LV_STYLE_MARGIN_RIGHT:
|
||||
if(list->margin_all_zero) def = true;
|
||||
break;
|
||||
case LV_STYLE_BG_BLEND_MODE:
|
||||
case LV_STYLE_BORDER_BLEND_MODE:
|
||||
case LV_STYLE_IMAGE_BLEND_MODE:
|
||||
@@ -2567,6 +2636,9 @@ lv_style_int_t _lv_obj_get_style_int(const lv_obj_t * obj, uint8_t part, lv_styl
|
||||
case LV_STYLE_VALUE_BLEND_MODE:
|
||||
if(list->blend_mode_all_normal) def = true;
|
||||
break;
|
||||
case LV_STYLE_TEXT_DECOR:
|
||||
if(list->text_decor_none) def = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(def) {
|
||||
@@ -2714,7 +2786,6 @@ lv_opa_t _lv_obj_get_style_opa(const lv_obj_t * obj, uint8_t part, lv_style_prop
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
lv_state_t state = lv_obj_get_state(parent, part);
|
||||
prop = (uint16_t)prop_ori + ((uint16_t)state << LV_STYLE_STATE_POS);
|
||||
|
||||
@@ -2969,7 +3040,6 @@ bool lv_obj_get_parent_event(const lv_obj_t * obj)
|
||||
return obj->parent_event == 0 ? false : true;
|
||||
}
|
||||
|
||||
|
||||
lv_bidi_dir_t lv_obj_get_base_dir(const lv_obj_t * obj)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
|
||||
@@ -3192,7 +3262,6 @@ bool lv_obj_is_focused(const lv_obj_t * obj)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*-------------------
|
||||
* OTHER FUNCTIONS
|
||||
*------------------*/
|
||||
@@ -3436,7 +3505,8 @@ void lv_obj_init_draw_label_dsc(lv_obj_t * obj, uint8_t part, lv_draw_label_dsc_
|
||||
draw_dsc->font = lv_obj_get_style_text_font(obj, part);
|
||||
|
||||
if(draw_dsc->sel_start != LV_DRAW_LABEL_NO_TXT_SEL && draw_dsc->sel_end != LV_DRAW_LABEL_NO_TXT_SEL) {
|
||||
draw_dsc->color = lv_obj_get_style_text_sel_color(obj, part);
|
||||
draw_dsc->sel_color = lv_obj_get_style_text_sel_color(obj, part);
|
||||
draw_dsc->sel_bg_color = lv_obj_get_style_text_sel_bg_color(obj, part);
|
||||
}
|
||||
|
||||
#if LV_USE_BIDI
|
||||
@@ -3709,17 +3779,13 @@ static void obj_del_core(lv_obj_t * obj)
|
||||
|
||||
/*Recursively delete the children*/
|
||||
lv_obj_t * i;
|
||||
lv_obj_t * i_next;
|
||||
i = _lv_ll_get_head(&(obj->child_ll));
|
||||
while(i != NULL) {
|
||||
/*Get the next object before delete this*/
|
||||
i_next = _lv_ll_get_next(&(obj->child_ll), i);
|
||||
|
||||
/*Call the recursive del to the child too*/
|
||||
/*Call the recursive delete to the child too*/
|
||||
obj_del_core(i);
|
||||
|
||||
/*Set i to the next node*/
|
||||
i = i_next;
|
||||
/*Set i to the new head node*/
|
||||
i = _lv_ll_get_head(&(obj->child_ll));
|
||||
}
|
||||
|
||||
lv_event_mark_deleted(obj);
|
||||
@@ -3794,7 +3860,7 @@ static lv_design_res_t lv_obj_design(lv_obj_t * obj, const lv_area_t * clip_area
|
||||
if(lv_obj_get_style_border_blend_mode(obj, LV_OBJ_PART_MAIN) != LV_BLEND_MODE_NORMAL) return LV_DESIGN_RES_NOT_COVER;
|
||||
if(lv_obj_get_style_opa_scale(obj, LV_OBJ_PART_MAIN) < LV_OPA_MAX) return LV_DESIGN_RES_NOT_COVER;
|
||||
|
||||
return LV_DESIGN_RES_COVER;
|
||||
return LV_DESIGN_RES_COVER;
|
||||
|
||||
}
|
||||
else if(mode == LV_DESIGN_DRAW_MAIN) {
|
||||
@@ -3822,8 +3888,21 @@ static lv_design_res_t lv_obj_design(lv_obj_t * obj, const lv_area_t * clip_area
|
||||
lv_draw_mask_radius_param_t * mp = _lv_mem_buf_get(sizeof(lv_draw_mask_radius_param_t));
|
||||
|
||||
lv_coord_t r = lv_obj_get_style_radius(obj, LV_OBJ_PART_MAIN);
|
||||
/* If it has border make the clip area 1 px smaller to avoid color bleeding
|
||||
* The border will cover the minimal issue on the edges*/
|
||||
if(draw_dsc.border_post && draw_dsc.border_opa >= LV_OPA_MIN && draw_dsc.border_width > 0) {
|
||||
lv_area_t cc_area;
|
||||
cc_area.x1 = obj->coords.x1 + 1;
|
||||
cc_area.y1 = obj->coords.y1 + 1;
|
||||
cc_area.x2 = obj->coords.x2 - 1;
|
||||
cc_area.y2 = obj->coords.y2 - 1;
|
||||
lv_draw_mask_radius_init(mp, &cc_area, r, false);
|
||||
}
|
||||
/*If no border use the full size.*/
|
||||
else {
|
||||
lv_draw_mask_radius_init(mp, &obj->coords, r, false);
|
||||
}
|
||||
|
||||
lv_draw_mask_radius_init(mp, &obj->coords, r, false);
|
||||
/*Add the mask and use `obj+8` as custom id. Don't use `obj` directly because it might be used by the user*/
|
||||
lv_draw_mask_add(mp, obj + 8);
|
||||
}
|
||||
@@ -3859,7 +3938,6 @@ static lv_design_res_t lv_obj_design(lv_obj_t * obj, const lv_area_t * clip_area
|
||||
return LV_DESIGN_RES_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the really focused object by taking `focus_parent` into account.
|
||||
* @param obj the start object
|
||||
@@ -3989,8 +4067,9 @@ static void report_style_mod_core(void * style, lv_obj_t * obj)
|
||||
|
||||
uint8_t ci;
|
||||
for(ci = 0; ci < list->style_cnt; ci++) {
|
||||
lv_style_t * class = lv_style_list_get_style(list, ci);
|
||||
if(class == style || style == NULL) {
|
||||
/* changed class to _class to allow compilation as c++ */
|
||||
lv_style_t * _class = lv_style_list_get_style(list, ci);
|
||||
if(_class == style || style == NULL) {
|
||||
lv_obj_refresh_style(obj, part, LV_STYLE_PROP_ALL);
|
||||
break;
|
||||
}
|
||||
@@ -4067,7 +4146,6 @@ static void obj_align_mid_core(lv_obj_t * obj, const lv_obj_t * base, lv_align_t
|
||||
lv_coord_t obj_w_half = lv_obj_get_width(obj) / 2;
|
||||
lv_coord_t obj_h_half = lv_obj_get_height(obj) / 2;
|
||||
|
||||
|
||||
switch(align) {
|
||||
case LV_ALIGN_CENTER:
|
||||
new_x = lv_obj_get_width(base) / 2 - obj_w_half;
|
||||
@@ -4189,8 +4267,6 @@ static void obj_align_mid_core(lv_obj_t * obj, const lv_obj_t * base, lv_align_t
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if LV_USE_ANIMATION
|
||||
|
||||
/**
|
||||
@@ -4210,14 +4286,18 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop,
|
||||
lv_style_list_t * style_list = lv_obj_get_style_list(obj, part);
|
||||
lv_style_t * style_trans = _lv_style_list_get_transition_style(style_list);
|
||||
|
||||
bool cache_ori = style_list->ignore_cache;
|
||||
|
||||
/*Get the previous and current values*/
|
||||
if((prop & 0xF) < LV_STYLE_ID_COLOR) { /*Int*/
|
||||
style_list->skip_trans = 1;
|
||||
style_list->ignore_cache = 1;
|
||||
obj->state = prev_state;
|
||||
lv_style_int_t int1 = _lv_obj_get_style_int(obj, part, prop);
|
||||
obj->state = new_state;
|
||||
lv_style_int_t int2 = _lv_obj_get_style_int(obj, part, prop);
|
||||
style_list->skip_trans = 0;
|
||||
style_list->ignore_cache = cache_ori;
|
||||
|
||||
if(int1 == int2) return NULL;
|
||||
obj->state = prev_state;
|
||||
@@ -4242,11 +4322,13 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop,
|
||||
}
|
||||
else if((prop & 0xF) < LV_STYLE_ID_OPA) { /*Color*/
|
||||
style_list->skip_trans = 1;
|
||||
style_list->ignore_cache = 1;
|
||||
obj->state = prev_state;
|
||||
lv_color_t c1 = _lv_obj_get_style_color(obj, part, prop);
|
||||
obj->state = new_state;
|
||||
lv_color_t c2 = _lv_obj_get_style_color(obj, part, prop);
|
||||
style_list->skip_trans = 0;
|
||||
style_list->ignore_cache = cache_ori;
|
||||
|
||||
if(c1.full == c2.full) return NULL;
|
||||
obj->state = prev_state;
|
||||
@@ -4262,11 +4344,13 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop,
|
||||
}
|
||||
else if((prop & 0xF) < LV_STYLE_ID_PTR) { /*Opa*/
|
||||
style_list->skip_trans = 1;
|
||||
style_list->ignore_cache = 1;
|
||||
obj->state = prev_state;
|
||||
lv_opa_t o1 = _lv_obj_get_style_opa(obj, part, prop);
|
||||
obj->state = new_state;
|
||||
lv_opa_t o2 = _lv_obj_get_style_opa(obj, part, prop);
|
||||
style_list->skip_trans = 0;
|
||||
style_list->ignore_cache = cache_ori;
|
||||
|
||||
if(o1 == o2) return NULL;
|
||||
|
||||
@@ -4284,10 +4368,12 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop,
|
||||
else { /*Ptr*/
|
||||
obj->state = prev_state;
|
||||
style_list->skip_trans = 1;
|
||||
style_list->ignore_cache = 1;
|
||||
const void * p1 = _lv_obj_get_style_ptr(obj, part, prop);
|
||||
obj->state = new_state;
|
||||
const void * p2 = _lv_obj_get_style_ptr(obj, part, prop);
|
||||
style_list->skip_trans = 0;
|
||||
style_list->ignore_cache = cache_ori;
|
||||
|
||||
if(memcmp(&p1, &p2, sizeof(const void *)) == 0) return NULL;
|
||||
obj->state = prev_state;
|
||||
@@ -4473,7 +4559,6 @@ static bool style_prop_is_cacheble(lv_style_property_t prop)
|
||||
|
||||
switch(prop) {
|
||||
case LV_STYLE_PROP_ALL:
|
||||
case LV_STYLE_BG_GRAD_DIR:
|
||||
case LV_STYLE_CLIP_CORNER:
|
||||
case LV_STYLE_TEXT_LETTER_SPACE:
|
||||
case LV_STYLE_TEXT_LINE_SPACE:
|
||||
@@ -4497,6 +4582,10 @@ static bool style_prop_is_cacheble(lv_style_property_t prop)
|
||||
case LV_STYLE_PAD_BOTTOM:
|
||||
case LV_STYLE_PAD_LEFT:
|
||||
case LV_STYLE_PAD_RIGHT:
|
||||
case LV_STYLE_MARGIN_TOP:
|
||||
case LV_STYLE_MARGIN_BOTTOM:
|
||||
case LV_STYLE_MARGIN_LEFT:
|
||||
case LV_STYLE_MARGIN_RIGHT:
|
||||
case LV_STYLE_BG_BLEND_MODE:
|
||||
case LV_STYLE_BORDER_BLEND_MODE:
|
||||
case LV_STYLE_IMAGE_BLEND_MODE:
|
||||
@@ -4515,7 +4604,7 @@ static bool style_prop_is_cacheble(lv_style_property_t prop)
|
||||
|
||||
/**
|
||||
* Update the cache of style list
|
||||
* @param obj pointer to an obejct
|
||||
* @param obj pointer to an object
|
||||
* @param part the part of the object
|
||||
* @param prop the property which triggered the update
|
||||
*/
|
||||
@@ -4542,12 +4631,10 @@ static void update_style_cache(lv_obj_t * obj, uint8_t part, uint16_t prop)
|
||||
list->text_space_zero = 0;
|
||||
}
|
||||
|
||||
|
||||
lv_opa_t bg_opa = lv_obj_get_style_bg_opa(obj, part);
|
||||
list->bg_opa_transp = bg_opa == LV_OPA_TRANSP ? 1 : 0;
|
||||
list->bg_opa_cover = bg_opa == LV_OPA_COVER ? 1 : 0;
|
||||
|
||||
list->bg_grad_dir_none = lv_obj_get_style_bg_grad_dir(obj, part) == LV_GRAD_DIR_NONE ? 1 : 0;
|
||||
list->border_width_zero = lv_obj_get_style_border_width(obj, part) == 0 ? 1 : 0;
|
||||
list->border_side_full = lv_obj_get_style_border_side(obj, part) == LV_BORDER_SIDE_FULL ? 1 : 0;
|
||||
list->border_post_off = lv_obj_get_style_border_post(obj, part) == 0 ? 1 : 0;
|
||||
@@ -4559,7 +4646,6 @@ static void update_style_cache(lv_obj_t * obj, uint8_t part, uint16_t prop)
|
||||
list->shadow_width_zero = lv_obj_get_style_shadow_width(obj, part) == 0 ? 1 : 0;
|
||||
list->value_txt_str = lv_obj_get_style_value_str(obj, part) == NULL ? 1 : 0;
|
||||
|
||||
|
||||
list->transform_all_zero = 1;
|
||||
if(lv_obj_get_style_transform_angle(obj, part) != 0 ||
|
||||
lv_obj_get_style_transform_width(obj, part) != 0 ||
|
||||
@@ -4576,6 +4662,14 @@ static void update_style_cache(lv_obj_t * obj, uint8_t part, uint16_t prop)
|
||||
list->pad_all_zero = 0;
|
||||
}
|
||||
|
||||
list->margin_all_zero = 1;
|
||||
if(lv_obj_get_style_margin_top(obj, part) != 0 ||
|
||||
lv_obj_get_style_margin_bottom(obj, part) != 0 ||
|
||||
lv_obj_get_style_margin_left(obj, part) != 0 ||
|
||||
lv_obj_get_style_margin_right(obj, part) != 0) {
|
||||
list->margin_all_zero = 0;
|
||||
}
|
||||
|
||||
list->blend_mode_all_normal = 1;
|
||||
#if LV_USE_BLEND_MODES
|
||||
if(lv_obj_get_style_bg_blend_mode(obj, part) != LV_BLEND_MODE_NORMAL ||
|
||||
@@ -4640,23 +4734,16 @@ static void invalidate_style_cache(lv_obj_t * obj, uint8_t part, lv_style_proper
|
||||
{
|
||||
if(style_prop_is_cacheble(prop) == false) return;
|
||||
|
||||
if(part != LV_OBJ_PART_ALL) {
|
||||
for(part = 0; part < _LV_OBJ_PART_REAL_FIRST; part++) {
|
||||
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||
if(list == NULL) return;
|
||||
if(list == NULL) break;
|
||||
list->valid_cache = 0;
|
||||
}
|
||||
else {
|
||||
|
||||
for(part = 0; part < _LV_OBJ_PART_REAL_FIRST; part++) {
|
||||
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||
if(list == NULL) break;
|
||||
list->valid_cache = 0;
|
||||
}
|
||||
for(part = _LV_OBJ_PART_REAL_FIRST; part < 0xFF; part++) {
|
||||
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||
if(list == NULL) break;
|
||||
list->valid_cache = 0;
|
||||
}
|
||||
for(part = _LV_OBJ_PART_REAL_FIRST; part < 0xFF; part++) {
|
||||
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||
if(list == NULL) break;
|
||||
list->valid_cache = 0;
|
||||
}
|
||||
|
||||
lv_obj_t * child = lv_obj_get_child(obj, NULL);
|
||||
@@ -4666,3 +4753,81 @@ static void invalidate_style_cache(lv_obj_t * obj, uint8_t part, lv_style_proper
|
||||
}
|
||||
}
|
||||
|
||||
static void style_snapshot(lv_obj_t * obj, uint8_t part, style_snapshot_t * shot)
|
||||
{
|
||||
_lv_obj_disable_style_caching(obj, true);
|
||||
_lv_memset_00(shot, sizeof(style_snapshot_t));
|
||||
lv_draw_rect_dsc_init(&shot->rect);
|
||||
lv_draw_label_dsc_init(&shot->label);
|
||||
lv_draw_img_dsc_init(&shot->img);
|
||||
lv_draw_line_dsc_init(&shot->line);
|
||||
|
||||
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||
bool trans_ori = list->skip_trans;
|
||||
list->skip_trans = 1;
|
||||
|
||||
lv_obj_init_draw_rect_dsc(obj, part, &shot->rect);
|
||||
lv_obj_init_draw_label_dsc(obj, part, &shot->label);
|
||||
lv_obj_init_draw_img_dsc(obj, part, &shot->img);
|
||||
lv_obj_init_draw_line_dsc(obj, part, &shot->line);
|
||||
|
||||
shot->pad_top = lv_obj_get_style_pad_top(obj, part);
|
||||
shot->pad_bottom = lv_obj_get_style_pad_bottom(obj, part);
|
||||
shot->pad_right = lv_obj_get_style_pad_right(obj, part);
|
||||
shot->pad_left = lv_obj_get_style_pad_left(obj, part);
|
||||
shot->pad_inner = lv_obj_get_style_pad_inner(obj, part);
|
||||
shot->margin_top = lv_obj_get_style_margin_top(obj, part);
|
||||
shot->margin_bottom = lv_obj_get_style_margin_bottom(obj, part);
|
||||
shot->margin_left = lv_obj_get_style_margin_left(obj, part);
|
||||
shot->margin_right = lv_obj_get_style_margin_right(obj, part);
|
||||
shot->size = lv_obj_get_style_size(obj, part);
|
||||
shot->transform_width = lv_obj_get_style_transform_width(obj, part);
|
||||
shot->transform_height = lv_obj_get_style_transform_height(obj, part);
|
||||
shot->transform_angle = lv_obj_get_style_transform_angle(obj, part);
|
||||
shot->transform_zoom = lv_obj_get_style_transform_zoom(obj, part);
|
||||
shot->scale_width = lv_obj_get_style_scale_width(obj, part);
|
||||
shot->scale_border_width = lv_obj_get_style_scale_border_width(obj, part);
|
||||
shot->scale_end_border_width = lv_obj_get_style_scale_end_border_width(obj, part);
|
||||
shot->scale_end_line_width = lv_obj_get_style_scale_end_line_width(obj, part);
|
||||
shot->scale_grad_color = lv_obj_get_style_scale_grad_color(obj, part);
|
||||
shot->scale_end_color = lv_obj_get_style_scale_end_color(obj, part);
|
||||
shot->opa_scale = lv_obj_get_style_opa_scale(obj, part);
|
||||
shot->clip_corner = lv_obj_get_style_clip_corner(obj, part);
|
||||
shot->border_post = lv_obj_get_style_border_post(obj, part);
|
||||
|
||||
_lv_obj_disable_style_caching(obj, false);
|
||||
list->skip_trans = trans_ori;
|
||||
}
|
||||
|
||||
static style_snapshot_res_t style_snapshot_compare(style_snapshot_t * shot1, style_snapshot_t * shot2)
|
||||
{
|
||||
if(memcmp(shot1, shot2, sizeof(style_snapshot_t)) == 0) return STYLE_COMPARE_SAME;
|
||||
|
||||
if(shot1->pad_top != shot2->pad_top) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->pad_bottom != shot2->pad_bottom) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->pad_left != shot2->pad_right) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->pad_right != shot2->pad_right) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->pad_top != shot2->pad_top) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->pad_inner != shot2->pad_inner) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->margin_top != shot2->margin_top) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->margin_bottom != shot2->margin_bottom) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->margin_left != shot2->margin_right) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->margin_right != shot2->margin_right) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->margin_top != shot2->margin_top) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->transform_width != shot2->transform_width) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->transform_height != shot2->transform_height) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->transform_angle != shot2->transform_angle) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->transform_zoom != shot2->transform_zoom) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->rect.outline_width != shot2->rect.outline_width) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->rect.outline_pad != shot2->rect.outline_pad) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->rect.value_font != shot2->rect.value_font) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->rect.value_align != shot2->rect.value_align) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->rect.value_font != shot2->rect.value_font) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->rect.shadow_spread != shot2->rect.shadow_spread) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->rect.shadow_width != shot2->rect.shadow_width) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->rect.shadow_ofs_x != shot2->rect.shadow_ofs_x) return STYLE_COMPARE_DIFF;
|
||||
if(shot1->rect.shadow_ofs_y != shot2->rect.shadow_ofs_y) return STYLE_COMPARE_DIFF;
|
||||
|
||||
/*If not returned earlier its just a visual difference, a simple redraw is enough*/
|
||||
return STYLE_COMPARE_VISUAL_DIFF;
|
||||
}
|
||||
|
||||
@@ -43,9 +43,9 @@ extern "C" {
|
||||
|
||||
#define LV_MAX_ANCESTOR_NUM 8
|
||||
|
||||
#define LV_EXT_CLICK_AREA_OFF 0
|
||||
#define LV_EXT_CLICK_AREA_TINY 1
|
||||
#define LV_EXT_CLICK_AREA_FULL 2
|
||||
#define LV_EXT_CLICK_AREA_OFF 0
|
||||
#define LV_EXT_CLICK_AREA_TINY 1
|
||||
#define LV_EXT_CLICK_AREA_FULL 2
|
||||
|
||||
#define _LV_OBJ_PART_VIRTUAL_FIRST 0x01
|
||||
#define _LV_OBJ_PART_REAL_FIRST 0x40
|
||||
@@ -56,7 +56,6 @@ extern "C" {
|
||||
|
||||
struct _lv_obj_t;
|
||||
|
||||
|
||||
/** Design modes */
|
||||
enum {
|
||||
LV_DESIGN_DRAW_MAIN, /**< Draw the main portion of the object */
|
||||
@@ -65,7 +64,6 @@ enum {
|
||||
};
|
||||
typedef uint8_t lv_design_mode_t;
|
||||
|
||||
|
||||
/** Design results */
|
||||
enum {
|
||||
LV_DESIGN_RES_OK, /**< Draw ready */
|
||||
@@ -179,6 +177,7 @@ enum {
|
||||
LV_PROTECT_PRESS_LOST = 0x10, /**< If the `indev` was pressing this object but swiped out while
|
||||
pressing do not search other object.*/
|
||||
LV_PROTECT_CLICK_FOCUS = 0x20, /**< Prevent focusing the object by clicking on it*/
|
||||
LV_PROTECT_EVENT_TO_DISABLED = 0x40, /**< Pass events even to disabled objects*/
|
||||
};
|
||||
typedef uint8_t lv_protect_t;
|
||||
|
||||
@@ -205,7 +204,7 @@ typedef struct _lv_obj_t {
|
||||
lv_design_cb_t design_cb; /**< Object type specific design function*/
|
||||
|
||||
void * ext_attr; /**< Object type specific extended data*/
|
||||
lv_style_list_t style_list;
|
||||
lv_style_list_t style_list;
|
||||
|
||||
#if LV_USE_EXT_CLICK_AREA == LV_EXT_CLICK_AREA_TINY
|
||||
uint8_t ext_click_pad_hor; /**< Extra click padding in horizontal direction */
|
||||
@@ -288,7 +287,6 @@ typedef struct {
|
||||
*/
|
||||
void lv_init(void);
|
||||
|
||||
|
||||
/**
|
||||
* Deinit the 'lv' library
|
||||
* Currently only implemented when not using custom allocators, or GC is enabled.
|
||||
@@ -339,7 +337,6 @@ void lv_obj_del_async(struct _lv_obj_t * obj);
|
||||
*/
|
||||
void lv_obj_clean(lv_obj_t * obj);
|
||||
|
||||
|
||||
/**
|
||||
* Mark an area of an object as invalid.
|
||||
* This area will be redrawn by 'lv_refr_task'
|
||||
@@ -354,7 +351,6 @@ void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area);
|
||||
*/
|
||||
void lv_obj_invalidate(const lv_obj_t * obj);
|
||||
|
||||
|
||||
/**
|
||||
* Tell whether an area of an object is visible (even partially) now or not
|
||||
* @param obj pointer to an object
|
||||
@@ -513,7 +509,6 @@ void lv_obj_align_y(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_
|
||||
*/
|
||||
void lv_obj_align_mid(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs);
|
||||
|
||||
|
||||
/**
|
||||
* Align an object's middle point to an other object horizontally.
|
||||
* @param obj pointer to an object to align
|
||||
@@ -583,7 +578,7 @@ void lv_obj_remove_style(lv_obj_t * obj, uint8_t part, lv_style_t * style);
|
||||
* Release all used memories and cancel pending related transitions.
|
||||
* Typically used in `LV_SIGN_CLEAN_UP.
|
||||
* @param obj pointer to an object
|
||||
* @param part the part of the object which style list should be reseted.
|
||||
* @param part the part of the object which style list should be reset.
|
||||
* E.g. `LV_OBJ_PART_MAIN`, `LV_BTN_PART_MAIN`, `LV_SLIDER_PART_KNOB`
|
||||
*/
|
||||
void lv_obj_clean_style_list(lv_obj_t * obj, uint8_t part);
|
||||
@@ -593,7 +588,7 @@ void lv_obj_clean_style_list(lv_obj_t * obj, uint8_t part);
|
||||
* Release all used memories and cancel pending related transitions.
|
||||
* Also notifies the object about the style change.
|
||||
* @param obj pointer to an object
|
||||
* @param part the part of the object which style list should be reseted.
|
||||
* @param part the part of the object which style list should be reset.
|
||||
* E.g. `LV_OBJ_PART_MAIN`, `LV_BTN_PART_MAIN`, `LV_SLIDER_PART_KNOB`
|
||||
*/
|
||||
void lv_obj_reset_style_list(lv_obj_t * obj, uint8_t part);
|
||||
@@ -682,7 +677,7 @@ void _lv_obj_set_style_local_ptr(lv_obj_t * obj, uint8_t type, lv_style_property
|
||||
bool lv_obj_remove_style_local_prop(lv_obj_t * obj, uint8_t part, lv_style_property_t prop);
|
||||
|
||||
/**
|
||||
* Enable/disable the use of style cahche for an object
|
||||
* Enable/disable the use of style cache for an object
|
||||
* @param obj pointer to an object
|
||||
* @param dis true: disable; false: enable (re-enable)
|
||||
*/
|
||||
@@ -775,6 +770,7 @@ void lv_obj_set_parent_event(lv_obj_t * obj, bool en);
|
||||
|
||||
/**
|
||||
* Set the base direction of the object
|
||||
* @note This only works if LV_USE_BIDI is enabled.
|
||||
* @param obj pointer to an object
|
||||
* @param dir the new base direction. `LV_BIDI_DIR_LTR/RTL/AUTO/INHERIT`
|
||||
*/
|
||||
@@ -847,10 +843,9 @@ void lv_obj_set_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb);
|
||||
*/
|
||||
lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, const void * data);
|
||||
|
||||
|
||||
/**
|
||||
* Send LV_EVENT_REFRESH event to an object
|
||||
* @param obj point to an obejct. (Can NOT be NULL)
|
||||
* @param obj point to an object. (Can NOT be NULL)
|
||||
* @return LV_RES_OK: success, LV_RES_INV: to object become invalid (e.g. deleted) due to this event.
|
||||
*/
|
||||
lv_res_t lv_event_send_refresh(lv_obj_t * obj);
|
||||
@@ -887,7 +882,6 @@ const void * lv_event_get_data(void);
|
||||
*/
|
||||
void lv_obj_set_signal_cb(lv_obj_t * obj, lv_signal_cb_t signal_cb);
|
||||
|
||||
|
||||
/**
|
||||
* Send an event to the object
|
||||
* @param obj pointer to an object
|
||||
@@ -1062,7 +1056,7 @@ lv_coord_t lv_obj_get_width_margin(lv_obj_t * obj);
|
||||
* Take paddings into account.
|
||||
* @param obj pointer to an object
|
||||
* @param div indicates how many columns are assumed.
|
||||
* If 1 the width will be set the the parent's width
|
||||
* If 1 the width will be set the parent's width
|
||||
* If 2 only half parent width - inner padding of the parent
|
||||
* If 3 only third parent width - 2 * inner padding of the parent
|
||||
* @param span how many columns are combined
|
||||
@@ -1075,7 +1069,7 @@ lv_coord_t lv_obj_get_width_grid(lv_obj_t * obj, uint8_t div, uint8_t span);
|
||||
* Take paddings into account.
|
||||
* @param obj pointer to an object
|
||||
* @param div indicates how many rows are assumed.
|
||||
* If 1 the height will be set the the parent's height
|
||||
* If 1 the height will be set the parent's height
|
||||
* If 2 only half parent height - inner padding of the parent
|
||||
* If 3 only third parent height - 2 * inner padding of the parent
|
||||
* @param span how many rows are combined
|
||||
@@ -1086,7 +1080,7 @@ lv_coord_t lv_obj_get_height_grid(lv_obj_t * obj, uint8_t div, uint8_t span);
|
||||
/**
|
||||
* Get the automatic realign property of the object.
|
||||
* @param obj pointer to an object
|
||||
* @return true: auto realign is enabled; false: auto realign is disabled
|
||||
* @return true: auto realign is enabled; false: auto realign is disabled
|
||||
*/
|
||||
bool lv_obj_get_auto_realign(const lv_obj_t * obj);
|
||||
|
||||
@@ -1211,7 +1205,6 @@ const void * _lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, lv_style_
|
||||
*/
|
||||
lv_style_t * lv_obj_get_local_style(lv_obj_t * obj, uint8_t part);
|
||||
|
||||
|
||||
#include "lv_obj_style_dec.h"
|
||||
|
||||
/*-----------------
|
||||
@@ -1274,7 +1267,6 @@ bool lv_obj_get_drag_throw(const lv_obj_t * obj);
|
||||
*/
|
||||
bool lv_obj_get_drag_parent(const lv_obj_t * obj);
|
||||
|
||||
|
||||
/**
|
||||
* Get the focus parent attribute of an object
|
||||
* @param obj pointer to an object
|
||||
@@ -1282,7 +1274,6 @@ bool lv_obj_get_drag_parent(const lv_obj_t * obj);
|
||||
*/
|
||||
bool lv_obj_get_focus_parent(const lv_obj_t * obj);
|
||||
|
||||
|
||||
/**
|
||||
* Get the drag parent attribute of an object
|
||||
* @param obj pointer to an object
|
||||
@@ -1314,7 +1305,6 @@ uint8_t lv_obj_get_protect(const lv_obj_t * obj);
|
||||
*/
|
||||
bool lv_obj_is_protected(const lv_obj_t * obj, uint8_t prot);
|
||||
|
||||
|
||||
lv_state_t lv_obj_get_state(const lv_obj_t * obj, uint8_t part);
|
||||
|
||||
/**
|
||||
@@ -1488,7 +1478,6 @@ bool lv_debug_check_obj_type(const lv_obj_t * obj, const char * obj_type);
|
||||
*/
|
||||
bool lv_debug_check_obj_valid(const lv_obj_t * obj);
|
||||
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
@@ -1509,7 +1498,6 @@ bool lv_debug_check_obj_valid(const lv_obj_t * obj);
|
||||
*/
|
||||
#define LV_EVENT_CB_DECLARE(name) static void name(lv_obj_t * obj, lv_event_t e)
|
||||
|
||||
|
||||
#if LV_USE_DEBUG
|
||||
|
||||
# ifndef LV_DEBUG_IS_OBJ
|
||||
@@ -1518,7 +1506,6 @@ bool lv_debug_check_obj_valid(const lv_obj_t * obj);
|
||||
lv_debug_check_obj_type(obj_p, obj_type))
|
||||
# endif
|
||||
|
||||
|
||||
# if LV_USE_ASSERT_OBJ
|
||||
# ifndef LV_ASSERT_OBJ
|
||||
# define LV_ASSERT_OBJ(obj_p, obj_type) LV_DEBUG_ASSERT(LV_DEBUG_IS_OBJ(obj_p, obj_type), "Invalid object", obj_p);
|
||||
@@ -1527,14 +1514,13 @@ bool lv_debug_check_obj_valid(const lv_obj_t * obj);
|
||||
# if LV_USE_ASSERT_NULL /*Use at least LV_ASSERT_NULL if enabled*/
|
||||
# define LV_ASSERT_OBJ(obj_p, obj_type) LV_ASSERT_NULL(obj_p)
|
||||
# else
|
||||
# define LV_ASSERT_OBJ(obj_p, obj_type) true
|
||||
# define LV_ASSERT_OBJ(obj_p, obj_type)
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# define LV_ASSERT_OBJ(obj, obj_type) true
|
||||
# define LV_ASSERT_OBJ(obj, obj_type)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
@@ -163,6 +163,7 @@ _LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_DECOR, text_decor, lv_text_decor_t, _int, sca
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_BLEND_MODE, text_blend_mode, lv_blend_mode_t, _int, scalar)
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_COLOR, text_color, lv_color_t, _color, nonscalar)
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_SEL_COLOR, text_sel_color, lv_color_t, _color, nonscalar)
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_SEL_BG_COLOR, text_sel_bg_color, lv_color_t, _color, nonscalar)
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_OPA, text_opa, lv_opa_t, _opa, scalar)
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_FONT, text_font, const lv_font_t *, _ptr, scalar)
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(LINE_WIDTH, line_width, lv_style_int_t, _int, scalar)
|
||||
@@ -199,7 +200,6 @@ _LV_OBJ_STYLE_SET_GET_DECLARE(SCALE_END_COLOR, scale_end_color, lv_color_t, _col
|
||||
|
||||
#undef _LV_OBJ_STYLE_SET_GET_DECLARE
|
||||
|
||||
|
||||
static inline void lv_obj_set_style_local_pad_all(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value)
|
||||
{
|
||||
lv_obj_set_style_local_pad_top(obj, part, state, value);
|
||||
@@ -208,7 +208,6 @@ static inline void lv_obj_set_style_local_pad_all(lv_obj_t * obj, uint8_t part,
|
||||
lv_obj_set_style_local_pad_right(obj, part, state, value);
|
||||
}
|
||||
|
||||
|
||||
static inline void lv_style_set_pad_all(lv_style_t * style, lv_state_t state, lv_style_int_t value)
|
||||
{
|
||||
lv_style_set_pad_top(style, state, value);
|
||||
@@ -217,35 +216,30 @@ static inline void lv_style_set_pad_all(lv_style_t * style, lv_state_t state, lv
|
||||
lv_style_set_pad_right(style, state, value);
|
||||
}
|
||||
|
||||
|
||||
static inline void lv_obj_set_style_local_pad_hor(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value)
|
||||
{
|
||||
lv_obj_set_style_local_pad_left(obj, part, state, value);
|
||||
lv_obj_set_style_local_pad_right(obj, part, state, value);
|
||||
}
|
||||
|
||||
|
||||
static inline void lv_style_set_pad_hor(lv_style_t * style, lv_state_t state, lv_style_int_t value)
|
||||
{
|
||||
lv_style_set_pad_left(style, state, value);
|
||||
lv_style_set_pad_right(style, state, value);
|
||||
}
|
||||
|
||||
|
||||
static inline void lv_obj_set_style_local_pad_ver(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value)
|
||||
{
|
||||
lv_obj_set_style_local_pad_top(obj, part, state, value);
|
||||
lv_obj_set_style_local_pad_bottom(obj, part, state, value);
|
||||
}
|
||||
|
||||
|
||||
static inline void lv_style_set_pad_ver(lv_style_t * style, lv_state_t state, lv_style_int_t value)
|
||||
{
|
||||
lv_style_set_pad_top(style, state, value);
|
||||
lv_style_set_pad_bottom(style, state, value);
|
||||
}
|
||||
|
||||
|
||||
static inline void lv_obj_set_style_local_margin_all(lv_obj_t * obj, uint8_t part, lv_state_t state,
|
||||
lv_style_int_t value)
|
||||
{
|
||||
@@ -255,7 +249,6 @@ static inline void lv_obj_set_style_local_margin_all(lv_obj_t * obj, uint8_t par
|
||||
lv_obj_set_style_local_margin_right(obj, part, state, value);
|
||||
}
|
||||
|
||||
|
||||
static inline void lv_style_set_margin_all(lv_style_t * style, lv_state_t state, lv_style_int_t value)
|
||||
{
|
||||
lv_style_set_margin_top(style, state, value);
|
||||
@@ -264,7 +257,6 @@ static inline void lv_style_set_margin_all(lv_style_t * style, lv_state_t state,
|
||||
lv_style_set_margin_right(style, state, value);
|
||||
}
|
||||
|
||||
|
||||
static inline void lv_obj_set_style_local_margin_hor(lv_obj_t * obj, uint8_t part, lv_state_t state,
|
||||
lv_style_int_t value)
|
||||
{
|
||||
@@ -272,14 +264,12 @@ static inline void lv_obj_set_style_local_margin_hor(lv_obj_t * obj, uint8_t par
|
||||
lv_obj_set_style_local_margin_right(obj, part, state, value);
|
||||
}
|
||||
|
||||
|
||||
static inline void lv_style_set_margin_hor(lv_style_t * style, lv_state_t state, lv_style_int_t value)
|
||||
{
|
||||
lv_style_set_margin_left(style, state, value);
|
||||
lv_style_set_margin_right(style, state, value);
|
||||
}
|
||||
|
||||
|
||||
static inline void lv_obj_set_style_local_margin_ver(lv_obj_t * obj, uint8_t part, lv_state_t state,
|
||||
lv_style_int_t value)
|
||||
{
|
||||
@@ -287,14 +277,12 @@ static inline void lv_obj_set_style_local_margin_ver(lv_obj_t * obj, uint8_t par
|
||||
lv_obj_set_style_local_margin_bottom(obj, part, state, value);
|
||||
}
|
||||
|
||||
|
||||
static inline void lv_style_set_margin_ver(lv_style_t * style, lv_state_t state, lv_style_int_t value)
|
||||
{
|
||||
lv_style_set_margin_top(style, state, value);
|
||||
lv_style_set_margin_bottom(style, state, value);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
@@ -23,10 +23,6 @@
|
||||
#include "../lv_widgets/lv_label.h"
|
||||
#endif
|
||||
|
||||
#if defined(LV_GC_INCLUDE)
|
||||
#include LV_GC_INCLUDE
|
||||
#endif /* LV_ENABLE_GC */
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
@@ -54,6 +50,10 @@ static void lv_refr_vdb_flush(void);
|
||||
**********************/
|
||||
static uint32_t px_num;
|
||||
static lv_disp_t * disp_refr; /*Display being refreshed*/
|
||||
#if LV_USE_PERF_MONITOR
|
||||
static uint32_t fps_sum_cnt;
|
||||
static uint32_t fps_sum_all;
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
@@ -74,7 +74,7 @@ void _lv_refr_init(void)
|
||||
/**
|
||||
* Redraw the invalidated areas now.
|
||||
* Normally the redrawing is periodically executed in `lv_task_handler` but a long blocking process
|
||||
* can prevent the call of `lv_task_handler`. In this case if the the GUI is updated in the process
|
||||
* can prevent the call of `lv_task_handler`. In this case if the GUI is updated in the process
|
||||
* (e.g. progress bar) this function can be called when the screen should be updated.
|
||||
* @param disp pointer to display to refresh. NULL to refresh all displays.
|
||||
*/
|
||||
@@ -290,17 +290,28 @@ void _lv_disp_refr_task(lv_task_t * task)
|
||||
}
|
||||
|
||||
static uint32_t perf_last_time = 0;
|
||||
static uint32_t elaps_max = 1;
|
||||
static uint32_t elaps_sum = 0;
|
||||
static uint32_t frame_cnt = 0;
|
||||
if(lv_tick_elaps(perf_last_time) < 300) {
|
||||
elaps_max = LV_MATH_MAX(elaps, elaps_max);
|
||||
if(px_num > 5000) {
|
||||
elaps_sum += elaps;
|
||||
frame_cnt ++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
perf_last_time = lv_tick_get();
|
||||
uint32_t fps = 1000 / (elaps_max == 0 ? 1 : elaps_max);
|
||||
elaps_max = 1;
|
||||
uint32_t fps_limit = 1000 / disp_refr->refr_task->period;
|
||||
uint32_t fps;
|
||||
|
||||
if(elaps_sum == 0) elaps_sum = 1;
|
||||
if(frame_cnt == 0) fps = fps_limit;
|
||||
else fps = (1000 * frame_cnt) / elaps_sum;
|
||||
elaps_sum = 0;
|
||||
frame_cnt = 0;
|
||||
if(fps > fps_limit) fps = fps_limit;
|
||||
|
||||
fps_sum_all += fps;
|
||||
fps_sum_cnt ++;
|
||||
uint32_t cpu = 100 - lv_task_get_idle();
|
||||
lv_label_set_text_fmt(perf_label, "%d FPS\n%d%% CPU", fps, cpu);
|
||||
lv_obj_align(perf_label, NULL, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
|
||||
@@ -310,6 +321,13 @@ void _lv_disp_refr_task(lv_task_t * task)
|
||||
LV_LOG_TRACE("lv_refr_task: ready");
|
||||
}
|
||||
|
||||
#if LV_USE_PERF_MONITOR
|
||||
uint32_t lv_refr_get_fps_avg(void)
|
||||
{
|
||||
return fps_sum_all / fps_sum_cnt;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
@@ -381,14 +399,14 @@ static void lv_refr_areas(void)
|
||||
disp_refr->driver.buffer->last_part = 0;
|
||||
lv_refr_area(&disp_refr->inv_areas[i]);
|
||||
|
||||
if(disp_refr->driver.monitor_cb) px_num += lv_area_get_size(&disp_refr->inv_areas[i]);
|
||||
px_num += lv_area_get_size(&disp_refr->inv_areas[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh an area if there is Virtual Display Buffer
|
||||
* @param area_p pointer to an area to refresh
|
||||
* @param area_p pointer to an area to refresh
|
||||
*/
|
||||
static void lv_refr_area(const lv_area_t * area_p)
|
||||
{
|
||||
@@ -542,7 +560,6 @@ static void lv_refr_area_part(const lv_area_t * area_p)
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(top_act_scr == NULL) {
|
||||
top_act_scr = disp_refr->act_scr;
|
||||
}
|
||||
@@ -746,6 +763,8 @@ static void lv_refr_vdb_flush(void)
|
||||
|
||||
/*Flush the rendered content to the display*/
|
||||
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
||||
if(disp->driver.gpu_wait_cb) disp->driver.gpu_wait_cb(&disp->driver);
|
||||
|
||||
if(disp->driver.flush_cb) disp->driver.flush_cb(&disp->driver, &vdb->area, vdb->buf_act);
|
||||
|
||||
if(vdb->buf1 && vdb->buf2) {
|
||||
|
||||
@@ -50,7 +50,7 @@ void _lv_refr_init(void);
|
||||
/**
|
||||
* Redraw the invalidated areas now.
|
||||
* Normally the redrawing is periodically executed in `lv_task_handler` but a long blocking process
|
||||
* can prevent the call of `lv_task_handler`. In this case if the the GUI is updated in the process
|
||||
* can prevent the call of `lv_task_handler`. In this case if the GUI is updated in the process
|
||||
* (e.g. progress bar) this function can be called when the screen should be updated.
|
||||
* @param disp pointer to display to refresh. NULL to refresh all displays.
|
||||
*/
|
||||
@@ -78,6 +78,14 @@ lv_disp_t * _lv_refr_get_disp_refreshing(void);
|
||||
*/
|
||||
void _lv_refr_set_disp_refreshing(lv_disp_t * disp);
|
||||
|
||||
#if LV_USE_PERF_MONITOR
|
||||
/**
|
||||
* Get the average FPS since start up
|
||||
* @return the average FPS
|
||||
*/
|
||||
uint32_t lv_refr_get_fps_avg(void);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Called periodically to handle the refreshing
|
||||
* @param task pointer to the task itself
|
||||
|
||||
@@ -44,7 +44,7 @@ static inline size_t get_prop_size(uint8_t prop_id);
|
||||
static inline size_t get_next_prop_index(uint8_t prop_id, size_t id);
|
||||
|
||||
/**********************
|
||||
* GLOABAL VARIABLES
|
||||
* GLOBAL VARIABLES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
@@ -93,7 +93,7 @@ void lv_style_copy(lv_style_t * style_dest, const lv_style_t * style_src)
|
||||
/**
|
||||
* Remove a property from a style
|
||||
* @param style pointer to a style
|
||||
* @param prop a style property ORed with a state.
|
||||
* @param prop a style property ORed with a state.
|
||||
* E.g. `LV_STYLE_BORDER_WIDTH | (LV_STATE_PRESSED << LV_STYLE_STATE_POS)`
|
||||
* @return true: the property was found and removed; false: the property wasn't found
|
||||
*/
|
||||
@@ -188,7 +188,7 @@ void lv_style_list_copy(lv_style_list_t * list_dest, const lv_style_list_t * lis
|
||||
|
||||
/**
|
||||
* Add a style to a style list.
|
||||
* Only the the style pointer will be saved so the shouldn't be a local variable.
|
||||
* Only the style pointer will be saved so the shouldn't be a local variable.
|
||||
* (It should be static, global or dynamically allocated)
|
||||
* @param list pointer to a style list
|
||||
* @param style pointer to a style to add
|
||||
@@ -340,7 +340,7 @@ uint16_t _lv_style_get_mem_size(const lv_style_t * style)
|
||||
|
||||
size_t i = 0;
|
||||
uint8_t prop_id;
|
||||
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSEING_PROP) {
|
||||
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSING_PROP) {
|
||||
i = get_next_prop_index(prop_id, i);
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ void _lv_style_set_int(lv_style_t * style, lv_style_property_t prop, lv_style_in
|
||||
|
||||
/*Add new property if not exists yet*/
|
||||
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(lv_style_int_t));
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
|
||||
uint8_t end_mark_size = sizeof(end_mark);
|
||||
|
||||
uint16_t size = _lv_style_get_mem_size(style);
|
||||
@@ -424,7 +424,7 @@ void _lv_style_set_color(lv_style_t * style, lv_style_property_t prop, lv_color_
|
||||
|
||||
/*Add new property if not exists yet*/
|
||||
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(lv_color_t));
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
|
||||
uint8_t end_mark_size = sizeof(end_mark);
|
||||
|
||||
uint16_t size = _lv_style_get_mem_size(style);
|
||||
@@ -471,7 +471,7 @@ void _lv_style_set_opa(lv_style_t * style, lv_style_property_t prop, lv_opa_t op
|
||||
|
||||
/*Add new property if not exists yet*/
|
||||
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(lv_opa_t));
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
|
||||
uint8_t end_mark_size = sizeof(end_mark);
|
||||
|
||||
uint16_t size = _lv_style_get_mem_size(style);
|
||||
@@ -518,7 +518,7 @@ void _lv_style_set_ptr(lv_style_t * style, lv_style_property_t prop, const void
|
||||
|
||||
/*Add new property if not exists yet*/
|
||||
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(const void *));
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
|
||||
uint8_t end_mark_size = sizeof(end_mark);
|
||||
|
||||
uint16_t size = _lv_style_get_mem_size(style);
|
||||
@@ -732,7 +732,6 @@ lv_style_t * _lv_style_list_add_trans_style(lv_style_list_t * list)
|
||||
return trans_style;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set a local integer typed property in a style list.
|
||||
* @param list pointer to a style list where the local property should be set
|
||||
@@ -797,8 +796,6 @@ void _lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t pr
|
||||
_lv_style_set_ptr(local, prop, value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get an integer typed property from a style list.
|
||||
* It will return the property which match best with given state.
|
||||
@@ -827,8 +824,9 @@ lv_res_t _lv_style_list_get_int(lv_style_list_t * list, lv_style_property_t prop
|
||||
|
||||
int16_t ci;
|
||||
for(ci = 0; ci < list->style_cnt; ci++) {
|
||||
lv_style_t * class = lv_style_list_get_style(list, ci);
|
||||
int16_t weight_act = _lv_style_get_int(class, prop, &value_act);
|
||||
/* changed class to _class to allow compilation as c++ */
|
||||
lv_style_t * _class = lv_style_list_get_style(list, ci);
|
||||
int16_t weight_act = _lv_style_get_int(_class, prop, &value_act);
|
||||
|
||||
/*On perfect match return the value immediately*/
|
||||
if(weight_act == weight_goal) {
|
||||
@@ -880,8 +878,8 @@ lv_res_t _lv_style_list_get_color(lv_style_list_t * list, lv_style_property_t pr
|
||||
|
||||
int16_t ci;
|
||||
for(ci = 0; ci < list->style_cnt; ci++) {
|
||||
lv_style_t * class = lv_style_list_get_style(list, ci);
|
||||
int16_t weight_act = _lv_style_get_color(class, prop, &value_act);
|
||||
lv_style_t * _class = lv_style_list_get_style(list, ci);
|
||||
int16_t weight_act = _lv_style_get_color(_class, prop, &value_act);
|
||||
/*On perfect match return the value immediately*/
|
||||
if(weight_act == weight_goal) {
|
||||
*res = value_act;
|
||||
@@ -930,8 +928,8 @@ lv_res_t _lv_style_list_get_opa(lv_style_list_t * list, lv_style_property_t prop
|
||||
|
||||
int16_t ci;
|
||||
for(ci = 0; ci < list->style_cnt; ci++) {
|
||||
lv_style_t * class = lv_style_list_get_style(list, ci);
|
||||
int16_t weight_act = _lv_style_get_opa(class, prop, &value_act);
|
||||
lv_style_t * _class = lv_style_list_get_style(list, ci);
|
||||
int16_t weight_act = _lv_style_get_opa(_class, prop, &value_act);
|
||||
/*On perfect match return the value immediately*/
|
||||
if(weight_act == weight_goal) {
|
||||
*res = value_act;
|
||||
@@ -980,8 +978,8 @@ lv_res_t _lv_style_list_get_ptr(lv_style_list_t * list, lv_style_property_t prop
|
||||
|
||||
int16_t ci;
|
||||
for(ci = 0; ci < list->style_cnt; ci++) {
|
||||
lv_style_t * class = lv_style_list_get_style(list, ci);
|
||||
int16_t weight_act = _lv_style_get_ptr(class, prop, &value_act);
|
||||
lv_style_t * _class = lv_style_list_get_style(list, ci);
|
||||
int16_t weight_act = _lv_style_get_ptr(_class, prop, &value_act);
|
||||
/*On perfect match return the value immediately*/
|
||||
if(weight_act == weight_goal) {
|
||||
*res = value_act;
|
||||
@@ -1068,7 +1066,7 @@ LV_ATTRIBUTE_FAST_MEM static inline int32_t get_property_index(const lv_style_t
|
||||
size_t i = 0;
|
||||
|
||||
uint8_t prop_id;
|
||||
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSEING_PROP) {
|
||||
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSING_PROP) {
|
||||
if(prop_id == id_to_find) {
|
||||
lv_style_attr_t attr_i;
|
||||
attr_i = get_style_prop_attr(style, i);
|
||||
@@ -1168,7 +1166,6 @@ static inline uint8_t get_style_prop_attr(const lv_style_t * style, size_t idx)
|
||||
return ((get_style_prop(style, idx) >> 8) & 0xFFU);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get property size.
|
||||
* @param prop_id property id.
|
||||
|
||||
@@ -29,8 +29,8 @@ extern "C" {
|
||||
#define LV_RADIUS_CIRCLE (0x7FFF) /**< A very big radius to always draw as circle*/
|
||||
LV_EXPORT_CONST_INT(LV_RADIUS_CIRCLE);
|
||||
|
||||
#define LV_DEBUG_STYLE_SENTINEL_VALUE 0x2288AAEE
|
||||
#define LV_DEBUG_STYLE_LIST_SENTINEL_VALUE 0x9977CCBB
|
||||
#define LV_DEBUG_STYLE_SENTINEL_VALUE 0x2288AAEE
|
||||
#define LV_DEBUG_STYLE_LIST_SENTINEL_VALUE 0x9977CCBB
|
||||
|
||||
#define LV_STYLE_PROP_INIT(name, group, id, attr) name = (((group << 4) + id) | ((attr) << 8))
|
||||
|
||||
@@ -39,7 +39,7 @@ LV_EXPORT_CONST_INT(LV_RADIUS_CIRCLE);
|
||||
#define LV_STYLE_ATTR_NONE 0
|
||||
#define LV_STYLE_ATTR_INHERIT (1 << 7)
|
||||
|
||||
#define _LV_STYLE_CLOSEING_PROP 0xFF
|
||||
#define _LV_STYLE_CLOSING_PROP 0xFF
|
||||
|
||||
#define LV_STYLE_TRANS_NUM_MAX 6
|
||||
|
||||
@@ -159,14 +159,15 @@ enum {
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_FONT, 0x7, LV_STYLE_ID_PTR + 0, LV_STYLE_ATTR_NONE),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_STR, 0x7, LV_STYLE_ID_PTR + 1, LV_STYLE_ATTR_NONE),
|
||||
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_LETTER_SPACE, 0x8, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_LINE_SPACE, 0x8, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_DECOR, 0x8, LV_STYLE_ID_VALUE + 2, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_BLEND_MODE, 0x8, LV_STYLE_ID_VALUE + 3, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_COLOR, 0x8, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_SEL_COLOR, 0x8, LV_STYLE_ID_COLOR + 1, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_OPA, 0x8, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_FONT, 0x8, LV_STYLE_ID_PTR + 0, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_LETTER_SPACE, 0x8, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_LINE_SPACE, 0x8, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_DECOR, 0x8, LV_STYLE_ID_VALUE + 2, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_BLEND_MODE, 0x8, LV_STYLE_ID_VALUE + 3, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_COLOR, 0x8, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_SEL_COLOR, 0x8, LV_STYLE_ID_COLOR + 1, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_SEL_BG_COLOR, 0x8, LV_STYLE_ID_COLOR + 2, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_OPA, 0x8, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_INHERIT),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_FONT, 0x8, LV_STYLE_ID_PTR + 0, LV_STYLE_ATTR_INHERIT),
|
||||
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_LINE_WIDTH, 0x9, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_NONE),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_LINE_BLEND_MODE, 0x9, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_NONE),
|
||||
@@ -234,10 +235,10 @@ typedef struct {
|
||||
uint32_t clip_corner_off : 1;
|
||||
uint32_t transform_all_zero : 1;
|
||||
uint32_t pad_all_zero : 1;
|
||||
uint32_t margin_all_zero : 1;
|
||||
uint32_t blend_mode_all_normal : 1;
|
||||
uint32_t bg_opa_transp : 1;
|
||||
uint32_t bg_opa_cover : 1;
|
||||
uint32_t bg_grad_dir_none : 1;
|
||||
|
||||
uint32_t border_width_zero : 1;
|
||||
uint32_t border_side_full : 1;
|
||||
@@ -286,7 +287,7 @@ void lv_style_list_copy(lv_style_list_t * list_dest, const lv_style_list_t * lis
|
||||
|
||||
/**
|
||||
* Add a style to a style list.
|
||||
* Only the the style pointer will be saved so the shouldn't be a local variable.
|
||||
* Only the style pointer will be saved so the shouldn't be a local variable.
|
||||
* (It should be static, global or dynamically allocated)
|
||||
* @param list pointer to a style list
|
||||
* @param style pointer to a style to add
|
||||
@@ -337,7 +338,7 @@ void lv_style_copy(lv_style_t * dest, const lv_style_t * src);
|
||||
/**
|
||||
* Remove a property from a style
|
||||
* @param style pointer to a style
|
||||
* @param prop a style property ORed with a state.
|
||||
* @param prop a style property ORed with a state.
|
||||
* E.g. `LV_STYLE_BORDER_WIDTH | (LV_STATE_PRESSED << LV_STYLE_STATE_POS)`
|
||||
* @return true: the property was found and removed; false: the property wasn't found
|
||||
*/
|
||||
@@ -538,7 +539,6 @@ lv_res_t _lv_style_list_get_int(lv_style_list_t * list, lv_style_property_t prop
|
||||
*/
|
||||
lv_res_t _lv_style_list_get_color(lv_style_list_t * list, lv_style_property_t prop, lv_color_t * res);
|
||||
|
||||
|
||||
/**
|
||||
* Get an opacity typed property from a style list.
|
||||
* It will return the property which match best with given state.
|
||||
@@ -598,8 +598,6 @@ bool lv_debug_check_style_list(const lv_style_list_t * list);
|
||||
*/
|
||||
#define LV_STYLE_CREATE(name, copy_p) static lv_style_t name; lv_style_init(&name); lv_style_copy(&name, copy_p);
|
||||
|
||||
|
||||
|
||||
#if LV_USE_DEBUG
|
||||
|
||||
# ifndef LV_DEBUG_IS_STYLE
|
||||
@@ -618,13 +616,13 @@ bool lv_debug_check_style_list(const lv_style_list_t * list);
|
||||
# define LV_ASSERT_STYLE_LIST(list_p) LV_DEBUG_ASSERT(LV_DEBUG_IS_STYLE_LIST(list_p), "Invalid style list", list_p);
|
||||
# endif
|
||||
# else
|
||||
# define LV_ASSERT_STYLE(style_p) true
|
||||
# define LV_ASSERT_STYLE_LIST(list_p) true
|
||||
# define LV_ASSERT_STYLE(style_p)
|
||||
# define LV_ASSERT_STYLE_LIST(list_p)
|
||||
# endif
|
||||
|
||||
#else
|
||||
# define LV_ASSERT_STYLE(p) true
|
||||
# define LV_ASSERT_STYLE_LIST(p) true
|
||||
# define LV_ASSERT_STYLE(p)
|
||||
# define LV_ASSERT_STYLE_LIST(p)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -34,7 +34,6 @@ typedef struct {
|
||||
const lv_area_t * clip_area;
|
||||
} quarter_draw_dsc_t;
|
||||
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
@@ -42,8 +41,7 @@ static void draw_quarter_0(quarter_draw_dsc_t * q);
|
||||
static void draw_quarter_1(quarter_draw_dsc_t * q);
|
||||
static void draw_quarter_2(quarter_draw_dsc_t * q);
|
||||
static void draw_quarter_3(quarter_draw_dsc_t * q);
|
||||
static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t tickness, lv_area_t * res_area);
|
||||
|
||||
static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness, lv_area_t * res_area);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@@ -331,7 +329,6 @@ static void draw_quarter_2(quarter_draw_dsc_t * q)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void draw_quarter_3(quarter_draw_dsc_t * q)
|
||||
{
|
||||
lv_area_t quarter_area;
|
||||
@@ -385,29 +382,19 @@ static void draw_quarter_3(quarter_draw_dsc_t * q)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t tickness, lv_area_t * res_area)
|
||||
static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness, lv_area_t * res_area)
|
||||
{
|
||||
const uint8_t ps = 8;
|
||||
const uint8_t pa = 127;
|
||||
|
||||
int32_t thick_half = tickness / 2;
|
||||
uint8_t thick_corr = (tickness & 0x01) ? 0 : 1;
|
||||
|
||||
int32_t rx_corr;
|
||||
int32_t ry_corr;
|
||||
|
||||
if(angle > 90 && angle < 270) rx_corr = 0;
|
||||
else rx_corr = 0;
|
||||
|
||||
if(angle > 0 && angle < 180) ry_corr = 0;
|
||||
else ry_corr = 0;
|
||||
int32_t thick_half = thickness / 2;
|
||||
uint8_t thick_corr = (thickness & 0x01) ? 0 : 1;
|
||||
|
||||
int32_t cir_x;
|
||||
int32_t cir_y;
|
||||
|
||||
cir_x = ((radius - rx_corr - thick_half) * _lv_trigo_sin(90 - angle)) >> (LV_TRIGO_SHIFT - ps);
|
||||
cir_y = ((radius - ry_corr - thick_half) * _lv_trigo_sin(angle)) >> (LV_TRIGO_SHIFT - ps);
|
||||
cir_x = ((radius - thick_half) * _lv_trigo_sin(90 - angle)) >> (LV_TRIGO_SHIFT - ps);
|
||||
cir_y = ((radius - thick_half) * _lv_trigo_sin(angle)) >> (LV_TRIGO_SHIFT - ps);
|
||||
|
||||
/* Actually the center of the pixel need to be calculated so apply 1/2 px offset*/
|
||||
if(cir_x > 0) {
|
||||
@@ -432,4 +419,3 @@ static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t tickness,
|
||||
res_area->y2 = cir_y + thick_half - thick_corr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,13 @@
|
||||
#include "../lv_hal/lv_hal_disp.h"
|
||||
#include "../lv_core/lv_refr.h"
|
||||
|
||||
#include "../lv_gpu/lv_gpu_stm32_dma2d.h"
|
||||
#if LV_USE_GPU_NXP_PXP
|
||||
#include "../lv_gpu/lv_gpu_nxp_pxp.h"
|
||||
#elif LV_USE_GPU_NXP_VG_LITE
|
||||
#include "../lv_gpu/lv_gpu_nxp_vglite.h"
|
||||
#elif LV_USE_GPU_STM32_DMA2D
|
||||
#include "../lv_gpu/lv_gpu_stm32_dma2d.h"
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -64,7 +70,7 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
|
||||
#if LV_USE_GPU || LV_USE_GPU_STM32_DMA2D
|
||||
#if (LV_USE_GPU || LV_USE_GPU_STM32_DMA2D) && (LV_USE_GPU_NXP_PXP == 0) && (LV_USE_GPU_NXP_VG_LITE == 0)
|
||||
LV_ATTRIBUTE_DMA static lv_color_t blend_buf[LV_HOR_RES_MAX];
|
||||
#endif
|
||||
|
||||
@@ -72,7 +78,6 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
|
||||
#define FILL_NORMAL_MASK_PX(out_x, color) \
|
||||
if(*mask_tmp_x) { \
|
||||
if(*mask_tmp_x == LV_OPA_COVER) disp_buf_first[out_x] = color; \
|
||||
@@ -80,7 +85,6 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co
|
||||
} \
|
||||
mask_tmp_x++;
|
||||
|
||||
|
||||
#define FILL_NORMAL_MASK_PX_SCR_TRANSP(out_x, color) \
|
||||
if(*mask_tmp_x) { \
|
||||
if(*mask_tmp_x == LV_OPA_COVER) disp_buf_first[out_x] = color; \
|
||||
@@ -90,7 +94,6 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co
|
||||
} \
|
||||
mask_tmp_x++;
|
||||
|
||||
|
||||
#define MAP_NORMAL_MASK_PX(x) \
|
||||
if(*mask_tmp_x) { \
|
||||
if(*mask_tmp_x == LV_OPA_COVER) disp_buf_first[x] = map_buf_first[x]; \
|
||||
@@ -111,7 +114,6 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
|
||||
/**
|
||||
* Fill and area in the display buffer.
|
||||
* @param clip_area clip the fill to this area (absolute coordinates)
|
||||
@@ -138,6 +140,7 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_
|
||||
const lv_area_t * disp_area = &vdb->area;
|
||||
lv_color_t * disp_buf = vdb->buf_act;
|
||||
|
||||
if(disp->driver.gpu_wait_cb) disp->driver.gpu_wait_cb(&disp->driver);
|
||||
|
||||
/* Get clipped fill area which is the real draw area.
|
||||
* It is always the same or inside `fill_area` */
|
||||
@@ -188,7 +191,7 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_
|
||||
* @param mask_res LV_MASK_RES_COVER: the mask has only 0xff values (no mask),
|
||||
* LV_MASK_RES_TRANSP: the mask has only 0x00 values (full transparent),
|
||||
* LV_MASK_RES_CHANGED: the mask has mixed values
|
||||
* @param opa overall opacity in 0x00..0xff range
|
||||
* @param opa overall opacity in 0x00..0xff range
|
||||
* @param mode blend mode from `lv_blend_mode_t`
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_area_t * map_area,
|
||||
@@ -212,6 +215,8 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_a
|
||||
const lv_area_t * disp_area = &vdb->area;
|
||||
lv_color_t * disp_buf = vdb->buf_act;
|
||||
|
||||
if(disp->driver.gpu_wait_cb) disp->driver.gpu_wait_cb(&disp->driver);
|
||||
|
||||
/* Now `draw_area` has absolute coordinates.
|
||||
* Make it relative to `disp_area` to simplify draw to `disp_buf`*/
|
||||
draw_area.x1 -= disp_area->x1;
|
||||
@@ -243,7 +248,6 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_a
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
@@ -327,18 +331,28 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
|
||||
/*Simple fill (maybe with opacity), no masking*/
|
||||
if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) {
|
||||
if(opa > LV_OPA_MAX) {
|
||||
#if LV_USE_GPU
|
||||
if(disp->driver.gpu_fill_cb && lv_area_get_size(draw_area) > GPU_SIZE_LIMIT) {
|
||||
disp->driver.gpu_fill_cb(&disp->driver, disp_buf, disp_w, draw_area, color);
|
||||
#if LV_USE_GPU_NXP_PXP
|
||||
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_PXP_FILL_SIZE_LIMIT) {
|
||||
lv_gpu_nxp_pxp_fill(disp_buf, disp_w, draw_area, color, opa);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_GPU_STM32_DMA2D
|
||||
#elif LV_USE_GPU_NXP_VG_LITE
|
||||
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_VG_LITE_FILL_SIZE_LIMIT) {
|
||||
if(lv_gpu_nxp_vglite_fill(disp_buf, disp_w, lv_area_get_height(disp_area), draw_area, color, opa) == LV_RES_OK) {
|
||||
return;
|
||||
}
|
||||
/* Fall down to SW render in case of error */
|
||||
}
|
||||
#elif LV_USE_GPU_STM32_DMA2D
|
||||
if(lv_area_get_size(draw_area) >= 240) {
|
||||
lv_gpu_stm32_dma2d_fill(disp_buf_first, disp_w, color, draw_area_w, draw_area_h);
|
||||
return;
|
||||
}
|
||||
#elif LV_USE_GPU
|
||||
if(disp->driver.gpu_fill_cb && lv_area_get_size(draw_area) > GPU_SIZE_LIMIT) {
|
||||
disp->driver.gpu_fill_cb(&disp->driver, disp_buf, disp_w, draw_area, color);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
/*Software rendering*/
|
||||
for(y = 0; y < draw_area_h; y++) {
|
||||
@@ -348,7 +362,20 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
|
||||
}
|
||||
/*No mask with opacity*/
|
||||
else {
|
||||
#if LV_USE_GPU
|
||||
|
||||
#if LV_USE_GPU_NXP_PXP
|
||||
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_PXP_FILL_OPA_SIZE_LIMIT) {
|
||||
lv_gpu_nxp_pxp_fill(disp_buf, disp_w, draw_area, color, opa);
|
||||
return;
|
||||
}
|
||||
#elif LV_USE_GPU_NXP_VG_LITE
|
||||
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_VG_LITE_FILL_OPA_SIZE_LIMIT) {
|
||||
if(lv_gpu_nxp_vglite_fill(disp_buf, disp_w, lv_area_get_height(disp_area), draw_area, color, opa) == LV_RES_OK) {
|
||||
return;
|
||||
}
|
||||
/* Fall down to SW render in case of error */
|
||||
}
|
||||
#elif LV_USE_GPU
|
||||
if(disp->driver.gpu_blend_cb && lv_area_get_size(draw_area) > GPU_SIZE_LIMIT) {
|
||||
for(x = 0; x < draw_area_w ; x++) blend_buf[x].full = color.full;
|
||||
|
||||
@@ -360,7 +387,6 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if LV_USE_GPU_STM32_DMA2D
|
||||
if(lv_area_get_size(draw_area) >= 240) {
|
||||
if(blend_buf[0].full != color.full) lv_color_fill(blend_buf, color, LV_HOR_RES_MAX);
|
||||
@@ -368,6 +394,7 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
|
||||
lv_coord_t line_h = LV_HOR_RES_MAX / draw_area_w;
|
||||
for(y = 0; y <= draw_area_h - line_h; y += line_h) {
|
||||
lv_gpu_stm32_dma2d_blend(disp_buf_first, disp_w, blend_buf, opa, draw_area_w, draw_area_w, line_h);
|
||||
lv_gpu_stm32_dma2d_wait_cb(NULL);
|
||||
disp_buf_first += disp_w * line_h;
|
||||
}
|
||||
|
||||
@@ -417,7 +444,6 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*Buffer the result color to avoid recalculating the same color*/
|
||||
lv_color_t last_dest_color;
|
||||
lv_color_t last_res_color;
|
||||
@@ -548,7 +574,6 @@ static void fill_blended(const lv_area_t * disp_area, lv_color_t * disp_buf, co
|
||||
/*Create a temp. disp_buf which always point to current line to draw*/
|
||||
lv_color_t * disp_buf_tmp = disp_buf + disp_w * draw_area->y1;
|
||||
|
||||
|
||||
lv_color_t (*blend_fp)(lv_color_t, lv_color_t, lv_opa_t);
|
||||
switch(mode) {
|
||||
case LV_BLEND_MODE_ADDITIVE:
|
||||
@@ -723,7 +748,42 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col
|
||||
#endif
|
||||
|
||||
if(opa > LV_OPA_MAX) {
|
||||
#if LV_USE_GPU_STM32_DMA2D
|
||||
#if LV_USE_GPU_NXP_PXP
|
||||
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_PXP_BLIT_SIZE_LIMIT) {
|
||||
lv_gpu_nxp_pxp_blit(disp_buf_first, disp_w, map_buf_first, map_w, draw_area_w, draw_area_h, opa);
|
||||
return;
|
||||
}
|
||||
#elif (LV_USE_GPU_NXP_VG_LITE)
|
||||
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_VG_LITE_BLIT_SIZE_LIMIT) {
|
||||
|
||||
lv_gpu_nxp_vglite_blit_info_t blit;
|
||||
|
||||
blit.src = map_buf;
|
||||
blit.src_width = draw_area_w;
|
||||
blit.src_height = draw_area_h;
|
||||
blit.src_stride = lv_area_get_width(map_area) * sizeof(lv_color_t);
|
||||
blit.src_area.x1 = (draw_area->x1 - (map_area->x1 - disp_area->x1));
|
||||
blit.src_area.y1 = (draw_area->y1 - (map_area->y1 - disp_area->y1));
|
||||
blit.src_area.x2 = blit.src_area.x1 + draw_area_w;
|
||||
blit.src_area.y2 = blit.src_area.y1 + draw_area_h;
|
||||
|
||||
blit.dst = disp_buf;
|
||||
blit.dst_width = lv_area_get_width(disp_area);
|
||||
blit.dst_height = lv_area_get_height(disp_area);
|
||||
blit.dst_stride = lv_area_get_width(disp_area) * sizeof(lv_color_t);
|
||||
blit.dst_area.x1 = draw_area->x1;
|
||||
blit.dst_area.y1 = draw_area->y1;
|
||||
blit.dst_area.x2 = blit.dst_area.x1 + draw_area_w;
|
||||
blit.dst_area.y2 = blit.dst_area.y1 + draw_area_h;
|
||||
|
||||
blit.opa = opa;
|
||||
|
||||
if(lv_gpu_nxp_vglite_blit(&blit) == LV_RES_OK) {
|
||||
return;
|
||||
}
|
||||
/* Fall down to SW render in case of error */
|
||||
}
|
||||
#elif LV_USE_GPU_STM32_DMA2D
|
||||
if(lv_area_get_size(draw_area) >= 240) {
|
||||
lv_gpu_stm32_dma2d_copy(disp_buf_first, disp_w, map_buf_first, map_w, draw_area_w, draw_area_h);
|
||||
return;
|
||||
@@ -738,7 +798,42 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col
|
||||
}
|
||||
}
|
||||
else {
|
||||
#if LV_USE_GPU_STM32_DMA2D
|
||||
#if LV_USE_GPU_NXP_PXP
|
||||
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_PXP_BLIT_OPA_SIZE_LIMIT) {
|
||||
lv_gpu_nxp_pxp_blit(disp_buf_first, disp_w, map_buf_first, map_w, draw_area_w, draw_area_h, opa);
|
||||
return;
|
||||
}
|
||||
#elif (LV_USE_GPU_NXP_VG_LITE)
|
||||
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_VG_LITE_BLIT_OPA_SIZE_LIMIT) {
|
||||
|
||||
lv_gpu_nxp_vglite_blit_info_t blit;
|
||||
|
||||
blit.src = map_buf;
|
||||
blit.src_width = lv_area_get_width(map_area);
|
||||
blit.src_height = lv_area_get_height(map_area);
|
||||
blit.src_stride = lv_area_get_width(map_area) * sizeof(lv_color_t);
|
||||
blit.src_area.x1 = (draw_area->x1 - (map_area->x1 - disp_area->x1));
|
||||
blit.src_area.y1 = (draw_area->y1 - (map_area->y1 - disp_area->y1));
|
||||
blit.src_area.x2 = blit.src_area.x1 + draw_area_w;
|
||||
blit.src_area.y2 = blit.src_area.y1 + draw_area_h;
|
||||
|
||||
blit.dst = disp_buf;
|
||||
blit.dst_width = lv_area_get_width(disp_area);
|
||||
blit.dst_height = lv_area_get_height(disp_area);
|
||||
blit.dst_stride = lv_area_get_width(disp_area) * sizeof(lv_color_t);
|
||||
blit.dst_area.x1 = draw_area->x1;
|
||||
blit.dst_area.y1 = draw_area->y1;
|
||||
blit.dst_area.x2 = blit.dst_area.x1 + draw_area_w;
|
||||
blit.dst_area.y2 = blit.dst_area.y1 + draw_area_h;
|
||||
|
||||
blit.opa = opa;
|
||||
|
||||
if(lv_gpu_nxp_vglite_blit(&blit) == LV_RES_OK) {
|
||||
return;
|
||||
}
|
||||
/* Fall down to SW render in case of error */
|
||||
}
|
||||
#elif LV_USE_GPU_STM32_DMA2D
|
||||
if(lv_area_get_size(draw_area) >= 240) {
|
||||
lv_gpu_stm32_dma2d_blend(disp_buf_first, disp_w, map_buf_first, opa, map_w, draw_area_w, draw_area_h);
|
||||
return;
|
||||
|
||||
@@ -42,7 +42,6 @@ typedef uint8_t lv_blend_mode_t;
|
||||
LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_area_t * fill_area, lv_color_t color,
|
||||
lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode);
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_area_t * map_area,
|
||||
const lv_color_t * map_buf,
|
||||
lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode);
|
||||
|
||||
@@ -13,8 +13,11 @@
|
||||
#include "../lv_core/lv_refr.h"
|
||||
#include "../lv_misc/lv_mem.h"
|
||||
#include "../lv_misc/lv_math.h"
|
||||
#include "../lv_gpu/lv_gpu_stm32_dma2d.h"
|
||||
|
||||
#if LV_USE_GPU_STM32_DMA2D
|
||||
#include "../lv_gpu/lv_gpu_stm32_dma2d.h"
|
||||
#elif LV_USE_GPU_NXP_PXP
|
||||
#include "../lv_gpu/lv_gpu_nxp_pxp.h"
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -37,6 +40,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
||||
bool chroma_key, bool alpha_byte);
|
||||
|
||||
static void show_error(const lv_area_t * coords, const lv_area_t * clip_area, const char * msg);
|
||||
static void draw_cleanup(lv_img_cache_entry_t * cache);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@@ -264,9 +268,10 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords,
|
||||
lv_area_t mask_com; /*Common area of mask and coords*/
|
||||
bool union_ok;
|
||||
union_ok = _lv_area_intersect(&mask_com, clip_area, &map_area_rot);
|
||||
/*Out of mask. There is nothing to draw so the image is drawn successfully.*/
|
||||
if(union_ok == false) {
|
||||
return LV_RES_OK; /*Out of mask. There is nothing to draw so the image is drawn
|
||||
successfully.*/
|
||||
draw_cleanup(cdsc);
|
||||
return LV_RES_OK;
|
||||
}
|
||||
|
||||
lv_draw_map(coords, &mask_com, cdsc->dec_dsc.img_data, draw_dsc, chroma_keyed, alpha_byte);
|
||||
@@ -276,9 +281,10 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords,
|
||||
lv_area_t mask_com; /*Common area of mask and coords*/
|
||||
bool union_ok;
|
||||
union_ok = _lv_area_intersect(&mask_com, clip_area, coords);
|
||||
/*Out of mask. There is nothing to draw so the image is drawn successfully.*/
|
||||
if(union_ok == false) {
|
||||
return LV_RES_OK; /*Out of mask. There is nothing to draw so the image is drawn
|
||||
successfully.*/
|
||||
draw_cleanup(cdsc);
|
||||
return LV_RES_OK;
|
||||
}
|
||||
|
||||
int32_t width = lv_area_get_width(&mask_com);
|
||||
@@ -303,10 +309,10 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords,
|
||||
lv_img_decoder_close(&cdsc->dec_dsc);
|
||||
LV_LOG_WARN("Image draw can't read the line");
|
||||
_lv_mem_buf_release(buf);
|
||||
draw_cleanup(cdsc);
|
||||
return LV_RES_INV;
|
||||
}
|
||||
|
||||
|
||||
lv_draw_map(&line, &mask_line, buf, draw_dsc, chroma_keyed, alpha_byte);
|
||||
line.y1++;
|
||||
line.y2++;
|
||||
@@ -315,6 +321,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords,
|
||||
_lv_mem_buf_release(buf);
|
||||
}
|
||||
|
||||
draw_cleanup(cdsc);
|
||||
return LV_RES_OK;
|
||||
}
|
||||
|
||||
@@ -355,6 +362,23 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
||||
_lv_blend_map(clip_area, map_area, (lv_color_t *)map_p, NULL, LV_DRAW_MASK_RES_FULL_COVER, draw_dsc->opa,
|
||||
draw_dsc->blend_mode);
|
||||
}
|
||||
#if LV_USE_GPU_NXP_PXP
|
||||
/* Simple case without masking and transformations */
|
||||
else if(other_mask_cnt == 0 && draw_dsc->angle == 0 && draw_dsc->zoom == LV_IMG_ZOOM_NONE && alpha_byte == false &&
|
||||
chroma_key == true && draw_dsc->recolor_opa == LV_OPA_TRANSP) { /* copy with color keying (+ alpha) */
|
||||
lv_gpu_nxp_pxp_enable_color_key();
|
||||
_lv_blend_map(clip_area, map_area, (lv_color_t *)map_p, NULL, LV_DRAW_MASK_RES_FULL_COVER, draw_dsc->opa,
|
||||
draw_dsc->blend_mode);
|
||||
lv_gpu_nxp_pxp_disable_color_key();
|
||||
}
|
||||
else if(other_mask_cnt == 0 && draw_dsc->angle == 0 && draw_dsc->zoom == LV_IMG_ZOOM_NONE && alpha_byte == false &&
|
||||
chroma_key == false && draw_dsc->recolor_opa != LV_OPA_TRANSP) { /* copy with recolor (+ alpha) */
|
||||
lv_gpu_nxp_pxp_enable_recolor(draw_dsc->recolor, draw_dsc->recolor_opa);
|
||||
_lv_blend_map(clip_area, map_area, (lv_color_t *)map_p, NULL, LV_DRAW_MASK_RES_FULL_COVER, draw_dsc->opa,
|
||||
draw_dsc->blend_mode);
|
||||
lv_gpu_nxp_pxp_disable_recolor();
|
||||
}
|
||||
#endif
|
||||
/*In the other cases every pixel need to be checked one-by-one*/
|
||||
else {
|
||||
/*The pixel size in byte is different if an alpha byte is added too*/
|
||||
@@ -399,7 +423,8 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
uint32_t mask_buf_size = lv_area_get_size(&draw_area) > LV_HOR_RES_MAX ? LV_HOR_RES_MAX : lv_area_get_size(&draw_area);
|
||||
uint32_t hor_res = (uint32_t) lv_disp_get_hor_res(disp);
|
||||
uint32_t mask_buf_size = lv_area_get_size(&draw_area) > (uint32_t) hor_res ? hor_res : lv_area_get_size(&draw_area);
|
||||
lv_color_t * map2 = _lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t));
|
||||
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
|
||||
|
||||
@@ -449,7 +474,8 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
||||
/*Most complicated case: transform or other mask or chroma keyed*/
|
||||
else {
|
||||
/*Build the image and a mask line-by-line*/
|
||||
uint32_t mask_buf_size = lv_area_get_size(&draw_area) > LV_HOR_RES_MAX ? LV_HOR_RES_MAX : lv_area_get_size(&draw_area);
|
||||
uint32_t hor_res = (uint32_t) lv_disp_get_hor_res(disp);
|
||||
uint32_t mask_buf_size = lv_area_get_size(&draw_area) > hor_res ? hor_res : lv_area_get_size(&draw_area);
|
||||
lv_color_t * map2 = _lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t));
|
||||
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
|
||||
|
||||
@@ -485,7 +511,6 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
||||
mask_res = (alpha_byte || chroma_key || draw_dsc->angle ||
|
||||
draw_dsc->zoom != LV_IMG_ZOOM_NONE) ? LV_DRAW_MASK_RES_CHANGED : LV_DRAW_MASK_RES_FULL_COVER;
|
||||
|
||||
|
||||
/*Prepare the `mask_buf`if there are other masks*/
|
||||
if(other_mask_cnt) {
|
||||
_lv_memset_ff(mask_buf, mask_buf_size);
|
||||
@@ -505,7 +530,6 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
||||
#endif
|
||||
for(x = 0; x < draw_area_w; x++, map_px += px_size_byte, px_i++) {
|
||||
|
||||
|
||||
#if LV_USE_IMG_TRANSFORM
|
||||
if(transform) {
|
||||
|
||||
@@ -529,7 +553,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
||||
lv_opa_t px_opa = map_px[LV_IMG_PX_SIZE_ALPHA_BYTE - 1];
|
||||
mask_buf[px_i] = px_opa;
|
||||
if(px_opa == 0) {
|
||||
#if LV_COLOR_DEPTH == 32
|
||||
#if LV_COLOR_DEPTH == 32
|
||||
map2[px_i].full = 0;
|
||||
#endif
|
||||
continue;
|
||||
@@ -552,7 +576,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
||||
if(chroma_key) {
|
||||
if(c.full == chroma_keyed_color.full) {
|
||||
mask_buf[px_i] = LV_OPA_TRANSP;
|
||||
#if LV_COLOR_DEPTH == 32
|
||||
#if LV_COLOR_DEPTH == 32
|
||||
map2[px_i].full = 0;
|
||||
#endif
|
||||
continue;
|
||||
@@ -627,3 +651,12 @@ static void show_error(const lv_area_t * coords, const lv_area_t * clip_area, co
|
||||
lv_draw_label(coords, clip_area, &label_dsc, msg, NULL);
|
||||
}
|
||||
|
||||
static void draw_cleanup(lv_img_cache_entry_t * cache)
|
||||
{
|
||||
/*Automatically close images with no caching*/
|
||||
#if LV_IMG_CACHE_DEF_SIZE == 0
|
||||
lv_img_decoder_close(&cache->dec_dsc);
|
||||
#else
|
||||
LV_UNUSED(cache);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -88,9 +88,8 @@ bool lv_img_cf_is_chroma_keyed(lv_img_cf_t cf);
|
||||
*/
|
||||
bool lv_img_cf_has_alpha(lv_img_cf_t cf);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_TEMPL_H*/
|
||||
#endif /*LV_DRAW_IMG_H*/
|
||||
|
||||
@@ -41,7 +41,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_
|
||||
static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_dsc_t * g, const lv_area_t * clip_area,
|
||||
const uint8_t * map_p, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode);
|
||||
|
||||
|
||||
static uint8_t hex_char_to_num(char hex);
|
||||
|
||||
/**********************
|
||||
@@ -98,7 +97,8 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc)
|
||||
dsc->font = LV_THEME_DEFAULT_FONT_NORMAL;
|
||||
dsc->sel_start = LV_DRAW_LABEL_NO_TXT_SEL;
|
||||
dsc->sel_end = LV_DRAW_LABEL_NO_TXT_SEL;
|
||||
dsc->sel_color = LV_COLOR_BLUE;
|
||||
dsc->sel_color = LV_COLOR_BLACK;
|
||||
dsc->sel_bg_color = LV_COLOR_BLUE;
|
||||
dsc->bidi_dir = LV_BIDI_DIR_LTR;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,6 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
|
||||
bool clip_ok = _lv_area_intersect(&clipped_area, coords, mask);
|
||||
if(!clip_ok) return;
|
||||
|
||||
|
||||
if((dsc->flag & LV_TXT_FLAG_EXPAND) == 0) {
|
||||
/*Normally use the label's width as width*/
|
||||
w = lv_area_get_width(coords);
|
||||
@@ -220,7 +219,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
|
||||
if((dsc->decor & LV_TEXT_DECOR_UNDERLINE) || (dsc->decor & LV_TEXT_DECOR_STRIKETHROUGH)) {
|
||||
lv_draw_line_dsc_init(&line_dsc);
|
||||
line_dsc.color = dsc->color;
|
||||
line_dsc.width = font->underline_thickness ? font->underline_thickness : LV_MATH_MAX(font->line_height / 10, 1);
|
||||
line_dsc.width = font->underline_thickness ? font->underline_thickness : 1;
|
||||
line_dsc.opa = dsc->opa;
|
||||
line_dsc.blend_mode = dsc->blend_mode;
|
||||
}
|
||||
@@ -231,10 +230,9 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
|
||||
lv_color_t recolor;
|
||||
int32_t letter_w;
|
||||
|
||||
|
||||
lv_draw_rect_dsc_t draw_dsc_sel;
|
||||
lv_draw_rect_dsc_init(&draw_dsc_sel);
|
||||
draw_dsc_sel.bg_color = dsc->sel_color;
|
||||
draw_dsc_sel.bg_color = dsc->sel_bg_color;
|
||||
|
||||
int32_t pos_x_start = pos.x;
|
||||
/*Write out all lines*/
|
||||
@@ -320,6 +318,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
|
||||
sel_coords.x2 = pos.x + letter_w + dsc->letter_space - 1;
|
||||
sel_coords.y2 = pos.y + line_height - 1;
|
||||
lv_draw_rect(&sel_coords, mask, &draw_dsc_sel);
|
||||
color = dsc->sel_color;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,7 +386,6 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
|
||||
/**
|
||||
* Draw a letter in the Virtual Display Buffer
|
||||
* @param pos_p left-top coordinate of the latter
|
||||
@@ -413,7 +411,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_letter(const lv_point_t * pos_p, const
|
||||
lv_font_glyph_dsc_t g;
|
||||
bool g_ret = lv_font_get_glyph_dsc(font_p, &g, letter, '\0');
|
||||
if(g_ret == false) {
|
||||
/* Add waring if the dsc is not found
|
||||
/* Add warning if the dsc is not found
|
||||
* but do not print warning for non printable ASCII chars (e.g. '\n')*/
|
||||
if(letter >= 0x20) {
|
||||
LV_LOG_WARN("lv_draw_letter: glyph dsc. not found");
|
||||
@@ -435,7 +433,6 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_letter(const lv_point_t * pos_p, const
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const uint8_t * map_p = lv_font_get_glyph_bitmap(font_p, letter);
|
||||
if(map_p == NULL) {
|
||||
LV_LOG_WARN("lv_draw_letter: character's bitmap not found");
|
||||
@@ -450,7 +447,6 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_letter(const lv_point_t * pos_p, const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_dsc_t * g,
|
||||
const lv_area_t * clip_area,
|
||||
const uint8_t * map_p, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode)
|
||||
@@ -522,7 +518,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_
|
||||
uint32_t col_bit;
|
||||
col_bit = bit_ofs & 0x7; /* "& 0x7" equals to "% 8" just faster */
|
||||
|
||||
uint32_t mask_buf_size = box_w * box_h > LV_HOR_RES_MAX ? LV_HOR_RES_MAX : box_w * box_h;
|
||||
lv_coord_t hor_res = lv_disp_get_hor_res(_lv_refr_get_disp_refreshing());
|
||||
uint32_t mask_buf_size = box_w * box_h > hor_res ? hor_res : box_w * box_h;
|
||||
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
|
||||
int32_t mask_p = 0;
|
||||
|
||||
@@ -566,7 +563,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_
|
||||
mask_p++;
|
||||
}
|
||||
|
||||
|
||||
/*Apply masks if any*/
|
||||
if(other_mask_cnt) {
|
||||
lv_draw_mask_res_t mask_res = lv_draw_mask_apply(mask_buf + mask_p_start, fill_area.x1, fill_area.y2,
|
||||
@@ -644,7 +640,6 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_
|
||||
int32_t box_h = g->box_h;
|
||||
int32_t width_bit = box_w * bpp; /*Letter width in bits*/
|
||||
|
||||
|
||||
/* Calculate the col/row start/end on the map*/
|
||||
int32_t col_start = pos_x >= clip_area->x1 ? 0 : (clip_area->x1 - pos_x) * 3;
|
||||
int32_t col_end = pos_x + box_w / 3 <= clip_area->x2 ? box_w : (clip_area->x2 - pos_x + 1) * 3;
|
||||
@@ -814,7 +809,6 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert a hexadecimal characters to a number (0..15)
|
||||
* @param hex Pointer to a hexadecimal character (0..9, A..F)
|
||||
|
||||
@@ -29,6 +29,7 @@ extern "C" {
|
||||
typedef struct {
|
||||
lv_color_t color;
|
||||
lv_color_t sel_color;
|
||||
lv_color_t sel_bg_color;
|
||||
const lv_font_t * font;
|
||||
lv_opa_t opa;
|
||||
lv_style_int_t line_space;
|
||||
|
||||
@@ -83,7 +83,6 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_line(const lv_point_t * point1, const lv_poin
|
||||
else if(point1->x == point2->x) draw_line_ver(point1, point2, &clip_line, dsc);
|
||||
else draw_line_skew(point1, point2, &clip_line, dsc);
|
||||
|
||||
|
||||
if(dsc->round_end || dsc->round_start) {
|
||||
lv_draw_rect_dsc_t cir_dsc;
|
||||
lv_draw_rect_dsc_init(&cir_dsc);
|
||||
@@ -217,7 +216,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const lv_point_t * point2,
|
||||
const lv_area_t * clip,
|
||||
const lv_draw_line_dsc_t * dsc)
|
||||
@@ -312,7 +310,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, const lv_point_t * point2,
|
||||
const lv_area_t * clip,
|
||||
const lv_draw_line_dsc_t * dsc)
|
||||
@@ -424,7 +421,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons
|
||||
|
||||
/*Draw the background line by line*/
|
||||
int32_t h;
|
||||
size_t mask_buf_size = LV_MATH_MIN(lv_area_get_size(&draw_area), LV_HOR_RES_MAX);
|
||||
uint32_t hor_res = (uint32_t)lv_disp_get_hor_res(disp);
|
||||
size_t mask_buf_size = LV_MATH_MIN(lv_area_get_size(&draw_area), hor_res);
|
||||
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
|
||||
|
||||
lv_area_t fill_area;
|
||||
|
||||
@@ -51,7 +51,6 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_line(const lv_point_t * point1, const lv_poin
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc);
|
||||
|
||||
|
||||
//! @endcond
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @file lv_mask.c
|
||||
*
|
||||
@@ -16,10 +12,6 @@
|
||||
#include "../lv_misc/lv_debug.h"
|
||||
#include "../lv_misc/lv_gc.h"
|
||||
|
||||
#if defined(LV_GC_INCLUDE)
|
||||
#include LV_GC_INCLUDE
|
||||
#endif /* LV_ENABLE_GC */
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
@@ -288,7 +280,6 @@ void lv_draw_mask_line_angle_init(lv_draw_mask_line_param_t * param, lv_coord_t
|
||||
* Find the degree which keeps the origo in place */
|
||||
if(angle > 180) angle -= 180; /*> 180 will swap the origo*/
|
||||
|
||||
|
||||
int32_t p2x;
|
||||
int32_t p2y;
|
||||
|
||||
@@ -298,7 +289,6 @@ void lv_draw_mask_line_angle_init(lv_draw_mask_line_param_t * param, lv_coord_t
|
||||
lv_draw_mask_line_points_init(param, p1x, py, p2x, p2y, side);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize an angle mask.
|
||||
* @param param pointer to a `lv_draw_mask_param_t` to initialize
|
||||
@@ -364,7 +354,6 @@ void lv_draw_mask_angle_init(lv_draw_mask_angle_param_t * param, lv_coord_t vert
|
||||
lv_draw_mask_line_angle_init(¶m->end_line, vertex_x, vertex_y, end_angle, end_side);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize a fade mask.
|
||||
* @param param param pointer to a `lv_draw_mask_param_t` to initialize
|
||||
@@ -389,7 +378,6 @@ void lv_draw_mask_radius_init(lv_draw_mask_radius_param_t * param, const lv_area
|
||||
param->y_prev_x.i = 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize a fade mask.
|
||||
* @param param pointer to a `lv_draw_mask_param_t` to initialize
|
||||
@@ -412,7 +400,6 @@ void lv_draw_mask_fade_init(lv_draw_mask_fade_param_t * param, const lv_area_t *
|
||||
param->dsc.type = LV_DRAW_MASK_TYPE_FADE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize a map mask.
|
||||
* @param param pointer to a `lv_draw_mask_param_t` to initialize
|
||||
@@ -427,7 +414,6 @@ void lv_draw_mask_map_init(lv_draw_mask_map_param_t * param, const lv_area_t * c
|
||||
param->dsc.type = LV_DRAW_MASK_TYPE_MAP;
|
||||
}
|
||||
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
@@ -465,7 +451,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mas
|
||||
int32_t k = - abs_x;
|
||||
if(k < 0) return LV_DRAW_MASK_RES_TRANSP;
|
||||
if(k >= 0 && k < len) _lv_memset_00(&mask_buf[k], len - k);
|
||||
return LV_DRAW_MASK_RES_CHANGED;
|
||||
return LV_DRAW_MASK_RES_CHANGED;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -475,7 +461,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mas
|
||||
if(k < 0) k = 0;
|
||||
if(k >= len) return LV_DRAW_MASK_RES_TRANSP;
|
||||
else if(k >= 0 && k < len) _lv_memset_00(&mask_buf[0], k);
|
||||
return LV_DRAW_MASK_RES_CHANGED;
|
||||
return LV_DRAW_MASK_RES_CHANGED;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -577,7 +563,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_b
|
||||
if(k >= len) break;
|
||||
}
|
||||
|
||||
|
||||
if(k < len && k >= 0) {
|
||||
int32_t x_inters = (px_h * p->xy_steep) >> 10;
|
||||
m = (x_inters * px_h) >> 9;
|
||||
@@ -586,7 +571,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_b
|
||||
mask_buf[k] = mask_mix(mask_buf[k], m);
|
||||
}
|
||||
|
||||
|
||||
if(p->inv) {
|
||||
k = xei - abs_x;
|
||||
if(k > len) {
|
||||
@@ -751,7 +735,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_
|
||||
return LV_DRAW_MASK_RES_CHANGED;
|
||||
}
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_angle_param_t * p)
|
||||
@@ -759,7 +742,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma
|
||||
int32_t rel_y = abs_y - p->cfg.vertex_p.y;
|
||||
int32_t rel_x = abs_x - p->cfg.vertex_p.x;
|
||||
|
||||
|
||||
if(p->cfg.start_angle < 180 && p->cfg.end_angle < 180 &&
|
||||
p->cfg.start_angle != 0 && p->cfg.end_angle != 0 &&
|
||||
p->cfg.start_angle > p->cfg.end_angle) {
|
||||
@@ -772,7 +754,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma
|
||||
int32_t end_angle_first = (rel_y * p->end_line.xy_steep) >> 10;
|
||||
int32_t start_angle_last = ((rel_y + 1) * p->start_line.xy_steep) >> 10;
|
||||
|
||||
|
||||
/*Do not let the line end cross the vertex else it will affect the opposite part*/
|
||||
if(p->cfg.start_angle > 270 && p->cfg.start_angle <= 359 && start_angle_last < 0) start_angle_last = 0;
|
||||
else if(p->cfg.start_angle > 0 && p->cfg.start_angle <= 90 && start_angle_last < 0) start_angle_last = 0;
|
||||
@@ -782,7 +763,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma
|
||||
else if(p->cfg.end_angle > 0 && p->cfg.end_angle <= 90 && start_angle_last < 0) start_angle_last = 0;
|
||||
else if(p->cfg.end_angle > 90 && p->cfg.end_angle < 270 && start_angle_last > 0) start_angle_last = 0;
|
||||
|
||||
|
||||
int32_t dist = (end_angle_first - start_angle_last) >> 1;
|
||||
|
||||
lv_draw_mask_res_t res1 = LV_DRAW_MASK_RES_FULL_COVER;
|
||||
@@ -1143,7 +1123,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m
|
||||
return LV_DRAW_MASK_RES_CHANGED;
|
||||
}
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_fade(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_fade_param_t * p)
|
||||
@@ -1204,7 +1183,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_map(lv_opa_t * mask
|
||||
const lv_opa_t * map_tmp = p->cfg.map;
|
||||
map_tmp += (abs_y - p->cfg.coords.y1) * lv_area_get_width(&p->cfg.coords);
|
||||
|
||||
|
||||
if(abs_x + len > p->cfg.coords.x2) len -= abs_x + len - p->cfg.coords.x2 - 1;
|
||||
|
||||
if(abs_x < p->cfg.coords.x1) {
|
||||
@@ -1225,7 +1203,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_map(lv_opa_t * mask
|
||||
return LV_DRAW_MASK_RES_CHANGED;
|
||||
}
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static inline lv_opa_t mask_mix(lv_opa_t mask_act, lv_opa_t mask_new)
|
||||
{
|
||||
if(mask_new >= LV_OPA_MAX) return mask_act;
|
||||
|
||||
@@ -36,7 +36,6 @@ enum {
|
||||
|
||||
typedef uint8_t lv_draw_mask_res_t;
|
||||
|
||||
|
||||
enum {
|
||||
LV_DRAW_MASK_TYPE_LINE,
|
||||
LV_DRAW_MASK_TYPE_ANGLE,
|
||||
@@ -102,7 +101,6 @@ typedef struct {
|
||||
/*1: It's a flat line? (Near to horizontal)*/
|
||||
uint8_t flat : 1;
|
||||
|
||||
|
||||
/* Invert the mask. The default is: Keep the left part.
|
||||
* It is used to select left/right/top/bottom*/
|
||||
uint8_t inv: 1;
|
||||
@@ -181,7 +179,6 @@ typedef _lv_draw_mask_saved_t _lv_draw_mask_saved_arr_t[_LV_MASK_MAX_NUM];
|
||||
*/
|
||||
int16_t lv_draw_mask_add(void * param, void * custom_id);
|
||||
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
|
||||
/**
|
||||
@@ -198,7 +195,6 @@ int16_t lv_draw_mask_add(void * param, void * custom_id);
|
||||
LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
|
||||
lv_coord_t len);
|
||||
|
||||
|
||||
//! @endcond
|
||||
|
||||
/**
|
||||
@@ -225,7 +221,6 @@ void * lv_draw_mask_remove_custom(void * custom_id);
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM uint8_t lv_draw_mask_get_cnt(void);
|
||||
|
||||
|
||||
//! @endcond
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,13 +10,14 @@
|
||||
#include "lv_draw_blend.h"
|
||||
#include "lv_draw_mask.h"
|
||||
#include "../lv_misc/lv_math.h"
|
||||
#include "../lv_misc/lv_txt_ap.h"
|
||||
#include "../lv_core/lv_refr.h"
|
||||
#include "../lv_misc/lv_debug.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define SHADOW_UPSACALE_SHIFT 6
|
||||
#define SHADOW_UPSCALE_SHIFT 6
|
||||
#define SHADOW_ENHANCE 1
|
||||
#define SPLIT_LIMIT 50
|
||||
|
||||
@@ -51,7 +52,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t
|
||||
static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, const lv_draw_rect_dsc_t * dsc);
|
||||
#endif
|
||||
static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * area_outer, const lv_area_t * clip,
|
||||
lv_coord_t radius, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode);
|
||||
lv_coord_t radius, bool radius_is_in, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode);
|
||||
LV_ATTRIBUTE_FAST_MEM static inline lv_color_t grad_get(const lv_draw_rect_dsc_t * dsc, lv_coord_t s, lv_coord_t i);
|
||||
|
||||
/**********************
|
||||
@@ -244,7 +245,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are
|
||||
lv_draw_mask_res_t mask_res = LV_DRAW_MASK_RES_FULL_COVER;
|
||||
lv_color_t grad_color = dsc->bg_color;
|
||||
|
||||
|
||||
lv_color_t * grad_map = NULL;
|
||||
/*In case of horizontal gradient pre-compute a line with a gradient*/
|
||||
if(grad_dir == LV_GRAD_DIR_HOR) {
|
||||
@@ -329,7 +329,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are
|
||||
_lv_blend_fill(clip, &fill_area2,
|
||||
grad_color, mask_buf + mask_ofs, mask_res, opa2, dsc->bg_blend_mode);
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
if(grad_dir == LV_GRAD_DIR_HOR) {
|
||||
@@ -362,7 +361,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are
|
||||
if(fill_area.y1 <= fill_area.y2) fill_area.y1 = fill_area.y2 + 1; /*Avoid overdrawing the last line*/
|
||||
fill_area.y2 = coords_bg.y2;
|
||||
|
||||
|
||||
_lv_blend_fill(clip, &fill_area,
|
||||
dsc->bg_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode);
|
||||
|
||||
@@ -410,7 +408,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv
|
||||
area_inner.y2 -= ((dsc->border_side & LV_BORDER_SIDE_BOTTOM) ? dsc->border_width : - (dsc->border_width + rout));
|
||||
|
||||
if(dsc->border_side == LV_BORDER_SIDE_FULL) {
|
||||
draw_full_border(&area_inner, coords, clip, dsc->radius, dsc->border_color, dsc->border_opa, dsc->border_blend_mode);
|
||||
draw_full_border(&area_inner, coords, clip, dsc->radius, false, dsc->border_color, dsc->border_opa,
|
||||
dsc->border_blend_mode);
|
||||
}
|
||||
else {
|
||||
lv_opa_t opa = dsc->border_opa;
|
||||
@@ -587,7 +586,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv
|
||||
short_side = LV_MATH_MIN(lv_area_get_width(&sh_rect_area), lv_area_get_height(&sh_rect_area));
|
||||
if(r_sh > short_side >> 1) r_sh = short_side >> 1;
|
||||
|
||||
|
||||
int32_t corner_size = sw + r_sh;
|
||||
|
||||
lv_opa_t * sh_buf;
|
||||
@@ -914,7 +912,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*Fill the bottom side*/
|
||||
a.x1 = sh_area.x1 + corner_size;
|
||||
a.x2 = sh_area.x2 - corner_size;
|
||||
@@ -1027,10 +1024,10 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord
|
||||
}
|
||||
else {
|
||||
int32_t i;
|
||||
sh_ups_tmp_buf[0] = (mask_line[0] << SHADOW_UPSACALE_SHIFT) / sw;
|
||||
sh_ups_tmp_buf[0] = (mask_line[0] << SHADOW_UPSCALE_SHIFT) / sw;
|
||||
for(i = 1; i < size; i++) {
|
||||
if(mask_line[i] == mask_line[i - 1]) sh_ups_tmp_buf[i] = sh_ups_tmp_buf[i - 1];
|
||||
else sh_ups_tmp_buf[i] = (mask_line[i] << SHADOW_UPSACALE_SHIFT) / sw;
|
||||
else sh_ups_tmp_buf[i] = (mask_line[i] << SHADOW_UPSCALE_SHIFT) / sw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1042,7 +1039,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord
|
||||
int32_t i;
|
||||
lv_opa_t * res_buf = (lv_opa_t *)sh_buf;
|
||||
for(i = 0; i < size * size; i++) {
|
||||
res_buf[i] = (sh_buf[i] >> SHADOW_UPSACALE_SHIFT);
|
||||
res_buf[i] = (sh_buf[i] >> SHADOW_UPSCALE_SHIFT);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1060,10 +1057,10 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord
|
||||
sw += sw_ori & 1;
|
||||
if(sw > 1) {
|
||||
uint32_t i;
|
||||
sh_buf[0] = (sh_buf[0] << SHADOW_UPSACALE_SHIFT) / sw;
|
||||
sh_buf[0] = (sh_buf[0] << SHADOW_UPSCALE_SHIFT) / sw;
|
||||
for(i = 1; i < (uint32_t) size * size; i++) {
|
||||
if(sh_buf[i] == sh_buf[i - 1]) sh_buf[i] = sh_buf[i - 1];
|
||||
else sh_buf[i] = (sh_buf[i] << SHADOW_UPSACALE_SHIFT) / sw;
|
||||
else sh_buf[i] = (sh_buf[i] << SHADOW_UPSCALE_SHIFT) / sw;
|
||||
}
|
||||
|
||||
shadow_blur_corner(size, sw, sh_buf);
|
||||
@@ -1116,14 +1113,14 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t
|
||||
sh_ups_buf[0] = sh_ups_buf[0] / sw;
|
||||
for(i = 1; i < (uint32_t)size * size; i++) {
|
||||
if(sh_ups_buf[i] == sh_ups_buf[i - 1]) sh_ups_buf[i] = sh_ups_buf[i - 1];
|
||||
else sh_ups_buf[i] = sh_ups_buf[i] / sw;
|
||||
else sh_ups_buf[i] = sh_ups_buf[i] / sw;
|
||||
}
|
||||
|
||||
for(x = 0; x < size; x++) {
|
||||
sh_ups_tmp_buf = &sh_ups_buf[x];
|
||||
int32_t v = sh_ups_tmp_buf[0] * sw;
|
||||
for(y = 0; y < size ; y++, sh_ups_tmp_buf += size) {
|
||||
sh_ups_blur_buf[y] = v < 0 ? 0 : (v >> SHADOW_UPSACALE_SHIFT);
|
||||
sh_ups_blur_buf[y] = v < 0 ? 0 : (v >> SHADOW_UPSCALE_SHIFT);
|
||||
|
||||
/*Forget the top pixel*/
|
||||
uint32_t top_val;
|
||||
@@ -1176,7 +1173,7 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, const
|
||||
area_outer.y1 -= dsc->outline_width;
|
||||
area_outer.y2 += dsc->outline_width;
|
||||
|
||||
draw_full_border(&area_inner, &area_outer, clip, dsc->radius, dsc->outline_color, dsc->outline_opa,
|
||||
draw_full_border(&area_inner, &area_outer, clip, dsc->radius, true, dsc->outline_color, dsc->outline_opa,
|
||||
dsc->outline_blend_mode);
|
||||
}
|
||||
#endif
|
||||
@@ -1229,10 +1226,13 @@ static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, const
|
||||
return;
|
||||
}
|
||||
|
||||
/*Can't draw zero sized images*/
|
||||
if(img_w == 0 || img_h == 0) return;
|
||||
|
||||
lv_area_t coords_tmp;
|
||||
lv_draw_mask_radius_param_t radius_mask_param;
|
||||
|
||||
if(dsc->pattern_repeat) {
|
||||
lv_draw_mask_radius_param_t radius_mask_param;
|
||||
lv_draw_mask_radius_init(&radius_mask_param, coords, dsc->radius, false);
|
||||
int16_t radius_mask_id = lv_draw_mask_add(&radius_mask_param, NULL);
|
||||
|
||||
@@ -1271,7 +1271,6 @@ static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, const
|
||||
|
||||
int16_t radius_mask_id = LV_MASK_ID_INV;
|
||||
if(_lv_area_is_in(&coords_tmp, coords, dsc->radius) == false) {
|
||||
lv_draw_mask_radius_param_t radius_mask_param;
|
||||
lv_draw_mask_radius_init(&radius_mask_param, coords, dsc->radius, false);
|
||||
radius_mask_id = lv_draw_mask_add(&radius_mask_param, NULL);
|
||||
}
|
||||
@@ -1284,15 +1283,22 @@ static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, const
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if LV_USE_VALUE_STR
|
||||
static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, const lv_draw_rect_dsc_t * dsc)
|
||||
{
|
||||
if(dsc->value_str == NULL) return;
|
||||
if(dsc->value_opa <= LV_OPA_MIN) return;
|
||||
|
||||
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
|
||||
const char * str = dsc->value_str;
|
||||
#else
|
||||
uint32_t str_len = _lv_txt_ap_calc_bytes_cnt(dsc->value_str);
|
||||
char * str = _lv_mem_buf_get(str_len + 1);
|
||||
_lv_txt_ap_proc(dsc->value_str, str);
|
||||
#endif
|
||||
|
||||
lv_point_t s;
|
||||
_lv_txt_get_size(&s, dsc->value_str, dsc->value_font, dsc->value_letter_space, dsc->value_line_space, LV_COORD_MAX,
|
||||
_lv_txt_get_size(&s, str, dsc->value_font, dsc->value_letter_space, dsc->value_line_space, LV_COORD_MAX,
|
||||
LV_TXT_FLAG_NONE);
|
||||
|
||||
lv_area_t value_area;
|
||||
@@ -1317,12 +1323,16 @@ static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, con
|
||||
label_dsc.color = dsc->value_color;
|
||||
label_dsc.opa = dsc->value_opa;
|
||||
|
||||
lv_draw_label(&value_area, clip, &label_dsc, dsc->value_str, NULL);
|
||||
lv_draw_label(&value_area, clip, &label_dsc, str, NULL);
|
||||
|
||||
#if LV_USE_ARABIC_PERSIAN_CHARS
|
||||
_lv_mem_buf_release(str);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * area_outer, const lv_area_t * clip,
|
||||
lv_coord_t radius, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode)
|
||||
lv_coord_t radius, bool radius_is_in, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode)
|
||||
{
|
||||
uint8_t other_mask_cnt = lv_draw_mask_get_cnt();
|
||||
bool simple_mode = true;
|
||||
@@ -1331,18 +1341,30 @@ static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * are
|
||||
int32_t inner_w = lv_area_get_width(area_inner);
|
||||
int32_t inner_h = lv_area_get_height(area_inner);
|
||||
lv_coord_t border_width = area_outer->x2 - area_inner->x2;
|
||||
int32_t rin = radius;
|
||||
|
||||
int32_t short_side = LV_MATH_MIN(inner_w, inner_h);
|
||||
if(rin > short_side >> 1) rin = short_side >> 1;
|
||||
|
||||
/*Get the outer area*/
|
||||
int32_t rout = rin + border_width;
|
||||
|
||||
int32_t coords_out_w = lv_area_get_width(area_outer);
|
||||
int32_t coords_out_h = lv_area_get_height(area_outer);
|
||||
short_side = LV_MATH_MIN(coords_out_w, coords_out_h);
|
||||
if(rout > short_side >> 1) rout = short_side >> 1;
|
||||
|
||||
int32_t rin;
|
||||
int32_t rout;
|
||||
if(radius_is_in) {
|
||||
rin = radius;
|
||||
int32_t short_side = LV_MATH_MIN(inner_w, inner_h);
|
||||
if(rin > short_side >> 1) rin = short_side >> 1;
|
||||
|
||||
/*Get the outer area*/
|
||||
rout = rin + border_width;
|
||||
}
|
||||
else {
|
||||
rout = radius;
|
||||
int32_t short_side = LV_MATH_MIN(coords_out_w, coords_out_h);
|
||||
if(rout > short_side >> 1) rout = short_side >> 1;
|
||||
|
||||
/*Get the outer area*/
|
||||
rin = rout - border_width;
|
||||
if(rin < 0) rin = 0;
|
||||
|
||||
}
|
||||
|
||||
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
||||
lv_disp_buf_t * vdb = lv_disp_get_buf(disp);
|
||||
@@ -1454,7 +1476,6 @@ static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * are
|
||||
if(mask_ofs < 0) mask_ofs = 0;
|
||||
_lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode);
|
||||
|
||||
|
||||
fill_area.y1++;
|
||||
fill_area.y2++;
|
||||
}
|
||||
@@ -1494,4 +1515,3 @@ static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * are
|
||||
lv_draw_mask_remove_id(mask_rout_id);
|
||||
_lv_mem_buf_release(mask_buf);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,29 +58,53 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
|
||||
if(point_cnt < 3) return;
|
||||
if(points == NULL) return;
|
||||
|
||||
int16_t i;
|
||||
/*Join adjacent points if they are on the same coordinate*/
|
||||
lv_point_t * p = _lv_mem_buf_get(point_cnt * sizeof(lv_point_t));
|
||||
if(p == NULL) return;
|
||||
uint16_t i;
|
||||
uint16_t pcnt = 0;
|
||||
p[0] = points[0];
|
||||
for(i = 0; i < point_cnt - 1; i++) {
|
||||
if(points[i].x != points[i + 1].x || points[i].y != points[i + 1].y) {
|
||||
p[pcnt] = points[i];
|
||||
pcnt++;
|
||||
}
|
||||
}
|
||||
/*The first and the last points are also adjacent */
|
||||
if(points[0].x != points[point_cnt - 1].x || points[0].y != points[point_cnt - 1].y) {
|
||||
p[pcnt] = points[point_cnt - 1];
|
||||
pcnt++;
|
||||
}
|
||||
|
||||
point_cnt = pcnt;
|
||||
if(point_cnt < 3) {
|
||||
_lv_mem_buf_release(p);
|
||||
return;
|
||||
}
|
||||
|
||||
lv_area_t poly_coords = {.x1 = LV_COORD_MAX, .y1 = LV_COORD_MAX, .x2 = LV_COORD_MIN, .y2 = LV_COORD_MIN};
|
||||
|
||||
for(i = 0; i < point_cnt; i++) {
|
||||
poly_coords.x1 = LV_MATH_MIN(poly_coords.x1, points[i].x);
|
||||
poly_coords.y1 = LV_MATH_MIN(poly_coords.y1, points[i].y);
|
||||
poly_coords.x2 = LV_MATH_MAX(poly_coords.x2, points[i].x);
|
||||
poly_coords.y2 = LV_MATH_MAX(poly_coords.y2, points[i].y);
|
||||
poly_coords.x1 = LV_MATH_MIN(poly_coords.x1, p[i].x);
|
||||
poly_coords.y1 = LV_MATH_MIN(poly_coords.y1, p[i].y);
|
||||
poly_coords.x2 = LV_MATH_MAX(poly_coords.x2, p[i].x);
|
||||
poly_coords.y2 = LV_MATH_MAX(poly_coords.y2, p[i].y);
|
||||
}
|
||||
|
||||
|
||||
bool is_common;
|
||||
lv_area_t poly_mask;
|
||||
is_common = _lv_area_intersect(&poly_mask, &poly_coords, clip_area);
|
||||
if(!is_common) return;
|
||||
|
||||
if(!is_common) {
|
||||
_lv_mem_buf_release(p);
|
||||
return;
|
||||
}
|
||||
/*Find the lowest point*/
|
||||
lv_coord_t y_min = points[0].y;
|
||||
lv_coord_t y_min = p[0].y;
|
||||
int16_t y_min_i = 0;
|
||||
|
||||
for(i = 1; i < point_cnt; i++) {
|
||||
if(points[i].y < y_min) {
|
||||
y_min = points[i].y;
|
||||
if(p[i].y < y_min) {
|
||||
y_min = p[i].y;
|
||||
y_min_i = i;
|
||||
}
|
||||
}
|
||||
@@ -94,16 +118,27 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
|
||||
int32_t i_next_right;
|
||||
uint32_t mask_cnt = 0;
|
||||
|
||||
/* Check if the order of points is inverted or not.
|
||||
* The normal case is when the left point is on `y_min_i - 1`*/
|
||||
/*Get the index of the left and right points*/
|
||||
i_next_left = y_min_i - 1;
|
||||
if(i_next_left < 0) i_next_left = point_cnt + i_next_left;
|
||||
|
||||
i_next_right = y_min_i + 1;
|
||||
if(i_next_right > point_cnt - 1) i_next_right = 0;
|
||||
|
||||
/* Check if the order of points is inverted or not.
|
||||
* The normal case is when the left point is on `y_min_i - 1`
|
||||
* Explanation:
|
||||
* if angle(p_left) < angle(p_right) -> inverted
|
||||
* dy_left/dx_left < dy_right/dx_right
|
||||
* dy_left * dx_right < dy_right * dx_left
|
||||
*/
|
||||
lv_coord_t dxl = p[i_next_left].x - p[y_min_i].x;
|
||||
lv_coord_t dxr = p[i_next_right].x - p[y_min_i].x;
|
||||
lv_coord_t dyl = p[i_next_left].y - p[y_min_i].y;
|
||||
lv_coord_t dyr = p[i_next_right].y - p[y_min_i].y;
|
||||
|
||||
bool inv = false;
|
||||
if(points[i_next_left].x > points[i_next_right].x && points[i_next_left].y < points[i_next_right].y) inv = true;
|
||||
if(dyl * dxr < dyr * dxl) inv = true;
|
||||
|
||||
do {
|
||||
if(!inv) {
|
||||
@@ -121,11 +156,11 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
|
||||
if(i_next_right < 0) i_next_right = point_cnt + i_next_right;
|
||||
}
|
||||
|
||||
if(points[i_next_left].y >= points[i_prev_left].y) {
|
||||
if(points[i_next_left].y != points[i_prev_left].y &&
|
||||
points[i_next_left].x != points[i_prev_left].x) {
|
||||
lv_draw_mask_line_points_init(mp_next, points[i_prev_left].x, points[i_prev_left].y,
|
||||
points[i_next_left].x, points[i_next_left].y,
|
||||
if(p[i_next_left].y >= p[i_prev_left].y) {
|
||||
if(p[i_next_left].y != p[i_prev_left].y &&
|
||||
p[i_next_left].x != p[i_prev_left].x) {
|
||||
lv_draw_mask_line_points_init(mp_next, p[i_prev_left].x, p[i_prev_left].y,
|
||||
p[i_next_left].x, p[i_next_left].y,
|
||||
LV_DRAW_MASK_LINE_SIDE_RIGHT);
|
||||
lv_draw_mask_add(mp_next, mp);
|
||||
mp_next++;
|
||||
@@ -136,12 +171,12 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
|
||||
|
||||
if(mask_cnt == point_cnt) break;
|
||||
|
||||
if(points[i_next_right].y >= points[i_prev_right].y) {
|
||||
if(points[i_next_right].y != points[i_prev_right].y &&
|
||||
points[i_next_right].x != points[i_prev_right].x) {
|
||||
if(p[i_next_right].y >= p[i_prev_right].y) {
|
||||
if(p[i_next_right].y != p[i_prev_right].y &&
|
||||
p[i_next_right].x != p[i_prev_right].x) {
|
||||
|
||||
lv_draw_mask_line_points_init(mp_next, points[i_prev_right].x, points[i_prev_right].y,
|
||||
points[i_next_right].x, points[i_next_right].y,
|
||||
lv_draw_mask_line_points_init(mp_next, p[i_prev_right].x, p[i_prev_right].y,
|
||||
p[i_next_right].x, p[i_next_right].y,
|
||||
LV_DRAW_MASK_LINE_SIDE_LEFT);
|
||||
lv_draw_mask_add(mp_next, mp);
|
||||
mp_next++;
|
||||
@@ -157,6 +192,7 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
|
||||
lv_draw_mask_remove_custom(mp);
|
||||
|
||||
_lv_mem_buf_release(mp);
|
||||
_lv_mem_buf_release(p);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
|
||||
/**
|
||||
* Get the color of an image's pixel
|
||||
* @param dsc an image descriptor
|
||||
@@ -411,7 +410,6 @@ uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if LV_USE_IMG_TRANSFORM
|
||||
/**
|
||||
* Initialize a descriptor to transform an image
|
||||
@@ -423,14 +421,14 @@ void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc)
|
||||
dsc->tmp.pivot_y_256 = dsc->cfg.pivot_y * 256;
|
||||
|
||||
int32_t angle_low = dsc->cfg.angle / 10;
|
||||
int32_t angle_hight = angle_low + 1;
|
||||
int32_t angle_high = angle_low + 1;
|
||||
int32_t angle_rem = dsc->cfg.angle - (angle_low * 10);
|
||||
|
||||
int32_t s1 = _lv_trigo_sin(-angle_low);
|
||||
int32_t s2 = _lv_trigo_sin(-angle_hight);
|
||||
int32_t s2 = _lv_trigo_sin(-angle_high);
|
||||
|
||||
int32_t c1 = _lv_trigo_sin(-angle_low + 90);
|
||||
int32_t c2 = _lv_trigo_sin(-angle_hight + 90);
|
||||
int32_t c2 = _lv_trigo_sin(-angle_high + 90);
|
||||
|
||||
dsc->tmp.sinma = (s1 * (10 - angle_rem) + s2 * angle_rem) / 10;
|
||||
dsc->tmp.cosma = (c1 * (10 - angle_rem) + c2 * angle_rem) / 10;
|
||||
@@ -485,7 +483,6 @@ void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
res->x1 = (((-pivot->x) * zoom) >> 8) - 1;
|
||||
res->y1 = (((-pivot->y) * zoom) >> 8) - 1;
|
||||
res->x2 = (((w - pivot->x) * zoom) >> 8) + 2;
|
||||
@@ -500,14 +497,14 @@ void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t
|
||||
}
|
||||
|
||||
int32_t angle_low = angle / 10;
|
||||
int32_t angle_hight = angle_low + 1;
|
||||
int32_t angle_high = angle_low + 1;
|
||||
int32_t angle_rem = angle - (angle_low * 10);
|
||||
|
||||
int32_t s1 = _lv_trigo_sin(angle_low);
|
||||
int32_t s2 = _lv_trigo_sin(angle_hight);
|
||||
int32_t s2 = _lv_trigo_sin(angle_high);
|
||||
|
||||
int32_t c1 = _lv_trigo_sin(angle_low + 90);
|
||||
int32_t c2 = _lv_trigo_sin(angle_hight + 90);
|
||||
int32_t c2 = _lv_trigo_sin(angle_high + 90);
|
||||
|
||||
int32_t sinma = (s1 * (10 - angle_rem) + s2 * angle_rem) / 10;
|
||||
int32_t cosma = (c1 * (10 - angle_rem) + c2 * angle_rem) / 10;
|
||||
@@ -683,4 +680,3 @@ bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc)
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ extern "C" {
|
||||
#include "../lv_misc/lv_color.h"
|
||||
#include "../lv_misc/lv_area.h"
|
||||
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
@@ -101,7 +100,6 @@ enum {
|
||||
};
|
||||
typedef uint8_t lv_img_cf_t;
|
||||
|
||||
|
||||
/**
|
||||
* LVGL image header
|
||||
*/
|
||||
@@ -113,14 +111,13 @@ typedef uint8_t lv_img_cf_t;
|
||||
#if LV_BIG_ENDIAN_SYSTEM
|
||||
typedef struct {
|
||||
|
||||
uint32_t h : 11; /*Height of the image map*/
|
||||
uint32_t h : 11; /*Height of the image map*/
|
||||
uint32_t w : 11; /*Width of the image map*/
|
||||
uint32_t reserved : 2; /*Reserved to be used later*/
|
||||
uint32_t always_zero : 3; /*It the upper bits of the first byte. Always zero to look like a
|
||||
non-printable character*/
|
||||
uint32_t cf : 5; /* Color format: See `lv_img_color_format_t`*/
|
||||
|
||||
|
||||
} lv_img_header_t;
|
||||
#else
|
||||
typedef struct {
|
||||
@@ -132,7 +129,7 @@ typedef struct {
|
||||
uint32_t reserved : 2; /*Reserved to be used later*/
|
||||
|
||||
uint32_t w : 11; /*Width of the image map*/
|
||||
uint32_t h : 11; /*Height of the image map*/
|
||||
uint32_t h : 11; /*Height of the image map*/
|
||||
} lv_img_header_t;
|
||||
#endif
|
||||
|
||||
@@ -163,7 +160,6 @@ typedef struct {
|
||||
lv_opa_t opa;
|
||||
} res;
|
||||
|
||||
|
||||
struct {
|
||||
lv_img_dsc_t img_dsc;
|
||||
int32_t pivot_x_256;
|
||||
@@ -269,7 +265,6 @@ void lv_img_buf_free(lv_img_dsc_t * dsc);
|
||||
*/
|
||||
uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf);
|
||||
|
||||
|
||||
#if LV_USE_IMG_TRANSFORM
|
||||
/**
|
||||
* Initialize a descriptor to rotate an image
|
||||
@@ -283,7 +278,6 @@ void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc);
|
||||
*/
|
||||
bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc);
|
||||
|
||||
|
||||
/**
|
||||
* Get which color and opa would come to a pixel if it were rotated
|
||||
* @param dsc a descriptor initialized by `lv_img_buf_rotate_init`
|
||||
|
||||
@@ -13,13 +13,10 @@
|
||||
#include "../lv_hal/lv_hal_tick.h"
|
||||
#include "../lv_misc/lv_gc.h"
|
||||
|
||||
#if defined(LV_GC_INCLUDE)
|
||||
#include LV_GC_INCLUDE
|
||||
#endif /* LV_ENABLE_GC */
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
/*Decrement life with this value in every open*/
|
||||
/*Decrement life with this value on every open*/
|
||||
#define LV_IMG_CACHE_AGING 1
|
||||
|
||||
/*Boost life by this factor (multiply time_to_open with this value)*/
|
||||
@@ -29,10 +26,6 @@
|
||||
* "die" from very high values */
|
||||
#define LV_IMG_CACHE_LIFE_LIMIT 1000
|
||||
|
||||
#if LV_IMG_CACHE_DEF_SIZE < 1
|
||||
#error "LV_IMG_CACHE_DEF_SIZE must be >= 1. See lv_conf.h"
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
@@ -40,11 +33,16 @@
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
#if LV_IMG_CACHE_DEF_SIZE == 0
|
||||
static lv_img_cache_entry_t cache_temp;
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static uint16_t entry_cnt;
|
||||
#if LV_IMG_CACHE_DEF_SIZE
|
||||
static uint16_t entry_cnt;
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
@@ -64,6 +62,10 @@ static uint16_t entry_cnt;
|
||||
*/
|
||||
lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color)
|
||||
{
|
||||
/*Is the image cached?*/
|
||||
lv_img_cache_entry_t * cached_src = NULL;
|
||||
|
||||
#if LV_IMG_CACHE_DEF_SIZE
|
||||
if(entry_cnt == 0) {
|
||||
LV_LOG_WARN("lv_img_cache_open: the cache size is 0");
|
||||
return NULL;
|
||||
@@ -79,8 +81,6 @@ lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color)
|
||||
}
|
||||
}
|
||||
|
||||
/*Is the image cached?*/
|
||||
lv_img_cache_entry_t * cached_src = NULL;
|
||||
for(i = 0; i < entry_cnt; i++) {
|
||||
bool match = false;
|
||||
lv_img_src_t src_type = lv_img_src_get_type(cache[i].dec_dsc.src);
|
||||
@@ -104,48 +104,51 @@ lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color)
|
||||
}
|
||||
|
||||
/*The image is not cached then cache it now*/
|
||||
if(cached_src == NULL) {
|
||||
/*Find an entry to reuse. Select the entry with the least life*/
|
||||
cached_src = &cache[0];
|
||||
for(i = 1; i < entry_cnt; i++) {
|
||||
if(cache[i].life < cached_src->life) {
|
||||
cached_src = &cache[i];
|
||||
}
|
||||
}
|
||||
if(cached_src) return cached_src;
|
||||
|
||||
/*Close the decoder to reuse if it was opened (has a valid source)*/
|
||||
if(cached_src->dec_dsc.src) {
|
||||
lv_img_decoder_close(&cached_src->dec_dsc);
|
||||
LV_LOG_INFO("image draw: cache miss, close and reuse an entry");
|
||||
/*Find an entry to reuse. Select the entry with the least life*/
|
||||
cached_src = &cache[0];
|
||||
for(i = 1; i < entry_cnt; i++) {
|
||||
if(cache[i].life < cached_src->life) {
|
||||
cached_src = &cache[i];
|
||||
}
|
||||
else {
|
||||
LV_LOG_INFO("image draw: cache miss, cached to an empty entry");
|
||||
}
|
||||
|
||||
/*Open the image and measure the time to open*/
|
||||
uint32_t t_start;
|
||||
t_start = lv_tick_get();
|
||||
cached_src->dec_dsc.time_to_open = 0;
|
||||
lv_res_t open_res = lv_img_decoder_open(&cached_src->dec_dsc, src, color);
|
||||
if(open_res == LV_RES_INV) {
|
||||
LV_LOG_WARN("Image draw cannot open the image resource");
|
||||
lv_img_decoder_close(&cached_src->dec_dsc);
|
||||
_lv_memset_00(&cached_src->dec_dsc, sizeof(lv_img_decoder_dsc_t));
|
||||
_lv_memset_00(cached_src, sizeof(lv_img_cache_entry_t));
|
||||
cached_src->life = INT32_MIN; /*Make the empty entry very "weak" to force its use */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cached_src->life = 0;
|
||||
|
||||
/*If `time_to_open` was not set in the open function set it here*/
|
||||
if(cached_src->dec_dsc.time_to_open == 0) {
|
||||
cached_src->dec_dsc.time_to_open = lv_tick_elaps(t_start);
|
||||
}
|
||||
|
||||
if(cached_src->dec_dsc.time_to_open == 0) cached_src->dec_dsc.time_to_open = 1;
|
||||
}
|
||||
|
||||
/*Close the decoder to reuse if it was opened (has a valid source)*/
|
||||
if(cached_src->dec_dsc.src) {
|
||||
lv_img_decoder_close(&cached_src->dec_dsc);
|
||||
LV_LOG_INFO("image draw: cache miss, close and reuse an entry");
|
||||
}
|
||||
else {
|
||||
LV_LOG_INFO("image draw: cache miss, cached to an empty entry");
|
||||
}
|
||||
|
||||
#else
|
||||
cached_src = &cache_temp;
|
||||
#endif
|
||||
/*Open the image and measure the time to open*/
|
||||
uint32_t t_start;
|
||||
t_start = lv_tick_get();
|
||||
cached_src->dec_dsc.time_to_open = 0;
|
||||
lv_res_t open_res = lv_img_decoder_open(&cached_src->dec_dsc, src, color);
|
||||
if(open_res == LV_RES_INV) {
|
||||
LV_LOG_WARN("Image draw cannot open the image resource");
|
||||
lv_img_decoder_close(&cached_src->dec_dsc);
|
||||
_lv_memset_00(&cached_src->dec_dsc, sizeof(lv_img_decoder_dsc_t));
|
||||
_lv_memset_00(cached_src, sizeof(lv_img_cache_entry_t));
|
||||
cached_src->life = INT32_MIN; /*Make the empty entry very "weak" to force its use */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cached_src->life = 0;
|
||||
|
||||
/*If `time_to_open` was not set in the open function set it here*/
|
||||
if(cached_src->dec_dsc.time_to_open == 0) {
|
||||
cached_src->dec_dsc.time_to_open = lv_tick_elaps(t_start);
|
||||
}
|
||||
|
||||
if(cached_src->dec_dsc.time_to_open == 0) cached_src->dec_dsc.time_to_open = 1;
|
||||
|
||||
return cached_src;
|
||||
}
|
||||
|
||||
@@ -157,6 +160,10 @@ lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color)
|
||||
*/
|
||||
void lv_img_cache_set_size(uint16_t new_entry_cnt)
|
||||
{
|
||||
#if LV_IMG_CACHE_DEF_SIZE == 0
|
||||
LV_UNUSED(new_entry_cnt);
|
||||
LV_LOG_WARN("Can't change cache size because it's disabled by LV_IMG_CACHE_DEF_SIZE = 0");
|
||||
#else
|
||||
if(LV_GC_ROOT(_lv_img_cache_array) != NULL) {
|
||||
/*Clean the cache before free it*/
|
||||
lv_img_cache_invalidate_src(NULL);
|
||||
@@ -178,6 +185,7 @@ void lv_img_cache_set_size(uint16_t new_entry_cnt)
|
||||
_lv_memset_00(&LV_GC_ROOT(_lv_img_cache_array)[i].dec_dsc, sizeof(lv_img_decoder_dsc_t));
|
||||
_lv_memset_00(&LV_GC_ROOT(_lv_img_cache_array)[i], sizeof(lv_img_cache_entry_t));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,7 +195,7 @@ void lv_img_cache_set_size(uint16_t new_entry_cnt)
|
||||
*/
|
||||
void lv_img_cache_invalidate_src(const void * src)
|
||||
{
|
||||
|
||||
#if LV_IMG_CACHE_DEF_SIZE
|
||||
lv_img_cache_entry_t * cache = LV_GC_ROOT(_lv_img_cache_array);
|
||||
|
||||
uint16_t i;
|
||||
@@ -201,6 +209,7 @@ void lv_img_cache_invalidate_src(const void * src)
|
||||
_lv_memset_00(&cache[i], sizeof(lv_img_cache_entry_t));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
#include "../lv_misc/lv_color.h"
|
||||
#include "../lv_misc/lv_gc.h"
|
||||
|
||||
#if defined(LV_GC_INCLUDE)
|
||||
#include LV_GC_INCLUDE
|
||||
#endif /* LV_ENABLE_GC */
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
@@ -432,7 +428,6 @@ lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder
|
||||
/*The palette begins in the beginning of the image data. Just point to it.*/
|
||||
lv_color32_t * palette_p = (lv_color32_t *)((lv_img_dsc_t *)dsc->src)->data;
|
||||
|
||||
|
||||
uint32_t i;
|
||||
for(i = 0; i < palette_size; i++) {
|
||||
user_data->palette[i] = lv_color_make(palette_p[i].ch.red, palette_p[i].ch.green, palette_p[i].ch.blue);
|
||||
@@ -537,7 +532,6 @@ void lv_img_decoder_built_in_close(lv_img_decoder_t * decoder, lv_img_decoder_ds
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_IMG_DEOCER_H
|
||||
#define LV_IMG_DEOCER_H
|
||||
#ifndef LV_IMG_DECODER_H
|
||||
#define LV_IMG_DECODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -267,4 +267,4 @@ void lv_img_decoder_built_in_close(lv_img_decoder_t * decoder, lv_img_decoder_ds
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_TEMPL_H*/
|
||||
#endif /*LV_IMG_DECODER_H*/
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
* Return with the bitmap of a font.
|
||||
* @param font_p pointer to a font
|
||||
* @param letter an UNICODE character code
|
||||
* @return pointer to the bitmap of the letter
|
||||
* @return pointer to the bitmap of the letter
|
||||
*/
|
||||
const uint8_t * lv_font_get_glyph_bitmap(const lv_font_t * font_p, uint32_t letter)
|
||||
{
|
||||
|
||||
@@ -24,11 +24,6 @@ extern "C" {
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
/*Number of fractional digits in the advanced width (`adv_w`) field of `lv_font_glyph_dsc_t`*/
|
||||
#define LV_FONT_WIDTH_FRACT_DIGIT 4
|
||||
|
||||
#define LV_FONT_KERN_POSITIVE 0
|
||||
#define LV_FONT_KERN_NEGATIVE 1
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
@@ -40,7 +35,7 @@ extern "C" {
|
||||
|
||||
/** Describes the properties of a glyph. */
|
||||
typedef struct {
|
||||
uint16_t adv_w; /**< The glyph needs this space. Draw the next glyph after this width. 8 bit integer, 4 bit fractional */
|
||||
uint16_t adv_w; /**< The glyph needs this space. Draw the next glyph after this width. */
|
||||
uint16_t box_w; /**< Width of the glyph's bounding box*/
|
||||
uint16_t box_h; /**< Height of the glyph's bounding box*/
|
||||
int16_t ofs_x; /**< x offset of the bounding box*/
|
||||
@@ -48,7 +43,6 @@ typedef struct {
|
||||
uint8_t bpp; /**< Bit-per-pixel: 1, 2, 4, 8*/
|
||||
} lv_font_glyph_dsc_t;
|
||||
|
||||
|
||||
/** The bitmaps might be upscaled by 3 to achieve subpixel rendering. */
|
||||
enum {
|
||||
LV_FONT_SUBPX_NONE,
|
||||
@@ -61,7 +55,7 @@ typedef uint8_t lv_font_subpx_t;
|
||||
|
||||
/** Describe the properties of a font*/
|
||||
typedef struct _lv_font_struct {
|
||||
/** Get a glyph's descriptor from a font*/
|
||||
/** Get a glyph's descriptor from a font*/
|
||||
bool (*get_glyph_dsc)(const struct _lv_font_struct *, lv_font_glyph_dsc_t *, uint32_t letter, uint32_t letter_next);
|
||||
|
||||
/** Get a glyph's bitmap from a font*/
|
||||
@@ -73,14 +67,13 @@ typedef struct _lv_font_struct {
|
||||
uint8_t subpx : 2; /**< An element of `lv_font_subpx_t`*/
|
||||
|
||||
int8_t underline_position; /**< Distance between the top of the underline and base line (< 0 means below the base line)*/
|
||||
int8_t underline_thickness; /**< Thickness of the underline*/
|
||||
int8_t underline_thickness; /**< Thickness of the underline*/
|
||||
|
||||
void * dsc; /**< Store implementation specific or run_time data or caching here*/
|
||||
#if LV_USE_USER_DATA
|
||||
lv_font_user_data_t user_data; /**< Custom user data for font. */
|
||||
#endif
|
||||
|
||||
|
||||
} lv_font_t;
|
||||
|
||||
/**********************
|
||||
@@ -91,7 +84,7 @@ typedef struct _lv_font_struct {
|
||||
* Return with the bitmap of a font.
|
||||
* @param font_p pointer to a font
|
||||
* @param letter an UNICODE character code
|
||||
* @return pointer to the bitmap of the letter
|
||||
* @return pointer to the bitmap of the letter
|
||||
*/
|
||||
const uint8_t * lv_font_get_glyph_bitmap(const lv_font_t * font_p, uint32_t letter);
|
||||
|
||||
@@ -131,6 +124,14 @@ static inline lv_coord_t lv_font_get_line_height(const lv_font_t * font_p)
|
||||
|
||||
#define LV_FONT_DECLARE(font_name) extern lv_font_t font_name;
|
||||
|
||||
#if LV_FONT_MONTSERRAT_8
|
||||
LV_FONT_DECLARE(lv_font_montserrat_8)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_10
|
||||
LV_FONT_DECLARE(lv_font_montserrat_10)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_12
|
||||
LV_FONT_DECLARE(lv_font_montserrat_12)
|
||||
#endif
|
||||
@@ -219,6 +220,10 @@ LV_FONT_DECLARE(lv_font_montserrat_12_subpx)
|
||||
LV_FONT_DECLARE(lv_font_unscii_8)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_UNSCII_16
|
||||
LV_FONT_DECLARE(lv_font_unscii_16)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_DEJAVU_16_PERSIAN_HEBREW
|
||||
LV_FONT_DECLARE(lv_font_dejavu_16_persian_hebrew)
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
CSRCS += lv_font.c
|
||||
CSRCS += lv_font_fmt_txt.c
|
||||
CSRCS += lv_font_loader.c
|
||||
CSRCS += lv_font_montserrat_8.c
|
||||
CSRCS += lv_font_montserrat_10.c
|
||||
CSRCS += lv_font_montserrat_12.c
|
||||
CSRCS += lv_font_montserrat_14.c
|
||||
CSRCS += lv_font_montserrat_16.c
|
||||
|
||||
@@ -5818,7 +5818,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
@@ -6508,8 +6507,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
@@ -6527,7 +6524,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.bitmap_format = 0
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
@@ -6540,9 +6536,12 @@ lv_font_t lv_font_dejavu_16_persian_hebrew = {
|
||||
.base_line = 7, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0)
|
||||
.underline_position = -1,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
#endif /*#if LV_FONT_DEJAVU_16_PERSIAN_HEBREW*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file lv_font.c
|
||||
* @file lv_font_fmt_txt.c
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#include "lv_font.h"
|
||||
#include "lv_font_fmt_txt.h"
|
||||
#include "../lv_misc/lv_debug.h"
|
||||
#include "../lv_draw/lv_draw.h"
|
||||
#include "../lv_misc/lv_types.h"
|
||||
#include "../lv_misc/lv_gc.h"
|
||||
#include "../lv_misc/lv_log.h"
|
||||
#include "../lv_misc/lv_utils.h"
|
||||
#include "../lv_misc/lv_mem.h"
|
||||
@@ -37,23 +37,26 @@ static int32_t unicode_list_compare(const void * ref, const void * element);
|
||||
static int32_t kern_pair_8_compare(const void * ref, const void * element);
|
||||
static int32_t kern_pair_16_compare(const void * ref, const void * element);
|
||||
|
||||
static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord_t h, uint8_t bpp, bool prefilter);
|
||||
static inline void decompress_line(uint8_t * out, lv_coord_t w);
|
||||
static inline uint8_t get_bits(const uint8_t * in, uint32_t bit_pos, uint8_t len);
|
||||
static inline void bits_write(uint8_t * out, uint32_t bit_pos, uint8_t val, uint8_t len);
|
||||
static inline void rle_init(const uint8_t * in, uint8_t bpp);
|
||||
static inline uint8_t rle_next(void);
|
||||
#if LV_USE_FONT_COMPRESSED
|
||||
static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord_t h, uint8_t bpp, bool prefilter);
|
||||
static inline void decompress_line(uint8_t * out, lv_coord_t w);
|
||||
static inline uint8_t get_bits(const uint8_t * in, uint32_t bit_pos, uint8_t len);
|
||||
static inline void bits_write(uint8_t * out, uint32_t bit_pos, uint8_t val, uint8_t len);
|
||||
static inline void rle_init(const uint8_t * in, uint8_t bpp);
|
||||
static inline uint8_t rle_next(void);
|
||||
#endif /* LV_USE_FONT_COMPRESSED */
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static uint8_t * decompr_buf;
|
||||
static uint32_t rle_rdp;
|
||||
static const uint8_t * rle_in;
|
||||
static uint8_t rle_bpp;
|
||||
static uint8_t rle_prev_v;
|
||||
static uint8_t rle_cnt;
|
||||
static rle_state_t rle_state;
|
||||
#if LV_USE_FONT_COMPRESSED
|
||||
static uint32_t rle_rdp;
|
||||
static const uint8_t * rle_in;
|
||||
static uint8_t rle_bpp;
|
||||
static uint8_t rle_prev_v;
|
||||
static uint8_t rle_cnt;
|
||||
static rle_state_t rle_state;
|
||||
#endif /* LV_USE_FONT_COMPRESSED */
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
@@ -84,7 +87,7 @@ const uint8_t * lv_font_get_bitmap_fmt_txt(const lv_font_t * font, uint32_t unic
|
||||
const lv_font_fmt_txt_glyph_dsc_t * gdsc = &fdsc->glyph_dsc[gid];
|
||||
|
||||
if(fdsc->bitmap_format == LV_FONT_FMT_TXT_PLAIN) {
|
||||
if(gdsc) return &fdsc->glyph_bitmap[gdsc->bitmap_index];
|
||||
return &fdsc->glyph_bitmap[gdsc->bitmap_index];
|
||||
}
|
||||
/*Handle compressed bitmap*/
|
||||
else {
|
||||
@@ -109,16 +112,17 @@ const uint8_t * lv_font_get_bitmap_fmt_txt(const lv_font_t * font, uint32_t unic
|
||||
break;
|
||||
}
|
||||
|
||||
if(_lv_mem_get_size(decompr_buf) < buf_size) {
|
||||
decompr_buf = lv_mem_realloc(decompr_buf, buf_size);
|
||||
LV_ASSERT_MEM(decompr_buf);
|
||||
if(decompr_buf == NULL) return NULL;
|
||||
if(_lv_mem_get_size(LV_GC_ROOT(_lv_font_decompr_buf)) < buf_size) {
|
||||
uint8_t * tmp = lv_mem_realloc(LV_GC_ROOT(_lv_font_decompr_buf), buf_size);
|
||||
LV_ASSERT_MEM(tmp);
|
||||
if(tmp == NULL) return NULL;
|
||||
LV_GC_ROOT(_lv_font_decompr_buf) = tmp;
|
||||
}
|
||||
|
||||
bool prefilter = fdsc->bitmap_format == LV_FONT_FMT_TXT_COMPRESSED ? true : false;
|
||||
decompress(&fdsc->glyph_bitmap[gdsc->bitmap_index], decompr_buf, gdsc->box_w, gdsc->box_h, (uint8_t)fdsc->bpp,
|
||||
prefilter);
|
||||
return decompr_buf;
|
||||
decompress(&fdsc->glyph_bitmap[gdsc->bitmap_index], LV_GC_ROOT(_lv_font_decompr_buf), gdsc->box_w, gdsc->box_h,
|
||||
(uint8_t)fdsc->bpp, prefilter);
|
||||
return LV_GC_ROOT(_lv_font_decompr_buf);
|
||||
#else /* !LV_USE_FONT_COMPRESSED */
|
||||
return NULL;
|
||||
#endif
|
||||
@@ -184,13 +188,12 @@ bool lv_font_get_glyph_dsc_fmt_txt(const lv_font_t * font, lv_font_glyph_dsc_t *
|
||||
*/
|
||||
void _lv_font_clean_up_fmt_txt(void)
|
||||
{
|
||||
if(decompr_buf) {
|
||||
lv_mem_free(decompr_buf);
|
||||
decompr_buf = NULL;
|
||||
if(LV_GC_ROOT(_lv_font_decompr_buf)) {
|
||||
lv_mem_free(LV_GC_ROOT(_lv_font_decompr_buf));
|
||||
LV_GC_ROOT(_lv_font_decompr_buf) = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
@@ -220,24 +223,22 @@ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter)
|
||||
}
|
||||
else if(fdsc->cmaps[i].type == LV_FONT_FMT_TXT_CMAP_SPARSE_TINY) {
|
||||
uint16_t key = rcp;
|
||||
uint8_t * p = _lv_utils_bsearch(&key, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length,
|
||||
sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare);
|
||||
uint16_t * p = _lv_utils_bsearch(&key, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length,
|
||||
sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare);
|
||||
|
||||
if(p) {
|
||||
lv_uintptr_t ofs = (lv_uintptr_t)(p - (uint8_t *) fdsc->cmaps[i].unicode_list);
|
||||
ofs = ofs >> 1; /*The list stores `uint16_t` so the get the index divide by 2*/
|
||||
lv_uintptr_t ofs = p - fdsc->cmaps[i].unicode_list;
|
||||
glyph_id = fdsc->cmaps[i].glyph_id_start + ofs;
|
||||
}
|
||||
}
|
||||
else if(fdsc->cmaps[i].type == LV_FONT_FMT_TXT_CMAP_SPARSE_FULL) {
|
||||
uint16_t key = rcp;
|
||||
uint8_t * p = _lv_utils_bsearch(&key, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length,
|
||||
sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare);
|
||||
uint16_t * p = _lv_utils_bsearch(&key, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length,
|
||||
sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare);
|
||||
|
||||
if(p) {
|
||||
lv_uintptr_t ofs = (lv_uintptr_t)(p - (uint8_t *) fdsc->cmaps[i].unicode_list);
|
||||
ofs = ofs >> 1; /*The list stores `uint16_t` so the get the index divide by 2*/
|
||||
const uint8_t * gid_ofs_16 = fdsc->cmaps[i].glyph_id_ofs_list;
|
||||
lv_uintptr_t ofs = p - fdsc->cmaps[i].unicode_list;
|
||||
const uint16_t * gid_ofs_16 = fdsc->cmaps[i].glyph_id_ofs_list;
|
||||
glyph_id = fdsc->cmaps[i].glyph_id_start + gid_ofs_16[ofs];
|
||||
}
|
||||
}
|
||||
@@ -266,28 +267,26 @@ static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t
|
||||
if(kdsc->glyph_ids_size == 0) {
|
||||
/* Use binary search to find the kern value.
|
||||
* The pairs are ordered left_id first, then right_id secondly. */
|
||||
const uint8_t * g_ids = kdsc->glyph_ids;
|
||||
const uint16_t * g_ids = kdsc->glyph_ids;
|
||||
uint16_t g_id_both = (gid_right << 8) + gid_left; /*Create one number from the ids*/
|
||||
uint8_t * kid_p = _lv_utils_bsearch(&g_id_both, g_ids, kdsc->pair_cnt, 2, kern_pair_8_compare);
|
||||
uint16_t * kid_p = _lv_utils_bsearch(&g_id_both, g_ids, kdsc->pair_cnt, 2, kern_pair_8_compare);
|
||||
|
||||
/*If the `g_id_both` were found get its index from the pointer*/
|
||||
if(kid_p) {
|
||||
lv_uintptr_t ofs = (lv_uintptr_t)(kid_p - g_ids);
|
||||
ofs = ofs >> 1; /*ofs is for pair, divide by 2 to refer as a single value*/
|
||||
lv_uintptr_t ofs = kid_p - g_ids;
|
||||
value = kdsc->values[ofs];
|
||||
}
|
||||
}
|
||||
else if(kdsc->glyph_ids_size == 1) {
|
||||
/* Use binary search to find the kern value.
|
||||
* The pairs are ordered left_id first, then right_id secondly. */
|
||||
const uint16_t * g_ids = kdsc->glyph_ids;
|
||||
lv_uintptr_t g_id_both = (uint32_t)((uint32_t)gid_right << 8) + gid_left; /*Create one number from the ids*/
|
||||
uint8_t * kid_p = _lv_utils_bsearch(&g_id_both, g_ids, kdsc->pair_cnt, 4, kern_pair_16_compare);
|
||||
const uint32_t * g_ids = kdsc->glyph_ids;
|
||||
uint32_t g_id_both = (gid_right << 16) + gid_left; /*Create one number from the ids*/
|
||||
uint32_t * kid_p = _lv_utils_bsearch(&g_id_both, g_ids, kdsc->pair_cnt, 4, kern_pair_16_compare);
|
||||
|
||||
/*If the `g_id_both` were found get its index from the pointer*/
|
||||
if(kid_p) {
|
||||
lv_uintptr_t ofs = (lv_uintptr_t)(kid_p - (const uint8_t *)g_ids);
|
||||
ofs = ofs >> 4; /*ofs is 4 byte pairs, divide by 4 to refer as a single value*/
|
||||
lv_uintptr_t ofs = kid_p - g_ids;
|
||||
value = kdsc->values[ofs];
|
||||
}
|
||||
|
||||
@@ -333,6 +332,7 @@ static int32_t kern_pair_16_compare(const void * ref, const void * element)
|
||||
else return (int32_t) ref16_p[1] - element16_p[1];
|
||||
}
|
||||
|
||||
#if LV_USE_FONT_COMPRESSED
|
||||
/**
|
||||
* The compress a glyph's bitmap
|
||||
* @param in the compressed bitmap
|
||||
@@ -547,7 +547,6 @@ static inline uint8_t rle_next(void)
|
||||
rle_state = RLE_STATE_SINGLE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if(rle_state == RLE_STATE_COUNTER) {
|
||||
ret = rle_prev_v;
|
||||
@@ -562,6 +561,7 @@ static inline uint8_t rle_next(void)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* LV_USE_FONT_COMPRESSED */
|
||||
|
||||
/** Code Comparator.
|
||||
*
|
||||
@@ -571,9 +571,9 @@ static inline uint8_t rle_next(void)
|
||||
* @param[in] pElement Pointer to the element to compare.
|
||||
*
|
||||
* @return Result of comparison.
|
||||
* @retval < 0 Reference is greater than element.
|
||||
* @retval < 0 Reference is less than element.
|
||||
* @retval = 0 Reference is equal to element.
|
||||
* @retval > 0 Reference is less than element.
|
||||
* @retval > 0 Reference is greater than element.
|
||||
*
|
||||
*/
|
||||
static int32_t unicode_list_compare(const void * ref, const void * element)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file lv_font.h
|
||||
* @file lv_font_fmt_txt.h
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -34,29 +34,27 @@ typedef struct {
|
||||
uint8_t box_w; /**< Width of the glyph's bounding box*/
|
||||
uint8_t box_h; /**< Height of the glyph's bounding box*/
|
||||
int8_t ofs_x; /**< x offset of the bounding box*/
|
||||
int8_t ofs_y; /**< y offset of the bounding box. Measured from the top of the line*/
|
||||
int8_t ofs_y; /**< y offset of the bounding box. Measured from the top of the line*/
|
||||
#else
|
||||
uint32_t bitmap_index; /**< Start index of the bitmap. A font can be max 4 GB. */
|
||||
uint32_t adv_w; /**< Draw the next glyph after this width. 28.4 format (real_value * 16 is stored). */
|
||||
uint16_t box_w; /**< Width of the glyph's bounding box*/
|
||||
uint16_t box_h; /**< Height of the glyph's bounding box*/
|
||||
int16_t ofs_x; /**< x offset of the bounding box*/
|
||||
uint16_t box_w; /**< Width of the glyph's bounding box*/
|
||||
uint16_t box_h; /**< Height of the glyph's bounding box*/
|
||||
int16_t ofs_x; /**< x offset of the bounding box*/
|
||||
int16_t ofs_y; /**< y offset of the bounding box. Measured from the top of the line*/
|
||||
#endif
|
||||
} lv_font_fmt_txt_glyph_dsc_t;
|
||||
|
||||
|
||||
/** Format of font character map. */
|
||||
enum {
|
||||
LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY,
|
||||
LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL,
|
||||
LV_FONT_FMT_TXT_CMAP_SPARSE_TINY,
|
||||
LV_FONT_FMT_TXT_CMAP_SPARSE_FULL,
|
||||
LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY,
|
||||
LV_FONT_FMT_TXT_CMAP_SPARSE_TINY,
|
||||
};
|
||||
|
||||
typedef uint8_t lv_font_fmt_txt_cmap_type_t;
|
||||
|
||||
|
||||
/* Map codepoints to a `glyph_dsc`s
|
||||
* Several formats are supported to optimize memory usage
|
||||
* See https://github.com/lvgl/lv_font_conv/blob/master/doc/font_spec.md
|
||||
@@ -117,14 +115,14 @@ typedef struct {
|
||||
typedef struct {
|
||||
/*To get a kern value of two code points:
|
||||
1. Get the `glyph_id_left` and `glyph_id_right` from `lv_font_fmt_txt_cmap_t
|
||||
2 for(i = 0; i < pair_cnt * 2; i+2)
|
||||
2. for(i = 0; i < pair_cnt * 2; i += 2)
|
||||
if(gylph_ids[i] == glyph_id_left &&
|
||||
gylph_ids[i+1] == glyph_id_right)
|
||||
return values[i / 2];
|
||||
*/
|
||||
const void * glyph_ids;
|
||||
const int8_t * values;
|
||||
uint32_t pair_cnt : 24;
|
||||
uint32_t pair_cnt : 30;
|
||||
uint32_t glyph_ids_size : 2; /*0: `glyph_ids` is stored as `uint8_t`; 1: as `uint16_t`*/
|
||||
} lv_font_fmt_txt_kern_pair_t;
|
||||
|
||||
@@ -132,20 +130,19 @@ typedef struct {
|
||||
typedef struct {
|
||||
/*To get a kern value of two code points:
|
||||
1. Get the `glyph_id_left` and `glyph_id_right` from `lv_font_fmt_txt_cmap_t
|
||||
2 Get the class of the left and right glyphs as `left_class` and `right_class`
|
||||
2. Get the class of the left and right glyphs as `left_class` and `right_class`
|
||||
left_class = left_class_mapping[glyph_id_left];
|
||||
right_class = right_class_mapping[glyph_id_right];
|
||||
3. value = class_pair_values[(left_class-1)*right_class_cnt + (right_class-1)]
|
||||
*/
|
||||
|
||||
const int8_t * class_pair_values; /*left_class_num * right_class_num value*/
|
||||
const int8_t * class_pair_values; /*left_class_cnt * right_class_cnt value*/
|
||||
const uint8_t * left_class_mapping; /*Map the glyph_ids to classes: index -> glyph_id -> class_id*/
|
||||
const uint8_t * right_class_mapping; /*Map the glyph_ids to classes: index -> glyph_id -> class_id*/
|
||||
uint8_t left_class_cnt;
|
||||
uint8_t right_class_cnt;
|
||||
} lv_font_fmt_txt_kern_classes_t;
|
||||
|
||||
|
||||
/** Bitmap formats*/
|
||||
typedef enum {
|
||||
LV_FONT_FMT_TXT_PLAIN = 0,
|
||||
@@ -153,7 +150,6 @@ typedef enum {
|
||||
LV_FONT_FMT_TXT_COMPRESSED_NO_PREFILTER = 1,
|
||||
} lv_font_fmt_txt_bitmap_format_t;
|
||||
|
||||
|
||||
/*Describe store additional data for fonts */
|
||||
typedef struct {
|
||||
/*The bitmaps of all glyphs*/
|
||||
@@ -176,7 +172,7 @@ typedef struct {
|
||||
uint16_t kern_scale;
|
||||
|
||||
/*Number of cmap tables*/
|
||||
uint16_t cmap_num : 10;
|
||||
uint16_t cmap_num : 9;
|
||||
|
||||
/*Bit per pixel: 1, 2, 3, 4, 8*/
|
||||
uint16_t bpp : 4;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
#if LV_USE_FILESYSTEM
|
||||
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
@@ -49,6 +48,8 @@ typedef struct font_header_bin {
|
||||
uint8_t compression_id;
|
||||
uint8_t subpixels_mode;
|
||||
uint8_t padding;
|
||||
int16_t underline_position;
|
||||
uint16_t underline_thickness;
|
||||
} font_header_bin_t;
|
||||
|
||||
typedef struct cmap_table_bin {
|
||||
@@ -61,7 +62,6 @@ typedef struct cmap_table_bin {
|
||||
uint8_t padding;
|
||||
} cmap_table_bin_t;
|
||||
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
@@ -70,8 +70,7 @@ static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font);
|
||||
int32_t load_kern(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint8_t format, uint32_t start);
|
||||
|
||||
static int read_bits_signed(bit_iterator_t * it, int n_bits, lv_fs_res_t * res);
|
||||
static int read_bits(bit_iterator_t * it, int n_bits, lv_fs_res_t * res);
|
||||
|
||||
static unsigned int read_bits(bit_iterator_t * it, int n_bits, lv_fs_res_t * res);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
@@ -98,25 +97,24 @@ lv_font_t * lv_font_load(const char * font_name)
|
||||
|
||||
if(res == LV_FS_RES_OK) {
|
||||
success = lvgl_load_font(&file, font);
|
||||
}
|
||||
|
||||
if(!success) {
|
||||
LV_LOG_WARN("Error loading font file: %s\n", font_name);
|
||||
/*
|
||||
* When `lvgl_load_font` fails it can leak some pointers.
|
||||
* All non-null pointers can be assumed as allocated and
|
||||
* `lv_font_free` should free them correctly.
|
||||
*/
|
||||
lv_font_free(font);
|
||||
font = NULL;
|
||||
}
|
||||
if(!success) {
|
||||
LV_LOG_WARN("Error loading font file: %s\n", font_name);
|
||||
/*
|
||||
* When `lvgl_load_font` fails it can leak some pointers.
|
||||
* All non-null pointers can be assumed as allocated and
|
||||
* `lv_font_free` should free them correctly.
|
||||
*/
|
||||
lv_font_free(font);
|
||||
font = NULL;
|
||||
}
|
||||
|
||||
lv_fs_close(&file);
|
||||
lv_fs_close(&file);
|
||||
}
|
||||
|
||||
return font;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Frees the memory allocated by the `lv_font_load()` function
|
||||
* @param font lv_font_t object created by the lv_font_load function
|
||||
@@ -185,7 +183,6 @@ void lv_font_free(lv_font_t * font)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
@@ -199,9 +196,9 @@ static bit_iterator_t init_bit_iterator(lv_fs_file_t * fp)
|
||||
return it;
|
||||
}
|
||||
|
||||
static int read_bits(bit_iterator_t * it, int n_bits, lv_fs_res_t * res)
|
||||
static unsigned int read_bits(bit_iterator_t * it, int n_bits, lv_fs_res_t * res)
|
||||
{
|
||||
int value = 0;
|
||||
unsigned int value = 0;
|
||||
while(n_bits--) {
|
||||
it->byte_value = it->byte_value << 1;
|
||||
it->bit_pos--;
|
||||
@@ -210,7 +207,7 @@ static int read_bits(bit_iterator_t * it, int n_bits, lv_fs_res_t * res)
|
||||
it->bit_pos = 7;
|
||||
*res = lv_fs_read(it->fp, &(it->byte_value), 1, NULL);
|
||||
if(*res != LV_FS_RES_OK) {
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
int8_t bit = (it->byte_value & 0x80) ? 1 : 0;
|
||||
@@ -223,11 +220,9 @@ static int read_bits(bit_iterator_t * it, int n_bits, lv_fs_res_t * res)
|
||||
|
||||
static int read_bits_signed(bit_iterator_t * it, int n_bits, lv_fs_res_t * res)
|
||||
{
|
||||
int value = read_bits(it, n_bits, res);
|
||||
unsigned int value = read_bits(it, n_bits, res);
|
||||
if(value & (1 << (n_bits - 1))) {
|
||||
for(int bit = n_bits; bit < 8; ++bit) {
|
||||
value |= (1 << bit);
|
||||
}
|
||||
value |= ~0u << n_bits;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@@ -252,16 +247,8 @@ static int read_label(lv_fs_file_t * fp, int start, const char * label)
|
||||
static bool load_cmaps_tables(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc,
|
||||
uint32_t cmaps_start, cmap_table_bin_t * cmap_table)
|
||||
{
|
||||
for(unsigned int i = 0; i < font_dsc->cmap_num; ++i) {
|
||||
if(lv_fs_read(fp, &cmap_table[i], sizeof(cmap_table_bin_t), NULL) != LV_FS_RES_OK) {
|
||||
return false;
|
||||
}
|
||||
|
||||
lv_font_fmt_txt_cmap_t * cmap = (lv_font_fmt_txt_cmap_t *) & (font_dsc->cmaps[i]);
|
||||
|
||||
cmap->range_start = cmap_table[i].range_start;
|
||||
cmap->range_length = cmap_table[i].range_length;
|
||||
cmap->glyph_id_start = cmap_table[i].glyph_id_start;
|
||||
if(lv_fs_read(fp, cmap_table, font_dsc->cmap_num * sizeof(cmap_table_bin_t), NULL) != LV_FS_RES_OK) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for(unsigned int i = 0; i < font_dsc->cmap_num; ++i) {
|
||||
@@ -272,8 +259,13 @@ static bool load_cmaps_tables(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_ds
|
||||
|
||||
lv_font_fmt_txt_cmap_t * cmap = (lv_font_fmt_txt_cmap_t *) & (font_dsc->cmaps[i]);
|
||||
|
||||
cmap->range_start = cmap_table[i].range_start;
|
||||
cmap->range_length = cmap_table[i].range_length;
|
||||
cmap->glyph_id_start = cmap_table[i].glyph_id_start;
|
||||
cmap->type = cmap_table[i].format_type;
|
||||
|
||||
switch(cmap_table[i].format_type) {
|
||||
case 0: {
|
||||
case LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL: {
|
||||
uint8_t ids_size = sizeof(uint8_t) * cmap_table[i].data_entries_count;
|
||||
uint8_t * glyph_id_ofs_list = lv_mem_alloc(ids_size);
|
||||
|
||||
@@ -283,19 +275,13 @@ static bool load_cmaps_tables(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_ds
|
||||
return false;
|
||||
}
|
||||
|
||||
cmap->type = LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL;
|
||||
cmap->list_length = cmap->range_length;
|
||||
cmap->unicode_list = NULL;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
cmap->type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY;
|
||||
cmap->list_length = 0;
|
||||
cmap->unicode_list = NULL;
|
||||
cmap->glyph_id_ofs_list = NULL;
|
||||
case LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY:
|
||||
break;
|
||||
case 1:
|
||||
case 3: {
|
||||
case LV_FONT_FMT_TXT_CMAP_SPARSE_FULL:
|
||||
case LV_FONT_FMT_TXT_CMAP_SPARSE_TINY: {
|
||||
uint32_t list_size = sizeof(uint16_t) * cmap_table[i].data_entries_count;
|
||||
uint16_t * unicode_list = (uint16_t *) lv_mem_alloc(list_size);
|
||||
|
||||
@@ -306,20 +292,15 @@ static bool load_cmaps_tables(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_ds
|
||||
return false;
|
||||
}
|
||||
|
||||
if(cmap_table[i].format_type == 1) {
|
||||
if(cmap_table[i].format_type == LV_FONT_FMT_TXT_CMAP_SPARSE_FULL) {
|
||||
uint16_t * buf = lv_mem_alloc(sizeof(uint16_t) * cmap->list_length);
|
||||
|
||||
cmap->type = LV_FONT_FMT_TXT_CMAP_SPARSE_FULL;
|
||||
cmap->glyph_id_ofs_list = buf;
|
||||
|
||||
if(lv_fs_read(fp, buf, sizeof(uint16_t) * cmap->list_length, NULL) != LV_FS_RES_OK) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
cmap->type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY;
|
||||
cmap->glyph_id_ofs_list = NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -421,7 +402,7 @@ static int32_t load_glyph(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc,
|
||||
}
|
||||
|
||||
int nbits = header->advance_width_bits + 2 * header->xy_bits + 2 * header->wh_bits;
|
||||
int next_offset = (i < loca_count - 1) ? glyph_offset[i + 1] : (uint32_t)(glyph_length - 1);
|
||||
int next_offset = (i < loca_count - 1) ? glyph_offset[i + 1] : (uint32_t)glyph_length;
|
||||
int bmp_size = next_offset - glyph_offset[i] - nbits / 8;
|
||||
|
||||
if(i == 0) {
|
||||
@@ -462,15 +443,27 @@ static int32_t load_glyph(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc,
|
||||
continue;
|
||||
}
|
||||
|
||||
int next_offset = (i < loca_count - 1) ? glyph_offset[i + 1] : (uint32_t)(glyph_length - 1);
|
||||
int next_offset = (i < loca_count - 1) ? glyph_offset[i + 1] : (uint32_t)glyph_length;
|
||||
int bmp_size = next_offset - glyph_offset[i] - nbits / 8;
|
||||
|
||||
for(int k = 0; k < bmp_size; ++k) {
|
||||
glyph_bmp[cur_bmp_size + k] = read_bits(&bit_it, 8, &res);
|
||||
if(nbits % 8 == 0) { /* Fast path */
|
||||
if(lv_fs_read(fp, &glyph_bmp[cur_bmp_size], bmp_size, NULL) != LV_FS_RES_OK) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for(int k = 0; k < bmp_size - 1; ++k) {
|
||||
glyph_bmp[cur_bmp_size + k] = read_bits(&bit_it, 8, &res);
|
||||
if(res != LV_FS_RES_OK) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
glyph_bmp[cur_bmp_size + bmp_size - 1] = read_bits(&bit_it, 8 - nbits % 8, &res);
|
||||
if(res != LV_FS_RES_OK) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
cur_bmp_size += bmp_size;
|
||||
}
|
||||
return glyph_length;
|
||||
@@ -512,7 +505,9 @@ static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font)
|
||||
font->line_height = font_header.ascent - font_header.descent;
|
||||
font->get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt;
|
||||
font->get_glyph_bitmap = lv_font_get_bitmap_fmt_txt;
|
||||
font->subpx = LV_FONT_SUBPX_NONE;
|
||||
font->subpx = font_header.subpixels_mode;
|
||||
font->underline_position = font_header.underline_position;
|
||||
font->underline_thickness = font_header.underline_thickness;
|
||||
|
||||
font_dsc->bpp = font_header.bits_per_pixel;
|
||||
font_dsc->kern_scale = font_header.kerning_scale;
|
||||
@@ -540,8 +535,8 @@ static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font)
|
||||
bool failed = false;
|
||||
uint32_t * glyph_offset = lv_mem_alloc(sizeof(uint32_t) * (loca_count + 1));
|
||||
|
||||
for(unsigned int i = 0; i < loca_count; ++i) {
|
||||
if(font_header.index_to_loc_format == 0) {
|
||||
if(font_header.index_to_loc_format == 0) {
|
||||
for(unsigned int i = 0; i < loca_count; ++i) {
|
||||
uint16_t offset;
|
||||
if(lv_fs_read(fp, &offset, sizeof(uint16_t), NULL) != LV_FS_RES_OK) {
|
||||
failed = true;
|
||||
@@ -549,20 +544,16 @@ static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font)
|
||||
}
|
||||
glyph_offset[i] = offset;
|
||||
}
|
||||
else if(font_header.index_to_loc_format == 1) {
|
||||
uint32_t offset;
|
||||
if(lv_fs_read(fp, &offset, sizeof(uint32_t), NULL) != LV_FS_RES_OK) {
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
glyph_offset[i] = offset;
|
||||
}
|
||||
else {
|
||||
LV_LOG_WARN("Unknown index_to_loc_format: %d.", font_header.index_to_loc_format);
|
||||
}
|
||||
else if(font_header.index_to_loc_format == 1) {
|
||||
if(lv_fs_read(fp, glyph_offset, loca_count * sizeof(uint32_t), NULL) != LV_FS_RES_OK) {
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LV_LOG_WARN("Unknown index_to_loc_format: %d.", font_header.index_to_loc_format);
|
||||
failed = true;
|
||||
}
|
||||
|
||||
if(failed) {
|
||||
lv_mem_free(glyph_offset);
|
||||
@@ -691,4 +682,3 @@ int32_t load_kern(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint8_t f
|
||||
}
|
||||
|
||||
#endif /*LV_USE_FILESYSTEM*/
|
||||
|
||||
|
||||
1615
src/lv_font/lv_font_montserrat_10.c
Normal file
1615
src/lv_font/lv_font_montserrat_10.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1201,7 +1201,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0x0, 0x0, 0x0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
@@ -1396,7 +1395,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
@@ -1826,7 +1824,6 @@ static const int8_t kern_class_values[] =
|
||||
0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
@@ -1854,7 +1851,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.bitmap_format = 0
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
@@ -1867,9 +1863,12 @@ lv_font_t lv_font_montserrat_12 = {
|
||||
.base_line = 3, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0)
|
||||
.underline_position = -1,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
#endif /*#if LV_FONT_MONTSERRAT_12*/
|
||||
|
||||
|
||||
@@ -1201,7 +1201,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0x0, 0x0, 0x0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
@@ -1396,7 +1395,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
@@ -1826,7 +1824,6 @@ static const int8_t kern_class_values[] =
|
||||
0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
@@ -1854,7 +1851,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.bitmap_format = 0
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
@@ -1867,9 +1863,12 @@ lv_font_t lv_font_montserrat_12_subpx = {
|
||||
.base_line = 3, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0)
|
||||
.underline_position = -1,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
#endif /*#if LV_FONT_MONTSERRAT_12_SUBPX*/
|
||||
|
||||
|
||||
@@ -1470,7 +1470,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0x0, 0x0, 0x0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
@@ -1665,7 +1664,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
@@ -2095,7 +2093,6 @@ static const int8_t kern_class_values[] =
|
||||
0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
@@ -2123,7 +2120,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.bitmap_format = 0
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
@@ -2136,9 +2132,12 @@ lv_font_t lv_font_montserrat_14 = {
|
||||
.base_line = 3, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0)
|
||||
.underline_position = -1,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
#endif /*#if LV_FONT_MONTSERRAT_14*/
|
||||
|
||||
|
||||
@@ -1733,7 +1733,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
@@ -1928,7 +1927,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
@@ -2358,7 +2356,6 @@ static const int8_t kern_class_values[] =
|
||||
0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
@@ -2386,7 +2383,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.bitmap_format = 0
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
@@ -2399,9 +2395,12 @@ lv_font_t lv_font_montserrat_16 = {
|
||||
.base_line = 3, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0)
|
||||
.underline_position = -1,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
#endif /*#if LV_FONT_MONTSERRAT_16*/
|
||||
|
||||
|
||||
@@ -2122,7 +2122,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0x0, 0x0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
@@ -2317,7 +2316,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
@@ -2747,7 +2745,6 @@ static const int8_t kern_class_values[] =
|
||||
0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
@@ -2775,7 +2772,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.bitmap_format = 0
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
@@ -2788,9 +2784,12 @@ lv_font_t lv_font_montserrat_18 = {
|
||||
.base_line = 4, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0)
|
||||
.underline_position = -1,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
#endif /*#if LV_FONT_MONTSERRAT_18*/
|
||||
|
||||
|
||||
@@ -2468,7 +2468,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0x0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
@@ -2663,7 +2662,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
@@ -3093,7 +3091,6 @@ static const int8_t kern_class_values[] =
|
||||
0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
@@ -3121,7 +3118,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.bitmap_format = 0
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
@@ -3134,9 +3130,12 @@ lv_font_t lv_font_montserrat_20 = {
|
||||
.base_line = 4, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0)
|
||||
.underline_position = -1,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
#endif /*#if LV_FONT_MONTSERRAT_20*/
|
||||
|
||||
|
||||
@@ -2885,7 +2885,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0x0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
@@ -3080,7 +3079,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
@@ -3510,7 +3508,6 @@ static const int8_t kern_class_values[] =
|
||||
0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
@@ -3538,7 +3535,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.bitmap_format = 0
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
@@ -3551,9 +3547,12 @@ lv_font_t lv_font_montserrat_22 = {
|
||||
.base_line = 4, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0)
|
||||
.underline_position = -2,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
#endif /*#if LV_FONT_MONTSERRAT_22*/
|
||||
|
||||
|
||||
@@ -3286,7 +3286,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
@@ -3481,7 +3480,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
@@ -3911,7 +3909,6 @@ static const int8_t kern_class_values[] =
|
||||
0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
@@ -3939,7 +3936,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.bitmap_format = 0
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
@@ -3952,9 +3948,12 @@ lv_font_t lv_font_montserrat_24 = {
|
||||
.base_line = 5, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0)
|
||||
.underline_position = -2,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
#endif /*#if LV_FONT_MONTSERRAT_24*/
|
||||
|
||||
|
||||
@@ -3806,7 +3806,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0x0, 0x0, 0x0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
@@ -4001,7 +4000,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
@@ -4431,7 +4429,6 @@ static const int8_t kern_class_values[] =
|
||||
0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
@@ -4459,7 +4456,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.bitmap_format = 0
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
@@ -4472,9 +4468,12 @@ lv_font_t lv_font_montserrat_26 = {
|
||||
.base_line = 5, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0)
|
||||
.underline_position = -2,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
#endif /*#if LV_FONT_MONTSERRAT_26*/
|
||||
|
||||
|
||||
@@ -4340,7 +4340,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0x0, 0x0, 0x0, 0x0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
@@ -4535,7 +4534,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
@@ -4965,7 +4963,6 @@ static const int8_t kern_class_values[] =
|
||||
0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
@@ -4993,7 +4990,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.bitmap_format = 0
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
@@ -5006,9 +5002,12 @@ lv_font_t lv_font_montserrat_28 = {
|
||||
.base_line = 5, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0)
|
||||
.underline_position = -2,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
#endif /*#if LV_FONT_MONTSERRAT_28*/
|
||||
|
||||
|
||||
@@ -2530,7 +2530,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0xff, 0x3a, 0xba, 0x40, 0x3f, 0xf9, 0x0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
@@ -2725,7 +2724,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
@@ -3155,7 +3153,6 @@ static const int8_t kern_class_values[] =
|
||||
0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
@@ -3183,7 +3180,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.bitmap_format = 1
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
@@ -3196,9 +3192,12 @@ lv_font_t lv_font_montserrat_28_compressed = {
|
||||
.base_line = 5, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0)
|
||||
.underline_position = -2,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
#endif /*#if LV_FONT_MONTSERRAT_28_COMPRESSED*/
|
||||
|
||||
|
||||
@@ -4906,7 +4906,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
@@ -5101,7 +5100,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
@@ -5531,7 +5529,6 @@ static const int8_t kern_class_values[] =
|
||||
0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
@@ -5559,7 +5556,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.bitmap_format = 0
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
@@ -5572,9 +5568,12 @@ lv_font_t lv_font_montserrat_30 = {
|
||||
.base_line = 6, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0)
|
||||
.underline_position = -2,
|
||||
.underline_thickness = 2,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
#endif /*#if LV_FONT_MONTSERRAT_30*/
|
||||
|
||||
|
||||
@@ -5383,7 +5383,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0x0, 0x0, 0x0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
@@ -5578,7 +5577,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
@@ -6008,7 +6006,6 @@ static const int8_t kern_class_values[] =
|
||||
0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
@@ -6036,7 +6033,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.bitmap_format = 0
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
@@ -6049,9 +6045,12 @@ lv_font_t lv_font_montserrat_32 = {
|
||||
.base_line = 6, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0)
|
||||
.underline_position = -2,
|
||||
.underline_thickness = 2,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
#endif /*#if LV_FONT_MONTSERRAT_32*/
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user