Compare commits

...

204 Commits

Author SHA1 Message Date
Gabor Kiss-Vamosi
f5d4bf8fc4 lv_tabview_set_tab_act: enable to set the act tab again: 2018-05-20 21:49:04 +02:00
Gabor Kiss-Vamosi
1254020b8b Merge branch 'beta' 2018-05-20 21:33:21 +02:00
Gabor Kiss-Vamosi
7f03c17a08 remove debug printf 2018-05-20 21:32:16 +02:00
Gabor Kiss-Vamosi
4440506858 Merge branch 'beta' of https://github.com/littlevgl/lvgl into beta 2018-05-20 21:31:23 +02:00
Gabor Kiss-Vamosi
01b4820b93 release v5.1.1 2018-05-20 21:30:36 +02:00
Gabor Kiss-Vamosi
fc8ee11955 start lv_refr_task immediately on start up (don't need to wait it's period to refresh the screen) 2018-05-17 17:07:21 +02:00
Gabor Kiss-Vamosi
fe30f9739b Update TODO_PATCH.md 2018-05-17 13:05:54 +02:00
Gabor Kiss-Vamosi
6be0089cac lv_group_del: remove the objects from the groups too 2018-05-16 23:30:04 +02:00
Gabor Kiss-Vamosi
80cb93f8e1 don't invalidate hidden objects 2018-05-16 23:19:22 +02:00
Gabor Kiss-Vamosi
a3ad4b3616 in lv_objx set functions apply the new value only if it's different from the current 2018-05-16 23:09:30 +02:00
Gabor Kiss-Vamosi
89b5907eb6 lv_slider: draw greater background on negative padding if knob_in == 1 2018-05-08 11:28:26 +02:00
Gabor Kiss-Vamosi
68d262ba93 lv_draw: remove debug printf-s 2018-05-08 11:28:26 +02:00
Gabor Kiss-Vamosi
ee3a44388c lv_draw: shadow draw fix array over indexing 2018-05-08 11:28:26 +02:00
Gabor Kiss-Vamosi
51e15ced3f add lv_theme_zen.h to lv_theme.h 2018-04-18 18:11:20 +02:00
Gabor Kiss-Vamosi
aac716d497 lv_task: lv_task_set_prio fix 2018-04-18 13:23:43 +02:00
Gabor Kiss-Vamosi
2353ca0621 fix overflow in lv_anim_speed_to_time 2018-04-17 14:11:39 +02:00
Gabor Kiss-Vamosi
8bc5770c28 lv_del_obj: fix if delted while pressed 2018-04-14 22:06:13 +02:00
Gabor Kiss-Vamosi
913517f19d lv_kb: before ok/close action don't deassign the lv_ta if there is user defived action 2018-04-13 20:09:14 +02:00
Gabor Kiss-Vamosi
0d385c237a lv_font: remove const number return values 2018-04-09 12:39:58 +02:00
Gabor Kiss-Vamosi
94bf21b9be lv_fs: fix duplicated error cheching 2018-04-09 12:33:33 +02:00
Gabor Kiss-Vamosi
a4b697f41e in style animation add opacity handling to image, text and line 2018-04-09 12:29:56 +02:00
Gabor Kiss-Vamosi
b047c1318f minor comment fixes 2018-04-05 22:21:50 +02:00
Gabor Kiss-Vamosi
a5d6881e9e Merge pull request #187 from upbeat27/group_missing_def
Add missing function definition for lv_group_del
2018-04-05 17:54:29 +02:00
Josh McAtee
eddbbc58b1 Add missing function definition for lv_group_del 2018-04-04 10:24:53 -07:00
Gabor Kiss-Vamosi
908db3cd59 Update CONTRIBUTING.md 2018-04-04 00:17:37 +02:00
Gabor Kiss-Vamosi
8a42ab14ad Merge branch 'master' into beta 2018-04-03 12:22:11 +02:00
Gabor Kiss-Vamosi
c2f70d1cc7 mono theme: fix typo 2018-04-03 12:21:59 +02:00
Gabor Kiss-Vamosi
89452a9d8e lv_cont_set_fit: fix wrong signal paramter 2018-04-03 12:21:45 +02:00
Gabor Kiss-Vamosi
563411a33a lv_indev: drag test use absolute coosdinates 2018-04-03 12:21:07 +02:00
Gabor Kiss-Vamosi
d1889b77e5 lv_slider: inicator draw bugfix 2018-03-29 13:56:21 +02:00
Gabor Kiss-Vamosi
e8a9d1bdc7 lv_line: set line.width ext. size to not trim parts on x = 0, y = 0 coordinates 2018-03-22 14:45:15 +01:00
Gabor Kiss-Vamosi
9b2de5f215 Update TODO_PATCH.md 2018-03-22 14:42:56 +01:00
Gabor Kiss-Vamosi
779cac9b77 Update TODO_PATCH.md 2018-03-22 14:42:41 +01:00
Gabor Kiss-Vamosi
a4d77bec6b Disable Visual Studio warnings 2018-03-22 14:41:55 +01:00
Gabor Kiss-Vamosi
dd6bad1b6e fix of 16 bit image draw with alpha byte 2018-03-22 12:39:58 +01:00
Gabor Kiss-Vamosi
0d93816827 lv_group_create: init focus_cb 2018-03-22 10:37:00 +01:00
Gabor Kiss-Vamosi
ca95d76659 lv_conf.h: add LV_COMPILER_VLA_SUPPORTED 2018-03-22 10:09:00 +01:00
Gabor Kiss-Vamosi
d58a83cda7 lv_mbox: Translate LV_GROUP_KEY_UP/DOWN to LV_GROUP_KEY_LEFT/RIGHT 2018-03-21 13:15:02 +01:00
Gabor Kiss-Vamosi
69c5373db0 start v5.1.1 2018-03-12 17:20:24 +01:00
Gabor Kiss-Vamosi
a55d02dd31 Merge pull request #158 from Zaltora/patch-1
Non constant declaration
2018-03-12 13:17:11 +01:00
Zaltora
02d318e66d Non constant declaration
I got an error when compilation. I fix the compilation problem but a proper way to initialize this variable is maybe needed. maybe in lv_init ?
You can fix it and close this pull request.
2018-03-12 11:40:24 +01:00
Gabor Kiss-Vamosi
9f72ca2329 Update TODO_MAJOR.md 2018-03-12 10:44:02 +01:00
Gabor Kiss-Vamosi
2d12ad9251 Update TODO_PATCH.md 2018-03-12 10:43:42 +01:00
Gabor Kiss-Vamosi
09c072bda6 Update TODO_MINOR.md 2018-03-12 10:43:12 +01:00
Gabor Kiss-Vamosi
9909a4123f Update TODO_PATCH.md 2018-03-12 10:42:03 +01:00
Gabor Kiss-Vamosi
63c59b6570 Update CONTRIBUTING.md 2018-03-10 09:26:35 +01:00
Gabor Kiss-Vamosi
ee4cd4756b Update README.md 2018-03-10 07:47:28 +01:00
Gabor Kiss-Vamosi
bd0c6c9ce3 regenerate buil in fonts 2018-03-09 14:14:06 +01:00
Gabor Kiss-Vamosi
213e621412 fix text opacity 2018-03-09 14:13:51 +01:00
Gabor Kiss-Vamosi
5d53a9edaf fix warnings 2018-03-07 14:46:38 +01:00
Gabor Kiss-Vamosi
c2fb0fffbd Update README.md 2018-03-07 13:51:59 +01:00
Gabor Kiss-Vamosi
fc05fad277 release v5.1 2018-03-07 13:39:51 +01:00
Gabor Kiss-Vamosi
1466d2b97e Merge branch 'master' of https://github.com/littlevgl/lvgl 2018-03-07 13:36:50 +01:00
Gabor Kiss-Vamosi
13351c0091 lv_math: lv_math_num_to_str: return with buf 2018-03-07 13:10:20 +01:00
Gabor Kiss-Vamosi
19f98ce8ea merge dev-5.1 2018-03-07 13:08:53 +01:00
Gabor Kiss-Vamosi
4b5fefa521 Merge branch 'beta' of https://github.com/littlevgl/lvgl into beta 2018-03-07 13:07:17 +01:00
Gabor Kiss-Vamosi
f8b4dc3a2d merge beta 2018-03-07 13:07:00 +01:00
Gabor Kiss-Vamosi
4d571290c7 Update TODO_PATCH.md 2018-03-07 12:48:31 +01:00
Gabor Kiss-Vamosi
3a35da8f27 lv_btnm (and lv_kb): add up/down navigation with LV_GROUP_KEY_UP/DOWN 2018-03-07 11:37:38 +01:00
Gabor Kiss-Vamosi
1b1efbd0f0 lv_area_is_on bugfix 2018-03-07 10:49:25 +01:00
Gabor Kiss-Vamosi
d068c85e80 minor updates on LV_ATTRIBUTE_... 2018-03-07 09:22:37 +01:00
Gabor Kiss-Vamosi
145ea416be ddlist: auto-open on LV_GROUP_KEY_LEF/RIGHT/UP/DOWN 2018-03-07 09:22:10 +01:00
Gabor Kiss-Vamosi
0b6be3a0f6 bottom shadow: add blur 2018-03-05 17:14:45 +01:00
Gabor Kiss-Vamosi
7cf2cf0756 Update TODO_MINOR.md 2018-03-05 14:16:53 +01:00
Gabor Kiss-Vamosi
69eb3a9756 updae comments 2018-03-04 17:57:51 +01:00
Gabor Kiss-Vamosi
7b20da2276 remove debug printf 2018-03-04 17:56:32 +01:00
Gabor Kiss-Vamosi
eb376899ce remove sprintf from lv_gauge the save ROM (custom BCD converter added to lv_math.c) 2018-03-04 17:51:41 +01:00
Gabor Kiss-Vamosi
2123ee0218 fixes with USE_LV_FILESYSTEM = 0 2018-03-04 17:03:37 +01:00
Gabor Kiss-Vamosi
6e94c70fbb replace the only sscanf with a custom function (save 30 kB ROM) 2018-03-04 16:34:14 +01:00
Gabor Kiss-Vamosi
80b181293a fix lv_rfill screen sized area size 2018-03-04 15:36:45 +01:00
Gabor Kiss-Vamosi
fb59508ad1 typo fix: lv_refr_set_round_cb() 2018-03-02 15:34:22 +01:00
Gabor Kiss-Vamosi
9e20b3a18e Merge pull request #136 from chenshijianworkgit/beta
fix keyboard cursor management invalid
2018-03-02 10:59:43 +01:00
jian
505c44a4d3 fix keyboard cursor management invalid 2018-03-02 09:44:05 +08:00
Gabor Kiss-Vamosi
c0d55112b4 Merge remote-tracking branch 'origin/beta' into dev-5.1 2018-03-01 13:18:50 +01:00
Gabor Kiss-Vamosi
e246db4604 minor updates 2018-03-01 13:17:29 +01:00
Gabor Kiss-Vamosi
2d5e41d566 lv_conf_templ: minor updates 2018-03-01 12:52:35 +01:00
Gabor Kiss-Vamosi
c3e248ec79 ddlist and roller group updates + updates with USE_LV_ANIMATION = 0 2018-03-01 12:21:49 +01:00
Gabor Kiss-Vamosi
7da60e219d Merge pull request #134 from chenshijianworkgit/beta
gauge's label count is not inherited
2018-03-01 10:12:05 +01:00
jian
8978f27145 fix the number of gauge's label count is not inherited 2018-03-01 11:37:54 +08:00
Gabor Kiss-Vamosi
a6749c0a26 Update TODO_MINOR.md 2018-02-28 16:31:40 +01:00
Gabor Kiss-Vamosi
d20fe1f4ee add special default style_mod function in lv_group for LV_COLOR_DEPTH = 1 2018-02-28 16:17:56 +01:00
Gabor Kiss-Vamosi
05fe9b6b81 add lv_obj_get_type 2018-02-28 15:37:41 +01:00
Gabor Kiss-Vamosi
e4b677be3d lv_hal_disp: fix linked list issue whan adding more displays 2018-02-28 09:45:51 +01:00
Gabor Kiss-Vamosi
05a98a0107 Update TODO_MINOR.md 2018-02-28 09:42:44 +01:00
Gabor Kiss-Vamosi
769f864360 makefle update 2018-02-27 13:24:49 +01:00
Gabor Kiss-Vamosi
af3012abff border draw bugfix with radius = 0 2018-02-27 13:24:41 +01:00
Gabor Kiss-Vamosi
cdebffe462 remove debug printf-s 2018-02-27 11:47:21 +01:00
Gabor Kiss-Vamosi
5b9c9c4833 fix: USE_LV_SHADOW = 0 with LV_ANTIALAIS = 1 2018-02-27 11:45:38 +01:00
Gabor Kiss-Vamosi
9605a6b712 image draw: minor optimization 2018-02-27 11:43:14 +01:00
Gabor Kiss-Vamosi
6f304736c5 image draw bugfix with NO_GPU 2018-02-26 17:19:51 +01:00
Gabor Kiss-Vamosi
dbe7ef7a0c lv_color.h fix uninitialized alpha chanel with 24 bit color 2018-02-26 15:57:40 +01:00
Gabor Kiss-Vamosi
f0a705595b minor shadow bottom draw bugfix 2018-02-24 15:36:19 +01:00
Gabor Kiss-Vamosi
076540752b prevent refresh after drag is no movement happened 2018-02-24 15:36:06 +01:00
Gabor Kiss-Vamosi
5bc8f819f0 Update TODO_MINOR.md 2018-02-24 14:50:58 +01:00
Gabor Kiss-Vamosi
f3e1df3997 add LV_GROUP_KEY_ENETER_LONG to trigger long press evets of the objects 2018-02-24 14:39:15 +01:00
Gabor Kiss-Vamosi
465ce80e41 Update TODO_MINOR.md 2018-02-24 13:37:53 +01:00
Gabor Kiss-Vamosi
b2f72d3f70 LV_INDEV_TYPE_BUTTON added 2018-02-24 13:17:39 +01:00
Gabor Kiss-Vamosi
a676590e30 add group focus callback and invalid area rounding callback option 2018-02-24 11:55:39 +01:00
Gabor Kiss-Vamosi
7688535204 Update TODO_MINOR.md 2018-02-24 11:54:45 +01:00
Gabor Kiss-Vamosi
7310a2c6cc add LV_PROTECT_PRESS_LOST 2018-02-24 11:26:06 +01:00
Gabor Kiss-Vamosi
3bbc052794 Update TODO_MINOR.md 2018-02-24 11:25:06 +01:00
Gabor Kiss-Vamosi
d57749ec98 Update TODO_MINOR.md 2018-02-23 20:55:21 +01:00
Gabor Kiss-Vamosi
5b637c68ee Update TODO_MINOR.md 2018-02-23 18:09:05 +01:00
Gabor Kiss-Vamosi
3e8ca224a8 Update TODO_MAJOR.md 2018-02-23 17:10:58 +01:00
Gabor Kiss-Vamosi
6e6a7de1a8 lv_conf_templ.h update 2018-02-23 17:07:02 +01:00
Gabor Kiss-Vamosi
ff2e425b48 comment updates 2018-02-23 17:03:00 +01:00
Gabor Kiss-Vamosi
f7ee864709 Update TODO_MINOR.md 2018-02-23 16:31:15 +01:00
Gabor Kiss-Vamosi
93330eaf1d rename LV_IMG_FORMAT_RAW_INTERNAL to LV_IMG_FORMAT_INTERNAL_RAW 2018-02-23 15:22:23 +01:00
Gabor Kiss-Vamosi
c4503cb8f8 lv_draw_label bugfix (old rounding from LV_FONT_ANTIALIAS) 2018-02-23 15:19:39 +01:00
Gabor Kiss-Vamosi
a11957d0b4 new font and anti-alising system release for test 2018-02-23 13:56:32 +01:00
Gabor Kiss-Vamosi
2177e51857 lv_slider: fix knob_in with not zero min value 2018-02-23 13:56:32 +01:00
Gabor Kiss-Vamosi
ff3bbc56bc Update lv_txt.c
fix lv_txt_ut8_size() with 4 byte characters.
2018-02-23 13:56:32 +01:00
Gabor Kiss-Vamosi
3e5d43fd8b Merge pull request #116 from CapnBry/dev-5.1
Add user pointer to indev driver for state storage between read() calls
2018-02-20 14:29:33 +01:00
Bryan Mayland
fada3aabfa Add user pointer to indev driver for state storage between read() calls 2018-02-20 13:25:36 +00:00
Gabor Kiss-Vamosi
7a09086c6b Update TODO_MAJOR.md 2018-02-20 08:48:52 +01:00
Gabor Kiss-Vamosi
890829aa93 Update TODO_MINOR.md 2018-02-17 20:15:02 +01:00
Gabor Kiss-Vamosi
88096cbbfe merge change 2018-02-16 13:16:40 +01:00
Gabor Kiss-Vamosi
c56f5421f0 shadow drawing optimized 2018-02-16 12:55:05 +01:00
Gabor Kiss-Vamosi
fa6eb2fc22 lv_anim: delete unused global variable 2018-02-15 13:37:23 +01:00
Gabor Kiss-Vamosi
c547d2cf67 Merge branch 'master' into beta 2018-02-15 13:25:37 +01:00
Gabor Kiss-Vamosi
2f5f63ed13 lv_task: faster and clearer handler 2018-02-15 13:24:56 +01:00
Gabor Kiss-Vamosi
2237ebd46e work in progress with new anti aliasing 2018-02-15 10:12:28 +01:00
Gabor Kiss-Vamosi
f4679bffc3 lv_draw_label: letter position bugfix with no anti aliasing 2018-02-09 12:41:48 +01:00
Gabor Kiss-Vamosi
133bfe161c add new fonts 2018-02-09 12:40:00 +01:00
Gabor Kiss-Vamosi
39961a686f Update TODO_MINOR.md 2018-02-07 13:32:34 +01:00
Gabor Kiss-Vamosi
dfedda8e28 Update TODO_PATCH.md 2018-02-07 13:08:28 +01:00
Gabor Kiss-Vamosi
7e17d38754 Merge pull request #105 from upbeat27/indev-proc-fix
Fix input device processing
2018-02-07 13:07:39 +01:00
Gabor Kiss-Vamosi
9f7e091aba Update TODO_MINOR.md 2018-02-07 13:00:26 +01:00
Josh McAtee
55a276ff9a Fix input device processing 2018-02-06 11:42:50 -08:00
Gabor Kiss-Vamosi
5f5c5f3d42 Update TODO_MAJOR.md 2018-02-05 21:46:01 +01:00
Gabor Kiss-Vamosi
83aab8f825 Update TODO_MAJOR.md 2018-02-05 21:45:45 +01:00
Gabor Kiss-Vamosi
d5bc4c0522 Update TODO_MINOR.md 2018-02-05 21:43:28 +01:00
Gabor Kiss-Vamosi
e5133e27e6 Update TODO_PATCH.md 2018-02-05 21:33:32 +01:00
Gabor Kiss-Vamosi
bbbf822561 lv_slider: fix knob_in with not zero min value 2018-02-05 11:35:07 +01:00
Gabor Kiss-Vamosi
b0e26d865c new font system WIP 2018-02-05 11:27:08 +01:00
Gabor Kiss-Vamosi
0bf1d14756 Update lv_txt.c
fix lv_txt_ut8_size() with 4 byte characters.
2018-02-03 06:25:42 +01:00
Gabor Kiss-Vamosi
e5676aaf9b lv_label_set_anim_time: fix (was no effect in LONG_ROLL) 2018-01-31 10:07:20 +01:00
Gabor Kiss-Vamosi
acc4d77fe9 lv_label_set_anim_time: fix (was no effect in LONG_ROLL) 2018-01-31 10:06:39 +01:00
Gabor Kiss-Vamosi
241c2e5d38 Merge pull request #95 from upbeat27/beta
Fix dropdown bug
2018-01-31 10:00:10 +01:00
Josh McAtee
cab6ce93d6 Fix ddlist controlled via keyboard
The selected option is tracked correctly when scrolling through the
dropdown list via keyboard
2018-01-30 11:58:40 -08:00
upbeat27
aad9f76a39 Merge pull request #1 from littlevgl/beta
Beta
2018-01-30 11:09:23 -08:00
Gabor Kiss-Vamosi
ec19ceb22f typo fixes 2018-01-30 14:48:35 +01:00
Gabor Kiss-Vamosi
1689a121e5 label draw bugfix: upscale offset with anti-aliasing 2018-01-30 14:48:35 +01:00
Gabor Kiss-Vamosi
120a694324 Update README.md 2018-01-29 12:32:14 +01:00
Gabor Kiss-Vamosi
90c67d8f64 Update TODO_PATCH.md 2018-01-26 10:03:57 +01:00
Gabor Kiss-Vamosi
a2db424eb1 Merge pull request #86 from upbeat27/tabview-spelling-fix
Tabview spelling fix
2018-01-26 10:03:44 +01:00
Gabor Kiss-Vamosi
bff582d5ed Merge pull request #85 from upbeat27/patch-1
Chart draw bug
2018-01-26 10:00:59 +01:00
Josh McAtee
8bc9868705 Fix spelling of "handler"
Correct instances of hadler -> handler
2018-01-25 13:14:10 -08:00
Josh McAtee
7b46bfa0d1 Merge remote-tracking branch 'upstream/beta' 2018-01-25 13:10:17 -08:00
upbeat27
2770752813 Fix incorrect storage size for loop counter
When drawing chart lines/points/columns, execution will stay in loop forever when point count > 255.
The loop counter i was set to uint8_t when it should be the same size as point_cnt, uint16_t.
2018-01-25 11:34:47 -08:00
Gabor Kiss-Vamosi
2d83b6edb2 Update TODO_MAJOR.md 2018-01-23 19:49:13 +01:00
Gabor Kiss-Vamosi
39e76b0e4f Update TODO_MAJOR.md 2018-01-23 19:46:23 +01:00
Gabor Kiss-Vamosi
e9805c98d5 Update TODO_MAJOR.md 2018-01-23 11:22:51 +01:00
Kiss-Vamosi Gabor
177af6cae7 start v5.0.3 beta 2018-01-21 12:45:35 +01:00
Kiss-Vamosi Gabor
cb1bbeaf3a fix utf-8 encoding with 4 byte long codes 2018-01-21 12:43:47 +01:00
Gabor Kiss-Vamosi
46a1a8dfde Update TODO_MINOR.md 2018-01-19 15:59:48 +01:00
Gabor Kiss-Vamosi
4b4ac7c706 Update TODO_PATCH.md 2018-01-19 15:57:28 +01:00
Gabor Kiss-Vamosi
ad0ad2c4e1 lv_color: set 0xFF as default alpha for 24 bit colors 2018-01-19 15:56:29 +01:00
Gabor Kiss-Vamosi
df2204d50f Merge branch 'beta' 2018-01-19 15:45:58 +01:00
Gabor Kiss-Vamosi
fa883a0220 Merge branch 'master' of https://github.com/littlevgl/lvgl 2018-01-19 15:41:37 +01:00
Gabor Kiss-Vamosi
436833f138 Release: v5.0.2 2018-01-19 15:41:05 +01:00
Gabor Kiss-Vamosi
4ecee47caa add dependecy check to some object types 2018-01-19 15:40:22 +01:00
Gabor Kiss-Vamosi
5db75661cf lv_conf_templ.h: use LV_FONT_ANTIALIAS by default instead of LV_ANTIALAIS 2018-01-19 15:21:51 +01:00
Gabor Kiss-Vamosi
64b5010b15 change 0b.. number to 0x... and add big endian support to LV_COLOR_MAKE 2018-01-19 15:19:13 +01:00
Gabor Kiss-Vamosi
0733018ba5 Update TODO_MINOR.md 2018-01-19 14:10:59 +01:00
Gabor Kiss-Vamosi
6f43efde23 Merge branch 'beta' of https://github.com/littlevgl/lvgl into beta 2018-01-19 13:28:28 +01:00
Gabor Kiss-Vamosi
fb75153d29 lv_list: group focus fixes 2018-01-19 13:28:14 +01:00
Gabor Kiss-Vamosi
339227877a Update TODO_PATCH.md 2018-01-18 11:54:11 +01:00
Gabor Kiss-Vamosi
7710b1df43 Update TODO_MINOR.md 2018-01-18 11:54:05 +01:00
Gabor Kiss-Vamosi
c0a8460575 Update TODO_PATCH.md 2018-01-18 11:44:00 +01:00
Gabor Kiss-Vamosi
7027c7486b Merge pull request #75 from Zaltora/warn_err_compiler
fix warning/error with lv_conf.h option
2018-01-18 11:18:14 +01:00
Gabor Kiss-Vamosi
a42b56c7c7 lv_roller: add missing action handling 2018-01-16 15:35:35 +01:00
Gabor Kiss-Vamosi
c331659026 fix compile issue with undefined LV_ATTRIBUTE_TICK_INC/TASK_HANDLER 2018-01-16 15:26:02 +01:00
Zaltora
01088f77ab dependencies fix 2018-01-16 13:16:48 +01:00
Zaltora
7d302574cc fix warning/error for Graphics feature usage 2018-01-16 11:54:35 +01:00
Zaltora
ee4a419019 fix warning with VDB and shadow selection 2018-01-16 10:44:24 +01:00
Gabor Kiss-Vamosi
1173b33715 Merge pull request #72 from Zaltora/tick_optimization
Specific compiler attribute for tick
2018-01-15 11:17:11 +01:00
Zaltora
0fe5a3ba5e fix typo 2018-01-15 11:13:16 +01:00
Zaltora
6c06bfbf41 miss include fix 2018-01-15 11:07:33 +01:00
Zaltora
6bab1d2840 add handle fn to attribute + reorganize 2018-01-15 11:03:50 +01:00
Zaltora
89044a8649 Add specific otion for tick function + inline it 2018-01-14 10:23:16 +01:00
Gabor Kiss-Vamosi
94e686ba44 lv_obj_get_style: with NULL style check if the parent is focused and use the focused style 2018-01-13 08:18:24 +01:00
Gabor Kiss-Vamosi
86110cf1de lv_roller: lv_roller_get_selected_str: bugfix 2018-01-10 09:43:19 +01:00
Gabor Kiss-Vamosi
9b664e2944 LV_INDEV_READ_PERIOD 0 build bugfix 2018-01-10 09:42:52 +01:00
Gabor Kiss-Vamosi
78ff568dfb Merge pull request #66 from iromero91/master
Add configuration options for whole row and column invalid areas
2018-01-09 20:32:14 +01:00
Jose I Romero
e1d2709431 Add configuration options for whole row and column invalid areas
Some displays like the Sharp memory LCDs require whole rows to be updated at
a time, LV_INV_FULL_ROW ensures that every screen flush is a whole number of
rows.

LV_INV_FULL_COL is provided too for convenience when rotating the screen 90
degrees, making all updates be whole columns instead. Enabling both flags will
make lvgl update the whole screen every time.
2018-01-09 12:38:52 -06:00
Gabor Kiss-Vamosi
47556f2290 lv_ufs_remove: check file existance 2018-01-08 09:48:27 +01:00
Gabor Kiss-Vamosi
531eb4b417 line width bugfox width anti-aliasing 2018-01-08 09:48:27 +01:00
Gabor Kiss-Vamosi
7f8b1e920a Update README.md 2018-01-08 09:48:27 +01:00
Gabor Kiss-Vamosi
2f084d204e Update README.md 2018-01-08 09:48:27 +01:00
Gabor Kiss-Vamosi
a93fedf945 Update README.md 2018-01-08 09:48:27 +01:00
Gabor Kiss-Vamosi
8fd88300ce Update README.md 2018-01-08 09:48:27 +01:00
Gabor Kiss-Vamosi
d3f0331e8e Update README.md 2018-01-08 09:48:27 +01:00
Gabor Kiss-Vamosi
9fb0da69cc Update README.md 2018-01-08 09:48:27 +01:00
Gabor Kiss-Vamosi
4675bf9ae8 Update README.md 2018-01-08 09:48:27 +01:00
Gabor Kiss-Vamosi
da631cd441 Update README.md 2018-01-08 09:48:27 +01:00
Gabor Kiss-Vamosi
fd40f53d2e Update README.md 2018-01-08 09:48:27 +01:00
Gabor Kiss-Vamosi
9f420af5e2 Update TODO_MINOR.md 2018-01-08 09:48:27 +01:00
Gabor Kiss-Vamosi
9ff4b0e5b2 Update TODO_MAJOR.md 2018-01-08 09:48:27 +01:00
Gabor Kiss-Vamosi
901cb1fab0 Update TODO_MAJOR.md 2018-01-08 09:48:27 +01:00
Gabor Kiss-Vamosi
809c93a19e update version 2018-01-05 13:52:43 +01:00
Gabor Kiss-Vamosi
62c307d6f2 lv_fs: lv_dir_open: bugifx (use rddir_size instead of file_fize) 2018-01-05 13:49:15 +01:00
Gabor Kiss-Vamosi
31488478c1 Merge pull request #60 from BenQoo/beta
lv_group: fix memory leak.
2018-01-04 09:13:03 +01:00
BenQoo
59fa14f989 lv_group: fix memory leak.
The items lack of memory deallocation
* `lv_group->obj_ll`
* `lv_group`
2018-01-04 14:54:37 +08:00
205 changed files with 146598 additions and 216029 deletions

View File

@@ -18,34 +18,32 @@ Homepage: https://littlevgl.com
## 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 etc
* 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 (80 kB Flash, 10 kB RAM)
* 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
* Advanced support and professional GUI development service
* Documentation and API references online
* Free and open-source under MIT licence
## 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
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 ()
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 the lvgl repository: `git clone https://github.com/littlevgl/lvgl.git`
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 *_conf.h files delete the first `#if 0` and its `#endif`. Let the default configurations at first.
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();
@@ -71,5 +69,4 @@ See [CONTRIBUTING.md](https://github.com/littlevgl/lvgl/blob/master/docs/CONTRIB
## 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:
[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GJV3SC5EHDANS)
[![Donate](https://littlevgl.com/donate_dir/donate_btn.png)](https://littlevgl.com/donate)

View File

@@ -1,72 +1,71 @@
# Contributing to Littlev Graphics Library
First of all thank you for reading these guide before contributing!
It's glad to see that you are interested in Contributing to LittlevGL!
In this guide you can read how can you help in developing the Littlev Graphic Library. If you have a constructive idea just create pull request on this document!
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-an-issue)
* [Simple issue](#simple-issue)
* [Complex issue](#complex-issue)
* [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)
* [File format](#file-format)
* [Functions](#functions)
* [Variables](#variables)
* [Defines](#defines)
* [Typedefs](#typedefs)
* [Comments](#comments)
* [Formatting](#formatting)
## 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 the development of the graphics library with:
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)
Continue reading to know how you can be part of the development! We are waiting for you!
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 an issue?
## 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
### Simple issue
If you find an issue which is very simple to fix, and you fixed it, please send a pull request against `beta` branch.
A simple issue could be:
* Misspelled names
* Comment: misspelling or grammatical error in comments
* Variable: misspelled variable name (e.g. ***ojb**_next* instead of ***obj**_next*)
* Define: only local defines in files because global defines affect API
* Function: only static function name because global functions affect API
* Not handled error case:
* A parameter can be NULL (during normal usage)
* Negative index in array or over indexing
* Overflow in variable
* Anything which is local an can be fixed with a few lines of code
then tell
* where you found the bug (which file/function/variable)
* how can it cause problem
* what is your suggeseted solution if you have
### Complex issue
If you find a complex issue which:
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
please create a **new issue** and describe
* what you experience
* how to reproduce the issue (maybe with example code)
* version you are using (lvgl.h)
* misc library version (misc.h)
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 you can use GitHub issues to suggest a new feature. Please note the followings on feature requests:
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?
After a discussion we figure out the specification of the new feature and the technical details/implementation possibilities.
With the knowledge of how to do it somebody can implement the new feature.
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)
@@ -79,55 +78,35 @@ The new feature should be in a new branch.
## Styling guide
### File format
Use [misc/templ/templ.c](https://github.com/littlevgl/misc/blob/master/templ/templ.c) and [misc/templ/templ.h](https://github.com/littlevgl/misc/blob/master/templ/templ.h)
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)
### Abbreviations
Please read this document to see the list of accepted abbreviations: [abbreviations-in-code](https://github.com/kisvegabor/abbreviations-in-code)
### 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
### Functions
* try to write function shorter then is 40 lines
* always shorter then 100 lines (except very straightforwards)
* in function names:
* words sparated by '_'
* only lower case letters
* only clear abbreviation (OK: *lv_xy_get_title_txt*, BAD: *lv_xy_get_ttxt*)
#### Global functions names (API)
An example: *lv_btn_set_state()*
* starts with *lv*
* followed by module name: *btn*, *label*, *style* etc.
* followed by the action: *set*, *get*, *refr* etc.
* closed with subject: *name*, *size*, *state* etc.
* optional like in *lv_obj_del()* it is missing
* could contain more words: *long_mode*, *point_all*
#### Static functions names
Names can be used freely.
### Variables
* words sparated by '_'
* always lower case
* 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)
### Defines
* always upper case
* starts with *LV_*
* followed by the modul: *OBJ*, *BTN* etc.
* closed by the subject: *ANIM_TIME*, *VALUE_MIN*, *WIDTH_DEF*
### Typedefs
- prefer `typedef struct` instead of `struct name`
- prefer `typedef enum` instead of `enum name`
- types always lowercase speperated by '_'
- first word for public typedefs is *lv_...*
- next word identifies the modul: *lv_obj_...*, *lv_btn_...*
- always add closing *..._t*
- Examples: *lv_obj_t*, *lv_cont_layout_t*
### 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:
@@ -152,7 +131,7 @@ You should write **why** have you done this:
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'*/`
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:
@@ -163,7 +142,7 @@ Here is example to show bracket placing and using of white spaces:
* @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 in new line*/
{ /* Main bracket of functions in new line*/
if(label == NULL) return; /*No bracket only if the command is inline with the if statement*/
@@ -172,14 +151,12 @@ void lv_label_set_text(lv_obj_t * label, const char * text)
lv_label_ext_t * ext = lv_obj_get_ext(label);
/*Comment before a section */
if(text == ext->txt || text == NULL) { /*Bracket start inline*/
if(text == ext->txt || text == NULL) { /*Bracket of statements start inline*/
lv_label_refr_text(label);
return;
}
.
.
.
...
}
```

View File

@@ -4,7 +4,16 @@ 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.
## v5 (released at: 20.12.2017)
## 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

View File

@@ -9,13 +9,47 @@ 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_form: new object type, form field with place holder text
- lv_listctrl: new object type, a list various controls on th right (sw, cb erc.)
- lv_inlist: new ibject type, inline drop down list (different open/closed style)
- anim. paths: monentum (tnh(x)), curve (exp), shake
- hover, hover_lost signals
- 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.0 (released at: 20.12.2017)
## 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)
@@ -26,7 +60,7 @@ Here are ideas which are not assigned to a minor version yet:
- [x] add themes with predefined styles
- [x] partial border draw in styles
## v4.2 (released at: 17.08.2017)
## 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

View File

@@ -1,22 +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.
Bugfixes are done in `bugfix` branche.
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
## Next release
## 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)
- [ ] lv_img: define *lv_img_raw_header* in *lv_draw.h* because now lv_img can't be disabled
- [ ] lv_list: ignore image related things when *lv_img* is not enebled
- [ ] lv_ta: fix hegiht if *one_line* and *FONT_ANTIALIAS*
- [ ] lv_obj_set_style: fix to update self style too (not only children)
- [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 at: 17.08.2017)
## 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()*

View File

@@ -11,13 +11,12 @@
/*----------------
* Dynamic memory
*----------------*/
/*
* Memory size which will be used by the library
* to store the graphical objects and other data
*/
/* 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 mem_alloc (in bytes)*/
#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*/
@@ -28,37 +27,28 @@
/*===================
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 internal graphics buffer (required for buffered drawing)
* VDB means Virtual Display Buffer (the internal graphics buffer)
* Set to 0 for unbuffered drawing
* Set to >= LV_HOR_RES for buffered drawing if LV_ANTIALIAS = 0
* Set to >= 2 * LV_HOR_RES for buffered drawing if LV_ANTIALIAS = 1
* More info: https://littlevgl.com/basics#drawing-and-rendering*/
#define LV_VDB_SIZE (20 * 1024) /*Size of VDB in pixel count*/
#define LV_VDB_ADR 0 /*Place VDB to a specific address (e.g. in external RAM) (0: allocate automatically into RAM)*/
/* 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
* If enabled everything will be rendered in double size and filtered to normal size.
* Fonts and Images will be downscaled */
/* Enable anti-aliasing (lines, and radiuses will be smoothed) */
#define LV_ANTIALIAS 1 /*1: Enable anti-aliasing*/
/* Enable anti-aliasing only for fonts (texts)
* It downscales the fonts to half size so you should use double sized fonts
* Much faster then normal anti-aliasing */
#define LV_FONT_ANTIALIAS 0 /*1: Enable font 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 */
@@ -69,7 +59,7 @@
/*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*/
#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*/
@@ -77,7 +67,7 @@
/*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 (chroma keying)*/
#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 */
@@ -88,8 +78,14 @@
#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
*================*/
@@ -104,62 +100,31 @@
/*==================
* FONT USAGE
*===================*/
/*More info about fonts: https://littlevgl.com/basics#fonts*/
#define LV_FONT_DEFAULT &lv_font_dejavu_40 /*Always set a default font from the built-in fonts*/
/* 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_SUP 0
#define USE_LV_FONT_DEJAVU_10_LATIN_EXT_A 0
#define USE_LV_FONT_DEJAVU_10_LATIN_EXT_B 0
#define USE_LV_FONT_DEJAVU_10_LATIN_SUP 0
#define USE_LV_FONT_DEJAVU_10_CYRILLIC 0
#define USE_LV_FONT_SYMBOL_10_BASIC 0
#define USE_LV_FONT_SYMBOL_10_FILE 0
#define USE_LV_FONT_SYMBOL_10_FEEDBACK 0
#define USE_LV_FONT_SYMBOL_10 0
#define USE_LV_FONT_DEJAVU_20 0
#define USE_LV_FONT_DEJAVU_20_SUP 0
#define USE_LV_FONT_DEJAVU_20_LATIN_EXT_A 0
#define USE_LV_FONT_DEJAVU_20_LATIN_EXT_B 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_BASIC 0
#define USE_LV_FONT_SYMBOL_20_FILE 0
#define USE_LV_FONT_SYMBOL_20_FEEDBACK 0
#define USE_LV_FONT_SYMBOL_20 4
#define USE_LV_FONT_DEJAVU_30 0
#define USE_LV_FONT_DEJAVU_30_SUP 0
#define USE_LV_FONT_DEJAVU_30_LATIN_EXT_A 0
#define USE_LV_FONT_DEJAVU_30_LATIN_EXT_B 0
#define USE_LV_FONT_DEJAVU_30_LATIN_SUP 0
#define USE_LV_FONT_DEJAVU_30_CYRILLIC 0
#define USE_LV_FONT_SYMBOL_30_BASIC 0
#define USE_LV_FONT_SYMBOL_30_FILE 0
#define USE_LV_FONT_SYMBOL_30_FEEDBACK 0
#define USE_LV_FONT_SYMBOL_30 0
#define USE_LV_FONT_DEJAVU_40 1
#define USE_LV_FONT_DEJAVU_40_SUP 1
#define USE_LV_FONT_DEJAVU_40_LATIN_EXT_A 1
#define USE_LV_FONT_DEJAVU_40_LATIN_EXT_B 1
#define USE_LV_FONT_DEJAVU_40_CYRILLIC 1
#define USE_LV_FONT_SYMBOL_40_BASIC 1
#define USE_LV_FONT_SYMBOL_40_FILE 1
#define USE_LV_FONT_SYMBOL_40_FEEDBACK 1
#define USE_LV_FONT_DEJAVU_60 0
#define USE_LV_FONT_DEJAVU_60_SUP 0
#define USE_LV_FONT_DEJAVU_60_LATIN_EXT_A 0
#define USE_LV_FONT_DEJAVU_60_LATIN_EXT_B 0
#define USE_LV_FONT_DEJAVU_60_CYRILLIC 0
#define USE_LV_FONT_SYMBOL_60_BASIC 0
#define USE_LV_FONT_SYMBOL_60_FILE 0
#define USE_LV_FONT_SYMBOL_60_FEEDBACK 0
#define USE_LV_FONT_DEJAVU_80 0
#define USE_LV_FONT_DEJAVU_80_SUP 0
#define USE_LV_FONT_DEJAVU_80_LATIN_EXT_A 0
#define USE_LV_FONT_DEJAVU_80_LATIN_EXT_B 0
#define USE_LV_FONT_DEJAVU_80_CYRILLIC 0
#define USE_LV_FONT_SYMBOL_80_BASIC 0
#define USE_LV_FONT_SYMBOL_80_FILE 0
#define USE_LV_FONT_SYMBOL_80_FEEDBACK 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
@@ -181,7 +146,7 @@
/*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*/
#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*/
@@ -278,7 +243,15 @@
/*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*/

View File

@@ -47,10 +47,33 @@ lv_group_t * lv_group_create(void)
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
@@ -78,20 +101,19 @@ 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;
break;
}
}
if(*g->obj_focus == obj) {
g->obj_focus = NULL;
lv_group_focus_next(g);
}
}
/**
@@ -106,7 +128,6 @@ void lv_group_focus_obj(lv_obj_t * obj)
if(g->frozen != 0) return;
lv_obj_t ** i;
LL_READ(g->obj_ll, i) {
if(*i == obj) {
if(g->obj_focus != NULL) {
@@ -148,6 +169,8 @@ void lv_group_focus_next(lv_group_t * group)
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);
}
}
@@ -174,6 +197,8 @@ void lv_group_focus_prev(lv_group_t * group)
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);
}
}
@@ -202,18 +227,28 @@ void lv_group_send_data(lv_group_t * group, uint32_t c)
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_cb the style modifier function pointer
* @param style_mod_func the style modifier function pointer
*/
void lv_group_set_style_mod_cb(lv_group_t * group, void (*style_cb)(lv_style_t * style))
void lv_group_set_style_mod_cb(lv_group_t * group,lv_group_style_mod_func_t style_mod_func)
{
group->style_mod = style_cb;
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
@@ -243,6 +278,26 @@ lv_obj_t * lv_group_get_focused(lv_group_t * group)
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
**********************/
@@ -253,6 +308,7 @@ lv_obj_t * lv_group_get_focused(lv_group_t * group)
*/
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;
@@ -265,6 +321,13 @@ static void style_mod_def(lv_style_t * style)
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*/

View File

@@ -25,22 +25,30 @@ extern "C" {
#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 33 /*0x1B*/
#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;
lv_obj_t ** obj_focus;
void (*style_mod)(lv_style_t * style);
lv_style_t style_tmp;
uint8_t frozen:1;
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;
/**********************
@@ -53,6 +61,12 @@ typedef struct _lv_group_t
*/
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
@@ -98,13 +112,19 @@ void lv_group_focus_freeze(lv_group_t * group, bool en);
*/
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_cb the style modifier function pointer
* @param style_mod_func the style modifier function pointer
*/
void lv_group_set_style_mod_cb(lv_group_t * group, void (*style_cb)(lv_style_t * style));
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.
@@ -121,6 +141,20 @@ lv_style_t * lv_group_mod_style(lv_group_t * group, const lv_style_t * style);
*/
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
**********************/

View File

@@ -11,6 +11,7 @@
#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"
@@ -27,18 +28,23 @@
/**********************
* STATIC PROTOTYPES
**********************/
#if LV_INDEV_READ_PERIOD != 0
static void indev_proc_task(void * param);
static void indev_proc_point(lv_indev_proc_t * indev);
static void indev_proc_press(lv_indev_proc_t * info);
static void indev_proc_release(lv_indev_proc_t * state);
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_task_t *indev_proc_task_p;
static lv_indev_t *indev_act;
/**********************
@@ -55,9 +61,7 @@ static lv_indev_t *indev_act;
void lv_indev_init(void)
{
#if LV_INDEV_READ_PERIOD != 0
indev_proc_task_p = lv_task_create(indev_proc_task, LV_INDEV_READ_PERIOD, LV_TASK_PRIO_MID, NULL);
#else
indev_proc_task_p = lv_task_create(indev_proc_task, 1, LV_TASK_PRIO_OFF); /*Not use lv_indev_proc*/
lv_task_create(indev_proc_task, LV_INDEV_READ_PERIOD, LV_TASK_PRIO_MID, NULL);
#endif
lv_indev_reset(NULL); /*Reset all input devices*/
@@ -115,13 +119,13 @@ void lv_indev_enable(lv_hal_indev_type_t type, bool enable)
}
/**
* Set a cursor for a pointer input device
* @param indev pointer to an input device (type: 'LV_INDEV_TYPE_POINTER')
* 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) return;
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());
@@ -130,47 +134,69 @@ 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
* @param indev pointer to an input device (type: 'LV_INDEV_TYPE_KEYPAD')
* 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)
{
indev->group = group;
if(indev->driver.type == LV_INDEV_TYPE_KEYPAD) indev->group = group;
}
#endif
/**
* Get the last point of an input device
* 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)
{
point->x = indev->proc.act_point.x;
point->y = indev->proc.act_point.y;
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
* 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
* 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)
{
point->x = indev->proc.vect.x;
point->y = indev->proc.vect.y;
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;
}
}
/**
@@ -208,6 +234,7 @@ void lv_indev_wait_release(lv_indev_t * indev)
* STATIC FUNCTIONS
**********************/
#if LV_INDEV_READ_PERIOD != 0
/**
* Called periodically to handle the input devices
* @param param unused
@@ -225,157 +252,209 @@ static void indev_proc_task(void * param)
indev_act = i;
/*Handle reset query before processing the point*/
if(i->proc.reset_query) {
i->proc.act_obj = NULL;
i->proc.last_obj = NULL;
i->proc.drag_range_out = 0;
i->proc.drag_in_prog = 0;
i->proc.long_pr_sent = 0;
i->proc.pr_timestamp = 0;
i->proc.longpr_rep_timestamp = 0;
i->proc.drag_sum.x = 0;
i->proc.drag_sum.y = 0;
i->proc.reset_query = 0;
}
indev_proc_reset_query_handler(i);
if(i->proc.disabled == 0) {
/*Read the data*/
lv_indev_read(i, &data);
i->proc.state = data.state;
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();
}
/*Move the cursor if set and moved*/
if(i->driver.type == LV_INDEV_TYPE_POINTER &&
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);
}
if(i->driver.type == LV_INDEV_TYPE_POINTER)
{
i->proc.act_point.x = data.point.x;
i->proc.act_point.y = data.point.y;;
/*Process the current point*/
indev_proc_point(&i->proc);
}
else if (i->driver.type == LV_INDEV_TYPE_KEYPAD) {
#if USE_LV_GROUP
if(i->group != NULL && data.key != 0 &&
data.state == LV_INDEV_STATE_PR && i->proc.last_state == LV_INDEV_STATE_REL)
{
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);
}
if(i->proc.state == LV_INDEV_STATE_PR) {
i->last_activity_time = lv_tick_get();
}
i->proc.last_state = data.state;
#endif
}
}
/*Handle reset query if it happened in during processing*/
if(i->proc.reset_query) {
i->proc.act_obj = NULL;
i->proc.last_obj = NULL;
i->proc.drag_range_out = 0;
i->proc.drag_in_prog = 0;
i->proc.long_pr_sent = 0;
i->proc.pr_timestamp = 0;
i->proc.longpr_rep_timestamp = 0;
i->proc.drag_sum.x = 0;
i->proc.drag_sum.y = 0;
i->proc.reset_query = 0;
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_proc_point(lv_indev_proc_t * indev)
static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data)
{
if(indev->state == LV_INDEV_STATE_PR){
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 = indev->act_point.x - (LV_INDEV_POINT_MARKER >> 1);
area.y1 = indev->act_point.y - (LV_INDEV_POINT_MARKER >> 1);
area.x2 = indev->act_point.x + ((LV_INDEV_POINT_MARKER >> 1) | 0x1);
area.y2 = indev->act_point.y + ((LV_INDEV_POINT_MARKER >> 1) | 0x1);
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(indev);
indev_proc_press(&i->proc);
} else {
indev_proc_release(indev);
/*If a new point comes always make a release*/
indev_proc_release(&i->proc);
}
indev->last_point.x = indev->act_point.x;
indev->last_point.y = indev->act_point.y;
}
i->proc.last_point.x = i->proc.act_point.x;
i->proc.last_point.y = i->proc.act_point.y;
}
/**
* Process the pressed state
* @param indev pointer to an input device state
* 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 * info)
static void indev_proc_press(lv_indev_proc_t * proc)
{
lv_obj_t * pr_obj = info->act_obj;
lv_obj_t * pr_obj = proc->act_obj;
if(info->wait_unil_release != 0) return;
if(proc->wait_unil_release != 0) return;
/*If there is no last object then search*/
if(info->act_obj == NULL) {
pr_obj = indev_search_obj(info, lv_layer_top());
if(pr_obj == NULL) pr_obj = indev_search_obj(info, lv_scr_act());
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 also search*/
else if(info->drag_in_prog == 0) {/*Now act_obj != NULL*/
pr_obj = indev_search_obj(info, lv_layer_top());
if(pr_obj == NULL) pr_obj = indev_search_obj(info, 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 object was the last then keep it*/
/*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 != info->act_obj) {
if(pr_obj != proc->act_obj) {
info->last_point.x = info->act_point.x;
info->last_point.y = info->act_point.y;
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(info->act_obj != NULL) {
info->act_obj->signal_func(info->act_obj, LV_SIGNAL_PRESS_LOST, indev_act);
if(info->reset_query != 0) return;
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.*/
info->pr_timestamp = lv_tick_get();
info->long_pr_sent = 0;
info->drag_range_out = 0;
info->drag_in_prog = 0;
info->drag_sum.x = 0;
info->drag_sum.y = 0;
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;
@@ -395,46 +474,46 @@ static void indev_proc_press(lv_indev_proc_t * info)
/*Send a signal about the press*/
pr_obj->signal_func(pr_obj, LV_SIGNAL_PRESSED, indev_act);
if(info->reset_query != 0) return;
if(proc->reset_query != 0) return;
}
}
info->act_obj = pr_obj; /*Save the pressed object*/
info->last_obj = info->act_obj; /*Refresh the last_obj*/
proc->act_obj = pr_obj; /*Save the pressed object*/
proc->last_obj = proc->act_obj; /*Refresh the last_obj*/
/*Calculate the vector*/
info->vect.x = info->act_point.x - info->last_point.x;
info->vect.y = info->act_point.y - info->last_point.y;
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(info->act_obj != NULL) {
info->act_obj->signal_func(info->act_obj, LV_SIGNAL_PRESSING, indev_act);
if(info->reset_query != 0) return;
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(info);
if(info->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(info->drag_in_prog == 0 && info->long_pr_sent == 0) {
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(info->pr_timestamp) > LV_INDEV_LONG_PRESS_TIME) {
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(info->reset_query != 0) return;
if(proc->reset_query != 0) return;
/*Mark the signal sending to do not send it again*/
info->long_pr_sent = 1;
proc->long_pr_sent = 1;
/*Save the long press time stamp for the long press repeat handler*/
info->longpr_rep_timestamp = lv_tick_get();
proc->longpr_rep_timestamp = lv_tick_get();
}
}
/*Send long press repeated signal*/
if(info->drag_in_prog == 0 && info->long_pr_sent == 1) {
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(info->longpr_rep_timestamp) > LV_INDEV_LONG_PRESS_REP_TIME) {
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(info->reset_query != 0) return;
info->longpr_rep_timestamp = lv_tick_get();
if(proc->reset_query != 0) return;
proc->longpr_rep_timestamp = lv_tick_get();
}
}
@@ -442,36 +521,58 @@ static void indev_proc_press(lv_indev_proc_t * info)
}
/**
* Process the released state
* @param indev_proc_p pointer to an input device state
* 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 * state)
static void indev_proc_release(lv_indev_proc_t * proc)
{
if(state->wait_unil_release != 0) {
state->act_obj = NULL;
state->last_obj = NULL;
state->pr_timestamp = 0;
state->longpr_rep_timestamp = 0;
state->wait_unil_release = 0;
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(state->act_obj != NULL) {
state->act_obj->signal_func(state->act_obj, LV_SIGNAL_RELEASED, indev_act);
if(state->reset_query != 0) return;
state->act_obj = NULL;
state->pr_timestamp = 0;
state->longpr_rep_timestamp = 0;
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(state->last_obj != NULL && state->reset_query == 0) {
indev_drag_throw(state);
if(state->reset_query != 0) return;
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
@@ -549,21 +650,30 @@ static void indev_drag(lv_indev_proc_t * state)
/*Set new position if the vector is not zero*/
if(state->vect.x != 0 ||
state->vect.y != 0) {
/*Get the coordinates of the object end modify them*/
/*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(lv_obj_get_x(drag_obj) != act_x || lv_obj_get_y(drag_obj) != act_y) {
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);
}
}
}
}
@@ -622,3 +732,4 @@ static void indev_drag_throw(lv_indev_proc_t * state)
drag_obj->signal_func(drag_obj, LV_SIGNAL_DRAG_END, indev_act);
}
}
#endif

View File

@@ -60,40 +60,49 @@ void lv_indev_reset_lpr(lv_indev_t * indev);
void lv_indev_enable(lv_hal_indev_type_t type, bool enable);
/**
* Set a cursor for a pointer input device
* @param indev pointer to an input device (type: 'LV_INDEV_TYPE_POINTER')
* 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
* @param indev pointer to an input device (type: 'LV_INDEV_TYPE_KEYPAD')
* 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
/**
* Get the last point of an input device
* 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
* 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
* 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)

View File

@@ -284,20 +284,17 @@ lv_res_t lv_obj_del(lv_obj_t * obj)
lv_anim_del(obj, NULL);
#endif
/*Delete from the group*/
#if USE_LV_GROUP
if(obj->group_p != NULL) lv_group_remove_obj(obj);
#endif
/* Reset all input devices if
* the currently pressed object is deleted*/
lv_indev_t * indev = lv_indev_next(NULL);
lv_obj_t * dpar;
while(indev) {
dpar = obj;
while(dpar != NULL) {
if(indev->proc.act_obj == dpar ||
indev->proc.last_obj == dpar) {
lv_indev_reset(indev);
break;
} else {
dpar = lv_obj_get_parent(dpar);
}
if(indev->proc.act_obj == obj || indev->proc.last_obj == obj) {
lv_indev_reset(indev);
}
indev = lv_indev_next(indev);
}
@@ -346,11 +343,14 @@ void lv_obj_clean(lv_obj_t *obj)
*/
void lv_obj_invalidate(lv_obj_t * obj)
{
if(lv_obj_get_hidden(obj)) return;
/*Invalidate the object only if it belongs to the 'act_scr'*/
lv_obj_t * obj_scr = lv_obj_get_screen(obj);
if(obj_scr == lv_scr_act() ||
obj_scr == lv_layer_top() ||
obj_scr == lv_layer_sys()) {
obj_scr == lv_layer_sys())
{
/*Truncate recursively to the parents*/
lv_area_t area_trunc;
lv_obj_t * par = lv_obj_get_parent(obj);
@@ -366,7 +366,8 @@ void lv_obj_invalidate(lv_obj_t * obj)
/*Check through all parents*/
while(par != NULL) {
union_ok = lv_area_union(&area_trunc, &area_trunc, &par->coords);
if(union_ok == false) break; /*If no common parts with parent break;*/
if(union_ok == false) break; /*If no common parts with parent break;*/
if(lv_obj_get_hidden(par)) return; /*If the parent is hidden then the child is hidden and won't be drawn*/
par = lv_obj_get_parent(par);
}
@@ -753,12 +754,15 @@ void lv_obj_report_style_mod(lv_style_t * style)
*/
void lv_obj_set_hidden(lv_obj_t * obj, bool en)
{
if(!obj->hidden) lv_obj_invalidate(obj); /*Invalidate when not hidden (hidden objects are ignored) */
obj->hidden = en == false ? 0 : 1;
if(!obj->hidden) lv_obj_invalidate(obj); /*Invalidate when not hidden (hidden objects are ignored) */
lv_obj_t * par = lv_obj_get_parent(obj);
par->signal_func(par, LV_SIGNAL_CHILD_CHG, obj);
lv_obj_invalidate(obj);
}
/**
@@ -789,6 +793,7 @@ void lv_obj_set_top(lv_obj_t * obj, bool en)
*/
void lv_obj_set_drag(lv_obj_t * obj, bool en)
{
if(en == true) lv_obj_set_click(obj, true); /*Drag is useless without enabled clicking*/
obj->drag = (en == true ? 1 : 0);
}
@@ -1202,7 +1207,17 @@ lv_style_t * lv_obj_get_style(lv_obj_t * obj)
while(par) {
if(par->style_p) {
if(par->style_p->glass == 0) {
#if USE_LV_GROUP == 0
style_act = par->style_p;
#else
/*Is a parent is focused then use then focused style*/
lv_group_t *g = lv_obj_get_group(par);
if(lv_group_get_focused(g) == par) {
style_act = lv_group_mod_style(g, par->style_p);
} else {
style_act = par->style_p;
}
#endif
break;
}
}
@@ -1342,6 +1357,34 @@ void * lv_obj_get_ext_attr(lv_obj_t * obj)
return obj->ext_attr;
}
/**
* 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)
{
lv_obj_type_t tmp;
memset(buf, 0, sizeof(lv_obj_type_t));
memset(&tmp, 0, sizeof(lv_obj_type_t));
obj->signal_func(obj, LV_SIGNAL_GET_TYPE, &tmp);
uint8_t cnt;
for(cnt = 0; cnt < LV_MAX_ANCESTOR_NUM; cnt++) {
if(tmp.type[cnt] == NULL) break;
}
/*Swap the order. The real type comes first*/
uint8_t i;
for(i = 0; i < cnt; i++) {
buf->type[i] = tmp.type[cnt - 1 - i];
}
}
#ifdef LV_OBJ_FREE_NUM_TYPE
/**
* Get the free number
@@ -1366,6 +1409,7 @@ void * lv_obj_get_free_ptr(lv_obj_t * obj)
}
#endif
#if USE_LV_GROUP
/**
* Get the group of the object
@@ -1440,19 +1484,19 @@ static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param)
lv_res_t res = LV_RES_OK;
lv_style_t * style = lv_obj_get_style(obj);
switch(sign) {
case LV_SIGNAL_CHILD_CHG:
/*Return 'invalid' if the child change signal is not enabled*/
if(lv_obj_is_protected(obj, LV_PROTECT_CHILD_CHG) != false) res = LV_RES_INV;
break;
case LV_SIGNAL_REFR_EXT_SIZE:
if(style->body.shadow.width > obj->ext_size) obj->ext_size = style->body.shadow.width;
break;
case LV_SIGNAL_STYLE_CHG:
lv_obj_refresh_ext_size(obj);
break;
default:
break;
if(sign == LV_SIGNAL_CHILD_CHG) {
/*Return 'invalid' if the child change signal is not enabled*/
if(lv_obj_is_protected(obj, LV_PROTECT_CHILD_CHG) != false) res = LV_RES_INV;
}
else if(sign == LV_SIGNAL_REFR_EXT_SIZE) {
if(style->body.shadow.width > obj->ext_size) obj->ext_size = style->body.shadow.width;
}
else if(sign == LV_SIGNAL_STYLE_CHG) {
lv_obj_refresh_ext_size(obj);
}
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
buf->type[0] = "lv_obj";
}
return res;
@@ -1546,6 +1590,16 @@ static void delete_children(lv_obj_t * obj)
if(obj->group_p != NULL) lv_group_remove_obj(obj);
#endif
/* Reset the input devices if
* the currently pressed object is deleted*/
lv_indev_t * indev = lv_indev_next(NULL);
while(indev) {
if(indev->proc.act_obj == obj || indev->proc.last_obj == obj) {
lv_indev_reset(indev);
}
indev = lv_indev_next(indev);
}
/*Remove the object from parent's children list*/
lv_obj_t * par = lv_obj_get_parent(obj);
lv_ll_rem(&(par->child_ll), obj);

View File

@@ -28,29 +28,31 @@ extern "C" {
/*Error check of lv_conf.h*/
#if LV_HOR_RES == 0 || LV_VER_RES == 0
#error "LV: LV_HOR_RES and LV_VER_RES must be greater then 0"
#error "LittlevGL: LV_HOR_RES and LV_VER_RES must be greater then 0"
#endif
#if LV_ANTIALIAS != 0 && LV_ANTIALIAS != 1
#error "LV: LV_ATIALIAS can be only 0 or 1"
#if LV_ANTIALIAS > 1
#error "LittlevGL: LV_ANTIALIAS can be only 0 or 1"
#endif
#if LV_VDB_SIZE == 0 && LV_ANTIALIAS != 0
#error "LV: If LV_VDB_SIZE == 0 the antialaissing must be disabled"
#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 && LV_ANTIALIAS == 0
#error "LV: Small Virtual Display Buffer (lv_conf.h: LV_VDB_SIZE >= LV_HOR_RES)"
#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 && LV_VDB_SIZE < 2 *LV_HOR_RES && LV_ANTIALIAS != 0
#error "LV: Small Virtual Display Buffer (lv_conf.h: LV_VDB_SIZE >= (2 * LV_HOR_RES))"
#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
**********************/
@@ -80,6 +82,7 @@ typedef enum
LV_SIGNAL_CORD_CHG,
LV_SIGNAL_STYLE_CHG,
LV_SIGNAL_REFR_EXT_SIZE,
LV_SIGNAL_GET_TYPE,
/*Input device related*/
LV_SIGNAL_PRESSED,
@@ -116,8 +119,9 @@ typedef struct _lv_obj_t
void * free_ptr; /*Application specific pointer (set it freely)*/
#endif
void * group_p; /*Pointer to the group of the object*/
#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*/
@@ -146,8 +150,15 @@ typedef enum
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,
@@ -225,7 +236,6 @@ void lv_obj_clean(lv_obj_t *obj);
*/
void lv_obj_invalidate(lv_obj_t * obj);
/*=====================
* Setter functions
*====================*/
@@ -419,7 +429,7 @@ void lv_obj_set_design_func(lv_obj_t * obj, lv_design_func_t fp);
* 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 Normal pointer to the allocated ext
* @return pointer to the allocated ext
*/
void * lv_obj_allocate_ext_attr(lv_obj_t * obj, uint16_t ext_size);
@@ -675,6 +685,14 @@ lv_design_func_t lv_obj_get_design_func(lv_obj_t * obj);
*/
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

View File

@@ -48,7 +48,8 @@ static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_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);
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;
/**********************
@@ -69,7 +70,7 @@ void lv_refr_init(void)
lv_task_t* task;
task = lv_task_create(lv_refr_task, LV_REFR_PERIOD, LV_TASK_PRIO_MID, NULL);
lv_mem_assert(task);
lv_task_ready(task); /*Be sure the screen will be refreshed immediately on start up*/
}
/**
@@ -96,15 +97,8 @@ void lv_inv_area(const lv_area_t * area_p)
suc = lv_area_union(&com_area, area_p, &scr_area);
/*The area is truncated to the screen*/
if(suc != false)
{
#if LV_ANTIALIAS == 1
/*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;
@@ -112,7 +106,6 @@ void lv_inv_area(const lv_area_t * area_p)
if(lv_area_is_in(&com_area, &inv_buf[i].area) != false) return;
}
/*Save the area*/
if(inv_buf_p < LV_INV_FIFO_SIZE) {
lv_area_copy(&inv_buf[inv_buf_p].area,&com_area);
@@ -136,6 +129,35 @@ 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
**********************/
@@ -262,10 +284,8 @@ static void lv_refr_area_with_vdb(const lv_area_t * 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;
uint32_t max_row = (uint32_t) LV_VDB_SIZE / (w << LV_AA);
if(max_row > (h << LV_AA)) max_row = (h << LV_AA);
max_row = max_row >> LV_AA ;
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;
@@ -312,13 +332,6 @@ static void lv_refr_area_part_vdb(const lv_area_t * area_p)
lv_area_t start_mask;
lv_area_union(&start_mask, area_p, &vdb_p->area);
#if LV_ANTIALIAS
vdb_p->area.x1 = vdb_p->area.x1 << LV_AA;
vdb_p->area.x2 = (vdb_p->area.x2 << LV_AA) + 1;
vdb_p->area.y1 = (vdb_p->area.y1 << LV_AA);
vdb_p->area.y2 = (vdb_p->area.y2 << LV_AA) + 1;
#endif
/*Get the most top object which is not covered by others*/
top_p = lv_refr_get_top_obj(&start_mask, lv_scr_act());

View File

@@ -58,6 +58,24 @@ void lv_inv_area(const lv_area_t * area_p);
*/
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
**********************/

View File

@@ -272,8 +272,11 @@ static void style_animator(lv_style_anim_dsc_t * dsc, int32_t 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;

View File

@@ -23,7 +23,6 @@ extern "C" {
* DEFINES
*********************/
#define LV_RADIUS_CIRCLE (LV_COORD_MAX) /*A very big radius to always draw as circle*/
#define LV_AA LV_ANTIALIAS /*Just a shorter form of LV_ANTIALIAS*/
/**********************
* TYPEDEFS

View File

@@ -119,59 +119,9 @@ void lv_vdb_flush(void)
if(vdb_state[1] == LV_VDB_STATE_ACTIVE) vdb_state[1] = LV_VDB_STATE_FLUSH;
#endif
#if LV_ANTIALIAS == 0
/*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);
#else
/* Get the average of 2x2 pixels and put the result back to the VDB
* The reading goes much faster then the write back
* so useful data won't be overwritten
* Example:
* -----------------------------
* in1_buf |2,2|6,8| 3,7
* in2_buf |4,4|7,7| 1,2
* --------- ==>
* in1_buf |1,1|1,3|
* in2_buf |1,1|1,3|
* */
lv_coord_t x;
lv_coord_t y;
lv_coord_t w = lv_area_get_width(&vdb_act->area);
lv_color_t * in1_buf = vdb_act->buf; /*Pointer to the first row*/
lv_color_t * in2_buf = vdb_act->buf + w; /*Pointer to the second row*/
lv_color_t * out_buf = vdb_act->buf; /*Store the result here*/
for(y = vdb_act->area.y1; y < vdb_act->area.y2; y += 2) {
for(x = vdb_act->area.x1; x < vdb_act->area.x2; x += 2) {
/*If the pixels are the same do not calculate the average */
if(in1_buf->full == (in1_buf + 1)->full &&
in1_buf->full == in2_buf->full &&
in1_buf->full == (in2_buf + 1)->full) {
out_buf->full = in1_buf->full;
} else {
/*Get the average of 2x2 red*/
out_buf->red = (in1_buf->red + (in1_buf + 1)->red +
in2_buf->red + (in2_buf+ 1)->red) >> 2;
/*Get the average of 2x2 green*/
out_buf->green = (in1_buf->green + (in1_buf + 1)->green +
in2_buf->green + (in2_buf + 1)->green) >> 2;
/*Get the average of 2x2 blue*/
out_buf->blue = (in1_buf->blue + (in1_buf + 1)->blue +
in2_buf->blue + (in2_buf + 1)->blue) >> 2;
}
in1_buf += 2; /*Skip the next pixel because it is already used above*/
in2_buf += 2;
out_buf ++;
}
/*2 row is ready so go the next 2*/
in1_buf += w; /*Skip the next row because it is processed from in2_buf*/
in2_buf += w;
}
/* Now the full the VDB is filtered and the result is stored in the first quarter of it
* Write out the filtered map to the display*/
lv_disp_flush(vdb_act->area.x1 >> 1, vdb_act->area.y1 >> 1, vdb_act->area.x2 >> 1, vdb_act->area.y2 >> 1, vdb_act->buf);
#endif
}
/**

File diff suppressed because it is too large Load Diff

View File

@@ -19,6 +19,14 @@ extern "C" {
/*********************
* 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
@@ -28,12 +36,39 @@ extern "C" {
* the result image converter utility*/
typedef struct
{
uint32_t w:12; /*Width of the image map*/
uint32_t h:12; /*Height of the image map*/
uint32_t transp:1; /*1: The image contains transparent pixels with LV_COLOR_TRANSP color*/
uint32_t cd:3; /*Color depth (0: reserved, 1: 8 bit, 2: 16 bit or 3: 24 bit, 4-7: reserved)*/
uint32_t res :4; /*Reserved*/
}lv_img_raw_header_t;
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
@@ -79,8 +114,8 @@ void lv_draw_label(const lv_area_t * cords_p,const lv_area_t * mask_p, const lv_
* @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 * cords_p, const lv_area_t * mask_p,
const lv_style_t * style_p, const char * fn);
void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask,
const lv_style_t * style, const void * src);
#endif
/**

View File

@@ -6,10 +6,12 @@
/*********************
* INCLUDES
*********************/
#include "../lv_hal/lv_hal_disp.h"
#include "lv_draw_rbasic.h"
#include "../../lv_conf.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
@@ -26,6 +28,7 @@
/**********************
* STATIC VARIABLES
**********************/
static lv_color_t letter_bg_color;
/**********************
* MACROS
@@ -76,7 +79,7 @@ void lv_rfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
union_ok = lv_area_union(&masked_area, cords_p, mask_p);
} else {
lv_area_t scr_area;
lv_area_set(&scr_area, 0, 0, LV_HOR_RES - 1, LV_HOR_RES - 1);
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);
}
@@ -100,96 +103,109 @@ void lv_rletter(const lv_point_t * pos_p, const lv_area_t * mask_p,
{
(void)opa; /*Opa is used only for compatibility with lv_vletter*/
uint8_t w = lv_font_get_width(font_p, letter);
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(letter == 'C') {
letter = 'C';
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 * bitmap_p = lv_font_get_bitmap(font_p, letter);
const uint8_t * map_p = lv_font_get_bitmap(font_p, letter);
uint8_t col, col_sub, row;
#if LV_FONT_ANTIALIAS == 0
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, opa);
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 ++;
}
}
/*Go to the next row*/
if(col_sub != 7) bitmap_p ++; /*Go to the next byte if it not done in the last step*/
map_p += (width_byte_bpp) - col_byte_cnt;
}
#else
uint8_t width_byte = w >> 3; /*Width in bytes (e.g. w = 11 -> 2 bytes wide)*/
if(w & 0x7) width_byte++;
const uint8_t * map1_p = bitmap_p;
const uint8_t * map2_p = bitmap_p + width_byte;
uint8_t px_cnt;
uint8_t col_byte_cnt;
for(row = 0; row < (font_p->height_row >> 1); row ++) {
col_byte_cnt = 0;
col_sub = 7;
for(col = 0; col < (w >> 1); col ++) {
px_cnt = 0;
if((*map1_p & (1 << col_sub)) != 0) px_cnt++;
if((*map2_p & (1 << col_sub)) != 0) px_cnt++;
if(col_sub != 0) col_sub --;
else {
col_sub = 7;
col_byte_cnt ++;
map1_p ++;
map2_p ++;
}
if((*map1_p & (1 << col_sub)) != 0) px_cnt++;
if((*map2_p & (1 << col_sub)) != 0) px_cnt++;
if(col_sub != 0) col_sub --;
else {
col_sub = 7;
col_byte_cnt ++;
map1_p ++;
map2_p ++;
}
if(px_cnt != 0) {
lv_rpx(pos_p->x + col, pos_p->y + row, mask_p, lv_color_mix(color, LV_COLOR_SILVER, 63 * px_cnt), LV_OPA_COVER);
}
}
map1_p += width_byte;
map2_p += width_byte;
map1_p += width_byte - col_byte_cnt;
map2_p += width_byte - col_byte_cnt;
}
#endif
}
/**
* 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 lv_color_t array
* @param opa opacity of the map (ignored, only for compatibility with lv_vmap)
* @param transp true: enable transparency of LV_IMG_LV_COLOR_TRANSP color pixels
* @param upscale true: upscale to double size (not supported)
* @param recolor mix the pixels with this color (not supported)
* @param recolor_opa the intense of recoloring (not supported)
* @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 lv_color_t * map_p, lv_opa_t opa, bool transp, bool upscale,
lv_color_t recolor, lv_opa_t recolor_opa)
const uint8_t * map_p, lv_opa_t opa, bool chroma_key, bool alpha_byte,
lv_color_t recolor, lv_opa_t recolor_opa)
{
(void)opa; /*opa is used only for compatibility with lv_vmap*/
(void)recolor_opa; /*recolor_opa is used only for compatibility with lv_vmap*/
(void)recolor; /*recolor is used only for compatibility with lv_vmap*/
(void)upscale; /*upscale is used only for compatibility with lv_vmap*/
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;
@@ -200,28 +216,35 @@ void lv_rmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
/*Go to the first pixel*/
lv_coord_t map_width = lv_area_get_width(cords_p);
map_p+= (masked_a.y1 - cords_p->y1) * map_width;
map_p += masked_a.x1 - cords_p->x1;
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) {
lv_coord_t row;
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 = 0; row < lv_area_get_height(&masked_a); row++) {
lv_disp_map(masked_a.x1, masked_a.y1 + row, masked_a.x1 + mask_w, masked_a.y1 + row, map_p);
map_p += map_width;
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 {
lv_color_t transp_color = LV_COLOR_TRANSP;
lv_coord_t row;
for(row = 0; row < lv_area_get_height(&masked_a); row++) {
lv_coord_t col;
for(col = 0; col < lv_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], opa);
} 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*/
}
}
}
@@ -229,3 +252,5 @@ void lv_rmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
/**********************
* STATIC FUNCTIONS
**********************/
#endif /*USE_LV_REAL_DRAW*/

View File

@@ -13,6 +13,9 @@ extern "C" {
/*********************
* INCLUDES
*********************/
#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"
@@ -55,23 +58,31 @@ void lv_rletter(const lv_point_t * pos_p, const lv_area_t * mask_p,
lv_color_t color, lv_opa_t opa);
/**
* 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);
/**
* 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 transp true: enable transparency of LV_IMG_LV_COLOR_TRANSP color pixels
* @param upscale true: upscale to double size (not supported)
* @param recolor mix the pixels with this color (not supported)
* @param recolor_opa the intense of recoloring (not supported)
* @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 lv_color_t * map_p, lv_opa_t opa, bool transp, bool upscale,
lv_color_t recolor, lv_opa_t recolor_opa);
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" */

View File

@@ -18,6 +18,7 @@
#include <stddef.h>
#include "../lv_core/lv_vdb.h"
#include "lv_draw.h"
/*********************
* INCLUDES
@@ -119,7 +120,7 @@ void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
#if USE_LV_GPU
static lv_color_t color_array_tmp[LV_HOR_RES << LV_ANTIALIAS]; /*Used by 'sw_color_fill'*/
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);
@@ -141,6 +142,7 @@ void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
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++) {
@@ -148,6 +150,8 @@ void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
}
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);
@@ -163,7 +167,7 @@ void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
}
/*Fill with opacity*/
else {
/*Use hw blend if present*/
/*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;
@@ -203,11 +207,31 @@ void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
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 = 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);
@@ -223,15 +247,16 @@ void lv_vletter(const lv_point_t * pos_p, const lv_area_t * mask_p,
lv_coord_t col, row;
uint8_t col_bit;
uint8_t col_byte_cnt;
uint8_t width_byte = letter_w >> 3; /*Width in bytes (e.g. w = 11 -> 2 bytes wide)*/
if(letter_w & 0x7) width_byte++;
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
* If font anti alaiassing is enabled use the reduced letter sizes*/
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 >> LV_FONT_ANTIALIAS) < mask_p->x2 ? (letter_w >> LV_FONT_ANTIALIAS) : 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 >> LV_FONT_ANTIALIAS) < mask_p->y2 ? (letter_h >> LV_FONT_ANTIALIAS) : 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->area.y1) * vdb_width)
@@ -241,94 +266,58 @@ void lv_vletter(const lv_point_t * pos_p, const lv_area_t * mask_p,
vdb_buf_tmp += (row_start * vdb_width) + col_start;
/*Move on the map too*/
map_p += ((row_start << LV_FONT_ANTIALIAS) * width_byte) + ((col_start << LV_FONT_ANTIALIAS) >> 3);
map_p += (row_start * width_byte_bpp) + ((col_start * bpp) >> 3);
#if LV_FONT_ANTIALIAS != 0
lv_opa_t opa_tmp = opa;
if(opa_tmp != LV_OPA_COVER) opa_tmp = opa_tmp >> 2; /*Opacity per pixel (used when sum the pixels)*/
const uint8_t * map1_p = map_p;
const uint8_t * map2_p = map_p + width_byte;
uint8_t px_cnt;
uint8_t letter_px;
for(row = row_start; row < row_end; row ++) {
col_byte_cnt = 0;
col_bit = 7 - ((col_start << LV_FONT_ANTIALIAS) % 8);
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) {
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);
}
}
px_cnt = 0;
if((*map1_p & (1 << col_bit)) != 0) px_cnt++;
if((*map2_p & (1 << col_bit)) != 0) px_cnt++;
if(col_bit != 0) col_bit --;
vdb_buf_tmp++;
if(col_bit < 8 - bpp) {
col_bit += bpp;
mask = mask >> bpp;
}
else {
col_bit = 7;
col_bit = 0;
col_byte_cnt ++;
map1_p ++;
map2_p ++;
}
if((*map1_p & (1 << col_bit)) != 0) px_cnt++;
if((*map2_p & (1 << col_bit)) != 0) px_cnt++;
if(col_bit != 0) col_bit --;
else {
col_bit = 7;
col_byte_cnt ++;
map1_p ++;
map2_p ++;
}
if(px_cnt != 0) {
if(opa == LV_OPA_COVER) *vdb_buf_tmp = lv_color_mix(color, *vdb_buf_tmp, 63*px_cnt);
else *vdb_buf_tmp = lv_color_mix(color, *vdb_buf_tmp, opa_tmp * px_cnt);
}
vdb_buf_tmp++;
}
map1_p += width_byte;
map2_p += width_byte;
map1_p += width_byte - col_byte_cnt;
map2_p += width_byte - col_byte_cnt;
vdb_buf_tmp += vdb_width - ((col_end) - (col_start)); /*Next row in VDB*/
}
#else
for(row = row_start; row < row_end; row ++) {
col_byte_cnt = 0;
col_bit = 7 - (col_start % 8);
for(col = col_start; col < col_end; col ++) {
if((*map_p & (1 << col_bit)) != 0) {
if(opa == LV_OPA_COVER) *vdb_buf_tmp = color;
else *vdb_buf_tmp = lv_color_mix(color, *vdb_buf_tmp, opa);
}
vdb_buf_tmp++;
if(col_bit != 0) col_bit --;
else {
col_bit = 7;
col_byte_cnt ++;
map_p ++;
mask = mask_init;
map_p ++;
}
}
map_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*/
}
#endif
}
/**
* 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 (truncated to VDB 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 transp true: enable transparency of LV_IMG_LV_COLOR_TRANSP color pixels
* @param upscale true: upscale to double size
* @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 lv_color_t * map_p, lv_opa_t opa, bool transp, bool upscale,
lv_color_t recolor, lv_opa_t recolor_opa)
const uint8_t * map_p, lv_opa_t opa, bool chroma_key, bool alpha_byte,
lv_color_t recolor, lv_opa_t recolor_opa)
{
lv_area_t masked_a;
bool union_ok;
@@ -342,19 +331,19 @@ void lv_vmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
/*If there are common part of the three area then draw to the vdb*/
if(union_ok == false) return;
uint8_t ds_shift = 0;
if(upscale != false) ds_shift = 1;
/*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*/
lv_coord_t map_width = lv_area_get_width(cords_p) >> ds_shift;
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) >> ds_shift);
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) >> ds_shift;
map_p += (masked_a.x1 - cords_p->x1) * px_size_byte;
}
/*Stores coordinates relative to the act vdb*/
/*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;
@@ -363,157 +352,87 @@ void lv_vmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
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 >> ds_shift); /*Move back. It will be easier to index 'map_p' later*/
lv_coord_t row;
lv_coord_t map_useful_w = lv_area_get_width(&masked_a);
/*No upscalse*/
if(upscale == false) {
if(transp == false) { /*Simply copy the pixels to the VDB*/
lv_coord_t row;
lv_coord_t map_useful_w = lv_area_get_width(&masked_a);
/*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) {
for(row = masked_a.y1; row <= masked_a.y2; row++) {
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[masked_a.x1], &map_p[masked_a.x1], map_useful_w, opa);
} else {
lv_disp_mem_blend(&vdb_buf_tmp[masked_a.x1], &map_p[masked_a.x1], map_useful_w, opa);
}
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
sw_mem_blend(&vdb_buf_tmp[masked_a.x1], &map_p[masked_a.x1], map_useful_w, opa);
sw_mem_blend(vdb_buf_tmp, (lv_color_t *)map_p, map_useful_w, opa);
#endif
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(recolor_opa != LV_OPA_TRANSP) {
lv_vfill(cords_p, mask_p, recolor, recolor_opa);
}
} else { /*transp == true: Check all pixels */
lv_coord_t row;
lv_coord_t col;
lv_color_t transp_color = LV_COLOR_TRANSP;
if(recolor_opa == LV_OPA_TRANSP) {/*No recolor*/
if(opa == LV_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 {
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] = lv_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*/
lv_color_t lv_color_tmp;
if(opa == LV_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) {
lv_color_tmp = lv_color_mix(recolor, map_p[col], recolor_opa);
vdb_buf_tmp[col] = lv_color_tmp;
}
}
map_p += map_width; /*Next row on the map*/
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
}
} else {
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) {
lv_color_tmp = lv_color_mix(recolor, map_p[col], recolor_opa);
vdb_buf_tmp[col] = lv_color_mix(lv_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*/
}
}
/*Upscalse*/
/*In the other cases every pixel need to be checked one-by-one*/
else {
lv_coord_t row;
lv_color_t chroma_key_color = LV_COLOR_TRANSP;
lv_coord_t col;
lv_color_t transp_color = LV_COLOR_TRANSP;
lv_color_t lv_color_tmp;
lv_color_t prev_color = LV_COLOR_BLACK;
lv_coord_t map_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;
/*The most simple case (but upscale): 0 opacity, no recolor, no transp. pixels*/
if(transp == false && opa == LV_OPA_COVER && recolor_opa == LV_OPA_TRANSP) {
lv_coord_t map_col_start = masked_a.x1 >> 1;
lv_coord_t map_col_end = masked_a.x2 >> 1;
lv_coord_t vdb_col; /*Col. in this row*/
lv_coord_t vdb_col2; /*Col. in next row*/
/*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);
}
for(row = masked_a.y1; row <= masked_a.y2; row += 2) {
map_col_start = masked_a.x1 >> 1;
map_col_end = masked_a.x2 >> 1;
vdb_col = masked_a.x1;
vdb_col2 = masked_a.x1 + vdb_width;
for(map_col = map_col_start; map_col <= map_col_end; map_col ++, vdb_col += 2, vdb_col2 += 2) {
/*Handle chroma key*/
if(chroma_key && px_color.full == chroma_key_color.full) continue;
vdb_buf_tmp[vdb_col].full = map_p[map_col].full;
vdb_buf_tmp[vdb_col + 1].full = map_p[map_col].full;
vdb_buf_tmp[vdb_col2].full = map_p[map_col].full;
vdb_buf_tmp[vdb_col2 + 1].full = map_p[map_col].full;
}
/*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);
}
map_p += map_width;
vdb_buf_tmp += 2 * vdb_width ; /*+ 2 row on the VDB (2 rows are filled because of the upscale)*/
}
}
/*Handle other cases*/
else {
lv_color_tmp = lv_color_mix(recolor, prev_color, recolor_opa);
for(row = masked_a.y1; row <= masked_a.y2; row++) {
for(col = masked_a.x1; col <= masked_a.x2; col ++) {
map_col = col >> 1;
/*Handle recoloring*/
if(recolor_opa == LV_OPA_TRANSP) {
lv_color_tmp.full = map_p[map_col].full;
} else {
if(map_p[map_col].full != prev_color.full) {
prev_color.full = map_p[map_col].full;
lv_color_tmp = lv_color_mix(recolor, prev_color, recolor_opa);
}
}
/*Put the NOT transparent pixels*/
if(transp == false || map_p[map_col].full != transp_color.full) {
/*Handle opacity*/
if(opa == LV_OPA_COVER) {
vdb_buf_tmp[col] = lv_color_tmp;
} else {
vdb_buf_tmp[col] = lv_color_mix( lv_color_tmp, vdb_buf_tmp[col], opa);
}
}
}
if((row & 0x1) != 0) map_p += map_width; /*Next row on the map*/
vdb_buf_tmp += vdb_width ; /*Next row on the VDB*/
}
/*Next row on the map*/
map_p += map_width * px_size_byte;
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
}
}
}
/**********************
@@ -534,8 +453,8 @@ static void sw_mem_blend(lv_color_t * dest, const lv_color_t * src, uint32_t len
} else {
uint32_t col;
for(col = 0; col < length; col++) {
dest[col] = lv_color_mix(src[col], dest[col], opa);
}
dest[col] = lv_color_mix(src[col], dest[col], opa);
}
}
}

View File

@@ -58,19 +58,19 @@ void lv_vletter(const lv_point_t * pos_p, const lv_area_t * mask_p,
lv_color_t color, lv_opa_t opa);
/**
* 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 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 (ignored, only for compatibility with lv_vmap)
* @param transp true: enable transparency of LV_IMG_LV_COLOR_TRANSP color pixels
* @param upscale true: upscale to double size
* @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 lv_color_t * map_p, lv_opa_t opa, bool transp, bool upscale,
lv_color_t recolor, lv_opa_t recolor_opa);
const uint8_t * map_p, lv_opa_t opa, bool chroma_key, bool alpha_byte,
lv_color_t recolor, lv_opa_t recolor_opa);
/**

View File

@@ -81,7 +81,7 @@ lv_disp_t * lv_disp_drv_register(lv_disp_drv_t *driver)
active = node;
lv_obj_invalidate(lv_scr_act());
} else {
node->next = disp_list;
disp_list->next = node;
}
return node;
@@ -200,6 +200,7 @@ void lv_disp_mem_fill(lv_color_t * dest, uint32_t length, lv_color_t color)
*/
bool lv_disp_is_mem_blend_supported(void)
{
if(active == NULL) return false;
if(active->driver.mem_blend) return true;
else return false;
}
@@ -210,6 +211,7 @@ bool lv_disp_is_mem_blend_supported(void)
*/
bool lv_disp_is_mem_fill_supported(void)
{
if(active == NULL) return false;
if(active->driver.mem_fill) return true;
else return false;
}

View File

@@ -46,6 +46,7 @@ void lv_indev_drv_init(lv_indev_drv_t *driver)
{
driver->read = NULL;
driver->type = LV_INDEV_TYPE_NONE;
driver->user_data = NULL;
}
/**
@@ -60,12 +61,14 @@ lv_indev_t * lv_indev_drv_register(lv_indev_drv_t *driver)
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;
@@ -107,6 +110,7 @@ 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));

View File

@@ -33,35 +33,40 @@ 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,
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 INDEV_TYPE_POINTER*/
uint32_t key; /*For INDEV_TYPE_KEYPAD*/
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*/
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*/
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;
typedef struct _lv_indev_state_t {
/*Run time data of input devices*/
typedef struct _lv_indev_proc_t {
lv_indev_state_t state;
union {
struct { /*Pointer data*/
struct { /*Pointer and button data*/
lv_point_t act_point;
lv_point_t last_point;
lv_point_t vect;
@@ -76,6 +81,7 @@ typedef struct _lv_indev_state_t {
};
struct { /*Keypad data*/
lv_indev_state_t last_state;
uint32_t last_key;
};
};
@@ -92,13 +98,16 @@ typedef struct _lv_indev_state_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;
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;

View File

@@ -8,6 +8,7 @@
*********************/
#include "lv_hal_tick.h"
#include <stddef.h>
#include "../../lv_conf.h"
/*********************
* DEFINES
@@ -39,7 +40,7 @@ static volatile uint8_t tick_irq_flag;
* You have to call this function periodically
* @param tick_period the call period of this function in milliseconds
*/
void lv_tick_inc(uint32_t tick_period)
LV_ATTRIBUTE_TICK_INC void lv_tick_inc(uint32_t tick_period)
{
tick_irq_flag = 0;
sys_time += tick_period;

View File

@@ -19,6 +19,9 @@ extern "C" {
/*********************
* DEFINES
*********************/
#ifndef LV_ATTRIBUTE_TICK_INC
#define LV_ATTRIBUTE_TICK_INC
#endif
/**********************
* TYPEDEFS
@@ -32,7 +35,7 @@ extern "C" {
* You have to call this function periodically
* @param tick_period the call period of this function in milliseconds
*/
void lv_tick_inc(uint32_t tick_period);
LV_ATTRIBUTE_TICK_INC void lv_tick_inc(uint32_t tick_period);
/**
* Get the elapsed milliseconds since start up

View File

@@ -36,7 +36,6 @@ static bool anim_ready_handler(lv_anim_t * a);
**********************/
static lv_ll_t anim_ll;
static uint32_t last_task_run;
static bool anim_del_global_flag = false;
/**********************
* MACROS
@@ -51,9 +50,9 @@ static bool anim_del_global_flag = false;
*/
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);
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);
}
/**
@@ -65,16 +64,16 @@ 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);
/*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));
/*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);
/*Set the start value*/
if(new_anim->fp != NULL) new_anim->fp(new_anim->var, new_anim->start);
}
/**
@@ -86,25 +85,24 @@ void lv_anim_create(lv_anim_t * anim_p)
*/
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);
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;
anim_del_global_flag = true;
}
if(a->var == var && (a->fp == fp || fp == NULL)) {
lv_ll_rem(&anim_ll, a);
lv_mem_free(a);
del = true;
}
a = a_next;
}
a = a_next;
}
return del;
return del;
}
/**
@@ -116,14 +114,16 @@ bool lv_anim_del(void * var, lv_anim_fp_t fp)
*/
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);
uint16_t time = (int32_t)((int32_t)(d * 1000) / speed);
int32_t d = LV_MATH_ABS((int32_t) start - end);
uint32_t time = (int32_t)((int32_t)(d * 1000) / speed);
if(time == 0) {
time++;
}
if(time > UINT16_MAX) time = UINT16_MAX;
return time;
if(time == 0) {
time++;
}
return time;
}
/**
@@ -174,39 +174,39 @@ static void anim_task (void * param)
{
(void)param;
volatile uint32_t elaps;
elaps = lv_tick_elaps(last_task_run);
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);
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;
a->act_time += elaps;
if(a->act_time >= 0) {
if(a->act_time > a->time) a->act_time = a->time;
int32_t new_value;
int32_t new_value;
new_value = a->path(a);
if(a->fp != NULL) a->fp(a->var, new_value); /*Apply the calculated value*/
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*/
}
}
}
/*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;
}
a = a_next;
}
last_task_run = lv_tick_get();
last_task_run = lv_tick_get();
}
/**
@@ -217,43 +217,42 @@ static void anim_task (void * param)
* */
static bool anim_ready_handler(lv_anim_t * a)
{
bool invalid = false;
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);
/*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*/
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;
/*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;
}
}
/*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;
return invalid;
}
#endif

View File

@@ -43,7 +43,7 @@ typedef struct _lv_anim_t
lv_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*/
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*/
@@ -119,7 +119,7 @@ int32_t lv_anim_path_step(const lv_anim_t *a);
* MACROS
**********************/
#endif /*LV_NO_ANIM == 0*/
#endif /*USE_LV_ANIMATION == 0*/
#ifdef __cplusplus
} /* extern "C" */

View File

@@ -166,45 +166,16 @@ bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p)
*/
bool lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p)
{
/*Two area are on each other if... */
lv_point_t p;
/*a2 left-top corner is on a1*/
p.x = a2_p->x1;
p.y = a2_p->y1;
if(lv_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(lv_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(lv_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(lv_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;
}
}
/**

View File

@@ -95,6 +95,7 @@ typedef union
uint8_t blue;
uint8_t green;
uint8_t red;
uint8_t alpha;
};
uint32_t full;
}lv_color24_t;
@@ -147,17 +148,17 @@ static inline uint8_t lv_color_to1(lv_color_t color)
#if LV_COLOR_DEPTH == 1
return color.full;
#elif LV_COLOR_DEPTH == 8
if((color.red & 0b100) ||
(color.green & 0b100) ||
(color.blue & 0b10)) {
if((color.red & 0x4) ||
(color.green & 0x4) ||
(color.blue & 0x2)) {
return 1;
} else {
return 0;
}
#elif LV_COLOR_DEPTH == 16
if((color.red & 0b10000) ||
(color.green & 0b100000) ||
(color.blue & 0b10000)) {
if((color.red & 0x10) ||
(color.green & 0x20) ||
(color.blue & 0x10)) {
return 1;
} else {
return 0;
@@ -221,18 +222,20 @@ static inline uint32_t lv_color_to24(lv_color_t color)
{
#if LV_COLOR_DEPTH == 1
if(color.full == 0) return 0;
else return 0xFFFFFF;
else return 0xFFFFFFFF;
#elif LV_COLOR_DEPTH == 8
lv_color24_t ret;
ret.red = color.red * 36; /*(2^8 - 1)/(2^3 - 1) = 255/7 = 36*/
ret.green = color.green * 36; /*(2^8 - 1)/(2^3 - 1) = 255/7 = 36*/
ret.blue = color.blue * 85; /*(2^8 - 1)/(2^2 - 1) = 255/3 = 85*/
ret.blue = color.blue * 85; /*(2^8 - 1)/(2^2 - 1) = 255/3 = 85*/
ret.alpha = 0xFF;
return ret.full;
#elif LV_COLOR_DEPTH == 16
lv_color24_t ret;
ret.red = color.red * 8; /*(2^8 - 1)/(2^5 - 1) = 255/31 = 8*/
ret.green = color.green * 4; /*(2^8 - 1)/(2^6 - 1) = 255/63 = 4*/
ret.blue = color.blue * 8; /*(2^8 - 1)/(2^5 - 1) = 255/31 = 8*/
ret.alpha = 0xFF;
return ret.full;
#elif LV_COLOR_DEPTH == 24
return color.full;
@@ -242,9 +245,17 @@ static inline uint32_t lv_color_to24(lv_color_t color)
static inline lv_color_t lv_color_mix(lv_color_t c1, lv_color_t c2, uint8_t mix)
{
lv_color_t ret;
#if LV_COLOR_DEPTH != 1
ret.red = (uint16_t)((uint16_t) c1.red * mix + (c2.red * (255 - mix))) >> 8;
ret.green = (uint16_t)((uint16_t) c1.green * mix + (c2.green * (255 - mix))) >> 8;
ret.blue = (uint16_t)((uint16_t) c1.blue * mix + (c2.blue * (255 - mix))) >> 8;
# if LV_COLOR_DEPTH == 24
ret.alpha = 0xFF;
# endif
#else
ret.full = mix > LV_OPA_50 ? c1.full : c2.full;
#endif
return ret;
}
@@ -261,6 +272,9 @@ static inline uint8_t lv_color_brightness(lv_color_t color)
return (uint16_t) bright >> 3;
}
/* The most simple macro to create a color from R,G and B values
* The order of bit field is different on Big-endian and Little-endian machines*/
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#if LV_COLOR_DEPTH == 1
#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){(b8 >> 7 | g8 >> 7 | r8 >> 7)})
#elif LV_COLOR_DEPTH == 8
@@ -268,7 +282,18 @@ static inline uint8_t lv_color_brightness(lv_color_t color)
#elif LV_COLOR_DEPTH == 16
#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{b8 >> 3, g8 >> 2, r8 >> 3}})
#elif LV_COLOR_DEPTH == 24
#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{b8, g8, r8}})
#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{b8, g8, r8, 0xff}}) /*Fix 0xff alpha*/
#endif
#else
#if LV_COLOR_DEPTH == 1
#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){(r8 >> 7 | g8 >> 7 | b8 >> 7)})
#elif LV_COLOR_DEPTH == 8
#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{r8 >> 6, g8 >> 5, b8 >> 5}})
#elif LV_COLOR_DEPTH == 16
#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{r8 >> 3, g8 >> 2, b8 >> 3}})
#elif LV_COLOR_DEPTH == 24
#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{0xff, r8, g8, b8}}) /*Fix 0xff alpha*/
#endif
#endif
#define LV_COLOR_HEX(c) LV_COLOR_MAKE(((uint32_t)((uint32_t)c >> 16) & 0xFF), \

View File

@@ -18,6 +18,11 @@
/**********************
* TYPEDEFS
**********************/
typedef struct {
uint32_t glyph_index;
uint32_t unicode;
uint8_t w_px;
}asd_glyph_dsc_t;
/**********************
* STATIC PROTOTYPES
@@ -44,33 +49,16 @@
*/
void lv_font_init(void)
{
/*DEJAVU 10*/
#if USE_LV_FONT_DEJAVU_10 != 0
lv_font_add(&lv_font_dejavu_10, NULL);
#endif
#if USE_LV_FONT_DEJAVU_10_SUP != 0
#if USE_LV_FONT_DEJAVU_10_LATIN_SUP != 0
#if USE_LV_FONT_DEJAVU_10 != 0
lv_font_add(&lv_font_dejavu_10_sup, &lv_font_dejavu_10);
lv_font_add(&lv_font_dejavu_10_latin_sup, &lv_font_dejavu_10);
#else
lv_font_add(&lv_font_dejavu_10_sup, NULL);
#endif
#endif
#if USE_LV_FONT_DEJAVU_10_LATIN_EXT_A != 0
#if USE_LV_FONT_DEJAVU_10 != 0
lv_font_add(&lv_font_dejavu_10_latin_ext_a, &lv_font_dejavu_10);
#else
lv_font_add(&lv_font_dejavu_10_latine_ext_a, NULL);
#endif
#endif
#if USE_LV_FONT_DEJAVU_10_LATIN_EXT_B != 0
#if USE_LV_FONT_DEJAVU_10 != 0
lv_font_add(&lv_font_dejavu_10_latin_ext_b, &lv_font_dejavu_10);
#else
lv_font_add(&lv_font_dejavu_10_latin_ext_b, NULL);
lv_font_add(&lv_font_dejavu_10_latin_sup, NULL);
#endif
#endif
@@ -83,56 +71,25 @@ void lv_font_init(void)
#endif
/*SYMBOL 10*/
#if USE_LV_FONT_SYMBOL_10_BASIC != 0
#if USE_LV_FONT_SYMBOL_10 != 0
#if USE_LV_FONT_DEJAVU_10 != 0
lv_font_add(&lv_font_symbol_10_basic, &lv_font_dejavu_10);
lv_font_add(&lv_font_symbol_10, &lv_font_dejavu_10);
#else
lv_font_add(&lv_font_symbol_10_basic, NULL);
lv_font_add(&lv_font_symbol_10, NULL);
#endif
#endif
#if USE_LV_FONT_SYMBOL_10_FILE != 0
#if USE_LV_FONT_SYMBOL_10_BASIC != 0
lv_font_add(&lv_font_symbol_10_file, &lv_font_symbol_10_basic);
#else
lv_font_add(&lv_font_symbol_10_file, NULL);
#endif
#endif
#if USE_LV_FONT_SYMBOL_10_FEEDBACK != 0
#if USE_LV_FONT_SYMBOL_10_BASIC != 0
lv_font_add(&lv_font_symbol_10_feedback, &lv_font_symbol_10_basic);
#else
lv_font_add(&lv_font_symbol_10_feedback, NULL);
#endif
#endif
/*DEJAVU 20*/
#if USE_LV_FONT_DEJAVU_20 != 0
lv_font_add(&lv_font_dejavu_20, NULL);
#endif
#if USE_LV_FONT_DEJAVU_20_SUP != 0
#if USE_LV_FONT_DEJAVU_20_LATIN_SUP != 0
#if USE_LV_FONT_DEJAVU_20 != 0
lv_font_add(&lv_font_dejavu_20_sup, &lv_font_dejavu_20);
lv_font_add(&lv_font_dejavu_20_latin_sup, &lv_font_dejavu_20);
#else
lv_font_add(&lv_font_symbol_20_sup, NULL);
#endif
#endif
#if USE_LV_FONT_DEJAVU_20_LATIN_EXT_A != 0
#if USE_LV_FONT_DEJAVU_20 != 0
lv_font_add(&lv_font_dejavu_20_latin_ext_a, &lv_font_dejavu_20);
#else
lv_font_add(&lv_font_dejavu_20_latin_ext_a, NULL);
#endif
#endif
#if USE_LV_FONT_DEJAVU_20_LATIN_EXT_B != 0
#if USE_LV_FONT_DEJAVU_20 != 0
lv_font_add(&lv_font_dejavu_20_latin_ext_b, &lv_font_dejavu_20);
#else
lv_font_add(&lv_font_dejavu_20_latin_ext_b, NULL);
lv_font_add(&lv_font_symbol_20_latin_sup, NULL);
#endif
#endif
@@ -145,56 +102,25 @@ void lv_font_init(void)
#endif
/*SYMBOL 20*/
#if USE_LV_FONT_SYMBOL_20_BASIC != 0
#if USE_LV_FONT_SYMBOL_20 != 0
#if USE_LV_FONT_DEJAVU_20 != 0
lv_font_add(&lv_font_symbol_20_basic, &lv_font_dejavu_20);
lv_font_add(&lv_font_symbol_20, &lv_font_dejavu_20);
#else
lv_font_add(&lv_font_symbol_20_basic, NULL);
lv_font_add(&lv_font_symbol_20, NULL);
#endif
#endif
#if USE_LV_FONT_SYMBOL_20_FILE != 0
#if USE_LV_FONT_SYMBOL_20_BASIC != 0
lv_font_add(&lv_font_symbol_20_file, &lv_font_symbol_20_basic);
#else
lv_font_add(&lv_font_symbol_20_file, NULL);
#endif
#endif
#if USE_LV_FONT_SYMBOL_20_FEEDBACK != 0
#if USE_LV_FONT_SYMBOL_20_BASIC != 0
lv_font_add(&lv_font_symbol_20_feedback, &lv_font_symbol_20_basic);
#else
lv_font_add(&lv_font_symbol_20_feedback, NULL);
#endif
#endif
/*DEJAVU 30*/
#if USE_LV_FONT_DEJAVU_30 != 0
lv_font_add(&lv_font_dejavu_30, NULL);
#endif
#if USE_LV_FONT_DEJAVU_30_SUP != 0
#if USE_LV_FONT_DEJAVU_30_LATIN_SUP != 0
#if USE_LV_FONT_DEJAVU_30 != 0
lv_font_add(&lv_font_dejavu_30_sup, &lv_font_dejavu_30);
lv_font_add(&lv_font_dejavu_30_latin_sup, &lv_font_dejavu_30);
#else
lv_font_add(&lv_font_dejavu_30_sup, NULL);
#endif
#endif
#if USE_LV_FONT_DEJAVU_30_LATIN_EXT_A != 0
#if USE_LV_FONT_DEJAVU_30 != 0
lv_font_add(&lv_font_dejavu_30_latin_ext_a, &lv_font_dejavu_30);
#else
lv_font_add(&lv_font_dejavu_30_latin_ext_a, NULL);
#endif
#endif
#if USE_LV_FONT_DEJAVU_30_LATIN_EXT_B != 0
#if USE_LV_FONT_DEJAVU_30 != 0
lv_font_add(&lv_font_dejavu_30_latin_ext_b, &lv_font_dejavu_30);
#else
lv_font_add(&lv_font_dejavu_30_latin_ext_b, NULL);
lv_font_add(&lv_font_dejavu_30_latin_sup, NULL);
#endif
#endif
@@ -207,28 +133,12 @@ void lv_font_init(void)
#endif
/*SYMBOL 30*/
#if USE_LV_FONT_SYMBOL_30_BASIC != 0
#if USE_LV_FONT_SYMBOL_30 != 0
#if USE_LV_FONT_DEJAVU_30 != 0
lv_font_add(&lv_font_symbol_30_basic, &lv_font_dejavu_30);
lv_font_add(&lv_font_symbol_30, &lv_font_dejavu_30);
#else
lv_font_add(&lv_font_symbol_30_basic, NULL);
#endif
#endif
#if USE_LV_FONT_SYMBOL_30_FILE != 0
#if USE_LV_FONT_SYMBOL_30_BASIC != 0
lv_font_add(&lv_font_symbol_30_file, &lv_font_symbol_30_basic);
#else
lv_font_add(&lv_font_symbol_30_file, NULL);
#endif
#endif
#if USE_LV_FONT_SYMBOL_30_FEEDBACK != 0
#if USE_LV_FONT_SYMBOL_30_BASIC != 0
lv_font_add(&lv_font_symbol_30_feedback, &lv_font_symbol_30_basic);
#else
lv_font_add(&lv_font_symbol_30_feedback, NULL);
#endif
#endif
/*DEJAVU 40*/
@@ -236,27 +146,11 @@ void lv_font_init(void)
lv_font_add(&lv_font_dejavu_40, NULL);
#endif
#if USE_LV_FONT_DEJAVU_40_SUP != 0
#if USE_LV_FONT_DEJAVU_40_LATIN_SUP != 0
#if USE_LV_FONT_DEJAVU_40 != 0
lv_font_add(&lv_font_dejavu_40_sup, &lv_font_dejavu_40);
lv_font_add(&lv_font_dejavu_40_latin_sup, &lv_font_dejavu_40);
#else
lv_font_add(&lv_font_dejavu_40_sup, NULL);
#endif
#endif
#if USE_LV_FONT_DEJAVU_40_LATIN_EXT_A != 0
#if USE_LV_FONT_DEJAVU_40 != 0
lv_font_add(&lv_font_dejavu_40_latin_ext_a, &lv_font_dejavu_40);
#else
lv_font_add(&lv_font_dejavu_40_latin_ext_a, NULL);
#endif
#endif
#if USE_LV_FONT_DEJAVU_40_LATIN_EXT_B != 0
#if USE_LV_FONT_DEJAVU_40 != 0
lv_font_add(&lv_font_dejavu_40_latin_ext_b, &lv_font_dejavu_40);
#else
lv_font_add(&lv_font_dejavu_40_latin_ext_b, NULL);
lv_font_add(&lv_font_dejavu_40_latin_sup, NULL);
#endif
#endif
@@ -269,153 +163,14 @@ void lv_font_init(void)
#endif
/*SYMBOL 40*/
#if USE_LV_FONT_SYMBOL_40_BASIC != 0
#if USE_LV_FONT_SYMBOL_40 != 0
#if USE_LV_FONT_DEJAVU_40 != 0
lv_font_add(&lv_font_symbol_40_basic, &lv_font_dejavu_40);
lv_font_add(&lv_font_symbol_40, &lv_font_dejavu_40);
#else
lv_font_add(&lv_font_symbol_40_basic, NULL);
lv_font_add(&lv_font_symbol_40, NULL);
#endif
#endif
#if USE_LV_FONT_SYMBOL_40_FILE != 0
#if USE_LV_FONT_SYMBOL_40_BASIC != 0
lv_font_add(&lv_font_symbol_40_file, &lv_font_symbol_40_basic);
#else
lv_font_add(&lv_font_symbol_40_file, NULL);
#endif
#endif
#if USE_LV_FONT_SYMBOL_40_FEEDBACK != 0
#if USE_LV_FONT_SYMBOL_40_BASIC != 0
lv_font_add(&lv_font_symbol_40_feedback, &lv_font_symbol_40_basic);
#else
lv_font_add(&lv_font_symbol_40_feedback, NULL);
#endif
#endif
/*DEJAVU 60*/
#if USE_LV_FONT_DEJAVU_60 != 0
lv_font_add(&lv_font_dejavu_60, NULL);
#endif
#if USE_LV_FONT_DEJAVU_60_SUP != 0
#if USE_LV_FONT_DEJAVU_60 != 0
lv_font_add(&lv_font_dejavu_60_sup, &lv_font_dejavu_60);
#else
lv_font_add(&lv_font_dejavu_60_sup, NULL);
#endif
#endif
#if USE_LV_FONT_DEJAVU_60_LATIN_EXT_A != 0
#if USE_LV_FONT_DEJAVU_60 != 0
lv_font_add(&lv_font_dejavu_60_latin_ext_a, &lv_font_dejavu_60);
#else
lv_font_add(&lv_font_dejavu_60_latin_ext_a, NULL);
#endif
#endif
#if USE_LV_FONT_DEJAVU_60_LATIN_EXT_B != 0
#if USE_LV_FONT_DEJAVU_60 != 0
lv_font_add(&lv_font_dejavu_60_latin_ext_b, &lv_font_dejavu_60);
#else
lv_font_add(&lv_font_dejavu_60_latin_ext_b, NULL);
#endif
#endif
#if USE_LV_FONT_DEJAVU_60_CYRILLIC != 0
#if USE_LV_FONT_DEJAVU_60 != 0
lv_font_add(&lv_font_dejavu_60_cyrillic, &lv_font_dejavu_60);
#else
lv_font_add(&lv_font_dejavu_60_cyrillic, NULL);
#endif
#endif
/*SYMBOL 60*/
#if USE_LV_FONT_SYMBOL_60_BASIC != 0
#if USE_LV_FONT_DEJAVU_60 != 0
lv_font_add(&lv_font_symbol_60_basic, &lv_font_dejavu_60);
#else
lv_font_add(&lv_font_symbol_60_basic, NULL);
#endif
#endif
#if USE_LV_FONT_SYMBOL_60_FILE != 0
#if USE_LV_FONT_SYMBOL_60_BASIC != 0
lv_font_add(&lv_font_symbol_60_file, &lv_font_symbol_60_basic);
#else
lv_font_add(&lv_font_symbol_60_file, NULL);
#endif
#endif
#if USE_LV_FONT_SYMBOL_60_FEEDBACK != 0
#if USE_LV_FONT_SYMBOL_60_BASIC != 0
lv_font_add(&lv_font_symbol_60_feedback, &lv_font_symbol_60_basic);
#else
lv_font_add(&lv_font_symbol_60_feedback, NULL);
#endif
#endif
/*DEJAVU 80*/
#if USE_LV_FONT_DEJAVU_80 != 0
lv_font_add(&lv_font_dejavu_80, NULL);
#endif
#if USE_LV_FONT_DEJAVU_80_SUP != 0
#if USE_LV_FONT_DEJAVU_80 != 0
lv_font_add(&lv_font_dejavu_80_sup, &lv_font_dejavu_80);
#else
lv_font_add(&lv_font_dejavu_80_sup, NULL);
#endif
#endif
#if USE_LV_FONT_DEJAVU_80_LATIN_EXT_A != 0
#if USE_LV_FONT_DEJAVU_80 != 0
lv_font_add(&lv_font_dejavu_80_latin_ext_a, &lv_font_dejavu_80);
#else
lv_font_add(&lv_font_dejavu_80_latin_ext_a, NULL);
#endif
#endif
#if USE_LV_FONT_DEJAVU_80_LATIN_EXT_B != 0
#if USE_LV_FONT_DEJAVU_80 != 0
lv_font_add(&lv_font_dejavu_80_latin_ext_b, &lv_font_dejavu_80);
#else
lv_font_add(&lv_font_dejavu_80_latin_ext_b, NULL);
#endif
#endif
#if USE_LV_FONT_DEJAVU_80_CYRILLIC != 0
#if USE_LV_FONT_DEJAVU_80 != 0
lv_font_add(&lv_font_dejavu_80_cyrillic, &lv_font_dejavu_80);
#else
lv_font_add(&lv_font_dejavu_80_cyrillic, NULL);
#endif
#endif
/*SYMBOL 80*/
#if USE_LV_FONT_SYMBOL_80_BASIC != 0
#if USE_LV_FONT_DEJAVU_80 != 0
lv_font_add(&lv_font_symbol_80_basic, &lv_font_dejavu_80);
#else
lv_font_add(&lv_font_symbol_80_basic, NULL);
#endif
#endif
#if USE_LV_FONT_SYMBOL_80_FILE != 0
#if USE_LV_FONT_SYMBOL_80_BASIC != 0
lv_font_add(&lv_font_symbol_80_file, &lv_font_symbol_80_basic);
#else
lv_font_add(&lv_font_symbol_80_file, NULL);
#endif
#endif
#if USE_LV_FONT_SYMBOL_80_FEEDBACK != 0
#if USE_LV_FONT_SYMBOL_80_BASIC != 0
lv_font_add(&lv_font_symbol_80_feedback, &lv_font_symbol_80_basic);
#else
lv_font_add(&lv_font_symbol_80_feedback, NULL);
#endif
#endif
}
/**
@@ -446,10 +201,8 @@ const uint8_t * lv_font_get_bitmap(const lv_font_t * font_p, uint32_t letter)
{
const lv_font_t * font_i = font_p;
while(font_i != NULL) {
if(letter >= font_i->first_ascii && letter <= font_i->last_ascii) {
uint32_t index = (letter - font_i->first_ascii);
return &font_i->bitmap[font_i->map[index]];
}
const uint8_t * bitmap = font_i->get_bitmap(font_i, letter);
if(bitmap) return bitmap;
font_i = font_i->next_page;
}
@@ -466,17 +219,111 @@ const uint8_t * lv_font_get_bitmap(const lv_font_t * font_p, uint32_t letter)
uint8_t lv_font_get_width(const lv_font_t * font_p, uint32_t letter)
{
const lv_font_t * font_i = font_p;
int16_t w;
while(font_i != NULL) {
if(letter >= font_i->first_ascii && letter <= font_i->last_ascii) {
uint32_t index = (letter - font_i->first_ascii);
return font_i->width[index];
}
w = font_i->get_width(font_i, letter);
if(w >= 0) return w;
font_i = font_i->next_page;
}
return 0;
}
/**
* Get the bit-per-pixel of font
* @param font pointer to font
* @param letter a letter from font (font extensions can have different bpp)
* @return bpp of the font (or font extension)
*/
uint8_t lv_font_get_bpp(const lv_font_t * font, uint32_t letter)
{
const lv_font_t * font_i = font;
while(font_i != NULL) {
if(letter >= font_i->unicode_first && letter <= font_i->unicode_last) {
return font_i->bpp;
}
font_i = font_i->next_page;
}
return 0;
}
/**
* Generic bitmap get function used in 'font->get_bitmap' when the font contains all characters in the range
* @param font pointer to font
* @param unicode_letter an unicode letter which bitmap should be get
* @return pointer to the bitmap or NULL if not found
*/
const uint8_t * lv_font_get_bitmap_continuous(const lv_font_t * font, uint32_t unicode_letter)
{
/*Check the range*/
if(unicode_letter < font->unicode_first || unicode_letter > font->unicode_last) return NULL;
uint32_t index = (unicode_letter - font->unicode_first);
return &font->glyph_bitmap[font->glyph_dsc[index].glyph_index];
}
/**
* Generic bitmap get function used in 'font->get_bitmap' when the font NOT contains all characters in the range (sparse)
* @param font pointer to font
* @param unicode_letter an unicode letter which bitmap should be get
* @return pointer to the bitmap or NULL if not found
*/
const uint8_t * lv_font_get_bitmap_sparse(const lv_font_t * font, uint32_t unicode_letter)
{
/*Check the range*/
if(unicode_letter < font->unicode_first || unicode_letter > font->unicode_last) return NULL;
uint32_t i;
for(i = 0; font->unicode_list[i] != 0; i++) {
if(font->unicode_list[i] == unicode_letter) {
return &font->glyph_bitmap[font->glyph_dsc[i].glyph_index];
}
}
return NULL;
}
/**
* Generic glyph width get function used in 'font->get_width' when the font contains all characters in the range
* @param font pointer to font
* @param unicode_letter an unicode letter which width should be get
* @return width of the gylph or -1 if not found
*/
int16_t lv_font_get_width_continuous(const lv_font_t * font, uint32_t unicode_letter)
{
/*Check the range*/
if(unicode_letter < font->unicode_first || unicode_letter > font->unicode_last) {
return -1;
}
uint32_t index = (unicode_letter - font->unicode_first);
return font->glyph_dsc[index].w_px;
}
/**
* Generic glyph width get function used in 'font->get_bitmap' when the font NOT contains all characters in the range (sparse)
* @param font pointer to font
* @param unicode_letter an unicode letter which width should be get
* @return width of the glyph or -1 if not found
*/
int16_t lv_font_get_width_sparse(const lv_font_t * font, uint32_t unicode_letter)
{
/*Check the range*/
if(unicode_letter < font->unicode_first || unicode_letter > font->unicode_last) return -1;
uint32_t i;
for(i = 0; font->unicode_list[i] != 0; i++) {
if(font->unicode_list[i] == unicode_letter) {
return font->glyph_dsc[i].w_px;
}
}
return -1;
}
/**********************
* STATIC FUNCTIONS
**********************/

View File

@@ -29,15 +29,30 @@ extern "C" {
* TYPEDEFS
**********************/
typedef struct
{
uint32_t w_px :8;
uint32_t glyph_index :24;
}lv_font_glyph_dsc_t;
typedef struct
{
uint32_t unicode :21;
uint32_t glyph_dsc_index :11;
}lv_font_unicode_map_t;
typedef struct _lv_font_struct
{
uint32_t first_ascii;
uint32_t last_ascii;
uint8_t height_row;
const uint8_t * bitmap;
const uint32_t * map;
const uint8_t * width;
uint32_t unicode_first;
uint32_t unicode_last;
uint8_t h_px;
const uint8_t * glyph_bitmap;
const lv_font_glyph_dsc_t * glyph_dsc;
const uint32_t * unicode_list;
const uint8_t * (*get_bitmap)(const struct _lv_font_struct * ,uint32_t); /*Get a glyph's bitmap from a font*/
int16_t (*get_width)(const struct _lv_font_struct * ,uint32_t); /*Get a glyph's with with a given font*/
struct _lv_font_struct * next_page; /*Pointer to a font extension*/
uint32_t bpp :4; /*Bit per pixel: 1, 2 or 4*/
}lv_font_t;
/**********************
@@ -71,20 +86,9 @@ const uint8_t * lv_font_get_bitmap(const lv_font_t * font_p, uint32_t letter);
*/
static inline uint8_t lv_font_get_height(const lv_font_t * font_p)
{
return font_p->height_row;
return font_p->h_px;
}
/**
* Get the height of a font. Give the real size on the screen (half size if LV_FONT_ANTIALIAS is enabled)
* @param font_p pointer to a font
* @return the height of a font
*/
static inline uint8_t lv_font_get_height_scale(const lv_font_t * font_p)
{
return (font_p->height_row >> LV_FONT_ANTIALIAS) >> LV_ANTIALIAS;
}
/**
* Get the width of a letter in a font
* @param font_p pointer to a font
@@ -94,78 +98,120 @@ static inline uint8_t lv_font_get_height_scale(const lv_font_t * font_p)
uint8_t lv_font_get_width(const lv_font_t * font_p, uint32_t letter);
/**
* Get the width of a letter in a font )Give the real size on the screen (half size if LV_FONT_ANTIALIAS is enabled)
* @param font_p pointer to a font
* @param letter a letter
* @return the width of a letter
* Get the bit-per-pixel of font
* @param font pointer to font
* @param letter a letter from font (font extensions can have different bpp)
* @return bpp of the font (or font extension)
*/
static inline uint8_t lv_font_get_width_scale(const lv_font_t * font_p, uint32_t letter)
{
return (lv_font_get_width(font_p, letter) >> LV_FONT_ANTIALIAS) >> LV_ANTIALIAS;
}
uint8_t lv_font_get_bpp(const lv_font_t * font, uint32_t letter);
/**
* Generic bitmap get function used in 'font->get_bitmap' when the font contains all characters in the range
* @param font pointer to font
* @param unicode_letter an unicode letter which bitmap should be get
* @return pointer to the bitmap or NULL if not found
*/
const uint8_t * lv_font_get_bitmap_continuous(const lv_font_t * font, uint32_t unicode_letter);
/**
* Generic bitmap get function used in 'font->get_bitmap' when the font NOT contains all characters in the range (sparse)
* @param font pointer to font
* @param unicode_letter an unicode letter which bitmap should be get
* @return pointer to the bitmap or NULL if not found
*/
const uint8_t * lv_font_get_bitmap_sparse(const lv_font_t * font, uint32_t unicode_letter);
/**
* Generic glyph width get function used in 'font->get_width' when the font contains all characters in the range
* @param font pointer to font
* @param unicode_letter an unicode letter which width should be get
* @return width of the gylph or -1 if not found
*/
int16_t lv_font_get_width_continuous(const lv_font_t * font, uint32_t unicode_letter);
/**
* Generic glyph width get function used in 'font->get_bitmap' when the font NOT contains all characters in the range (sparse)
* @param font pointer to font
* @param unicode_letter an unicode letter which width should be get
* @return width of the glyph or -1 if not found
*/
int16_t lv_font_get_width_sparse(const lv_font_t * font, uint32_t unicode_letter);
/**********************
* MACROS
**********************/
#define LV_FONT_DECLARE(font_name) extern lv_font_t font_name;
/***********************
* POST INCLUDES
***********************/
/*Add built-in fonts*/
/******************************
* FONT DECLARATION INCLUDES
*****************************/
#include "lv_fonts/dejavu_10.h"
#include "lv_fonts/dejavu_10_sup.h"
#include "lv_fonts/dejavu_10_latin_ext_a.h"
#include "lv_fonts/dejavu_10_latin_ext_b.h"
#include "lv_fonts/dejavu_10_cyrillic.h"
#include "lv_fonts/symbol_10_basic.h"
#include "lv_fonts/symbol_10_file.h"
#include "lv_fonts/symbol_10_feedback.h"
/*10 px */
#if USE_LV_FONT_DEJAVU_10
LV_FONT_DECLARE(lv_font_dejavu_10);
#endif
#include "lv_fonts/dejavu_20.h"
#include "lv_fonts/dejavu_20_sup.h"
#include "lv_fonts/dejavu_20_latin_ext_a.h"
#include "lv_fonts/dejavu_20_latin_ext_b.h"
#include "lv_fonts/dejavu_20_cyrillic.h"
#include "lv_fonts/symbol_20_basic.h"
#include "lv_fonts/symbol_20_file.h"
#include "lv_fonts/symbol_20_feedback.h"
#if USE_LV_FONT_DEJAVU_10_LATIN_SUP
LV_FONT_DECLARE(lv_font_dejavu_10_latin_sup);
#endif
#include "lv_fonts/dejavu_30.h"
#include "lv_fonts/dejavu_30_sup.h"
#include "lv_fonts/dejavu_30_latin_ext_a.h"
#include "lv_fonts/dejavu_30_latin_ext_b.h"
#include "lv_fonts/dejavu_30_cyrillic.h"
#include "lv_fonts/symbol_30_basic.h"
#include "lv_fonts/symbol_30_file.h"
#include "lv_fonts/symbol_30_feedback.h"
#if USE_LV_FONT_DEJAVU_10_CYRILLIC
LV_FONT_DECLARE(lv_font_dejavu_10_cyrillic);
#endif
#include "lv_fonts/dejavu_40.h"
#include "lv_fonts/dejavu_40_sup.h"
#include "lv_fonts/dejavu_40_latin_ext_a.h"
#include "lv_fonts/dejavu_40_latin_ext_b.h"
#include "lv_fonts/dejavu_40_cyrillic.h"
#include "lv_fonts/symbol_40_basic.h"
#include "lv_fonts/symbol_40_file.h"
#include "lv_fonts/symbol_40_feedback.h"
#if USE_LV_FONT_SYMBOL_10
LV_FONT_DECLARE(lv_font_symbol_10);
#endif
#include "lv_fonts/dejavu_60.h"
#include "lv_fonts/dejavu_60_sup.h"
#include "lv_fonts/dejavu_60_latin_ext_a.h"
#include "lv_fonts/dejavu_60_latin_ext_b.h"
#include "lv_fonts/dejavu_60_cyrillic.h"
#include "lv_fonts/symbol_60_basic.h"
#include "lv_fonts/symbol_60_file.h"
#include "lv_fonts/symbol_60_feedback.h"
/*20 px */
#if USE_LV_FONT_DEJAVU_20
LV_FONT_DECLARE(lv_font_dejavu_20);
#endif
#include "lv_fonts/dejavu_80.h"
#include "lv_fonts/dejavu_80_sup.h"
#include "lv_fonts/dejavu_80_latin_ext_a.h"
#include "lv_fonts/dejavu_80_latin_ext_b.h"
#include "lv_fonts/dejavu_80_cyrillic.h"
#include "lv_fonts/symbol_80_basic.h"
#include "lv_fonts/symbol_80_file.h"
#include "lv_fonts/symbol_80_feedback.h"
#if USE_LV_FONT_DEJAVU_20_LATIN_SUP
LV_FONT_DECLARE(lv_font_dejavu_20_latin_sup);
#endif
#if USE_LV_FONT_DEJAVU_20_CYRILLIC
LV_FONT_DECLARE(lv_font_dejavu_20_cyrillic);
#endif
#if USE_LV_FONT_SYMBOL_20
LV_FONT_DECLARE(lv_font_symbol_20);
#endif
/*30 px */
#if USE_LV_FONT_DEJAVU_30
LV_FONT_DECLARE(lv_font_dejavu_30);
#endif
#if USE_LV_FONT_DEJAVU_30_LATIN_SUP
LV_FONT_DECLARE(lv_font_dejavu_30_latin_sup);
#endif
#if USE_LV_FONT_DEJAVU_30_CYRILLIC
LV_FONT_DECLARE(lv_font_dejavu_30_cyrillic);
#endif
#if USE_LV_FONT_SYMBOL_30
LV_FONT_DECLARE(lv_font_symbol_30);
#endif
/*40 px */
#if USE_LV_FONT_DEJAVU_40
LV_FONT_DECLARE(lv_font_dejavu_40);
#endif
#if USE_LV_FONT_DEJAVU_40_LATIN_SUP
LV_FONT_DECLARE(lv_font_dejavu_40_latin_sup);
#endif
#if USE_LV_FONT_DEJAVU_40_CYRILLIC
LV_FONT_DECLARE(lv_font_dejavu_40_cyrillic);
#endif
#if USE_LV_FONT_SYMBOL_40
LV_FONT_DECLARE(lv_font_symbol_40);
#endif
#ifdef __cplusplus
} /* extern "C" */

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_10_H
#define DEJAVU_10_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_10
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_10;
#endif /*USE_LV_FONT_DEJAVU_10*/
#endif /*DEJAVU_10_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_10_CYRILLIC_H
#define DEJAVU_10_CYRILLIC_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_10_CYRILLIC
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_10_cyrillic;
#endif /*USE_LV_FONT_DEJAVU_10_CYRILLIC*/
#endif /*DEJAVU_10_CYRILLIC_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_10_LATIN_EXT_A_H
#define DEJAVU_10_LATIN_EXT_A_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_10_LATIN_EXT_A
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_10_latin_ext_a;
#endif /*USE_LV_FONT_DEJAVU_10_LATIN_EXT_A*/
#endif /*DEJAVU_10_LATIN_EXT_A_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_10_LATIN_EXT_B_H
#define DEJAVU_10_LATIN_EXT_B_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_10_LATIN_EXT_B
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_10_latin_ext_b;
#endif /*USE_LV_FONT_DEJAVU_10_LATIN_EXT_B*/
#endif /*DEJAVU_10_LATIN_EXT_B_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_10_SUP_H
#define DEJAVU_10_SUP_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_10_SUP
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_10_sup;
#endif /*USE_LV_FONT_DEJAVU_10_SUP*/
#endif /*DEJAVU_10_SUP_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_20_H
#define DEJAVU_20_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_20
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_20;
#endif /*USE_LV_FONT_DEJAVU_20*/
#endif /*DEJAVU_20_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_20_CYRILLIC_H
#define DEJAVU_20_CYRILLIC_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_20_CYRILLIC
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_20_cyrillic;
#endif /*USE_LV_FONT_DEJAVU_20_CYRILLIC*/
#endif /*DEJAVU_20_CYRILLIC_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_20_LATIN_EXT_A_H
#define DEJAVU_20_LATIN_EXT_A_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_20_LATIN_EXT_A
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_20_latin_ext_a;
#endif /*USE_LV_FONT_DEJAVU_20_LATIN_EXT_A*/
#endif /*DEJAVU_20_LATIN_EXT_A_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_20_LATIN_EXT_B_H
#define DEJAVU_20_LATIN_EXT_B_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_20_LATIN_EXT_B
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_20_latin_ext_b;
#endif /*USE_LV_FONT_DEJAVU_20_LATIN_EXT_B*/
#endif /*DEJAVU_20_LATIN_EXT_B_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_20_SUP_H
#define DEJAVU_20_SUP_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_20_SUP
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_20_sup;
#endif /*USE_LV_FONT_DEJAVU_20_SUP*/
#endif /*DEJAVU_20_SUP_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_30_H
#define DEJAVU_30_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_30
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_30;
#endif /*USE_LV_FONT_DEJAVU_30*/
#endif /*DEJAVU_30_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_30_CYRILLIC_H
#define DEJAVU_30_CYRILLIC_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_30_CYRILLIC
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_30_cyrillic;
#endif /*USE_LV_FONT_DEJAVU_30_CYRILLIC*/
#endif /*DEJAVU_30_CYRILLIC_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_30_LATIN_EXT_A_H
#define DEJAVU_30_LATIN_EXT_A_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_30_LATIN_EXT_A
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_30_latin_ext_a;
#endif /*USE_LV_FONT_DEJAVU_30_LATIN_EXT_A*/
#endif /*DEJAVU_30_LATIN_EXT_A_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_30_LATIN_EXT_B_H
#define DEJAVU_30_LATIN_EXT_B_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_30_LATIN_EXT_B
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_30_latin_ext_b;
#endif /*USE_LV_FONT_DEJAVU_30_LATIN_EXT_B*/
#endif /*DEJAVU_30_LATIN_EXT_B_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_30_SUP_H
#define DEJAVU_30_SUP_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_30_SUP
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_30_sup;
#endif /*USE_LV_FONT_DEJAVU_30_SUP*/
#endif /*DEJAVU_30_SUP_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_40_H
#define DEJAVU_40_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_40
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_40;
#endif /*USE_LV_FONT_DEJAVU_40*/
#endif /*DEJAVU_40_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_40_CYRILLIC_H
#define DEJAVU_40_CYRILLIC_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_40_CYRILLIC
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_40_cyrillic;
#endif /*USE_LV_FONT_DEJAVU_40_CYRILLIC*/
#endif /*DEJAVU_40_CYRILLIC_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_40_LATIN_EXT_A_H
#define DEJAVU_40_LATIN_EXT_A_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_40_LATIN_EXT_A
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_40_latin_ext_a;
#endif /*USE_LV_FONT_DEJAVU_40_LATIN_EXT_A*/
#endif /*DEJAVU_40_LATIN_EXT_A_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_40_LATIN_EXT_B_H
#define DEJAVU_40_LATIN_EXT_B_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_40_LATIN_EXT_B
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_40_latin_ext_b;
#endif /*USE_LV_FONT_DEJAVU_40_LATIN_EXT_B*/
#endif /*DEJAVU_40_LATIN_EXT_B_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_40_SUP_H
#define DEJAVU_40_SUP_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_40_SUP
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_40_sup;
#endif /*USE_LV_FONT_DEJAVU_40_SUP*/
#endif /*DEJAVU_40_SUP_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_60_H
#define DEJAVU_60_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_60
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_60;
#endif /*USE_LV_FONT_DEJAVU_60*/
#endif /*DEJAVU_60_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_60_CYRILLIC_H
#define DEJAVU_60_CYRILLIC_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_60_CYRILLIC
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_60_cyrillic;
#endif /*USE_LV_FONT_DEJAVU_60_CYRILLIC*/
#endif /*DEJAVU_60_CYRILLIC_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_60_LATIN_EXT_A_H
#define DEJAVU_60_LATIN_EXT_A_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_60_LATIN_EXT_A
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_60_latin_ext_a;
#endif /*USE_LV_FONT_DEJAVU_60_LATIN_EXT_A*/
#endif /*DEJAVU_60_LATIN_EXT_A_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_60_LATIN_EXT_B_H
#define DEJAVU_60_LATIN_EXT_B_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_60_LATIN_EXT_B
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_60_latin_ext_b;
#endif /*USE_LV_FONT_DEJAVU_60_LATIN_EXT_B*/
#endif /*DEJAVU_60_LATIN_EXT_B_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_60_SUP_H
#define DEJAVU_60_SUP_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_60_SUP
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_60_sup;
#endif /*USE_LV_FONT_DEJAVU_60_SUP*/
#endif /*DEJAVU_60_SUP_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_80_H
#define DEJAVU_80_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_80
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_80;
#endif /*USE_LV_FONT_DEJAVU_80*/
#endif /*DEJAVU_80_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_80_CYRILLIC_H
#define DEJAVU_80_CYRILLIC_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_80_CYRILLIC
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_80_cyrillic;
#endif /*USE_LV_FONT_DEJAVU_80_CYRILLIC*/
#endif /*DEJAVU_80_CYRILLIC_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_80_LATIN_EXT_A_H
#define DEJAVU_80_LATIN_EXT_A_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_80_LATIN_EXT_A
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_80_latin_ext_a;
#endif /*USE_LV_FONT_DEJAVU_80_LATIN_EXT_A*/
#endif /*DEJAVU_80_LATIN_EXT_A_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_80_LATIN_EXT_B_H
#define DEJAVU_80_LATIN_EXT_B_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_80_LATIN_EXT_B
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_80_latin_ext_b;
#endif /*USE_LV_FONT_DEJAVU_80_LATIN_EXT_B*/
#endif /*DEJAVU_80_LATIN_EXT_B_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_80_SUP_H
#define DEJAVU_80_SUP_H
/*Use UTF-8 encoding in the IDE*/
#include "../../../lv_conf.h"
#if USE_LV_FONT_DEJAVU_80_SUP
#include <stdint.h>
#include "../lv_font.h"
extern lv_font_t lv_font_dejavu_80_sup;
#endif /*USE_LV_FONT_DEJAVU_80_SUP*/
#endif /*DEJAVU_80_SUP_H*/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More