Compare commits

...

1039 Commits

Author SHA1 Message Date
Gabor Kiss-Vamosi
0aefab358b Release v7.9.1 2021-01-19 14:36:38 +01:00
Xiang Xiao
60be7c1cee Fix minor issues found in task module (#2029)
* fix(task): Remove the unnecessary cast and init

and correct the comment too

* fix(task): Implement lv_task_create directly

to avoid lv_task_set_prio which is a time consuming operation.

* fix(task): Exclude the return value computing from the idle time

and change handler_start and time_till_next to local variables

* fix(task): Remove zero task_deleted and task_created in lv_task_exec

since the loop in lv_task_handler already do the same thing
2021-01-19 10:08:30 +01:00
Xiang Xiao
a637f415d7 Fix minor issue found in color module (#2024)
* fix(color): Return the opposite value in lv_color_premult when LV_COLOR_DEPTH equals 1

and correct the comment too

* fix(color): Correct the comment and alignment issue

* fix(color): Remove LV_COLOR_[SET|GET]_G16_SWAP

to simplify LV_COLOR_16_SWAP process

* fix(color): Correct the cast usage

* fix(color): Remove LV_MATH_ABS in lv_color_rgb_to_hsv

since delta can never become a negative number

* fix(color): Align LV_COLOR_[SET|GET]_A1 with other similar macro
2021-01-18 09:13:42 +01:00
Xiang Xiao
c9b97feea8 fix(formatting): various improvements (#2028)
* fix(formatting): Remove the duplicated space

* fix(formatting): Remove the duplicated 'the'

* fix(spell): run codespell -w for the code base
2021-01-17 09:03:31 -05:00
Xiang Xiao
873551bb5e fix(area): minor improvements (#2023)
* fix(area): Correct r_sqrd and dist(int32_t to uint32_t)

since these two variables never become negative

* fix(area): Return early in _lv_area_is_in if pointer outside area

The origin code always does the full check if radius != 0, but it
is unnecessary when is_in equals true.
2021-01-15 14:31:16 -05:00
Xiang Xiao
bc25998c5b Minor fix found in mem module (#2014)
* fix(mem): Utilize ALIGN_MASK as much as possible

to avoid check LV_ARCH_64 again and again and
correct the comment about MEM_UNIT

* fix(mem): Simplify _lv_memset implementation by SET8/SET32/REPEAT8 macro

* fix(mem): Handle the out of memory gracefully in _lv_mem_buf_get

don't modify the state in the failure

* fix(mem): Remove the unnecessary memset, memcpy and assignment
2021-01-12 19:26:26 +01:00
Xiang Xiao
9ca4ffd64d fix(format) correct comments in lv_gc.h, lv_ll.h and lv_log.h (#2016) 2021-01-12 11:01:45 -05:00
Xiang Xiao
d6ca15a749 Move LV_GC_INCLUDE to the common place(gc.h) (#2010)
* Move LV_GC_INCLUDE to the common place(gc.h)

to avoid the duplication in many source files

* fix(theme template): Always initialize _lv_theme_material_styles

just like what other theme do
2021-01-12 16:13:41 +01:00
Xiang Xiao
486053012d Various fs module fix and improvement (#2019)
* fix(fs): Check driver ready in lv_fs_dir_open and lv_fs_free_space

* fix(fs): Avoid the memory leak in lv_fs_open and lv_fs_dir_open

* fix(fs): Fix typo error in lv_fs_trunc(tell_cb should be trunc_cb)

* fix(fs): Make lv_fs_dir_close same as lv_fs_close when dir_close_cb equals NULL

* fix(fs): Handle the struct cleanup correctly

* improve(fs): Don't allocate memory when file_size or rddir_size equal zero

pass the address of file_d or dir_d to open_cb or dir_open_cb instead, so
implementor can point file_d/dir_d to other location. In many cases(POSIX),
file system will allocate the context for us, this improvement could avoid
we allocate the 4/8 bytes intermediate space.
2021-01-12 12:16:02 +01:00
Xiang Xiao
c083d19b52 Minor fix found in async module (#2015)
* fix(async): Move lv_async_info_t from lv_async.h to lv_async.c

since the user don't need know the implementation detail

* fix(async): Don't set user_data again

since lv_task_create already save it for us
2021-01-12 12:07:00 +01:00
Xiang Xiao
138fcfec79 fix(math): Correct the function argument type declaration (#2013)
1.all argument of _lv_bezier3 should be uint32_t since the input and output are unsigned
2.the return type of _lv_map should be int32_t since the type of output range is int32_t
3.remove the unnecessary cast
2021-01-12 12:00:20 +01:00
Xiang Xiao
c20d5d81f2 Minor fix found in Kconfig (#2005)
* Trim trailing whitespace from Kconfig

* Replace all tab to space in Kconfig

* Add more dependence between opions to Kconfig

* Add LV_USE_FONT_SUBPX for LV_FONT_SUBPX_BGR in Kconfig

* Fix typo error(LV_USE_DROPBOX->LV_USE_DROPDOWN) in Kconfig

* Remove LV_THEME_MATERIAL dependence from the child of LV_THEME_DEFAULT_FLAG

since LV_THEME_DEFAULT_FLAG already depends on LV_THEME_MATERIAL

* Rename LV_MEM_SIZE_BYTES to LV_MEM_SIZE_KILOBYTES

since this opion use KiB as the unit
2021-01-11 14:38:17 +01:00
Xiang Xiao
81b13bf3b6 Remove the double empty lines from all source files (#2009)
* Run dos2unix for all source files

* Remove the trail space from all source files

* Remove the double empty lines from all source files
2021-01-11 14:28:00 +01:00
udoudou
52ba06a228 Update CHANGELOG.md (#2011)
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
2021-01-11 13:10:54 +01:00
udoudou
923f989b39 Fix(indev): Don't leave edit mode if there is only one object in the group (#1999)
* Release v7.7.0

* Fix(indev): Don't leave edit mode if there is only
 one object in the group

* Remove unnecessary judgment conditions

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
2021-01-11 13:10:02 +01:00
Julian Mitchell
a2e9f03eda Fix build when LV_USE_GPU_NXP_PXP is enabled (#1982)
* Fix build when LV_USE_GPU_NXP_PXP is enabled

* Allow fill_normal to use PXP
2021-01-11 10:26:24 +01:00
Gabor Kiss-Vamosi
4cff14f823 fix(gou_nxp_pxp): fix incorrent define name 2021-01-11 10:22:23 +01:00
embeddedt
0d52a60200 Update CHANGELOG.md 2021-01-09 15:25:21 -05:00
embeddedt
c988b68605 fix(msgbox) use the animation time provided
Fixes #2008
2021-01-09 15:25:07 -05:00
Gabor Kiss-Vamosi
7d3a6c8de4 Update main.yml 2021-01-08 14:35:39 +01:00
Gabor Kiss-Vamosi
636ea46a44 Delete close-if-no-template.yml 2021-01-08 14:33:49 +01:00
Gabor Kiss-Vamosi
0e2c83813f Create main.yml 2021-01-08 14:32:55 +01:00
Gabor Kiss-Vamosi
ccc847e975 Create close-if-no-template.yml 2021-01-08 14:24:53 +01:00
Gabor Kiss-Vamosi
cabbaf093c Delete auto-close-if-no-template.yml 2021-01-08 14:24:24 +01:00
Gabor Kiss-Vamosi
d31304a1cc Create auto-close-if-no-template.yml 2021-01-08 14:22:51 +01:00
Gabor Kiss-Vamosi
6de31e9ffc Update bug-report.md 2021-01-08 14:11:23 +01:00
Gabor Kiss-Vamosi
e457c33dc2 Update dev-discussion.md 2021-01-08 14:10:12 +01:00
Gabor Kiss-Vamosi
9bb7ff30ec Update and rename all-other-issues.md to dev-discussion.md 2021-01-08 14:08:39 +01:00
Gabor Kiss-Vamosi
f0fd2b757f Update bug-report.md 2021-01-08 12:52:23 +01:00
Gabor Kiss-Vamosi
97f1493202 Update bug-report.md 2021-01-08 12:51:44 +01:00
Gabor Kiss-Vamosi
20975a2290 Update all-other-issues.md 2021-01-07 14:52:19 +01:00
Gabor Kiss-Vamosi
7dc3262855 Update config.yml 2021-01-07 14:50:43 +01:00
Gabor Kiss-Vamosi
0110a1888d Update bug-report.md 2021-01-07 14:49:09 +01:00
embeddedt
74564b7c7e fix(canvas): spelling in log messages 2021-01-07 07:46:20 -05:00
Gabor Kiss-Vamosi
b391c64434 Update config.yml 2021-01-07 13:33:01 +01:00
Gabor Kiss-Vamosi
509a56fde9 fix(dropdown): fix selecting options after the last one
fix #1996
2021-01-06 12:06:51 +01:00
Gabor Kiss-Vamosi
8cd07b6ff5 fix(cpicker): fix division by zero
fix #1992
2021-01-06 11:53:51 +01:00
embeddedt
ae2fbdb9ef fix(win): incorrect switch syntax 2021-01-05 17:10:57 -05:00
Gabor Kiss-Vamosi
8aaff10bd5 fix(release script): fix regexp to update the required LVGL version in lv_examples.h 2021-01-05 16:33:07 +01:00
Gabor Kiss-Vamosi
e3ad7918e2 Update master version 2021-01-05 16:04:29 +01:00
Gabor Kiss-Vamosi
e66f19e5ce Release v7.9.0 2021-01-05 15:57:36 +01:00
Gabor Kiss-Vamosi
8ed224fd63 fix warning 2021-01-05 15:51:59 +01:00
Gabor Kiss-Vamosi
998ad66c84 fix(kconfig): fix redefinition of LV_SPRINTF_DISABLE_FLOAT if no Kconfig 2021-01-05 15:46:57 +01:00
Gabor Kiss-Vamosi
83c55c2a64 Update ROADMAP.md 2021-01-04 18:15:37 +01:00
Carlos Diaz
6ed420e043 Kconfig: Handle LV_SPRINTF_DISABLE_FLOAT (#1988)
* Kconfig: Handle LV_SPRINTF_DISABLE_FLOAT

* Update CHANGELOG

* Remove debug code

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
2021-01-04 15:27:38 +01:00
Gabor Kiss-Vamosi
de44f74522 fix(gauge): fix redraw with image needle
fix #1993
2021-01-04 15:12:34 +01:00
Jan Van Winkel
ed5f91ab72 Add support for Zephyr intergartion (#1979)
* Removed src/lv_conf_zephyr.h

Removed src/lv_conf_zephyr.h as it is maintained in the Zephyr build it self.

* CMakeLists.txt: Added support for Zephyr RTOS

Added support to build LVGL as library for Zephyr RTOS

* Added support to use LVGL repo as Zephyr module

Added support to use the LVGL repository as a Zephyr module repository
2021-01-04 14:18:11 +01:00
robekras
e5f58151ac Update lv_disp.c (#1990)
Check d->scr_to_load for not beeing NULL.

See forum post https://forum.lvgl.io/t/lv-scr-load-anim-does-not-work-properly/4057
2021-01-04 10:47:34 +01:00
embeddedt
26ab373b43 fix(layout): workaround overflow by implementing a recursion threshold (#1986)
* fix(layout): workaround overflow by implementing a recursion threshold

* Update CHANGELOG.md
2021-01-04 09:55:13 +01:00
Gabor Kiss-Vamosi
3dbee9b584 refactor(lv_conf_internal): simplify the uppercase conversation added in aba10b0
Reaeted to #1989
2021-01-04 09:46:01 +01:00
Gabor Kiss-Vamosi
56a48e0173 Merge branch 'master' of https://github.com/littlevgl/lvgl 2021-01-04 09:42:59 +01:00
Gabor Kiss-Vamosi
aba10b0170 fix(lv_conf_internal): be sure Kconfig defines are always uppercase
fixes #1989
2021-01-04 09:42:50 +01:00
Themba Dube
f0c52b3511 Add note about base_dir functions requiring LV_USE_BIDI 2020-12-30 11:01:24 -05:00
liebman
6dd1884228 Fix kconfig warnings (#1967)
* quote string defaults for Kconfig values to eliminate warnings

* don't add \ in default for LV_TICK_CUSTOM_SYS_TIME_EXPR
(tho its needed on linux and MacOS) as I can't test on Windows
2020-12-30 16:54:38 +01:00
embeddedt
20d56ee6e9 fix(linemeter): draw first critical needle with correct color (#1978)
* fix(linemeter): draw first critical needle with correct color

* Update CHANGELOG.md
2020-12-27 11:30:59 +01:00
embeddedt
196bcb9b0e Update pull_request_template.md 2020-12-24 11:12:53 -05:00
Hamid Reza Mehrabian
cee779a56d Fix #1959: wrong glyph data 2020-12-23 16:00:02 -05:00
Andrey
07b6d93de4 lv_chart: Fix division by zero issue when all points are equal (#1962)
* Fix division by zero issue when all points are equal

As the title says, when all the points are equal, it attempts division by zero, and in some cases it can result in funny behavior.
Slightly kludgy fix, but not a significant performance impact.

* Actually fix the division by zero issue both ways

Previous commit was slightly broken and only worked one way

* Fix range setting instead of drawing

* Missing y_tmp
2020-12-22 10:44:17 +01:00
Gabor Kiss-Vamosi
091174069d fix(textarea): cursor position after hiding character in password mode 2020-12-21 18:54:47 +01:00
Riccardo
43ed3eb1f4 lv_txt: support extended ascii codes in lv_txt_unicode_to_iso8859_1() (#1963) 2020-12-21 16:13:42 +01:00
Gabor Kiss-Vamosi
c4d978fa6f fix(textarea): buffer overflow in password mode with UTF-8 characters
fixes #1960
2020-12-20 15:36:28 +01:00
Gabor Kiss-Vamosi
0ca874bc49 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-12-20 15:19:33 +01:00
Gabor Kiss-Vamosi
3d22dc5722 dropdown: fix typo causing build error 2020-12-20 13:39:00 +01:00
Mattia Maldini
62d21734d9 Improved ESP-IDF integration (#1961)
* Removed LV_CONF_SKIP definition from CMake to avoid redefinition warnings; added more Kconfig options

* Bumped up version and removed unnecessary default values

* Added user data configuration to KConfig

* Moved user data options to "Feature Usage" menu
2020-12-20 13:34:48 +01:00
Gabor Kiss-Vamosi
cd69be12d1 Update pull_request_template.md 2020-12-20 13:32:37 +01:00
Gabor Kiss-Vamosi
1b83855c72 Create pull_request_template.md 2020-12-20 13:31:44 +01:00
Gabor Kiss-Vamosi
243145d8c9 add arabic processin to to window title and lv_dropdown_add_option 2020-12-20 13:21:06 +01:00
Gabor Kiss-Vamosi
cb021a425a calendar: fix build error 2020-12-20 10:59:42 +01:00
Gabor Kiss-Vamosi
b0fecc6bb2 update CHANGELOG 2020-12-20 10:56:30 +01:00
Gabor Kiss-Vamosi
4e177e01ea Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-12-20 10:55:25 +01:00
Gabor Kiss-Vamosi
2bf91dbbb5 calendar: make get_day_of_week() public 2020-12-20 10:55:20 +01:00
Gabor Kiss-Vamosi
aac672e88b fix(draw): free buffer used for arabic processing 2020-12-20 10:54:40 +01:00
Gabor Kiss-Vamosi
93d7bd4cf5 release script: update version in Kconfig 2020-12-20 10:53:06 +01:00
Gabor Kiss-Vamosi
57c2201386 Merge branch 'master' into dev 2020-12-15 19:59:27 +01:00
Gabor Kiss-Vamosi
9e72cb0000 Release v7.8.1 2020-12-15 19:59:27 +01:00
github-actions[bot]
0ea6bcd40c Merge 9b579f3fad into dev 2020-12-11 15:42:50 +00:00
Gabor Kiss-Vamosi
9b579f3fad fix(test): use sys/time.h only if built in test mode 2020-12-11 16:42:15 +01:00
Gabor Kiss-Vamosi
417e32b4df fix: add missing lv_txt_ap.h include to some C files 2020-12-11 16:40:52 +01:00
Rhaoma
0a7f6a6331 Add option to align title text in window (#1953)
* Add option to align title text in window 

I found that i really needed a basic way to align the title text in a window, and therefore i did a bit of tinkering and came up with this solution. Mind you that I'm very new to this so it might not be the most optimal way. I have tested a bit and it pretty looked promising,
I have of course written the alignments as I felt was most suitable, but I shouldn't be the judge of that.
Current alignment:

LV_TXT_FLAG_CENTER makes the text align in the center of the header but ensures it can’t overextend into to header button area;

LV_TXT_FLAG_RIGHT makes the text align at the right side, but takes the right side header buttons into account

LV_TXT_FLAG_FIT & LV_TXT_FLAG_EXPAND I wasn’t too sure about what to do so as of now it just aligns them as normal

LV_TXT_FLAG_NONE Is equal to no flag set by the user and therefore I have just set it to the default coords, like normal. The text then align at the left side.

* Update lv_win.h

* Added functions

Added function to set and get alignment of the header title as requested

* Added functions

Added setter and getter functions for the header title alignment as requested
2020-12-11 16:37:20 +01:00
Gabor Kiss-Vamosi
b04dea5971 fix warnings 2020-12-10 11:18:30 +01:00
Gabor Kiss-Vamosi
e90ce9d4b7 Merge branch 'dev' of https://github.com/littlevgl/lvgl into dev 2020-12-10 11:15:01 +01:00
Gabor Kiss-Vamosi
5fc66822b9 feat(img_cache): allow disabling image cacheing
related to #1954
2020-12-10 11:14:26 +01:00
github-actions[bot]
e2d7fa4477 Merge b565a69c76 into dev 2020-12-09 18:07:53 +00:00
embeddedt
b565a69c76 fix(dropdown): always invalidate if selected option changes
Reported on the forum: https://forum.lvgl.io/t/dropdown-selected-value-doesnt-change-after-calling-lv-dropdown-set-selected/3983
2020-12-09 13:07:21 -05:00
Gabor Kiss-Vamosi
861f07bb77 feat(chart): add lv_chart_remove_series and lv_chart_hide_series 2020-12-09 14:15:56 +01:00
Gabor Kiss-Vamosi
6d4de78756 set version number 2020-12-09 14:11:14 +01:00
Gabor Kiss-Vamosi
a905be4f90 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-12-09 14:02:36 +01:00
Gabor Kiss-Vamosi
99bb4cb8f1 fix(page): fix LV_SCOLLBAR_MODE_DRAG
fixes
https://forum.lvgl.io/t/page-scrollbar-appears-even-if-scrollbar-mode-is-set-to-lv-scrlbar-mode-drag/3883
2020-12-09 14:02:28 +01:00
embeddedt
03d2d10f17 Fix #1955: wrong display size macro being used 2020-12-08 07:45:52 -05:00
Gabor Kiss-Vamosi
b80f1dbf14 fix(lv_scr_load_anim): fix when multiple screen are loaded at tsame time with delay 2020-12-07 18:04:40 +01:00
embeddedt
b9aff01102 Correct preprocessor syntax (#1951) 2020-12-05 19:47:50 -05:00
Amir Gonnen
ba5ee315e9 lv_txt.h: Add missing include (#1949) 2020-12-03 18:42:42 -05:00
nazar01
568c2ee688 Spelling, docs fixing, and cosmetic code fixing (#1944)
* Spelling and docs fixes

* Fix #endif comments

* Fix function declarations (fix param names and remove duplicate)
2020-12-02 11:25:15 +01:00
Gabor Kiss-Vamosi
2aad9aaebd Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-12-01 15:27:52 +01:00
Gabor Kiss-Vamosi
4f6fb723ef fix roller LV_ROLLER_MODE_INIFINITE refactoring 2020-12-01 15:27:44 +01:00
Gabor Kiss-Vamosi
2c0ca03319 Update master version 2020-12-01 15:13:30 +01:00
Gabor Kiss-Vamosi
51f95f3286 Release v7.8.0 2020-12-01 15:08:50 +01:00
Carlos Diaz
bf08ff444e Update Kconfig. (#1917)
* Kconfig: Add missing _HEX to LV_COLOR_TRANSP option.

* lv_conf_checker: Define LV_CONF_SKIP if CONFIG_LV_CONF_SKIP is defined.

* fix(indev): disabled object shouldn't absorb clicks but let the parent to be clicked

* Update README.md

* fix(arabic): support processing again alraedy processed texts with _lv_txt_ap_proc

* fix(textarea): support Arabic letter connections

fixes #1888

* Fix #1924: incorrect date on changelog

December 1st is two weeks from 7.7.2 release.

* Kconfig: Fix LV_CONF_MINIMAL related options.

* fix(arabic): support Arabic letter connections

fixes #1920

* fix(arabic): support Arabic letter connections in value string property

* Update CHANGELOG.md

* Update CHANGELOG.md

* Kconfig: Add Zephyr specific code.

* fix: fix double include in lv_obj.c

fix #1926

* Removed trailing semi-colon from macros (#1928)

* Removed commented out test definition

Removed commented out test definition LV_BUILD_TEST

* Remove blank line

* Fix comment spelling

* Added blank line

* Removed trailing semi-colon in macros

* fix(indev): in LV_INDEV_TYPE_BUTTON recognize 1 cycle long presses too

Fixes https://forum.lvgl.io/t/bug-in-indev-button-proc-misses-buttons-that-are-pressed-for-a-single-callback/3699

* fix(arc): make arc work with encoder

fixes https://forum.lvgl.io/t/lv-arc-with-encoder-lv-group/3769

* fix(slider): adjusting the left knob too with encoder

https://forum.lvgl.io/t/slider-with-2-knobs-and-encoder-functionality/3770

* fix(arc_draw): remove statments that do nothing

fix #1930

* Change LV_DRAW_BUF_MAX_NUM to LV_MEM_BUF_MAX_NUM (#1931)

* Update CHANGELOG.md

* fix(draw polygon): join adjacent points if they are on the same coordinate

* fix(draw polygon): fix memory leak and vertex joining

* fix(style): invalidate cache on every PART

Inherited properties on parts other than MAIN  needs to be recached on property change beacuse they
are inherted from MAIN

fixes #1933

* fix(anim): fix bounce path

* fix(slider): do not let edit left knob in non-range mode

* Update ROADMAP.md

* Fix hardfault when DCache is disabled with no callback (#1935)

* fix(linemeter): fix invalidation when setting new value

The old complex but more optimal invalidation was buggy in some cases

fixes #1904

* fix(linemeter): fix invalidation when setting new value

The old complex but more optimal invalidation was buggy in some cases

fixes #1904

* fix(table): add missing invalidation when changeing cell type

fixes https://forum.lvgl.io/t/bug-of-table-click-to-change-style/3842

* CMakeLists.txt: Let the user configure whether LV_ATTRIBUTE_FAST_MEM is IRAM_ATTR (#1939)

* fix(slider): fix left/right knob control with encoder

* fix(img): increase the size of invalidated area in lv_img_set_zoom

Becasue of the pivot placement there can be some rounding errors

* feat(perf_monitor): add lv_refr_get_fps_avg()

* Add 8px and 10px montserrat fonts to build (#1941)

* Fix #1942: lv_textarea_set_pwd_mode not changing to bullets

Thanks to @fvanroie for investigating.

* fix(material): make button pressed color darker (#1940)

* simplify touch handling in the Arduino example

* Update ROADMAP.md

* Update ROADMAP.md

* feat(lv_conf_kconfig): add LV_CONF_KCONFIG_EXTERNAL_INCLUDE

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com>
Co-authored-by: xennex22 <25083624+xennex22@users.noreply.github.com>
Co-authored-by: incity <610455681@qq.com>
Co-authored-by: Andrey <spirit@spirit.re>
Co-authored-by: defogprog <22955033+defogprog@users.noreply.github.com>
2020-12-01 15:04:20 +01:00
Gabor Kiss-Vamosi
41b1a7ea15 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-12-01 12:51:53 +01:00
Gabor Kiss-Vamosi
4e5b262401 refactor(roller): rename LV_ROLLER_MODE_INIFINITE -> LV_ROLLER_MODE_INFINITE 2020-12-01 12:50:42 +01:00
Gabor Kiss-Vamosi
c52482efa2 Update ROADMAP.md 2020-12-01 12:19:45 +01:00
Gabor Kiss-Vamosi
5b09c3879d Update ROADMAP.md 2020-12-01 12:15:59 +01:00
Gabor Kiss-Vamosi
e43d6da389 simplify touch handling in the Arduino example 2020-12-01 11:40:21 +01:00
embeddedt
73f4156aad fix(material): make button pressed color darker (#1940) 2020-12-01 11:25:43 +01:00
embeddedt
bc2ca71bf5 Fix #1942: lv_textarea_set_pwd_mode not changing to bullets
Thanks to @fvanroie for investigating.
2020-11-28 19:57:14 -05:00
defogprog
b1a7dbadcd Add 8px and 10px montserrat fonts to build (#1941) 2020-11-28 12:19:46 -05:00
Gabor Kiss-Vamosi
1b37ee8873 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-11-28 12:41:23 +01:00
Gabor Kiss-Vamosi
9c5fec9b79 feat(perf_monitor): add lv_refr_get_fps_avg() 2020-11-28 12:41:06 +01:00
Gabor Kiss-Vamosi
65f7ff66d5 fix(img): increase the size of invalidated area in lv_img_set_zoom
Becasue of the pivot placement there can be some rounding errors
2020-11-28 12:38:48 +01:00
Gabor Kiss-Vamosi
dded9b383a fix(slider): fix left/right knob control with encoder 2020-11-28 12:37:26 +01:00
Carlos Diaz
3c55dfb672 CMakeLists.txt: Let the user configure whether LV_ATTRIBUTE_FAST_MEM is IRAM_ATTR (#1939) 2020-11-27 13:17:15 -05:00
Gabor Kiss-Vamosi
9797c555c0 fix conflits 2020-11-27 11:15:08 +01:00
Gabor Kiss-Vamosi
87e26d4997 fix(table): add missing invalidation when changeing cell type
fixes https://forum.lvgl.io/t/bug-of-table-click-to-change-style/3842
2020-11-27 11:14:36 +01:00
Gabor Kiss-Vamosi
6c62a8eeb5 fix(linemeter): fix invalidation when setting new value
The old complex but more optimal invalidation was buggy in some cases

fixes #1904
2020-11-27 09:49:10 +01:00
Gabor Kiss-Vamosi
4853eacfa4 fix(linemeter): fix invalidation when setting new value
The old complex but more optimal invalidation was buggy in some cases

fixes #1904
2020-11-27 09:48:59 +01:00
Andrey
48a676f404 Fix hardfault when DCache is disabled with no callback (#1935) 2020-11-26 19:12:21 -05:00
Gabor Kiss-Vamosi
2f6eaa516c Update ROADMAP.md 2020-11-26 15:54:39 +01:00
Gabor Kiss-Vamosi
5e8581a345 fix(slider): do not let edit left knob in non-range mode 2020-11-26 15:30:50 +01:00
Gabor Kiss-Vamosi
d6d5903be1 fix(anim): fix bounce path 2020-11-26 15:23:50 +01:00
Gabor Kiss-Vamosi
313f7f30a7 fix(style): invalidate cache on every PART
Inherited properties on parts other than MAIN  needs to be recached on property change beacuse they
are inherted from MAIN

fixes #1933
2020-11-26 15:23:50 +01:00
Gabor Kiss-Vamosi
89eca30da8 fix(draw polygon): fix memory leak and vertex joining 2020-11-26 15:23:50 +01:00
Gabor Kiss-Vamosi
819f01c930 fix(draw polygon): join adjacent points if they are on the same coordinate 2020-11-26 15:23:50 +01:00
embeddedt
8cd738eaa1 Update CHANGELOG.md 2020-11-25 12:22:11 -05:00
incity
d6dd6199f3 Change LV_DRAW_BUF_MAX_NUM to LV_MEM_BUF_MAX_NUM (#1931) 2020-11-25 12:21:22 -05:00
Gabor Kiss-Vamosi
9d0335f38c fix(arc_draw): remove statments that do nothing
fix #1930
2020-11-25 11:35:12 +01:00
Gabor Kiss-Vamosi
82fdfb34c0 fix(slider): adjusting the left knob too with encoder
https://forum.lvgl.io/t/slider-with-2-knobs-and-encoder-functionality/3770
2020-11-25 10:12:58 +01:00
Gabor Kiss-Vamosi
a2535fe6f1 fix(arc): make arc work with encoder
fixes https://forum.lvgl.io/t/lv-arc-with-encoder-lv-group/3769
2020-11-25 09:56:24 +01:00
Gabor Kiss-Vamosi
fa49f35b14 fix(indev): in LV_INDEV_TYPE_BUTTON recognize 1 cycle long presses too
Fixes https://forum.lvgl.io/t/bug-in-indev-button-proc-misses-buttons-that-are-pressed-for-a-single-callback/3699
2020-11-25 09:48:37 +01:00
xennex22
bc369de6fa Removed trailing semi-colon from macros (#1928)
* Removed commented out test definition

Removed commented out test definition LV_BUILD_TEST

* Remove blank line

* Fix comment spelling

* Added blank line

* Removed trailing semi-colon in macros
2020-11-24 18:16:16 +01:00
Gabor Kiss-Vamosi
3d81bb40da fix: fix double include in lv_obj.c
fix #1926
2020-11-24 15:27:42 +01:00
Gabor Kiss-Vamosi
5848aa59e5 Update CHANGELOG.md 2020-11-23 14:06:27 +01:00
Gabor Kiss-Vamosi
68300a5dec Update CHANGELOG.md 2020-11-23 13:24:34 +01:00
Gabor Kiss-Vamosi
07a95b5b33 fix(arabic): support Arabic letter connections in value string property 2020-11-23 13:12:13 +01:00
Gabor Kiss-Vamosi
d90cbe92de fix(arabic): support Arabic letter connections
fixes #1920
2020-11-23 13:12:13 +01:00
embeddedt
45599c2c2a Fix #1924: incorrect date on changelog
December 1st is two weeks from 7.7.2 release.
2020-11-22 15:01:37 -05:00
Gabor Kiss-Vamosi
85b3e8766f Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-11-21 23:53:15 +01:00
Gabor Kiss-Vamosi
07c63b8ad3 fix(textarea): support Arabic letter connections
fixes #1888
2020-11-21 23:53:05 +01:00
Gabor Kiss-Vamosi
8361d89a55 fix(arabic): support processing again alraedy processed texts with _lv_txt_ap_proc 2020-11-21 23:51:57 +01:00
embeddedt
510bc7ca11 Update README.md 2020-11-21 15:45:11 -05:00
Gabor Kiss-Vamosi
440c79e40c fix(indev): disabled object shouldn't absorb clicks but let the parent to be clicked 2020-11-21 20:54:39 +01:00
Gabor Kiss-Vamosi
baa1f848b1 Update ROADMAP.md 2020-11-19 17:21:52 +01:00
Gabor Kiss-Vamosi
522e975a4e fix(btnmatrix): fix seg. fault with arabic text processing 2020-11-19 11:49:34 +01:00
Gabor Kiss-Vamosi
e511fe53c9 Update ROADMAP.md 2020-11-18 13:52:01 +01:00
Gabor Kiss-Vamosi
4903bdb908 fix(btnmatrix): handle arabic texts in button matrices 2020-11-17 12:12:19 +01:00
Gabor Kiss-Vamosi
6b99545e50 fix(release): minor fixes in the release script 2020-11-17 12:02:32 +01:00
Gabor Kiss-Vamosi
70438d158d Merge branch 'master' into dev 2020-11-17 11:29:58 +01:00
Gabor Kiss-Vamosi
52f52397cb Release v7.7.2 2020-11-17 11:29:58 +01:00
Gabor Kiss-Vamosi
94a25b86a8 fix confilcts 2020-11-17 11:15:14 +01:00
Gabor Kiss-Vamosi
3979024660 fix(spinbox): update cursor position in lv_spinbox_set_step
fix #1907
2020-11-17 10:52:33 +01:00
Carlos Diaz
16567f5705 Add Kconfig (#1875)
* Kconfig: Add first revision of Kconfig.

* Kconfig: Let the user edit LV_COLOR_TRANSP directly.

* Kconfig: Define CONFIG_LV_CONF_SKIP.

* Kconfig: Let the user edit LV_THEME_DEFAULT_COLOR_PRIMARY and LV_THEME_DEFAULT_COLOR_SECONDARY directly.

* Kconfig: add LV_CONF_MINIMAL

* Kconfig: Expose LV_CONF_MINIMAL option.

* Kconfig: Fix LV_CONF_SKIP missing type.

* Remove garbage files

* lv_conf_kconfig: Fix wrong check for LV_THEME_DEFAULT_COLOR_PRIMARY and SECONDARY symbols.

* Add Unscii 16 options.

* Multiply LV_MEM_SIZE by 1024

* Fix message on API compability options

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
2020-11-16 12:49:48 +01:00
github-actions[bot]
0b79b1690f Merge 4f0beee01b into dev 2020-11-15 12:50:02 +00:00
Tim Gates
4f0beee01b docs: fix simple typo, obejct -> object (#1900)
There is a small typo in src/lv_core/lv_obj.c, src/lv_core/lv_obj.h.

Should read `object` rather than `obejct`.
2020-11-15 07:49:31 -05:00
github-actions[bot]
d018558134 Merge 6060d4d1f6 into dev 2020-11-13 22:16:32 +00:00
Gabor Kiss-Vamosi
6060d4d1f6 fix(list): in lv_list remove clean last_sel_btn and act_sel_btn only if arelated button was deleted
related to #1895
2020-11-13 23:15:46 +01:00
github-actions[bot]
0c6a627b92 Merge 54883792e1 into dev 2020-11-13 15:29:55 +00:00
Gabor Kiss-Vamosi
54883792e1 fix(list): fix compiler error if LV_USE_GROUP = 0 2020-11-13 16:29:18 +01:00
github-actions[bot]
e2f96b9007 Merge 20fef93fea into dev 2020-11-13 15:21:10 +00:00
Gabor Kiss-Vamosi
20fef93fea fix(list): fix removing list elements
remove the button from last_sel_btn adn act_sel_btn
related to #1895
2020-11-13 16:20:11 +01:00
Gabor Kiss-Vamosi
63dfe9e8e3 fix(imgbtn): guess a the closest availabe state with valid src 2020-11-13 16:18:34 +01:00
Gabor Kiss-Vamosi
0ae70c027b fix(anim): tune overshoth path 2020-11-13 15:57:38 +01:00
github-actions[bot]
3e404b1583 Merge 43771fa2f7 into dev 2020-11-11 12:22:27 +00:00
Gabor Kiss-Vamosi
43771fa2f7 fix(theme_material): remove the bottom border from tabview header
If the tabs were placed to the bottom the bottom border looked like gap on the bottom

fix #1882
2020-11-11 13:21:40 +01:00
github-actions[bot]
34635da14c Merge b79d615ae8 into dev 2020-11-11 11:30:19 +00:00
iDalink
b79d615ae8 look ahead chars when be in LV_LABEL_LONG_DOT (#1881)
Co-authored-by: Dalink <Dalink@gitee.com>
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
2020-11-11 12:29:51 +01:00
github-actions[bot]
af27c16793 Merge 945f5900d5 into dev 2020-11-10 21:07:35 +00:00
Gabor Kiss-Vamosi
945f5900d5 fix(arc): update knob position when bg_angle(s) changes 2020-11-10 22:06:58 +01:00
github-actions[bot]
24340fa927 Merge a7c4fc410a into dev 2020-11-10 21:00:26 +00:00
Gabor Kiss-Vamosi
a7c4fc410a fix(arc): fix and improve arc dragging
It was difficult to handle the pressed angle on the arc when it crossed the 360 degree boundery.
The solution is to handle the angle relative to the bg_start_angle. This way no angle can be larger than 360.
The other issue was the case when a smaller than min. or larger than max. angle was pressed.
It is handled by introducing 'min_close' flag which stores which end is closer on the last valid press
and prefer this end in uncleary situation.
2020-11-10 21:59:37 +01:00
github-actions[bot]
08fcf03c3f Merge 93138759a9 into dev 2020-11-10 16:26:09 +00:00
Gabor Kiss-Vamosi
93138759a9 fix(btnmatrix): fix setting the same map with modified pointers
fix #1889
2020-11-10 17:25:17 +01:00
Gabor Kiss-Vamosi
380df4578e fix(lv_font_unscii_16) use relative include path to lvgl.h 2020-11-10 10:18:08 +01:00
github-actions[bot]
71619aa8f6 Merge a07583331e into dev 2020-11-09 15:12:28 +00:00
Gabor Kiss-Vamosi
a07583331e docs(changelog): update changelog 2020-11-09 16:11:48 +01:00
github-actions[bot]
2afd887fdf Merge 1bc1d278eb into dev 2020-11-09 15:11:28 +00:00
Gabor Kiss-Vamosi
1bc1d278eb fix(draw_triangle): fix polygon/triangle drawing when the order of points is counter-clockwise 2020-11-09 16:10:46 +01:00
github-actions[bot]
fc5709d04c Merge b3c9096830 into dev 2020-11-09 12:13:49 +00:00
Gabor Kiss-Vamosi
b3c9096830 Use copy of va_list rather than original va_list in txt_set_text_vfmt (#1890)
Fix issue #1886

Co-authored-by: Wenting Zhang <zephray@outlook.com>
2020-11-09 13:13:18 +01:00
github-actions[bot]
74efc2e73e Merge 85c5e786a4 into dev 2020-11-09 09:30:43 +00:00
Gabor Kiss-Vamosi
85c5e786a4 fix(library.json) set the version to the last release
platform.io haven't recognized the last version
https://forum.lvgl.io/t/platformio-repository-for-lvgl-not-updating/3607
2020-11-09 10:30:14 +01:00
github-actions[bot]
8a489b3a8e Merge b19fb8620f into dev 2020-11-06 08:51:06 +00:00
Maureen Helm
b19fb8620f lv_font: Fix compiler warning when compressed fonts are disabled (#1880)
Fixes a compiler warning in lv_font_fmt_txt.c when compressed fonts are
disabled (LV_USE_FONT_COMPRESSED=0):

/home/maureen/zephyrproject/modules/lib/gui/lvgl/src/lv_font/lv_font_fmt_txt.c:349:13: warning: 'decompress' defined but not used [-Wunused-function]
  349 | static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord_t h, uint8_t bpp, bool prefilter)
      |             ^~~~~~~~~~

This was found after upgrading Zephyr to use LVGL v7.6.1, building with
the Zephyr SDK 0.11.3 toolchain.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-11-06 09:50:32 +01:00
Gabor Kiss-Vamosi
2d986871c9 fix(lv_conf_internal): re-generate to add LV_FONT_UNSCII_16 2020-11-05 12:42:20 +01:00
Gabor Kiss-Vamosi
ef81e0fbc3 feat(font): add unscii-16 built-in font
https://forum.lvgl.io/t/more-unscii-font-version/3433
2020-11-05 12:38:44 +01:00
Gabor Kiss-Vamosi
b00628e77d merge master 2020-11-03 11:04:34 +01:00
Gabor Kiss-Vamosi
d110731409 add v7.7.2 to changelog 2020-11-03 11:03:26 +01:00
Gabor Kiss-Vamosi
92c75a6e8c minor release script fixes 2020-11-03 11:02:26 +01:00
Gabor Kiss-Vamosi
2f40ca37df Update master version 2020-11-03 10:02:00 +01:00
Gabor Kiss-Vamosi
112c894e73 Merge branch 'master' into dev 2020-11-03 09:23:29 +01:00
Gabor Kiss-Vamosi
5035c0c780 Release v7.7.1 2020-11-03 09:23:29 +01:00
Gabor Kiss-Vamosi
f42afb1c52 Update lv_conf_kconfig.h 2020-11-02 16:12:24 +01:00
github-actions[bot]
4f9869fc7e Merge f915b4cfb6 into dev 2020-11-02 15:04:17 +00:00
Gabor Kiss-Vamosi
f915b4cfb6 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-11-02 16:03:37 +01:00
github-actions[bot]
06ae6be9d4 Merge b62ddf8f64 into dev 2020-11-02 15:03:22 +00:00
Gabor Kiss-Vamosi
b62ddf8f64 push test 2020-11-02 16:02:47 +01:00
Gabor Kiss-Vamosi
b05aaaeb6b Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-11-02 15:55:10 +01:00
Gabor Kiss-Vamosi
47687fc252 Update changelog 2020-11-02 15:54:54 +01:00
github-actions[bot]
a85ed5b949 Merge 929d9f7a57 into dev 2020-11-02 12:13:31 +00:00
Gabor Kiss-Vamosi
929d9f7a57 Update release.yml 2020-11-02 13:13:01 +01:00
github-actions[bot]
20d034c279 Merge 23aec1e1ce into dev 2020-11-02 11:52:32 +00:00
Gabor Kiss-Vamosi
23aec1e1ce Update release.yml 2020-11-02 12:52:03 +01:00
github-actions[bot]
0931bb6cae Merge d487acd7cc into dev 2020-11-02 11:51:39 +00:00
Gabor Kiss-Vamosi
d487acd7cc Create release.yml 2020-11-02 12:51:12 +01:00
github-actions[bot]
380b59fddd Merge 6d92d084f7 into dev 2020-11-02 11:24:52 +00:00
Gabor Kiss-Vamosi
6d92d084f7 group: fix in lv_group_remove_obj to handle deleting hidden obejcts correctly 2020-11-02 12:24:12 +01:00
Carlos Diaz
16678b78bc lv_conf_kconfig: Update (#1870)
* lv_conf_kconfig: Update

* lv_conf_kconfig: Define CONFIG_LV_COLOR_TRANSP with lv_color_hex.
2020-11-02 11:10:33 +01:00
github-actions[bot]
8f14c31bc9 Merge a2b4bbcd2a into dev 2020-10-29 22:05:58 +00:00
Gabor Kiss-Vamosi
a2b4bbcd2a add missing #include <stdarg.h> 2020-10-29 23:05:16 +01:00
github-actions[bot]
20f901f9e3 Merge 85c8014880 into dev 2020-10-28 10:18:12 +00:00
Gabor Kiss-Vamosi
85c8014880 gauge: make the needle images to use the styles from LV_GAUGE_PART_PART 2020-10-28 11:14:05 +01:00
github-actions[bot]
b5ddf8d19d Merge b3cca917df into dev 2020-10-28 09:14:53 +00:00
Ali Rostami
b3cca917df create the fmt version of setting text for msgbox. (#1851)
* create the fmt version of setting text for msgbox.

* define _lv_txt_set_text_vfmt and change the body of lv_msgbox_set_text_fmt.

* make lv_label_refr_text out of static.

* fix a bug in _lv_txt_set_text_vfmt
2020-10-28 10:14:18 +01:00
github-actions[bot]
6bae5c7af5 Merge 4dafa10017 into dev 2020-10-27 12:50:23 +00:00
Gabor Kiss-Vamosi
4dafa10017 fix messed up function introduced in 6e9714c5 2020-10-27 13:49:47 +01:00
github-actions[bot]
622472387c Merge 6e9714c545 into dev 2020-10-27 12:42:40 +00:00
Gabor Kiss-Vamosi
6e9714c545 respect btnmatrix's one_check in lv_btnmatrix_set_btn_ctrl
Related to https://forum.lvgl.io/t/expand-lv-btnmatrix-set-one-check-to-allow-radio-button-functionality/2962
2020-10-27 13:42:01 +01:00
github-actions[bot]
6e12abe015 Merge 8788317bb1 into dev 2020-10-26 14:19:22 +00:00
Gabor Kiss-Vamosi
8788317bb1 chart: remove LV_CHART_SCATTER option which was only an accidental leftover 2020-10-26 15:18:41 +01:00
Carlos Diaz
f9da89d77d Add CMakeLists.txt (#1868) 2020-10-26 10:05:32 -04:00
Carlos Diaz
def8e047af lv_conf_checker: Update lv_conf_checker so it is ESP-IDF aware. (#1864)
* lv_conf_checker: Update lv_conf_checker so it is ESP-IDF aware.

Include ESP-IDF headers and lv_conf_kconfig.h when using the ESP-IDF framework.
Also remove the CONFIG_LV_CONF_SKIP as it is not generated by the Kconfig file.

* lv_conf_checker: Always include lv_conf_kconfig.h.

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
2020-10-26 13:18:06 +01:00
github-actions[bot]
6b59b1f706 Merge cc921dae17 into dev 2020-10-26 11:46:26 +00:00
Gabor Kiss-Vamosi
cc921dae17 Fix infinite loop in lv_imgbtn
Fixes: #1867
2020-10-26 12:45:51 +01:00
github-actions[bot]
ae0d498cf6 Merge 18ae2fe7fb into dev 2020-10-26 11:40:55 +00:00
Gabor Kiss-Vamosi
18ae2fe7fb Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-10-26 12:40:15 +01:00
Gabor Kiss-Vamosi
c19a4ad568 lv_conf_checker.py: add auto incude of lv_conf.h if available 2020-10-26 12:40:05 +01:00
github-actions[bot]
54a8a4ba33 Merge b3bfa3c58b into dev 2020-10-26 11:02:04 +00:00
iDalink
b3bfa3c58b lv_label effect area clip line space (#1866)
Co-authored-by: Dalink <Dalink@gitee.com>
2020-10-26 12:01:32 +01:00
github-actions[bot]
9d7ba3fcb1 Merge b44ddb5b64 into dev 2020-10-26 08:14:38 +00:00
Gabor Kiss-Vamosi
b44ddb5b64 lv_gpu_nxp_pxp_osa.h include lv_conf_internal.h instead of lv_conf.h
Related to #1860
2020-10-26 09:13:48 +01:00
github-actions[bot]
1a66a485f9 Merge d6c87cb753 into dev 2020-10-24 18:50:24 +00:00
Chris Mumford
d6c87cb753 Initialize lv_color_t::green_l when LV_COLOR_16_SWAP==1 (#1865) 2020-10-24 14:49:55 -04:00
github-actions[bot]
bd59dafa42 Merge 51a522c8d3 into dev 2020-10-24 18:07:52 +00:00
Chris Mumford
51a522c8d3 Fixed a few dangling references to lv_conf_templ.h. (#1863) 2020-10-24 14:07:19 -04:00
github-actions[bot]
120d579c88 Merge 200d3aa26d into dev 2020-10-22 11:57:58 +00:00
Gabor Kiss-Vamosi
200d3aa26d fix build with out lv_conf.h
Fixes: #1860
2020-10-22 13:57:25 +02:00
github-actions[bot]
e6a4860d96 Merge c03160abc2 into dev 2020-10-22 11:55:51 +00:00
Gabor Kiss-Vamosi
c03160abc2 add lv_conf_kvoncfig.h to handle special Kconfig options 2020-10-22 13:55:12 +02:00
Gabor Kiss-Vamosi
232d6a5530 merge master 2020-10-21 14:15:37 +02:00
Gabor Kiss-Vamosi
757df9eb89 Update version to 7.7.1-dev 2020-10-21 14:10:24 +02:00
github-actions[bot]
63ea07c0ab Merge aec831d277 into dev 2020-10-21 12:09:15 +00:00
Gabor Kiss-Vamosi
aec831d277 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-10-21 14:08:29 +02:00
Gabor Kiss-Vamosi
d3cafedb65 remove pycache files 2020-10-21 14:08:16 +02:00
Gabor Kiss-Vamosi
16a4023abf reorganize release script 2020-10-21 14:06:48 +02:00
Gabor Kiss-Vamosi
9c78f86880 Merge branch 'master' into dev 2020-10-20 13:33:37 +02:00
Gabor Kiss-Vamosi
6fb4235c66 prepare to release v7.7.0 2020-10-20 13:32:57 +02:00
github-actions[bot]
8627389837 Merge 64c68ec25b into dev 2020-10-20 11:28:56 +00:00
Gabor Kiss-Vamosi
64c68ec25b release.py: add lv_sim_emscripten 2020-10-20 13:27:14 +02:00
github-actions[bot]
5e1b08131b Merge 62a21e912c into dev 2020-10-19 10:34:20 +00:00
Gabor Kiss-Vamosi
62a21e912c Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-10-19 12:33:42 +02:00
Gabor Kiss-Vamosi
df49f8656d fix image transformation
Fixes: #1854
2020-10-19 12:33:34 +02:00
github-actions[bot]
eb2ad01a89 Merge 3d4284b02c into dev 2020-10-18 16:33:09 +00:00
Themba Dube
3d4284b02c stm32: use DSB to ensure GPU clock gets enabled 2020-10-18 12:32:22 -04:00
github-actions[bot]
0dd1dc41be Merge 4ca5d4e86d into dev 2020-10-16 11:13:15 +00:00
Gabor Kiss-Vamosi
4ca5d4e86d Update ROADMAP.md 2020-10-16 13:12:46 +02:00
github-actions[bot]
6f41624b14 Merge 55d78e1f92 into dev 2020-10-16 11:06:54 +00:00
Gabor Kiss-Vamosi
55d78e1f92 Update ROADMAP.md 2020-10-16 13:06:21 +02:00
github-actions[bot]
dcaa2e037f Merge cf8e40fcbe into dev 2020-10-16 09:28:14 +00:00
Gabor Kiss-Vamosi
cf8e40fcbe Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-10-16 11:27:35 +02:00
Gabor Kiss-Vamosi
8d9c0bd9b2 fix define_set to check define name end too 2020-10-16 11:27:24 +02:00
github-actions[bot]
e32b3bf13b Merge 8c0ab944af into dev 2020-10-15 13:22:29 +00:00
Gabor Kiss-Vamosi
8c0ab944af Update ROADMAP.md 2020-10-15 15:21:55 +02:00
github-actions[bot]
77b4bd597b Merge 79433deeb8 into dev 2020-10-13 10:56:14 +00:00
Gabor Kiss-Vamosi
79433deeb8 Update ROADMAP.md 2020-10-13 12:55:43 +02:00
github-actions[bot]
8a54450984 Merge ddb4ae8685 into dev 2020-10-13 09:53:40 +00:00
Gabor Kiss-Vamosi
ddb4ae8685 fix lv_win_clean() 2020-10-13 11:53:03 +02:00
github-actions[bot]
5a946fc3f4 Merge 489f426b27 into dev 2020-10-12 13:49:28 +00:00
Gabor Kiss-Vamosi
489f426b27 fix rectangle border drawing with large width 2020-10-12 15:48:43 +02:00
Gabor Kiss-Vamosi
8cddd4bdab fix conflicts 2020-10-12 13:16:43 +02:00
Gabor Kiss-Vamosi
b1b233d249 fix warning 2020-10-12 13:15:48 +02:00
Gabor Kiss-Vamosi
c4f8959e65 remove version control text
Fixes #1846
2020-10-12 12:58:04 +02:00
github-actions[bot]
5347779e50 Merge 68629c725a into dev 2020-10-12 10:44:29 +00:00
Gabor Kiss-Vamosi
68629c725a add missing fonts
fixes: #1845
2020-10-12 12:43:51 +02:00
github-actions[bot]
a81a8b8d3e Merge 20363b09e6 into dev 2020-10-12 10:09:46 +00:00
Gabor Kiss-Vamosi
20363b09e6 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-10-12 12:09:08 +02:00
Gabor Kiss-Vamosi
4d620d3771 fix dropdown selection with RTL basedirection
Related to: #1842
2020-10-12 12:08:49 +02:00
Gabor Kiss-Vamosi
6d120b1f7f Merge branch 'dev' of https://github.com/littlevgl/lvgl into dev 2020-10-12 11:55:22 +02:00
Gabor Kiss-Vamosi
5d0c00a201 update CHANGELOG 2020-10-12 11:54:54 +02:00
Gabor Kiss-Vamosi
9a029a1784 make DMA2S non blovking 2020-10-12 11:53:56 +02:00
Sergei Kolotovchenkov
cb5ad1e9d3 Improve compatibility with C++14 (#1843) 2020-10-12 11:53:56 +02:00
Gabor Kiss-Vamosi
4d614e60ef skip objects in groups if they are in disabled state 2020-10-12 11:53:56 +02:00
github-actions[bot]
6fcfe72df6 Merge e1f222d04f into dev 2020-10-09 13:12:06 +00:00
Sergei Kolotovchenkov
e1f222d04f Improve compatibility with C++14 (#1843) 2020-10-09 09:11:34 -04:00
github-actions[bot]
de7cb0fa71 Merge 56c4cab228 into dev 2020-10-09 08:34:38 +00:00
Gabor Kiss-Vamosi
56c4cab228 skip objects in groups if they are in disabled state 2020-10-09 10:34:02 +02:00
github-actions[bot]
0429c501b7 Merge 5d91c24723 into dev 2020-10-08 13:19:22 +00:00
Gabor Kiss-Vamosi
5d91c24723 support RTL in pretty layout (draw columns right to left)
Related to #1833
2020-10-08 15:18:30 +02:00
github-actions[bot]
8ec2030cab Merge 6e48cde2f1 into dev 2020-10-08 12:31:00 +00:00
embeddedt
6e48cde2f1 Fix #1837: remove last designated initializer in lv_color.h 2020-10-08 08:30:29 -04:00
github-actions[bot]
73c0bf6439 Merge 9ec4b61417 into dev 2020-10-07 18:18:09 +00:00
robekras
9ec4b61417 Fix #1798: Use AHB3 enable register for STM32H7 (#1840) 2020-10-07 14:17:38 -04:00
github-actions[bot]
28c9cf0aa5 Merge 6c426aa855 into dev 2020-10-07 12:03:39 +00:00
Gabor Kiss-Vamosi
6c426aa855 fix warnings 2020-10-07 14:03:06 +02:00
github-actions[bot]
2b47542bbd Merge c804fadf40 into dev 2020-10-07 11:55:43 +00:00
Gabor Kiss-Vamosi
c804fadf40 remove the internal usage of LV_HOR/VER_RES_MAX 2020-10-07 13:55:06 +02:00
github-actions[bot]
d9c75f61c5 Merge 1ee9c13a1d into dev 2020-10-07 11:49:04 +00:00
Gabor Kiss-Vamosi
1ee9c13a1d revert debug changes in material theme 2020-10-07 13:48:31 +02:00
github-actions[bot]
0b5f414ca8 Merge 0266244c58 into dev 2020-10-07 11:48:30 +00:00
Gabor Kiss-Vamosi
0266244c58 support RTL in table (draw columns right to left)
Related to #1833
2020-10-07 13:47:49 +02:00
github-actions[bot]
beda277316 Merge f1a198bd93 into dev 2020-10-07 10:45:39 +00:00
Gabor Kiss-Vamosi
f1a198bd93 fix imgbtn state change 2020-10-07 12:44:54 +02:00
github-actions[bot]
63c4b43a57 Merge 1d50bc962d into dev 2020-10-07 10:23:59 +00:00
Gabor Kiss-Vamosi
1d50bc962d theme update to support text selection background
Fixes #1820
2020-10-07 12:23:24 +02:00
github-actions[bot]
ec616da1ac Merge fff3a00de2 into dev 2020-10-06 09:32:55 +00:00
Gabor Kiss-Vamosi
fff3a00de2 fix lv_disp_get_inactive_time if the disp==NULL
Fixes #1836
2020-10-06 11:25:37 +02:00
github-actions[bot]
6f312e34e3 Merge faf50714a1 into dev 2020-10-06 09:24:17 +00:00
Gabor Kiss-Vamosi
faf50714a1 update release script 2020-10-06 11:23:40 +02:00
Gabor Kiss-Vamosi
3c9468a621 Update dev version 2020-10-06 09:54:32 +02:00
Gabor Kiss-Vamosi
e41bc28817 Merge branch 'master' into dev 2020-10-06 09:33:59 +02:00
Gabor Kiss-Vamosi
8b6bb63795 prepare to release v7.6.1 2020-10-06 09:30:37 +02:00
Gabor Kiss-Vamosi
0de2cc9a8e fix conflicts 2020-10-06 09:30:00 +02:00
Gabor Kiss-Vamosi
3d8a19a0ca fix version number 2020-10-06 09:29:13 +02:00
Gabor Kiss-Vamosi
bc626dc9d0 update CHANGELOG 2020-10-06 08:59:07 +02:00
github-actions[bot]
38a9426135 Merge 6b24c949f1 into dev 2020-10-05 18:46:45 +00:00
Gabor Kiss-Vamosi
6b24c949f1 fix lv_img offset usage
Fixes: https://forum.lvgl.io/t/problem-with-lv-img-set-offset-y-in-ver-7/3330
2020-10-05 20:46:09 +02:00
github-actions[bot]
44709caf6f Merge e557b0fbac into dev 2020-10-05 12:31:49 +00:00
embeddedt
e557b0fbac Only check __STDC_VERSION__ if __cplusplus is not defined 2020-10-05 08:31:20 -04:00
github-actions[bot]
b124f4d7e0 Merge 3dabec4cae into dev 2020-10-05 08:53:33 +00:00
Amir Gonnen
3dabec4cae Run test on dev branch as well (#1835) 2020-10-05 10:53:02 +02:00
github-actions[bot]
4092c71a45 Merge 78ecdd1f1d into dev 2020-10-05 07:44:20 +00:00
Gabor Kiss-Vamosi
78ecdd1f1d Update ROADMAP.md 2020-10-05 09:43:52 +02:00
Gabor Kiss-Vamosi
4c2c1dd8bd fix conflicts 2020-10-05 09:42:59 +02:00
Gabor Kiss-Vamosi
e33e1df4af Merge branch 'feature/vg-lite-support-dev-7-7' of https://github.com/NXPmicro/lvgl into NXPmicro-feature/vg-lite-support-dev-7-7 2020-10-05 09:23:53 +02:00
github-actions[bot]
4c7a2ae0b7 Merge 96478a0c3e into dev 2020-10-03 12:38:29 +00:00
C47D
96478a0c3e lv_conf_internal: Check for LV_CONF_INCLUDE_SIMPLE before defining it. 2020-10-03 08:37:49 -04:00
github-actions[bot]
61437e793a Merge 86ddaf90a7 into dev 2020-10-02 19:46:11 +00:00
Gabor Kiss-Vamosi
86ddaf90a7 material theme: do not set the text font to allow easy global font change 2020-10-02 21:45:32 +02:00
Ali Rostami
8394d92fac Cursor (#1789)
* update lv_obj_refresh_style describtion.

* cursor added.

* refresh chart after setting the cursor

* add new direction and a bug fixed.

* fixed the wrong changes for header file.

* rename lv_cursor_direction_t enum members.

* add lv_chart_get_x_from_index and lv_chart_get_y_from_index

* lv_chart_get_x_from_index supports column chart type too.

* fix the error of no lv_coord_t value return.

* fix a bug based on the coord is with respect to the series area.

* make get_series_area function global.

* fix the name of get_series_area function.

* add the description of the added functions.

* chart cursor minor fixes

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
2020-10-02 13:59:05 +02:00
jozba
fc2206105b Fixed include paths (#1823)
Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>
2020-10-02 13:12:41 +02:00
jozba
b049b7e1f6 Bugfix/mgg 562 lvgl pxp symbol prefix missing include path update blit limit (#1830)
* PXP: Updated area threshold, fixed symbol names, minor fixes

- Area threshold of 1 left from debugging, changed to 32 for performance
reasons.
- Fixed naming convention of symbols (prefix LV_GPU_)
- Fixed include paths (no need to add src folder into include paths)
- Comments changed to doxygen

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Code formatting

Applied code-format.sh script.

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>
2020-10-02 13:10:09 +02:00
github-actions[bot]
cf1ca20750 Merge 34e0fefeb3 into dev 2020-10-02 10:26:54 +00:00
Gabor Kiss-Vamosi
34e0fefeb3 fix imgbtn image switching with empty style 2020-10-02 12:26:12 +02:00
Gabor Kiss-Vamosi
a12d54855f Update CHANGELOG.md 2020-10-02 11:35:15 +02:00
ryanpowers
6d1a72b522 Text selection enhancement (#1829)
* Corrected bug in styles of labels with selections

Text selection color (text_selection_color) property was incorrectly
being applied to the text color if there was a selection. The sel_color
property in the label descriptor was initialized to blue. This property
was intended to be the label background color under a selection.

* Add new property for the color of selected text

New property for labels: text_sel_font_color
This property will change the color of the font within selected text.

* Rename text selection color properties

Per feedback from issue #1820, sel_color is now sel_bg_color and
sel_font_color is now sel_color. This results in clearer naming.

Co-authored-by: Ryan Powers <ryan.powers@envision-tek.com>
2020-10-02 11:34:28 +02:00
github-actions[bot]
f37cbafad6 Merge 79d72f9286 into dev 2020-10-02 08:55:42 +00:00
Gabor Kiss-Vamosi
79d72f9286 Fix click focus 2020-10-02 10:54:53 +02:00
Themba Dube
e7bb0382c4 Merge remote-tracking branch 'origin/master' into dev 2020-10-01 10:34:08 -04:00
Gabor Kiss-Vamosi
0b1590d9ac Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-10-01 16:24:01 +02:00
Gabor Kiss-Vamosi
d14e642fc7 fix style transitions with style caching
related to #1825
2020-10-01 16:23:54 +02:00
Martino Facchin
535c3d506f Allow inclusion of local lv_conf_internal.h (#1822)
* Allow inclusion of local lv_conf_internal.h

A wrapper library cna contain an lv_conf.h file and it would be automatically picked up by the buildsystem

* Guard __has_include and simplify code

* Make number sign indentation consistent

Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com>
2020-10-01 13:51:33 +02:00
Gabor Kiss-Vamosi
8bed30db34 handle sub pixel rendering in font loader 2020-10-01 13:28:22 +02:00
Gabor Kiss-Vamosi
f6df9b490e Update CHANGELOG.md 2020-10-01 13:18:00 +02:00
Gabor Kiss-Vamosi
5770a09e73 Update CHANGELOG.md 2020-10-01 13:16:52 +02:00
Ali Rostami
c2c130889d use margin in the header part of calendar. (#1817)
* use margin in the header part of calendar.

* make calendar_init same as before based on new changes of pad and margin in calendar_header.
2020-10-01 13:16:00 +02:00
Jozef Bastek
ed90f36984 VG-Lite: Added support for fill and BLIT
VG-Lite accelerated features:
  - fill (+ transparency)
  - BLIT (+ transparency)

Limitation:
  Image width must be aligned to 16 for VG-Lite to process the buffer.

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>
2020-09-30 17:38:25 +02:00
github-actions[bot]
540856a8bc Merge 8c824b265e into dev 2020-09-30 04:55:39 +00:00
Gabor Kiss-Vamosi
8c824b265e style cahce: add margin 2020-09-30 06:55:05 +02:00
github-actions[bot]
f1690be7fc Merge 5a0006cd3c into dev 2020-09-29 07:34:27 +00:00
Gabor Kiss-Vamosi
5a0006cd3c Update ROADMAP.md 2020-09-29 09:33:57 +02:00
github-actions[bot]
25bd804724 Merge 07746a78d5 into dev 2020-09-28 13:32:34 +00:00
Gabor Kiss-Vamosi
07746a78d5 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-09-28 15:31:55 +02:00
Gabor Kiss-Vamosi
a24e3f619f dropdown list fixes with Bidi == RTL 2020-09-28 11:48:27 +02:00
Gabor Kiss-Vamosi
5be1fcadca fix copying base dir in lv_obj_craete 2020-09-28 11:48:06 +02:00
github-actions[bot]
03c526514d Merge 8ff5e23378 into dev 2020-09-28 09:08:17 +00:00
Gabor Kiss-Vamosi
8ff5e23378 Update ROADMAP.md 2020-09-28 11:07:49 +02:00
github-actions[bot]
ef0c8690e4 Merge ce11b4c71c into dev 2020-09-28 08:51:58 +00:00
Gabor Kiss-Vamosi
ce11b4c71c fix build error 2020-09-28 10:51:26 +02:00
github-actions[bot]
0d62025e2c Merge f0fc45eb52 into dev 2020-09-28 08:43:39 +00:00
Gabor Kiss-Vamosi
f0fc45eb52 checkbox: do not play transition on manual state change 2020-09-28 10:43:05 +02:00
github-actions[bot]
115314b140 Merge ffd9b872d9 into dev 2020-09-27 12:47:45 +00:00
Gabor Kiss-Vamosi
ffd9b872d9 fix BIDI support in dropdown list 2020-09-27 14:47:11 +02:00
github-actions[bot]
22fbde4501 Merge 71669c252c into dev 2020-09-23 17:59:22 +00:00
Gabor Kiss-Vamosi
71669c252c Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-09-23 19:58:45 +02:00
Gabor Kiss-Vamosi
672537dcc2 propogate checkbox state change to bullet and label too 2020-09-23 19:26:22 +02:00
github-actions[bot]
a45ff2c574 Merge 6b06ac4b72 into dev 2020-09-23 17:24:37 +00:00
embeddedt
6b06ac4b72 Fix grammar error in README.md 2020-09-23 13:24:00 -04:00
github-actions[bot]
2f7369e771 Merge b2d201dba7 into dev 2020-09-23 10:42:07 +00:00
embeddedt
b2d201dba7 Fix #1795: ensure switch/bar visual state matches logical state (#1805) 2020-09-23 06:41:37 -04:00
github-actions[bot]
695d8e5462 Merge 2b49a7eb28 into dev 2020-09-23 09:00:53 +00:00
Gabor Kiss-Vamosi
2b49a7eb28 add missing style cache invalidation on state change 2020-09-23 11:00:15 +02:00
Gabor Kiss-Vamosi
0b3759201f Update CHANGELOG.md 2020-09-23 10:23:45 +02:00
Ali Rostami
23f5a11340 Table fmt (#1803)
* update lv_obj_refresh_style describtion.

* fmt version of lv_table_set_cell_value added.

* fix a bug.

* add include lv_printf.h

* fix a bug for LV_USE_BIDI in lv_table_set_cell_value_fmt

* fix a missed part for arabic_persian chars in lv_table_set_cell_value
2020-09-23 10:23:37 +02:00
github-actions[bot]
a590f91fd0 Merge 686a3b5271 into dev 2020-09-23 08:14:44 +00:00
Gabor Kiss-Vamosi
686a3b5271 Update ROADMAP.md 2020-09-23 10:14:06 +02:00
Gabor Kiss-Vamosi
27eb84667f Update CHANGELOG.md 2020-09-23 09:59:09 +02:00
jozba
1508320aa8 PXP support for NXP RTxxx MCUs (#1702)
* PXP: Added basic PXP acceleration

PXP accelerated features:
 - fill (+ opacity)
 - BLIT (+ opacity)
 - recoloring (+ opacity)
 - color keying (+ opacity)

Recoloring + color keying simultaneously not supported.

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Added abstraction for interrupt handling

Previous imlpementation used IRQ polling on PXP, which doesn't allow
real CPU offload. Therefore added set of callbacks for interrupt
handling that should be implemented by user, with possible RTOS
integration.

Default/example implementation of callbacks for bare metal and FreeRTOS
provided (lv_gpu_nxp_pxp_osa.c), enabled by
LV_USE_GPU_NXP_PXP_DEFAULT_OSA switch, accesible via pxp_default_cfg
structure.

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Optimized cache flushing

Previous implementation flushed areas of (LCD width * object height)
size. Cache flush is expensive operation and flushing line by line,
smallest possible area, boost performance by shortening time spent on
cache flushes.

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Added documentation for NXP PXP accelerator

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: added missing extern c in header files

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Fixed ifdefs - Removed LV_USE_GPU, fixed internal config

LV_USE_GPU is not intended as a global GPU enable switch. It's used only
for gpu_blend_cb and gpu_fill_cb callbacks, which are obsolete. This
patch removes LV_USE_GPU dependency for PXP code, so it's enabled only
with LV_USE_GPU_NXP_PXP symbol.

Added missing symbols to internal conf, so automatic testd can pass
build step.

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Default OSA changed to PXP auto-initialization

Auto init feature added so if user run FreeRTOS or bare-metal, no PXP
Init code is required. Renamed symbol to be more clear.

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Documentation moved to docs repo

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>

* PXP: Fixed alpha configuration

- Coverity issue: AS blend config used uninitialized structure. No
impact on functionality, as blend module is not used (porter-duff blends
in this case)
- Alpha config fixed - swapped alpha values produced different result
from SW render

Signed-off-by: Jozef Bastek <jozef.bastek@nxp.com>
2020-09-23 09:57:38 +02:00
github-actions[bot]
ea16ce5dd0 Merge eb056315c3 into dev 2020-09-22 13:54:10 +00:00
xennex22
eb056315c3 Changed non-debug macro expansion (#1808) 2020-09-22 09:53:36 -04:00
github-actions[bot]
64a4fff635 Merge ddf33b2fd9 into dev 2020-09-22 09:24:13 +00:00
Gabor Kiss-Vamosi
ddf33b2fd9 release.py: update docs only in the end 2020-09-22 11:23:34 +02:00
Gabor Kiss-Vamosi
e9476f4767 Merge branch 'dev' of https://github.com/lvgl/lvgl into dev 2020-09-22 10:51:09 +02:00
Gabor Kiss-Vamosi
04e2b94c06 Merge branch 'master' into dev 2020-09-22 10:46:38 +02:00
Gabor Kiss-Vamosi
f2bd86ed7c prepare to release v7.6.0 2020-09-22 10:39:15 +02:00
github-actions[bot]
39f4c15876 Merge 783dc6be9a into dev 2020-09-22 08:37:22 +00:00
Gabor Kiss-Vamosi
783dc6be9a update release script 2020-09-22 10:36:48 +02:00
github-actions[bot]
39f1b363fd Merge 18db4d83bc into dev 2020-09-22 07:27:24 +00:00
Michael Simon
18db4d83bc Highlight selected option if show_selected is false (#1810) 2020-09-22 09:26:56 +02:00
Gabor Kiss-Vamosi
458046b9b0 add v7.7 to changelog 2020-09-22 09:24:59 +02:00
github-actions[bot]
23ba19d068 Merge 4d87007c95 into dev 2020-09-22 04:21:17 +00:00
github-actions[bot]
0576300981 Merge 2415f99a20 into dev 2020-09-22 04:21:00 +00:00
Gabor Kiss-Vamosi
4d87007c95 Delete a.patch 2020-09-22 06:20:45 +02:00
Gabor Kiss-Vamosi
2415f99a20 Delete r.patch 2020-09-22 06:20:34 +02:00
github-actions[bot]
77fd862b3f Merge 1c930dc8fb into dev 2020-09-22 04:20:10 +00:00
Gabor Kiss-Vamosi
1c930dc8fb Update CHANGELOG.md 2020-09-22 06:19:45 +02:00
github-actions[bot]
259907b788 Merge 83c9145072 into dev 2020-09-22 04:18:24 +00:00
incity
83c9145072 Update CHANGELOG.md (#1809) 2020-09-22 06:17:51 +02:00
github-actions[bot]
02afe7f82c Merge 94a6dc08d8 into dev 2020-09-21 22:05:35 +00:00
embeddedt
94a6dc08d8 Check for a Cortex-M7 before calling cache functions (#1806) 2020-09-21 18:05:06 -04:00
tosriram
5ef1df9357 Extend maximum number of table cell styles from 4 to 16 (#1800) 2020-09-21 11:50:54 -04:00
github-actions[bot]
a81574543b Merge cbd3393d7c into dev 2020-09-21 09:58:26 +00:00
Gabor Kiss-Vamosi
cbd3393d7c Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-09-21 11:57:47 +02:00
Gabor Kiss-Vamosi
7def9a9bb2 add Arduino example 2020-09-21 11:57:37 +02:00
Gabor Kiss-Vamosi
1067d04c03 fix font laoder supprt LV_FONT_FMT_TXT_LARGE 2020-09-21 11:57:20 +02:00
github-actions[bot]
b09d5a846c Merge 2820cf897f into dev 2020-09-17 13:09:42 +00:00
github-actions[bot]
33dbc82a0c Merge 18a4869e62 into dev 2020-09-17 13:09:41 +00:00
Gabor Kiss-Vamosi
2820cf897f Update ROADMAP.md 2020-09-17 15:09:11 +02:00
Gabor Kiss-Vamosi
18a4869e62 Update ROADMAP.md 2020-09-17 15:08:59 +02:00
github-actions[bot]
adce9d72fc Merge d90f5d0144 into dev 2020-09-17 11:26:04 +00:00
Gabor Kiss-Vamosi
d90f5d0144 Update CHANGELOG.md 2020-09-17 13:25:33 +02:00
github-actions[bot]
9461e48998 Merge 565643e883 into dev 2020-09-16 17:55:03 +00:00
Themba Dube
565643e883 lv_gauge: fix invalidation with angle offset 2020-09-16 13:54:23 -04:00
github-actions[bot]
132e6d11b4 Merge 7756d70705 into dev 2020-09-16 13:23:52 +00:00
Gabor Kiss-Vamosi
7756d70705 Update ROADMAP.md 2020-09-16 15:23:21 +02:00
github-actions[bot]
dbbf4a406f Merge be4f7a76d4 into dev 2020-09-16 13:22:05 +00:00
embeddedt
be4f7a76d4 Fix gauge end arc segment not being rendered (#1796) 2020-09-16 15:21:33 +02:00
github-actions[bot]
537456cea5 Merge d547d8afe1 into dev 2020-09-16 09:51:23 +00:00
Gabor Kiss-Vamosi
d547d8afe1 cleant the Arduino example folders 2020-09-16 11:50:41 +02:00
github-actions[bot]
fb6e3518ea Merge 2614d1342e into dev 2020-09-15 10:30:09 +00:00
Gabor Kiss-Vamosi
2614d1342e update relaese script 2020-09-15 12:29:37 +02:00
github-actions[bot]
0287b759ac Merge 3c6741b11c into dev 2020-09-15 10:20:27 +00:00
Amir Gonnen
3c6741b11c Update build_micropython.yml (#1794)
Fetch both head and merge commits of "pull" refs. This would allow the CI script to first try checkout the merge commit (which is `github.sha` on PR) and only if that fails, default to checking out the PR head.
2020-09-15 12:19:56 +02:00
Gabor Kiss-Vamosi
9b953abbd2 Update dev version 2020-09-15 11:56:57 +02:00
Gabor Kiss-Vamosi
ac52762c20 update lv_cnf_internal.h 2020-09-15 11:44:13 +02:00
Gabor Kiss-Vamosi
9093395478 fix version number 2020-09-15 11:35:50 +02:00
Gabor Kiss-Vamosi
dc0f9253d4 Merge branch 'master' into dev 2020-09-15 11:19:33 +02:00
Gabor Kiss-Vamosi
c5bacff2fa prepare to release v7.5.0 2020-09-15 11:14:32 +02:00
github-actions[bot]
b60714a710 Merge 5a6da9a2ef into dev 2020-09-14 19:49:32 +00:00
Gabor Kiss-Vamosi
5a6da9a2ef fix selectiion of options with non-ASCII letters in dropdown list 2020-09-14 21:48:57 +02:00
github-actions[bot]
38e4e5d385 Merge d99ea10213 into dev 2020-09-14 19:17:19 +00:00
Gabor Kiss-Vamosi
d99ea10213 fix drawing images with 1 px height or width 2020-09-14 21:16:43 +02:00
Gabor Kiss-Vamosi
59791a8e2f perform style change check in lv_obj_set_state() with LV_USE_ANIMATION == 0 too 2020-09-14 20:42:03 +02:00
github-actions[bot]
f4cdea6a0d Merge 5566935a5d into dev 2020-09-14 18:28:03 +00:00
Gabor Kiss-Vamosi
5566935a5d Update CHANGELOG.md 2020-09-14 20:27:35 +02:00
github-actions[bot]
f874b61bd3 Merge b947465da1 into dev 2020-09-14 18:15:08 +00:00
Gabor Kiss-Vamosi
b947465da1 fix divisioin by zero in draw_pattern (lv_draw_rect.c) if the image or letter is not found 2020-09-14 20:14:33 +02:00
github-actions[bot]
efb0ca04a0 Merge d44b8d47d3 into dev 2020-09-14 10:46:20 +00:00
Sergei Kolotovchenkov
d44b8d47d3 Improve compatibility with ARM Compiler V6 with C++98 mode (#1788)
* Fixed infinite loop during calculation size of lv_list

* Fixed msvc 2019 compiler error C4576 when using the LVGL inside C++ code

* Refactoring to make autocomplete less noisy

* Improve compatibility with ARM Compiler V6 with C++98 mode

* Replaced non-ascii symbol

* Fixed CI build error

* Refactoring, added ability to override _LV_COLOR_HAS_MODERN_CPP
2020-09-14 12:45:53 +02:00
github-actions[bot]
eb79d9263c Merge 96e0de063a into dev 2020-09-14 10:45:00 +00:00
liebman
96e0de063a fix lv_align_y/mid_y to align y and not x (#1792) 2020-09-14 12:44:28 +02:00
github-actions[bot]
3994a5425d Merge 81ec2d1b10 into dev 2020-09-14 08:46:57 +00:00
Gabor Kiss-Vamosi
81ec2d1b10 add LV_GC_ROOT prefix to _lv_font_decompr_buf 2020-09-14 10:46:20 +02:00
Gabor Kiss-Vamosi
de1d6b2581 add 8px an 10 px built in fonts 2020-09-14 10:43:26 +02:00
github-actions[bot]
e4a1a800d1 Merge 55d05c2eb3 into dev 2020-09-12 23:15:47 +00:00
embeddedt
55d05c2eb3 Fix #1791: add NULL check for group->obj_focus 2020-09-12 19:15:21 -04:00
github-actions[bot]
160d92ba69 Merge e236cf7f73 into dev 2020-09-11 12:26:03 +00:00
Michael Simon
e236cf7f73 Do not use an anim if pwd_show_time is 0 (#1786) 2020-09-11 14:25:33 +02:00
Gabor Kiss-Vamosi
17fd875f4b merge master 2020-09-11 14:19:43 +02:00
Gabor Kiss-Vamosi
38cf5c0b3e remove code accidentally merged from dev branch 2020-09-11 14:07:56 +02:00
Gabor Kiss-Vamosi
3d0c5f7207 Merge branch 'master' into dev 2020-09-11 13:46:08 +02:00
Gabor Kiss-Vamosi
e2183750f2 fix warnings 2020-09-11 13:42:57 +02:00
Gabor Kiss-Vamosi
c55b165150 add font decompr_buf to GC roots 2020-09-11 13:39:05 +02:00
Gabor Kiss-Vamosi
50b5e3c477 add rounding to btnmatrix line height calculation
Fixes #1776
2020-09-11 13:28:34 +02:00
Amir Gonnen
1b3e1c4331 Fix submodule checkout in both push and PR (#1783) 2020-09-10 19:20:59 -04:00
Gabor Kiss-Vamosi
3f36139469 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-09-10 16:08:03 +02:00
Gabor Kiss-Vamosi
125e6e95f6 fix color bleeding on corner clipping
Fixes #1777
2020-09-10 16:07:42 +02:00
Gabor Kiss-Vamosi
1f8450b453 lv_conf_internal fixes 2020-09-10 09:16:42 +02:00
github-actions[bot]
1c96215db9 Merge c683a3612d into dev 2020-09-08 13:57:22 +00:00
梁永祥
c683a3612d group fix calling lv_obj_invalidate() when focuse is NULL (#1774) 2020-09-08 15:56:51 +02:00
github-actions[bot]
42cdab2e98 Merge 50594851f6 into dev 2020-09-08 12:58:06 +00:00
Gabor Kiss-Vamosi
50594851f6 Update ROADMAP.md 2020-09-08 14:57:38 +02:00
github-actions[bot]
6f8f293241 Merge a2685363e8 into dev 2020-09-08 12:48:24 +00:00
Gabor Kiss-Vamosi
a2685363e8 Update ROADMAP.md 2020-09-08 14:47:56 +02:00
Gabor Kiss-Vamosi
893c53476c fix define name in lv_conf_internal.h 2020-09-08 14:47:00 +02:00
Gabor Kiss-Vamosi
a8e3fc594e add Kconfig support to lv_conf_internal.h 2020-09-08 14:39:19 +02:00
github-actions[bot]
3247a10f2c Merge 8b7ffccd64 into dev 2020-09-08 11:45:50 +00:00
Gabor Kiss-Vamosi
8b7ffccd64 Update ROADMAP.md 2020-09-08 13:45:22 +02:00
Gabor Kiss-Vamosi
b87ca71824 fix warnings 2020-09-08 13:44:03 +02:00
Gabor Kiss-Vamosi
c94f9358d1 style change check fixes 2020-09-08 13:41:57 +02:00
Gabor Kiss-Vamosi
49052a7f06 Merge branch 'dev' of https://github.com/littlevgl/lvgl into dev 2020-09-08 13:39:24 +02:00
Gabor Kiss-Vamosi
966ff9d186 Merge branch 'master' into dev 2020-09-08 13:39:04 +02:00
Gabor Kiss-Vamosi
81884401d2 style change check 2020-09-08 13:20:29 +02:00
github-actions[bot]
715b40fb3f Merge b87d16fc6e into dev 2020-09-07 08:19:11 +00:00
Gabor Kiss-Vamosi
b87d16fc6e fix textra focus event sending 2020-09-07 10:18:37 +02:00
github-actions[bot]
75ca0e6e2e Merge b1c43d329d into dev 2020-09-07 08:13:53 +00:00
Gabor Kiss-Vamosi
b1c43d329d update comments in lv_port_disp_template 2020-09-07 10:13:17 +02:00
github-actions[bot]
4073e43e34 Merge 710ec7d417 into dev 2020-09-07 07:21:14 +00:00
Gabor Kiss-Vamosi
710ec7d417 Update ROADMAP.md 2020-09-07 09:20:41 +02:00
github-actions[bot]
c73004caef Merge 176eb9fd46 into dev 2020-09-06 10:50:36 +00:00
Gabor Kiss-Vamosi
176eb9fd46 Update ROADMAP.md 2020-09-06 12:50:08 +02:00
github-actions[bot]
dc500aa19e Merge a6150ea78f into dev 2020-09-05 11:46:33 +00:00
Amir Gonnen
a6150ea78f CI - Build Micropython with LVGL submodule (#1771) 2020-09-05 13:46:07 +02:00
github-actions[bot]
366c3abdff Merge 35c7197d1c into dev 2020-09-04 11:31:09 +00:00
tgillbe
35c7197d1c Fix button matrix button width (#1768) 2020-09-04 07:30:39 -04:00
github-actions[bot]
2074146b30 Merge 15e692d596 into dev 2020-09-04 11:11:22 +00:00
Gabor Kiss-Vamosi
15e692d596 fix conflicts 2020-09-04 13:10:44 +02:00
Gabor Kiss-Vamosi
1ab87eda09 update CHANGELOG 2020-09-04 13:07:29 +02:00
Gabor Kiss-Vamosi
804c3c7994 fix unexpeted DEFOCUS on lv_page
Fixes #1762
2020-09-04 13:06:19 +02:00
Michael Simon
1b638565b0 lv_textarea: send event when Enter is pressed in one-line mode (#1769) 2020-09-03 08:08:04 -04:00
github-actions[bot]
61fa7eed6b Merge 0596088544 into dev 2020-09-01 17:19:58 +00:00
Gabor Kiss-Vamosi
0596088544 remove unused variable 2020-09-01 19:19:25 +02:00
github-actions[bot]
1cc17f7888 Merge 85bd12a794 into dev 2020-09-01 17:15:14 +00:00
Gabor Kiss-Vamosi
85bd12a794 fix lv_obj_del and lv_obj_clean if the children list changed during deletion
https://forum.lvgl.io/t/lv-obj-del-and-kin-wrongly-assume-that-child-ll-wont-change-while-deleting/3091
2020-09-01 19:14:39 +02:00
Gabor Kiss-Vamosi
4613811c45 lmeter: fix uninitialized 'mirror' property 2020-09-01 19:14:34 +02:00
github-actions[bot]
9ce57485ab Merge 03c3838605 into dev 2020-09-01 14:46:11 +00:00
Gabor Kiss-Vamosi
03c3838605 arc: use value_update in lv_arc_set_value
it was overwritten on merge
2020-09-01 16:45:36 +02:00
Gabor Kiss-Vamosi
1d875eaa22 fix conflicts 2020-09-01 16:43:05 +02:00
Gabor Kiss-Vamosi
b4a8a21d26 update changelog 2020-09-01 13:01:21 +02:00
github-actions[bot]
6bfba0e02a Merge fb6e7deadf into dev 2020-09-01 10:24:43 +00:00
Gabor Kiss-Vamosi
fb6e7deadf Update CHANGELOG.md 2020-09-01 12:24:18 +02:00
github-actions[bot]
bc80633a0d Merge d941461052 into dev 2020-09-01 10:21:03 +00:00
Gabor Kiss-Vamosi
d941461052 release script fixes 2020-09-01 12:20:28 +02:00
Gabor Kiss-Vamosi
0104d436e9 Update dev version 2020-09-01 12:06:21 +02:00
Gabor Kiss-Vamosi
3d32290ee4 fix version number 2020-09-01 11:59:50 +02:00
Gabor Kiss-Vamosi
6932b6c1da Merge branch 'master' into dev 2020-09-01 11:42:11 +02:00
Gabor Kiss-Vamosi
6d7bd355ed fix version lv_conf_template.h 2020-09-01 11:39:54 +02:00
Gabor Kiss-Vamosi
343605ebac prepare to release v7.4.0 2020-09-01 11:34:10 +02:00
Gabor Kiss-Vamosi
beec11565c update changelog 2020-09-01 11:29:08 +02:00
Gabor Kiss-Vamosi
beb3d40d24 fix conflicts 2020-09-01 10:47:39 +02:00
Gabor Kiss-Vamosi
26b36dfea1 release.py minor update to run in debugger 2020-09-01 10:45:27 +02:00
Gabor Kiss-Vamosi
289fd95c3d release.py: remove debug statements 2020-09-01 10:42:58 +02:00
Gabor Kiss-Vamosi
2f79133685 release.py: remove debug statements 2020-09-01 10:42:32 +02:00
Gabor Kiss-Vamosi
e42128e937 minor release related fixes 2020-09-01 10:18:35 +02:00
Gabor Kiss-Vamosi
de38ee4a21 fix typo 2020-09-01 09:40:16 +02:00
Gabor Kiss-Vamosi
612308f281 lv_img: check blend modes in cover check 2020-09-01 09:38:25 +02:00
Gabor Kiss-Vamosi
f545a24bbd gauge: allow not recoling the image needle 2020-09-01 09:38:25 +02:00
Gabor Kiss-Vamosi
1102cfdf82 lv_arc_set_value: be sure the 'fixed' angle is corerct 2020-09-01 09:38:25 +02:00
Gabor Kiss-Vamosi
775f1a59df lv_refr: take opa_scale into account in cover check 2020-09-01 09:38:25 +02:00
github-actions[bot]
1906a623fb Merge 35ae1a28d4 into dev 2020-09-01 07:27:19 +00:00
Gabor Kiss-Vamosi
35ae1a28d4 fixes in release.py 2020-09-01 09:26:41 +02:00
Gabor Kiss-Vamosi
842eb11448 release.py: add projec update 2020-08-31 19:48:59 +02:00
github-actions[bot]
ca9c36e081 Merge 5976973111 into dev 2020-08-31 12:18:35 +00:00
Alex-I-B
5976973111 Proposed fix for roller widget crash when LV_USE_GROUP=0 (#1761)
Removed LV_USE_GROUP guard macro for signals != LV_SIGNAL_CONTROL in signal functions of roller and spinbox to allow signal propagating to ancestors
2020-08-31 14:18:07 +02:00
github-actions[bot]
b7baa01bc1 Merge 91cfb70856 into dev 2020-08-31 12:10:04 +00:00
Gabor Kiss-Vamosi
91cfb70856 fix ci 2020-08-31 14:04:23 +02:00
github-actions[bot]
5ee4d14788 Merge 09ce595239 into dev 2020-08-31 12:03:15 +00:00
Gabor Kiss-Vamosi
09ce595239 fix ci 2020-08-31 14:02:43 +02:00
github-actions[bot]
5d02b27b1f Merge d4c3567f84 into dev 2020-08-31 12:01:26 +00:00
Gabor Kiss-Vamosi
d4c3567f84 install libpng for test 2020-08-31 14:00:49 +02:00
Gabor Kiss-Vamosi
39bf116e07 fix screenshot testing 2020-08-31 13:58:51 +02:00
Gabor Kiss-Vamosi
10eeeb2490 image cover check: minor reordering for better performance 2020-08-31 13:58:51 +02:00
github-actions[bot]
eb7f0d8eeb Merge 694d9eff19 into dev 2020-08-31 09:06:49 +00:00
Gabor Kiss-Vamosi
694d9eff19 Update ROADMAP.md 2020-08-31 11:06:04 +02:00
tgillbe
d4e40fce63 Fix position of 0 in special keyboard (#1758) 2020-08-31 10:15:16 +02:00
github-actions[bot]
6e000c97f8 Merge 9b9cd36dc9 into dev 2020-08-28 14:00:44 +00:00
Gabor Kiss-Vamosi
9b9cd36dc9 fix roller width if selected text is larger than the normal 2020-08-28 16:00:04 +02:00
rabbitsaviola
8df8700bed Add async gpu wait interface (#1736)
Add async gpu wait interface
Closes #1708
2020-08-28 15:31:30 +02:00
Gabor Kiss-Vamosi
c17f2f7e84 fix conflicts 2020-08-28 10:25:34 +02:00
Gabor Kiss-Vamosi
c3953f478f fix conflicts 2020-08-28 10:20:34 +02:00
Gabor Kiss-Vamosi
adf65b6761 Fix _lv_txt_ins with zero length insert text
Closes #1754
2020-08-28 09:53:56 +02:00
Adam Martini
cb5faa64ac Add update_value private function to lv_arc to prevent set_value return checks in the event of… (#1748)
Add update_value to lv_arc to update the value on range change.
2020-08-27 09:51:11 +02:00
Gabor Kiss-Vamosi
832000ad34 Merge pull request #1743 from lvgl/dcache_cb
lv_disp: add `clean_dcache_cb` callback
2020-08-27 09:48:56 +02:00
Gabor Kiss-Vamosi
037d3d9090 run code formatter 2020-08-26 15:21:24 +02:00
github-actions[bot]
6772ceb7e2 Merge e7364f321d into dev 2020-08-25 13:22:04 +00:00
Gabor Kiss-Vamosi
e7364f321d update CHANGELOG 2020-08-25 15:21:25 +02:00
github-actions[bot]
d9afdb5316 Merge 14a2a60bf9 into dev 2020-08-25 13:19:24 +00:00
Gabor Kiss-Vamosi
14a2a60bf9 Fix btnmatrix to not send event when CLICK_TRIG = true and the cursor slid from a pressed button
Fixes: https://forum.lvgl.io/t/v7-3-register-button-in-button-matrix-only-after-touch-release-not-button-release/3117
2020-08-25 15:18:45 +02:00
Themba Dube
350269c3d4 Update CHANGELOG.md 2020-08-25 07:38:08 -04:00
Gabor Kiss-Vamosi
52c61b115f minor image zoom fixes 2020-08-25 11:54:12 +02:00
Themba Dube
7ca806ddff Use CMSIS cache functions if custom callback is not registered 2020-08-24 10:51:09 -04:00
github-actions[bot]
c8be0df768 Merge 78f2451b2a into dev 2020-08-24 14:01:31 +00:00
Gabor Kiss-Vamosi
78f2451b2a imporve image zoom precision 2020-08-24 16:00:53 +02:00
Themba Dube
36433c2144 Rename function to lv_disp_clean_dcache and use currently refreshing display 2020-08-24 07:36:44 -04:00
github-actions[bot]
2224ce95cb Merge 54b3ba39fb into dev 2020-08-24 08:53:19 +00:00
Gabor Kiss-Vamosi
54b3ba39fb Fix deleting tabview with LEFT/RIGHT tab position 2020-08-24 10:52:48 +02:00
github-actions[bot]
9a2d2b5392 Merge ede6085429 into dev 2020-08-24 08:14:36 +00:00
Gabor Kiss-Vamosi
ede6085429 img: imporve zoom precision 2020-08-24 10:14:01 +02:00
github-actions[bot]
3ea4418727 Merge 961f295b94 into dev 2020-08-24 07:51:36 +00:00
Gabor Kiss-Vamosi
961f295b94 img: fix zooming and rotateing mosaic images 2020-08-24 09:50:52 +02:00
github-actions[bot]
12b1f1f590 Merge 848c468b06 into dev 2020-08-24 04:40:41 +00:00
Gabor Kiss-Vamosi
848c468b06 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-08-24 06:40:08 +02:00
Gabor Kiss-Vamosi
ba94b9cc94 fix croping of last column/row if an image is zoomed
Fixes #1742
2020-08-24 06:39:57 +02:00
Themba Dube
a1f47e9051 Add lv_arc_set_adjustable and lv_arc_get_adjustable 2020-08-23 07:46:00 -04:00
Themba Dube
ff357db938 Merge branch 'dev' into dcache_cb 2020-08-23 07:43:49 -04:00
github-actions[bot]
2f26d0a511 Merge 851493a188 into dev 2020-08-23 11:20:37 +00:00
Ali Rostami
851493a188 Update lv_obj_refresh_style description (#1746) 2020-08-23 07:20:07 -04:00
github-actions[bot]
5f35e46be8 Merge 7e4769e319 into dev 2020-08-23 06:50:03 +00:00
Gabor Kiss-Vamosi
7e4769e319 fix using LV_SCROLLBAR_UNHIDE after LV_SCROLLBAR_ON
Fixes https://forum.lvgl.io/t/lv-sb-mode-unhide-has-an-unsuitable-value/3081
2020-08-23 08:49:27 +02:00
github-actions[bot]
75a0a5e6d6 Merge c0f6ff4d42 into dev 2020-08-23 05:45:08 +00:00
Gabor Kiss-Vamosi
c0f6ff4d42 fix color bleeding on border drawing
Fixes https://forum.lvgl.io/t/border-dont-cover-calendar/3029/4
2020-08-23 07:44:34 +02:00
github-actions[bot]
fef3a069d6 Merge 35e09885fb into dev 2020-08-22 21:38:06 +00:00
Themba Dube
35e09885fb lv_arc: use rotation when calculating drag angle
fixes #1745
2020-08-22 17:37:29 -04:00
Themba Dube
24c2921c21 lv_disp: add clean_dcache_cb callback 2020-08-21 09:53:13 -04:00
github-actions[bot]
001fabbb18 Merge f4b4df8a17 into dev 2020-08-20 21:53:52 +00:00
Amir Gonnen
f4b4df8a17 lv_arc_set_reverse: remove prototype with no implementation (#1741)
Required for Micropython
2020-08-20 17:53:23 -04:00
github-actions[bot]
41d093ea76 Merge 953753263c into dev 2020-08-20 05:07:01 +00:00
Gabor Kiss-Vamosi
953753263c fix warning 2020-08-20 07:06:23 +02:00
github-actions[bot]
8990544b42 Merge 809497f707 into dev 2020-08-19 21:31:30 +00:00
Gabor Kiss-Vamosi
809497f707 release.py: fix blog post name 2020-08-19 23:30:57 +02:00
github-actions[bot]
148e6d12fd Merge 45cc51d48c into dev 2020-08-19 21:29:09 +00:00
Gabor Kiss-Vamosi
45cc51d48c release.py: publish blog post 2020-08-19 23:28:34 +02:00
github-actions[bot]
187f4be2ee Merge 677ce48bea into dev 2020-08-18 15:03:21 +00:00
Gabor Kiss-Vamosi
677ce48bea tabview: fix press state style update
fixes: #1728
2020-08-18 17:02:42 +02:00
github-actions[bot]
6023bb4372 Merge d0cc9283e7 into dev 2020-08-18 09:58:04 +00:00
Gabor Kiss-Vamosi
d0cc9283e7 merge dev 2020-08-18 11:57:26 +02:00
Gabor Kiss-Vamosi
71e5618380 upadte release.py 2020-08-18 11:32:43 +02:00
Gabor Kiss-Vamosi
bcb6d02acf fix version 2020-08-18 10:54:43 +02:00
Gabor Kiss-Vamosi
f116073baf fix version 2020-08-18 10:54:10 +02:00
Gabor Kiss-Vamosi
6e884615d8 fix version 2020-08-18 10:53:37 +02:00
Gabor Kiss-Vamosi
d665294669 fix release script 2020-08-18 10:53:08 +02:00
Gabor Kiss-Vamosi
cc43762030 Update dev version 2020-08-18 10:45:41 +02:00
Gabor Kiss-Vamosi
9c7c395cc7 Merge branch 'dev' of https://github.com/lvgl/lvgl into dev 2020-08-18 10:45:36 +02:00
Gabor Kiss-Vamosi
9680d5bbb2 Update dev version 2020-08-18 10:43:47 +02:00
Gabor Kiss-Vamosi
96534d58e5 Merge branch 'master' into dev 2020-08-18 10:40:39 +02:00
Gabor Kiss-Vamosi
1088492449 prepare to release v7.3.1 2020-08-18 10:28:35 +02:00
github-actions[bot]
9b154d12c1 Merge e9ee46f302 into dev 2020-08-18 08:26:00 +00:00
Gabor Kiss-Vamosi
e9ee46f302 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-08-18 10:25:28 +02:00
Gabor Kiss-Vamosi
c0714d9c6b fix release script 2020-08-18 10:25:19 +02:00
Gabor Kiss-Vamosi
e728ba1928 remove debug statements from release.py 2020-08-18 10:22:02 +02:00
github-actions[bot]
b94ca2bf80 Merge 74aae39e4e into dev 2020-08-18 08:13:00 +00:00
Gabor Kiss-Vamosi
74aae39e4e Update CHANGELOG.md 2020-08-18 10:12:32 +02:00
github-actions[bot]
b9bd436b89 Merge 6eab2adfc1 into dev 2020-08-18 08:12:25 +00:00
Gabor Kiss-Vamosi
6eab2adfc1 Merge pull request #1732 from ali-rostami/gray_day_calendar
init disabled days to gray color in calendar
2020-08-18 10:11:56 +02:00
Gabor Kiss-Vamosi
209e1c4d38 fix conflicts 2020-08-18 08:50:31 +02:00
Gabor Kiss-Vamosi
056da0f922 fix color picker invalidation in rectangle mode 2020-08-18 08:47:08 +02:00
Gabor Kiss-Vamosi
e1a84f2cfe Merge pull request #1734 from daiyinger/dev
Reduced animation callback interface calls
2020-08-18 06:41:24 +02:00
Gabor Kiss-Vamosi
b77bd763c0 merge master 2020-08-18 06:36:42 +02:00
xiaobo
437e6d35eb Reduced animation callback interface calls 2020-08-18 11:25:40 +08:00
Gabor Kiss-Vamosi
3b06d4ab84 rewrite the release script 2020-08-17 23:51:23 +02:00
Ali Rostami
3a5ad7712e init disabled days to gray color in calendar
In ver6 we saw that disabled days in `calendar` were gray, which was a good thing and seemed was missed in new versions.
2020-08-17 16:10:44 +04:30
Gabor Kiss-Vamosi
28eb766904 comment updates 2020-08-17 09:20:35 +02:00
Gabor Kiss-Vamosi
4af6c62146 Merge pull request #1726 from upbeat27/lv_btnmatrix_set_one_check_fix
Fix `lv_btnmatrix_set_one_check` not forcing one button to be checked
2020-08-17 09:11:12 +02:00
Josh McAtee
96eba8e0ff Fix lv_btnmatrix_set_one_check not forcing one button to be checked 2020-08-14 09:06:44 -07:00
github-actions[bot]
95ccd877a8 Merge 1815ff4b99 into dev 2020-08-14 04:58:44 +00:00
Gabor Kiss-Vamosi
1815ff4b99 Limit extra button click area of button matrix's buttons. Fixes #1712 2020-08-14 06:58:00 +02:00
Gabor Kiss-Vamosi
c8cc9db7f0 table: fix typo 2020-08-14 06:58:00 +02:00
Gabor Kiss-Vamosi
b8ebca8d6c update CHANGELOG 2020-08-14 00:03:14 +02:00
Gabor Kiss-Vamosi
245a47a848 Merge branch 'dev' of https://github.com/littlevgl/lvgl into dev 2020-08-13 23:56:40 +02:00
Gabor Kiss-Vamosi
c46f12b97a fix conflicts 2020-08-13 23:55:48 +02:00
github-actions[bot]
db2ddd6033 Merge de1ccc269c into dev 2020-08-13 21:28:29 +00:00
Gabor Kiss-Vamosi
de1ccc269c Update README.md 2020-08-13 23:28:03 +02:00
Gabor Kiss-Vamosi
cd9f53c4b4 Merge pull request #1717 from fabiowguerra/feat/dynamic-font-loading
Feat/dynamic font loading
2020-08-13 22:46:23 +02:00
github-actions[bot]
25afed1d58 Merge f3e91634f8 into dev 2020-08-13 19:09:24 +00:00
Gabor Kiss-Vamosi
f3e91634f8 fix crash if 'lv_table_set_col_cnt' is called before 'lv_table_set_row_cnt' for the first time
Fixes #1716
2020-08-13 21:08:50 +02:00
Gabor Kiss-Vamosi
6980277aca Update CHANGELOG 2020-08-13 20:09:43 +02:00
Gabor Kiss-Vamosi
f59a206ab0 send gesture with dragging too.
User can test dragging manually with  lv_indev_is_dragging
2020-08-13 20:07:18 +02:00
Gabor Kiss-Vamosi
4eb3283342 Merge pull request #1592 from acumartini/feature/1568_lv_rotary
Feature/1568 lv rotary
2020-08-13 20:05:13 +02:00
Gabor Kiss-Vamosi
c2b5979e91 arc: fix event sending 2020-08-13 12:00:57 +02:00
Gabor Kiss-Vamosi
cfee7e8b8a arc knob invalidation fix 2020-08-13 11:03:04 +02:00
Fabio Guerra
6fcca7dd44 Better comments, explaining memory allocation strategy when parsing fonts. 2020-08-12 11:02:43 -03:00
Fabio Guerra
f1edd3a1ea Removing #ifdef for LVGL version 6 on binary font parser. 2020-08-12 11:02:43 -03:00
Gabor Kiss-Vamosi
d321e0e4fc fix tests 2020-08-12 14:29:50 +02:00
Gabor Kiss-Vamosi
8d89bf9ed0 fix CHANGELOG 2020-08-12 14:23:53 +02:00
Gabor Kiss-Vamosi
f8b991731f Merge branch 'dev' into feat/dynamic-font-loading 2020-08-12 14:20:47 +02:00
github-actions[bot]
77b57ba035 Merge 08684b31ee into dev 2020-08-12 04:58:43 +00:00
Ali Rostami
08684b31ee Patch 1 (#1714)
update comments
2020-08-12 06:58:15 +02:00
Gabor Kiss-Vamosi
977f6d210d Merge pull request #1715 from lvgl/checkbox_anim
Fade in checkmark for material theme
2020-08-12 06:22:21 +02:00
Fabio Guerra
e399b7a085 Code format with astyle. 2020-08-12 00:45:06 -03:00
Fabio Guerra
b3634790cd Implementing missing formats for font loading. 2020-08-12 00:11:02 -03:00
Themba Dube
3dad4c724e Fade in checkmark for material theme 2020-08-11 10:49:57 -04:00
Gabor Kiss-Vamosi
d95cf0a3d6 arc: rework knob to indicate the current positoin 2020-08-11 15:03:57 +02:00
Gabor Kiss-Vamosi
14a4c190c9 merge rotary to arc 2020-08-11 14:17:05 +02:00
Gabor Kiss-Vamosi
461619411d Merge branch 'dev' into acumartini-feature/1568_lv_rotary 2020-08-11 12:31:32 +02:00
Gabor Kiss-Vamosi
c36c8e11f7 Merge branch 'master' into acumartini-feature/1568_lv_rotary 2020-08-11 12:31:24 +02:00
github-actions[bot]
11a9dedbaa Merge 2068ab3211 into dev 2020-08-11 08:38:47 +00:00
Gabor Kiss-Vamosi
2068ab3211 bar, switch, slider: fix drawing background's 'value_str' twice 2020-08-11 10:38:16 +02:00
github-actions[bot]
d94bbd4f91 Merge 28807b6a77 into dev 2020-08-11 08:34:41 +00:00
Gabor Kiss-Vamosi
28807b6a77 lv_img_design: fix cover check if angle != 0 2020-08-11 10:34:04 +02:00
github-actions[bot]
d71f664fbb Merge f066f0b8d8 into dev 2020-08-11 08:10:17 +00:00
Gabor Kiss-Vamosi
f066f0b8d8 fix overflow in large image transformations 2020-08-11 10:09:41 +02:00
github-actions[bot]
e30055674d Merge d2e1094159 into dev 2020-08-10 18:14:00 +00:00
Sergei Kolotovchenkov
d2e1094159 Fix Visual Studio 2019 compile errors (#1711)
Fixed msvc 2019 compiler error C4576 when using the LVGL inside C++ code
2020-08-10 14:13:26 -04:00
github-actions[bot]
73a918ce13 Merge 6fd7bcf172 into dev 2020-08-10 09:37:17 +00:00
Gabor Kiss-Vamosi
6fd7bcf172 allow adding extra label to list buttons 2020-08-10 11:36:43 +02:00
github-actions[bot]
b88ee8e430 Merge ebaeb1bf7c into dev 2020-08-10 04:18:01 +00:00
Gabor Kiss-Vamosi
ebaeb1bf7c Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-08-10 06:17:17 +02:00
Gabor Kiss-Vamosi
bd8ac58b6b add missing background drawing and radius handling to image button 2020-08-10 06:17:03 +02:00
github-actions[bot]
fcca7fff60 Merge b6c18ed171 into dev 2020-08-09 10:41:53 +00:00
Gabor Kiss-Vamosi
b6c18ed171 Update ROADMAP.md 2020-08-09 12:41:25 +02:00
github-actions[bot]
872030fb77 Merge 90be42c493 into dev 2020-08-08 14:22:34 +00:00
Gabor Kiss-Vamosi
90be42c493 Fix setting local style property multiple times
Realted to https://forum.lvgl.io/t/how-to-change-button-object-color-on-demand/2922/2
2020-08-08 16:22:00 +02:00
Fabio Guerra
c4e7254aed Some changes to support binary fonts without the kernel table. 2020-08-07 10:56:37 -03:00
github-actions[bot]
1b40c2a495 Merge 81caeaa725 into dev 2020-08-07 11:32:00 +00:00
embeddedt
81caeaa725 Fix lv_obj_set_height_fit 2020-08-07 07:31:31 -04:00
github-actions[bot]
1ca9dc6c4e Merge 8af9e96299 into dev 2020-08-06 12:57:04 +00:00
Gabor Kiss-Vamosi
8af9e96299 Merge pull request #1706 from satirebird/code-fixes
Make several descriptor parameters const
2020-08-06 14:56:36 +02:00
github-actions[bot]
70ac65793f Merge 5d981f56ad into dev 2020-08-06 12:55:23 +00:00
Gabor Kiss-Vamosi
5d981f56ad remove unused variable 2020-08-06 14:54:51 +02:00
github-actions[bot]
e16eb8e830 Merge cda21694c4 into dev 2020-08-06 12:51:07 +00:00
Gabor Kiss-Vamosi
58d86cff71 Merge branch 'master' into code-fixes 2020-08-06 14:51:05 +02:00
Gabor Kiss-Vamosi
cda21694c4 Fix text decor (udnerline strikethrough) with older versions of font converter 2020-08-06 14:50:30 +02:00
Gabor Kiss-Vamosi
7af20516a5 add linemeter's mirror feature again
the drawing part was somehow removed
2020-08-06 14:50:30 +02:00
github-actions[bot]
2cab9d12d6 Merge 21985e9a14 into dev 2020-08-06 09:40:58 +00:00
Gabor Kiss-Vamosi
21985e9a14 Update FUNDING.yml 2020-08-06 11:40:30 +02:00
Sven Krauß
7827d948d8 Fix evaluation of return value 2020-08-05 11:18:56 +02:00
Sven Krauß
3b7fa645fb Merge tag 'v7.3.0' into code-fixes
Conflicts:
	src/lv_draw/lv_draw_rect.c
2020-08-05 11:14:27 +02:00
Sven Krauß
28f74bd91d Make several descriptor parameters const, update parameter docs.
Making the descriptor const allows to use static initialized variables.
2020-08-05 10:53:03 +02:00
github-actions[bot]
0e1fda5c37 Merge 1f0a4918f2 into dev 2020-08-05 08:04:45 +00:00
Gabor Kiss-Vamosi
1f0a4918f2 Update ROADMAP.md 2020-08-05 10:04:16 +02:00
Fabio Guerra
004adac31d Adding changes to changelog and replacing line style comments with block comments. 2020-08-05 01:29:54 -03:00
Fabio Guerra
f58d97d990 Adding support to dynamic font loading. 2020-08-04 18:59:49 -03:00
github-actions[bot]
4b1a0d590f Merge bd4db19aee into dev 2020-08-04 16:53:12 +00:00
Gabor Kiss-Vamosi
bd4db19aee rename lv_chart_clear_serie to lv_chart_clear_series and lv_obj_align_origo to lv_obj_align_mid 2020-08-04 18:52:37 +02:00
github-actions[bot]
5c3640868c Merge b4955f0b6e into dev 2020-08-04 16:44:11 +00:00
Gabor Kiss-Vamosi
b4955f0b6e Fix drawing value string twice
Fixes #1704
2020-08-04 18:43:34 +02:00
github-actions[bot]
cdb99b3588 Merge acb46aaed1 into dev 2020-08-04 15:37:37 +00:00
Gabor Kiss-Vamosi
acb46aaed1 Update README.md 2020-08-04 17:37:07 +02:00
github-actions[bot]
525c3bd829 Merge 7caa2bf9ad into dev 2020-08-04 15:36:56 +00:00
Gabor Kiss-Vamosi
7caa2bf9ad Update README.md 2020-08-04 17:36:27 +02:00
Gabor Kiss-Vamosi
0a9cc2a3b5 update version number 2020-08-04 17:35:17 +02:00
Gabor Kiss-Vamosi
62f4ced294 update version number 2020-08-04 17:34:44 +02:00
github-actions[bot]
2a6815c451 Merge a0f338eb6f into dev 2020-08-04 15:34:16 +00:00
Gabor Kiss-Vamosi
a0f338eb6f update changlelog 2020-08-04 17:33:39 +02:00
Gabor Kiss-Vamosi
0f0d57d855 Merge branch 'dev' of https://github.com/littlevgl/lvgl into dev 2020-08-04 17:30:46 +02:00
github-actions[bot]
5d42f92c86 Merge 5810baa021 into dev 2020-08-04 15:12:23 +00:00
github-actions[bot]
42a7fda05d Merge f36f8fe253 into dev 2020-08-04 15:11:53 +00:00
Gabor Kiss-Vamosi
5810baa021 Update library.properties 2020-08-04 17:11:51 +02:00
Gabor Kiss-Vamosi
f36f8fe253 Update library.properties 2020-08-04 17:11:19 +02:00
github-actions[bot]
d56708b45e Merge d0b408d679 into dev 2020-08-04 15:09:01 +00:00
Gabor Kiss-Vamosi
d0b408d679 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-08-04 17:08:21 +02:00
Gabor Kiss-Vamosi
7e3739576f add back library.proeprties 2020-08-04 17:07:54 +02:00
github-actions[bot]
565633828c Merge 061c6325b7 into dev 2020-08-04 12:59:36 +00:00
Gabor Kiss-Vamosi
061c6325b7 Merge pull request #1697 from Droup67/focus_padding
page: Use padding when focus an child item
2020-08-04 14:59:07 +02:00
github-actions[bot]
66c184a84d Merge e3a07ed58c into dev 2020-08-04 09:24:50 +00:00
Gabor Kiss-Vamosi
e3a07ed58c update release.py 2020-08-04 11:24:13 +02:00
github-actions[bot]
e1963a4a3d Merge eb76519d25 into dev 2020-08-04 08:08:03 +00:00
github-actions[bot]
05f6b67b5f Merge 48f8d83bdc into dev 2020-08-04 08:07:32 +00:00
Gabor Kiss-Vamosi
eb76519d25 Release v7.3.0 2020-08-04 10:07:30 +02:00
Gabor Kiss-Vamosi
7b0a0ef4a7 Run code formatter 2020-08-04 10:07:29 +02:00
Gabor Kiss-Vamosi
48f8d83bdc update release.py 2020-08-04 10:06:57 +02:00
github-actions[bot]
a728817fb5 Merge ad422250db into dev 2020-08-04 07:58:01 +00:00
Gabor Kiss-Vamosi
ad422250db update release.py 2020-08-04 09:57:29 +02:00
github-actions[bot]
243c448df9 Merge ec7397e4a0 into dev 2020-08-04 07:50:33 +00:00
Gabor Kiss-Vamosi
ec7397e4a0 update release.py 2020-08-04 09:49:57 +02:00
github-actions[bot]
245de140f4 Merge 0ec409f83e into dev 2020-08-04 07:28:49 +00:00
Gabor Kiss-Vamosi
0ec409f83e fix version nnumber 2020-08-04 09:28:16 +02:00
github-actions[bot]
cc505a3cb2 Merge b58f9c6021 into dev 2020-08-04 07:20:47 +00:00
Gabor Kiss-Vamosi
b58f9c6021 Add LV_USE_OUTLINE/PATTERN/VALUE_STR and LV_MEMCPY_MEMSET_STD 2020-08-04 09:19:59 +02:00
github-actions[bot]
4560a72c32 Merge 85d375b128 into dev 2020-08-03 11:40:16 +00:00
Gabor Kiss-Vamosi
85d375b128 Update ROADMAP.md 2020-08-03 13:39:51 +02:00
github-actions[bot]
99f49f9097 Merge a0e6f7f022 into dev 2020-08-03 11:37:40 +00:00
Gabor Kiss-Vamosi
a0e6f7f022 Update ROADMAP.md 2020-08-03 13:37:11 +02:00
Droup
1c3bbc9f6c Fix focus move
Signed-off-by: Droup <droup@pm.me>
2020-08-03 10:38:18 +02:00
Gabor Kiss-Vamosi
07cb113c0a add radius, border_side and boder_post to style cache 2020-08-03 09:37:01 +02:00
Gabor Kiss-Vamosi
61a5cb44b8 optimze style asking order in lv_obj_init_draw_xxx_dsc function 2020-08-03 07:17:21 +02:00
Gabor Kiss-Vamosi
6ccfd0101a style cache: add missing LV_STYLE_FONT_TEXT to cachable proeprties 2020-08-03 07:03:54 +02:00
Gabor Kiss-Vamosi
1b29814e1e improve style caching 2020-08-03 06:43:25 +02:00
Gabor Kiss-Vamosi
ae0e855d91 style cache fixes 2020-08-02 20:49:21 +02:00
github-actions[bot]
0aa4591021 Merge c85295b5ea into dev 2020-08-02 10:05:44 +00:00
Gabor Kiss-Vamosi
c85295b5ea update CHANGELOG 2020-08-02 12:05:00 +02:00
Gabor Kiss-Vamosi
28213adfa6 -fix using freed memory in _lv_style_list_remove_style
Fixes: #1694
2020-08-02 12:05:00 +02:00
Gabor Kiss-Vamosi
11cab40103 import style caching 2020-08-02 11:36:27 +02:00
Gabor Kiss-Vamosi
41fd83e1d3 implement caching on style lists 2020-08-02 10:14:29 +02:00
github-actions[bot]
25b0b994a0 Merge 2b60f4496f into dev 2020-08-01 17:36:31 +00:00
DefinPlusPlus
2b60f4496f Fixed infinite loop during calculation size of lv_list (#1700) 2020-08-01 13:36:07 -04:00
github-actions[bot]
1d714bfed7 Merge b7d7bf7dd5 into dev 2020-07-31 20:14:15 +00:00
Gabor Kiss-Vamosi
b7d7bf7dd5 Update README.md 2020-07-31 22:13:46 +02:00
Droup
373af97472 page: Use padding when focus an child item
Signed-off-by: Droup <droup@pm.me>
2020-07-31 14:32:17 +02:00
github-actions[bot]
3e9495a074 Merge 1072b71ea0 into dev 2020-07-30 09:12:45 +00:00
Gabor Kiss-Vamosi
1072b71ea0 gauge: fix image needle drawing 2020-07-30 11:11:54 +02:00
Sven Krauß
b0e3f11da1 Make lv_draw_line_dsc_t parameters constant 2020-07-28 17:08:21 +02:00
github-actions[bot]
cb0d6f40c9 Merge 0f69469eee into dev 2020-07-28 10:19:14 +00:00
Seth Itow
0f69469eee README.md: Update link to Micropython documentation (#1693) 2020-07-28 06:18:42 -04:00
github-actions[bot]
f2a59c23f1 Merge cac6f92964 into dev 2020-07-27 18:19:43 +00:00
Gabor Kiss-Vamosi
cac6f92964 fix warning 2020-07-27 20:19:02 +02:00
github-actions[bot]
0d2784a13e Merge 80a4c6ff14 into dev 2020-07-27 15:58:55 +00:00
Gabor Kiss-Vamosi
80a4c6ff14 update CHANGELOG 2020-07-27 17:58:10 +02:00
Gabor Kiss-Vamosi
013ae48221 Merge branch 'size_reduction' 2020-07-27 17:47:25 +02:00
github-actions[bot]
daec3626bc Merge fd695c9ad3 into dev 2020-07-27 15:47:05 +00:00
Gabor Kiss-Vamosi
fd695c9ad3 textarea: fix typo in lv_textarea_set_sscrollbar_mode
Fixes #1691
2020-07-27 17:46:10 +02:00
github-actions[bot]
88ce04cea3 Merge 06d7a6d006 into dev 2020-07-27 14:01:19 +00:00
Gabor Kiss-Vamosi
06d7a6d006 btnmatrix: hadle combined states of buttons (e.g. chacked + disabled) 2020-07-27 15:57:28 +02:00
github-actions[bot]
529fee1e20 Merge ca9dfb7063 into dev 2020-07-27 12:30:52 +00:00
Gabor Kiss-Vamosi
ca9dfb7063 Update FUNDING.yml 2020-07-27 14:30:22 +02:00
github-actions[bot]
83ca45e0c8 Merge fd411e200f into dev 2020-07-27 12:30:13 +00:00
Gabor Kiss-Vamosi
fd411e200f Update and rename _FUNDING.yml to FUNDING.yml 2020-07-27 14:29:41 +02:00
github-actions[bot]
3592a2ac17 Merge 8cc951202c into dev 2020-07-27 12:18:37 +00:00
Gabor Kiss-Vamosi
8cc951202c Rename FUNDING.yml to _FUNDING.yml 2020-07-27 14:17:58 +02:00
github-actions[bot]
ac89d1245b Merge 2172ec93a2 into dev 2020-07-27 12:16:37 +00:00
Gabor Kiss-Vamosi
2172ec93a2 material theme minor fix
Fixes #1689
2020-07-27 14:16:06 +02:00
Gabor Kiss-Vamosi
c173f28a3f add underline properties to the fonts 2020-07-27 12:47:07 +02:00
github-actions[bot]
a5a7329d41 Merge ed10c1da67 into dev 2020-07-26 19:15:06 +00:00
Gabor Kiss-Vamosi
ed10c1da67 Add LV_THEME_MATERIAL_FLAG_NO_TRANSITION and LV_THEME_MATERIAL_FLAG_NO_FOCUS flags 2020-07-26 21:14:10 +02:00
github-actions[bot]
bb730735f2 Merge 834b498aec into dev 2020-07-24 19:51:40 +00:00
Gabor Kiss-Vamosi
834b498aec Update ROADMAP.md 2020-07-24 21:51:08 +02:00
github-actions[bot]
2fb690b3b9 Merge 28a668ce09 into dev 2020-07-24 19:50:15 +00:00
Gabor Kiss-Vamosi
28a668ce09 Create ROADMAP.md 2020-07-24 21:49:44 +02:00
github-actions[bot]
5a2cf28c54 Merge ed480e821c into dev 2020-07-24 14:32:06 +00:00
Gabor Kiss-Vamosi
ed480e821c Merge pull request #1684 from lvgl/pete-pjb-cpicker
Tidy up the edges of the colour picker widget.
2020-07-24 16:31:35 +02:00
Gabor Kiss-Vamosi
f11f7c5223 Merge branch 'master' into pete-pjb-cpicker 2020-07-24 16:30:39 +02:00
github-actions[bot]
3b4bff79c2 Merge f30dc5d186 into dev 2020-07-24 14:16:54 +00:00
Gabor Kiss-Vamosi
f30dc5d186 remove duplicated lines from lv_tabview_add_tab 2020-07-24 16:16:18 +02:00
pete-pjb
da5c9dd424 Add define and comment to explain magic number used in previous fix. 2020-07-24 13:50:35 +01:00
pete-pjb
89adfbc816 Fix ragged edge of Colour Picker. 2020-07-24 10:15:29 +01:00
pete-pjb
d125472e81 Update change log. 2020-07-23 14:24:28 +01:00
pete-pjb
28495b9eb9 Tidy up the edges of the colour picker widget. 2020-07-23 14:15:34 +01:00
github-actions[bot]
4fefa2ee28 Merge 00e93a5d30 into dev 2020-07-22 16:24:25 +00:00
Gabor Kiss-Vamosi
00e93a5d30 Update CHANGELOG.md 2020-07-22 18:23:56 +02:00
github-actions[bot]
95ef03baa8 Merge dae3ebdb66 into dev 2020-07-22 16:23:36 +00:00
Gabor Kiss-Vamosi
dae3ebdb66 Merge pull request #1679 from lvgl/embeddedt-patch-1
textarea: don't call LV_EVENT_INSERT too far before insertion
2020-07-22 18:22:57 +02:00
Gabor Kiss-Vamosi
fb3e6ec1f4 textarea: add insert handler functions 2020-07-22 16:28:03 +02:00
github-actions[bot]
bb4e4a9e53 Merge 4df27fc5b2 into dev 2020-07-22 14:26:22 +00:00
Gabor Kiss-Vamosi
4df27fc5b2 Update CHANGELOG.md 2020-07-22 16:25:42 +02:00
github-actions[bot]
f7870310dc Merge 3c3fe46447 into dev 2020-07-22 14:19:34 +00:00
Gabor Kiss-Vamosi
3c3fe46447 Update CHANGELOG.md 2020-07-22 16:18:49 +02:00
embeddedt
806f3a9bbf textarea: don't call LV_EVENT_INSERT too far before insertion 2020-07-21 11:16:26 -04:00
github-actions[bot]
dca7cedb28 Merge 557342cc08 into dev 2020-07-21 14:39:50 +00:00
Gabor Kiss-Vamosi
557342cc08 Do not print for missing glyph if its height OR width is zero
Fixes: #1674
2020-07-21 16:39:04 +02:00
Gabor Kiss-Vamosi
eb725a3a68 add LV_USE_FONT_SUBPX option and draw_full_border() to avoid duplication in outline and border drawing 2020-07-21 16:06:14 +02:00
Gabor Kiss-Vamosi
53f002c3f8 Merge branch 'dev' into size_reduction 2020-07-21 16:03:54 +02:00
Gabor Kiss-Vamosi
b48120947f Merge branch 'master' into size_reduction 2020-07-21 14:44:11 +02:00
Gabor Kiss-Vamosi
4659289924 Merge branch 'dev' of https://github.com/littlevgl/lvgl into dev 2020-07-21 13:43:16 +02:00
Gabor Kiss-Vamosi
cc0ea22903 increment version number to v7.4-dev 2020-07-21 13:43:05 +02:00
github-actions[bot]
c0ca1a025b Merge 35b3a1f2a4 into dev 2020-07-21 11:42:42 +00:00
Gabor Kiss-Vamosi
35b3a1f2a4 merge dev 2020-07-21 13:42:02 +02:00
Gabor Kiss-Vamosi
6731e44503 Merge branch 'dev' 2020-07-21 13:40:36 +02:00
Gabor Kiss-Vamosi
7b68e6e426 Merge branch 'master' of https://github.com/littlevgl/lvgl 2020-07-21 13:38:24 +02:00
Gabor Kiss-Vamosi
c36a96914b fix release script 2020-07-21 13:38:04 +02:00
github-actions[bot]
ab6f93db24 Merge 57079452b0 into dev 2020-07-21 11:30:20 +00:00
Gabor Kiss-Vamosi
57079452b0 Release v7.2.0 2020-07-21 13:29:37 +02:00
Gabor Kiss-Vamosi
960bca7807 Run code formatter 2020-07-21 13:29:36 +02:00
github-actions[bot]
67400d1d72 Merge ecfef570ea into dev 2020-07-17 15:35:14 +00:00
Gabor Kiss-Vamosi
ecfef570ea Merge pull request #1672 from adamhan2/fix_issue_1671
fixes #1671 lv_cont_layout_grid() fails to calculate available space in a row
2020-07-17 17:34:43 +02:00
Adam Han
75875e244d fixes #1671 lv_cont_layout_grid() fails to calculate available space in a row
this issue results in space waste in right side of container
  the size of wasted space in each row is pad_left plus pad_inner
2020-07-17 15:51:09 +01:00
github-actions[bot]
1db33435c1 Merge 2d984da893 into dev 2020-07-17 12:09:30 +00:00
Gabor Kiss-Vamosi
2d984da893 improve mono theme when used with keyboard or encoder 2020-07-17 14:08:42 +02:00
github-actions[bot]
5b062a0d8d Merge c0a7cf76b9 into dev 2020-07-17 09:42:43 +00:00
Gabor Kiss-Vamosi
c0a7cf76b9 minor fixes with LV_COLOR_DEPTH == 1 2020-07-17 11:42:08 +02:00
github-actions[bot]
44e57aaaf5 Merge d06fe5100e into dev 2020-07-17 08:26:44 +00:00
Gabor Kiss-Vamosi
d06fe5100e Merge pull request #1670 from mentha/patch-1
Fix lv_canvas_set_buffer document
2020-07-17 10:26:00 +02:00
mentha
ae94302f4d Fix lv_canvas_set_buffer doc
Lines in canvas buffers are byte aligned so buffers might request larger size and contain unused bits.
The previous documented calc method would often result in a buffer size smaller than what was expected by LVGL, leading to memory corruption and program crash.
2020-07-17 16:09:24 +08:00
Themba Dube
b26b4435a5 Add LV_USE_FONT_COMPRESSED to lv_conf_template.h 2020-07-16 18:58:28 -04:00
Themba Dube
da9a5f58d0 Don't include blending code if LV_USE_BLEND_MODES is disabled 2020-07-16 18:55:35 -04:00
Themba Dube
a4774ccc72 Add LV_USE_FONT_COMPRESSED to control support for compressed fonts 2020-07-16 18:55:25 -04:00
github-actions[bot]
a6289f5e85 Merge dd56e9a013 into dev 2020-07-16 11:09:48 +00:00
Gabor Kiss-Vamosi
dd56e9a013 set the cursor object non clickable by default
Fixes: #1664
2020-07-16 13:09:09 +02:00
github-actions[bot]
e31993bdf2 Merge 6dac633235 into dev 2020-07-15 06:58:39 +00:00
Gabor Kiss-Vamosi
6dac633235 Merge pull request #1663 from diegoherranz/readme_typos
Fix README typos
2020-07-15 08:58:10 +02:00
Diego Herranz
1d5300e02f Fix README typos 2020-07-15 07:55:27 +01:00
github-actions[bot]
b646365e2c Merge 798f3177f2 into dev 2020-07-14 15:37:09 +00:00
Gabor Kiss-Vamosi
798f3177f2 Update README.md 2020-07-14 17:36:41 +02:00
github-actions[bot]
0921cf6e3b Merge ac5f1998e4 into dev 2020-07-14 15:16:11 +00:00
Gabor Kiss-Vamosi
ac5f1998e4 Update README.md 2020-07-14 17:15:30 +02:00
github-actions[bot]
433435889a Merge a66afca68e into dev 2020-07-14 15:07:16 +00:00
Gabor Kiss-Vamosi
a66afca68e Update README.md 2020-07-14 17:06:33 +02:00
Gabor Kiss-Vamosi
b1213dcc59 remove lv_event_queue_refresh_recursive
keep only the synchronous functions for refresh for easier maintanance
2020-07-14 15:25:56 +02:00
github-actions[bot]
f8c8c4040a Merge 2f33670b4f into dev 2020-07-14 11:37:37 +00:00
Gabor Kiss-Vamosi
2f33670b4f Merge pull request #1661 from tehkillerbee/master
Handle LV_EVENT_CANCEL in list/group
2020-07-14 13:37:10 +02:00
Johannes Linde
d8e10c41cf Handle ESC/Cancel event in list 2020-07-14 12:04:53 +02:00
Gabor Kiss-Vamosi
7e38ac68e3 Update CHANGELOG.md 2020-07-13 19:59:53 +02:00
Gabor Kiss-Vamosi
abff805509 Merge pull request #1653 from mibcat/tabview-set-tab-name
widget tableview: add new function lv_tabview_set_tab_name() to change a tab name during runtime
2020-07-13 19:57:25 +02:00
Michael Katzenberger
18072b3dd4 update CHANGELOG.md 2020-07-13 19:56:06 +02:00
github-actions[bot]
4640611758 Merge baeda1998f into dev 2020-07-13 13:31:40 +00:00
pete-pjb
baeda1998f Fix chart linked list free before use bug. 2020-07-13 14:26:04 +01:00
Gabor Kiss-Vamosi
e1a09551ce fix drawing on right border 2020-07-13 09:43:18 +02:00
Michael Katzenberger
ba7a86de74 implement review findings: use C-style comments 2020-07-12 14:22:09 +02:00
Michael Katzenberger
6cb79914a8 widget tableview: add function lv_tabview_set_tab_name() to change a tab name 2020-07-12 11:46:12 +02:00
github-actions[bot]
f1f0aa621a Merge 43a77d8699 into dev 2020-07-10 13:04:49 +00:00
Gabor Kiss-Vamosi
43a77d8699 linemeter: fix arc drawing if the value is close to max value 2020-07-10 15:04:02 +02:00
github-actions[bot]
58b88bf1fb Merge 96bc397821 into dev 2020-07-10 12:57:43 +00:00
Gabor Kiss-Vamosi
96bc397821 linemeter: fix conversation of current value to "level"
Related to #1648
2020-07-10 14:57:03 +02:00
github-actions[bot]
fd508065dd Merge 416ef9e251 into dev 2020-07-09 12:42:08 +00:00
Gabor Kiss-Vamosi
416ef9e251 fix chart series area invalidation 2020-07-09 14:41:24 +02:00
Gabor Kiss-Vamosi
09250d0a92 Delete queued refresh queries 2020-07-09 14:13:21 +02:00
github-actions[bot]
822e06be39 Merge c07ef75ac5 into dev 2020-07-08 13:03:31 +00:00
Gabor Kiss-Vamosi
c07ef75ac5 update release script 2020-07-08 15:02:53 +02:00
github-actions[bot]
2a6f5d46ab Merge e3f6a3327d into dev 2020-07-08 12:59:42 +00:00
Gabor Kiss-Vamosi
e3f6a3327d Update library.json 2020-07-08 14:59:02 +02:00
github-actions[bot]
6227aaee96 Merge 08591a8e8c into dev 2020-07-08 11:43:18 +00:00
Pete Bone
08591a8e8c Merge pull request #1646 from DaPa/master
Fix lv_page_get_height_grid comment
2020-07-08 12:42:51 +01:00
DaPa
106e023c80 Fix lv_page_get_height_grid comment 2020-07-08 14:36:13 +03:00
Gabor Kiss-Vamosi
a5de71933b fix typoe in comments 2020-07-08 10:31:52 +02:00
github-actions[bot]
e85888908a Merge 1a3b6d4cb3 into dev 2020-07-08 07:36:08 +00:00
Gabor Kiss-Vamosi
1a3b6d4cb3 update lv_conf_internal.h 2020-07-08 09:35:25 +02:00
github-actions[bot]
e587ceb22e Merge b769463d39 into dev 2020-07-08 07:32:39 +00:00
Gabor Kiss-Vamosi
b769463d39 update CHANGELONG and lv_conf_internal.h 2020-07-08 09:31:52 +02:00
Gabor Kiss-Vamosi
cbc88285d3 change default fot to 14 px for better compatibility with small displays
Related to #1602
2020-07-08 09:31:52 +02:00
Gabor Kiss-Vamosi
ec64820272 tileview: fix navigation when not screen sized 2020-07-08 09:31:52 +02:00
Gabor Kiss-Vamosi
15b7ea6614 Add lv_event_send_refresh, lv_event_send_refresh_recursive, lv_event_queue_refresh_recursive
Used to easily send LV_EVENT_REFRESH to objects
2020-07-08 09:29:48 +02:00
Gabor Kiss-Vamosi
843555a4b1 Add lv_task_get_next 2020-07-08 09:29:48 +02:00
github-actions[bot]
5f4c26cb79 Merge 019042297d into dev 2020-07-08 04:27:23 +00:00
Gabor Kiss-Vamosi
019042297d Update library.json 2020-07-08 06:26:56 +02:00
github-actions[bot]
46a4469a9c Merge 646cb71a9d into dev 2020-07-07 18:41:18 +00:00
Gabor Kiss-Vamosi
646cb71a9d Update library.json 2020-07-07 20:40:33 +02:00
github-actions[bot]
ad262172de Merge 343b70b19c into dev 2020-07-07 11:09:52 +00:00
Gabor Kiss-Vamosi
343b70b19c Update auto-comment.yml 2020-07-07 13:09:26 +02:00
github-actions[bot]
b802e7e775 Merge 2cecd01b30 into dev 2020-07-07 11:07:33 +00:00
Gabor Kiss-Vamosi
2cecd01b30 Update auto-comment.yml 2020-07-07 13:07:02 +02:00
github-actions[bot]
2ba1fc625f Merge aff7a22ac5 into dev 2020-07-07 11:04:10 +00:00
Gabor Kiss-Vamosi
aff7a22ac5 Update auto-comment.yml 2020-07-07 13:03:30 +02:00
github-actions[bot]
5a23fd569b Merge 234e74202c into dev 2020-07-07 10:58:47 +00:00
Gabor Kiss-Vamosi
234e74202c image decoder open bug described in #1638 2020-07-07 12:58:13 +02:00
github-actions[bot]
914c874ada Merge a6793b2695 into dev 2020-07-07 10:45:11 +00:00
Gabor Kiss-Vamosi
a6793b2695 Update auto-comment.yml 2020-07-07 12:44:42 +02:00
Gabor Kiss-Vamosi
cae5132038 rotary: fix with low chg_rate 2020-07-07 12:35:23 +02:00
github-actions[bot]
45bf6a3862 Merge c599a59f05 into dev 2020-07-07 09:31:48 +00:00
github-actions[bot]
f00a6a118d Merge c97a0684cf into dev 2020-07-07 09:31:03 +00:00
Gabor Kiss-Vamosi
c599a59f05 Update README.md 2020-07-07 11:31:00 +02:00
Gabor Kiss-Vamosi
c97a0684cf Create auto-comment.yml 2020-07-07 11:30:35 +02:00
github-actions[bot]
418413e334 Merge faf56680f8 into dev 2020-07-07 09:30:07 +00:00
github-actions[bot]
815e0afdaf Merge b2d78dcca7 into dev 2020-07-07 09:29:50 +00:00
Gabor Kiss-Vamosi
faf56680f8 Delete auto-comment.yml 2020-07-07 11:29:41 +02:00
Gabor Kiss-Vamosi
b2d78dcca7 Create auto-comment.yml 2020-07-07 11:29:20 +02:00
Gabor Kiss-Vamosi
38e68eeb7a update version number 2020-07-07 10:06:49 +02:00
github-actions[bot]
0f69cbf087 Merge 039080fc26 into dev 2020-07-07 08:06:19 +00:00
Gabor Kiss-Vamosi
039080fc26 update changlog 2020-07-07 10:05:29 +02:00
Gabor Kiss-Vamosi
7e9cf858d6 update version number 2020-07-07 10:03:52 +02:00
Gabor Kiss-Vamosi
a740af4afb fix conflicts 2020-07-07 10:02:50 +02:00
Gabor Kiss-Vamosi
a117b3cead update relaese script 2020-07-07 10:01:28 +02:00
github-actions[bot]
e178bcc9f3 Merge d8585d2ea3 into dev 2020-07-07 07:32:59 +00:00
Gabor Kiss-Vamosi
96728e7ed9 rotary: minor refactoring 2020-07-06 11:51:26 +02:00
Adam Martini
83bdb6c347 Reverse angle delta logic 2020-07-05 14:44:11 -07:00
Adam Martini
085a6499a7 Comment updates for clarity 2020-07-05 13:59:03 -07:00
Adam Martini
b371bd3d05 Capture tick at drap start 2020-07-05 13:50:05 -07:00
Adam Martini
cf39677dfa Use tick elps 2020-07-05 13:30:07 -07:00
Adam Martini
a0bf57f529 tick type 2020-07-05 13:22:37 -07:00
Adam Martini
7a10b700e2 Remove use of tick_elaspe 2020-07-05 13:21:54 -07:00
Adam Martini
aea84d8d79 Cache timestamp for slew rate limit interation 2020-07-05 13:18:08 -07:00
Adam Martini
e3f4c11500 Remove previous thresholding and add creation defaults. Move angle caching to set value to cache last angel for type changes and external value setters. 2020-07-05 12:49:27 -07:00
Adam Martini
e256a27b5a Add slew rate limited angle delta based on threshold of degress/sec 2020-07-05 12:25:44 -07:00
github-actions[bot]
41c4c25315 Merge 9e56f750a7 into dev 2020-07-04 23:50:42 +00:00
github-actions[bot]
4396196889 Merge e6fe8436f4 into dev 2020-07-04 11:30:45 +00:00
github-actions[bot]
f3f1c606b6 Merge e9d3001dbf into dev 2020-07-03 12:49:29 +00:00
github-actions[bot]
25607ceaee Merge 4b2c3e560b into dev 2020-07-01 14:14:54 +00:00
Gabor Kiss-Vamosi
989016dff3 fix conflicts 2020-07-01 15:21:14 +02:00
Gabor Kiss-Vamosi
c54788fae4 fix conflicts 2020-07-01 15:19:29 +02:00
Themba Dube
c7fb2ad12c Merge branch 'master' into dev 2020-07-01 09:19:17 -04:00
Gabor Kiss-Vamosi
2fdeaf5599 fix conflicts 2020-07-01 15:18:48 +02:00
Pete Bone
b539e6dc46 Merge pull request #1630 from pete-pjb/dev
New functions for Check Box and a minor bug fix
2020-07-01 12:44:41 +01:00
pete-pjb
06603a9c84 New functions for Check Box and a minor bug fix
Remove use of c++ keyword 'new' from function parameter in
lv_theme_set_base() function.
Add function lv_checkbox_set_state(lv_obj_t * cb, lv_btn_state_t state).
Add function lv_checkbox_get_state(const lv_obj_t * cb)
Update Change log.
2020-07-01 12:13:46 +01:00
github-actions[bot]
6b45f3ade5 Merge 6b246b2fed into dev 2020-07-01 08:53:55 +00:00
Gabor Kiss-Vamosi
c4e7d7cb83 Merge branch 'dev' of https://github.com/littlevgl/lvgl into dev 2020-06-30 17:09:57 +02:00
github-actions[bot]
43b69a88a9 Merge 6d1da27b3c into dev 2020-06-30 07:44:39 +00:00
Gabor Kiss-Vamosi
3aa35a77cb rotary: minor fixes on dragging 2020-06-28 22:03:20 +02:00
Gabor Kiss-Vamosi
ddbeb212b7 Add support to compressed fonts without pre-filter to gain some speed by sacrificing some memory 2020-06-28 13:29:01 +02:00
Amir Gonnen
40daa7195d lv_theme: add lv_theme_set_apply_cb (#1616) 2020-06-27 17:46:22 -04:00
Gabor Kiss-Vamosi
2d7423100a fix conflicts 2020-06-27 06:57:28 +02:00
Gabor Kiss-Vamosi
6971d603d2 add lv_theme_copy 2020-06-27 06:54:47 +02:00
Adam Martini
3af55796d9 Remove uneeded point manupulaton 2020-06-26 19:39:10 -07:00
Adam Martini
200c1e788f Second pass at angle based drag. Working with proper threshold setting with knowledge of rotary range. 2020-06-26 16:54:36 -07:00
Amir Gonnen
aad9f4f0c1 Add lv_dpx inline function (#1612)
Identical to LV_DPX (no code additions)
2020-06-26 18:04:46 -04:00
Adam Martini
d271fd6108 Adjust click area extension 2020-06-26 12:35:41 -07:00
Gabor Kiss-Vamosi
76625adec2 fix typo in lv_obj_align_origo_x/y 2020-06-26 21:02:06 +02:00
Gabor Kiss-Vamosi
8b3f9f19f6 add lv_obj_align_origo_x() and lv_obj_align_origo_y() functions 2020-06-26 20:59:57 +02:00
Gabor Kiss-Vamosi
97f999ed9f add lv_obj_align_x() and lv_obj_align_y() functions 2020-06-26 20:52:21 +02:00
Gabor Kiss-Vamosi
e678a2c599 chart: add lv_chart_set_series_axis and lv_chart_set_y_range 2020-06-26 20:31:20 +02:00
Adam Martini
7e4b8aa49b Second attempt arc drag 2020-06-26 09:46:55 -07:00
Adam Martini
c36f731316 Only drag in one dimension because its too jumpy 2020-06-26 08:50:24 -07:00
Adam Martini
849d3d3255 Use point as last point 2020-06-26 08:48:12 -07:00
Adam Martini
ec4cc14bf9 Remove unsec x setter 2020-06-26 08:46:56 -07:00
Adam Martini
7de60867ef Set last drag point based on diffs 2020-06-26 08:45:41 -07:00
Adam Martini
4011d54668 Use the max x and y drag diff to control drag 2020-06-26 08:40:30 -07:00
Gabor Kiss-Vamosi
91f64c8662 Add lv_theme_set_base() to allow easy extension of built-in (or any) themes 2020-06-26 14:05:34 +02:00
Adam Martini
8bcbceef08 Send event on if the value really does change 2020-06-25 23:05:48 -07:00
Adam Martini
7ce9a969c8 Rever drag limit integration as it makes rotary control too granular 2020-06-25 22:43:54 -07:00
Adam Martini
f836e90869 Account for indev drag limit 2020-06-25 22:40:03 -07:00
Adam Martini
6d07effbc3 Revert arc tracking 2020-06-25 21:39:19 -07:00
Adam Martini
a73b316681 Remove undeclared 2020-06-25 21:27:18 -07:00
Adam Martini
70a2287568 Remove undeclared 2020-06-25 21:24:19 -07:00
Adam Martini
9e3d8c9090 Remove undeclared 2020-06-25 21:23:14 -07:00
Adam Martini
2d4c709a88 Get area width using pointer 2020-06-25 21:22:37 -07:00
Adam Martini
92ecff3fc0 WIP: dragging on ring only using lv_atan 2020-06-25 21:18:42 -07:00
Gabor Kiss-Vamosi
eb006b3d39 finialze screen animations 2020-06-25 12:43:45 +02:00
Gabor Kiss-Vamosi
f10f94bea3 use void * as theme user data for backward compatibility 2020-06-25 12:43:44 +02:00
Gabor Kiss-Vamosi
710226c6db add user_data to themes 2020-06-25 12:43:44 +02:00
Gabor Kiss-Vamosi
44a96df9fb initial implementation of screen load animation 2020-06-25 12:43:44 +02:00
embeddedt
cd788da47a Fix #1610: don't assert an expected null pointer 2020-06-25 12:43:44 +02:00
Gabor Kiss-Vamosi
c4eec78a02 lv_textarea fix cursor alignment with empty textarea when the text alignment is center or right 2020-06-25 12:43:44 +02:00
Gabor Kiss-Vamosi
1e33359d0c fix build error 2020-06-25 12:43:44 +02:00
Gabor Kiss-Vamosi
cf8357e004 fix focusing/defocusing for pages 2020-06-25 12:43:44 +02:00
Gabor Kiss-Vamosi
8f243c01d5 style: minor fix on getting style attributes + formatting 2020-06-25 12:43:44 +02:00
Gabor Kiss-Vamosi
e2aa68394c update changelog 2020-06-25 12:43:44 +02:00
Gabor Kiss-Vamosi
2828582c7a lv_img: fix invalidation area when angle or zoom changes 2020-06-25 12:43:44 +02:00
jbamaral
f6a2c635fd Improve big endian support (#1599) 2020-06-25 12:43:44 +02:00
Gabor Kiss-Vamosi
db24bf1d18 In lv_init test if the the strings are UTF-8 encoded 2020-06-25 12:42:06 +02:00
Deon Marais
8c151a2d43 Add missing lv_font_montserrat_34
if you do not mind me asking, and on matters of fonts why was Roboto changed to Montserrat when V7 was released ?
2020-06-25 12:42:06 +02:00
Adam Martini
f75428e52b Match rotary_bg line width to indicator width 2020-06-23 23:06:56 -07:00
Adam Martini
b414aa755d int32 fix to mapping logic 2020-06-23 13:33:25 -07:00
Adam Martini
5961800fe0 Fix map contract 2020-06-23 12:56:07 -07:00
Adam Martini
663af3dfb3 Shift mapping math out of floating point 2020-06-23 12:54:06 -07:00
Adam Martini
0aeb49d28a Fix Set sym end angle 2020-06-22 22:53:58 -07:00
Adam Martini
83d05f945f Fix bg_end init 2020-06-22 22:49:23 -07:00
Adam Martini
f0cae00574 Rearrange type call for clarity. Fix symmetric arc setters 2020-06-22 22:47:01 -07:00
Adam Martini
46f7dff9e2 Fix statement declaration 2020-06-22 21:56:31 -07:00
Adam Martini
9ede4ba707 typo 2020-06-22 21:54:47 -07:00
Adam Martini
1c071530ad Remove sym references 2020-06-22 21:54:03 -07:00
Adam Martini
ba10671b2b Rotary types. Add symmetric value setter 2020-06-22 21:50:21 -07:00
Adam Martini
af7134269e Force set_value handling in reverse 2020-06-21 11:15:48 -07:00
Adam Martini
19a1afbd89 Fix reverse mapping 2020-06-21 11:05:24 -07:00
Adam Martini
5359a762b8 Reverse min and max in mapping reverse 2020-06-21 10:59:41 -07:00
Themba Dube
0d0427f8bc Merge remote-tracking branch 'origin/master' into dev 2020-06-21 08:32:48 -04:00
Adam Martini
0d6b8a86d4 Try reverse mapping 2020-06-21 00:36:39 -07:00
Adam Martini
6c01490372 Use value setter for reverse start angle setting 2020-06-21 00:34:08 -07:00
Adam Martini
4ab8520bfb Use lv math abs 2020-06-21 00:29:03 -07:00
Adam Martini
d60a6cbc76 Add reverse value mapping and arc tracking 2020-06-21 00:26:20 -07:00
Adam Martini
4bedc57b7d Add setter for threshold 2020-06-21 00:08:49 -07:00
Adam Martini
e1761d50a1 Test threshold for value jupming 2020-06-21 00:05:09 -07:00
Adam Martini
856368284e Test sensitivity threshold for value jumping 2020-06-20 23:58:03 -07:00
Adam Martini
ad990994d0 Fix release drag hoping better checking for -1 last drag x 2020-06-20 23:54:25 -07:00
Adam Martini
247b5b6f0c Fix drag diff calc 2020-06-20 23:43:40 -07:00
Adam Martini
6836947e67 typo 2020-06-20 23:33:50 -07:00
Adam Martini
dc873966e9 Make sensitivity an int 2020-06-20 23:33:18 -07:00
Adam Martini
fe483e8e21 Add sensitivity default explicit 2020-06-20 23:26:22 -07:00
Adam Martini
3a31577592 Add sesitivty setter 2020-06-20 23:20:12 -07:00
Adam Martini
3721fc52a8 Typo 2020-06-20 17:25:14 -07:00
Adam Martini
a7350282f0 Use drag diff for value setting 2020-06-20 17:24:34 -07:00
Adam Martini
c93ef97ab9 Remove NULL comp 2020-06-20 17:18:53 -07:00
Adam Martini
866e088f98 Copy knob_area to ext 2020-06-20 17:16:57 -07:00
Adam Martini
15ec0f8e2f Remove value_to_set remnant. Do not override checked opacity 2020-06-20 17:15:09 -07:00
Adam Martini
fc14c2c01c Remove chechable and toggle 2020-06-20 17:11:12 -07:00
Adam Martini
71f8497ee6 Add knob_area ext 2020-06-20 16:47:23 -07:00
Adam Martini
5a0c0e2e97 Add value change event calls for dragging 2020-06-20 16:43:53 -07:00
Adam Martini
3e079a47ae Pull btn functionality out for now, make checked state make DEAFULT. Add dragging value setters. 2020-06-20 16:40:47 -07:00
Adam Martini
35c0cfcfea Use custom event as data is not transfered to CB 2020-06-20 12:23:24 -07:00
Adam Martini
fa8deb524d Mising ; 2020-06-20 12:18:53 -07:00
Adam Martini
f3773694bc Remove custom event in favor or NULL diff 2020-06-20 12:17:15 -07:00
Adam Martini
1860742c13 Fix missing ;. Add custom event last 2020-06-20 12:14:17 -07:00
Adam Martini
f6d75e759c Add btn like signal handling for knob part. Add custom event to distuinguish from VALUE_CHANGED 2020-06-20 12:12:42 -07:00
Adam Martini
9b38b35420 Static state setter 2020-06-20 11:13:37 -07:00
Adam Martini
b1afc3f34d Add rotary state 2020-06-20 11:11:26 -07:00
Adam Martini
1dfdabd638 Test btn extension 2020-06-20 11:06:06 -07:00
Adam Martini
446b0b6429 Floats working fro value mapping 2020-06-19 18:05:55 -07:00
Adam Martini
cf4db99206 Test float for mapping 2020-06-19 18:01:15 -07:00
Adam Martini
c854670062 Test float for mapping 2020-06-19 18:00:28 -07:00
Adam Martini
e100565c67 Move map function to proper func to avoid recalc of slope 2020-06-19 17:49:02 -07:00
Adam Martini
f5d9e4bff4 Fix range mapping for value setter assuming left to right indic 2020-06-19 17:39:50 -07:00
Adam Martini
7a7e1668fa Make value setter indic mapping from arc start to bg end. 2020-06-19 17:15:15 -07:00
Adam Martini
4e13d6ae4d Cast ext 2020-06-19 15:59:04 -07:00
Gabor Kiss-Vamosi
201d38c574 Add theme->apply_cb to replace theme->apply_xcb to make it compatible with the Micropython binding 2020-06-20 00:01:33 +02:00
Gabor Kiss-Vamosi
75a27e4cc7 rotary: leave the default size from arc + fix style get 2020-06-19 23:41:29 +02:00
Gabor Kiss-Vamosi
95b07a2d23 rotary: clean up 2020-06-19 23:25:17 +02:00
Gabor Kiss-Vamosi
94a710a5e1 Merge branch 'feature/1568_lv_rotary' of https://github.com/acumartini/lvgl into acumartini-feature/1568_lv_rotary 2020-06-19 23:00:03 +02:00
Adam Martini
b9dc9e81de Missing ; 2020-06-19 11:44:29 -07:00
Adam Martini
1396fce961 Fix debug import 2020-06-19 11:42:55 -07:00
Adam Martini
884be64d17 Fix rotary type getter. 2020-06-19 11:38:22 -07:00
Gabor Kiss-Vamosi
4345e05e32 test
Signed-off-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
2020-06-19 15:12:17 +02:00
Gabor Kiss-Vamosi
24b1a7735a roller: allow setting different font for the selected text 2020-06-19 13:17:45 +02:00
Adam Martini
168a7c4c45 Add theme define 2020-06-18 22:46:30 -07:00
Adam Martini
a696aef959 Use rotary param in type getter 2020-06-18 22:43:38 -07:00
Adam Martini
6dddbde387 Add ifndef to internal conf 2020-06-18 22:27:51 -07:00
Adam Martini
b9d92236e3 Add rotary to build.py defines 2020-06-18 22:25:41 -07:00
Adam Martini
2dc14fc7e5 Add missing rotary widget import 2020-06-18 22:22:22 -07:00
Adam Martini
2908a74b42 Reduce knob pad get logic 2020-06-18 17:11:15 -07:00
Adam Martini
1a41f13fd6 Initial lv_rotary work extending lv_arc with stubbed signal handler. 2020-06-18 17:06:24 -07:00
Gabor Kiss-Vamosi
b16f3ff8e7 Merge branch 'dev' of https://github.com/littlevgl/lvgl into dev 2020-06-18 16:32:14 +02:00
Pete Bone
6b3d7759cc Merge pull request #1587 from pete-pjb/dev
Finalise chart function updates
2020-06-18 14:59:19 +01:00
Pete Bone
765b6c4015 Update CHANGELOG.md 2020-06-18 14:38:07 +01:00
Gabor Kiss-Vamosi
6ae7f67ef5 Update CHANGELOG.md 2020-06-18 12:36:05 +02:00
Gabor Kiss-Vamosi
156a3c005d Update CHANGELOG.md 2020-06-18 12:35:38 +02:00
Gabor Kiss-Vamosi
a39f51a571 Merge branch 'dev' into dev 2020-06-18 07:41:54 +02:00
Gabor Kiss-Vamosi
d050c99161 Merge branch 'dev' of https://github.com/littlevgl/lvgl into dev 2020-06-18 06:04:02 +02:00
Gabor Kiss-Vamosi
1523cc0634 fix typo 2020-06-18 06:03:52 +02:00
Diego Herranz
65d029279b lv_calendar: add option to start week on Monday (#1589) 2020-06-17 16:09:40 -04:00
pete-pjb
4a953b9d9d Free memory for series_ll 2020-06-16 18:24:05 +01:00
pete-pjb
ae748cfffa Fix initialisation problem.
Found that new structure parmaeter ext_buf_assigned needs to be
initialised to false in lv_chart_add_series() as sometimes is set true
depending on what was previously in the heap where it was allocated.
2020-06-16 18:04:36 +01:00
PeterB
ad215c5b4b Finalise changes for new Chart Functions 2020-06-16 16:24:37 +01:00
Gabor Kiss-Vamosi
2dd84e6de1 Merge branch 'master' into dev 2020-06-16 16:52:18 +02:00
pete-pjb
05d249d5ee Merge branch 'master' into dev 2020-06-16 15:10:56 +01:00
Pete Bone
f746ac8542 Added functions to extend chart functionality (#1581) 2020-06-16 09:53:21 -04:00
pete-pjb
832dbd644b Remove redundant assert 2020-06-16 09:31:37 +01:00
pete-pjb
fe5663908c Fix unused variable 2020-06-15 17:29:33 +01:00
pete-pjb
f23873e3f5 Added Functions to extend chart functionality as follows:
/**
 * Set the index of the x-axis start point in the data array
 * @param chart             pointer to a chart object
 * @param ser 				pointer to a data series on 'chart'
 * @param id    			the index of the x point in the data array
 */
void lv_chart_set_x_start_point(lv_obj_t * chart, lv_chart_series_t *
ser, uint16_t id);

/**
 * Set an external array of data points to use for the chart
 * NOTE: It is the users responsibility to make sure the point_cnt
matches the external array size.
 * @param chart             pointer to a chart object
 * @param ser 				pointer to a data series on 'chart'
 * @param array				external array of points for chart
 */
void lv_chart_set_ext_array(lv_obj_t * chart, lv_chart_series_t * ser,
lv_coord_t array[], uint16_t point_cnt );

/**
 * Set an individual point value in the chart series directly based on
index
 * @param chart             pointer to a chart object
 * @param ser 				pointer to a data series on 'chart'
 * @param value				value to assign to array point
 * @param id				the index of the x point in the array
 */
void lv_chart_set_point_id(lv_obj_t * chart, lv_chart_series_t * ser,
lv_coord_t value, uint16_t id);


/**
 * get the current index of the x-axis start point in the data array
 * @param chart             pointer to a chart object
 * @param ser 				pointer to a data series on 'chart'
 * @return 					the index of the current x start point in the data array
 */
uint16_t lv_chart_get_x_start_point(lv_obj_t * chart, lv_chart_series_t
* ser);

/**
 * Get an individual point value in the chart series directly based on
index
 * @param chart             pointer to a chart object
 * @param ser 				pointer to a data series on 'chart'
 * @param id				the index of the x point in the array
 * @return					value of array point at index id
 */
lv_coord_t lv_chart_get_point_id(lv_obj_t * chart, lv_chart_series_t *
ser, uint16_t id);
2020-06-15 17:15:05 +01:00
259 changed files with 21158 additions and 4847 deletions

View File

@@ -4,4 +4,3 @@ indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

2
.github/FUNDING.yml vendored
View File

@@ -1 +1 @@
custom: ["https://littlevgl.com/donate"]
custom: ["https://paypal.me/littlevgl?locale.x=en_US"]

View File

@@ -1,14 +0,0 @@
---
name: All other issues
about: Questions and enhancement requests should go to the forum.
title: ''
labels: not-template
assignees: ''
---
# All enhancement requests or questions should be directed to the Forum.
We use GitHub issues for development related discussions.
Please use the [forum](https://forum.littlevgl.com/) to ask questions.

View File

@@ -1,29 +1,43 @@
---
name: Bug report
about: Create a report to help us improve
about: Create a bug report to help us improve
title: ''
labels: ''
assignees: ''
---
> # Important: issues that don't use this template will be ignored/closed.
<!--
IMPORTANT
Issues that don't use this template will be ignored and closed.
-->
**Describe the bug**
### Perform all steps below and tick them with [x]
- [ ] Check the related part of the [Documentation](https://docs.lvgl.io/)
- [ ] Update lvgl to the latest version
- [ ] Reproduce the issue in a [Simulator](https://docs.lvgl.io/latest/en/html/get-started/pc-simulator.html)
### Describe the bug
<!--
A clear and concise description of what the bug is.
-->
**To Reproduce**
Please provide a small, independent code sample that can be used to reproduce the issue. Ideally this should work in the PC simulator unless the problem is specific to one platform.
**Expected behavior**
### To Reproduce
<!--
Provide a small, independent code sample that can be used to reproduce the issue.
Ideally this should work in the PC simulator unless the problem is specific to a platform.
Format the code like this:
```c
your code here
```
-->
### Expected behavior
<!--
A clear and concise description of what you expected to happen.
-->
**Screenshots**
### Screenshots or video
<!--
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.
-->

View File

@@ -5,7 +5,7 @@ contact_links:
about: Be sure to read to documentation first
- name: Forum
url: https://forum.lvgl.io
about: For how-to questions use the forum
about: For topics like How-to, Getting started, Feature request
- name: CONTIBUTING.md
url: https://github.com/lvgl/lvgl/blob/master/docs/CONTRIBUTING.md#faq-about-contributing
about: The basic rules of contributing

View File

@@ -0,0 +1,29 @@
---
name: Development discussion
about: Discussion strictly related to the develoopment of the LVGL.
title: ''
labels: ''
assignees: ''
---
<!--
IMPORTANT
Issues that don't use this template will be ignored and closed.
Normal Feature requests should go to the Forum: https://forum.lvgl.io/c/feature-request/9
-->
### Introcude the problem
<!--
A clear and concise description of the problem.
-->
### Examples and cases
<!--
Mention some examples and cases where the problem or the missing feature is relevant
-->
### Suggested solution
<!--
If you already have an idea about the solution share it here
-->

12
.github/auto-comment.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
# Comment to a new issue.
pullRequestOpened: |
Thank you for raising your pull request.
To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin).
The text of DCO can be read here: https://developercertificate.org/
For a more detailed description see the [Documentation](https://docs.lvgl.io/latest/en/html/contributing/index.html#developer-certification-of-origin-dco) site.
By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO.
No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comment.

8
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,8 @@
### Description of the feature or fix
A clear and concise description of what the bug or new feature is.
### Checkpoints
- [ ] Follow the [styling guide](https://github.com/lvgl/lvgl/blob/master/docs/CODING_STYLE.md)
- [ ] Update CHANGELOG.md
- [ ] Update the documentation

2
.github/stale.yml vendored
View File

@@ -7,7 +7,7 @@ exemptLabels:
- architecture
- pinned
# Label to use when marking an issue as stale
staleLabel: stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue or pull request has been automatically marked as stale because it has not had

41
.github/workflows/build_micropython.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Build Micropython with LVGL submodule
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install SDL
run: |
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
sudo apt-get update -y -qq
sudo apt-get install libsdl2-dev
- name: Clone lv_micropython
run: git clone https://github.com/lvgl/lv_micropython.git .
- name: Update submodules
run: git submodule update --init --recursive
- name: Checkout LVGL submodule
working-directory: ./lib/lv_bindings/lvgl
run: |
git fetch --force ${{ github.event.repository.git_url }} "+refs/heads/*:refs/remotes/origin/*"
git fetch --force ${{ github.event.repository.git_url }} "+refs/pull/*:refs/remotes/origin/pr/*"
git checkout ${{ github.sha }} || git checkout ${{ github.event.pull_request.head.sha }}
git submodule update --init --recursive
- name: Build mpy-cross
run: make -j $(nproc) -C mpy-cross
- name: Build the unix port
run: make -j $(nproc) -C ports/unix
- name: Run advanced_demo
run: >
echo "import gc,utime;
utime.sleep(5);
gc.collect();
utime.sleep(5)" |
ports/unix/micropython -i lib/lv_bindings/examples/advanced_demo.py

View File

@@ -14,4 +14,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Run tests
run: cd tests; python ./build.py
run: sudo apt-get install libpng-dev; cd tests; python ./build.py

16
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
on:
issues:
types: [opened, edited]
jobs:
auto_close_issues:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Automatically close issues that don't follow the issue template
uses: lucasbento/auto-close-issues@v1.0.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-close-message: "@${issue.user.login}: hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template." # optional property
closed-issues-label: "not-template"

27
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Release
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
See the [CHANGELOG](https://github.com/lvgl/lvgl/blob/master/CHANGELOG.md)
draft: false
prerelease: false

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
scripts/release/__pycache__
**/*.o
**/*bin
**/*.swp

View File

@@ -1,7 +1,223 @@
# Changelog
## v7.1.0 (planned on 07.07.2020)
*Available in the `master` branch*
## v7.9.1 (Planned at 19.01.2020
### Bugfixes
- fix(cpicker) fix division by zero
- fix(dropdown) fix selecting options after the last one
- fix(msgbox) use the animation time provided
- fix(gpu_nxp_pxp) fix incorrect define name
- fix(indev) don't leave edit mode if there is only one object in the group
## v7.9.0 (Plann1d at 05.01.2020
### New features
- feat(chart) add lv_chart_remove_series and lv_chart_hide_series
- feat(img_cahce) allow disabling image caching
- calendar: make get_day_of_week() public
- Added support for Zephyr integration
### Bugfixes
- fix(draw_rect) free buffer used for arabic processing
- fix(win) arabic process the title of the window
- fix(dropdown) arabic process the option in lv_dropdown_add_option
- fix(textarea) buffer overflow in password mode with UTF-8 characters
- fix(textarea) cursor position after hiding character in password mode
- fix(linemeter) draw critical lines with correct color
- fix(kconfig) handle disable sprintf float correctly.
- fix(layout) stop layout after recursion threshold is reached
- fix(gauge) fix redraw with image needle
## v7.8.1
### Bugfixes
- fix(lv_scr_load_anim) fix when multiple screen are loaded at tsame time with delay
- fix(page) fix LV_SCOLLBAR_MODE_DRAG
## v7.8.0 (01.12.2020)
### New features
- make DMA2D non blocking
- add unscii-16 built-in font
- add KConfig
- add lv_refr_get_fps_avg()
### Bugfixes
- fix(btnmatrix) handle arabic texts in button matrices
- fix(indev) disabled object shouldn't absorb clicks but let the parent to be clicked
- fix(arabic) support processing again already processed texts with _lv_txt_ap_proc
- fix(textarea) support Arabic letter connections
- fix(dropdown) support Arabic letter connections
- fix(value_str) support Arabic letter connections in value string property
- fix(indev) in LV_INDEV_TYPE_BUTTON recognize 1 cycle long presses too
- fix(arc) make arc work with encoder
- fix(slider) adjusting the left knob too with encoder
- fix reference to LV_DRAW_BUF_MAX_NUM in lv_mem.c
- fix(polygon draw) join adjacent points if they are on the same coordinate
- fix(linemeter) fix invalidation when setting new value
- fix(table) add missing invalidation when changing cell type
- refactor(roller) rename LV_ROLLER_MODE_INIFINITE -> LV_ROLLER_MODE_INFINITE
## v7.7.2 (17.11.2020)
### Bugfixes
- fix(draw_triangle): fix polygon/triangle drawing when the order of points is counter-clockwise
- fix(btnmatrix): fix setting the same map with modified pointers
- fix(arc) fix and improve arc dragging
- label: Repair calculate back `dot` character logical error which cause infinite loop.
- fix(theme_material): remove the bottom border from tabview header
- fix(imgbtn) guess a the closest available state with valid src
- fix(spinbox) update cursor position in lv_spinbox_set_step
## v7.7.1 (03.11.2020)
### Bugfixes
- Respect btnmatrix's `one_check` in `lv_btnmatrix_set_btn_ctrl`
- Gauge: make the needle images to use the styles from `LV_GAUGE_PART_PART`
- Group: fix in `lv_group_remove_obj` to handle deleting hidden obejcts correctly
## v7.7.0 (20.10.2020)
### New features
- Add PXP GPU support (for NXP MCUs)
- Add VG-Lite GPU support (for NXP MCUs)
- Allow max. 16 cell types for table
- Add `lv_table_set_text_fmt()`
- Use margin on calendar header to set distances and padding to the size of the header
- Add `text_sel_bg` style property
### Bugfixes
- Theme update to support text selection background
- Fix imgbtn state change
- Support RTL in table (draw columns right to left)
- Support RTL in pretty layout (draw columns right to left)
- Skip objects in groups if they are in disabled state
- Fix dropdown selection with RTL basedirection
- Fix rectangle border drawing with large width
- Fix `lv_win_clean()`
## v7.6.1 (06.10.2020)
### Bugfixes
- Fix BIDI support in dropdown list
- Fix copying base dir in `lv_obj_create`
- Handle sub pixel rendering in font loader
- Fix transitions with style caching
- Fix click focus
- Fix imgbtn image switching with empty style
- Material theme: do not set the text font to allow easy global font change
## v7.6.0 (22.09.2020)
### New features
- Check whether any style property has changed on a state change to decide if any redraw is required
### Bugfixes
- Fix selection of options with non-ASCII letters in dropdown list
- Fix font loader to support LV_FONT_FMT_TXT_LARGE
## v7.5.0 (15.09.2020)
### New features
- Add `clean_dcache_cb` and `lv_disp_clean_dcache` to enable users to use their own cache management function
- Add `gpu_wait_cb` to wait until the GPU is working. It allows to run CPU a wait only when the rendered data is needed.
- Add 10px and 8ox built in fonts
### Bugfixes
- Fix unexpected DEFOCUS on lv_page when clicking to bg after the scrollable
- Fix `lv_obj_del` and `lv_obj_clean` if the children list changed during deletion.
- Adjust button matrix button width to include padding when spanning multiple units.
- Add rounding to btnmatrix line height calculation
- Add `decmopr_buf` to GC roots
- Fix divisioin by zero in draw_pattern (lv_draw_rect.c) if the image or letter is not found
- Fix drawing images with 1 px height or width
## v7.4.0 (01.09.2020)
The main new features of v7.4 are run-time font loading, style caching and arc knob with value setting by click.
### New features
- Add `lv_font_load()` function - Loads a `lv_font_t` object from a binary font file
- Add `lv_font_free()` function - Frees the memory allocated by the `lv_font_load()` function
- Add style caching to reduce access time of properties with default value
- arc: add set value by click feature
- arc: add `LV_ARC_PART_KNOB` similarly to slider
- send gestures event if the object was dragged. User can check dragging with `lv_indev_is_dragging(lv_indev_act())` in the event function.
### Bugfixes
- Fix color bleeding on border drawing
- Fix using 'LV_SCROLLBAR_UNHIDE' after 'LV_SCROLLBAR_ON'
- Fix croping of last column/row if an image is zoomed
- Fix zooming and rotateing mosaic images
- Fix deleting tabview with LEFT/RIGHT tab position
- Fix btnmatrix to not send event when CLICK_TRIG = true and the cursor slid from a pressed button
- Fix roller width if selected text is larger than the normal
## v7.3.1 (18.08.2020)
### Bugfixes
- Fix drawing value string twice
- Rename `lv_chart_clear_serie` to `lv_chart_clear_series` and `lv_obj_align_origo` to `lv_obj_align_mid`
- Add linemeter's mirror feature again
- Fix text decor (udnerline strikethrough) with older versions of font converter
- Fix setting local style property multiple times
- Add missing background drawing and radius handling to image button
- Allow adding extra label to list buttons
- Fix crash if `lv_table_set_col_cnt` is called before `lv_table_set_row_cnt` for the first time
- Fix overflow in large image transformations
- Limit extra button click area of button matrix's buttons. With large paddings it was counter intuitive. (Gaps are mapped to button when clicked).
- Fix `lv_btnmatrix_set_one_check` not forcing exactly one button to be checked
- Fix color picker invalidation in rectangle mode
- Init disabled days to gray color in calendar
## v7.3.0 (04.08.2020)
### New features
- Add `lv_task_get_next`
- Add `lv_event_send_refresh`, `lv_event_send_refresh_recursive` to easily send `LV_EVENT_REFRESH` to object
- Add `lv_tabview_set_tab_name()` function - used to change a tab's name
- Add `LV_THEME_MATERIAL_FLAG_NO_TRANSITION` and `LV_THEME_MATERIAL_FLAG_NO_FOCUS` flags
- Reduce code size by adding: `LV_USE_FONT_COMPRESSED` and `LV_FONT_USE_SUBPX` and applying some optimization
- Add `LV_MEMCPY_MEMSET_STD` to use standard `memcpy` and `memset`
### Bugfixes
- Do not print warning for missing glyph if its height OR width is zero.
- Prevent duplicated sending of `LV_EVENT_INSERT` from text area
- Tidy outer edges of cpicker widget.
- Remove duplicated lines from `lv_tabview_add_tab`
- btnmatrix: hadle combined states of buttons (e.g. chacked + disabled)
- textarea: fix typo in lv_textarea_set_sscrollbar_mode
- gauge: fix image needle drawing
- fix using freed memory in _lv_style_list_remove_style
## v7.2.0 (21.07.2020)
### New features
- Add screen transitions with `lv_scr_load_anim()`
- Add display background color, wallpaper and opacity. Shown when the screen is transparent. Can be used with `lv_disp_set_bg_opa/color/image()`.
- Add `LV_CALENDAR_WEEK_STARTS_MONDAY`
- Add `lv_chart_set_x_start_point()` function - Set the index of the x-axis start point in the data array
- Add `lv_chart_set_ext_array()` function - Set an external array of data points to use for the chart
- Add `lv_chart_set_point_id()` function - Set an individual point value in the chart series directly based on index
- Add `lv_chart_get_x_start_point()` function - Get the current index of the x-axis start point in the data array
- Add `lv_chart_get_point_id()` function - Get an individual point value in the chart series directly based on index
- Add `ext_buf_assigned` bit field to `lv_chart_series_t` structure - it's true if external buffer is assigned to series
- Add `lv_chart_set_series_axis()` to assign series to primary or secondary axis
- Add `lv_chart_set_y_range()` to allow setting range of secondary y axis (based on `lv_chart_set_range` but extended with an axis parameter)
- Allow setting different font for the selected text in `lv_roller`
- Add `theme->apply_cb` to replace `theme->apply_xcb` to make it compatible with the MicroPython binding
- Add `lv_theme_set_base()` to allow easy extension of built-in (or any) themes
- Add `lv_obj_align_x()` and `lv_obj_align_y()` functions
- Add `lv_obj_align_origo_x()` and `lv_obj_align_origo_y()` functions
### Bugfixes
- `tileview` fix navigation when not screen sized
- Use 14px font by default to for better compatibility with smaller displays
- `linemeter` fix conversation of current value to "level"
- Fix drawing on right border
- Set the cursor image non clickable by default
- Improve mono theme when used with keyboard or encoder
## v7.1.0 (07.07.2020)
### New features
- Add `focus_parent` attribute to `lv_obj`
@@ -9,13 +225,17 @@
- Add lv_btnmatrix_set/get_align capability
- DMA2D: Remove dependency on ST CubeMX HAL
- Added `max_used` propriety to `lv_mem_monitor_t` struct
- In `lv_init` test if the the strings are UTF-8 encoded.
- In `lv_init` test if the strings are UTF-8 encoded.
- Add `user_data` to themes
- Add LV_BIG_ENDIAN_SYSTEM flag to lv_conf.h in order to fix displaying images on big endian systems.
- Add inline function lv_checkbox_get_state(const lv_obj_t * cb) to extend the checkbox functionality.
- Add inline function lv_checkbox_set_state(const lv_obj_t * cb, lv_btn_state_t state ) to extend the checkbox functionality.
### Bugfixes
- `lv_img` fix invalidation area when angle or zoom changes
- Update the style handling to support Big endian MCUs
- Change some methods to support big endian hardware.
- remove use of c++ keyword 'new' in parameter of function lv_theme_set_base().
- Add LV_BIG_ENDIAN_SYSTEM flag to lv_conf.h in order to fix displaying images on big endian systems.
- Fix inserting chars in text area in big endian hardware.
@@ -48,7 +268,7 @@
### Bugfixes
- Make the Microptyhon working by adding the required variables as GC_ROOT
- Prefix some internal API functions with `_` to reduce the API of LVGL
- Prefix some internal API functions with `_` to reduce the API of LVGL
- Fix built-in SimSun CJK font
- Fix UTF-8 encoding when `LV_USE_ARABIC_PERSIAN_CHARS` is enabled
- Fix DMA2D usage when 32 bit images directly blended
@@ -59,7 +279,7 @@
- Remove memcpy from `lv_ll` (caused issues with some optimization settings)
- `lv_chart` fix X tick drawing
- Fix vertical dashed line drawing
- Some additonal minor fixes and formattings
- Some additional minor fixes and formattings
## v7.0.0 (18.05.2020)
@@ -72,30 +292,28 @@ The name of the project is changed to LVGL and the new website is on https://lvg
LVGL remains free under the same conditions (MIT license) and a company is created to manage LVGL and offer services.
### New drawing system
Complete rework of LVGL's draw engine to use "masks" for more advanced and higher quality graphical effects.
Complete rework of LVGL's draw engine to use "masks" for more advanced and higher quality graphical effects.
A possible use-case of this system is to remove the overflowing content from the rounded edges.
It also allows drawing perfectly anti-aliased circles, lines, and arcs.
Internally, the drawings happen by defining masks (such as rounded rectangle, line, angle).
When something is drawn the currently active masks can make some pixels transparent.
For example, rectangle borders are drawn by using 2 rectangle masks: one mask removes the inner part and another the outer part.
Internally, the drawings happen by defining masks (such as rounded rectangle, line, angle).
When something is drawn the currently active masks can make some pixels transparent.
For example, rectangle borders are drawn by using 2 rectangle masks: one mask removes the inner part and another the outer part.
The API in this regard remained the same but some new functions were added:
- `lv_img_set_zoom`: set image object's zoom factor
- `lv_img_set_angle`: set image object's angle without using canvas
- `lv_img_set_pivot`: set the pivot point of rotation
The new drawing engine brought new drawing features too. They are highlighted in the "style" section.
### New style system
The old style system is replaced with a new more flexible and lightweighted one.
It uses an approach similar to CSS: support cascading styles, inheriting properties and local style properties per object.
As part of these updates, a lot of objects were reworked and the APIs have been changed.
The old style system is replaced with a new more flexible and lightweighted one.
It uses an approach similar to CSS: support cascading styles, inheriting properties and local style properties per object.
As part of these updates, a lot of objects were reworked and the APIs have been changed.
- more shadows options: *offset* and *spread*
- gradient stop position to shift the gradient area and horizontal gradient
- gradient stop position to shift the gradient area and horizontal gradient
- `LV_BLEND_MODE_NORMAL/ADDITIVE/SUBTRACTIVE` blending modes
- *clip corner*: crop the content on the rounded corners
- *text underline* and *strikethrough*
@@ -139,16 +357,16 @@ The following object types are renamed:
- `linemeter`, `gauge`: can have background if the related style properties are set. Padding makes the scale/lines smaller. scale_border_width and scale_end_border_width allow to draw an arc on the outer part of the scale lines.
- `gauge`: `lv_gauge_set_needle_img` allows use image as needle
- `canvas`: allow drawing to true color alpha and alpha only canvas, add `lv_canvas_blur_hor/ver` and rename `lv_canvas_rotate` to `lv_canvas_transform`
- `textarea`: If available in the font use bullet (`U+2022`) character in text area password
- `textarea`: If available in the font use bullet (`U+2022`) character in text area password
### New object types
- `lv_objmask`: masks can be added to it. The children will be masked accordingly.
- `lv_objmask`: masks can be added to it. The children will be masked accordingly.
### Others
- Change the built-in fonts to [Montserrat](https://fonts.google.com/specimen/Montserrat) and add built-in fonts from 12 px to 48 px for every 2nd size.
- Add example CJK and Arabic/Persian/Hebrew built-in font
- Add ° and "bullet" to the built-in fonts
- Add Arabic/Persian script support: change the character according to its position in the text.
- Add Arabic/Persian script support: change the character according to its position in the text.
- Add `playback_time` to animations.
- Add `repeat_count` to animations instead of the current "repeat forever".
- Replace `LV_LAYOUT_PRETTY` with `LV_LAYOUT_PRETTY_TOP/MID/BOTTOM`
@@ -162,7 +380,7 @@ The following object types are renamed:
- Merge new features and fixes directly into `master` and release a patch or minor releases every 2 weeks.
### Migrating from v6 to v7
- First and foremost, create a new `lv_conf.h` based on `lv_conf_templ.h`.
- First and foremost, create a new `lv_conf.h` based on `lv_conf_template.h`.
- To try the new version it suggested using a simulator project and see the examples.
- If you have a running project, the most difficult part of the migration is updating to the new style system. Unfortunately, there is no better way than manually updating to the new format.
- The other parts are mainly minor renames and refactoring as described above.
- The other parts are mainly minor renames and refactoring as described above.

64
CMakeLists.txt Normal file
View File

@@ -0,0 +1,64 @@
if(ESP_PLATFORM)
file(GLOB_RECURSE SOURCES src/*.c)
idf_component_register(SRCS ${SOURCES}
INCLUDE_DIRS . src
REQUIRES main)
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_CONF_INCLUDE_SIMPLE")
if (CONFIG_LV_MEM_CUSTOM)
if (CONFIG_LV_MEM_CUSTOM_ALLOC)
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_MEM_CUSTOM_ALLOC=${CONFIG_LV_MEM_CUSTOM_ALLOC}")
endif()
if (CONFIG_LV_MEM_CUSTOM_FREE)
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_MEM_CUSTOM_FREE=${CONFIG_LV_MEM_CUSTOM_FREE}")
endif()
endif()
if (CONFIG_LV_TICK_CUSTOM)
if (CONFIG_LV_TICK_CUSTOM_SYS_TIME_EXPR)
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_TICK_CUSTOM_SYS_TIME_EXPR=${CONFIG_LV_TICK_CUSTOM_SYS_TIME_EXPR}")
endif()
endif()
if (CONFIG_LV_USER_DATA_FREE)
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_USER_DATA_FREE=${CONFIG_LV_USER_DATA_FREE}")
endif()
if (CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM)
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_ATTRIBUTE_FAST_MEM=IRAM_ATTR")
endif()
elseif(ZEPHYR_BASE)
if(CONFIG_LVGL)
zephyr_include_directories(${ZEPHYR_BASE}/lib/gui/lvgl)
target_include_directories(lvgl INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
zephyr_compile_definitions(LV_CONF_KCONFIG_EXTERNAL_INCLUDE=<autoconf.h>)
zephyr_compile_definitions_ifdef(CONFIG_LV_MEM_CUSTOM
LV_MEM_CUSTOM_ALLOC=${CONFIG_LV_MEM_CUSTOM_ALLOC}
)
zephyr_compile_definitions_ifdef(CONFIG_LV_MEM_CUSTOM
LV_MEM_CUSTOM_FREE=${CONFIG_LV_MEM_CUSTOM_FREE}
)
zephyr_compile_definitions_ifdef(CONFIG_LV_TICK_CUSTOM
LV_TICK_CUSTOM_SYS_TIME_EXPR=${CONFIG_LV_TICK_CUSTOM_SYS_TIME_EXPR}
)
zephyr_library()
file(GLOB_RECURSE SOURCES src/*.c)
zephyr_library_sources(${SOURCES})
endif() # CONFIG_LVGL
else()
message(FATAL_ERROR "Unknown platform.")
endif()

1212
Kconfig Normal file

File diff suppressed because it is too large Load Diff

125
README.md
View File

@@ -1,89 +1,128 @@
<h1 align="center"> LVGL - Light and Versatile Graphics Library</h1>
<p align="center">
<a href="https://github.com/lvgl/lvgl/blob/master/LICENCE.txt"><img src="https://img.shields.io/badge/licence-MIT-blue.svg"></a>
<a href="https://github.com/lvgl/lvgl/releases/tag/v7.0.0"><img src="https://img.shields.io/badge/version-7.0.0-blue.svg"></a>
</p>
<p align="center">
<img src="https://lvgl.io/assets/images/img_1.png">
</p>
<p align="center">
LVGL provides everything you need to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint.
LVGL provides everything you need to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint.
</p>
<h4 align="center">
<a href="https://lvgl.io">Website </a> &middot;
<a href="https://lvgl.io/demos">Online demo</a> &middot;
<a href="https://docs.lvgl.io/">Docs</a> &middot;
<a href="https://forum.lvgl.io">Forum</a> &middot;
<a href="https://lvgl.io">Website </a> &middot;
<a href="https://lvgl.io/demos">Online demo</a> &middot;
<a href="https://lvgl.github.io/lv_examples/">Nightly demos</a> &middot;
<a href="https://docs.lvgl.io/">Docs</a> &middot;
<a href="https://forum.lvgl.io">Forum</a>
</h4>
---
## Features
* Powerful building blocks: buttons, charts, lists, sliders, images, etc.
* Powerful [building blocks](https://docs.lvgl.io/latest/en/html/widgets/index.html): buttons, charts, lists, sliders, images, etc.
* Advanced graphics: animations, anti-aliasing, opacity, smooth scrolling
* Simultaneously use various input devices: touchscreen, mouse, keyboard, encoder, buttons, etc.
* Simultaneously use multiple displays: e.g. monochrome and color display
* Multi-language support with UTF-8 encoding, Bidirectional support, and Arabic text handling
* Fully customizable graphical elements via CSS-like styles
* Use [various input devices](https://docs.lvgl.io/latest/en/html/overview/indev.html): touchscreen, mouse, keyboard, encoder, buttons, etc.
* Use [multiple displays](https://docs.lvgl.io/latest/en/html/overview/display.html): e.g. monochrome and color display
* Hardware independent to use with any microcontroller or display
* Scalable to operate with little memory (64 kB Flash, 10 kB RAM)
* Multi-language support with UTF-8 handling, Bidirectional and Arabic script support
* Fully customizable graphical elements via [CSS-like styles](https://docs.lvgl.io/latest/en/html/overview/style.html)
* OS, External memory and GPU are supported but not required
* Single frame buffer operation even with advances graphical effects
* Smooth rendering even with a [single frame buffer](https://docs.lvgl.io/latest/en/html/porting/display.html)
* Written in C for maximal compatibility (C++ compatible)
* Micropython Binding exposes [LVGL API in Micropython](https://blog.lvgl.io/2019-02-20/micropython-bindings)
* Simulator to develop on PC without embedded hardware
* Tutorials, examples, themes for rapid development
* Documentation and API references
* [Simulator](https://docs.lvgl.io/latest/en/html/get-started/pc-simulator.html) to develop on PC without embedded hardware
* [Examples](lv_examples) and tutorials for rapid development
* [Documentation](http://docs.lvgl.io/) and API references
## Supported devices
## Requirements
Basically, every modern controller (which is able to drive a display) is suitable to run LVGL. The minimal requirements are:
- 16, 32 or 64 bit microcontroller or processor
- &gt; 16 MHz clock speed is recommended
- Flash/ROM: &gt; 64 kB for the very essential components (&gt; 180 kB is recommended)
- RAM:
- Static RAM usage: ~2 kB depending on the used features and objects types
- Stack: &gt; 2kB (&gt; 8 kB is recommended)
- Dynamic data (heap): &gt; 2 KB (&gt; 16 kB is recommended if using several objects).
Set by `LV_MEM_SIZE` in *lv_conf.h*.
- Display buffer: &gt; *"Horizontal resolution"* pixels (&gt; 10 &times; *"Horizontal resolution"* is recommended)
- C99 or newer compiler
<table>
<tr>
<td> <strong>Name</strong> </td>
<td><strong>Minimal</strong></td>
<td><strong>Recommended</strong></td>
</tr>
<tr>
<td><strong>Architecture</strong></td>
<td colspan="2">16, 32 or 64 bit microcontroller or processor</td>
</tr>
<tr>
<td> <strong>Clock</strong></td>
<td> &gt; 16 MHz </td>
<td> &gt; 48 MHz</td>
</tr>
<tr>
<td> <strong>Flash/ROM</strong></td>
<td> &gt; 64 kB </td>
<td> &gt; 180 kB</td>
</tr>
<tr>
<td> <strong>Static RAM</strong></td>
<td> &gt; 2 kB </td>
<td> &gt; 4 kB</td>
</tr>
<tr>
<td> <strong>Stack</strong></td>
<td> &gt; 2 kB </td>
<td> &gt; 8 kB</td>
</tr>
<tr>
<td> <strong>Heap</strong></td>
<td> &gt; 2 kB </td>
<td> &gt; 8 kB</td>
</tr>
<tr>
<td> <strong>Display buffer</strong></td>
<td> &gt; 1 &times; <em>hor. res.</em> pixels </td>
<td> &gt; 10 &times; <em>hor. res.</em> pixels </td>
</tr>
<tr>
<td> <strong>Compiler</strong></td>
<td colspan="2"> C99 or newer </td>
</tr>
</table>
*Note that the memory usage might vary depending on the architecture, compiler and build options.*
Just to mention some platforms:
- STM32F1, STM32F3, [STM32F4](https://blog.lvgl.io/2017-07-15/stm32f429_disco_port), [STM32F7](https://github.com/lvgl/lv_port_stm32f746_disco_sw4stm32), STM32L4
- STM32F1, STM32F3, STM32F4, STM32F7, STM32L4, STM32L5, STM32H7
- Microchip dsPIC33, PIC24, PIC32MX, PIC32MZ
- NXP: Kinetis, LPC, iMX, iMX RT
- [Linux frame buffer](https://blog.lvgl.io/2018-01-03/linux_fb) (/dev/fb)
- [Raspberry PI](http://www.vk3erw.com/index.php/16-software/63-raspberry-pi-official-7-touchscreen-and-littlevgl)
- [Raspberry Pi](http://www.vk3erw.com/index.php/16-software/63-raspberry-pi-official-7-touchscreen-and-littlevgl)
- [Espressif ESP32](https://github.com/lvgl/lv_port_esp32)
- [Infineon aurix](https://github.com/lvgl/lv_port_aurix)
- Nordic NRF52
- Quectell M66
- [Infineon Aurix](https://github.com/lvgl/lv_port_aurix)
- Nordic NRF52 Bluetooth modules
- Quectel modems
## Get started
his list shows the recommended way of learning the library:
This list shows the recommended way of learning the library:
1. Check the [Online demos](https://lvgl.io/demos) to see LVGL in action (3 minutes)
2. Read the [Introduction](https://docs.lvgl.io/latest/en/html/intro/index.html) page of the documentation (5 minutes)
3. Read the [Quick overview](https://docs.lvgl.io/latest/en/html/get-started/quick-overview.html) page of the documentation (15 minutes)
3. Get familiar with the basics on the [Quick overview](https://docs.lvgl.io/latest/en/html/get-started/quick-overview.html) page (15 minutes)
4. Set up a [Simulator](https://docs.lvgl.io/latest/en/html/get-started/pc-simulator.html) (10 minutes)
5. Try out some [Examples](https://github.com/lvgl/lv_examples/)
6. Port LVGL to a board. See the [Porting](https://docs.lvgl.io/latest/en/html/porting/index.html) guide or check the ready to use [Projects](https://github.com/lvgl?q=lv_port_&type=&language=)
7. Read the [Overview](https://docs.lvgl.io/latest/en/html/overview/index.html) page to get a better understanding of the library. (2-3 hours)
7. Read the [Overview](https://docs.lvgl.io/latest/en/html/overview/index.html) page to get a better understanding of the library (2-3 hours)
8. Check the documentation of the [Widgets](https://docs.lvgl.io/latest/en/html/widgets/index.html) to see their features and usage
9. If you have questions got to the [Forum](http://forum.lvgl.io/)
10. Read the [Contributing](https://docs.lvgl.io/latest/en/html/contributing/index.html) guide to see how you can help to improve LVGL (15 minutes)
9. If you have questions go to the [Forum](http://forum.lvgl.io/)
10. Read the [Contributing](https://docs.lvgl.io/latest/en/html/contributing/index.html) guide to see how you can help to improve LVGL (15 minutes)
## Examples
## Examples
For more examples see the [lv_examples](https://github.com/lvgl/lv_examples) repository.
### Button with label
```c
lv_obj_t * btn = lv_btn_create(lv_scr_act(), NULL); /*Add a button the current screen*/
lv_obj_t * btn = lv_btn_create(lv_scr_act(), NULL); /*Add a button to the current screen*/
lv_obj_set_pos(btn, 10, 10); /*Set its position*/
lv_obj_set_size(btn, 100, 50); /*Set its size*/
lv_obj_set_event_cb(btn, btn_event_cb); /*Assign a callback to the button*/
@@ -103,7 +142,7 @@ void btn_event_cb(lv_obj_t * btn, lv_event_t event)
![LVGL button with label example](https://raw.githubusercontent.com/lvgl/docs/latest/misc/simple_button_example.gif)
### LVGL from Micropython
Learn more about [Micropython](https://docs.lvgl.io/en/html/get-started/micropython).
Learn more about [Micropython](https://docs.lvgl.io/latest/en/html/get-started/micropython.html).
```python
# Create a Button and a Label
scr = lv.obj()
@@ -117,4 +156,6 @@ lv.scr_load(scr)
```
## Contributing
LVGL is an open project and contribution is very welcome. There are many ways to contribute from simply speaking about your project, through writing examples, improving the documentation, fixing bugs to hosing your own project under in LVGL.
For a detailed description of contribution opportunities visit the [Contributing](https://docs.lvgl.io/latest/en/html/contributing/index.html) section of the documentation.

View File

@@ -11,19 +11,19 @@ Use [lv_misc/lv_templ.c](https://github.com/lvgl/lvgl/blob/master/src/lv_misc/lv
* starts with *lv*
* followed by module name: *btn*, *label*, *style* etc.
* followed by the action (for functions): *set*, *get*, *refr* etc.
* closed with the subject: *name*, *size*, *state* etc.
* closed with the subject: *name*, *size*, *state* etc.
* Typedefs
* prefer `typedef struct` and `typedef enum` instead of `struct name` and `enum name`
* always end `typedef struct` and `typedef enum` type names with `_t`
* Abbreviations:
* Only words longer or equal than 6 characters can be abbreviated.
* Only words longer or equal than 6 characters can be abbreviated.
* Abbreviate only if it makes the word at least half as long
* Use only very straightforward and well-known abbreviations (e.g. pos: position, def: default, btn: button)
* Use only very straightforward and well-known abbreviations (e.g. pos: position, def: default, btn: button)
## Coding guide
* Functions:
* Try to write function shorter than is 50 lines
* Always shorter than 200 lines (except very straightforwards)
* Try to write function shorter than is 50 lines
* Always shorter than 200 lines (except very straightforwards)
* Variables:
* One line, one declaration (BAD: char x, y;)
* Use `<stdint.h>` (*uint8_t*, *int32_t* etc)
@@ -41,16 +41,16 @@ Before every function have a comment like this:
* @param obj pointer to an object
* @return pointer to a screen
*/
lv_obj_t * lv_obj_get_scr(lv_obj_t * obj);
lv_obj_t * lv_obj_get_scr(lv_obj_t * obj);
```
Always use `/* Something */` format and NOT `//Something`
Write readable code to avoid descriptive comments like:
`x++; /* Add 1 to x */`.
Write readable code to avoid descriptive comments like:
`x++; /* Add 1 to x */`.
The code should show clearly what you are doing.
You should write **why** have you done this:
You should write **why** have you done this:
`x++; /*Because of closing '\0' of the string */`
Short "code summaries" of a few lines are accepted. E.g. `/*Calculate the new coordinates*/`
@@ -67,19 +67,19 @@ Here is example to show bracket placing and using of white spaces:
*/
void lv_label_set_text(lv_obj_t * label, const char * text)
{ /* Main brackets of functions in new line*/
if(label == NULL) return; /*No bracket only if the command is inline with the if statement*/
lv_obj_inv(label);
lv_label_ext_t * ext = lv_obj_get_ext(label);
/*Comment before a section */
if(text == ext->txt || text == NULL) { /*Bracket of statements start inline*/
lv_label_refr_text(label);
return;
return;
}
...
}
```

View File

@@ -1,5 +1,5 @@
# Contributing to LVGL
Thank you for considering contributing to LVGL.
Thank you for considering contributing to LVGL.
For a detailed description of contribution opportunities, please visit the [Contributing](https://docs.lvgl.io/latest/en/html/contributing/index.html) section of the documentation.

60
docs/ROADMAP.md Normal file
View File

@@ -0,0 +1,60 @@
# Roadmap
This is a summary for thenew fatures of the major releases and a collection of ideas.
This list indicates only the current intention and can be changed.
## v8
Planned to November/December 2020
- Create an `lv_components` repository for compley widgets
- It makes the core LVGL leaner
- In `lv_components` we can have a lot and specific widgets
- Good place for contribution
- New scrolling:
- See [feat/new-scroll](https://github.com/lvgl/lvgl/tree/feat/new-scroll) branch and [#1614](https://github.com/lvgl/lvgl/issues/1614)) issue.
- Remove `lv_page` and support scrolling on `lv_obj`
- Support "elastic" scrolling when scrolled in
- Support scroll chaining among any objects types (not only `lv_pages`s)
- Remove `lv_drag`. Similar effect can be achieved by setting the position in `LV_EVENT_PRESSING`
- Add snapping
- Add snap stop to scroll max 1 snap point
- Already working
- New layouts:
- See [#1615](https://github.com/lvgl/lvgl/issues/1615) issue
- [CSS Grid](https://css-tricks.com/snippets/css/a-guide-to-grid/)-like layout support
- [CSS Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/)-like layout support
- Remove `lv_cont` and support layouts on `lv_obj`
- Simplified File system interface ([feat/new_fs_api](https://github.com/lvgl/lvgl/tree/feat/new-fs-api) branch) to make porting easier
- Work in progress
- Remove the align parameter from `lv_canvas_draw_text`
- Make the copy parameter obsolate in create functions
- Optimize and simplifie styles [#1832](https://github.com/lvgl/lvgl/issues/1832)
- Use a more generic inheritenace [#1919](https://github.com/lvgl/lvgl/issues/1919)
## v8.x
- Add radio button widget
- Unit testing (gtest?). See [#1658](https://github.com/lvgl/lvgl/issues/1658)
- Benchmarking (gem5?). See [#1660](https://github.com/lvgl/lvgl/issues/1660)
## v9
- Simplify `group`s. Discussion is [here](https://forum.lvgl.io/t/lv-group-tabindex/2927/3).
- Consider direct binary font format support
- Optimize line and circle drawing and masking
- Reconsider color format management for run time color format setting, and custom color format usage. (Also [RGB888](https://github.com/lvgl/lvgl/issues/1722))
- 9-patch support for `lv_imgbtn`.
- Handle stride. See [#1858](https://github.com/lvgl/lvgl/issues/1858)
- Make gradients more versatile
- Make image transformations more versatile
- Allow snapshoting object to tranfrom them to images
## Ideas
- lv_mem_alloc_aligned(size, align)
- Text node. See [#1701](https://github.com/lvgl/lvgl/issues/1701#issuecomment-699479408)
- CPP binding. See [Forum](https://forum.lvgl.io/t/is-it-possible-to-officially-support-optional-cpp-api/2736)
- Optimize font decompression
- Switch to RGBA colors in styles
- Need coverage report for tests
- Need static analyze (via coverity.io or somehing else)
- Support dot_begin and dot_middle long modes for labels
- Add new label alignment modes. [#1656](https://github.com/lvgl/lvgl/issues/1656)
- Support larger images: [#1892](https://github.com/lvgl/lvgl/issues/1892)

View File

@@ -36,36 +36,20 @@ bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
bool touched = tft.getTouch(&touchX, &touchY, 600);
if(!touched)
{
if(!touched) {
data->state = LV_INDEV_STATE_REL;
return false;
}
else
{
} else {
data->state = LV_INDEV_STATE_PR;
}
if(touchX>screenWidth || touchY > screenHeight)
{
Serial.println("Y or y outside of expected parameters..");
Serial.print("y:");
Serial.print(touchX);
Serial.print(" x:");
Serial.print(touchY);
}
else
{
/*Set the coordinates*/
data->point.x = touchX;
data->point.y = touchY;
Serial.print("Data x");
Serial.println(touchX);
Serial.print("Data y");
Serial.println(touchY);
}
return false; /*Return `false` because we are not buffering and no more data to read*/
@@ -86,7 +70,7 @@ void setup()
uint16_t calData[5] = { 275, 3620, 264, 3532, 1 };
tft.setTouch(calData);
lv_disp_buf_init(&disp_buf, buf, NULL, LV_HOR_RES_MAX * 10);
/*Initialize the display*/
@@ -110,7 +94,6 @@ void setup()
lv_ex_btn_1();
}
void loop()
{

View File

@@ -1,44 +0,0 @@
# Example for lv_arduino using a slider
This example has the screen set to 320x480 (ILI9488), change this by altering the following lines in the main ino file:
```C
int screenWidth = 480;
int screenHeight = 320;
```
## Backlight
Change pin 32 to your preferred backlight pin using a PNP transistor (2N3906) or remove the following code and connect directly to +ve:
```C
ledcSetup(10, 5000/*freq*/, 10 /*resolution*/);
ledcAttachPin(32, 10);
analogReadResolution(10);
ledcWrite(10,768);
```
## Theme selection
Change the following to change the theme:
```C
lv_theme_t * th = lv_theme_night_init(210, NULL); //Set a HUE value and a Font for the Night Theme
lv_theme_set_current(th);
```
## Calibration
This is using the bodmer tft_espi driver for touch. To correctly set the calibration load the calibration sketch and replace the following with your values:
```C
uint16_t calData[5] = { 275, 3620, 264, 3532, 1 };
```
## Screen rotation
Check the following if you need to alter your screen rotation:
```C
tft.setRotation(3);
```

View File

@@ -1,37 +0,0 @@
# LVGL Arduino examples
LVGL can be installed via Arduino IDE Library Manager or as an .ZIP library.
It will install [lv_exmaples](https://github.com/lvgl/lv_examples) which contains a lot of examples and demos to try LVGL.
## Example
There are simple examples which use the [TFT_eSPI](https://github.com/Bodmer/TFT_eSPI) library as a TFT driver to simplify testing.
To get all this to work you have to setup TFT_eSPI to work with your TFT display type via editing the `User_Setup.h` file in TFT_eSPI library folder, or by selecting your own configurtion in the `User_Setup_Select.h` file in TFT_eSPI library folder.
LVGL library has its own configuration file called `lv_conf.h`. When LVGL is installed to followings needs to be done to configure it:
1. Go to directory of the installed Arduno libraries
2. Go to `lvgl` and copy `lv_conf_template.h` as `lvgl.h` next to the `lvgl` folder.
3. Open `lv_conf.h` and change the first `#if 0` to `#if 1`
4. Set the resolution of your display in `LV_HOR_RES_MAX` and `LV_VER_RES_MAX`
5. Set the color depth of you display in `LV_COLOR_DEPTH`
6. Set `LV_TICK_CUSTOM 1`
## Debugging
In case of trouble there are debug informations inside LVGL. In the `ESP32_TFT_eSPI` example there is `my_print` method, which allow to send this debug informations to the serial interface. To enable this feature you have to edit `lv_conf.h` file and enable logging in section `log settings`:
```c
/*Log settings*/
#define USE_LV_LOG 1 /*Enable/disable the log module*/
#if LV_USE_LOG
/* How important log should be added:
* LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
* LV_LOG_LEVEL_INFO Log important events
* LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
* LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
* LV_LOG_LEVEL_NONE Do not log anything
*/
# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
```
After enabling log module and setting LV_LOG_LEVEL accordingly the output log is sent to the `Serial` port @ 115200 Bd.

View File

@@ -54,41 +54,42 @@ void lv_port_disp_init(void)
* Create a buffer for drawing
*----------------------------*/
/* LVGL requires a buffer where it draws the objects. The buffer's has to be greater than 1 display row
/* LVGL requires a buffer where it internally draws the widgets.
* Later this buffer will passed your display drivers `flush_cb` to copy its content to your display.
* The buffer has to be greater than 1 display row
*
* There are three buffering configurations:
* 1. Create ONE buffer with some rows:
* 1. Create ONE buffer with some rows:
* LVGL will draw the display's content here and writes it to your display
*
* 2. Create TWO buffer with some rows:
*
* 2. Create TWO buffer with some rows:
* LVGL will draw the display's content to a buffer and writes it your display.
* You should use DMA to write the buffer's content to the display.
* It will enable LVGL to draw the next part of the screen to the other buffer while
* the data is being sent form the first buffer. It makes rendering and flushing parallel.
*
* 3. Create TWO screen-sized buffer:
*
* 3. Create TWO screen-sized buffer:
* Similar to 2) but the buffer have to be screen sized. When LVGL is ready it will give the
* whole frame to display. This way you only need to change the frame buffer's address instead of
* copying the pixels.
* */
/* Example for 1) */
static lv_disp_buf_t disp_buf_1;
static lv_color_t buf1_1[LV_HOR_RES_MAX * 10]; /*A buffer for 10 rows*/
lv_disp_buf_init(&disp_buf_1, buf1_1, NULL, LV_HOR_RES_MAX * 10); /*Initialize the display buffer*/
static lv_disp_buf_t draw_buf_dsc_1;
static lv_color_t draw_buf_1[LV_HOR_RES_MAX * 10]; /*A buffer for 10 rows*/
lv_disp_buf_init(&draw_buf_dsc_1, draw_buf_1, NULL, LV_HOR_RES_MAX * 10); /*Initialize the display buffer*/
/* Example for 2) */
static lv_disp_buf_t disp_buf_2;
static lv_color_t buf2_1[LV_HOR_RES_MAX * 10]; /*A buffer for 10 rows*/
static lv_color_t buf2_2[LV_HOR_RES_MAX * 10]; /*An other buffer for 10 rows*/
lv_disp_buf_init(&disp_buf_2, buf2_1, buf2_2, LV_HOR_RES_MAX * 10); /*Initialize the display buffer*/
static lv_disp_buf_t draw_buf_dsc_2;
static lv_color_t draw_buf_2_1[LV_HOR_RES_MAX * 10]; /*A buffer for 10 rows*/
static lv_color_t draw_buf_2_1[LV_HOR_RES_MAX * 10]; /*An other buffer for 10 rows*/
lv_disp_buf_init(&draw_buf_dsc_2, draw_buf_2_1, draw_buf_2_1, LV_HOR_RES_MAX * 10); /*Initialize the display buffer*/
/* Example for 3) */
static lv_disp_buf_t disp_buf_3;
static lv_color_t buf3_1[LV_HOR_RES_MAX * LV_VER_RES_MAX]; /*A screen sized buffer*/
static lv_color_t buf3_2[LV_HOR_RES_MAX * LV_VER_RES_MAX]; /*An other screen sized buffer*/
lv_disp_buf_init(&disp_buf_3, buf3_1, buf3_2, LV_HOR_RES_MAX * LV_VER_RES_MAX); /*Initialize the display buffer*/
static lv_disp_buf_t draw_buf_dsc_3;
static lv_color_t draw_buf_3_1[LV_HOR_RES_MAX * LV_VER_RES_MAX]; /*A screen sized buffer*/
static lv_color_t draw_buf_3_1[LV_HOR_RES_MAX * LV_VER_RES_MAX]; /*An other screen sized buffer*/
lv_disp_buf_init(&draw_buf_dsc_3, draw_buf_3_1, draw_buf_3_2, LV_HOR_RES_MAX * LV_VER_RES_MAX); /*Initialize the display buffer*/
/*-----------------------------------
* Register the display in LVGL
@@ -107,7 +108,7 @@ void lv_port_disp_init(void)
disp_drv.flush_cb = disp_flush;
/*Set a display buffer*/
disp_drv.buffer = &disp_buf_2;
disp_drv.buffer = &draw_buf_dsc_1;
#if LV_USE_GPU
/*Optionally add functions to access the GPU. (Only in buffered mode, LV_VDB_SIZE != 0)*/
@@ -155,7 +156,6 @@ static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_colo
lv_disp_flush_ready(disp_drv);
}
/*OPTIONAL: GPU INTERFACE*/
#if LV_USE_GPU

View File

@@ -34,7 +34,6 @@ extern "C" {
* MACROS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif

View File

@@ -36,7 +36,6 @@ typedef struct {
uint32_t dummy2;
}dir_t;
/**********************
* STATIC PROTOTYPES
**********************/
@@ -81,7 +80,7 @@ void lv_port_fs_init(void)
fs_init();
/*---------------------------------------------------
* Register the file system interface in LVGL
* Register the file system interface in LVGL
*--------------------------------------------------*/
/* Add a simple drive to open images */
@@ -118,7 +117,7 @@ void lv_port_fs_init(void)
/* Initialize your Storage device and File system. */
static void fs_init(void)
{
/*E.g. for FatFS initalize the SD card and FatFS itself*/
/*E.g. for FatFS initialize the SD card and FatFS itself*/
/*You code here*/
}
@@ -157,7 +156,6 @@ static lv_fs_res_t fs_open (lv_fs_drv_t * drv, void * file_p, const char * path,
return res;
}
/**
* Close an opened file
* @param drv pointer to a driver where this function belongs
@@ -264,7 +262,7 @@ static lv_fs_res_t fs_tell (lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p)
* Delete a file
* @param drv pointer to a driver where this function belongs
* @param path path of the file to delete
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
*/
static lv_fs_res_t fs_remove (lv_fs_drv_t * drv, const char *path)
{
@@ -325,9 +323,9 @@ static lv_fs_res_t fs_free (lv_fs_drv_t * drv, uint32_t * total_p, uint32_t * fr
}
/**
* Initialize a 'fs_read_dir_t' variable for directory reading
* Initialize a 'lv_fs_dir_t' variable for directory reading
* @param drv pointer to a driver where this function belongs
* @param rddir_p pointer to a 'fs_read_dir_t' variable
* @param rddir_p pointer to a 'lv_fs_dir_t' variable
* @param path path to a directory
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
*/
@@ -344,7 +342,7 @@ static lv_fs_res_t fs_dir_open (lv_fs_drv_t * drv, void * rddir_p, const char *p
* Read the next filename form a directory.
* The name of the directories will begin with '/'
* @param drv pointer to a driver where this function belongs
* @param rddir_p pointer to an initialized 'fs_read_dir_t' variable
* @param rddir_p pointer to an initialized 'lv_fs_dir_t' variable
* @param fn pointer to a buffer to store the filename
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
*/
@@ -360,7 +358,7 @@ static lv_fs_res_t fs_dir_read (lv_fs_drv_t * drv, void * rddir_p, char *fn)
/**
* Close the directory reading
* @param drv pointer to a driver where this function belongs
* @param rddir_p pointer to an initialized 'fs_read_dir_t' variable
* @param rddir_p pointer to an initialized 'lv_fs_dir_t' variable
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
*/
static lv_fs_res_t fs_dir_close (lv_fs_drv_t * drv, void * rddir_p)

View File

@@ -34,7 +34,6 @@ extern "C" {
* MACROS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif

View File

@@ -79,7 +79,6 @@ void lv_port_indev_init(void)
* You should shape them according to your hardware
*/
lv_indev_drv_t indev_drv;
/*------------------
@@ -174,8 +173,6 @@ void lv_port_indev_init(void)
* STATIC FUNCTIONS
**********************/
/*------------------
* Touchpad
* -----------------*/
@@ -225,7 +222,6 @@ static void touchpad_get_xy(lv_coord_t * x, lv_coord_t * y)
(*y) = 0;
}
/*------------------
* Mouse
* -----------------*/
@@ -361,7 +357,6 @@ static void encoder_handler(void)
encoder_state = LV_INDEV_STATE_REL;
}
/*------------------
* Button
* -----------------*/

View File

@@ -35,7 +35,6 @@ extern "C" {
* MACROS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif

View File

@@ -1,14 +1,17 @@
{
"name": "lvgl",
"version": "v7.1.0",
"keywords": "graphics, gui, embedded, littlevgl",
"description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.",
"repository":
{
"type": "git",
"url": "https://github.com/lvgl/lvgl.git"
},
"build": {
"includeDir": "."
}
"name": "lvgl",
"version": "7.9.1",
"keywords": "graphics, gui, embedded, tft, lvgl",
"description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.",
"repository": {
"type": "git",
"url": "https://github.com/lvgl/lvgl.git"
},
"build": {
"includeDir": "."
},
"license": "MIT",
"homepage": "https://lvgl.io",
"frameworks": "*",
"platforms": "*"
}

10
library.properties Normal file
View File

@@ -0,0 +1,10 @@
name=lvgl
version=7.9.1
author=kisvegabor
maintainer=kisvegabor,embeddedt,pete-pjb
sentence=Full-featured Graphics Library for Embedded Systems
paragraph=Powerful and easy-to-use embedded GUI with many widgets, advanced visual effects (opacity, antialiasing, animations) and low memory requirements (16K RAM, 64K Flash).
category=Display
url=https://lvgl.io
architectures=*
includes=lvgl.h

View File

@@ -1,6 +1,6 @@
/**
* @file lv_conf.h
* Configuration file for LVGL v7.1.0
* Configuration file for v7.9.1
*/
/*
@@ -82,7 +82,7 @@ typedef int16_t lv_coord_t;
/* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
# define LV_MEM_SIZE (32U * 1024U)
/* Complier prefix for a big array declaration */
/* Compiler prefix for a big array declaration */
# define LV_MEM_ATTR
/* Set an address for the memory pool instead of allocating it as an array.
@@ -97,6 +97,10 @@ typedef int16_t lv_coord_t;
# define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
#endif /*LV_MEM_CUSTOM*/
/* Use the standard memcpy and memset instead of LVGL's own functions.
* The standard functions might or might not be faster depending on their implementation. */
#define LV_MEMCPY_MEMSET_STD 0
/* Garbage Collector settings
* Used if lvgl is binded to higher level language and the memory is managed by that language */
#define LV_ENABLE_GC 0
@@ -123,14 +127,13 @@ typedef int16_t lv_coord_t;
#define LV_INDEV_DEF_DRAG_THROW 10
/* Long press time in milliseconds.
* Time to send `LV_EVENT_LONG_PRESSSED`) */
* Time to send `LV_EVENT_LONG_PRESSED`) */
#define LV_INDEV_DEF_LONG_PRESS_TIME 400
/* Repeated trigger period in long press [ms]
* Time between `LV_EVENT_LONG_PRESSED_REPEAT */
#define LV_INDEV_DEF_LONG_PRESS_REP_TIME 100
/* Gesture threshold in pixels */
#define LV_INDEV_DEF_GESTURE_LIMIT 50
@@ -150,7 +153,7 @@ typedef void * lv_anim_user_data_t;
#endif
/* 1: Enable shadow drawing*/
/* 1: Enable shadow drawing on rectangles*/
#define LV_USE_SHADOW 1
#if LV_USE_SHADOW
/* Allow buffering some shadow calculation
@@ -160,6 +163,15 @@ typedef void * lv_anim_user_data_t;
#define LV_SHADOW_CACHE_SIZE 0
#endif
/*1: enable outline drawing on rectangles*/
#define LV_USE_OUTLINE 1
/*1: enable pattern drawing on rectangles*/
#define LV_USE_PATTERN 1
/*1: enable value string drawing on rectangles*/
#define LV_USE_VALUE_STR 1
/* 1: Use other blend modes than normal (`LV_BLEND_MODE_...`)*/
#define LV_USE_BLEND_MODES 1
@@ -182,6 +194,19 @@ typedef void * lv_group_user_data_t;
e.g. "stm32f769xx.h" or "stm32f429xx.h" */
#define LV_GPU_DMA2D_CMSIS_INCLUDE
/*1: Use PXP for CPU off-load on NXP RTxxx platforms */
#define LV_USE_GPU_NXP_PXP 0
/*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c)
* and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol FSL_RTOS_FREE_RTOS
* has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected.
*0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init()
* */
#define LV_USE_GPU_NXP_PXP_AUTO_INIT 0
/*1: Use VG-Lite for CPU offload on NXP RTxxx platforms */
#define LV_USE_GPU_NXP_VG_LITE 0
/* 1: Enable file system (might be required for images */
#define LV_USE_FILESYSTEM 1
#if LV_USE_FILESYSTEM
@@ -197,6 +222,7 @@ typedef void * lv_fs_drv_user_data_t;
/*1: Use the functions and types from the older API if possible */
#define LV_USE_API_EXTENSION_V6 1
#define LV_USE_API_EXTENSION_V7 1
/*========================
* Image decoder and cache
@@ -213,7 +239,7 @@ typedef void * lv_fs_drv_user_data_t;
* (I.e. no new image decoder is added)
* With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images.
* However the opened images might consume additional RAM.
* LV_IMG_CACHE_DEF_SIZE must be >= 1 */
* Set it to 0 to disable caching */
#define LV_IMG_CACHE_DEF_SIZE 1
/*Declare the type of the user data of image decoder (can be e.g. `void *`, `int`, `struct`)*/
@@ -235,9 +261,14 @@ typedef void * lv_img_decoder_user_data_t;
/* Define a custom attribute to `lv_disp_flush_ready` function */
#define LV_ATTRIBUTE_FLUSH_READY
/* Required alignment size for buffers */
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE
/* With size optimization (-Os) the compiler might not align data to
* 4 or 8 byte boundary. This alignment will be explicitly applied where needed.
* E.g. __attribute__((aligned(4))) */
* 4 or 8 byte boundary. Some HW may need even 32 or 64 bytes.
* This alignment will be explicitly applied where needed.
* LV_ATTRIBUTE_MEM_ALIGN_SIZE should be used to specify required align size.
* E.g. __attribute__((aligned(LV_ATTRIBUTE_MEM_ALIGN_SIZE))) */
#define LV_ATTRIBUTE_MEM_ALIGN
/* Attribute to mark large constant arrays for example
@@ -304,7 +335,7 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
* If an invalid parameter is found an error log message is printed and
* the MCU halts at the error. (`LV_USE_LOG` should be enabled)
* If you are debugging the MCU you can pause
* the debugger to see exactly where the issue is.
* the debugger to see exactly where the issue is.
*
* The behavior of asserts can be overwritten by redefining them here.
* E.g. #define LV_ASSERT_MEM(p) <my_assert_code>
@@ -339,7 +370,7 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
* FONT USAGE
*===================*/
/* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel.
/* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel.
* The symbols are available via `LV_SYMBOL_...` defines
* More info about fonts: https://docs.lvgl.io/v7/en/html/overview/font.html
* To create a new font go to: https://lvgl.com/ttf-font-to-c-array
@@ -347,9 +378,11 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
/* Montserrat fonts with bpp = 4
* https://fonts.google.com/specimen/Montserrat */
#define LV_FONT_MONTSERRAT_8 0
#define LV_FONT_MONTSERRAT_10 0
#define LV_FONT_MONTSERRAT_12 0
#define LV_FONT_MONTSERRAT_14 0
#define LV_FONT_MONTSERRAT_16 1
#define LV_FONT_MONTSERRAT_14 1
#define LV_FONT_MONTSERRAT_16 0
#define LV_FONT_MONTSERRAT_18 0
#define LV_FONT_MONTSERRAT_20 0
#define LV_FONT_MONTSERRAT_22 0
@@ -376,6 +409,7 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
/*Pixel perfect monospace font
* http://pelulamu.net/unscii/ */
#define LV_FONT_UNSCII_8 0
#define LV_FONT_UNSCII_16 0
/* Optionally declare your custom fonts here.
* You can use these fonts as default font too
@@ -390,11 +424,20 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
* but with > 10,000 characters if you see issues probably you need to enable it.*/
#define LV_FONT_FMT_TXT_LARGE 0
/* Enables/disables support for compressed fonts. If it's disabled, compressed
* glyphs cannot be processed by the library and won't be rendered.
*/
#define LV_USE_FONT_COMPRESSED 1
/* Enable subpixel rendering */
#define LV_USE_FONT_SUBPX 1
#if LV_USE_FONT_SUBPX
/* Set the pixel order of the display.
* Important only if "subpx fonts" are used.
* With "normal" font it doesn't matter.
*/
#define LV_FONT_SUBPX_BGR 0
#endif
/*Declare the type of the user data of fonts (can be e.g. `void *`, `int`, `struct`)*/
typedef void * lv_font_user_data_t;
@@ -407,34 +450,37 @@ typedef void * lv_font_user_data_t;
/* No theme, you can apply your styles as you need
* No flags. Set LV_THEME_DEFAULT_FLAG 0 */
#define LV_USE_THEME_EMPTY 1
#define LV_USE_THEME_EMPTY 1
/*Simple to the create your theme based on it
* No flags. Set LV_THEME_DEFAULT_FLAG 0 */
#define LV_USE_THEME_TEMPLATE 1
#define LV_USE_THEME_TEMPLATE 1
/* A fast and impressive theme.
* Flags:
* LV_THEME_MATERIAL_FLAG_LIGHT: light theme
* LV_THEME_MATERIAL_FLAG_DARK: dark theme*/
#define LV_USE_THEME_MATERIAL 1
* LV_THEME_MATERIAL_FLAG_DARK: dark theme
* LV_THEME_MATERIAL_FLAG_NO_TRANSITION: disable transitions (state change animations)
* LV_THEME_MATERIAL_FLAG_NO_FOCUS: disable indication of focused state)
* */
#define LV_USE_THEME_MATERIAL 1
/* Mono-color theme for monochrome displays.
* If LV_THEME_DEFAULT_COLOR_PRIMARY is LV_COLOR_BLACK the
* texts and borders will be black and the background will be
* white. Else the colors are inverted.
* No flags. Set LV_THEME_DEFAULT_FLAG 0 */
#define LV_USE_THEME_MONO 1
#define LV_USE_THEME_MONO 1
#define LV_THEME_DEFAULT_INCLUDE <stdint.h> /*Include a header for the init. function*/
#define LV_THEME_DEFAULT_INIT lv_theme_material_init
#define LV_THEME_DEFAULT_COLOR_PRIMARY lv_color_hex(0x01a2b1)
#define LV_THEME_DEFAULT_COLOR_SECONDARY lv_color_hex(0x44d1b6)
#define LV_THEME_DEFAULT_FLAG LV_THEME_MATERIAL_FLAG_LIGHT
#define LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_16
#define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_16
#define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_16
#define LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_16
#define LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_14
#define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_14
#define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_14
#define LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_14
/*=================
* Text settings
@@ -467,7 +513,7 @@ typedef void * lv_font_user_data_t;
/* Support bidirectional texts.
* Allows mixing Left-to-Right and Right-to-Left texts.
* The direction will be processed according to the Unicode Bidirectioanl Algorithm:
* The direction will be processed according to the Unicode Bidirectional Algorithm:
* https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
#define LV_USE_BIDI 0
#if LV_USE_BIDI
@@ -540,6 +586,9 @@ typedef void * lv_obj_user_data_t;
/*Calendar (dependencies: -)*/
#define LV_USE_CALENDAR 1
#if LV_USE_CALENDAR
# define LV_CALENDAR_WEEK_STARTS_MONDAY 0
#endif
/*Canvas (dependencies: lv_img)*/
#define LV_USE_CANVAS 1
@@ -624,7 +673,7 @@ typedef void * lv_obj_user_data_t;
* 1: Some extra precision
* 2: Best precision
*/
# define LV_LINEMETER_PRECISE 0
# define LV_LINEMETER_PRECISE 1
#endif
/*Mask (dependencies: -)*/
@@ -678,6 +727,7 @@ typedef void * lv_obj_user_data_t;
#define LV_USE_TABLE 1
#if LV_USE_TABLE
# define LV_TABLE_COL_MAX 12
# define LV_TABLE_CELL_STYLE_CNT 4
#endif
/*Tab (dependencies: lv_page, lv_btnm)*/

15
lvgl.h
View File

@@ -10,6 +10,14 @@
extern "C" {
#endif
/***************************
* CURRENT VERSION OF LVGL
***************************/
#define LVGL_VERSION_MAJOR 7
#define LVGL_VERSION_MINOR 9
#define LVGL_VERSION_PATCH 1
#define LVGL_VERSION_INFO ""
/*********************
* INCLUDES
*********************/
@@ -31,6 +39,7 @@ extern "C" {
#include "src/lv_themes/lv_theme.h"
#include "src/lv_font/lv_font.h"
#include "src/lv_font/lv_font_loader.h"
#include "src/lv_font/lv_font_fmt_txt.h"
#include "src/lv_misc/lv_printf.h"
@@ -75,11 +84,6 @@ extern "C" {
/*********************
* DEFINES
*********************/
/*Current version of LVGL*/
#define LVGL_VERSION_MAJOR 7
#define LVGL_VERSION_MINOR 1
#define LVGL_VERSION_PATCH 0
#define LVGL_VERSION_INFO ""
/**********************
* TYPEDEFS
@@ -116,7 +120,6 @@ extern "C" {
* */
#define LV_VERSION_CHECK(x,y,z) (x == LVGL_VERSION_MAJOR && (y < LVGL_VERSION_MINOR || (y == LVGL_VERSION_MINOR && z <= LVGL_VERSION_PATCH)))
#ifdef __cplusplus
}
#endif

View File

@@ -6,5 +6,3 @@ include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_misc/lv_misc.mk
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_themes/lv_themes.mk
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_draw/lv_draw.mk
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_gpu/lv_gpu.mk

View File

@@ -7,40 +7,40 @@ import sys
parser = argparse.ArgumentParser(description="""Create fonts for LittelvGL including the built-in symbols. lv_font_conv needs to be installed. See https://github.com/littlevgl/lv_font_conv
Example: python built_in_font_gen.py --size 16 -o lv_font_roboto_16.c --bpp 4 -r 0x20-0x7F""", formatter_class=RawTextHelpFormatter)
parser.add_argument('-s', '--size',
type=int,
metavar = 'px',
nargs='?',
parser.add_argument('-s', '--size',
type=int,
metavar = 'px',
nargs='?',
help='Size of the font in px')
parser.add_argument('--bpp',
type=int,
metavar = '1,2,4',
nargs='?',
parser.add_argument('--bpp',
type=int,
metavar = '1,2,4',
nargs='?',
help='Bit per pixel')
parser.add_argument('-r', '--range',
nargs='+',
metavar = 'start-end',
default=['0x20-0x7F,0xB0,0x2022'],
parser.add_argument('-r', '--range',
nargs='+',
metavar = 'start-end',
default=['0x20-0x7F,0xB0,0x2022'],
help='Ranges and/or characters to include. Default is 0x20-7F (ASCII). E.g. -r 0x20-0x7F, 0x200, 324')
parser.add_argument('--symbols',
nargs='+',
metavar = 'sym',
parser.add_argument('--symbols',
nargs='+',
metavar = 'sym',
default=[''],
help=u'Symbols to include. E.g. -s ÁÉŐ'.encode('utf-8'))
parser.add_argument('--font',
metavar = 'file',
nargs='?',
default='Montserrat-Medium.ttf',
parser.add_argument('--font',
metavar = 'file',
nargs='?',
default='Montserrat-Medium.ttf',
help='A TTF or WOFF file')
parser.add_argument('-o', '--output',
nargs='?',
metavar='file',
parser.add_argument('-o', '--output',
nargs='?',
metavar='file',
help='Output file name. E.g. my_font_20.c')
parser.add_argument('--compressed', action='store_true',
help='Compress the bitmaps')
parser.add_argument('--subpx', action='store_true',
help='3 times wider letters for sub pixel rendering')
args = parser.parse_args()
if args.compressed == False:

View File

@@ -2,13 +2,15 @@
import os
print("\nGenerating 16 px CJK")
os.system(u"./built_in_font_gen.py --size 16 -o lv_font_simsun_16_cjk.c --bpp 4 --font SimSun.woff -r 0x20-0x7f --symbols 一在有個我不這了他也就人都說而我們你了要會對及和與以很種的大能著她那上但年還可以最自己為來所他們兩各可為或好等又將因為於由從更被才已者每次把三什麼問題其讓此做再所以只與則台灣卻並位想去呢學生表示到公司將如果社會看小天因此新但是它中使工作全覺得使用這些裡並由於時候知道這樣一認為時間事過向可能中國美國到和幾系統政府大家國家許多生活跟已經大學研究因本二活動該世界應四希望方式內項啊下環境一些必須文化高孩子沒有不能如開始元不同仍網路日本用中心來對雖然重要地方進行關係市場太老師提供學校應該指出經濟其他家發展教育成為多非常便方面很多吃然後未發現電腦一樣而且心不過無法企業正服務較不會臺灣曾嗎空間看到五如何國內們無對於以及之後可是當人員比先產品資訊資料比較先生地除了大陸需要像在給歲請月些名另若亦地區技術至特別其實國際不要發生參加一定其中問台北包括講造成看像常即喜歡去沒出現政治話走單位一直吧是否當然整處理歷史了解那怎麼機會家聽所有只要朋友令甚至用真六呀情況還是錢方法點任何經驗藝術你們十主要媽媽增加提出為什麼以您計畫作利用東西在條設計找之間成長能夠決定學習誰見半時代完成帶相當同學件能力別人生命下來場會議容易開發民眾事情書事實有關自組織言多愛建立相關均產生多業者解決完全的話接受知約一般推動過程管理功能手打水要求小朋友教授難我國告訴內容結果調查家庭成立選擇經營然而父母寫人類至於買尤其配合進入例如得討論依作品情形資源原因啦妳運動觀念給軟體品質經過如此嗯精神影響之過好像成參與以後於是部分另外公園透過訓練努力研究具有共同所謂下行為合作經合作目標起來考慮長意見辦法音樂連受廠商隻受到一切或是中央某女性教學極獲得真的路來快國小部份工程女人舉行句只是段根據現象人民土地面對注意這裡新聞繼續相信政策變成計劃強調學人士前前存在制度意義代表課程該沒至需求人生那些成功爸爸產業負責民間雖影響直接幾乎分實際團體價值使得類形成科技這麼當七不但往本身標準似乎應用或者動物電話態度建設事業老那麼常常字坐舉辦自我有的具目的塊條件即使好十分多少放又電影科學執行邊委員會溝通開一起張針對員工引起自然那麼安全總統此外擁有並且事件設計研究所語言嚴重故事學術片設備之外車基本實在久套達到改善死結構住皆改變拿小組支持座醫院既僅值得學者八交通階段就是申請主管申請同感覺電視母親嘛香港記者壓力快樂喝敢院也許人們談生產怕就身體規定程度積極知識作為機構而是鼓勵角色狀況專家據清楚不僅比賽玩效果越保護共開放附近上父親專業經費曾經工作願意分別重視不少歡迎小孩小時中國人顯示中共出男人避免屬於實施聲音主義行動不可只有校園興趣山表現得回來主任裡面經常不再電子受思想頭終於謝謝協助除當地正式真正低性份因素推出上價格去認識方向責任說明工業大量做逐漸心理一點供須簡單運用觀察往往規劃減少重新業務報導仍然感到開放領域有效女要從事發揮人才反而行政銀行公共媒體提高代自然社區力量啊教育部愈超過維持家長結合校長通常缺乏委員特色結果有時教師之前遠控制本否則法少原則要臉通過建議工具作業達節目智慧來自而變化同樣形式站以為健康擔任人口規劃剛特殊原來道分傳統總是前往投資加強不斷對象追求加上比思考製作台北市取得出來加入台安排兒童國中範圍老人雙方牠北京年輕結束教程式婦女找到彼此全球成本回到部而已之下等變期間非小姐整體採用根本叫歐洲正在加以充滿系列隨著早等等頗不足總分析深報告不錯在於旁笑故消費者意識公尺民族為主大眾到底願度大概對方官員發表進一步自由正確豐富國民黨戰爭怎麼樣只好明顯改革表達肯定強高興哪樹適合茶別國外關心蘇聯成績人物聽到創造不必不論尚居民不管美麗伊拉克帶來有般永遠感情兒子這樣子起全部".encode('utf-8'))
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_simsun_16_cjk.c')
print("Generating 8 px")
os.system("./built_in_font_gen.py --size 8 -o lv_font_montserrat_8.c --bpp 4")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_8.c')
exit()
print("\nGenerating 10 px")
os.system("./built_in_font_gen.py --size 10 -o lv_font_montserrat_10.c --bpp 4")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_10.c')
print("Generating 12 px")
print("\nGenerating 12 px")
os.system("./built_in_font_gen.py --size 12 -o lv_font_montserrat_12.c --bpp 4")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_12.c')
@@ -96,8 +98,6 @@ print("\nGenerating 16 px CJK")
os.system(u"./built_in_font_gen.py --size 16 -o lv_font_simsun_16_cjk.c --bpp 4 --font SimSun.woff -r 0x20-0x7f --symbols 一在有個我不這了他也就人都說而我們你了要會對及和與以很種的大能著她那上但年還可以最自己為來所他們兩各可為或好等又將因為於由從更被才已者每次把三什麼問題其讓此做再所以只與則台灣卻並位想去呢學生表示到公司將如果社會看小天因此新但是它中使工作全覺得使用這些裡並由於時候知道這樣一認為時間事過向可能中國美國到和幾系統政府大家國家許多生活跟已經大學研究因本二活動該世界應四希望方式內項啊下環境一些必須文化高孩子沒有不能如開始元不同仍網路日本用中心來對雖然重要地方進行關係市場太老師提供學校應該指出經濟其他家發展教育成為多非常便方面很多吃然後未發現電腦一樣而且心不過無法企業正服務較不會臺灣曾嗎空間看到五如何國內們無對於以及之後可是當人員比先產品資訊資料比較先生地除了大陸需要像在給歲請月些名另若亦地區技術至特別其實國際不要發生參加一定其中問台北包括講造成看像常即喜歡去沒出現政治話走單位一直吧是否當然整處理歷史了解那怎麼機會家聽所有只要朋友令甚至用真六呀情況還是錢方法點任何經驗藝術你們十主要媽媽增加提出為什麼以您計畫作利用東西在條設計找之間成長能夠決定學習誰見半時代完成帶相當同學件能力別人生命下來場會議容易開發民眾事情書事實有關自組織言多愛建立相關均產生多業者解決完全的話接受知約一般推動過程管理功能手打水要求小朋友教授難我國告訴內容結果調查家庭成立選擇經營然而父母寫人類至於買尤其配合進入例如得討論依作品情形資源原因啦妳運動觀念給軟體品質經過如此嗯精神影響之過好像成參與以後於是部分另外公園透過訓練努力研究具有共同所謂下行為合作經合作目標起來考慮長意見辦法音樂連受廠商隻受到一切或是中央某女性教學極獲得真的路來快國小部份工程女人舉行句只是段根據現象人民土地面對注意這裡新聞繼續相信政策變成計劃強調學人士前前存在制度意義代表課程該沒至需求人生那些成功爸爸產業負責民間雖影響直接幾乎分實際團體價值使得類形成科技這麼當七不但往本身標準似乎應用或者動物電話態度建設事業老那麼常常字坐舉辦自我有的具目的塊條件即使好十分多少放又電影科學執行邊委員會溝通開一起張針對員工引起自然那麼安全總統此外擁有並且事件設計研究所語言嚴重故事學術片設備之外車基本實在久套達到改善死結構住皆改變拿小組支持座醫院既僅值得學者八交通階段就是申請主管申請同感覺電視母親嘛香港記者壓力快樂喝敢院也許人們談生產怕就身體規定程度積極知識作為機構而是鼓勵角色狀況專家據清楚不僅比賽玩效果越保護共開放附近上父親專業經費曾經工作願意分別重視不少歡迎小孩小時中國人顯示中共出男人避免屬於實施聲音主義行動不可只有校園興趣山表現得回來主任裡面經常不再電子受思想頭終於謝謝協助除當地正式真正低性份因素推出上價格去認識方向責任說明工業大量做逐漸心理一點供須簡單運用觀察往往規劃減少重新業務報導仍然感到開放領域有效女要從事發揮人才反而行政銀行公共媒體提高代自然社區力量啊教育部愈超過維持家長結合校長通常缺乏委員特色結果有時教師之前遠控制本否則法少原則要臉通過建議工具作業達節目智慧來自而變化同樣形式站以為健康擔任人口規劃剛特殊原來道分傳統總是前往投資加強不斷對象追求加上比思考製作台北市取得出來加入台安排兒童國中範圍老人雙方牠北京年輕結束教程式婦女找到彼此全球成本回到部而已之下等變期間非小姐整體採用根本叫歐洲正在加以充滿系列隨著早等等頗不足總分析深報告不錯在於旁笑故消費者意識公尺民族為主大眾到底願度大概對方官員發表進一步自由正確豐富國民黨戰爭怎麼樣只好明顯改革表達肯定強高興哪樹適合茶別國外關心蘇聯成績人物聽到創造不必不論尚居民不管美麗伊拉克帶來有般永遠感情兒子這樣子起全部".encode('utf-8'))
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_simsun_16_cjk.c')
print("Generating 16 px Hebrew, Persian")
print("\nGenerating 16 px Hebrew, Persian")
os.system("./built_in_font_gen.py --size 16 -o lv_font_dejavu_16_persian_hebrew.c --bpp 4 --font DejaVuSans.ttf -r 0x20-0x7f,0x5d0-0x5ea,0x600-0x6FF,0xFB50-0xFDFF,0xFE70-0xFEFF")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_dejavu_16_persian_hebrew.c')

View File

@@ -23,7 +23,7 @@
--suffix=none
--preserve-date
--formatted
--exclude=lv_conf_internal.h
--exclude=lv_conf_internal.h
--exclude=../src/lv_font/lv_font_montserrat_12.c
--exclude=../src/lv_font/lv_font_montserrat_14.c
--exclude=../src/lv_font/lv_font_montserrat_16.c
@@ -47,4 +47,3 @@
--exclude=../src/lv_font/lv_font_montserrat_28_compressed.c
--exclude=../src/lv_font/lv_font_simsun_16_cjk.c
--exclude=../src/lv_font/lv_font_dejavu_16_persian_hebrew.c

View File

@@ -1,2 +1 @@
cppcheck -j8 --template="{severity}\t{file}:{line}\t{id}: {message}" --enable=all ../src/ --output-file=cppcheck_res.txt --suppress=unusedFunction --suppress=preprocessorErrorDirective --force

View File

@@ -1,10 +1,9 @@
# https://github.com/facebook/infer
#
# Install:
# Install:
# VERSION=0.17.0; \
# curl -sSL "https://github.com/facebook/infer/releases/download/v$VERSION/infer-linux64-v$VERSION.tar.xz" \
# | sudo tar -C /opt -xJ && \
# sudoln -s "/opt/infer-linux64-v$VERSION/bin/infer" /usr/local/bin/infer
infer run -- make -j8

View File

@@ -1,10 +1,9 @@
#!/usr/bin/env python3
'''
Generates a checker file for lv_conf.h from lv_conf_templ.h define all the not defined values
Generates a checker file for lv_conf.h from lv_conf_template.h define all the not defined values
'''
import sys
import re
@@ -15,7 +14,6 @@ if sys.version_info < (3,6,0):
fin = open("../lv_conf_template.h", "r")
fout = open("../src/lv_conf_internal.h", "w")
fout.write(
'''/**
* GENERATED FILE, DO NOT EDIT IT!
@@ -29,16 +27,41 @@ fout.write(
#include <stdint.h>
#if defined(LV_CONF_PATH)
#define __LV_TO_STR_AUX(x) #x
#define __LV_TO_STR(x) __LV_TO_STR_AUX(x)
#include __LV_TO_STR(LV_CONF_PATH)
#undef __LV_TO_STR_AUX
#undef __LV_TO_STR
#elif defined(LV_CONF_INCLUDE_SIMPLE)
#include "lv_conf.h"
#else
#include "../../lv_conf.h"
/* Add ESP-IDF related includes */
#if defined (ESP_PLATFORM)
# include "sdkconfig.h"
# include "esp_attr.h"
#endif
/* Handle special Kconfig options */
#include "lv_conf_kconfig.h"
#ifdef CONFIG_LV_CONF_SKIP
#define LV_CONF_SKIP
#endif
/* If "lv_conf.h" is available from here try to use it later.*/
#if defined __has_include
# if __has_include("lv_conf.h")
# ifndef LV_CONF_INCLUDE_SIMPLE
# define LV_CONF_INCLUDE_SIMPLE
# endif
# endif
#endif
/*If lv_conf.h is not skipped include it*/
#if !defined(LV_CONF_SKIP)
# if defined(LV_CONF_PATH) /*If there is a path defined for lv_conf.h use it*/
# define __LV_TO_STR_AUX(x) #x
# define __LV_TO_STR(x) __LV_TO_STR_AUX(x)
# include __LV_TO_STR(LV_CONF_PATH)
# undef __LV_TO_STR_AUX
# undef __LV_TO_STR
# elif defined(LV_CONF_INCLUDE_SIMPLE) /*Or simply include lv_conf.h is enabled*/
# include "lv_conf.h"
# else
# include "../../lv_conf.h" /*Else assume lv_conf.h is next to the lvgl folder */
# endif
#endif
'''
@@ -57,23 +80,70 @@ for i in fin.read().splitlines():
if '/*--END OF LV_CONF_H--*/' in i: break
r = re.search(r'^ *# *define ([^\s]+).*$', i)
#ifndef LV_USE_BTN /*Only if not defined in lv_conf.h*/
# ifdef CONFIG_LV_USE_BTN /*Use KConfig value if set*/
# define LV_USE_BTN CONFIG_LV_USE_BTN
# else
# define LV_USE_BTN 1 /*Use default value*/
# endif
#endif
if r:
line = re.sub('\(.*?\)', '', r[1], 1) #remove parentheses from macros
dr = re.sub('.*# *define', '', i, 1)
d = "# define " + dr
fout.write(
f'#ifndef {line}\n'
f'{i}\n'
'#endif\n'
f'# ifdef CONFIG_{line.upper()}\n'
f'# define {line} CONFIG_{line.upper()}\n'
f'# else\n'
f'{d}\n'
f'# endif\n'
f'#endif\n'
)
elif re.search('^ *typedef .*;.*$', i):
continue #ignore typedefs to avoide redeclaration
else:
fout.write(f'{i}\n')
fout.write(
'''
#endif /*LV_CONF_CHECKER_H*/
/*If running without lv_conf.h add typdesf with default value*/
#if defined(LV_CONF_SKIP)
/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
typedef int16_t lv_coord_t;
# if LV_USE_ANIMATION
/*Declare the type of the user data of animations (can be e.g. `void *`, `int`, `struct`)*/
typedef void * lv_anim_user_data_t;
# endif
# if LV_USE_GROUP
typedef void * lv_group_user_data_t;
# endif
# if LV_USE_FILESYSTEM
typedef void * lv_fs_drv_user_data_t;
# endif
typedef void * lv_img_decoder_user_data_t;
typedef void * lv_disp_drv_user_data_t; /*Type of user data in the display driver*/
typedef void * lv_indev_drv_user_data_t; /*Type of user data in the input device driver*/
typedef void * lv_font_user_data_t;
# if LV_USE_USER_DATA
typedef void * lv_obj_user_data_t;
# endif
#endif
#endif /*LV_CONF_INTERNAL_H*/
'''
)

View File

@@ -1,249 +0,0 @@
import re
import os
lastNum = re.compile(r'(?:[^\d]*(\d+)[^\d]*)+')
def title(t):
print("\n---------------------------------")
print(t)
print("---------------------------------")
def cmd(c):
print("\n" + c)
r = os.system(c)
if r:
print("Exit due to previous error")
exit(r)
def lvgl_clone():
title("lvgl: Clone")
cmd("git clone https://github.com/lvgl/lvgl.git")
os.chdir("./lvgl")
cmd("git co master")
def lvgl_format():
title("lvgl: Run code formatter")
os.chdir("./scripts")
cmd("./code-format.sh")
cmd("git ci -am 'Run code formatter'")
os.chdir("..")
def lvgl_update_version():
title("lvgl: Update version number")
f = open("./lvgl.h", "r")
outbuf = ""
major_ver = -1
minor_ver = -1
patch_ver = -1
for i in f.read().splitlines():
r = re.search(r'^#define LVGL_VERSION_MAJOR ', i)
if r:
m = lastNum.search(i)
if m: major_ver = m.group(1)
r = re.search(r'^#define LVGL_VERSION_MINOR ', i)
if r:
m = lastNum.search(i)
if m: minor_ver = m.group(1)
r = re.search(r'^#define LVGL_VERSION_PATCH ', i)
if r:
m = lastNum.search(i)
if m: patch_ver = m.group(1)
r = re.search(r'^#define LVGL_VERSION_INFO ', i)
if r:
i = "#define LVGL_VERSION_INFO \"\""
outbuf += i + '\n'
f.close()
f = open("./lvgl.h", "w")
f.write(outbuf)
f.close()
s = "v" + str(major_ver) + "." + str(minor_ver) + "." + str(patch_ver)
print("New version:" + s)
return s
def lvgl_update_library_json(v):
title("lvgl: Update version number in library.json")
f = open("./library.json", "r")
outbuf = ""
for i in f.read().splitlines():
r = re.search(r'"version": ', i)
if r:
i = ' "version": "' + v + '",'
outbuf += i + '\n'
f.close()
f = open("./library.json", "w")
f.write(outbuf)
f.close()
def lvgl_update_lv_conf_templ(ver_str):
title("lvgl: Update version number in lv_conf_template.h")
cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+/"+ ver_str +"/' lv_conf_template.h ")
def lvgl_commit_push(v):
title("lvgl: commit and push release")
cmd('git ci -am "Release ' + v + '"')
cmd('git tag -a ' + v + ' -m "Release ' + v +'"')
cmd('git push origin master')
cmd('git push origin ' + v)
def lvgl_merge_to_release_branch(v):
title("lvgl: merge to release branch")
cmd('git co release/v7')
cmd('git merge master')
cmd('git push origin release/v7')
os.chdir("../")
def lvgl_update_api_docs():
title("lvgl: Update API with Doxygen")
cmd("cd scripts; doxygen");
def examples_clone():
title("examples: Clone")
cmd("git clone https://github.com/lvgl/lv_examples.git")
os.chdir("./lv_examples")
cmd("git co master")
def examples_commit_push(v):
title("examples: commit and push release")
cmd('git ci -am "Release ' + v + '"')
cmd('git tag -a ' + v + ' -m "Release ' + v +'"')
cmd('git push origin master')
cmd('git push origin ' + v)
def examples_merge_to_release_branch(v):
title("examples: merge to release branch")
cmd('git co release/v7')
cmd('git merge master')
cmd('git push origin release/v7')
os.chdir("../")
def drivers_clone():
title("drivers: Clone")
cmd("git clone https://github.com/lvgl/lv_drivers.git")
os.chdir("./lv_drivers")
cmd("git co master")
def drivers_commit_push(v):
title("drivers: commit and push release")
cmd('git ci -am "Release ' + v + '"')
cmd('git tag -a ' + v + ' -m "Release ' + v +'"')
cmd('git push origin master')
cmd('git push origin ' + v)
def drivers_merge_to_release_branch(v):
title("drivers: merge to release branch")
cmd('git co release/v7')
cmd('git merge master')
cmd('git push origin release/v7')
os.chdir("../")
def docs_clone():
title("docs: Clone")
cmd("git clone --recursive https://github.com/lvgl/docs.git")
os.chdir("./docs")
def docs_get_api():
title("docs: Get API files")
cmd("git co latest")
cmd("rm -rf xml");
cmd("cp -r ../../lvgl/docs/api_doc/xml .");
cmd("git add xml");
cmd('git commit -m "update API"')
def docs_update_version(v):
title("docs: Update version number")
f = open("./conf.py", "r")
outbuf = ""
for i in f.read().splitlines():
r = re.search(r'^version = ', i)
if r:
i = "version = '" + v + "'"
r = re.search(r'^release = ', i)
if r:
i = "version = '" + v + "'"
outbuf += i + '\n'
f.close()
f = open("./conf.py", "w")
f.write(outbuf)
f.close()
cmd("git add conf.py")
cmd('git ci -m "update conf.py to ' + v '"')
def docs_update_trans():
title("docs: Update translations")
cmd("cd en && ./trans_push.py && ./trans_pull.py")
def docs_build():
title("docs: Build")
cmd("git checkout master")
cmd("./update.py latest")
def clean_up():
title("Clean up repos")
os.chdir("../..")
cmd("rm -rf lvgl docs lv_examples lv_drivers")
lvgl_clone()
lvgl_format()
lvgl_update_api_docs()
ver_str = lvgl_update_version()
lvgl_update_library_json(ver_str)
lvgl_update_lv_conf_templ(ver_str)
lvgl_commit_push(ver_str)
lvgl_merge_to_release_branch(ver_str)
examples_clone()
examples_commit_push(ver_str)
examples_merge_to_release_branch(ver_str)
drivers_clone()
drivers_commit_push(ver_str)
drivers_merge_to_release_branch(ver_str)
docs_clone()
docs_get_api()
docs_update_version(ver_str)
#docs_update_trans() # Zanata is not working now
docs_build()
clean_up()

110
scripts/release/com.py Executable file
View File

@@ -0,0 +1,110 @@
#!/usr/bin/env python
import sys
import os.path
from os import path
import os, fnmatch
import re
import subprocess
import com
def cmd(c, ask_on_err = True):
print("\n" + c)
r = os.system(c)
if r:
print("### Error: " + str(r))
if ask_on_err:
input("Press Enter to continue execution...")
def define_set(fn, name, value):
print("In " + fn + " set " + name + " to " + value)
new_content = ""
s = r'^ *# *define +' + str(name).rstrip() + ' +'
f = open(fn, "r")
for i in f.read().splitlines():
r = re.search(s, i)
if r:
d = i.split("define")
i = d[0] + "define " + name + " " + value
new_content += i + '\n'
f.close()
f = open(fn, "w")
f.write(new_content)
f.close()
def ver_format(ver):
s = "v" + str(ver[0]) + "." + str(ver[1]) + "." + str(ver[2])
if(ver[3] != ""): s = s + "-" + ver[3]
return s
def get_lvgl_version(br):
print("Get LVGL's version")
ver = [0, 0, 0, ""]
os.chdir("./lvgl")
com.cmd("git checkout " + br)
f = open("./lvgl.h", "r")
lastNum = re.compile(r'(?:[^\d]*(\d+)[^\d]*)+')
for i in f.read().splitlines():
r = re.search(r'^#define LVGL_VERSION_MAJOR ', i)
if r:
m = lastNum.search(i)
if m: ver[0] = m.group(1)
r = re.search(r'^#define LVGL_VERSION_MINOR ', i)
if r:
m = lastNum.search(i)
if m: ver[1] = m.group(1)
r = re.search(r'^#define LVGL_VERSION_PATCH ', i)
if r:
m = lastNum.search(i)
if m: ver[2] = m.group(1)
f.close()
com.cmd("git checkout master")
os.chdir("../")
return ver
def push(c):
cmd("git push " + c)
def update_version(ver):
ver_str = ver_format(ver)
ver_num = ver[0] + "." + ver[1] + "." + ver[2]
templ = fnmatch.filter(os.listdir('.'), '*_templ*.h')
if len(templ) > 0 and templ[0]:
print("Updating version in " + templ[0])
cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+.*/"+ "v" + ver_num + "/' " + templ[0])
if os.path.exists("library.json"):
print("Updating version in library.json")
cmd("sed -i -r 's/[0-9]+\.[0-9]+\.[0-9]+/"+ ver_num +"/' library.json")
if path.exists("library.properties"):
print("Updating version in library.properties")
cmd("sed -i -r 's/version=[0-9]+\.[0-9]+\.[0-9]+/"+ "version=" + ver_num + "/' library.properties")
if path.exists("conf.py"):
cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + ver_str + "'/\" conf.py")
if path.exists("Kconfig"):
cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + ver_str + "'/\" Kconfig")
if path.exists("lvgl.h"):
define_set("./lvgl.h", "LVGL_VERSION_MAJOR", str(ver[0]))
define_set("./lvgl.h", "LVGL_VERSION_MINOR", str(ver[1]))
define_set("./lvgl.h", "LVGL_VERSION_PATCH", str(ver[2]))
define_set("./lvgl.h", "LVGL_VERSION_INFO", "\"" + ver[3] + "\"")

72
scripts/release/dev.py Executable file
View File

@@ -0,0 +1,72 @@
#!/usr/bin/env python
import re
import os, fnmatch
import os.path
from os import path
from datetime import date
import com
def lvgl_update_ver(ver, br):
os.chdir("./lvgl")
com.cmd("git checkout " + br)
com.update_version(ver)
com.cmd("git commit -am 'Update " + br + " version'")
com.push("origin " + br)
com.cmd("git checkout master")
os.chdir("../")
def docs_update_ver(ver, br):
os.chdir("./docs")
com.cmd("git checkout " + br + " --")
com.update_version(ver)
com.cmd("git commit -am 'Update " + br + " version'")
com.push("origin " + br)
com.cmd("git checkout master --")
os.chdir("../")
def merge_dev_to_master():
os.chdir("./lvgl")
com.cmd("git checkout master")
com.cmd("git merge dev")
com.push("origin master")
os.chdir("../")
os.chdir("./docs")
com.cmd("git checkout dev -- ") #'dev' sometimes is not recognized so switch to it first
com.cmd("git checkout latest --")
com.cmd("git merge dev -X theirs --no-edit;")
com.push("origin latest")
os.chdir("../")
def make(mode):
if(mode == "bugfix"):
ver = com.get_lvgl_version("master")
ver[3] = "dev"
ver[2] = str(int(ver[2]) + 1)
lvgl_update_ver(ver, "master")
docs_update_ver(ver, "latest")
else:
ver = com.get_lvgl_version("dev")
ver[3] = "dev"
merge_dev_to_master()
if(mode == "major"):
ver[0] = str(int(ver[0]) + 1)
ver[1] = '0'
ver[2] = '0'
if(mode == "minor"):
ver[1] = str(int(ver[1]) + 1)
ver[2] = '0'
lvgl_update_ver(ver, "dev")
docs_update_ver(ver, "dev")
if __name__ == '__main__':
if(len(sys.argv) != 2):
print("Missing argument. Usage ./dev.py major | minor | bugfix")
print("E.g. ./dev.py minor")
else:
make(sys.argv[1])

65
scripts/release/main.py Executable file
View File

@@ -0,0 +1,65 @@
#!/usr/bin/env python
import os.path
from os import path
from datetime import date
import sys
import com
import release
import dev
import proj
upstream_org_url = "https://github.com/lvgl/"
workdir = "./release_tmp"
proj_list = [ "lv_sim_eclipse_sdl", "lv_sim_emscripten"]
def upstream(repo):
return upstream_org_url + repo + ".git"
def clone(repo):
com.cmd("git clone --recurse-submodules " + upstream(repo))
os.chdir("./" + repo)
com.cmd("git checkout master")
com.cmd("git remote update origin --prune")
com.cmd("git pull origin --tags")
os.chdir("..")
def clone_repos():
com.cmd("rm -fr " + workdir)
com.cmd("mkdir " + workdir)
os.chdir(workdir)
clone("lvgl")
clone("lv_examples")
clone("lv_drivers")
clone("docs")
clone("blog")
for p in proj_list:
clone(p)
def cleanup():
os.chdir("../")
com.cmd("rm -fr " + workdir)
if __name__ == '__main__':
prepare_type = ['major', 'minor', 'bugfix']
dev_prepare = 'minor'
# if(len(sys.argv) != 2):
# print("Missing argument. Usage ./release.py bugfix | minor | major")
# print("Use minor by default")
# else:
# dev_prepare = sys.argv[1]
if not (dev_prepare in prepare_type):
print("Invalid argument. Usage ./release.py bugfix | minor | major")
exit(1)
#os.chdir(workdir)
clone_repos()
release.make()
for p in proj_list:
proj.make(p, True)
dev.make(dev_prepare)
#cleanup()

62
scripts/release/proj.py Executable file
View File

@@ -0,0 +1,62 @@
#!/usr/bin/env python
import sys
import os.path
from os import path
import re
import subprocess
import com
def make(repo_path, auto_push = False):
os.chdir("./" + repo_path)
com.cmd('git checkout master')
print("Update lvgl");
os.chdir("./lvgl")
com.cmd("git checkout master")
com.cmd("git pull origin --tags")
out = subprocess.Popen(['git', 'tag', '--sort=-creatordate'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
stdout,stderr = out.communicate()
ver_str = stdout.decode("utf-8").split('\n')[0]
release_br = ver_str[1:] #trim "v"
release_br = release_br.split('.')[0] # get the first number
release_br = "release/v" + release_br
com.cmd("git checkout " + release_br + "; git pull origin " + release_br)
os.chdir("..")
com.cmd("cp -f lvgl/lv_conf_template.h lv_conf.h")
com.cmd("sed -i -r 's/#if 0/#if 1/' lv_conf.h") # Enable lv_conf.h
with open("confdef.txt") as f:
for line in f:
(key, val) = line.rstrip().split('\t')
com.define_set("lv_conf.h", str(key), str(val))
if os.path.exists("lv_examples"):
print("Update lv_examples");
com.cmd("cd lv_examples; git co " + release_br + "; git pull origin " + release_br)
if os.path.exists("lv_drivers"):
print("update lv_drivers");
com.cmd("cd lv_drivers " + release_br + "; git pull origin " + release_br)
msg = 'Update to ' + ver_str
com.cmd("git add .")
com.cmd('git commit -am "' + msg + '"')
com.cmd("git tag -a " + ver_str + " -m '" + msg + "' " )
if auto_push:
com.push("origin --tags")
com.push("origin master")
os.chdir("../")
if __name__ == '__main__':
if(len(sys.argv) != 2):
print("Missing argument. Usage ./projs_update.py repo_path")
print("E.g. ./projs_update.py ./lv_sim_eclipse_sdl")
else:
make(sys.argv[1], sys.argv[2])

171
scripts/release/release.py Executable file
View File

@@ -0,0 +1,171 @@
#!/usr/bin/env python
import os.path
from os import path
from datetime import date
import sys
import com
import re
def update_release_branch(release_br, master_br = "master"):
com.cmd("git checkout " + release_br)
com.cmd("git pull origin " + release_br)
com.cmd("git merge "+ master_br +" -X ours");
com.push("origin " + release_br);
com.cmd("git checkout master");
def lvgl_release(ver):
print("Release lvgl")
ver_str = com.ver_format(ver)
release_br = "release/v" + str(ver[0])
os.chdir("./lvgl")
com.define_set("./lvgl.h", "LVGL_VERSION_INFO", '\"\"')
# Run some scripts
os.chdir("./scripts")
com.cmd("./code-format.sh")
com.cmd("./lv_conf_checker.py")
com.cmd("doxygen")
os.chdir("../")
com.update_version(ver)
#update CHANGLELOG
new_content = ""
f = open("./CHANGELOG.md", "r")
release_note = ""
note_state = 0
for i in f.read().splitlines():
if note_state == 0:
r = re.search(r'^## ' + ver_str, i)
if r:
i = i.replace("planned on ", "")
note_state+=1
elif note_state == 1:
r = re.search(r'^## ', i)
if r:
note_state+=1
else:
release_note += i + '\n'
new_content += i + '\n'
f.close()
f = open("./CHANGELOG.md", "w")
f.write(new_content)
f.close()
com.cmd('git commit -am "Release ' + ver_str + '"')
com.cmd('git checkout dev')
com.cmd("git merge master -X ours")
com.cmd("git add .")
com.cmd("git commit -am 'Merge master'", False)
com.push('origin dev')
com.cmd('git checkout master')
com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ")
com.push('origin master')
com.push('origin --tags')
update_release_branch(release_br)
os.chdir("../")
return release_note
def lv_examples_release(ver):
print("Release lv_examples")
os.chdir("./lv_examples")
release_br = "release/v" + str(ver[0])
ver_str = com.ver_format(ver)
com.update_version(ver)
com.cmd("sed -i -r 's/LV_VERSION_CHECK\([0-9]+, *[0-9]+, *[0-9]+\)/"+ "LV_VERSION_CHECK\(" + str(ver[0]) + ", " + str(ver[1]) + ", " + str(ver[2]) + ")/' lv_examples.h")
com.cmd('git commit -am "Release ' + ver_str + '"')
com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ")
com.push('origin master')
com.push('origin --tags')
os.chdir("../")
def lv_drivers_release(ver):
print("Release lv_drivers")
os.chdir("./lv_drivers")
release_br = "release/v" + str(ver[0])
ver_str = com.ver_format(ver)
com.update_version(ver)
com.cmd('git commit -am "Release ' + ver_str + '"')
com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ")
com.push('origin master')
com.push('origin --tags')
update_release_branch(release_br)
os.chdir("../")
def docs_release(ver):
print("Release docs")
os.chdir("./docs")
release_br = "release/v" + str(ver[0])
ver_str = com.ver_format(ver)
com.cmd("git co latest --")
com.cmd("rm -rf xml");
com.cmd("cp -r ../lvgl/docs/api_doc/xml .");
com.cmd("git add xml");
com.update_version(ver)
com.cmd('git commit -am "Release ' + ver_str + '"')
com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ")
com.push('origin master')
com.push('origin --tags')
update_release_branch(release_br, "latest")
os.chdir("../")
def blog_release(ver, release_note):
os.chdir("./blog/_posts")
ver_str = com.ver_format(ver)
post = "---\nlayout: post\ntitle: " + ver_str + " is released\nauthor: \"kisvegabor\"\ncover: /assets/release_cover.png\n---\n\n"
post += release_note
today = date.today()
d = today.strftime("%Y-%m-%d")
f = open(d + "-release_" + ver_str + ".md", "w")
f.write(post)
f.close()
com.cmd("git add .")
com.cmd("git commit -am 'Add " + ver_str + " release post'")
com.push('origin master')
os.chdir("../../")
def make():
ver = com.get_lvgl_version("master")
release_note = lvgl_release(ver)
lv_examples_release(ver)
lv_drivers_release(ver)
docs_release(ver)
blog_release(ver, release_note)
if __name__ == '__main__':
make()

View File

@@ -49,7 +49,6 @@ static inline void lv_task_once(lv_task_t * task)
#endif
#if LV_USE_DROPDOWN
static inline void lv_dropdown_set_draw_arrow(lv_obj_t * ddlist, bool en)
@@ -145,10 +144,8 @@ static inline void lv_roller_set_fix_width(lv_obj_t * roller, lv_coord_t w)
lv_obj_set_width(roller, w);
}
#endif
#if LV_USE_PAGE
#define lv_scrlbar_mode_t lv_scrollbar_mode_t
@@ -159,7 +156,6 @@ static inline void lv_roller_set_fix_width(lv_obj_t * roller, lv_coord_t w)
#define LV_SCRLBAR_MODE_HIDE LV_SCROLLBAR_MODE_HIDE
#define LV_SCRLBAR_MODE_UNHIDE LV_SCROLLBAR_MODE_UNHIDE
static inline void lv_page_set_scrlbar_mode(lv_obj_t * page, lv_scrlbar_mode_t sb_mode)
{
lv_page_set_scrollbar_mode(page, sb_mode);
@@ -169,13 +165,23 @@ static inline lv_scrollbar_mode_t lv_page_get_scrlbar_mode(lv_obj_t * page)
return lv_page_get_scrollbar_mode(page);
}
static inline lv_obj_t * lv_page_get_scrl(lv_obj_t * page)
{
return lv_page_get_scrollable(page);
}
#endif
#endif /*LV_USE_API_EXTENSION_V6*/
/*---------------------
* V7.0 COMPATIBILITY
*--------------------*/
#if LV_USE_API_EXTENSION_V7
#if LV_USE_ROLLER
#define LV_ROLLER_MODE_INIFINITE LV_ROLLER_MODE_INFINITE
#endif
#if LV_USE_WIN
static inline lv_obj_t * lv_win_add_btn(lv_obj_t * win, const void * img_src)
@@ -185,8 +191,36 @@ static inline lv_obj_t * lv_win_add_btn(lv_obj_t * win, const void * img_src)
#endif
#endif /*LV_USE_API_EXTENSION_V6*/
#if LV_USE_CHART
static inline void lv_chart_set_range(lv_obj_t * chart, lv_coord_t ymin, lv_coord_t ymax)
{
lv_chart_set_y_range(chart, LV_CHART_AXIS_PRIMARY_Y, ymin, ymax);
}
static inline void lv_chart_clear_serie(lv_obj_t * chart, lv_chart_series_t * series)
{
lv_chart_clear_series(chart, series);
}
#endif
static inline void lv_obj_align_origo(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs,
lv_coord_t y_ofs)
{
lv_obj_align_mid(obj, base, align, x_ofs, y_ofs);
}
static inline void lv_obj_align_origo_x(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs)
{
lv_obj_align_mid_y(obj, base, align, x_ofs);
}
static inline void lv_obj_align_origo_y(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t y_ofs)
{
lv_obj_align_mid_y(obj, base, align, y_ofs);
}
#endif /*LV_USE_API_EXTENSION_V6*/
/**********************
* MACROS
**********************/

File diff suppressed because it is too large Load Diff

420
src/lv_conf_kconfig.h Normal file
View File

@@ -0,0 +1,420 @@
/**
* @file lv_conf_kconfig.h
* Configs that needs special handling when LVGL is used with Kconfig
*/
#ifndef LV_CONF_KCONFIG_H
#define LV_CONF_KCONFIG_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef LV_CONF_KCONFIG_EXTERNAL_INCLUDE
# include LV_CONF_KCONFIG_EXTERNAL_INCLUDE
#else
# if defined ESP_PLATFORM
# include "sdkconfig.h"
# include "esp_attr.h"
# endif
# ifdef __NuttX__
# include <nuttx/config.h>
# endif
#endif /*LV_CONF_KCONFIG_EXTERNAL_INCLUDE*/
/*******************
* LV_MEM_SIZE
*******************/
#ifndef LV_MEM_SIZE
#if defined (CONFIG_LV_MEM_SIZE_KILOBYTES)
#define CONFIG_LV_MEM_SIZE (CONFIG_LV_MEM_SIZE_KILOBYTES * 1024U)
#endif
#endif
/*******************
* LV COLOR TRANSP
*******************/
#ifndef LV_COLOR_TRANSP
#if defined (CONFIG_LV_COLOR_TRANSP_HEX)
#define CONFIG_LV_COLOR_TRANSP lv_color_hex(CONFIG_LV_COLOR_TRANSP_HEX)
#else
#define CONFIG_LV_COLOR_TRANSP LV_COLOR_LIME
#endif
#endif
/*******************
* THEME SELECTION
*******************/
#ifndef LV_THEME_DEFAULT_INIT
#if defined (CONFIG_LV_THEME_DEFAULT_INIT_EMPTY)
#define CONFIG_LV_THEME_DEFAULT_INIT lv_theme_empty_init
#elif defined (CONFIG_LV_THEME_DEFAULT_INIT_TEMPLATE)
#define CONFIG_LV_THEME_DEFAULT_INIT lv_theme_template_init
#elif defined (CONFIG_LV_THEME_DEFAULT_INIT_MATERIAL)
#define CONFIG_LV_THEME_DEFAULT_INIT lv_theme_material_init
#elif defined (CONFIG_LV_THEME_DEFAULT_INIT_MONO)
#define LV_THEME_DEFAULT_INIT lv_theme_mono_init
#endif
#endif
/*******************
* COLOR SELECTION
*******************/
#ifndef LV_THEME_DEFAULT_COLOR_PRIMARY
#ifdef CONFIG_LV_THEME_DEFAULT_COLOR_PRIMARY
#define LV_THEME_DEFAULT_COLOR_PRIMARY lv_color_hex(CONFIG_LV_THEME_DEFAULT_COLOR_PRIMARY)
#endif
#endif
#ifndef LV_THEME_DEFAULT_COLOR_SECONDARY
#ifdef CONFIG_LV_THEME_DEFAULT_COLOR_SECONDARY
#define LV_THEME_DEFAULT_COLOR_SECONDARY lv_color_hex(CONFIG_LV_THEME_DEFAULT_COLOR_SECONDARY)
#endif
#endif
/********************
* FONT SELECTION
*******************/
/* NOTE: In Kconfig instead of `LV_THEME_DEFAULT_FONT_SMALL`
* `CONFIG_LV_THEME_DEFAULT_FONT_SMALL_<font_name>` is defined
* hence the large selection with if-s
*/
/*------------------
* SMALL FONT
*-----------------*/
#ifndef LV_THEME_DEFAULT_FONT_SMALL
#if defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_8
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_8
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_10
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_10
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_12
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_12
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_14
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_14
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_16
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_16
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_18
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_18
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_20
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_20
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_22
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_22
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_24
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_24
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_26
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_26
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_28
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_28
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_30
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_30
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_32
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_32
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_34
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_34
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_36
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_36
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_38
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_38
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_40
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_40
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_42
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_42
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_44
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_44
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_46
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_46
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT_48
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_48
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_UNSCII_8
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_unscii_8
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_UNSCII_16
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_unscii_16
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT12SUBPX
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_12_subpx
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_MONTSERRAT28COMPRESSED
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_28_compressed
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_DEJAVU_16_PERSIAN_HEBREW
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_dejavu_16_persian_hebrew
#elif defined CONFIG_LV_FONT_DEFAULT_SMALL_SIMSUN_16_CJK
#define CONFIG_LV_THEME_DEFAULT_FONT_SMALL &lv_font_simsun_16_cjk
#endif
#endif
/*------------------
* NORMAL FONT
*-----------------*/
#ifndef LV_THEME_DEFAULT_FONT_NORMAL
#if defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_8
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_8
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_10
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_10
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_12
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_12
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_14
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_14
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_16
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_16
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_18
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_18
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_20
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_20
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_22
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_22
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_24
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_24
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_26
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_26
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_28
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_28
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_30
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_30
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_32
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_32
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_34
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_34
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_36
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_36
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_38
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_38
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_40
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_40
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_42
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_42
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_44
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_44
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_46
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_46
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT_48
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_48
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_UNSCII_8
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_unscii_8
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_UNSCII_16
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_unscii_16
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT12SUBPX
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_12_subpx
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_MONTSERRAT28COMPRESSED
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_28_compressed
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_DEJAVU_16_PERSIAN_HEBREW
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_dejavu_16_persian_hebrew
#elif defined CONFIG_LV_FONT_DEFAULT_NORMAL_SIMSUN_16_CJK
#define CONFIG_LV_THEME_DEFAULT_FONT_NORMAL &lv_font_simsun_16_cjk
#endif
#endif
/*------------------
* SUBTITLE FONT
*-----------------*/
#ifndef LV_THEME_DEFAULT_FONT_SUBTITLE
#if defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_8
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_8
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_10
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_10
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_12
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_12
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_14
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_14
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_16
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_16
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_18
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_18
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_20
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_20
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_22
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_22
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_24
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_24
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_26
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_26
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_28
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_28
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_30
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_30
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_32
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_32
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_34
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_34
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_36
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_36
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_38
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_38
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_40
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_40
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_42
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_42
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_44
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_44
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_46
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_46
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT_48
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_48
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_UNSCII_8
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_unscii_8
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_UNSCII_16
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_unscii_16
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT12SUBPX
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_12_subpx
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_MONTSERRAT28COMPRESSED
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_28_compressed
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_DEJAVU_16_PERSIAN_HEBREW
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_dejavu_16_persian_hebrew
#elif defined CONFIG_LV_FONT_DEFAULT_SUBTITLE_SIMSUN_16_CJK
#define CONFIG_LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_simsun_16_cjk
#endif
#endif
/*------------------
* TITLE FONT
*-----------------*/
#ifndef LV_THEME_DEFAULT_FONT_TITLE
#if defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_8
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_8
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_10
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_10
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_12
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_12
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_14
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_14
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_16
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_16
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_18
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_18
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_20
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_20
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_22
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_22
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_24
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_24
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_26
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_26
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_28
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_28
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_30
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_30
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_32
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_32
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_34
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_34
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_36
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_36
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_38
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_38
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_40
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_40
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_42
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_42
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_44
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_44
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_46
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_46
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT_48
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_48
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_UNSCII_8
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_unscii_8
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_UNSCII_16
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_unscii_16
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT12SUBPX
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_12_subpx
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_MONTSERRAT28COMPRESSED
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_28_compressed
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_DEJAVU_16_PERSIAN_HEBREW
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_dejavu_16_persian_hebrew
#elif defined CONFIG_LV_FONT_DEFAULT_TITLE_SIMSUN_16_CJK
#define CONFIG_LV_THEME_DEFAULT_FONT_TITLE &lv_font_simsun_16_cjk
#endif
#endif
/*------------------
* TEXT ENCODING
*-----------------*/
#ifndef LV_TEXT_ENC
#ifdef CONFIG_LV_TXT_ENC_UTF8
#define CONFIG_LV_TXT_ENC LV_TXT_ENC_UTF8
#elif defined CONFIG_LV_TXT_ENC_ASCII
#define CONFIG_LV_TXT_ENC LV_TXT_ENC_ASCII
#endif
#endif
/*------------------
* BIDI DIRECTION
*-----------------*/
#ifndef LV_BIDI_BASE_DIR_DEF
#ifdef CONFIG_LV_BIDI_DIR_LTR
#define CONFIG_LV_BIDI_BASE_DIR_DEF LV_BIDI_DIR_LTR
#elif defined CONFIG_LV_BIDI_DIR_RTL
#define CONFIG_LV_BIDI_BASE_DIR_DEF LV_BIDI_DIR_RTL
#elif defined CONFIG_LV_BIDI_DIR_AUTO
#define CONFIG_LV_BIDI_BASE_DIR_DEF LV_BIDI_DIR_AUTO
#endif
#endif
/*------------------
* EXT CLICK AREA
*-----------------*/
#ifndef LV_USE_EXT_CLICK_AREA
#ifdef CONFIG_LV_USE_EXT_CLICK_AREA_OFF
#define CONFIG_LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_OFF
#elif defined CONFIG_LV_USE_EXT_CLICK_AREA_TINY
#define CONFIG_LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_TINY
#elif defined CONFIG_LV_USE_EXT_CLICK_AREA_FULL
#define CONFIG_LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_FULL
#endif
#endif
/*------------------
* LINEMETER PRECISE
*-----------------*/
#ifndef LV_LINEMETER_PRECISE
#ifdef CONFIG_LV_LINEMETER_PRECISE_NO_EXTRA_PRECISION
#define CONFIG_LV_LINEMETER_PRECISE 0
#elif defined CONFIG_LV_LINEMETER_PRECISE_SOME_EXTRA_PRECISION
#define CONFIG_LV_LINEMETER_PRECISE 1
#elif defined CONFIG_LV_LINEMETER_PRECISE_BEST_PRECISION
#define CONFIG_LV_LINEMETER_PRECISE 2
#endif
#endif
/*------------------
* SPINNER DEF ANIM
*-----------------*/
#ifndef LV_SPINNER_DEF_ANIM
#ifdef CONFIG_LV_SPINNER_TYPE_SPINNING_ARC
#define CONFIG_LV_SPINNER_DEF_ANIM LV_SPINNER_TYPE_SPINNING_ARC
#elif defined CONFIG_LV_SPINNER_TYPE_FILLSPIN_ARC
#define CONFIG_LV_SPINNER_DEF_ANIM LV_SPINNER_TYPE_FILLSPIN_ARC
#elif defined CONFIG_LV_SPINNER_TYPE_CONSTANT_ARC
#define CONFIG_LV_SPINNER_DEF_ANIM LV_SPINNER_TYPE_CONSTANT_ARC
#endif
#endif
/*------------------
* SPRINTF DISABLE FLOAT
*-----------------*/
#if defined(CONFIG_LV_CONF_SKIP) || defined(LV_CONF_SKIP)
# ifndef LV_SPRINTF_DISABLE_FLOAT
# ifndef CONFIG_LV_SPRINTF_DISABLE_FLOAT
# define LV_SPRINTF_DISABLE_FLOAT 0
# else
# define LV_SPRINTF_DISABLE_FLOAT 1
# endif
# endif
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_CONF_KCONFIG_H*/

View File

@@ -8,6 +8,7 @@
*********************/
#include "lv_disp.h"
#include "../lv_misc/lv_math.h"
#include "../lv_core/lv_refr.h"
/*********************
* DEFINES
@@ -21,6 +22,12 @@
* STATIC PROTOTYPES
**********************/
#if LV_USE_ANIMATION
static void scr_load_anim_start(lv_anim_t * a);
static void opa_scale_anim(lv_obj_t * obj, lv_anim_value_t v);
static void scr_anim_ready(lv_anim_t * a);
#endif
/**********************
* STATIC VARIABLES
**********************/
@@ -43,13 +50,30 @@ lv_obj_t * lv_disp_get_scr_act(lv_disp_t * disp)
{
if(!disp) disp = lv_disp_get_default();
if(!disp) {
LV_LOG_WARN("lv_scr_act: no display registered to get its act. screen");
LV_LOG_WARN("no display registered to get its active screen");
return NULL;
}
return disp->act_scr;
}
/**
* Return with a pointer to the previous screen. Only used during screen transitions.
* @param disp pointer to display which previous screen should be get. (NULL to use the default
* screen)
* @return pointer to the previous screen object or NULL if not used now
*/
lv_obj_t * lv_disp_get_scr_prev(lv_disp_t * disp)
{
if(!disp) disp = lv_disp_get_default();
if(!disp) {
LV_LOG_WARN("no display registered to get its previous screen");
return NULL;
}
return disp->prev_scr;
}
/**
* Make a screen active
* @param scr pointer to a screen
@@ -82,7 +106,7 @@ lv_obj_t * lv_disp_get_layer_top(lv_disp_t * disp)
/**
* Return with the sys. layer. (Same on every screen and it is above the normal screen and the top
* layer)
* @param disp pointer to display which sys. layer should be get. (NULL to use the default screen)
* @param disp pointer to display which sys. layer should be get. (NULL to use the default screen)
* @return pointer to the sys layer object (transparent screen sized lv_obj)
*/
lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp)
@@ -115,6 +139,188 @@ void lv_disp_assign_screen(lv_disp_t * disp, lv_obj_t * scr)
_lv_ll_chg_list(&old_disp->scr_ll, &disp->scr_ll, scr, true);
}
/**
* Set the background color of a display
* @param disp pointer to a display
* @param color color of the background
*/
void lv_disp_set_bg_color(lv_disp_t * disp, lv_color_t color)
{
if(!disp) disp = lv_disp_get_default();
if(!disp) {
LV_LOG_WARN("no display registered");
return;
}
disp->bg_color = color;
lv_area_t a;
lv_area_set(&a, 0, 0, lv_disp_get_hor_res(disp) - 1, lv_disp_get_ver_res(disp) - 1);
_lv_inv_area(disp, &a);
}
/**
* Set the background image of a display
* @param disp pointer to a display
* @param img_src path to file or pointer to an `lv_img_dsc_t` variable
*/
void lv_disp_set_bg_image(lv_disp_t * disp, const void * img_src)
{
if(!disp) disp = lv_disp_get_default();
if(!disp) {
LV_LOG_WARN("no display registered");
return;
}
disp->bg_img = img_src;
lv_area_t a;
lv_area_set(&a, 0, 0, lv_disp_get_hor_res(disp) - 1, lv_disp_get_ver_res(disp) - 1);
_lv_inv_area(disp, &a);
}
/**
* Opacity of the background
* @param disp pointer to a display
* @param opa opacity (0..255)
*/
void lv_disp_set_bg_opa(lv_disp_t * disp, lv_opa_t opa)
{
if(!disp) disp = lv_disp_get_default();
if(!disp) {
LV_LOG_WARN("no display registered");
return;
}
disp->bg_opa = opa;
lv_area_t a;
lv_area_set(&a, 0, 0, lv_disp_get_hor_res(disp) - 1, lv_disp_get_ver_res(disp) - 1);
_lv_inv_area(disp, &a);
}
#if LV_USE_ANIMATION
/**
* Switch screen with animation
* @param scr pointer to the new screen to load
* @param anim_type type of the animation from `lv_scr_load_anim_t`. E.g. `LV_SCR_LOAD_ANIM_MOVE_LEFT`
* @param time time of the animation
* @param delay delay before the transition
* @param auto_del true: automatically delete the old screen
*/
void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t time, uint32_t delay, bool auto_del)
{
lv_disp_t * d = lv_obj_get_disp(new_scr);
lv_obj_t * act_scr = lv_scr_act();
if(d->del_prev && act_scr != d->scr_to_load && d->scr_to_load) {
lv_obj_del(act_scr);
lv_disp_load_scr(d->scr_to_load);
lv_anim_del(d->scr_to_load, NULL);
lv_obj_set_pos(d->scr_to_load, 0, 0);
lv_style_remove_prop(lv_obj_get_local_style(d->scr_to_load, LV_OBJ_PART_MAIN), LV_STYLE_OPA_SCALE);
act_scr = d->scr_to_load;
}
d->scr_to_load = new_scr;
if(d->prev_scr && d->del_prev) {
lv_obj_del(d->prev_scr);
d->prev_scr = NULL;
}
d->del_prev = auto_del;
/*Be sure there is no other animation on the screens*/
lv_anim_del(new_scr, NULL);
lv_anim_del(lv_scr_act(), NULL);
/*Be sure both screens are in a normal position*/
lv_obj_set_pos(new_scr, 0, 0);
lv_obj_set_pos(lv_scr_act(), 0, 0);
lv_style_remove_prop(lv_obj_get_local_style(new_scr, LV_OBJ_PART_MAIN), LV_STYLE_OPA_SCALE);
lv_style_remove_prop(lv_obj_get_local_style(lv_scr_act(), LV_OBJ_PART_MAIN), LV_STYLE_OPA_SCALE);
lv_anim_t a_new;
lv_anim_init(&a_new);
lv_anim_set_var(&a_new, new_scr);
lv_anim_set_start_cb(&a_new, scr_load_anim_start);
lv_anim_set_ready_cb(&a_new, scr_anim_ready);
lv_anim_set_time(&a_new, time);
lv_anim_set_delay(&a_new, delay);
lv_anim_t a_old;
lv_anim_init(&a_old);
lv_anim_set_var(&a_old, d->act_scr);
lv_anim_set_time(&a_old, time);
lv_anim_set_delay(&a_old, delay);
switch(anim_type) {
case LV_SCR_LOAD_ANIM_NONE:
/* Create a dummy animation to apply the delay*/
lv_anim_set_exec_cb(&a_new, (lv_anim_exec_xcb_t) lv_obj_set_x);
lv_anim_set_values(&a_new, 0, 0);
break;
case LV_SCR_LOAD_ANIM_OVER_LEFT:
lv_anim_set_exec_cb(&a_new, (lv_anim_exec_xcb_t) lv_obj_set_x);
lv_anim_set_values(&a_new, lv_disp_get_hor_res(d), 0);
break;
case LV_SCR_LOAD_ANIM_OVER_RIGHT:
lv_anim_set_exec_cb(&a_new, (lv_anim_exec_xcb_t) lv_obj_set_x);
lv_anim_set_values(&a_new, -lv_disp_get_hor_res(d), 0);
break;
case LV_SCR_LOAD_ANIM_OVER_TOP:
lv_anim_set_exec_cb(&a_new, (lv_anim_exec_xcb_t) lv_obj_set_y);
lv_anim_set_values(&a_new, lv_disp_get_ver_res(d), 0);
break;
case LV_SCR_LOAD_ANIM_OVER_BOTTOM:
lv_anim_set_exec_cb(&a_new, (lv_anim_exec_xcb_t) lv_obj_set_y);
lv_anim_set_values(&a_new, -lv_disp_get_ver_res(d), 0);
break;
case LV_SCR_LOAD_ANIM_MOVE_LEFT:
lv_anim_set_exec_cb(&a_new, (lv_anim_exec_xcb_t) lv_obj_set_x);
lv_anim_set_values(&a_new, lv_disp_get_hor_res(d), 0);
lv_anim_set_exec_cb(&a_old, (lv_anim_exec_xcb_t) lv_obj_set_x);
lv_anim_set_values(&a_old, 0, -lv_disp_get_hor_res(d));
break;
case LV_SCR_LOAD_ANIM_MOVE_RIGHT:
lv_anim_set_exec_cb(&a_new, (lv_anim_exec_xcb_t) lv_obj_set_x);
lv_anim_set_values(&a_new, -lv_disp_get_hor_res(d), 0);
lv_anim_set_exec_cb(&a_old, (lv_anim_exec_xcb_t) lv_obj_set_x);
lv_anim_set_values(&a_old, 0, lv_disp_get_hor_res(d));
break;
case LV_SCR_LOAD_ANIM_MOVE_TOP:
lv_anim_set_exec_cb(&a_new, (lv_anim_exec_xcb_t) lv_obj_set_y);
lv_anim_set_values(&a_new, lv_disp_get_ver_res(d), 0);
lv_anim_set_exec_cb(&a_old, (lv_anim_exec_xcb_t) lv_obj_set_y);
lv_anim_set_values(&a_old, 0, -lv_disp_get_ver_res(d));
break;
case LV_SCR_LOAD_ANIM_MOVE_BOTTOM:
lv_anim_set_exec_cb(&a_new, (lv_anim_exec_xcb_t) lv_obj_set_y);
lv_anim_set_values(&a_new, -lv_disp_get_ver_res(d), 0);
lv_anim_set_exec_cb(&a_old, (lv_anim_exec_xcb_t) lv_obj_set_y);
lv_anim_set_values(&a_old, 0, lv_disp_get_ver_res(d));
break;
case LV_SCR_LOAD_ANIM_FADE_ON:
lv_anim_set_exec_cb(&a_new, (lv_anim_exec_xcb_t) opa_scale_anim);
lv_anim_set_values(&a_new, LV_OPA_TRANSP, LV_OPA_COVER);
break;
}
lv_anim_start(&a_new);
lv_anim_start(&a_old);
}
#endif
/**
* Get elapsed time since last user activity on a display (e.g. click)
* @param disp pointer to an display (NULL to get the overall smallest inactivity)
@@ -122,12 +328,6 @@ void lv_disp_assign_screen(lv_disp_t * disp, lv_obj_t * scr)
*/
uint32_t lv_disp_get_inactive_time(const lv_disp_t * disp)
{
if(!disp) disp = lv_disp_get_default();
if(!disp) {
LV_LOG_WARN("lv_disp_get_inactive_time: no display registered");
return 0;
}
if(disp) return lv_tick_elaps(disp->last_activity_time);
lv_disp_t * d;
@@ -157,6 +357,21 @@ void lv_disp_trig_activity(lv_disp_t * disp)
disp->last_activity_time = lv_tick_get();
}
/**
* Clean any CPU cache that is related to the display.
* @param disp pointer to an display (NULL to use the default display)
*/
void lv_disp_clean_dcache(lv_disp_t * disp)
{
if(!disp) disp = lv_disp_get_default();
if(!disp) {
LV_LOG_WARN("lv_disp_clean_dcache: no display registered");
return;
}
if(disp->driver.clean_dcache_cb)
disp->driver.clean_dcache_cb(&disp->driver);
}
/**
* Get a pointer to the screen refresher task to
@@ -178,3 +393,28 @@ lv_task_t * _lv_disp_get_refr_task(lv_disp_t * disp)
/**********************
* STATIC FUNCTIONS
**********************/
#if LV_USE_ANIMATION
static void scr_load_anim_start(lv_anim_t * a)
{
lv_disp_t * d = lv_obj_get_disp(a->var);
d->prev_scr = lv_scr_act();
lv_disp_load_scr(a->var);
}
static void opa_scale_anim(lv_obj_t * obj, lv_anim_value_t v)
{
lv_obj_set_style_local_opa_scale(obj, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, v);
}
static void scr_anim_ready(lv_anim_t * a)
{
lv_disp_t * d = lv_obj_get_disp(a->var);
if(d->prev_scr && d->del_prev) lv_obj_del(d->prev_scr);
d->prev_scr = NULL;
d->scr_to_load = NULL;
lv_style_remove_prop(lv_obj_get_local_style(a->var, LV_OBJ_PART_MAIN), LV_STYLE_OPA_SCALE);
}
#endif

View File

@@ -24,6 +24,19 @@ extern "C" {
* TYPEDEFS
**********************/
typedef enum {
LV_SCR_LOAD_ANIM_NONE,
LV_SCR_LOAD_ANIM_OVER_LEFT,
LV_SCR_LOAD_ANIM_OVER_RIGHT,
LV_SCR_LOAD_ANIM_OVER_TOP,
LV_SCR_LOAD_ANIM_OVER_BOTTOM,
LV_SCR_LOAD_ANIM_MOVE_LEFT,
LV_SCR_LOAD_ANIM_MOVE_RIGHT,
LV_SCR_LOAD_ANIM_MOVE_TOP,
LV_SCR_LOAD_ANIM_MOVE_BOTTOM,
LV_SCR_LOAD_ANIM_FADE_ON,
} lv_scr_load_anim_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
@@ -36,6 +49,14 @@ extern "C" {
*/
lv_obj_t * lv_disp_get_scr_act(lv_disp_t * disp);
/**
* Return with a pointer to the previous screen. Only used during screen transitions.
* @param disp pointer to display which previous screen should be get. (NULL to use the default
* screen)
* @return pointer to the previous screen object or NULL if not used now
*/
lv_obj_t * lv_disp_get_scr_prev(lv_disp_t * disp);
/**
* Make a screen active
* @param scr pointer to a screen
@@ -52,7 +73,7 @@ lv_obj_t * lv_disp_get_layer_top(lv_disp_t * disp);
/**
* Return with the sys. layer. (Same on every screen and it is above the normal screen and the top
* layer)
* @param disp pointer to display which sys. layer should be get. (NULL to use the default screen)
* @param disp pointer to display which sys. layer should be get. (NULL to use the default screen)
* @return pointer to the sys layer object (transparent screen sized lv_obj)
*/
lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp);
@@ -64,6 +85,40 @@ lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp);
*/
void lv_disp_assign_screen(lv_disp_t * disp, lv_obj_t * scr);
/**
* Set the background color of a display
* @param disp pointer to a display
* @param color color of the background
*/
void lv_disp_set_bg_color(lv_disp_t * disp, lv_color_t color);
/**
* Set the background image of a display
* @param disp pointer to a display
* @param img_src path to file or pointer to an `lv_img_dsc_t` variable
*/
void lv_disp_set_bg_image(lv_disp_t * disp, const void * img_src);
/**
* Opacity of the background
* @param disp pointer to a display
* @param opa opacity (0..255)
*/
void lv_disp_set_bg_opa(lv_disp_t * disp, lv_opa_t opa);
#if LV_USE_ANIMATION
/**
* Switch screen with animation
* @param scr pointer to the new screen to load
* @param anim_type type of the animation from `lv_scr_load_anim_t`. E.g. `LV_SCR_LOAD_ANIM_MOVE_LEFT`
* @param time time of the animation
* @param delay delay before the transition
* @param auto_del true: automatically delete the old screen
*/
void lv_scr_load_anim(lv_obj_t * scr, lv_scr_load_anim_t anim_type, uint32_t time, uint32_t delay, bool auto_del);
#endif
/**
* Get elapsed time since last user activity on a display (e.g. click)
* @param disp pointer to an display (NULL to get the overall smallest inactivity)
@@ -77,6 +132,12 @@ uint32_t lv_disp_get_inactive_time(const lv_disp_t * disp);
*/
void lv_disp_trig_activity(lv_disp_t * disp);
/**
* Clean any CPU cache that is related to the display.
* @param disp pointer to an display (NULL to use the default display)
*/
void lv_disp_clean_dcache(lv_disp_t * disp);
/**
* Get a pointer to the screen refresher task to
* modify its parameters with `lv_task_...` functions.
@@ -100,7 +161,7 @@ static inline lv_obj_t * lv_scr_act(void)
}
/**
* Get the top layer of the default display
* Get the top layer of the default display
* @return pointer to the top layer
*/
static inline lv_obj_t * lv_layer_top(void)
@@ -110,7 +171,7 @@ static inline lv_obj_t * lv_layer_top(void)
/**
* Get the active screen of the default display
* @return pointer to the sys layer
* @return pointer to the sys layer
*/
static inline lv_obj_t * lv_layer_sys(void)
{
@@ -145,17 +206,21 @@ static inline void lv_scr_load(lv_obj_t * scr)
#define LV_VER_RES lv_disp_get_ver_res(lv_disp_get_default())
#endif
/**
* Same as Android's DIP. (Different name is chosen to avoid mistype between LV_DPI and LV_DIP)
* 1 dip is 1 px on a 160 DPI screen
* 1 dip is 2 px on a 320 DPI screen
* https://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dip-dp-and-sp
*/
#define LV_DPX(n) LV_MATH_MAX((( lv_disp_get_dpi(NULL) * (n) + 80) / 160), 1) /*+80 for rounding*/
#define LV_DPX(n) (n == 0 ? 0 :LV_MATH_MAX((( lv_disp_get_dpi(NULL) * (n) + 80) / 160), 1)) /*+80 for rounding*/
static inline lv_coord_t lv_dpx(lv_coord_t n)
{
return LV_DPX(n);
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_TEMPL_H*/
#endif /*LV_DISP_H*/

View File

@@ -13,10 +13,6 @@
#include "../lv_themes/lv_theme.h"
#include "../lv_misc/lv_gc.h"
#if defined(LV_GC_INCLUDE)
#include LV_GC_INCLUDE
#endif /* LV_ENABLE_GC */
/*********************
* DEFINES
*********************/
@@ -85,7 +81,7 @@ lv_group_t * lv_group_create(void)
*/
void lv_group_del(lv_group_t * group)
{
/*Defocus the the currently focused object*/
/*Defocus the currently focused object*/
if(group->obj_focus != NULL) {
(*group->obj_focus)->signal_cb(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
lv_obj_invalidate(*group->obj_focus);
@@ -149,7 +145,6 @@ void lv_group_remove_obj(lv_obj_t * obj)
{
lv_group_t * g = obj->group_p;
if(g == NULL) return;
if(g->obj_focus == NULL) return; /*Just to be sure (Not possible if there is at least one object in the group)*/
/*Focus on the next object*/
if(*g->obj_focus == obj) {
@@ -190,7 +185,7 @@ void lv_group_remove_obj(lv_obj_t * obj)
*/
void lv_group_remove_all_objs(lv_group_t * group)
{
/*Defocus the the currently focused object*/
/*Defocus the currently focused object*/
if(group->obj_focus != NULL) {
(*group->obj_focus)->signal_cb(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
lv_obj_invalidate(*group->obj_focus);
@@ -218,7 +213,7 @@ void lv_group_focus_obj(lv_obj_t * obj)
if(g->frozen != 0) return;
if(obj == *g->obj_focus) return;
if(g->obj_focus != NULL && obj == *g->obj_focus) return;
/*On defocus edit mode must be leaved*/
lv_group_set_editing(g, false);
@@ -332,9 +327,9 @@ void lv_group_set_editing(lv_group_t * group, bool edit)
focused->signal_cb(focused, LV_SIGNAL_FOCUS, NULL); /*Focus again to properly leave/open edit/navigate mode*/
lv_res_t res = lv_event_send(*group->obj_focus, LV_EVENT_FOCUSED, NULL);
if(res != LV_RES_OK) return;
}
lv_obj_invalidate(focused);
lv_obj_invalidate(focused);
}
}
/**
@@ -488,8 +483,9 @@ static void focus_next_core(lv_group_t * group, void * (*begin)(const lv_ll_t *)
can_move = true;
if(obj_next == NULL) continue;
if(lv_obj_get_state(*obj_next, LV_OBJ_PART_MAIN) & LV_STATE_DISABLED) continue;
/*Hidden objects don't receive focus*/
/*Hidden and disabled objects don't receive focus*/
if(!lv_obj_get_hidden(*obj_next)) break;
}

View File

@@ -213,6 +213,7 @@ void lv_indev_set_cursor(lv_indev_t * indev, lv_obj_t * cur_obj)
indev->cursor = cur_obj;
lv_obj_set_parent(indev->cursor, lv_disp_get_layer_sys(indev->driver.disp));
lv_obj_set_pos(indev->cursor, indev->proc.types.pointer.act_point.x, indev->proc.types.pointer.act_point.y);
lv_obj_set_click(indev->cursor, false);
}
#if LV_USE_GROUP
@@ -540,7 +541,7 @@ static void indev_keypad_proc(lv_indev_t * i, lv_indev_data_t * data)
lv_group_focus_prev(g);
if(indev_reset_check(&i->proc)) return;
}
/*Just send other keys again to the object (e.g. 'A' or `LV_GORUP_KEY_RIGHT)*/
/*Just send other keys again to the object (e.g. 'A' or `LV_GROUP_KEY_RIGHT)*/
else {
lv_group_send_data(g, data->key);
if(indev_reset_check(&i->proc)) return;
@@ -596,7 +597,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data)
}
/* Save the last keys before anything else.
* They need to be already saved if the the function returns for any reason*/
* They need to be already saved if the function returns for any reason*/
lv_indev_state_t last_state = i->proc.types.keypad.last_state;
i->proc.types.keypad.last_state = data->state;
i->proc.types.keypad.last_key = data->key;
@@ -668,7 +669,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data)
/*On enter long press toggle edit mode.*/
if(editable) {
/*Don't leave edit mode if there is only one object (nowhere to navigate)*/
if(_lv_ll_is_empty(&g->obj_ll) == false) {
if(_lv_ll_get_len(&g->obj_ll) > 1) {
lv_group_set_editing(g, lv_group_get_editing(g) ? false : true); /*Toggle edit mode on long press*/
}
}
@@ -734,7 +735,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data)
/*An object is being edited and the button is released. */
else if(g->editing) {
/*Ignore long pressed enter release because it comes from mode switch*/
if(!i->proc.long_pr_sent || _lv_ll_is_empty(&g->obj_ll)) {
if(!i->proc.long_pr_sent || _lv_ll_get_len(&g->obj_ll) <= 1) {
indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_RELEASED, NULL);
if(indev_reset_check(&i->proc)) return;
@@ -802,29 +803,38 @@ static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data)
{
/* Die gracefully if i->btn_points is NULL */
if(i->btn_points == NULL) {
LV_LOG_WARN("indev_button_proc: btn_points was NULL");
LV_LOG_WARN("indev_button_proc: btn_points was NULL");
return;
}
i->proc.types.pointer.act_point.x = i->btn_points[data->btn_id].x;
i->proc.types.pointer.act_point.y = i->btn_points[data->btn_id].y;
lv_coord_t x = i->btn_points[data->btn_id].x;
lv_coord_t y = i->btn_points[data->btn_id].y;
/*Still the same point is pressed*/
if(i->proc.types.pointer.last_point.x == i->proc.types.pointer.act_point.x &&
i->proc.types.pointer.last_point.y == i->proc.types.pointer.act_point.y && data->state == LV_INDEV_STATE_PR) {
indev_proc_press(&i->proc);
}
else {
/*If a new point comes always make a release*/
indev_proc_release(&i->proc);
/*If a new point comes always make a release*/
if(data->state == LV_INDEV_STATE_PR) {
if(i->proc.types.pointer.last_point.x != x ||
i->proc.types.pointer.last_point.y != y) {
indev_proc_release(&i->proc);
}
}
if(indev_reset_check(&i->proc)) return;
/*Save the new points*/
i->proc.types.pointer.act_point.x = x;
i->proc.types.pointer.act_point.y = y;
if(data->state == LV_INDEV_STATE_PR) indev_proc_press(&i->proc);
else indev_proc_release(&i->proc);
if(indev_reset_check(&i->proc)) return;
i->proc.types.pointer.last_point.x = i->proc.types.pointer.act_point.x;
i->proc.types.pointer.last_point.y = i->proc.types.pointer.act_point.y;
}
/**
* Process the pressed state of LV_INDEV_TYPE_POINER input devices
* Process the pressed state of LV_INDEV_TYPE_POINTER input devices
* @param indev pointer to an input device 'proc'
* @return LV_RES_OK: no indev reset required; LV_RES_INV: indev reset is required
*/
@@ -867,11 +877,6 @@ static void indev_proc_press(lv_indev_proc_t * proc)
indev_drag_throw(proc);
}
/*Do not use disabled objects*/
if(indev_obj_act && (lv_obj_get_state(indev_obj_act, LV_OBJ_PART_MAIN) & LV_STATE_DISABLED)) {
indev_obj_act = proc->types.pointer.act_obj;
}
/*If a new object was found reset some variables and send a pressed signal*/
if(indev_obj_act != proc->types.pointer.act_obj) {
proc->types.pointer.last_point.x = proc->types.pointer.act_point.x;
@@ -999,7 +1004,7 @@ static void indev_proc_press(lv_indev_proc_t * proc)
}
/**
* Process the released state of LV_INDEV_TYPE_POINER input devices
* Process the released state of LV_INDEV_TYPE_POINTER input devices
* @param proc pointer to an input device 'proc'
*/
static void indev_proc_release(lv_indev_proc_t * proc)
@@ -1143,7 +1148,7 @@ lv_obj_t * lv_indev_search_obj(lv_obj_t * obj, lv_point_t * point)
hidden_i = lv_obj_get_parent(hidden_i);
}
/*No parent found with hidden == true*/
if(hidden_i == NULL) found_p = obj;
if(hidden_i == NULL && (lv_obj_get_state(obj, LV_OBJ_PART_MAIN) & LV_STATE_DISABLED) == false) found_p = obj;
}
}
@@ -1161,14 +1166,14 @@ static void indev_click_focus(lv_indev_proc_t * proc)
if(lv_obj_is_protected(indev_obj_act, LV_PROTECT_CLICK_FOCUS) == false &&
proc->types.pointer.last_pressed != obj_to_focus) {
#if LV_USE_GROUP
lv_group_t * g_act = lv_obj_get_group(indev_obj_act);
lv_group_t * g_act = lv_obj_get_group(obj_to_focus);
lv_group_t * g_prev = proc->types.pointer.last_pressed ? lv_obj_get_group(proc->types.pointer.last_pressed) : NULL;
/*If both the last and act. obj. are in the same group (or no group but it's also the same) */
if(g_act == g_prev) {
/*The objects are in a group*/
if(g_act) {
lv_group_focus_obj(indev_obj_act);
lv_group_focus_obj(obj_to_focus);
if(indev_reset_check(proc)) return;
}
/*The object are not in group*/
@@ -1180,9 +1185,9 @@ static void indev_click_focus(lv_indev_proc_t * proc)
if(indev_reset_check(proc)) return;
}
lv_signal_send(indev_obj_act, LV_SIGNAL_FOCUS, NULL);
lv_signal_send(obj_to_focus, LV_SIGNAL_FOCUS, NULL);
if(indev_reset_check(proc)) return;
lv_event_send(indev_obj_act, LV_EVENT_FOCUSED, NULL);
lv_event_send(obj_to_focus, LV_EVENT_FOCUSED, NULL);
if(indev_reset_check(proc)) return;
}
}
@@ -1217,13 +1222,13 @@ static void indev_click_focus(lv_indev_proc_t * proc)
/*Focus to the act. in its group*/
if(g_act) {
lv_group_focus_obj(indev_obj_act);
lv_group_focus_obj(obj_to_focus);
if(indev_reset_check(proc)) return;
}
else {
lv_signal_send(indev_obj_act, LV_SIGNAL_FOCUS, NULL);
lv_signal_send(obj_to_focus, LV_SIGNAL_FOCUS, NULL);
if(indev_reset_check(proc)) return;
lv_event_send(indev_obj_act, LV_EVENT_FOCUSED, NULL);
lv_event_send(obj_to_focus, LV_EVENT_FOCUSED, NULL);
if(indev_reset_check(proc)) return;
}
}
@@ -1235,9 +1240,9 @@ static void indev_click_focus(lv_indev_proc_t * proc)
if(indev_reset_check(proc)) return;
}
lv_signal_send(indev_obj_act, LV_SIGNAL_FOCUS, NULL);
lv_signal_send(obj_to_focus, LV_SIGNAL_FOCUS, NULL);
if(indev_reset_check(proc)) return;
lv_event_send(indev_obj_act, LV_EVENT_FOCUSED, NULL);
lv_event_send(obj_to_focus, LV_EVENT_FOCUSED, NULL);
if(indev_reset_check(proc)) return;
#endif
proc->types.pointer.last_pressed = obj_to_focus;
@@ -1258,7 +1263,6 @@ static void indev_drag(lv_indev_proc_t * proc)
if(lv_obj_get_drag(drag_obj) == false) return;
lv_drag_dir_t allowed_dirs = lv_obj_get_drag_dir(drag_obj);
/*Count the movement by drag*/
@@ -1464,7 +1468,6 @@ static void indev_drag_throw(lv_indev_proc_t * proc)
}
}
/**
* Get the really dragged object by taking `drag_parent` into account.
* @param obj the start object
@@ -1481,7 +1484,6 @@ static lv_obj_t * get_dragged_obj(lv_obj_t * obj)
return drag_obj;
}
/**
* Handle the gesture of indev_proc_p->types.pointer.act_obj
* @param indev pointer to a input device state
@@ -1489,7 +1491,6 @@ static lv_obj_t * get_dragged_obj(lv_obj_t * obj)
static void indev_gesture(lv_indev_proc_t * proc)
{
if(proc->types.pointer.drag_in_prog) return;
if(proc->types.pointer.gesture_sent) return;
lv_obj_t * gesture_obj = proc->types.pointer.act_obj;
@@ -1501,7 +1502,6 @@ static void indev_gesture(lv_indev_proc_t * proc)
if(gesture_obj == NULL) return;
if((LV_MATH_ABS(proc->types.pointer.vect.x) < indev_act->driver.gesture_min_velocity) &&
(LV_MATH_ABS(proc->types.pointer.vect.y) < indev_act->driver.gesture_min_velocity)) {
proc->types.pointer.gesture_sum.x = 0;
@@ -1537,7 +1537,6 @@ static void indev_gesture(lv_indev_proc_t * proc)
}
}
/**
* Checks if the reset_query flag has been set. If so, perform necessary global indev cleanup actions
* @param proc pointer to an input device 'proc'

View File

@@ -149,7 +149,6 @@ lv_res_t lv_indev_finish_drag(lv_indev_t * indev);
*/
void lv_indev_wait_release(lv_indev_t * indev);
/**
* Gets a pointer to the currently active object in indev proc functions.
* NULL if no object is currently being handled or if groups aren't used.

File diff suppressed because it is too large Load Diff

View File

@@ -43,9 +43,12 @@ extern "C" {
#define LV_MAX_ANCESTOR_NUM 8
#define LV_EXT_CLICK_AREA_OFF 0
#define LV_EXT_CLICK_AREA_TINY 1
#define LV_EXT_CLICK_AREA_FULL 2
#define LV_EXT_CLICK_AREA_OFF 0
#define LV_EXT_CLICK_AREA_TINY 1
#define LV_EXT_CLICK_AREA_FULL 2
#define _LV_OBJ_PART_VIRTUAL_FIRST 0x01
#define _LV_OBJ_PART_REAL_FIRST 0x40
/**********************
* TYPEDEFS
@@ -53,7 +56,6 @@ extern "C" {
struct _lv_obj_t;
/** Design modes */
enum {
LV_DESIGN_DRAW_MAIN, /**< Draw the main portion of the object */
@@ -62,7 +64,6 @@ enum {
};
typedef uint8_t lv_design_mode_t;
/** Design results */
enum {
LV_DESIGN_RES_OK, /**< Draw ready */
@@ -102,6 +103,7 @@ enum {
LV_EVENT_APPLY, /**< "Ok", "Apply" or similar specific button has clicked*/
LV_EVENT_CANCEL, /**< "Close", "Cancel" or similar specific button has clicked*/
LV_EVENT_DELETE, /**< Object is being deleted */
_LV_EVENT_LAST /** Number of events*/
};
typedef uint8_t lv_event_t; /**< Type of event being sent to the object. */
@@ -159,7 +161,7 @@ typedef struct {
lv_coord_t yofs;
lv_align_t align;
uint8_t auto_realign : 1;
uint8_t origo_align : 1; /**< 1: the origo (center of the object) was aligned with
uint8_t mid_align : 1; /**< 1: the origo (center of the object) was aligned with
`lv_obj_align_origo`*/
} lv_realign_t;
#endif
@@ -201,7 +203,7 @@ typedef struct _lv_obj_t {
lv_design_cb_t design_cb; /**< Object type specific design function*/
void * ext_attr; /**< Object type specific extended data*/
lv_style_list_t style_list;
lv_style_list_t style_list;
#if LV_USE_EXT_CLICK_AREA == LV_EXT_CLICK_AREA_TINY
uint8_t ext_click_pad_hor; /**< Extra click padding in horizontal direction */
@@ -247,8 +249,8 @@ typedef struct _lv_obj_t {
enum {
LV_OBJ_PART_MAIN,
_LV_OBJ_PART_VIRTUAL_LAST = 0x01,
_LV_OBJ_PART_REAL_LAST = 0x40,
_LV_OBJ_PART_VIRTUAL_LAST = _LV_OBJ_PART_VIRTUAL_FIRST,
_LV_OBJ_PART_REAL_LAST = _LV_OBJ_PART_REAL_FIRST,
LV_OBJ_PART_ALL = 0xFF,
};
@@ -284,7 +286,6 @@ typedef struct {
*/
void lv_init(void);
/**
* Deinit the 'lv' library
* Currently only implemented when not using custom allocators, or GC is enabled.
@@ -335,7 +336,6 @@ void lv_obj_del_async(struct _lv_obj_t * obj);
*/
void lv_obj_clean(lv_obj_t * obj);
/**
* Mark an area of an object as invalid.
* This area will be redrawn by 'lv_refr_task'
@@ -350,6 +350,21 @@ void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area);
*/
void lv_obj_invalidate(const lv_obj_t * obj);
/**
* Tell whether an area of an object is visible (even partially) now or not
* @param obj pointer to an object
* @param area the are to check. The visible part of the area will be written back here.
* @return true: visible; false: not visible (hidden, out of parent, on other screen, etc)
*/
bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area);
/**
* Tell whether an object is visible (even partially) now or not
* @param obj pointer to an object
* @return true: visible; false: not visible (hidden, out of parent, on other screen, etc)
*/
bool lv_obj_is_visible(const lv_obj_t * obj);
/*=====================
* Setter functions
*====================*/
@@ -465,6 +480,24 @@ void lv_obj_set_height_margin(lv_obj_t * obj, lv_coord_t h);
*/
void lv_obj_align(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs);
/**
* Align an object to an other object horizontally.
* @param obj pointer to an object to align
* @param base pointer to an object (if NULL the parent is used). 'obj' will be aligned to it.
* @param align type of alignment (see 'lv_align_t' enum)
* @param x_ofs x coordinate offset after alignment
*/
void lv_obj_align_x(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs);
/**
* Align an object to an other object vertically.
* @param obj pointer to an object to align
* @param base pointer to an object (if NULL the parent is used). 'obj' will be aligned to it.
* @param align type of alignment (see 'lv_align_t' enum)
* @param y_ofs y coordinate offset after alignment
*/
void lv_obj_align_y(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t y_ofs);
/**
* Align an object to an other object.
* @param obj pointer to an object to align
@@ -473,7 +506,25 @@ void lv_obj_align(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_co
* @param x_ofs x coordinate offset after alignment
* @param y_ofs y coordinate offset after alignment
*/
void lv_obj_align_origo(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs);
void lv_obj_align_mid(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs);
/**
* Align an object's middle point to an other object horizontally.
* @param obj pointer to an object to align
* @param base pointer to an object (if NULL the parent is used). 'obj' will be aligned to it.
* @param align type of alignment (see 'lv_align_t' enum)
* @param x_ofs x coordinate offset after alignment
*/
void lv_obj_align_mid_x(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs);
/**
* Align an object's middle point to an other object vertically.
* @param obj pointer to an object to align
* @param base pointer to an object (if NULL the parent is used). 'obj' will be aligned to it.
* @param align type of alignment (see 'lv_align_t' enum)
* @param y_ofs y coordinate offset after alignment
*/
void lv_obj_align_mid_y(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t y_ofs);
/**
* Realign the object based on the last `lv_obj_align` parameters.
@@ -526,7 +577,7 @@ void lv_obj_remove_style(lv_obj_t * obj, uint8_t part, lv_style_t * style);
* Release all used memories and cancel pending related transitions.
* Typically used in `LV_SIGN_CLEAN_UP.
* @param obj pointer to an object
* @param part the part of the object which style list should be reseted.
* @param part the part of the object which style list should be reset.
* E.g. `LV_OBJ_PART_MAIN`, `LV_BTN_PART_MAIN`, `LV_SLIDER_PART_KNOB`
*/
void lv_obj_clean_style_list(lv_obj_t * obj, uint8_t part);
@@ -536,7 +587,7 @@ void lv_obj_clean_style_list(lv_obj_t * obj, uint8_t part);
* Release all used memories and cancel pending related transitions.
* Also notifies the object about the style change.
* @param obj pointer to an object
* @param part the part of the object which style list should be reseted.
* @param part the part of the object which style list should be reset.
* E.g. `LV_OBJ_PART_MAIN`, `LV_BTN_PART_MAIN`, `LV_SLIDER_PART_KNOB`
*/
void lv_obj_reset_style_list(lv_obj_t * obj, uint8_t part);
@@ -546,7 +597,7 @@ void lv_obj_reset_style_list(lv_obj_t * obj, uint8_t part);
* @param obj pointer to an object
* @param prop `LV_STYLE_PROP_ALL` or an `LV_STYLE_...` property. It is used to optimize what needs to be refreshed.
*/
void lv_obj_refresh_style(lv_obj_t * obj, lv_style_property_t prop);
void lv_obj_refresh_style(lv_obj_t * obj, uint8_t part, lv_style_property_t prop);
/**
* Notify all object if a style is modified
@@ -624,6 +675,13 @@ void _lv_obj_set_style_local_ptr(lv_obj_t * obj, uint8_t type, lv_style_property
*/
bool lv_obj_remove_style_local_prop(lv_obj_t * obj, uint8_t part, lv_style_property_t prop);
/**
* Enable/disable the use of style cache for an object
* @param obj pointer to an object
* @param dis true: disable; false: enable (re-enable)
*/
void _lv_obj_disable_style_caching(lv_obj_t * obj, bool dis);
/*-----------------
* Attribute set
*----------------*/
@@ -711,6 +769,7 @@ void lv_obj_set_parent_event(lv_obj_t * obj, bool en);
/**
* Set the base direction of the object
* @note This only works if LV_USE_BIDI is enabled.
* @param obj pointer to an object
* @param dir the new base direction. `LV_BIDI_DIR_LTR/RTL/AUTO/INHERIT`
*/
@@ -783,6 +842,19 @@ void lv_obj_set_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb);
*/
lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, const void * data);
/**
* Send LV_EVENT_REFRESH event to an object
* @param obj point to an object. (Can NOT be NULL)
* @return LV_RES_OK: success, LV_RES_INV: to object become invalid (e.g. deleted) due to this event.
*/
lv_res_t lv_event_send_refresh(lv_obj_t * obj);
/**
* Send LV_EVENT_REFRESH event to an object and all of its children
* @param obj pointer to an object or NULL to refresh all objects of all displays
*/
void lv_event_send_refresh_recursive(lv_obj_t * obj);
/**
* Call an event function with an object, event, and data.
* @param event_xcb an event callback function. If `NULL` `LV_RES_OK` will return without any actions.
@@ -809,7 +881,6 @@ const void * lv_event_get_data(void);
*/
void lv_obj_set_signal_cb(lv_obj_t * obj, lv_signal_cb_t signal_cb);
/**
* Send an event to the object
* @param obj pointer to an object
@@ -984,7 +1055,7 @@ lv_coord_t lv_obj_get_width_margin(lv_obj_t * obj);
* Take paddings into account.
* @param obj pointer to an object
* @param div indicates how many columns are assumed.
* If 1 the width will be set the the parent's width
* If 1 the width will be set the parent's width
* If 2 only half parent width - inner padding of the parent
* If 3 only third parent width - 2 * inner padding of the parent
* @param span how many columns are combined
@@ -997,7 +1068,7 @@ lv_coord_t lv_obj_get_width_grid(lv_obj_t * obj, uint8_t div, uint8_t span);
* Take paddings into account.
* @param obj pointer to an object
* @param div indicates how many rows are assumed.
* If 1 the height will be set the the parent's height
* If 1 the height will be set the parent's height
* If 2 only half parent height - inner padding of the parent
* If 3 only third parent height - 2 * inner padding of the parent
* @param span how many rows are combined
@@ -1008,7 +1079,7 @@ lv_coord_t lv_obj_get_height_grid(lv_obj_t * obj, uint8_t div, uint8_t span);
/**
* Get the automatic realign property of the object.
* @param obj pointer to an object
* @return true: auto realign is enabled; false: auto realign is disabled
* @return true: auto realign is enabled; false: auto realign is disabled
*/
bool lv_obj_get_auto_realign(const lv_obj_t * obj);
@@ -1133,7 +1204,6 @@ const void * _lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, lv_style_
*/
lv_style_t * lv_obj_get_local_style(lv_obj_t * obj, uint8_t part);
#include "lv_obj_style_dec.h"
/*-----------------
@@ -1196,7 +1266,6 @@ bool lv_obj_get_drag_throw(const lv_obj_t * obj);
*/
bool lv_obj_get_drag_parent(const lv_obj_t * obj);
/**
* Get the focus parent attribute of an object
* @param obj pointer to an object
@@ -1204,7 +1273,6 @@ bool lv_obj_get_drag_parent(const lv_obj_t * obj);
*/
bool lv_obj_get_focus_parent(const lv_obj_t * obj);
/**
* Get the drag parent attribute of an object
* @param obj pointer to an object
@@ -1236,7 +1304,6 @@ uint8_t lv_obj_get_protect(const lv_obj_t * obj);
*/
bool lv_obj_is_protected(const lv_obj_t * obj, uint8_t prot);
lv_state_t lv_obj_get_state(const lv_obj_t * obj, uint8_t part);
/**
@@ -1410,7 +1477,6 @@ bool lv_debug_check_obj_type(const lv_obj_t * obj, const char * obj_type);
*/
bool lv_debug_check_obj_valid(const lv_obj_t * obj);
/**********************
* MACROS
**********************/
@@ -1431,7 +1497,6 @@ bool lv_debug_check_obj_valid(const lv_obj_t * obj);
*/
#define LV_EVENT_CB_DECLARE(name) static void name(lv_obj_t * obj, lv_event_t e)
#if LV_USE_DEBUG
# ifndef LV_DEBUG_IS_OBJ
@@ -1440,7 +1505,6 @@ bool lv_debug_check_obj_valid(const lv_obj_t * obj);
lv_debug_check_obj_type(obj_p, obj_type))
# endif
# if LV_USE_ASSERT_OBJ
# ifndef LV_ASSERT_OBJ
# define LV_ASSERT_OBJ(obj_p, obj_type) LV_DEBUG_ASSERT(LV_DEBUG_IS_OBJ(obj_p, obj_type), "Invalid object", obj_p);
@@ -1449,14 +1513,13 @@ bool lv_debug_check_obj_valid(const lv_obj_t * obj);
# if LV_USE_ASSERT_NULL /*Use at least LV_ASSERT_NULL if enabled*/
# define LV_ASSERT_OBJ(obj_p, obj_type) LV_ASSERT_NULL(obj_p)
# else
# define LV_ASSERT_OBJ(obj_p, obj_type) true
# define LV_ASSERT_OBJ(obj_p, obj_type)
# endif
# endif
#else
# define LV_ASSERT_OBJ(obj, obj_type) true
# define LV_ASSERT_OBJ(obj, obj_type)
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif

View File

@@ -163,6 +163,7 @@ _LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_DECOR, text_decor, lv_text_decor_t, _int, sca
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_BLEND_MODE, text_blend_mode, lv_blend_mode_t, _int, scalar)
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_COLOR, text_color, lv_color_t, _color, nonscalar)
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_SEL_COLOR, text_sel_color, lv_color_t, _color, nonscalar)
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_SEL_BG_COLOR, text_sel_bg_color, lv_color_t, _color, nonscalar)
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_OPA, text_opa, lv_opa_t, _opa, scalar)
_LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_FONT, text_font, const lv_font_t *, _ptr, scalar)
_LV_OBJ_STYLE_SET_GET_DECLARE(LINE_WIDTH, line_width, lv_style_int_t, _int, scalar)
@@ -199,7 +200,6 @@ _LV_OBJ_STYLE_SET_GET_DECLARE(SCALE_END_COLOR, scale_end_color, lv_color_t, _col
#undef _LV_OBJ_STYLE_SET_GET_DECLARE
static inline void lv_obj_set_style_local_pad_all(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value)
{
lv_obj_set_style_local_pad_top(obj, part, state, value);
@@ -208,7 +208,6 @@ static inline void lv_obj_set_style_local_pad_all(lv_obj_t * obj, uint8_t part,
lv_obj_set_style_local_pad_right(obj, part, state, value);
}
static inline void lv_style_set_pad_all(lv_style_t * style, lv_state_t state, lv_style_int_t value)
{
lv_style_set_pad_top(style, state, value);
@@ -217,35 +216,30 @@ static inline void lv_style_set_pad_all(lv_style_t * style, lv_state_t state, lv
lv_style_set_pad_right(style, state, value);
}
static inline void lv_obj_set_style_local_pad_hor(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value)
{
lv_obj_set_style_local_pad_left(obj, part, state, value);
lv_obj_set_style_local_pad_right(obj, part, state, value);
}
static inline void lv_style_set_pad_hor(lv_style_t * style, lv_state_t state, lv_style_int_t value)
{
lv_style_set_pad_left(style, state, value);
lv_style_set_pad_right(style, state, value);
}
static inline void lv_obj_set_style_local_pad_ver(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value)
{
lv_obj_set_style_local_pad_top(obj, part, state, value);
lv_obj_set_style_local_pad_bottom(obj, part, state, value);
}
static inline void lv_style_set_pad_ver(lv_style_t * style, lv_state_t state, lv_style_int_t value)
{
lv_style_set_pad_top(style, state, value);
lv_style_set_pad_bottom(style, state, value);
}
static inline void lv_obj_set_style_local_margin_all(lv_obj_t * obj, uint8_t part, lv_state_t state,
lv_style_int_t value)
{
@@ -255,7 +249,6 @@ static inline void lv_obj_set_style_local_margin_all(lv_obj_t * obj, uint8_t par
lv_obj_set_style_local_margin_right(obj, part, state, value);
}
static inline void lv_style_set_margin_all(lv_style_t * style, lv_state_t state, lv_style_int_t value)
{
lv_style_set_margin_top(style, state, value);
@@ -264,7 +257,6 @@ static inline void lv_style_set_margin_all(lv_style_t * style, lv_state_t state,
lv_style_set_margin_right(style, state, value);
}
static inline void lv_obj_set_style_local_margin_hor(lv_obj_t * obj, uint8_t part, lv_state_t state,
lv_style_int_t value)
{
@@ -272,14 +264,12 @@ static inline void lv_obj_set_style_local_margin_hor(lv_obj_t * obj, uint8_t par
lv_obj_set_style_local_margin_right(obj, part, state, value);
}
static inline void lv_style_set_margin_hor(lv_style_t * style, lv_state_t state, lv_style_int_t value)
{
lv_style_set_margin_left(style, state, value);
lv_style_set_margin_right(style, state, value);
}
static inline void lv_obj_set_style_local_margin_ver(lv_obj_t * obj, uint8_t part, lv_state_t state,
lv_style_int_t value)
{
@@ -287,14 +277,12 @@ static inline void lv_obj_set_style_local_margin_ver(lv_obj_t * obj, uint8_t par
lv_obj_set_style_local_margin_bottom(obj, part, state, value);
}
static inline void lv_style_set_margin_ver(lv_style_t * style, lv_state_t state, lv_style_int_t value)
{
lv_style_set_margin_top(style, state, value);
lv_style_set_margin_bottom(style, state, value);
}
#ifdef __cplusplus
} /* extern "C" */
#endif

View File

@@ -23,10 +23,6 @@
#include "../lv_widgets/lv_label.h"
#endif
#if defined(LV_GC_INCLUDE)
#include LV_GC_INCLUDE
#endif /* LV_ENABLE_GC */
/*********************
* DEFINES
*********************/
@@ -54,6 +50,10 @@ static void lv_refr_vdb_flush(void);
**********************/
static uint32_t px_num;
static lv_disp_t * disp_refr; /*Display being refreshed*/
#if LV_USE_PERF_MONITOR
static uint32_t fps_sum_cnt;
static uint32_t fps_sum_all;
#endif
/**********************
* MACROS
@@ -74,7 +74,7 @@ void _lv_refr_init(void)
/**
* Redraw the invalidated areas now.
* Normally the redrawing is periodically executed in `lv_task_handler` but a long blocking process
* can prevent the call of `lv_task_handler`. In this case if the the GUI is updated in the process
* can prevent the call of `lv_task_handler`. In this case if the GUI is updated in the process
* (e.g. progress bar) this function can be called when the screen should be updated.
* @param disp pointer to display to refresh. NULL to refresh all displays.
*/
@@ -290,17 +290,28 @@ void _lv_disp_refr_task(lv_task_t * task)
}
static uint32_t perf_last_time = 0;
static uint32_t elaps_max = 1;
static uint32_t elaps_sum = 0;
static uint32_t frame_cnt = 0;
if(lv_tick_elaps(perf_last_time) < 300) {
elaps_max = LV_MATH_MAX(elaps, elaps_max);
if(px_num > 5000) {
elaps_sum += elaps;
frame_cnt ++;
}
}
else {
perf_last_time = lv_tick_get();
uint32_t fps = 1000 / (elaps_max == 0 ? 1 : elaps_max);
elaps_max = 1;
uint32_t fps_limit = 1000 / disp_refr->refr_task->period;
uint32_t fps;
if(elaps_sum == 0) elaps_sum = 1;
if(frame_cnt == 0) fps = fps_limit;
else fps = (1000 * frame_cnt) / elaps_sum;
elaps_sum = 0;
frame_cnt = 0;
if(fps > fps_limit) fps = fps_limit;
fps_sum_all += fps;
fps_sum_cnt ++;
uint32_t cpu = 100 - lv_task_get_idle();
lv_label_set_text_fmt(perf_label, "%d FPS\n%d%% CPU", fps, cpu);
lv_obj_align(perf_label, NULL, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
@@ -310,6 +321,13 @@ void _lv_disp_refr_task(lv_task_t * task)
LV_LOG_TRACE("lv_refr_task: ready");
}
#if LV_USE_PERF_MONITOR
uint32_t lv_refr_get_fps_avg(void)
{
return fps_sum_all / fps_sum_cnt;
}
#endif
/**********************
* STATIC FUNCTIONS
**********************/
@@ -381,14 +399,14 @@ static void lv_refr_areas(void)
disp_refr->driver.buffer->last_part = 0;
lv_refr_area(&disp_refr->inv_areas[i]);
if(disp_refr->driver.monitor_cb) px_num += lv_area_get_size(&disp_refr->inv_areas[i]);
px_num += lv_area_get_size(&disp_refr->inv_areas[i]);
}
}
}
/**
* Refresh an area if there is Virtual Display Buffer
* @param area_p pointer to an area to refresh
* @param area_p pointer to an area to refresh
*/
static void lv_refr_area(const lv_area_t * area_p)
{
@@ -490,7 +508,8 @@ static void lv_refr_area_part(const lv_area_t * area_p)
}
}
lv_obj_t * top_p;
lv_obj_t * top_act_scr = NULL;
lv_obj_t * top_prev_scr = NULL;
/*Get the new mask from the original area and the act. VDB
It will be a part of 'area_p'*/
@@ -498,10 +517,54 @@ static void lv_refr_area_part(const lv_area_t * area_p)
_lv_area_intersect(&start_mask, area_p, &vdb->area);
/*Get the most top object which is not covered by others*/
top_p = lv_refr_get_top_obj(&start_mask, lv_disp_get_scr_act(disp_refr));
top_act_scr = lv_refr_get_top_obj(&start_mask, lv_disp_get_scr_act(disp_refr));
if(disp_refr->prev_scr) {
top_prev_scr = lv_refr_get_top_obj(&start_mask, disp_refr->prev_scr);
}
/*Draw a display background if there is no top object*/
if(top_act_scr == NULL && top_prev_scr == NULL) {
if(disp_refr->bg_img) {
lv_draw_img_dsc_t dsc;
lv_draw_img_dsc_init(&dsc);
dsc.opa = disp_refr->bg_opa;
lv_img_header_t header;
lv_res_t res;
res = lv_img_decoder_get_info(disp_refr->bg_img, &header);
if(res == LV_RES_OK) {
lv_area_t a;
lv_area_set(&a, 0, 0, header.w - 1, header.h - 1);
lv_draw_img(&a, &start_mask, disp_refr->bg_img, &dsc);
}
else {
LV_LOG_WARN("Can't draw the background image")
}
}
else {
lv_draw_rect_dsc_t dsc;
lv_draw_rect_dsc_init(&dsc);
dsc.bg_color = disp_refr->bg_color;
dsc.bg_opa = disp_refr->bg_opa;
lv_draw_rect(&start_mask, &start_mask, &dsc);
}
}
/*Refresh the previous screen if any*/
if(disp_refr->prev_scr) {
/*Get the most top object which is not covered by others*/
if(top_prev_scr == NULL) {
top_prev_scr = disp_refr->prev_scr;
}
/*Do the refreshing from the top object*/
lv_refr_obj_and_children(top_prev_scr, &start_mask);
}
if(top_act_scr == NULL) {
top_act_scr = disp_refr->act_scr;
}
/*Do the refreshing from the top object*/
lv_refr_obj_and_children(top_p, &start_mask);
lv_refr_obj_and_children(top_act_scr, &start_mask);
/*Also refresh top and sys layer unconditionally*/
lv_refr_obj_and_children(lv_disp_get_layer_top(disp_refr), &start_mask);
@@ -526,10 +589,15 @@ static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj)
/*If this object is fully cover the draw area check the children too */
if(_lv_area_is_in(area_p, &obj->coords, 0) && obj->hidden == 0) {
lv_design_res_t design_res = obj->design_cb ? obj->design_cb(obj, area_p,
LV_DESIGN_COVER_CHK) : LV_DESIGN_RES_NOT_COVER;
lv_design_res_t design_res = obj->design_cb(obj, area_p, LV_DESIGN_COVER_CHK);
if(design_res == LV_DESIGN_RES_MASKED) return NULL;
#if LV_USE_OPA_SCALE
if(design_res == LV_DESIGN_RES_COVER && lv_obj_get_style_opa_scale(obj, LV_OBJ_PART_MAIN) != LV_OPA_COVER) {
design_res = LV_DESIGN_RES_NOT_COVER;
}
#endif
lv_obj_t * i;
_LV_LL_READ(obj->child_ll, i) {
found_p = lv_refr_get_top_obj(area_p, i);
@@ -695,6 +763,8 @@ static void lv_refr_vdb_flush(void)
/*Flush the rendered content to the display*/
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
if(disp->driver.gpu_wait_cb) disp->driver.gpu_wait_cb(&disp->driver);
if(disp->driver.flush_cb) disp->driver.flush_cb(&disp->driver, &vdb->area, vdb->buf_act);
if(vdb->buf1 && vdb->buf2) {

View File

@@ -50,7 +50,7 @@ void _lv_refr_init(void);
/**
* Redraw the invalidated areas now.
* Normally the redrawing is periodically executed in `lv_task_handler` but a long blocking process
* can prevent the call of `lv_task_handler`. In this case if the the GUI is updated in the process
* can prevent the call of `lv_task_handler`. In this case if the GUI is updated in the process
* (e.g. progress bar) this function can be called when the screen should be updated.
* @param disp pointer to display to refresh. NULL to refresh all displays.
*/
@@ -78,6 +78,14 @@ lv_disp_t * _lv_refr_get_disp_refreshing(void);
*/
void _lv_refr_set_disp_refreshing(lv_disp_t * disp);
#if LV_USE_PERF_MONITOR
/**
* Get the average FPS since start up
* @return the average FPS
*/
uint32_t lv_refr_get_fps_avg(void);
#endif
/**
* Called periodically to handle the refreshing
* @param task pointer to the task itself

View File

@@ -44,7 +44,7 @@ static inline size_t get_prop_size(uint8_t prop_id);
static inline size_t get_next_prop_index(uint8_t prop_id, size_t id);
/**********************
* GLOABAL VARIABLES
* GLOBAL VARIABLES
**********************/
/**********************
@@ -93,7 +93,7 @@ void lv_style_copy(lv_style_t * style_dest, const lv_style_t * style_src)
/**
* Remove a property from a style
* @param style pointer to a style
* @param prop a style property ORed with a state.
* @param prop a style property ORed with a state.
* E.g. `LV_STYLE_BORDER_WIDTH | (LV_STATE_PRESSED << LV_STYLE_STATE_POS)`
* @return true: the property was found and removed; false: the property wasn't found
*/
@@ -188,7 +188,7 @@ void lv_style_list_copy(lv_style_list_t * list_dest, const lv_style_list_t * lis
/**
* Add a style to a style list.
* Only the the style pointer will be saved so the shouldn't be a local variable.
* Only the style pointer will be saved so the shouldn't be a local variable.
* (It should be static, global or dynamically allocated)
* @param list pointer to a style list
* @param style pointer to a style to add
@@ -257,7 +257,7 @@ void _lv_style_list_remove_style(lv_style_list_t * list, lv_style_t * style)
return;
}
lv_style_t ** new_classes = lv_mem_realloc(list->style_list, sizeof(lv_style_t *) * (list->style_cnt - 1));
lv_style_t ** new_classes = lv_mem_alloc(sizeof(lv_style_t *) * (list->style_cnt - 1));
LV_ASSERT_MEM(new_classes);
if(new_classes == NULL) {
LV_LOG_WARN("lv_style_list_remove_style: couldn't reallocate class list");
@@ -271,6 +271,8 @@ void _lv_style_list_remove_style(lv_style_list_t * list, lv_style_t * style)
}
lv_mem_free(list->style_list);
list->style_cnt--;
list->style_list = new_classes;
}
@@ -338,7 +340,7 @@ uint16_t _lv_style_get_mem_size(const lv_style_t * style)
size_t i = 0;
uint8_t prop_id;
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSEING_PROP) {
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSING_PROP) {
i = get_next_prop_index(prop_id, i);
}
@@ -376,7 +378,7 @@ void _lv_style_set_int(lv_style_t * style, lv_style_property_t prop, lv_style_in
/*Add new property if not exists yet*/
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(lv_style_int_t));
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
uint8_t end_mark_size = sizeof(end_mark);
uint16_t size = _lv_style_get_mem_size(style);
@@ -422,7 +424,7 @@ void _lv_style_set_color(lv_style_t * style, lv_style_property_t prop, lv_color_
/*Add new property if not exists yet*/
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(lv_color_t));
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
uint8_t end_mark_size = sizeof(end_mark);
uint16_t size = _lv_style_get_mem_size(style);
@@ -469,7 +471,7 @@ void _lv_style_set_opa(lv_style_t * style, lv_style_property_t prop, lv_opa_t op
/*Add new property if not exists yet*/
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(lv_opa_t));
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
uint8_t end_mark_size = sizeof(end_mark);
uint16_t size = _lv_style_get_mem_size(style);
@@ -516,7 +518,7 @@ void _lv_style_set_ptr(lv_style_t * style, lv_style_property_t prop, const void
/*Add new property if not exists yet*/
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(const void *));
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
uint8_t end_mark_size = sizeof(end_mark);
uint16_t size = _lv_style_get_mem_size(style);
@@ -730,7 +732,6 @@ lv_style_t * _lv_style_list_add_trans_style(lv_style_list_t * list)
return trans_style;
}
/**
* Set a local integer typed property in a style list.
* @param list pointer to a style list where the local property should be set
@@ -795,8 +796,6 @@ void _lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t pr
_lv_style_set_ptr(local, prop, value);
}
/**
* Get an integer typed property from a style list.
* It will return the property which match best with given state.
@@ -825,8 +824,9 @@ lv_res_t _lv_style_list_get_int(lv_style_list_t * list, lv_style_property_t prop
int16_t ci;
for(ci = 0; ci < list->style_cnt; ci++) {
lv_style_t * class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_int(class, prop, &value_act);
/* changed class to _class to allow compilation as c++ */
lv_style_t * _class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_int(_class, prop, &value_act);
/*On perfect match return the value immediately*/
if(weight_act == weight_goal) {
@@ -873,12 +873,13 @@ lv_res_t _lv_style_list_get_color(lv_style_list_t * list, lv_style_property_t pr
int16_t weight = -1;
lv_color_t value_act = { 0 };
lv_color_t value_act;
value_act.full = 0;
int16_t ci;
for(ci = 0; ci < list->style_cnt; ci++) {
lv_style_t * class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_color(class, prop, &value_act);
lv_style_t * _class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_color(_class, prop, &value_act);
/*On perfect match return the value immediately*/
if(weight_act == weight_goal) {
*res = value_act;
@@ -927,8 +928,8 @@ lv_res_t _lv_style_list_get_opa(lv_style_list_t * list, lv_style_property_t prop
int16_t ci;
for(ci = 0; ci < list->style_cnt; ci++) {
lv_style_t * class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_opa(class, prop, &value_act);
lv_style_t * _class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_opa(_class, prop, &value_act);
/*On perfect match return the value immediately*/
if(weight_act == weight_goal) {
*res = value_act;
@@ -977,8 +978,8 @@ lv_res_t _lv_style_list_get_ptr(lv_style_list_t * list, lv_style_property_t prop
int16_t ci;
for(ci = 0; ci < list->style_cnt; ci++) {
lv_style_t * class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_ptr(class, prop, &value_act);
lv_style_t * _class = lv_style_list_get_style(list, ci);
int16_t weight_act = _lv_style_get_ptr(_class, prop, &value_act);
/*On perfect match return the value immediately*/
if(weight_act == weight_goal) {
*res = value_act;
@@ -1037,7 +1038,6 @@ bool lv_debug_check_style_list(const lv_style_list_t * list)
return true;
}
/**********************
* STATIC FUNCTIONS
**********************/
@@ -1066,7 +1066,7 @@ LV_ATTRIBUTE_FAST_MEM static inline int32_t get_property_index(const lv_style_t
size_t i = 0;
uint8_t prop_id;
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSEING_PROP) {
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSING_PROP) {
if(prop_id == id_to_find) {
lv_style_attr_t attr_i;
attr_i = get_style_prop_attr(style, i);
@@ -1102,7 +1102,7 @@ static lv_style_t * get_alloc_local_style(lv_style_list_t * list)
{
LV_ASSERT_STYLE_LIST(list);
if(list->has_local) return lv_style_list_get_style(list, 0);
if(list->has_local) return lv_style_list_get_style(list, list->has_trans ? 1 : 0);
lv_style_t * local_style = lv_mem_alloc(sizeof(lv_style_t));
LV_ASSERT_MEM(local_style);
@@ -1166,7 +1166,6 @@ static inline uint8_t get_style_prop_attr(const lv_style_t * style, size_t idx)
return ((get_style_prop(style, idx) >> 8) & 0xFFU);
}
/**
* Get property size.
* @param prop_id property id.

View File

@@ -29,8 +29,8 @@ extern "C" {
#define LV_RADIUS_CIRCLE (0x7FFF) /**< A very big radius to always draw as circle*/
LV_EXPORT_CONST_INT(LV_RADIUS_CIRCLE);
#define LV_DEBUG_STYLE_SENTINEL_VALUE 0x2288AAEE
#define LV_DEBUG_STYLE_LIST_SENTINEL_VALUE 0x9977CCBB
#define LV_DEBUG_STYLE_SENTINEL_VALUE 0x2288AAEE
#define LV_DEBUG_STYLE_LIST_SENTINEL_VALUE 0x9977CCBB
#define LV_STYLE_PROP_INIT(name, group, id, attr) name = (((group << 4) + id) | ((attr) << 8))
@@ -39,7 +39,7 @@ LV_EXPORT_CONST_INT(LV_RADIUS_CIRCLE);
#define LV_STYLE_ATTR_NONE 0
#define LV_STYLE_ATTR_INHERIT (1 << 7)
#define _LV_STYLE_CLOSEING_PROP 0xFF
#define _LV_STYLE_CLOSING_PROP 0xFF
#define LV_STYLE_TRANS_NUM_MAX 6
@@ -159,14 +159,15 @@ enum {
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_FONT, 0x7, LV_STYLE_ID_PTR + 0, LV_STYLE_ATTR_NONE),
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_STR, 0x7, LV_STYLE_ID_PTR + 1, LV_STYLE_ATTR_NONE),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_LETTER_SPACE, 0x8, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_LINE_SPACE, 0x8, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_DECOR, 0x8, LV_STYLE_ID_VALUE + 2, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_BLEND_MODE, 0x8, LV_STYLE_ID_VALUE + 3, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_COLOR, 0x8, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_SEL_COLOR, 0x8, LV_STYLE_ID_COLOR + 1, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_OPA, 0x8, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_FONT, 0x8, LV_STYLE_ID_PTR + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_LETTER_SPACE, 0x8, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_LINE_SPACE, 0x8, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_DECOR, 0x8, LV_STYLE_ID_VALUE + 2, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_BLEND_MODE, 0x8, LV_STYLE_ID_VALUE + 3, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_COLOR, 0x8, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_SEL_COLOR, 0x8, LV_STYLE_ID_COLOR + 1, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_SEL_BG_COLOR, 0x8, LV_STYLE_ID_COLOR + 2, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_OPA, 0x8, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_FONT, 0x8, LV_STYLE_ID_PTR + 0, LV_STYLE_ATTR_INHERIT),
LV_STYLE_PROP_INIT(LV_STYLE_LINE_WIDTH, 0x9, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_NONE),
LV_STYLE_PROP_INIT(LV_STYLE_LINE_BLEND_MODE, 0x9, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_NONE),
@@ -221,11 +222,37 @@ typedef struct {
#if LV_USE_ASSERT_STYLE
uint32_t sentinel;
#endif
uint8_t style_cnt;
uint8_t has_local : 1;
uint8_t has_trans : 1;
uint8_t skip_trans : 1; /*1: Temporally skip the transition style if any*/
uint8_t ignore_trans : 1; /*1: Mark that this style list shouldn't receive transitions at all*/
uint32_t style_cnt : 6;
uint32_t has_local : 1;
uint32_t has_trans : 1;
uint32_t skip_trans : 1; /*1: Temporally skip the transition style if any*/
uint32_t ignore_trans : 1; /*1: Mark that this style list shouldn't receive transitions at all*/
uint32_t valid_cache : 1; /*1: The cache is valid and can be used*/
uint32_t ignore_cache : 1; /*1: Ignore cache while getting value of properties*/
uint32_t radius_zero : 1;
uint32_t opa_scale_cover : 1;
uint32_t clip_corner_off : 1;
uint32_t transform_all_zero : 1;
uint32_t pad_all_zero : 1;
uint32_t margin_all_zero : 1;
uint32_t blend_mode_all_normal : 1;
uint32_t bg_opa_transp : 1;
uint32_t bg_opa_cover : 1;
uint32_t border_width_zero : 1;
uint32_t border_side_full : 1;
uint32_t border_post_off : 1;
uint32_t outline_width_zero : 1;
uint32_t pattern_img_null : 1;
uint32_t shadow_width_zero : 1;
uint32_t value_txt_str : 1;
uint32_t img_recolor_opa_transp : 1;
uint32_t text_space_zero : 1;
uint32_t text_decor_none : 1;
uint32_t text_font_normal : 1;
} lv_style_list_t;
/**********************
@@ -260,7 +287,7 @@ void lv_style_list_copy(lv_style_list_t * list_dest, const lv_style_list_t * lis
/**
* Add a style to a style list.
* Only the the style pointer will be saved so the shouldn't be a local variable.
* Only the style pointer will be saved so the shouldn't be a local variable.
* (It should be static, global or dynamically allocated)
* @param list pointer to a style list
* @param style pointer to a style to add
@@ -311,7 +338,7 @@ void lv_style_copy(lv_style_t * dest, const lv_style_t * src);
/**
* Remove a property from a style
* @param style pointer to a style
* @param prop a style property ORed with a state.
* @param prop a style property ORed with a state.
* E.g. `LV_STYLE_BORDER_WIDTH | (LV_STATE_PRESSED << LV_STYLE_STATE_POS)`
* @return true: the property was found and removed; false: the property wasn't found
*/
@@ -512,7 +539,6 @@ lv_res_t _lv_style_list_get_int(lv_style_list_t * list, lv_style_property_t prop
*/
lv_res_t _lv_style_list_get_color(lv_style_list_t * list, lv_style_property_t prop, lv_color_t * res);
/**
* Get an opacity typed property from a style list.
* It will return the property which match best with given state.
@@ -570,9 +596,7 @@ bool lv_debug_check_style_list(const lv_style_list_t * list);
* lv_style_init(&my_style);
* lv_style_copy(&my_style, &style_to_copy);
*/
#define LV_STYLE_CREATE(name, copy_p) static lv_style_t name; lv_style_init(&name); lv_style_copy(&name, copy);
#define LV_STYLE_CREATE(name, copy_p) static lv_style_t name; lv_style_init(&name); lv_style_copy(&name, copy_p);
#if LV_USE_DEBUG
@@ -592,13 +616,13 @@ bool lv_debug_check_style_list(const lv_style_list_t * list);
# define LV_ASSERT_STYLE_LIST(list_p) LV_DEBUG_ASSERT(LV_DEBUG_IS_STYLE_LIST(list_p), "Invalid style list", list_p);
# endif
# else
# define LV_ASSERT_STYLE(style_p) true
# define LV_ASSERT_STYLE_LIST(list_p) true
# define LV_ASSERT_STYLE(style_p)
# define LV_ASSERT_STYLE_LIST(list_p)
# endif
#else
# define LV_ASSERT_STYLE(p) true
# define LV_ASSERT_STYLE_LIST(p) true
# define LV_ASSERT_STYLE(p)
# define LV_ASSERT_STYLE_LIST(p)
#endif
#ifdef __cplusplus

View File

@@ -34,7 +34,6 @@ typedef struct {
const lv_area_t * clip_area;
} quarter_draw_dsc_t;
/**********************
* STATIC PROTOTYPES
**********************/
@@ -42,8 +41,7 @@ static void draw_quarter_0(quarter_draw_dsc_t * q);
static void draw_quarter_1(quarter_draw_dsc_t * q);
static void draw_quarter_2(quarter_draw_dsc_t * q);
static void draw_quarter_3(quarter_draw_dsc_t * q);
static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t tickness, lv_area_t * res_area);
static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness, lv_area_t * res_area);
/**********************
* STATIC VARIABLES
@@ -65,17 +63,18 @@ static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t tickness,
* @param mask the arc will be drawn only in this mask
* @param start_angle the start angle of the arc (0 deg on the bottom, 90 deg on the right)
* @param end_angle the end angle of the arc
* @param style style of the arc (`body.thickness`, `body.main_color`, `body.opa` is used)
* @param opa_scale scale down all opacities by the factor
* @param clip_area the arc will be drawn only in this area
* @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable
*/
void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, uint16_t start_angle, uint16_t end_angle,
const lv_area_t * clip_area, lv_draw_line_dsc_t * dsc)
const lv_area_t * clip_area, const lv_draw_line_dsc_t * dsc)
{
if(dsc->opa <= LV_OPA_MIN) return;
if(dsc->width == 0) return;
if(start_angle == end_angle) return;
if(dsc->width > radius) dsc->width = radius;
lv_style_int_t width = dsc->width;
if(width > radius) width = radius;
lv_draw_rect_dsc_t cir_dsc;
lv_draw_rect_dsc_init(&cir_dsc);
@@ -83,7 +82,7 @@ void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, uin
cir_dsc.bg_opa = LV_OPA_TRANSP;
cir_dsc.border_opa = dsc->opa;
cir_dsc.border_color = dsc->color;
cir_dsc.border_width = dsc->width;
cir_dsc.border_width = width;
cir_dsc.border_blend_mode = dsc->blend_mode;
lv_area_t area;
@@ -123,7 +122,7 @@ void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, uin
q_dsc.end_angle = end_angle;
q_dsc.start_quarter = (start_angle / 90) & 0x3;
q_dsc.end_quarter = (end_angle / 90) & 0x3;
q_dsc.width = dsc->width;
q_dsc.width = width;
q_dsc.draw_dsc = &cir_dsc;
q_dsc.draw_area = &area;
q_dsc.clip_area = clip_area;
@@ -146,7 +145,7 @@ void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, uin
lv_area_t round_area;
if(dsc->round_start) {
get_rounded_area(start_angle, radius, dsc->width, &round_area);
get_rounded_area(start_angle, radius, width, &round_area);
round_area.x1 += center_x;
round_area.x2 += center_x;
round_area.y1 += center_y;
@@ -156,7 +155,7 @@ void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, uin
}
if(dsc->round_end) {
get_rounded_area(end_angle, radius, dsc->width, &round_area);
get_rounded_area(end_angle, radius, width, &round_area);
round_area.x1 += center_x;
round_area.x2 += center_x;
round_area.y1 += center_y;
@@ -330,7 +329,6 @@ static void draw_quarter_2(quarter_draw_dsc_t * q)
}
}
static void draw_quarter_3(quarter_draw_dsc_t * q)
{
lv_area_t quarter_area;
@@ -384,29 +382,19 @@ static void draw_quarter_3(quarter_draw_dsc_t * q)
}
}
static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t tickness, lv_area_t * res_area)
static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness, lv_area_t * res_area)
{
const uint8_t ps = 8;
const uint8_t pa = 127;
int32_t thick_half = tickness / 2;
uint8_t thick_corr = (tickness & 0x01) ? 0 : 1;
int32_t rx_corr;
int32_t ry_corr;
if(angle > 90 && angle < 270) rx_corr = 0;
else rx_corr = 0;
if(angle > 0 && angle < 180) ry_corr = 0;
else ry_corr = 0;
int32_t thick_half = thickness / 2;
uint8_t thick_corr = (thickness & 0x01) ? 0 : 1;
int32_t cir_x;
int32_t cir_y;
cir_x = ((radius - rx_corr - thick_half) * _lv_trigo_sin(90 - angle)) >> (LV_TRIGO_SHIFT - ps);
cir_y = ((radius - ry_corr - thick_half) * _lv_trigo_sin(angle)) >> (LV_TRIGO_SHIFT - ps);
cir_x = ((radius - thick_half) * _lv_trigo_sin(90 - angle)) >> (LV_TRIGO_SHIFT - ps);
cir_y = ((radius - thick_half) * _lv_trigo_sin(angle)) >> (LV_TRIGO_SHIFT - ps);
/* Actually the center of the pixel need to be calculated so apply 1/2 px offset*/
if(cir_x > 0) {
@@ -431,4 +419,3 @@ static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t tickness,
res_area->y2 = cir_y + thick_half - thick_corr;
}
}

View File

@@ -35,11 +35,11 @@ extern "C" {
* @param mask the arc will be drawn only in this mask
* @param start_angle the start angle of the arc (0 deg on the bottom, 90 deg on the right)
* @param end_angle the end angle of the arc
* @param style style of the arc (`body.thickness`, `body.main_color`, `body.opa` is used)
* @param opa_scale scale down all opacities by the factor
* @param clip_area the arc will be drawn only in this area
* @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable
*/
void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, uint16_t start_angle, uint16_t end_angle,
const lv_area_t * clip_area, lv_draw_line_dsc_t * dsc);
const lv_area_t * clip_area, const lv_draw_line_dsc_t * dsc);
/**********************
* MACROS

View File

@@ -12,7 +12,13 @@
#include "../lv_hal/lv_hal_disp.h"
#include "../lv_core/lv_refr.h"
#include "../lv_gpu/lv_gpu_stm32_dma2d.h"
#if LV_USE_GPU_NXP_PXP
#include "../lv_gpu/lv_gpu_nxp_pxp.h"
#elif LV_USE_GPU_NXP_VG_LITE
#include "../lv_gpu/lv_gpu_nxp_vglite.h"
#elif LV_USE_GPU_STM32_DMA2D
#include "../lv_gpu/lv_gpu_stm32_dma2d.h"
#endif
/*********************
* DEFINES
@@ -36,9 +42,11 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
lv_color_t color, lv_opa_t opa,
const lv_opa_t * mask, lv_draw_mask_res_t mask_res);
#if LV_USE_BLEND_MODES
static void fill_blended(const lv_area_t * disp_area, lv_color_t * disp_buf, const lv_area_t * draw_area,
lv_color_t color, lv_opa_t opa,
const lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_blend_mode_t mode);
#endif
static void map_set_px(const lv_area_t * disp_area, lv_color_t * disp_buf, const lv_area_t * draw_area,
const lv_area_t * map_area, const lv_color_t * map_buf, lv_opa_t opa,
@@ -49,18 +57,20 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col
const lv_area_t * map_area, const lv_color_t * map_buf, lv_opa_t opa,
const lv_opa_t * mask, lv_draw_mask_res_t mask_res);
#if LV_USE_BLEND_MODES
static void map_blended(const lv_area_t * disp_area, lv_color_t * disp_buf, const lv_area_t * draw_area,
const lv_area_t * map_area, const lv_color_t * map_buf, lv_opa_t opa,
const lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_blend_mode_t mode);
static inline lv_color_t color_blend_true_color_additive(lv_color_t fg, lv_color_t bg, lv_opa_t opa);
static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_color_t bg, lv_opa_t opa);
#endif
/**********************
* STATIC VARIABLES
**********************/
#if LV_USE_GPU || LV_USE_GPU_STM32_DMA2D
#if (LV_USE_GPU || LV_USE_GPU_STM32_DMA2D) && (LV_USE_GPU_NXP_PXP == 0) && (LV_USE_GPU_NXP_VG_LITE == 0)
LV_ATTRIBUTE_DMA static lv_color_t blend_buf[LV_HOR_RES_MAX];
#endif
@@ -68,7 +78,6 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co
* MACROS
**********************/
#define FILL_NORMAL_MASK_PX(out_x, color) \
if(*mask_tmp_x) { \
if(*mask_tmp_x == LV_OPA_COVER) disp_buf_first[out_x] = color; \
@@ -76,7 +85,6 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co
} \
mask_tmp_x++;
#define FILL_NORMAL_MASK_PX_SCR_TRANSP(out_x, color) \
if(*mask_tmp_x) { \
if(*mask_tmp_x == LV_OPA_COVER) disp_buf_first[out_x] = color; \
@@ -86,7 +94,6 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co
} \
mask_tmp_x++;
#define MAP_NORMAL_MASK_PX(x) \
if(*mask_tmp_x) { \
if(*mask_tmp_x == LV_OPA_COVER) disp_buf_first[x] = map_buf_first[x]; \
@@ -107,7 +114,6 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co
* GLOBAL FUNCTIONS
**********************/
/**
* Fill and area in the display buffer.
* @param clip_area clip the fill to this area (absolute coordinates)
@@ -134,6 +140,7 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_
const lv_area_t * disp_area = &vdb->area;
lv_color_t * disp_buf = vdb->buf_act;
if(disp->driver.gpu_wait_cb) disp->driver.gpu_wait_cb(&disp->driver);
/* Get clipped fill area which is the real draw area.
* It is always the same or inside `fill_area` */
@@ -167,9 +174,11 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_
else if(mode == LV_BLEND_MODE_NORMAL) {
fill_normal(disp_area, disp_buf, &draw_area, color, opa, mask, mask_res);
}
#if LV_USE_BLEND_MODES
else {
fill_blended(disp_area, disp_buf, &draw_area, color, opa, mask, mask_res, mode);
}
#endif
}
/**
@@ -182,7 +191,7 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_
* @param mask_res LV_MASK_RES_COVER: the mask has only 0xff values (no mask),
* LV_MASK_RES_TRANSP: the mask has only 0x00 values (full transparent),
* LV_MASK_RES_CHANGED: the mask has mixed values
* @param opa overall opacity in 0x00..0xff range
* @param opa overall opacity in 0x00..0xff range
* @param mode blend mode from `lv_blend_mode_t`
*/
LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_area_t * map_area,
@@ -206,6 +215,8 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_a
const lv_area_t * disp_area = &vdb->area;
lv_color_t * disp_buf = vdb->buf_act;
if(disp->driver.gpu_wait_cb) disp->driver.gpu_wait_cb(&disp->driver);
/* Now `draw_area` has absolute coordinates.
* Make it relative to `disp_area` to simplify draw to `disp_buf`*/
draw_area.x1 -= disp_area->x1;
@@ -230,12 +241,13 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_a
else if(mode == LV_BLEND_MODE_NORMAL) {
map_normal(disp_area, disp_buf, &draw_area, map_area, map_buf, opa, mask, mask_res);
}
#if LV_USE_BLEND_MODES
else {
map_blended(disp_area, disp_buf, &draw_area, map_area, map_buf, opa, mask, mask_res, mode);
}
#endif
}
/**********************
* STATIC FUNCTIONS
**********************/
@@ -319,18 +331,28 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
/*Simple fill (maybe with opacity), no masking*/
if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) {
if(opa > LV_OPA_MAX) {
#if LV_USE_GPU
if(disp->driver.gpu_fill_cb && lv_area_get_size(draw_area) > GPU_SIZE_LIMIT) {
disp->driver.gpu_fill_cb(&disp->driver, disp_buf, disp_w, draw_area, color);
#if LV_USE_GPU_NXP_PXP
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_PXP_FILL_SIZE_LIMIT) {
lv_gpu_nxp_pxp_fill(disp_buf, disp_w, draw_area, color, opa);
return;
}
#endif
#if LV_USE_GPU_STM32_DMA2D
#elif LV_USE_GPU_NXP_VG_LITE
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_VG_LITE_FILL_SIZE_LIMIT) {
if(lv_gpu_nxp_vglite_fill(disp_buf, disp_w, lv_area_get_height(disp_area), draw_area, color, opa) == LV_RES_OK) {
return;
}
/* Fall down to SW render in case of error */
}
#elif LV_USE_GPU_STM32_DMA2D
if(lv_area_get_size(draw_area) >= 240) {
lv_gpu_stm32_dma2d_fill(disp_buf_first, disp_w, color, draw_area_w, draw_area_h);
return;
}
#elif LV_USE_GPU
if(disp->driver.gpu_fill_cb && lv_area_get_size(draw_area) > GPU_SIZE_LIMIT) {
disp->driver.gpu_fill_cb(&disp->driver, disp_buf, disp_w, draw_area, color);
return;
}
#endif
/*Software rendering*/
for(y = 0; y < draw_area_h; y++) {
@@ -340,7 +362,20 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
}
/*No mask with opacity*/
else {
#if LV_USE_GPU
#if LV_USE_GPU_NXP_PXP
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_PXP_FILL_OPA_SIZE_LIMIT) {
lv_gpu_nxp_pxp_fill(disp_buf, disp_w, draw_area, color, opa);
return;
}
#elif LV_USE_GPU_NXP_VG_LITE
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_VG_LITE_FILL_OPA_SIZE_LIMIT) {
if(lv_gpu_nxp_vglite_fill(disp_buf, disp_w, lv_area_get_height(disp_area), draw_area, color, opa) == LV_RES_OK) {
return;
}
/* Fall down to SW render in case of error */
}
#elif LV_USE_GPU
if(disp->driver.gpu_blend_cb && lv_area_get_size(draw_area) > GPU_SIZE_LIMIT) {
for(x = 0; x < draw_area_w ; x++) blend_buf[x].full = color.full;
@@ -352,7 +387,6 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
}
#endif
#if LV_USE_GPU_STM32_DMA2D
if(lv_area_get_size(draw_area) >= 240) {
if(blend_buf[0].full != color.full) lv_color_fill(blend_buf, color, LV_HOR_RES_MAX);
@@ -360,6 +394,7 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
lv_coord_t line_h = LV_HOR_RES_MAX / draw_area_w;
for(y = 0; y <= draw_area_h - line_h; y += line_h) {
lv_gpu_stm32_dma2d_blend(disp_buf_first, disp_w, blend_buf, opa, draw_area_w, draw_area_w, line_h);
lv_gpu_stm32_dma2d_wait_cb(NULL);
disp_buf_first += disp_w * line_h;
}
@@ -409,7 +444,6 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
}
#endif
/*Buffer the result color to avoid recalculating the same color*/
lv_color_t last_dest_color;
lv_color_t last_res_color;
@@ -515,7 +549,7 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
}
}
#if LV_USE_BLEND_MODES
/**
* Fill an area with a color but apply blending algorithms
* @param disp_area the current display area (destination area)
@@ -540,7 +574,6 @@ static void fill_blended(const lv_area_t * disp_area, lv_color_t * disp_buf, co
/*Create a temp. disp_buf which always point to current line to draw*/
lv_color_t * disp_buf_tmp = disp_buf + disp_w * draw_area->y1;
lv_color_t (*blend_fp)(lv_color_t, lv_color_t, lv_opa_t);
switch(mode) {
case LV_BLEND_MODE_ADDITIVE:
@@ -606,6 +639,7 @@ static void fill_blended(const lv_area_t * disp_area, lv_color_t * disp_buf, co
}
}
}
#endif
static void map_set_px(const lv_area_t * disp_area, lv_color_t * disp_buf, const lv_area_t * draw_area,
const lv_area_t * map_area, const lv_color_t * map_buf, lv_opa_t opa,
@@ -714,7 +748,42 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col
#endif
if(opa > LV_OPA_MAX) {
#if LV_USE_GPU_STM32_DMA2D
#if LV_USE_GPU_NXP_PXP
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_PXP_BLIT_SIZE_LIMIT) {
lv_gpu_nxp_pxp_blit(disp_buf_first, disp_w, map_buf_first, map_w, draw_area_w, draw_area_h, opa);
return;
}
#elif (LV_USE_GPU_NXP_VG_LITE)
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_VG_LITE_BLIT_SIZE_LIMIT) {
lv_gpu_nxp_vglite_blit_info_t blit;
blit.src = map_buf;
blit.src_width = draw_area_w;
blit.src_height = draw_area_h;
blit.src_stride = lv_area_get_width(map_area) * sizeof(lv_color_t);
blit.src_area.x1 = (draw_area->x1 - (map_area->x1 - disp_area->x1));
blit.src_area.y1 = (draw_area->y1 - (map_area->y1 - disp_area->y1));
blit.src_area.x2 = blit.src_area.x1 + draw_area_w;
blit.src_area.y2 = blit.src_area.y1 + draw_area_h;
blit.dst = disp_buf;
blit.dst_width = lv_area_get_width(disp_area);
blit.dst_height = lv_area_get_height(disp_area);
blit.dst_stride = lv_area_get_width(disp_area) * sizeof(lv_color_t);
blit.dst_area.x1 = draw_area->x1;
blit.dst_area.y1 = draw_area->y1;
blit.dst_area.x2 = blit.dst_area.x1 + draw_area_w;
blit.dst_area.y2 = blit.dst_area.y1 + draw_area_h;
blit.opa = opa;
if(lv_gpu_nxp_vglite_blit(&blit) == LV_RES_OK) {
return;
}
/* Fall down to SW render in case of error */
}
#elif LV_USE_GPU_STM32_DMA2D
if(lv_area_get_size(draw_area) >= 240) {
lv_gpu_stm32_dma2d_copy(disp_buf_first, disp_w, map_buf_first, map_w, draw_area_w, draw_area_h);
return;
@@ -729,7 +798,42 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col
}
}
else {
#if LV_USE_GPU_STM32_DMA2D
#if LV_USE_GPU_NXP_PXP
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_PXP_BLIT_OPA_SIZE_LIMIT) {
lv_gpu_nxp_pxp_blit(disp_buf_first, disp_w, map_buf_first, map_w, draw_area_w, draw_area_h, opa);
return;
}
#elif (LV_USE_GPU_NXP_VG_LITE)
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_VG_LITE_BLIT_OPA_SIZE_LIMIT) {
lv_gpu_nxp_vglite_blit_info_t blit;
blit.src = map_buf;
blit.src_width = lv_area_get_width(map_area);
blit.src_height = lv_area_get_height(map_area);
blit.src_stride = lv_area_get_width(map_area) * sizeof(lv_color_t);
blit.src_area.x1 = (draw_area->x1 - (map_area->x1 - disp_area->x1));
blit.src_area.y1 = (draw_area->y1 - (map_area->y1 - disp_area->y1));
blit.src_area.x2 = blit.src_area.x1 + draw_area_w;
blit.src_area.y2 = blit.src_area.y1 + draw_area_h;
blit.dst = disp_buf;
blit.dst_width = lv_area_get_width(disp_area);
blit.dst_height = lv_area_get_height(disp_area);
blit.dst_stride = lv_area_get_width(disp_area) * sizeof(lv_color_t);
blit.dst_area.x1 = draw_area->x1;
blit.dst_area.y1 = draw_area->y1;
blit.dst_area.x2 = blit.dst_area.x1 + draw_area_w;
blit.dst_area.y2 = blit.dst_area.y1 + draw_area_h;
blit.opa = opa;
if(lv_gpu_nxp_vglite_blit(&blit) == LV_RES_OK) {
return;
}
/* Fall down to SW render in case of error */
}
#elif LV_USE_GPU_STM32_DMA2D
if(lv_area_get_size(draw_area) >= 240) {
lv_gpu_stm32_dma2d_blend(disp_buf_first, disp_w, map_buf_first, opa, map_w, draw_area_w, draw_area_h);
return;
@@ -845,7 +949,7 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col
}
}
}
#if LV_USE_BLEND_MODES
static void map_blended(const lv_area_t * disp_area, lv_color_t * disp_buf, const lv_area_t * draw_area,
const lv_area_t * map_area, const lv_color_t * map_buf, lv_opa_t opa,
const lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_blend_mode_t mode)
@@ -996,3 +1100,4 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co
return lv_color_mix(fg, bg, opa);
}
#endif

View File

@@ -26,8 +26,10 @@ extern "C" {
**********************/
enum {
LV_BLEND_MODE_NORMAL,
#if LV_USE_BLEND_MODES
LV_BLEND_MODE_ADDITIVE,
LV_BLEND_MODE_SUBTRACTIVE,
#endif
};
typedef uint8_t lv_blend_mode_t;
@@ -40,7 +42,6 @@ typedef uint8_t lv_blend_mode_t;
LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_area_t * fill_area, lv_color_t color,
lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode);
LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_area_t * map_area,
const lv_color_t * map_buf,
lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode);

View File

@@ -13,8 +13,11 @@
#include "../lv_core/lv_refr.h"
#include "../lv_misc/lv_mem.h"
#include "../lv_misc/lv_math.h"
#include "../lv_gpu/lv_gpu_stm32_dma2d.h"
#if LV_USE_GPU_STM32_DMA2D
#include "../lv_gpu/lv_gpu_stm32_dma2d.h"
#elif LV_USE_GPU_NXP_PXP
#include "../lv_gpu/lv_gpu_nxp_pxp.h"
#endif
/*********************
* DEFINES
@@ -29,14 +32,15 @@
**********************/
LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords, const lv_area_t * clip_area,
const void * src,
lv_draw_img_dsc_t * draw_dsc);
const lv_draw_img_dsc_t * draw_dsc);
LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const lv_area_t * clip_area,
const uint8_t * map_p,
lv_draw_img_dsc_t * draw_dsc,
const lv_draw_img_dsc_t * draw_dsc,
bool chroma_key, bool alpha_byte);
static void show_error(const lv_area_t * coords, const lv_area_t * clip_area, const char * msg);
static void draw_cleanup(lv_img_cache_entry_t * cache);
/**********************
* STATIC VARIABLES
@@ -65,13 +69,9 @@ void lv_draw_img_dsc_init(lv_draw_img_dsc_t * dsc)
* @param coords the coordinates of the image
* @param mask the image will be drawn only in this area
* @param src pointer to a lv_color_t array which contains the pixels of the image
* @param style style of the image
* @param angle rotation angle of the image
* @param center rotation center of the image
* @param antialias anti-alias transformations (rotate, zoom) or not
* @param opa_scale scale down all opacities by the factor
* @param dsc pointer to an initialized `lv_draw_img_dsc_t` variable
*/
void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask, const void * src, lv_draw_img_dsc_t * dsc)
void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask, const void * src, const lv_draw_img_dsc_t * dsc)
{
if(src == NULL) {
LV_LOG_WARN("Image draw: src is NULL");
@@ -232,7 +232,7 @@ lv_img_src_t lv_img_src_get_type(const void * src)
LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords, const lv_area_t * clip_area,
const void * src,
lv_draw_img_dsc_t * draw_dsc)
const lv_draw_img_dsc_t * draw_dsc)
{
if(draw_dsc->opa <= LV_OPA_MIN) return LV_RES_OK;
@@ -268,9 +268,10 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords,
lv_area_t mask_com; /*Common area of mask and coords*/
bool union_ok;
union_ok = _lv_area_intersect(&mask_com, clip_area, &map_area_rot);
/*Out of mask. There is nothing to draw so the image is drawn successfully.*/
if(union_ok == false) {
return LV_RES_OK; /*Out of mask. There is nothing to draw so the image is drawn
successfully.*/
draw_cleanup(cdsc);
return LV_RES_OK;
}
lv_draw_map(coords, &mask_com, cdsc->dec_dsc.img_data, draw_dsc, chroma_keyed, alpha_byte);
@@ -280,9 +281,10 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords,
lv_area_t mask_com; /*Common area of mask and coords*/
bool union_ok;
union_ok = _lv_area_intersect(&mask_com, clip_area, coords);
/*Out of mask. There is nothing to draw so the image is drawn successfully.*/
if(union_ok == false) {
return LV_RES_OK; /*Out of mask. There is nothing to draw so the image is drawn
successfully.*/
draw_cleanup(cdsc);
return LV_RES_OK;
}
int32_t width = lv_area_get_width(&mask_com);
@@ -307,10 +309,10 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords,
lv_img_decoder_close(&cdsc->dec_dsc);
LV_LOG_WARN("Image draw can't read the line");
_lv_mem_buf_release(buf);
draw_cleanup(cdsc);
return LV_RES_INV;
}
lv_draw_map(&line, &mask_line, buf, draw_dsc, chroma_keyed, alpha_byte);
line.y1++;
line.y2++;
@@ -319,6 +321,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords,
_lv_mem_buf_release(buf);
}
draw_cleanup(cdsc);
return LV_RES_OK;
}
@@ -327,18 +330,14 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords,
* @param cords_p coordinates the color map
* @param mask_p the map will drawn only on this area (truncated to VDB area)
* @param map_p pointer to a lv_color_t array
* @param opa opacity of the map
* @param draw_dsc pointer to an initialized `lv_draw_img_dsc_t` variable
* @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 style style of the image
* @param angle angle in degree
* @param pivot center of rotation
* @param zoom zoom factor
* @param antialias anti-alias transformations (rotate, zoom) or not
*/
LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const lv_area_t * clip_area,
const uint8_t * map_p,
lv_draw_img_dsc_t * draw_dsc, bool chroma_key, bool alpha_byte)
const lv_draw_img_dsc_t * draw_dsc,
bool chroma_key, bool alpha_byte)
{
/* Use the clip area as draw area*/
lv_area_t draw_area;
@@ -363,6 +362,23 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
_lv_blend_map(clip_area, map_area, (lv_color_t *)map_p, NULL, LV_DRAW_MASK_RES_FULL_COVER, draw_dsc->opa,
draw_dsc->blend_mode);
}
#if LV_USE_GPU_NXP_PXP
/* Simple case without masking and transformations */
else if(other_mask_cnt == 0 && draw_dsc->angle == 0 && draw_dsc->zoom == LV_IMG_ZOOM_NONE && alpha_byte == false &&
chroma_key == true && draw_dsc->recolor_opa == LV_OPA_TRANSP) { /* copy with color keying (+ alpha) */
lv_gpu_nxp_pxp_enable_color_key();
_lv_blend_map(clip_area, map_area, (lv_color_t *)map_p, NULL, LV_DRAW_MASK_RES_FULL_COVER, draw_dsc->opa,
draw_dsc->blend_mode);
lv_gpu_nxp_pxp_disable_color_key();
}
else if(other_mask_cnt == 0 && draw_dsc->angle == 0 && draw_dsc->zoom == LV_IMG_ZOOM_NONE && alpha_byte == false &&
chroma_key == false && draw_dsc->recolor_opa != LV_OPA_TRANSP) { /* copy with recolor (+ alpha) */
lv_gpu_nxp_pxp_enable_recolor(draw_dsc->recolor, draw_dsc->recolor_opa);
_lv_blend_map(clip_area, map_area, (lv_color_t *)map_p, NULL, LV_DRAW_MASK_RES_FULL_COVER, draw_dsc->opa,
draw_dsc->blend_mode);
lv_gpu_nxp_pxp_disable_recolor();
}
#endif
/*In the other cases every pixel need to be checked one-by-one*/
else {
/*The pixel size in byte is different if an alpha byte is added too*/
@@ -407,8 +423,8 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
return;
}
#endif
/*Build the image and a mask line-by-line*/
uint32_t mask_buf_size = lv_area_get_size(&draw_area) > LV_HOR_RES_MAX ? LV_HOR_RES_MAX : lv_area_get_size(&draw_area);
uint32_t hor_res = (uint32_t) lv_disp_get_hor_res(disp);
uint32_t mask_buf_size = lv_area_get_size(&draw_area) > (uint32_t) hor_res ? hor_res : lv_area_get_size(&draw_area);
lv_color_t * map2 = _lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t));
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
@@ -420,7 +436,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
lv_opa_t px_opa = map_px[LV_IMG_PX_SIZE_ALPHA_BYTE - 1];
mask_buf[px_i] = px_opa;
if(px_opa) {
#if LV_COLOR_DEPTH == 8
#if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1
map2[px_i].full = map_px[0];
#elif LV_COLOR_DEPTH == 16
map2[px_i].full = map_px[0] + (map_px[1] << 8);
@@ -458,7 +474,8 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
/*Most complicated case: transform or other mask or chroma keyed*/
else {
/*Build the image and a mask line-by-line*/
uint32_t mask_buf_size = lv_area_get_size(&draw_area) > LV_HOR_RES_MAX ? LV_HOR_RES_MAX : lv_area_get_size(&draw_area);
uint32_t hor_res = (uint32_t) lv_disp_get_hor_res(disp);
uint32_t mask_buf_size = lv_area_get_size(&draw_area) > hor_res ? hor_res : lv_area_get_size(&draw_area);
lv_color_t * map2 = _lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t));
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
@@ -494,7 +511,6 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
mask_res = (alpha_byte || chroma_key || draw_dsc->angle ||
draw_dsc->zoom != LV_IMG_ZOOM_NONE) ? LV_DRAW_MASK_RES_CHANGED : LV_DRAW_MASK_RES_FULL_COVER;
/*Prepare the `mask_buf`if there are other masks*/
if(other_mask_cnt) {
_lv_memset_ff(mask_buf, mask_buf_size);
@@ -514,7 +530,6 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
#endif
for(x = 0; x < draw_area_w; x++, map_px += px_size_byte, px_i++) {
#if LV_USE_IMG_TRANSFORM
if(transform) {
@@ -538,7 +553,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
lv_opa_t px_opa = map_px[LV_IMG_PX_SIZE_ALPHA_BYTE - 1];
mask_buf[px_i] = px_opa;
if(px_opa == 0) {
#if LV_COLOR_DEPTH == 32
#if LV_COLOR_DEPTH == 32
map2[px_i].full = 0;
#endif
continue;
@@ -561,7 +576,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
if(chroma_key) {
if(c.full == chroma_keyed_color.full) {
mask_buf[px_i] = LV_OPA_TRANSP;
#if LV_COLOR_DEPTH == 32
#if LV_COLOR_DEPTH == 32
map2[px_i].full = 0;
#endif
continue;
@@ -636,3 +651,12 @@ static void show_error(const lv_area_t * coords, const lv_area_t * clip_area, co
lv_draw_label(coords, clip_area, &label_dsc, msg, NULL);
}
static void draw_cleanup(lv_img_cache_entry_t * cache)
{
/*Automatically close images with no caching*/
#if LV_IMG_CACHE_DEF_SIZE == 0
lv_img_decoder_close(&cache->dec_dsc);
#else
LV_UNUSED(cache);
#endif
}

View File

@@ -53,13 +53,9 @@ void lv_draw_img_dsc_init(lv_draw_img_dsc_t * dsc);
* @param coords the coordinates of the image
* @param mask the image will be drawn only in this area
* @param src pointer to a lv_color_t array which contains the pixels of the image
* @param style style of the image
* @param angle rotation angle of the image
* @param center rotation center of the image
* @param antialias anti-alias transformations (rotate, zoom) or not
* @param opa_scale scale down all opacities by the factor
* @param dsc pointer to an initialized `lv_draw_img_dsc_t` variable
*/
void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask, const void * src, lv_draw_img_dsc_t * dsc);
void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask, const void * src, const lv_draw_img_dsc_t * dsc);
/**
* Get the type of an image source
@@ -92,9 +88,8 @@ bool lv_img_cf_is_chroma_keyed(lv_img_cf_t cf);
*/
bool lv_img_cf_has_alpha(lv_img_cf_t cf);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_TEMPL_H*/
#endif /*LV_DRAW_IMG_H*/

View File

@@ -41,7 +41,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_
static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_dsc_t * g, const lv_area_t * clip_area,
const uint8_t * map_p, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode);
static uint8_t hex_char_to_num(char hex);
/**********************
@@ -98,7 +97,8 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc)
dsc->font = LV_THEME_DEFAULT_FONT_NORMAL;
dsc->sel_start = LV_DRAW_LABEL_NO_TXT_SEL;
dsc->sel_end = LV_DRAW_LABEL_NO_TXT_SEL;
dsc->sel_color = LV_COLOR_BLUE;
dsc->sel_color = LV_COLOR_BLACK;
dsc->sel_bg_color = LV_COLOR_BLUE;
dsc->bidi_dir = LV_BIDI_DIR_LTR;
}
@@ -111,8 +111,10 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc)
* @param hint pointer to a `lv_draw_label_hint_t` variable.
* It is managed by the drawer to speed up the drawing of very long texts (thousands of lines).
*/
LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area_t * mask, lv_draw_label_dsc_t * dsc,
const char * txt, lv_draw_label_hint_t * hint)
LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area_t * mask,
const lv_draw_label_dsc_t * dsc,
const char * txt,
lv_draw_label_hint_t * hint)
{
if(dsc->opa <= LV_OPA_MIN) return;
@@ -126,7 +128,6 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
bool clip_ok = _lv_area_intersect(&clipped_area, coords, mask);
if(!clip_ok) return;
if((dsc->flag & LV_TXT_FLAG_EXPAND) == 0) {
/*Normally use the label's width as width*/
w = lv_area_get_width(coords);
@@ -213,12 +214,12 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
sel_start = sel_end;
sel_end = tmp;
}
lv_draw_line_dsc_t line_dsc;
if((dsc->decor & LV_TEXT_DECOR_UNDERLINE) || (dsc->decor & LV_TEXT_DECOR_STRIKETHROUGH)) {
lv_draw_line_dsc_init(&line_dsc);
line_dsc.color = dsc->color;
line_dsc.width = (dsc->font->line_height + 5) / 10; /*+5 for rounding*/
line_dsc.width = font->underline_thickness ? font->underline_thickness : 1;
line_dsc.opa = dsc->opa;
line_dsc.blend_mode = dsc->blend_mode;
}
@@ -229,10 +230,9 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
lv_color_t recolor;
int32_t letter_w;
lv_draw_rect_dsc_t draw_dsc_sel;
lv_draw_rect_dsc_init(&draw_dsc_sel);
draw_dsc_sel.bg_color = dsc->sel_color;
draw_dsc_sel.bg_color = dsc->sel_bg_color;
int32_t pos_x_start = pos.x;
/*Write out all lines*/
@@ -318,6 +318,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
sel_coords.x2 = pos.x + letter_w + dsc->letter_space - 1;
sel_coords.y2 = pos.y + line_height - 1;
lv_draw_rect(&sel_coords, mask, &draw_dsc_sel);
color = dsc->sel_color;
}
}
@@ -342,7 +343,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
lv_point_t p1;
lv_point_t p2;
p1.x = pos_x_start;
p1.y = pos.y + dsc->font->line_height - dsc->font->base_line + line_dsc.width / 2 + 1;
p1.y = pos.y + dsc->font->line_height - dsc->font->base_line - font->underline_position;
p2.x = pos.x;
p2.y = p1.y;
lv_draw_line(&p1, &p2, mask, &line_dsc);
@@ -385,7 +386,6 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
* STATIC FUNCTIONS
**********************/
/**
* Draw a letter in the Virtual Display Buffer
* @param pos_p left-top coordinate of the latter
@@ -411,7 +411,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_letter(const lv_point_t * pos_p, const
lv_font_glyph_dsc_t g;
bool g_ret = lv_font_get_glyph_dsc(font_p, &g, letter, '\0');
if(g_ret == false) {
/* Add waring if the dsc is not found
/* Add warning if the dsc is not found
* but do not print warning for non printable ASCII chars (e.g. '\n')*/
if(letter >= 0x20) {
LV_LOG_WARN("lv_draw_letter: glyph dsc. not found");
@@ -420,7 +420,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_letter(const lv_point_t * pos_p, const
}
/* Don't draw anything if the character is empty. E.g. space */
if((g.box_h == 0) && (g.box_w == 0)) return;
if((g.box_h == 0) || (g.box_w == 0)) return;
int32_t pos_x = pos_p->x + g.ofs_x;
int32_t pos_y = pos_p->y + (font_p->line_height - font_p->base_line) - g.box_h - g.ofs_y;
@@ -433,7 +433,6 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_letter(const lv_point_t * pos_p, const
return;
}
const uint8_t * map_p = lv_font_get_glyph_bitmap(font_p, letter);
if(map_p == NULL) {
LV_LOG_WARN("lv_draw_letter: character's bitmap not found");
@@ -448,7 +447,6 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_letter(const lv_point_t * pos_p, const
}
}
LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_dsc_t * g,
const lv_area_t * clip_area,
const uint8_t * map_p, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode)
@@ -520,7 +518,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_
uint32_t col_bit;
col_bit = bit_ofs & 0x7; /* "& 0x7" equals to "% 8" just faster */
uint32_t mask_buf_size = box_w * box_h > LV_HOR_RES_MAX ? LV_HOR_RES_MAX : box_w * box_h;
lv_coord_t hor_res = lv_disp_get_hor_res(_lv_refr_get_disp_refreshing());
uint32_t mask_buf_size = box_w * box_h > hor_res ? hor_res : box_w * box_h;
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
int32_t mask_p = 0;
@@ -564,7 +563,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_
mask_p++;
}
/*Apply masks if any*/
if(other_mask_cnt) {
lv_draw_mask_res_t mask_res = lv_draw_mask_apply(mask_buf + mask_p_start, fill_area.x1, fill_area.y2,
@@ -607,6 +605,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_
static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_dsc_t * g, const lv_area_t * clip_area,
const uint8_t * map_p, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode)
{
#if LV_USE_FONT_SUBPX
const uint8_t * bpp_opa_table;
uint32_t bitmask_init;
uint32_t bitmask;
@@ -641,7 +640,6 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_
int32_t box_h = g->box_h;
int32_t width_bit = box_w * bpp; /*Letter width in bits*/
/* Calculate the col/row start/end on the map*/
int32_t col_start = pos_x >= clip_area->x1 ? 0 : (clip_area->x1 - pos_x) * 3;
int32_t col_end = pos_x + box_w / 3 <= clip_area->x2 ? box_w : (clip_area->x2 - pos_x + 1) * 3;
@@ -806,9 +804,11 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_
_lv_mem_buf_release(mask_buf);
_lv_mem_buf_release(color_buf);
#else
LV_LOG_WARN("Can't draw sub-pixel rendered letter because LV_USE_FONT_SUBPX == 0 in lv_conf.h");
#endif
}
/**
* Convert a hexadecimal characters to a number (0..15)
* @param hex Pointer to a hexadecimal character (0..9, A..F)

View File

@@ -29,6 +29,7 @@ extern "C" {
typedef struct {
lv_color_t color;
lv_color_t sel_color;
lv_color_t sel_bg_color;
const lv_font_t * font;
lv_opa_t opa;
lv_style_int_t line_space;
@@ -77,7 +78,8 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc);
* @param hint pointer to a `lv_draw_label_hint_t` variable.
* It is managed by the drawer to speed up the drawing of very long texts (thousands of lines).
*/
LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area_t * mask, lv_draw_label_dsc_t * dsc,
LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area_t * mask,
const lv_draw_label_dsc_t * dsc,
const char * txt, lv_draw_label_hint_t * hint);
//! @endcond

View File

@@ -26,13 +26,13 @@
**********************/
LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, const lv_point_t * point2,
const lv_area_t * clip,
lv_draw_line_dsc_t * dsc);
const lv_draw_line_dsc_t * dsc);
LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const lv_point_t * point2,
const lv_area_t * clip,
lv_draw_line_dsc_t * dsc);
const lv_draw_line_dsc_t * dsc);
LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const lv_point_t * point2,
const lv_area_t * clip,
lv_draw_line_dsc_t * dsc);
const lv_draw_line_dsc_t * dsc);
/**********************
* STATIC VARIABLES
@@ -58,12 +58,11 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc)
* Draw a line
* @param point1 first point of the line
* @param point2 second point of the line
* @param mask the line will be drawn only on this area
* @param style pointer to a line's style
* @param opa_scale scale down all opacities by the factor
* @param clip the line will be drawn only in this area
* @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable
*/
LV_ATTRIBUTE_FAST_MEM void lv_draw_line(const lv_point_t * point1, const lv_point_t * point2, const lv_area_t * clip,
lv_draw_line_dsc_t * dsc)
const lv_draw_line_dsc_t * dsc)
{
if(dsc->width == 0) return;
if(dsc->opa <= LV_OPA_MIN) return;
@@ -84,7 +83,6 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_line(const lv_point_t * point1, const lv_poin
else if(point1->x == point2->x) draw_line_ver(point1, point2, &clip_line, dsc);
else draw_line_skew(point1, point2, &clip_line, dsc);
if(dsc->round_end || dsc->round_start) {
lv_draw_rect_dsc_t cir_dsc;
lv_draw_rect_dsc_init(&cir_dsc);
@@ -120,7 +118,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_line(const lv_point_t * point1, const lv_poin
LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const lv_point_t * point2,
const lv_area_t * clip,
lv_draw_line_dsc_t * dsc)
const lv_draw_line_dsc_t * dsc)
{
lv_opa_t opa = dsc->opa;
@@ -218,10 +216,9 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const
}
}
LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const lv_point_t * point2,
const lv_area_t * clip,
lv_draw_line_dsc_t * dsc)
const lv_draw_line_dsc_t * dsc)
{
lv_opa_t opa = dsc->opa;
@@ -313,10 +310,9 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const
}
}
LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, const lv_point_t * point2,
const lv_area_t * clip,
lv_draw_line_dsc_t * dsc)
const lv_draw_line_dsc_t * dsc)
{
/*Keep the great y in p1*/
lv_point_t p1;
@@ -425,7 +421,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons
/*Draw the background line by line*/
int32_t h;
size_t mask_buf_size = LV_MATH_MIN(lv_area_get_size(&draw_area), LV_HOR_RES_MAX);
uint32_t hor_res = (uint32_t)lv_disp_get_hor_res(disp);
size_t mask_buf_size = LV_MATH_MIN(lv_area_get_size(&draw_area), hor_res);
lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size);
lv_area_t fill_area;

View File

@@ -43,16 +43,14 @@ typedef struct {
* Draw a line
* @param point1 first point of the line
* @param point2 second point of the line
* @param mask the line will be drawn only on this area
* @param style pointer to a line's style
* @param opa_scale scale down all opacities by the factor
* @param clip the line will be drawn only in this area
* @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable
*/
LV_ATTRIBUTE_FAST_MEM void lv_draw_line(const lv_point_t * point1, const lv_point_t * point2, const lv_area_t * mask,
lv_draw_line_dsc_t * dsc);
LV_ATTRIBUTE_FAST_MEM void lv_draw_line(const lv_point_t * point1, const lv_point_t * point2, const lv_area_t * clip,
const lv_draw_line_dsc_t * dsc);
LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc);
//! @endcond
/**********************

View File

@@ -1,7 +1,3 @@
/**
* @file lv_mask.c
*
@@ -16,10 +12,6 @@
#include "../lv_misc/lv_debug.h"
#include "../lv_misc/lv_gc.h"
#if defined(LV_GC_INCLUDE)
#include LV_GC_INCLUDE
#endif /* LV_ENABLE_GC */
/*********************
* DEFINES
*********************/
@@ -288,7 +280,6 @@ void lv_draw_mask_line_angle_init(lv_draw_mask_line_param_t * param, lv_coord_t
* Find the degree which keeps the origo in place */
if(angle > 180) angle -= 180; /*> 180 will swap the origo*/
int32_t p2x;
int32_t p2y;
@@ -298,7 +289,6 @@ void lv_draw_mask_line_angle_init(lv_draw_mask_line_param_t * param, lv_coord_t
lv_draw_mask_line_points_init(param, p1x, py, p2x, p2y, side);
}
/**
* Initialize an angle mask.
* @param param pointer to a `lv_draw_mask_param_t` to initialize
@@ -364,7 +354,6 @@ void lv_draw_mask_angle_init(lv_draw_mask_angle_param_t * param, lv_coord_t vert
lv_draw_mask_line_angle_init(&param->end_line, vertex_x, vertex_y, end_angle, end_side);
}
/**
* Initialize a fade mask.
* @param param param pointer to a `lv_draw_mask_param_t` to initialize
@@ -389,7 +378,6 @@ void lv_draw_mask_radius_init(lv_draw_mask_radius_param_t * param, const lv_area
param->y_prev_x.i = 0;
}
/**
* Initialize a fade mask.
* @param param pointer to a `lv_draw_mask_param_t` to initialize
@@ -412,7 +400,6 @@ void lv_draw_mask_fade_init(lv_draw_mask_fade_param_t * param, const lv_area_t *
param->dsc.type = LV_DRAW_MASK_TYPE_FADE;
}
/**
* Initialize a map mask.
* @param param pointer to a `lv_draw_mask_param_t` to initialize
@@ -427,7 +414,6 @@ void lv_draw_mask_map_init(lv_draw_mask_map_param_t * param, const lv_area_t * c
param->dsc.type = LV_DRAW_MASK_TYPE_MAP;
}
/**********************
* STATIC FUNCTIONS
**********************/
@@ -465,7 +451,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mas
int32_t k = - abs_x;
if(k < 0) return LV_DRAW_MASK_RES_TRANSP;
if(k >= 0 && k < len) _lv_memset_00(&mask_buf[k], len - k);
return LV_DRAW_MASK_RES_CHANGED;
return LV_DRAW_MASK_RES_CHANGED;
}
}
else {
@@ -475,7 +461,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mas
if(k < 0) k = 0;
if(k >= len) return LV_DRAW_MASK_RES_TRANSP;
else if(k >= 0 && k < len) _lv_memset_00(&mask_buf[0], k);
return LV_DRAW_MASK_RES_CHANGED;
return LV_DRAW_MASK_RES_CHANGED;
}
}
}
@@ -577,7 +563,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_b
if(k >= len) break;
}
if(k < len && k >= 0) {
int32_t x_inters = (px_h * p->xy_steep) >> 10;
m = (x_inters * px_h) >> 9;
@@ -586,7 +571,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_b
mask_buf[k] = mask_mix(mask_buf[k], m);
}
if(p->inv) {
k = xei - abs_x;
if(k > len) {
@@ -751,7 +735,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_
return LV_DRAW_MASK_RES_CHANGED;
}
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_angle_param_t * p)
@@ -759,7 +742,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma
int32_t rel_y = abs_y - p->cfg.vertex_p.y;
int32_t rel_x = abs_x - p->cfg.vertex_p.x;
if(p->cfg.start_angle < 180 && p->cfg.end_angle < 180 &&
p->cfg.start_angle != 0 && p->cfg.end_angle != 0 &&
p->cfg.start_angle > p->cfg.end_angle) {
@@ -772,7 +754,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma
int32_t end_angle_first = (rel_y * p->end_line.xy_steep) >> 10;
int32_t start_angle_last = ((rel_y + 1) * p->start_line.xy_steep) >> 10;
/*Do not let the line end cross the vertex else it will affect the opposite part*/
if(p->cfg.start_angle > 270 && p->cfg.start_angle <= 359 && start_angle_last < 0) start_angle_last = 0;
else if(p->cfg.start_angle > 0 && p->cfg.start_angle <= 90 && start_angle_last < 0) start_angle_last = 0;
@@ -782,7 +763,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma
else if(p->cfg.end_angle > 0 && p->cfg.end_angle <= 90 && start_angle_last < 0) start_angle_last = 0;
else if(p->cfg.end_angle > 90 && p->cfg.end_angle < 270 && start_angle_last > 0) start_angle_last = 0;
int32_t dist = (end_angle_first - start_angle_last) >> 1;
lv_draw_mask_res_t res1 = LV_DRAW_MASK_RES_FULL_COVER;
@@ -1143,7 +1123,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m
return LV_DRAW_MASK_RES_CHANGED;
}
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_fade(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_fade_param_t * p)
@@ -1204,7 +1183,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_map(lv_opa_t * mask
const lv_opa_t * map_tmp = p->cfg.map;
map_tmp += (abs_y - p->cfg.coords.y1) * lv_area_get_width(&p->cfg.coords);
if(abs_x + len > p->cfg.coords.x2) len -= abs_x + len - p->cfg.coords.x2 - 1;
if(abs_x < p->cfg.coords.x1) {
@@ -1225,7 +1203,6 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_map(lv_opa_t * mask
return LV_DRAW_MASK_RES_CHANGED;
}
LV_ATTRIBUTE_FAST_MEM static inline lv_opa_t mask_mix(lv_opa_t mask_act, lv_opa_t mask_new)
{
if(mask_new >= LV_OPA_MAX) return mask_act;

View File

@@ -36,7 +36,6 @@ enum {
typedef uint8_t lv_draw_mask_res_t;
enum {
LV_DRAW_MASK_TYPE_LINE,
LV_DRAW_MASK_TYPE_ANGLE,
@@ -102,7 +101,6 @@ typedef struct {
/*1: It's a flat line? (Near to horizontal)*/
uint8_t flat : 1;
/* Invert the mask. The default is: Keep the left part.
* It is used to select left/right/top/bottom*/
uint8_t inv: 1;
@@ -181,7 +179,6 @@ typedef _lv_draw_mask_saved_t _lv_draw_mask_saved_arr_t[_LV_MASK_MAX_NUM];
*/
int16_t lv_draw_mask_add(void * param, void * custom_id);
//! @cond Doxygen_Suppress
/**
@@ -198,7 +195,6 @@ int16_t lv_draw_mask_add(void * param, void * custom_id);
LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
lv_coord_t len);
//! @endcond
/**
@@ -225,7 +221,6 @@ void * lv_draw_mask_remove_custom(void * custom_id);
*/
LV_ATTRIBUTE_FAST_MEM uint8_t lv_draw_mask_get_cnt(void);
//! @endcond
/**

View File

@@ -10,13 +10,14 @@
#include "lv_draw_blend.h"
#include "lv_draw_mask.h"
#include "../lv_misc/lv_math.h"
#include "../lv_misc/lv_txt_ap.h"
#include "../lv_core/lv_refr.h"
#include "../lv_misc/lv_debug.h"
/*********************
* DEFINES
*********************/
#define SHADOW_UPSACALE_SHIFT 6
#define SHADOW_UPSCALE_SHIFT 6
#define SHADOW_ENHANCE 1
#define SPLIT_LIMIT 50
@@ -27,20 +28,32 @@
/**********************
* STATIC PROTOTYPES
**********************/
LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_area_t * clip,
const lv_draw_rect_dsc_t * dsc);
LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv_area_t * clip,
lv_draw_rect_dsc_t * dsc);
static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
LV_ATTRIBUTE_FAST_MEM static inline lv_color_t grad_get(lv_draw_rect_dsc_t * dsc, lv_coord_t s, lv_coord_t i);
const lv_draw_rect_dsc_t * dsc);
#if LV_USE_OUTLINE
static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, const lv_draw_rect_dsc_t * dsc);
#endif
#if LV_USE_SHADOW
LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv_area_t * clip,
lv_draw_rect_dsc_t * dsc);
const lv_draw_rect_dsc_t * dsc);
LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coords, uint16_t * sh_buf, lv_coord_t s,
lv_coord_t r);
LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t sw, uint16_t * sh_ups_buf);
#endif
static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
static void draw_value(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
#if LV_USE_PATTERN
static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, const lv_draw_rect_dsc_t * dsc);
#endif
#if LV_USE_VALUE_STR
static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, const lv_draw_rect_dsc_t * dsc);
#endif
static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * area_outer, const lv_area_t * clip,
lv_coord_t radius, bool radius_is_in, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode);
LV_ATTRIBUTE_FAST_MEM static inline lv_color_t grad_get(const lv_draw_rect_dsc_t * dsc, lv_coord_t s, lv_coord_t i);
/**********************
* STATIC VARIABLES
@@ -85,9 +98,9 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc)
* Draw a rectangle
* @param coords the coordinates of the rectangle
* @param mask the rectangle will be drawn only in this mask
* @param style pointer to a style
* @param dsc pointer to an initialized `lv_draw_rect_dsc_t` variable
*/
void lv_draw_rect(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc)
void lv_draw_rect(const lv_area_t * coords, const lv_area_t * clip, const lv_draw_rect_dsc_t * dsc)
{
if(lv_area_get_height(coords) < 1 || lv_area_get_width(coords) < 1) return;
#if LV_USE_SHADOW
@@ -95,10 +108,19 @@ void lv_draw_rect(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect
#endif
draw_bg(coords, clip, dsc);
#if LV_USE_PATTERN
draw_pattern(coords, clip, dsc);
#endif
draw_border(coords, clip, dsc);
draw_value(coords, clip, dsc);
#if LV_USE_VALUE_STR
draw_value_str(coords, clip, dsc);
#endif
#if LV_USE_OUTLINE
draw_outline(coords, clip, dsc);
#endif
LV_ASSERT_MEM_INTEGRITY();
}
@@ -142,7 +164,8 @@ void lv_draw_px(const lv_point_t * point, const lv_area_t * clip_area, const lv_
* STATIC FUNCTIONS
**********************/
LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc)
LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_area_t * clip,
const lv_draw_rect_dsc_t * dsc)
{
if(dsc->bg_opa <= LV_OPA_MIN) return;
@@ -222,7 +245,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are
lv_draw_mask_res_t mask_res = LV_DRAW_MASK_RES_FULL_COVER;
lv_color_t grad_color = dsc->bg_color;
lv_color_t * grad_map = NULL;
/*In case of horizontal gradient pre-compute a line with a gradient*/
if(grad_dir == LV_GRAD_DIR_HOR) {
@@ -307,7 +329,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are
_lv_blend_fill(clip, &fill_area2,
grad_color, mask_buf + mask_ofs, mask_res, opa2, dsc->bg_blend_mode);
}
else {
if(grad_dir == LV_GRAD_DIR_HOR) {
@@ -340,7 +361,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are
if(fill_area.y1 <= fill_area.y2) fill_area.y1 = fill_area.y2 + 1; /*Avoid overdrawing the last line*/
fill_area.y2 = coords_bg.y2;
_lv_blend_fill(clip, &fill_area,
dsc->bg_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode);
@@ -364,46 +384,12 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are
}
LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv_area_t * clip,
lv_draw_rect_dsc_t * dsc)
const lv_draw_rect_dsc_t * dsc)
{
if(dsc->border_opa <= LV_OPA_MIN) return;
if(dsc->border_width == 0) return;
if(dsc->border_side == LV_BORDER_SIDE_NONE) return;
lv_opa_t opa = dsc->border_opa;
if(opa > LV_OPA_MAX) opa = LV_OPA_COVER;
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
lv_disp_buf_t * vdb = lv_disp_get_buf(disp);
/* Get clipped fill area which is the real draw area.
* It is always the same or inside `fill_area` */
lv_area_t draw_area;
bool is_common;
is_common = _lv_area_intersect(&draw_area, coords, clip);
if(is_common == false) return;
const lv_area_t * disp_area = &vdb->area;
/* Now `draw_area` has absolute coordinates.
* Make it relative to `disp_area` to simplify draw to `disp_buf`*/
draw_area.x1 -= disp_area->x1;
draw_area.y1 -= disp_area->y1;
draw_area.x2 -= disp_area->x1;
draw_area.y2 -= disp_area->y1;
int32_t draw_area_w = lv_area_get_width(&draw_area);
/*Create a mask if there is a radius*/
lv_opa_t * mask_buf = _lv_mem_buf_get(draw_area_w);
uint8_t other_mask_cnt = lv_draw_mask_get_cnt();
bool simple_mode = true;
if(other_mask_cnt) simple_mode = false;
else if(dsc->border_side != LV_BORDER_SIDE_FULL) simple_mode = false;
int16_t mask_rout_id = LV_MASK_ID_INV;
if(dsc->border_post) return;
int32_t coords_w = lv_area_get_width(coords);
int32_t coords_h = lv_area_get_height(coords);
@@ -413,140 +399,81 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv
int32_t short_side = LV_MATH_MIN(coords_w, coords_h);
if(rout > short_side >> 1) rout = short_side >> 1;
/*Get the outer area*/
lv_draw_mask_radius_param_t mask_rout_param;
if(rout > 0) {
lv_draw_mask_radius_init(&mask_rout_param, coords, rout, false);
mask_rout_id = lv_draw_mask_add(&mask_rout_param, NULL);
}
/*Get the inner radius*/
int32_t rin = rout - dsc->border_width;
if(rin < 0) rin = 0;
/*Get the inner area*/
lv_area_t area_small;
lv_area_copy(&area_small, coords);
area_small.x1 += ((dsc->border_side & LV_BORDER_SIDE_LEFT) ? dsc->border_width : - (dsc->border_width + rout));
area_small.x2 -= ((dsc->border_side & LV_BORDER_SIDE_RIGHT) ? dsc->border_width : - (dsc->border_width + rout));
area_small.y1 += ((dsc->border_side & LV_BORDER_SIDE_TOP) ? dsc->border_width : - (dsc->border_width + rout));
area_small.y2 -= ((dsc->border_side & LV_BORDER_SIDE_BOTTOM) ? dsc->border_width : - (dsc->border_width + rout));
lv_area_t area_inner;
lv_area_copy(&area_inner, coords);
area_inner.x1 += ((dsc->border_side & LV_BORDER_SIDE_LEFT) ? dsc->border_width : - (dsc->border_width + rout));
area_inner.x2 -= ((dsc->border_side & LV_BORDER_SIDE_RIGHT) ? dsc->border_width : - (dsc->border_width + rout));
area_inner.y1 += ((dsc->border_side & LV_BORDER_SIDE_TOP) ? dsc->border_width : - (dsc->border_width + rout));
area_inner.y2 -= ((dsc->border_side & LV_BORDER_SIDE_BOTTOM) ? dsc->border_width : - (dsc->border_width + rout));
/*Create inner the mask*/
lv_draw_mask_radius_param_t mask_rin_param;
lv_draw_mask_radius_init(&mask_rin_param, &area_small, rout - dsc->border_width, true);
int16_t mask_rin_id = lv_draw_mask_add(&mask_rin_param, NULL);
int32_t corner_size = LV_MATH_MAX(rout, dsc->border_width - 1);
int32_t h;
lv_draw_mask_res_t mask_res;
lv_area_t fill_area;
lv_color_t color = dsc->border_color;
lv_blend_mode_t blend_mode = dsc->border_blend_mode;
/*Apply some optimization if there is no other mask*/
if(simple_mode) {
/*Draw the upper corner area*/
int32_t upper_corner_end = coords->y1 - disp_area->y1 + corner_size;
upper_corner_end = LV_MATH_MIN(upper_corner_end, draw_area.y2);
fill_area.x1 = coords->x1;
fill_area.x2 = coords->x2;
fill_area.y1 = disp_area->y1 + draw_area.y1;
fill_area.y2 = fill_area.y1;
for(h = draw_area.y1; h <= upper_corner_end; h++) {
_lv_memset_ff(mask_buf, draw_area_w);
mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w);
lv_area_t fill_area2;
fill_area2.y1 = fill_area.y1;
fill_area2.y2 = fill_area.y2;
fill_area2.x1 = coords->x1;
fill_area2.x2 = coords->x1 + rout - 1;
_lv_blend_fill(clip, &fill_area2, color, mask_buf, mask_res, opa, blend_mode);
/*Draw the top horizontal line*/
if(fill_area2.y2 < coords->y1 + dsc->border_width) {
fill_area2.x1 = coords->x1 + rout;
fill_area2.x2 = coords->x2 - rout;
_lv_blend_fill(clip, &fill_area2, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode);
}
fill_area2.x1 = coords->x2 - rout + 1;
fill_area2.x2 = coords->x2;
int32_t mask_ofs = (coords->x2 - rout + 1) - (vdb->area.x1 + draw_area.x1);
if(mask_ofs < 0) mask_ofs = 0;
_lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode);
fill_area.y1++;
fill_area.y2++;
}
/*Draw the lower corner area */
int32_t lower_corner_end = coords->y2 - disp_area->y1 - corner_size;
lower_corner_end = LV_MATH_MAX(lower_corner_end, draw_area.y1);
if(lower_corner_end <= upper_corner_end) lower_corner_end = upper_corner_end + 1;
fill_area.y1 = disp_area->y1 + lower_corner_end;
fill_area.y2 = fill_area.y1;
for(h = lower_corner_end; h <= draw_area.y2; h++) {
_lv_memset_ff(mask_buf, draw_area_w);
mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w);
lv_area_t fill_area2;
fill_area2.x1 = coords->x1;
fill_area2.x2 = coords->x1 + rout - 1;
fill_area2.y1 = fill_area.y1;
fill_area2.y2 = fill_area.y2;
_lv_blend_fill(clip, &fill_area2, color, mask_buf, mask_res, opa, blend_mode);
/*Draw the bottom horizontal line*/
if(fill_area2.y2 > coords->y2 - dsc->border_width) {
fill_area2.x1 = coords->x1 + rout;
fill_area2.x2 = coords->x2 - rout;
_lv_blend_fill(clip, &fill_area2, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode);
}
fill_area2.x1 = coords->x2 - rout + 1;
fill_area2.x2 = coords->x2;
int32_t mask_ofs = (coords->x2 - rout + 1) - (vdb->area.x1 + draw_area.x1);
if(mask_ofs < 0) mask_ofs = 0;
_lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode);
fill_area.y1++;
fill_area.y2++;
}
/*Draw the left vertical border part*/
fill_area.y1 = coords->y1 + corner_size + 1;
fill_area.y2 = coords->y2 - corner_size - 1;
fill_area.x1 = coords->x1;
fill_area.x2 = coords->x1 + dsc->border_width - 1;
_lv_blend_fill(clip, &fill_area, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode);
/*Draw the right vertical border*/
fill_area.x1 = coords->x2 - dsc->border_width + 1;
fill_area.x2 = coords->x2;
_lv_blend_fill(clip, &fill_area, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode);
if(dsc->border_side == LV_BORDER_SIDE_FULL) {
draw_full_border(&area_inner, coords, clip, dsc->radius, false, dsc->border_color, dsc->border_opa,
dsc->border_blend_mode);
}
/*Process line by line if there is other mask too*/
else {
lv_opa_t opa = dsc->border_opa;
if(opa > LV_OPA_MAX) opa = LV_OPA_COVER;
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
lv_disp_buf_t * vdb = lv_disp_get_buf(disp);
/* Get clipped fill area which is the real draw area.
* It is always the same or inside `fill_area` */
lv_area_t draw_area;
bool is_common;
is_common = _lv_area_intersect(&draw_area, coords, clip);
if(is_common == false) return;
const lv_area_t * disp_area = &vdb->area;
/* Now `draw_area` has absolute coordinates.
* Make it relative to `disp_area` to simplify draw to `disp_buf`*/
draw_area.x1 -= disp_area->x1;
draw_area.y1 -= disp_area->y1;
draw_area.x2 -= disp_area->x1;
draw_area.y2 -= disp_area->y1;
int32_t draw_area_w = lv_area_get_width(&draw_area);
/*Create a mask if there is a radius*/
lv_opa_t * mask_buf = _lv_mem_buf_get(draw_area_w);
/*Create mask for the outer area*/
int16_t mask_rout_id = LV_MASK_ID_INV;
lv_draw_mask_radius_param_t mask_rout_param;
if(rout > 0) {
lv_draw_mask_radius_init(&mask_rout_param, coords, rout, false);
mask_rout_id = lv_draw_mask_add(&mask_rout_param, NULL);
}
/*Create mask for the inner mask*/
int32_t rin = rout - dsc->border_width;
if(rin < 0) rin = 0;
lv_draw_mask_radius_param_t mask_rin_param;
lv_draw_mask_radius_init(&mask_rin_param, &area_inner, rout - dsc->border_width, true);
int16_t mask_rin_id = lv_draw_mask_add(&mask_rin_param, NULL);
int32_t corner_size = LV_MATH_MAX(rout, dsc->border_width - 1);
int32_t h;
lv_draw_mask_res_t mask_res;
lv_area_t fill_area;
lv_color_t color = dsc->border_color;
lv_blend_mode_t blend_mode = dsc->border_blend_mode;
fill_area.x1 = coords->x1;
fill_area.x2 = coords->x2;
fill_area.y1 = disp_area->y1 + draw_area.y1;
fill_area.y2 = fill_area.y1;
uint32_t buf_ofs = 0;
if(dsc->border_side == LV_BORDER_SIDE_LEFT) fill_area.x2 = coords->x1 + corner_size;
else if(dsc->border_side == LV_BORDER_SIDE_RIGHT) fill_area.x1 = coords->x2 - corner_size;
else if(dsc->border_side == LV_BORDER_SIDE_RIGHT) {
fill_area.x1 = coords->x2 - corner_size;
buf_ofs = fill_area.x1 - coords->x1;
}
volatile bool top_only = false;
volatile bool bottom_only = false;
@@ -565,19 +492,19 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv
(bottom_only && fill_area.y1 >= coords->y2 - corner_size)) {
_lv_memset_ff(mask_buf, draw_area_w);
mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w);
_lv_blend_fill(clip, &fill_area, color, mask_buf, mask_res, opa, blend_mode);
_lv_blend_fill(clip, &fill_area, color, mask_buf + buf_ofs, mask_res, opa, blend_mode);
}
fill_area.y1++;
fill_area.y2++;
}
lv_draw_mask_remove_id(mask_rin_id);
lv_draw_mask_remove_id(mask_rout_id);
_lv_mem_buf_release(mask_buf);
}
lv_draw_mask_remove_id(mask_rin_id);
lv_draw_mask_remove_id(mask_rout_id);
_lv_mem_buf_release(mask_buf);
}
LV_ATTRIBUTE_FAST_MEM static inline lv_color_t grad_get(lv_draw_rect_dsc_t * dsc, lv_coord_t s, lv_coord_t i)
LV_ATTRIBUTE_FAST_MEM static inline lv_color_t grad_get(const lv_draw_rect_dsc_t * dsc, lv_coord_t s, lv_coord_t i)
{
int32_t min = (dsc->bg_main_color_stop * s) >> 8;
if(i <= min) return dsc->bg_color;
@@ -594,7 +521,7 @@ LV_ATTRIBUTE_FAST_MEM static inline lv_color_t grad_get(lv_draw_rect_dsc_t * dsc
#if LV_USE_SHADOW
LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv_area_t * clip,
lv_draw_rect_dsc_t * dsc)
const lv_draw_rect_dsc_t * dsc)
{
/*Check whether the shadow is visible*/
if(dsc->shadow_width == 0) return;
@@ -659,7 +586,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv
short_side = LV_MATH_MIN(lv_area_get_width(&sh_rect_area), lv_area_get_height(&sh_rect_area));
if(r_sh > short_side >> 1) r_sh = short_side >> 1;
int32_t corner_size = sw + r_sh;
lv_opa_t * sh_buf;
@@ -986,7 +912,6 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv
}
}
/*Fill the bottom side*/
a.x1 = sh_area.x1 + corner_size;
a.x2 = sh_area.x2 - corner_size;
@@ -1099,10 +1024,10 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord
}
else {
int32_t i;
sh_ups_tmp_buf[0] = (mask_line[0] << SHADOW_UPSACALE_SHIFT) / sw;
sh_ups_tmp_buf[0] = (mask_line[0] << SHADOW_UPSCALE_SHIFT) / sw;
for(i = 1; i < size; i++) {
if(mask_line[i] == mask_line[i - 1]) sh_ups_tmp_buf[i] = sh_ups_tmp_buf[i - 1];
else sh_ups_tmp_buf[i] = (mask_line[i] << SHADOW_UPSACALE_SHIFT) / sw;
else sh_ups_tmp_buf[i] = (mask_line[i] << SHADOW_UPSCALE_SHIFT) / sw;
}
}
@@ -1114,7 +1039,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord
int32_t i;
lv_opa_t * res_buf = (lv_opa_t *)sh_buf;
for(i = 0; i < size * size; i++) {
res_buf[i] = (sh_buf[i] >> SHADOW_UPSACALE_SHIFT);
res_buf[i] = (sh_buf[i] >> SHADOW_UPSCALE_SHIFT);
}
return;
}
@@ -1132,10 +1057,10 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord
sw += sw_ori & 1;
if(sw > 1) {
uint32_t i;
sh_buf[0] = (sh_buf[0] << SHADOW_UPSACALE_SHIFT) / sw;
sh_buf[0] = (sh_buf[0] << SHADOW_UPSCALE_SHIFT) / sw;
for(i = 1; i < (uint32_t) size * size; i++) {
if(sh_buf[i] == sh_buf[i - 1]) sh_buf[i] = sh_buf[i - 1];
else sh_buf[i] = (sh_buf[i] << SHADOW_UPSACALE_SHIFT) / sw;
else sh_buf[i] = (sh_buf[i] << SHADOW_UPSCALE_SHIFT) / sw;
}
shadow_blur_corner(size, sw, sh_buf);
@@ -1188,14 +1113,14 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t
sh_ups_buf[0] = sh_ups_buf[0] / sw;
for(i = 1; i < (uint32_t)size * size; i++) {
if(sh_ups_buf[i] == sh_ups_buf[i - 1]) sh_ups_buf[i] = sh_ups_buf[i - 1];
else sh_ups_buf[i] = sh_ups_buf[i] / sw;
else sh_ups_buf[i] = sh_ups_buf[i] / sw;
}
for(x = 0; x < size; x++) {
sh_ups_tmp_buf = &sh_ups_buf[x];
int32_t v = sh_ups_tmp_buf[0] * sw;
for(y = 0; y < size ; y++, sh_ups_tmp_buf += size) {
sh_ups_blur_buf[y] = v < 0 ? 0 : (v >> SHADOW_UPSACALE_SHIFT);
sh_ups_blur_buf[y] = v < 0 ? 0 : (v >> SHADOW_UPSCALE_SHIFT);
/*Forget the top pixel*/
uint32_t top_val;
@@ -1222,7 +1147,8 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t
#endif
static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc)
#if LV_USE_OUTLINE
static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, const lv_draw_rect_dsc_t * dsc)
{
if(dsc->outline_opa <= LV_OPA_MIN) return;
if(dsc->outline_width == 0) return;
@@ -1231,10 +1157,6 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_dr
if(opa > LV_OPA_MAX) opa = LV_OPA_COVER;
uint8_t other_mask_cnt = lv_draw_mask_get_cnt();
bool simple_mode = true;
if(other_mask_cnt) simple_mode = false;
/*Get the inner radius*/
lv_area_t area_inner;
lv_area_copy(&area_inner, coords);
@@ -1243,16 +1165,6 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_dr
area_inner.x2 += dsc->outline_pad;
area_inner.y2 += dsc->outline_pad;
int32_t inner_w = lv_area_get_width(&area_inner);
int32_t inner_h = lv_area_get_height(&area_inner);
int32_t rin = dsc->radius;
int32_t short_side = LV_MATH_MIN(inner_w, inner_h);
if(rin > short_side >> 1) rin = short_side >> 1;
/*Get the outer area*/
int32_t rout = rin + dsc->outline_width;
lv_area_t area_outer;
lv_area_copy(&area_outer, &area_inner);
@@ -1261,166 +1173,13 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_dr
area_outer.y1 -= dsc->outline_width;
area_outer.y2 += dsc->outline_width;
int32_t coords_out_w = lv_area_get_width(&area_outer);
int32_t coords_out_h = lv_area_get_height(&area_outer);
short_side = LV_MATH_MIN(coords_out_w, coords_out_h);
if(rout > short_side >> 1) rout = short_side >> 1;
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
lv_disp_buf_t * vdb = lv_disp_get_buf(disp);
/* Get clipped fill area which is the real draw area.
* It is always the same or inside `fill_area` */
lv_area_t draw_area;
bool is_common;
is_common = _lv_area_intersect(&draw_area, &area_outer, clip);
if(is_common == false) return;
const lv_area_t * disp_area = &vdb->area;
/* Now `draw_area` has absolute coordinates.
* Make it relative to `disp_area` to simplify draw to `disp_buf`*/
draw_area.x1 -= disp_area->x1;
draw_area.y1 -= disp_area->y1;
draw_area.x2 -= disp_area->x1;
draw_area.y2 -= disp_area->y1;
int32_t draw_area_w = lv_area_get_width(&draw_area);
/*Create inner the mask*/
lv_draw_mask_radius_param_t mask_rin_param;
lv_draw_mask_radius_init(&mask_rin_param, &area_inner, rin, true);
int16_t mask_rin_id = lv_draw_mask_add(&mask_rin_param, NULL);
lv_draw_mask_radius_param_t mask_rout_param;
lv_draw_mask_radius_init(&mask_rout_param, &area_outer, rout, false);
int16_t mask_rout_id = lv_draw_mask_add(&mask_rout_param, NULL);
lv_opa_t * mask_buf = _lv_mem_buf_get(draw_area_w);
int32_t corner_size = LV_MATH_MAX(rout, dsc->outline_width - 1);
int32_t h;
lv_draw_mask_res_t mask_res;
lv_area_t fill_area;
lv_color_t color = dsc->outline_color;
lv_blend_mode_t blend_mode = dsc->outline_blend_mode;
/*Apply some optimization if there is no other mask*/
if(simple_mode) {
/*Draw the upper corner area*/
int32_t upper_corner_end = area_outer.y1 - disp_area->y1 + corner_size;
fill_area.x1 = area_outer.x1;
fill_area.x2 = area_outer.x2;
fill_area.y1 = disp_area->y1 + draw_area.y1;
fill_area.y2 = fill_area.y1;
for(h = draw_area.y1; h <= upper_corner_end; h++) {
_lv_memset_ff(mask_buf, draw_area_w);
mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w);
lv_area_t fill_area2;
fill_area2.y1 = fill_area.y1;
fill_area2.y2 = fill_area.y2;
fill_area2.x1 = area_outer.x1;
fill_area2.x2 = area_outer.x1 + rout - 1;
_lv_blend_fill(clip, &fill_area2, color, mask_buf, mask_res, opa, blend_mode);
/*Draw the top horizontal line*/
if(fill_area2.y2 < area_outer.y1 + dsc->outline_width) {
fill_area2.x1 = area_outer.x1 + rout;
fill_area2.x2 = area_outer.x2 - rout;
_lv_blend_fill(clip, &fill_area2, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode);
}
fill_area2.x1 = area_outer.x2 - rout + 1;
fill_area2.x2 = area_outer.x2;
int32_t mask_ofs = (area_outer.x2 - rout + 1) - (vdb->area.x1 + draw_area.x1);
if(mask_ofs < 0) mask_ofs = 0;
_lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode);
fill_area.y1++;
fill_area.y2++;
}
/*Draw the lower corner area */
int32_t lower_corner_end = area_outer.y2 - disp_area->y1 - corner_size;
if(lower_corner_end <= upper_corner_end) lower_corner_end = upper_corner_end + 1;
fill_area.y1 = disp_area->y1 + lower_corner_end;
fill_area.y2 = fill_area.y1;
for(h = lower_corner_end; h <= draw_area.y2; h++) {
_lv_memset_ff(mask_buf, draw_area_w);
mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w);
lv_area_t fill_area2;
fill_area2.x1 = area_outer.x1;
fill_area2.x2 = area_outer.x1 + rout - 1;
fill_area2.y1 = fill_area.y1;
fill_area2.y2 = fill_area.y2;
_lv_blend_fill(clip, &fill_area2, color, mask_buf, mask_res, opa, blend_mode);
/*Draw the bottom horizontal line*/
if(fill_area2.y2 > area_outer.y2 - dsc->outline_width) {
fill_area2.x1 = area_outer.x1 + rout;
fill_area2.x2 = area_outer.x2 - rout;
_lv_blend_fill(clip, &fill_area2, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode);
}
fill_area2.x1 = area_outer.x2 - rout + 1;
fill_area2.x2 = area_outer.x2;
int32_t mask_ofs = (area_outer.x2 - rout + 1) - (vdb->area.x1 + draw_area.x1);
if(mask_ofs < 0) mask_ofs = 0;
_lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode);
fill_area.y1++;
fill_area.y2++;
}
/*Draw the left vertical part*/
fill_area.y1 = area_outer.y1 + corner_size + 1;
fill_area.y2 = area_outer.y2 - corner_size - 1;
fill_area.x1 = area_outer.x1;
fill_area.x2 = area_outer.x1 + dsc->outline_width - 1;
_lv_blend_fill(clip, &fill_area, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode);
/*Draw the right vertical border*/
fill_area.x1 = area_outer.x2 - dsc->outline_width + 1;
fill_area.x2 = area_outer.x2;
_lv_blend_fill(clip, &fill_area, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode);
}
/*Process line by line if there is other mask too*/
else {
fill_area.x1 = area_outer.x1;
fill_area.x2 = area_outer.x2;
fill_area.y1 = disp_area->y1 + draw_area.y1;
fill_area.y2 = fill_area.y1;
for(h = draw_area.y1; h <= draw_area.y2; h++) {
_lv_memset_ff(mask_buf, draw_area_w);
mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w);
_lv_blend_fill(clip, &fill_area, color, mask_buf, mask_res, opa, blend_mode);
fill_area.y1++;
fill_area.y2++;
}
}
lv_draw_mask_remove_id(mask_rin_id);
lv_draw_mask_remove_id(mask_rout_id);
_lv_mem_buf_release(mask_buf);
draw_full_border(&area_inner, &area_outer, clip, dsc->radius, true, dsc->outline_color, dsc->outline_opa,
dsc->outline_blend_mode);
}
#endif
static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc)
#if LV_USE_PATTERN
static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, const lv_draw_rect_dsc_t * dsc)
{
if(dsc->pattern_image == NULL) return;
if(dsc->pattern_opa <= LV_OPA_MIN) return;
@@ -1467,6 +1226,9 @@ static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, lv_dr
return;
}
/*Can't draw zero sized images*/
if(img_w == 0 || img_h == 0) return;
lv_area_t coords_tmp;
if(dsc->pattern_repeat) {
@@ -1520,15 +1282,24 @@ static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, lv_dr
lv_draw_mask_remove_id(radius_mask_id);
}
}
#endif
static void draw_value(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc)
#if LV_USE_VALUE_STR
static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, const lv_draw_rect_dsc_t * dsc)
{
if(dsc->value_str == NULL) return;
if(dsc->value_opa <= LV_OPA_MIN) return;
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
const char * str = dsc->value_str;
#else
uint32_t str_len = _lv_txt_ap_calc_bytes_cnt(dsc->value_str);
char * str = _lv_mem_buf_get(str_len + 1);
_lv_txt_ap_proc(dsc->value_str, str);
#endif
lv_point_t s;
_lv_txt_get_size(&s, dsc->value_str, dsc->value_font, dsc->value_letter_space, dsc->value_line_space, LV_COORD_MAX,
_lv_txt_get_size(&s, str, dsc->value_font, dsc->value_letter_space, dsc->value_line_space, LV_COORD_MAX,
LV_TXT_FLAG_NONE);
lv_area_t value_area;
@@ -1553,6 +1324,195 @@ static void draw_value(const lv_area_t * coords, const lv_area_t * clip, lv_draw
label_dsc.color = dsc->value_color;
label_dsc.opa = dsc->value_opa;
lv_draw_label(&value_area, clip, &label_dsc, dsc->value_str, NULL);
}
lv_draw_label(&value_area, clip, &label_dsc, str, NULL);
#if LV_USE_ARABIC_PERSIAN_CHARS
_lv_mem_buf_release(str);
#endif
}
#endif
static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * area_outer, const lv_area_t * clip,
lv_coord_t radius, bool radius_is_in, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode)
{
uint8_t other_mask_cnt = lv_draw_mask_get_cnt();
bool simple_mode = true;
if(other_mask_cnt) simple_mode = false;
int32_t inner_w = lv_area_get_width(area_inner);
int32_t inner_h = lv_area_get_height(area_inner);
lv_coord_t border_width = area_outer->x2 - area_inner->x2;
int32_t coords_out_w = lv_area_get_width(area_outer);
int32_t coords_out_h = lv_area_get_height(area_outer);
int32_t rin;
int32_t rout;
if(radius_is_in) {
rin = radius;
int32_t short_side = LV_MATH_MIN(inner_w, inner_h);
if(rin > short_side >> 1) rin = short_side >> 1;
/*Get the outer area*/
rout = rin + border_width;
}
else {
rout = radius;
int32_t short_side = LV_MATH_MIN(coords_out_w, coords_out_h);
if(rout > short_side >> 1) rout = short_side >> 1;
/*Get the outer area*/
rin = rout - border_width;
if(rin < 0) rin = 0;
}
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
lv_disp_buf_t * vdb = lv_disp_get_buf(disp);
/* Get clipped fill area which is the real draw area.
* It is always the same or inside `fill_area` */
lv_area_t draw_area;
bool is_common;
is_common = _lv_area_intersect(&draw_area, area_outer, clip);
if(is_common == false) return;
const lv_area_t * disp_area = &vdb->area;
/* Now `draw_area` has absolute coordinates.
* Make it relative to `disp_area` to simplify draw to `disp_buf`*/
draw_area.x1 -= disp_area->x1;
draw_area.y1 -= disp_area->y1;
draw_area.x2 -= disp_area->x1;
draw_area.y2 -= disp_area->y1;
int32_t draw_area_w = lv_area_get_width(&draw_area);
/*Create inner the mask*/
lv_draw_mask_radius_param_t mask_rin_param;
lv_draw_mask_radius_init(&mask_rin_param, area_inner, rin, true);
int16_t mask_rin_id = lv_draw_mask_add(&mask_rin_param, NULL);
lv_draw_mask_radius_param_t mask_rout_param;
lv_draw_mask_radius_init(&mask_rout_param, area_outer, rout, false);
int16_t mask_rout_id = lv_draw_mask_add(&mask_rout_param, NULL);
lv_opa_t * mask_buf = _lv_mem_buf_get(draw_area_w);
int32_t corner_size = LV_MATH_MAX(rout, border_width - 1);
int32_t h;
lv_draw_mask_res_t mask_res;
lv_area_t fill_area;
/*Apply some optimization if there is no other mask*/
if(simple_mode) {
/*Draw the upper corner area*/
int32_t upper_corner_end = area_outer->y1 - disp_area->y1 + corner_size;
fill_area.x1 = area_outer->x1;
fill_area.x2 = area_outer->x2;
fill_area.y1 = disp_area->y1 + draw_area.y1;
fill_area.y2 = fill_area.y1;
for(h = draw_area.y1; h <= upper_corner_end; h++) {
_lv_memset_ff(mask_buf, draw_area_w);
mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w);
lv_area_t fill_area2;
fill_area2.y1 = fill_area.y1;
fill_area2.y2 = fill_area.y2;
fill_area2.x1 = area_outer->x1;
fill_area2.x2 = area_outer->x1 + rout - 1;
_lv_blend_fill(clip, &fill_area2, color, mask_buf, mask_res, opa, blend_mode);
/*Draw the top horizontal line*/
if(fill_area2.y2 < area_outer->y1 + border_width) {
fill_area2.x1 = area_outer->x1 + rout;
fill_area2.x2 = area_outer->x2 - rout;
_lv_blend_fill(clip, &fill_area2, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode);
}
fill_area2.x1 = area_outer->x2 - rout + 1;
fill_area2.x2 = area_outer->x2;
int32_t mask_ofs = (area_outer->x2 - rout + 1) - (vdb->area.x1 + draw_area.x1);
if(mask_ofs < 0) mask_ofs = 0;
_lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode);
fill_area.y1++;
fill_area.y2++;
}
/*Draw the lower corner area */
int32_t lower_corner_end = area_outer->y2 - disp_area->y1 - corner_size;
if(lower_corner_end <= upper_corner_end) lower_corner_end = upper_corner_end + 1;
fill_area.y1 = disp_area->y1 + lower_corner_end;
fill_area.y2 = fill_area.y1;
for(h = lower_corner_end; h <= draw_area.y2; h++) {
_lv_memset_ff(mask_buf, draw_area_w);
mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w);
lv_area_t fill_area2;
fill_area2.x1 = area_outer->x1;
fill_area2.x2 = area_outer->x1 + rout - 1;
fill_area2.y1 = fill_area.y1;
fill_area2.y2 = fill_area.y2;
_lv_blend_fill(clip, &fill_area2, color, mask_buf, mask_res, opa, blend_mode);
/*Draw the bottom horizontal line*/
if(fill_area2.y2 > area_outer->y2 - border_width) {
fill_area2.x1 = area_outer->x1 + rout;
fill_area2.x2 = area_outer->x2 - rout;
_lv_blend_fill(clip, &fill_area2, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode);
}
fill_area2.x1 = area_outer->x2 - rout + 1;
fill_area2.x2 = area_outer->x2;
int32_t mask_ofs = (area_outer->x2 - rout + 1) - (vdb->area.x1 + draw_area.x1);
if(mask_ofs < 0) mask_ofs = 0;
_lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode);
fill_area.y1++;
fill_area.y2++;
}
/*Draw the left vertical part*/
fill_area.y1 = area_outer->y1 + corner_size + 1;
fill_area.y2 = area_outer->y2 - corner_size - 1;
fill_area.x1 = area_outer->x1;
fill_area.x2 = area_outer->x1 + border_width - 1;
_lv_blend_fill(clip, &fill_area, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode);
/*Draw the right vertical border*/
fill_area.x1 = area_outer->x2 - border_width + 1;
fill_area.x2 = area_outer->x2;
_lv_blend_fill(clip, &fill_area, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode);
}
/*Process line by line if there is other mask too*/
else {
fill_area.x1 = area_outer->x1;
fill_area.x2 = area_outer->x2;
fill_area.y1 = disp_area->y1 + draw_area.y1;
fill_area.y2 = fill_area.y1;
for(h = draw_area.y1; h <= draw_area.y2; h++) {
_lv_memset_ff(mask_buf, draw_area_w);
mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w);
_lv_blend_fill(clip, &fill_area, color, mask_buf, mask_res, opa, blend_mode);
fill_area.y1++;
fill_area.y2++;
}
}
lv_draw_mask_remove_id(mask_rin_id);
lv_draw_mask_remove_id(mask_rout_id);
_lv_mem_buf_release(mask_buf);
}

View File

@@ -41,6 +41,7 @@ typedef struct {
lv_style_int_t border_side;
lv_opa_t border_opa;
lv_blend_mode_t border_blend_mode;
uint8_t border_post : 1; /*There is a border it will be drawn later. */
/*Outline*/
lv_color_t outline_color;
@@ -92,9 +93,9 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc);
* Draw a rectangle
* @param coords the coordinates of the rectangle
* @param mask the rectangle will be drawn only in this mask
* @param style pointer to a style
* @param dsc pointer to an initialized `lv_draw_rect_dsc_t` variable
*/
void lv_draw_rect(const lv_area_t * coords, const lv_area_t * mask, lv_draw_rect_dsc_t * dsc);
void lv_draw_rect(const lv_area_t * coords, const lv_area_t * mask, const lv_draw_rect_dsc_t * dsc);
/**
* Draw a pixel

View File

@@ -40,7 +40,7 @@
* @param clip_area the triangle will be drawn only in this area
* @param draw_dsc pointer to an initialized `lv_draw_rect_dsc_t` variable
*/
void lv_draw_triangle(const lv_point_t points[], const lv_area_t * clip_area, lv_draw_rect_dsc_t * draw_dsc)
void lv_draw_triangle(const lv_point_t points[], const lv_area_t * clip_area, const lv_draw_rect_dsc_t * draw_dsc)
{
lv_draw_polygon(points, 3, clip_area, draw_dsc);
}
@@ -53,34 +53,58 @@ void lv_draw_triangle(const lv_point_t points[], const lv_area_t * clip_area, lv
* @param draw_dsc pointer to an initialized `lv_draw_rect_dsc_t` variable
*/
void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_area_t * clip_area,
lv_draw_rect_dsc_t * draw_dsc)
const lv_draw_rect_dsc_t * draw_dsc)
{
if(point_cnt < 3) return;
if(points == NULL) return;
int16_t i;
/*Join adjacent points if they are on the same coordinate*/
lv_point_t * p = _lv_mem_buf_get(point_cnt * sizeof(lv_point_t));
if(p == NULL) return;
uint16_t i;
uint16_t pcnt = 0;
p[0] = points[0];
for(i = 0; i < point_cnt - 1; i++) {
if(points[i].x != points[i + 1].x || points[i].y != points[i + 1].y) {
p[pcnt] = points[i];
pcnt++;
}
}
/*The first and the last points are also adjacent */
if(points[0].x != points[point_cnt - 1].x || points[0].y != points[point_cnt - 1].y) {
p[pcnt] = points[point_cnt - 1];
pcnt++;
}
point_cnt = pcnt;
if(point_cnt < 3) {
_lv_mem_buf_release(p);
return;
}
lv_area_t poly_coords = {.x1 = LV_COORD_MAX, .y1 = LV_COORD_MAX, .x2 = LV_COORD_MIN, .y2 = LV_COORD_MIN};
for(i = 0; i < point_cnt; i++) {
poly_coords.x1 = LV_MATH_MIN(poly_coords.x1, points[i].x);
poly_coords.y1 = LV_MATH_MIN(poly_coords.y1, points[i].y);
poly_coords.x2 = LV_MATH_MAX(poly_coords.x2, points[i].x);
poly_coords.y2 = LV_MATH_MAX(poly_coords.y2, points[i].y);
poly_coords.x1 = LV_MATH_MIN(poly_coords.x1, p[i].x);
poly_coords.y1 = LV_MATH_MIN(poly_coords.y1, p[i].y);
poly_coords.x2 = LV_MATH_MAX(poly_coords.x2, p[i].x);
poly_coords.y2 = LV_MATH_MAX(poly_coords.y2, p[i].y);
}
bool is_common;
lv_area_t poly_mask;
is_common = _lv_area_intersect(&poly_mask, &poly_coords, clip_area);
if(!is_common) return;
if(!is_common) {
_lv_mem_buf_release(p);
return;
}
/*Find the lowest point*/
lv_coord_t y_min = points[0].y;
lv_coord_t y_min = p[0].y;
int16_t y_min_i = 0;
for(i = 1; i < point_cnt; i++) {
if(points[i].y < y_min) {
y_min = points[i].y;
if(p[i].y < y_min) {
y_min = p[i].y;
y_min_i = i;
}
}
@@ -94,16 +118,27 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
int32_t i_next_right;
uint32_t mask_cnt = 0;
/* Check if the order of points is inverted or not.
* The normal case is when the left point is on `y_min_i - 1`*/
/*Get the index of the left and right points*/
i_next_left = y_min_i - 1;
if(i_next_left < 0) i_next_left = point_cnt + i_next_left;
i_next_right = y_min_i + 1;
if(i_next_right > point_cnt - 1) i_next_right = 0;
/* Check if the order of points is inverted or not.
* The normal case is when the left point is on `y_min_i - 1`
* Explanation:
* if angle(p_left) < angle(p_right) -> inverted
* dy_left/dx_left < dy_right/dx_right
* dy_left * dx_right < dy_right * dx_left
*/
lv_coord_t dxl = p[i_next_left].x - p[y_min_i].x;
lv_coord_t dxr = p[i_next_right].x - p[y_min_i].x;
lv_coord_t dyl = p[i_next_left].y - p[y_min_i].y;
lv_coord_t dyr = p[i_next_right].y - p[y_min_i].y;
bool inv = false;
if(points[i_next_left].x > points[i_next_right].x && points[i_next_left].y < points[i_next_right].y) inv = true;
if(dyl * dxr < dyr * dxl) inv = true;
do {
if(!inv) {
@@ -121,11 +156,11 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
if(i_next_right < 0) i_next_right = point_cnt + i_next_right;
}
if(points[i_next_left].y >= points[i_prev_left].y) {
if(points[i_next_left].y != points[i_prev_left].y &&
points[i_next_left].x != points[i_prev_left].x) {
lv_draw_mask_line_points_init(mp_next, points[i_prev_left].x, points[i_prev_left].y,
points[i_next_left].x, points[i_next_left].y,
if(p[i_next_left].y >= p[i_prev_left].y) {
if(p[i_next_left].y != p[i_prev_left].y &&
p[i_next_left].x != p[i_prev_left].x) {
lv_draw_mask_line_points_init(mp_next, p[i_prev_left].x, p[i_prev_left].y,
p[i_next_left].x, p[i_next_left].y,
LV_DRAW_MASK_LINE_SIDE_RIGHT);
lv_draw_mask_add(mp_next, mp);
mp_next++;
@@ -136,12 +171,12 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
if(mask_cnt == point_cnt) break;
if(points[i_next_right].y >= points[i_prev_right].y) {
if(points[i_next_right].y != points[i_prev_right].y &&
points[i_next_right].x != points[i_prev_right].x) {
if(p[i_next_right].y >= p[i_prev_right].y) {
if(p[i_next_right].y != p[i_prev_right].y &&
p[i_next_right].x != p[i_prev_right].x) {
lv_draw_mask_line_points_init(mp_next, points[i_prev_right].x, points[i_prev_right].y,
points[i_next_right].x, points[i_next_right].y,
lv_draw_mask_line_points_init(mp_next, p[i_prev_right].x, p[i_prev_right].y,
p[i_next_right].x, p[i_next_right].y,
LV_DRAW_MASK_LINE_SIDE_LEFT);
lv_draw_mask_add(mp_next, mp);
mp_next++;
@@ -157,6 +192,7 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
lv_draw_mask_remove_custom(mp);
_lv_mem_buf_release(mp);
_lv_mem_buf_release(p);
}

View File

@@ -33,7 +33,7 @@ extern "C" {
* @param clip_area the triangle will be drawn only in this area
* @param draw_dsc pointer to an initialized `lv_draw_rect_dsc_t` variable
*/
void lv_draw_triangle(const lv_point_t points[], const lv_area_t * clip, lv_draw_rect_dsc_t * draw_dsc);
void lv_draw_triangle(const lv_point_t points[], const lv_area_t * clip, const lv_draw_rect_dsc_t * draw_dsc);
/**
* Draw a polygon. Only convex polygons are supported.
@@ -43,7 +43,7 @@ void lv_draw_triangle(const lv_point_t points[], const lv_area_t * clip, lv_draw
* @param draw_dsc pointer to an initialized `lv_draw_rect_dsc_t` variable
*/
void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_area_t * mask,
lv_draw_rect_dsc_t * draw_dsc);
const lv_draw_rect_dsc_t * draw_dsc);
/**********************
* MACROS

View File

@@ -38,7 +38,6 @@
* GLOBAL FUNCTIONS
**********************/
/**
* Get the color of an image's pixel
* @param dsc an image descriptor
@@ -411,7 +410,6 @@ uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
}
}
#if LV_USE_IMG_TRANSFORM
/**
* Initialize a descriptor to transform an image
@@ -423,18 +421,22 @@ void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc)
dsc->tmp.pivot_y_256 = dsc->cfg.pivot_y * 256;
int32_t angle_low = dsc->cfg.angle / 10;
int32_t angle_hight = angle_low + 1;
int32_t angle_high = angle_low + 1;
int32_t angle_rem = dsc->cfg.angle - (angle_low * 10);
int32_t s1 = _lv_trigo_sin(-angle_low);
int32_t s2 = _lv_trigo_sin(-angle_hight);
int32_t s2 = _lv_trigo_sin(-angle_high);
int32_t c1 = _lv_trigo_sin(-angle_low + 90);
int32_t c2 = _lv_trigo_sin(-angle_hight + 90);
int32_t c2 = _lv_trigo_sin(-angle_high + 90);
dsc->tmp.sinma = (s1 * (10 - angle_rem) + s2 * angle_rem) / 10;
dsc->tmp.cosma = (c1 * (10 - angle_rem) + c2 * angle_rem) / 10;
/*Use smaller value to avoid overflow*/
dsc->tmp.sinma = dsc->tmp.sinma >> (LV_TRIGO_SHIFT - _LV_TRANSFORM_TRIGO_SHIFT);
dsc->tmp.cosma = dsc->tmp.cosma >> (LV_TRIGO_SHIFT - _LV_TRANSFORM_TRIGO_SHIFT);
dsc->tmp.chroma_keyed = lv_img_cf_is_chroma_keyed(dsc->cfg.cf) ? 1 : 0;
dsc->tmp.has_alpha = lv_img_cf_has_alpha(dsc->cfg.cf) ? 1 : 0;
if(dsc->cfg.cf == LV_IMG_CF_TRUE_COLOR || dsc->cfg.cf == LV_IMG_CF_TRUE_COLOR_ALPHA ||
@@ -451,7 +453,9 @@ void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc)
dsc->tmp.img_dsc.header.w = dsc->cfg.src_w;
dsc->tmp.img_dsc.header.h = dsc->cfg.src_h;
dsc->tmp.zoom_inv = (256 * 256) / dsc->cfg.zoom;
/* The inverse of the zoom will be sued during the transformation
* + dsc->cfg.zoom / 2 for rounding*/
dsc->tmp.zoom_inv = (((256 * 256) << _LV_ZOOM_INV_UPSCALE) + dsc->cfg.zoom / 2) / dsc->cfg.zoom;
dsc->res.opa = LV_OPA_COVER;
dsc->res.color = dsc->cfg.color;
@@ -468,7 +472,7 @@ void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc)
* @param pivot x,y pivot coordinates of rotation
*/
void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom,
lv_point_t * pivot)
const lv_point_t * pivot)
{
#if LV_USE_IMG_TRANSFORM
if(angle == 0 && zoom == LV_IMG_ZOOM_NONE) {
@@ -477,22 +481,38 @@ void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t
res->x2 = w - 1;
res->y2 = h - 1;
return;
}
res->x1 = (((-pivot->x) * zoom) >> 8) - 1;
res->y1 = (((-pivot->y) * zoom) >> 8) - 1;
res->x2 = (((w - pivot->x) * zoom) >> 8) + 2;
res->y2 = (((h - pivot->y) * zoom) >> 8) + 2;
if(angle == 0) {
res->x1 += pivot->x;
res->y1 += pivot->y;
res->x2 += pivot->x;
res->y2 += pivot->y;
return;
}
int32_t angle_low = angle / 10;
int32_t angle_hight = angle_low + 1;
int32_t angle_high = angle_low + 1;
int32_t angle_rem = angle - (angle_low * 10);
int32_t s1 = _lv_trigo_sin(angle_low);
int32_t s2 = _lv_trigo_sin(angle_hight);
int32_t s2 = _lv_trigo_sin(angle_high);
int32_t c1 = _lv_trigo_sin(angle_low + 90);
int32_t c2 = _lv_trigo_sin(angle_hight + 90);
int32_t c2 = _lv_trigo_sin(angle_high + 90);
int32_t sinma = (s1 * (10 - angle_rem) + s2 * angle_rem) / 10;
int32_t cosma = (c1 * (10 - angle_rem) + c2 * angle_rem) / 10;
/*Use smaller value to avoid overflow*/
sinma = sinma >> (LV_TRIGO_SHIFT - _LV_TRANSFORM_TRIGO_SHIFT);
cosma = cosma >> (LV_TRIGO_SHIFT - _LV_TRANSFORM_TRIGO_SHIFT);
lv_point_t lt;
lv_point_t rt;
lv_point_t lb;
@@ -501,31 +521,25 @@ void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t
lv_coord_t xt;
lv_coord_t yt;
lv_area_t a;
a.x1 = ((-pivot->x) * zoom) >> 8;
a.y1 = ((-pivot->y) * zoom) >> 8;
a.x2 = ((w - pivot->x) * zoom) >> 8;
a.y2 = ((h - pivot->y) * zoom) >> 8;
xt = res->x1;
yt = res->y1;
lt.x = ((cosma * xt - sinma * yt) >> _LV_TRANSFORM_TRIGO_SHIFT) + pivot->x;
lt.y = ((sinma * xt + cosma * yt) >> _LV_TRANSFORM_TRIGO_SHIFT) + pivot->y;
xt = a.x1;
yt = a.y1;
lt.x = ((cosma * xt - sinma * yt) >> LV_TRIGO_SHIFT) + pivot->x;
lt.y = ((sinma * xt + cosma * yt) >> LV_TRIGO_SHIFT) + pivot->y;
xt = res->x2;
yt = res->y1;
rt.x = ((cosma * xt - sinma * yt) >> _LV_TRANSFORM_TRIGO_SHIFT) + pivot->x;
rt.y = ((sinma * xt + cosma * yt) >> _LV_TRANSFORM_TRIGO_SHIFT) + pivot->y;
xt = a.x2;
yt = a.y1;
rt.x = ((cosma * xt - sinma * yt) >> LV_TRIGO_SHIFT) + pivot->x;
rt.y = ((sinma * xt + cosma * yt) >> LV_TRIGO_SHIFT) + pivot->y;
xt = res->x1;
yt = res->y2;
lb.x = ((cosma * xt - sinma * yt) >> _LV_TRANSFORM_TRIGO_SHIFT) + pivot->x;
lb.y = ((sinma * xt + cosma * yt) >> _LV_TRANSFORM_TRIGO_SHIFT) + pivot->y;
xt = a.x1;
yt = a.y2;
lb.x = ((cosma * xt - sinma * yt) >> LV_TRIGO_SHIFT) + pivot->x;
lb.y = ((sinma * xt + cosma * yt) >> LV_TRIGO_SHIFT) + pivot->y;
xt = a.x2;
yt = a.y2;
rb.x = ((cosma * xt - sinma * yt) >> LV_TRIGO_SHIFT) + pivot->x;
rb.y = ((sinma * xt + cosma * yt) >> LV_TRIGO_SHIFT) + pivot->y;
xt = res->x2;
yt = res->y2;
rb.x = ((cosma * xt - sinma * yt) >> _LV_TRANSFORM_TRIGO_SHIFT) + pivot->x;
rb.y = ((sinma * xt + cosma * yt) >> _LV_TRANSFORM_TRIGO_SHIFT) + pivot->y;
res->x1 = LV_MATH_MIN4(lb.x, lt.x, rb.x, rt.x);
res->x2 = LV_MATH_MAX4(lb.x, lt.x, rb.x, rt.x);
@@ -666,4 +680,3 @@ bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc)
/**********************
* STATIC FUNCTIONS
**********************/

View File

@@ -17,7 +17,6 @@ extern "C" {
#include "../lv_misc/lv_color.h"
#include "../lv_misc/lv_area.h"
/*********************
* DEFINES
*********************/
@@ -48,6 +47,9 @@ extern "C" {
#define LV_IMG_ZOOM_NONE 256
#define _LV_TRANSFORM_TRIGO_SHIFT 10
#define _LV_ZOOM_INV_UPSCALE 5
/**********************
* TYPEDEFS
**********************/
@@ -98,7 +100,6 @@ enum {
};
typedef uint8_t lv_img_cf_t;
/**
* LVGL image header
*/
@@ -110,14 +111,13 @@ typedef uint8_t lv_img_cf_t;
#if LV_BIG_ENDIAN_SYSTEM
typedef struct {
uint32_t h : 11; /*Height of the image map*/
uint32_t h : 11; /*Height of the image map*/
uint32_t w : 11; /*Width of the image map*/
uint32_t reserved : 2; /*Reserved to be used later*/
uint32_t always_zero : 3; /*It the upper bits of the first byte. Always zero to look like a
non-printable character*/
uint32_t cf : 5; /* Color format: See `lv_img_color_format_t`*/
} lv_img_header_t;
#else
typedef struct {
@@ -129,7 +129,7 @@ typedef struct {
uint32_t reserved : 2; /*Reserved to be used later*/
uint32_t w : 11; /*Width of the image map*/
uint32_t h : 11; /*Height of the image map*/
uint32_t h : 11; /*Height of the image map*/
} lv_img_header_t;
#endif
@@ -160,7 +160,6 @@ typedef struct {
lv_opa_t opa;
} res;
struct {
lv_img_dsc_t img_dsc;
int32_t pivot_x_256;
@@ -172,7 +171,7 @@ typedef struct {
uint8_t has_alpha : 1;
uint8_t native_color : 1;
uint16_t zoom_inv;
uint32_t zoom_inv;
/*Runtime data*/
lv_coord_t xs;
@@ -266,7 +265,6 @@ void lv_img_buf_free(lv_img_dsc_t * dsc);
*/
uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf);
#if LV_USE_IMG_TRANSFORM
/**
* Initialize a descriptor to rotate an image
@@ -280,7 +278,6 @@ void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc);
*/
bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc);
/**
* Get which color and opa would come to a pixel if it were rotated
* @param dsc a descriptor initialized by `lv_img_buf_rotate_init`
@@ -301,20 +298,20 @@ static inline bool _lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_
int32_t ys;
if(dsc->cfg.zoom == LV_IMG_ZOOM_NONE) {
/*Get the source pixel from the upscaled image*/
xs = ((dsc->tmp.cosma * xt - dsc->tmp.sinma * yt) >> (LV_TRIGO_SHIFT - 8)) + dsc->tmp.pivot_x_256;
ys = ((dsc->tmp.sinma * xt + dsc->tmp.cosma * yt) >> (LV_TRIGO_SHIFT - 8)) + dsc->tmp.pivot_y_256;
xs = ((dsc->tmp.cosma * xt - dsc->tmp.sinma * yt) >> (_LV_TRANSFORM_TRIGO_SHIFT - 8)) + dsc->tmp.pivot_x_256;
ys = ((dsc->tmp.sinma * xt + dsc->tmp.cosma * yt) >> (_LV_TRANSFORM_TRIGO_SHIFT - 8)) + dsc->tmp.pivot_y_256;
}
else if(dsc->cfg.angle == 0) {
xt *= dsc->tmp.zoom_inv;
yt *= dsc->tmp.zoom_inv;
xt = (int32_t)((int32_t)xt * dsc->tmp.zoom_inv) >> _LV_ZOOM_INV_UPSCALE;
yt = (int32_t)((int32_t)yt * dsc->tmp.zoom_inv) >> _LV_ZOOM_INV_UPSCALE;
xs = xt + dsc->tmp.pivot_x_256;
ys = yt + dsc->tmp.pivot_y_256;
}
else {
xt *= dsc->tmp.zoom_inv;
yt *= dsc->tmp.zoom_inv;
xs = ((dsc->tmp.cosma * xt - dsc->tmp.sinma * yt) >> (LV_TRIGO_SHIFT)) + dsc->tmp.pivot_x_256;
ys = ((dsc->tmp.sinma * xt + dsc->tmp.cosma * yt) >> (LV_TRIGO_SHIFT)) + dsc->tmp.pivot_y_256;
xt = (int32_t)((int32_t)xt * dsc->tmp.zoom_inv) >> _LV_ZOOM_INV_UPSCALE;
yt = (int32_t)((int32_t)yt * dsc->tmp.zoom_inv) >> _LV_ZOOM_INV_UPSCALE;
xs = ((dsc->tmp.cosma * xt - dsc->tmp.sinma * yt) >> (_LV_TRANSFORM_TRIGO_SHIFT)) + dsc->tmp.pivot_x_256;
ys = ((dsc->tmp.sinma * xt + dsc->tmp.cosma * yt) >> (_LV_TRANSFORM_TRIGO_SHIFT)) + dsc->tmp.pivot_y_256;
}
/*Get the integer part of the source pixel*/
@@ -380,7 +377,7 @@ static inline bool _lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_
* @param pivot x,y pivot coordinates of rotation
*/
void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom,
lv_point_t * pivot);
const lv_point_t * pivot);
/**********************
* MACROS

View File

@@ -13,13 +13,10 @@
#include "../lv_hal/lv_hal_tick.h"
#include "../lv_misc/lv_gc.h"
#if defined(LV_GC_INCLUDE)
#include LV_GC_INCLUDE
#endif /* LV_ENABLE_GC */
/*********************
* DEFINES
*********************/
/*Decrement life with this value in every open*/
/*Decrement life with this value on every open*/
#define LV_IMG_CACHE_AGING 1
/*Boost life by this factor (multiply time_to_open with this value)*/
@@ -29,10 +26,6 @@
* "die" from very high values */
#define LV_IMG_CACHE_LIFE_LIMIT 1000
#if LV_IMG_CACHE_DEF_SIZE < 1
#error "LV_IMG_CACHE_DEF_SIZE must be >= 1. See lv_conf.h"
#endif
/**********************
* TYPEDEFS
**********************/
@@ -40,11 +33,16 @@
/**********************
* STATIC PROTOTYPES
**********************/
#if LV_IMG_CACHE_DEF_SIZE == 0
static lv_img_cache_entry_t cache_temp;
#endif
/**********************
* STATIC VARIABLES
**********************/
static uint16_t entry_cnt;
#if LV_IMG_CACHE_DEF_SIZE
static uint16_t entry_cnt;
#endif
/**********************
* MACROS
@@ -59,11 +57,15 @@ static uint16_t entry_cnt;
* The image will be left open meaning if the image decoder open callback allocated memory then it will remain.
* The image is closed if a new image is opened and the new image takes its place in the cache.
* @param src source of the image. Path to file or pointer to an `lv_img_dsc_t` variable
* @param style style of the image
* @param color color The color of the image with `LV_IMG_CF_ALPHA_...`
* @return pointer to the cache entry or NULL if can open the image
*/
lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color)
{
/*Is the image cached?*/
lv_img_cache_entry_t * cached_src = NULL;
#if LV_IMG_CACHE_DEF_SIZE
if(entry_cnt == 0) {
LV_LOG_WARN("lv_img_cache_open: the cache size is 0");
return NULL;
@@ -79,8 +81,6 @@ lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color)
}
}
/*Is the image cached?*/
lv_img_cache_entry_t * cached_src = NULL;
for(i = 0; i < entry_cnt; i++) {
bool match = false;
lv_img_src_t src_type = lv_img_src_get_type(cache[i].dec_dsc.src);
@@ -104,48 +104,51 @@ lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color)
}
/*The image is not cached then cache it now*/
if(cached_src == NULL) {
/*Find an entry to reuse. Select the entry with the least life*/
cached_src = &cache[0];
for(i = 1; i < entry_cnt; i++) {
if(cache[i].life < cached_src->life) {
cached_src = &cache[i];
}
}
if(cached_src) return cached_src;
/*Close the decoder to reuse if it was opened (has a valid source)*/
if(cached_src->dec_dsc.src) {
lv_img_decoder_close(&cached_src->dec_dsc);
LV_LOG_INFO("image draw: cache miss, close and reuse an entry");
/*Find an entry to reuse. Select the entry with the least life*/
cached_src = &cache[0];
for(i = 1; i < entry_cnt; i++) {
if(cache[i].life < cached_src->life) {
cached_src = &cache[i];
}
else {
LV_LOG_INFO("image draw: cache miss, cached to an empty entry");
}
/*Open the image and measure the time to open*/
uint32_t t_start;
t_start = lv_tick_get();
cached_src->dec_dsc.time_to_open = 0;
lv_res_t open_res = lv_img_decoder_open(&cached_src->dec_dsc, src, color);
if(open_res == LV_RES_INV) {
LV_LOG_WARN("Image draw cannot open the image resource");
lv_img_decoder_close(&cached_src->dec_dsc);
_lv_memset_00(&cached_src->dec_dsc, sizeof(lv_img_decoder_dsc_t));
_lv_memset_00(cached_src, sizeof(lv_img_cache_entry_t));
cached_src->life = INT32_MIN; /*Make the empty entry very "weak" to force its use */
return NULL;
}
cached_src->life = 0;
/*If `time_to_open` was not set in the open function set it here*/
if(cached_src->dec_dsc.time_to_open == 0) {
cached_src->dec_dsc.time_to_open = lv_tick_elaps(t_start);
}
if(cached_src->dec_dsc.time_to_open == 0) cached_src->dec_dsc.time_to_open = 1;
}
/*Close the decoder to reuse if it was opened (has a valid source)*/
if(cached_src->dec_dsc.src) {
lv_img_decoder_close(&cached_src->dec_dsc);
LV_LOG_INFO("image draw: cache miss, close and reuse an entry");
}
else {
LV_LOG_INFO("image draw: cache miss, cached to an empty entry");
}
#else
cached_src = &cache_temp;
#endif
/*Open the image and measure the time to open*/
uint32_t t_start;
t_start = lv_tick_get();
cached_src->dec_dsc.time_to_open = 0;
lv_res_t open_res = lv_img_decoder_open(&cached_src->dec_dsc, src, color);
if(open_res == LV_RES_INV) {
LV_LOG_WARN("Image draw cannot open the image resource");
lv_img_decoder_close(&cached_src->dec_dsc);
_lv_memset_00(&cached_src->dec_dsc, sizeof(lv_img_decoder_dsc_t));
_lv_memset_00(cached_src, sizeof(lv_img_cache_entry_t));
cached_src->life = INT32_MIN; /*Make the empty entry very "weak" to force its use */
return NULL;
}
cached_src->life = 0;
/*If `time_to_open` was not set in the open function set it here*/
if(cached_src->dec_dsc.time_to_open == 0) {
cached_src->dec_dsc.time_to_open = lv_tick_elaps(t_start);
}
if(cached_src->dec_dsc.time_to_open == 0) cached_src->dec_dsc.time_to_open = 1;
return cached_src;
}
@@ -157,6 +160,10 @@ lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color)
*/
void lv_img_cache_set_size(uint16_t new_entry_cnt)
{
#if LV_IMG_CACHE_DEF_SIZE == 0
LV_UNUSED(new_entry_cnt);
LV_LOG_WARN("Can't change cache size because it's disabled by LV_IMG_CACHE_DEF_SIZE = 0");
#else
if(LV_GC_ROOT(_lv_img_cache_array) != NULL) {
/*Clean the cache before free it*/
lv_img_cache_invalidate_src(NULL);
@@ -178,6 +185,7 @@ void lv_img_cache_set_size(uint16_t new_entry_cnt)
_lv_memset_00(&LV_GC_ROOT(_lv_img_cache_array)[i].dec_dsc, sizeof(lv_img_decoder_dsc_t));
_lv_memset_00(&LV_GC_ROOT(_lv_img_cache_array)[i], sizeof(lv_img_cache_entry_t));
}
#endif
}
/**
@@ -187,7 +195,7 @@ void lv_img_cache_set_size(uint16_t new_entry_cnt)
*/
void lv_img_cache_invalidate_src(const void * src)
{
#if LV_IMG_CACHE_DEF_SIZE
lv_img_cache_entry_t * cache = LV_GC_ROOT(_lv_img_cache_array);
uint16_t i;
@@ -201,6 +209,7 @@ void lv_img_cache_invalidate_src(const void * src)
_lv_memset_00(&cache[i], sizeof(lv_img_cache_entry_t));
}
}
#endif
}
/**********************

View File

@@ -46,7 +46,7 @@ typedef struct {
* The image will be left open meaning if the image decoder open callback allocated memory then it will remain.
* The image is closed if a new image is opened and the new image takes its place in the cache.
* @param src source of the image. Path to file or pointer to an `lv_img_dsc_t` variable
* @param style style of the image
* @param color The color of the image with `LV_IMG_CF_ALPHA_...`
* @return pointer to the cache entry or NULL if can open the image
*/
lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color);

View File

@@ -13,10 +13,6 @@
#include "../lv_misc/lv_color.h"
#include "../lv_misc/lv_gc.h"
#if defined(LV_GC_INCLUDE)
#include LV_GC_INCLUDE
#endif /* LV_ENABLE_GC */
/*********************
* DEFINES
*********************/
@@ -89,6 +85,9 @@ void _lv_img_decoder_init(void)
lv_res_t lv_img_decoder_get_info(const char * src, lv_img_header_t * header)
{
header->always_zero = 0;
header->h = 0;
header->w = 0;
header->cf = LV_IMG_CF_UNKNOWN;
lv_res_t res = LV_RES_INV;
lv_img_decoder_t * d;
@@ -111,7 +110,7 @@ lv_res_t lv_img_decoder_get_info(const char * src, lv_img_header_t * header)
* 1) File name: E.g. "S:folder/img1.png" (The drivers needs to registered via `lv_fs_add_drv()`)
* 2) Variable: Pointer to an `lv_img_dsc_t` variable
* 3) Symbol: E.g. `LV_SYMBOL_OK`
* @param style the style of the image
* @param color The color of the image with `LV_IMG_CF_ALPHA_...`
* @return LV_RES_OK: opened the image. `dsc->img_data` and `dsc->header` are set.
* LV_RES_INV: none of the registered image decoders were able to open the image.
*/
@@ -150,10 +149,6 @@ lv_res_t lv_img_decoder_open(lv_img_decoder_dsc_t * dsc, const void * src, lv_co
if(res == LV_RES_OK) break;
}
if(res == LV_RES_INV) {
_lv_memset_00(dsc, sizeof(lv_img_decoder_dsc_t));
}
return res;
}
@@ -433,7 +428,6 @@ lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder
/*The palette begins in the beginning of the image data. Just point to it.*/
lv_color32_t * palette_p = (lv_color32_t *)((lv_img_dsc_t *)dsc->src)->data;
uint32_t i;
for(i = 0; i < palette_size; i++) {
user_data->palette[i] = lv_color_make(palette_p[i].ch.red, palette_p[i].ch.green, palette_p[i].ch.blue);
@@ -538,7 +532,6 @@ void lv_img_decoder_built_in_close(lv_img_decoder_t * decoder, lv_img_decoder_ds
}
}
/**********************
* STATIC FUNCTIONS
**********************/
@@ -560,7 +553,7 @@ static lv_res_t lv_img_decoder_built_in_line_true_color(lv_img_decoder_dsc_t * d
}
uint32_t btr = len * (px_size >> 3);
uint32_t br = 0;
lv_fs_read(user_data->f, buf, btr, &br);
res = lv_fs_read(user_data->f, buf, btr, &br);
if(res != LV_FS_RES_OK || btr != br) {
LV_LOG_WARN("Built-in image decoder read failed");
return LV_RES_INV;

View File

@@ -3,8 +3,8 @@
*
*/
#ifndef LV_IMG_DEOCER_H
#define LV_IMG_DEOCER_H
#ifndef LV_IMG_DECODER_H
#define LV_IMG_DECODER_H
#ifdef __cplusplus
extern "C" {
@@ -157,7 +157,7 @@ lv_res_t lv_img_decoder_get_info(const char * src, lv_img_header_t * header);
* 1) File name: E.g. "S:folder/img1.png" (The drivers needs to registered via `lv_fs_add_drv()`)
* 2) Variable: Pointer to an `lv_img_dsc_t` variable
* 3) Symbol: E.g. `LV_SYMBOL_OK`
* @param style the style of the image
* @param color The color of the image with `LV_IMG_CF_ALPHA_...`
* @return LV_RES_OK: opened the image. `dsc->img_data` and `dsc->header` are set.
* LV_RES_INV: none of the registered image decoders were able to open the image.
*/
@@ -267,4 +267,4 @@ void lv_img_decoder_built_in_close(lv_img_decoder_t * decoder, lv_img_decoder_ds
} /* extern "C" */
#endif
#endif /*LV_TEMPL_H*/
#endif /*LV_IMG_DECODER_H*/

View File

@@ -43,7 +43,7 @@
* Return with the bitmap of a font.
* @param font_p pointer to a font
* @param letter an UNICODE character code
* @return pointer to the bitmap of the letter
* @return pointer to the bitmap of the letter
*/
const uint8_t * lv_font_get_glyph_bitmap(const lv_font_t * font_p, uint32_t letter)
{

View File

@@ -24,11 +24,6 @@ extern "C" {
/*********************
* DEFINES
*********************/
/*Number of fractional digits in the advanced width (`adv_w`) field of `lv_font_glyph_dsc_t`*/
#define LV_FONT_WIDTH_FRACT_DIGIT 4
#define LV_FONT_KERN_POSITIVE 0
#define LV_FONT_KERN_NEGATIVE 1
/**********************
* TYPEDEFS
@@ -48,7 +43,6 @@ typedef struct {
uint8_t bpp; /**< Bit-per-pixel: 1, 2, 4, 8*/
} lv_font_glyph_dsc_t;
/** The bitmaps might be upscaled by 3 to achieve subpixel rendering. */
enum {
LV_FONT_SUBPX_NONE,
@@ -61,7 +55,7 @@ typedef uint8_t lv_font_subpx_t;
/** Describe the properties of a font*/
typedef struct _lv_font_struct {
/** Get a glyph's descriptor from a font*/
/** Get a glyph's descriptor from a font*/
bool (*get_glyph_dsc)(const struct _lv_font_struct *, lv_font_glyph_dsc_t *, uint32_t letter, uint32_t letter_next);
/** Get a glyph's bitmap from a font*/
@@ -71,12 +65,15 @@ typedef struct _lv_font_struct {
lv_coord_t line_height; /**< The real line height where any text fits*/
lv_coord_t base_line; /**< Base line measured from the top of the line_height*/
uint8_t subpx : 2; /**< An element of `lv_font_subpx_t`*/
int8_t underline_position; /**< Distance between the top of the underline and base line (< 0 means below the base line)*/
int8_t underline_thickness; /**< Thickness of the underline*/
void * dsc; /**< Store implementation specific or run_time data or caching here*/
#if LV_USE_USER_DATA
lv_font_user_data_t user_data; /**< Custom user data for font. */
#endif
} lv_font_t;
/**********************
@@ -87,7 +84,7 @@ typedef struct _lv_font_struct {
* Return with the bitmap of a font.
* @param font_p pointer to a font
* @param letter an UNICODE character code
* @return pointer to the bitmap of the letter
* @return pointer to the bitmap of the letter
*/
const uint8_t * lv_font_get_glyph_bitmap(const lv_font_t * font_p, uint32_t letter);
@@ -127,6 +124,14 @@ static inline lv_coord_t lv_font_get_line_height(const lv_font_t * font_p)
#define LV_FONT_DECLARE(font_name) extern lv_font_t font_name;
#if LV_FONT_MONTSERRAT_8
LV_FONT_DECLARE(lv_font_montserrat_8)
#endif
#if LV_FONT_MONTSERRAT_10
LV_FONT_DECLARE(lv_font_montserrat_10)
#endif
#if LV_FONT_MONTSERRAT_12
LV_FONT_DECLARE(lv_font_montserrat_12)
#endif
@@ -215,6 +220,10 @@ LV_FONT_DECLARE(lv_font_montserrat_12_subpx)
LV_FONT_DECLARE(lv_font_unscii_8)
#endif
#if LV_FONT_UNSCII_16
LV_FONT_DECLARE(lv_font_unscii_16)
#endif
#if LV_FONT_DEJAVU_16_PERSIAN_HEBREW
LV_FONT_DECLARE(lv_font_dejavu_16_persian_hebrew)
#endif

View File

@@ -1,5 +1,8 @@
CSRCS += lv_font.c
CSRCS += lv_font_fmt_txt.c
CSRCS += lv_font_loader.c
CSRCS += lv_font_montserrat_8.c
CSRCS += lv_font_montserrat_10.c
CSRCS += lv_font_montserrat_12.c
CSRCS += lv_font_montserrat_14.c
CSRCS += lv_font_montserrat_16.c

View File

@@ -5818,7 +5818,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
@@ -6508,8 +6507,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
}
};
/*--------------------
* ALL CUSTOM DATA
*--------------------*/
@@ -6527,7 +6524,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
.bitmap_format = 0
};
/*-----------------
* PUBLIC FONT
*----------------*/
@@ -6540,9 +6536,12 @@ lv_font_t lv_font_dejavu_16_persian_hebrew = {
.base_line = 7, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
.underline_position = -1,
.underline_thickness = 1,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if LV_FONT_DEJAVU_16_PERSIAN_HEBREW*/

View File

@@ -11,6 +11,7 @@
#include "../lv_misc/lv_debug.h"
#include "../lv_draw/lv_draw.h"
#include "../lv_misc/lv_types.h"
#include "../lv_misc/lv_gc.h"
#include "../lv_misc/lv_log.h"
#include "../lv_misc/lv_utils.h"
#include "../lv_misc/lv_mem.h"
@@ -37,24 +38,26 @@ static int32_t unicode_list_compare(const void * ref, const void * element);
static int32_t kern_pair_8_compare(const void * ref, const void * element);
static int32_t kern_pair_16_compare(const void * ref, const void * element);
static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord_t h, uint8_t bpp);
static inline void decompress_line(uint8_t * out, lv_coord_t w);
static inline uint8_t get_bits(const uint8_t * in, uint32_t bit_pos, uint8_t len);
static inline void bits_write(uint8_t * out, uint32_t bit_pos, uint8_t val, uint8_t len);
static inline void rle_init(const uint8_t * in, uint8_t bpp);
static inline uint8_t rle_next(void);
#if LV_USE_FONT_COMPRESSED
static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord_t h, uint8_t bpp, bool prefilter);
static inline void decompress_line(uint8_t * out, lv_coord_t w);
static inline uint8_t get_bits(const uint8_t * in, uint32_t bit_pos, uint8_t len);
static inline void bits_write(uint8_t * out, uint32_t bit_pos, uint8_t val, uint8_t len);
static inline void rle_init(const uint8_t * in, uint8_t bpp);
static inline uint8_t rle_next(void);
#endif /* LV_USE_FONT_COMPRESSED */
/**********************
* STATIC VARIABLES
**********************/
static uint8_t * decompr_buf;
static uint32_t rle_rdp;
static const uint8_t * rle_in;
static uint8_t rle_bpp;
static uint8_t rle_prev_v;
static uint8_t rle_cnt;
static rle_state_t rle_state;
#if LV_USE_FONT_COMPRESSED
static uint32_t rle_rdp;
static const uint8_t * rle_in;
static uint8_t rle_bpp;
static uint8_t rle_prev_v;
static uint8_t rle_cnt;
static rle_state_t rle_state;
#endif /* LV_USE_FONT_COMPRESSED */
/**********************
* GLOBAL PROTOTYPES
@@ -89,6 +92,7 @@ const uint8_t * lv_font_get_bitmap_fmt_txt(const lv_font_t * font, uint32_t unic
}
/*Handle compressed bitmap*/
else {
#if LV_USE_FONT_COMPRESSED
uint32_t gsize = gdsc->box_w * gdsc->box_h;
if(gsize == 0) return NULL;
@@ -109,14 +113,20 @@ const uint8_t * lv_font_get_bitmap_fmt_txt(const lv_font_t * font, uint32_t unic
break;
}
if(_lv_mem_get_size(decompr_buf) < buf_size) {
decompr_buf = lv_mem_realloc(decompr_buf, buf_size);
LV_ASSERT_MEM(decompr_buf);
if(decompr_buf == NULL) return NULL;
if(_lv_mem_get_size(LV_GC_ROOT(_lv_font_decompr_buf)) < buf_size) {
LV_GC_ROOT(_lv_font_decompr_buf) = lv_mem_realloc(LV_GC_ROOT(_lv_font_decompr_buf), buf_size);
LV_ASSERT_MEM(LV_GC_ROOT(_lv_font_decompr_buf));
if(LV_GC_ROOT(_lv_font_decompr_buf) == NULL) return NULL;
}
decompress(&fdsc->glyph_bitmap[gdsc->bitmap_index], decompr_buf, gdsc->box_w, gdsc->box_h, (uint8_t)fdsc->bpp);
return decompr_buf;
bool prefilter = fdsc->bitmap_format == LV_FONT_FMT_TXT_COMPRESSED ? true : false;
decompress(&fdsc->glyph_bitmap[gdsc->bitmap_index], LV_GC_ROOT(_lv_font_decompr_buf), gdsc->box_w, gdsc->box_h,
(uint8_t)fdsc->bpp,
prefilter);
return LV_GC_ROOT(_lv_font_decompr_buf);
#else /* !LV_USE_FONT_COMPRESSED */
return NULL;
#endif
}
/*If not returned earlier then the letter is not found in this font*/
@@ -179,13 +189,12 @@ bool lv_font_get_glyph_dsc_fmt_txt(const lv_font_t * font, lv_font_glyph_dsc_t *
*/
void _lv_font_clean_up_fmt_txt(void)
{
if(decompr_buf) {
lv_mem_free(decompr_buf);
decompr_buf = NULL;
if(LV_GC_ROOT(_lv_font_decompr_buf)) {
lv_mem_free(LV_GC_ROOT(_lv_font_decompr_buf));
LV_GC_ROOT(_lv_font_decompr_buf) = NULL;
}
}
/**********************
* STATIC FUNCTIONS
**********************/
@@ -328,14 +337,16 @@ static int32_t kern_pair_16_compare(const void * ref, const void * element)
else return (int32_t) ref16_p[1] - element16_p[1];
}
#if LV_USE_FONT_COMPRESSED
/**
* The compress a glyph's bitmap
* @param in the compressed bitmap
* @param out buffer to store the result
* @param px_num number of pixels in the glyph (width * height)
* @param bpp bit per pixel (bpp = 3 will be converted to bpp = 4)
* @param prefilter true: the lines are XORed
*/
static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord_t h, uint8_t bpp)
static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord_t h, uint8_t bpp, bool prefilter)
{
uint32_t wrp = 0;
uint8_t wr_size = bpp;
@@ -344,7 +355,12 @@ static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord
rle_init(in, bpp);
uint8_t * line_buf1 = _lv_mem_buf_get(w);
uint8_t * line_buf2 = _lv_mem_buf_get(w);
uint8_t * line_buf2 = NULL;
if(prefilter) {
line_buf2 = _lv_mem_buf_get(w);
}
decompress_line(line_buf1, w);
@@ -357,12 +373,22 @@ static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord
}
for(y = 1; y < h; y++) {
decompress_line(line_buf2, w);
if(prefilter) {
decompress_line(line_buf2, w);
for(x = 0; x < w; x++) {
line_buf1[x] = line_buf2[x] ^ line_buf1[x];
bits_write(out, wrp, line_buf1[x], bpp);
wrp += wr_size;
for(x = 0; x < w; x++) {
line_buf1[x] = line_buf2[x] ^ line_buf1[x];
bits_write(out, wrp, line_buf1[x], bpp);
wrp += wr_size;
}
}
else {
decompress_line(line_buf1, w);
for(x = 0; x < w; x++) {
bits_write(out, wrp, line_buf1[x], bpp);
wrp += wr_size;
}
}
}
@@ -526,7 +552,6 @@ static inline uint8_t rle_next(void)
rle_state = RLE_STATE_SINGLE;
}
}
else if(rle_state == RLE_STATE_COUNTER) {
ret = rle_prev_v;
@@ -541,6 +566,7 @@ static inline uint8_t rle_next(void)
return ret;
}
#endif /* LV_USE_FONT_COMPRESSED */
/** Code Comparator.
*

View File

@@ -45,7 +45,6 @@ typedef struct {
#endif
} lv_font_fmt_txt_glyph_dsc_t;
/** Format of font character map. */
enum {
LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY,
@@ -56,7 +55,6 @@ enum {
typedef uint8_t lv_font_fmt_txt_cmap_type_t;
/* Map codepoints to a `glyph_dsc`s
* Several formats are supported to optimize memory usage
* See https://github.com/lvgl/lv_font_conv/blob/master/doc/font_spec.md
@@ -117,7 +115,7 @@ typedef struct {
typedef struct {
/*To get a kern value of two code points:
1. Get the `glyph_id_left` and `glyph_id_right` from `lv_font_fmt_txt_cmap_t
2 for(i = 0; i < pair_cnt * 2; i+2)
2. for(i = 0; i < pair_cnt * 2; i+2)
if(gylph_ids[i] == glyph_id_left &&
gylph_ids[i+1] == glyph_id_right)
return values[i / 2];
@@ -132,7 +130,7 @@ typedef struct {
typedef struct {
/*To get a kern value of two code points:
1. Get the `glyph_id_left` and `glyph_id_right` from `lv_font_fmt_txt_cmap_t
2 Get the class of the left and right glyphs as `left_class` and `right_class`
2. Get the class of the left and right glyphs as `left_class` and `right_class`
left_class = left_class_mapping[glyph_id_left];
right_class = right_class_mapping[glyph_id_right];
3. value = class_pair_values[(left_class-1)*right_class_cnt + (right_class-1)]
@@ -145,14 +143,13 @@ typedef struct {
uint8_t right_class_cnt;
} lv_font_fmt_txt_kern_classes_t;
/** Bitmap formats*/
typedef enum {
LV_FONT_FMT_TXT_PLAIN = 0,
LV_FONT_FMT_TXT_COMPRESSED = 1,
LV_FONT_FMT_TXT_COMPRESSED_NO_PREFILTER = 1,
} lv_font_fmt_txt_bitmap_format_t;
/*Describe store additional data for fonts */
typedef struct {
/*The bitmaps of all glyphs*/

View File

@@ -0,0 +1,688 @@
/**
* @file lv_font_loader.c
*
*/
/*********************
* INCLUDES
*********************/
#include <stdint.h>
#include <stdbool.h>
#include "../lvgl.h"
#include "../lv_misc/lv_fs.h"
#include "lv_font_loader.h"
#if LV_USE_FILESYSTEM
/**********************
* TYPEDEFS
**********************/
typedef struct {
lv_fs_file_t * fp;
int8_t bit_pos;
uint8_t byte_value;
} bit_iterator_t;
typedef struct font_header_bin {
uint32_t version;
uint16_t tables_count;
uint16_t font_size;
uint16_t ascent;
int16_t descent;
uint16_t typo_ascent;
int16_t typo_descent;
uint16_t typo_line_gap;
int16_t min_y;
int16_t max_y;
uint16_t default_advance_width;
uint16_t kerning_scale;
uint8_t index_to_loc_format;
uint8_t glyph_id_format;
uint8_t advance_width_format;
uint8_t bits_per_pixel;
uint8_t xy_bits;
uint8_t wh_bits;
uint8_t advance_width_bits;
uint8_t compression_id;
uint8_t subpixels_mode;
uint8_t padding;
} font_header_bin_t;
typedef struct cmap_table_bin {
uint32_t data_offset;
uint32_t range_start;
uint16_t range_length;
uint16_t glyph_id_start;
uint16_t data_entries_count;
uint8_t format_type;
uint8_t padding;
} cmap_table_bin_t;
/**********************
* STATIC PROTOTYPES
**********************/
static bit_iterator_t init_bit_iterator(lv_fs_file_t * fp);
static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font);
int32_t load_kern(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint8_t format, uint32_t start);
static int read_bits_signed(bit_iterator_t * it, int n_bits, lv_fs_res_t * res);
static int read_bits(bit_iterator_t * it, int n_bits, lv_fs_res_t * res);
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Loads a `lv_font_t` object from a binary font file
* @param font_name filename where the font file is located
* @return a pointer to the font or NULL in case of error
*/
lv_font_t * lv_font_load(const char * font_name)
{
bool success = false;
lv_font_t * font = lv_mem_alloc(sizeof(lv_font_t));
memset(font, 0, sizeof(lv_font_t));
lv_fs_file_t file;
lv_fs_res_t res = lv_fs_open(&file, font_name, LV_FS_MODE_RD);
if(res == LV_FS_RES_OK) {
success = lvgl_load_font(&file, font);
}
if(!success) {
LV_LOG_WARN("Error loading font file: %s\n", font_name);
/*
* When `lvgl_load_font` fails it can leak some pointers.
* All non-null pointers can be assumed as allocated and
* `lv_font_free` should free them correctly.
*/
lv_font_free(font);
font = NULL;
}
lv_fs_close(&file);
return font;
}
/**
* Frees the memory allocated by the `lv_font_load()` function
* @param font lv_font_t object created by the lv_font_load function
*/
void lv_font_free(lv_font_t * font)
{
if(NULL != font) {
lv_font_fmt_txt_dsc_t * dsc = (lv_font_fmt_txt_dsc_t *) font->dsc;
if(NULL != dsc) {
if(dsc->kern_classes == 0) {
lv_font_fmt_txt_kern_pair_t * kern_dsc =
(lv_font_fmt_txt_kern_pair_t *) dsc->kern_dsc;
if(NULL != kern_dsc) {
if(kern_dsc->glyph_ids)
lv_mem_free((void *) kern_dsc->glyph_ids);
if(kern_dsc->values)
lv_mem_free((void *) kern_dsc->values);
lv_mem_free((void *) kern_dsc);
}
}
else {
lv_font_fmt_txt_kern_classes_t * kern_dsc =
(lv_font_fmt_txt_kern_classes_t *) dsc->kern_dsc;
if(NULL != kern_dsc) {
if(kern_dsc->class_pair_values)
lv_mem_free((void *) kern_dsc->class_pair_values);
if(kern_dsc->left_class_mapping)
lv_mem_free((void *) kern_dsc->left_class_mapping);
if(kern_dsc->right_class_mapping)
lv_mem_free((void *) kern_dsc->right_class_mapping);
lv_mem_free((void *) kern_dsc);
}
}
lv_font_fmt_txt_cmap_t * cmaps =
(lv_font_fmt_txt_cmap_t *) dsc->cmaps;
if(NULL != cmaps) {
for(int i = 0; i < dsc->cmap_num; ++i) {
if(NULL != cmaps[i].glyph_id_ofs_list)
lv_mem_free((void *) cmaps[i].glyph_id_ofs_list);
if(NULL != cmaps[i].unicode_list)
lv_mem_free((void *) cmaps[i].unicode_list);
}
lv_mem_free(cmaps);
}
if(NULL != dsc->glyph_bitmap) {
lv_mem_free((void *) dsc->glyph_bitmap);
}
if(NULL != dsc->glyph_dsc) {
lv_mem_free((void *) dsc->glyph_dsc);
}
lv_mem_free(dsc);
}
lv_mem_free(font);
}
}
/**********************
* STATIC FUNCTIONS
**********************/
static bit_iterator_t init_bit_iterator(lv_fs_file_t * fp)
{
bit_iterator_t it;
it.fp = fp;
it.bit_pos = -1;
it.byte_value = 0;
return it;
}
static int read_bits(bit_iterator_t * it, int n_bits, lv_fs_res_t * res)
{
int value = 0;
while(n_bits--) {
it->byte_value = it->byte_value << 1;
it->bit_pos--;
if(it->bit_pos < 0) {
it->bit_pos = 7;
*res = lv_fs_read(it->fp, &(it->byte_value), 1, NULL);
if(*res != LV_FS_RES_OK) {
return -1;
}
}
int8_t bit = (it->byte_value & 0x80) ? 1 : 0;
value |= (bit << n_bits);
}
*res = LV_FS_RES_OK;
return value;
}
static int read_bits_signed(bit_iterator_t * it, int n_bits, lv_fs_res_t * res)
{
int value = read_bits(it, n_bits, res);
if(value & (1 << (n_bits - 1))) {
for(int bit = n_bits; bit < 16; ++bit) {
value |= (1 << bit);
}
}
return value;
}
static int read_label(lv_fs_file_t * fp, int start, const char * label)
{
lv_fs_seek(fp, start);
uint32_t length;
char buf[4];
if(lv_fs_read(fp, &length, 4, NULL) != LV_FS_RES_OK
|| lv_fs_read(fp, buf, 4, NULL) != LV_FS_RES_OK
|| memcmp(label, buf, 4) != 0) {
LV_LOG_WARN("Error reading '%s' label.", label);
return -1;
}
return length;
}
static bool load_cmaps_tables(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc,
uint32_t cmaps_start, cmap_table_bin_t * cmap_table)
{
for(unsigned int i = 0; i < font_dsc->cmap_num; ++i) {
if(lv_fs_read(fp, &cmap_table[i], sizeof(cmap_table_bin_t), NULL) != LV_FS_RES_OK) {
return false;
}
lv_font_fmt_txt_cmap_t * cmap = (lv_font_fmt_txt_cmap_t *) & (font_dsc->cmaps[i]);
cmap->range_start = cmap_table[i].range_start;
cmap->range_length = cmap_table[i].range_length;
cmap->glyph_id_start = cmap_table[i].glyph_id_start;
}
for(unsigned int i = 0; i < font_dsc->cmap_num; ++i) {
lv_fs_res_t res = lv_fs_seek(fp, cmaps_start + cmap_table[i].data_offset);
if(res != LV_FS_RES_OK) {
return false;
}
lv_font_fmt_txt_cmap_t * cmap = (lv_font_fmt_txt_cmap_t *) & (font_dsc->cmaps[i]);
switch(cmap_table[i].format_type) {
case 0: {
uint8_t ids_size = sizeof(uint8_t) * cmap_table[i].data_entries_count;
uint8_t * glyph_id_ofs_list = lv_mem_alloc(ids_size);
cmap->glyph_id_ofs_list = glyph_id_ofs_list;
if(lv_fs_read(fp, glyph_id_ofs_list, ids_size, NULL) != LV_FS_RES_OK) {
return false;
}
cmap->type = LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL;
cmap->list_length = cmap->range_length;
cmap->unicode_list = NULL;
break;
}
case 2:
cmap->type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY;
cmap->list_length = 0;
cmap->unicode_list = NULL;
cmap->glyph_id_ofs_list = NULL;
break;
case 1:
case 3: {
uint32_t list_size = sizeof(uint16_t) * cmap_table[i].data_entries_count;
uint16_t * unicode_list = (uint16_t *) lv_mem_alloc(list_size);
cmap->unicode_list = unicode_list;
cmap->list_length = cmap_table[i].data_entries_count;
if(lv_fs_read(fp, unicode_list, list_size, NULL) != LV_FS_RES_OK) {
return false;
}
if(cmap_table[i].format_type == 1) {
uint16_t * buf = lv_mem_alloc(sizeof(uint16_t) * cmap->list_length);
cmap->type = LV_FONT_FMT_TXT_CMAP_SPARSE_FULL;
cmap->glyph_id_ofs_list = buf;
if(lv_fs_read(fp, buf, sizeof(uint16_t) * cmap->list_length, NULL) != LV_FS_RES_OK) {
return false;
}
}
else {
cmap->type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY;
cmap->glyph_id_ofs_list = NULL;
}
break;
}
default:
LV_LOG_WARN("Unknown cmaps format type %d.", cmap_table[i].format_type);
return false;
}
}
return true;
}
static int32_t load_cmaps(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint32_t cmaps_start)
{
int32_t cmaps_length = read_label(fp, cmaps_start, "cmap");
if(cmaps_length < 0) {
return -1;
}
uint32_t cmaps_subtables_count;
if(lv_fs_read(fp, &cmaps_subtables_count, sizeof(uint32_t), NULL) != LV_FS_RES_OK) {
return -1;
}
lv_font_fmt_txt_cmap_t * cmaps =
lv_mem_alloc(cmaps_subtables_count * sizeof(lv_font_fmt_txt_cmap_t));
memset(cmaps, 0, cmaps_subtables_count * sizeof(lv_font_fmt_txt_cmap_t));
font_dsc->cmaps = cmaps;
font_dsc->cmap_num = cmaps_subtables_count;
cmap_table_bin_t * cmaps_tables = lv_mem_alloc(sizeof(cmap_table_bin_t) * font_dsc->cmap_num);
bool success = load_cmaps_tables(fp, font_dsc, cmaps_start, cmaps_tables);
lv_mem_free(cmaps_tables);
return success ? cmaps_length : -1;
}
static int32_t load_glyph(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc,
uint32_t start, uint32_t * glyph_offset, uint32_t loca_count, font_header_bin_t * header)
{
int32_t glyph_length = read_label(fp, start, "glyf");
if(glyph_length < 0) {
return -1;
}
lv_font_fmt_txt_glyph_dsc_t * glyph_dsc = (lv_font_fmt_txt_glyph_dsc_t *)
lv_mem_alloc(loca_count * sizeof(lv_font_fmt_txt_glyph_dsc_t));
memset(glyph_dsc, 0, loca_count * sizeof(lv_font_fmt_txt_glyph_dsc_t));
font_dsc->glyph_dsc = glyph_dsc;
int cur_bmp_size = 0;
for(unsigned int i = 0; i < loca_count; ++i) {
lv_font_fmt_txt_glyph_dsc_t * gdsc = &glyph_dsc[i];
lv_fs_res_t res = lv_fs_seek(fp, start + glyph_offset[i]);
if(res != LV_FS_RES_OK) {
return -1;
}
bit_iterator_t bit_it = init_bit_iterator(fp);
if(header->advance_width_bits == 0) {
gdsc->adv_w = header->default_advance_width;
}
else {
gdsc->adv_w = read_bits(&bit_it, header->advance_width_bits, &res);
if(res != LV_FS_RES_OK) {
return -1;
}
}
if(header->advance_width_format == 0) {
gdsc->adv_w *= 16;
}
gdsc->ofs_x = read_bits_signed(&bit_it, header->xy_bits, &res);
if(res != LV_FS_RES_OK) {
return -1;
}
gdsc->ofs_y = read_bits_signed(&bit_it, header->xy_bits, &res);
if(res != LV_FS_RES_OK) {
return -1;
}
gdsc->box_w = read_bits(&bit_it, header->wh_bits, &res);
if(res != LV_FS_RES_OK) {
return -1;
}
gdsc->box_h = read_bits(&bit_it, header->wh_bits, &res);
if(res != LV_FS_RES_OK) {
return -1;
}
int nbits = header->advance_width_bits + 2 * header->xy_bits + 2 * header->wh_bits;
int next_offset = (i < loca_count - 1) ? glyph_offset[i + 1] : (uint32_t)(glyph_length - 1);
int bmp_size = next_offset - glyph_offset[i] - nbits / 8;
if(i == 0) {
gdsc->adv_w = 0;
gdsc->box_w = 0;
gdsc->box_h = 0;
gdsc->ofs_x = 0;
gdsc->ofs_y = 0;
}
gdsc->bitmap_index = cur_bmp_size;
if(gdsc->box_w * gdsc->box_h != 0) {
cur_bmp_size += bmp_size;
}
}
uint8_t * glyph_bmp = (uint8_t *) lv_mem_alloc(sizeof(uint8_t) * cur_bmp_size);
font_dsc->glyph_bitmap = glyph_bmp;
cur_bmp_size = 0;
for(unsigned int i = 1; i < loca_count; ++i) {
lv_fs_res_t res = lv_fs_seek(fp, start + glyph_offset[i]);
if(res != LV_FS_RES_OK) {
return -1;
}
bit_iterator_t bit_it = init_bit_iterator(fp);
int nbits = header->advance_width_bits + 2 * header->xy_bits + 2 * header->wh_bits;
read_bits(&bit_it, nbits, &res);
if(res != LV_FS_RES_OK) {
return -1;
}
if(glyph_dsc[i].box_w * glyph_dsc[i].box_h == 0) {
continue;
}
int next_offset = (i < loca_count - 1) ? glyph_offset[i + 1] : (uint32_t)(glyph_length - 1);
int bmp_size = next_offset - glyph_offset[i] - nbits / 8;
for(int k = 0; k < bmp_size; ++k) {
glyph_bmp[cur_bmp_size + k] = read_bits(&bit_it, 8, &res);
if(res != LV_FS_RES_OK) {
return -1;
}
}
cur_bmp_size += bmp_size;
}
return glyph_length;
}
/*
* Loads a `lv_font_t` from a binary file, given a `lv_fs_file_t`.
*
* Memory allocations on `lvgl_load_font` should be immediately zeroed and
* the pointer should be set on the `lv_font_t` data before any possible return.
*
* When something fails, it returns `false` and the memory on the `lv_font_t`
* still needs to be freed using `lv_font_free`.
*
* `lv_font_free` will assume that all non-null pointers are allocated and
* should be freed.
*/
static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font)
{
lv_font_fmt_txt_dsc_t * font_dsc = (lv_font_fmt_txt_dsc_t *)
lv_mem_alloc(sizeof(lv_font_fmt_txt_dsc_t));
memset(font_dsc, 0, sizeof(lv_font_fmt_txt_dsc_t));
font->dsc = font_dsc;
/* header */
int32_t header_length = read_label(fp, 0, "head");
if(header_length < 0) {
return false;
}
font_header_bin_t font_header;
if(lv_fs_read(fp, &font_header, sizeof(font_header_bin_t), NULL) != LV_FS_RES_OK) {
return false;
}
font->base_line = -font_header.descent;
font->line_height = font_header.ascent - font_header.descent;
font->get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt;
font->get_glyph_bitmap = lv_font_get_bitmap_fmt_txt;
font->subpx = font_header.subpixels_mode;
font_dsc->bpp = font_header.bits_per_pixel;
font_dsc->kern_scale = font_header.kerning_scale;
font_dsc->bitmap_format = font_header.compression_id;
/* cmaps */
uint32_t cmaps_start = header_length;
int32_t cmaps_length = load_cmaps(fp, font_dsc, cmaps_start);
if(cmaps_length < 0) {
return false;
}
/* loca */
uint32_t loca_start = cmaps_start + cmaps_length;
int32_t loca_length = read_label(fp, loca_start, "loca");
if(loca_length < 0) {
return false;
}
uint32_t loca_count;
if(lv_fs_read(fp, &loca_count, sizeof(uint32_t), NULL) != LV_FS_RES_OK) {
return false;
}
bool failed = false;
uint32_t * glyph_offset = lv_mem_alloc(sizeof(uint32_t) * (loca_count + 1));
for(unsigned int i = 0; i < loca_count; ++i) {
if(font_header.index_to_loc_format == 0) {
uint16_t offset;
if(lv_fs_read(fp, &offset, sizeof(uint16_t), NULL) != LV_FS_RES_OK) {
failed = true;
break;
}
glyph_offset[i] = offset;
}
else if(font_header.index_to_loc_format == 1) {
uint32_t offset;
if(lv_fs_read(fp, &offset, sizeof(uint32_t), NULL) != LV_FS_RES_OK) {
failed = true;
break;
}
glyph_offset[i] = offset;
}
else {
LV_LOG_WARN("Unknown index_to_loc_format: %d.", font_header.index_to_loc_format);
failed = true;
break;
}
}
if(failed) {
lv_mem_free(glyph_offset);
return false;
}
/* glyph */
uint32_t glyph_start = loca_start + loca_length;
int32_t glyph_length = load_glyph(
fp, font_dsc, glyph_start, glyph_offset, loca_count, &font_header);
lv_mem_free(glyph_offset);
if(glyph_length < 0) {
return false;
}
if(font_header.tables_count < 4) {
font_dsc->kern_dsc = NULL;
font_dsc->kern_classes = 0;
font_dsc->kern_scale = 0;
return true;
}
uint32_t kern_start = glyph_start + glyph_length;
int32_t kern_length = load_kern(fp, font_dsc, font_header.glyph_id_format, kern_start);
return kern_length >= 0;
}
int32_t load_kern(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint8_t format, uint32_t start)
{
int32_t kern_length = read_label(fp, start, "kern");
if(kern_length < 0) {
return -1;
}
uint8_t kern_format_type;
int32_t padding;
if(lv_fs_read(fp, &kern_format_type, sizeof(uint8_t), NULL) != LV_FS_RES_OK ||
lv_fs_read(fp, &padding, 3 * sizeof(uint8_t), NULL) != LV_FS_RES_OK) {
return -1;
}
if(0 == kern_format_type) { /* sorted pairs */
lv_font_fmt_txt_kern_pair_t * kern_pair = lv_mem_alloc(sizeof(lv_font_fmt_txt_kern_pair_t));
memset(kern_pair, 0, sizeof(lv_font_fmt_txt_kern_pair_t));
font_dsc->kern_dsc = kern_pair;
font_dsc->kern_classes = 0;
uint32_t glyph_entries;
if(lv_fs_read(fp, &glyph_entries, sizeof(uint32_t), NULL) != LV_FS_RES_OK) {
return -1;
}
int ids_size;
if(format == 0) {
ids_size = sizeof(int8_t) * 2 * glyph_entries;
}
else {
ids_size = sizeof(int16_t) * 2 * glyph_entries;
}
uint8_t * glyph_ids = lv_mem_alloc(ids_size);
int8_t * values = lv_mem_alloc(glyph_entries);
kern_pair->glyph_ids_size = format;
kern_pair->pair_cnt = glyph_entries;
kern_pair->glyph_ids = glyph_ids;
kern_pair->values = values;
if(lv_fs_read(fp, glyph_ids, ids_size, NULL) != LV_FS_RES_OK) {
return -1;
}
if(lv_fs_read(fp, values, glyph_entries, NULL) != LV_FS_RES_OK) {
return -1;
}
}
else if(3 == kern_format_type) { /* array M*N of classes */
lv_font_fmt_txt_kern_classes_t * kern_classes = lv_mem_alloc(sizeof(lv_font_fmt_txt_kern_classes_t));
memset(kern_classes, 0, sizeof(lv_font_fmt_txt_kern_classes_t));
font_dsc->kern_dsc = kern_classes;
font_dsc->kern_classes = 1;
uint16_t kern_class_mapping_length;
uint8_t kern_table_rows;
uint8_t kern_table_cols;
if(lv_fs_read(fp, &kern_class_mapping_length, sizeof(uint16_t), NULL) != LV_FS_RES_OK ||
lv_fs_read(fp, &kern_table_rows, sizeof(uint8_t), NULL) != LV_FS_RES_OK ||
lv_fs_read(fp, &kern_table_cols, sizeof(uint8_t), NULL) != LV_FS_RES_OK) {
return -1;
}
int kern_values_length = sizeof(int8_t) * kern_table_rows * kern_table_cols;
uint8_t * kern_left = lv_mem_alloc(kern_class_mapping_length);
uint8_t * kern_right = lv_mem_alloc(kern_class_mapping_length);
int8_t * kern_values = lv_mem_alloc(kern_values_length);
kern_classes->left_class_mapping = kern_left;
kern_classes->right_class_mapping = kern_right;
kern_classes->left_class_cnt = kern_table_rows;
kern_classes->right_class_cnt = kern_table_cols;
kern_classes->class_pair_values = kern_values;
if(lv_fs_read(fp, kern_left, kern_class_mapping_length, NULL) != LV_FS_RES_OK ||
lv_fs_read(fp, kern_right, kern_class_mapping_length, NULL) != LV_FS_RES_OK ||
lv_fs_read(fp, kern_values, kern_values_length, NULL) != LV_FS_RES_OK) {
return -1;
}
}
else {
LV_LOG_WARN("Unknown kern_format_type: %d", kern_format_type);
return -1;
}
return kern_length;
}
#endif /*LV_USE_FILESYSTEM*/

View File

@@ -0,0 +1,44 @@
/**
* @file lv_font_loader.h
*
*/
#ifndef LV_FONT_LOADER_H
#define LV_FONT_LOADER_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
#if LV_USE_FILESYSTEM
lv_font_t * lv_font_load(const char * fontName);
void lv_font_free(lv_font_t * font);
#endif
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_FONT_LOADER_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1201,7 +1201,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
0x0, 0x0, 0x0
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
@@ -1396,7 +1395,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
* KERNING
*----------------*/
/*Map glyph_ids to kern left classes*/
static const uint8_t kern_left_class_mapping[] =
{
@@ -1826,7 +1824,6 @@ static const int8_t kern_class_values[] =
0, 0, 0, 0, 0
};
/*Collect the kern class' data in one place*/
static const lv_font_fmt_txt_kern_classes_t kern_classes =
{
@@ -1854,7 +1851,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
.bitmap_format = 0
};
/*-----------------
* PUBLIC FONT
*----------------*/
@@ -1867,9 +1863,12 @@ lv_font_t lv_font_montserrat_12 = {
.base_line = 3, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
.underline_position = -1,
.underline_thickness = 1,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if LV_FONT_MONTSERRAT_12*/

View File

@@ -1201,7 +1201,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
0x0, 0x0, 0x0
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
@@ -1396,7 +1395,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
* KERNING
*----------------*/
/*Map glyph_ids to kern left classes*/
static const uint8_t kern_left_class_mapping[] =
{
@@ -1826,7 +1824,6 @@ static const int8_t kern_class_values[] =
0, 0, 0, 0, 0
};
/*Collect the kern class' data in one place*/
static const lv_font_fmt_txt_kern_classes_t kern_classes =
{
@@ -1854,7 +1851,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
.bitmap_format = 0
};
/*-----------------
* PUBLIC FONT
*----------------*/
@@ -1867,9 +1863,12 @@ lv_font_t lv_font_montserrat_12_subpx = {
.base_line = 3, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
.underline_position = -1,
.underline_thickness = 1,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if LV_FONT_MONTSERRAT_12_SUBPX*/

View File

@@ -1470,7 +1470,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
0x0, 0x0, 0x0
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
@@ -1665,7 +1664,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
* KERNING
*----------------*/
/*Map glyph_ids to kern left classes*/
static const uint8_t kern_left_class_mapping[] =
{
@@ -2095,7 +2093,6 @@ static const int8_t kern_class_values[] =
0, 0, 0, 0, 0
};
/*Collect the kern class' data in one place*/
static const lv_font_fmt_txt_kern_classes_t kern_classes =
{
@@ -2123,7 +2120,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
.bitmap_format = 0
};
/*-----------------
* PUBLIC FONT
*----------------*/
@@ -2136,9 +2132,12 @@ lv_font_t lv_font_montserrat_14 = {
.base_line = 3, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
.underline_position = -1,
.underline_thickness = 1,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if LV_FONT_MONTSERRAT_14*/

View File

@@ -1733,7 +1733,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
0x0, 0x0, 0x0, 0x0, 0x0, 0x0
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
@@ -1928,7 +1927,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
* KERNING
*----------------*/
/*Map glyph_ids to kern left classes*/
static const uint8_t kern_left_class_mapping[] =
{
@@ -2358,7 +2356,6 @@ static const int8_t kern_class_values[] =
0, 0, 0, 0, 0
};
/*Collect the kern class' data in one place*/
static const lv_font_fmt_txt_kern_classes_t kern_classes =
{
@@ -2386,7 +2383,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
.bitmap_format = 0
};
/*-----------------
* PUBLIC FONT
*----------------*/
@@ -2399,9 +2395,12 @@ lv_font_t lv_font_montserrat_16 = {
.base_line = 3, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
.underline_position = -1,
.underline_thickness = 1,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if LV_FONT_MONTSERRAT_16*/

View File

@@ -2122,7 +2122,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
0x0, 0x0
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
@@ -2317,7 +2316,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
* KERNING
*----------------*/
/*Map glyph_ids to kern left classes*/
static const uint8_t kern_left_class_mapping[] =
{
@@ -2747,7 +2745,6 @@ static const int8_t kern_class_values[] =
0, 0, 0, 0, 0
};
/*Collect the kern class' data in one place*/
static const lv_font_fmt_txt_kern_classes_t kern_classes =
{
@@ -2775,7 +2772,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
.bitmap_format = 0
};
/*-----------------
* PUBLIC FONT
*----------------*/
@@ -2788,9 +2784,12 @@ lv_font_t lv_font_montserrat_18 = {
.base_line = 4, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
.underline_position = -1,
.underline_thickness = 1,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if LV_FONT_MONTSERRAT_18*/

View File

@@ -2468,7 +2468,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
0x0
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
@@ -2663,7 +2662,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
* KERNING
*----------------*/
/*Map glyph_ids to kern left classes*/
static const uint8_t kern_left_class_mapping[] =
{
@@ -3093,7 +3091,6 @@ static const int8_t kern_class_values[] =
0, 0, 0, 0, 0
};
/*Collect the kern class' data in one place*/
static const lv_font_fmt_txt_kern_classes_t kern_classes =
{
@@ -3121,7 +3118,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
.bitmap_format = 0
};
/*-----------------
* PUBLIC FONT
*----------------*/
@@ -3134,9 +3130,12 @@ lv_font_t lv_font_montserrat_20 = {
.base_line = 4, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
.underline_position = -1,
.underline_thickness = 1,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if LV_FONT_MONTSERRAT_20*/

View File

@@ -2885,7 +2885,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
0x0
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
@@ -3080,7 +3079,6 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
* KERNING
*----------------*/
/*Map glyph_ids to kern left classes*/
static const uint8_t kern_left_class_mapping[] =
{
@@ -3510,7 +3508,6 @@ static const int8_t kern_class_values[] =
0, 0, 0, 0, 0
};
/*Collect the kern class' data in one place*/
static const lv_font_fmt_txt_kern_classes_t kern_classes =
{
@@ -3538,7 +3535,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
.bitmap_format = 0
};
/*-----------------
* PUBLIC FONT
*----------------*/
@@ -3551,9 +3547,12 @@ lv_font_t lv_font_montserrat_22 = {
.base_line = 4, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
.underline_position = -2,
.underline_thickness = 1,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if LV_FONT_MONTSERRAT_22*/

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