Compare commits
803 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5d4bf8fc4 | ||
|
|
1254020b8b | ||
|
|
7f03c17a08 | ||
|
|
4440506858 | ||
|
|
01b4820b93 | ||
|
|
fc8ee11955 | ||
|
|
fe30f9739b | ||
|
|
6be0089cac | ||
|
|
80cb93f8e1 | ||
|
|
a3ad4b3616 | ||
|
|
89b5907eb6 | ||
|
|
68d262ba93 | ||
|
|
ee3a44388c | ||
|
|
51e15ced3f | ||
|
|
aac716d497 | ||
|
|
2353ca0621 | ||
|
|
8bc5770c28 | ||
|
|
913517f19d | ||
|
|
0d385c237a | ||
|
|
94bf21b9be | ||
|
|
a4b697f41e | ||
|
|
b047c1318f | ||
|
|
a5d6881e9e | ||
|
|
eddbbc58b1 | ||
|
|
908db3cd59 | ||
|
|
8a42ab14ad | ||
|
|
c2f70d1cc7 | ||
|
|
89452a9d8e | ||
|
|
563411a33a | ||
|
|
d1889b77e5 | ||
|
|
e8a9d1bdc7 | ||
|
|
9b2de5f215 | ||
|
|
779cac9b77 | ||
|
|
a4d77bec6b | ||
|
|
dd6bad1b6e | ||
|
|
0d93816827 | ||
|
|
ca95d76659 | ||
|
|
d58a83cda7 | ||
|
|
69c5373db0 | ||
|
|
a55d02dd31 | ||
|
|
02d318e66d | ||
|
|
9f72ca2329 | ||
|
|
2d12ad9251 | ||
|
|
09c072bda6 | ||
|
|
9909a4123f | ||
|
|
63c59b6570 | ||
|
|
ee4cd4756b | ||
|
|
bd0c6c9ce3 | ||
|
|
213e621412 | ||
|
|
5d53a9edaf | ||
|
|
c2fb0fffbd | ||
|
|
fc05fad277 | ||
|
|
1466d2b97e | ||
|
|
13351c0091 | ||
|
|
19f98ce8ea | ||
|
|
4b5fefa521 | ||
|
|
f8b4dc3a2d | ||
|
|
4d571290c7 | ||
|
|
3a35da8f27 | ||
|
|
1b1efbd0f0 | ||
|
|
d068c85e80 | ||
|
|
145ea416be | ||
|
|
0b6be3a0f6 | ||
|
|
7cf2cf0756 | ||
|
|
69eb3a9756 | ||
|
|
7b20da2276 | ||
|
|
eb376899ce | ||
|
|
2123ee0218 | ||
|
|
6e94c70fbb | ||
|
|
80b181293a | ||
|
|
fb59508ad1 | ||
|
|
9e20b3a18e | ||
|
|
505c44a4d3 | ||
|
|
c0d55112b4 | ||
|
|
e246db4604 | ||
|
|
2d5e41d566 | ||
|
|
c3e248ec79 | ||
|
|
7da60e219d | ||
|
|
8978f27145 | ||
|
|
a6749c0a26 | ||
|
|
d20fe1f4ee | ||
|
|
05fe9b6b81 | ||
|
|
e4b677be3d | ||
|
|
05a98a0107 | ||
|
|
769f864360 | ||
|
|
af3012abff | ||
|
|
cdebffe462 | ||
|
|
5b9c9c4833 | ||
|
|
9605a6b712 | ||
|
|
6f304736c5 | ||
|
|
dbe7ef7a0c | ||
|
|
f0a705595b | ||
|
|
076540752b | ||
|
|
5bc8f819f0 | ||
|
|
f3e1df3997 | ||
|
|
465ce80e41 | ||
|
|
b2f72d3f70 | ||
|
|
a676590e30 | ||
|
|
7688535204 | ||
|
|
7310a2c6cc | ||
|
|
3bbc052794 | ||
|
|
d57749ec98 | ||
|
|
5b637c68ee | ||
|
|
3e8ca224a8 | ||
|
|
6e6a7de1a8 | ||
|
|
ff2e425b48 | ||
|
|
f7ee864709 | ||
|
|
93330eaf1d | ||
|
|
c4503cb8f8 | ||
|
|
a11957d0b4 | ||
|
|
2177e51857 | ||
|
|
ff3bbc56bc | ||
|
|
3e5d43fd8b | ||
|
|
fada3aabfa | ||
|
|
7a09086c6b | ||
|
|
890829aa93 | ||
|
|
88096cbbfe | ||
|
|
c56f5421f0 | ||
|
|
fa6eb2fc22 | ||
|
|
c547d2cf67 | ||
|
|
2f5f63ed13 | ||
|
|
2237ebd46e | ||
|
|
f4679bffc3 | ||
|
|
133bfe161c | ||
|
|
39961a686f | ||
|
|
dfedda8e28 | ||
|
|
7e17d38754 | ||
|
|
9f7e091aba | ||
|
|
55a276ff9a | ||
|
|
5f5c5f3d42 | ||
|
|
83aab8f825 | ||
|
|
d5bc4c0522 | ||
|
|
e5133e27e6 | ||
|
|
bbbf822561 | ||
|
|
b0e26d865c | ||
|
|
0bf1d14756 | ||
|
|
e5676aaf9b | ||
|
|
acc4d77fe9 | ||
|
|
241c2e5d38 | ||
|
|
cab6ce93d6 | ||
|
|
aad9f76a39 | ||
|
|
ec19ceb22f | ||
|
|
1689a121e5 | ||
|
|
120a694324 | ||
|
|
90c67d8f64 | ||
|
|
a2db424eb1 | ||
|
|
bff582d5ed | ||
|
|
8bc9868705 | ||
|
|
7b46bfa0d1 | ||
|
|
2770752813 | ||
|
|
2d83b6edb2 | ||
|
|
39e76b0e4f | ||
|
|
e9805c98d5 | ||
|
|
177af6cae7 | ||
|
|
cb1bbeaf3a | ||
|
|
46a1a8dfde | ||
|
|
4b4ac7c706 | ||
|
|
ad0ad2c4e1 | ||
|
|
df2204d50f | ||
|
|
fa883a0220 | ||
|
|
436833f138 | ||
|
|
4ecee47caa | ||
|
|
5db75661cf | ||
|
|
64b5010b15 | ||
|
|
0733018ba5 | ||
|
|
6f43efde23 | ||
|
|
fb75153d29 | ||
|
|
339227877a | ||
|
|
7710b1df43 | ||
|
|
c0a8460575 | ||
|
|
7027c7486b | ||
|
|
a42b56c7c7 | ||
|
|
c331659026 | ||
|
|
01088f77ab | ||
|
|
7d302574cc | ||
|
|
ee4a419019 | ||
|
|
1173b33715 | ||
|
|
0fe5a3ba5e | ||
|
|
6c06bfbf41 | ||
|
|
6bab1d2840 | ||
|
|
89044a8649 | ||
|
|
94e686ba44 | ||
|
|
86110cf1de | ||
|
|
9b664e2944 | ||
|
|
78ff568dfb | ||
|
|
e1d2709431 | ||
|
|
47556f2290 | ||
|
|
531eb4b417 | ||
|
|
7f8b1e920a | ||
|
|
2f084d204e | ||
|
|
a93fedf945 | ||
|
|
8fd88300ce | ||
|
|
d3f0331e8e | ||
|
|
9fb0da69cc | ||
|
|
4675bf9ae8 | ||
|
|
da631cd441 | ||
|
|
fd40f53d2e | ||
|
|
9f420af5e2 | ||
|
|
9ff4b0e5b2 | ||
|
|
901cb1fab0 | ||
|
|
809c93a19e | ||
|
|
62c307d6f2 | ||
|
|
31488478c1 | ||
|
|
59fa14f989 | ||
|
|
1c34777024 | ||
|
|
dc3bc9f30d | ||
|
|
96692bfc3b | ||
|
|
4aa3927b55 | ||
|
|
6eea879a14 | ||
|
|
c7862fd701 | ||
|
|
e1f4426f76 | ||
|
|
cc37769c91 | ||
|
|
337d533dd5 | ||
|
|
bc4a62da96 | ||
|
|
4a58c778e4 | ||
|
|
866e9e73b1 | ||
|
|
3582f6501a | ||
|
|
dfa0970585 | ||
|
|
33f2d2fbd8 | ||
|
|
85bb30a19d | ||
|
|
90ee83fb3e | ||
|
|
bb30cac9df | ||
|
|
d8ecb4afec | ||
|
|
9d097c7cc1 | ||
|
|
e7356bfbb6 | ||
|
|
b0d84a4a3d | ||
|
|
ee795362ba | ||
|
|
e5e76f163c | ||
|
|
d47db72584 | ||
|
|
cde8738f0e | ||
|
|
925a174ae2 | ||
|
|
5654c97c6b | ||
|
|
d9590baf4c | ||
|
|
dda1a38143 | ||
|
|
d239b319ef | ||
|
|
8164e8eac3 | ||
|
|
60cbe5ec4c | ||
|
|
b9b735ce9f | ||
|
|
65032619e2 | ||
|
|
da581072b4 | ||
|
|
f242eba9c1 | ||
|
|
7dad802981 | ||
|
|
3f54e37143 | ||
|
|
ad3c0ebbfe | ||
|
|
4fce2f394d | ||
|
|
ce61609900 | ||
|
|
ae23300c07 | ||
|
|
e7055bedf8 | ||
|
|
dffc613d46 | ||
|
|
7fb2974259 | ||
|
|
4138785a4e | ||
|
|
91b788dc57 | ||
|
|
0bfb73b632 | ||
|
|
893475ad89 | ||
|
|
8bd9ab7b84 | ||
|
|
266487fdab | ||
|
|
76902e00eb | ||
|
|
2cf7ed0d26 | ||
|
|
1060e3c25a | ||
|
|
562486c14e | ||
|
|
acd0a98641 | ||
|
|
92e75fe05d | ||
|
|
43646b78ef | ||
|
|
03d076197f | ||
|
|
596b15799d | ||
|
|
d6e1705a1a | ||
|
|
525c8d3dd9 | ||
|
|
defa3a0922 | ||
|
|
15c2187c57 | ||
|
|
cabf623e11 | ||
|
|
47f2e0a8f7 | ||
|
|
b5af497aad | ||
|
|
514d2b38b4 | ||
|
|
2f5a09bc99 | ||
|
|
11c2d5dce4 | ||
|
|
bfc735a004 | ||
|
|
b26bb2e5b7 | ||
|
|
366ac0c03c | ||
|
|
617438d770 | ||
|
|
dfb0789191 | ||
|
|
8db441d6a8 | ||
|
|
1a1840ae11 | ||
|
|
cc7128ce4c | ||
|
|
9d87a82210 | ||
|
|
d6692e3ead | ||
|
|
80b408f9a6 | ||
|
|
7f486ac48f | ||
|
|
1ea356688f | ||
|
|
193ca45248 | ||
|
|
6678e48ccc | ||
|
|
1eab2ccba3 | ||
|
|
2d09b3dbdf | ||
|
|
83b01aa627 | ||
|
|
0a3ff11223 | ||
|
|
c9b28c7692 | ||
|
|
c890dc8d43 | ||
|
|
84477fccee | ||
|
|
1d103f11c3 | ||
|
|
c157f0cdad | ||
|
|
8e1f54a213 | ||
|
|
17a691ad39 | ||
|
|
2ff3c37a54 | ||
|
|
c48a521882 | ||
|
|
a8ceb6bcaf | ||
|
|
1fcda8092e | ||
|
|
c3471fd04e | ||
|
|
c5b9a4eb17 | ||
|
|
b90f3c7d32 | ||
|
|
38663e1365 | ||
|
|
d8d49d1835 | ||
|
|
25f9500d5a | ||
|
|
7de9b97c6c | ||
|
|
bd60d7cd3b | ||
|
|
eaacc34c6e | ||
|
|
b2ef660b3a | ||
|
|
22f9c69fc1 | ||
|
|
2f896ab068 | ||
|
|
9d2d7ee869 | ||
|
|
b749236724 | ||
|
|
fc6f7ceba4 | ||
|
|
d4aba14fea | ||
|
|
cff1c299ab | ||
|
|
8fd12c53d2 | ||
|
|
68133801d8 | ||
|
|
79e3951ac8 | ||
|
|
4ca6a04ce3 | ||
|
|
cc687c8ead | ||
|
|
1e139dc86c | ||
|
|
552e7a8cf1 | ||
|
|
dc9b619307 | ||
|
|
1f6855f085 | ||
|
|
fef902f1da | ||
|
|
ec8deaad69 | ||
|
|
f66a45ba8b | ||
|
|
40f8a12c40 | ||
|
|
3ca4aa6858 | ||
|
|
4004153a5a | ||
|
|
a006082a47 | ||
|
|
7753257842 | ||
|
|
63d54b0212 | ||
|
|
feb445d558 | ||
|
|
b973dd342a | ||
|
|
e3378d23d4 | ||
|
|
38c799e27e | ||
|
|
350ceddf3f | ||
|
|
86daac1424 | ||
|
|
39075fe06d | ||
|
|
b8b0869a54 | ||
|
|
eb0383ea89 | ||
|
|
cab8e4e7f5 | ||
|
|
f03efd9460 | ||
|
|
8f715434ac | ||
|
|
4ecd589d84 | ||
|
|
0a5bd40430 | ||
|
|
6862cbdec2 | ||
|
|
72605cac51 | ||
|
|
a2ab0cde79 | ||
|
|
d6739192fd | ||
|
|
410ea1f8f1 | ||
|
|
e42d63c7be | ||
|
|
f7baf2716a | ||
|
|
0671556002 | ||
|
|
36f236bc44 | ||
|
|
b160b1d1d5 | ||
|
|
1246878f00 | ||
|
|
27237acc88 | ||
|
|
8eb4317e37 | ||
|
|
4412b13928 | ||
|
|
9497090093 | ||
|
|
8175e4e723 | ||
|
|
a256f58de1 | ||
|
|
44818d3527 | ||
|
|
c517d73a71 | ||
|
|
4076c8ddaf | ||
|
|
5325a93990 | ||
|
|
a1afdc5f3c | ||
|
|
6e5db9e44e | ||
|
|
2b6a69068c | ||
|
|
21475e86f2 | ||
|
|
c13507ae0c | ||
|
|
0646509b9a | ||
|
|
0dbc0f0442 | ||
|
|
919a8e81ea | ||
|
|
5608bf868e | ||
|
|
df238e2f44 | ||
|
|
f0080b944d | ||
|
|
a1b4da6a30 | ||
|
|
816327f4f7 | ||
|
|
964499a06f | ||
|
|
866f53658e | ||
|
|
8707f3f122 | ||
|
|
09c51d1a6a | ||
|
|
bf1903d17b | ||
|
|
2ea1af59b9 | ||
|
|
8c9d4b58ed | ||
|
|
0856790760 | ||
|
|
d9205adc60 | ||
|
|
2b44c68794 | ||
|
|
c9b1d0c75f | ||
|
|
7a65dca973 | ||
|
|
bfb3a105ac | ||
|
|
c96b1d4db3 | ||
|
|
dbe741da12 | ||
|
|
49547a33f8 | ||
|
|
49a50152cc | ||
|
|
f1ba07eab7 | ||
|
|
7b24b47adf | ||
|
|
bf8cf9fb81 | ||
|
|
a7a6812a19 | ||
|
|
af2b6f8034 | ||
|
|
9aac004c2c | ||
|
|
7f6bdbe6eb | ||
|
|
f06534eb2e | ||
|
|
e42fe2fead | ||
|
|
a78ea8f2e8 | ||
|
|
dcf50104f0 | ||
|
|
57619fca06 | ||
|
|
748009735c | ||
|
|
577fc7b528 | ||
|
|
d6fe59bf73 | ||
|
|
dedad11102 | ||
|
|
d32692922b | ||
|
|
7b3c0009f6 | ||
|
|
a5c85244a7 | ||
|
|
aea3154b3b | ||
|
|
f7c8fe9857 | ||
|
|
eb067af098 | ||
|
|
71c5c5814c | ||
|
|
73b042cc82 | ||
|
|
4d2714facc | ||
|
|
d27d8fd087 | ||
|
|
e468f0d5fc | ||
|
|
c0715b4c63 | ||
|
|
445b5ad231 | ||
|
|
315bf64ccb | ||
|
|
d6ccc48963 | ||
|
|
1544f6b6ed | ||
|
|
d1dcc41f69 | ||
|
|
0777561390 | ||
|
|
0c473c6ccb | ||
|
|
974540cc63 | ||
|
|
fc3b967f33 | ||
|
|
b1abcb9310 | ||
|
|
3d38150563 | ||
|
|
380c0b1408 | ||
|
|
5dabd945bd | ||
|
|
9cd49f1554 | ||
|
|
c72bb4502a | ||
|
|
ebfe8fbfd4 | ||
|
|
5a6350df2a | ||
|
|
0afd6cee46 | ||
|
|
a6f5141f42 | ||
|
|
fbb88452fb | ||
|
|
af11110e0f | ||
|
|
d07d4f5300 | ||
|
|
b557331d63 | ||
|
|
280e039e19 | ||
|
|
4935b88588 | ||
|
|
d950ae0ee4 | ||
|
|
1bbe6e1068 | ||
|
|
6e3445c2d6 | ||
|
|
569edb7685 | ||
|
|
d610872ee7 | ||
|
|
8414b1de2b | ||
|
|
0b8daf5283 | ||
|
|
cb6824755d | ||
|
|
1782af2abb | ||
|
|
45f4b64cd4 | ||
|
|
cf69a7ae33 | ||
|
|
637a41d392 | ||
|
|
45b8364b0e | ||
|
|
f55d6fa640 | ||
|
|
ecc8c8af8f | ||
|
|
0c45e9eac4 | ||
|
|
b6820e7e79 | ||
|
|
024d776d2c | ||
|
|
7148f377c4 | ||
|
|
9cefda4f7b | ||
|
|
f78046acce | ||
|
|
9405abb3fd | ||
|
|
eaf7a123d4 | ||
|
|
fce6d2982e | ||
|
|
99dbf35953 | ||
|
|
892745a592 | ||
|
|
922d0ab150 | ||
|
|
ed8df15de4 | ||
|
|
ad2a9a4cea | ||
|
|
ce50c08e91 | ||
|
|
64852194ea | ||
|
|
0ef1fa0627 | ||
|
|
fea552511e | ||
|
|
7c90b4630b | ||
|
|
90d8a11917 | ||
|
|
1bdc650635 | ||
|
|
d0d46d482e | ||
|
|
af0c8d57b5 | ||
|
|
dc7ac427b5 | ||
|
|
ebf7fd20ae | ||
|
|
6d68aabc41 | ||
|
|
8ad9b481a8 | ||
|
|
e6028a913c | ||
|
|
53b7ef0429 | ||
|
|
14cd444f8d | ||
|
|
525a9e381f | ||
|
|
3a4463d2e4 | ||
|
|
2aab61b91d | ||
|
|
4b59ae0976 | ||
|
|
fa5edfb53e | ||
|
|
3980f08440 | ||
|
|
237edae7df | ||
|
|
61c5777a6b | ||
|
|
6852f6ee80 | ||
|
|
2965b351a5 | ||
|
|
798e021803 | ||
|
|
def6cb2c92 | ||
|
|
a053641ea5 | ||
|
|
c6bf07973e | ||
|
|
7dfb4eb374 | ||
|
|
b424927b80 | ||
|
|
42f040f885 | ||
|
|
f776a8f1cf | ||
|
|
9fddc294ab | ||
|
|
7fdd633561 | ||
|
|
b8080ef1db | ||
|
|
e044e02541 | ||
|
|
22dabf9c2a | ||
|
|
96a43ba3c5 | ||
|
|
a8721ff3c3 | ||
|
|
d15980cdd3 | ||
|
|
2e60555506 | ||
|
|
692a4b33c8 | ||
|
|
da0a235a33 | ||
|
|
77e1dc21bb | ||
|
|
94b6be4c3d | ||
|
|
1ff5f1f91d | ||
|
|
3e053db00b | ||
|
|
317c8f40da | ||
|
|
267d0d96af | ||
|
|
660a986e04 | ||
|
|
b83023703b | ||
|
|
740eaa56b7 | ||
|
|
5b06a41ebc | ||
|
|
894d5f5861 | ||
|
|
969640717f | ||
|
|
d69c18dba4 | ||
|
|
125b199f85 | ||
|
|
4924e871b2 | ||
|
|
4ab5d9459e | ||
|
|
ff3f2ed80c | ||
|
|
dee00b08cc | ||
|
|
3052681761 | ||
|
|
a90aa4211b | ||
|
|
09f8e25fdd | ||
|
|
702ba26dd8 | ||
|
|
7284aa0d05 | ||
|
|
fb5cee3b56 | ||
|
|
d9147ae21b | ||
|
|
1749a0e7e1 | ||
|
|
3a7d160bfa | ||
|
|
958ad5f999 | ||
|
|
178f42b89a | ||
|
|
cd15f653f6 | ||
|
|
6e1a32e891 | ||
|
|
0c1e3239b7 | ||
|
|
e6b6c3a19c | ||
|
|
f547a7dbc2 | ||
|
|
fa8846a2ce | ||
|
|
e4cf96cb81 | ||
|
|
9b51181575 | ||
|
|
22d79cd585 | ||
|
|
25651261c2 | ||
|
|
687dea0543 | ||
|
|
55b7a9f513 | ||
|
|
61881ca7cd | ||
|
|
2ab2a5a973 | ||
|
|
d3a07c866f | ||
|
|
7c3263bc7b | ||
|
|
053e70342c | ||
|
|
46f51b1d67 | ||
|
|
81e84ed829 | ||
|
|
04197a83d0 | ||
|
|
931e74e2a6 | ||
|
|
7b26cdc75e | ||
|
|
c72c8c62de | ||
|
|
e65f781bbd | ||
|
|
2846cff2d3 | ||
|
|
31fcc7d395 | ||
|
|
ec776b48d5 | ||
|
|
b8226ace04 | ||
|
|
3bf1dde5b2 | ||
|
|
3b3ba1b5df | ||
|
|
d1837d2684 | ||
|
|
fbe39b7357 | ||
|
|
f4b9b2a477 | ||
|
|
af47b4bd40 | ||
|
|
e78c3d132c | ||
|
|
2dbda3d004 | ||
|
|
6d4791c6e9 | ||
|
|
3c2c4c5f86 | ||
|
|
358f7cf00b | ||
|
|
7248eef1f0 | ||
|
|
422481533e | ||
|
|
6cd9fda009 | ||
|
|
c46e31c536 | ||
|
|
a7a24bcf84 | ||
|
|
73d4fd00bd | ||
|
|
e52a2fb87c | ||
|
|
2bdfdc0ed2 | ||
|
|
6b3444271c | ||
|
|
78c5ad0cdb | ||
|
|
df00db0dc2 | ||
|
|
89731ae74a | ||
|
|
592a54f8ee | ||
|
|
9fcb264e05 | ||
|
|
1456853135 | ||
|
|
92ebe1f940 | ||
|
|
cd83e6febc | ||
|
|
9fcb8e0d1b | ||
|
|
adbd978155 | ||
|
|
455676e982 | ||
|
|
faf33212e7 | ||
|
|
8dba219f42 | ||
|
|
ab21e705d5 | ||
|
|
4fd0dfc7c4 | ||
|
|
fb49ed806e | ||
|
|
5353906dea | ||
|
|
25fb3e368a | ||
|
|
811386090d | ||
|
|
186a5c07c2 | ||
|
|
c6179239e1 | ||
|
|
d1e6063551 | ||
|
|
9de436a61b | ||
|
|
e00cd04963 | ||
|
|
a24c6d30b2 | ||
|
|
cc98cfb27e | ||
|
|
37c9154b13 | ||
|
|
3632b1b916 | ||
|
|
1fc4c9a1f7 | ||
|
|
7b98b1e7a7 | ||
|
|
6f1d63bf42 | ||
|
|
ca3f4e1a7c | ||
|
|
574033a5ba | ||
|
|
1eec8e425d | ||
|
|
9af40d76cd | ||
|
|
f6c459d2d7 | ||
|
|
b4c877c0ea | ||
|
|
0087faf3c3 | ||
|
|
f3f7664300 | ||
|
|
712feae198 | ||
|
|
f641b70343 | ||
|
|
643d7ffe36 | ||
|
|
c67f558131 | ||
|
|
ac3b7631d0 | ||
|
|
2774d52043 | ||
|
|
08ee1c9736 | ||
|
|
56f266749f | ||
|
|
e53dc381c5 | ||
|
|
de8f294244 | ||
|
|
79b07f8493 | ||
|
|
5d29302627 | ||
|
|
4b33645805 | ||
|
|
86b6cf78e7 | ||
|
|
91b9bea35b | ||
|
|
2b6b3aec91 | ||
|
|
752a7aa7b5 | ||
|
|
f931d759bb | ||
|
|
57453a1f41 | ||
|
|
349109a4b5 | ||
|
|
b7445f2346 | ||
|
|
f16c78fc9f | ||
|
|
7fab8564d0 | ||
|
|
a02fb7bf82 | ||
|
|
8bf03bd7e3 | ||
|
|
056d449f89 | ||
|
|
889807b449 | ||
|
|
2f5d824348 | ||
|
|
6b711b759c | ||
|
|
dcb77a59c7 | ||
|
|
168bda2b8f | ||
|
|
119c4b577b | ||
|
|
cf3b94d29b | ||
|
|
678e119d2f | ||
|
|
b82c4c828b | ||
|
|
5fcbdc3e9a | ||
|
|
941925a56e | ||
|
|
9ee60404cf | ||
|
|
662c22b51a | ||
|
|
166fa39d89 | ||
|
|
23c559bbb0 | ||
|
|
79e372c2f2 | ||
|
|
7cd532ae58 | ||
|
|
3b42e205ad | ||
|
|
15b9d8d808 | ||
|
|
5e9cf2571d | ||
|
|
95b6a2193f | ||
|
|
a13259d3f9 | ||
|
|
c3e9ce73b0 | ||
|
|
8fc7c26aa1 | ||
|
|
fbc4551894 | ||
|
|
06cea6ed3a | ||
|
|
26325e5ee6 | ||
|
|
8578c2f1a2 | ||
|
|
6b2ff57559 | ||
|
|
48a227b5ed | ||
|
|
7ab323cd33 | ||
|
|
55a5d46fb9 | ||
|
|
f42611d17b | ||
|
|
8c35ff3c3b | ||
|
|
91c28e5f44 | ||
|
|
7e65d8e757 | ||
|
|
813a8e5476 | ||
|
|
50d30e8d88 | ||
|
|
cc10990d64 | ||
|
|
20af407203 | ||
|
|
da1f4e8e2f | ||
|
|
3a9a23b350 | ||
|
|
20f4685541 | ||
|
|
3f0323192c | ||
|
|
2abc9b214b | ||
|
|
1277a805c8 | ||
|
|
6591da5917 | ||
|
|
e50be12eca | ||
|
|
69876763e2 | ||
|
|
c72a16147c | ||
|
|
082eb2dad3 | ||
|
|
9edaf13c68 | ||
|
|
24128ae325 | ||
|
|
dadb8973bf | ||
|
|
d1bec14de8 | ||
|
|
462244684e | ||
|
|
373bf2de84 | ||
|
|
e07abd8ad6 | ||
|
|
330893ac6a | ||
|
|
2a1ace1f81 | ||
|
|
d93844bdd8 | ||
|
|
092c0da4b5 | ||
|
|
f431f262be | ||
|
|
6116e83815 | ||
|
|
09967f66f2 | ||
|
|
c4f3838b1e | ||
|
|
4c14c4c762 | ||
|
|
7bb849f4eb | ||
|
|
ad89961737 | ||
|
|
5b7559ea76 | ||
|
|
7f49404d62 | ||
|
|
c26f3b000d | ||
|
|
1696d77516 | ||
|
|
92e63fbb46 | ||
|
|
c05ebc075f | ||
|
|
e98aa0f6e6 | ||
|
|
48ecbf4f5d | ||
|
|
615eceb94b | ||
|
|
1cce542cd5 | ||
|
|
b5b38ec642 | ||
|
|
e1fe92ffe7 | ||
|
|
ef591b7af1 | ||
|
|
a2173ea4fe | ||
|
|
ca9b423f70 | ||
|
|
5da17ebf50 | ||
|
|
6abcbe01cd | ||
|
|
bff43f09a0 | ||
|
|
253fbe0ee5 | ||
|
|
13f75de6ee | ||
|
|
7c77ebe6e5 | ||
|
|
7f79910092 | ||
|
|
a97d4b6af5 | ||
|
|
f189307b9c | ||
|
|
014d0a3842 | ||
|
|
a0c35464ef | ||
|
|
2de1f4363c | ||
|
|
4f3e26b616 | ||
|
|
f47f999480 | ||
|
|
8296570d54 | ||
|
|
22f1a01b1c | ||
|
|
2cb9d8ed83 | ||
|
|
398d5e32ae | ||
|
|
df47565bd9 | ||
|
|
79885c70fc | ||
|
|
166fe70781 | ||
|
|
39af8d8252 | ||
|
|
ac39928a01 | ||
|
|
ba093a8d80 | ||
|
|
215da26097 | ||
|
|
f089ce3929 | ||
|
|
4fb9468664 | ||
|
|
6990528bb9 | ||
|
|
0ddfa4c840 | ||
|
|
d553dcf399 | ||
|
|
01d0e9257f | ||
|
|
9bd8e3e65e | ||
|
|
6bde942abe | ||
|
|
b98dca77e1 | ||
|
|
1a326ffbf7 | ||
|
|
030719f583 | ||
|
|
1dc0438827 | ||
|
|
f85741be30 | ||
|
|
04a0bcaaec | ||
|
|
b2aa49a5b4 | ||
|
|
9a1b8d0712 | ||
|
|
510e8b8992 | ||
|
|
b5feee60be | ||
|
|
955d15d434 | ||
|
|
2d7e770b4b |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
**/*.o
|
||||
70
README.md
70
README.md
@@ -1,16 +1,72 @@
|
||||
# LittleV Graphical Libraray Core
|
||||
# Littlev Graphics Libraray
|
||||
|
||||
LittleV Graphical Library is C written software libraray which helps you to add modern and innovative graphical user interface to your embedded application.
|
||||

|
||||
|
||||
The library supports high level graphical effects, like anialaiasing, opacity, color fade etc.
|
||||
LittlevGL provides everything you need to create a Graphical User Interface (GUI) on embedded systems with easy-to-use graphical elements, beautiful visual effects and low memory footprint.
|
||||
|
||||
The GUI can be built from simle objects like screens, buttons labels, images etc.
|
||||
Homepage: https://littlevgl.com
|
||||
|
||||
The "misc" modul is required to use use the library. (https://github.com/littlevgl/misc)
|
||||
### Table Of Content
|
||||
* [Key features](#key-features)
|
||||
* [Porting](#porting)
|
||||
* [Project set-up](#project-set-up)
|
||||
* [PC simulator](#pc-simulator)
|
||||
* [Screenshots](#screenshots)
|
||||
* [Contributing](#contributing)
|
||||
* [Donate](#donate)
|
||||
|
||||
Check littlev.hu for more information!
|
||||
## Key features
|
||||
* Powerful building blocks buttons, charts, lists, sliders, images etc
|
||||
* Advanced graphics with animations, anti-aliasing, opacity, smooth scrolling
|
||||
* Various input devices touch pad, mouse, keyboard, encoder, buttons etc
|
||||
* Multi language support with UTF-8 decoding
|
||||
* Fully customizable graphical elements
|
||||
* Hardware independent to use with any microcontroller or display
|
||||
* Scalable to operate with few memory (50 kB Flash, 10 kB RAM)
|
||||
* OS, External memory and GPU supported but not required
|
||||
* Single frame buffer operation even with advances graphical effects
|
||||
* Written in C for maximal compatibility
|
||||
* Simulator to develop on PC without embedded hardware
|
||||
* Tutorials, examples, themes for rapid development
|
||||
* Documentation and API references online
|
||||
|
||||
There are two branches: master and beta. In beta you will find the newest features which are not released yet.
|
||||
## Porting
|
||||
In the most sime case you need 4 things:
|
||||
1. Call `lv_tick_inc(1)` in every millisecods in a Timer or Task
|
||||
2. Register a function which can **copy a pixel array** to an area of the screen.
|
||||
3. Register a function which can **read an input device**. (E.g. touch pad)
|
||||
4. Call `lv_task_handler()` periodically in every few milliseconds
|
||||
For more information visit https://littlevgl.com/porting
|
||||
Or check the [Porting tutorial](https://github.com/littlevgl/lv_examples/blob/master/lv_tutorial/0_porting/lv_tutorial_porting.c)
|
||||
|
||||
## Project set-up
|
||||
1. **Clone** or [Download](https://littlevgl.com/download) the lvgl repository: `git clone https://github.com/littlevgl/lvgl.git`
|
||||
2. **Create project** with your prefered IDE and add the *lvgl* folder
|
||||
3. Copy **lvgl/lv_conf_templ.h** as **lv_conf.h** next to the *lvgl* folder
|
||||
4. In the lv_conf.h delete the first `#if 0` and its `#endif`. Let the default configurations at first.
|
||||
5. In your *main.c*: #include "lvgl/lvgl.h"
|
||||
6. In your *main function*:
|
||||
* lvgl_init();
|
||||
* tick, display and input device initialization (see above)
|
||||
7. To **test** create a label: `lv_obj_t * label = lv_label_create(lv_scr_act(), NULL);`
|
||||
8. In the main *while(1)* call `lv_task_handler();` and make a few milliseconds delay (e.g. `my_delay_ms(5);`)
|
||||
9. Compile the code and load it to your embedded hardware
|
||||
|
||||
## PC Simulator
|
||||
If you don't have got an embedded hardware you can test the graphics library in a PC simulator. The simulator uses [SDL2](https://www.libsdl.org/) to emulate a display on your monitor and a touch pad with your mouse.
|
||||
|
||||
There is a pre-configured PC project for **Eclipse CDT** in this repository: https://github.com/littlevgl/pc_simulator
|
||||
|
||||
## Screenshots
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## Contributing
|
||||
See [CONTRIBUTING.md](https://github.com/littlevgl/lvgl/blob/master/docs/CONTRIBUTING.md)
|
||||
|
||||
## Donate
|
||||
If you are pleased with the graphics library, found it useful or be happy with the support you got, please help its further development:
|
||||
|
||||
[](https://littlevgl.com/donate)
|
||||
|
||||
46
docs/CODE_OF_CONDUCT.md
Normal file
46
docs/CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [atom@github.com](mailto:atom@github.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
163
docs/CONTRIBUTING.md
Normal file
163
docs/CONTRIBUTING.md
Normal file
@@ -0,0 +1,163 @@
|
||||
# Contributing to Littlev Graphics Library
|
||||
It's glad to see that you are interested in Contributing to LittlevGL!
|
||||
|
||||
In this guide you can learn how can you help to develop LittlevGL.
|
||||
|
||||
### Table Of Content
|
||||
* [Who can contribute?](#who-can-contribute)
|
||||
* [How to report an issue?](#how-to-report-a-bug)
|
||||
* [How to suggest a feature?](#how-to-suggest-a-feature)
|
||||
* [How to implement a feature?](#how-to-implement-a-feature)
|
||||
* [Styling guide](#styling-guide)
|
||||
|
||||
## Who can contribute?
|
||||
As graphical interfaces for embedded systems has an increasing relevance today you also might find important to work with a good graphics library. Now - independently from skills, programming level or any personal attributes - you can influence and help the development of Littlev Graphics Library with:
|
||||
* Report an issue
|
||||
* Suggest feature
|
||||
* Fix an issue
|
||||
* Implement a feature
|
||||
* Help with testing bugfixes and new features
|
||||
|
||||
Please, take a look at [CODE_OF_CONDUCT](https://github.com/littlevgl/lvgl/blob/master/docs/CODE_OF_CONDUCT.md)
|
||||
|
||||
There a few general rules:
|
||||
* We use [GitHub's issue tracker](https://github.com/littlevgl/lvgl/issues)
|
||||
* Be kind and respectful. Strating with "Hi" is always a good idea :)
|
||||
* If somebedy helped you give a feedback.
|
||||
* Always create an issue before creating a [Pull request](https://help.github.com/articles/about-pull-requests/) (maybe somebeody already working on this issue)
|
||||
* One issue should be about one topic. If you have other questions please open a new issue.
|
||||
* Tell your remarks in a structured way. Use paragraphs and the [Markdown](https://guides.github.com/features/mastering-markdown/) support of GitHub.
|
||||
* Be sure you are using the lates version (from `master` branch)
|
||||
|
||||
## How to report a bug?
|
||||
If you found a **simple and straightforward bug** like:
|
||||
* misspelling (in comments function/variable names or grammatical issues in comments)
|
||||
* not handled error cases (negative array index, overflow etc)
|
||||
* anything else which can be fixed locally with a few lines of code
|
||||
* or defective documentation
|
||||
|
||||
then tell
|
||||
* where you found the bug (which file/function/variable)
|
||||
* how can it cause problem
|
||||
* what is your suggeseted solution if you have
|
||||
|
||||
If you faced with **something more clomplex** like:
|
||||
* might be simple but you don't know its origin
|
||||
* affects a whole file, module or even the architecture
|
||||
* needs deeper discussion
|
||||
|
||||
then please
|
||||
* tell what do you experience
|
||||
* tell what do you expect to happen
|
||||
* tell how to reproduce the issue
|
||||
* provide a simlified code example (better if can be tested with copy-paste)
|
||||
* attache your lv_conf.h (if you feel it's important)
|
||||
* logs and long codes should be attached in a file (instead of copying into a comment)
|
||||
|
||||
## How to suggest a feature?
|
||||
If you have a good and useful idea open issue to tell it! Please note the followings on suggesting new features:
|
||||
* What the new feature is about?
|
||||
* Why/Where/In which case is it useful/helpful/relevant?
|
||||
* Can you mention real life usecases/examples for the use this feature?
|
||||
* Can you help in implementing it?
|
||||
|
||||
Your suggestion can have 4 possible outcomes:
|
||||
1. This feature is already exists. In this case you will learn how to achive your goal.
|
||||
2. You can simply realize it with the current functionality.
|
||||
3. Although it's a new feature but it would break LittlevGL's platform independent and/or resource minimalist nature.
|
||||
4. It's really a new feature which would be good to be in LittlevGL. Hurray! In a discussion we figure out the technical details andimplementation options. With the knowledge of how to do it somebody can implement the new feature.
|
||||
|
||||
Keep in mind if you wouldn't like to do the implementation there is no guarantee that it will be ready in the new future.
|
||||
However if you would like to force it, take a look at this page: [Feature request service](http://www.gl.littlev.hu/services#feature)
|
||||
|
||||
## How to implement a feature?
|
||||
In [docs/TODO_MINOR.md](https://github.com/littlevgl/lvgl/blob/master/docs/TODO_MINOR.md) and [docs/TODO_PATCH.md](https://github.com/littlevgl/lvgl/blob/master/docs/TODO_PATCH.md) you can see some ideas which are waiting for somebody to realize them! If want to deal with a feature from this files, please start an issue and discusse the details.
|
||||
|
||||
The new feature should be in a new branch.
|
||||
|
||||
## Styling guide
|
||||
|
||||
### File format
|
||||
Use [lv_misc/lv_templ.c](https://github.com/littlevgl/lvgl/blob/master/lv_misc/lv_templ.c) and [lv_misc/lv_templ.h](https://github.com/littlevgl/lvgl/blob/master/lv_misc/lv_templ.h)
|
||||
|
||||
### Naming conventions
|
||||
* Words are sparated by '_'
|
||||
* In variable and function names use only lower case letters (e.g. *height_tmp*)
|
||||
* In enums and defines use only upper case letters (e.g. *e.g. MAX_LINE_NUM*)
|
||||
* Global names (API):
|
||||
* 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.
|
||||
* Typedefs
|
||||
* prefer `typedef struct` and `typedef enum` instead of `struct name` and `enum name`
|
||||
* always add a closing *..._t*
|
||||
* Abbreviations:
|
||||
* Use abbreviations on public names only if they become longer then 32 characters
|
||||
* Use only very straightforward (e.g. pos: position) or well established (e.g. pr: press) abbreviatons
|
||||
|
||||
### Coding guide
|
||||
* Functions:
|
||||
* Try to write function shorter then is 50 lines
|
||||
* Always shorter then 100 lines (except very straightforwards)
|
||||
* Variables:
|
||||
* One line, one declaration (BAD: char x, y;)
|
||||
* Use `<stdint.h>` (*uint8_t*, *int32_t* etc)
|
||||
* Declare variables when needed (not all at function start)
|
||||
* Use the smallest required scope
|
||||
* Variables in a file (outside functions) are always *static*
|
||||
* Do not use global variables (use functions to set/get static variables)
|
||||
|
||||
### Comments
|
||||
Before every function have a comment like this:
|
||||
|
||||
```c
|
||||
/**
|
||||
* Return with the screen of an object
|
||||
* @param obj pointer to an object
|
||||
* @return pointer to a screen
|
||||
*/
|
||||
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 */`.
|
||||
The code should show clearly what you are doing.
|
||||
|
||||
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*/`
|
||||
|
||||
In comments use \` \` when refering to a variable. E.g. ``/*Update the value of `x_act`*/``
|
||||
|
||||
### Formatting
|
||||
Here is example to show bracket placing and using of white spaces:
|
||||
```c
|
||||
/**
|
||||
* Set a new text for a label. Memory will be allocated to store the text by the label.
|
||||
* @param label pointer to a label object
|
||||
* @param text '\0' terminated character string. NULL to refresh with the current text.
|
||||
*/
|
||||
void lv_label_set_text(lv_obj_t * label, const char * text)
|
||||
{ /* Main bracket 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;
|
||||
}
|
||||
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
Use 4 spaces indentation instead of tab.
|
||||
39
docs/TODO_MAJOR.md
Normal file
39
docs/TODO_MAJOR.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# TODOs for major versions
|
||||
Major versions released typically when API changes are required
|
||||
|
||||
## Contributing
|
||||
Please create an issue to suggest a new feature instead of adding pull request to this file.
|
||||
|
||||
## v6 (released on: in progrss)
|
||||
- [ ] lv_img_upscale removal (generate image with with opacity instead)
|
||||
- [ ] disp_map and disp_fill removal
|
||||
- [ ] disp_flush, mem_blend, mem_fill rework: usea lv_area_t as parameter an GPU support 2D area
|
||||
- [ ] disp_flush: not const color map
|
||||
- [ ] ext size removal, enable drawing on full parent.
|
||||
- [ ] multiple display support
|
||||
- [ ] lv_ufs removal (was required only in the the old image system)
|
||||
|
||||
## v5 (released on: 20.12.2017)
|
||||
**Architectural changes**
|
||||
- [x] Rename repository from *proj_pc* to *pc_simulator*
|
||||
- [x] Integrate *hal* in LittlevGL as a normal folder
|
||||
- [x] Create a new repository for examples
|
||||
- [x] Convert Applications into simple examples
|
||||
- [x] Add tests for all object types
|
||||
|
||||
**API changes**
|
||||
- [x] Rework lv_style_t structure
|
||||
- [x] Remove LV_DOWNSCALE (LV_ANTIALIAS will be used instead)
|
||||
- [x] Rename (and slightly rework) some function, defines and enums to be more descriptive
|
||||
- [x] lv_btnm: rework width control. Now a control byte is used for *width*, *hide* and *no long press* settings.
|
||||
- [x] LV_LABEL_LONG_DOTS removed, use LV_LABEL_LONG_ROLL instead
|
||||
- [x] *lv_list_set_element_text_roll()* removed.
|
||||
- [x] *lv_ddlist_set_fix_height()* instead of *auto_size*
|
||||
- [x] *lv_list_set_sb_out()* removed because now the scrollbar style can position the scrollbar
|
||||
- [x] *lv_gauge* rework to make it more like line meter (remove background but add scale lines)
|
||||
- [x] rename *lv_dispi_...* to *lv_indev_...*
|
||||
- [x] *lv_dispi_t* removed from *lv_action_type_t*. Use lv_indev_act() instead
|
||||
- [x] make styles to global variable to ensure less typing
|
||||
- [x] make fonts to global variables to ensure less typing and easy user-font adding
|
||||
- [x] join symbol fonts into normal built-in fonts
|
||||
- [x] add inline functions to avoide direct use of anchestor functions (e.g. for buttons: lv_cont_set_fit -> lv_btn_set_fit)
|
||||
71
docs/TODO_MINOR.md
Normal file
71
docs/TODO_MINOR.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# TODOs for minor versions
|
||||
Minor versions (x.1.0, x.2.0 ...) released when one or more new feature is addded without changing the API. New features can be added with major versions (1.0.0, 2.0.0 ...) too.
|
||||
|
||||
## Contributing
|
||||
Please create an issue to suggest a new feature instead of adding pull request to this file.
|
||||
|
||||
## Ideas
|
||||
Here are ideas which are not assigned to a minor version yet:
|
||||
- label: add a horzintal line (e.g. underline or line through).
|
||||
- lv_split: new object type, a hor. or ver. line for decoration purpose
|
||||
- lv_valset: new object type, a label with "+" and "-" buttons
|
||||
- lv_listctrl: new object type, a list various controls on th right (sw, cb erc.)
|
||||
- lv_inlist: new object type, inline drop down list (a button wich opens a list in place)
|
||||
- lv_char: new_object type: characteristic set (like chart with draggable points)
|
||||
- lv_vol: new_object type: volume meter (like a bar with segments)
|
||||
- Anim. paths: monentum (tnh(x)), curve (exp), shake
|
||||
- Hover, hover_lost signals
|
||||
- Detached area (for video rendering where LittlevGL don't put pixels)
|
||||
- lv_ta: add placeholder text
|
||||
- image rotate
|
||||
|
||||
|
||||
## v5.2 (in progress)
|
||||
- [ ] Lua interface to craete GUI with script
|
||||
- [ ] Arabic glyph convert (based on letter position)
|
||||
- [ ] Right-to-left write support
|
||||
- [ ] Bit based VDB: 1, 2 or 4 bit
|
||||
- [ ] lv_icon: new object type: an image wich acts as a button
|
||||
- [ ] lv_table: new object type: a table with rows and colums
|
||||
- [ ] triangle drawing
|
||||
- [ ] user defined error callback
|
||||
- [ ] Support more character coding (e.g. UTF8, UTF16 etc)
|
||||
|
||||
## v5.1 (released on: 09.03.2018)
|
||||
- [x] lv_refr_set_roundig_callback: set a function to modify the invalidated area for special display controllers
|
||||
- [x] lv_group_set_focus_callback: set function to call when a new object is focused #94
|
||||
- [x] lv_obj_get_type() return string, e.g. "lv_slider", "lv_btn" etc #91
|
||||
- [x] Font handling extension for effective Chiese font handling (cutsom read functions)
|
||||
- [x] Remove LV_FONT_ANTIALIAS and add fonts with BPP (bit-per-pixel): 1, 2, 4 and 8
|
||||
- [x] lv_img: add pixel level opacity option (ARGB8888 or ARGB8565) (make image upscale pointless)
|
||||
- [x] LV_ANTIALIAS rework: meaning anti-alias lines and curves
|
||||
- [x] Merge symbol fonts (basic, file and feedback) into one font
|
||||
- [x] lv_group: different default style_mod function with LV_COLOR_DEPTH 1
|
||||
- [x] lv_img_set_src() to handle file path, symbols and const variables with one function
|
||||
- [x] LV_PROTECT_PRESS_LOST: prevent the input devices to NOT find new object when the object's pressing is lost
|
||||
- [x] lv_label: draw style.body.padding.hor/ver greater body if body_draw is enabled
|
||||
- [x] LV_LAYOUT_PRETTY: in one row align obeóject vertically to middle
|
||||
- [x] Add user data option to lv_indev_drv_t and pass it with lv_indev_data_t to the read function. #115
|
||||
- [x] LV_GROUP_KEY_ENTER_LONG: sent by the library on long press of LV_GROUP_KEY_ENTER to trigger long press of the object #113
|
||||
- [x] LV_INDEV_TYPE_BUTTON: for a hatdware buttons which press a point on a screen
|
||||
|
||||
## v5.0 (released on: 20.12.2017)
|
||||
- [x] UTF-8 support
|
||||
- [x] lv_tabview: new object type to organise content with tabs
|
||||
- [x] lv_sw: new object type, switch, turn on/off by tap (a little slider)
|
||||
- [x] lv_roller: new object type, a roller to select a value (like on smartphones)
|
||||
- [x] lv_kb: new object type, Keyboard
|
||||
- [x] lv_btnm: lv_btnm_set_tgl() to toggle last button
|
||||
- [x] lv_ta: cursor types
|
||||
- [x] add themes with predefined styles
|
||||
- [x] partial border draw in styles
|
||||
|
||||
## v4.2 (released on: 17.08.2017)
|
||||
- [x] Double VDB support: one for rendering, another to transfer former rendered image to frame buffer in the background (e.g. with DMA) [#15](https://github.com/littlevgl/lvgl/issues/15)
|
||||
- [x] lv_group: to control without touch pad. Issue [#14](https://github.com/littlevgl/lvgl/issues/14)
|
||||
- [x] lv_page: scrl def fit modification: hor:false, ver:true, and always set width to parent width
|
||||
- [x] lv_btn: add lv_btn_get_..._action
|
||||
- [x] lv_list: add lv_list_get_element_label/img
|
||||
- [x] lv_ta: lv_ta_set_one_line to configure the Text area to one lined input field
|
||||
- [x] style animations add
|
||||
- [x] lv_btnm: besides 0. byte (width dsc) 1. byte: hidden (\177, 0x7F, delete)
|
||||
62
docs/TODO_PATCH.md
Normal file
62
docs/TODO_PATCH.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# TODOs for patch versions
|
||||
Patch versions (x.y.1, x.y.2) contain bugfixes without changing the API but they can apppear in minor (x.1.0, x.2.0) or major (1.0.0, 2.0.0) versions too.
|
||||
|
||||
The bugfixes of the still not released version are in `beta` branche.
|
||||
|
||||
## Contributing
|
||||
Please create an issue to introduce a bug instead of adding pull request to this file.
|
||||
|
||||
## v5.1.1 (in progress)
|
||||
- [x] lv_line: set line.width ext. size to not trim parts on x = 0, y = 0 coordinates
|
||||
- [x] lv_conf.h: add LV_COMPILER_VLA_SUPPORTED
|
||||
- [x] lv_group_create: init focus_cb
|
||||
- [x] fix of 16 bit image drawing with alpha bytes
|
||||
- [x] fix text opacity
|
||||
- [x] lv_mbox: enable navigation with LV_GROUP_KEY_DOWN/UP too
|
||||
- [x] lv_conf.h: add LV_COMPILER_VLA_SUPPORTED
|
||||
- [x] lv_slider: inicator draw bugfix
|
||||
- [x] lv_slider: draw greater background on negative padding if knob_in == 1
|
||||
- [x] mono theme: fix typo
|
||||
- [x] style animations: add opacity handling to image, text and line
|
||||
- [x] lv_kb: before ok/close action don't deassign the lv_ta if there is user defined action
|
||||
- [x] in lv_objx_set_... functions apply the new value only if it's different from the current
|
||||
- [x] don't invalide hidden objects
|
||||
- [x] lv_group_del: remove the objects from the groups too
|
||||
|
||||
## v5.0.3 (released on: 09.03.2018)
|
||||
- [x] lv_chart: Fix the use of point_num more then 256 (Thanks to upbeat27)
|
||||
- [x] lv_label: fix 'offset' with LV_ANTIALIAS (LV_LABEL_LONG_ROLL was effected)
|
||||
- [x] lv_label: anim. time wasn't allyed for LV_LABEL_LONG_ROLL
|
||||
- [x] lv_txt_ut8_size fiy for 4 byte characters
|
||||
- [x] lv_slider: fix knob_in with not zero min value
|
||||
- [x] lv_area_is_on: handled some cases wrong
|
||||
- [x] lv_indev: buffered indevs (return *true* in indev_read) was handled as non-buffered
|
||||
- [x] drag: don't invalidate if the object wasn't moved
|
||||
|
||||
## v5.0.2 (released on: 19.01.2018)
|
||||
- [x] Fix dependencied (Thanks to Zaltora)
|
||||
- [x] lv_group: fix memory leak (Thanks to BenQoo)
|
||||
- [x] LV_INDEV_READ_PERIOD 0 build bugfix
|
||||
- [x] lv_roller: lv_roller_get_selected_str: bugfix (was recursive call)
|
||||
- [x] lv_obj_get_style: with NULL style check if the parent is focused and use the focused style
|
||||
- [x] lv_roller: add missing action handling
|
||||
- [x] Set 24 bit colors upper byte (alpha) to 0xFF
|
||||
|
||||
## v5.0.1 (released on: 02.01.2018)
|
||||
- [x] lv_list: fixed when mouse and keyboard used together
|
||||
- [x] lv_btnm: fix bottom border visibility
|
||||
- [x] theme updates
|
||||
- [x] line width fix width anti-aliasing
|
||||
- [x] lv_conf_templ.h add more info
|
||||
|
||||
## v5.0 (released on: 21.12.2017)
|
||||
- [x] lv_btnm: check hide code (\177) at 0. byte position too (if width is not specified)
|
||||
- [x] lv_img: define *lv_img_raw_header* in *lv_draw.h* because now lv_img can't be disabled
|
||||
- [x] lv_list: ignore image related things when *lv_img* is not enebled
|
||||
- [x] lv_ta: fix hegiht if *one_line* and *FONT_ANTIALIAS*
|
||||
- [x] lv_obj_set_style: fix to update self style too (not only children)
|
||||
|
||||
## v4.2 (released on: 17.08.2017)
|
||||
- [x] lv_slider: don't let indicator or bar to disappear because of hpad/vpad
|
||||
- [x] lv_ta: memory leak if deleted in password mode
|
||||
- [x] lv_list: work without *lv_img* by ignore the image file name parameter of *lv_list_add()*
|
||||
@@ -1,41 +0,0 @@
|
||||
/**
|
||||
* @file img_conf.h
|
||||
*
|
||||
*/
|
||||
|
||||
#if 0 /*Remove this to enable the content (Delete the last #endif too!)*/
|
||||
|
||||
#ifndef IMG_CONF_H
|
||||
#define IMG_CONF_H
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/* Enable here the used images
|
||||
* For example:
|
||||
* #define USE_IMG_EXAMPLE 1
|
||||
*
|
||||
* This is compatible with the images
|
||||
* generated by the image converter utility
|
||||
* For more information see: www.littlev.hu */
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif
|
||||
|
||||
#endif /*Remove this to enable the content*/
|
||||
1142
lv_app/lv_app.c
1142
lv_app/lv_app.c
File diff suppressed because it is too large
Load Diff
133
lv_app/lv_app.h
133
lv_app/lv_app.h
@@ -1,133 +0,0 @@
|
||||
/**
|
||||
* @file lv_app.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_APP_H
|
||||
#define LV_APP_H
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lvgl/lvgl.h"
|
||||
|
||||
#if LV_APP_ENABLE != 0
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
typedef enum
|
||||
{
|
||||
LV_APP_MODE_NONE = 0x0000,
|
||||
LV_APP_MODE_NOT_LIST = 0x0001, /*Do not list the application*/
|
||||
LV_APP_MODE_NO_SC_TITLE = 0x0002, /*No short cut title*/
|
||||
}lv_app_mode_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
LV_APP_COM_TYPE_CHAR, /*Stream of characters. Always '\0' terminated*/
|
||||
LV_APP_COM_TYPE_INT, /*Stream of 'int32_t' numbers*/
|
||||
LV_APP_COM_TYPE_LOG, /*String about an event to log*/
|
||||
LV_APP_COM_TYPE_TRIG, /*A trigger to do some specific action (data is ignored)*/
|
||||
LV_APP_COM_TYPE_INV, /*Invalid type*/
|
||||
LV_APP_COM_TYPE_NUM, /*Indicates the number of com. types*/
|
||||
}lv_app_com_type_t;
|
||||
|
||||
struct __LV_APP_DSC_T;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const struct __LV_APP_DSC_T * dsc;
|
||||
char * name;
|
||||
lv_obj_t * sc;
|
||||
lv_obj_t * sc_title;
|
||||
lv_obj_t * win;
|
||||
void * app_data;
|
||||
void * sc_data;
|
||||
void * win_data;
|
||||
}lv_app_inst_t;
|
||||
|
||||
typedef struct __LV_APP_DSC_T
|
||||
{
|
||||
const char * name;
|
||||
lv_app_mode_t mode;
|
||||
void (*app_run)(lv_app_inst_t *, void *);
|
||||
void (*app_close) (lv_app_inst_t *);
|
||||
void (*com_rec) (lv_app_inst_t *, lv_app_inst_t *, lv_app_com_type_t, const void *, uint32_t);
|
||||
void (*sc_open) (lv_app_inst_t *, lv_obj_t *);
|
||||
void (*sc_close) (lv_app_inst_t *);
|
||||
void (*win_open) (lv_app_inst_t *, lv_obj_t *);
|
||||
void (*win_close) (lv_app_inst_t *);
|
||||
uint16_t app_data_size;
|
||||
uint16_t sc_data_size;
|
||||
uint16_t win_data_size;
|
||||
}lv_app_dsc_t;
|
||||
|
||||
typedef struct {
|
||||
lv_rects_t menu_style;
|
||||
lv_btns_t menu_btn_style;
|
||||
lv_labels_t menu_btn_label_style;
|
||||
lv_imgs_t menu_btn_img_style;
|
||||
lv_lists_t app_list_style;
|
||||
lv_pages_t sc_page_style;
|
||||
lv_labels_t win_txt_style;
|
||||
lv_wins_t win_style;
|
||||
lv_btns_t sc_style;
|
||||
lv_btns_t sc_send_style;
|
||||
lv_btns_t sc_rec_style;
|
||||
lv_labels_t sc_title_style;
|
||||
lv_labels_t sc_txt_style;
|
||||
|
||||
|
||||
opa_t menu_opa;
|
||||
opa_t menu_btn_opa;
|
||||
opa_t sc_opa;
|
||||
|
||||
cord_t menu_h;
|
||||
cord_t app_list_w;
|
||||
cord_t app_list_h;
|
||||
cord_t sc_title_margin;
|
||||
|
||||
/*Calculated values, do not set them!*/
|
||||
cord_t win_useful_w;
|
||||
cord_t win_useful_h;
|
||||
}lv_app_style_t;
|
||||
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
void lv_app_init(void);
|
||||
lv_app_inst_t * lv_app_run(const lv_app_dsc_t * app_dsc, void * conf);
|
||||
void lv_app_close(lv_app_inst_t * app);
|
||||
uint16_t lv_app_com_send(lv_app_inst_t * app_send, lv_app_com_type_t type , const void * data, uint32_t size);
|
||||
lv_obj_t * lv_app_sc_open(lv_app_inst_t * app);
|
||||
void lv_app_sc_close(lv_app_inst_t * app);
|
||||
lv_obj_t * lv_app_win_open(lv_app_inst_t * app);
|
||||
void lv_app_win_close(lv_app_inst_t * app);
|
||||
lv_obj_t * lv_app_win_get_from_obj(lv_obj_t * obj);
|
||||
const lv_app_dsc_t * lv_app_dsc_get(const char * name);
|
||||
|
||||
bool lv_app_con_check(lv_app_inst_t * sender, lv_app_inst_t * receiver);
|
||||
void lv_app_con_set(lv_app_inst_t * sender, lv_app_inst_t * receiver);
|
||||
void lv_app_con_del(lv_app_inst_t * sender, lv_app_inst_t * receiver);
|
||||
lv_app_style_t * lv_app_style_get(void);
|
||||
void lv_app_rename(lv_app_inst_t * app, const char * name);
|
||||
void lv_app_style_refr(void);
|
||||
|
||||
lv_app_inst_t * lv_app_get_next(lv_app_inst_t * prev, lv_app_dsc_t * dsc);
|
||||
lv_app_dsc_t ** lv_app_dsc_get_next(lv_app_dsc_t ** prev);
|
||||
|
||||
const lv_app_dsc_t * lv_app_example_init(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*LV_APP_ENABLE != 0*/
|
||||
|
||||
#endif /*LV_APP_H*/
|
||||
@@ -1,381 +0,0 @@
|
||||
/**
|
||||
* @file lv_app_fsel.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_app_fsel.h"
|
||||
#if LV_APP_ENABLE != 0
|
||||
|
||||
#include <stdio.h>
|
||||
#include "lv_app_notice.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define LV_APP_FSEL_FN_MAX_LEN 128
|
||||
#define LV_APP_FSEL_PATH_MAX_LEN 256
|
||||
#define LV_APP_FSEL_PAGE_SIZE 8
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static void fsel_refr(void);
|
||||
static lv_action_res_t fsel_close_action(lv_obj_t * close, lv_dispi_t * dispi);
|
||||
static lv_action_res_t fsel_up_action(lv_obj_t * up, lv_dispi_t * dispi);
|
||||
static lv_action_res_t fsel_next_action(lv_obj_t * next, lv_dispi_t * dispi);
|
||||
static lv_action_res_t fsel_prev_action(lv_obj_t * prev, lv_dispi_t * dispi);
|
||||
static lv_action_res_t fsel_drv_action(lv_obj_t * drv, lv_dispi_t * dispi);
|
||||
static lv_action_res_t fsel_drv_lpr_action(lv_obj_t * drv, lv_dispi_t * dispi);
|
||||
static lv_action_res_t fsel_folder_action(lv_obj_t * folder, lv_dispi_t * dispi);
|
||||
static lv_action_res_t fsel_folder_lpr_action(lv_obj_t * folder, lv_dispi_t * dispi);
|
||||
static lv_action_res_t fsel_file_action(lv_obj_t * file, lv_dispi_t * dispi);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static const char * fsel_filter;
|
||||
static char fsel_path[LV_APP_FSEL_PATH_MAX_LEN];
|
||||
static uint16_t fsel_file_cnt;
|
||||
static lv_obj_t * fsel_win;
|
||||
static lv_obj_t * fsel_list;
|
||||
static lv_lists_t fsel_lists;
|
||||
static void * fsel_param;
|
||||
static void (*fsel_ok_action)(void *, const char *);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize the File selector utility
|
||||
*/
|
||||
void lv_app_fsel_init(void)
|
||||
{
|
||||
lv_lists_get(LV_LISTS_TRANSP, &fsel_lists);
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the File selector
|
||||
* @param path start path
|
||||
* @param filter show only files with a specific extension, e.g. "wav".
|
||||
* "/" means filter to folders.
|
||||
* @param param a free parameter which will be added to 'ok_action'
|
||||
* @param ok_action an action to call when a file or folder is chosen
|
||||
*/
|
||||
void lv_app_fsel_open(const char * path, const char * filter, void * param, void (*ok_action)(void *, const char *))
|
||||
{
|
||||
/*Save the parameters*/
|
||||
strcpy(fsel_path, path);
|
||||
fsel_filter = filter;
|
||||
fsel_file_cnt = 0;
|
||||
fsel_param = param;
|
||||
fsel_ok_action = ok_action;
|
||||
|
||||
/*Trim the extra '\' or '/' from the end of path*/
|
||||
uint16_t i;
|
||||
for(i = strlen(fsel_path) -1 ; fsel_path[i] == '/' || fsel_path[i] == '\\'; i--) {
|
||||
fsel_path[i] = '\0';
|
||||
}
|
||||
|
||||
/*Check filter: NULL and "" mean no filtering*/
|
||||
if(fsel_filter == NULL) fsel_filter = "";
|
||||
|
||||
/*Create a window for the File selector*/
|
||||
lv_app_style_t * app_style = lv_app_style_get();
|
||||
fsel_win = lv_win_create(lv_scr_act(), NULL);
|
||||
lv_obj_set_size(fsel_win, LV_HOR_RES, LV_VER_RES);
|
||||
lv_obj_set_style(fsel_win, &app_style->win_style);
|
||||
|
||||
lv_win_add_ctrl_btn(fsel_win, "U:/icon_close", fsel_close_action);
|
||||
|
||||
fsel_refr(); /*Refresh the list*/
|
||||
|
||||
/*Show instruction when first open with folder filter*/
|
||||
static bool first_folder_call = false;
|
||||
if(first_folder_call == false && fsel_filter[0] == '/') {
|
||||
lv_app_notice_add("Press a folder long\nto choose it!");
|
||||
first_folder_call = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the File selector
|
||||
*/
|
||||
void lv_app_fsel_close(void)
|
||||
{
|
||||
if(fsel_win != NULL) {
|
||||
lv_obj_del(fsel_win);
|
||||
}
|
||||
|
||||
fsel_win = NULL;
|
||||
fsel_list = NULL;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Refresh the file list according to the current path and filter
|
||||
*/
|
||||
static void fsel_refr(void)
|
||||
{
|
||||
/*Delete the previous list*/
|
||||
if(fsel_list != NULL) {
|
||||
lv_obj_del(fsel_list);
|
||||
}
|
||||
|
||||
lv_win_set_title(fsel_win, fsel_path);
|
||||
|
||||
/*Create a new list*/
|
||||
lv_app_style_t * app_style = lv_app_style_get();
|
||||
fsel_list = lv_list_create(fsel_win, NULL);
|
||||
lv_obj_set_width(fsel_list, app_style->win_useful_w);
|
||||
lv_obj_set_style(fsel_list, lv_lists_get(LV_LISTS_TRANSP, NULL));
|
||||
lv_obj_set_drag_parent(fsel_list, true);
|
||||
lv_obj_set_drag_parent(lv_page_get_scrl(fsel_list), true);
|
||||
lv_rect_set_fit(fsel_list, false, true);
|
||||
|
||||
fs_res_t res = FS_RES_OK;
|
||||
|
||||
/*At empty path show the drivers */
|
||||
if(fsel_path[0] == '\0') {
|
||||
char drv[16];
|
||||
char buf[2];
|
||||
lv_obj_t * liste;
|
||||
fs_get_letters(drv);
|
||||
uint8_t i;
|
||||
for(i = 0; drv[i] != '\0'; i++) {
|
||||
buf[0] = drv[i];
|
||||
buf[1] = '\0';
|
||||
liste = lv_list_add(fsel_list, "U:/icon_driver", buf, fsel_drv_action);
|
||||
/*Add long press action to choose the driver as a folder*/
|
||||
if(fsel_filter[0] == '/') lv_btn_set_lpr_action(liste, fsel_drv_lpr_action);
|
||||
}
|
||||
}
|
||||
/*List the files/folders with fs interface*/
|
||||
else {
|
||||
lv_list_add(fsel_list, "U:/icon_up", "Up", fsel_up_action);
|
||||
|
||||
fs_readdir_t rd;
|
||||
res = fs_readdir_init(&rd, fsel_path);
|
||||
if(res != FS_RES_OK) {
|
||||
lv_app_notice_add("Can not read the path\nin File selector");
|
||||
return;
|
||||
}
|
||||
|
||||
/*At not first page add prev. page button */
|
||||
if(fsel_file_cnt != 0) {
|
||||
lv_list_add(fsel_list, "U:/icon_left", "Previous page", fsel_prev_action);
|
||||
}
|
||||
|
||||
char fn[LV_APP_FSEL_FN_MAX_LEN];
|
||||
|
||||
/*Read the files from the previous pages*/
|
||||
uint16_t file_cnt = 0;
|
||||
while(file_cnt <= fsel_file_cnt) {
|
||||
res = fs_readdir(&rd, fn);
|
||||
if(res != FS_RES_OK || fn[0] == '\0'){
|
||||
lv_app_notice_add("Can not read the path\nin File selector");
|
||||
return;
|
||||
}
|
||||
file_cnt ++;
|
||||
}
|
||||
|
||||
/*Add list elements from the files and folders*/
|
||||
while(res == FS_RES_OK && fn[0] != '\0') {
|
||||
if(fn[0] == '/') { /*Add a folder*/
|
||||
lv_obj_t * liste;
|
||||
liste = lv_list_add(fsel_list, "U:/icon_folder", &fn[1], fsel_folder_action);
|
||||
/*Add long press action to choose a folder*/
|
||||
if(fsel_filter[0] == '/') lv_btn_set_lpr_action(liste, fsel_folder_lpr_action);
|
||||
|
||||
fsel_file_cnt ++;
|
||||
file_cnt ++;
|
||||
}
|
||||
/*Add a file if it is not filtered*/
|
||||
else if(fsel_filter[0] == '\0' || /*No filtering or ...*/
|
||||
(strcmp(fs_get_ext(fn), fsel_filter) == 0 && /*.. the filter matches*/
|
||||
fsel_filter[0] != '/')) {
|
||||
lv_list_add(fsel_list, "U:/icon_file", fn, fsel_file_action);
|
||||
fsel_file_cnt ++;
|
||||
file_cnt ++;
|
||||
}
|
||||
|
||||
/*Get the next element*/
|
||||
res = fs_readdir(&rd, fn);
|
||||
|
||||
/*Show only LV_APP_FSEL_MAX_FILE elements and add a Next page button*/
|
||||
if(fsel_file_cnt != 0 && fsel_file_cnt % LV_APP_FSEL_PAGE_SIZE == 0) {
|
||||
lv_list_add(fsel_list, "U:/icon_right", "Next page", fsel_next_action);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*Close the read directory*/
|
||||
fs_readdir_close(&rd);
|
||||
}
|
||||
|
||||
if(res != FS_RES_OK) {
|
||||
lv_app_notice_add("Can not read the path\nin File selector");
|
||||
}
|
||||
|
||||
/*Focus to the top of the list*/
|
||||
lv_obj_set_y(lv_page_get_scrl(fsel_list), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the File selector window close button is released
|
||||
* @param close pointer to the close button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the window is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t fsel_close_action(lv_obj_t * close, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_app_fsel_close();
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the Up list element is released to step one level
|
||||
* @param up pointer to the Up button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the list is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t fsel_up_action(lv_obj_t * up, lv_dispi_t * dispi)
|
||||
{
|
||||
fs_up(fsel_path);
|
||||
fsel_file_cnt = 0;
|
||||
fsel_refr();
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the Next list element is released to go to the next page
|
||||
* @param next pointer to the Next button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the list is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t fsel_next_action(lv_obj_t * next, lv_dispi_t * dispi)
|
||||
{
|
||||
fsel_refr();
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the Prev list element is released to previous page
|
||||
* @param prev pointer to the Prev button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the list is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t fsel_prev_action(lv_obj_t * prev, lv_dispi_t * dispi)
|
||||
{
|
||||
if(fsel_file_cnt <= 2 * LV_APP_FSEL_PAGE_SIZE) fsel_file_cnt = 0;
|
||||
else if(fsel_file_cnt % LV_APP_FSEL_PAGE_SIZE == 0) {
|
||||
fsel_file_cnt -= 2 * LV_APP_FSEL_PAGE_SIZE;
|
||||
} else {
|
||||
fsel_file_cnt = ((fsel_file_cnt / LV_APP_FSEL_PAGE_SIZE) - 1) * LV_APP_FSEL_PAGE_SIZE;
|
||||
}
|
||||
|
||||
fsel_refr();
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when the Driver list element is released to step into a driver
|
||||
* @param drv pointer to the Driver button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the list is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t fsel_drv_action(lv_obj_t * drv, lv_dispi_t * dispi)
|
||||
{
|
||||
sprintf(fsel_path, "%s:", lv_list_element_get_txt(drv));
|
||||
fsel_file_cnt = 0;
|
||||
fsel_refr();
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the Driver list element is long pressed to choose it
|
||||
* @param drv pointer to the Driver button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the list is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t fsel_drv_lpr_action(lv_obj_t * drv, lv_dispi_t * dispi)
|
||||
{
|
||||
sprintf(fsel_path, "%s:", lv_list_element_get_txt(drv));
|
||||
|
||||
if(fsel_ok_action != NULL) {
|
||||
fsel_ok_action(fsel_param, fsel_path);
|
||||
}
|
||||
|
||||
lv_app_fsel_close();
|
||||
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a folder list element is released to enter into it
|
||||
* @param folder pointer to a folder button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the list is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t fsel_folder_action(lv_obj_t * folder, lv_dispi_t * dispi)
|
||||
{
|
||||
sprintf(fsel_path, "%s/%s", fsel_path, lv_list_element_get_txt(folder));
|
||||
fsel_file_cnt = 0;
|
||||
fsel_refr();
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a folder list element is long pressed to choose it
|
||||
* @param folder pointer to a folder button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the list is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t fsel_folder_lpr_action(lv_obj_t * folder, lv_dispi_t * dispi)
|
||||
{
|
||||
sprintf(fsel_path, "%s/%s", fsel_path, lv_list_element_get_txt(folder));
|
||||
|
||||
if(fsel_ok_action != NULL) {
|
||||
fsel_ok_action(fsel_param, fsel_path);
|
||||
}
|
||||
|
||||
lv_app_fsel_close();
|
||||
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a file list element is released to choose it
|
||||
* @param file pointer to a file button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the list is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t fsel_file_action(lv_obj_t * file, lv_dispi_t * dispi)
|
||||
{
|
||||
sprintf(fsel_path, "%s/%s", fsel_path, lv_list_element_get_txt(file));
|
||||
|
||||
if(fsel_ok_action != NULL) {
|
||||
fsel_ok_action(fsel_param, fsel_path);
|
||||
}
|
||||
|
||||
lv_app_fsel_close();
|
||||
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
#endif /*LV_APP_ENABLE != 0*/
|
||||
@@ -1,36 +0,0 @@
|
||||
/**
|
||||
* @file lv_app_fsel.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_APP_FSEL_H
|
||||
#define LV_APP_FSEL_H
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "../lv_app.h"
|
||||
#if LV_APP_ENABLE != 0
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
void lv_app_fsel_init(void);
|
||||
void lv_app_fsel_open(const char * path, const char * filter, void * param, void (*ok_action)(void *, const char *));
|
||||
void lv_app_fsel_close();
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*LV_APP_ENABLE != 0*/
|
||||
|
||||
#endif /*LV_APP_FSEL_H*/
|
||||
@@ -1,245 +0,0 @@
|
||||
/**
|
||||
* @file lv_app_kb.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_app_kb.h"
|
||||
#if LV_APP_ENABLE != 0
|
||||
|
||||
#include "lvgl/lv_objx/lv_btnm.h"
|
||||
#include "lvgl/lv_objx/lv_ta.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static lv_action_res_t lv_app_kb_action(lv_obj_t * btnm, uint16_t i);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static lv_obj_t * kb_btnm;
|
||||
static lv_obj_t * kb_win;
|
||||
static lv_obj_t * kb_ta;
|
||||
static const char * kb_map_lc[] = {
|
||||
"\0051#", "\004q", "\004w", "\004e", "\004r", "\004t", "\004y", "\004u", "\004i", "\004o", "\004p", "\007Del", "\n",
|
||||
"\007ABC", "\004a", "\004s", "\004d", "\004f", "\004g", "\004h", "\004j", "\004k", "\004l", "\010Enter", "\n",
|
||||
"_", "-", "z", "x", "c", "v", "b", "n", "m", ".", ",", ":", "\n",
|
||||
"\002Hide", "\002Left", "\006 ", "\002Right", "\002Ok", ""
|
||||
};
|
||||
|
||||
static const char * kb_map_uc[] = {
|
||||
"\0051#", "\004Q", "\004W", "\004E", "\004R", "\004T", "\004Y", "\004U", "\004I", "\004O", "\004P", "\007Del", "\n",
|
||||
"\007abc", "\004A", "\004S", "\004D", "\004F", "\004G", "\004H", "\004J", "\004K", "\004L", "\010Enter", "\n",
|
||||
"_", "-", "Z", "X", "C", "V", "B", "N", "M", ".", ",", ":", "\n",
|
||||
"\002Hide", "\002Left", "\006 ", "\002Right", "\002Ok", ""
|
||||
};
|
||||
|
||||
static const char * kb_map_spec[] = {
|
||||
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "\002Del", "\n",
|
||||
"\002abc", "+", "-", "/", "*", "=", "%", "!", "?", "#", "<", ">", "\n",
|
||||
"\\", "@", "$", "(", ")", "{", "}", "[", "]", ";", "\"", "'", "\n",
|
||||
"\002Hide", "\002Left", "\006 ", "\002Right", "\002Ok", ""
|
||||
};
|
||||
|
||||
static const char * kb_map_num[] = {
|
||||
"1", "2", "3", "\002Hide","\n",
|
||||
"4", "5", "6", "\002Ok", "\n",
|
||||
"7", "8", "9", "\002Del", "\n",
|
||||
"+/-", "0", ".", "Left", "Right", ""
|
||||
};
|
||||
|
||||
static cord_t kb_ta_ori_size;
|
||||
static uint8_t kb_mode;
|
||||
static void (*kb_close_action)(lv_obj_t *);
|
||||
static void (*kb_ok_action)(lv_obj_t *);
|
||||
static lv_btnms_t kb_btnms;
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
void lv_app_kb_init(void)
|
||||
{
|
||||
lv_btnms_get(LV_BTNMS_DEF, &kb_btnms);
|
||||
kb_btnms.rects.gcolor = COLOR_WHITE;
|
||||
kb_btnms.rects.objs.color = COLOR_WHITE;
|
||||
kb_btnms.rects.opad = 4 + LV_DOWNSCALE;
|
||||
kb_btnms.rects.vpad = 3 + LV_DOWNSCALE;
|
||||
kb_btnms.rects.hpad = 3 + LV_DOWNSCALE;
|
||||
kb_btnms.rects.round = 0;
|
||||
kb_btnms.rects.bwidth = 0;
|
||||
|
||||
// kb_btnms.btns.rects.bwidth = 0;
|
||||
kb_btnms.btns.rects.round = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a keyboard for a text area object
|
||||
* @param ta pointer to a text area object
|
||||
* @param mode 'OR'd values of 'lv_app_kb_mode_t' enum
|
||||
* @param close a function to call when the keyboard is closed
|
||||
* @param ok a function to called when the "Ok" button is pressed
|
||||
*/
|
||||
void lv_app_kb_open(lv_obj_t * ta, lv_app_kb_mode_t mode, void (*close)(lv_obj_t *), void (*ok)(lv_obj_t *))
|
||||
{
|
||||
/*Close the previous keyboard*/
|
||||
if(kb_btnm != NULL) {
|
||||
lv_app_kb_close(false);
|
||||
}
|
||||
|
||||
/*Save some parameters*/
|
||||
kb_ta = ta;
|
||||
kb_mode = mode;
|
||||
kb_close_action = close;
|
||||
kb_ok_action = ok;
|
||||
|
||||
/*Create a button matrix for the keyboard */
|
||||
kb_btnm = lv_btnm_create(lv_scr_act(), NULL);
|
||||
lv_obj_set_size(kb_btnm, LV_HOR_RES, LV_VER_RES / 2);
|
||||
lv_obj_align(kb_btnm, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
|
||||
lv_btnm_set_cb(kb_btnm, lv_app_kb_action);
|
||||
if(mode & LV_APP_KB_MODE_TXT) {
|
||||
kb_btnms.labels.font = LV_APP_FONT_MEDIUM;
|
||||
lv_btnm_set_map(kb_btnm, kb_map_lc);
|
||||
}
|
||||
else if(mode & LV_APP_KB_MODE_NUM) {
|
||||
kb_btnms.labels.font = LV_APP_FONT_LARGE;
|
||||
lv_btnm_set_map(kb_btnm, kb_map_num);
|
||||
}
|
||||
lv_obj_set_style(kb_btnm, &kb_btnms);
|
||||
|
||||
/*Reduce teh size of the window and align it to the top*/
|
||||
kb_win = lv_app_win_get_from_obj(kb_ta);
|
||||
lv_obj_set_height(kb_win, LV_VER_RES / 2);
|
||||
lv_obj_set_y(kb_win, 0);
|
||||
|
||||
/*If the text area is higher then the new size of the window redus its size too*/
|
||||
lv_app_style_t * app_style = lv_app_style_get();
|
||||
cord_t win_h = lv_obj_get_height(kb_win) - 2 * app_style->win_style.pages.scrl_rects.vpad;
|
||||
kb_ta_ori_size = lv_obj_get_height(kb_ta);
|
||||
if(lv_obj_get_height(kb_ta) > win_h) {
|
||||
lv_obj_set_height(kb_ta, win_h);
|
||||
}
|
||||
|
||||
lv_ta_set_cursor_pos(kb_ta, LV_TA_CUR_LAST);
|
||||
|
||||
#if LV_APP_ANIM_LEVEL != 0
|
||||
lv_page_focus(lv_win_get_content(kb_win), kb_ta, true);
|
||||
#else
|
||||
lv_page_focus(kb_win, kb_ta, false);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the keyboard
|
||||
* @param ok true: call the ok function, false: call the close function
|
||||
*/
|
||||
void lv_app_kb_close(bool ok)
|
||||
{
|
||||
if(kb_btnm == NULL) return;
|
||||
|
||||
if(ok == false) {
|
||||
if(kb_close_action != NULL) kb_close_action(kb_ta);
|
||||
} else {
|
||||
if(kb_ok_action != NULL) kb_ok_action(kb_ta);
|
||||
}
|
||||
|
||||
/*Reset the modified sizes*/
|
||||
|
||||
lv_obj_set_height(kb_ta, kb_ta_ori_size);
|
||||
|
||||
lv_obj_set_size(kb_win, LV_HOR_RES, LV_VER_RES);
|
||||
kb_win = NULL;
|
||||
|
||||
lv_obj_del(kb_btnm);
|
||||
kb_btnm = NULL;
|
||||
|
||||
kb_ta = NULL;
|
||||
}
|
||||
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Called when a button of 'kb_btnm' is released
|
||||
* @param btnm pointer to 'kb_btnm'
|
||||
* @param i the index of the released button from the current btnm map
|
||||
* @return LV_ACTION_RES_INV if the btnm is deleted else LV_ACTION_RES_OK
|
||||
*/
|
||||
static lv_action_res_t lv_app_kb_action(lv_obj_t * btnm, uint16_t i)
|
||||
{
|
||||
const char ** map = lv_btnm_get_map(btnm);
|
||||
const char * txt = map[i];
|
||||
|
||||
/*Ignore the unit size number of the text*/
|
||||
if(txt[0] <= '\011') txt++;
|
||||
|
||||
/*Do the corresponding action according to the text of the button*/
|
||||
if(strcmp(txt, "abc") == 0) {
|
||||
lv_btnm_set_map(btnm, kb_map_lc);
|
||||
} else if(strcmp(txt, "ABC") == 0) {
|
||||
lv_btnm_set_map(btnm, kb_map_uc);
|
||||
} else if(strcmp(txt, "1#") == 0) {
|
||||
lv_btnm_set_map(btnm, kb_map_spec);
|
||||
} else if(strcmp(txt, "Enter") == 0) {
|
||||
lv_ta_add_char(kb_ta, '\n');
|
||||
} else if(strcmp(txt, "Left") == 0) {
|
||||
lv_ta_cursor_left(kb_ta);
|
||||
} else if(strcmp(txt, "Right") == 0) {
|
||||
lv_ta_cursor_right(kb_ta);
|
||||
} else if(strcmp(txt, "Del") == 0) {
|
||||
lv_ta_del(kb_ta);
|
||||
} else if(strcmp(txt, "+/-") == 0) {
|
||||
uint16_t cur = lv_ta_get_cursor_pos(kb_ta);
|
||||
const char * ta_txt = lv_ta_get_txt(kb_ta);
|
||||
if(ta_txt[0] == '-') {
|
||||
lv_ta_set_cursor_pos(kb_ta, 1);
|
||||
lv_ta_del(kb_ta);
|
||||
lv_ta_add_char(kb_ta, '+');
|
||||
lv_ta_set_cursor_pos(kb_ta, cur);
|
||||
} else if(ta_txt[0] == '+') {
|
||||
lv_ta_set_cursor_pos(kb_ta, 1);
|
||||
lv_ta_del(kb_ta);
|
||||
lv_ta_add_char(kb_ta, '-');
|
||||
lv_ta_set_cursor_pos(kb_ta, cur);
|
||||
} else {
|
||||
lv_ta_set_cursor_pos(kb_ta, 0);
|
||||
lv_ta_add_char(kb_ta, '-');
|
||||
lv_ta_set_cursor_pos(kb_ta, cur + 1);
|
||||
}
|
||||
} else if(strcmp(txt, "Hide") == 0) {
|
||||
lv_app_kb_close(false);
|
||||
return LV_ACTION_RES_INV;
|
||||
} else if(strcmp(txt, "Ok") == 0) {
|
||||
lv_app_kb_close(true);
|
||||
return LV_ACTION_RES_INV;
|
||||
} else {
|
||||
lv_ta_add_text(kb_ta, txt);
|
||||
}
|
||||
|
||||
#if LV_APP_ANIM_LEVEL != 0
|
||||
lv_page_focus(lv_win_get_content(kb_win), kb_ta, true);
|
||||
#else
|
||||
lv_page_focus(kb_win, kb_ta, false);
|
||||
#endif
|
||||
return LV_ACTION_RES_OK;
|
||||
}
|
||||
|
||||
#endif /*LV_APP_ENABLE != 0*/
|
||||
@@ -1,40 +0,0 @@
|
||||
/**
|
||||
* @file lv_app_kb.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_APP_KB_H
|
||||
#define LV_APP_KB_H
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "../lv_app.h"
|
||||
#if LV_APP_ENABLE != 0
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
typedef enum
|
||||
{
|
||||
LV_APP_KB_MODE_TXT = 0x01,
|
||||
LV_APP_KB_MODE_NUM = 0x02,
|
||||
}lv_app_kb_mode_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
void lv_app_kb_init(void);
|
||||
void lv_app_kb_open(lv_obj_t * ta, lv_app_kb_mode_t mode, void (*close)(lv_obj_t *), void (*ok)(lv_obj_t *));
|
||||
void lv_app_kb_close(bool ok);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
#endif /*LV_APP_ENABLE != 0*/
|
||||
|
||||
#endif /*LV_APP_KB_H*/
|
||||
@@ -1,165 +0,0 @@
|
||||
/**
|
||||
* @file lv_app_notice.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_app_notice.h"
|
||||
#if LV_APP_ENABLE != 0
|
||||
|
||||
#include "lvgl/lv_objx/lv_rect.h"
|
||||
#include "lvgl/lv_objx/lv_label.h"
|
||||
|
||||
#include "lvgl/lv_misc/anim.h"
|
||||
#include <stdio.h>
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static lv_action_res_t notice_rel_action(lv_obj_t * n, lv_dispi_t * dispi);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static lv_obj_t * notice_h;
|
||||
|
||||
static lv_btns_t notice_btns;
|
||||
static lv_labels_t notice_labels;
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
/**
|
||||
* Initialize the Notifications
|
||||
*/
|
||||
void lv_app_notice_init(void)
|
||||
{
|
||||
lv_app_style_t * app_style = lv_app_style_get();
|
||||
|
||||
memcpy(¬ice_btns, &app_style->menu_style, sizeof(lv_rects_t));
|
||||
notice_btns.rects.round = 5 * LV_DOWNSCALE;
|
||||
notice_btns.bcolor[LV_BTN_STATE_REL] = COLOR_WHITE;
|
||||
notice_btns.mcolor[LV_BTN_STATE_REL] = COLOR_BLACK;
|
||||
notice_btns.gcolor[LV_BTN_STATE_REL] = COLOR_BLACK;
|
||||
notice_btns.bcolor[LV_BTN_STATE_PR] = COLOR_WHITE;
|
||||
notice_btns.mcolor[LV_BTN_STATE_PR] = COLOR_GRAY;
|
||||
notice_btns.gcolor[LV_BTN_STATE_PR] = COLOR_GRAY;
|
||||
notice_btns.rects.bwidth = 1 * LV_DOWNSCALE;
|
||||
notice_btns.rects.bopa = 90;
|
||||
notice_btns.rects.light = 5 * LV_DOWNSCALE;
|
||||
|
||||
memcpy(¬ice_labels, &app_style->menu_btn_label_style, sizeof(lv_labels_t));
|
||||
notice_labels.mid = 0;
|
||||
notice_labels.font = LV_APP_FONT_MEDIUM;
|
||||
|
||||
notice_h = lv_rect_create(lv_scr_act(), NULL);
|
||||
lv_obj_set_size(notice_h, LV_HOR_RES, LV_VER_RES - app_style->menu_h);
|
||||
lv_obj_set_y(notice_h, app_style->menu_h);
|
||||
lv_obj_set_click(notice_h, false);
|
||||
lv_obj_set_style(notice_h, lv_rects_get(LV_RECTS_TRANSP, NULL));
|
||||
lv_rect_set_layout(notice_h, LV_RECT_LAYOUT_COL_R);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a notification with a given text
|
||||
* @param format pritntf-like format string
|
||||
*/
|
||||
void lv_app_notice_add(const char * format, ...)
|
||||
{
|
||||
char txt[LV_APP_NOTICE_MAX_LEN];
|
||||
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
vsprintf(txt,format, va);
|
||||
va_end(va);
|
||||
|
||||
lv_app_style_t * app_style = lv_app_style_get();
|
||||
|
||||
lv_obj_t * n;
|
||||
n = lv_btn_create(notice_h, NULL);
|
||||
lv_rect_set_fit(n, true, true);
|
||||
lv_obj_set_style(n, ¬ice_btns);
|
||||
lv_obj_set_opa(n, app_style->menu_opa);
|
||||
lv_btn_set_rel_action(n, notice_rel_action);
|
||||
|
||||
lv_obj_t * l;
|
||||
l = lv_label_create(n, NULL);
|
||||
lv_label_set_text(l, txt);
|
||||
lv_obj_set_style(l, ¬ice_labels);
|
||||
|
||||
|
||||
lv_obj_set_parent(notice_h, lv_scr_act());
|
||||
|
||||
lv_rect_set_fit(n, false, false);
|
||||
#if LV_APP_EFFECT_ANIM != 0 && LV_APP_ANIM_NOTICE != 0
|
||||
anim_t a;
|
||||
a.var = n;
|
||||
a.path = anim_get_path(ANIM_PATH_LIN);
|
||||
a.time = LV_APP_ANIM_NOTICE;
|
||||
a.act_time = - LV_APP_NOTICE_SHOW_TIME;
|
||||
a.playback = 0;
|
||||
a.playback_pause = 0;
|
||||
a.repeat = 0;
|
||||
a.repeat_pause = 0;
|
||||
a.end_cb = NULL;
|
||||
#if LV_APP_EFFECT_OPA_ANIM != 0
|
||||
a.fp = (anim_fp_t) lv_obj_set_opar;
|
||||
a.start = lv_obj_get_opa(n);
|
||||
a.end = OPA_TRANSP;
|
||||
anim_create(&a);
|
||||
|
||||
/*Restore the label opacity because the opar anim changes it*/
|
||||
lv_obj_set_opa(l, OPA_COVER);
|
||||
|
||||
a.act_time = - LV_APP_NOTICE_SHOW_TIME - LV_APP_ANIM_NOTICE; /*Do the next animation after the opa animation*/
|
||||
#endif
|
||||
|
||||
a.fp = (anim_fp_t) lv_obj_set_height;
|
||||
a.start = lv_obj_get_height(n);
|
||||
a.end = 0;
|
||||
a.end_cb = (anim_cb_t)lv_obj_del;
|
||||
anim_create(&a);
|
||||
#else
|
||||
anim_t a;
|
||||
a.var = n;
|
||||
a.path = anim_get_path(ANIM_PATH_STEP);
|
||||
a.time = LV_APP_ANIM_NOTICE;
|
||||
a.act_time = - LV_APP_NOTICE_SHOW_TIME + LV_APP_ANIM_NOTICE;
|
||||
a.playback = 0;
|
||||
a.playback_pause = 0;
|
||||
a.repeat = 0;
|
||||
a.repeat_pause = 0;
|
||||
a.fp = (anim_fp_t) lv_obj_set_height;
|
||||
a.start = lv_obj_get_height(n);
|
||||
a.end = lv_obj_get_height(n);
|
||||
a.end_cb = lv_obj_del;
|
||||
anim_create(&a);
|
||||
#endif
|
||||
|
||||
}
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
static lv_action_res_t notice_rel_action(lv_obj_t * n, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_obj_del(n);
|
||||
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,218 +0,0 @@
|
||||
/**
|
||||
* @file lv_app_example.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_app_example.h"
|
||||
#if LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0
|
||||
|
||||
#include "../lv_app/lv_app_util/lv_app_kb.h"
|
||||
#include <stdio.h>
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/*Application specific data for an instance of this application*/
|
||||
typedef struct
|
||||
{
|
||||
|
||||
}my_app_data_t;
|
||||
|
||||
/*Application specific data a window of this application*/
|
||||
typedef struct
|
||||
{
|
||||
|
||||
}my_win_data_t;
|
||||
|
||||
/*Application specific data for a shortcut of this application*/
|
||||
typedef struct
|
||||
{
|
||||
lv_obj_t * label;
|
||||
}my_sc_data_t;
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static void my_app_run(lv_app_inst_t * app, void * conf);
|
||||
static void my_app_close(lv_app_inst_t * app);
|
||||
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec, lv_app_com_type_t type , const void * data, uint32_t size);
|
||||
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc);
|
||||
static void my_sc_close(lv_app_inst_t * app);
|
||||
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win);
|
||||
static void my_win_close(lv_app_inst_t * app);
|
||||
|
||||
static lv_action_res_t ta_rel_action(lv_obj_t * ta, lv_dispi_t * dispi);
|
||||
static void kb_ok_action(lv_obj_t * ta);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static lv_app_dsc_t my_app_dsc =
|
||||
{
|
||||
.name = "Example",
|
||||
.mode = LV_APP_MODE_NONE,
|
||||
.app_run = my_app_run,
|
||||
.app_close = my_app_close,
|
||||
.com_rec = my_com_rec,
|
||||
.win_open = my_win_open,
|
||||
.win_close = my_win_close,
|
||||
.sc_open = my_sc_open,
|
||||
.sc_close = my_sc_close,
|
||||
.app_data_size = sizeof(my_app_data_t),
|
||||
.sc_data_size = sizeof(my_sc_data_t),
|
||||
.win_data_size = sizeof(my_win_data_t),
|
||||
};
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize the application
|
||||
* @return pointer to the application descriptor of this application
|
||||
*/
|
||||
const lv_app_dsc_t * lv_app_example_init(void)
|
||||
{
|
||||
return &my_app_dsc;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Run an application according to 'app_dsc'
|
||||
* @param app_dsc pointer to an application descriptor
|
||||
* @param conf pointer to a lv_app_example_conf_t structure with configuration data or NULL if unused
|
||||
* @return pointer to the opened application or NULL if any error occurred
|
||||
*/
|
||||
static void my_app_run(lv_app_inst_t * app, void * conf)
|
||||
{
|
||||
/*Initialize the application*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Close a running application.
|
||||
* Close the Window and the Shortcut too if opened.
|
||||
* Free all the allocated memory by this application.
|
||||
* @param app pointer to an application
|
||||
*/
|
||||
static void my_app_close(lv_app_inst_t * app)
|
||||
{
|
||||
/*No dynamically allocated data in 'my_app_data'*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the data have been sent to this application
|
||||
* @param app_send pointer to an application which sent the message
|
||||
* @param app_rec pointer to an application which is receiving the message
|
||||
* @param type type of data from 'lv_app_com_type_t' enum
|
||||
* @param data pointer to the sent data
|
||||
* @param size length of 'data' in bytes
|
||||
*/
|
||||
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
|
||||
lv_app_com_type_t type , const void * data, uint32_t size)
|
||||
{
|
||||
if(type == LV_APP_COM_TYPE_CHAR) { /*data: string*/
|
||||
my_sc_data_t * sc_data = app_rec->sc_data;
|
||||
if (sc_data->label != NULL) {
|
||||
lv_label_set_text_array(sc_data->label, data, size);
|
||||
lv_obj_align(sc_data->label , NULL,LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a shortcut for an application
|
||||
* @param app pointer to an application
|
||||
* @param sc pointer to an object where the application
|
||||
* can create content of the shortcut
|
||||
*/
|
||||
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc)
|
||||
{
|
||||
my_sc_data_t * sc_data = app->sc_data;
|
||||
lv_app_style_t * app_style = lv_app_style_get();
|
||||
|
||||
sc_data->label = lv_label_create(sc, NULL);
|
||||
lv_label_set_text(sc_data->label, "Empty");
|
||||
lv_obj_set_style(sc_data->label, &app_style->sc_txt_style);
|
||||
lv_obj_align(sc_data->label, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the shortcut of an application
|
||||
* @param app pointer to an application
|
||||
*/
|
||||
static void my_sc_close(lv_app_inst_t * app)
|
||||
{
|
||||
/*No dynamically allocated data in 'my_sc_data'*/
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Open the application in a window
|
||||
* @param app pointer to an application
|
||||
* @param win pointer to a window object where
|
||||
* the application can create content
|
||||
*/
|
||||
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win)
|
||||
{
|
||||
lv_obj_t * ta;
|
||||
ta = lv_ta_create(win, NULL);
|
||||
lv_obj_set_size_us(ta, 200, 100);
|
||||
lv_obj_set_pos_us(ta, 0, 0);
|
||||
lv_obj_set_free_p(ta, app);
|
||||
lv_page_set_rel_action(ta, ta_rel_action);
|
||||
lv_ta_set_text(ta, "Write a text to send to the other applications");
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the window of an application
|
||||
* @param app pointer to an application
|
||||
*/
|
||||
static void my_win_close(lv_app_inst_t * app)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*--------------------
|
||||
* OTHER FUNCTIONS
|
||||
---------------------*/
|
||||
|
||||
/**
|
||||
* Called when the text area on the window is released to open the app. keyboard
|
||||
* @param ta pointer to the text area on the window
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_OK because the text area is not deleted
|
||||
*/
|
||||
static lv_action_res_t ta_rel_action(lv_obj_t * ta, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_ta_set_text(ta, ""); /*Clear the ta*/
|
||||
lv_app_kb_open(ta, LV_APP_KB_MODE_TXT, NULL, kb_ok_action);
|
||||
return LV_ACTION_RES_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the "Ok" button is pressed on the app. keyboard
|
||||
* @param ta pointer to the text area assigned to the app. kexboard
|
||||
*/
|
||||
static void kb_ok_action(lv_obj_t * ta)
|
||||
{
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(ta);
|
||||
const char * txt = lv_ta_get_txt(ta);
|
||||
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, txt, strlen(txt));
|
||||
}
|
||||
|
||||
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0*/
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* @file lv_app_example.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_APP_EXAMPLE_H
|
||||
#define LV_APP_EXAMPLE_H
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lvgl/lv_app/lv_app.h"
|
||||
|
||||
#if LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
typedef struct
|
||||
{
|
||||
|
||||
}lv_app_example_conf_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
const lv_app_dsc_t * lv_app_example_init(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0*/
|
||||
|
||||
#endif /* LV_APP_EXAMPLE_H */
|
||||
@@ -1,930 +0,0 @@
|
||||
/**
|
||||
* @file lv_app_example.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_app_files.h"
|
||||
#if LV_APP_ENABLE != 0 && USE_LV_APP_FILES != 0
|
||||
|
||||
#include <stdio.h>
|
||||
#include "misc/os/ptask.h"
|
||||
#include "../lv_app/lv_app_util/lv_app_kb.h"
|
||||
#include "../lv_app/lv_app_util/lv_app_notice.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define LV_APP_FILES_CHUNK_MIN_SIZE 32
|
||||
#define LV_APP_FILES_CHUNK_MIN_TIME 10
|
||||
#define LV_APP_FILES_CHUNK_MAX_TIME 10000
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/*Application specific data for an instance of this application*/
|
||||
typedef struct
|
||||
{
|
||||
char path[LV_APP_FILES_PATH_MAX_LEN];
|
||||
char fn[LV_APP_FILES_FN_MAX_LEN];
|
||||
fs_file_t file;
|
||||
uint8_t file_cnt;
|
||||
uint16_t chunk_delay;
|
||||
uint16_t chunk_size;
|
||||
uint8_t send_fn :1;
|
||||
uint8_t send_size :1;
|
||||
uint8_t send_crc :1;
|
||||
uint8_t send_in_prog :1;
|
||||
ptask_t * send_task;
|
||||
}my_app_data_t;
|
||||
|
||||
/*Application specific data a window of this application*/
|
||||
typedef struct
|
||||
{
|
||||
lv_obj_t * file_list;
|
||||
lv_obj_t * send_set_h;
|
||||
}my_win_data_t;
|
||||
|
||||
/*Application specific data for a shortcut of this application*/
|
||||
typedef struct
|
||||
{
|
||||
lv_obj_t * label;
|
||||
}my_sc_data_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SEND_SETTINGS_FN,
|
||||
SEND_SETTINGS_SIZE,
|
||||
SEND_SETTINGS_CRC,
|
||||
SEND_SETTINGS_CHUNK_SIZE,
|
||||
SEND_SETTINGS_CHUNK_DELAY,
|
||||
}send_settings_id_t;
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static void my_app_run(lv_app_inst_t * app, void * conf);
|
||||
static void my_app_close(lv_app_inst_t * app);
|
||||
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec, lv_app_com_type_t type , const void * data, uint32_t size);
|
||||
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc);
|
||||
static void my_sc_close(lv_app_inst_t * app);
|
||||
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win);
|
||||
static void my_win_close(lv_app_inst_t * app);
|
||||
|
||||
static void win_load_file_list(lv_app_inst_t * app);
|
||||
static void win_create_list(lv_app_inst_t * app);
|
||||
static lv_action_res_t win_up_action(lv_obj_t * up, lv_dispi_t * dispi);
|
||||
static lv_action_res_t win_next_action(lv_obj_t * next, lv_dispi_t * dispi);
|
||||
static lv_action_res_t win_prev_action(lv_obj_t * prev, lv_dispi_t * dispi);
|
||||
static lv_action_res_t win_drv_action(lv_obj_t * drv, lv_dispi_t * dispi);
|
||||
static lv_action_res_t win_folder_action(lv_obj_t * folder, lv_dispi_t * dispi);
|
||||
static lv_action_res_t win_file_action(lv_obj_t * file, lv_dispi_t * dispi);
|
||||
static lv_action_res_t win_send_rel_action(lv_obj_t * send, lv_dispi_t * dispi);
|
||||
static lv_action_res_t win_send_lpr_action(lv_obj_t * send, lv_dispi_t * dispi);
|
||||
static lv_action_res_t win_send_settings_element_rel_action(lv_obj_t * element, lv_dispi_t * dispi);
|
||||
static lv_action_res_t win_back_action(lv_obj_t * back, lv_dispi_t * dispi);
|
||||
static lv_action_res_t win_del_rel_action(lv_obj_t * del, lv_dispi_t * dispi);
|
||||
static lv_action_res_t win_del_lpr_action(lv_obj_t * del, lv_dispi_t * dispi);
|
||||
static void send_settings_kb_close_action(lv_obj_t * ta);
|
||||
static void send_settings_kb_ok_action(lv_obj_t * ta);
|
||||
static void start_send(lv_app_inst_t * app, const char * path);
|
||||
static void send_task(void * param);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static lv_app_dsc_t my_app_dsc =
|
||||
{
|
||||
.name = "Files",
|
||||
.mode = LV_APP_MODE_NONE,
|
||||
.app_run = my_app_run,
|
||||
.app_close = my_app_close,
|
||||
.com_rec = my_com_rec,
|
||||
.win_open = my_win_open,
|
||||
.win_close = my_win_close,
|
||||
.sc_open = my_sc_open,
|
||||
.sc_close = my_sc_close,
|
||||
.app_data_size = sizeof(my_app_data_t),
|
||||
.sc_data_size = sizeof(my_sc_data_t),
|
||||
.win_data_size = sizeof(my_win_data_t),
|
||||
};
|
||||
|
||||
static lv_labels_t sc_labels;
|
||||
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize the application
|
||||
* @return pointer to the application descriptor of this application
|
||||
*/
|
||||
const lv_app_dsc_t * lv_app_files_init(void)
|
||||
{
|
||||
lv_app_style_t * app_style = lv_app_style_get();
|
||||
memcpy(&sc_labels, &app_style->sc_txt_style, sizeof(lv_labels_t));
|
||||
sc_labels.font = LV_APP_FONT_LARGE;
|
||||
|
||||
|
||||
return &my_app_dsc;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Run an application according to 'app_dsc'
|
||||
* @param app_dsc pointer to an application descriptor
|
||||
* @param conf pointer to a lv_app_example_conf_t structure with configuration data or NULL if unused
|
||||
* @return pointer to the opened application or NULL if any error occurred
|
||||
*/
|
||||
static void my_app_run(lv_app_inst_t * app, void * conf)
|
||||
{
|
||||
/*Initialize the application*/
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
app_data->file_cnt = 0;
|
||||
app_data->path[0] = '\0';
|
||||
app_data->fn[0] = '\0';
|
||||
app_data->send_fn = 0;
|
||||
app_data->send_size = 0;
|
||||
app_data->send_crc = 0;
|
||||
app_data->chunk_size = LV_APP_FILES_CHUNK_DEF_SIZE;
|
||||
app_data->chunk_delay = LV_APP_FILES_CHUNK_DEF_TIME;
|
||||
app_data->send_in_prog = 0;
|
||||
|
||||
app_data->send_task = ptask_create(send_task, LV_APP_FILES_CHUNK_DEF_TIME, PTASK_PRIO_OFF, app);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close a running application.
|
||||
* Close the Window and the Shortcut too if opened.
|
||||
* Free all the allocated memory by this application.
|
||||
* @param app pointer to an application
|
||||
*/
|
||||
static void my_app_close(lv_app_inst_t * app)
|
||||
{
|
||||
/*No dynamically allocated data in 'my_app_data'*/
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
ptask_del(app_data->send_task);
|
||||
if(app_data->send_in_prog != 0) fs_close(&app_data->file);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the data have been sent to this application
|
||||
* @param app_send pointer to an application which sent the message
|
||||
* @param app_rec pointer to an application which is receiving the message
|
||||
* @param type type of data from 'lv_app_com_type_t' enum
|
||||
* @param data pointer to the sent data
|
||||
* @param size length of 'data' in bytes
|
||||
*/
|
||||
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
|
||||
lv_app_com_type_t type , const void * data, uint32_t size)
|
||||
{
|
||||
if(type == LV_APP_COM_TYPE_CHAR) {
|
||||
/*Check for file query. E.g. "U:/file.txt?"*/
|
||||
const char * path = data;
|
||||
if(path[size - 1] == '?') {
|
||||
if(size > LV_APP_FILES_PATH_MAX_LEN + LV_APP_FILES_FN_MAX_LEN) {
|
||||
lv_app_notice_add("Can not send file:\ntoo long path");
|
||||
}
|
||||
|
||||
char path_fn[LV_APP_FILES_PATH_MAX_LEN + LV_APP_FILES_FN_MAX_LEN];
|
||||
memcpy(path_fn, data, size - 1); /*-1 to ignore the '?' at the end*/
|
||||
path_fn[size - 1] = '\0';
|
||||
start_send(app_rec, path_fn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a shortcut for an application
|
||||
* @param app pointer to an application
|
||||
* @param sc pointer to an object where the application
|
||||
* can create content of the shortcut
|
||||
*/
|
||||
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc)
|
||||
{
|
||||
my_sc_data_t * sc_data = app->sc_data;
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
|
||||
|
||||
sc_data->label = lv_label_create(sc, NULL);
|
||||
lv_obj_set_style(sc_data->label, &sc_labels);
|
||||
lv_label_set_text(sc_data->label, fs_get_last(app_data->path));
|
||||
lv_obj_align(sc_data->label, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the shortcut of an application
|
||||
* @param app pointer to an application
|
||||
*/
|
||||
static void my_sc_close(lv_app_inst_t * app)
|
||||
{
|
||||
/*No dynamically allocated data in 'my_sc_data'*/
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Open the application in a window
|
||||
* @param app pointer to an application
|
||||
* @param win pointer to a window object where
|
||||
* the application can create content
|
||||
*/
|
||||
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win)
|
||||
{
|
||||
my_win_data_t * win_data = app->win_data;
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
|
||||
app_data->file_cnt = 0;
|
||||
win_data->file_list = NULL;
|
||||
win_data->send_set_h = NULL;
|
||||
|
||||
lv_win_set_title(win, app_data->path);
|
||||
|
||||
win_load_file_list(app);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the window of an application
|
||||
* @param app pointer to an application
|
||||
*/
|
||||
static void my_win_close(lv_app_inst_t * app)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*--------------------
|
||||
* OTHER FUNCTIONS
|
||||
---------------------*/
|
||||
/**
|
||||
* Create an mpty list on the window. 'win_load_file_list' will fill it.
|
||||
* @param app pointer to a Files application
|
||||
*/
|
||||
static void win_create_list(lv_app_inst_t * app)
|
||||
{
|
||||
lv_app_style_t * app_style = lv_app_style_get();
|
||||
my_win_data_t * win_data = app->win_data;
|
||||
|
||||
/*Delete the previous list*/
|
||||
if(win_data->file_list != NULL) {
|
||||
lv_obj_del(win_data->file_list);
|
||||
}
|
||||
|
||||
/*Create a new list*/
|
||||
win_data->file_list = lv_list_create(app->win, NULL);
|
||||
lv_obj_set_width(win_data->file_list, app_style->win_useful_w);
|
||||
lv_obj_set_style(win_data->file_list, lv_lists_get(LV_LISTS_TRANSP, NULL));
|
||||
lv_obj_set_drag_parent(win_data->file_list, true);
|
||||
lv_obj_set_drag_parent(lv_page_get_scrl(win_data->file_list), true);
|
||||
lv_rect_set_fit(win_data->file_list, false, true);
|
||||
lv_rect_set_layout(lv_page_get_scrl(win_data->file_list), LV_RECT_LAYOUT_COL_L);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the file list from the current path on the window
|
||||
* @param app pointer to a Files application
|
||||
*/
|
||||
static void win_load_file_list(lv_app_inst_t * app)
|
||||
{
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
my_win_data_t * win_data = app->win_data;
|
||||
|
||||
/*Create a new list*/
|
||||
win_create_list(app);
|
||||
|
||||
fs_res_t res = FS_RES_OK;
|
||||
|
||||
/*At empty path show the drivers */
|
||||
lv_obj_t * liste;
|
||||
if(app_data->path[0] == '\0') {
|
||||
char drv[16];
|
||||
char buf[2];
|
||||
fs_get_letters(drv);
|
||||
uint8_t i;
|
||||
for(i = 0; drv[i] != '\0'; i++) {
|
||||
buf[0] = drv[i];
|
||||
buf[1] = '\0';
|
||||
liste = lv_list_add(win_data->file_list, "U:/icon_driver", buf, win_drv_action);
|
||||
lv_obj_set_free_p(liste, app);
|
||||
}
|
||||
}
|
||||
/*List the files/folders with fs interface*/
|
||||
else {
|
||||
liste = lv_list_add(win_data->file_list, "U:/icon_up", "Up", win_up_action);
|
||||
lv_obj_set_free_p(liste, app);
|
||||
|
||||
fs_readdir_t rd;
|
||||
res = fs_readdir_init(&rd, app_data->path);
|
||||
if(res != FS_RES_OK) {
|
||||
lv_app_notice_add("Can not read the\npath in Files");
|
||||
return;
|
||||
}
|
||||
|
||||
/*At not first page add prev. page button */
|
||||
if(app_data->file_cnt != 0) {
|
||||
liste = lv_list_add(win_data->file_list, "U:/icon_left", "Previous page", win_prev_action);
|
||||
lv_obj_set_free_p(liste, app);
|
||||
}
|
||||
|
||||
char fn[LV_APP_FILES_FN_MAX_LEN];
|
||||
|
||||
/*Read the files from the previous pages*/
|
||||
uint16_t file_cnt = 0;
|
||||
while(file_cnt <= app_data->file_cnt) {
|
||||
res = fs_readdir(&rd, fn);
|
||||
if(res != FS_RES_OK || fn[0] == '\0'){
|
||||
lv_app_notice_add("Can not read\nthe path in Files");
|
||||
return;
|
||||
}
|
||||
file_cnt ++;
|
||||
}
|
||||
|
||||
/*Add list elements from the files and folders*/
|
||||
while(res == FS_RES_OK && fn[0] != '\0') {
|
||||
if(fn[0] == '/') { /*Add a folder*/
|
||||
lv_obj_t * liste;
|
||||
liste = lv_list_add(win_data->file_list, "U:/icon_folder", &fn[1], win_folder_action);
|
||||
lv_obj_set_free_p(liste, app);
|
||||
app_data->file_cnt ++;
|
||||
}
|
||||
/*Add a file*/
|
||||
else {
|
||||
liste = lv_list_add(win_data->file_list, "U:/icon_file", fn, win_file_action);
|
||||
lv_obj_set_free_p(liste, app);
|
||||
app_data->file_cnt ++;
|
||||
}
|
||||
|
||||
/*Get the next element*/
|
||||
res = fs_readdir(&rd, fn);
|
||||
|
||||
/*Show only LV_APP_FSEL_MAX_FILE elements and add a Next page button*/
|
||||
if(app_data->file_cnt != 0 && app_data->file_cnt % LV_APP_FILES_PAGE_SIZE == 0) {
|
||||
liste = lv_list_add(win_data->file_list, "U:/icon_right", "Next page", win_next_action);
|
||||
lv_obj_set_free_p(liste, app);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*Close the read directory*/
|
||||
fs_readdir_close(&rd);
|
||||
}
|
||||
|
||||
if(res != FS_RES_OK) {
|
||||
lv_app_notice_add("Can not read\nthe path in Files");
|
||||
}
|
||||
|
||||
/*Focus to the top of the list*/
|
||||
lv_obj_set_y(lv_page_get_scrl(win_data->file_list), 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when the Up list element is released to step one level
|
||||
* @param up pointer to the Up button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the list is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t win_up_action(lv_obj_t * up, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(up);
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
fs_up(app_data->path);
|
||||
app_data->file_cnt = 0;
|
||||
lv_win_set_title(app->win, app_data->path);
|
||||
|
||||
my_sc_data_t * sc_data = app->sc_data;
|
||||
if(sc_data != NULL) {
|
||||
lv_label_set_text(sc_data->label, fs_get_last(app_data->path));
|
||||
lv_obj_align(sc_data->label, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
|
||||
win_load_file_list(app);
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the Next list element is released to go to the next page
|
||||
* @param next pointer to the Next button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the list is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t win_next_action(lv_obj_t * next, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(next);
|
||||
win_load_file_list(app);
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the Prev list element is released to previous page
|
||||
* @param prev pointer to the Prev button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the list is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t win_prev_action(lv_obj_t * prev, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(prev);
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
if(app_data->file_cnt <= 2 * LV_APP_FILES_PAGE_SIZE) app_data->file_cnt = 0;
|
||||
else if(app_data->file_cnt % LV_APP_FILES_PAGE_SIZE == 0) {
|
||||
app_data->file_cnt -= 2 * LV_APP_FILES_PAGE_SIZE;
|
||||
} else {
|
||||
app_data->file_cnt = ((app_data->file_cnt / LV_APP_FILES_PAGE_SIZE) - 1) * LV_APP_FILES_PAGE_SIZE;
|
||||
}
|
||||
|
||||
win_load_file_list(app);
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when the Driver list element is released to step into a driver
|
||||
* @param drv pointer to the Driver button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the list is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t win_drv_action(lv_obj_t * drv, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(drv);
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
sprintf(app_data->path, "%s:", lv_list_element_get_txt(drv));
|
||||
app_data->file_cnt = 0;
|
||||
lv_win_set_title(app->win, app_data->path);
|
||||
my_sc_data_t * sc_data = app->sc_data;
|
||||
if(sc_data != NULL) {
|
||||
lv_label_set_text(sc_data->label, fs_get_last(app_data->path));
|
||||
lv_obj_align(sc_data->label, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
|
||||
win_load_file_list(app);
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when a folder list element is released to enter into it
|
||||
* @param folder pointer to a folder button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the list is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t win_folder_action(lv_obj_t * folder, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(folder);
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
sprintf(app_data->path, "%s/%s", app_data->path, lv_list_element_get_txt(folder));
|
||||
app_data->file_cnt = 0;
|
||||
|
||||
lv_win_set_title(app->win, app_data->path);
|
||||
my_sc_data_t * sc_data = app->sc_data;
|
||||
if(sc_data != NULL) {
|
||||
lv_label_set_text(sc_data->label, fs_get_last(app_data->path));
|
||||
lv_obj_align(sc_data->label, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
win_load_file_list(app);
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when a file list element is released to show the list of operation on it
|
||||
* @param file pointer to a file button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the list is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t win_file_action(lv_obj_t * file, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(file);
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
my_win_data_t * win_data = app->win_data;
|
||||
|
||||
sprintf(app_data->fn, "%s", lv_list_element_get_txt(file));
|
||||
|
||||
win_create_list(app);
|
||||
|
||||
/*Create the list of operations*/
|
||||
lv_obj_t * liste;
|
||||
liste = lv_list_add(win_data->file_list, "U:/icon_left", "Back", win_back_action);
|
||||
lv_obj_set_free_p(liste, app);
|
||||
|
||||
/*Send button*/
|
||||
liste = lv_list_add(win_data->file_list, NULL, "Send", win_send_rel_action);
|
||||
lv_obj_set_free_p(liste, app);
|
||||
lv_btn_set_lpr_action(liste, win_send_lpr_action);
|
||||
lv_obj_set_free_p(liste, app);
|
||||
|
||||
/*Delete button*/
|
||||
liste = lv_list_add(win_data->file_list, NULL, "Delete", win_del_rel_action);
|
||||
lv_btn_set_lpr_action(liste, win_del_lpr_action);
|
||||
lv_obj_set_free_p(liste, app);
|
||||
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the Back list element is released to when a file chosen to
|
||||
* go back to the file list from file operation
|
||||
* @param back pointer to the back button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_INV because the list is deleted in the function
|
||||
*/
|
||||
static lv_action_res_t win_back_action(lv_obj_t * up, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(up);
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
|
||||
app_data->file_cnt = 0;
|
||||
win_load_file_list(app);
|
||||
return LV_ACTION_RES_INV;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the Send list element is released to send the file
|
||||
* @param sed pointer to the Up button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_OK because the list is NOT deleted in the function
|
||||
*/
|
||||
static lv_action_res_t win_send_rel_action(lv_obj_t * send, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(send);
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
|
||||
if(app_data->send_in_prog != 0) {
|
||||
lv_app_notice_add("File sending\nin progress");
|
||||
return LV_ACTION_RES_OK;
|
||||
}
|
||||
|
||||
char path_fn[LV_APP_FILES_PATH_MAX_LEN + LV_APP_FILES_FN_MAX_LEN];
|
||||
sprintf(path_fn, "%s/%s", app_data->path, app_data->fn);
|
||||
start_send(app, path_fn);
|
||||
|
||||
return LV_ACTION_RES_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the Send list element is long pressed to show/hide send settings
|
||||
* @param send pointer to the Up button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_OK because the list is NOT deleted in the function
|
||||
*/
|
||||
static lv_action_res_t win_send_lpr_action(lv_obj_t * send, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(send);
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
my_win_data_t * win_data = app->win_data;
|
||||
|
||||
/*Close the settings if it is opened*/
|
||||
if(win_data->send_set_h != NULL) {
|
||||
lv_obj_del(win_data->send_set_h);
|
||||
win_data->send_set_h = NULL;
|
||||
lv_dispi_wait_release(dispi);
|
||||
lv_btn_set_state(send, LV_BTN_STATE_REL);
|
||||
return LV_ACTION_RES_OK;
|
||||
}
|
||||
|
||||
/*Create the settings*/
|
||||
lv_btn_set_state(send, LV_BTN_STATE_REL);
|
||||
lv_rect_set_layout(send, LV_RECT_LAYOUT_COL_L);
|
||||
|
||||
/*Create holder for the settings*/
|
||||
win_data->send_set_h = lv_rect_create(send, NULL);
|
||||
lv_obj_set_style(win_data->send_set_h, lv_rects_get(LV_RECTS_TRANSP, NULL));
|
||||
lv_obj_set_click(win_data->send_set_h, false);
|
||||
lv_rect_set_fit(win_data->send_set_h, true, true);
|
||||
lv_rect_set_layout(win_data->send_set_h, LV_RECT_LAYOUT_COL_L);
|
||||
|
||||
/*Create check boxes*/
|
||||
lv_obj_t * cb;
|
||||
|
||||
/*Send file name check box*/
|
||||
cb = lv_cb_create(win_data->send_set_h, NULL);
|
||||
lv_cb_set_text(cb, "Send file name");
|
||||
lv_obj_set_free_num(cb, SEND_SETTINGS_FN);
|
||||
lv_obj_set_free_p(cb, app);
|
||||
lv_btn_set_rel_action(cb, win_send_settings_element_rel_action);
|
||||
if(app_data->send_fn != 0) lv_btn_set_state(cb, LV_BTN_STATE_TGL_REL);
|
||||
else lv_btn_set_state(cb, LV_BTN_STATE_REL);
|
||||
|
||||
/*Send size check box*/
|
||||
cb = lv_cb_create(win_data->send_set_h, cb);
|
||||
lv_cb_set_text(cb, "Send size");
|
||||
lv_obj_set_free_num(cb, SEND_SETTINGS_SIZE);
|
||||
if(app_data->send_size != 0) lv_btn_set_state(cb, LV_BTN_STATE_TGL_REL);
|
||||
else lv_btn_set_state(cb, LV_BTN_STATE_REL);
|
||||
|
||||
/*Send CRC check box*/
|
||||
cb = lv_cb_create(win_data->send_set_h, cb);
|
||||
lv_cb_set_text(cb, "Send CRC");
|
||||
lv_obj_set_free_num(cb, SEND_SETTINGS_CRC);
|
||||
if(app_data->send_crc != 0) lv_btn_set_state(cb, LV_BTN_STATE_TGL_REL);
|
||||
else lv_btn_set_state(cb, LV_BTN_STATE_REL);
|
||||
|
||||
/*Create a text area the type chunk size*/
|
||||
lv_obj_t * val_set_h;
|
||||
val_set_h = lv_rect_create(win_data->send_set_h, NULL);
|
||||
lv_obj_set_style(val_set_h, lv_rects_get(LV_RECTS_TRANSP, NULL));
|
||||
lv_obj_set_click(val_set_h, false);
|
||||
lv_rect_set_fit(val_set_h, true, true);
|
||||
lv_rect_set_layout(val_set_h, LV_RECT_LAYOUT_ROW_M);
|
||||
|
||||
lv_obj_t * label;
|
||||
label = lv_label_create(val_set_h, NULL);
|
||||
lv_label_set_text(label, "Chunk size");
|
||||
|
||||
lv_obj_t * ta;
|
||||
char buf[32];
|
||||
ta = lv_ta_create(val_set_h, NULL);
|
||||
lv_obj_set_style(ta, lv_tas_get(LV_TAS_SIMPLE, NULL));
|
||||
lv_rect_set_fit(ta, false, true);
|
||||
lv_obj_set_free_num(ta, SEND_SETTINGS_CHUNK_SIZE);
|
||||
lv_obj_set_free_p(ta, app);
|
||||
lv_page_set_rel_action(ta, win_send_settings_element_rel_action);
|
||||
sprintf(buf, "%d", app_data->chunk_size);
|
||||
lv_ta_set_text(ta, buf);
|
||||
|
||||
/*Create a text area to type the chunk delay*/
|
||||
val_set_h = lv_rect_create(win_data->send_set_h, val_set_h);
|
||||
|
||||
label = lv_label_create(val_set_h, NULL);
|
||||
lv_label_set_text(label, "Inter-chunk delay");
|
||||
|
||||
ta = lv_ta_create(val_set_h, ta);
|
||||
lv_obj_set_free_num(ta, SEND_SETTINGS_CHUNK_DELAY);
|
||||
sprintf(buf, "%d", app_data->chunk_delay);
|
||||
lv_ta_set_text(ta, buf);
|
||||
|
||||
return LV_ACTION_RES_OK;
|
||||
}
|
||||
/**
|
||||
* Called when a send settings element is released
|
||||
* @param element pointer to a chekbox or text area
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_OK because the list is NOT deleted in the function
|
||||
*/
|
||||
static lv_action_res_t win_send_settings_element_rel_action(lv_obj_t * element, lv_dispi_t * dispi)
|
||||
{
|
||||
send_settings_id_t id = lv_obj_get_free_num(element);
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(element);
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
|
||||
if(id == SEND_SETTINGS_FN) {
|
||||
app_data->send_fn = lv_btn_get_state(element) == LV_BTN_STATE_REL ? 0 : 1;
|
||||
} else if(id == SEND_SETTINGS_SIZE) {
|
||||
app_data->send_size = lv_btn_get_state(element) == LV_BTN_STATE_REL ? 0 : 1;
|
||||
} else if(id == SEND_SETTINGS_CRC) {
|
||||
app_data->send_crc = lv_btn_get_state(element) == LV_BTN_STATE_REL ? 0 : 1;
|
||||
|
||||
/*TODO CRC sending is not supported yet*/
|
||||
if(app_data->send_crc != 0) {
|
||||
lv_app_notice_add("CRC sending is\nnot supported yet");
|
||||
}
|
||||
} else if(id == SEND_SETTINGS_CHUNK_SIZE) {
|
||||
lv_app_kb_open(element, LV_APP_KB_MODE_NUM, send_settings_kb_close_action, send_settings_kb_ok_action);
|
||||
} else if(id == SEND_SETTINGS_CHUNK_DELAY) {
|
||||
lv_app_kb_open(element, LV_APP_KB_MODE_NUM, send_settings_kb_close_action, send_settings_kb_ok_action);
|
||||
}
|
||||
|
||||
return LV_ACTION_RES_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when the Delete list element is released.
|
||||
* It will show a notification to long press the Delete button to remove the file
|
||||
* @param del pointer to the back button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_OK because the list is NOT deleted in the function
|
||||
*/
|
||||
static lv_action_res_t win_del_rel_action(lv_obj_t * del, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_app_notice_add("Press long the Delete button\n"
|
||||
"to remove the file");
|
||||
|
||||
return LV_ACTION_RES_OK;
|
||||
}
|
||||
/**
|
||||
* Called when the Delete list element is long pressed to remove a file
|
||||
* @param del pointer to the Delete button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_OK because the list is NOT deleted in the function
|
||||
*/
|
||||
static lv_action_res_t win_del_lpr_action(lv_obj_t * del, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(del);
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
|
||||
char path_fn[LV_APP_FILES_PATH_MAX_LEN + LV_APP_FILES_FN_MAX_LEN];
|
||||
sprintf(path_fn, "%s/%s", app_data->path, app_data->fn);
|
||||
|
||||
fs_res_t res = fs_remove(path_fn);
|
||||
if(res == FS_RES_OK) lv_app_notice_add("%s deleted", app_data->fn);
|
||||
else lv_app_notice_add("Can not delete\n%s", app_data->fn);
|
||||
|
||||
return LV_ACTION_RES_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a send setting is typed and 'Close' pressed on the App. keyboard.
|
||||
* The function reverts the original value in the text area.
|
||||
* @param ta pointer to a text area
|
||||
*/
|
||||
static void send_settings_kb_close_action(lv_obj_t * ta)
|
||||
{
|
||||
send_settings_id_t id = lv_obj_get_free_num(ta);
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(ta);
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
|
||||
char buf[32];
|
||||
buf[0] = '\0';
|
||||
|
||||
if(id == SEND_SETTINGS_CHUNK_DELAY) {
|
||||
sprintf(buf, "%d", app_data->chunk_size);
|
||||
} else if(id == SEND_SETTINGS_CHUNK_SIZE) {
|
||||
sprintf(buf, "%d", app_data->chunk_size);
|
||||
}
|
||||
lv_ta_set_text(ta, buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a send setting is typed and 'Ok' pressed on the App. keyboard.
|
||||
* The function saves teh new value.
|
||||
* @param ta pointer to a text area
|
||||
*/
|
||||
static void send_settings_kb_ok_action(lv_obj_t * ta)
|
||||
{
|
||||
send_settings_id_t id = lv_obj_get_free_num(ta);
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(ta);
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
|
||||
int num;
|
||||
sscanf(lv_ta_get_txt(ta), "%d", &num);
|
||||
|
||||
if(id == SEND_SETTINGS_CHUNK_DELAY) {
|
||||
if(num > LV_APP_FILES_CHUNK_MAX_TIME) num = LV_APP_FILES_CHUNK_MAX_TIME;
|
||||
if(num < LV_APP_FILES_CHUNK_MIN_TIME) num = LV_APP_FILES_CHUNK_MIN_TIME;
|
||||
app_data->chunk_delay = (uint16_t) num;
|
||||
} else if(id == SEND_SETTINGS_CHUNK_SIZE) {
|
||||
if(num > LV_APP_FILES_CHUNK_MAX_SIZE) num = LV_APP_FILES_CHUNK_MAX_SIZE;
|
||||
if(num < LV_APP_FILES_CHUNK_MIN_SIZE) num = LV_APP_FILES_CHUNK_MIN_SIZE;
|
||||
app_data->chunk_size= (uint16_t) num;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the sending of a file
|
||||
* @param app pointer to a Files application
|
||||
* @param path path of the file to send
|
||||
*/
|
||||
static void start_send(lv_app_inst_t * app, const char * path)
|
||||
{
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
|
||||
/*Open the file*/
|
||||
fs_res_t res = fs_open(&app_data->file, path, FS_MODE_RD);
|
||||
if(res == FS_RES_OK) {
|
||||
uint32_t rn;
|
||||
char rd_buf[LV_APP_FILES_CHUNK_MAX_SIZE];
|
||||
|
||||
/*Read the first chunk*/
|
||||
res = fs_read(&app_data->file, rd_buf, app_data->chunk_size, &rn);
|
||||
if(res == FS_RES_OK) {
|
||||
app_data->send_in_prog = 1;
|
||||
|
||||
/*Send the header*/
|
||||
if(app_data->send_fn != 0) {
|
||||
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, app_data->path, strlen(app_data->path));
|
||||
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "/", 1);
|
||||
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, app_data->fn, strlen(app_data->fn));
|
||||
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "\n", 1);
|
||||
}
|
||||
|
||||
if(app_data->send_size != 0) {
|
||||
char buf[64];
|
||||
uint32_t size;
|
||||
fs_size(&app_data->file, &size);
|
||||
sprintf(buf,"%d", (int) size);
|
||||
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, buf, strlen(buf));
|
||||
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "\n", 1);
|
||||
}
|
||||
if(app_data->send_crc != 0) {
|
||||
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "0x0000", 6);
|
||||
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "\n", 1);
|
||||
}
|
||||
|
||||
/*Add an extra \n to separate the header from the file data*/
|
||||
if(app_data->send_fn != 0 || app_data->send_size != 0 || app_data->send_crc != 0) {
|
||||
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "\n", 1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*If an error occurred close the file*/
|
||||
if(res != FS_RES_OK) {
|
||||
fs_close(&app_data->file);
|
||||
ptask_set_prio(app_data->send_task, PTASK_PRIO_OFF);
|
||||
app_data->send_in_prog = 0;
|
||||
lv_app_notice_add("Can not send\nthe file in Files");
|
||||
}
|
||||
/*If no error show notification, start the sender task and refresh the shortcut*/
|
||||
else {
|
||||
/*Start the sender task*/
|
||||
ptask_set_period(app_data->send_task, app_data->chunk_delay);
|
||||
ptask_reset(app_data->send_task);
|
||||
ptask_set_prio(app_data->send_task, PTASK_PRIO_HIGH);
|
||||
lv_app_notice_add("Sending\n%s", fs_get_last(path));
|
||||
|
||||
/*Refresh the shortcut with the percentage of the sending*/
|
||||
if(app->sc_data != NULL) {
|
||||
my_sc_data_t * sc_data = app->sc_data;
|
||||
|
||||
uint32_t size;
|
||||
fs_size(&app_data->file, &size);
|
||||
uint32_t pos;
|
||||
fs_tell(&app_data->file, &pos);
|
||||
|
||||
int pct = (uint32_t) (pos * 100) / size;
|
||||
|
||||
char buf[256];
|
||||
sprintf(buf, "Sending\n%d%%", pct);
|
||||
lv_label_set_text(sc_data->label, buf);
|
||||
lv_obj_align(sc_data->label, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Periodically send the next chunk of the file
|
||||
* @param app pointer to a Files application
|
||||
*/
|
||||
static void send_task(void * param)
|
||||
{
|
||||
lv_app_inst_t * app = param;
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
|
||||
if(app_data->send_in_prog == 0) return;
|
||||
|
||||
/*Read a chunk*/
|
||||
uint32_t rn;
|
||||
char rd_buf[LV_APP_FILES_CHUNK_MAX_SIZE];
|
||||
fs_res_t res = fs_read(&app_data->file, rd_buf, app_data->chunk_size, &rn);
|
||||
if(res == FS_RES_OK) {
|
||||
app_data->send_in_prog = 1;
|
||||
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, rd_buf, rn);
|
||||
}
|
||||
|
||||
/*If the read failed close the file and show an error*/
|
||||
if(res != FS_RES_OK) {
|
||||
fs_close(&app_data->file);
|
||||
app_data->send_in_prog = 0;
|
||||
lv_app_notice_add("Can not send\nthe file in Files");
|
||||
}
|
||||
/*If the read was successful*/
|
||||
else {
|
||||
my_sc_data_t * sc_data = app->sc_data;
|
||||
|
||||
/*If the file is read close it a show a notification*/
|
||||
if(rn < app_data->chunk_size) {
|
||||
lv_app_notice_add("File sent");
|
||||
fs_close(&app_data->file);
|
||||
app_data->send_in_prog = 0;
|
||||
|
||||
/*Refresh the shortut*/
|
||||
if(sc_data != NULL) {
|
||||
lv_label_set_text(sc_data->label, fs_get_last(app_data->path));
|
||||
lv_obj_align(sc_data->label, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
}
|
||||
/*If the file is not sent yet refresh the shortcut with percentage of sending*/
|
||||
else {
|
||||
if(sc_data != NULL) {
|
||||
uint32_t size;
|
||||
fs_size(&app_data->file, &size);
|
||||
uint32_t pos;
|
||||
fs_tell(&app_data->file, &pos);
|
||||
|
||||
uint8_t pct = (uint32_t) (pos * 100) / size;
|
||||
|
||||
char buf[256];
|
||||
sprintf(buf, "Sending\n%d%%", pct);
|
||||
lv_label_set_text(sc_data->label, buf);
|
||||
lv_obj_align(sc_data->label, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_FILES != 0*/
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* @file lv_app_files.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_APP_FILES_H
|
||||
#define LV_APP_FILES_H
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lvgl/lv_app/lv_app.h"
|
||||
|
||||
#if LV_APP_ENABLE != 0 && USE_LV_APP_FILES != 0
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
typedef struct
|
||||
{
|
||||
|
||||
}lv_app_files_conf_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
const lv_app_dsc_t * lv_app_files_init(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_FILES != 0*/
|
||||
|
||||
#endif /* LV_APP_EXAMPLE_H */
|
||||
@@ -1,388 +0,0 @@
|
||||
/**
|
||||
* @file lv_app_sysmon.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_app_sysmon.h"
|
||||
#if LV_APP_ENABLE != 0 && USE_LV_APP_SYSMON != 0
|
||||
|
||||
#include <stdio.h>
|
||||
#include "misc/os/ptask.h"
|
||||
#include "misc/os/idle.h"
|
||||
#include "lvgl/lv_objx/lv_chart.h"
|
||||
#include "lvgl/lv_app/lv_app_util/lv_app_notice.h"
|
||||
#include "hal/systick/systick.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/*Application specific data for an instance of this application*/
|
||||
typedef struct
|
||||
{
|
||||
|
||||
}my_app_data_t;
|
||||
|
||||
/*Application specific data a window of this application*/
|
||||
typedef struct
|
||||
{
|
||||
lv_obj_t * chart;
|
||||
cord_t * cpu_dl;
|
||||
cord_t * mem_dl;
|
||||
lv_obj_t * label;
|
||||
}my_win_data_t;
|
||||
|
||||
/*Application specific data for a shortcut of this application*/
|
||||
typedef struct
|
||||
{
|
||||
lv_obj_t * pb_cpu;
|
||||
lv_obj_t * pb_mem;
|
||||
}my_sc_data_t;
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static void my_app_run(lv_app_inst_t * app, void * conf);
|
||||
static void my_app_close(lv_app_inst_t * app);
|
||||
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec, lv_app_com_type_t type , const void * data, uint32_t size);
|
||||
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc);
|
||||
static void my_sc_close(lv_app_inst_t * app);
|
||||
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win);
|
||||
static void my_win_close(lv_app_inst_t * app);
|
||||
|
||||
static void sysmon_task(void * param);
|
||||
static void lv_app_sysmon_refr(void);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static lv_app_dsc_t my_app_dsc =
|
||||
{
|
||||
.name = "Sys. monitor",
|
||||
.mode = LV_APP_MODE_NONE,
|
||||
.app_run = my_app_run,
|
||||
.app_close = my_app_close,
|
||||
.com_rec = my_com_rec,
|
||||
.win_open = my_win_open,
|
||||
.win_close = my_win_close,
|
||||
.sc_open = my_sc_open,
|
||||
.sc_close = my_sc_close,
|
||||
.app_data_size = sizeof(my_app_data_t),
|
||||
.sc_data_size = sizeof(my_sc_data_t),
|
||||
.win_data_size = sizeof(my_win_data_t),
|
||||
};
|
||||
|
||||
static uint8_t mem_pct[LV_APP_SYSMON_PNUM];
|
||||
static uint8_t cpu_pct[LV_APP_SYSMON_PNUM];
|
||||
static lv_pbs_t cpu_pbs;
|
||||
static lv_pbs_t mem_pbs;
|
||||
#if USE_DYN_MEM != 0 && DM_CUSTOM == 0
|
||||
static dm_mon_t mem_mon;
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize the application
|
||||
* @return pointer to the application descriptor of this application
|
||||
*/
|
||||
const lv_app_dsc_t * lv_app_sysmon_init(void)
|
||||
{
|
||||
ptask_create(sysmon_task, LV_APP_SYSMON_REFR_TIME, PTASK_PRIO_LOW, NULL);
|
||||
|
||||
memset(mem_pct, 0, sizeof(mem_pct));
|
||||
memset(cpu_pct, 0, sizeof(cpu_pct));
|
||||
|
||||
/*Create progress bar styles for the shortcut*/
|
||||
lv_pbs_get(LV_PBS_DEF, &cpu_pbs);
|
||||
cpu_pbs.bg.gcolor = COLOR_MAKE(0xFF, 0xE0, 0xE0);
|
||||
cpu_pbs.bg.objs.color = COLOR_MAKE(0xFF, 0xD0, 0xD0);
|
||||
cpu_pbs.bg.bcolor = COLOR_MAKE(0xFF, 0x20, 0x20);
|
||||
cpu_pbs.bg.bwidth = 1 * LV_DOWNSCALE;
|
||||
|
||||
cpu_pbs.bar.gcolor = COLOR_MARRON;
|
||||
cpu_pbs.bar.objs.color = COLOR_RED;
|
||||
cpu_pbs.bar.bwidth = 0;
|
||||
|
||||
cpu_pbs.label.objs.color = COLOR_MAKE(0x40, 0x00, 0x00);
|
||||
cpu_pbs.label.font = LV_APP_FONT_MEDIUM;
|
||||
cpu_pbs.label.line_space = 0;
|
||||
cpu_pbs.label.mid = 1;
|
||||
|
||||
memcpy(&mem_pbs, &cpu_pbs, sizeof(mem_pbs));
|
||||
mem_pbs.bg.gcolor = COLOR_MAKE(0xD0, 0xFF, 0xD0);
|
||||
mem_pbs.bg.objs.color = COLOR_MAKE(0xE0, 0xFF, 0xE0);
|
||||
mem_pbs.bg.bcolor = COLOR_MAKE(0x20, 0xFF, 0x20);
|
||||
|
||||
mem_pbs.bar.gcolor = COLOR_GREEN;
|
||||
mem_pbs.bar.objs.color = COLOR_LIME;
|
||||
|
||||
mem_pbs.label.objs.color = COLOR_MAKE(0x00, 0x40, 0x00);
|
||||
|
||||
return &my_app_dsc;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Run an application according to 'app_dsc'
|
||||
* @param app_dsc pointer to an application descriptor
|
||||
* @param conf pointer to a lv_app_sysmon_conf_t structure with configuration data or NULL if unused
|
||||
* @return pointer to the opened application or NULL if any error occurred
|
||||
*/
|
||||
static void my_app_run(lv_app_inst_t * app, void * conf)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Close a running application.
|
||||
* Close the Window and the Shortcut too if opened.
|
||||
* Free all the allocated memory by this application.
|
||||
* @param app pointer to an application
|
||||
*/
|
||||
static void my_app_close(lv_app_inst_t * app)
|
||||
{
|
||||
/*No dynamically allocated data in 'my_app_data'*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the data have been sent to this application
|
||||
* @param app_send pointer to an application which sent the message
|
||||
* @param app_rec pointer to an application which is receiving the message
|
||||
* @param type type of data from 'lv_app_com_type_t' enum
|
||||
* @param data pointer to the sent data
|
||||
* @param size length of 'data' in bytes
|
||||
*/
|
||||
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
|
||||
lv_app_com_type_t type , const void * data, uint32_t size)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a shortcut for an application
|
||||
* @param app pointer to an application
|
||||
* @param sc pointer to an object where the application
|
||||
* can create content of the shortcut
|
||||
*/
|
||||
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc)
|
||||
{
|
||||
my_sc_data_t * sc_data = app->sc_data;
|
||||
|
||||
cord_t w = lv_obj_get_width(sc) / 5;
|
||||
|
||||
/*Create 2 progress bars fr the CPU and the Memory*/
|
||||
sc_data->pb_cpu = lv_pb_create(sc, NULL);
|
||||
lv_obj_set_size(sc_data->pb_cpu, w, 5 * lv_obj_get_height(sc) / 8);
|
||||
lv_obj_align(sc_data->pb_cpu, NULL, LV_ALIGN_IN_BOTTOM_LEFT, w, - lv_obj_get_height(sc) / 8);
|
||||
lv_obj_set_style(sc_data->pb_cpu, &cpu_pbs);
|
||||
lv_obj_set_click(sc_data->pb_cpu, false);
|
||||
lv_pb_set_min_max_value(sc_data->pb_cpu, 0, 100);
|
||||
lv_pb_set_format_str(sc_data->pb_cpu, "C\nP\nU");
|
||||
|
||||
sc_data->pb_mem = lv_pb_create(sc, sc_data->pb_cpu);
|
||||
lv_obj_align(sc_data->pb_mem, sc_data->pb_cpu, LV_ALIGN_OUT_RIGHT_MID, w, 0);
|
||||
lv_obj_set_style(sc_data->pb_mem, &mem_pbs);
|
||||
lv_pb_set_format_str(sc_data->pb_mem, "M\ne\nm");
|
||||
|
||||
lv_app_sysmon_refr();
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the shortcut of an application
|
||||
* @param app pointer to an application
|
||||
*/
|
||||
static void my_sc_close(lv_app_inst_t * app)
|
||||
{
|
||||
/*No dynamically allocated data in 'my_sc_data'*/
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Open the application in a window
|
||||
* @param app pointer to an application
|
||||
* @param win pointer to a window object where
|
||||
* the application can create content
|
||||
*/
|
||||
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win)
|
||||
{
|
||||
my_win_data_t * win_data = app->win_data;
|
||||
lv_app_style_t * app_style = lv_app_style_get();
|
||||
|
||||
/*Create a chart with two data lines*/
|
||||
win_data->chart = lv_chart_create(win, NULL);
|
||||
lv_obj_set_size(win_data->chart, LV_HOR_RES / 2, LV_VER_RES / 2);
|
||||
lv_chart_set_pnum(win_data->chart, LV_APP_SYSMON_PNUM);
|
||||
lv_chart_set_range(win_data->chart, 0, 100);
|
||||
lv_chart_set_type(win_data->chart, LV_CHART_LINE);
|
||||
|
||||
win_data->cpu_dl = lv_chart_add_dataline(win_data->chart);
|
||||
win_data->mem_dl = lv_chart_add_dataline(win_data->chart);
|
||||
|
||||
uint16_t i;
|
||||
for(i = 0; i < LV_APP_SYSMON_PNUM; i ++) {
|
||||
win_data->cpu_dl[i] = cpu_pct[i];
|
||||
win_data->mem_dl[i] = mem_pct[i];
|
||||
}
|
||||
|
||||
/*Create a label for the details of Memory and CPU usage*/
|
||||
cord_t opad = app_style->win_style.pages.scrl_rects.opad;
|
||||
win_data->label = lv_label_create(win, NULL);
|
||||
lv_obj_align(win_data->label, win_data->chart, LV_ALIGN_OUT_RIGHT_MID, opad, 0);
|
||||
lv_obj_set_style(win_data->label, &app_style->win_txt_style);
|
||||
|
||||
lv_app_sysmon_refr();
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the window of an application
|
||||
* @param app pointer to an application
|
||||
*/
|
||||
static void my_win_close(lv_app_inst_t * app)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*--------------------
|
||||
* OTHER FUNCTIONS
|
||||
---------------------*/
|
||||
|
||||
/**
|
||||
* Called periodically to monitor the CPU and memory usage.
|
||||
* It refreshes the shortcuts and windows and also add notifications if there is any problem.
|
||||
* @param param unused
|
||||
*/
|
||||
static void sysmon_task(void * param)
|
||||
{
|
||||
/*Shift out the oldest data*/
|
||||
uint16_t i;
|
||||
for(i = 1; i < LV_APP_SYSMON_PNUM; i++) {
|
||||
mem_pct[i - 1] = mem_pct[i];
|
||||
cpu_pct[i - 1] = cpu_pct[i];
|
||||
}
|
||||
|
||||
/*Get CPU and memory information */
|
||||
uint8_t cpu_busy = 0;
|
||||
#if USE_IDLE != 0
|
||||
cpu_busy = 100 - idle_get();
|
||||
#endif
|
||||
|
||||
uint8_t mem_used_pct = 0;
|
||||
#if USE_DYN_MEM != 0 && DM_CUSTOM == 0
|
||||
dm_monitor(&mem_mon);
|
||||
mem_used_pct = mem_mon.pct_used;
|
||||
#endif
|
||||
|
||||
/*Add the CPU and memory data*/
|
||||
cpu_pct[LV_APP_SYSMON_PNUM - 1] = cpu_busy;
|
||||
mem_pct[LV_APP_SYSMON_PNUM - 1] = mem_used_pct;
|
||||
|
||||
/*Refresh the shortcuts and windows*/
|
||||
lv_app_sysmon_refr();
|
||||
|
||||
#if USE_DYN_MEM != 0 && DM_CUSTOM == 0
|
||||
|
||||
/*Handle periodic defrag. if enabled*/
|
||||
#if LV_APP_SYSMON_DEFRAG_PERIOD != 0
|
||||
static uint32_t last_defrag = 0;
|
||||
|
||||
if(systick_elaps(last_defrag) > LV_APP_SYSMON_DEFRAG_PERIOD) {
|
||||
dm_defrag();
|
||||
last_defrag = systick_get();
|
||||
}
|
||||
#endif
|
||||
/*Add notifications if something is critical*/
|
||||
static bool mem_warn_report = false;
|
||||
if(mem_mon.size_free < LV_APP_SYSMON_MEM_WARN && mem_warn_report == false) {
|
||||
mem_warn_report = true;
|
||||
lv_app_notice_add("Critically low memory");
|
||||
}
|
||||
|
||||
if(mem_mon.size_free > LV_APP_SYSMON_MEM_WARN) mem_warn_report = false;
|
||||
|
||||
static bool frag_warn_report = false;
|
||||
if(mem_mon.pct_frag > LV_APP_SYSMON_FRAG_WARN) {
|
||||
if(frag_warn_report == false) {
|
||||
frag_warn_report = true;
|
||||
lv_app_notice_add("Critically memory fragmentation");
|
||||
dm_defrag(); /*Defrag. if the fragmentation is critical*/
|
||||
}
|
||||
}
|
||||
|
||||
if(mem_mon.pct_frag < LV_APP_SYSMON_FRAG_WARN) frag_warn_report = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh the shortcuts and windows.
|
||||
*/
|
||||
static void lv_app_sysmon_refr(void)
|
||||
{
|
||||
|
||||
char buf_long[256];
|
||||
char buf_short[128];
|
||||
#if USE_IDLE != 0
|
||||
sprintf(buf_long, "CPU: %d %%\n\n", cpu_pct[LV_APP_SYSMON_PNUM - 1]);
|
||||
sprintf(buf_short, "CPU: %d %%\n", cpu_pct[LV_APP_SYSMON_PNUM - 1]);
|
||||
#else
|
||||
strcpy(buf_long, "CPU: N/A\n\n");
|
||||
strcpy(buf_short, "CPU: N/A\n");
|
||||
#endif
|
||||
|
||||
#if USE_DYN_MEM != 0 && DM_CUSTOM == 0
|
||||
sprintf(buf_long, "%sMEMORY: %d %%\nTotal: %d bytes\nUsed: %d bytes\nFree: %d bytes\nFrag: %d %%",
|
||||
buf_long,
|
||||
mem_pct[LV_APP_SYSMON_PNUM - 1],
|
||||
mem_mon.size_total,
|
||||
mem_mon.size_total - mem_mon.size_free, mem_mon.size_free, mem_mon.pct_frag);
|
||||
|
||||
sprintf(buf_short, "%sMem: %d %%\nFrag: %d %%\n",
|
||||
buf_short, mem_pct[LV_APP_SYSMON_PNUM - 1], mem_mon.pct_frag);
|
||||
#else
|
||||
sprintf(buf_long, "%sMEMORY: N/A", buf_long);
|
||||
sprintf(buf_short, "%sMem: N/A\nFrag: N/A", buf_short);
|
||||
#endif
|
||||
lv_app_style_t * app_style = lv_app_style_get();
|
||||
cord_t opad = app_style->win_style.pages.scrl_rects.opad;
|
||||
lv_app_inst_t * app;
|
||||
app = lv_app_get_next(NULL, &my_app_dsc);
|
||||
while(app != NULL) {
|
||||
/*Refresh the windows*/
|
||||
my_win_data_t * win_data = app->win_data;
|
||||
if(win_data != NULL) {
|
||||
lv_label_set_text(win_data->label, buf_long);
|
||||
lv_obj_align(win_data->label, win_data->chart, LV_ALIGN_OUT_RIGHT_TOP, opad, 0);
|
||||
|
||||
lv_chart_set_next(win_data->chart, win_data->mem_dl, mem_pct[LV_APP_SYSMON_PNUM - 1]);
|
||||
lv_chart_set_next(win_data->chart, win_data->cpu_dl, cpu_pct[LV_APP_SYSMON_PNUM - 1]);
|
||||
|
||||
}
|
||||
/*Refresh the shortcut*/
|
||||
my_sc_data_t * sc_data = app->sc_data;
|
||||
if(sc_data != NULL) {
|
||||
lv_pb_set_value(sc_data->pb_cpu, cpu_pct[LV_APP_SYSMON_PNUM - 1]);
|
||||
lv_pb_set_value(sc_data->pb_mem, mem_pct[LV_APP_SYSMON_PNUM - 1]);
|
||||
}
|
||||
|
||||
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, buf_short, strlen(buf_short));
|
||||
|
||||
app = lv_app_get_next(app, &my_app_dsc);
|
||||
}
|
||||
}
|
||||
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_SYSMON != 0*/
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* @file lv_app_example.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_APP_SYSMON_H
|
||||
#define LV_APP_SYSMON_H
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lvgl/lv_app/lv_app.h"
|
||||
|
||||
#if LV_APP_ENABLE != 0 && USE_LV_APP_SYSMON != 0
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
typedef struct
|
||||
{
|
||||
|
||||
}lv_app_sysmon_conf_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
const lv_app_dsc_t * lv_app_sysmon_init(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_SYSMON != 0*/
|
||||
|
||||
#endif /* LV_APP_SYSMON_H */
|
||||
@@ -1,446 +0,0 @@
|
||||
/**
|
||||
* @file lv_app_terminal.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_app_terminal.h"
|
||||
#if LV_APP_ENABLE != 0 && USE_LV_APP_TERMINAL != 0
|
||||
|
||||
#include "lvgl/lv_app/lv_app_util/lv_app_kb.h"
|
||||
#include <stdio.h>
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/*Application specific data for an instance of this application*/
|
||||
typedef struct
|
||||
{
|
||||
char txt[LV_APP_TERMINAL_LENGTH + 1];
|
||||
lv_app_com_type_t com_type;
|
||||
lv_app_inst_t * last_sender;
|
||||
}my_app_data_t;
|
||||
|
||||
/*Application specific data a window of this application*/
|
||||
typedef struct
|
||||
{
|
||||
lv_obj_t * label;
|
||||
lv_obj_t * ta;
|
||||
lv_obj_t * com_type_btn;
|
||||
lv_obj_t * clear_btn;
|
||||
}my_win_data_t;
|
||||
|
||||
/*Application specific data for a shortcut of this application*/
|
||||
typedef struct
|
||||
{
|
||||
lv_obj_t * label;
|
||||
}my_sc_data_t;
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static void my_app_run(lv_app_inst_t * app, void * conf);
|
||||
static void my_app_close(lv_app_inst_t * app);
|
||||
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec, lv_app_com_type_t type , const void * data, uint32_t size);
|
||||
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc);
|
||||
static void my_sc_close(lv_app_inst_t * app);
|
||||
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win);
|
||||
static void my_win_close(lv_app_inst_t * app);
|
||||
|
||||
static void add_data(lv_app_inst_t * app, const void * data, uint16_t data_len);
|
||||
static lv_action_res_t win_ta_rel_action(lv_obj_t * ta, lv_dispi_t * dispi);
|
||||
static lv_action_res_t win_comch_rel_action(lv_obj_t * btn, lv_dispi_t * dispi);
|
||||
static lv_action_res_t win_clear_rel_action(lv_obj_t * btn, lv_dispi_t * dispi);
|
||||
static void win_ta_kb_ok_action(lv_obj_t * ta);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static lv_app_dsc_t my_app_dsc =
|
||||
{
|
||||
.name = "Terminal",
|
||||
.mode = LV_APP_MODE_NONE,
|
||||
.app_run = my_app_run,
|
||||
.app_close = my_app_close,
|
||||
.com_rec = my_com_rec,
|
||||
.win_open = my_win_open,
|
||||
.win_close = my_win_close,
|
||||
.sc_open = my_sc_open,
|
||||
.sc_close = my_sc_close,
|
||||
.app_data_size = sizeof(my_app_data_t),
|
||||
.sc_data_size = sizeof(my_sc_data_t),
|
||||
.win_data_size = sizeof(my_win_data_t),
|
||||
};
|
||||
|
||||
const char * com_type_txt [LV_APP_COM_TYPE_NUM];
|
||||
lv_objs_t sc_txt_bgs;
|
||||
lv_labels_t sc_txts;
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize the application
|
||||
* @return pointer to the application descriptor of this application
|
||||
*/
|
||||
const lv_app_dsc_t * lv_app_terminal_init(void)
|
||||
{
|
||||
com_type_txt[LV_APP_COM_TYPE_INT] = "Ch: Num";
|
||||
com_type_txt[LV_APP_COM_TYPE_CHAR] = "Ch: Chars";
|
||||
com_type_txt[LV_APP_COM_TYPE_LOG] = "Ch: Log";
|
||||
com_type_txt[LV_APP_COM_TYPE_INV] = "Ch: None";
|
||||
|
||||
lv_app_style_t * app_style = lv_app_style_get();
|
||||
|
||||
memcpy(&sc_txts, &app_style->sc_txt_style, sizeof(lv_labels_t));
|
||||
sc_txts.line_space = 0;
|
||||
sc_txts.letter_space = 0;
|
||||
sc_txts.mid = 0;
|
||||
sc_txts.objs.color = COLOR_WHITE;
|
||||
|
||||
lv_objs_get(LV_OBJS_DEF, &sc_txt_bgs);
|
||||
sc_txt_bgs.color = COLOR_MAKE(0x20, 0x20, 0x20);
|
||||
|
||||
|
||||
return &my_app_dsc;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Run an application according to 'app_dsc'
|
||||
* @param app_dsc pointer to an application descriptor
|
||||
* @param conf pointer to a lv_app_example_conf_t structure with configuration data or NULL if unused
|
||||
* @return pointer to the opened application or NULL if any error occurred
|
||||
*/
|
||||
static void my_app_run(lv_app_inst_t * app, void * conf)
|
||||
{
|
||||
/*Initialize the application*/
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
app_data->com_type = LV_APP_COM_TYPE_CHAR;
|
||||
app_data->last_sender = NULL;
|
||||
memset(app_data->txt, 0, sizeof(app_data->txt));
|
||||
}
|
||||
|
||||
/**
|
||||
* Close a running application.
|
||||
* Close the Window and the Shortcut too if opened.
|
||||
* Free all the allocated memory by this application.
|
||||
* @param app pointer to an application
|
||||
*/
|
||||
static void my_app_close(lv_app_inst_t * app)
|
||||
{
|
||||
/*No dynamically allocated data in 'my_app_data'*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the data have been sent to this applicationstring
|
||||
* @param app_send pointer to an application which sent the message
|
||||
* @param app_rec pointer to an application which is receiving the message
|
||||
* @param type type of data from 'lv_app_com_type_t' enum
|
||||
* @param data pointer to the sent data
|
||||
* @param size length of 'data' in bytes
|
||||
*/
|
||||
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
|
||||
lv_app_com_type_t type , const void * data, uint32_t size)
|
||||
{
|
||||
my_app_data_t * app_data = app_rec->app_data;
|
||||
|
||||
/*Add the recevied data if the type is matches*/
|
||||
if(type == app_data->com_type) {
|
||||
|
||||
/*Insert the name of the sender application if it is not the last*/
|
||||
if(app_data->last_sender != app_send) {
|
||||
if(app_data->txt[0] != '\0') add_data(app_rec, "\n", 1);
|
||||
add_data(app_rec, "@", 1);
|
||||
add_data(app_rec, app_send->name, strlen(app_send->name));
|
||||
add_data(app_rec, "\n", 1);
|
||||
}
|
||||
add_data(app_rec, data, size);
|
||||
}
|
||||
|
||||
app_data->last_sender = app_send;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a shortcut for an application
|
||||
* @param app pointer to an application
|
||||
* @param sc pointer to an object where the application
|
||||
* can create content of the shortcut
|
||||
*/
|
||||
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc)
|
||||
{
|
||||
my_sc_data_t * sc_data = app->sc_data;
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
|
||||
/*Create a dark background*/
|
||||
lv_obj_t * txt_bg = lv_obj_create(sc, NULL);
|
||||
lv_obj_set_size(txt_bg, 7 * LV_APP_SC_WIDTH / 8 , app->sc->cords.y2 - app->sc_title->cords.y2 - 10 * LV_DOWNSCALE);
|
||||
lv_obj_set_style(txt_bg, &sc_txt_bgs);
|
||||
lv_obj_align(txt_bg, app->sc_title, LV_ALIGN_OUT_BOTTOM_MID, 0, 3 * LV_DOWNSCALE);
|
||||
lv_obj_set_click(txt_bg, false);
|
||||
|
||||
/*Add a text with the text of the terminal*/
|
||||
sc_data->label = lv_label_create(txt_bg, NULL);
|
||||
lv_obj_set_style(sc_data->label, &sc_txts);
|
||||
lv_label_set_long_mode(sc_data->label, LV_LABEL_LONG_BREAK);
|
||||
lv_obj_set_width(sc_data->label, lv_obj_get_width(txt_bg) - LV_APP_SC_WIDTH / 8);
|
||||
lv_label_set_text_static(sc_data->label, app_data->txt);
|
||||
lv_obj_align(sc_data->label, txt_bg, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the shortcut of an application
|
||||
* @param app pointer to an application
|
||||
*/
|
||||
static void my_sc_close(lv_app_inst_t * app)
|
||||
{
|
||||
/*No dynamically allocated data in 'my_sc_data'*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the application in a window
|
||||
* @param app pointer to an application
|
||||
* @param win pointer to a window object where
|
||||
* the application can create content
|
||||
*/
|
||||
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win)
|
||||
{
|
||||
my_win_data_t * win_data = app->win_data;
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
lv_app_style_t * app_style = lv_app_style_get();
|
||||
|
||||
cord_t opad = app_style->win_style.pages.scrl_rects.opad;
|
||||
|
||||
/*Create a label for the text of the terminal*/
|
||||
win_data->label = lv_label_create(win, NULL);
|
||||
lv_label_set_long_mode(win_data->label, LV_LABEL_LONG_BREAK);
|
||||
lv_obj_set_width(win_data->label, LV_HOR_RES -
|
||||
2 * (app_style->win_style.pages.bg_rects.hpad +
|
||||
app_style->win_style.pages.scrl_rects.hpad));
|
||||
|
||||
lv_obj_set_style(win_data->label, &app_style->win_txt_style);
|
||||
lv_label_set_text_static(win_data->label, app_data->txt); /*Use the app. data text directly*/
|
||||
|
||||
/*Create a text area. Text can be added to the terminal from here by app. keyboard.*/
|
||||
win_data->ta = lv_ta_create(win, NULL);
|
||||
lv_obj_set_size(win_data->ta, LV_HOR_RES / 2, LV_VER_RES / 4);
|
||||
lv_obj_set_free_p(win_data->ta, app);
|
||||
lv_page_set_rel_action(win_data->ta, win_ta_rel_action);
|
||||
lv_ta_set_text(win_data->ta, "");
|
||||
lv_obj_set_style(win_data->ta, lv_tas_get(LV_TAS_DEF, NULL));
|
||||
lv_obj_align(win_data->ta, win_data->label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, opad);
|
||||
|
||||
|
||||
/*Create a button to set the communication type (char, integer etc.)*/
|
||||
win_data->com_type_btn = lv_btn_create(win, NULL);
|
||||
lv_rect_set_fit(win_data->com_type_btn, true, true);
|
||||
lv_obj_set_free_p(win_data->com_type_btn, app);
|
||||
lv_btn_set_rel_action(win_data->com_type_btn, win_comch_rel_action);
|
||||
lv_obj_t * btn_label = lv_label_create(win_data->com_type_btn, NULL);
|
||||
lv_obj_set_style(btn_label, lv_labels_get(LV_LABELS_BTN, NULL));
|
||||
lv_label_set_text(btn_label, com_type_txt[app_data->com_type]);
|
||||
lv_obj_align(win_data->com_type_btn, win_data->ta, LV_ALIGN_OUT_RIGHT_TOP, opad, 0);
|
||||
|
||||
|
||||
/*Create a clear button*/
|
||||
win_data->clear_btn = lv_btn_create(win, win_data->com_type_btn);
|
||||
lv_btn_set_rel_action(win_data->clear_btn, win_clear_rel_action);
|
||||
btn_label = lv_label_create(win_data->clear_btn, NULL);
|
||||
lv_obj_set_style(btn_label, lv_labels_get(LV_LABELS_BTN, NULL));
|
||||
lv_label_set_text(btn_label, "Clear");
|
||||
lv_obj_align(win_data->clear_btn, win_data->com_type_btn, LV_ALIGN_OUT_RIGHT_TOP, opad, 0);
|
||||
|
||||
/*Align the window to see the text area on the bottom*/
|
||||
lv_obj_align(lv_page_get_scrl(app->win), NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0,
|
||||
- app_style->win_style.pages.scrl_rects.vpad);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the window of an application
|
||||
* @param app pointer to an application
|
||||
*/
|
||||
static void my_win_close(lv_app_inst_t * app)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*--------------------
|
||||
* OTHER FUNCTIONS
|
||||
---------------------*/
|
||||
|
||||
/**
|
||||
* Called when the Text area is released to open the app. keybard
|
||||
* @param ta pointer to the text area
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_OK because the text area is not deleted
|
||||
*/
|
||||
static lv_action_res_t win_ta_rel_action(lv_obj_t * ta, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_app_kb_open(ta, LV_APP_KB_MODE_TXT, NULL, win_ta_kb_ok_action);
|
||||
|
||||
return LV_ACTION_RES_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the communication type button is released to change the type
|
||||
* @param btn pointer to the comm. type button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_OK because the button is not deleted
|
||||
*/
|
||||
static lv_action_res_t win_comch_rel_action(lv_obj_t * btn, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(btn);
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
my_win_data_t * win_data = app->win_data;
|
||||
|
||||
if(app_data->com_type == LV_APP_COM_TYPE_CHAR) app_data->com_type = LV_APP_COM_TYPE_LOG;
|
||||
else if(app_data->com_type == LV_APP_COM_TYPE_LOG) app_data->com_type = LV_APP_COM_TYPE_INT;
|
||||
else if(app_data->com_type == LV_APP_COM_TYPE_INT) app_data->com_type = LV_APP_COM_TYPE_INV;
|
||||
else app_data->com_type = LV_APP_COM_TYPE_CHAR;
|
||||
|
||||
lv_label_set_text(lv_obj_get_child(win_data->com_type_btn, NULL), com_type_txt[app_data->com_type]);
|
||||
return LV_ACTION_RES_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the Clear button is released to clear the ex od the terminal
|
||||
* @param btn pointer to the clear button
|
||||
* @param dispi pointer to the caller display input
|
||||
* @return LV_ACTION_RES_OK because the button is not deleted
|
||||
*/
|
||||
static lv_action_res_t win_clear_rel_action(lv_obj_t * btn, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(btn);
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
my_win_data_t * win_data = app->win_data;
|
||||
my_sc_data_t * sc_data = app->sc_data;
|
||||
|
||||
app_data->txt[0] = '\0';
|
||||
|
||||
if(sc_data != NULL) {
|
||||
lv_label_set_text_static(sc_data->label, app_data->txt);
|
||||
lv_obj_align(sc_data->label, NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
|
||||
}
|
||||
|
||||
if(win_data != NULL) {
|
||||
lv_app_style_t * app_style =lv_app_style_get();
|
||||
cord_t opad = app_style->win_style.pages.scrl_rects.opad;
|
||||
lv_label_set_text_static(win_data->label, app_data->txt);
|
||||
lv_obj_align(win_data->ta, win_data->label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, opad);
|
||||
lv_obj_align(win_data->com_type_btn, win_data->ta, LV_ALIGN_OUT_RIGHT_TOP, opad, 0);
|
||||
lv_obj_align(win_data->clear_btn, win_data->com_type_btn, LV_ALIGN_OUT_RIGHT_TOP, opad, 0);
|
||||
lv_obj_align(lv_page_get_scrl(app->win), NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0,
|
||||
- app_style->win_style.pages.scrl_rects.vpad);
|
||||
}
|
||||
|
||||
return LV_ACTION_RES_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the 'Ok' button of the keyboard in the window
|
||||
* is pressed to write to the Terminal
|
||||
* @param ta pointer to the Text area in the window
|
||||
*/
|
||||
static void win_ta_kb_ok_action(lv_obj_t * ta)
|
||||
{
|
||||
lv_app_inst_t * app = lv_obj_get_free_p(ta);
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
const char * ta_txt = lv_ta_get_txt(ta);
|
||||
uint32_t ta_txt_len = strlen(ta_txt);
|
||||
if(app_data->txt[0] != '\0') add_data(app, "\n", 1);
|
||||
add_data(app, ">", 1);
|
||||
add_data(app, ta_txt, ta_txt_len);
|
||||
|
||||
lv_app_com_send(app, app_data->com_type, ta_txt, ta_txt_len);
|
||||
|
||||
lv_ta_set_text(ta, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Add data to the terminal
|
||||
* @param app pointer to a Terminal application
|
||||
* @param data pointer to the data
|
||||
* @param data_len length of 'data' in bytes
|
||||
*/
|
||||
static void add_data(lv_app_inst_t * app, const void * data, uint16_t data_len)
|
||||
{
|
||||
my_app_data_t * app_data = app->app_data;
|
||||
uint16_t old_len = strlen(app_data->txt);
|
||||
const char * txt = data;
|
||||
|
||||
/*IF the data is longer then the terminal ax size show the last part of data*/
|
||||
if(data_len > LV_APP_TERMINAL_LENGTH) {
|
||||
txt += (data_len - LV_APP_TERMINAL_LENGTH);
|
||||
data_len = LV_APP_TERMINAL_LENGTH;
|
||||
old_len = 0;
|
||||
}
|
||||
/*If the text become too long 'forget' the oldest lines*/
|
||||
else if(old_len + data_len > LV_APP_TERMINAL_LENGTH) {
|
||||
uint16_t new_start;
|
||||
for(new_start = 0; new_start < old_len; new_start++) {
|
||||
if(app_data->txt[new_start] == '\n') {
|
||||
/*If there is enough space break*/
|
||||
if(new_start >= data_len) {
|
||||
/*Ignore line breaks*/
|
||||
while(app_data->txt[new_start] == '\n' || app_data->txt[new_start] == '\r') new_start++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* If it wasn't able to make enough space on line breaks
|
||||
* simply forget the oldest characters*/
|
||||
if(new_start == old_len) {
|
||||
new_start = old_len - (LV_APP_TERMINAL_LENGTH - data_len);
|
||||
}
|
||||
/*Move the remaining text to the beginning*/
|
||||
uint16_t j;
|
||||
for(j = new_start; j < old_len; j++) {
|
||||
app_data->txt[j - new_start] = app_data->txt[j];
|
||||
}
|
||||
old_len = old_len - new_start;
|
||||
app_data->txt[old_len] = '\0';
|
||||
|
||||
}
|
||||
|
||||
memcpy(&app_data->txt[old_len], txt, data_len);
|
||||
app_data->txt[old_len + data_len] = '\0';
|
||||
|
||||
my_win_data_t * win_data = app->win_data;
|
||||
my_sc_data_t * sc_data = app->sc_data;
|
||||
lv_app_style_t * app_style = lv_app_style_get();
|
||||
|
||||
if(win_data != NULL) {
|
||||
cord_t opad = app_style->win_style.pages.scrl_rects.opad;
|
||||
lv_label_set_text_static(win_data->label, app_data->txt);
|
||||
lv_obj_align(win_data->ta, win_data->label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, opad);
|
||||
lv_obj_align(win_data->com_type_btn, win_data->ta, LV_ALIGN_OUT_RIGHT_TOP, opad, 0);
|
||||
lv_obj_align(win_data->clear_btn, win_data->com_type_btn, LV_ALIGN_OUT_RIGHT_TOP, opad, 0);
|
||||
lv_obj_align(lv_page_get_scrl(app->win), NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0,
|
||||
- app_style->win_style.pages.scrl_rects.vpad);
|
||||
}
|
||||
|
||||
/*Set the last line on the shortcut*/
|
||||
if(sc_data != NULL) {
|
||||
lv_label_set_text_static(sc_data->label, app_data->txt);
|
||||
lv_obj_align(sc_data->label, NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_TERMINAL != 0*/
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* @file lv_app_terminal.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_APP_TERMINAL_H
|
||||
#define LV_APP_TERMINAL_H
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lvgl/lv_app/lv_app.h"
|
||||
|
||||
#if LV_APP_ENABLE != 0 && USE_LV_APP_TERMINAL != 0
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
typedef struct
|
||||
{
|
||||
|
||||
}lv_app_terminal_conf_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
const lv_app_dsc_t * lv_app_terminal_init(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_TERMINAL != 0*/
|
||||
|
||||
#endif /* LV_APP_TERMINAL_H */
|
||||
217
lv_conf_temp.h
217
lv_conf_temp.h
@@ -1,217 +0,0 @@
|
||||
/**
|
||||
* @file lv_conf.h
|
||||
*
|
||||
*/
|
||||
|
||||
#if 0 /*Remove this to enable the content (Delete the last #endif too!)*/
|
||||
|
||||
#ifndef LV_CONF_H
|
||||
#define LV_CONF_H
|
||||
|
||||
/*===================
|
||||
Graphical settings
|
||||
*=====================*/
|
||||
|
||||
/* Horizontal and vertical resolution of the library.
|
||||
* Screen resolution multiplied by LV_DOWN_SCALE*/
|
||||
#define LV_HOR_RES (480 * LV_DOWNSCALE)
|
||||
#define LV_VER_RES (320 * LV_DOWNSCALE)
|
||||
|
||||
/* Buffered rendering: >= LV_DOWNSCALE * LV_HOR_RES or 0 to disable buffering*/
|
||||
|
||||
#define LV_VDB_SIZE (LV_HOR_RES * (LV_VER_RES / 20))
|
||||
|
||||
/* Enable antialaiassing
|
||||
* If enabled everything will half-sized
|
||||
* Use LV_DOWNSCALE to compensate
|
||||
* the down scaling effect of antialiassing*/
|
||||
#define LV_ANTIALIAS 1
|
||||
/*Set the downscaling value*/
|
||||
#if LV_ANTIALIAS == 0
|
||||
#define LV_DOWNSCALE 1
|
||||
#else
|
||||
#define LV_DOWNSCALE 2
|
||||
#endif
|
||||
|
||||
#define LV_REFR_PERIOD 40 /*Screen refresh period in milliseconds*/
|
||||
#define LV_INV_FIFO_SIZE 32 /*The average number of objects on a screen */
|
||||
|
||||
/*=================
|
||||
Misc. setting
|
||||
*=================*/
|
||||
/*Display Input settings*/
|
||||
#define LV_DISPI_READ_PERIOD 50 /*Input device read period milliseconds*/
|
||||
#define LV_DISPI_TP_MARKER 0 /*Mark the pressed points*/
|
||||
#define LV_DISPI_DRAG_LIMIT 10 /*Drag threshold in pixels */
|
||||
#define LV_DISPI_DRAG_THROW 20 /*Drag throw slow-down in [%]. Greater value means faster slow-down */
|
||||
#define LV_DISPI_LONG_PRESS_TIME 400 /*Long press time in milliseconds*/
|
||||
#define LV_DISPI_LONG_PRESS_REP_TIME 100 /*Repeated trigger period in long press [ms] */
|
||||
|
||||
/*Coordinates*/
|
||||
#define LV_CORD_TYPE int16_t /*Coordinate type*/
|
||||
#define LV_CORD_MAX (32000)
|
||||
#define LV_CORD_MIN (-32000)
|
||||
|
||||
/*Fonts and texts*/
|
||||
#define USE_FONT_DEJAVU_8 1
|
||||
#define USE_FONT_DEJAVU_10 1
|
||||
#define USE_FONT_DEJAVU_14 1
|
||||
#define USE_FONT_DEJAVU_20 1
|
||||
#define USE_FONT_DEJAVU_30 1
|
||||
#define USE_FONT_DEJAVU_40 1
|
||||
#define USE_FONT_DEJAVU_60 1
|
||||
#define USE_FONT_DEJAVU_80 1
|
||||
#define LV_FONT_DEFAULT FONT_DEJAVU_30 /*Always set a default font*/
|
||||
#define LV_TXT_BREAK_CHARS " ,.;-" /*Can break texts on these chars*/
|
||||
|
||||
/*lv_obj (base object) settings*/
|
||||
#define LV_OBJ_FREE_P 1 /*Enable the free pointer attribute*/
|
||||
#define LV_OBJ_DEF_SCR_COLOR COLOR_SILVER /*Default screen color*/
|
||||
|
||||
/*Others*/
|
||||
#define LV_COLOR_TRANSP COLOR_LIME
|
||||
|
||||
/*==================
|
||||
* LV OBJ X USAGE
|
||||
* ================*/
|
||||
|
||||
/*Rectangle (dependencies: -*/
|
||||
#define USE_LV_RECT 1
|
||||
|
||||
/*Label (dependencies: -*/
|
||||
#define USE_LV_LABEL 1
|
||||
#if USE_LV_LABEL != 0
|
||||
#define LV_LABEL_SCROLL_SPEED (25 * LV_DOWNSCALE) /*Hor, or ver. scroll speed (px/sec) in 'LV_LABEL_LONG_SCROLL' mode*/
|
||||
#define LV_LABEL_SCROLL_SPEED_VER (10 * LV_DOWNSCALE) /*Ver. scroll speed if hor. scroll is applied too*/
|
||||
#define LV_LABEL_SCROLL_PLAYBACK_PAUSE 500 /*Wait before the scroll turns back in ms*/
|
||||
#define LV_LABEL_SCROLL_REPEAT_PAUSE 500 /*Wait before the scroll begins again in ms*/
|
||||
#endif
|
||||
|
||||
/*Button (dependencies: lv_rect*/
|
||||
#define USE_LV_BTN 1
|
||||
|
||||
/*Line (dependencies: -*/
|
||||
#define USE_LV_LINE 1
|
||||
|
||||
/*Image (dependencies: from misc: FSINT, UFS)*/
|
||||
#define USE_LV_IMG 1
|
||||
#if USE_LV_IMG != 0
|
||||
//#define LV_IMG_DEF_WALLPAPER img_wallpaper_var /*Comment this line to NOT use wallpaper*/
|
||||
#endif /*USE_LV_IMG*/
|
||||
|
||||
/*Page (dependencies: lv_rect)*/
|
||||
#define USE_LV_PAGE 1
|
||||
#if USE_LV_PAGE != 0
|
||||
#define LV_PAGE_ANIM_FOCUS_TIME 300 /*List focus animation time [ms] (0: turn off the animation)*/
|
||||
#endif
|
||||
|
||||
/*List (dependencies: lv_btn, lv_label, lv_img)*/
|
||||
#define USE_LV_LIST 1
|
||||
|
||||
/*Check box (dependencies: lv_btn, lv_label)*/
|
||||
#define USE_LV_CB 1
|
||||
|
||||
/*Progress bar (dependencies: lv_rect, lv_label)*/
|
||||
#define USE_LV_PB 1
|
||||
|
||||
/*LED (dependencies: lv_rect)*/
|
||||
#define USE_LV_LED 1
|
||||
|
||||
/*Chart (dependencies: lv_rect, lv_line)*/
|
||||
#define USE_LV_CHART 1
|
||||
|
||||
/*Text area (dependencies: lv_label, lv_page)*/
|
||||
#define USE_LV_TA 1
|
||||
#if USE_LV_TA != 0
|
||||
#define LV_TA_MAX_LENGTH 256
|
||||
#define LV_TA_CUR_BLINK_TIME 400 /*ms*/
|
||||
#endif
|
||||
|
||||
/*Button matrix (dependencies: lv_rect, lv_label)*/
|
||||
#define USE_LV_BTNM 1
|
||||
|
||||
/*Window (dependencies: lv_rect, lv_btn, lv_label, lv_img, lv_page)*/
|
||||
#define USE_LV_WIN 1
|
||||
|
||||
/*Message box (dependencies: lv_rect, lv_btn, lv_label)*/
|
||||
#define USE_LV_MBOX 1
|
||||
|
||||
/*==================
|
||||
* LV APP SETTINGS
|
||||
* =================*/
|
||||
|
||||
/*Enable the application system*/
|
||||
#define LV_APP_ENABLE 1
|
||||
|
||||
#if LV_APP_ENABLE != 0
|
||||
#define LV_APP_SC_WIDTH (LV_HOR_RES / 4) /*Shortcut width*/
|
||||
#define LV_APP_SC_HEIGHT (LV_VER_RES / 3) /*Shortcut height*/
|
||||
#define LV_APP_FONT_SMALL FONT_DEJAVU_20
|
||||
#define LV_APP_FONT_MEDIUM LV_FONT_DEFAULT
|
||||
#define LV_APP_FONT_LARGE FONT_DEJAVU_40
|
||||
|
||||
/* Internal icons:
|
||||
* 0: Do not use internal icons (img_close, img_add etc. icons have to be provided)
|
||||
* 1: Use simple sized icons
|
||||
* 2: Use double sized icons*/
|
||||
#define LV_APP_USE_INTERNAL_ICONS 2
|
||||
|
||||
/*Enable or disable the internal icons individually*/
|
||||
#if LV_APP_USE_INTERNAL_ICONS != 0
|
||||
#define USE_IMG_CLOSE 1
|
||||
#define USE_IMG_DOWN 1
|
||||
#define USE_IMG_DRIVER 1
|
||||
#define USE_IMG_FILE 1
|
||||
#define USE_IMG_FOLDER 1
|
||||
#define USE_IMG_LEFT 1
|
||||
#define USE_IMG_OK 1
|
||||
#define USE_IMG_RIGHT 1
|
||||
#define USE_IMG_UP 1
|
||||
#endif
|
||||
|
||||
/*Animation settings*/
|
||||
#define LV_APP_EFFECT_OPA 1 /*Enable the opacity in the application style (can be modified)*/
|
||||
#define LV_APP_EFFECT_ANIM 1 /*Enable the animation of the applications*/
|
||||
#define LV_APP_EFFECT_OPA_ANIM 1 /*Enable the using opacity in the application animations*/
|
||||
#define LV_APP_ANIM_WIN 200 /*Animation time in milliseconds (0: turn off animation)*/
|
||||
#define LV_APP_ANIM_SC 200 /*Animation time in milliseconds (0: turn off animation)*/
|
||||
#define LV_APP_ANIM_NOTICE 300 /*How fast animate out a notice [ms]*/
|
||||
|
||||
/* App. utility settings */
|
||||
#define LV_APP_NOTICE_SHOW_TIME 4000 /*Notices will be shown for this time [ms]*/
|
||||
#define LV_APP_NOTICE_MAX_LEN 256 /*Max. number of characters on a notice*/
|
||||
/*==================
|
||||
* LV APP X USAGE
|
||||
* ================*/
|
||||
|
||||
#define USE_LV_APP_EXAMPLE 1
|
||||
|
||||
#define USE_LV_APP_SYSMON 1
|
||||
#if USE_LV_APP_SYSMON != 0
|
||||
#define LV_APP_SYSMON_REFR_TIME 500 /*[ms]*/
|
||||
#define LV_APP_SYSMON_PNUM 64
|
||||
#define LV_APP_SYSMON_MEM_WARN (4 * 1024)
|
||||
#define LV_APP_SYSMON_FRAG_WARN (70) /*[%]*/
|
||||
#define LV_APP_SYSMON_DEFRAG_PERIOD (5000) /*[%]*/
|
||||
#endif /*USE_LV_APP_SYSMON != 0*/
|
||||
|
||||
#define USE_LV_APP_TERMINAL 1
|
||||
#if USE_LV_APP_TERMINAL != 0
|
||||
#define LV_APP_TERMINAL_LENGTH 512 /*Memory of the terminal*/
|
||||
#endif /*USE_LV_APP_TERMINAL != 0*/
|
||||
|
||||
#define USE_LV_APP_FILES 1
|
||||
#if USE_LV_APP_FILES != 0
|
||||
#define LV_APP_FILES_PAGE_SIZE 8 /*Max. number of files/folder on a page*/
|
||||
#define LV_APP_FILES_FN_MAX_LEN 128
|
||||
#define LV_APP_FILES_PATH_MAX_LEN 256
|
||||
#define LV_APP_FILES_CHUNK_DEF_SIZE 256
|
||||
#define LV_APP_FILES_CHUNK_DEF_TIME 100
|
||||
#define LV_APP_FILES_CHUNK_MAX_SIZE 1024
|
||||
#endif /*USE_LV_APP_FILES != 0*/
|
||||
#endif /*LV_APP_ENABLE != 0*/
|
||||
|
||||
#endif /*LV_CONF_H*/
|
||||
|
||||
#endif /*Remove this to enable the content*/
|
||||
|
||||
257
lv_conf_templ.h
Normal file
257
lv_conf_templ.h
Normal file
@@ -0,0 +1,257 @@
|
||||
/**
|
||||
* @file lv_conf.h
|
||||
*
|
||||
*/
|
||||
|
||||
#if 0 /*Remove this to enable the content (Delete the last #endif too!)*/
|
||||
|
||||
#ifndef LV_CONF_H
|
||||
#define LV_CONF_H
|
||||
|
||||
/*----------------
|
||||
* Dynamic memory
|
||||
*----------------*/
|
||||
|
||||
/* Memory size which will be used by the library
|
||||
* to store the graphical objects and other data */
|
||||
#define LV_MEM_CUSTOM 0 /*1: use custom malloc/free, 0: use the built-in lv_mem_alloc/lv_mem_free*/
|
||||
#if LV_MEM_CUSTOM == 0
|
||||
#define LV_MEM_SIZE (32U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
|
||||
#define LV_MEM_ATTR /*Complier prefix for big array declaration*/
|
||||
#define LV_MEM_AUTO_DEFRAG 1 /*Automatically defrag on free*/
|
||||
#else /*LV_MEM_CUSTOM*/
|
||||
#define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
|
||||
#define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
|
||||
#define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
|
||||
#endif /*LV_MEM_CUSTOM*/
|
||||
|
||||
/*===================
|
||||
Graphical settings
|
||||
*===================*/
|
||||
|
||||
/* Horizontal and vertical resolution of the library.*/
|
||||
#define LV_HOR_RES (320)
|
||||
#define LV_VER_RES (240)
|
||||
#define LV_DPI 100
|
||||
|
||||
/* Size of VDB (Virtual Display Buffer: the internal graphics buffer).
|
||||
* Required for buffered drawing, opacity and anti-aliasing
|
||||
* VDB makes the double buffering, you don't need to deal with it!
|
||||
* Typical size: ~1/10 screen */
|
||||
#define LV_VDB_SIZE (20 * LV_HOR_RES) /*Size of VDB in pixel count (1/10 screen size is good for first)*/
|
||||
#define LV_VDB_ADR 0 /*Place VDB to a specific address (e.g. in external RAM) (0: allocate automatically into RAM)*/
|
||||
|
||||
/* Use two Virtual Display buffers (VDB) parallelize rendering and flushing (optional)
|
||||
* The flushing should use DMA to write the frame buffer in the background*/
|
||||
#define LV_VDB_DOUBLE 0 /*1: Enable the use of 2 VDBs*/
|
||||
#define LV_VDB2_ADR 0 /*Place VDB2 to a specific address (e.g. in external RAM) (0: allocate automatically into RAM)*/
|
||||
|
||||
/* Enable anti-aliasing (lines, and radiuses will be smoothed) */
|
||||
#define LV_ANTIALIAS 1 /*1: Enable anti-aliasing*/
|
||||
|
||||
/*Screen refresh settings*/
|
||||
#define LV_REFR_PERIOD 50 /*Screen refresh period in milliseconds*/
|
||||
#define LV_INV_FIFO_SIZE 32 /*The average count of objects on a screen */
|
||||
|
||||
/*=================
|
||||
Misc. setting
|
||||
*=================*/
|
||||
|
||||
/*Input device settings*/
|
||||
#define LV_INDEV_READ_PERIOD 50 /*Input device read period in milliseconds*/
|
||||
#define LV_INDEV_POINT_MARKER 0 /*Mark the pressed points (required: USE_LV_REAL_DRAW = 1)*/
|
||||
#define LV_INDEV_DRAG_LIMIT 10 /*Drag threshold in pixels */
|
||||
#define LV_INDEV_DRAG_THROW 20 /*Drag throw slow-down in [%]. Greater value means faster slow-down */
|
||||
#define LV_INDEV_LONG_PRESS_TIME 400 /*Long press time in milliseconds*/
|
||||
#define LV_INDEV_LONG_PRESS_REP_TIME 100 /*Repeated trigger period in long press [ms] */
|
||||
|
||||
/*Color settings*/
|
||||
#define LV_COLOR_DEPTH 16 /*Color depth: 1/8/16/24*/
|
||||
#define LV_COLOR_TRANSP LV_COLOR_LIME /*Images pixels with this color will not be drawn (with chroma keying)*/
|
||||
|
||||
/*Text settings*/
|
||||
#define LV_TXT_UTF8 1 /*Enable UTF-8 coded Unicode character usage */
|
||||
#define LV_TXT_BREAK_CHARS " ,.;:-_" /*Can break texts on these chars*/
|
||||
|
||||
/*Graphics feature usage*/
|
||||
#define USE_LV_ANIMATION 1 /*1: Enable all animations*/
|
||||
#define USE_LV_SHADOW 1 /*1: Enable shadows*/
|
||||
#define USE_LV_GROUP 1 /*1: Enable object groups (for keyboards)*/
|
||||
#define USE_LV_GPU 1 /*1: Enable GPU interface*/
|
||||
#define USE_LV_REAL_DRAW 1 /*1: Enable function which draw directly to the frame buffer instead of VDB (required if LV_VDB_SIZE = 0)*/
|
||||
#define USE_LV_FILESYSTEM 1 /*1: Enable file system (required by images*/
|
||||
|
||||
/*Compiler settings*/
|
||||
#define LV_ATTRIBUTE_TICK_INC /* Define a custom attribute to `lv_tick_inc` function */
|
||||
#define LV_ATTRIBUTE_TASK_HANDLER /* Define a custom attribute to `lv_task_handler` function */
|
||||
#define LV_COMPILER_VLA_SUPPORTED 1 /* 1: Variable length array is supported*/
|
||||
|
||||
/*================
|
||||
* THEME USAGE
|
||||
*================*/
|
||||
#define USE_LV_THEME_TEMPL 0 /*Just for test*/
|
||||
#define USE_LV_THEME_DEFAULT 0 /*Built mainly from the built-in styles. Consumes very few RAM*/
|
||||
#define USE_LV_THEME_ALIEN 0 /*Dark futuristic theme*/
|
||||
#define USE_LV_THEME_NIGHT 0 /*Dark elegant theme*/
|
||||
#define USE_LV_THEME_MONO 0 /*Mono color theme for monochrome displays*/
|
||||
#define USE_LV_THEME_MATERIAL 0 /*Flat theme with bold colors and light shadows*/
|
||||
#define USE_LV_THEME_ZEN 0 /*Peaceful, mainly light theme */
|
||||
|
||||
/*==================
|
||||
* FONT USAGE
|
||||
*===================*/
|
||||
|
||||
/* More info about fonts: https://littlevgl.com/basics#fonts
|
||||
* To enable a built-in font use 1,2,4 or 8 values
|
||||
* which will determine the bit-per-pixel */
|
||||
#define LV_FONT_DEFAULT &lv_font_dejavu_20 /*Always set a default font from the built-in fonts*/
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_10 0
|
||||
#define USE_LV_FONT_DEJAVU_10_LATIN_SUP 0
|
||||
#define USE_LV_FONT_DEJAVU_10_CYRILLIC 0
|
||||
#define USE_LV_FONT_SYMBOL_10 0
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_20 4
|
||||
#define USE_LV_FONT_DEJAVU_20_LATIN_SUP 0
|
||||
#define USE_LV_FONT_DEJAVU_20_CYRILLIC 0
|
||||
#define USE_LV_FONT_SYMBOL_20 4
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_30 0
|
||||
#define USE_LV_FONT_DEJAVU_30_LATIN_SUP 0
|
||||
#define USE_LV_FONT_DEJAVU_30_CYRILLIC 0
|
||||
#define USE_LV_FONT_SYMBOL_30 0
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_40 0
|
||||
#define USE_LV_FONT_DEJAVU_40_LATIN_SUP 0
|
||||
#define USE_LV_FONT_DEJAVU_40_CYRILLIC 0
|
||||
#define USE_LV_FONT_SYMBOL_40 0
|
||||
|
||||
/*===================
|
||||
* LV_OBJ SETTINGS
|
||||
*==================*/
|
||||
#define LV_OBJ_FREE_NUM_TYPE uint32_t /*Type of free number attribute (comment out disable free number)*/
|
||||
#define LV_OBJ_FREE_PTR 1 /*Enable the free pointer attribute*/
|
||||
|
||||
/*==================
|
||||
* LV OBJ X USAGE
|
||||
*================*/
|
||||
/*
|
||||
* Documentation of the object types: https://littlevgl.com/object-types
|
||||
*/
|
||||
|
||||
/*****************
|
||||
* Simple object
|
||||
*****************/
|
||||
|
||||
/*Label (dependencies: -*/
|
||||
#define USE_LV_LABEL 1
|
||||
#if USE_LV_LABEL != 0
|
||||
#define LV_LABEL_SCROLL_SPEED 25 /*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_SCROLL/ROLL' mode*/
|
||||
#endif
|
||||
|
||||
/*Image (dependencies: lv_label*/
|
||||
#define USE_LV_IMG 1
|
||||
|
||||
/*Line (dependencies: -*/
|
||||
#define USE_LV_LINE 1
|
||||
|
||||
/*******************
|
||||
* Container objects
|
||||
*******************/
|
||||
|
||||
/*Container (dependencies: -*/
|
||||
#define USE_LV_CONT 1
|
||||
|
||||
/*Page (dependencies: lv_cont)*/
|
||||
#define USE_LV_PAGE 1
|
||||
|
||||
/*Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page)*/
|
||||
#define USE_LV_WIN 1
|
||||
|
||||
/*Tab (dependencies: lv_page, lv_btnm)*/
|
||||
#define USE_LV_TABVIEW 1
|
||||
#if USE_LV_TABVIEW != 0
|
||||
#define LV_TABVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/
|
||||
#endif
|
||||
|
||||
/*************************
|
||||
* Data visualizer objects
|
||||
*************************/
|
||||
|
||||
/*Bar (dependencies: -)*/
|
||||
#define USE_LV_BAR 1
|
||||
|
||||
/*Line meter (dependencies: *;)*/
|
||||
#define USE_LV_LMETER 1
|
||||
|
||||
/*Gauge (dependencies:bar, lmeter)*/
|
||||
#define USE_LV_GAUGE 1
|
||||
|
||||
/*Chart (dependencies: -)*/
|
||||
#define USE_LV_CHART 1
|
||||
|
||||
/*LED (dependencies: -)*/
|
||||
#define USE_LV_LED 1
|
||||
|
||||
/*Message box (dependencies: lv_rect, lv_btnm, lv_label)*/
|
||||
#define USE_LV_MBOX 1
|
||||
|
||||
/*Text area (dependencies: lv_label, lv_page)*/
|
||||
#define USE_LV_TA 1
|
||||
#if USE_LV_TA != 0
|
||||
#define LV_TA_CURSOR_BLINK_TIME 400 /*ms*/
|
||||
#define LV_TA_PWD_SHOW_TIME 1500 /*ms*/
|
||||
#endif
|
||||
|
||||
/*************************
|
||||
* User input objects
|
||||
*************************/
|
||||
|
||||
/*Button (dependencies: lv_cont*/
|
||||
#define USE_LV_BTN 1
|
||||
|
||||
/*Button matrix (dependencies: -)*/
|
||||
#define USE_LV_BTNM 1
|
||||
|
||||
/*Keyboard (dependencies: lv_btnm)*/
|
||||
#define USE_LV_KB 1
|
||||
|
||||
/*Check box (dependencies: lv_btn, lv_label)*/
|
||||
#define USE_LV_CB 1
|
||||
|
||||
/*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons ))*/
|
||||
#define USE_LV_LIST 1
|
||||
#if USE_LV_LIST != 0
|
||||
#define LV_LIST_FOCUS_TIME 100 /*Default animation time of focusing to a list element [ms] (0: no animation) */
|
||||
#endif
|
||||
|
||||
/*Drop down list (dependencies: lv_page, lv_label)*/
|
||||
#define USE_LV_DDLIST 1
|
||||
#if USE_LV_DDLIST != 0
|
||||
#define LV_DDLIST_ANIM_TIME 200 /*Open and close default animation time [ms] (0: no animation)*/
|
||||
#endif
|
||||
|
||||
/*Roller (dependencies: lv_ddlist)*/
|
||||
#define USE_LV_ROLLER 1
|
||||
#if USE_LV_ROLLER != 0
|
||||
#define LV_ROLLER_ANIM_TIME 200 /*Focus animation time [ms] (0: no animation)*/
|
||||
#endif
|
||||
|
||||
/*Slider (dependencies: lv_bar)*/
|
||||
#define USE_LV_SLIDER 1
|
||||
|
||||
/*Switch (dependencies: lv_slider)*/
|
||||
#define USE_LV_SW 1
|
||||
|
||||
/*************************
|
||||
* Non-user section
|
||||
*************************/
|
||||
#ifdef _MSC_VER /* Disable warnings for Visual Studio*/
|
||||
# define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
#endif /*LV_CONF_H*/
|
||||
|
||||
|
||||
#endif /*Remove this to enable the content*/
|
||||
|
||||
11
lv_core/lv_core.mk
Normal file
11
lv_core/lv_core.mk
Normal file
@@ -0,0 +1,11 @@
|
||||
CSRCS += lv_group.c
|
||||
CSRCS += lv_indev.c
|
||||
CSRCS += lv_obj.c
|
||||
CSRCS += lv_refr.c
|
||||
CSRCS += lv_style.c
|
||||
CSRCS += lv_vdb.c
|
||||
|
||||
DEPPATH += --dep-path lvgl/lv_core
|
||||
VPATH += :lvgl/lv_core
|
||||
|
||||
CFLAGS += "-I$(LVGL_DIR)/lvgl/lv_core"
|
||||
333
lv_core/lv_group.c
Normal file
333
lv_core/lv_group.c
Normal file
@@ -0,0 +1,333 @@
|
||||
/**
|
||||
* @file lv_group.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_group.h"
|
||||
#if USE_LV_GROUP != 0
|
||||
#include <stddef.h>
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static void style_mod_def(lv_style_t * style);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Create a new object group
|
||||
* @return pointer to the new object group
|
||||
*/
|
||||
lv_group_t * lv_group_create(void)
|
||||
{
|
||||
lv_group_t * group = lv_mem_alloc(sizeof(lv_group_t));
|
||||
lv_ll_init(&group->obj_ll, sizeof(lv_obj_t *));
|
||||
|
||||
group->style_mod = style_mod_def;
|
||||
group->obj_focus = NULL;
|
||||
group->frozen = 0;
|
||||
group->focus_cb = NULL;
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a group object
|
||||
* @param group pointer to a group
|
||||
*/
|
||||
void lv_group_del(lv_group_t * group)
|
||||
{
|
||||
/*Defocus the the currently focussed object*/
|
||||
if(group->obj_focus != NULL) {
|
||||
(*group->obj_focus)->signal_func(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
|
||||
lv_obj_invalidate(*group->obj_focus);
|
||||
}
|
||||
|
||||
/*Remove the objects from the group*/
|
||||
lv_obj_t ** obj;
|
||||
LL_READ(group->obj_ll, obj) {
|
||||
(*obj)->group_p = NULL;
|
||||
}
|
||||
|
||||
lv_ll_clear(&(group->obj_ll));
|
||||
lv_mem_free(group);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an object to a group
|
||||
* @param group pointer to a group
|
||||
* @param obj pointer to an object to add
|
||||
*/
|
||||
void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj)
|
||||
{
|
||||
obj->group_p = group;
|
||||
lv_obj_t ** next = lv_ll_ins_tail(&group->obj_ll);
|
||||
*next = obj;
|
||||
|
||||
/* If the head and the tail is equal then there is only one object in the linked list.
|
||||
* In this case automatically activate it*/
|
||||
if(lv_ll_get_head(&group->obj_ll) == next) {
|
||||
lv_group_focus_next(group);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an object from its group
|
||||
* @param obj pointer to an object to remove
|
||||
*/
|
||||
void lv_group_remove_obj(lv_obj_t * obj)
|
||||
{
|
||||
lv_group_t * g = obj->group_p;
|
||||
if(g == NULL) return;
|
||||
|
||||
if(*g->obj_focus == obj) {
|
||||
lv_group_focus_next(g);
|
||||
}
|
||||
|
||||
/*Search the object and remove it from its group */
|
||||
lv_obj_t ** i;
|
||||
LL_READ(g->obj_ll, i) {
|
||||
if(*i == obj) {
|
||||
lv_ll_rem(&g->obj_ll, i);
|
||||
lv_mem_free(i);
|
||||
obj->group_p = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Focus on an object (defocus the current)
|
||||
* @param obj pointer to an object to focus on
|
||||
*/
|
||||
void lv_group_focus_obj(lv_obj_t * obj)
|
||||
{
|
||||
lv_group_t * g = obj->group_p;
|
||||
if(g == NULL) return;
|
||||
|
||||
if(g->frozen != 0) return;
|
||||
|
||||
lv_obj_t ** i;
|
||||
LL_READ(g->obj_ll, i) {
|
||||
if(*i == obj) {
|
||||
if(g->obj_focus != NULL) {
|
||||
(*g->obj_focus)->signal_func(*g->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
|
||||
lv_obj_invalidate(*g->obj_focus);
|
||||
}
|
||||
|
||||
g->obj_focus = i;
|
||||
|
||||
if(g->obj_focus != NULL){
|
||||
(*g->obj_focus)->signal_func(*g->obj_focus, LV_SIGNAL_FOCUS, NULL);
|
||||
lv_obj_invalidate(*g->obj_focus);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Focus the next object in a group (defocus the current)
|
||||
* @param group pointer to a group
|
||||
*/
|
||||
void lv_group_focus_next(lv_group_t * group)
|
||||
{
|
||||
if(group->frozen) return;
|
||||
|
||||
if(group->obj_focus) {
|
||||
(*group->obj_focus)->signal_func(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
|
||||
lv_obj_invalidate(*group->obj_focus);
|
||||
}
|
||||
|
||||
lv_obj_t ** obj_next;
|
||||
if(group->obj_focus == NULL) obj_next = lv_ll_get_head(&group->obj_ll);
|
||||
else obj_next = lv_ll_get_next(&group->obj_ll, group->obj_focus);
|
||||
|
||||
if(obj_next == NULL) obj_next = lv_ll_get_head(&group->obj_ll);
|
||||
group->obj_focus = obj_next;
|
||||
|
||||
if(group->obj_focus){
|
||||
(*group->obj_focus)->signal_func(*group->obj_focus, LV_SIGNAL_FOCUS, NULL);
|
||||
lv_obj_invalidate(*group->obj_focus);
|
||||
|
||||
if(group->focus_cb) group->focus_cb(group);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Focus the previous object in a group (defocus the current)
|
||||
* @param group pointer to a group
|
||||
*/
|
||||
void lv_group_focus_prev(lv_group_t * group)
|
||||
{
|
||||
if(group->frozen) return;
|
||||
|
||||
if(group->obj_focus) {
|
||||
(*group->obj_focus)->signal_func(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
|
||||
lv_obj_invalidate(*group->obj_focus);
|
||||
}
|
||||
|
||||
lv_obj_t ** obj_next;
|
||||
if(group->obj_focus == NULL) obj_next = lv_ll_get_tail(&group->obj_ll);
|
||||
else obj_next = lv_ll_get_prev(&group->obj_ll, group->obj_focus);
|
||||
|
||||
if(obj_next == NULL) obj_next = lv_ll_get_tail(&group->obj_ll);
|
||||
group->obj_focus = obj_next;
|
||||
|
||||
if(group->obj_focus != NULL){
|
||||
(*group->obj_focus)->signal_func(*group->obj_focus, LV_SIGNAL_FOCUS, NULL);
|
||||
lv_obj_invalidate(*group->obj_focus);
|
||||
|
||||
if(group->focus_cb) group->focus_cb(group);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Do not let to change the focus from the current object
|
||||
* @param group pointer to a group
|
||||
* @param en true: freeze, false: release freezing (normal mode)
|
||||
*/
|
||||
void lv_group_focus_freeze(lv_group_t * group, bool en)
|
||||
{
|
||||
if(en == false) group->frozen = 0;
|
||||
else group->frozen = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a control character to the focuses object of a group
|
||||
* @param group pointer to a group
|
||||
* @param c a character (use LV_GROUP_KEY_.. to navigate)
|
||||
*/
|
||||
void lv_group_send_data(lv_group_t * group, uint32_t c)
|
||||
{
|
||||
lv_obj_t * act = lv_group_get_focused(group);
|
||||
if(act == NULL) return;
|
||||
|
||||
act->signal_func(act, LV_SIGNAL_CONTROLL, &c);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a function for a group which will modify the object's style if it is in focus
|
||||
* @param group pointer to a group
|
||||
* @param style_mod_func the style modifier function pointer
|
||||
*/
|
||||
void lv_group_set_style_mod_cb(lv_group_t * group,lv_group_style_mod_func_t style_mod_func)
|
||||
{
|
||||
group->style_mod = style_mod_func;
|
||||
if(group->obj_focus != NULL) lv_obj_invalidate(*group->obj_focus);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set a function for a group which will be called when a new object is focused
|
||||
* @param group pointer to a group
|
||||
* @param focus_cb the call back function or NULL if unused
|
||||
*/
|
||||
void lv_group_set_focus_cb(lv_group_t * group, lv_group_focus_cb_t focus_cb)
|
||||
{
|
||||
group->focus_cb = focus_cb;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify a style with the set 'style_mod' function. The input style remains unchanged.
|
||||
* @param group pointer to group
|
||||
* @param style pointer to a style to modify
|
||||
* @return a copy of the input style but modified with the 'style_mod' function
|
||||
*/
|
||||
lv_style_t * lv_group_mod_style(lv_group_t * group, const lv_style_t * style)
|
||||
{
|
||||
lv_style_copy(&group->style_tmp, style);
|
||||
|
||||
if(group->style_mod != NULL) group->style_mod(&group->style_tmp);
|
||||
else style_mod_def(&group->style_tmp);
|
||||
|
||||
return &group->style_tmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the focused object or NULL if there isn't one
|
||||
* @param group pointer to a group
|
||||
* @return pointer to the focused object
|
||||
*/
|
||||
lv_obj_t * lv_group_get_focused(lv_group_t * group)
|
||||
{
|
||||
if(group == NULL) return NULL;
|
||||
if(group->obj_focus == NULL) return NULL;
|
||||
|
||||
return *group->obj_focus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a the style modifier function of a group
|
||||
* @param group pointer to a group
|
||||
* @return pointer to the style modifier function
|
||||
*/
|
||||
lv_group_style_mod_func_t lv_group_get_style_mod_cb(lv_group_t * group)
|
||||
{
|
||||
return group->style_mod ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the focus callback function of a group
|
||||
* @param group pointer to a group
|
||||
* @return the call back function or NULL if not set
|
||||
*/
|
||||
lv_group_focus_cb_t lv_group_get_focus_cb(lv_group_t * group)
|
||||
{
|
||||
return group->focus_cb;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Default style modifier function
|
||||
* @param style pointer to a style to modify. (Typically group.style_tmp) It will be OVERWRITTEN.
|
||||
*/
|
||||
static void style_mod_def(lv_style_t * style)
|
||||
{
|
||||
#if LV_COLOR_DEPTH != 1
|
||||
/*Make the style to be a little bit orange*/
|
||||
style->body.border.opa = LV_OPA_COVER;
|
||||
style->body.border.color = LV_COLOR_ORANGE;
|
||||
|
||||
/*If not empty or has border then emphasis the border*/
|
||||
if(style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||
|
||||
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_ORANGE, LV_OPA_60);
|
||||
|
||||
style->text.color = lv_color_mix(style->text.color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||
#else
|
||||
style->body.border.opa = LV_OPA_COVER;
|
||||
style->body.border.color = LV_COLOR_BLACK;
|
||||
style->body.border.width = 3;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif /*USE_LV_GROUP != 0*/
|
||||
168
lv_core/lv_group.h
Normal file
168
lv_core/lv_group.h
Normal file
@@ -0,0 +1,168 @@
|
||||
/**
|
||||
* @file lv_group.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_GROUP_H
|
||||
#define LV_GROUP_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "../../lv_conf.h"
|
||||
#include "lv_obj.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
/*Predefined keys to control the focused object via lv_group_send(group, c)*/
|
||||
/*For compatibility in signal function define the keys regardless to LV_GROUP*/
|
||||
#define LV_GROUP_KEY_UP 17 /*0x11*/
|
||||
#define LV_GROUP_KEY_DOWN 18 /*0x12*/
|
||||
#define LV_GROUP_KEY_RIGHT 19 /*0x13*/
|
||||
#define LV_GROUP_KEY_LEFT 20 /*0x14*/
|
||||
#define LV_GROUP_KEY_ESC 27 /*0x1B*/
|
||||
#define LV_GROUP_KEY_ENTER 10 /*0x0A, '\n'*/
|
||||
#define LV_GROUP_KEY_NEXT 9 /*0x09, '\t'*/
|
||||
#define LV_GROUP_KEY_PREV 11 /*0x0B, '*/
|
||||
|
||||
#define LV_GROUP_KEY_ENTER_LONG 14 /*0x0E, Sent by the library if ENTER is long pressed*/
|
||||
|
||||
#if USE_LV_GROUP != 0
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
struct _lv_group_t;
|
||||
|
||||
typedef void (*lv_group_style_mod_func_t)(lv_style_t *);
|
||||
typedef void (*lv_group_focus_cb_t)(struct _lv_group_t *);
|
||||
|
||||
typedef struct _lv_group_t
|
||||
{
|
||||
lv_ll_t obj_ll; /*Linked list to store the objects in the group */
|
||||
lv_obj_t ** obj_focus; /*The object in focus*/
|
||||
lv_group_style_mod_func_t style_mod; /*A function which modifies the style of the focused object*/
|
||||
lv_group_focus_cb_t focus_cb; /*A function to call when a new object is focused (optional)*/
|
||||
lv_style_t style_tmp; /*Stores the modified style of the focused object */
|
||||
uint8_t frozen:1; /*1: can't focus to new object*/
|
||||
}lv_group_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Create a new object group
|
||||
* @return pointer to the new object group
|
||||
*/
|
||||
lv_group_t * lv_group_create(void);
|
||||
|
||||
/**
|
||||
* Delete a group object
|
||||
* @param group pointer to a group
|
||||
*/
|
||||
void lv_group_del(lv_group_t * group);
|
||||
|
||||
/**
|
||||
* Add an object to a group
|
||||
* @param group pointer to a group
|
||||
* @param obj pointer to an object to add
|
||||
*/
|
||||
void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Remove an object from its group
|
||||
* @param obj pointer to an object to remove
|
||||
*/
|
||||
void lv_group_remove_obj(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Focus on an object (defocus the current)
|
||||
* @param obj pointer to an object to focus on
|
||||
*/
|
||||
void lv_group_focus_obj(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Focus the next object in a group (defocus the current)
|
||||
* @param group pointer to a group
|
||||
*/
|
||||
void lv_group_focus_next(lv_group_t * group);
|
||||
|
||||
/**
|
||||
* Focus the previous object in a group (defocus the current)
|
||||
* @param group pointer to a group
|
||||
*/
|
||||
void lv_group_focus_prev(lv_group_t * group);
|
||||
|
||||
/**
|
||||
* Do not let to change the focus from the current object
|
||||
* @param group pointer to a group
|
||||
* @param en true: freeze, false: release freezing (normal mode)
|
||||
*/
|
||||
void lv_group_focus_freeze(lv_group_t * group, bool en);
|
||||
|
||||
/**
|
||||
* Send a control character to the focuses object of a group
|
||||
* @param group pointer to a group
|
||||
* @param c a character (use LV_GROUP_KEY_.. to navigate)
|
||||
*/
|
||||
void lv_group_send_data(lv_group_t * group, uint32_t c);
|
||||
|
||||
/**
|
||||
* Set a function for a group which will modify the object's style if it is in focus
|
||||
* @param group pointer to a group
|
||||
* @param style_mod_func the style modifier function pointer
|
||||
*/
|
||||
void lv_group_set_style_mod_cb(lv_group_t * group,lv_group_style_mod_func_t style_mod_func);
|
||||
|
||||
/**
|
||||
* Set a function for a group which will be called when a new object is focused
|
||||
* @param group pointer to a group
|
||||
* @param focus_cb the call back function or NULL if unused
|
||||
*/
|
||||
void lv_group_set_focus_cb(lv_group_t * group, lv_group_focus_cb_t focus_cb);
|
||||
|
||||
/**
|
||||
* Modify a style with the set 'style_mod' function. The input style remains unchanged.
|
||||
* @param group pointer to group
|
||||
* @param style pointer to a style to modify
|
||||
* @return a copy of the input style but modified with the 'style_mod' function
|
||||
*/
|
||||
lv_style_t * lv_group_mod_style(lv_group_t * group, const lv_style_t * style);
|
||||
|
||||
/**
|
||||
* Get the focused object or NULL if there isn't one
|
||||
* @param group pointer to a group
|
||||
* @return pointer to the focused object
|
||||
*/
|
||||
lv_obj_t * lv_group_get_focused(lv_group_t * group);
|
||||
|
||||
/**
|
||||
* Get a the style modifier function of a group
|
||||
* @param group pointer to a group
|
||||
* @return pointer to the style modifier function
|
||||
*/
|
||||
lv_group_style_mod_func_t lv_group_get_style_mod_cb(lv_group_t * group);
|
||||
|
||||
/**
|
||||
* Get the focus callback function of a group
|
||||
* @param group pointer to a group
|
||||
* @return the call back function or NULL if not set
|
||||
*/
|
||||
lv_group_focus_cb_t lv_group_get_focus_cb(lv_group_t * group);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*USE_LV_GROUP != 0*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_GROUP_H*/
|
||||
735
lv_core/lv_indev.c
Normal file
735
lv_core/lv_indev.c
Normal file
@@ -0,0 +1,735 @@
|
||||
/**
|
||||
* @file lv_indev_proc.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
********************/
|
||||
#include "lv_indev.h"
|
||||
#include "../../lv_conf.h"
|
||||
|
||||
#include "../lv_hal/lv_hal_tick.h"
|
||||
#include "../lv_core/lv_group.h"
|
||||
#include "../lv_core/lv_refr.h"
|
||||
#include "../lv_misc/lv_task.h"
|
||||
#include "../lv_misc/lv_math.h"
|
||||
#include "../lv_draw/lv_draw_rbasic.h"
|
||||
#include "lv_obj.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
#if LV_INDEV_READ_PERIOD != 0
|
||||
static void indev_proc_task(void * param);
|
||||
static void indev_pointer_proc(lv_indev_t * i, lv_indev_data_t * data);
|
||||
static void indev_keypad_proc(lv_indev_t * i, lv_indev_data_t * data);
|
||||
static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data);
|
||||
static void indev_proc_press(lv_indev_proc_t * proc);
|
||||
static void indev_proc_release(lv_indev_proc_t * proc);
|
||||
static void indev_proc_reset_query_handler(lv_indev_t * indev);
|
||||
static lv_obj_t * indev_search_obj(const lv_indev_proc_t * indev, lv_obj_t * obj);
|
||||
static void indev_drag(lv_indev_proc_t * state);
|
||||
static void indev_drag_throw(lv_indev_proc_t * state);
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static lv_indev_t *indev_act;
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize the display input device subsystem
|
||||
*/
|
||||
void lv_indev_init(void)
|
||||
{
|
||||
#if LV_INDEV_READ_PERIOD != 0
|
||||
lv_task_create(indev_proc_task, LV_INDEV_READ_PERIOD, LV_TASK_PRIO_MID, NULL);
|
||||
#endif
|
||||
|
||||
lv_indev_reset(NULL); /*Reset all input devices*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the currently processed input device. Can be used in action functions too.
|
||||
* @return pointer to the currently processed input device or NULL if no input device processing right now
|
||||
*/
|
||||
lv_indev_t * lv_indev_get_act(void)
|
||||
{
|
||||
return indev_act;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset one or all input devices
|
||||
* @param indev pointer to an input device to reset or NULL to reset all of them
|
||||
*/
|
||||
void lv_indev_reset(lv_indev_t * indev)
|
||||
{
|
||||
if(indev) indev->proc.reset_query = 1;
|
||||
else {
|
||||
lv_indev_t * i = lv_indev_next(NULL);
|
||||
while(i) {
|
||||
i->proc.reset_query = 1;
|
||||
i = lv_indev_next(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the long press state of an input device
|
||||
* @param indev pointer to an input device
|
||||
*/
|
||||
void lv_indev_reset_lpr(lv_indev_t * indev)
|
||||
{
|
||||
indev->proc.long_pr_sent = 0;
|
||||
indev->proc.longpr_rep_timestamp = lv_tick_get();
|
||||
indev->proc.pr_timestamp = lv_tick_get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable input devices device by type
|
||||
* @param type Input device type
|
||||
* @param enable true: enable this type; false: disable this type
|
||||
*/
|
||||
void lv_indev_enable(lv_hal_indev_type_t type, bool enable)
|
||||
{
|
||||
lv_indev_t *i = lv_indev_next(NULL);
|
||||
|
||||
while (i) {
|
||||
if (i->driver.type == type) i->proc.disabled = enable == false ? 1 : 0;
|
||||
i = lv_indev_next(i);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a cursor for a pointer input device (for LV_INPUT_TYPE_POINTER and LV_INPUT_TYPE_BUTTON)
|
||||
* @param indev pointer to an input device
|
||||
* @param cur_obj pointer to an object to be used as cursor
|
||||
*/
|
||||
void lv_indev_set_cursor(lv_indev_t *indev, lv_obj_t *cur_obj)
|
||||
{
|
||||
if(indev->driver.type != LV_INDEV_TYPE_POINTER && indev->driver.type != LV_INDEV_TYPE_BUTTON) return;
|
||||
|
||||
indev->cursor = cur_obj;
|
||||
lv_obj_set_parent(indev->cursor, lv_layer_sys());
|
||||
lv_obj_set_pos(indev->cursor, indev->proc.act_point.x, indev->proc.act_point.y);
|
||||
}
|
||||
|
||||
#if USE_LV_GROUP
|
||||
/**
|
||||
* Set a destination group for a keypad input device (for LV_INDEV_TYPE_KEYPAD)
|
||||
* @param indev pointer to an input device
|
||||
* @param group point to a group
|
||||
*/
|
||||
void lv_indev_set_group(lv_indev_t *indev, lv_group_t *group)
|
||||
{
|
||||
if(indev->driver.type == LV_INDEV_TYPE_KEYPAD) indev->group = group;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Set the an array of points for LV_INDEV_TYPE_BUTTON.
|
||||
* These points will be assigned to the buttons to press a specific point on the screen
|
||||
* @param indev pointer to an input device
|
||||
* @param group point to a group
|
||||
*/
|
||||
void lv_indev_set_button_points(lv_indev_t *indev, lv_point_t *points)
|
||||
{
|
||||
if(indev->driver.type == LV_INDEV_TYPE_BUTTON) indev->btn_points = points;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the last point of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON)
|
||||
* @param indev pointer to an input device
|
||||
* @param point pointer to a point to store the result
|
||||
*/
|
||||
void lv_indev_get_point(lv_indev_t * indev, lv_point_t * point)
|
||||
{
|
||||
if(indev->driver.type != LV_INDEV_TYPE_POINTER && indev->driver.type != LV_INDEV_TYPE_BUTTON) {
|
||||
point->x = 0;
|
||||
point->y = 0;
|
||||
} else {
|
||||
point->x = indev->proc.act_point.x;
|
||||
point->y = indev->proc.act_point.y;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if there is dragging with an input device or not (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON)
|
||||
* @param indev pointer to an input device
|
||||
* @return true: drag is in progress
|
||||
*/
|
||||
bool lv_indev_is_dragging(lv_indev_t * indev)
|
||||
{
|
||||
if(indev == NULL) return false;
|
||||
if(indev->driver.type != LV_INDEV_TYPE_POINTER && indev->driver.type != LV_INDEV_TYPE_BUTTON) return false;
|
||||
return indev->proc.drag_in_prog == 0 ? false : true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the vector of dragging of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON)
|
||||
* @param indev pointer to an input device
|
||||
* @param point pointer to a point to store the vector
|
||||
*/
|
||||
void lv_indev_get_vect(lv_indev_t * indev, lv_point_t * point)
|
||||
{
|
||||
if(indev->driver.type != LV_INDEV_TYPE_POINTER && indev->driver.type != LV_INDEV_TYPE_BUTTON) {
|
||||
point->x = 0;
|
||||
point->y = 0;
|
||||
} else {
|
||||
point->x = indev->proc.vect.x;
|
||||
point->y = indev->proc.vect.y;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get elapsed time since last press
|
||||
* @param indev pointer to an input device (NULL to get the overall smallest inactivity)
|
||||
* @return Elapsed ticks (milliseconds) since last press
|
||||
*/
|
||||
uint32_t lv_indev_get_inactive_time(lv_indev_t * indev)
|
||||
{
|
||||
uint32_t t;
|
||||
|
||||
if(indev) return t = lv_tick_elaps(indev->last_activity_time);
|
||||
|
||||
lv_indev_t *i;
|
||||
t = UINT16_MAX;
|
||||
i = lv_indev_next(NULL);
|
||||
while(i) {
|
||||
t = LV_MATH_MIN(t, lv_tick_elaps(i->last_activity_time));
|
||||
i = lv_indev_next(i);
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do nothing until the next release
|
||||
* @param indev pointer to an input device
|
||||
*/
|
||||
void lv_indev_wait_release(lv_indev_t * indev)
|
||||
{
|
||||
indev->proc.wait_unil_release = 1;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
#if LV_INDEV_READ_PERIOD != 0
|
||||
/**
|
||||
* Called periodically to handle the input devices
|
||||
* @param param unused
|
||||
*/
|
||||
static void indev_proc_task(void * param)
|
||||
{
|
||||
(void)param;
|
||||
|
||||
lv_indev_data_t data;
|
||||
lv_indev_t * i;
|
||||
i = lv_indev_next(NULL);
|
||||
|
||||
/*Read and process all indevs*/
|
||||
while(i) {
|
||||
indev_act = i;
|
||||
|
||||
/*Handle reset query before processing the point*/
|
||||
indev_proc_reset_query_handler(i);
|
||||
|
||||
if(i->proc.disabled == 0) {
|
||||
bool more_to_read;
|
||||
do {
|
||||
/*Read the data*/
|
||||
more_to_read = lv_indev_read(i, &data);
|
||||
i->proc.state = data.state;
|
||||
|
||||
if(i->proc.state == LV_INDEV_STATE_PR) {
|
||||
i->last_activity_time = lv_tick_get();
|
||||
}
|
||||
|
||||
if(i->driver.type == LV_INDEV_TYPE_POINTER) {
|
||||
indev_pointer_proc(i,&data);
|
||||
}
|
||||
else if(i->driver.type == LV_INDEV_TYPE_KEYPAD) {
|
||||
indev_keypad_proc(i, &data);
|
||||
}
|
||||
else if(i->driver.type == LV_INDEV_TYPE_BUTTON) {
|
||||
indev_button_proc(i, &data);
|
||||
}
|
||||
/*Handle reset query if it happened in during processing*/
|
||||
indev_proc_reset_query_handler(i);
|
||||
} while(more_to_read);
|
||||
}
|
||||
i = lv_indev_next(i); /*Go to the next indev*/
|
||||
}
|
||||
|
||||
indev_act = NULL; /*End of indev processing, so no act indev*/
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process a new point from LV_INDEV_TYPE_POINTER input device
|
||||
* @param i pointer to an input device
|
||||
* @param data pointer to the data read from the input device
|
||||
*/
|
||||
static void indev_pointer_proc(lv_indev_t * i, lv_indev_data_t * data)
|
||||
{
|
||||
/*Move the cursor if set and moved*/
|
||||
if(i->cursor != NULL &&
|
||||
(i->proc.last_point.x != data->point.x ||
|
||||
i->proc.last_point.y != data->point.y))
|
||||
{
|
||||
lv_obj_set_pos(i->cursor, data->point.x, data->point.y);
|
||||
}
|
||||
|
||||
i->proc.act_point.x = data->point.x;
|
||||
i->proc.act_point.y = data->point.y;
|
||||
|
||||
if(i->proc.state == LV_INDEV_STATE_PR){
|
||||
#if LV_INDEV_POINT_MARKER != 0
|
||||
lv_area_t area;
|
||||
area.x1 = i->proc.act_point.x - (LV_INDEV_POINT_MARKER >> 1);
|
||||
area.y1 = i->proc.act_point.y - (LV_INDEV_POINT_MARKER >> 1);
|
||||
area.x2 = i->proc.act_point.x + ((LV_INDEV_POINT_MARKER >> 1) | 0x1);
|
||||
area.y2 = i->proc.act_point.y + ((LV_INDEV_POINT_MARKER >> 1) | 0x1);
|
||||
lv_rfill(&area, NULL, LV_COLOR_MAKE(0xFF, 0, 0), LV_OPA_COVER);
|
||||
#endif
|
||||
indev_proc_press(&i->proc);
|
||||
} else {
|
||||
indev_proc_release(&i->proc);
|
||||
}
|
||||
|
||||
i->proc.last_point.x = i->proc.act_point.x;
|
||||
i->proc.last_point.y = i->proc.act_point.y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process a new point from LV_INDEV_TYPE_KEYPAD input device
|
||||
* @param i pointer to an input device
|
||||
* @param data pointer to the data read from the input device
|
||||
*/
|
||||
static void indev_keypad_proc(lv_indev_t * i, lv_indev_data_t * data)
|
||||
{
|
||||
#if USE_LV_GROUP
|
||||
if(i->group == NULL) return;
|
||||
|
||||
/*Key press happened*/
|
||||
if(data->state == LV_INDEV_STATE_PR &&
|
||||
i->proc.last_state == LV_INDEV_STATE_REL)
|
||||
{
|
||||
i->proc.pr_timestamp = lv_tick_get();
|
||||
}
|
||||
/*Pressing*/
|
||||
else if(data->state == LV_INDEV_STATE_PR && i->proc.last_state == LV_INDEV_STATE_PR) {
|
||||
if(data->key == LV_GROUP_KEY_ENTER &&
|
||||
i->proc.long_pr_sent == 0 &&
|
||||
lv_tick_elaps(i->proc.pr_timestamp) > LV_INDEV_LONG_PRESS_TIME)
|
||||
{
|
||||
|
||||
lv_group_send_data(i->group, LV_GROUP_KEY_ENTER_LONG);
|
||||
i->proc.long_pr_sent = 1;
|
||||
|
||||
}
|
||||
}
|
||||
/*Release happened*/
|
||||
else if(data->state == LV_INDEV_STATE_REL && i->proc.last_state == LV_INDEV_STATE_PR)
|
||||
{
|
||||
/*The user might clear the key it was released. Always release the pressed key*/
|
||||
data->key = i->proc.last_key;
|
||||
|
||||
if(data->key == LV_GROUP_KEY_NEXT) {
|
||||
lv_group_focus_next(i->group);
|
||||
}
|
||||
else if(data->key == LV_GROUP_KEY_PREV) {
|
||||
lv_group_focus_prev(i->group);
|
||||
}
|
||||
else {
|
||||
lv_group_send_data(i->group, data->key);
|
||||
}
|
||||
|
||||
i->proc.pr_timestamp = 0;
|
||||
i->proc.long_pr_sent = 0;
|
||||
}
|
||||
|
||||
i->proc.last_state = data->state;
|
||||
i->proc.last_key = data->key;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process new points from a input device. indev->state.pressed has to be set
|
||||
* @param indev pointer to an input device state
|
||||
* @param x x coordinate of the next point
|
||||
* @param y y coordinate of the next point
|
||||
*/
|
||||
static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data)
|
||||
{
|
||||
i->proc.act_point.x = i->btn_points[data->btn].x;
|
||||
i->proc.act_point.y = i->btn_points[data->btn].y;
|
||||
|
||||
/*Still the same point is pressed*/
|
||||
if(i->proc.last_point.x == i->proc.act_point.x &&
|
||||
i->proc.last_point.y == i->proc.act_point.y &&
|
||||
data->state == LV_INDEV_STATE_PR) {
|
||||
#if LV_INDEV_POINT_MARKER != 0
|
||||
lv_area_t area;
|
||||
area.x1 = i->proc.act_point.x - (LV_INDEV_POINT_MARKER >> 1);
|
||||
area.y1 = i->proc.act_point.y - (LV_INDEV_POINT_MARKER >> 1);
|
||||
area.x2 = i->proc.act_point.x + ((LV_INDEV_POINT_MARKER >> 1) | 0x1);
|
||||
area.y2 = i->proc.act_point.y + ((LV_INDEV_POINT_MARKER >> 1) | 0x1);
|
||||
lv_rfill(&area, NULL, LV_COLOR_MAKE(0xFF, 0, 0), LV_OPA_COVER);
|
||||
#endif
|
||||
indev_proc_press(&i->proc);
|
||||
} else {
|
||||
/*If a new point comes always make a release*/
|
||||
indev_proc_release(&i->proc);
|
||||
}
|
||||
|
||||
i->proc.last_point.x = i->proc.act_point.x;
|
||||
i->proc.last_point.y = i->proc.act_point.y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the pressed state of LV_INDEV_TYPE_POINER input devices
|
||||
* @param indev pointer to an input device 'proc'
|
||||
*/
|
||||
static void indev_proc_press(lv_indev_proc_t * proc)
|
||||
{
|
||||
lv_obj_t * pr_obj = proc->act_obj;
|
||||
|
||||
if(proc->wait_unil_release != 0) return;
|
||||
|
||||
/*If there is no last object then search*/
|
||||
if(proc->act_obj == NULL) {
|
||||
pr_obj = indev_search_obj(proc, lv_layer_top());
|
||||
if(pr_obj == NULL) pr_obj = indev_search_obj(proc, lv_scr_act());
|
||||
}
|
||||
/*If there is last object but it is not dragged and not protected also search*/
|
||||
else if(proc->drag_in_prog == 0 &&
|
||||
lv_obj_is_protected(proc->act_obj, LV_PROTECT_PRESS_LOST) == false) {/*Now act_obj != NULL*/
|
||||
pr_obj = indev_search_obj(proc, lv_layer_top());
|
||||
if(pr_obj == NULL) pr_obj = indev_search_obj(proc, lv_scr_act());
|
||||
}
|
||||
/*If a dragable or a protected object was the last then keep it*/
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
/*If a new object was found reset some variables and send a pressed signal*/
|
||||
if(pr_obj != proc->act_obj) {
|
||||
|
||||
proc->last_point.x = proc->act_point.x;
|
||||
proc->last_point.y = proc->act_point.y;
|
||||
|
||||
/*If a new object found the previous was lost, so send a signal*/
|
||||
if(proc->act_obj != NULL) {
|
||||
proc->act_obj->signal_func(proc->act_obj, LV_SIGNAL_PRESS_LOST, indev_act);
|
||||
if(proc->reset_query != 0) return;
|
||||
}
|
||||
|
||||
if(pr_obj != NULL) {
|
||||
/* Save the time when the obj pressed.
|
||||
* It is necessary to count the long press time.*/
|
||||
proc->pr_timestamp = lv_tick_get();
|
||||
proc->long_pr_sent = 0;
|
||||
proc->drag_range_out = 0;
|
||||
proc->drag_in_prog = 0;
|
||||
proc->drag_sum.x = 0;
|
||||
proc->drag_sum.y = 0;
|
||||
|
||||
/*Search for 'top' attribute*/
|
||||
lv_obj_t * i = pr_obj;
|
||||
lv_obj_t * last_top = NULL;
|
||||
while(i != NULL){
|
||||
if(i->top != 0) last_top = i;
|
||||
i = lv_obj_get_parent(i);
|
||||
}
|
||||
|
||||
if(last_top != NULL) {
|
||||
/*Move the last_top object to the foreground*/
|
||||
lv_obj_t * par = lv_obj_get_parent(last_top);
|
||||
/*After list change it will be the new head*/
|
||||
lv_ll_chg_list(&par->child_ll, &par->child_ll, last_top);
|
||||
lv_obj_invalidate(last_top);
|
||||
}
|
||||
|
||||
/*Send a signal about the press*/
|
||||
pr_obj->signal_func(pr_obj, LV_SIGNAL_PRESSED, indev_act);
|
||||
if(proc->reset_query != 0) return;
|
||||
}
|
||||
}
|
||||
|
||||
proc->act_obj = pr_obj; /*Save the pressed object*/
|
||||
proc->last_obj = proc->act_obj; /*Refresh the last_obj*/
|
||||
|
||||
/*Calculate the vector*/
|
||||
proc->vect.x = proc->act_point.x - proc->last_point.x;
|
||||
proc->vect.y = proc->act_point.y - proc->last_point.y;
|
||||
|
||||
/*If there is active object and it can be dragged run the drag*/
|
||||
if(proc->act_obj != NULL) {
|
||||
proc->act_obj->signal_func(proc->act_obj, LV_SIGNAL_PRESSING, indev_act);
|
||||
if(proc->reset_query != 0) return;
|
||||
|
||||
indev_drag(proc);
|
||||
if(proc->reset_query != 0) return;
|
||||
|
||||
/*If there is no drag then check for long press time*/
|
||||
if(proc->drag_in_prog == 0 && proc->long_pr_sent == 0) {
|
||||
/*Send a signal about the long press if enough time elapsed*/
|
||||
if(lv_tick_elaps(proc->pr_timestamp) > LV_INDEV_LONG_PRESS_TIME) {
|
||||
pr_obj->signal_func(pr_obj, LV_SIGNAL_LONG_PRESS, indev_act);
|
||||
if(proc->reset_query != 0) return;
|
||||
|
||||
/*Mark the signal sending to do not send it again*/
|
||||
proc->long_pr_sent = 1;
|
||||
|
||||
/*Save the long press time stamp for the long press repeat handler*/
|
||||
proc->longpr_rep_timestamp = lv_tick_get();
|
||||
}
|
||||
}
|
||||
/*Send long press repeated signal*/
|
||||
if(proc->drag_in_prog == 0 && proc->long_pr_sent == 1) {
|
||||
/*Send a signal about the long press repeate if enough time elapsed*/
|
||||
if(lv_tick_elaps(proc->longpr_rep_timestamp) > LV_INDEV_LONG_PRESS_REP_TIME) {
|
||||
pr_obj->signal_func(pr_obj, LV_SIGNAL_LONG_PRESS_REP, indev_act);
|
||||
if(proc->reset_query != 0) return;
|
||||
proc->longpr_rep_timestamp = lv_tick_get();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the released state of LV_INDEV_TYPE_POINER input devices
|
||||
* @param proc pointer to an input device 'proc'
|
||||
*/
|
||||
static void indev_proc_release(lv_indev_proc_t * proc)
|
||||
{
|
||||
if(proc->wait_unil_release != 0) {
|
||||
proc->act_obj = NULL;
|
||||
proc->last_obj = NULL;
|
||||
proc->pr_timestamp = 0;
|
||||
proc->longpr_rep_timestamp = 0;
|
||||
proc->wait_unil_release = 0;
|
||||
}
|
||||
|
||||
/*Forgot the act obj and send a released signal */
|
||||
if(proc->act_obj != NULL) {
|
||||
proc->act_obj->signal_func(proc->act_obj, LV_SIGNAL_RELEASED, indev_act);
|
||||
if(proc->reset_query != 0) return;
|
||||
proc->act_obj = NULL;
|
||||
proc->pr_timestamp = 0;
|
||||
proc->longpr_rep_timestamp = 0;
|
||||
}
|
||||
|
||||
/*The reset can be set in the signal function.
|
||||
* In case of reset query ignore the remaining parts.*/
|
||||
if(proc->last_obj != NULL && proc->reset_query == 0) {
|
||||
indev_drag_throw(proc);
|
||||
if(proc->reset_query != 0) return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process a new point from LV_INDEV_TYPE_BUTTON input device
|
||||
* @param i pointer to an input device
|
||||
* @param data pointer to the data read from the input device
|
||||
* Reset input device if a reset query has been sent to it
|
||||
* @param indev pointer to an input device
|
||||
*/
|
||||
static void indev_proc_reset_query_handler(lv_indev_t * indev)
|
||||
{
|
||||
if(indev->proc.reset_query) {
|
||||
indev->proc.act_obj = NULL;
|
||||
indev->proc.last_obj = NULL;
|
||||
indev->proc.drag_range_out = 0;
|
||||
indev->proc.drag_in_prog = 0;
|
||||
indev->proc.long_pr_sent = 0;
|
||||
indev->proc.pr_timestamp = 0;
|
||||
indev->proc.longpr_rep_timestamp = 0;
|
||||
indev->proc.drag_sum.x = 0;
|
||||
indev->proc.drag_sum.y = 0;
|
||||
indev->proc.reset_query = 0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Search the most top, clickable object on the last point of an input device
|
||||
* @param indev pointer to an input device
|
||||
* @param obj pointer to a start object, typically the screen
|
||||
* @return pointer to the found object or NULL if there was no suitable object
|
||||
*/
|
||||
static lv_obj_t * indev_search_obj(const lv_indev_proc_t * indev, lv_obj_t * obj)
|
||||
{
|
||||
lv_obj_t * found_p = NULL;
|
||||
|
||||
/*If the point is on this object*/
|
||||
/*Check its children too*/
|
||||
if(lv_area_is_point_on(&obj->coords, &indev->act_point)) {
|
||||
lv_obj_t * i;
|
||||
|
||||
LL_READ(obj->child_ll, i) {
|
||||
found_p = indev_search_obj(indev, i);
|
||||
|
||||
/*If a child was found then break*/
|
||||
if(found_p != NULL) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*If then the children was not ok, and this obj is clickable
|
||||
* and it or its parent is not hidden then save this object*/
|
||||
if(found_p == NULL && lv_obj_get_click(obj) != false) {
|
||||
lv_obj_t * hidden_i = obj;
|
||||
while(hidden_i != NULL) {
|
||||
if(lv_obj_get_hidden(hidden_i) == true) break;
|
||||
hidden_i = lv_obj_get_parent(hidden_i);
|
||||
}
|
||||
/*No parent found with hidden == true*/
|
||||
if(hidden_i == NULL) found_p = obj;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return found_p;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the dragging of indev_proc_p->act_obj
|
||||
* @param indev pointer to a input device state
|
||||
*/
|
||||
static void indev_drag(lv_indev_proc_t * state)
|
||||
{
|
||||
lv_obj_t * drag_obj = state->act_obj;
|
||||
|
||||
/*If drag parent is active check recursively the drag_parent attribute*/
|
||||
while(lv_obj_get_drag_parent(drag_obj) != false &&
|
||||
drag_obj != NULL) {
|
||||
drag_obj = lv_obj_get_parent(drag_obj);
|
||||
}
|
||||
|
||||
if(drag_obj == NULL) return;
|
||||
|
||||
if(lv_obj_get_drag(drag_obj) == false) return;
|
||||
|
||||
/*If still there is no drag then count the movement*/
|
||||
if(state->drag_range_out == 0) {
|
||||
state->drag_sum.x += state->vect.x;
|
||||
state->drag_sum.y += state->vect.y;
|
||||
|
||||
/*If a move is greater then LV_DRAG_LIMIT then begin the drag*/
|
||||
if(LV_MATH_ABS(state->drag_sum.x) >= LV_INDEV_DRAG_LIMIT ||
|
||||
LV_MATH_ABS(state->drag_sum.y) >= LV_INDEV_DRAG_LIMIT)
|
||||
{
|
||||
state->drag_range_out = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*If the drag limit is stepped over then handle the dragging*/
|
||||
if(state->drag_range_out != 0) {
|
||||
/*Set new position if the vector is not zero*/
|
||||
if(state->vect.x != 0 ||
|
||||
state->vect.y != 0) {
|
||||
/*Get the coordinates of the object and modify them*/
|
||||
lv_coord_t act_x = lv_obj_get_x(drag_obj);
|
||||
lv_coord_t act_y = lv_obj_get_y(drag_obj);
|
||||
uint16_t inv_buf_size = lv_refr_get_buf_size(); /*Get the number of currently invalidated areas*/
|
||||
|
||||
lv_coord_t prev_x = drag_obj->coords.x1;
|
||||
lv_coord_t prev_y = drag_obj->coords.y1;
|
||||
|
||||
lv_obj_set_pos(drag_obj, act_x + state->vect.x, act_y + state->vect.y);
|
||||
|
||||
/*Set the drag in progress flag if the object is really moved*/
|
||||
|
||||
if(drag_obj->coords.x1 != prev_x || drag_obj->coords.y1 != prev_y) {
|
||||
if(state->drag_range_out != 0) { /*Send the drag begin signal on first move*/
|
||||
drag_obj->signal_func(drag_obj, LV_SIGNAL_DRAG_BEGIN, indev_act);
|
||||
if(state->reset_query != 0) return;
|
||||
}
|
||||
state->drag_in_prog = 1;
|
||||
}
|
||||
/*If the object didn't moved then clear the invalidated areas*/
|
||||
else {
|
||||
uint16_t new_inv_buf_size = lv_refr_get_buf_size();
|
||||
lv_refr_pop_from_buf(new_inv_buf_size - inv_buf_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle throwing by drag if the drag is ended
|
||||
* @param indev pointer to an input device state
|
||||
*/
|
||||
static void indev_drag_throw(lv_indev_proc_t * state)
|
||||
{
|
||||
if(state->drag_in_prog == 0) return;
|
||||
|
||||
/*Set new position if the vector is not zero*/
|
||||
lv_obj_t * drag_obj = state->last_obj;
|
||||
|
||||
/*If drag parent is active check recursively the drag_parent attribute*/
|
||||
while(lv_obj_get_drag_parent(drag_obj) != false &&
|
||||
drag_obj != NULL) {
|
||||
drag_obj = lv_obj_get_parent(drag_obj);
|
||||
}
|
||||
|
||||
if(drag_obj == NULL) return;
|
||||
|
||||
/*Return if the drag throw is not enabled*/
|
||||
if(lv_obj_get_drag_throw(drag_obj) == false ){
|
||||
state->drag_in_prog = 0;
|
||||
drag_obj->signal_func(drag_obj, LV_SIGNAL_DRAG_END, indev_act);
|
||||
return;
|
||||
}
|
||||
|
||||
/*Reduce the vectors*/
|
||||
state->vect.x = state->vect.x * (100 -LV_INDEV_DRAG_THROW) / 100;
|
||||
state->vect.y = state->vect.y * (100 -LV_INDEV_DRAG_THROW) / 100;
|
||||
|
||||
if(state->vect.x != 0 ||
|
||||
state->vect.y != 0)
|
||||
{
|
||||
/*Get the coordinates and modify them*/
|
||||
lv_coord_t act_x = lv_obj_get_x(drag_obj) + state->vect.x;
|
||||
lv_coord_t act_y = lv_obj_get_y(drag_obj) + state->vect.y;
|
||||
lv_obj_set_pos(drag_obj, act_x, act_y);
|
||||
|
||||
/*If non of the coordinates are changed then do not continue throwing*/
|
||||
if((lv_obj_get_x(drag_obj) != act_x || state->vect.x == 0) &&
|
||||
(lv_obj_get_y(drag_obj) != act_y || state->vect.y == 0)) {
|
||||
state->drag_in_prog = 0;
|
||||
state->vect.x = 0;
|
||||
state->vect.y = 0;
|
||||
drag_obj->signal_func(drag_obj, LV_SIGNAL_DRAG_END, indev_act);
|
||||
|
||||
}
|
||||
}
|
||||
/*If the vectors become 0 -> drag_in_prog = 0 and send a drag end signal*/
|
||||
else {
|
||||
state->drag_in_prog = 0;
|
||||
drag_obj->signal_func(drag_obj, LV_SIGNAL_DRAG_END, indev_act);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
128
lv_core/lv_indev.h
Normal file
128
lv_core/lv_indev.h
Normal file
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* @file lv_indev_proc.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_INDEV_H
|
||||
#define LV_INDEV_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_obj.h"
|
||||
#include "../lv_hal/lv_hal_indev.h"
|
||||
#include "../lv_core/lv_group.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize the display input device subsystem
|
||||
*/
|
||||
void lv_indev_init(void);
|
||||
|
||||
/**
|
||||
* Get the currently processed input device. Can be used in action functions too.
|
||||
* @return pointer to the currently processed input device or NULL if no input device processing right now
|
||||
*/
|
||||
lv_indev_t * lv_indev_get_act(void);
|
||||
|
||||
/**
|
||||
* Reset one or all input devices
|
||||
* @param indev pointer to an input device to reset or NULL to reset all of them
|
||||
*/
|
||||
void lv_indev_reset(lv_indev_t * indev);
|
||||
|
||||
/**
|
||||
* Reset the long press state of an input device
|
||||
* @param indev_proc pointer to an input device
|
||||
*/
|
||||
void lv_indev_reset_lpr(lv_indev_t * indev);
|
||||
|
||||
/**
|
||||
* Enable input devices device by type
|
||||
* @param type Input device type
|
||||
* @param enable true: enable this type; false: disable this type
|
||||
*/
|
||||
void lv_indev_enable(lv_hal_indev_type_t type, bool enable);
|
||||
|
||||
/**
|
||||
* Set a cursor for a pointer input device (for LV_INPUT_TYPE_POINTER and LV_INPUT_TYPE_BUTTON)
|
||||
* @param indev pointer to an input device
|
||||
* @param cur_obj pointer to an object to be used as cursor
|
||||
*/
|
||||
void lv_indev_set_cursor(lv_indev_t *indev, lv_obj_t *cur_obj);
|
||||
|
||||
#if USE_LV_GROUP
|
||||
/**
|
||||
* Set a destination group for a keypad input device (for LV_INDEV_TYPE_KEYPAD)
|
||||
* @param indev pointer to an input device
|
||||
* @param group point to a group
|
||||
*/
|
||||
void lv_indev_set_group(lv_indev_t *indev, lv_group_t *group);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Set the an array of points for LV_INDEV_TYPE_BUTTON.
|
||||
* These points will be assigned to the buttons to press a specific point on the screen
|
||||
* @param indev pointer to an input device
|
||||
* @param group point to a group
|
||||
*/
|
||||
void lv_indev_set_button_points(lv_indev_t *indev, lv_point_t *points);
|
||||
|
||||
/**
|
||||
* Get the last point of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON)
|
||||
* @param indev pointer to an input device
|
||||
* @param point pointer to a point to store the result
|
||||
*/
|
||||
void lv_indev_get_point(lv_indev_t * indev, lv_point_t * point);
|
||||
|
||||
/**
|
||||
* Check if there is dragging with an input device or not (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON)
|
||||
* @param indev pointer to an input device
|
||||
* @return true: drag is in progress
|
||||
*/
|
||||
bool lv_indev_is_dragging(lv_indev_t * indev);
|
||||
|
||||
/**
|
||||
* Get the vector of dragging of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON)
|
||||
* @param indev pointer to an input device
|
||||
* @param point pointer to a point to store the vector
|
||||
*/
|
||||
void lv_indev_get_vect(lv_indev_t * indev, lv_point_t * point);
|
||||
/**
|
||||
* Get elapsed time since last press
|
||||
* @param indev pointer to an input device (NULL to get the overall smallest inactivity)
|
||||
* @return Elapsed ticks (milliseconds) since last press
|
||||
*/
|
||||
uint32_t lv_indev_get_inactive_time(lv_indev_t * indev);
|
||||
|
||||
/**
|
||||
* Do nothing until the next release
|
||||
* @param indev pointer to an input device
|
||||
*/
|
||||
void lv_indev_wait_release(lv_indev_t * indev);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_INDEV_H*/
|
||||
File diff suppressed because it is too large
Load Diff
734
lv_core/lv_obj.h
Normal file
734
lv_core/lv_obj.h
Normal file
@@ -0,0 +1,734 @@
|
||||
/**
|
||||
* @file lv_obj.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_OBJ_H
|
||||
#define LV_OBJ_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "../../lv_conf.h"
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include "lv_style.h"
|
||||
#include "../lv_misc/lv_area.h"
|
||||
#include "../lv_misc/lv_mem.h"
|
||||
#include "../lv_misc/lv_ll.h"
|
||||
#include "../lv_misc/lv_color.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/*Error check of lv_conf.h*/
|
||||
#if LV_HOR_RES == 0 || LV_VER_RES == 0
|
||||
#error "LittlevGL: LV_HOR_RES and LV_VER_RES must be greater then 0"
|
||||
#endif
|
||||
|
||||
#if LV_ANTIALIAS > 1
|
||||
#error "LittlevGL: LV_ANTIALIAS can be only 0 or 1"
|
||||
#endif
|
||||
|
||||
#if LV_VDB_SIZE == 0 && LV_ANTIALIAS != 0
|
||||
#error "LittlevGL: If LV_VDB_SIZE == 0 the anti-aliasing must be disabled"
|
||||
#endif
|
||||
|
||||
#if LV_VDB_SIZE > 0 && LV_VDB_SIZE < LV_HOR_RES
|
||||
#error "LittlevGL: Small Virtual Display Buffer (lv_conf.h: LV_VDB_SIZE >= LV_HOR_RES)"
|
||||
#endif
|
||||
|
||||
#if LV_VDB_SIZE == 0 && USE_LV_REAL_DRAW == 0
|
||||
#error "LittlevGL: If LV_VDB_SIZE = 0 Real drawing function are required (lv_conf.h: USE_LV_REAL_DRAW 1)"
|
||||
#endif
|
||||
|
||||
|
||||
#define LV_ANIM_IN 0x00 /*Animation to show an object. 'OR' it with lv_anim_builtin_t*/
|
||||
#define LV_ANIM_OUT 0x80 /*Animation to hide an object. 'OR' it with lv_anim_builtin_t*/
|
||||
#define LV_ANIM_DIR_MASK 0x80 /*ANIM_IN/ANIM_OUT mask*/
|
||||
|
||||
#define LV_MAX_ANCESTOR_NUM 8
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
struct _lv_obj_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
LV_DESIGN_DRAW_MAIN,
|
||||
LV_DESIGN_DRAW_POST,
|
||||
LV_DESIGN_COVER_CHK,
|
||||
}lv_design_mode_t;
|
||||
|
||||
typedef bool (* lv_design_func_t) (struct _lv_obj_t * obj, const lv_area_t * mask_p, lv_design_mode_t mode);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
LV_RES_INV = 0, /*Typically indicates that the object is deleted (become invalid) in the action function*/
|
||||
LV_RES_OK, /*The object is valid (no deleted) after the action*/
|
||||
}lv_res_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/*General signals*/
|
||||
LV_SIGNAL_CLEANUP,
|
||||
LV_SIGNAL_CHILD_CHG,
|
||||
LV_SIGNAL_CORD_CHG,
|
||||
LV_SIGNAL_STYLE_CHG,
|
||||
LV_SIGNAL_REFR_EXT_SIZE,
|
||||
LV_SIGNAL_GET_TYPE,
|
||||
|
||||
/*Input device related*/
|
||||
LV_SIGNAL_PRESSED,
|
||||
LV_SIGNAL_PRESSING,
|
||||
LV_SIGNAL_PRESS_LOST,
|
||||
LV_SIGNAL_RELEASED,
|
||||
LV_SIGNAL_LONG_PRESS,
|
||||
LV_SIGNAL_LONG_PRESS_REP,
|
||||
LV_SIGNAL_DRAG_BEGIN,
|
||||
LV_SIGNAL_DRAG_END,
|
||||
|
||||
/*Group related*/
|
||||
LV_SIGNAL_FOCUS,
|
||||
LV_SIGNAL_DEFOCUS,
|
||||
LV_SIGNAL_CONTROLL,
|
||||
}lv_signal_t;
|
||||
|
||||
typedef lv_res_t (* lv_signal_func_t) (struct _lv_obj_t * obj, lv_signal_t sign, void * param);
|
||||
|
||||
typedef struct _lv_obj_t
|
||||
{
|
||||
struct _lv_obj_t * par; /*Pointer to the parent object*/
|
||||
lv_ll_t child_ll; /*Linked list to store the children objects*/
|
||||
|
||||
lv_area_t coords; /*Coordinates of the object (x1, y1, x2, y2)*/
|
||||
|
||||
lv_signal_func_t signal_func; /*Object type specific signal function*/
|
||||
lv_design_func_t design_func; /*Object type specific design function*/
|
||||
|
||||
void * ext_attr; /*Object type specific extended data*/
|
||||
lv_style_t * style_p; /*Pointer to the object's style*/
|
||||
|
||||
#if LV_OBJ_FREE_PTR != 0
|
||||
void * free_ptr; /*Application specific pointer (set it freely)*/
|
||||
#endif
|
||||
|
||||
#if USE_LV_GROUP != 0
|
||||
void * group_p; /*Pointer to the group of the object*/
|
||||
#endif
|
||||
/*Attributes and states*/
|
||||
uint8_t click :1; /*1: Can be pressed by an input device*/
|
||||
uint8_t drag :1; /*1: Enable the dragging*/
|
||||
uint8_t drag_throw:1; /*1: Enable throwing with drag*/
|
||||
uint8_t drag_parent :1; /*1: Parent will be dragged instead*/
|
||||
uint8_t hidden :1; /*1: Object is hidden*/
|
||||
uint8_t top :1; /*1: If the object or its children is clicked it goes to the foreground*/
|
||||
uint8_t reserved :1;
|
||||
|
||||
uint8_t protect; /*Automatically happening actions can be prevented. 'OR'ed values from lv_obj_prot_t*/
|
||||
|
||||
lv_coord_t ext_size; /*EXTtend the size of the object in every direction. E.g. for shadow drawing*/
|
||||
|
||||
#ifdef LV_OBJ_FREE_NUM_TYPE
|
||||
LV_OBJ_FREE_NUM_TYPE free_num; /*Application specific identifier (set it freely)*/
|
||||
#endif
|
||||
}lv_obj_t;
|
||||
|
||||
typedef lv_res_t (*lv_action_t) (struct _lv_obj_t * obj);
|
||||
|
||||
/*Protect some attributes (max. 8 bit)*/
|
||||
typedef enum
|
||||
{
|
||||
LV_PROTECT_NONE = 0x00,
|
||||
LV_PROTECT_CHILD_CHG = 0x01, /*Disable the child change signal. Used by the library*/
|
||||
LV_PROTECT_PARENT = 0x02, /*Prevent automatic parent change (e.g. in lv_page)*/
|
||||
LV_PROTECT_POS = 0x04, /*Prevent automatic positioning (e.g. in lv_cont layout)*/
|
||||
LV_PROTECT_FOLLOW = 0x08, /*Prevent the object be followed in automatic ordering (e.g. in lv_cont PRETTY layout)*/
|
||||
LV_PROTECT_PRESS_LOST= 0x10, /*TODO */
|
||||
}lv_protect_t;
|
||||
|
||||
|
||||
/*Used by `lv_obj_get_type()`. The object's and its ancestor types are stored here*/
|
||||
typedef struct {
|
||||
const char * type[LV_MAX_ANCESTOR_NUM]; /*[0]: the actual type, [1]: ancestor, [2] #1's ancestor ... [x]: "lv_obj" */
|
||||
}lv_obj_type_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
LV_ALIGN_CENTER = 0,
|
||||
LV_ALIGN_IN_TOP_LEFT,
|
||||
LV_ALIGN_IN_TOP_MID,
|
||||
LV_ALIGN_IN_TOP_RIGHT,
|
||||
LV_ALIGN_IN_BOTTOM_LEFT,
|
||||
LV_ALIGN_IN_BOTTOM_MID,
|
||||
LV_ALIGN_IN_BOTTOM_RIGHT,
|
||||
LV_ALIGN_IN_LEFT_MID,
|
||||
LV_ALIGN_IN_RIGHT_MID,
|
||||
LV_ALIGN_OUT_TOP_LEFT,
|
||||
LV_ALIGN_OUT_TOP_MID,
|
||||
LV_ALIGN_OUT_TOP_RIGHT,
|
||||
LV_ALIGN_OUT_BOTTOM_LEFT,
|
||||
LV_ALIGN_OUT_BOTTOM_MID,
|
||||
LV_ALIGN_OUT_BOTTOM_RIGHT,
|
||||
LV_ALIGN_OUT_LEFT_TOP,
|
||||
LV_ALIGN_OUT_LEFT_MID,
|
||||
LV_ALIGN_OUT_LEFT_BOTTOM,
|
||||
LV_ALIGN_OUT_RIGHT_TOP,
|
||||
LV_ALIGN_OUT_RIGHT_MID,
|
||||
LV_ALIGN_OUT_RIGHT_BOTTOM,
|
||||
}lv_align_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
LV_ANIM_NONE = 0,
|
||||
LV_ANIM_FLOAT_TOP, /*Float from/to the top*/
|
||||
LV_ANIM_FLOAT_LEFT, /*Float from/to the left*/
|
||||
LV_ANIM_FLOAT_BOTTOM, /*Float from/to the bottom*/
|
||||
LV_ANIM_FLOAT_RIGHT, /*Float from/to the right*/
|
||||
LV_ANIM_GROW_H, /*Grow/shrink horizontally*/
|
||||
LV_ANIM_GROW_V, /*Grow/shrink vertically*/
|
||||
}lv_anim_builtin_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Init. the 'lv' library.
|
||||
*/
|
||||
void lv_init(void);
|
||||
|
||||
/*--------------------
|
||||
* Create and delete
|
||||
*-------------------*/
|
||||
|
||||
/**
|
||||
* Create a basic object
|
||||
* @param parent pointer to a parent object.
|
||||
* If NULL then a screen will be created
|
||||
* @param copy pointer to a base object, if not NULL then the new object will be copied from it
|
||||
* @return pointer to the new object
|
||||
*/
|
||||
lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy);
|
||||
|
||||
/**
|
||||
* Delete 'obj' and all of its children
|
||||
* @param obj pointer to an object to delete
|
||||
* @return LV_RES_INV because the object is deleted
|
||||
*/
|
||||
lv_res_t lv_obj_del(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Delete all children of an object
|
||||
* @param obj pointer to an object
|
||||
*/
|
||||
void lv_obj_clean(lv_obj_t *obj);
|
||||
|
||||
/**
|
||||
* Mark the object as invalid therefore its current position will be redrawn by 'lv_refr_task'
|
||||
* @param obj pointer to an object
|
||||
*/
|
||||
void lv_obj_invalidate(lv_obj_t * obj);
|
||||
|
||||
/*=====================
|
||||
* Setter functions
|
||||
*====================*/
|
||||
|
||||
/*--------------
|
||||
* Screen set
|
||||
*--------------*/
|
||||
|
||||
/**
|
||||
* Load a new screen
|
||||
* @param scr pointer to a screen
|
||||
*/
|
||||
void lv_scr_load(lv_obj_t * scr);
|
||||
|
||||
/*--------------------
|
||||
* Parent/children set
|
||||
*--------------------*/
|
||||
|
||||
/**
|
||||
* Set a new parent for an object. Its relative position will be the same.
|
||||
* @param obj pointer to an object
|
||||
* @param parent pointer to the new parent object
|
||||
*/
|
||||
void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent);
|
||||
|
||||
/*--------------------
|
||||
* Coordinate set
|
||||
* ------------------*/
|
||||
|
||||
/**
|
||||
* Set relative the position of an object (relative to the parent)
|
||||
* @param obj pointer to an object
|
||||
* @param x new distance from the left side of the parent
|
||||
* @param y new distance from the top of the parent
|
||||
*/
|
||||
void lv_obj_set_pos(lv_obj_t * obj, lv_coord_t x, lv_coord_t y);
|
||||
|
||||
/**
|
||||
* Set the x coordinate of a object
|
||||
* @param obj pointer to an object
|
||||
* @param x new distance from the left side from the parent
|
||||
*/
|
||||
void lv_obj_set_x(lv_obj_t * obj, lv_coord_t x);
|
||||
|
||||
/**
|
||||
* Set the y coordinate of a object
|
||||
* @param obj pointer to an object
|
||||
* @param y new distance from the top of the parent
|
||||
*/
|
||||
void lv_obj_set_y(lv_obj_t * obj, lv_coord_t y);
|
||||
|
||||
/**
|
||||
* Set the size of an object
|
||||
* @param obj pointer to an object
|
||||
* @param w new width
|
||||
* @param h new height
|
||||
*/
|
||||
void lv_obj_set_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h);
|
||||
|
||||
/**
|
||||
* Set the width of an object
|
||||
* @param obj pointer to an object
|
||||
* @param w new width
|
||||
*/
|
||||
void lv_obj_set_width(lv_obj_t * obj, lv_coord_t w);
|
||||
|
||||
/**
|
||||
* Set the height of an object
|
||||
* @param obj pointer to an object
|
||||
* @param h new height
|
||||
*/
|
||||
void lv_obj_set_height(lv_obj_t * obj, lv_coord_t h);
|
||||
|
||||
/**
|
||||
* Align an object to an other object.
|
||||
* @param obj pointer to an object to align
|
||||
* @param base pointer to an object (if NULL the parent is used). 'obj' will be aligned to it.
|
||||
* @param align type of alignment (see 'lv_align_t' enum)
|
||||
* @param x_mod x coordinate shift after alignment
|
||||
* @param y_mod y coordinate shift after alignment
|
||||
*/
|
||||
void lv_obj_align(lv_obj_t * obj,lv_obj_t * base, lv_align_t align, lv_coord_t x_mod, lv_coord_t y_mod);
|
||||
|
||||
|
||||
/*---------------------
|
||||
* Appearance set
|
||||
*--------------------*/
|
||||
|
||||
/**
|
||||
* Set a new style for an object
|
||||
* @param obj pointer to an object
|
||||
* @param style_p pointer to the new style
|
||||
*/
|
||||
void lv_obj_set_style(lv_obj_t * obj, lv_style_t * style);
|
||||
|
||||
/**
|
||||
* Notify an object about its style is modified
|
||||
* @param obj pointer to an object
|
||||
*/
|
||||
void lv_obj_refresh_style(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Notify all object if a style is modified
|
||||
* @param style pointer to a style. Only the objects with this style will be notified
|
||||
* (NULL to notify all objects)
|
||||
*/
|
||||
void lv_obj_report_style_mod(lv_style_t * style);
|
||||
|
||||
/*-----------------
|
||||
* Attribute set
|
||||
*----------------*/
|
||||
|
||||
/**
|
||||
* Hide an object. It won't be visible and clickable.
|
||||
* @param obj pointer to an object
|
||||
* @param en true: hide the object
|
||||
*/
|
||||
void lv_obj_set_hidden(lv_obj_t * obj, bool en);
|
||||
|
||||
/**
|
||||
* Enable or disable the clicking of an object
|
||||
* @param obj pointer to an object
|
||||
* @param en true: make the object clickable
|
||||
*/
|
||||
void lv_obj_set_click(lv_obj_t * obj, bool en);
|
||||
|
||||
/**
|
||||
* Enable to bring this object to the foreground if it
|
||||
* or any of its children is clicked
|
||||
* @param obj pointer to an object
|
||||
* @param en true: enable the auto top feature
|
||||
*/
|
||||
void lv_obj_set_top(lv_obj_t * obj, bool en);
|
||||
|
||||
/**
|
||||
* Enable the dragging of an object
|
||||
* @param obj pointer to an object
|
||||
* @param en true: make the object dragable
|
||||
*/
|
||||
void lv_obj_set_drag(lv_obj_t * obj, bool en);
|
||||
|
||||
/**
|
||||
* Enable the throwing of an object after is is dragged
|
||||
* @param obj pointer to an object
|
||||
* @param en true: enable the drag throw
|
||||
*/
|
||||
void lv_obj_set_drag_throw(lv_obj_t * obj, bool en);
|
||||
|
||||
/**
|
||||
* Enable to use parent for drag related operations.
|
||||
* If trying to drag the object the parent will be moved instead
|
||||
* @param obj pointer to an object
|
||||
* @param en true: enable the 'drag parent' for the object
|
||||
*/
|
||||
void lv_obj_set_drag_parent(lv_obj_t * obj, bool en);
|
||||
|
||||
/**
|
||||
* Set a bit or bits in the protect filed
|
||||
* @param obj pointer to an object
|
||||
* @param prot 'OR'-ed values from lv_obj_prot_t
|
||||
*/
|
||||
void lv_obj_set_protect(lv_obj_t * obj, uint8_t prot);
|
||||
|
||||
/**
|
||||
* Clear a bit or bits in the protect filed
|
||||
* @param obj pointer to an object
|
||||
* @param prot 'OR'-ed values from lv_obj_prot_t
|
||||
*/
|
||||
void lv_obj_clear_protect(lv_obj_t * obj, uint8_t prot);
|
||||
|
||||
/**
|
||||
* Set the signal function of an object.
|
||||
* Always call the previous signal function in the new.
|
||||
* @param obj pointer to an object
|
||||
* @param fp the new signal function
|
||||
*/
|
||||
void lv_obj_set_signal_func(lv_obj_t * obj, lv_signal_func_t fp);
|
||||
|
||||
/**
|
||||
* Set a new design function for an object
|
||||
* @param obj pointer to an object
|
||||
* @param fp the new design function
|
||||
*/
|
||||
void lv_obj_set_design_func(lv_obj_t * obj, lv_design_func_t fp);
|
||||
|
||||
/*----------------
|
||||
* Other set
|
||||
*--------------*/
|
||||
|
||||
/**
|
||||
* Allocate a new ext. data for an object
|
||||
* @param obj pointer to an object
|
||||
* @param ext_size the size of the new ext. data
|
||||
* @return pointer to the allocated ext
|
||||
*/
|
||||
void * lv_obj_allocate_ext_attr(lv_obj_t * obj, uint16_t ext_size);
|
||||
|
||||
/**
|
||||
* Send a 'LV_SIGNAL_REFR_EXT_SIZE' signal to the object
|
||||
* @param obj pointer to an object
|
||||
*/
|
||||
void lv_obj_refresh_ext_size(lv_obj_t * obj);
|
||||
|
||||
#ifdef LV_OBJ_FREE_NUM_TYPE
|
||||
/**
|
||||
* Set an application specific number for an object.
|
||||
* It can help to identify objects in the application.
|
||||
* @param obj pointer to an object
|
||||
* @param free_num the new free number
|
||||
*/
|
||||
void lv_obj_set_free_num(lv_obj_t * obj, LV_OBJ_FREE_NUM_TYPE free_num);
|
||||
#endif
|
||||
|
||||
#if LV_OBJ_FREE_PTR != 0
|
||||
/**
|
||||
* Set an application specific pointer for an object.
|
||||
* It can help to identify objects in the application.
|
||||
* @param obj pointer to an object
|
||||
* @param free_p the new free pinter
|
||||
*/
|
||||
void lv_obj_set_free_ptr(lv_obj_t * obj, void * free_p);
|
||||
#endif
|
||||
|
||||
#if USE_LV_ANIMATION
|
||||
/**
|
||||
* Animate an object
|
||||
* @param obj pointer to an object to animate
|
||||
* @param type type of animation from 'lv_anim_builtin_t'. 'OR' it with ANIM_IN or ANIM_OUT
|
||||
* @param time time of animation in milliseconds
|
||||
* @param delay delay before the animation in milliseconds
|
||||
* @param cb a function to call when the animation is ready
|
||||
*/
|
||||
void lv_obj_animate(lv_obj_t * obj, lv_anim_builtin_t type, uint16_t time, uint16_t delay, void (*cb) (lv_obj_t *));
|
||||
#endif
|
||||
|
||||
/*=======================
|
||||
* Getter functions
|
||||
*======================*/
|
||||
|
||||
/*------------------
|
||||
* Screen get
|
||||
*-----------------*/
|
||||
|
||||
/**
|
||||
* Return with a pointer to the active screen
|
||||
* @return pointer to the active screen object (loaded by 'lv_scr_load()')
|
||||
*/
|
||||
lv_obj_t * lv_scr_act(void);
|
||||
|
||||
/**
|
||||
* Return with the top layer. (Same on every screen and it is above the normal screen layer)
|
||||
* @return pointer to the top layer object (transparent screen sized lv_obj)
|
||||
*/
|
||||
lv_obj_t * lv_layer_top(void);
|
||||
|
||||
/**
|
||||
* Return with the system layer. (Same on every screen and it is above the all other layers)
|
||||
* It is used for example by the cursor
|
||||
* @return pointer to the system layer object (transparent screen sized lv_obj)
|
||||
*/
|
||||
lv_obj_t * lv_layer_sys(void);
|
||||
|
||||
/**
|
||||
* Return with the screen of an object
|
||||
* @param obj pointer to an object
|
||||
* @return pointer to a screen
|
||||
*/
|
||||
lv_obj_t * lv_obj_get_screen(lv_obj_t * obj);
|
||||
|
||||
/*---------------------
|
||||
* Parent/children get
|
||||
*--------------------*/
|
||||
|
||||
/**
|
||||
* Returns with the parent of an object
|
||||
* @param obj pointer to an object
|
||||
* @return pointer to the parent of 'obj'
|
||||
*/
|
||||
lv_obj_t * lv_obj_get_parent(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Iterate through the children of an object (start from the "youngest, lastly created")
|
||||
* @param obj pointer to an object
|
||||
* @param child NULL at first call to get the next children
|
||||
* and the previous return value later
|
||||
* @return the child after 'act_child' or NULL if no more child
|
||||
*/
|
||||
lv_obj_t * lv_obj_get_child(lv_obj_t * obj, lv_obj_t * child);
|
||||
|
||||
/**
|
||||
* Iterate through the children of an object (start from the "oldest", firstly created)
|
||||
* @param obj pointer to an object
|
||||
* @param child NULL at first call to get the next children
|
||||
* and the previous return value later
|
||||
* @return the child after 'act_child' or NULL if no more child
|
||||
*/
|
||||
lv_obj_t * lv_obj_get_child_back(lv_obj_t * obj, lv_obj_t * child);
|
||||
|
||||
/**
|
||||
* Count the children of an object (only children directly on 'obj')
|
||||
* @param obj pointer to an object
|
||||
* @return children number of 'obj'
|
||||
*/
|
||||
uint16_t lv_obj_count_children(lv_obj_t * obj);
|
||||
|
||||
/*---------------------
|
||||
* Coordinate get
|
||||
*--------------------*/
|
||||
|
||||
/**
|
||||
* Copy the coordinates of an object to an area
|
||||
* @param obj pointer to an object
|
||||
* @param cords_p pointer to an area to store the coordinates
|
||||
*/
|
||||
void lv_obj_get_coords(lv_obj_t * obj, lv_area_t * cords_p);
|
||||
|
||||
/**
|
||||
* Get the x coordinate of object
|
||||
* @param obj pointer to an object
|
||||
* @return distance of 'obj' from the left side of its parent
|
||||
*/
|
||||
lv_coord_t lv_obj_get_x(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get the y coordinate of object
|
||||
* @param obj pointer to an object
|
||||
* @return distance of 'obj' from the top of its parent
|
||||
*/
|
||||
lv_coord_t lv_obj_get_y(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get the width of an object
|
||||
* @param obj pointer to an object
|
||||
* @return the width
|
||||
*/
|
||||
lv_coord_t lv_obj_get_width(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get the height of an object
|
||||
* @param obj pointer to an object
|
||||
* @return the height
|
||||
*/
|
||||
lv_coord_t lv_obj_get_height(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get the extended size attribute of an object
|
||||
* @param obj pointer to an object
|
||||
* @return the extended size attribute
|
||||
*/
|
||||
lv_coord_t lv_obj_get_ext_size(lv_obj_t * obj);
|
||||
|
||||
/*-----------------
|
||||
* Appearance get
|
||||
*---------------*/
|
||||
|
||||
/**
|
||||
* Get the style pointer of an object (if NULL get style of the parent)
|
||||
* @param obj pointer to an object
|
||||
* @return pointer to a style
|
||||
*/
|
||||
lv_style_t * lv_obj_get_style(lv_obj_t * obj);
|
||||
|
||||
/*-----------------
|
||||
* Attribute get
|
||||
*----------------*/
|
||||
|
||||
/**
|
||||
* Get the hidden attribute of an object
|
||||
* @param obj pointer to an object
|
||||
* @return true: the object is hidden
|
||||
*/
|
||||
bool lv_obj_get_hidden(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get the click enable attribute of an object
|
||||
* @param obj pointer to an object
|
||||
* @return true: the object is clickable
|
||||
*/
|
||||
bool lv_obj_get_click(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get the top enable attribute of an object
|
||||
* @param obj pointer to an object
|
||||
* @return true: the auto top feture is enabled
|
||||
*/
|
||||
bool lv_obj_get_top(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get the drag enable attribute of an object
|
||||
* @param obj pointer to an object
|
||||
* @return true: the object is dragable
|
||||
*/
|
||||
bool lv_obj_get_drag(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get the drag thow enable attribute of an object
|
||||
* @param obj pointer to an object
|
||||
* @return true: drag throw is enabled
|
||||
*/
|
||||
bool lv_obj_get_drag_throw(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get the drag parent attribute of an object
|
||||
* @param obj pointer to an object
|
||||
* @return true: drag parent is enabled
|
||||
*/
|
||||
bool lv_obj_get_drag_parent(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get the protect field of an object
|
||||
* @param obj pointer to an object
|
||||
* @return protect field ('OR'ed values of lv_obj_prot_t)
|
||||
*/
|
||||
uint8_t lv_obj_get_protect(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Check at least one bit of a given protect bitfield is set
|
||||
* @param obj pointer to an object
|
||||
* @param prot protect bits to test ('OR'ed values of lv_obj_prot_t)
|
||||
* @return false: none of the given bits are set, true: at least one bit is set
|
||||
*/
|
||||
bool lv_obj_is_protected(lv_obj_t * obj, uint8_t prot);
|
||||
|
||||
/**
|
||||
* Get the signal function of an object
|
||||
* @param obj pointer to an object
|
||||
* @return the signal function
|
||||
*/
|
||||
lv_signal_func_t lv_obj_get_signal_func(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get the design function of an object
|
||||
* @param obj pointer to an object
|
||||
* @return the design function
|
||||
*/
|
||||
lv_design_func_t lv_obj_get_design_func(lv_obj_t * obj);
|
||||
|
||||
/*------------------
|
||||
* Other get
|
||||
*-----------------*/
|
||||
|
||||
/**
|
||||
* Get the ext pointer
|
||||
* @param obj pointer to an object
|
||||
* @return the ext pointer but not the dynamic version
|
||||
* Use it as ext->data1, and NOT da(ext)->data1
|
||||
*/
|
||||
void * lv_obj_get_ext_attr(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get object's and its ancestors type. Put their name in `type_buf` starting with the current type.
|
||||
* E.g. buf.type[0]="lv_btn", buf.type[1]="lv_cont", buf.type[2]="lv_obj"
|
||||
* @param obj pointer to an object which type should be get
|
||||
* @param buf pointer to an `lv_obj_type_t` buffer to store the types
|
||||
*/
|
||||
void lv_obj_get_type(lv_obj_t * obj, lv_obj_type_t * buf);
|
||||
|
||||
#ifdef LV_OBJ_FREE_NUM_TYPE
|
||||
/**
|
||||
* Get the free number
|
||||
* @param obj pointer to an object
|
||||
* @return the free number
|
||||
*/
|
||||
LV_OBJ_FREE_NUM_TYPE lv_obj_get_free_num(lv_obj_t * obj);
|
||||
#endif
|
||||
|
||||
#if LV_OBJ_FREE_PTR != 0
|
||||
/**
|
||||
* Get the free pointer
|
||||
* @param obj pointer to an object
|
||||
* @return the free pointer
|
||||
*/
|
||||
void * lv_obj_get_free_ptr(lv_obj_t * obj);
|
||||
#endif
|
||||
|
||||
#if USE_LV_GROUP
|
||||
/**
|
||||
* Get the group of the object
|
||||
* @param obj pointer to an object
|
||||
* @return the pointer to group of the object
|
||||
*/
|
||||
void * lv_obj_get_group(lv_obj_t * obj);
|
||||
#endif
|
||||
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
#define LV_SCALE(x) (x << LV_ANTIALIAS)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_OBJ_H*/
|
||||
@@ -6,12 +6,13 @@
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "../../lv_conf.h"
|
||||
#include <stddef.h>
|
||||
#include "lv_conf.h"
|
||||
#include "misc/os/ptask.h"
|
||||
#include "misc/mem/fifo.h"
|
||||
#include "lv_refr.h"
|
||||
#include "lv_vdb.h"
|
||||
#include "../lv_hal/lv_hal_tick.h"
|
||||
#include "../lv_misc/lv_task.h"
|
||||
#include "../lv_misc/lv_mem.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -22,7 +23,7 @@
|
||||
**********************/
|
||||
typedef struct
|
||||
{
|
||||
area_t area;
|
||||
lv_area_t area;
|
||||
uint8_t joined;
|
||||
}lv_join_t;
|
||||
|
||||
@@ -33,20 +34,23 @@ static void lv_refr_task(void * param);
|
||||
static void lv_refr_join_area(void);
|
||||
static void lv_refr_areas(void);
|
||||
#if LV_VDB_SIZE == 0
|
||||
static void lv_refr_area_no_vdb(const area_t * area_p);
|
||||
static void lv_refr_area_no_vdb(const lv_area_t * area_p);
|
||||
#else
|
||||
static void lv_refr_area_with_vdb(const area_t * area_p);
|
||||
static void lv_refr_area_part_vdb(const area_t * area_p);
|
||||
static void lv_refr_area_with_vdb(const lv_area_t * area_p);
|
||||
static void lv_refr_area_part_vdb(const lv_area_t * area_p);
|
||||
#endif
|
||||
static lv_obj_t * lv_refr_get_top_obj(const area_t * area_p, lv_obj_t * obj);
|
||||
static void lv_refr_make(lv_obj_t * top_p, const area_t * mask_p);
|
||||
static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p);
|
||||
static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj);
|
||||
static void lv_refr_obj_and_children(lv_obj_t * top_p, const lv_area_t * mask_p);
|
||||
static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_p);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
lv_join_t inv_buf[LV_INV_FIFO_SIZE];
|
||||
uint16_t inv_buf_p;
|
||||
static lv_join_t inv_buf[LV_INV_FIFO_SIZE];
|
||||
static uint16_t inv_buf_p;
|
||||
static void (*monitor_cb)(uint32_t, uint32_t); /*Monitor the rendering time*/
|
||||
static void (*round_cb)(lv_area_t*); /*If set then called to modify invalidated areas for special display controllers*/
|
||||
static uint32_t px_num;
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
@@ -64,58 +68,96 @@ void lv_refr_init(void)
|
||||
inv_buf_p = 0;
|
||||
memset(inv_buf, 0, sizeof(inv_buf));
|
||||
|
||||
ptask_t* task;
|
||||
task = ptask_create(lv_refr_task, LV_REFR_PERIOD, PTASK_PRIO_MID, NULL);
|
||||
dm_assert(task);
|
||||
|
||||
lv_task_t* task;
|
||||
task = lv_task_create(lv_refr_task, LV_REFR_PERIOD, LV_TASK_PRIO_MID, NULL);
|
||||
lv_task_ready(task); /*Be sure the screen will be refreshed immediately on start up*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidate an area
|
||||
* @param area_p pointer to area which should be invalidated
|
||||
*/
|
||||
void lv_inv_area(const area_t * area_p)
|
||||
void lv_inv_area(const lv_area_t * area_p)
|
||||
{
|
||||
area_t scr_area;
|
||||
/*Clear the invalidate buffer if the parameter is NULL*/
|
||||
if(area_p == NULL) {
|
||||
inv_buf_p = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
lv_area_t scr_area;
|
||||
scr_area.x1 = 0;
|
||||
scr_area.y1 = 0;
|
||||
scr_area.x2 = LV_HOR_RES - 1;
|
||||
scr_area.y2 = LV_VER_RES - 1;
|
||||
|
||||
area_t com_area;
|
||||
lv_area_t com_area;
|
||||
bool suc;
|
||||
|
||||
suc = area_union(&com_area, area_p, &scr_area);
|
||||
suc = lv_area_union(&com_area, area_p, &scr_area);
|
||||
|
||||
/*The area is truncated to the screen*/
|
||||
if(suc != false)
|
||||
{
|
||||
#if LV_DOWNSCALE == 2
|
||||
/*Rounding*/
|
||||
com_area.x1 = com_area.x1 & (~0x1);
|
||||
com_area.y1 = com_area.y1 & (~0x1);
|
||||
com_area.x2 = com_area.x2 | 0x1;
|
||||
com_area.y2 = com_area.y2 | 0x1;
|
||||
#endif
|
||||
if(suc != false) {
|
||||
if(round_cb) round_cb(&com_area);
|
||||
|
||||
/*Save only if this area is not in one of the saved areas*/
|
||||
uint16_t i;
|
||||
for(i = 0; i < inv_buf_p; i++) {
|
||||
if(area_is_in(&com_area, &inv_buf[i].area) != false) return;
|
||||
if(lv_area_is_in(&com_area, &inv_buf[i].area) != false) return;
|
||||
}
|
||||
|
||||
|
||||
/*Save the area*/
|
||||
if(inv_buf_p < LV_INV_FIFO_SIZE) {
|
||||
area_cpy(&inv_buf[inv_buf_p].area,&com_area);
|
||||
lv_area_copy(&inv_buf[inv_buf_p].area,&com_area);
|
||||
} else {/*If no place for the area add the screen*/
|
||||
inv_buf_p = 0;
|
||||
area_cpy(&inv_buf[inv_buf_p].area,&scr_area);
|
||||
lv_area_copy(&inv_buf[inv_buf_p].area,&scr_area);
|
||||
}
|
||||
inv_buf_p ++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a function to call after every refresh to announce the refresh time and the number of refreshed pixels
|
||||
* @param cb pointer to a callback function (void my_refr_cb(uint32_t time_ms, uint32_t px_num))
|
||||
* time_ms: refresh time in [ms]
|
||||
* px_num: not the drawn pixels but the number of affected pixels of the screen
|
||||
* (more pixels are drawn because of overlapping objects)
|
||||
*/
|
||||
void lv_refr_set_monitor_cb(void (*cb)(uint32_t, uint32_t))
|
||||
{
|
||||
monitor_cb = cb;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when an area is invalidated to modify the coordinates of the area.
|
||||
* Special display controllers may require special coordinate rounding
|
||||
* @param cb pointer to the a function which will modify the area
|
||||
*/
|
||||
void lv_refr_set_round_cb(void(*cb)(lv_area_t*))
|
||||
{
|
||||
round_cb = cb;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the number of areas in the buffer
|
||||
* @return number of invalid areas
|
||||
*/
|
||||
uint16_t lv_refr_get_buf_size(void)
|
||||
{
|
||||
return inv_buf_p;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pop (delete) the last 'num' invalidated areas from the buffer
|
||||
* @param num number of areas to delete
|
||||
*/
|
||||
void lv_refr_pop_from_buf(uint16_t num)
|
||||
{
|
||||
if(inv_buf_p < num) inv_buf_p = 0;
|
||||
else inv_buf_p -= num;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
@@ -126,12 +168,26 @@ void lv_inv_area(const area_t * area_p)
|
||||
*/
|
||||
static void lv_refr_task(void * param)
|
||||
{
|
||||
(void)param;
|
||||
|
||||
uint32_t start = lv_tick_get();
|
||||
|
||||
lv_refr_join_area();
|
||||
|
||||
lv_refr_areas();
|
||||
|
||||
bool refr_done = false;
|
||||
if(inv_buf_p != 0) refr_done = true;
|
||||
memset(inv_buf, 0, sizeof(inv_buf));
|
||||
inv_buf_p = 0;
|
||||
|
||||
/* In the callback lv_obj_inv can occur
|
||||
* therefore be sure the inv_buf is cleared prior to it*/
|
||||
if(refr_done != false) {
|
||||
if(monitor_cb != NULL) {
|
||||
monitor_cb(lv_tick_elaps(start), px_num);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +198,7 @@ static void lv_refr_join_area(void)
|
||||
{
|
||||
uint32_t join_from;
|
||||
uint32_t join_in;
|
||||
area_t joined_area;
|
||||
lv_area_t joined_area;
|
||||
for(join_in = 0; join_in < inv_buf_p; join_in++) {
|
||||
if(inv_buf[join_in].joined != 0) continue;
|
||||
|
||||
@@ -154,19 +210,19 @@ static void lv_refr_join_area(void)
|
||||
}
|
||||
|
||||
/*Check if the areas are on each other*/
|
||||
if(area_is_on(&inv_buf[join_in].area,
|
||||
if(lv_area_is_on(&inv_buf[join_in].area,
|
||||
&inv_buf[join_from].area) == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
area_join(&joined_area, &inv_buf[join_in].area,
|
||||
lv_area_join(&joined_area, &inv_buf[join_in].area,
|
||||
&inv_buf[join_from].area);
|
||||
|
||||
/*Join two area only if the joined area size is smaller*/
|
||||
if(area_get_size(&joined_area) <
|
||||
(area_get_size(&inv_buf[join_in].area) + area_get_size(&inv_buf[join_from].area))) {
|
||||
area_cpy(&inv_buf[join_in].area, &joined_area);
|
||||
if(lv_area_get_size(&joined_area) <
|
||||
(lv_area_get_size(&inv_buf[join_in].area) + lv_area_get_size(&inv_buf[join_from].area))) {
|
||||
lv_area_copy(&inv_buf[join_in].area, &joined_area);
|
||||
|
||||
/*Mark 'join_form' is joined into 'join_in'*/
|
||||
inv_buf[join_from].joined = 1;
|
||||
@@ -180,8 +236,9 @@ static void lv_refr_join_area(void)
|
||||
*/
|
||||
static void lv_refr_areas(void)
|
||||
{
|
||||
px_num = 0;
|
||||
uint32_t i;
|
||||
|
||||
|
||||
for(i = 0; i < inv_buf_p; i++) {
|
||||
/*Refresh the unjoined areas*/
|
||||
if(inv_buf[i].joined == 0) {
|
||||
@@ -192,9 +249,10 @@ static void lv_refr_areas(void)
|
||||
/*If VDB is used...*/
|
||||
lv_refr_area_with_vdb(&inv_buf[i].area);
|
||||
#endif
|
||||
|
||||
if(monitor_cb != NULL) px_num += lv_area_get_size(&inv_buf[i].area);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if LV_VDB_SIZE == 0
|
||||
@@ -202,7 +260,7 @@ static void lv_refr_areas(void)
|
||||
* Refresh an area if there is no Virtual Display Buffer
|
||||
* @param area_p pointer to an area to refresh
|
||||
*/
|
||||
static void lv_refr_area_no_vdb(const area_t * area_p)
|
||||
static void lv_refr_area_no_vdb(const lv_area_t * area_p)
|
||||
{
|
||||
lv_obj_t * top_p;
|
||||
|
||||
@@ -210,7 +268,7 @@ static void lv_refr_area_no_vdb(const area_t * area_p)
|
||||
top_p = lv_refr_get_top_obj(area_p, lv_scr_act());
|
||||
|
||||
/*Do the refreshing*/
|
||||
lv_refr_make(top_p, area_p);
|
||||
lv_refr_obj_and_children(top_p, area_p);
|
||||
}
|
||||
|
||||
#else
|
||||
@@ -219,40 +277,41 @@ static void lv_refr_area_no_vdb(const area_t * area_p)
|
||||
* Refresh an area if there is Virtual Display Buffer
|
||||
* @param area_p pointer to an area to refresh
|
||||
*/
|
||||
static void lv_refr_area_with_vdb(const area_t * area_p)
|
||||
static void lv_refr_area_with_vdb(const lv_area_t * area_p)
|
||||
{
|
||||
lv_vdb_t * vdb_p = lv_vdb_get();
|
||||
|
||||
/*Always use the full row*/
|
||||
vdb_p->vdb_area.x1 = area_p->x1;
|
||||
vdb_p->vdb_area.y1 = area_p->y1;
|
||||
vdb_p->vdb_area.x2 = area_p->x2;
|
||||
|
||||
/*Calculate the max row num*/
|
||||
uint32_t max_row = (uint32_t) LV_VDB_SIZE / (vdb_p->vdb_area.x2 - vdb_p->vdb_area.x1 + 1);
|
||||
if(max_row > area_get_height(area_p)) max_row = area_get_height(area_p);
|
||||
|
||||
/*Round the row number with downscale*/
|
||||
#if LV_DOWNSCALE == 2
|
||||
max_row &= (~0x1);
|
||||
#endif
|
||||
lv_coord_t w = lv_area_get_width(area_p);
|
||||
lv_coord_t h = lv_area_get_height(area_p);
|
||||
lv_coord_t y2 = area_p->y2 >= LV_VER_RES ? y2 = LV_VER_RES - 1 : area_p->y2;
|
||||
|
||||
/*Refresh all rows*/
|
||||
cord_t row = area_p->y1;
|
||||
uint32_t max_row = (uint32_t) LV_VDB_SIZE / w;
|
||||
if(max_row > h) max_row = h;
|
||||
|
||||
/*Always use the full row*/
|
||||
uint32_t row;
|
||||
lv_coord_t row_last = 0;
|
||||
for(row = area_p->y1; row + max_row - 1 <= y2; row += max_row) {
|
||||
lv_vdb_t * vdb_p = lv_vdb_get();
|
||||
|
||||
for(row = area_p->y1; row + max_row - 1 <= area_p->y2; row += max_row) {
|
||||
/*Calc. the next y coordinates of VDB*/
|
||||
vdb_p->vdb_area.y1 = row;
|
||||
vdb_p->vdb_area.y2 = row + max_row - 1;
|
||||
|
||||
vdb_p->area.x1 = area_p->x1;
|
||||
vdb_p->area.x2 = area_p->x2;
|
||||
vdb_p->area.y1 = row;
|
||||
vdb_p->area.y2 = row + max_row - 1;
|
||||
if(vdb_p->area.y2 > y2) vdb_p->area.y2 = y2;
|
||||
row_last = vdb_p->area.y2;
|
||||
lv_refr_area_part_vdb(area_p);
|
||||
}
|
||||
|
||||
/*If the last y coordinates are not handled yet ...*/
|
||||
if(area_p->y2 != vdb_p->vdb_area.y2) {
|
||||
if(y2 != row_last) {
|
||||
lv_vdb_t * vdb_p = lv_vdb_get();
|
||||
|
||||
/*Calc. the next y coordinates of VDB*/
|
||||
vdb_p->vdb_area.y1 = row;
|
||||
vdb_p->vdb_area.y2 = area_p->y2;
|
||||
vdb_p->area.x1 = area_p->x1;
|
||||
vdb_p->area.x2 = area_p->x2;
|
||||
vdb_p->area.y1 = row;
|
||||
vdb_p->area.y2 = y2;
|
||||
|
||||
/*Refresh this part too*/
|
||||
lv_refr_area_part_vdb(area_p);
|
||||
@@ -263,22 +322,26 @@ static void lv_refr_area_with_vdb(const area_t * area_p)
|
||||
* Refresh a part of an area which is on the actual Virtual Display Buffer
|
||||
* @param area_p pointer to an area to refresh
|
||||
*/
|
||||
static void lv_refr_area_part_vdb(const area_t * area_p)
|
||||
static void lv_refr_area_part_vdb(const lv_area_t * area_p)
|
||||
{
|
||||
lv_vdb_t * vdb_p = lv_vdb_get();
|
||||
lv_obj_t * top_p;
|
||||
|
||||
/*Get the new mask from the original area and the act. VDB
|
||||
It will be a part of 'area_p'*/
|
||||
area_t start_mask;
|
||||
area_union(&start_mask, area_p, &vdb_p->vdb_area);
|
||||
lv_area_t start_mask;
|
||||
lv_area_union(&start_mask, area_p, &vdb_p->area);
|
||||
|
||||
/*Get the most top object which is not covered by others*/
|
||||
top_p = lv_refr_get_top_obj(&start_mask, lv_scr_act());
|
||||
|
||||
/*Do the refreshing from the top object*/
|
||||
lv_refr_make(top_p, &start_mask);
|
||||
|
||||
lv_refr_obj_and_children(top_p, &start_mask);
|
||||
|
||||
/*Also refresh top and sys layer unconditionally*/
|
||||
lv_refr_obj_and_children(lv_layer_top(), &start_mask);
|
||||
lv_refr_obj_and_children(lv_layer_sys(), &start_mask);
|
||||
|
||||
/*Flush the content of the VDB*/
|
||||
lv_vdb_flush();
|
||||
}
|
||||
@@ -291,13 +354,13 @@ static void lv_refr_area_part_vdb(const area_t * area_p)
|
||||
* @param obj the first object to start the searching (typically a screen)
|
||||
* @return
|
||||
*/
|
||||
static lv_obj_t * lv_refr_get_top_obj(const area_t * area_p, lv_obj_t * obj)
|
||||
static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj)
|
||||
{
|
||||
lv_obj_t * i;
|
||||
lv_obj_t * found_p = NULL;
|
||||
|
||||
/*If this object is fully cover the draw area check the children too */
|
||||
if(area_is_in(area_p, &obj->cords) && obj->hidden == 0)
|
||||
if(lv_area_is_in(area_p, &obj->coords) && obj->hidden == 0)
|
||||
{
|
||||
LL_READ(obj->child_ll, i) {
|
||||
found_p = lv_refr_get_top_obj(area_p, i);
|
||||
@@ -310,9 +373,9 @@ static lv_obj_t * lv_refr_get_top_obj(const area_t * area_p, lv_obj_t * obj)
|
||||
|
||||
/*If no better children check this object*/
|
||||
if(found_p == NULL) {
|
||||
if(obj->opa == OPA_COVER &&
|
||||
LV_SA(obj, lv_objs_t)->transp == 0 &&
|
||||
obj->design_f(obj, area_p, LV_DESIGN_COVER_CHK) != false) {
|
||||
lv_style_t * style = lv_obj_get_style(obj);
|
||||
if(style->body.opa == LV_OPA_COVER &&
|
||||
obj->design_func(obj, area_p, LV_DESIGN_COVER_CHK) != false) {
|
||||
found_p = obj;
|
||||
}
|
||||
}
|
||||
@@ -322,11 +385,11 @@ static lv_obj_t * lv_refr_get_top_obj(const area_t * area_p, lv_obj_t * obj)
|
||||
}
|
||||
|
||||
/**
|
||||
* Make the refreshing from an object. Draw all its children and the yungers too.
|
||||
* Make the refreshing from an object. Draw all its children and the youngers too.
|
||||
* @param top_p pointer to an objects. Start the drawing from it.
|
||||
* @param mask_p pointer to an area, the objects will be drawn only here
|
||||
*/
|
||||
static void lv_refr_make(lv_obj_t * top_p, const area_t * mask_p)
|
||||
static void lv_refr_obj_and_children(lv_obj_t * top_p, const lv_area_t * mask_p)
|
||||
{
|
||||
/* Normally always will be a top_obj (at least the screen)
|
||||
* but in special cases (e.g. if the screen has alpha) it won't.
|
||||
@@ -346,12 +409,12 @@ static void lv_refr_make(lv_obj_t * top_p, const area_t * mask_p)
|
||||
/*Do until not reach the screen*/
|
||||
while(par != NULL) {
|
||||
/*object before border_p has to be redrawn*/
|
||||
i = ll_get_prev(&(par->child_ll), border_p);
|
||||
i = lv_ll_get_prev(&(par->child_ll), border_p);
|
||||
|
||||
while(i != NULL) {
|
||||
/*Refresh the objects*/
|
||||
lv_refr_obj(i, mask_p);
|
||||
i = ll_get_prev(&(par->child_ll), i);
|
||||
i = lv_ll_get_prev(&(par->child_ll), i);
|
||||
}
|
||||
|
||||
/*The new border will be there last parents,
|
||||
@@ -364,7 +427,7 @@ static void lv_refr_make(lv_obj_t * top_p, const area_t * mask_p)
|
||||
/*Call the post draw design function of the parents of the to object*/
|
||||
par = lv_obj_get_parent(top_p);
|
||||
while(par != NULL) {
|
||||
par->design_f(par, mask_p, LV_DESIGN_DRAW_POST);
|
||||
par->design_func(par, mask_p, LV_DESIGN_DRAW_POST);
|
||||
par = lv_obj_get_parent(par);
|
||||
}
|
||||
}
|
||||
@@ -374,7 +437,7 @@ static void lv_refr_make(lv_obj_t * top_p, const area_t * mask_p)
|
||||
* @param obj pointer to an object to refresh
|
||||
* @param mask_ori_p pointer to an area, the objects will be drawn only here
|
||||
*/
|
||||
static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p)
|
||||
static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_p)
|
||||
{
|
||||
/*Do not refresh hidden objects*/
|
||||
if(obj->hidden != 0) return;
|
||||
@@ -382,36 +445,37 @@ static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p)
|
||||
bool union_ok; /* Store the return value of area_union */
|
||||
/* Truncate the original mask to the coordinates of the parent
|
||||
* because the parent and its children are visible only here */
|
||||
area_t obj_mask;
|
||||
area_t obj_ext_mask;
|
||||
area_t obj_area;
|
||||
cord_t ext_size = obj->ext_size;
|
||||
lv_obj_get_cords(obj, &obj_area);
|
||||
lv_area_t obj_mask;
|
||||
lv_area_t obj_ext_mask;
|
||||
lv_area_t obj_area;
|
||||
lv_coord_t ext_size = obj->ext_size;
|
||||
lv_obj_get_coords(obj, &obj_area);
|
||||
obj_area.x1 -= ext_size;
|
||||
obj_area.y1 -= ext_size;
|
||||
obj_area.x2 += ext_size;
|
||||
obj_area.y2 += ext_size;
|
||||
union_ok = area_union(&obj_ext_mask, mask_ori_p, &obj_area);
|
||||
union_ok = lv_area_union(&obj_ext_mask, mask_ori_p, &obj_area);
|
||||
|
||||
/*Draw the parent and its children only if they ore on 'mask_parent'*/
|
||||
if(union_ok != false) {
|
||||
|
||||
/* Redraw the object */
|
||||
if(obj->opa != OPA_TRANSP && LV_SA(obj, lv_objs_t)->transp == 0) {
|
||||
obj->design_f(obj, &obj_ext_mask, LV_DESIGN_DRAW_MAIN);
|
||||
/* tick_wait_ms(100); */ /*DEBUG: Wait after every object draw to see the order of drawing*/
|
||||
/* Redraw the object */
|
||||
lv_style_t * style = lv_obj_get_style(obj);
|
||||
if(style->body.opa != LV_OPA_TRANSP) {
|
||||
obj->design_func(obj, &obj_ext_mask, LV_DESIGN_DRAW_MAIN);
|
||||
//tick_wait_ms(100); /*DEBUG: Wait after every object draw to see the order of drawing*/
|
||||
}
|
||||
|
||||
/*Create a new 'obj_mask' without 'ext_size' because the children can't be visible there*/
|
||||
lv_obj_get_cords(obj, &obj_area);
|
||||
union_ok = area_union(&obj_mask, mask_ori_p, &obj_area);
|
||||
lv_obj_get_coords(obj, &obj_area);
|
||||
union_ok = lv_area_union(&obj_mask, mask_ori_p, &obj_area);
|
||||
if(union_ok != false) {
|
||||
area_t mask_child; /*Mask from obj and its child*/
|
||||
lv_area_t mask_child; /*Mask from obj and its child*/
|
||||
lv_obj_t * child_p;
|
||||
area_t child_area;
|
||||
lv_area_t child_area;
|
||||
LL_READ_BACK(obj->child_ll, child_p)
|
||||
{
|
||||
lv_obj_get_cords(child_p, &child_area);
|
||||
lv_obj_get_coords(child_p, &child_area);
|
||||
ext_size = child_p->ext_size;
|
||||
child_area.x1 -= ext_size;
|
||||
child_area.y1 -= ext_size;
|
||||
@@ -419,7 +483,7 @@ static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p)
|
||||
child_area.y2 += ext_size;
|
||||
/* Get the union (common parts) of original mask (from obj)
|
||||
* and its child */
|
||||
union_ok = area_union(&mask_child, &obj_mask, &child_area);
|
||||
union_ok = lv_area_union(&mask_child, &obj_mask, &child_area);
|
||||
|
||||
/*If the parent and the child has common area then refresh the child */
|
||||
if(union_ok) {
|
||||
@@ -430,8 +494,8 @@ static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p)
|
||||
}
|
||||
|
||||
/* If all the children are redrawn make 'post draw' design */
|
||||
if(obj->opa != OPA_TRANSP && LV_SA(obj, lv_objs_t)->transp == 0) {
|
||||
obj->design_f(obj, &obj_ext_mask, LV_DESIGN_DRAW_POST);
|
||||
if(style->body.opa != LV_OPA_TRANSP) {
|
||||
obj->design_func(obj, &obj_ext_mask, LV_DESIGN_DRAW_POST);
|
||||
}
|
||||
}
|
||||
}
|
||||
88
lv_core/lv_refr.h
Normal file
88
lv_core/lv_refr.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* @file lv_refr.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_REFR_H
|
||||
#define LV_REFR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_obj.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize the screen refresh subsystem
|
||||
*/
|
||||
void lv_refr_init(void);
|
||||
|
||||
/**
|
||||
* Invalidate an area
|
||||
* @param area_p pointer to area which should be invalidated
|
||||
*/
|
||||
void lv_inv_area(const lv_area_t * area_p);
|
||||
|
||||
/**
|
||||
* Set a function to call after every refresh to announce the refresh time and the number of refreshed pixels
|
||||
* @param cb pointer to a callback function (void my_refr_cb(uint32_t time_ms, uint32_t px_num))
|
||||
*/
|
||||
void lv_refr_set_monitor_cb(void (*cb)(uint32_t, uint32_t));
|
||||
|
||||
/**
|
||||
* Called when an area is invalidated to modify the coordinates of the area.
|
||||
* Special display controllers may require special coordinate rounding
|
||||
* @param cb pointer to the a function which will modify the area
|
||||
*/
|
||||
void lv_refr_set_round_cb(void(*cb)(lv_area_t*));
|
||||
|
||||
/**
|
||||
* Get the number of areas in the buffer
|
||||
* @return number of invalid areas
|
||||
*/
|
||||
uint16_t lv_refr_get_buf_size(void);
|
||||
|
||||
/**
|
||||
* Pop (delete) the last 'num' invalidated areas from the buffer
|
||||
* @param num number of areas to delete
|
||||
*/
|
||||
void lv_refr_pop_from_buf(uint16_t num);
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_REFR_H*/
|
||||
322
lv_core/lv_style.c
Normal file
322
lv_core/lv_style.c
Normal file
@@ -0,0 +1,322 @@
|
||||
/**
|
||||
* @file lv_style.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "../../lv_conf.h"
|
||||
#include "lv_style.h"
|
||||
#include "lv_obj.h"
|
||||
#include "../lv_misc/lv_mem.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#if USE_LV_ANIMATION
|
||||
#define LV_STYLE_ANIM_RES 256
|
||||
#define LV_STYLE_ANIM_SHIFT 8 /*log2(LV_STYLE_ANIM_RES)*/
|
||||
|
||||
#define VAL_PROP(v1, v2, r) v1 + (((v2-v1) * r) >> LV_STYLE_ANIM_SHIFT)
|
||||
#define STYLE_ATTR_ANIM(attr, r) if(start->attr != end->attr) act->attr = VAL_PROP(start->attr, end->attr, r)
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
#if USE_LV_ANIMATION
|
||||
typedef struct {
|
||||
lv_style_t style_start; /*Save not only pointers because can be same as 'style_anim' then it will be modified too*/
|
||||
lv_style_t style_end;
|
||||
lv_style_t *style_anim;
|
||||
void (*end_cb)(void *);
|
||||
}lv_style_anim_dsc_t;
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
#if USE_LV_ANIMATION
|
||||
static void style_animator(lv_style_anim_dsc_t * dsc, int32_t val);
|
||||
static void style_animation_common_end_cb(void *ptr);
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
lv_style_t lv_style_scr;
|
||||
lv_style_t lv_style_transp;
|
||||
lv_style_t lv_style_transp_fit;
|
||||
lv_style_t lv_style_transp_tight;
|
||||
lv_style_t lv_style_plain;
|
||||
lv_style_t lv_style_plain_color;
|
||||
lv_style_t lv_style_pretty;
|
||||
lv_style_t lv_style_pretty_color;
|
||||
lv_style_t lv_style_btn_rel;
|
||||
lv_style_t lv_style_btn_pr;
|
||||
lv_style_t lv_style_btn_tgl_rel;
|
||||
lv_style_t lv_style_btn_tgl_pr;
|
||||
lv_style_t lv_style_btn_ina;
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Init the basic styles
|
||||
*/
|
||||
void lv_style_init (void)
|
||||
{
|
||||
/* Not White/Black/Gray colors are created by HSV model with
|
||||
* HUE = 210*/
|
||||
|
||||
/*Screen style*/
|
||||
lv_style_scr.glass = 0;
|
||||
lv_style_scr.body.opa = LV_OPA_COVER;
|
||||
lv_style_scr.body.main_color = LV_COLOR_WHITE;
|
||||
lv_style_scr.body.grad_color = LV_COLOR_WHITE;
|
||||
lv_style_scr.body.radius = 0;
|
||||
lv_style_scr.body.padding.ver = LV_DPI / 12;
|
||||
lv_style_scr.body.padding.hor = LV_DPI / 12;
|
||||
lv_style_scr.body.padding.inner = LV_DPI / 12;
|
||||
|
||||
lv_style_scr.body.border.color = LV_COLOR_BLACK;
|
||||
lv_style_scr.body.border.opa = LV_OPA_COVER;
|
||||
lv_style_scr.body.border.width = 0;
|
||||
lv_style_scr.body.border.part = LV_BORDER_FULL;
|
||||
|
||||
lv_style_scr.body.shadow.color = LV_COLOR_GRAY;
|
||||
lv_style_scr.body.shadow.type = LV_SHADOW_FULL;
|
||||
lv_style_scr.body.shadow.width = 0;
|
||||
|
||||
lv_style_scr.text.opa = LV_OPA_COVER;
|
||||
lv_style_scr.text.color = LV_COLOR_MAKE(0x30, 0x30, 0x30);
|
||||
lv_style_scr.text.font = LV_FONT_DEFAULT;
|
||||
lv_style_scr.text.letter_space = 2;
|
||||
lv_style_scr.text.line_space = 2;
|
||||
|
||||
lv_style_scr.image.opa = LV_OPA_COVER;
|
||||
lv_style_scr.image.color = LV_COLOR_MAKE(0x20, 0x20, 0x20);
|
||||
lv_style_scr.image.intense = LV_OPA_TRANSP;
|
||||
|
||||
lv_style_scr.line.opa = LV_OPA_COVER;
|
||||
lv_style_scr.line.color = LV_COLOR_MAKE(0x20, 0x20, 0x20);
|
||||
lv_style_scr.line.width = 1;
|
||||
|
||||
/*Plain style (by default near the same as the screen style)*/
|
||||
memcpy(&lv_style_plain, &lv_style_scr, sizeof(lv_style_t));
|
||||
|
||||
/*Plain color style*/
|
||||
memcpy(&lv_style_plain_color, &lv_style_plain, sizeof(lv_style_t));
|
||||
lv_style_plain_color.text.color = LV_COLOR_MAKE(0xf0, 0xf0, 0xf0);
|
||||
lv_style_plain_color.image.color = LV_COLOR_MAKE(0xf0, 0xf0, 0xf0);
|
||||
lv_style_plain_color.line.color = LV_COLOR_MAKE(0xf0, 0xf0, 0xf0);
|
||||
lv_style_plain_color.body.main_color = LV_COLOR_MAKE(0x55, 0x96, 0xd8);
|
||||
lv_style_plain_color.body.grad_color = lv_style_plain_color.body.main_color;
|
||||
|
||||
/*Pretty style */
|
||||
memcpy(&lv_style_pretty, &lv_style_plain, sizeof(lv_style_t));
|
||||
lv_style_pretty.text.color = LV_COLOR_MAKE(0x20, 0x20, 0x20);
|
||||
lv_style_pretty.image.color = LV_COLOR_MAKE(0x20, 0x20, 0x20);
|
||||
lv_style_pretty.line.color = LV_COLOR_MAKE(0x20, 0x20, 0x20);
|
||||
lv_style_pretty.body.main_color = LV_COLOR_WHITE;
|
||||
lv_style_pretty.body.grad_color = LV_COLOR_SILVER;
|
||||
lv_style_pretty.body.radius = LV_DPI / 15;
|
||||
lv_style_pretty.body.border.color = LV_COLOR_MAKE(0x40, 0x40, 0x40);
|
||||
lv_style_pretty.body.border.width = LV_DPI / 50 >= 1 ? LV_DPI / 50 : 1;
|
||||
lv_style_pretty.body.border.opa = LV_OPA_30;
|
||||
|
||||
/*Pretty color style*/
|
||||
memcpy(&lv_style_pretty_color, &lv_style_pretty, sizeof(lv_style_t));
|
||||
lv_style_pretty_color.text.color = LV_COLOR_MAKE(0xe0, 0xe0, 0xe0);
|
||||
lv_style_pretty_color.image.color = LV_COLOR_MAKE(0xe0, 0xe0, 0xe0);
|
||||
lv_style_pretty_color.line.color = LV_COLOR_MAKE(0xc0, 0xc0, 0xc0);
|
||||
lv_style_pretty_color.body.main_color = LV_COLOR_MAKE(0x6b, 0x9a, 0xc7);
|
||||
lv_style_pretty_color.body.grad_color = LV_COLOR_MAKE(0x2b, 0x59, 0x8b);
|
||||
lv_style_pretty_color.body.border.color = LV_COLOR_MAKE(0x15, 0x2c, 0x42);
|
||||
|
||||
/*Transparent style*/
|
||||
memcpy(&lv_style_transp, &lv_style_plain, sizeof(lv_style_t));
|
||||
lv_style_transp.body.empty = 1;
|
||||
lv_style_transp.glass = 1;
|
||||
lv_style_transp.body.border.width = 0;
|
||||
|
||||
/*Transparent tight style*/
|
||||
memcpy(&lv_style_transp_fit, &lv_style_transp, sizeof(lv_style_t));
|
||||
lv_style_transp_fit.body.padding.hor = 0;
|
||||
lv_style_transp_fit.body.padding.ver = 0;
|
||||
|
||||
/*Transparent fitting size*/
|
||||
memcpy(&lv_style_transp_tight, &lv_style_transp_fit, sizeof(lv_style_t));
|
||||
lv_style_transp_tight.body.padding.inner = 0;
|
||||
|
||||
/*Button released style*/
|
||||
memcpy(&lv_style_btn_rel, &lv_style_plain, sizeof(lv_style_t));
|
||||
lv_style_btn_rel.body.main_color = LV_COLOR_MAKE(0x76, 0xa2, 0xd0);
|
||||
lv_style_btn_rel.body.grad_color = LV_COLOR_MAKE(0x19, 0x3a, 0x5d);
|
||||
lv_style_btn_rel.body.radius = LV_DPI / 15;
|
||||
lv_style_btn_rel.body.padding.hor = LV_DPI / 4;
|
||||
lv_style_btn_rel.body.padding.ver = LV_DPI / 6;
|
||||
lv_style_btn_rel.body.padding.inner = LV_DPI / 10;
|
||||
lv_style_btn_rel.body.border.color = LV_COLOR_MAKE(0x0b, 0x19, 0x28);
|
||||
lv_style_btn_rel.body.border.width = LV_DPI / 50 >= 1 ? LV_DPI / 50 : 1;
|
||||
lv_style_btn_rel.body.border.opa = LV_OPA_70;
|
||||
lv_style_btn_rel.text.color = LV_COLOR_MAKE(0xff, 0xff, 0xff);
|
||||
lv_style_btn_rel.body.shadow.color = LV_COLOR_GRAY;
|
||||
lv_style_btn_rel.body.shadow.width = 0;
|
||||
|
||||
/*Button pressed style*/
|
||||
memcpy(&lv_style_btn_pr, &lv_style_btn_rel, sizeof(lv_style_t));
|
||||
lv_style_btn_pr.body.main_color = LV_COLOR_MAKE(0x33, 0x62, 0x94);
|
||||
lv_style_btn_pr.body.grad_color = LV_COLOR_MAKE(0x10, 0x26, 0x3c);
|
||||
lv_style_btn_pr.text.color = LV_COLOR_MAKE(0xa4, 0xb5, 0xc6);
|
||||
lv_style_btn_pr.image.color = LV_COLOR_MAKE(0xa4, 0xb5, 0xc6);
|
||||
lv_style_btn_pr.line.color = LV_COLOR_MAKE(0xa4, 0xb5, 0xc6);
|
||||
|
||||
/*Button toggle released style*/
|
||||
memcpy(&lv_style_btn_tgl_rel, &lv_style_btn_rel, sizeof(lv_style_t));
|
||||
lv_style_btn_tgl_rel.body.main_color = LV_COLOR_MAKE(0x0a, 0x11, 0x22);
|
||||
lv_style_btn_tgl_rel.body.grad_color = LV_COLOR_MAKE(0x37, 0x62, 0x90);
|
||||
lv_style_btn_tgl_rel.body.border.color = LV_COLOR_MAKE(0x01, 0x07, 0x0d);
|
||||
lv_style_btn_tgl_rel.text.color = LV_COLOR_MAKE(0xc8, 0xdd, 0xf4);
|
||||
lv_style_btn_tgl_rel.image.color = LV_COLOR_MAKE(0xc8, 0xdd, 0xf4);
|
||||
lv_style_btn_tgl_rel.line.color = LV_COLOR_MAKE(0xc8, 0xdd, 0xf4);
|
||||
|
||||
/*Button toggle pressed style*/
|
||||
memcpy(&lv_style_btn_tgl_pr, &lv_style_btn_tgl_rel, sizeof(lv_style_t));
|
||||
lv_style_btn_tgl_pr.body.main_color = LV_COLOR_MAKE(0x02, 0x14, 0x27);
|
||||
lv_style_btn_tgl_pr.body.grad_color = LV_COLOR_MAKE(0x2b, 0x4c, 0x70);
|
||||
lv_style_btn_tgl_pr.text.color = LV_COLOR_MAKE(0xa4, 0xb5, 0xc6);
|
||||
lv_style_btn_tgl_pr.image.color = LV_COLOR_MAKE(0xa4, 0xb5, 0xc6);
|
||||
lv_style_btn_tgl_pr.line.color = LV_COLOR_MAKE(0xa4, 0xb5, 0xc6);
|
||||
|
||||
/*Button inactive style*/
|
||||
memcpy(&lv_style_btn_ina, &lv_style_btn_rel, sizeof(lv_style_t));
|
||||
lv_style_btn_ina.body.main_color = LV_COLOR_MAKE(0xd8, 0xd8, 0xd8);
|
||||
lv_style_btn_ina.body.grad_color = LV_COLOR_MAKE(0xd8, 0xd8, 0xd8);
|
||||
lv_style_btn_ina.body.border.color = LV_COLOR_MAKE(0x90, 0x90, 0x90);
|
||||
lv_style_btn_ina.text.color = LV_COLOR_MAKE(0x70, 0x70, 0x70);
|
||||
lv_style_btn_ina.image.color = LV_COLOR_MAKE(0x70, 0x70, 0x70);
|
||||
lv_style_btn_ina.line.color = LV_COLOR_MAKE(0x70, 0x70, 0x70);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Copy a style to an other
|
||||
* @param dest pointer to the destination style
|
||||
* @param src pointer to the source style
|
||||
*/
|
||||
void lv_style_copy(lv_style_t * dest, const lv_style_t * src)
|
||||
{
|
||||
memcpy(dest, src, sizeof(lv_style_t));
|
||||
}
|
||||
|
||||
#if USE_LV_ANIMATION
|
||||
/**
|
||||
* Create an animation from a pre-configured 'lv_style_anim_t' variable
|
||||
* @param anim pointer to a pre-configured 'lv_style_anim_t' variable (will be copied)
|
||||
*/
|
||||
void lv_style_anim_create(lv_style_anim_t * anim)
|
||||
{
|
||||
lv_style_anim_dsc_t * dsc;
|
||||
dsc = lv_mem_alloc(sizeof(lv_style_anim_dsc_t));
|
||||
dsc->style_anim = anim->style_anim;
|
||||
memcpy(&dsc->style_start, anim->style_start, sizeof(lv_style_t));
|
||||
memcpy(&dsc->style_end, anim->style_end, sizeof(lv_style_t));
|
||||
dsc->end_cb = anim->end_cb;
|
||||
|
||||
|
||||
lv_anim_t a;
|
||||
a.var = (void*)dsc;
|
||||
a.start = 0;
|
||||
a.end = LV_STYLE_ANIM_RES;
|
||||
a.fp = (lv_anim_fp_t)style_animator;
|
||||
a.path = lv_anim_path_linear;
|
||||
a.end_cb = style_animation_common_end_cb;
|
||||
a.act_time = anim->act_time;
|
||||
a.time = anim->time;
|
||||
a.playback = anim->playback;
|
||||
a.playback_pause = anim->playback_pause;
|
||||
a.repeat = anim->repeat;
|
||||
a.repeat_pause = anim->repeat_pause;
|
||||
|
||||
lv_anim_create(&a);
|
||||
}
|
||||
#endif
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
#if USE_LV_ANIMATION
|
||||
/**
|
||||
* Used by the style animations to set the values of a style according to start and end style.
|
||||
* @param dsc the 'animated variable' set by lv_style_anim_create()
|
||||
* @param val the current state of the animation between 0 and LV_STYLE_ANIM_RES
|
||||
*/
|
||||
static void style_animator(lv_style_anim_dsc_t * dsc, int32_t val)
|
||||
{
|
||||
const lv_style_t * start = &dsc->style_start;
|
||||
const lv_style_t * end = &dsc->style_end;
|
||||
lv_style_t * act = dsc->style_anim;
|
||||
|
||||
STYLE_ATTR_ANIM(body.opa, val);
|
||||
STYLE_ATTR_ANIM(body.radius, val);
|
||||
STYLE_ATTR_ANIM(body.border.width, val);
|
||||
STYLE_ATTR_ANIM(body.shadow.width, val);
|
||||
STYLE_ATTR_ANIM(body.padding.hor, val);
|
||||
STYLE_ATTR_ANIM(body.padding.ver, val);
|
||||
STYLE_ATTR_ANIM(body.padding.inner, val);
|
||||
STYLE_ATTR_ANIM(text.line_space, val);
|
||||
STYLE_ATTR_ANIM(text.letter_space, val);
|
||||
STYLE_ATTR_ANIM(text.opa, val);
|
||||
STYLE_ATTR_ANIM(line.width, val);
|
||||
STYLE_ATTR_ANIM(line.opa, val);
|
||||
STYLE_ATTR_ANIM(image.intense, val);
|
||||
STYLE_ATTR_ANIM(image.opa, val);
|
||||
|
||||
lv_opa_t opa = val == LV_STYLE_ANIM_RES ? LV_OPA_COVER : val;
|
||||
|
||||
act->body.main_color = lv_color_mix(end->body.main_color, start->body.main_color, opa);
|
||||
act->body.grad_color = lv_color_mix(end->body.grad_color, start->body.grad_color, opa);
|
||||
act->body.border.color = lv_color_mix(end->body.border.color, start->body.border.color, opa);
|
||||
act->body.shadow.color = lv_color_mix(end->body.shadow.color, start->body.shadow.color, opa);
|
||||
act->text.color = lv_color_mix(end->text.color, start->text.color, opa);
|
||||
act->image.color = lv_color_mix(end->image.color, start->image.color, opa);
|
||||
act->line.color = lv_color_mix(end->line.color, start->line.color, opa);
|
||||
|
||||
if(val == 0) {
|
||||
act->body.empty = start->body.empty;
|
||||
act->glass = start->glass;
|
||||
act->text.font = start->text.font;
|
||||
act->body.shadow.type = start->body.shadow.type;
|
||||
}
|
||||
|
||||
if(val == LV_STYLE_ANIM_RES) {
|
||||
act->body.empty = end->body.empty;
|
||||
act->glass = end->glass;
|
||||
act->text.font = end->text.font;
|
||||
act->body.shadow.type = end->body.shadow.type;
|
||||
}
|
||||
|
||||
lv_obj_report_style_mod(dsc->style_anim);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a style animation is ready
|
||||
* It called the user defined call back and free the allocated memories
|
||||
* @param ptr the 'animated variable' set by lv_style_anim_create()
|
||||
*/
|
||||
static void style_animation_common_end_cb(void *ptr)
|
||||
{
|
||||
lv_style_anim_dsc_t *dsc = ptr; /*To avoid casting*/
|
||||
|
||||
if(dsc->end_cb) dsc->end_cb(dsc);
|
||||
|
||||
lv_mem_free(dsc);
|
||||
}
|
||||
|
||||
#endif
|
||||
183
lv_core/lv_style.h
Normal file
183
lv_core/lv_style.h
Normal file
@@ -0,0 +1,183 @@
|
||||
/**
|
||||
* @file lv_style.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_STYLE_H
|
||||
#define LV_STYLE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <stdbool.h>
|
||||
#include "../lv_misc/lv_color.h"
|
||||
#include "../lv_misc/lv_area.h"
|
||||
#include "../lv_misc/lv_font.h"
|
||||
#include "../lv_misc/lv_anim.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define LV_RADIUS_CIRCLE (LV_COORD_MAX) /*A very big radius to always draw as circle*/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/*Border types (Use 'OR'ed values)*/
|
||||
typedef enum
|
||||
{
|
||||
LV_BORDER_NONE = 0x00,
|
||||
LV_BORDER_BOTTOM = 0x01,
|
||||
LV_BORDER_TOP = 0x02,
|
||||
LV_BORDER_LEFT = 0x04,
|
||||
LV_BORDER_RIGHT = 0x08,
|
||||
LV_BORDER_FULL = 0x0F,
|
||||
}lv_border_part_t;
|
||||
|
||||
/*Shadow types*/
|
||||
typedef enum
|
||||
{
|
||||
LV_SHADOW_BOTTOM = 0,
|
||||
LV_SHADOW_FULL,
|
||||
}lv_shadow_type_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t glass :1; /*1: Do not inherit this style*/
|
||||
|
||||
struct {
|
||||
lv_color_t main_color;
|
||||
lv_color_t grad_color;
|
||||
lv_coord_t radius;
|
||||
lv_opa_t opa;
|
||||
|
||||
struct {
|
||||
lv_color_t color;
|
||||
lv_coord_t width;
|
||||
lv_border_part_t part;
|
||||
lv_opa_t opa;
|
||||
}border;
|
||||
|
||||
struct {
|
||||
lv_color_t color;
|
||||
lv_coord_t width;
|
||||
uint8_t type;
|
||||
}shadow;
|
||||
|
||||
struct {
|
||||
lv_coord_t ver;
|
||||
lv_coord_t hor;
|
||||
lv_coord_t inner;
|
||||
}padding;
|
||||
|
||||
uint8_t empty :1; /*Transparent background (border still drawn)*/
|
||||
}body;
|
||||
|
||||
|
||||
struct {
|
||||
lv_color_t color;
|
||||
const lv_font_t * font;
|
||||
lv_coord_t letter_space;
|
||||
lv_coord_t line_space;
|
||||
lv_opa_t opa;
|
||||
}text;
|
||||
|
||||
struct {
|
||||
lv_color_t color;
|
||||
lv_opa_t intense;
|
||||
lv_opa_t opa;
|
||||
}image;
|
||||
|
||||
struct {
|
||||
lv_color_t color;
|
||||
lv_coord_t width;
|
||||
lv_opa_t opa;
|
||||
}line;
|
||||
}lv_style_t;
|
||||
|
||||
#if USE_LV_ANIMATION
|
||||
typedef struct {
|
||||
const lv_style_t * style_start; /*Pointer to the starting style*/
|
||||
const lv_style_t * style_end; /*Pointer to the destination style*/
|
||||
lv_style_t * style_anim; /*Pointer to a style to animate*/
|
||||
lv_anim_cb_t end_cb; /*Call it when the animation is ready (NULL if unused)*/
|
||||
int16_t time; /*Animation time in ms*/
|
||||
int16_t act_time; /*Current time in animation. Set to negative to make delay.*/
|
||||
uint16_t playback_pause; /*Wait before play back*/
|
||||
uint16_t repeat_pause; /*Wait before repeat*/
|
||||
uint8_t playback :1; /*When the animation is ready play it back*/
|
||||
uint8_t repeat :1; /*Repeat the animation infinitely*/
|
||||
}lv_style_anim_t;
|
||||
|
||||
/* Example initialization
|
||||
lv_style_anim_t a;
|
||||
a.style_anim = &style_to_anim;
|
||||
a.style_start = &style_1;
|
||||
a.style_end = &style_2;
|
||||
a.act_time = 0;
|
||||
a.time = 1000;
|
||||
a.playback = 0;
|
||||
a.playback_pause = 0;
|
||||
a.repeat = 0;
|
||||
a.repeat_pause = 0;
|
||||
a.end_cb = NULL;
|
||||
lv_style_anim_create(&a);
|
||||
*/
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Init the basic styles
|
||||
*/
|
||||
void lv_style_init (void);
|
||||
|
||||
/**
|
||||
* Copy a style to an other
|
||||
* @param dest pointer to the destination style
|
||||
* @param src pointer to the source style
|
||||
*/
|
||||
void lv_style_copy(lv_style_t * dest, const lv_style_t * src);
|
||||
|
||||
#if USE_LV_ANIMATION
|
||||
/**
|
||||
* Create an animation from a pre-configured 'lv_style_anim_t' variable
|
||||
* @param anim pointer to a pre-configured 'lv_style_anim_t' variable (will be copied)
|
||||
*/
|
||||
void lv_style_anim_create(lv_style_anim_t * anim);
|
||||
#endif
|
||||
|
||||
/*************************
|
||||
* GLOBAL VARIABLES
|
||||
*************************/
|
||||
extern lv_style_t lv_style_scr;
|
||||
extern lv_style_t lv_style_transp;
|
||||
extern lv_style_t lv_style_transp_fit;
|
||||
extern lv_style_t lv_style_transp_tight;
|
||||
extern lv_style_t lv_style_plain;
|
||||
extern lv_style_t lv_style_plain_color;
|
||||
extern lv_style_t lv_style_pretty;
|
||||
extern lv_style_t lv_style_pretty_color;
|
||||
extern lv_style_t lv_style_btn_rel;
|
||||
extern lv_style_t lv_style_btn_pr;
|
||||
extern lv_style_t lv_style_btn_tgl_rel;
|
||||
extern lv_style_t lv_style_btn_tgl_pr;;
|
||||
extern lv_style_t lv_style_btn_ina;
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_STYLE_H*/
|
||||
153
lv_core/lv_vdb.c
Normal file
153
lv_core/lv_vdb.c
Normal file
@@ -0,0 +1,153 @@
|
||||
/**
|
||||
* @file lv_vdb.c
|
||||
*
|
||||
*/
|
||||
#include "../../lv_conf.h"
|
||||
#if LV_VDB_SIZE != 0
|
||||
|
||||
#include "../lv_hal/lv_hal_disp.h"
|
||||
#include <stddef.h>
|
||||
#include "lv_vdb.h"
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
typedef enum {
|
||||
LV_VDB_STATE_FREE = 0,
|
||||
LV_VDB_STATE_ACTIVE,
|
||||
LV_VDB_STATE_FLUSH,
|
||||
} lv_vdb_state_t;
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
|
||||
|
||||
#if LV_VDB_DOUBLE == 0
|
||||
/*Simple VDB*/
|
||||
static volatile lv_vdb_state_t vdb_state = LV_VDB_STATE_ACTIVE;
|
||||
# if LV_VDB_ADR == 0
|
||||
/*If the buffer address is not specified simply allocate it*/
|
||||
static lv_color_t vdb_buf[LV_VDB_SIZE];
|
||||
static lv_vdb_t vdb = {.buf = vdb_buf};
|
||||
# else
|
||||
/*If the buffer address is specified use that address*/
|
||||
static lv_vdb_t vdb = {.buf = (lv_color_t *)LV_VDB_ADR};
|
||||
# endif
|
||||
#else
|
||||
/*Double VDB*/
|
||||
static volatile lv_vdb_state_t vdb_state[2] = {LV_VDB_STATE_FREE, LV_VDB_STATE_FREE};
|
||||
# if LV_VDB_ADR == 0
|
||||
/*If the buffer address is not specified simply allocate it*/
|
||||
static lv_color_t vdb_buf1[LV_VDB_SIZE];
|
||||
static lv_color_t vdb_buf2[LV_VDB_SIZE];
|
||||
static lv_vdb_t vdb[2] = {{.buf = vdb_buf1}, {.buf = vdb_buf2}};
|
||||
# else
|
||||
/*If the buffer address is specified use that address*/
|
||||
static lv_vdb_t vdb[2] = {{.buf = (lv_color_t *)LV_VDB_ADR}, {.buf = (lv_color_t *)LV_VDB2_ADR}};
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Get the 'vdb' variable or allocate one in LV_VDB_DOUBLE mode
|
||||
* @return pointer to a 'vdb' variable
|
||||
*/
|
||||
lv_vdb_t * lv_vdb_get(void)
|
||||
{
|
||||
#if LV_VDB_DOUBLE == 0
|
||||
/* Wait until VDB become ACTIVE from FLUSH by the
|
||||
* user call of 'lv_flush_ready()' in display drivers's flush function*/
|
||||
while(vdb_state != LV_VDB_STATE_ACTIVE);
|
||||
return &vdb;
|
||||
#else
|
||||
/*If already there is an active do nothing*/
|
||||
if(vdb_state[0] == LV_VDB_STATE_ACTIVE) return &vdb[0];
|
||||
if(vdb_state[1] == LV_VDB_STATE_ACTIVE) return &vdb[1];
|
||||
|
||||
/*Try to allocate a free VDB*/
|
||||
if(vdb_state[0] == LV_VDB_STATE_FREE) {
|
||||
vdb_state[0] = LV_VDB_STATE_ACTIVE;
|
||||
return &vdb[0];
|
||||
}
|
||||
|
||||
if(vdb_state[1] == LV_VDB_STATE_FREE) {
|
||||
vdb_state[1] = LV_VDB_STATE_ACTIVE;
|
||||
return &vdb[1];
|
||||
}
|
||||
|
||||
return NULL; /*There wasn't free VDB (never happen)*/
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Flush the content of the VDB
|
||||
*/
|
||||
void lv_vdb_flush(void)
|
||||
{
|
||||
lv_vdb_t * vdb_act = lv_vdb_get();
|
||||
if(vdb_act == NULL) return;
|
||||
|
||||
#if LV_VDB_DOUBLE == 0
|
||||
vdb_state = LV_VDB_STATE_FLUSH; /*User call to 'lv_flush_ready()' will set to ACTIVE 'disp_flush'*/
|
||||
#else
|
||||
/* Wait the pending flush before starting this one
|
||||
* (Don't forget: 'lv_flush_ready()' has to be called when flushing is ready)*/
|
||||
while(vdb_state[0] == LV_VDB_STATE_FLUSH || vdb_state[1] == LV_VDB_STATE_FLUSH);
|
||||
|
||||
/*Turn the active VDB to flushing*/
|
||||
if(vdb_state[0] == LV_VDB_STATE_ACTIVE) vdb_state[0] = LV_VDB_STATE_FLUSH;
|
||||
if(vdb_state[1] == LV_VDB_STATE_ACTIVE) vdb_state[1] = LV_VDB_STATE_FLUSH;
|
||||
#endif
|
||||
|
||||
/*Flush the rendered content to the display*/
|
||||
lv_disp_flush(vdb_act->area.x1, vdb_act->area.y1, vdb_act->area.x2, vdb_act->area.y2, vdb_act->buf);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Call in the display driver's 'disp_flush' function when the flushing is finished
|
||||
*/
|
||||
void lv_flush_ready(void)
|
||||
{
|
||||
#if LV_VDB_DOUBLE == 0
|
||||
vdb_state = LV_VDB_STATE_ACTIVE;
|
||||
#else
|
||||
if(vdb_state[0] == LV_VDB_STATE_FLUSH) vdb_state[0] = LV_VDB_STATE_FREE;
|
||||
if(vdb_state[1] == LV_VDB_STATE_FLUSH) vdb_state[1] = LV_VDB_STATE_FREE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
#else
|
||||
|
||||
/**
|
||||
* Just for compatibility
|
||||
*/
|
||||
void lv_flush_ready(void)
|
||||
{
|
||||
/*Do nothing. It is used only for VDB*/
|
||||
}
|
||||
#endif
|
||||
73
lv_core/lv_vdb.h
Normal file
73
lv_core/lv_vdb.h
Normal file
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* @file lv_vdb.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_VDB_H
|
||||
#define LV_VDB_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "../../lv_conf.h"
|
||||
|
||||
#if LV_VDB_SIZE != 0
|
||||
|
||||
#include "../lv_misc/lv_color.h"
|
||||
#include "../lv_misc/lv_area.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
lv_area_t area;
|
||||
lv_color_t *buf;
|
||||
}lv_vdb_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Get the 'vdb' variable or allocate one in LV_VDB_DOUBLE mode
|
||||
* @return pointer to a 'vdb' variable
|
||||
*/
|
||||
lv_vdb_t * lv_vdb_get(void);
|
||||
|
||||
/**
|
||||
* Flush the content of the vdb
|
||||
*/
|
||||
void lv_vdb_flush(void);
|
||||
|
||||
|
||||
/**
|
||||
* In 'LV_VDB_DOUBLE' mode has to be called when 'disp_map()'
|
||||
* is ready with copying the map to a frame buffer.
|
||||
*/
|
||||
void lv_flush_ready(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#else /*LV_VDB_SIZE != 0*/
|
||||
|
||||
/*Just for compatibility*/
|
||||
void lv_flush_ready(void);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_VDB_H*/
|
||||
2402
lv_draw/lv_draw.c
2402
lv_draw/lv_draw.c
File diff suppressed because it is too large
Load Diff
@@ -1,54 +1,140 @@
|
||||
/**
|
||||
* @file lv_draw_img.h
|
||||
* @file lv_draw.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_DRAW_H
|
||||
#define LV_DRAW_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "../lv_objx/lv_btn.h"
|
||||
#include "../lv_objx/lv_rect.h"
|
||||
#include "../lv_objx/lv_line.h"
|
||||
#include "../lv_objx/lv_img.h"
|
||||
#include "../lv_objx/lv_label.h"
|
||||
|
||||
#include "misc_conf.h"
|
||||
#include "../lv_core/lv_style.h"
|
||||
#include "../lv_misc/lv_txt.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
/*If image pixels contains alpha we need to know how much byte is a pixel*/
|
||||
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
|
||||
# define LV_IMG_PX_SIZE_ALPHA_BYTE 2
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
# define LV_IMG_PX_SIZE_ALPHA_BYTE 3
|
||||
#elif LV_COLOR_DEPTH == 24
|
||||
# define LV_IMG_PX_SIZE_ALPHA_BYTE 4
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/* Image header it is compatible with
|
||||
* the result image converter utility*/
|
||||
typedef struct
|
||||
{
|
||||
union{
|
||||
struct {
|
||||
uint32_t chroma_keyed:1; /*1: The image contains transparent pixels with LV_COLOR_TRANSP color*/
|
||||
uint32_t alpha_byte :1; /*Every pixel is extended with a 8 bit alpha channel*/
|
||||
uint32_t format :6; /*See: lv_img_px_format*/
|
||||
uint32_t w:12; /*Width of the image map*/
|
||||
uint32_t h:12; /*Height of the image map*/
|
||||
}header;
|
||||
uint8_t src_type;
|
||||
};
|
||||
|
||||
union {
|
||||
const uint8_t * pixel_map; /*For internal images (c arrays) pointer to the pixels array*/
|
||||
uint8_t first_pixel; /*For external images (binary) the first byte of the pixels (just for convenient)*/
|
||||
};
|
||||
}lv_img_t;
|
||||
|
||||
typedef enum {
|
||||
LV_IMG_FORMAT_UNKOWN = 0,
|
||||
LV_IMG_FORMAT_INTERNAL_RAW, /*'lv_img_t' variable compiled with the code*/
|
||||
LV_IMG_FORMAT_FILE_RAW_RGB332, /*8 bit*/
|
||||
LV_IMG_FORMAT_FILE_RAW_RGB565, /*16 bit*/
|
||||
LV_IMG_FORMAT_FILE_RAW_RGB888, /*24 bit (stored on 32 bit)*/
|
||||
}lv_img_format_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
LV_IMG_SRC_VARIABLE,
|
||||
LV_IMG_SRC_FILE,
|
||||
LV_IMG_SRC_SYMBOL,
|
||||
LV_IMG_SRC_UNKNOWN,
|
||||
}lv_img_src_t;
|
||||
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
#if USE_LV_RECT != 0
|
||||
void lv_draw_rect(const area_t * cords_p, const area_t * mask_p,
|
||||
const lv_rects_t * rects_p, opa_t opa);
|
||||
|
||||
/**
|
||||
* Draw a rectangle
|
||||
* @param cords_p the coordinates of the rectangle
|
||||
* @param mask_p the rectangle will be drawn only in this mask
|
||||
* @param style_p pointer to a style
|
||||
*/
|
||||
void lv_draw_rect(const lv_area_t * cords_p, const lv_area_t * mask_p, const lv_style_t * style_p);
|
||||
|
||||
|
||||
/*Experimental use for 3D modeling*/
|
||||
#define USE_LV_TRIANGLE 0
|
||||
#if USE_LV_TRIANGLE != 0
|
||||
/**
|
||||
*
|
||||
* @param points pointer to an array with 3 points
|
||||
* @param mask_p the triangle will be drawn only in this mask
|
||||
* @param color color of the triangle
|
||||
*/
|
||||
void lv_draw_triangle(const lv_point_t * points, const lv_area_t * mask_p, lv_color_t color);
|
||||
#endif
|
||||
|
||||
#if USE_LV_LABEL != 0
|
||||
void lv_draw_label(const area_t * cords_p,const area_t * mask_p,
|
||||
const lv_labels_t * labels_p, opa_t opa, const char * txt);
|
||||
/**
|
||||
* Write a text
|
||||
* @param cords_p coordinates of the label
|
||||
* @param mask_p the label will be drawn only in this area
|
||||
* @param style_p pointer to a style
|
||||
* @param txt 0 terminated text to write
|
||||
* @param flags settings for the text from 'txt_flag_t' enum
|
||||
* @param offset text offset in x and y direction (NULL if unused)
|
||||
*/
|
||||
void lv_draw_label(const lv_area_t * cords_p,const lv_area_t * mask_p, const lv_style_t * style_p,
|
||||
const char * txt, lv_txt_flag_t flag, lv_point_t * offset);
|
||||
|
||||
#if USE_LV_IMG
|
||||
/**
|
||||
* Draw an image
|
||||
* @param cords_p the coordinates of the image
|
||||
* @param mask_p the image will be drawn only in this area
|
||||
* @param map_p pointer to a lv_color_t array which contains the pixels of the image
|
||||
*/
|
||||
void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask,
|
||||
const lv_style_t * style, const void * src);
|
||||
#endif
|
||||
|
||||
#if USE_LV_LINE != 0
|
||||
void lv_draw_line(const point_t * p1, const point_t * p2, const area_t * mask_p,
|
||||
const lv_lines_t * lines_p, opa_t opa);
|
||||
#endif
|
||||
/**
|
||||
* Draw a line
|
||||
* @param p1 first point of the line
|
||||
* @param p2 second point of the line
|
||||
* @param mask_pthe line will be drawn only on this area
|
||||
* @param style_p pointer to a style
|
||||
*/
|
||||
void lv_draw_line(const lv_point_t * p1, const lv_point_t * p2, const lv_area_t * mask_p,
|
||||
const lv_style_t * style_p);
|
||||
|
||||
#if USE_LV_IMG != 0 && USE_FSINT != 0 && USE_UFS != 0
|
||||
void lv_draw_img(const area_t * cords_p, const area_t * mask_p,
|
||||
const lv_imgs_t * imgs_p, opa_t opa, const char * fn);
|
||||
#endif
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_DRAW_H*/
|
||||
|
||||
8
lv_draw/lv_draw.mk
Normal file
8
lv_draw/lv_draw.mk
Normal file
@@ -0,0 +1,8 @@
|
||||
CSRCS += lv_draw_vbasic.c
|
||||
CSRCS += lv_draw.c
|
||||
CSRCS += lv_draw_rbasic.c
|
||||
|
||||
DEPPATH += --dep-path lvgl/lv_draw
|
||||
VPATH += :lvgl/lv_draw
|
||||
|
||||
CFLAGS += "-I$(LVGL_DIR)/lvgl/lv_draw"
|
||||
@@ -7,9 +7,11 @@
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_draw_rbasic.h"
|
||||
#include "lv_conf.h"
|
||||
#include "hal/disp/disp.h"
|
||||
#include "../lv_misc/font.h"
|
||||
#if USE_LV_REAL_DRAW != 0
|
||||
|
||||
#include "../lv_hal/lv_hal_disp.h"
|
||||
#include "../lv_misc/lv_font.h"
|
||||
#include "lv_draw.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -22,11 +24,11 @@
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static void lv_rpx(cord_t x, cord_t y, const area_t * mask_p, color_t color);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static lv_color_t letter_bg_color;
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
@@ -36,6 +38,27 @@ static void lv_rpx(cord_t x, cord_t y, const area_t * mask_p, color_t color);
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Put a pixel to the display
|
||||
* @param x x coordinate of the pixel
|
||||
* @param y y coordinate of the pixel
|
||||
* @param mask_p the pixel will be drawn on this area
|
||||
* @param color color of the pixel
|
||||
* @param opa opacity (ignored, only for compatibility with lv_vpx)
|
||||
*/
|
||||
void lv_rpx(lv_coord_t x, lv_coord_t y, const lv_area_t * mask_p, lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
(void)opa; /*Opa is used only for compatibility with lv_vpx*/
|
||||
|
||||
lv_area_t area;
|
||||
area.x1 = x;
|
||||
area.y1 = y;
|
||||
area.x2 = x;
|
||||
area.y2 = y;
|
||||
|
||||
lv_rfill(&area, mask_p, color, LV_OPA_COVER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill an area on the display
|
||||
* @param cords_p coordinates of the area to fill
|
||||
@@ -43,24 +66,25 @@ static void lv_rpx(cord_t x, cord_t y, const area_t * mask_p, color_t color);
|
||||
* @param color fill color
|
||||
* @param opa opacity (ignored, only for compatibility with lv_vfill)
|
||||
*/
|
||||
void lv_rfill(const area_t * cords_p, const area_t * mask_p,
|
||||
color_t color, opa_t opa)
|
||||
void lv_rfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
area_t masked_area;
|
||||
|
||||
(void)opa; /*Opa is used only for compatibility with lv_vfill*/
|
||||
|
||||
lv_area_t masked_area;
|
||||
bool union_ok = true;
|
||||
|
||||
if(mask_p != NULL) {
|
||||
union_ok = area_union(&masked_area, cords_p, mask_p);
|
||||
union_ok = lv_area_union(&masked_area, cords_p, mask_p);
|
||||
} else {
|
||||
area_t scr_area;
|
||||
area_set(&scr_area, 0, 0, LV_HOR_RES - 1, LV_VER_RES - 1);
|
||||
union_ok = area_union(&masked_area, cords_p, &scr_area);
|
||||
lv_area_t scr_area;
|
||||
lv_area_set(&scr_area, 0, 0, LV_HOR_RES - 1, LV_VER_RES - 1);
|
||||
union_ok = lv_area_union(&masked_area, cords_p, &scr_area);
|
||||
}
|
||||
|
||||
|
||||
if(union_ok != false){
|
||||
disp_area(DISP_ID_ALL, masked_area.x1, masked_area.y1, masked_area.x2, masked_area.y2);
|
||||
disp_fill(DISP_ID_ALL, color);
|
||||
lv_disp_fill(masked_area.x1, masked_area.y1, masked_area.x2, masked_area.y2, color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,79 +97,154 @@ void lv_rfill(const area_t * cords_p, const area_t * mask_p,
|
||||
* @param color color of letter
|
||||
* @param opa opacity of letter (ignored, only for compatibility with lv_vletter)
|
||||
*/
|
||||
void lv_rletter(const point_t * pos_p, const area_t * mask_p,
|
||||
const font_t * font_p, uint8_t letter,
|
||||
color_t color, opa_t opa)
|
||||
void lv_rletter(const lv_point_t * pos_p, const lv_area_t * mask_p,
|
||||
const lv_font_t * font_p, uint32_t letter,
|
||||
lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
uint8_t w = font_get_width(font_p, letter);
|
||||
const uint8_t * bitmap_p = font_get_bitmap(font_p, letter);
|
||||
(void)opa; /*Opa is used only for compatibility with lv_vletter*/
|
||||
|
||||
uint8_t col, col_sub, row;
|
||||
static uint8_t bpp1_opa_table[2] = {0, 255}; /*Opacity mapping with bpp = 1 (Just for compatibility)*/
|
||||
static uint8_t bpp2_opa_table[4] = {0, 85, 170, 255}; /*Opacity mapping with bpp = 2*/
|
||||
static uint8_t bpp4_opa_table[16] = {0, 17, 34, 51, /*Opacity mapping with bpp = 4*/
|
||||
68, 85, 102, 119,
|
||||
136, 153, 170, 187,
|
||||
204, 221, 238, 255};
|
||||
|
||||
for(row = 0; row < font_p->height_row; row ++) {
|
||||
for(col = 0, col_sub = 7; col < w; col ++, col_sub--) {
|
||||
if(*bitmap_p & (1 << col_sub)) {
|
||||
lv_rpx(pos_p->x + col, pos_p->y + row, mask_p, color);
|
||||
if(font_p == NULL) return;
|
||||
|
||||
uint8_t letter_w = lv_font_get_width(font_p, letter);
|
||||
uint8_t letter_h = lv_font_get_height(font_p);
|
||||
uint8_t bpp = lv_font_get_bpp(font_p, letter); /*Bit per pixel (1,2, 4 or 8)*/
|
||||
uint8_t *bpp_opa_table;
|
||||
uint8_t mask_init;
|
||||
uint8_t mask;
|
||||
|
||||
switch(bpp) {
|
||||
case 1: bpp_opa_table = bpp1_opa_table; mask_init = 0x80; break;
|
||||
case 2: bpp_opa_table = bpp2_opa_table; mask_init = 0xC0; break;
|
||||
case 4: bpp_opa_table = bpp4_opa_table; mask_init = 0xF0; break;
|
||||
case 8: bpp_opa_table = NULL; mask_init = 0xFF; break; /*No opa table, pixel value will be used directly*/
|
||||
default: return; /*Invalid bpp. Can't render the letter*/
|
||||
}
|
||||
|
||||
const uint8_t * map_p = lv_font_get_bitmap(font_p, letter);
|
||||
|
||||
if(map_p == NULL) return;
|
||||
|
||||
/*If the letter is completely out of mask don't draw it */
|
||||
if(pos_p->x + letter_w < mask_p->x1 || pos_p->x > mask_p->x2 ||
|
||||
pos_p->y + letter_h < mask_p->y1 || pos_p->y > mask_p->y2) return;
|
||||
|
||||
lv_coord_t col, row;
|
||||
uint8_t col_bit;
|
||||
uint8_t col_byte_cnt;
|
||||
uint8_t width_byte_scr = letter_w >> 3; /*Width in bytes (on the screen finally) (e.g. w = 11 -> 2 bytes wide)*/
|
||||
if(letter_w & 0x7) width_byte_scr++;
|
||||
uint8_t width_byte_bpp = (letter_w * bpp) >> 3; /*Letter width in byte. Real width in the font*/
|
||||
if((letter_w * bpp) & 0x7) width_byte_bpp++;
|
||||
|
||||
/* Calculate the col/row start/end on the map*/
|
||||
lv_coord_t col_start = pos_p->x >= mask_p->x1 ? 0 : mask_p->x1 - pos_p->x;
|
||||
lv_coord_t col_end = pos_p->x + letter_w <= mask_p->x2 ? letter_w : mask_p->x2 - pos_p->x + 1;
|
||||
lv_coord_t row_start = pos_p->y >= mask_p->y1 ? 0 : mask_p->y1 - pos_p->y;
|
||||
lv_coord_t row_end = pos_p->y + letter_h <= mask_p->y2 ? letter_h : mask_p->y2 - pos_p->y + 1;
|
||||
|
||||
/*Move on the map too*/
|
||||
map_p += (row_start * width_byte_bpp) + ((col_start * bpp) >> 3);
|
||||
|
||||
uint8_t letter_px;
|
||||
for(row = row_start; row < row_end; row ++) {
|
||||
col_byte_cnt = 0;
|
||||
col_bit = (col_start * bpp) % 8;
|
||||
mask = mask_init >> col_bit;
|
||||
for(col = col_start; col < col_end; col ++) {
|
||||
letter_px = (*map_p & mask) >> (8 - col_bit - bpp);
|
||||
if(letter_px != 0) {
|
||||
lv_rpx(pos_p->x + col, pos_p->y + row, mask_p, lv_color_mix(color, letter_bg_color, bpp == 8 ? letter_px : bpp_opa_table[letter_px]), LV_OPA_COVER);
|
||||
}
|
||||
|
||||
if(col_sub == 0) {
|
||||
bitmap_p++;
|
||||
col_sub = 8;
|
||||
if(col_bit < 8 - bpp) {
|
||||
col_bit += bpp;
|
||||
mask = mask >> bpp;
|
||||
}
|
||||
else {
|
||||
col_bit = 0;
|
||||
col_byte_cnt ++;
|
||||
mask = mask_init;
|
||||
map_p ++;
|
||||
}
|
||||
}
|
||||
|
||||
/*Correction if the letter is short*/
|
||||
bitmap_p += font_p->width_byte - ((w >> 3) + 1);
|
||||
/*Go to the next row*/
|
||||
bitmap_p ++;
|
||||
|
||||
map_p += (width_byte_bpp) - col_byte_cnt;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a color map to the display
|
||||
* When the letter is ant-aliased it needs to know the background color
|
||||
* @param bg_color the background color of the currently drawn letter
|
||||
*/
|
||||
void lv_rletter_set_background(lv_color_t color)
|
||||
{
|
||||
letter_bg_color = color;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a color map to the display (image)
|
||||
* @param cords_p coordinates the color map
|
||||
* @param mask_p the map will drawn only on this area
|
||||
* @param map_p pointer to a color_t array
|
||||
* @param opa opacity of the map (ignored, only for compatibility with lv_vmap)
|
||||
* @param transp true: enable transparency of LV_IMG_COLOR_TRANSP color pixels
|
||||
* @param map_p pointer to a lv_color_t array
|
||||
* @param opa opacity of the map (ignored, only for compatibility with 'lv_vmap')
|
||||
* @param chroma_keyed true: enable transparency of LV_IMG_LV_COLOR_TRANSP color pixels
|
||||
* @param alpha_byte true: extra alpha byte is inserted for every pixel (not supported, only l'v_vmap' can draw it)
|
||||
* @param recolor mix the pixels with this color
|
||||
* @param recolor_opa the intense of recoloring
|
||||
*/
|
||||
void lv_rmap(const area_t * cords_p, const area_t * mask_p,
|
||||
const color_t * map_p, opa_t opa, bool transp,
|
||||
color_t recolor, opa_t recolor_opa)
|
||||
void lv_rmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
const uint8_t * map_p, lv_opa_t opa, bool chroma_key, bool alpha_byte,
|
||||
lv_color_t recolor, lv_opa_t recolor_opa)
|
||||
{
|
||||
area_t masked_a;
|
||||
if(alpha_byte) return; /*Pixel level opacity i not supported in real map drawing*/
|
||||
|
||||
(void)opa; /*opa is used only for compatibility with lv_vmap*/
|
||||
lv_area_t masked_a;
|
||||
bool union_ok;
|
||||
|
||||
union_ok = area_union(&masked_a, cords_p, mask_p);
|
||||
union_ok = lv_area_union(&masked_a, cords_p, mask_p);
|
||||
|
||||
/*If there are common part of the mask and map then draw the map*/
|
||||
if(union_ok == false) return;
|
||||
|
||||
/*Go to the first pixel*/
|
||||
cord_t map_width = area_get_width(cords_p);
|
||||
map_p+= (masked_a.y1 - cords_p->y1) * map_width;
|
||||
map_p += masked_a.x1 - cords_p->x1;
|
||||
lv_coord_t map_width = lv_area_get_width(cords_p);
|
||||
map_p += (masked_a.y1 - cords_p->y1) * map_width * sizeof(lv_color_t);
|
||||
map_p += (masked_a.x1 - cords_p->x1) * sizeof(lv_color_t);
|
||||
|
||||
if(transp == false) {
|
||||
cord_t row;
|
||||
for(row = 0; row < area_get_height(&masked_a); row++) {
|
||||
cord_t col;
|
||||
for(col = 0; col < area_get_width(&masked_a); col ++) {
|
||||
lv_rpx(masked_a.x1 + col, masked_a.y1 + row, mask_p, map_p[col]);
|
||||
}
|
||||
map_p += map_width;
|
||||
lv_coord_t row;
|
||||
if(recolor_opa == LV_OPA_TRANSP && chroma_key == false) {
|
||||
lv_coord_t mask_w = lv_area_get_width(&masked_a) - 1;
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
lv_disp_map(masked_a.x1, row, masked_a.x1 + mask_w, row, (lv_color_t*)map_p);
|
||||
map_p += map_width * sizeof(lv_color_t); /*Next row on the map*/
|
||||
}
|
||||
}else {
|
||||
color_t transp_color = LV_COLOR_TRANSP;
|
||||
cord_t row;
|
||||
for(row = 0; row < area_get_height(&masked_a); row++) {
|
||||
cord_t col;
|
||||
for(col = 0; col < area_get_width(&masked_a); col ++) {
|
||||
if(map_p[col].full != transp_color.full) {
|
||||
lv_rpx(masked_a.x1 + col, masked_a.y1 + row, mask_p, map_p[col]);
|
||||
} else {
|
||||
lv_color_t chroma_key_color = LV_COLOR_TRANSP;
|
||||
lv_coord_t col;
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
for(col = masked_a.x1; col <= masked_a.x2; col++) {
|
||||
lv_color_t * px_color = (lv_color_t *) &map_p[(uint32_t)(col - masked_a.x1) * sizeof(lv_color_t)];
|
||||
|
||||
if(chroma_key && chroma_key_color.full == px_color->full) continue;
|
||||
|
||||
if(recolor_opa != LV_OPA_TRANSP) {
|
||||
lv_color_t recolored_px = lv_color_mix(recolor, *px_color, recolor_opa);
|
||||
|
||||
lv_rpx(col, row, mask_p, recolored_px, LV_OPA_COVER);
|
||||
} else {
|
||||
lv_rpx(col, row, mask_p, *px_color, LV_OPA_COVER);
|
||||
}
|
||||
|
||||
}
|
||||
map_p += map_width;
|
||||
map_p += map_width * sizeof(lv_color_t); /*Next row on the map*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,20 +253,4 @@ void lv_rmap(const area_t * cords_p, const area_t * mask_p,
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Put a pixel to the display
|
||||
* @param x x coordinate of the pixel
|
||||
* @param y y coordinate of the pixel
|
||||
* @param mask_p the pixel will be drawn on this area
|
||||
* @param color color of the pixel
|
||||
*/
|
||||
static void lv_rpx(cord_t x, cord_t y, const area_t * mask_p, color_t color)
|
||||
{
|
||||
area_t area;
|
||||
area.x1 = x;
|
||||
area.y1 = y;
|
||||
area.x2 = x;
|
||||
area.y2 = y;
|
||||
|
||||
lv_rfill(&area, mask_p, color, OPA_COVER);
|
||||
}
|
||||
#endif /*USE_LV_REAL_DRAW*/
|
||||
|
||||
@@ -6,12 +6,19 @@
|
||||
#ifndef LV_DRAW_RBASIC_H
|
||||
#define LV_DRAW_RBASIC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "misc/others/color.h"
|
||||
#include "../lv_misc/area.h"
|
||||
#include "../lv_misc/font.h"
|
||||
#include "../../lv_conf.h"
|
||||
#if USE_LV_REAL_DRAW != 0
|
||||
|
||||
#include "../lv_misc/lv_color.h"
|
||||
#include "../lv_misc/lv_area.h"
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -24,16 +31,61 @@
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
void lv_rfill(const area_t * area_p, const area_t * mask_p,
|
||||
color_t color, opa_t opa);
|
||||
void lv_rletter(const point_t * pos_p, const area_t * mask_p,
|
||||
const font_t * font_p, uint8_t letter,
|
||||
color_t color, opa_t opa);
|
||||
void lv_rmap(const area_t * cords_p, const area_t * mask_p,
|
||||
const color_t * map_p, opa_t opa, bool transp,
|
||||
color_t recolor, opa_t recolor_opa);
|
||||
|
||||
void lv_rpx(lv_coord_t x, lv_coord_t y, const lv_area_t * mask_p, lv_color_t color, lv_opa_t opa);
|
||||
|
||||
/**
|
||||
* Fill an area on the display
|
||||
* @param cords_p coordinates of the area to fill
|
||||
* @param mask_p fill only o this mask
|
||||
* @param color fill color
|
||||
* @param opa opacity (ignored, only for compatibility with lv_vfill)
|
||||
*/
|
||||
void lv_rfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
lv_color_t color, lv_opa_t opa);
|
||||
|
||||
/**
|
||||
* Draw a letter to the display
|
||||
* @param pos_p left-top coordinate of the latter
|
||||
* @param mask_p the letter will be drawn only on this area
|
||||
* @param font_p pointer to font
|
||||
* @param letter a letter to draw
|
||||
* @param color color of letter
|
||||
* @param opa opacity of letter (ignored, only for compatibility with lv_vletter)
|
||||
*/
|
||||
void lv_rletter(const lv_point_t * pos_p, const lv_area_t * mask_p,
|
||||
const lv_font_t * font_p, uint32_t letter,
|
||||
lv_color_t color, lv_opa_t opa);
|
||||
|
||||
/**
|
||||
* When the letter is ant-aliased it needs to know the background color
|
||||
* @param bg_color the background color of the currently drawn letter
|
||||
*/
|
||||
void lv_rletter_set_background(lv_color_t color);
|
||||
|
||||
|
||||
/**
|
||||
* Draw a color map to the display (image)
|
||||
* @param cords_p coordinates the color map
|
||||
* @param mask_p the map will drawn only on this area
|
||||
* @param map_p pointer to a lv_color_t array
|
||||
* @param opa opacity of the map (ignored, only for compatibility with 'lv_vmap')
|
||||
* @param chroma_keyed true: enable transparency of LV_IMG_LV_COLOR_TRANSP color pixels
|
||||
* @param alpha_byte true: extra alpha byte is inserted for every pixel (not supported, only l'v_vmap' can draw it)
|
||||
* @param recolor mix the pixels with this color
|
||||
* @param recolor_opa the intense of recoloring
|
||||
*/
|
||||
void lv_rmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
const uint8_t * map_p, lv_opa_t opa, bool chroma_key, bool alpha_byte,
|
||||
lv_color_t recolor, lv_opa_t recolor_opa);
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*USE_LV_REAL_DRAW*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_DRAW_RBASIC_H*/
|
||||
|
||||
@@ -2,11 +2,23 @@
|
||||
* @file lv_vdraw.c
|
||||
*
|
||||
*/
|
||||
#include "lv_conf.h"
|
||||
|
||||
#include "../../lv_conf.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../lv_hal/lv_hal_disp.h"
|
||||
#include "../lv_misc/lv_area.h"
|
||||
#include "../lv_misc/lv_font.h"
|
||||
#include "../lv_misc/lv_color.h"
|
||||
|
||||
#if LV_VDB_SIZE != 0
|
||||
|
||||
#include <stddef.h>
|
||||
#include "lvgl/lv_obj/lv_vdb.h"
|
||||
#include "../lv_core/lv_vdb.h"
|
||||
#include "lv_draw.h"
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
@@ -15,6 +27,7 @@
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define VFILL_HW_ACC_SIZE_LIMIT 50 /*Always fill < 50 px with 'sw_color_fill' because of the hw. init overhead*/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
@@ -23,6 +36,8 @@
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static void sw_mem_blend(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa);
|
||||
static void sw_color_fill(lv_area_t * mem_area, lv_color_t * mem, const lv_area_t * fill_area, lv_color_t color, lv_opa_t opa);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@@ -36,84 +51,189 @@
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Put a pixel in the Virtual Display Buffer
|
||||
* @param x pixel x coordinate
|
||||
* @param y pixel y coordinate
|
||||
* @param mask_p fill only on this mask (truncated to VDB area)
|
||||
* @param color pixel color
|
||||
* @param opa opacity of the area (0..255)
|
||||
*/
|
||||
void lv_vpx(lv_coord_t x, lv_coord_t y, const lv_area_t * mask_p, lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
lv_vdb_t * vdb_p = lv_vdb_get();
|
||||
|
||||
/*Pixel out of the mask*/
|
||||
if(x < mask_p->x1 || x > mask_p->x2 ||
|
||||
y < mask_p->y1 || y > mask_p->y2) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t vdb_width = lv_area_get_width(&vdb_p->area);
|
||||
|
||||
/*Make the coordinates relative to VDB*/
|
||||
x-=vdb_p->area.x1;
|
||||
y-=vdb_p->area.y1;
|
||||
lv_color_t * vdb_px_p = vdb_p->buf + y * vdb_width + x;
|
||||
if(opa == LV_OPA_COVER) {
|
||||
*vdb_px_p = color;
|
||||
}
|
||||
else {
|
||||
*vdb_px_p = lv_color_mix(color,*vdb_px_p, opa);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fill an area in the Virtual Display Buffer
|
||||
* @param cords_p coordinates of the area to fill
|
||||
* @param mask_p fill only o this mask
|
||||
* @param mask_p fill only o this mask (truncated to VDB area)
|
||||
* @param color fill color
|
||||
* @param opa opacity of the area (0..255)
|
||||
*/
|
||||
void lv_vfill(const area_t * cords_p, const area_t * mask_p,
|
||||
color_t color, opa_t opa)
|
||||
void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
area_t res_a;
|
||||
lv_area_t res_a;
|
||||
bool union_ok;
|
||||
lv_vdb_t * vdb_p = lv_vdb_get();
|
||||
|
||||
/*Get the union of cord and mask*/
|
||||
/* The mask is already truncated to the vdb size
|
||||
* in 'lv_refr_area_with_vdb' function */
|
||||
union_ok = area_union(&res_a, cords_p, mask_p);
|
||||
union_ok = lv_area_union(&res_a, cords_p, mask_p);
|
||||
|
||||
/*If there are common part of the three area then draw to the vdb*/
|
||||
if(union_ok == true) {
|
||||
area_t vdb_rel_a; /*Stores relative coordinates on vdb*/
|
||||
vdb_rel_a.x1 = res_a.x1 - vdb_p->vdb_area.x1;
|
||||
vdb_rel_a.y1 = res_a.y1 - vdb_p->vdb_area.y1;
|
||||
vdb_rel_a.x2 = res_a.x2 - vdb_p->vdb_area.x1;
|
||||
vdb_rel_a.y2 = res_a.y2 - vdb_p->vdb_area.y1;
|
||||
|
||||
color_t * vdb_buf_tmp = vdb_p->buf;
|
||||
uint32_t vdb_width = area_get_width(&vdb_p->vdb_area);
|
||||
/*Move the vdb_tmp to the first row*/
|
||||
vdb_buf_tmp += vdb_width * vdb_rel_a.y1;
|
||||
|
||||
/*Set all row in vdb to the given color*/
|
||||
cord_t row;
|
||||
uint32_t col;
|
||||
|
||||
/*Run simpler function without opacity*/
|
||||
if(opa == OPA_COVER) {
|
||||
for(row = vdb_rel_a.y1; row <= vdb_rel_a.y2; row++) {
|
||||
for(col = vdb_rel_a.x1; col <= vdb_rel_a.x2; col++) {
|
||||
vdb_buf_tmp[col] = color;
|
||||
}
|
||||
if(union_ok == false) return;
|
||||
|
||||
vdb_buf_tmp += vdb_width;
|
||||
}
|
||||
}
|
||||
/*Calculate the alpha too*/
|
||||
else {
|
||||
for(row = vdb_rel_a.y1; row <= vdb_rel_a.y2; row++) {
|
||||
for(col = vdb_rel_a.x1; col <= vdb_rel_a.x2; col++) {
|
||||
color_t c = color_mix(color, vdb_buf_tmp[col], opa);
|
||||
vdb_buf_tmp[col] = c;
|
||||
}
|
||||
lv_area_t vdb_rel_a; /*Stores relative coordinates on vdb*/
|
||||
vdb_rel_a.x1 = res_a.x1 - vdb_p->area.x1;
|
||||
vdb_rel_a.y1 = res_a.y1 - vdb_p->area.y1;
|
||||
vdb_rel_a.x2 = res_a.x2 - vdb_p->area.x1;
|
||||
vdb_rel_a.y2 = res_a.y2 - vdb_p->area.y1;
|
||||
|
||||
lv_color_t * vdb_buf_tmp = vdb_p->buf;
|
||||
uint32_t vdb_width = lv_area_get_width(&vdb_p->area);
|
||||
/*Move the vdb_tmp to the first row*/
|
||||
vdb_buf_tmp += vdb_width * vdb_rel_a.y1;
|
||||
|
||||
|
||||
#if USE_LV_GPU
|
||||
static lv_color_t color_array_tmp[LV_HOR_RES]; /*Used by 'lv_disp_mem_blend'*/
|
||||
static lv_coord_t last_width = -1;
|
||||
|
||||
lv_coord_t w = lv_area_get_width(&vdb_rel_a);
|
||||
/*Don't use hw. acc. for every small fill (because of the init overhead)*/
|
||||
if(w < VFILL_HW_ACC_SIZE_LIMIT) {
|
||||
sw_color_fill(&vdb_p->area, vdb_buf_tmp, &vdb_rel_a, color, opa);
|
||||
}
|
||||
/*Not opaque fill*/
|
||||
else if(opa == LV_OPA_COVER) {
|
||||
/*Use hw fill if present*/
|
||||
if(lv_disp_is_mem_fill_supported()) {
|
||||
lv_coord_t row;
|
||||
for(row = vdb_rel_a.y1;row <= vdb_rel_a.y2; row++) {
|
||||
lv_disp_mem_fill(&vdb_buf_tmp[vdb_rel_a.x1], w, color);
|
||||
vdb_buf_tmp += vdb_width;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*Use hw blend if present and the area is not too small*/
|
||||
else if(lv_area_get_height(&vdb_rel_a) > VFILL_HW_ACC_SIZE_LIMIT &&
|
||||
lv_disp_is_mem_blend_supported())
|
||||
{
|
||||
/*Fill a one line sized buffer with a color and blend this later*/
|
||||
if(color_array_tmp[0].full != color.full || last_width != w) {
|
||||
uint16_t i;
|
||||
for(i = 0; i < w; i++) {
|
||||
color_array_tmp[i].full = color.full;
|
||||
}
|
||||
last_width = w;
|
||||
}
|
||||
|
||||
/*Blend the filled line to every line VDB line-by-line*/
|
||||
lv_coord_t row;
|
||||
for(row = vdb_rel_a.y1;row <= vdb_rel_a.y2; row++) {
|
||||
lv_disp_mem_blend(&vdb_buf_tmp[vdb_rel_a.x1], color_array_tmp, w, opa);
|
||||
vdb_buf_tmp += vdb_width;
|
||||
}
|
||||
|
||||
}
|
||||
/*Else use sw fill if no better option*/
|
||||
else {
|
||||
sw_color_fill(&vdb_p->area, vdb_buf_tmp, &vdb_rel_a, color, opa);
|
||||
}
|
||||
|
||||
}
|
||||
/*Fill with opacity*/
|
||||
else {
|
||||
/*Use hw blend if present*/
|
||||
if(lv_disp_is_mem_blend_supported()) {
|
||||
if(color_array_tmp[0].full != color.full || last_width != w) {
|
||||
uint16_t i;
|
||||
for(i = 0; i < w; i++) {
|
||||
color_array_tmp[i].full = color.full;
|
||||
}
|
||||
|
||||
last_width = w;
|
||||
}
|
||||
lv_coord_t row;
|
||||
for(row = vdb_rel_a.y1;row <= vdb_rel_a.y2; row++) {
|
||||
lv_disp_mem_blend(&vdb_buf_tmp[vdb_rel_a.x1], color_array_tmp, w, opa);
|
||||
vdb_buf_tmp += vdb_width;
|
||||
}
|
||||
|
||||
}
|
||||
/*Use sw fill with opa if no better option*/
|
||||
else {
|
||||
sw_color_fill(&vdb_p->area, vdb_buf_tmp, &vdb_rel_a, color, opa);
|
||||
}
|
||||
|
||||
}
|
||||
#else
|
||||
sw_color_fill(&vdb_p->area, vdb_buf_tmp, &vdb_rel_a, color, opa);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a letter in the Virtual Display Buffer
|
||||
* @param pos_p left-top coordinate of the latter
|
||||
* @param mask_p the letter will be drawn only on this area
|
||||
* @param mask_p the letter will be drawn only on this area (truncated to VDB area)
|
||||
* @param font_p pointer to font
|
||||
* @param letter a letter to draw
|
||||
* @param color color of letter
|
||||
* @param opa opacity of letter (0..255)
|
||||
*/
|
||||
void lv_vletter(const point_t * pos_p, const area_t * mask_p,
|
||||
const font_t * font_p, uint8_t letter,
|
||||
color_t color, opa_t opa)
|
||||
{
|
||||
void lv_vletter(const lv_point_t * pos_p, const lv_area_t * mask_p,
|
||||
const lv_font_t * font_p, uint32_t letter,
|
||||
lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
|
||||
static uint8_t bpp1_opa_table[2] = {0, 255}; /*Opacity mapping with bpp = 1 (Just for compatibility)*/
|
||||
static uint8_t bpp2_opa_table[4] = {0, 85, 170, 255}; /*Opacity mapping with bpp = 2*/
|
||||
static uint8_t bpp4_opa_table[16] = {0, 17, 34, 51, /*Opacity mapping with bpp = 4*/
|
||||
68, 85, 102, 119,
|
||||
136, 153, 170, 187,
|
||||
204, 221, 238, 255};
|
||||
|
||||
if(font_p == NULL) return;
|
||||
|
||||
uint8_t letter_w = font_get_width(font_p, letter);
|
||||
uint8_t letter_h = font_get_height(font_p);
|
||||
uint8_t letter_w = lv_font_get_width(font_p, letter);
|
||||
uint8_t letter_h = lv_font_get_height(font_p);
|
||||
uint8_t bpp = lv_font_get_bpp(font_p, letter); /*Bit per pixel (1,2, 4 or 8)*/
|
||||
uint8_t *bpp_opa_table;
|
||||
uint8_t mask_init;
|
||||
uint8_t mask;
|
||||
|
||||
const uint8_t * map_p = font_get_bitmap(font_p, letter);
|
||||
switch(bpp) {
|
||||
case 1: bpp_opa_table = bpp1_opa_table; mask_init = 0x80; break;
|
||||
case 2: bpp_opa_table = bpp2_opa_table; mask_init = 0xC0; break;
|
||||
case 4: bpp_opa_table = bpp4_opa_table; mask_init = 0xF0; break;
|
||||
case 8: bpp_opa_table = NULL; mask_init = 0xFF; break; /*No opa table, pixel value will be used directly*/
|
||||
default: return; /*Invalid bpp. Can't render the letter*/
|
||||
}
|
||||
|
||||
const uint8_t * map_p = lv_font_get_bitmap(font_p, letter);
|
||||
|
||||
if(map_p == NULL) return;
|
||||
|
||||
@@ -122,189 +242,271 @@ void lv_vletter(const point_t * pos_p, const area_t * mask_p,
|
||||
pos_p->y + letter_h < mask_p->y1 || pos_p->y > mask_p->y2) return;
|
||||
|
||||
lv_vdb_t * vdb_p = lv_vdb_get();
|
||||
cord_t vdb_width = area_get_width(&vdb_p->vdb_area);
|
||||
color_t * vdb_buf_tmp = vdb_p->buf;
|
||||
cord_t col, row;
|
||||
lv_coord_t vdb_width = lv_area_get_width(&vdb_p->area);
|
||||
lv_color_t * vdb_buf_tmp = vdb_p->buf;
|
||||
lv_coord_t col, row;
|
||||
uint8_t col_bit;
|
||||
uint8_t col_byte_cnt;
|
||||
uint8_t width_byte_scr = letter_w >> 3; /*Width in bytes (on the screen finally) (e.g. w = 11 -> 2 bytes wide)*/
|
||||
if(letter_w & 0x7) width_byte_scr++;
|
||||
uint8_t width_byte_bpp = (letter_w * bpp) >> 3; /*Letter width in byte. Real width in the font*/
|
||||
if((letter_w * bpp) & 0x7) width_byte_bpp++;
|
||||
|
||||
cord_t col_start = pos_p->x > mask_p->x1 ? 0 : mask_p->x1 - pos_p->x;
|
||||
cord_t col_end = pos_p->x + letter_w < mask_p->x2 ? letter_w : mask_p->x2 - pos_p->x + 1;
|
||||
cord_t row_start = pos_p->y > mask_p->y1 ? 0 : mask_p->y1 - pos_p->y;
|
||||
cord_t row_end = pos_p->y + letter_h < mask_p->y2 ? letter_h : mask_p->y2 - pos_p->y + 1;
|
||||
/* Calculate the col/row start/end on the map*/
|
||||
lv_coord_t col_start = pos_p->x >= mask_p->x1 ? 0 : mask_p->x1 - pos_p->x;
|
||||
lv_coord_t col_end = pos_p->x + letter_w <= mask_p->x2 ? letter_w : mask_p->x2 - pos_p->x + 1;
|
||||
lv_coord_t row_start = pos_p->y >= mask_p->y1 ? 0 : mask_p->y1 - pos_p->y;
|
||||
lv_coord_t row_end = pos_p->y + letter_h <= mask_p->y2 ? letter_h : mask_p->y2 - pos_p->y + 1;
|
||||
|
||||
/*Set a pointer on VDB to the first pixel of the letter*/
|
||||
vdb_buf_tmp += ((pos_p->y - vdb_p->vdb_area.y1) * vdb_width)
|
||||
+ pos_p->x - vdb_p->vdb_area.x1;
|
||||
vdb_buf_tmp += ((pos_p->y - vdb_p->area.y1) * vdb_width)
|
||||
+ pos_p->x - vdb_p->area.x1;
|
||||
|
||||
/*If the letter is partially out of mask the move there on VDB*/
|
||||
vdb_buf_tmp += (row_start * vdb_width) + col_start;
|
||||
|
||||
/*Move on the map too*/
|
||||
map_p += (row_start * font_p->width_byte) + (col_start>>3);
|
||||
map_p += (row_start * width_byte_bpp) + ((col_start * bpp) >> 3);
|
||||
|
||||
uint8_t letter_px;
|
||||
for(row = row_start; row < row_end; row ++) {
|
||||
col_byte_cnt = 0;
|
||||
col_bit = 7 - (col_start % 8);
|
||||
col_bit = (col_start * bpp) % 8;
|
||||
mask = mask_init >> col_bit;
|
||||
for(col = col_start; col < col_end; col ++) {
|
||||
|
||||
if((*map_p & (1 << col_bit)) != 0) {
|
||||
if(opa == OPA_COVER) *vdb_buf_tmp = color;
|
||||
else *vdb_buf_tmp = color_mix(color, *vdb_buf_tmp, opa);
|
||||
letter_px = (*map_p & mask) >> (8 - col_bit - bpp);
|
||||
if(letter_px != 0) {
|
||||
if(opa == LV_OPA_COVER) {
|
||||
*vdb_buf_tmp = lv_color_mix(color, *vdb_buf_tmp, bpp == 8 ? letter_px : bpp_opa_table[letter_px]);
|
||||
} else {
|
||||
*vdb_buf_tmp = lv_color_mix(color, *vdb_buf_tmp, bpp == 8 ?
|
||||
(uint16_t)((uint16_t)letter_px * opa) >> 8 :
|
||||
(uint16_t)((uint16_t)bpp_opa_table[letter_px] * opa) >> 8);
|
||||
}
|
||||
}
|
||||
|
||||
vdb_buf_tmp++;
|
||||
|
||||
/*Use a col. more times depending on LV_UPSCALE_FONT*/
|
||||
if(col_bit != 0) col_bit --;
|
||||
else {
|
||||
col_bit = 7;
|
||||
col_byte_cnt ++;
|
||||
map_p ++;
|
||||
if(col_bit < 8 - bpp) {
|
||||
col_bit += bpp;
|
||||
mask = mask >> bpp;
|
||||
}
|
||||
else {
|
||||
col_bit = 0;
|
||||
col_byte_cnt ++;
|
||||
mask = mask_init;
|
||||
map_p ++;
|
||||
}
|
||||
}
|
||||
|
||||
map_p += font_p->width_byte - col_byte_cnt;
|
||||
map_p += (width_byte_bpp) - col_byte_cnt;
|
||||
vdb_buf_tmp += vdb_width - (col_end - col_start); /*Next row in VDB*/
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a color map to the display
|
||||
* Draw a color map to the display (image)
|
||||
* @param cords_p coordinates the color map
|
||||
* @param mask_p the map will drawn only on this area
|
||||
* @param map_p pointer to a color_t array
|
||||
* @param opa opacity of the map (ignored, only for compatibility with lv_vmap)
|
||||
* @param transp true: enable transparency of LV_IMG_COLOR_TRANSP color pixels
|
||||
* @param mask_p the map will drawn only on this area (truncated to VDB area)
|
||||
* @param map_p pointer to a lv_color_t array
|
||||
* @param opa opacity of the map
|
||||
* @param chroma_keyed true: enable transparency of LV_IMG_LV_COLOR_TRANSP color pixels
|
||||
* @param alpha_byte true: extra alpha byte is inserted for every pixel
|
||||
* @param recolor mix the pixels with this color
|
||||
* @param recolor_opa the intense of recoloring
|
||||
*/
|
||||
void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
const color_t * map_p, opa_t opa, bool transp,
|
||||
color_t recolor, opa_t recolor_opa)
|
||||
void lv_vmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
const uint8_t * map_p, lv_opa_t opa, bool chroma_key, bool alpha_byte,
|
||||
lv_color_t recolor, lv_opa_t recolor_opa)
|
||||
{
|
||||
area_t masked_a;
|
||||
lv_area_t masked_a;
|
||||
bool union_ok;
|
||||
lv_vdb_t * vdb_p = lv_vdb_get();
|
||||
|
||||
|
||||
/*Get the union of map size and mask*/
|
||||
/* The mask is already truncated to the vdb size
|
||||
* in 'lv_refr_area_with_vdb' function */
|
||||
union_ok = area_union(&masked_a, cords_p, mask_p);
|
||||
|
||||
* in 'lv_refr_area_with_vdb' function */
|
||||
union_ok = lv_area_union(&masked_a, cords_p, mask_p);
|
||||
|
||||
/*If there are common part of the three area then draw to the vdb*/
|
||||
if(union_ok == false) return;
|
||||
if(union_ok == false) return;
|
||||
|
||||
/*The pixel size in byte is different if an alpha byte is added too*/
|
||||
uint8_t px_size_byte = alpha_byte ? LV_IMG_PX_SIZE_ALPHA_BYTE : sizeof(lv_color_t);
|
||||
|
||||
/*If the map starts OUT of the masked area then calc. the first pixel*/
|
||||
cord_t map_width = area_get_width(cords_p);
|
||||
lv_coord_t map_width = lv_area_get_width(cords_p);
|
||||
if(cords_p->y1 < masked_a.y1) {
|
||||
map_p += (uint32_t) map_width * (masked_a.y1 - cords_p->y1);
|
||||
map_p += (uint32_t) map_width * ((masked_a.y1 - cords_p->y1)) * px_size_byte;
|
||||
}
|
||||
if(cords_p->x1 < masked_a.x1) {
|
||||
map_p += (masked_a.x1 - cords_p->x1);
|
||||
map_p += (masked_a.x1 - cords_p->x1) * px_size_byte;
|
||||
}
|
||||
|
||||
/*Stores coordinates relative to the act vdb*/
|
||||
masked_a.x1 = masked_a.x1 - vdb_p->vdb_area.x1;
|
||||
masked_a.y1 = masked_a.y1 - vdb_p->vdb_area.y1;
|
||||
masked_a.x2 = masked_a.x2 - vdb_p->vdb_area.x1;
|
||||
masked_a.y2 = masked_a.y2 - vdb_p->vdb_area.y1;
|
||||
/*Stores coordinates relative to the current VDB*/
|
||||
masked_a.x1 = masked_a.x1 - vdb_p->area.x1;
|
||||
masked_a.y1 = masked_a.y1 - vdb_p->area.y1;
|
||||
masked_a.x2 = masked_a.x2 - vdb_p->area.x1;
|
||||
masked_a.y2 = masked_a.y2 - vdb_p->area.y1;
|
||||
|
||||
cord_t vdb_width = area_get_width(&vdb_p->vdb_area);
|
||||
color_t * vdb_buf_tmp = vdb_p->buf;
|
||||
lv_coord_t vdb_width = lv_area_get_width(&vdb_p->area);
|
||||
lv_color_t * vdb_buf_tmp = vdb_p->buf;
|
||||
vdb_buf_tmp += (uint32_t) vdb_width * masked_a.y1; /*Move to the first row*/
|
||||
vdb_buf_tmp += (uint32_t) masked_a.x1; /*Move to the first col*/
|
||||
|
||||
map_p -= masked_a.x1;
|
||||
lv_coord_t row;
|
||||
lv_coord_t map_useful_w = lv_area_get_width(&masked_a);
|
||||
|
||||
/*No transparent pixels on the image*/
|
||||
if(transp == false) { /*Simply copy the pixels to the VDB*/
|
||||
cord_t row;
|
||||
/*The simplest case just copy the pixels into the VDB*/
|
||||
if(chroma_key == false && alpha_byte == false && opa == LV_OPA_COVER && recolor_opa == LV_OPA_TRANSP) {
|
||||
|
||||
if(opa == OPA_COVER) { /*no opa */
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
memcpy(&vdb_buf_tmp[masked_a.x1],
|
||||
&map_p[masked_a.x1],
|
||||
area_get_width(&masked_a) * sizeof(color_t));
|
||||
map_p += map_width; /*Next row on the map*/
|
||||
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
#if USE_LV_GPU
|
||||
if(lv_disp_is_mem_blend_supported() == false) {
|
||||
sw_mem_blend(vdb_buf_tmp, (lv_color_t *)map_p, map_useful_w, opa);
|
||||
} else {
|
||||
lv_disp_mem_blend(vdb_buf_tmp, (lv_color_t *)map_p, map_useful_w, opa);
|
||||
}
|
||||
} else {
|
||||
cord_t col;
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
for(col = masked_a.x1; col <= masked_a.x2; col ++) {
|
||||
vdb_buf_tmp[col] = color_mix( map_p[col], vdb_buf_tmp[col], opa);
|
||||
}
|
||||
map_p += map_width; /*Next row on the map*/
|
||||
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
|
||||
}
|
||||
}
|
||||
|
||||
/*To recolor draw simply a rectangle above the image*/
|
||||
#if LV_VDB_SIZE != 0
|
||||
lv_vfill(cords_p, mask_p, recolor, recolor_opa);
|
||||
#else
|
||||
sw_mem_blend(vdb_buf_tmp, (lv_color_t *)map_p, map_useful_w, opa);
|
||||
#endif
|
||||
|
||||
} else { /*transp == true: Check all pixels */
|
||||
cord_t row;
|
||||
cord_t col;
|
||||
color_t transp_color = LV_COLOR_TRANSP;
|
||||
|
||||
if(recolor_opa == OPA_TRANSP)/*No recolor*/
|
||||
{
|
||||
if(opa == OPA_COVER) { /*no opa */
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
for(col = masked_a.x1; col <= masked_a.x2; col ++) {
|
||||
if(map_p[col].full != transp_color.full) {
|
||||
vdb_buf_tmp[col] = map_p[col];
|
||||
}
|
||||
}
|
||||
|
||||
map_p += map_width; /*Next row on the map*/
|
||||
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
|
||||
}
|
||||
} else { /*Image opacity ut no recolor*/
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
for(col = masked_a.x1; col <= masked_a.x2; col ++) {
|
||||
if(map_p[col].full != transp_color.full) {
|
||||
vdb_buf_tmp[col] = color_mix( map_p[col], vdb_buf_tmp[col], opa);
|
||||
}
|
||||
}
|
||||
|
||||
map_p += map_width; /*Next row on the map*/
|
||||
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
|
||||
}
|
||||
}
|
||||
} else { /*Recolor needed*/
|
||||
color_t color_tmp;
|
||||
if(opa == OPA_COVER) { /*no opa */
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
for(col = masked_a.x1; col <= masked_a.x2; col ++) {
|
||||
if(map_p[col].full != transp_color.full) {
|
||||
color_tmp = color_mix(recolor, map_p[col], recolor_opa);
|
||||
vdb_buf_tmp[col] = color_tmp;
|
||||
}
|
||||
}
|
||||
|
||||
map_p += map_width; /*Next row on the map*/
|
||||
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
|
||||
}
|
||||
} else { /*Image opacity with recolor*/
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
for(col = masked_a.x1; col <= masked_a.x2; col ++) {
|
||||
if(map_p[col].full != transp_color.full) {
|
||||
color_tmp = color_mix(recolor, map_p[col], recolor_opa);
|
||||
vdb_buf_tmp[col] = color_mix(color_tmp, vdb_buf_tmp[col], opa);
|
||||
}
|
||||
}
|
||||
|
||||
map_p += map_width; /*Next row on the map*/
|
||||
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
|
||||
}
|
||||
}
|
||||
map_p += map_width * px_size_byte; /*Next row on the map*/
|
||||
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*In the other cases every pixel need to be checked one-by-one*/
|
||||
else {
|
||||
lv_color_t chroma_key_color = LV_COLOR_TRANSP;
|
||||
lv_coord_t col;
|
||||
lv_color_t last_img_px = LV_COLOR_BLACK;
|
||||
lv_color_t recolored_px = lv_color_mix(recolor, last_img_px, recolor_opa);
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
for(col = 0; col < map_useful_w; col++) {
|
||||
lv_opa_t opa_result = opa;
|
||||
uint8_t * px_color_p = (uint8_t *) &map_p[(uint32_t)col * px_size_byte];
|
||||
lv_color_t px_color;
|
||||
|
||||
/*Calculate with the pixel level alpha*/
|
||||
if(alpha_byte) {
|
||||
#if LV_COLOR_DEPTH == 8
|
||||
px_color.full = px_color_p[0];
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
/*Because of Alpha byte 16 bit color can start on odd address which can cause crash*/
|
||||
px_color.full = px_color_p[0] + (px_color_p[1] << 8);
|
||||
#elif LV_COLOR_DEPTH == 24
|
||||
px_color = *((lv_color_t*)px_color_p);
|
||||
#endif
|
||||
lv_opa_t px_opa = *(px_color_p + LV_IMG_PX_SIZE_ALPHA_BYTE - 1);
|
||||
if(px_opa == LV_OPA_TRANSP) continue;
|
||||
else if(px_opa != LV_OPA_COVER) opa_result = (uint32_t)((uint32_t)px_opa * opa_result) >> 8;
|
||||
}
|
||||
else {
|
||||
px_color = *((lv_color_t*)px_color_p);
|
||||
}
|
||||
|
||||
/*Handle chroma key*/
|
||||
if(chroma_key && px_color.full == chroma_key_color.full) continue;
|
||||
|
||||
/*Re-color the pixel if required*/
|
||||
if(recolor_opa != LV_OPA_TRANSP) {
|
||||
|
||||
if(last_img_px.full != px_color.full) { /*Minor acceleration: calculate only for new colors (save the last)*/
|
||||
last_img_px = px_color;
|
||||
recolored_px = lv_color_mix(recolor, last_img_px, recolor_opa);
|
||||
}
|
||||
|
||||
if(opa_result == LV_OPA_COVER) vdb_buf_tmp[col].full = recolored_px.full;
|
||||
else vdb_buf_tmp[col] = lv_color_mix(recolored_px, vdb_buf_tmp[col], opa_result);
|
||||
} else {
|
||||
if(opa_result == LV_OPA_COVER) vdb_buf_tmp[col] = px_color;
|
||||
else vdb_buf_tmp[col] = lv_color_mix(px_color, vdb_buf_tmp[col], opa_result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*Next row on the map*/
|
||||
map_p += map_width * px_size_byte;
|
||||
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Blend pixels to destination memory using opacity
|
||||
* @param dest a memory address. Copy 'src' here.
|
||||
* @param src pointer to pixel map. Copy it to 'dest'.
|
||||
* @param length number of pixels in 'src'
|
||||
* @param opa opacity (0, LV_OPA_TRANSP: transparent ... 255, LV_OPA_COVER, fully cover)
|
||||
*/
|
||||
static void sw_mem_blend(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa)
|
||||
{
|
||||
if(opa == LV_OPA_COVER) {
|
||||
memcpy(dest, src, length * sizeof(lv_color_t));
|
||||
} else {
|
||||
uint32_t col;
|
||||
for(col = 0; col < length; col++) {
|
||||
dest[col] = lv_color_mix(src[col], dest[col], opa);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param mem_area coordinates of 'mem' memory area
|
||||
* @param mem a memory address. Considered to a rectangular window according to 'mem_area'
|
||||
* @param fill_area coordinates of an area to fill. Relative to 'mem_area'.
|
||||
* @param color fill color
|
||||
* @param opa opacity (0, LV_OPA_TRANSP: transparent ... 255, LV_OPA_COVER, fully cover)
|
||||
*/
|
||||
static void sw_color_fill(lv_area_t * mem_area, lv_color_t * mem, const lv_area_t * fill_area, lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
|
||||
/*Set all row in vdb to the given color*/
|
||||
lv_coord_t row;
|
||||
lv_coord_t col;
|
||||
lv_coord_t mem_width = lv_area_get_width(mem_area);
|
||||
|
||||
/*Run simpler function without opacity*/
|
||||
if(opa == LV_OPA_COVER) {
|
||||
/*Fill the first row with 'color'*/
|
||||
for(col = fill_area->x1; col <= fill_area->x2; col++) {
|
||||
mem[col] = color;
|
||||
}
|
||||
|
||||
/*Copy the first row to all other rows*/
|
||||
lv_color_t * mem_first = &mem[fill_area->x1];
|
||||
lv_coord_t copy_size = (fill_area->x2 - fill_area->x1 + 1) * sizeof(lv_color_t);
|
||||
mem += mem_width;
|
||||
|
||||
for(row = fill_area->y1 + 1; row <= fill_area->y2; row++) {
|
||||
memcpy(&mem[fill_area->x1], mem_first, copy_size);
|
||||
mem += mem_width;
|
||||
}
|
||||
}
|
||||
/*Calculate with alpha too*/
|
||||
else {
|
||||
lv_color_t bg_tmp = LV_COLOR_BLACK;
|
||||
lv_color_t opa_tmp = lv_color_mix(color, bg_tmp, opa);
|
||||
for(row = fill_area->y1; row <= fill_area->y2; row++) {
|
||||
for(col = fill_area->x1; col <= fill_area->x2; col++) {
|
||||
/*If the bg color changed recalculate the result color*/
|
||||
if(mem[col].full != bg_tmp.full) {
|
||||
bg_tmp = mem[col];
|
||||
opa_tmp = lv_color_mix(color, bg_tmp, opa);
|
||||
}
|
||||
mem[col] = opa_tmp;
|
||||
}
|
||||
mem += mem_width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,16 +6,20 @@
|
||||
#ifndef LV_DRAW_VBASIC_H
|
||||
#define LV_DRAW_VBASIC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_conf.h"
|
||||
#include "../../lv_conf.h"
|
||||
|
||||
#if LV_VDB_SIZE != 0
|
||||
|
||||
#include "misc/others/color.h"
|
||||
#include "../lv_misc/area.h"
|
||||
#include "../lv_misc/font.h"
|
||||
#include "../lv_misc/lv_color.h"
|
||||
#include "../lv_misc/lv_area.h"
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -28,22 +32,60 @@
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
void lv_vfill(const area_t * cords_p, const area_t * mask_p,
|
||||
color_t color, opa_t opa);
|
||||
|
||||
void lv_vletter(const point_t * pos_p, const area_t * mask_p,
|
||||
const font_t * font_p, uint8_t letter,
|
||||
color_t color, opa_t opa);
|
||||
void lv_vpx(lv_coord_t x, lv_coord_t y, const lv_area_t * mask_p, lv_color_t color, lv_opa_t opa);
|
||||
/**
|
||||
* Fill an area in the Virtual Display Buffer
|
||||
* @param cords_p coordinates of the area to fill
|
||||
* @param mask_p fill only o this mask
|
||||
* @param color fill color
|
||||
* @param opa opacity of the area (0..255)
|
||||
*/
|
||||
void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
lv_color_t color, lv_opa_t opa);
|
||||
|
||||
void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
const color_t * map_p, opa_t opa, bool transp,
|
||||
color_t recolor, opa_t recolor_opa);
|
||||
/**
|
||||
* Draw a letter in the Virtual Display Buffer
|
||||
* @param pos_p left-top coordinate of the latter
|
||||
* @param mask_p the letter will be drawn only on this area
|
||||
* @param font_p pointer to font
|
||||
* @param letter a letter to draw
|
||||
* @param color color of letter
|
||||
* @param opa opacity of letter (0..255)
|
||||
*/
|
||||
void lv_vletter(const lv_point_t * pos_p, const lv_area_t * mask_p,
|
||||
const lv_font_t * font_p, uint32_t letter,
|
||||
lv_color_t color, lv_opa_t opa);
|
||||
|
||||
/**
|
||||
* Draw a color map to the display (image)
|
||||
* @param cords_p coordinates the color map
|
||||
* @param mask_p the map will drawn only on this area (truncated to VDB area)
|
||||
* @param map_p pointer to a lv_color_t array
|
||||
* @param opa opacity of the map
|
||||
* @param chroma_keyed true: enable transparency of LV_IMG_LV_COLOR_TRANSP color pixels
|
||||
* @param alpha_byte true: extra alpha byte is inserted for every pixel
|
||||
* @param recolor mix the pixels with this color
|
||||
* @param recolor_opa the intense of recoloring
|
||||
*/
|
||||
void lv_vmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
const uint8_t * map_p, lv_opa_t opa, bool chroma_key, bool alpha_byte,
|
||||
lv_color_t recolor, lv_opa_t recolor_opa);
|
||||
|
||||
|
||||
/**
|
||||
* Reallocate 'color_map_tmp' to the new hor. res. size. It is used in 'sw_fill'
|
||||
*/
|
||||
void lv_vdraw_refresh_temp_arrays(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*LV_VDB_SIZE != 0*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /*LV_DRAW_RBASIC_H*/
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/**
|
||||
* @file lv_vdb.h
|
||||
*
|
||||
* @file hal.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_VDB_H
|
||||
#define LV_VDB_H
|
||||
#ifndef HAL_H
|
||||
#define HAL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if LV_VDB_SIZE != 0
|
||||
|
||||
#include "misc/others/color.h"
|
||||
#include <lvgl/lv_misc/area.h>
|
||||
#include "../lv_misc/font.h"
|
||||
#include "lv_hal_disp.h"
|
||||
#include "lv_hal_indev.h"
|
||||
#include "lv_hal_tick.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -25,24 +25,16 @@
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
area_t vdb_area;
|
||||
color_t buf[LV_VDB_SIZE];
|
||||
}lv_vdb_t;
|
||||
|
||||
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
lv_vdb_t * lv_vdb_get(void);
|
||||
void lv_vdb_flush(void);
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
8
lv_hal/lv_hal.mk
Normal file
8
lv_hal/lv_hal.mk
Normal file
@@ -0,0 +1,8 @@
|
||||
CSRCS += lv_hal_disp.c
|
||||
CSRCS += lv_hal_indev.c
|
||||
CSRCS += lv_hal_tick.c
|
||||
|
||||
DEPPATH += --dep-path lvgl/lv_hal
|
||||
VPATH += :lvgl/lv_hal
|
||||
|
||||
CFLAGS += "-I$(LVGL_DIR)/lvgl/lv_hal"
|
||||
223
lv_hal/lv_hal_disp.c
Normal file
223
lv_hal/lv_hal_disp.c
Normal file
@@ -0,0 +1,223 @@
|
||||
|
||||
/**
|
||||
* @file hal_disp.c
|
||||
*
|
||||
* @description HAL layer for display driver
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "../lv_hal/lv_hal_disp.h"
|
||||
#include "../lv_misc/lv_mem.h"
|
||||
#include "../lv_core/lv_obj.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static lv_disp_t *disp_list = NULL;
|
||||
static lv_disp_t *active;
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize a display driver with default values.
|
||||
* It is used to surly have known values in the fields ant not memory junk.
|
||||
* After it you can set the fields.
|
||||
* @param driver pointer to driver variable to initialize
|
||||
*/
|
||||
void lv_disp_drv_init(lv_disp_drv_t *driver)
|
||||
{
|
||||
driver->disp_fill = NULL;
|
||||
driver->disp_map = NULL;
|
||||
driver->disp_flush = NULL;
|
||||
|
||||
#if USE_LV_GPU
|
||||
driver->mem_blend = NULL;
|
||||
driver->mem_fill = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Register an initialized display driver.
|
||||
* Automatically set the first display as active.
|
||||
* @param driver pointer to an initialized 'lv_disp_drv_t' variable (can be local variable)
|
||||
* @return pointer to the new display or NULL on error
|
||||
*/
|
||||
lv_disp_t * lv_disp_drv_register(lv_disp_drv_t *driver)
|
||||
{
|
||||
lv_disp_t *node;
|
||||
|
||||
node = lv_mem_alloc(sizeof(lv_disp_t));
|
||||
if (!node) return NULL;
|
||||
|
||||
memcpy(&node->driver,driver, sizeof(lv_disp_drv_t));
|
||||
node->next = NULL;
|
||||
|
||||
/* Set first display as active by default */
|
||||
if (disp_list == NULL) {
|
||||
disp_list = node;
|
||||
active = node;
|
||||
lv_obj_invalidate(lv_scr_act());
|
||||
} else {
|
||||
disp_list->next = node;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the active display
|
||||
* @param disp pointer to a display (return value of 'lv_disp_register')
|
||||
*/
|
||||
void lv_disp_set_active(lv_disp_t * disp)
|
||||
{
|
||||
active = disp;
|
||||
lv_obj_invalidate(lv_scr_act());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a pointer to the active display
|
||||
* @return pointer to the active display
|
||||
*/
|
||||
lv_disp_t * lv_disp_get_active(void)
|
||||
{
|
||||
return active;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next display.
|
||||
* @param disp pointer to the current display. NULL to initialize.
|
||||
* @return the next display or NULL if no more. Give the first display when the parameter is NULL
|
||||
*/
|
||||
lv_disp_t * lv_disp_next(lv_disp_t * disp)
|
||||
{
|
||||
if(disp == NULL) {
|
||||
return disp_list;
|
||||
} else {
|
||||
if(disp_list->next == NULL) return NULL;
|
||||
else return disp_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Write the content of the internal buffer (VDB) to the display
|
||||
* @param x1 left coordinate of the rectangle
|
||||
* @param x2 right coordinate of the rectangle
|
||||
* @param y1 top coordinate of the rectangle
|
||||
* @param y2 bottom coordinate of the rectangle
|
||||
* @param color_p fill color
|
||||
*/
|
||||
void lv_disp_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color)
|
||||
{
|
||||
if(active == NULL) return;
|
||||
if(active->driver.disp_fill != NULL) active->driver.disp_fill(x1, y1, x2, y2, color);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill a rectangular area with a color on the active display
|
||||
* @param x1 left coordinate of the rectangle
|
||||
* @param x2 right coordinate of the rectangle
|
||||
* @param y1 top coordinate of the rectangle
|
||||
* @param y2 bottom coordinate of the rectangle
|
||||
* @param color_p pointer to an array of colors
|
||||
*/
|
||||
void lv_disp_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t *color_p)
|
||||
{
|
||||
if(active == NULL) return;
|
||||
if(active->driver.disp_flush != NULL) active->driver.disp_flush(x1, y1, x2, y2, color_p);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a color map to a rectangular area on the active display
|
||||
* @param x1 left coordinate of the rectangle
|
||||
* @param x2 right coordinate of the rectangle
|
||||
* @param y1 top coordinate of the rectangle
|
||||
* @param y2 bottom coordinate of the rectangle
|
||||
* @param color_map pointer to an array of colors
|
||||
*/
|
||||
void lv_disp_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_map)
|
||||
{
|
||||
if(active == NULL) return;
|
||||
if(active->driver.disp_map != NULL) active->driver.disp_map(x1, y1, x2, y2, color_map);
|
||||
}
|
||||
|
||||
#if USE_LV_GPU
|
||||
|
||||
/**
|
||||
* Blend pixels to a destination memory from a source memory
|
||||
* In 'lv_disp_drv_t' 'mem_blend' is optional. (NULL if not available)
|
||||
* @param dest a memory address. Blend 'src' here.
|
||||
* @param src pointer to pixel map. Blend it to 'dest'.
|
||||
* @param length number of pixels in 'src'
|
||||
* @param opa opacity (0, LV_OPA_TRANSP: transparent ... 255, LV_OPA_COVER, fully cover)
|
||||
*/
|
||||
void lv_disp_mem_blend(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa)
|
||||
{
|
||||
if(active == NULL) return;
|
||||
if(active->driver.mem_blend != NULL) active->driver.mem_blend(dest, src, length, opa);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill a memory with a color (GPUs may support it)
|
||||
* In 'lv_disp_drv_t' 'mem_fill' is optional. (NULL if not available)
|
||||
* @param dest a memory address. Copy 'src' here.
|
||||
* @param src pointer to pixel map. Copy it to 'dest'.
|
||||
* @param length number of pixels in 'src'
|
||||
* @param opa opacity (0, LV_OPA_TRANSP: transparent ... 255, LV_OPA_COVER, fully cover)
|
||||
*/
|
||||
void lv_disp_mem_fill(lv_color_t * dest, uint32_t length, lv_color_t color)
|
||||
{
|
||||
if(active == NULL) return;
|
||||
if(active->driver.mem_fill != NULL) active->driver.mem_fill(dest, length, color);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows if memory blending (by GPU) is supported or not
|
||||
* @return false: 'mem_blend' is not supported in the driver; true: 'mem_blend' is supported in the driver
|
||||
*/
|
||||
bool lv_disp_is_mem_blend_supported(void)
|
||||
{
|
||||
if(active == NULL) return false;
|
||||
if(active->driver.mem_blend) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows if memory fill (by GPU) is supported or not
|
||||
* @return false: 'mem_fill' is not supported in the drover; true: 'mem_fill' is supported in the driver
|
||||
*/
|
||||
bool lv_disp_is_mem_fill_supported(void)
|
||||
{
|
||||
if(active == NULL) return false;
|
||||
if(active->driver.mem_fill) return true;
|
||||
else return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
168
lv_hal/lv_hal_disp.h
Normal file
168
lv_hal/lv_hal_disp.h
Normal file
@@ -0,0 +1,168 @@
|
||||
/**
|
||||
* @file hal_disp.h
|
||||
*
|
||||
* @description Display Driver HAL interface header file
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HAL_DISP_H
|
||||
#define HAL_DISP_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "lv_hal.h"
|
||||
#include "../lv_misc/lv_color.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Display Driver structure to be registered by HAL
|
||||
*/
|
||||
typedef struct _disp_drv_t {
|
||||
/*Write the internal buffer (VDB) to the display. 'lv_flush_ready()' has to be called when finished*/
|
||||
void (*disp_flush)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p);
|
||||
|
||||
/*Fill an area with a color on the display*/
|
||||
void (*disp_fill)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color);
|
||||
|
||||
/*Write pixel map (e.g. image) to the display*/
|
||||
void (*disp_map)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p);
|
||||
|
||||
#if USE_LV_GPU
|
||||
/*Blend two memories using opacity (GPU only)*/
|
||||
void (*mem_blend)(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa);
|
||||
|
||||
/*Fill a memory with a color (GPU only)*/
|
||||
void (*mem_fill)(lv_color_t * dest, uint32_t length, lv_color_t color);
|
||||
#endif
|
||||
|
||||
} lv_disp_drv_t;
|
||||
|
||||
typedef struct _disp_t {
|
||||
lv_disp_drv_t driver;
|
||||
struct _disp_t *next;
|
||||
} lv_disp_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize a display driver with default values.
|
||||
* It is used to surly have known values in the fields ant not memory junk.
|
||||
* After it you can set the fields.
|
||||
* @param driver pointer to driver variable to initialize
|
||||
*/
|
||||
void lv_disp_drv_init(lv_disp_drv_t *driver);
|
||||
|
||||
/**
|
||||
* Register an initialized display driver.
|
||||
* Automatically set the first display as active.
|
||||
* @param driver pointer to an initialized 'lv_disp_drv_t' variable (can be local variable)
|
||||
* @return pointer to the new display or NULL on error
|
||||
*/
|
||||
lv_disp_t * lv_disp_drv_register(lv_disp_drv_t *driver);
|
||||
|
||||
/**
|
||||
* Set the active display
|
||||
* @param disp pointer to a display (return value of 'lv_disp_register')
|
||||
*/
|
||||
void lv_disp_set_active(lv_disp_t * disp);
|
||||
|
||||
/**
|
||||
* Get a pointer to the active display
|
||||
* @return pointer to the active display
|
||||
*/
|
||||
lv_disp_t * lv_disp_get_active(void);
|
||||
|
||||
/**
|
||||
* Get the next display.
|
||||
* @param disp pointer to the current display. NULL to initialize.
|
||||
* @return the next display or NULL if no more. Give the first display when the parameter is NULL
|
||||
*/
|
||||
lv_disp_t * lv_disp_next(lv_disp_t * disp);
|
||||
|
||||
/**
|
||||
* Fill a rectangular area with a color on the active display
|
||||
* @param x1 left coordinate of the rectangle
|
||||
* @param x2 right coordinate of the rectangle
|
||||
* @param y1 top coordinate of the rectangle
|
||||
* @param y2 bottom coordinate of the rectangle
|
||||
* @param color_p pointer to an array of colors
|
||||
*/
|
||||
void lv_disp_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t *color_p);
|
||||
|
||||
/**
|
||||
* Fill a rectangular area with a color on the active display
|
||||
* @param x1 left coordinate of the rectangle
|
||||
* @param x2 right coordinate of the rectangle
|
||||
* @param y1 top coordinate of the rectangle
|
||||
* @param y2 bottom coordinate of the rectangle
|
||||
* @param color fill color
|
||||
*/
|
||||
void lv_disp_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color);
|
||||
|
||||
/**
|
||||
* Put a color map to a rectangular area on the active display
|
||||
* @param x1 left coordinate of the rectangle
|
||||
* @param x2 right coordinate of the rectangle
|
||||
* @param y1 top coordinate of the rectangle
|
||||
* @param y2 bottom coordinate of the rectangle
|
||||
* @param color_map pointer to an array of colors
|
||||
*/
|
||||
void lv_disp_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_map);
|
||||
|
||||
#if USE_LV_GPU
|
||||
/**
|
||||
* Blend pixels to a destination memory from a source memory
|
||||
* In 'lv_disp_drv_t' 'mem_blend' is optional. (NULL if not available)
|
||||
* @param dest a memory address. Blend 'src' here.
|
||||
* @param src pointer to pixel map. Blend it to 'dest'.
|
||||
* @param length number of pixels in 'src'
|
||||
* @param opa opacity (0, LV_OPA_TRANSP: transparent ... 255, LV_OPA_COVER, fully cover)
|
||||
*/
|
||||
void lv_disp_mem_blend(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa);
|
||||
|
||||
/**
|
||||
* Fill a memory with a color (GPUs may support it)
|
||||
* In 'lv_disp_drv_t' 'mem_fill' is optional. (NULL if not available)
|
||||
* @param dest a memory address. Copy 'src' here.
|
||||
* @param src pointer to pixel map. Copy it to 'dest'.
|
||||
* @param length number of pixels in 'src'
|
||||
* @param opa opacity (0, LV_OPA_TRANSP: transparent ... 255, LV_OPA_COVER, fully cover)
|
||||
*/
|
||||
void lv_disp_mem_fill(lv_color_t * dest, uint32_t length, lv_color_t color);
|
||||
/**
|
||||
* Shows if memory blending (by GPU) is supported or not
|
||||
* @return false: 'mem_blend' is not supported in the driver; true: 'mem_blend' is supported in the driver
|
||||
*/
|
||||
bool lv_disp_is_mem_blend_supported(void);
|
||||
|
||||
/**
|
||||
* Shows if memory fill (by GPU) is supported or not
|
||||
* @return false: 'mem_fill' is not supported in the drover; true: 'mem_fill' is supported in the driver
|
||||
*/
|
||||
bool lv_disp_is_mem_fill_supported(void);
|
||||
#endif
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
124
lv_hal/lv_hal_indev.c
Normal file
124
lv_hal/lv_hal_indev.c
Normal file
@@ -0,0 +1,124 @@
|
||||
/**
|
||||
* @file hal_indev.c
|
||||
*
|
||||
* @description Input device HAL interface
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "../lv_hal/lv_hal_indev.h"
|
||||
#include "../lv_misc/lv_mem.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static lv_indev_t *indev_list = NULL;
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize an input device driver with default values.
|
||||
* It is used to surly have known values in the fields ant not memory junk.
|
||||
* After it you can set the fields.
|
||||
* @param driver pointer to driver variable to initialize
|
||||
*/
|
||||
void lv_indev_drv_init(lv_indev_drv_t *driver)
|
||||
{
|
||||
driver->read = NULL;
|
||||
driver->type = LV_INDEV_TYPE_NONE;
|
||||
driver->user_data = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register an initialized input device driver.
|
||||
* @param driver pointer to an initialized 'lv_indev_drv_t' variable (can be local variable)
|
||||
* @return pointer to the new input device or NULL on error
|
||||
*/
|
||||
lv_indev_t * lv_indev_drv_register(lv_indev_drv_t *driver)
|
||||
{
|
||||
lv_indev_t *node;
|
||||
|
||||
node = lv_mem_alloc(sizeof(lv_indev_t));
|
||||
if (!node) return NULL;
|
||||
|
||||
memset(node, 0, sizeof(lv_indev_t));
|
||||
memcpy(&node->driver, driver, sizeof(lv_indev_drv_t));
|
||||
|
||||
node->next = NULL;
|
||||
node->proc.reset_query = 1;
|
||||
node->cursor = NULL;
|
||||
node->group = NULL;
|
||||
node->btn_points = NULL;
|
||||
|
||||
if (indev_list == NULL) {
|
||||
indev_list = node;
|
||||
} else {
|
||||
lv_indev_t *last = indev_list;
|
||||
while (last->next)
|
||||
last = last->next;
|
||||
|
||||
last->next = node;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next input device.
|
||||
* @param indev pointer to the current input device. NULL to initialize.
|
||||
* @return the next input devise or NULL if no more. Give the first input device when the parameter is NULL
|
||||
*/
|
||||
lv_indev_t * lv_indev_next(lv_indev_t * indev)
|
||||
{
|
||||
|
||||
if(indev == NULL) {
|
||||
return indev_list;
|
||||
} else {
|
||||
if(indev->next == NULL) return NULL;
|
||||
else return indev->next;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Read data from an input device.
|
||||
* @param indev pointer to an input device
|
||||
* @param data input device will write its data here
|
||||
* @return false: no more data; true: there more data to read (buffered)
|
||||
*/
|
||||
bool lv_indev_read(lv_indev_t * indev, lv_indev_data_t *data)
|
||||
{
|
||||
bool cont = false;
|
||||
|
||||
if(indev->driver.read) {
|
||||
data->user_data = indev->driver.user_data;
|
||||
cont = indev->driver.read(data);
|
||||
} else {
|
||||
memset(data, 0, sizeof(lv_indev_data_t));
|
||||
}
|
||||
|
||||
return cont;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
157
lv_hal/lv_hal_indev.h
Normal file
157
lv_hal/lv_hal_indev.h
Normal file
@@ -0,0 +1,157 @@
|
||||
/**
|
||||
* @file hal_indev.h
|
||||
*
|
||||
* @description Input Device HAL interface layer header file
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HAL_INDEV_H
|
||||
#define HAL_INDEV_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "lv_hal.h"
|
||||
#include "../lv_misc/lv_area.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/*Possible input device types*/
|
||||
typedef enum {
|
||||
LV_INDEV_TYPE_NONE, /*Show uninitialized state*/
|
||||
LV_INDEV_TYPE_POINTER, /*Touch pad, mouse, external button*/
|
||||
LV_INDEV_TYPE_KEYPAD, /*Keypad or keyboard*/
|
||||
LV_INDEV_TYPE_BUTTON, /*External (hardware button) which is assinged to a specific point of the screen*/
|
||||
} lv_hal_indev_type_t;
|
||||
|
||||
/*States for input devices*/
|
||||
typedef enum {
|
||||
LV_INDEV_STATE_REL = 0,
|
||||
LV_INDEV_STATE_PR
|
||||
}lv_indev_state_t;
|
||||
|
||||
/*Data type when an input device is read */
|
||||
typedef struct {
|
||||
union {
|
||||
lv_point_t point; /*For LV_INDEV_TYPE_POINTER the currently pressed point*/
|
||||
uint32_t key; /*For LV_INDEV_TYPE_KEYPAD the currently pressed key*/
|
||||
uint32_t btn; /*For LV_INDEV_TYPE_BUTTON the currently pressed button*/
|
||||
};
|
||||
lv_indev_state_t state; /*LV_INDEV_EVENT_REL or LV_INDEV_EVENT_PR*/
|
||||
void *user_data; /*'lv_indev_drv_t.priv' for this driver*/
|
||||
}lv_indev_data_t;
|
||||
|
||||
/*Initialized by the user and registered by 'lv_indev_add()'*/
|
||||
typedef struct {
|
||||
lv_hal_indev_type_t type; /*Input device type*/
|
||||
bool (*read)(lv_indev_data_t *data); /*Function pointer to read data. Return 'true' if there is still data to be read (buffered)*/
|
||||
void *user_data; /*Pointer to user defined data, passed in 'lv_indev_data_t' on read*/
|
||||
}lv_indev_drv_t;
|
||||
|
||||
struct _lv_obj_t;
|
||||
|
||||
/*Run time data of input devices*/
|
||||
typedef struct _lv_indev_proc_t {
|
||||
lv_indev_state_t state;
|
||||
union {
|
||||
struct { /*Pointer and button data*/
|
||||
lv_point_t act_point;
|
||||
lv_point_t last_point;
|
||||
lv_point_t vect;
|
||||
lv_point_t drag_sum; /*Count the dragged pixels to check LV_INDEV_DRAG_LIMIT*/
|
||||
struct _lv_obj_t * act_obj;
|
||||
struct _lv_obj_t * last_obj;
|
||||
|
||||
/*Flags*/
|
||||
uint8_t drag_range_out :1;
|
||||
uint8_t drag_in_prog :1;
|
||||
uint8_t wait_unil_release :1;
|
||||
};
|
||||
struct { /*Keypad data*/
|
||||
lv_indev_state_t last_state;
|
||||
uint32_t last_key;
|
||||
};
|
||||
};
|
||||
|
||||
uint32_t pr_timestamp; /*Pressed time stamp*/
|
||||
uint32_t longpr_rep_timestamp; /*Long press repeat time stamp*/
|
||||
|
||||
/*Flags*/
|
||||
uint8_t long_pr_sent :1;
|
||||
uint8_t reset_query :1;
|
||||
uint8_t disabled :1;
|
||||
}lv_indev_proc_t;
|
||||
|
||||
|
||||
struct _lv_obj_t;
|
||||
struct _lv_group_t;
|
||||
|
||||
/*The main input device descriptor with driver, runtime data ('proc') and some additional information*/
|
||||
typedef struct _lv_indev_t {
|
||||
lv_indev_drv_t driver;
|
||||
lv_indev_proc_t proc;
|
||||
uint32_t last_activity_time;
|
||||
union {
|
||||
struct _lv_obj_t *cursor; /*Cursor for LV_INPUT_TYPE_POINTER*/
|
||||
struct _lv_group_t *group; /*Keypad destination group*/
|
||||
lv_point_t * btn_points; /*Array points assigned to the button ()screen will be pressed here by the buttons*/
|
||||
|
||||
};
|
||||
struct _lv_indev_t *next;
|
||||
} lv_indev_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize an input device driver with default values.
|
||||
* It is used to surly have known values in the fields ant not memory junk.
|
||||
* After it you can set the fields.
|
||||
* @param driver pointer to driver variable to initialize
|
||||
*/
|
||||
void lv_indev_drv_init(lv_indev_drv_t *driver);
|
||||
|
||||
/**
|
||||
* Register an initialized input device driver.
|
||||
* @param driver pointer to an initialized 'lv_indev_drv_t' variable (can be local variable)
|
||||
* @return pointer to the new input device or NULL on error
|
||||
*/
|
||||
lv_indev_t * lv_indev_drv_register(lv_indev_drv_t *driver);
|
||||
|
||||
/**
|
||||
* Get the next input device.
|
||||
* @param indev pointer to the current input device. NULL to initialize.
|
||||
* @return the next input devise or NULL if no more. Gives the first input device when the parameter is NULL
|
||||
*/
|
||||
lv_indev_t * lv_indev_next(lv_indev_t * indev);
|
||||
|
||||
/**
|
||||
* Read data from an input device.
|
||||
* @param indev pointer to an input device
|
||||
* @param data input device will write its data here
|
||||
* @return false: no more data; true: there more data to read (buffered)
|
||||
*/
|
||||
bool lv_indev_read(lv_indev_t * indev, lv_indev_data_t *data);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
87
lv_hal/lv_hal_tick.c
Normal file
87
lv_hal/lv_hal_tick.c
Normal file
@@ -0,0 +1,87 @@
|
||||
/**
|
||||
* @file systick.c
|
||||
* Provide access to the system tick with 1 millisecond resolution
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_hal_tick.h"
|
||||
#include <stddef.h>
|
||||
#include "../../lv_conf.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static uint32_t sys_time = 0;
|
||||
static volatile uint8_t tick_irq_flag;
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* You have to call this function periodically
|
||||
* @param tick_period the call period of this function in milliseconds
|
||||
*/
|
||||
LV_ATTRIBUTE_TICK_INC void lv_tick_inc(uint32_t tick_period)
|
||||
{
|
||||
tick_irq_flag = 0;
|
||||
sys_time += tick_period;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the elapsed milliseconds since start up
|
||||
* @return the elapsed milliseconds
|
||||
*/
|
||||
uint32_t lv_tick_get(void)
|
||||
{
|
||||
uint32_t result;
|
||||
do {
|
||||
tick_irq_flag = 1;
|
||||
result = sys_time;
|
||||
} while(!tick_irq_flag); /*'lv_tick_inc()' clears this flag which can be in an interrupt. Continue until make a non interrupted cycle */
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the elapsed milliseconds science a previous time stamp
|
||||
* @param prev_tick a previous time stamp (return value of systick_get() )
|
||||
* @return the elapsed milliseconds since 'prev_tick'
|
||||
*/
|
||||
uint32_t lv_tick_elaps(uint32_t prev_tick)
|
||||
{
|
||||
uint32_t act_time = lv_tick_get();
|
||||
|
||||
/*If there is no overflow in sys_time simple subtract*/
|
||||
if(act_time >= prev_tick) {
|
||||
prev_tick = act_time - prev_tick;
|
||||
} else {
|
||||
prev_tick = UINT32_MAX - prev_tick + 1;
|
||||
prev_tick += act_time;
|
||||
}
|
||||
|
||||
return prev_tick;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
61
lv_hal/lv_hal_tick.h
Normal file
61
lv_hal/lv_hal_tick.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* @file lv_hal_tick.h
|
||||
* Provide access to the system tick with 1 millisecond resolution
|
||||
*/
|
||||
|
||||
#ifndef LV_HAL_TICK_H
|
||||
#define LV_HAL_TICK_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#ifndef LV_ATTRIBUTE_TICK_INC
|
||||
#define LV_ATTRIBUTE_TICK_INC
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* You have to call this function periodically
|
||||
* @param tick_period the call period of this function in milliseconds
|
||||
*/
|
||||
LV_ATTRIBUTE_TICK_INC void lv_tick_inc(uint32_t tick_period);
|
||||
|
||||
/**
|
||||
* Get the elapsed milliseconds since start up
|
||||
* @return the elapsed milliseconds
|
||||
*/
|
||||
uint32_t lv_tick_get(void);
|
||||
|
||||
/**
|
||||
* Get the elapsed milliseconds science a previous time stamp
|
||||
* @param prev_tick a previous time stamp (return value of systick_get() )
|
||||
* @return the elapsed milliseconds since 'prev_tick'
|
||||
*/
|
||||
uint32_t lv_tick_elaps(uint32_t prev_tick);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_HAL_TICK_H*/
|
||||
@@ -1,31 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_CLOSE != 0 && LV_APP_USE_INTERNAL_ICONS == 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_close [] = { /*Width = 14, Height = 15*/
|
||||
14, /*Width*/
|
||||
15, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 6339, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 4258, 2016,
|
||||
6371, 0, 32, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2113, 0, 4226,
|
||||
10597, 0, 0, 0, 2016, 2016, 2016, 2016, 2016, 2016, 32, 0, 0, 8452,
|
||||
2016, 10597, 0, 0, 0, 2016, 2016, 2016, 2016, 32, 0, 0, 8452, 2016,
|
||||
2016, 2016, 10597, 0, 0, 0, 2016, 2016, 32, 0, 0, 8452, 2016, 2016,
|
||||
2016, 2016, 2016, 10565, 0, 0, 32, 2113, 0, 0, 6339, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 10597, 0, 0, 0, 0, 8452, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 0, 0, 0, 0, 35953, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 32, 0, 0, 0, 0, 0, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2113, 0, 0, 6339, 8484, 0, 0, 32, 2016, 2016, 2016,
|
||||
2016, 2016, 32, 0, 0, 8452, 2016, 2016, 10597, 0, 0, 0, 2016, 2016,
|
||||
2016, 32, 0, 0, 8452, 2016, 2016, 2016, 2016, 10597, 0, 0, 0, 2016,
|
||||
2113, 0, 0, 6339, 2016, 2016, 2016, 2016, 2016, 2016, 10565, 0, 0, 32,
|
||||
19049, 0, 8452, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12678, 0, 14823,
|
||||
2016, 23275, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 23243, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,26 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_DOWN != 0 && LV_APP_USE_INTERNAL_ICONS == 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_down [] = { /*Width = 15, Height = 10*/
|
||||
15, /*Width*/
|
||||
10, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 2016, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 33840, 2016, 2016,
|
||||
2016, 12710, 0, 19049, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 4226, 0, 35953, 2016,
|
||||
14791, 0, 0, 0, 19049, 2016, 2016, 2016, 2016, 2016, 4226, 0, 0, 0, 35953,
|
||||
10565, 0, 0, 0, 0, 16936, 2016, 2016, 2016, 2145, 0, 0, 0, 0, 29614,
|
||||
2016, 8484, 0, 0, 0, 0, 19049, 2016, 4226, 0, 0, 0, 0, 29582, 2016,
|
||||
2016, 2016, 10565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31695, 2016, 2016,
|
||||
2016, 2016, 2016, 8484, 0, 0, 0, 0, 0, 0, 0, 29582, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 8484, 0, 0, 0, 0, 0, 29582, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 8484, 0, 0, 0, 29582, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 8484, 0, 29582, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,30 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_DRIVER != 0 && LV_APP_USE_INTERNAL_ICONS == 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_driver [] = { /*Width = 16, Height = 14*/
|
||||
16, /*Width*/
|
||||
14, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 2016, 2016, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33808, 2016, 2016,
|
||||
2016, 2016, 14823, 2113, 44373, 44373, 44373, 44373, 44373, 44373, 44373, 44373, 6339, 8452, 2016, 2016,
|
||||
2016, 2016, 0, 23275, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 27469, 0, 2016, 2016,
|
||||
2016, 29614, 0, 46518, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 48599, 0, 23275, 2016,
|
||||
2016, 4258, 4258, 65503, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65503, 4226, 2113, 2016,
|
||||
2016, 0, 27501, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 23243, 0, 40147,
|
||||
21130, 0, 50744, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 44373, 0, 12710,
|
||||
4226, 0, 21162, 21162, 21162, 57083, 65535, 65535, 65535, 65535, 61309, 21162, 21162, 19017, 0, 0,
|
||||
2145, 0, 0, 0, 0, 23275, 65535, 65535, 65535, 65535, 31695, 0, 0, 0, 0, 0,
|
||||
2145, 0, 0, 0, 0, 32, 21162, 21162, 21162, 21162, 2145, 0, 0, 0, 0, 0,
|
||||
2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,32 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_FILE != 0 && LV_APP_USE_INTERNAL_ICONS == 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_file [] = { /*Width = 12, Height = 16*/
|
||||
12, /*Width*/
|
||||
16, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
23275, 21162, 21162, 21162, 21162, 21162, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2145, 0, 0, 0, 0, 0, 2113, 2016, 2016, 2016, 2016, 2016,
|
||||
2145, 0, 42260, 44373, 44373, 2113, 12678, 2145, 2016, 2016, 2016, 2016,
|
||||
2145, 0, 63390, 65535, 65535, 2145, 59196, 16904, 2113, 2016, 2016, 2016,
|
||||
2145, 0, 63390, 65535, 65535, 2145, 63390, 63422, 16904, 2113, 2016, 2016,
|
||||
2145, 0, 63390, 65535, 65535, 2145, 63390, 65535, 63422, 16904, 2113, 2016,
|
||||
2145, 0, 63390, 65535, 65535, 2145, 21130, 21162, 21162, 19017, 0, 2145,
|
||||
2145, 0, 63390, 65535, 65535, 44405, 44373, 44373, 44373, 44373, 2113, 0,
|
||||
2145, 0, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 2145, 0,
|
||||
2145, 0, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 2145, 0,
|
||||
2145, 0, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 2145, 0,
|
||||
2145, 0, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 2145, 0,
|
||||
2145, 0, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 2145, 0,
|
||||
2145, 0, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 2145, 0,
|
||||
2145, 0, 21130, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 32, 0,
|
||||
2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,28 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_FOLDER != 0 && LV_APP_USE_INTERNAL_ICONS == 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_folder [] = { /*Width = 16, Height = 12*/
|
||||
16, /*Width*/
|
||||
12, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 2016, 40147, 21162, 21162, 21162, 35921, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 23275, 2113, 0, 0, 0, 0, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 2016,
|
||||
2016, 2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
25388, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162,
|
||||
12678, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6339,
|
||||
21130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14791,
|
||||
29582, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23243,
|
||||
38034, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31695,
|
||||
2016, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38066,
|
||||
2016, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2016,
|
||||
2016, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,31 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_LEFT != 0 && LV_APP_USE_INTERNAL_ICONS == 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_left [] = { /*Width = 10, Height = 15*/
|
||||
10, /*Width*/
|
||||
15, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 27501, 21130, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 29582, 0, 0, 21130, 2016,
|
||||
2016, 2016, 2016, 2016, 31695, 0, 0, 0, 0, 27469,
|
||||
2016, 2016, 2016, 29582, 0, 0, 0, 0, 4226, 2016,
|
||||
2016, 2016, 29582, 0, 0, 0, 0, 4226, 2016, 2016,
|
||||
2016, 29582, 0, 0, 0, 0, 4226, 2016, 2016, 2016,
|
||||
29582, 0, 0, 0, 0, 4226, 2016, 2016, 2016, 2016,
|
||||
0, 0, 0, 0, 0, 2016, 2016, 2016, 2016, 2016,
|
||||
19049, 0, 0, 0, 0, 8484, 2016, 2016, 2016, 2016,
|
||||
2016, 19049, 0, 0, 0, 0, 8484, 2016, 2016, 2016,
|
||||
2016, 2016, 21130, 0, 0, 0, 0, 8484, 2016, 2016,
|
||||
2016, 2016, 2016, 21130, 0, 0, 0, 0, 8484, 2016,
|
||||
2016, 2016, 2016, 2016, 19017, 0, 0, 0, 0, 23243,
|
||||
2016, 2016, 2016, 2016, 2016, 21130, 0, 0, 12710, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 21130, 14791, 2016, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,28 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_OK != 0 && LV_APP_USE_INTERNAL_ICONS == 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_ok [] = { /*Width = 16, Height = 12*/
|
||||
16, /*Width*/
|
||||
12, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 32, 2113, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2113, 0, 0, 10597,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 32, 0, 0, 8452, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 32, 0, 0, 8452, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 32, 0, 0, 8452, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2113, 0, 0, 6371, 2016, 2016, 2016, 2016,
|
||||
2016, 4258, 0, 40147, 2016, 2016, 2016, 32, 0, 0, 8452, 2016, 2016, 2016, 2016, 2016,
|
||||
16936, 0, 0, 32, 2016, 2016, 2113, 0, 0, 6371, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 10565, 0, 0, 32, 2113, 0, 0, 6371, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 12710, 0, 0, 0, 0, 8452, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 12710, 0, 0, 8484, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 12710, 8484, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,31 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_RIGHT != 0 && LV_APP_USE_INTERNAL_ICONS == 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_right [] = { /*Width = 10, Height = 15*/
|
||||
10, /*Width*/
|
||||
15, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 2016, 21130, 27501, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 21130, 0, 0, 29582, 2016, 2016, 2016, 2016, 2016,
|
||||
27469, 0, 0, 0, 0, 31695, 2016, 2016, 2016, 2016,
|
||||
2016, 4226, 0, 0, 0, 0, 29582, 2016, 2016, 2016,
|
||||
2016, 2016, 4226, 0, 0, 0, 0, 29582, 2016, 2016,
|
||||
2016, 2016, 2016, 4226, 0, 0, 0, 0, 29582, 2016,
|
||||
2016, 2016, 2016, 2016, 4226, 0, 0, 0, 0, 29582,
|
||||
2016, 2016, 2016, 2016, 2016, 0, 0, 0, 0, 0,
|
||||
2016, 2016, 2016, 2016, 8484, 0, 0, 0, 0, 19049,
|
||||
2016, 2016, 2016, 8484, 0, 0, 0, 0, 19049, 2016,
|
||||
2016, 2016, 8484, 0, 0, 0, 0, 21130, 2016, 2016,
|
||||
2016, 8484, 0, 0, 0, 0, 21130, 2016, 2016, 2016,
|
||||
23243, 0, 0, 0, 0, 19017, 2016, 2016, 2016, 2016,
|
||||
2016, 12710, 0, 0, 21130, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 14791, 21130, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,26 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_UP != 0 && LV_APP_USE_INTERNAL_ICONS == 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_up [] = { /*Width = 15, Height = 10*/
|
||||
15, /*Width*/
|
||||
10, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 8484, 0, 29582, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 8484, 0, 0, 0, 29582, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 8484, 0, 0, 0, 0, 0, 29582, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 8484, 0, 0, 0, 0, 0, 0, 0, 29582, 2016, 2016, 2016,
|
||||
2016, 2016, 10565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31695, 2016, 2016,
|
||||
2016, 8484, 0, 0, 0, 0, 19049, 2016, 4226, 0, 0, 0, 0, 29582, 2016,
|
||||
10565, 0, 0, 0, 0, 16936, 2016, 2016, 2016, 2145, 0, 0, 0, 0, 29614,
|
||||
14791, 0, 0, 0, 19049, 2016, 2016, 2016, 2016, 2016, 4226, 0, 0, 0, 35953,
|
||||
2016, 12710, 0, 19049, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 4226, 0, 35953, 2016,
|
||||
2016, 2016, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 33840, 2016, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,49 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_CLOSE != 0 && LV_APP_USE_INTERNAL_ICONS == 2
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_close [] = { /*Width = 35, Height = 33*/
|
||||
35, /*Width*/
|
||||
33, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 25356, 21130, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 21162, 23243, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 33808, 6371, 2145, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 4258, 29614, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 25388, 10565, 32, 0, 2145, 16936, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 21130, 4258, 0, 0, 6371, 23243, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 14791, 0, 0, 0, 0, 4226, 23275, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29582, 6339, 0, 0, 0, 0, 10597, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 16904, 32, 0, 0, 0, 0, 4226, 16936, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 4258, 32, 0, 0, 0, 0, 12710, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 31695, 14791, 4226, 0, 0, 0, 0, 2145, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 0, 0, 2145, 10597, 27501, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 14791, 32, 0, 0, 0, 0, 2145, 16904, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 4258, 0, 0, 0, 0, 0, 10597, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 31727, 14791, 4226, 0, 0, 0, 0, 2145, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4258, 0, 0, 0, 0, 2145, 10597, 29582, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 14791, 32, 0, 0, 0, 0, 2145, 16904, 2016, 2016, 2016, 2016, 19049, 4226, 0, 0, 0, 0, 0, 10597, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 14791, 4226, 0, 0, 0, 0, 4226, 23275, 2016, 2016, 27501, 4258, 0, 0, 0, 0, 2113, 10597, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 32, 6339, 10565, 10597, 8452, 32, 0, 0, 0, 0, 10565, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31695, 12710, 4226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2145, 10565, 27469, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 14823, 2113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12710, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 12678, 2145, 0, 0, 0, 0, 0, 0, 2113, 8452, 25388, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 6371, 0, 0, 0, 0, 0, 0, 4258, 23275, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 27501, 6339, 0, 0, 0, 0, 0, 0, 4258, 23243, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 4258, 32, 0, 0, 0, 0, 0, 0, 0, 4226, 16904, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4258, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4226, 23243, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 21130, 4258, 0, 0, 0, 0, 32, 2113, 4226, 2145, 0, 0, 0, 0, 2145, 16936, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29582, 6339, 0, 0, 0, 0, 2145, 12710, 19049, 21162, 16904, 4258, 0, 0, 0, 0, 4226, 23275, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 4258, 32, 0, 0, 0, 0, 12678, 2016, 2016, 2016, 2016, 14791, 32, 0, 0, 0, 0, 4226, 16936, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 0, 0, 2145, 10597, 29582, 2016, 2016, 2016, 2016, 31727, 14791, 4226, 0, 0, 0, 0, 2145, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 19017, 4226, 0, 0, 0, 0, 0, 10597, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 14791, 32, 0, 0, 0, 0, 2145, 16904, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 0, 0, 2113, 10597, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 14791, 4226, 0, 0, 0, 0, 2145, 21162, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 19017, 4226, 0, 0, 0, 0, 0, 10565, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 2113, 14823, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 12678, 0, 0, 0, 0, 2145, 10565, 27469, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31695, 14791, 4226, 0, 0, 0, 0, 8484, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 23243, 6339, 0, 0, 0, 12678, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 14823, 2113, 0, 0, 2113, 19049, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 21162, 6371, 4226, 10597, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 33808, 14823, 4258, 4258, 16936, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 21162, 19017, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 19049, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,36 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_DOWN != 0 && LV_APP_USE_INTERNAL_ICONS == 2
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_down [] = { /*Width = 29, Height = 20*/
|
||||
29, /*Width*/
|
||||
20, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 2016, 2016, 2016, 23243, 23275, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 31695, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 16904, 4258, 6371, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 23275, 8452, 4226, 12678, 2016, 2016, 2016,
|
||||
2016, 2016, 16904, 2113, 0, 0, 6339, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 8452, 0, 0, 2113, 19017, 2016, 2016,
|
||||
33808, 16904, 4258, 0, 0, 0, 0, 6371, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25356, 8452, 32, 0, 0, 0, 2113, 12710, 2016,
|
||||
19049, 2145, 0, 0, 0, 0, 0, 0, 6339, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 8452, 0, 0, 0, 0, 0, 0, 2145, 23243,
|
||||
16936, 32, 0, 0, 0, 0, 0, 0, 0, 6371, 19049, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 23243, 6371, 32, 0, 0, 0, 0, 0, 0, 2113, 19049,
|
||||
29582, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 4258, 19049, 2016, 2016, 2016, 2016, 2016, 31695, 6371, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29582,
|
||||
2016, 2016, 12678, 0, 0, 0, 0, 0, 0, 0, 0, 6371, 23243, 2016, 2016, 2016, 25356, 8452, 32, 0, 0, 0, 0, 0, 0, 32, 12678, 29582, 2016,
|
||||
2016, 2016, 29614, 12710, 4226, 0, 0, 0, 0, 0, 0, 32, 8452, 19049, 2016, 2016, 8484, 0, 0, 0, 0, 0, 0, 0, 2113, 10597, 29614, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 14791, 32, 0, 0, 0, 0, 0, 0, 32, 4226, 8484, 8452, 2113, 0, 0, 0, 0, 0, 0, 2113, 14791, 31695, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 31695, 12710, 4226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 31695, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 12678, 29614, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 29614, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 12710, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 32, 12710, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 12710, 2145, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 12710, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 14791, 6371, 12678, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,45 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_DRIVER != 0 && LV_APP_USE_INTERNAL_ICONS == 2
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_driver [] = { /*Width = 32, Height = 29*/
|
||||
32, /*Width*/
|
||||
29, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 31695, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31695, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 23243, 10597, 12678, 12678, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12678, 10597, 21162, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 10597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8484, 29614, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 23275, 4226, 0, 4226, 6371, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6371, 4226, 0, 2145, 16936, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 31727, 12678, 32, 4258, 25356, 35921, 33808, 33808, 33808, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 33808, 35921, 25388, 8452, 2113, 6371, 25356, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 21162, 4258, 2145, 14823, 42260, 54938, 52825, 50744, 50744, 50744, 50744, 50744, 50744, 50744, 50744, 50744, 50744, 52825, 54938, 44373, 19017, 4258, 32, 16904, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 12678, 0, 10565, 27501, 54938, 65535, 63422, 63390, 63390, 63390, 63390, 63390, 63390, 63390, 63390, 63390, 63390, 63422, 65535, 54970, 31695, 12710, 0, 10565, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 6339, 0, 19017, 40147, 61277, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 61309, 42292, 21162, 2113, 4258, 31695, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 25388, 2145, 4226, 29614, 50712, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 63390, 50744, 31727, 4258, 32, 19049, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 14791, 0, 8484, 40179, 59196, 65503, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65503, 59196, 40179, 8484, 0, 8484, 27501, 2016, 2016,
|
||||
2016, 2016, 21162, 4226, 0, 14791, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 48631, 12710, 0, 0, 16936, 2016, 2016,
|
||||
2016, 2016, 12710, 0, 2145, 21162, 54970, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 54938, 19049, 32, 0, 10565, 2016, 2016,
|
||||
2016, 2016, 8452, 0, 12710, 31727, 57083, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 57051, 29582, 8484, 0, 6371, 2016, 2016,
|
||||
2016, 29582, 4226, 2145, 25356, 44373, 61309, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 61277, 38066, 19049, 2113, 2145, 23243, 2016,
|
||||
2016, 16936, 32, 6371, 38034, 57083, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65503, 50712, 29614, 6339, 0, 10597, 29614,
|
||||
27469, 6371, 0, 8452, 35953, 52857, 57051, 59164, 57083, 59196, 63422, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65503, 59196, 57083, 59164, 54970, 46518, 29614, 6371, 0, 2113, 21130,
|
||||
19017, 0, 0, 4258, 23243, 31727, 31727, 31727, 29614, 38066, 54970, 65503, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 59164, 38066, 29614, 31727, 31695, 29582, 19049, 4226, 0, 0, 14791,
|
||||
14823, 0, 0, 2145, 10597, 14823, 14791, 12710, 10597, 21130, 42260, 57051, 65503, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 61277, 46486, 23243, 10597, 12710, 14791, 14791, 10565, 2113, 0, 0, 10597,
|
||||
14823, 0, 0, 0, 2113, 2145, 2145, 2113, 32, 8452, 23275, 42260, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 63422, 48599, 29582, 8484, 32, 2113, 2145, 2145, 2113, 0, 0, 0, 12678,
|
||||
16904, 0, 0, 0, 0, 0, 0, 0, 0, 32, 10565, 25388, 50712, 61277, 59164, 57083, 57083, 59164, 61277, 50744, 31727, 14823, 2113, 0, 0, 0, 0, 0, 0, 0, 0, 12678,
|
||||
16904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2113, 10565, 27469, 33840, 33808, 31727, 31727, 33808, 33840, 27501, 12710, 4226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12678,
|
||||
16904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2113, 10597, 14823, 14791, 14791, 14791, 14791, 14823, 10597, 2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12678,
|
||||
16904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2113, 2145, 2145, 2145, 2145, 2145, 2145, 2113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12678,
|
||||
16904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12678,
|
||||
16904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12678,
|
||||
14823, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10597,
|
||||
12710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8484,
|
||||
23243, 6371, 6371, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 6371, 4226, 19017,
|
||||
2016, 31727, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 31727, 31695, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,49 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_FILE != 0 && LV_APP_USE_INTERNAL_ICONS == 2
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_file [] = { /*Width = 24, Height = 33*/
|
||||
24, /*Width*/
|
||||
33, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 31695, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31695, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
27469, 12678, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12678, 12678, 19017, 31727, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
19017, 2113, 2113, 2113, 32, 0, 0, 0, 0, 0, 2113, 4226, 6339, 19049, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
14791, 0, 0, 0, 4226, 6339, 6339, 6339, 6371, 4258, 0, 0, 0, 6371, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
14823, 0, 0, 4258, 23275, 33808, 33808, 33808, 35921, 25388, 6371, 0, 4226, 6339, 6371, 19049, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
16904, 0, 0, 8484, 38066, 52857, 52825, 52857, 54970, 40179, 10565, 2145, 19017, 19049, 4226, 6371, 29582, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
16904, 0, 0, 10597, 46518, 63422, 63422, 65503, 65535, 48631, 10597, 8484, 42260, 46486, 19017, 6339, 6339, 19049, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
16904, 0, 0, 12678, 50712, 65535, 65535, 65535, 65535, 52857, 12678, 10597, 52825, 61309, 38066, 19017, 2145, 6339, 27501, 2016, 2016, 2016, 2016, 2016,
|
||||
16904, 0, 0, 12678, 50712, 65535, 65535, 65535, 65535, 52825, 10597, 10597, 50712, 65535, 61277, 44405, 19017, 4258, 6339, 19017, 2016, 2016, 2016, 2016,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 52825, 10597, 10597, 50712, 65535, 65535, 61309, 38066, 19049, 4226, 6371, 27501, 2016, 2016, 2016,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 52825, 10597, 10597, 50744, 65535, 65535, 65535, 63390, 48599, 21162, 8452, 6371, 19049, 2016, 2016,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 52825, 10597, 8452, 42260, 57083, 57083, 59164, 61277, 50712, 27469, 10565, 0, 4226, 27501, 2016,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 52825, 10597, 32, 19049, 29582, 29582, 29614, 29614, 27469, 21130, 10597, 32, 0, 4258, 23275,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 54938, 21162, 8484, 19017, 23243, 23243, 23243, 23243, 23243, 25356, 19017, 4226, 0, 0, 12678,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 59196, 42260, 33808, 35921, 35953, 35953, 35953, 35953, 38034, 40147, 29614, 8452, 0, 0, 10597,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 63422, 54970, 50744, 50712, 50712, 50712, 50712, 50712, 50744, 52857, 40179, 12678, 0, 0, 10597,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 63422, 63390, 63390, 63390, 63390, 63390, 63390, 63422, 65535, 50712, 14823, 0, 0, 10597,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 54938, 16904, 0, 0, 12678,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 54938, 16904, 0, 0, 12678,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 52857, 16904, 0, 0, 12678,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 52857, 16904, 0, 0, 12678,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 52857, 16904, 0, 0, 12678,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 52857, 16904, 0, 0, 12678,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 52857, 16904, 0, 0, 12678,
|
||||
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 52857, 16904, 0, 0, 12678,
|
||||
16904, 0, 0, 12678, 50712, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 54938, 16904, 0, 0, 12678,
|
||||
16904, 0, 0, 12678, 52825, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 57051, 16904, 0, 0, 12678,
|
||||
16904, 0, 0, 10565, 42292, 59164, 59164, 57083, 57083, 57083, 57083, 57083, 57083, 57083, 57083, 57083, 57083, 59164, 61309, 46518, 14791, 0, 0, 12678,
|
||||
16904, 0, 0, 4258, 23275, 33808, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 33808, 33840, 25388, 8452, 0, 0, 12678,
|
||||
14823, 0, 0, 32, 8484, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 10565, 2113, 0, 0, 10597,
|
||||
12710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8484,
|
||||
23243, 6371, 6371, 6371, 6371, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6371, 6371, 6371, 4226, 19017,
|
||||
2016, 31727, 33808, 33808, 33808, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 33808, 33808, 31727, 31695, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,44 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_FOLDER != 0 && LV_APP_USE_INTERNAL_ICONS == 2
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_folder [] = { /*Width = 34, Height = 28*/
|
||||
34, /*Width*/
|
||||
28, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31695, 31727, 31727, 31695, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 25356, 16904, 12710, 12710, 12710, 12710, 14823, 21162, 33808, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 27469, 12710, 6339, 4226, 2145, 2145, 2145, 2145, 2145, 4226, 10597, 27469, 2016, 33808, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31695, 29614, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 27469, 8452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8484, 14791, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 10597, 8484, 23243, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 16904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12678, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 23243, 6339, 8452, 8484, 8484, 8484, 8484, 8484, 8484, 8484, 8484, 8452, 8452, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6339, 2145, 19017, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 33808, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 31695, 29582, 27501, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 27501, 29582, 29582, 2016, 2016,
|
||||
2016, 29582, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14791, 12678, 25388, 2016,
|
||||
2016, 25356, 8452, 4226, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 19049, 2016,
|
||||
2016, 25356, 6339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19017, 2016,
|
||||
2016, 29582, 10597, 2113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4258, 23275, 2016,
|
||||
2016, 33808, 14823, 2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2113, 8484, 27469, 2016,
|
||||
2016, 2016, 19017, 4226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2145, 12678, 31695, 2016,
|
||||
2016, 2016, 23243, 4258, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4226, 16904, 2016, 2016,
|
||||
2016, 2016, 25388, 6339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4226, 19049, 2016, 2016,
|
||||
2016, 2016, 29614, 6371, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4258, 23275, 2016, 2016,
|
||||
2016, 2016, 33808, 8452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6339, 27469, 2016, 2016,
|
||||
2016, 2016, 2016, 8484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6371, 31695, 2016, 2016,
|
||||
2016, 2016, 2016, 10565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8452, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 10565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8452, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 8484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6371, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 19049, 4226, 6371, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 6371, 4226, 16936, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 31695, 31727, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 31727, 31695, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,46 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_LEFT != 0 && LV_APP_USE_INTERNAL_ICONS == 2
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_left [] = { /*Width = 19, Height = 30*/
|
||||
19, /*Width*/
|
||||
30, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 33808, 29582, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 27501, 14791, 10565, 21162, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29582, 10565, 32, 0, 6371, 23243, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 12678, 32, 0, 0, 0, 6371, 23243, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31695, 10597, 32, 0, 0, 0, 0, 0, 8452, 25356,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31695, 14791, 2113, 0, 0, 0, 0, 0, 0, 2145, 21130,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 29582, 10597, 2113, 0, 0, 0, 0, 0, 0, 0, 8452, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 29582, 12678, 32, 0, 0, 0, 0, 0, 0, 32, 8452, 23275, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 29614, 10597, 32, 0, 0, 0, 0, 0, 0, 0, 8452, 31727, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 29614, 12710, 32, 0, 0, 0, 0, 0, 0, 32, 8452, 25356, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 29614, 10597, 32, 0, 0, 0, 0, 0, 0, 0, 8452, 31727, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 29614, 12710, 32, 0, 0, 0, 0, 0, 0, 2113, 8452, 25356, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 29614, 10597, 32, 0, 0, 0, 0, 0, 0, 0, 8452, 31727, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
29614, 12678, 32, 0, 0, 0, 0, 0, 0, 32, 8452, 23275, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
12678, 0, 0, 0, 0, 0, 0, 0, 0, 6371, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
8484, 0, 0, 0, 0, 0, 0, 0, 0, 6371, 31727, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
23243, 6339, 0, 0, 0, 0, 0, 0, 0, 2113, 10597, 29582, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 21162, 6371, 0, 0, 0, 0, 0, 0, 0, 32, 14791, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 21162, 6371, 0, 0, 0, 0, 0, 0, 0, 4226, 12710, 29614, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 23243, 8452, 0, 0, 0, 0, 0, 0, 0, 0, 12710, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 23243, 6371, 0, 0, 0, 0, 0, 0, 0, 2145, 12710, 29614, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 23243, 8452, 0, 0, 0, 0, 0, 0, 0, 0, 12710, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 23243, 6371, 0, 0, 0, 0, 0, 0, 0, 2145, 12710, 29614, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 23243, 6371, 0, 0, 0, 0, 0, 0, 0, 0, 12710, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 21130, 4258, 0, 0, 0, 0, 0, 0, 0, 4226, 19017,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 21130, 6371, 0, 0, 0, 0, 0, 0, 4258, 19049,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 23243, 6371, 0, 0, 0, 0, 2113, 16904, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 23243, 8452, 0, 0, 4258, 16904, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 21162, 8452, 4258, 16904, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 21162, 31727, 2016, 2016, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,47 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_OK != 0 && LV_APP_USE_INTERNAL_ICONS == 2
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_ok [] = { /*Width = 34, Height = 31*/
|
||||
34, /*Width*/
|
||||
31, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19017, 6339, 6371, 21130, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 6339, 29582, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 4258, 0, 0, 0, 32, 8452, 25388, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 27501, 4258, 0, 0, 0, 0, 2145, 10565, 29582, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 4258, 0, 0, 0, 0, 0, 12678, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 0, 0, 2145, 12678, 29582, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19017, 4226, 0, 0, 0, 0, 0, 12678, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 0, 0, 2145, 12678, 29582, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19017, 4226, 0, 0, 0, 0, 0, 12678, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 0, 0, 2145, 12678, 29582, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 21130, 4258, 0, 0, 0, 0, 0, 10565, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 33808, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 27501, 6339, 0, 0, 0, 0, 2145, 10597, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 25356, 10565, 6339, 14823, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 4258, 0, 0, 0, 0, 0, 12678, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 8484, 0, 0, 2113, 21130, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 0, 0, 2145, 12678, 29582, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 31727, 12710, 2113, 0, 0, 0, 2145, 16936, 2016, 2016, 2016, 2016, 21130, 4258, 0, 0, 0, 0, 0, 10597, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 33808, 14823, 4226, 0, 0, 0, 0, 4226, 25356, 2016, 2016, 29614, 6371, 0, 0, 0, 0, 2145, 10597, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 14791, 0, 0, 0, 0, 32, 6339, 10565, 12678, 8484, 2113, 0, 0, 0, 0, 10597, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 31727, 14791, 4226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2145, 10597, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 16904, 2113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12678, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 16904, 4258, 0, 0, 0, 0, 0, 0, 2145, 12678, 29582, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 16904, 2113, 0, 0, 0, 0, 0, 12678, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 16904, 4258, 0, 0, 2145, 12678, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 16904, 2113, 0, 12678, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 19017, 16904, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,46 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_RIGHT != 0 && LV_APP_USE_INTERNAL_ICONS == 2
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_right [] = { /*Width = 19, Height = 30*/
|
||||
19, /*Width*/
|
||||
30, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 2016, 2016, 2016, 29582, 33808, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 21162, 10565, 14791, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 23243, 6371, 0, 32, 10565, 29582, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 23243, 6371, 0, 0, 0, 32, 12678, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
25356, 8452, 0, 0, 0, 0, 0, 32, 10597, 31695, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
21130, 2145, 0, 0, 0, 0, 0, 0, 2113, 14791, 31695, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 8452, 0, 0, 0, 0, 0, 0, 0, 2113, 10597, 29582, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 23275, 8452, 32, 0, 0, 0, 0, 0, 0, 32, 12678, 29582, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 31727, 8452, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 25356, 8452, 32, 0, 0, 0, 0, 0, 0, 32, 12710, 29614, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 31727, 8452, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 25356, 8452, 2113, 0, 0, 0, 0, 0, 0, 32, 12710, 29614, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 31727, 8452, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29614, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 23275, 8452, 32, 0, 0, 0, 0, 0, 0, 32, 12678, 29614,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 6371, 0, 0, 0, 0, 0, 0, 0, 0, 12678,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 6371, 0, 0, 0, 0, 0, 0, 0, 0, 8484,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 29582, 10597, 2113, 0, 0, 0, 0, 0, 0, 0, 6339, 23243,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 14791, 32, 0, 0, 0, 0, 0, 0, 0, 6371, 21162, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 29614, 12710, 4226, 0, 0, 0, 0, 0, 0, 0, 6371, 21162, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 0, 0, 8452, 23243, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 29614, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 6371, 23243, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 0, 0, 8452, 23243, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 29614, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 6371, 23243, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 12710, 0, 0, 0, 0, 0, 0, 0, 0, 6371, 23243, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
19017, 4226, 0, 0, 0, 0, 0, 0, 0, 4258, 21130, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
19049, 4258, 0, 0, 0, 0, 0, 0, 6371, 21130, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 16904, 2113, 0, 0, 0, 0, 6371, 23243, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 16904, 4258, 0, 0, 8452, 23243, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 16904, 4258, 8452, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 31727, 21162, 25388, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,36 +0,0 @@
|
||||
#include "img_conf.h"
|
||||
#include "lv_conf.h"
|
||||
|
||||
#if USE_IMG_UP != 0 && LV_APP_USE_INTERNAL_ICONS == 2
|
||||
|
||||
#include <stdint.h>
|
||||
#include "misc/others/color.h"
|
||||
|
||||
const color_int_t img_up [] = { /*Width = 29, Height = 20*/
|
||||
29, /*Width*/
|
||||
20, /*Heigth*/
|
||||
16, /*Color depth = 16*/
|
||||
1, /*Flags: Transp = 1*/
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 14791, 6371, 12678, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 12710, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 12710, 2145, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 32, 12710, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 12710, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 29614, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 12678, 29614, 2016, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 31695, 12710, 4226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 31695, 2016, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 14791, 32, 0, 0, 0, 0, 0, 0, 32, 4226, 8484, 8452, 2113, 0, 0, 0, 0, 0, 0, 2113, 14791, 31695, 2016, 2016, 2016,
|
||||
2016, 2016, 29614, 12710, 4226, 0, 0, 0, 0, 0, 0, 32, 8452, 19049, 2016, 2016, 8484, 0, 0, 0, 0, 0, 0, 0, 2113, 10597, 29614, 2016, 2016,
|
||||
2016, 2016, 12678, 0, 0, 0, 0, 0, 0, 0, 0, 6371, 23243, 2016, 2016, 2016, 25356, 8452, 32, 0, 0, 0, 0, 0, 0, 32, 12678, 29582, 2016,
|
||||
29582, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 4258, 19049, 2016, 2016, 2016, 2016, 2016, 31695, 6371, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29582,
|
||||
16936, 32, 0, 0, 0, 0, 0, 0, 0, 6371, 19049, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 23243, 6371, 32, 0, 0, 0, 0, 0, 0, 2113, 19049,
|
||||
19049, 2145, 0, 0, 0, 0, 0, 0, 6339, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 8452, 0, 0, 0, 0, 0, 0, 2145, 23243,
|
||||
33808, 16904, 4258, 0, 0, 0, 0, 6371, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25356, 8452, 32, 0, 0, 0, 2113, 12710, 2016,
|
||||
2016, 2016, 16904, 2113, 0, 0, 6339, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 8452, 0, 0, 2113, 19017, 2016, 2016,
|
||||
2016, 2016, 2016, 16904, 4258, 6371, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 23275, 8452, 4226, 12678, 2016, 2016, 2016,
|
||||
2016, 2016, 2016, 2016, 23243, 23275, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 31695, 2016, 2016, 2016,
|
||||
};
|
||||
|
||||
#endif
|
||||
259
lv_misc/anim.c
259
lv_misc/anim.c
@@ -1,259 +0,0 @@
|
||||
/**
|
||||
* @file anim.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <string.h>
|
||||
#include "anim.h"
|
||||
#include "misc/math/math_base.h"
|
||||
#include "misc/os/ptask.h"
|
||||
#include "hal/systick/systick.h"
|
||||
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define ANIM_PATH_LENGTH 129 /*Elements in a path array*/
|
||||
#define ANIM_PATH_START 64 /*In path array a value which corresponds to the start position*/
|
||||
#define ANIM_PATH_END 192 /* ... to the end position. Not required, just for clearance.*/
|
||||
#define ANIM_PATH_NORM_SHIFT 7 /*ANIM_PATH_START - ANIM_PATH_END. Must be 2^N. The exponent goes here. */
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static void anim_task (void * param);
|
||||
static bool anim_ready_handler(anim_t * a);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static ll_dsc_t anim_ll;
|
||||
static uint32_t last_task_run;
|
||||
static bool anim_del_global_flag = false;
|
||||
|
||||
static anim_path_t anim_path_lin[] =
|
||||
{64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
|
||||
96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
|
||||
128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
|
||||
160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192};
|
||||
|
||||
static anim_path_t anim_path_step[] =
|
||||
{64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 192,};
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Init. the animation module
|
||||
*/
|
||||
void anim_init(void)
|
||||
{
|
||||
ll_init(&anim_ll, sizeof(anim_t));
|
||||
last_task_run = systick_get();
|
||||
ptask_create(anim_task, LV_REFR_PERIOD, PTASK_PRIO_MID, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an animation
|
||||
* @param anim_p an initialized 'anim_t' variable. Not required after call.
|
||||
*/
|
||||
void anim_create(anim_t * anim_p)
|
||||
{
|
||||
/*Add the new animation to the animation linked list*/
|
||||
anim_t * new_anim = ll_ins_head(&anim_ll);
|
||||
dm_assert(new_anim);
|
||||
|
||||
/*Initialize the animation descriptor*/
|
||||
anim_p->playback_now = 0;
|
||||
memcpy(new_anim, anim_p, sizeof(anim_t));
|
||||
|
||||
/*Set the start value*/
|
||||
if(new_anim->fp != NULL) new_anim->fp(new_anim->var, new_anim->start);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an animation for a variable with a given animatior function
|
||||
* @param var pointer to variable
|
||||
* @param fp a function pointer which is animating 'var',
|
||||
* or NULL to ignore it and delete all animation with 'var
|
||||
* @return true: at least 1 animation is deleted, false: no animation is deleted
|
||||
*/
|
||||
bool anim_del(void * var, anim_fp_t fp)
|
||||
{
|
||||
bool del = false;
|
||||
anim_t * a;
|
||||
anim_t * a_next;
|
||||
a = ll_get_head(&anim_ll);
|
||||
while(a != NULL) {
|
||||
/*'a' might be deleted, so get the next object while 'a' is valid*/
|
||||
a_next = ll_get_next(&anim_ll, a);
|
||||
|
||||
if(a->var == var && (a->fp == fp || fp == NULL)) {
|
||||
ll_rem(&anim_ll, a);
|
||||
dm_free(a);
|
||||
del = true;
|
||||
anim_del_global_flag = true;
|
||||
}
|
||||
|
||||
a = a_next;
|
||||
}
|
||||
|
||||
return del;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the time of an animation with a given speed and the start and end values
|
||||
* @param speed speed of animation in unit/sec
|
||||
* @param start start value of the animation
|
||||
* @param end end value of the animation
|
||||
* @return the required time [ms] for the animation with the given parameters
|
||||
*/
|
||||
uint16_t anim_speed_to_time(uint16_t speed, int32_t start, int32_t end)
|
||||
{
|
||||
int32_t d = MATH_ABS((int32_t) start - end);
|
||||
uint16_t time = (int32_t)((int32_t)(d * 1000) / speed);
|
||||
|
||||
if(time == 0) {
|
||||
time++;
|
||||
}
|
||||
|
||||
return time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a predefine animation path
|
||||
* @param name name of the path from 'anim_path_name_t'
|
||||
* @return pointer to the path array
|
||||
*/
|
||||
anim_path_t * anim_get_path(anim_path_name_t name)
|
||||
{
|
||||
switch (name) {
|
||||
case ANIM_PATH_LIN:
|
||||
return anim_path_lin;
|
||||
break;
|
||||
case ANIM_PATH_STEP:
|
||||
return anim_path_step;
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Periodically handle the animations.
|
||||
* @param param unused
|
||||
*/
|
||||
static void anim_task (void * param)
|
||||
{
|
||||
uint32_t elaps;
|
||||
elaps = systick_elaps(last_task_run);
|
||||
|
||||
anim_t * a;
|
||||
anim_t * a_next;
|
||||
a = ll_get_head(&anim_ll);
|
||||
while(a != NULL) {
|
||||
/*'a' might be deleted, so get the next object while 'a' is valid*/
|
||||
a_next = ll_get_next(&anim_ll, a);
|
||||
|
||||
a->act_time += elaps;
|
||||
if(a->act_time >= 0) {
|
||||
if(a->act_time > a->time) a->act_time = a->time;
|
||||
|
||||
/* Get the index of the path array based on the elapsed time*/
|
||||
uint8_t path_i;
|
||||
if(a->time == a->act_time) {
|
||||
path_i = ANIM_PATH_LENGTH - 1; /*Use the last value id the time fully elapsed*/
|
||||
} else {
|
||||
path_i = a->act_time * (ANIM_PATH_LENGTH - 1) / a->time;
|
||||
}
|
||||
/* Get the new value which will be proportional to the current element of 'path_p'
|
||||
* and the 'start' and 'end' values*/
|
||||
int32_t new_val;
|
||||
new_val = (int32_t)(a->path[path_i] - ANIM_PATH_START) * (a->end - a->start);
|
||||
new_val = new_val >> ANIM_PATH_NORM_SHIFT;
|
||||
new_val += a->start;
|
||||
|
||||
if(a->fp != NULL) a->fp(a->var, new_val); /*Apply the calculated value*/
|
||||
|
||||
/*If the time is elapsed the animation is ready*/
|
||||
if(a->act_time >= a->time) {
|
||||
bool invalid;
|
||||
invalid = anim_ready_handler(a);
|
||||
if(invalid != false) {
|
||||
a_next = ll_get_head(&anim_ll); /*a_next might be invalid if animation delete occurred*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a = a_next;
|
||||
}
|
||||
|
||||
last_task_run = systick_get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when an animation is ready to do the necessary thinks
|
||||
* e.g. repeat, play back, delete etc.
|
||||
* @param a pointer to an animation descriptor
|
||||
* @return true: animation delete occurred
|
||||
* */
|
||||
static bool anim_ready_handler(anim_t * a)
|
||||
{
|
||||
bool invalid = false;
|
||||
|
||||
/*Delete the animation if
|
||||
* - no repeat and no play back (simple one shot animation)
|
||||
* - no repeat, play back is enabled and play back is ready */
|
||||
if((a->repeat == 0 && a->playback == 0) ||
|
||||
(a->repeat == 0 && a->playback == 1 && a->playback_now == 1)) {
|
||||
void (*cb) (void *) = a->end_cb;
|
||||
void * p = a->var;
|
||||
ll_rem(&anim_ll, a);
|
||||
dm_free(a);
|
||||
|
||||
/*Call the callback function at the end*/
|
||||
/* Check if an animation is deleted in the cb function
|
||||
* if yes then the caller function has to know this*/
|
||||
anim_del_global_flag = false;
|
||||
if(cb != NULL) cb(p);
|
||||
invalid = anim_del_global_flag;
|
||||
}
|
||||
/*If the animation is not deleted then restart it*/
|
||||
else {
|
||||
a->act_time = - a->repeat_pause; /*Restart the animation*/
|
||||
/*Swap the start and end values in play back mode*/
|
||||
if(a->playback != 0) {
|
||||
/*If now turning back use the 'playback_pause*/
|
||||
if(a->playback_now == 0) a->act_time = - a->playback_pause;
|
||||
|
||||
/*Toggle the play back state*/
|
||||
a->playback_now = a->playback_now == 0 ? 1: 0;
|
||||
/*Swap the start and end values*/
|
||||
int32_t tmp;
|
||||
tmp = a->start;
|
||||
a->start = a->end;
|
||||
a->end = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
return invalid;
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
/**
|
||||
* @file anim.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ANIM_H
|
||||
#define ANIM_H
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lvgl/lvgl.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ANIM_PATH_LIN,
|
||||
ANIM_PATH_STEP,
|
||||
}anim_path_name_t;
|
||||
|
||||
typedef uint8_t anim_path_t;
|
||||
|
||||
typedef void (*anim_fp_t)(void *, int32_t);
|
||||
typedef void (*anim_cb_t)(void *);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void * var; /*Variable to animate*/
|
||||
anim_fp_t fp; /*Animator function*/
|
||||
anim_cb_t end_cb; /*Call it when the animation is ready*/
|
||||
anim_path_t * path; /*An array with the steps of animations*/
|
||||
int32_t start; /*Start value*/
|
||||
int32_t end; /*End value*/
|
||||
int16_t time; /*Animation time in ms*/
|
||||
int16_t act_time; /*Current time in animation. Set to negative to make delay.*/
|
||||
uint16_t playback_pause; /*Wait before play back*/
|
||||
uint16_t repeat_pause; /*Wait before repeat*/
|
||||
uint8_t playback :1; /*When the animation is ready play it back*/
|
||||
uint8_t repeat :1; /*Repeat the animation infinitely*/
|
||||
/*Animation system use these - user shouldn't set*/
|
||||
uint8_t playback_now :1; /*Play back is in progress*/
|
||||
}anim_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
void anim_init(void);
|
||||
void anim_create(anim_t * anim_p);
|
||||
anim_path_t * anim_get_path(anim_path_name_t type);
|
||||
bool anim_del(void * var, anim_fp_t fp);
|
||||
uint16_t anim_speed_to_time(uint16_t speed, int32_t start, int32_t end);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif
|
||||
@@ -1,74 +0,0 @@
|
||||
/**
|
||||
* @file area.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef AREA_H
|
||||
#define AREA_H
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_conf.h"
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
typedef LV_CORD_TYPE cord_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
cord_t x;
|
||||
cord_t y;
|
||||
}point_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
cord_t x1;
|
||||
cord_t y1;
|
||||
cord_t x2;
|
||||
cord_t y2;
|
||||
}area_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
static void inline area_cpy(area_t * dest, const area_t * src)
|
||||
{
|
||||
memcpy(dest, src, sizeof(area_t));
|
||||
}
|
||||
|
||||
static inline cord_t area_get_width(const area_t * area_p)
|
||||
{
|
||||
return area_p->x2 - area_p->x1 + 1;
|
||||
}
|
||||
|
||||
static inline cord_t area_get_height(const area_t * area_p)
|
||||
{
|
||||
return area_p->y2 - area_p->y1 + 1;
|
||||
}
|
||||
|
||||
void area_set(area_t * area_p, cord_t x1, cord_t y1, cord_t x2, cord_t y2);
|
||||
void area_set_width(area_t * area_p, cord_t w);
|
||||
void area_set_height(area_t * area_p, cord_t h);
|
||||
void area_set_pos(area_t * area_p, cord_t x, cord_t y);
|
||||
uint32_t area_get_size(const area_t * area_p);
|
||||
bool area_union(area_t * res_p, const area_t * a1_p, const area_t * a2_p);
|
||||
void area_join(area_t * a_res_p, const area_t * a1_p, const area_t * a2_p);
|
||||
bool area_is_point_on(const area_t * a_p, const point_t * p_p);
|
||||
bool area_is_on(const area_t * a1_p, const area_t * a2_p);
|
||||
bool area_is_in(const area_t * a_in, const area_t * a_holder);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif
|
||||
@@ -1,51 +0,0 @@
|
||||
/**
|
||||
* @file circ.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CIRC_H
|
||||
#define CIRC_H
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
|
||||
#include <lvgl/lv_misc/area.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define CIRC_OCT1_X(p) (p.x)
|
||||
#define CIRC_OCT1_Y(p) (p.y)
|
||||
#define CIRC_OCT2_X(p) (p.y)
|
||||
#define CIRC_OCT2_Y(p) (p.x)
|
||||
#define CIRC_OCT3_X(p) (-p.y)
|
||||
#define CIRC_OCT3_Y(p) (p.x)
|
||||
#define CIRC_OCT4_X(p) (-p.x)
|
||||
#define CIRC_OCT4_Y(p) (p.y)
|
||||
#define CIRC_OCT5_X(p) (-p.x)
|
||||
#define CIRC_OCT5_Y(p) (-p.y)
|
||||
#define CIRC_OCT6_X(p) (-p.y)
|
||||
#define CIRC_OCT6_Y(p) (-p.x)
|
||||
#define CIRC_OCT7_X(p) (p.y)
|
||||
#define CIRC_OCT7_Y(p) (-p.x)
|
||||
#define CIRC_OCT8_X(p) (p.x)
|
||||
#define CIRC_OCT8_Y(p) (-p.y)
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
void circ_init(point_t * c, cord_t * tmp, cord_t radius);
|
||||
bool circ_cont(point_t * c);
|
||||
void circ_next(point_t * c, cord_t * tmp);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif
|
||||
114
lv_misc/font.c
114
lv_misc/font.c
@@ -1,114 +0,0 @@
|
||||
/**
|
||||
* @file font.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <stddef.h>
|
||||
#include "font.h"
|
||||
#include "fonts/dejavu_8.h"
|
||||
#include "fonts/dejavu_10.h"
|
||||
#include "fonts/dejavu_14.h"
|
||||
#include "fonts/dejavu_20.h"
|
||||
#include "fonts/dejavu_30.h"
|
||||
#include "fonts/dejavu_40.h"
|
||||
#include "fonts/dejavu_60.h"
|
||||
#include "fonts/dejavu_80.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Get the font from its id
|
||||
* @param font_id: the id of a font (an element of font_types_t enum)
|
||||
* @return pointer to a font descriptor
|
||||
*/
|
||||
const font_t * font_get(font_types_t font_id)
|
||||
{
|
||||
const font_t * font_p = NULL;
|
||||
|
||||
switch(font_id)
|
||||
{
|
||||
#if USE_FONT_DEJAVU_8 != 0
|
||||
case FONT_DEJAVU_8:
|
||||
font_p = dejavu_8_get_dsc();
|
||||
break;
|
||||
#endif
|
||||
#if USE_FONT_DEJAVU_10 != 0
|
||||
case FONT_DEJAVU_10:
|
||||
font_p = dejavu_10_get_dsc();
|
||||
break;
|
||||
#endif
|
||||
#if USE_FONT_DEJAVU_14 != 0
|
||||
case FONT_DEJAVU_14:
|
||||
font_p = dejavu_14_get_dsc();
|
||||
break;
|
||||
#endif
|
||||
#if USE_FONT_DEJAVU_20 != 0
|
||||
case FONT_DEJAVU_20:
|
||||
font_p = dejavu_20_get_dsc();
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if USE_FONT_DEJAVU_30 != 0
|
||||
case FONT_DEJAVU_30:
|
||||
font_p = dejavu_30_get_dsc();
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if USE_FONT_DEJAVU_40 != 0
|
||||
case FONT_DEJAVU_40:
|
||||
font_p = dejavu_40_get_dsc();
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if USE_FONT_DEJAVU_60 != 0
|
||||
case FONT_DEJAVU_60:
|
||||
font_p = dejavu_60_get_dsc();
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if USE_FONT_DEJAVU_80 != 0
|
||||
case FONT_DEJAVU_80:
|
||||
font_p = dejavu_80_get_dsc();
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
font_p = NULL;
|
||||
}
|
||||
|
||||
return font_p;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
|
||||
117
lv_misc/font.h
117
lv_misc/font.h
@@ -1,117 +0,0 @@
|
||||
/**
|
||||
* @file font.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef FONT_H
|
||||
#define FONT_H
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_conf.h"
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
#if USE_FONT_DEJAVU_8 != 0
|
||||
FONT_DEJAVU_8,
|
||||
#endif
|
||||
#if USE_FONT_DEJAVU_10 != 0
|
||||
FONT_DEJAVU_10,
|
||||
#endif
|
||||
#if USE_FONT_DEJAVU_14 != 0
|
||||
FONT_DEJAVU_14,
|
||||
#endif
|
||||
#if USE_FONT_DEJAVU_20 != 0
|
||||
FONT_DEJAVU_20,
|
||||
#endif
|
||||
#if USE_FONT_DEJAVU_30 != 0
|
||||
FONT_DEJAVU_30,
|
||||
#endif
|
||||
#if USE_FONT_DEJAVU_40 != 0
|
||||
FONT_DEJAVU_40,
|
||||
#endif
|
||||
#if USE_FONT_DEJAVU_60 != 0
|
||||
FONT_DEJAVU_60,
|
||||
#endif
|
||||
#if USE_FONT_DEJAVU_80 != 0
|
||||
FONT_DEJAVU_80,
|
||||
#endif
|
||||
FONT_TYPE_NUM,
|
||||
}font_types_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t letter_cnt;
|
||||
uint8_t start_ascii;
|
||||
uint8_t width_byte;
|
||||
uint8_t height_row;
|
||||
uint8_t fixed_width;
|
||||
const uint8_t * width_bit_a;
|
||||
const uint8_t * bitmaps_a;
|
||||
}font_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
const font_t * font_get(font_types_t letter);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Return with the bitmap of a font.
|
||||
* @param font_p pointer to a font
|
||||
* @param letter a letter
|
||||
* @return pointer to the bitmap of the letter
|
||||
*/
|
||||
static inline const uint8_t * font_get_bitmap(const font_t * font_p, uint8_t letter)
|
||||
{
|
||||
if(letter < font_p->start_ascii || letter >= font_p->start_ascii + font_p->letter_cnt) return NULL;
|
||||
|
||||
uint32_t index = (letter - font_p->start_ascii) * font_p->height_row * font_p->width_byte;
|
||||
return &font_p->bitmaps_a[index];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the height of a font
|
||||
* @param font_p pointer to a font
|
||||
* @return the height of a font
|
||||
*/
|
||||
static inline uint8_t font_get_height(const font_t * font_p)
|
||||
{
|
||||
return font_p->height_row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the width of a letter in a font
|
||||
* @param font_p pointer to a font
|
||||
* @param letter a letter
|
||||
* @return the width of a letter
|
||||
*/
|
||||
static inline uint8_t font_get_width(const font_t * font_p, uint8_t letter)
|
||||
{
|
||||
if(letter < font_p->start_ascii) return 0;
|
||||
|
||||
letter -= font_p->start_ascii;
|
||||
uint8_t w = 0;
|
||||
if(letter < font_p->letter_cnt) {
|
||||
w = font_p->fixed_width != 0 ? font_p->fixed_width :
|
||||
font_p->width_bit_a[letter];
|
||||
}
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,18 +0,0 @@
|
||||
#ifndef DEJAVU_10_H
|
||||
#define DEJAVU_10_H
|
||||
|
||||
/*Use ISO8859-1 encoding in the IDE*/
|
||||
|
||||
#include "lv_conf.h"
|
||||
#if USE_FONT_DEJAVU_10 != 0
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../font.h"
|
||||
|
||||
|
||||
const font_t * dejavu_10_get_dsc(void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,18 +0,0 @@
|
||||
#ifndef DEJAVU_14_H
|
||||
#define DEJAVU_14_H
|
||||
|
||||
/*Use ISO8859-1 encoding in the IDE*/
|
||||
|
||||
#include "lv_conf.h"
|
||||
#if USE_FONT_DEJAVU_14 != 0
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../font.h"
|
||||
|
||||
|
||||
const font_t * dejavu_14_get_dsc(void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,18 +0,0 @@
|
||||
#ifndef DEJAVU_20_H
|
||||
#define DEJAVU_20_H
|
||||
|
||||
/*Use ISO8859-1 encoding in the IDE*/
|
||||
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_20 != 0
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../font.h"
|
||||
|
||||
|
||||
const font_t * dejavu_20_get_dsc(void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,18 +0,0 @@
|
||||
#ifndef DEJAVU_30_H
|
||||
#define DEJAVU_30_H
|
||||
|
||||
/*Use ISO8859-1 encoding in the IDE*/
|
||||
|
||||
#include "lv_conf.h"
|
||||
#if USE_FONT_DEJAVU_30 != 0
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../font.h"
|
||||
|
||||
|
||||
const font_t * dejavu_30_get_dsc(void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,18 +0,0 @@
|
||||
#ifndef DEJAVU_40_H
|
||||
#define DEJAVU_40_H
|
||||
|
||||
/*Use ISO8859-1 encoding in the IDE*/
|
||||
|
||||
#include "lv_conf.h"
|
||||
#if USE_FONT_DEJAVU_40 != 0
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../font.h"
|
||||
|
||||
|
||||
const font_t * dejavu_40_get_dsc(void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,18 +0,0 @@
|
||||
#ifndef DEJAVU_60_H
|
||||
#define DEJAVU_60_H
|
||||
|
||||
/*Use ISO8859-1 encoding in the IDE*/
|
||||
|
||||
#include "lv_conf.h"
|
||||
#if USE_FONT_DEJAVU_60 != 0
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../font.h"
|
||||
|
||||
|
||||
const font_t * dejavu_60_get_dsc(void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,18 +0,0 @@
|
||||
#ifndef DEJAVU_8_H
|
||||
#define DEJAVU_8_H
|
||||
|
||||
/*Use ISO8859-1 encoding in the IDE*/
|
||||
|
||||
#include "lv_conf.h"
|
||||
#if USE_FONT_DEJAVU_8 != 0
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../font.h"
|
||||
|
||||
|
||||
const font_t * dejavu_8_get_dsc(void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,15 +0,0 @@
|
||||
#ifndef DEJAVU_80_H
|
||||
#define DEJAVU_80_H
|
||||
|
||||
/*Use ISO8859-1 encoding in the IDE*/
|
||||
#include "lv_conf.h"
|
||||
#if USE_FONT_DEJAVU_80 != 0
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../font.h"
|
||||
const font_t * dejavu_80_get_dsc(void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
258
lv_misc/lv_anim.c
Normal file
258
lv_misc/lv_anim.c
Normal file
@@ -0,0 +1,258 @@
|
||||
/**
|
||||
* @file anim.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_anim.h"
|
||||
|
||||
#if USE_LV_ANIMATION
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include "../lv_hal/lv_hal_tick.h"
|
||||
#include "lv_task.h"
|
||||
#include "lv_math.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define LV_ANIM_RESOLUTION 1024
|
||||
#define LV_ANIM_RES_SHIFT 10
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static void anim_task (void * param);
|
||||
static bool anim_ready_handler(lv_anim_t * a);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static lv_ll_t anim_ll;
|
||||
static uint32_t last_task_run;
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Init. the animation module
|
||||
*/
|
||||
void lv_anim_init(void)
|
||||
{
|
||||
lv_ll_init(&anim_ll, sizeof(lv_anim_t));
|
||||
last_task_run = lv_tick_get();
|
||||
lv_task_create(anim_task, LV_REFR_PERIOD, LV_TASK_PRIO_MID, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an animation
|
||||
* @param anim_p an initialized 'anim_t' variable. Not required after call.
|
||||
*/
|
||||
void lv_anim_create(lv_anim_t * anim_p)
|
||||
{
|
||||
/* Do not let two animations for the same 'var' with the same 'fp'*/
|
||||
if(anim_p->fp != NULL) lv_anim_del(anim_p->var, anim_p->fp); /*fp == NULL would delete all animations of var*/
|
||||
|
||||
/*Add the new animation to the animation linked list*/
|
||||
lv_anim_t * new_anim = lv_ll_ins_head(&anim_ll);
|
||||
lv_mem_assert(new_anim);
|
||||
|
||||
/*Initialize the animation descriptor*/
|
||||
anim_p->playback_now = 0;
|
||||
memcpy(new_anim, anim_p, sizeof(lv_anim_t));
|
||||
|
||||
/*Set the start value*/
|
||||
if(new_anim->fp != NULL) new_anim->fp(new_anim->var, new_anim->start);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an animation for a variable with a given animator function
|
||||
* @param var pointer to variable
|
||||
* @param fp a function pointer which is animating 'var',
|
||||
* or NULL to delete all animations of 'var'
|
||||
* @return true: at least 1 animation is deleted, false: no animation is deleted
|
||||
*/
|
||||
bool lv_anim_del(void * var, lv_anim_fp_t fp)
|
||||
{
|
||||
bool del = false;
|
||||
lv_anim_t * a;
|
||||
lv_anim_t * a_next;
|
||||
a = lv_ll_get_head(&anim_ll);
|
||||
while(a != NULL) {
|
||||
/*'a' might be deleted, so get the next object while 'a' is valid*/
|
||||
a_next = lv_ll_get_next(&anim_ll, a);
|
||||
|
||||
if(a->var == var && (a->fp == fp || fp == NULL)) {
|
||||
lv_ll_rem(&anim_ll, a);
|
||||
lv_mem_free(a);
|
||||
del = true;
|
||||
}
|
||||
|
||||
a = a_next;
|
||||
}
|
||||
|
||||
return del;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the time of an animation with a given speed and the start and end values
|
||||
* @param speed speed of animation in unit/sec
|
||||
* @param start start value of the animation
|
||||
* @param end end value of the animation
|
||||
* @return the required time [ms] for the animation with the given parameters
|
||||
*/
|
||||
uint16_t lv_anim_speed_to_time(uint16_t speed, int32_t start, int32_t end)
|
||||
{
|
||||
int32_t d = LV_MATH_ABS((int32_t) start - end);
|
||||
uint32_t time = (int32_t)((int32_t)(d * 1000) / speed);
|
||||
|
||||
if(time > UINT16_MAX) time = UINT16_MAX;
|
||||
|
||||
if(time == 0) {
|
||||
time++;
|
||||
}
|
||||
|
||||
return time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the current value of an animation applying linear characteristic
|
||||
* @param a pointer to an animation
|
||||
* @return the current value to set
|
||||
*/
|
||||
int32_t lv_anim_path_linear(const lv_anim_t *a)
|
||||
{
|
||||
/*Calculate the current step*/
|
||||
|
||||
uint16_t step;
|
||||
if(a->time == a->act_time) step = LV_ANIM_RESOLUTION; /*Use the last value id the time fully elapsed*/
|
||||
else step = (a->act_time * LV_ANIM_RESOLUTION) / a->time;
|
||||
|
||||
|
||||
/* Get the new value which will be proportional to the current element of 'path_p'
|
||||
* and the 'start' and 'end' values*/
|
||||
int32_t new_value;
|
||||
new_value = (int32_t) step * (a->end - a->start);
|
||||
new_value = new_value >> LV_ANIM_RES_SHIFT;
|
||||
new_value += a->start;
|
||||
|
||||
return new_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the current value of an animation applying step characteristic.
|
||||
* (Set end value on the end of the animation)
|
||||
* @param a pointer to an animation
|
||||
* @return the current value to set
|
||||
*/
|
||||
int32_t lv_anim_path_step(const lv_anim_t *a)
|
||||
{
|
||||
if(a->act_time >= a->time) return a->end;
|
||||
else return a->start;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Periodically handle the animations.
|
||||
* @param param unused
|
||||
*/
|
||||
static void anim_task (void * param)
|
||||
{
|
||||
(void)param;
|
||||
|
||||
volatile uint32_t elaps;
|
||||
elaps = lv_tick_elaps(last_task_run);
|
||||
|
||||
lv_anim_t * a;
|
||||
lv_anim_t * a_next;
|
||||
a = lv_ll_get_head(&anim_ll);
|
||||
while(a != NULL) {
|
||||
/*'a' might be deleted, so get the next object while 'a' is valid*/
|
||||
a_next = lv_ll_get_next(&anim_ll, a);
|
||||
|
||||
a->act_time += elaps;
|
||||
if(a->act_time >= 0) {
|
||||
if(a->act_time > a->time) a->act_time = a->time;
|
||||
|
||||
int32_t new_value;
|
||||
new_value = a->path(a);
|
||||
|
||||
if(a->fp != NULL) a->fp(a->var, new_value); /*Apply the calculated value*/
|
||||
|
||||
/*If the time is elapsed the animation is ready*/
|
||||
if(a->act_time >= a->time) {
|
||||
bool invalid;
|
||||
invalid = anim_ready_handler(a);
|
||||
if(invalid != false) {
|
||||
a_next = lv_ll_get_head(&anim_ll); /*a_next might be invalid if animation delete occurred*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a = a_next;
|
||||
}
|
||||
|
||||
last_task_run = lv_tick_get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when an animation is ready to do the necessary thinks
|
||||
* e.g. repeat, play back, delete etc.
|
||||
* @param a pointer to an animation descriptor
|
||||
* @return true: animation delete occurred
|
||||
* */
|
||||
static bool anim_ready_handler(lv_anim_t * a)
|
||||
{
|
||||
bool invalid = false;
|
||||
|
||||
/*Delete the animation if
|
||||
* - no repeat and no play back (simple one shot animation)
|
||||
* - no repeat, play back is enabled and play back is ready */
|
||||
if((a->repeat == 0 && a->playback == 0) ||
|
||||
(a->repeat == 0 && a->playback == 1 && a->playback_now == 1)) {
|
||||
void (*cb) (void *) = a->end_cb;
|
||||
void * p = a->var;
|
||||
lv_ll_rem(&anim_ll, a);
|
||||
lv_mem_free(a);
|
||||
|
||||
/*Call the callback function at the end*/
|
||||
/* Check if an animation is deleted in the cb function
|
||||
* if yes then the caller function has to know this*/
|
||||
if(cb != NULL) cb(p);
|
||||
invalid = true;
|
||||
}
|
||||
/*If the animation is not deleted then restart it*/
|
||||
else {
|
||||
a->act_time = - a->repeat_pause; /*Restart the animation*/
|
||||
/*Swap the start and end values in play back mode*/
|
||||
if(a->playback != 0) {
|
||||
/*If now turning back use the 'playback_pause*/
|
||||
if(a->playback_now == 0) a->act_time = - a->playback_pause;
|
||||
|
||||
/*Toggle the play back state*/
|
||||
a->playback_now = a->playback_now == 0 ? 1: 0;
|
||||
/*Swap the start and end values*/
|
||||
int32_t tmp;
|
||||
tmp = a->start;
|
||||
a->start = a->end;
|
||||
a->end = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
return invalid;
|
||||
}
|
||||
#endif
|
||||
129
lv_misc/lv_anim.h
Normal file
129
lv_misc/lv_anim.h
Normal file
@@ -0,0 +1,129 @@
|
||||
/**
|
||||
* @file anim.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ANIM_H
|
||||
#define ANIM_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "../../lv_conf.h"
|
||||
#if USE_LV_ANIMATION
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
struct _lv_anim_t;
|
||||
|
||||
typedef int32_t(*lv_anim_path_t)(const struct _lv_anim_t*);
|
||||
|
||||
typedef void (*lv_anim_fp_t)(void *, int32_t);
|
||||
typedef void (*lv_anim_cb_t)(void *);
|
||||
|
||||
typedef struct _lv_anim_t
|
||||
{
|
||||
void * var; /*Variable to animate*/
|
||||
lv_anim_fp_t fp; /*Animator function*/
|
||||
lv_anim_cb_t end_cb; /*Call it when the animation is ready*/
|
||||
lv_anim_path_t path; /*An array with the steps of animations*/
|
||||
int32_t start; /*Start value*/
|
||||
int32_t end; /*End value*/
|
||||
uint16_t time; /*Animation time in ms*/
|
||||
int16_t act_time; /*Current time in animation. Set to negative to make delay.*/
|
||||
uint16_t playback_pause; /*Wait before play back*/
|
||||
uint16_t repeat_pause; /*Wait before repeat*/
|
||||
uint8_t playback :1; /*When the animation is ready play it back*/
|
||||
uint8_t repeat :1; /*Repeat the animation infinitely*/
|
||||
/*Animation system use these - user shouldn't set*/
|
||||
uint8_t playback_now :1; /*Play back is in progress*/
|
||||
}lv_anim_t;
|
||||
|
||||
/*Example initialization
|
||||
lv_anim_t a;
|
||||
a.var = obj;
|
||||
a.start = lv_obj_get_height(obj);
|
||||
a.end = new_height;
|
||||
a.fp = (lv_anim_fp_t)lv_obj_set_height;
|
||||
a.path = lv_anim_path_linear;
|
||||
a.end_cb = NULL;
|
||||
a.act_time = 0;
|
||||
a.time = 200;
|
||||
a.playback = 0;
|
||||
a.playback_pause = 0;
|
||||
a.repeat = 0;
|
||||
a.repeat_pause = 0;
|
||||
*/
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Init. the animation module
|
||||
*/
|
||||
void lv_anim_init(void);
|
||||
|
||||
/**
|
||||
* Create an animation
|
||||
* @param anim_p an initialized 'anim_t' variable. Not required after call.
|
||||
*/
|
||||
void lv_anim_create(lv_anim_t * anim_p);
|
||||
|
||||
/**
|
||||
* Delete an animation for a variable with a given animatior function
|
||||
* @param var pointer to variable
|
||||
* @param fp a function pointer which is animating 'var',
|
||||
* or NULL to ignore it and delete all animation with 'var
|
||||
* @return true: at least 1 animation is deleted, false: no animation is deleted
|
||||
*/
|
||||
bool lv_anim_del(void * var, lv_anim_fp_t fp);
|
||||
|
||||
/**
|
||||
* Calculate the time of an animation with a given speed and the start and end values
|
||||
* @param speed speed of animation in unit/sec
|
||||
* @param start start value of the animation
|
||||
* @param end end value of the animation
|
||||
* @return the required time [ms] for the animation with the given parameters
|
||||
*/
|
||||
uint16_t lv_anim_speed_to_time(uint16_t speed, int32_t start, int32_t end);
|
||||
|
||||
/**
|
||||
* Calculate the current value of an animation applying linear characteristic
|
||||
* @param a pointer to an animation
|
||||
* @return the current value to set
|
||||
*/
|
||||
int32_t lv_anim_path_linear(const lv_anim_t *a);
|
||||
|
||||
/**
|
||||
* Calculate the current value of an animation applying step characteristic.
|
||||
* (Set end value on the end of the animation)
|
||||
* @param a pointer to an animation
|
||||
* @return the current value to set
|
||||
*/
|
||||
int32_t lv_anim_path_step(const lv_anim_t *a);
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*USE_LV_ANIMATION == 0*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_ANIM_H*/
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* @file 2d.c
|
||||
* @file lv_area.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <lvgl/lv_misc/area.h>
|
||||
#include "misc/math/math_base.h"
|
||||
#include "lv_area.h"
|
||||
#include "lv_math.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -41,7 +41,7 @@
|
||||
* @param x2 right coordinate of the area
|
||||
* @param y2 bottom coordinate of the area
|
||||
*/
|
||||
void area_set(area_t * area_p, cord_t x1, cord_t y1, cord_t x2, cord_t y2)
|
||||
void lv_area_set(lv_area_t * area_p, lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2)
|
||||
{
|
||||
area_p->x1 = x1;
|
||||
area_p->y1 = y1;
|
||||
@@ -49,24 +49,40 @@ void area_set(area_t * area_p, cord_t x1, cord_t y1, cord_t x2, cord_t y2)
|
||||
area_p->y2 = y2;
|
||||
}
|
||||
|
||||
void area_set_width(area_t * area_p, cord_t w)
|
||||
/**
|
||||
* Set the width of an area
|
||||
* @param area_p pointer to an area
|
||||
* @param w the new width of the area (w == 1 makes x1 == x2)
|
||||
*/
|
||||
void lv_area_set_width(lv_area_t * area_p, lv_coord_t w)
|
||||
{
|
||||
area_p->x2 = area_p->x1 + w - 1;
|
||||
}
|
||||
|
||||
void area_set_height(area_t * area_p, cord_t h)
|
||||
/**
|
||||
* Set the height of an area
|
||||
* @param area_p pointer to an area
|
||||
* @param h the new height of the area (h == 1 makes y1 == y2)
|
||||
*/
|
||||
void lv_area_set_height(lv_area_t * area_p, lv_coord_t h)
|
||||
{
|
||||
area_p->y2 = area_p->y1 + h - 1;
|
||||
}
|
||||
|
||||
void area_set_pos(area_t * area_p, cord_t x, cord_t y)
|
||||
/**
|
||||
* Set the position of an area (width and height will be kept)
|
||||
* @param area_p pointer to an area
|
||||
* @param x the new x coordinate of the area
|
||||
* @param y the new y coordinate of the area
|
||||
*/
|
||||
void lv_area_set_pos(lv_area_t * area_p, lv_coord_t x, lv_coord_t y)
|
||||
{
|
||||
cord_t w = area_get_width(area_p);
|
||||
cord_t h = area_get_height(area_p);
|
||||
lv_coord_t w = lv_area_get_width(area_p);
|
||||
lv_coord_t h = lv_area_get_height(area_p);
|
||||
area_p->x1 = x;
|
||||
area_p->y1 = y;
|
||||
area_set_width(area_p, w);
|
||||
area_set_height(area_p, h);
|
||||
lv_area_set_width(area_p, w);
|
||||
lv_area_set_height(area_p, h);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,7 +90,7 @@ void area_set_pos(area_t * area_p, cord_t x, cord_t y)
|
||||
* @param area_p pointer to an area
|
||||
* @return size of area
|
||||
*/
|
||||
uint32_t area_get_size(const area_t * area_p)
|
||||
uint32_t lv_area_get_size(const lv_area_t * area_p)
|
||||
{
|
||||
uint32_t size;
|
||||
|
||||
@@ -91,13 +107,13 @@ uint32_t area_get_size(const area_t * area_p)
|
||||
* @param a2_p pointer to the second area
|
||||
* @return false: the two area has NO common parts, res_p is invalid
|
||||
*/
|
||||
bool area_union(area_t * res_p, const area_t * a1_p, const area_t * a2_p)
|
||||
bool lv_area_union(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p)
|
||||
{
|
||||
/* Get the smaller area from 'a1_p' and 'a2_p' */
|
||||
res_p->x1 = max(a1_p->x1, a2_p->x1);
|
||||
res_p->y1 = max(a1_p->y1, a2_p->y1);
|
||||
res_p->x2 = min(a1_p->x2, a2_p->x2);
|
||||
res_p->y2 = min(a1_p->y2, a2_p->y2);
|
||||
res_p->x1 = LV_MATH_MAX(a1_p->x1, a2_p->x1);
|
||||
res_p->y1 = LV_MATH_MAX(a1_p->y1, a2_p->y1);
|
||||
res_p->x2 = LV_MATH_MIN(a1_p->x2, a2_p->x2);
|
||||
res_p->y2 = LV_MATH_MIN(a1_p->y2, a2_p->y2);
|
||||
|
||||
/*If x1 or y1 greater then x2 or y2 then the areas union is empty*/
|
||||
bool union_ok = true;
|
||||
@@ -115,12 +131,12 @@ bool area_union(area_t * res_p, const area_t * a1_p, const area_t * a2_p)
|
||||
* @param a1_p pointer to the first area
|
||||
* @param a2_p pointer to the second area
|
||||
*/
|
||||
void area_join(area_t * a_res_p, const area_t * a1_p, const area_t * a2_p)
|
||||
void lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * a2_p)
|
||||
{
|
||||
a_res_p->x1 = min(a1_p->x1, a2_p->x1);
|
||||
a_res_p->y1 = min(a1_p->y1, a2_p->y1);
|
||||
a_res_p->x2 = max(a1_p->x2, a2_p->x2);
|
||||
a_res_p->y2 = max(a1_p->y2, a2_p->y2);
|
||||
a_res_p->x1 = LV_MATH_MIN(a1_p->x1, a2_p->x1);
|
||||
a_res_p->y1 = LV_MATH_MIN(a1_p->y1, a2_p->y1);
|
||||
a_res_p->x2 = LV_MATH_MAX(a1_p->x2, a2_p->x2);
|
||||
a_res_p->y2 = LV_MATH_MAX(a1_p->y2, a2_p->y2);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,7 +145,7 @@ void area_join(area_t * a_res_p, const area_t * a1_p, const area_t * a2_p)
|
||||
* @param p_p pointer to a point
|
||||
* @return false:the point is out of the area
|
||||
*/
|
||||
bool area_is_point_on(const area_t * a_p, const point_t * p_p)
|
||||
bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p)
|
||||
{
|
||||
bool is_on = false;
|
||||
|
||||
@@ -146,57 +162,29 @@ bool area_is_point_on(const area_t * a_p, const point_t * p_p)
|
||||
* Check if two area has common parts
|
||||
* @param a1_p pointer to an area.
|
||||
* @param a2_p pointer to an other area
|
||||
* @return false: a1_p and a2_p has no common parts */
|
||||
bool area_is_on(const area_t * a1_p, const area_t * a2_p)
|
||||
* @return false: a1_p and a2_p has no common parts
|
||||
*/
|
||||
bool lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p)
|
||||
{
|
||||
/*Two area are on each other if... */
|
||||
|
||||
point_t p;
|
||||
/*a2 left-top corner is on a1*/
|
||||
p.x = a2_p->x1;
|
||||
p.y = a2_p->y1;
|
||||
if(area_is_point_on(a1_p, &p)) return true;
|
||||
|
||||
/*a2 right-top corner is on a1*/
|
||||
p.x = a2_p->x1;
|
||||
p.y = a2_p->y1;
|
||||
if(area_is_point_on(a1_p, &p)) return true;
|
||||
|
||||
/*a2 left-bottom corner is on a1*/
|
||||
p.x = a2_p->x1;
|
||||
p.y = a2_p->y2;
|
||||
if(area_is_point_on(a1_p, &p)) return true;
|
||||
|
||||
/*a2 right-bottom corner is on a1*/
|
||||
p.x = a2_p->x2;
|
||||
p.y = a2_p->y2;
|
||||
if(area_is_point_on(a1_p, &p)) return true;
|
||||
|
||||
/*a2 is horizontally bigger then a1 and covers it*/
|
||||
if((a2_p->x1 <= a1_p->x1 && a2_p->x2 >= a1_p->x2) && /*a2 hor. cover a1?*/
|
||||
((a2_p->y1 <= a1_p->y1 && a2_p->y1 >= a1_p->y2) || /*upper edge is on a1?*/
|
||||
(a2_p->y2 <= a1_p->y1 && a2_p->y2 >= a1_p->y2) ||/* or lower edge is on a1?*/
|
||||
(a2_p->y1 <= a1_p->y1 && a2_p->y2 >= a1_p->y2))) /*or a2 vert bigger then a1*/
|
||||
return true;
|
||||
|
||||
/*a2 is vertically bigger then a1 and covers it*/
|
||||
if((a2_p->y1 <= a1_p->y1 && a2_p->y2 >= a1_p->y2) && /*a2 vert. cover a1?*/
|
||||
((a2_p->x1 <= a1_p->x1 && a2_p->x1 >= a1_p->x2) || /*left edge is on a1?*/
|
||||
(a2_p->x2 <= a1_p->x1 && a2_p->x2 >= a1_p->x2) ||/* or right edge is on a1?*/
|
||||
(a2_p->x1 <= a1_p->x1 && a2_p->x2 >= a1_p->x2))) /*or a2 hor. bigger then a1*/
|
||||
return true;
|
||||
|
||||
/*Else no cover*/
|
||||
return false;
|
||||
if((a1_p->x1 <= a2_p->x2) &&
|
||||
(a1_p->x2 >= a2_p->x1) &&
|
||||
(a1_p->y1 <= a2_p->y2) &&
|
||||
(a1_p->y2 >= a2_p->y1))
|
||||
{
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an area is fully on an other
|
||||
* @param ain_p pointer to an area which could be on aholder_p
|
||||
* @param aholder pointer to an area which could involve ain_p
|
||||
* @param ain_p pointer to an area which could be in 'aholder_p'
|
||||
* @param aholder pointer to an area which could involve 'ain_p'
|
||||
* @return
|
||||
*/
|
||||
bool area_is_in(const area_t * ain_p, const area_t * aholder_p)
|
||||
bool lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p)
|
||||
{
|
||||
bool is_in = false;
|
||||
|
||||
169
lv_misc/lv_area.h
Normal file
169
lv_misc/lv_area.h
Normal file
@@ -0,0 +1,169 @@
|
||||
/**
|
||||
* @file lv_area.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_AREA_H
|
||||
#define LV_AREA_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define LV_COORD_MAX (16383) /*To avoid overflow don't let the max [-32,32k] range */
|
||||
#define LV_COORD_MIN (-16384)
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
typedef int16_t lv_coord_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
lv_coord_t x;
|
||||
lv_coord_t y;
|
||||
}lv_point_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
lv_coord_t x1;
|
||||
lv_coord_t y1;
|
||||
lv_coord_t x2;
|
||||
lv_coord_t y2;
|
||||
}lv_area_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize an area
|
||||
* @param area_p pointer to an area
|
||||
* @param x1 left coordinate of the area
|
||||
* @param y1 top coordinate of the area
|
||||
* @param x2 right coordinate of the area
|
||||
* @param y2 bottom coordinate of the area
|
||||
*/
|
||||
void lv_area_set(lv_area_t * area_p, lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2);
|
||||
|
||||
/**
|
||||
* Copy an area
|
||||
* @param dest pointer to the destination area
|
||||
* @param src pointer to the source area
|
||||
*/
|
||||
inline static void lv_area_copy(lv_area_t * dest, const lv_area_t * src)
|
||||
{
|
||||
memcpy(dest, src, sizeof(lv_area_t));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the width of an area
|
||||
* @param area_p pointer to an area
|
||||
* @return the width of the area (if x1 == x2 -> width = 1)
|
||||
*/
|
||||
static inline lv_coord_t lv_area_get_width(const lv_area_t * area_p)
|
||||
{
|
||||
return area_p->x2 - area_p->x1 + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the height of an area
|
||||
* @param area_p pointer to an area
|
||||
* @return the height of the area (if y1 == y2 -> height = 1)
|
||||
*/
|
||||
static inline lv_coord_t lv_area_get_height(const lv_area_t * area_p)
|
||||
{
|
||||
return area_p->y2 - area_p->y1 + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the width of an area
|
||||
* @param area_p pointer to an area
|
||||
* @param w the new width of the area (w == 1 makes x1 == x2)
|
||||
*/
|
||||
void lv_area_set_width(lv_area_t * area_p, lv_coord_t w);
|
||||
|
||||
/**
|
||||
* Set the height of an area
|
||||
* @param area_p pointer to an area
|
||||
* @param h the new height of the area (h == 1 makes y1 == y2)
|
||||
*/
|
||||
void lv_area_set_height(lv_area_t * area_p, lv_coord_t h);
|
||||
|
||||
/**
|
||||
* Set the position of an area (width and height will be kept)
|
||||
* @param area_p pointer to an area
|
||||
* @param x the new x coordinate of the area
|
||||
* @param y the new y coordinate of the area
|
||||
*/
|
||||
void lv_area_set_pos(lv_area_t * area_p, lv_coord_t x, lv_coord_t y);
|
||||
|
||||
/**
|
||||
* Return with area of an area (x * y)
|
||||
* @param area_p pointer to an area
|
||||
* @return size of area
|
||||
*/
|
||||
uint32_t lv_area_get_size(const lv_area_t * area_p);
|
||||
|
||||
/**
|
||||
* Get the common parts of two areas
|
||||
* @param res_p pointer to an area, the result will be stored her
|
||||
* @param a1_p pointer to the first area
|
||||
* @param a2_p pointer to the second area
|
||||
* @return false: the two area has NO common parts, res_p is invalid
|
||||
*/
|
||||
bool lv_area_union(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p);
|
||||
|
||||
/**
|
||||
* Join two areas into a third which involves the other two
|
||||
* @param res_p pointer to an area, the result will be stored here
|
||||
* @param a1_p pointer to the first area
|
||||
* @param a2_p pointer to the second area
|
||||
*/
|
||||
void lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * a2_p);
|
||||
|
||||
/**
|
||||
* Check if a point is on an area
|
||||
* @param a_p pointer to an area
|
||||
* @param p_p pointer to a point
|
||||
* @return false:the point is out of the area
|
||||
*/
|
||||
bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p);
|
||||
|
||||
/**
|
||||
* Check if two area has common parts
|
||||
* @param a1_p pointer to an area.
|
||||
* @param a2_p pointer to an other area
|
||||
* @return false: a1_p and a2_p has no common parts
|
||||
*/
|
||||
bool lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p);
|
||||
|
||||
/**
|
||||
* Check if an area is fully on an other
|
||||
* @param ain_p pointer to an area which could be on aholder_p
|
||||
* @param aholder pointer to an area which could involve ain_p
|
||||
* @return
|
||||
*/
|
||||
bool lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file circ.c
|
||||
* @file lv_circ.c
|
||||
* Circle drawing algorithm (with Bresenham)
|
||||
* Only a 1/8 circle is calculated. Use CIRC_OCT1_X, CIRC_OCT1_Y macros to get
|
||||
* the other octets.
|
||||
@@ -8,7 +8,7 @@
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <lvgl/lv_misc/area.h>
|
||||
#include "lv_area.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -40,7 +40,7 @@
|
||||
* @param tmp point to a variable. It will store temporary data
|
||||
* @param radius radius of the circle
|
||||
*/
|
||||
void circ_init(point_t * c, cord_t * tmp, cord_t radius)
|
||||
void lv_circ_init(lv_point_t * c, lv_coord_t * tmp, lv_coord_t radius)
|
||||
{
|
||||
c->x = radius;
|
||||
c->y = 0;
|
||||
@@ -52,7 +52,7 @@ void circ_init(point_t * c, cord_t * tmp, cord_t radius)
|
||||
* @param c same as in circ_init
|
||||
* @return true if the circle is not ready yet
|
||||
*/
|
||||
bool circ_cont(point_t * c)
|
||||
bool lv_circ_cont(lv_point_t * c)
|
||||
{
|
||||
return c->y <= c->x ? true : false;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ bool circ_cont(point_t * c)
|
||||
* @param c same as in circ_init. The next point stored here.
|
||||
* @param tmp same as in circ_init.
|
||||
*/
|
||||
void circ_next(point_t * c, cord_t * tmp)
|
||||
void lv_circ_next(lv_point_t * c, lv_coord_t * tmp)
|
||||
{
|
||||
c->y++;
|
||||
|
||||
79
lv_misc/lv_circ.h
Normal file
79
lv_misc/lv_circ.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* @file lv_circ.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_CIRC_H
|
||||
#define LV_CIRC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <stddef.h>
|
||||
#include "lv_area.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define LV_CIRC_OCT1_X(p) (p.x)
|
||||
#define LV_CIRC_OCT1_Y(p) (p.y)
|
||||
#define LV_CIRC_OCT2_X(p) (p.y)
|
||||
#define LV_CIRC_OCT2_Y(p) (p.x)
|
||||
#define LV_CIRC_OCT3_X(p) (-p.y)
|
||||
#define LV_CIRC_OCT3_Y(p) (p.x)
|
||||
#define LV_CIRC_OCT4_X(p) (-p.x)
|
||||
#define LV_CIRC_OCT4_Y(p) (p.y)
|
||||
#define LV_CIRC_OCT5_X(p) (-p.x)
|
||||
#define LV_CIRC_OCT5_Y(p) (-p.y)
|
||||
#define LV_CIRC_OCT6_X(p) (-p.y)
|
||||
#define LV_CIRC_OCT6_Y(p) (-p.x)
|
||||
#define LV_CIRC_OCT7_X(p) (p.y)
|
||||
#define LV_CIRC_OCT7_Y(p) (-p.x)
|
||||
#define LV_CIRC_OCT8_X(p) (p.x)
|
||||
#define LV_CIRC_OCT8_Y(p) (-p.y)
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize the circle drawing
|
||||
* @param c pointer to a point. The coordinates will be calculated here
|
||||
* @param tmp point to a variable. It will store temporary data
|
||||
* @param radius radius of the circle
|
||||
*/
|
||||
void lv_circ_init(lv_point_t * c, lv_coord_t * tmp, lv_coord_t radius);
|
||||
|
||||
/**
|
||||
* Test the circle drawing is ready or not
|
||||
* @param c same as in circ_init
|
||||
* @return true if the circle is not ready yet
|
||||
*/
|
||||
bool lv_circ_cont(lv_point_t * c);
|
||||
|
||||
/**
|
||||
* Get the next point from the circle
|
||||
* @param c same as in circ_init. The next point stored here.
|
||||
* @param tmp same as in circ_init.
|
||||
*/
|
||||
void lv_circ_next(lv_point_t * c, lv_coord_t * tmp);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
135
lv_misc/lv_color.c
Normal file
135
lv_misc/lv_color.c
Normal file
@@ -0,0 +1,135 @@
|
||||
/**
|
||||
* @file lv_color.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_color.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Convert a HSV color to RGB
|
||||
* @param h hue [0..359]
|
||||
* @param s saturation [0..100]
|
||||
* @param v value [0..100]
|
||||
* @return the given RGB color in RGB (with LV_COLOR_DEPTH depth)
|
||||
*/
|
||||
lv_color_t lv_color_hsv_to_rgb(uint16_t h, uint8_t s, uint8_t v)
|
||||
{
|
||||
h = (uint32_t)((uint32_t)h * 255) / 360;
|
||||
s = (uint16_t)((uint16_t)s * 255) / 100;
|
||||
v = (uint16_t)((uint16_t)v * 255) / 100;
|
||||
|
||||
uint8_t r, g, b;
|
||||
|
||||
uint8_t region, remainder, p, q, t;
|
||||
|
||||
if (s == 0)
|
||||
{
|
||||
r = v;
|
||||
g = v;
|
||||
b = v;
|
||||
return LV_COLOR_MAKE(v, v, v);
|
||||
}
|
||||
|
||||
region = h / 43;
|
||||
remainder = (h - (region * 43)) * 6;
|
||||
|
||||
p = (v * (255 - s)) >> 8;
|
||||
q = (v * (255 - ((s * remainder) >> 8))) >> 8;
|
||||
t = (v * (255 - ((s * (255 - remainder)) >> 8))) >> 8;
|
||||
|
||||
switch (region)
|
||||
{
|
||||
case 0:
|
||||
r = v; g = t; b = p;
|
||||
break;
|
||||
case 1:
|
||||
r = q; g = v; b = p;
|
||||
break;
|
||||
case 2:
|
||||
r = p; g = v; b = t;
|
||||
break;
|
||||
case 3:
|
||||
r = p; g = q; b = v;
|
||||
break;
|
||||
case 4:
|
||||
r = t; g = p; b = v;
|
||||
break;
|
||||
default:
|
||||
r = v; g = p; b = q;
|
||||
break;
|
||||
}
|
||||
|
||||
lv_color_t result = LV_COLOR_MAKE(r, g, b);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an RGB color to HSV
|
||||
* @param r red
|
||||
* @param g green
|
||||
* @param b blue
|
||||
* @return the given RGB color n HSV
|
||||
*/
|
||||
lv_color_hsv_t lv_color_rgb_to_hsv(uint8_t r, uint8_t g, uint8_t b)
|
||||
{
|
||||
lv_color_hsv_t hsv;
|
||||
uint8_t rgbMin, rgbMax;
|
||||
|
||||
rgbMin = r < g ? (r < b ? r : b) : (g < b ? g : b);
|
||||
rgbMax = r > g ? (r > b ? r : b) : (g > b ? g : b);
|
||||
|
||||
hsv.v = rgbMax;
|
||||
if (hsv.v == 0)
|
||||
{
|
||||
hsv.h = 0;
|
||||
hsv.s = 0;
|
||||
return hsv;
|
||||
}
|
||||
|
||||
hsv.s = 255 * (long)(rgbMax - rgbMin) / hsv.v;
|
||||
if (hsv.s == 0)
|
||||
{
|
||||
hsv.h = 0;
|
||||
return hsv;
|
||||
}
|
||||
|
||||
if (rgbMax == r)
|
||||
hsv.h = 0 + 43 * (g - b) / (rgbMax - rgbMin);
|
||||
else if (rgbMax == g)
|
||||
hsv.h = 85 + 43 * (b - r) / (rgbMax - rgbMin);
|
||||
else
|
||||
hsv.h = 171 + 43 * (r - g) / (rgbMax - rgbMin);
|
||||
|
||||
return hsv;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user