1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

7366 Commits

Author SHA1 Message Date
Carlos Diaz
42989d4e9a
test(txt) initial unit tests and general code cleanup/fixes (#2623)
* test(txt): Add test for identifying empty text when trying to get next line

* test(txt): Rename next line empty string handling test

* test(txt): Add tests for _lv_txt_is_cmd

* test(txt): Add initial tests for _lv_txt_ins

* fix(txt): Check for NULL before using strlen

Passing NULL to strlen is not defined, so we should avoid it

* txt: Update docs

Remove docs from source file and add comment about pointers to NULL terminated arrays where necessary

* txt: Misc update in encoded_size

* test(txt): first tests for _lv_txt_cut

* tests: Remove -Wmissing-prototype flag from compilation

This will allow us to have cleaner test cases files.

* test(txt): Remove test (funtion) prototypes as they're no longer necessary

* Update src/misc/lv_txt.h

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

* Update src/misc/lv_txt.h

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

* Revert "tests: Remove -Wmissing-prototype flag from compilation"

This reverts commit 8b3217de8d9210eb2e6da5e94c0735beb2735be7.

* test(txt): Use pragma to disable missing-prototype warning

* test: use extended set of compile options for test cases

* Revert "test(txt): Use pragma to disable missing-prototype warning"

This reverts commit 64909e30ed124ca1e8ca390ca0639479c3e34f44.

* test(txt): Add assert to test_txt_cut_len_longer_than_string test

* test(txt): Add test for _lv_txt_encoded_next on valid ascii input

* test(txt): Add tests for _lv_txt_encoded_next with 2 byte long inputs

* test(txt): Add tests for _lv_txt_encoded_next with 3 byte long inputs

* test(txt): Add tests for _lv_txt_encoded_next with 4 byte long inputs

* cleanup(txt): Add helper macros to identify ASCII and UTF8 codes

* cleanup(txt): Add missing LV_ prefix to helper macros

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com>
2021-10-15 11:37:53 +02:00
Xiang Xiao
4baaa6fe07
fix(kconfig) sync Kconfig with the latest lv_conf_template.h (#2662)
* fix(conf): correct LV_USE_EXTERNAL_RENDERER and LV_USE_GPU_SDL related setting

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

* fix(Kconfig): typo error in the font and theme related setting

and correct the default value and sequence

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

* fix(Kconfig): Add the missing misc config

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

* fix(Kconfig): sync widget and theme in Kconfig with lv_conf_template.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

* fix(Kconfig): add the option for 3rd party library and examples

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-15 11:34:16 +02:00
Gabor Kiss-Vamosi
a5793c70a9 Revert "feat(conf) add better check for Kconfig default"
This reverts commit f8fe5366bb051cd5090e4a06658eb0d32decc0b3.
2021-10-14 16:23:12 +02:00
Gabor Kiss-Vamosi
f8fe5366bb feat(conf) add better check for Kconfig default
If a bool config is False Kconfig it won't add CONFIG_ define and it confused lv_conf_internal.h

Fixes: #2555
2021-10-14 16:20:20 +02:00
Xiang Xiao
b1416369ae
fix(log) reduce the stack usage in log function (#2649)
* fix(log): change fwrite to puts since not all platform support fwrite

This reverts commit 539388a66f5aca4e46869fca8da41634e8c5366e.

* fix(log): don't call printf and custom_print_cb at the same time

* fix(log): remove 768B temp buffer if LV_LOG_PRINTF == 1

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

* feat(printf): support %pV format specifier

to support the recursive print:
https://www.kernel.org/doc/html/latest/core-api/printk-formats.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

* fix(log): save 256B temp buffer if LV_LOG_PRINTF == 0

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-14 16:02:41 +02:00
gesture1968
2a701eeaa7
feat(lv_spinbox) support both right-to-left and left-to-right digit steps when clicking encoder button (#2644)
* Update lv_spinbox.c

* Added support for moving the Spinbox digit position from right-to-left when clicking the button on an encoder. The default behaviour is when clicking the encoder button, the digit is moved from left-to-right (MSB to LSB). 
* Added a check to see if the spinbox digit-count is just one. In that case it is pointless to check the buttonclick
* See also the spinbox.h file

* Update lv_spinbox.c

* Forgot the implementation of the setter function
* forgot a ;

* Update lv_spinbox.h

Adding Spinbox support for moving the digitposition both from left-to-right and right-to-left when editing a spinbox and clicking the encoder button. The current behaviour is clicking the encoder button only moves the digitposition from right to left (from MSB to LSB)

* Update lv_spinbox.c

Added brief / comment to new function

* Update lv_spinbox.h

More clear Brief / Comment

* Update lv_spinbox.c

nested function replaced by lv_pow fiunction

* Update lv_spinbox.h

removed spaces

* Update lv_spinbox.h

Replaced type used for direction of digit step when clicking an encoder with existing LVGL lv_dir_t

* Update lv_spinbox.c

Replaced type used for direction of digit step when clicking an encoder with existing LVGL lv_dir_t

* Update spinbox.md

Added comment for the new function 'lv_spinbox_set_digit_step_direction'

* Update src/extra/widgets/spinbox/lv_spinbox.h

Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com>

* Update src/extra/widgets/spinbox/lv_spinbox.h

Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com>

* Update lv_spinbox.c

bug: old definition LV_SPINBOX_DIGIT_DIR_TO_RIGHT changed to LV_DIR_RIGHT

* Update lv_spinbox.h

Extra linefeed removed

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com>
2021-10-14 13:42:25 +02:00
Gabor Kiss-Vamosi
bdce0bc60c fix(group) fix infinite loop 2021-10-13 15:18:41 +02:00
Gabor Kiss-Vamosi
5799c10843 fix(group) skip object if an of the parents is hidden
Previously only the object itself was checked for hidden.
2021-10-13 13:25:25 +02:00
Gabor Kiss-Vamosi
ee5369e2d2 feat(event) add LV_EVENT_SCREEN_LOADED/UNLOADED events 2021-10-13 12:36:03 +02:00
Xiang Xiao
7124ef7761
fix(conf) make a better style alignment in lv_conf_internal.h (#2652)
and reorder Kconfig and src/lv_conf_kconfig.h as lv_conf_template.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-12 18:15:05 +02:00
Jianting (Meco) Man
8debe10cd2
feat add support for rt-thread RTOS (#2660) 2021-10-12 17:35:37 +02:00
Gabor Kiss-Vamosi
7a95fa9e2d test add 3rd party libs to all tests and also fix them
Fixes: #2661
2021-10-12 17:03:50 +02:00
Gabor Kiss-Vamosi
273a0eb32f fix(textarea) various cursor darwing fixes 2021-10-12 16:36:52 +02:00
guoweilkd
d58cae5551
fix(span) eliminate warning in lv_get_snippet_cnt() (#2659) 2021-10-12 08:34:24 -04:00
Johannes Marbach
d09f6bdea3
feat(disp): Enable rendering to display subsection (#2583)
This change introduces new fields on `lv_disp_drv_t` that allow to
specify the size of the full display and the offset of the display
subsection that is being rendered to. The values are used to transform
the drawing area before calling `flush_cb` so that only the desired part
of the full display is being rendered to.

Relates to: lvgl/lv_drivers#166
2021-10-11 08:48:15 -04:00
Johannes Marbach
7658f98e86
feat(keyboard): add user-defined modes (#2651)
As discussed in https://forum.lvgl.io/t/localized-keyboard-layouts/6734,
this adds further `..._USER_N` keyboard modes that can be used to
implemented more keyboard layouts for locales that need more than 4
layers.
2021-10-11 14:46:07 +02:00
Carlos Diaz
3b6a05e253
test add setUp and tearDown to test template (#2648) 2021-10-11 14:22:55 +02:00
Xiang Xiao
c9e3760464
fix(config): remove the nonexistent Kconfig (#2654)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-11 14:02:59 +02:00
Xiang Xiao
6694d9d019
fix(Kconfig): add LV_MEM_ADDR config (#2653)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-11 13:58:47 +02:00
Xiang Xiao
539388a66f
fix(log): replace printf with fwrite to save the stack size (#2655)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-11 12:49:47 +02:00
embeddedt
ab316a07bc
ci(micropython) add GCC problem matcher 2021-10-09 08:11:54 -04:00
Gabor Kiss-Vamosi
038b78122e fix(align) avoid circular references with LV_SIZE_CONTENT
If a child has pct width and the parent has LV_SIZE_CONTENT width, it results in a circular reference.
With fix zero content width is assumed for children in such case.

Besides if a child is center or right aligned the calculation of LV_SIZE_CONTENT might give in conter intuitive result.
To solve this center and right aligned children are not considered in LV_SIZE_CONTENT calculations.

The same applies for height.
2021-10-08 21:38:40 +02:00
Carlos Diaz
acf915b896
test(arc) add initial unit tests (#2617)
* test(arc): Add test for valid creation

* test(arc): Add test for max value truncation

* test(arc): Add test for min value truncation

* test(arc): Add test for value adjustment after updating range

* test(arc): Update test for min value truncation

* test(arc): Add test for angle updating after changing to symmetrical mode

* test(arc): Add test for angle updating after changing to symmetrical mode and value is greater than middle range

* test(arc): Use unity setUp function

* remove API comments from lv_arc.c

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
2021-10-07 19:01:02 +02:00
Philippe Coval
d0f08563a5
build: always enable CMake install rule in default configuration (#2636)
This will simplify packaging recipes, it's not mandatory,
but there is no reason to have it as an option if it does
not imply any regressions.

Relate-to: https://github.com/lvgl/lvgl/issues/2534
Signed-off-by: Philippe Coval <philippe.coval@huawei.com>
2021-10-06 15:31:37 -04:00
Jose Commins
07688e6543
docs(colorwheel) fix old API names (#2643)
`lv_colorwheel_set_color_mode` is now `lv_colorwheel_set_mode`
2021-10-06 12:55:09 -04:00
Amir Gonnen
a625dc2206
ci(micropython) add ESP32 and STM32 tests (#2629)
Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com>
2021-10-06 12:03:03 -04:00
Philippe Coval
7b7bed37d3
build: fix lib name in CMakeLists (#2641)
Fixup for #2640
2021-10-06 08:54:14 -04:00
Philippe Coval
28af180daf
build: remove use of 'project' keyword in CMakeLists (#2640)
It looks like it's not supported on ESP32: "project command is not scriptable"

Signed-off-by: Philippe Coval <philippe.coval@huawei.com>
2021-10-05 08:16:02 -04:00
Miguel Magno
d93360537f
fix typos (#2634) 2021-10-04 18:37:07 +02:00
Philippe Coval
a28f14c3c6
build add install rule to CMakeList.txt (#2621)
* build: Add install rule

This can help to install lvgl on systems,
for clients applications.

It's made for unix (Linux OE/Yocto actually)
if needed it can be enabled for other platforms too.

Relate-to: https://github.com/lvgl/lvgl/issues/2534
Forwarded: https://github.com/lvgl/lvgl/pull/2621
Signed-off-by: Philippe Coval <philippe.coval@astrolabe.coop>

* build: Make install rules optionnal

This change may be reverted, once verified it's harmless

It was tested using:

    cmake -Dinstall=ON . && make install DESTDIR=/tmp/

Forwarded: https://github.com/lvgl/lvgl/pull/2621
Signed-off-by: Philippe Coval <philippe.coval@huawei.com>
2021-10-04 16:54:33 +02:00
Gabor Kiss-Vamosi
5f90029811
feat(event) add LV_EVENT_CHILD_CREATED/DELETED (#2618)
* feat(event) add LV_EVENT_CHILD_CREATED/DELETED

* update docs and CHANGELOG
2021-10-04 16:52:11 +02:00
grarup
4eb406440b
fix LV_FORMAT_ATTRIBUTE fix for gnu > 4.4 (#2631)
Co-authored-by: Peter Grarup <pegp@dgs-diagnostics.com>
2021-10-04 16:42:41 +02:00
s-hadinger
61b5cbb5d3
fix(meter) make lv_meter_indicator_type_t of type uint8_t (#2632) 2021-10-04 16:19:14 +02:00
yonkoma
3eb646d3dc
Fixed row size calculation (#2633)
Previous code did not account for padding, rounding up to the next multiple of 4 bytes
2021-10-04 15:56:06 +02:00
Gabor Kiss-Vamosi
8e7bba6ace docs libs fixes 2021-10-04 15:27:52 +02:00
Gabor Kiss-Vamosi
1a8fed5df0 docs add libs to the main index 2021-10-04 15:08:52 +02:00
Gabor Kiss-Vamosi
f5f9562336 docs include paths in libs 2021-10-04 15:03:49 +02:00
Gabor Kiss-Vamosi
d908f31f8f test fix warning and docs build error 2021-10-04 14:55:27 +02:00
Gabor Kiss-Vamosi
18f61c5f77
arch add small 3rd party libs to lvgl (#2569)
* move png, sjpg, bmp, gif, fs_if to extra/libs

* reorganize the examples

* update lv_conf_internal.h

* fix warnings

* add freetype

* remove unused assets

* add the new libs to build tests

* update the docs
2021-10-04 14:34:11 +02:00
embeddedt
b20a706112
fix(keyboard) use LVGL heap functions instead of POSIX 2021-10-02 16:55:35 -04:00
Karijn Wessing
e7ba9b93af
feat(example) add lv_example_chart_9.py (#2604)
* Create lv_example_chart_9.py

lv_example_chart_9.c was exactly what i needed, thanks for that one!
the only thing is, i needed it in MicroPython :-) 
Here it is

* Update lv_example_chart_9.py

removed duplicate (... = lv.CHAR_POINT.NONE) lines

* Update lv_example_chart_9.py

restored gap
2021-10-01 09:51:49 +02:00
Gabor Kiss-Vamosi
d9c6ad0425 fix(scrollbar) hide the scrollbar if the scrollble flag is removed 2021-09-30 18:20:35 +02:00
Gabor Kiss-Vamosi
188a9467b1 fix(scrollbar) hide the scrollbar if the scrollble flag is removed 2021-09-30 18:06:42 +02:00
Gabor Kiss-Vamosi
78158f039f fix(blend) fix green channel with additive blending 2021-09-30 18:02:16 +02:00
Gabor Kiss-Vamosi
c9d396571d fix(textarea) allow using cursor with not full bg_opa
fixes #2620
2021-09-30 17:44:47 +02:00
Lzx-James
3211066c05
docs(display) fix typo (#2624) 2021-09-30 09:46:37 -04:00
Gabor Kiss-Vamosi
82f3fbcad7 fix(txt) _lv_txt_get_next_line return 0 on empty texts
fixes #2615
2021-09-29 14:04:17 +02:00
guoweilkd
e83eadf73a
fix(span):crash if span->txt = "" (#2616) 2021-09-29 14:01:43 +02:00
Gabor Kiss-Vamosi
86012aefc7 fix(btnmatrix) always udpate row_cnt
allocate_btn_areas_and_controls() returned very early if the same number buttuns were set
the the number fo rows can be different and is wasn't updated

fixes #2619
2021-09-29 13:51:30 +02:00
Gabor Kiss-Vamosi
2a9b9e6e11
Update arc.md 2021-09-29 13:30:44 +02:00