Compare commits
235 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e66f19e5ce | ||
|
|
8ed224fd63 | ||
|
|
998ad66c84 | ||
|
|
83c55c2a64 | ||
|
|
6ed420e043 | ||
|
|
de44f74522 | ||
|
|
ed5f91ab72 | ||
|
|
e5f58151ac | ||
|
|
26ab373b43 | ||
|
|
3dbee9b584 | ||
|
|
56a48e0173 | ||
|
|
aba10b0170 | ||
|
|
f0c52b3511 | ||
|
|
6dd1884228 | ||
|
|
20d56ee6e9 | ||
|
|
196bcb9b0e | ||
|
|
cee779a56d | ||
|
|
07b6d93de4 | ||
|
|
091174069d | ||
|
|
43ed3eb1f4 | ||
|
|
c4d978fa6f | ||
|
|
0ca874bc49 | ||
|
|
3d22dc5722 | ||
|
|
62d21734d9 | ||
|
|
cd69be12d1 | ||
|
|
1b83855c72 | ||
|
|
243145d8c9 | ||
|
|
cb021a425a | ||
|
|
b0fecc6bb2 | ||
|
|
4e177e01ea | ||
|
|
2bf91dbbb5 | ||
|
|
aac672e88b | ||
|
|
93d7bd4cf5 | ||
|
|
57c2201386 | ||
|
|
9e72cb0000 | ||
|
|
0ea6bcd40c | ||
|
|
9b579f3fad | ||
|
|
417e32b4df | ||
|
|
0a7f6a6331 | ||
|
|
b04dea5971 | ||
|
|
e90ce9d4b7 | ||
|
|
5fc66822b9 | ||
|
|
e2d7fa4477 | ||
|
|
b565a69c76 | ||
|
|
861f07bb77 | ||
|
|
6d4de78756 | ||
|
|
a905be4f90 | ||
|
|
99bb4cb8f1 | ||
|
|
03d2d10f17 | ||
|
|
b80f1dbf14 | ||
|
|
b9aff01102 | ||
|
|
ba5ee315e9 | ||
|
|
568c2ee688 | ||
|
|
2aad9aaebd | ||
|
|
4f6fb723ef | ||
|
|
2c0ca03319 | ||
|
|
51f95f3286 | ||
|
|
bf08ff444e | ||
|
|
41b1a7ea15 | ||
|
|
4e5b262401 | ||
|
|
c52482efa2 | ||
|
|
5b09c3879d | ||
|
|
e43d6da389 | ||
|
|
73f4156aad | ||
|
|
bc2ca71bf5 | ||
|
|
b1a7dbadcd | ||
|
|
1b37ee8873 | ||
|
|
9c5fec9b79 | ||
|
|
65f7ff66d5 | ||
|
|
dded9b383a | ||
|
|
3c55dfb672 | ||
|
|
9797c555c0 | ||
|
|
87e26d4997 | ||
|
|
6c62a8eeb5 | ||
|
|
4853eacfa4 | ||
|
|
48a676f404 | ||
|
|
2f6eaa516c | ||
|
|
5e8581a345 | ||
|
|
d6d5903be1 | ||
|
|
313f7f30a7 | ||
|
|
89eca30da8 | ||
|
|
819f01c930 | ||
|
|
8cd738eaa1 | ||
|
|
d6dd6199f3 | ||
|
|
9d0335f38c | ||
|
|
82fdfb34c0 | ||
|
|
a2535fe6f1 | ||
|
|
fa49f35b14 | ||
|
|
bc369de6fa | ||
|
|
3d81bb40da | ||
|
|
5848aa59e5 | ||
|
|
68300a5dec | ||
|
|
07a95b5b33 | ||
|
|
d90cbe92de | ||
|
|
45599c2c2a | ||
|
|
85b3e8766f | ||
|
|
07c63b8ad3 | ||
|
|
8361d89a55 | ||
|
|
510bc7ca11 | ||
|
|
440c79e40c | ||
|
|
baa1f848b1 | ||
|
|
522e975a4e | ||
|
|
e511fe53c9 | ||
|
|
4903bdb908 | ||
|
|
6b99545e50 | ||
|
|
70438d158d | ||
|
|
52f52397cb | ||
|
|
94a25b86a8 | ||
|
|
3979024660 | ||
|
|
16567f5705 | ||
|
|
0b79b1690f | ||
|
|
4f0beee01b | ||
|
|
d018558134 | ||
|
|
6060d4d1f6 | ||
|
|
0c6a627b92 | ||
|
|
54883792e1 | ||
|
|
e2f96b9007 | ||
|
|
20fef93fea | ||
|
|
63dfe9e8e3 | ||
|
|
0ae70c027b | ||
|
|
3e404b1583 | ||
|
|
43771fa2f7 | ||
|
|
34635da14c | ||
|
|
b79d615ae8 | ||
|
|
af27c16793 | ||
|
|
945f5900d5 | ||
|
|
24340fa927 | ||
|
|
a7c4fc410a | ||
|
|
08fcf03c3f | ||
|
|
93138759a9 | ||
|
|
380df4578e | ||
|
|
71619aa8f6 | ||
|
|
a07583331e | ||
|
|
2afd887fdf | ||
|
|
1bc1d278eb | ||
|
|
fc5709d04c | ||
|
|
b3c9096830 | ||
|
|
74efc2e73e | ||
|
|
85c5e786a4 | ||
|
|
8a489b3a8e | ||
|
|
b19fb8620f | ||
|
|
2d986871c9 | ||
|
|
ef81e0fbc3 | ||
|
|
b00628e77d | ||
|
|
d110731409 | ||
|
|
92c75a6e8c | ||
|
|
2f40ca37df | ||
|
|
112c894e73 | ||
|
|
5035c0c780 | ||
|
|
f42afb1c52 | ||
|
|
4f9869fc7e | ||
|
|
f915b4cfb6 | ||
|
|
06ae6be9d4 | ||
|
|
b62ddf8f64 | ||
|
|
b05aaaeb6b | ||
|
|
47687fc252 | ||
|
|
a85ed5b949 | ||
|
|
929d9f7a57 | ||
|
|
20d034c279 | ||
|
|
23aec1e1ce | ||
|
|
0931bb6cae | ||
|
|
d487acd7cc | ||
|
|
380b59fddd | ||
|
|
6d92d084f7 | ||
|
|
16678b78bc | ||
|
|
8f14c31bc9 | ||
|
|
a2b4bbcd2a | ||
|
|
20f901f9e3 | ||
|
|
85c8014880 | ||
|
|
b5ddf8d19d | ||
|
|
b3cca917df | ||
|
|
6bae5c7af5 | ||
|
|
4dafa10017 | ||
|
|
622472387c | ||
|
|
6e9714c545 | ||
|
|
6e12abe015 | ||
|
|
8788317bb1 | ||
|
|
f9da89d77d | ||
|
|
def8e047af | ||
|
|
6b59b1f706 | ||
|
|
cc921dae17 | ||
|
|
ae0d498cf6 | ||
|
|
18ae2fe7fb | ||
|
|
c19a4ad568 | ||
|
|
54a8a4ba33 | ||
|
|
b3bfa3c58b | ||
|
|
9d7ba3fcb1 | ||
|
|
b44ddb5b64 | ||
|
|
1a66a485f9 | ||
|
|
d6c87cb753 | ||
|
|
bd59dafa42 | ||
|
|
51a522c8d3 | ||
|
|
120d579c88 | ||
|
|
200d3aa26d | ||
|
|
e6a4860d96 | ||
|
|
c03160abc2 | ||
|
|
232d6a5530 | ||
|
|
757df9eb89 | ||
|
|
63ea07c0ab | ||
|
|
aec831d277 | ||
|
|
d3cafedb65 | ||
|
|
16a4023abf | ||
|
|
9c78f86880 | ||
|
|
8627389837 | ||
|
|
5e1b08131b | ||
|
|
eb2ad01a89 | ||
|
|
0dd1dc41be | ||
|
|
6f41624b14 | ||
|
|
dcaa2e037f | ||
|
|
e32b3bf13b | ||
|
|
77b4bd597b | ||
|
|
8a54450984 | ||
|
|
5a946fc3f4 | ||
|
|
8cddd4bdab | ||
|
|
5347779e50 | ||
|
|
a81a8b8d3e | ||
|
|
6d120b1f7f | ||
|
|
5d0c00a201 | ||
|
|
9a029a1784 | ||
|
|
cb5ad1e9d3 | ||
|
|
4d614e60ef | ||
|
|
6fcfe72df6 | ||
|
|
de7cb0fa71 | ||
|
|
0429c501b7 | ||
|
|
8ec2030cab | ||
|
|
73c0bf6439 | ||
|
|
28c9cf0aa5 | ||
|
|
2b47542bbd | ||
|
|
d9c75f61c5 | ||
|
|
0b5f414ca8 | ||
|
|
beda277316 | ||
|
|
63c4b43a57 | ||
|
|
ec616da1ac | ||
|
|
6f312e34e3 | ||
|
|
3c9468a621 |
8
.github/pull_request_template.md
vendored
Normal file
8
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
### Description of the feature or fix
|
||||
|
||||
A clear and concise description of what the bug or new feature is.
|
||||
|
||||
### Checkpoints
|
||||
- [ ] Follow the [styling guide](https://github.com/lvgl/lvgl/blob/master/docs/CODING_STYLE.md)
|
||||
- [ ] Update CHANGELOG.md
|
||||
- [ ] Update the documentation
|
||||
27
.github/workflows/release.yml
vendored
Normal file
27
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
on:
|
||||
push:
|
||||
# Sequence of patterns matched against refs/tags
|
||||
tags:
|
||||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
||||
|
||||
name: Create Release
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
body: |
|
||||
See the [CHANGELOG](https://github.com/lvgl/lvgl/blob/master/CHANGELOG.md)
|
||||
draft: false
|
||||
prerelease: false
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
scripts/release/__pycache__
|
||||
**/*.o
|
||||
**/*bin
|
||||
**/*.swp
|
||||
|
||||
67
CHANGELOG.md
67
CHANGELOG.md
@@ -1,5 +1,70 @@
|
||||
# Changelog
|
||||
|
||||
## 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 cacheing
|
||||
- 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 changeing 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 availabe 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)
|
||||
|
||||
@@ -310,7 +375,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.
|
||||
|
||||
64
CMakeLists.txt
Normal file
64
CMakeLists.txt
Normal file
@@ -0,0 +1,64 @@
|
||||
if(ESP_PLATFORM)
|
||||
|
||||
file(GLOB_RECURSE SOURCES src/*.c)
|
||||
|
||||
idf_component_register(SRCS ${SOURCES}
|
||||
INCLUDE_DIRS . src
|
||||
REQUIRES main)
|
||||
|
||||
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_CONF_INCLUDE_SIMPLE")
|
||||
|
||||
if (CONFIG_LV_MEM_CUSTOM)
|
||||
if (CONFIG_LV_MEM_CUSTOM_ALLOC)
|
||||
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_MEM_CUSTOM_ALLOC=${CONFIG_LV_MEM_CUSTOM_ALLOC}")
|
||||
endif()
|
||||
|
||||
if (CONFIG_LV_MEM_CUSTOM_FREE)
|
||||
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_MEM_CUSTOM_FREE=${CONFIG_LV_MEM_CUSTOM_FREE}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (CONFIG_LV_TICK_CUSTOM)
|
||||
if (CONFIG_LV_TICK_CUSTOM_SYS_TIME_EXPR)
|
||||
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_TICK_CUSTOM_SYS_TIME_EXPR=${CONFIG_LV_TICK_CUSTOM_SYS_TIME_EXPR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (CONFIG_LV_USER_DATA_FREE)
|
||||
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_USER_DATA_FREE=${CONFIG_LV_USER_DATA_FREE}")
|
||||
endif()
|
||||
|
||||
if (CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM)
|
||||
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_ATTRIBUTE_FAST_MEM=IRAM_ATTR")
|
||||
endif()
|
||||
|
||||
elseif(ZEPHYR_BASE)
|
||||
|
||||
if(CONFIG_LVGL)
|
||||
|
||||
zephyr_include_directories(${ZEPHYR_BASE}/lib/gui/lvgl)
|
||||
|
||||
target_include_directories(lvgl INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
zephyr_compile_definitions(LV_CONF_KCONFIG_EXTERNAL_INCLUDE=<autoconf.h>)
|
||||
|
||||
zephyr_compile_definitions_ifdef(CONFIG_LV_MEM_CUSTOM
|
||||
LV_MEM_CUSTOM_ALLOC=${CONFIG_LV_MEM_CUSTOM_ALLOC}
|
||||
)
|
||||
zephyr_compile_definitions_ifdef(CONFIG_LV_MEM_CUSTOM
|
||||
LV_MEM_CUSTOM_FREE=${CONFIG_LV_MEM_CUSTOM_FREE}
|
||||
)
|
||||
zephyr_compile_definitions_ifdef(CONFIG_LV_TICK_CUSTOM
|
||||
LV_TICK_CUSTOM_SYS_TIME_EXPR=${CONFIG_LV_TICK_CUSTOM_SYS_TIME_EXPR}
|
||||
)
|
||||
|
||||
zephyr_library()
|
||||
|
||||
file(GLOB_RECURSE SOURCES src/*.c)
|
||||
zephyr_library_sources(${SOURCES})
|
||||
|
||||
endif() # CONFIG_LVGL
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown platform.")
|
||||
endif()
|
||||
@@ -1,4 +1,4 @@
|
||||
<h1 align="center"> LVGL - Light and Versatile Graphics Library</h1>
|
||||
<h1 align="center"> LVGL - Light and Versatile Graphics Library</h1>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://lvgl.io/assets/images/img_1.png">
|
||||
@@ -11,6 +11,7 @@ LVGL provides everything you need to create embedded GUI with easy-to-use graphi
|
||||
<h4 align="center">
|
||||
<a href="https://lvgl.io">Website </a> ·
|
||||
<a href="https://lvgl.io/demos">Online demo</a> ·
|
||||
<a href="https://lvgl.github.io/lv_examples/">Nightly demos</a> ·
|
||||
<a href="https://docs.lvgl.io/">Docs</a> ·
|
||||
<a href="https://forum.lvgl.io">Forum</a>
|
||||
</h4>
|
||||
|
||||
@@ -5,7 +5,7 @@ This is a summary for thenew fatures of the major releases and a collection of i
|
||||
This list indicates only the current intention and can be changed.
|
||||
|
||||
## v8
|
||||
Planned to September/October 2020
|
||||
Planned to November/December 2020
|
||||
- Create an `lv_components` repository for compley widgets
|
||||
- It makes the core LVGL leaner
|
||||
- In `lv_components` we can have a lot and specific widgets
|
||||
@@ -27,29 +27,31 @@ Planned to September/October 2020
|
||||
- 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 of `create` functions deprecated
|
||||
- Make the copy paramter 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.1
|
||||
## 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).
|
||||
- Unit testing (gtest?). See [#1658](https://github.com/lvgl/lvgl/issues/1658)
|
||||
- Benchmarking (gem5?). See [#1660](https://github.com/lvgl/lvgl/issues/1660)
|
||||
- Consider direct binary font format support
|
||||
- Remove the copy paramter from create functions
|
||||
- Style selectors and style-based states See [#1832](https://github.com/lvgl/lvgl/issues/1832)
|
||||
- Optimize line and cirle 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
|
||||
|
||||
## v10
|
||||
- Remove property level states
|
||||
|
||||
|
||||
## Ideas
|
||||
- 9-patch support for `lv_imgbtn`.
|
||||
- lv_mem_alloc_aligned(size, align)
|
||||
- Text node. See [#1701](https://github.com/lvgl/lvgl/issues/1701#issuecomment-699479408)
|
||||
- RGB888 support [#1722](https://github.com/lvgl/lvgl/issues/1722)
|
||||
- Consider ARGB4444, ARGB1555 format
|
||||
- CPP binding. See [Forum](https://forum.lvgl.io/t/is-it-possible-to-officially-support-optional-cpp-api/2736)
|
||||
- Optmize font decompression
|
||||
- Switch to RGBA colors in styles
|
||||
@@ -57,3 +59,4 @@ Planned to September/October 2020
|
||||
- Need static analize (via coverity.io or somehing else)
|
||||
- Support dot_begin and dot_middle long modes for labels
|
||||
- Add new label alignment modes. [#1656](https://github.com/lvgl/lvgl/issues/1656)
|
||||
- Support larger images: [#1892](https://github.com/lvgl/lvgl/issues/1892)
|
||||
|
||||
@@ -36,26 +36,11 @@ 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;
|
||||
@@ -65,7 +50,6 @@ bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
|
||||
|
||||
Serial.print("Data y");
|
||||
Serial.println(touchY);
|
||||
|
||||
}
|
||||
|
||||
return false; /*Return `false` because we are not buffering and no more data to read*/
|
||||
|
||||
@@ -325,9 +325,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 +344,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 +360,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)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lvgl",
|
||||
"version": "7.7.0",
|
||||
"version": "7.9.0",
|
||||
"keywords": "graphics, gui, embedded, tft, lvgl",
|
||||
"description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.",
|
||||
"repository": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name=lvgl
|
||||
version=7.7.0
|
||||
version=7.9.0
|
||||
author=kisvegabor
|
||||
maintainer=kisvegabor,embeddedt,pete-pjb
|
||||
sentence=Full-featured Graphics Library for Embedded Systems
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file lv_conf.h
|
||||
* Configuration file for v7.7.0-dev
|
||||
* Configuration file for v7.9.0
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -82,7 +82,7 @@ typedef int16_t lv_coord_t;
|
||||
/* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
|
||||
# define LV_MEM_SIZE (32U * 1024U)
|
||||
|
||||
/* Complier prefix for a big array declaration */
|
||||
/* Compiler prefix for a big array declaration */
|
||||
# define LV_MEM_ATTR
|
||||
|
||||
/* Set an address for the memory pool instead of allocating it as an array.
|
||||
@@ -127,7 +127,7 @@ 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]
|
||||
@@ -240,7 +240,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`)*/
|
||||
@@ -410,6 +410,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
|
||||
@@ -513,7 +514,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
|
||||
|
||||
4
lvgl.h
4
lvgl.h
@@ -15,7 +15,7 @@ extern "C" {
|
||||
* CURRENT VERSION OF LVGL
|
||||
***************************/
|
||||
#define LVGL_VERSION_MAJOR 7
|
||||
#define LVGL_VERSION_MINOR 7
|
||||
#define LVGL_VERSION_MINOR 9
|
||||
#define LVGL_VERSION_PATCH 0
|
||||
#define LVGL_VERSION_INFO ""
|
||||
|
||||
@@ -82,8 +82,6 @@ extern "C" {
|
||||
|
||||
#include "src/lv_api_map.h"
|
||||
|
||||
//#define LV_BUILD_TEST 1
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/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
|
||||
'''
|
||||
|
||||
|
||||
@@ -29,8 +29,30 @@ fout.write(
|
||||
|
||||
#include <stdint.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) && !defined(CONFIG_LV_CONF_SKIP)
|
||||
#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)
|
||||
@@ -71,14 +93,13 @@ for i in fin.read().splitlines():
|
||||
|
||||
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'# ifdef CONFIG_{line}\n'
|
||||
f'# define {line} CONFIG_{line}\n'
|
||||
f'# ifdef CONFIG_{line.upper()}\n'
|
||||
f'# define {line} CONFIG_{line.upper()}\n'
|
||||
f'# else\n'
|
||||
f'{d}\n'
|
||||
f'# endif\n'
|
||||
@@ -94,7 +115,7 @@ fout.write(
|
||||
'''
|
||||
|
||||
/*If running without lv_conf.h add typdesf with default value*/
|
||||
#if defined(LV_CONF_SKIP) || defined(CONFIG_LV_CONF_SKIP)
|
||||
#if defined(LV_CONF_SKIP)
|
||||
|
||||
/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
|
||||
typedef int16_t lv_coord_t;
|
||||
|
||||
@@ -1,517 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Release lvgl, lv_examples, lv_drivers. docs, blog and prepare the development of the next major, minoror bugfix release
|
||||
# Usage: ./release,py bugfix | minor | major
|
||||
# The option means what type of versin to prepare for development after release
|
||||
#
|
||||
# STEPS:
|
||||
# - clone all 5 repos
|
||||
# - get the version numnber from lvgl.h
|
||||
# - set release branch (e.g. "release/v7")
|
||||
# - prepare lvgl
|
||||
# - run lv_conf_internal.py
|
||||
# - run code formatter
|
||||
# - clear LVGL_VERSION_INFO (set to "")
|
||||
# - run Doxygen
|
||||
# - update the version in lvgl's library.json, library.properties, lv_conf_template.h
|
||||
# - update CHANGELOG.md
|
||||
# - commit changes
|
||||
# - prepare lv_examples
|
||||
# - upadte the required LVGL version in lv_examples.h (LV_VERSION_CHECK)
|
||||
# - update the version in lv_ex_conf_template.h
|
||||
# - prepare lv_drivers
|
||||
# - update the version in library.json, lv_drv_conf_template.h
|
||||
# - prepare docs
|
||||
# - update API XML
|
||||
# - clear the versiopn info (should be plain vx.y.z)
|
||||
# - tag all repos with the new version
|
||||
# - merge to release branches
|
||||
# - blog: add release post
|
||||
# - push tags and commits
|
||||
# - docs: run ./updade.py release/vX
|
||||
#
|
||||
# If --patch
|
||||
# - merge master to dev branches
|
||||
# - increment patch version by 1 and append "-dev". E.g. "vX.Y.(Z+1)-dev"
|
||||
# - update version numbers in lvgl and docs
|
||||
# - commit and push
|
||||
# - docs: run ./updade.py latest dev
|
||||
#
|
||||
# Else (not --patch)
|
||||
# - merge master to dev
|
||||
# - merge the dev to master
|
||||
# - increment version number like "vX.(Y+1).0-dev"
|
||||
# - apply the new version in dev branches of lvgl, lv_examples, lv_drivers, docs
|
||||
# - commit and push to dev branches
|
||||
# - docs: run ./updade.py latest dev
|
||||
|
||||
import re
|
||||
import os, fnmatch
|
||||
import os.path
|
||||
from os import path
|
||||
from datetime import date
|
||||
import sys
|
||||
|
||||
upstream_org_url = "https://github.com/lvgl/"
|
||||
workdir = "./release_tmp"
|
||||
proj_list = [ "lv_sim_eclipse_sdl", "lv_sim_emscripten"]
|
||||
|
||||
ver_major = -1
|
||||
ver_minor = -1
|
||||
ver_patch = -1
|
||||
|
||||
dev_ver_major = -1
|
||||
dev_ver_minor = -1
|
||||
dev_ver_patch = -1
|
||||
|
||||
ver_str = ""
|
||||
dev_ver_str = ""
|
||||
release_br = ""
|
||||
release_note = ""
|
||||
|
||||
prepare_type = ['major', 'minor', 'bugfix']
|
||||
|
||||
dev_prepare = 'minor'
|
||||
|
||||
def upstream(repo):
|
||||
return upstream_org_url + repo + ".git"
|
||||
|
||||
def cmd(c, exit_on_err = True):
|
||||
print("\n" + c)
|
||||
r = os.system(c)
|
||||
if r:
|
||||
print("### Error: " + str(r))
|
||||
if exit_on_err: exit(int(r))
|
||||
|
||||
def define_set(fn, name, value):
|
||||
print("In " + fn + " set " + name + " to " + value)
|
||||
|
||||
new_content = ""
|
||||
s = r'^ *# *define +' + str(name).rstrip() + ' +'
|
||||
|
||||
f = open(fn, "r")
|
||||
for i in f.read().splitlines():
|
||||
r = re.search(s, i)
|
||||
if r:
|
||||
d = i.split("define")
|
||||
i = d[0] + "define " + name + " " + value
|
||||
new_content += i + '\n'
|
||||
|
||||
f.close()
|
||||
|
||||
f = open(fn, "w")
|
||||
f.write(new_content)
|
||||
f.close()
|
||||
|
||||
def clone_repos():
|
||||
cmd("rm -fr " + workdir)
|
||||
cmd("mkdir " + workdir)
|
||||
os.chdir(workdir)
|
||||
|
||||
cmd("git clone " + upstream("lvgl") + "; cd lvgl; git checkout master; git remote update origin --prune; ")
|
||||
cmd("git clone " + upstream("lv_examples") + "; cd lv_examples; git checkout master; git remote update origin --prune; ")
|
||||
cmd("git clone " + upstream("lv_drivers") + "; cd lv_drivers; git checkout master; git remote update origin --prune; ")
|
||||
cmd("git clone --recurse-submodules " + upstream("docs") + "; cd docs; git checkout master; git remote update origin --prune; ")
|
||||
cmd("git clone " + upstream("blog") + "; cd blog; git checkout master; git remote update origin --prune; ")
|
||||
|
||||
for p in proj_list:
|
||||
cmd("git clone " + upstream(p) + " --recurse-submodules ; cd " + p + "; git checkout master; git remote update origin --prune; ")
|
||||
|
||||
|
||||
def get_lvgl_version(br):
|
||||
print("Get LVGL's version")
|
||||
|
||||
global ver_str, ver_major, ver_minor, ver_patch, release_br
|
||||
|
||||
os.chdir("./lvgl")
|
||||
|
||||
cmd("git checkout " + br)
|
||||
|
||||
f = open("./lvgl.h", "r")
|
||||
|
||||
lastNum = re.compile(r'(?:[^\d]*(\d+)[^\d]*)+')
|
||||
for i in f.read().splitlines():
|
||||
r = re.search(r'^#define LVGL_VERSION_MAJOR ', i)
|
||||
if r:
|
||||
m = lastNum.search(i)
|
||||
if m: ver_major = m.group(1)
|
||||
|
||||
r = re.search(r'^#define LVGL_VERSION_MINOR ', i)
|
||||
if r:
|
||||
m = lastNum.search(i)
|
||||
if m: ver_minor = m.group(1)
|
||||
|
||||
r = re.search(r'^#define LVGL_VERSION_PATCH ', i)
|
||||
if r:
|
||||
m = lastNum.search(i)
|
||||
if m: ver_patch = m.group(1)
|
||||
|
||||
f.close()
|
||||
|
||||
cmd("git checkout master")
|
||||
|
||||
ver_str = "v" + str(ver_major) + "." + str(ver_minor) + "." + str(ver_patch)
|
||||
print("New version:" + ver_str)
|
||||
|
||||
release_br = "release/v" + ver_major
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def update_version():
|
||||
templ = fnmatch.filter(os.listdir('.'), '*templ*')
|
||||
|
||||
if templ[0]:
|
||||
print("Updating version in " + templ[0])
|
||||
cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+/"+ ver_str +"/' " + templ[0])
|
||||
|
||||
if os.path.exists("library.json"):
|
||||
print("Updating version in library.json")
|
||||
cmd("sed -i -r 's/[0-9]+\.[0-9]+\.[0-9]+/"+ ver_str[1:] +"/' library.json")
|
||||
|
||||
if path.exists("library.properties"):
|
||||
print("Updating version in library.properties")
|
||||
cmd("sed -i -r 's/version=[0-9]+\.[0-9]+\.[0-9]+/"+ "version=" + ver_str[1:] + "/' library.properties")
|
||||
|
||||
def lvgl_prepare():
|
||||
print("Prepare lvgl")
|
||||
|
||||
global ver_str, ver_major, ver_minor, ver_patch
|
||||
|
||||
os.chdir("./lvgl")
|
||||
define_set("./lvgl.h", "LVGL_VERSION_INFO", '\"\"')
|
||||
|
||||
# Run some scripts
|
||||
os.chdir("./scripts")
|
||||
cmd("./code-format.sh")
|
||||
cmd("./lv_conf_checker.py")
|
||||
cmd("doxygen")
|
||||
os.chdir("../")
|
||||
|
||||
update_version()
|
||||
|
||||
#update CHANGLELOG
|
||||
new_content = ""
|
||||
f = open("./CHANGELOG.md", "r")
|
||||
|
||||
global release_note
|
||||
release_note = ""
|
||||
note_state = 0
|
||||
for i in f.read().splitlines():
|
||||
if note_state == 0:
|
||||
r = re.search(r'^## ' + ver_str, i)
|
||||
if r:
|
||||
i = i.replace("planned on ", "")
|
||||
note_state+=1
|
||||
|
||||
elif note_state == 1:
|
||||
r = re.search(r'^## ', i)
|
||||
if r:
|
||||
note_state+=1
|
||||
else:
|
||||
release_note += i + '\n'
|
||||
|
||||
new_content += i + '\n'
|
||||
|
||||
f.close()
|
||||
|
||||
f = open("./CHANGELOG.md", "w")
|
||||
f.write(new_content)
|
||||
f.close()
|
||||
|
||||
cmd('git commit -am "prepare to release ' + ver_str + '"')
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
|
||||
def lv_examples_prepare():
|
||||
print("Prepare lv_examples")
|
||||
global ver_str, ver_major, ver_minor, ver_patch
|
||||
|
||||
os.chdir("./lv_examples")
|
||||
|
||||
update_version()
|
||||
|
||||
cmd("sed -i -r 's/LV_VERSION_CHECK\([0-9]+, *[0-9]+, *[0-9]+\)/"+ "LV_VERSION_CHECK(" + ver_major + ", " + ver_minor + ", " + ver_patch + ")/' lv_examples.h")
|
||||
|
||||
cmd('git commit -am "prepare to release ' + ver_str + '"')
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def lv_drivers_prepare():
|
||||
print("Prepare lv_drivers")
|
||||
global ver_str, ver_major, ver_minor, ver_patch
|
||||
|
||||
os.chdir("./lv_drivers")
|
||||
|
||||
update_version()
|
||||
|
||||
cmd('git commit -am "prepare to release ' + ver_str + '"')
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def docs_prepare():
|
||||
print("Prepare docs")
|
||||
global ver_str, ver_major, ver_minor, ver_patch
|
||||
|
||||
os.chdir("./docs")
|
||||
|
||||
cmd("git co latest --")
|
||||
cmd("rm -rf xml");
|
||||
cmd("cp -r ../lvgl/docs/api_doc/xml .");
|
||||
cmd("git add xml");
|
||||
|
||||
cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + ver_str + "'/\" conf.py")
|
||||
|
||||
cmd('git commit -am "prepare to release ' + ver_str + '"')
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def blog_add_post():
|
||||
global ver_str, release_note
|
||||
|
||||
os.chdir("./blog/_posts")
|
||||
|
||||
post = "---\nlayout: post\ntitle: " + ver_str + " is released\nauthor: \"kisvegabor\"\ncover: /assets/release_cover.png\n---\n\n"
|
||||
post += release_note
|
||||
|
||||
today = date.today()
|
||||
d = today.strftime("%Y-%m-%d")
|
||||
|
||||
f = open(d + "-release_" + ver_str + ".md", "w")
|
||||
f.write(post)
|
||||
f.close()
|
||||
|
||||
cmd("git add .")
|
||||
cmd("git commit -am 'Add " + ver_str + " release post'")
|
||||
|
||||
os.chdir("../../")
|
||||
|
||||
def add_tags():
|
||||
global ver_str
|
||||
tag_cmd = " git tag -a " + ver_str + " -m 'Release " + ver_str + "' "
|
||||
cmd("cd lvgl; " + tag_cmd)
|
||||
cmd("cd lv_examples; " + tag_cmd)
|
||||
cmd("cd lv_drivers; " + tag_cmd)
|
||||
cmd("cd docs; " + tag_cmd)
|
||||
|
||||
def update_release_branches():
|
||||
global release_br
|
||||
merge_cmd = " git checkout " + release_br + "; git pull origin " + release_br + "; git merge master -X ours; git push origin " + release_br + "; git checkout master"
|
||||
cmd("cd lvgl; " + merge_cmd)
|
||||
cmd("cd lv_examples; " + merge_cmd)
|
||||
cmd("cd lv_drivers; " + merge_cmd)
|
||||
|
||||
merge_cmd = " git checkout " + release_br + "; git pull origin " + release_br + "; git merge latest -X ours; git push origin " + release_br + "; git checkout latest"
|
||||
cmd("cd docs; " + merge_cmd)
|
||||
|
||||
def publish_master():
|
||||
|
||||
#Merge LVGL master to dev first to avoid "merge-to-dev.yml" running asynchronous
|
||||
os.chdir("./lvgl")
|
||||
cmd("git checkout dev")
|
||||
cmd("git merge master -X ours")
|
||||
cmd("git add .")
|
||||
cmd("git commit -am 'Merge master'", False)
|
||||
cmd("git push origin dev")
|
||||
cmd("git checkout master")
|
||||
os.chdir("../")
|
||||
|
||||
pub_cmd = "git push origin master; git push origin " + ver_str
|
||||
cmd("cd lvgl; " + pub_cmd)
|
||||
cmd("cd lv_examples; " + pub_cmd)
|
||||
cmd("cd lv_drivers; " + pub_cmd)
|
||||
|
||||
pub_cmd = "git push origin master"
|
||||
cmd("cd blog; " + pub_cmd)
|
||||
|
||||
def merge_from_dev():
|
||||
merge_cmd = "git checkout master; git merge dev;"
|
||||
cmd("cd lvgl; " + merge_cmd)
|
||||
|
||||
merge_cmd = "git checkout latest -- ; git merge dev -X theirs --no-edit;"
|
||||
cmd("cd docs; " + merge_cmd)
|
||||
|
||||
|
||||
def lvgl_update_master_version():
|
||||
global ver_major, ver_minor, ver_patch, ver_str
|
||||
|
||||
os.chdir("./lvgl")
|
||||
|
||||
cmd("git checkout master")
|
||||
define_set("./lvgl.h", "LVGL_VERSION_MAJOR", ver_major)
|
||||
define_set("./lvgl.h", "LVGL_VERSION_MINOR", ver_minor)
|
||||
define_set("./lvgl.h", "LVGL_VERSION_PATCH", ver_patch)
|
||||
define_set("./lvgl.h", "LVGL_VERSION_INFO", "dev")
|
||||
|
||||
templ = fnmatch.filter(os.listdir('.'), '*templ*')
|
||||
if templ[0]:
|
||||
print("Updating version in " + templ[0])
|
||||
cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+.*/"+ ver_str +"/' " + templ[0])
|
||||
|
||||
|
||||
cmd("git commit -am 'Update version'")
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def docs_update_latest_version():
|
||||
global ver_str
|
||||
|
||||
os.chdir("./docs")
|
||||
cmd("git checkout latest --")
|
||||
cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + ver_str + "'/\" conf.py")
|
||||
cmd("git commit -am 'Update version'")
|
||||
cmd("git checkout master --")
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
|
||||
def lvgl_update_dev_version():
|
||||
global ver_major, ver_minor, ver_patch, dev_ver_str
|
||||
|
||||
os.chdir("./lvgl")
|
||||
|
||||
cmd("git checkout dev")
|
||||
define_set("./lvgl.h", "LVGL_VERSION_MAJOR", str(ver_major))
|
||||
define_set("./lvgl.h", "LVGL_VERSION_MINOR", str(ver_minor))
|
||||
define_set("./lvgl.h", "LVGL_VERSION_PATCH", str(ver_patch))
|
||||
define_set("./lvgl.h", "LVGL_VERSION_INFO", "\"dev\"")
|
||||
|
||||
templ = fnmatch.filter(os.listdir('.'), '*templ*')
|
||||
if templ[0]:
|
||||
print("Updating version in " + templ[0])
|
||||
cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+.*/"+ dev_ver_str +"/' " + templ[0])
|
||||
|
||||
|
||||
cmd("git commit -am 'Update dev version'")
|
||||
cmd("git checkout master")
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def docs_update_dev_version():
|
||||
global dev_ver_str
|
||||
|
||||
os.chdir("./docs")
|
||||
cmd("git checkout dev --")
|
||||
cmd("sed -i -r \"s/'v[0-9]+\.[0-9]+\.[0-9]+.*'/\'" + dev_ver_str + "'/\" conf.py")
|
||||
cmd("git commit -am 'Update dev version'")
|
||||
cmd("git checkout master --")
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
|
||||
def publish_dev_and_master():
|
||||
pub_cmd = "git checkout dev; git push origin dev"
|
||||
cmd("cd lvgl; " + pub_cmd)
|
||||
pub_cmd = "git checkout master; git push origin master"
|
||||
cmd("cd lvgl; " + pub_cmd)
|
||||
|
||||
def projs_update():
|
||||
global proj_list, release_br, ver_str
|
||||
for p in proj_list:
|
||||
os.chdir("./" + p)
|
||||
cmd('git checkout master')
|
||||
print(p + ": upadte lvgl");
|
||||
cmd("cd lvgl; git co " + release_br + "; git pull origin " + release_br)
|
||||
cmd("cp -f lvgl/lv_conf_template.h lv_conf.h")
|
||||
cmd("sed -i -r 's/#if 0/#if 1/' lv_conf.h") # Enable lv_conf.h
|
||||
d = {}
|
||||
with open("confdef.txt") as f:
|
||||
for line in f:
|
||||
(key, val) = line.rstrip().split('\t')
|
||||
d[key] = val
|
||||
|
||||
for k,v in d.items():
|
||||
define_set("lv_conf.h", str(k), str(v))
|
||||
|
||||
if os.path.exists("lv_examples"):
|
||||
print(p + ": upadte lv_examples");
|
||||
cmd("cd lv_examples; git co " + release_br + "; git pull origin " + release_br)
|
||||
|
||||
if os.path.exists("lv_drivers"):
|
||||
print(p + ": upadte lv_drivers");
|
||||
cmd("cd lv_drivers " + release_br + "; git pull origin " + release_br)
|
||||
|
||||
msg = 'Update to ' + ver_str
|
||||
cmd("git add .")
|
||||
cmd('git commit -am "' + msg + '"')
|
||||
cmd('git push origin master')
|
||||
cmd("git tag -a " + ver_str + " -m '" + msg + "' " )
|
||||
cmd('git push origin ' + ver_str)
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def docs_update_all():
|
||||
cmd("cd docs; git checkout master; python 2.7 ./update.py master dev " + release_br)
|
||||
|
||||
def cleanup():
|
||||
os.chdir("../")
|
||||
cmd("rm -fr " + workdir)
|
||||
|
||||
if __name__ == '__main__':
|
||||
dev_prepare = 'minor'
|
||||
if(len(sys.argv) != 2):
|
||||
print("Missing argument. Usage ./release.py bugfix | minor | major")
|
||||
print("Use minor by deafult")
|
||||
else:
|
||||
dev_prepare = sys.argv[1]
|
||||
|
||||
if not (dev_prepare in prepare_type):
|
||||
print("Invalid argument. Usage ./release.py bugfix | minor | major")
|
||||
exit(1)
|
||||
|
||||
clone_repos()
|
||||
get_lvgl_version("dev")
|
||||
dev_ver_major = ver_major
|
||||
dev_ver_minor = ver_minor
|
||||
dev_ver_patch = ver_patch
|
||||
dev_ver_str = ver_str
|
||||
|
||||
get_lvgl_version("master")
|
||||
|
||||
lvgl_prepare()
|
||||
lv_examples_prepare()
|
||||
lv_drivers_prepare()
|
||||
docs_prepare()
|
||||
blog_add_post()
|
||||
add_tags()
|
||||
update_release_branches()
|
||||
publish_master()
|
||||
|
||||
projs_update()
|
||||
dev_ver_major = "7"
|
||||
dev_ver_minor = "7"
|
||||
dev_ver_patch = "0"
|
||||
dev_ver_str = "v7.7.0"
|
||||
|
||||
if dev_prepare == 'bugfix':
|
||||
ver_patch = str(int(ver_patch) + 1)
|
||||
ver_str = "v" + ver_major + "." + ver_minor + "." + ver_patch + "-dev"
|
||||
|
||||
print("Prepare bugfix version " + ver_str)
|
||||
|
||||
lvgl_update_master_version()
|
||||
docs_update_latest_version()
|
||||
|
||||
else:
|
||||
merge_from_dev()
|
||||
|
||||
if dev_prepare == 'minor':
|
||||
ver_major = dev_ver_major
|
||||
ver_minor = str(int(dev_ver_minor) + 1)
|
||||
ver_patch = "0"
|
||||
else:
|
||||
ver_major = str(int(dev_ver_major) + 1)
|
||||
ver_minor = "0"
|
||||
ver_patch = "0"
|
||||
|
||||
dev_ver_str = "v" + str(ver_major) + "." + str(ver_minor) + "." + str(ver_patch) + "-dev"
|
||||
|
||||
print("Prepare minor version " + dev_ver_str)
|
||||
|
||||
lvgl_update_dev_version()
|
||||
docs_update_dev_version()
|
||||
publish_dev_and_master()
|
||||
|
||||
docs_update_all();
|
||||
cleanup()
|
||||
|
||||
111
scripts/release/com.py
Executable file
111
scripts/release/com.py
Executable file
@@ -0,0 +1,111 @@
|
||||
#!/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 exectution...")
|
||||
|
||||
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] + "\"")
|
||||
|
||||
74
scripts/release/dev.py
Executable file
74
scripts/release/dev.py
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import re
|
||||
import os, fnmatch
|
||||
import os.path
|
||||
from os import path
|
||||
from datetime import date
|
||||
import com
|
||||
|
||||
def lvgl_update_ver(ver, br):
|
||||
os.chdir("./lvgl")
|
||||
|
||||
com.cmd("git checkout " + br)
|
||||
com.update_version(ver)
|
||||
com.cmd("git commit -am 'Update " + br + " version'")
|
||||
com.push("origin " + br)
|
||||
com.cmd("git checkout master")
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
def docs_update_ver(ver, br):
|
||||
os.chdir("./docs")
|
||||
com.cmd("git checkout " + br + " --")
|
||||
com.update_version(ver)
|
||||
com.cmd("git commit -am 'Update " + br + " version'")
|
||||
com.push("origin " + br)
|
||||
com.cmd("git checkout master --")
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
|
||||
def merge_dev_to_master():
|
||||
os.chdir("./lvgl")
|
||||
com.cmd("git checkout master")
|
||||
com.cmd("git merge dev")
|
||||
com.push("origin master")
|
||||
os.chdir("../")
|
||||
|
||||
os.chdir("./docs")
|
||||
com.cmd("git checkout dev -- ") #'dev' sometimes is not recognized so switch to it first
|
||||
com.cmd("git checkout latest --")
|
||||
com.cmd("git merge dev -X theirs --no-edit;")
|
||||
com.push("origin latest")
|
||||
os.chdir("../")
|
||||
|
||||
|
||||
def make(mode):
|
||||
if(mode == "bugfix"):
|
||||
ver = com.get_lvgl_version("master")
|
||||
ver[3] = "dev"
|
||||
ver[2] = str(int(ver[2]) + 1)
|
||||
lvgl_update_ver(ver, "master")
|
||||
docs_update_ver(ver, "latest")
|
||||
else:
|
||||
ver = com.get_lvgl_version("dev")
|
||||
ver[3] = "dev"
|
||||
merge_dev_to_master()
|
||||
if(mode == "major"):
|
||||
ver[0] = str(int(ver[0]) + 1)
|
||||
ver[1] = '0'
|
||||
ver[2] = '0'
|
||||
if(mode == "minor"):
|
||||
ver[1] = str(int(ver[1]) + 1)
|
||||
ver[2] = '0'
|
||||
|
||||
lvgl_update_ver(ver, "dev")
|
||||
docs_update_ver(ver, "dev")
|
||||
|
||||
if __name__ == '__main__':
|
||||
if(len(sys.argv) != 2):
|
||||
print("Missing argument. Usage ./dev.py major | minor | bugfix")
|
||||
print("E.g. ./dev.py minor")
|
||||
else:
|
||||
make(sys.argv[1])
|
||||
65
scripts/release/main.py
Executable file
65
scripts/release/main.py
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os.path
|
||||
from os import path
|
||||
from datetime import date
|
||||
import sys
|
||||
import com
|
||||
import release
|
||||
import dev
|
||||
import proj
|
||||
|
||||
upstream_org_url = "https://github.com/lvgl/"
|
||||
workdir = "./release_tmp"
|
||||
proj_list = [ "lv_sim_eclipse_sdl", "lv_sim_emscripten"]
|
||||
|
||||
def upstream(repo):
|
||||
return upstream_org_url + repo + ".git"
|
||||
|
||||
def clone(repo):
|
||||
com.cmd("git clone --recurse-submodules " + upstream(repo))
|
||||
os.chdir("./" + repo)
|
||||
com.cmd("git checkout master")
|
||||
com.cmd("git remote update origin --prune")
|
||||
com.cmd("git pull origin --tags")
|
||||
os.chdir("..")
|
||||
|
||||
def clone_repos():
|
||||
com.cmd("rm -fr " + workdir)
|
||||
com.cmd("mkdir " + workdir)
|
||||
os.chdir(workdir)
|
||||
clone("lvgl")
|
||||
clone("lv_examples")
|
||||
clone("lv_drivers")
|
||||
clone("docs")
|
||||
clone("blog")
|
||||
|
||||
for p in proj_list:
|
||||
clone(p)
|
||||
|
||||
def cleanup():
|
||||
os.chdir("../")
|
||||
com.cmd("rm -fr " + workdir)
|
||||
|
||||
if __name__ == '__main__':
|
||||
prepare_type = ['major', 'minor', 'bugfix']
|
||||
dev_prepare = 'minor'
|
||||
|
||||
# if(len(sys.argv) != 2):
|
||||
# print("Missing argument. Usage ./release.py bugfix | minor | major")
|
||||
# print("Use minor by deafult")
|
||||
# else:
|
||||
# dev_prepare = sys.argv[1]
|
||||
|
||||
if not (dev_prepare in prepare_type):
|
||||
print("Invalid argument. Usage ./release.py bugfix | minor | major")
|
||||
exit(1)
|
||||
|
||||
#os.chdir(workdir)
|
||||
clone_repos()
|
||||
release.make()
|
||||
for p in proj_list:
|
||||
proj.make(p, True)
|
||||
|
||||
dev.make(dev_prepare)
|
||||
#cleanup()
|
||||
64
scripts/release/proj.py
Executable file
64
scripts/release/proj.py
Executable file
@@ -0,0 +1,64 @@
|
||||
#!/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("Upadte 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("Upadte lv_examples");
|
||||
com.cmd("cd lv_examples; git co " + release_br + "; git pull origin " + release_br)
|
||||
|
||||
if os.path.exists("lv_drivers"):
|
||||
print("upadte lv_drivers");
|
||||
com.cmd("cd lv_drivers " + release_br + "; git pull origin " + release_br)
|
||||
|
||||
msg = 'Update to ' + ver_str
|
||||
com.cmd("git add .")
|
||||
com.cmd('git commit -am "' + msg + '"')
|
||||
com.cmd("git tag -a " + ver_str + " -m '" + msg + "' " )
|
||||
if auto_push:
|
||||
com.push("origin --tags")
|
||||
com.push("origin master")
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
if __name__ == '__main__':
|
||||
if(len(sys.argv) != 2):
|
||||
print("Missing argument. Usage ./projs_update.py repo_path")
|
||||
print("E.g. ./projs_update.py ./lv_sim_eclipse_sdl")
|
||||
else:
|
||||
make(sys.argv[1], sys.argv[2])
|
||||
173
scripts/release/release.py
Executable file
173
scripts/release/release.py
Executable file
@@ -0,0 +1,173 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os.path
|
||||
from os import path
|
||||
from datetime import date
|
||||
import sys
|
||||
import com
|
||||
import re
|
||||
|
||||
def update_release_branch(release_br, master_br = "master"):
|
||||
com.cmd("git checkout " + release_br)
|
||||
com.cmd("git pull origin " + release_br)
|
||||
com.cmd("git merge "+ master_br +" -X ours");
|
||||
com.push("origin " + release_br);
|
||||
com.cmd("git checkout master");
|
||||
|
||||
def lvgl_release(ver):
|
||||
print("Release lvgl")
|
||||
|
||||
ver_str = com.ver_format(ver)
|
||||
release_br = "release/v" + str(ver[0])
|
||||
|
||||
os.chdir("./lvgl")
|
||||
com.define_set("./lvgl.h", "LVGL_VERSION_INFO", '\"\"')
|
||||
|
||||
# Run some scripts
|
||||
os.chdir("./scripts")
|
||||
com.cmd("./code-format.sh")
|
||||
com.cmd("./lv_conf_checker.py")
|
||||
com.cmd("doxygen")
|
||||
os.chdir("../")
|
||||
|
||||
com.update_version(ver)
|
||||
|
||||
#update CHANGLELOG
|
||||
new_content = ""
|
||||
f = open("./CHANGELOG.md", "r")
|
||||
|
||||
release_note = ""
|
||||
note_state = 0
|
||||
for i in f.read().splitlines():
|
||||
if note_state == 0:
|
||||
r = re.search(r'^## ' + ver_str, i)
|
||||
if r:
|
||||
i = i.replace("planned on ", "")
|
||||
note_state+=1
|
||||
|
||||
elif note_state == 1:
|
||||
r = re.search(r'^## ', i)
|
||||
if r:
|
||||
note_state+=1
|
||||
else:
|
||||
release_note += i + '\n'
|
||||
|
||||
new_content += i + '\n'
|
||||
|
||||
f.close()
|
||||
|
||||
f = open("./CHANGELOG.md", "w")
|
||||
f.write(new_content)
|
||||
f.close()
|
||||
|
||||
com.cmd('git commit -am "Release ' + ver_str + '"')
|
||||
|
||||
com.cmd('git checkout dev')
|
||||
com.cmd("git merge master -X ours")
|
||||
com.cmd("git add .")
|
||||
com.cmd("git commit -am 'Merge master'", False)
|
||||
com.push('origin dev')
|
||||
com.cmd('git checkout master')
|
||||
com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ")
|
||||
com.push('origin master')
|
||||
com.push('origin --tags')
|
||||
|
||||
update_release_branch(release_br)
|
||||
|
||||
os.chdir("../")
|
||||
|
||||
return release_note
|
||||
|
||||
|
||||
def lv_examples_release(ver):
|
||||
print("Release lv_examples")
|
||||
|
||||
os.chdir("./lv_examples")
|
||||
release_br = "release/v" + str(ver[0])
|
||||
ver_str = com.ver_format(ver)
|
||||
|
||||
com.update_version(ver)
|
||||
|
||||
com.cmd("sed -i -r 's/LV_VERSION_CHECK\([0-9]+, *[0-9]+, *[0-9]+\)/"+ "LV_VERSION_CHECK(" + str(ver[0]) + ", " + str(ver[1]) + ", " + str(ver[2]) + ")/' lv_examples.h")
|
||||
|
||||
com.cmd('git commit -am "Release ' + ver_str + '"')
|
||||
com.cmd("git tag -a " + ver_str + " -m 'Release " + ver_str + "' ")
|
||||
com.push('origin master')
|
||||
com.push('origin --tags')
|
||||
|
||||
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()
|
||||
@@ -186,6 +186,11 @@ static inline lv_obj_t * lv_page_get_scrl(lv_obj_t * page)
|
||||
* 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)
|
||||
|
||||
@@ -10,8 +10,30 @@
|
||||
|
||||
#include <stdint.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) && !defined(CONFIG_LV_CONF_SKIP)
|
||||
#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)
|
||||
@@ -179,7 +201,7 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Complier prefix for a big array declaration */
|
||||
/* Compiler prefix for a big array declaration */
|
||||
#ifndef LV_MEM_ATTR
|
||||
# ifdef CONFIG_LV_MEM_ATTR
|
||||
# define LV_MEM_ATTR CONFIG_LV_MEM_ATTR
|
||||
@@ -308,7 +330,7 @@
|
||||
#endif
|
||||
|
||||
/* Long press time in milliseconds.
|
||||
* Time to send `LV_EVENT_LONG_PRESSSED`) */
|
||||
* Time to send `LV_EVENT_LONG_PRESSED`) */
|
||||
#ifndef LV_INDEV_DEF_LONG_PRESS_TIME
|
||||
# ifdef CONFIG_LV_INDEV_DEF_LONG_PRESS_TIME
|
||||
# define LV_INDEV_DEF_LONG_PRESS_TIME CONFIG_LV_INDEV_DEF_LONG_PRESS_TIME
|
||||
@@ -580,7 +602,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
|
||||
* (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 */
|
||||
#ifndef LV_IMG_CACHE_DEF_SIZE
|
||||
# ifdef CONFIG_LV_IMG_CACHE_DEF_SIZE
|
||||
# define LV_IMG_CACHE_DEF_SIZE CONFIG_LV_IMG_CACHE_DEF_SIZE
|
||||
@@ -1047,6 +1069,13 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
|
||||
# define LV_FONT_UNSCII_8 0
|
||||
# endif
|
||||
#endif
|
||||
#ifndef LV_FONT_UNSCII_16
|
||||
# ifdef CONFIG_LV_FONT_UNSCII_16
|
||||
# define LV_FONT_UNSCII_16 CONFIG_LV_FONT_UNSCII_16
|
||||
# else
|
||||
# define LV_FONT_UNSCII_16 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Optionally declare your custom fonts here.
|
||||
* You can use these fonts as default font too
|
||||
@@ -1293,7 +1322,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
|
||||
|
||||
/* 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*/
|
||||
#ifndef LV_USE_BIDI
|
||||
# ifdef CONFIG_LV_USE_BIDI
|
||||
@@ -1344,15 +1373,15 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
|
||||
# endif
|
||||
#endif
|
||||
#ifndef lv_snprintf
|
||||
# ifdef CONFIG_lv_snprintf
|
||||
# define lv_snprintf CONFIG_lv_snprintf
|
||||
# ifdef CONFIG_LV_SNPRINTF
|
||||
# define lv_snprintf CONFIG_LV_SNPRINTF
|
||||
# else
|
||||
# define lv_snprintf snprintf
|
||||
# endif
|
||||
#endif
|
||||
#ifndef lv_vsnprintf
|
||||
# ifdef CONFIG_lv_vsnprintf
|
||||
# define lv_vsnprintf CONFIG_lv_vsnprintf
|
||||
# ifdef CONFIG_LV_VSNPRINTF
|
||||
# define lv_vsnprintf CONFIG_LV_VSNPRINTF
|
||||
# else
|
||||
# define lv_vsnprintf vsnprintf
|
||||
# endif
|
||||
@@ -1964,7 +1993,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
|
||||
|
||||
|
||||
/*If running without lv_conf.h add typdesf with default value*/
|
||||
#if defined(LV_CONF_SKIP) || defined(CONFIG_LV_CONF_SKIP)
|
||||
#if defined(LV_CONF_SKIP)
|
||||
|
||||
/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
|
||||
typedef int16_t lv_coord_t;
|
||||
|
||||
421
src/lv_conf_kconfig.h
Normal file
421
src/lv_conf_kconfig.h
Normal file
@@ -0,0 +1,421 @@
|
||||
/**
|
||||
* @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_BYTES)
|
||||
#define CONFIG_LV_MEM_SIZE (CONFIG_LV_MEM_SIZE_BYTES * 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*/
|
||||
@@ -214,6 +214,20 @@ void lv_disp_set_bg_opa(lv_disp_t * disp, lv_opa_t opa)
|
||||
void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t time, uint32_t delay, bool auto_del)
|
||||
{
|
||||
lv_disp_t * d = lv_obj_get_disp(new_scr);
|
||||
lv_obj_t * act_scr = lv_scr_act();
|
||||
|
||||
|
||||
if(d->del_prev && act_scr != d->scr_to_load && d->scr_to_load) {
|
||||
lv_obj_del(act_scr);
|
||||
lv_disp_load_scr(d->scr_to_load);
|
||||
lv_anim_del(d->scr_to_load, NULL);
|
||||
lv_obj_set_pos(d->scr_to_load, 0, 0);
|
||||
lv_style_remove_prop(lv_obj_get_local_style(d->scr_to_load, LV_OBJ_PART_MAIN), LV_STYLE_OPA_SCALE);
|
||||
|
||||
act_scr = d->scr_to_load;
|
||||
}
|
||||
|
||||
d->scr_to_load = new_scr;
|
||||
|
||||
if(d->prev_scr && d->del_prev) {
|
||||
lv_obj_del(d->prev_scr);
|
||||
@@ -396,13 +410,13 @@ static void opa_scale_anim(lv_obj_t * obj, lv_anim_value_t v)
|
||||
lv_obj_set_style_local_opa_scale(obj, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, v);
|
||||
}
|
||||
|
||||
|
||||
static void scr_anim_ready(lv_anim_t * a)
|
||||
{
|
||||
lv_disp_t * d = lv_obj_get_disp(a->var);
|
||||
|
||||
if(d->prev_scr && d->del_prev) lv_obj_del(d->prev_scr);
|
||||
d->prev_scr = NULL;
|
||||
d->scr_to_load = NULL;
|
||||
lv_style_remove_prop(lv_obj_get_local_style(a->var, LV_OBJ_PART_MAIN), LV_STYLE_OPA_SCALE);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -225,4 +225,4 @@ static inline lv_coord_t lv_dpx(lv_coord_t n)
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_TEMPL_H*/
|
||||
#endif /*LV_DISP_H*/
|
||||
|
||||
@@ -149,7 +149,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) {
|
||||
|
||||
@@ -541,7 +541,7 @@ static void indev_keypad_proc(lv_indev_t * i, lv_indev_data_t * data)
|
||||
lv_group_focus_prev(g);
|
||||
if(indev_reset_check(&i->proc)) return;
|
||||
}
|
||||
/*Just send other keys again to the object (e.g. 'A' or `LV_GORUP_KEY_RIGHT)*/
|
||||
/*Just send other keys again to the object (e.g. 'A' or `LV_GROUP_KEY_RIGHT)*/
|
||||
else {
|
||||
lv_group_send_data(g, data->key);
|
||||
if(indev_reset_check(&i->proc)) return;
|
||||
@@ -807,25 +807,34 @@ static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data)
|
||||
return;
|
||||
}
|
||||
|
||||
i->proc.types.pointer.act_point.x = i->btn_points[data->btn_id].x;
|
||||
i->proc.types.pointer.act_point.y = i->btn_points[data->btn_id].y;
|
||||
lv_coord_t x = i->btn_points[data->btn_id].x;
|
||||
lv_coord_t y = i->btn_points[data->btn_id].y;
|
||||
|
||||
/*Still the same point is pressed*/
|
||||
if(i->proc.types.pointer.last_point.x == i->proc.types.pointer.act_point.x &&
|
||||
i->proc.types.pointer.last_point.y == i->proc.types.pointer.act_point.y && data->state == LV_INDEV_STATE_PR) {
|
||||
indev_proc_press(&i->proc);
|
||||
}
|
||||
else {
|
||||
/*If a new point comes always make a release*/
|
||||
indev_proc_release(&i->proc);
|
||||
/*If a new point comes always make a release*/
|
||||
if(data->state == LV_INDEV_STATE_PR) {
|
||||
if(i->proc.types.pointer.last_point.x != x ||
|
||||
i->proc.types.pointer.last_point.y != y) {
|
||||
indev_proc_release(&i->proc);
|
||||
}
|
||||
}
|
||||
|
||||
if(indev_reset_check(&i->proc)) return;
|
||||
|
||||
/*Save the new points*/
|
||||
i->proc.types.pointer.act_point.x = x;
|
||||
i->proc.types.pointer.act_point.y = y;
|
||||
|
||||
if(data->state == LV_INDEV_STATE_PR) indev_proc_press(&i->proc);
|
||||
else indev_proc_release(&i->proc);
|
||||
|
||||
if(indev_reset_check(&i->proc)) return;
|
||||
|
||||
i->proc.types.pointer.last_point.x = i->proc.types.pointer.act_point.x;
|
||||
i->proc.types.pointer.last_point.y = i->proc.types.pointer.act_point.y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the pressed state of LV_INDEV_TYPE_POINER input devices
|
||||
* Process the pressed state of LV_INDEV_TYPE_POINTER input devices
|
||||
* @param indev pointer to an input device 'proc'
|
||||
* @return LV_RES_OK: no indev reset required; LV_RES_INV: indev reset is required
|
||||
*/
|
||||
@@ -868,11 +877,6 @@ static void indev_proc_press(lv_indev_proc_t * proc)
|
||||
indev_drag_throw(proc);
|
||||
}
|
||||
|
||||
/*Do not use disabled objects*/
|
||||
if(indev_obj_act && (lv_obj_get_state(indev_obj_act, LV_OBJ_PART_MAIN) & LV_STATE_DISABLED)) {
|
||||
indev_obj_act = proc->types.pointer.act_obj;
|
||||
}
|
||||
|
||||
/*If a new object was found reset some variables and send a pressed signal*/
|
||||
if(indev_obj_act != proc->types.pointer.act_obj) {
|
||||
proc->types.pointer.last_point.x = proc->types.pointer.act_point.x;
|
||||
@@ -1000,7 +1004,7 @@ static void indev_proc_press(lv_indev_proc_t * proc)
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the released state of LV_INDEV_TYPE_POINER input devices
|
||||
* Process the released state of LV_INDEV_TYPE_POINTER input devices
|
||||
* @param proc pointer to an input device 'proc'
|
||||
*/
|
||||
static void indev_proc_release(lv_indev_proc_t * proc)
|
||||
@@ -1144,7 +1148,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
#include "../lv_misc/lv_fs.h"
|
||||
#include "../lv_misc/lv_gc.h"
|
||||
#include "../lv_misc/lv_math.h"
|
||||
#include "../lv_misc/lv_gc.h"
|
||||
#include "../lv_misc/lv_math.h"
|
||||
#include "../lv_misc/lv_log.h"
|
||||
#include "../lv_hal/lv_hal.h"
|
||||
#include <stdint.h>
|
||||
@@ -107,7 +105,7 @@ typedef struct {
|
||||
lv_color_t scale_grad_color;
|
||||
lv_color_t scale_end_color;
|
||||
lv_opa_t opa_scale;
|
||||
uint32_t clip_corder : 1;
|
||||
uint32_t clip_corner : 1;
|
||||
uint32_t border_post : 1;
|
||||
} style_snapshot_t;
|
||||
|
||||
@@ -223,8 +221,9 @@ void lv_init(void)
|
||||
_lv_indev_init();
|
||||
|
||||
_lv_img_decoder_init();
|
||||
#if LV_IMG_CACHE_DEF_SIZE
|
||||
lv_img_cache_set_size(LV_IMG_CACHE_DEF_SIZE);
|
||||
|
||||
#endif
|
||||
/*Test if the IDE has UTF-8 encoding*/
|
||||
char * txt = "Á";
|
||||
|
||||
@@ -592,7 +591,7 @@ bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area)
|
||||
{
|
||||
if(lv_obj_get_hidden(obj)) return false;
|
||||
|
||||
/*Invalidate the object only if it belongs to the curent or previous'*/
|
||||
/*Invalidate the object only if it belongs to the current or previous'*/
|
||||
lv_obj_t * obj_scr = lv_obj_get_screen(obj);
|
||||
lv_disp_t * disp = lv_obj_get_disp(obj_scr);
|
||||
if(obj_scr == lv_disp_get_scr_act(disp) ||
|
||||
@@ -1478,7 +1477,7 @@ void lv_obj_report_style_mod(lv_style_t * style)
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable/disable the use of style cahche for an object
|
||||
* Enable/disable the use of style cache for an object
|
||||
* @param obj pointer to an object
|
||||
* @param dis true: disable; false: enable (re-enable)
|
||||
*/
|
||||
@@ -1658,7 +1657,8 @@ void lv_obj_set_parent_event(lv_obj_t * obj, bool en)
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the base direction of the object
|
||||
* Set the base direction of the object.
|
||||
* @note This only works if LV_USE_BIDI is enabled.
|
||||
* @param obj pointer to an object
|
||||
* @param dir the new base direction. `LV_BIDI_DIR_LTR/RTL/AUTO/INHERIT`
|
||||
*/
|
||||
@@ -1900,7 +1900,7 @@ lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, const void * data)
|
||||
|
||||
/**
|
||||
* Send LV_EVENT_REFRESH event to an object
|
||||
* @param obj point to an obejct. (Can NOT be NULL)
|
||||
* @param obj point to an object. (Can NOT be NULL)
|
||||
* @return LV_RES_OK: success, LV_RES_INV: to object become invalid (e.g. deleted) due to this event.
|
||||
*/
|
||||
lv_res_t lv_event_send_refresh(lv_obj_t * obj)
|
||||
@@ -4311,7 +4311,7 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop,
|
||||
lv_style_list_t * style_list = lv_obj_get_style_list(obj, part);
|
||||
lv_style_t * style_trans = _lv_style_list_get_transition_style(style_list);
|
||||
|
||||
bool cahche_ori = style_list->ignore_cache;
|
||||
bool cache_ori = style_list->ignore_cache;
|
||||
|
||||
/*Get the previous and current values*/
|
||||
if((prop & 0xF) < LV_STYLE_ID_COLOR) { /*Int*/
|
||||
@@ -4322,7 +4322,7 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop,
|
||||
obj->state = new_state;
|
||||
lv_style_int_t int2 = _lv_obj_get_style_int(obj, part, prop);
|
||||
style_list->skip_trans = 0;
|
||||
style_list->ignore_cache = cahche_ori;
|
||||
style_list->ignore_cache = cache_ori;
|
||||
|
||||
if(int1 == int2) return NULL;
|
||||
obj->state = prev_state;
|
||||
@@ -4353,7 +4353,7 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop,
|
||||
obj->state = new_state;
|
||||
lv_color_t c2 = _lv_obj_get_style_color(obj, part, prop);
|
||||
style_list->skip_trans = 0;
|
||||
style_list->ignore_cache = cahche_ori;
|
||||
style_list->ignore_cache = cache_ori;
|
||||
|
||||
if(c1.full == c2.full) return NULL;
|
||||
obj->state = prev_state;
|
||||
@@ -4375,7 +4375,7 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop,
|
||||
obj->state = new_state;
|
||||
lv_opa_t o2 = _lv_obj_get_style_opa(obj, part, prop);
|
||||
style_list->skip_trans = 0;
|
||||
style_list->ignore_cache = cahche_ori;
|
||||
style_list->ignore_cache = cache_ori;
|
||||
|
||||
if(o1 == o2) return NULL;
|
||||
|
||||
@@ -4398,7 +4398,7 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop,
|
||||
obj->state = new_state;
|
||||
const void * p2 = _lv_obj_get_style_ptr(obj, part, prop);
|
||||
style_list->skip_trans = 0;
|
||||
style_list->ignore_cache = cahche_ori;
|
||||
style_list->ignore_cache = cache_ori;
|
||||
|
||||
if(memcmp(&p1, &p2, sizeof(const void *)) == 0) return NULL;
|
||||
obj->state = prev_state;
|
||||
@@ -4629,7 +4629,7 @@ static bool style_prop_is_cacheble(lv_style_property_t prop)
|
||||
|
||||
/**
|
||||
* Update the cache of style list
|
||||
* @param obj pointer to an obejct
|
||||
* @param obj pointer to an object
|
||||
* @param part the part of the object
|
||||
* @param prop the property which triggered the update
|
||||
*/
|
||||
@@ -4761,25 +4761,19 @@ static void invalidate_style_cache(lv_obj_t * obj, uint8_t part, lv_style_proper
|
||||
{
|
||||
if(style_prop_is_cacheble(prop) == false) return;
|
||||
|
||||
if(part != LV_OBJ_PART_ALL) {
|
||||
for(part = 0; part < _LV_OBJ_PART_REAL_FIRST; part++) {
|
||||
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||
if(list == NULL) return;
|
||||
if(list == NULL) break;
|
||||
list->valid_cache = 0;
|
||||
}
|
||||
else {
|
||||
|
||||
for(part = 0; part < _LV_OBJ_PART_REAL_FIRST; part++) {
|
||||
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||
if(list == NULL) break;
|
||||
list->valid_cache = 0;
|
||||
}
|
||||
for(part = _LV_OBJ_PART_REAL_FIRST; part < 0xFF; part++) {
|
||||
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||
if(list == NULL) break;
|
||||
list->valid_cache = 0;
|
||||
}
|
||||
for(part = _LV_OBJ_PART_REAL_FIRST; part < 0xFF; part++) {
|
||||
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||
if(list == NULL) break;
|
||||
list->valid_cache = 0;
|
||||
}
|
||||
|
||||
|
||||
lv_obj_t * child = lv_obj_get_child(obj, NULL);
|
||||
while(child) {
|
||||
update_style_cache_children(child);
|
||||
@@ -4827,7 +4821,7 @@ static void style_snapshot(lv_obj_t * obj, uint8_t part, style_snapshot_t * shot
|
||||
shot->scale_grad_color = lv_obj_get_style_scale_grad_color(obj, part);
|
||||
shot->scale_end_color = lv_obj_get_style_scale_end_color(obj, part);
|
||||
shot->opa_scale = lv_obj_get_style_opa_scale(obj, part);
|
||||
shot->clip_corder = lv_obj_get_style_clip_corner(obj, part);
|
||||
shot->clip_corner = lv_obj_get_style_clip_corner(obj, part);
|
||||
shot->border_post = lv_obj_get_style_border_post(obj, part);
|
||||
|
||||
_lv_obj_disable_style_caching(obj, false);
|
||||
|
||||
@@ -775,6 +775,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`
|
||||
*/
|
||||
@@ -850,7 +851,7 @@ lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, const void * data);
|
||||
|
||||
/**
|
||||
* Send LV_EVENT_REFRESH event to an object
|
||||
* @param obj point to an obejct. (Can NOT be NULL)
|
||||
* @param obj point to an object. (Can NOT be NULL)
|
||||
* @return LV_RES_OK: success, LV_RES_INV: to object become invalid (e.g. deleted) due to this event.
|
||||
*/
|
||||
lv_res_t lv_event_send_refresh(lv_obj_t * obj);
|
||||
|
||||
@@ -54,6 +54,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
|
||||
@@ -290,17 +294,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 +325,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,7 +403,7 @@ 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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +78,14 @@ lv_disp_t * _lv_refr_get_disp_refreshing(void);
|
||||
*/
|
||||
void _lv_refr_set_disp_refreshing(lv_disp_t * disp);
|
||||
|
||||
#if LV_USE_PERF_MONITOR
|
||||
/**
|
||||
* Get the average FPS since start up
|
||||
* @return the average FPS
|
||||
*/
|
||||
uint32_t lv_refr_get_fps_avg(void);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Called periodically to handle the refreshing
|
||||
* @param task pointer to the task itself
|
||||
|
||||
@@ -44,7 +44,7 @@ static inline size_t get_prop_size(uint8_t prop_id);
|
||||
static inline size_t get_next_prop_index(uint8_t prop_id, size_t id);
|
||||
|
||||
/**********************
|
||||
* GLOABAL VARIABLES
|
||||
* GLOBAL VARIABLES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
@@ -340,7 +340,7 @@ uint16_t _lv_style_get_mem_size(const lv_style_t * style)
|
||||
|
||||
size_t i = 0;
|
||||
uint8_t prop_id;
|
||||
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSEING_PROP) {
|
||||
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSING_PROP) {
|
||||
i = get_next_prop_index(prop_id, i);
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ void _lv_style_set_int(lv_style_t * style, lv_style_property_t prop, lv_style_in
|
||||
|
||||
/*Add new property if not exists yet*/
|
||||
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(lv_style_int_t));
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
|
||||
uint8_t end_mark_size = sizeof(end_mark);
|
||||
|
||||
uint16_t size = _lv_style_get_mem_size(style);
|
||||
@@ -424,7 +424,7 @@ void _lv_style_set_color(lv_style_t * style, lv_style_property_t prop, lv_color_
|
||||
|
||||
/*Add new property if not exists yet*/
|
||||
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(lv_color_t));
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
|
||||
uint8_t end_mark_size = sizeof(end_mark);
|
||||
|
||||
uint16_t size = _lv_style_get_mem_size(style);
|
||||
@@ -471,7 +471,7 @@ void _lv_style_set_opa(lv_style_t * style, lv_style_property_t prop, lv_opa_t op
|
||||
|
||||
/*Add new property if not exists yet*/
|
||||
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(lv_opa_t));
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
|
||||
uint8_t end_mark_size = sizeof(end_mark);
|
||||
|
||||
uint16_t size = _lv_style_get_mem_size(style);
|
||||
@@ -518,7 +518,7 @@ void _lv_style_set_ptr(lv_style_t * style, lv_style_property_t prop, const void
|
||||
|
||||
/*Add new property if not exists yet*/
|
||||
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(const void *));
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
|
||||
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
|
||||
uint8_t end_mark_size = sizeof(end_mark);
|
||||
|
||||
uint16_t size = _lv_style_get_mem_size(style);
|
||||
@@ -1069,7 +1069,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);
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -42,7 +42,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);
|
||||
|
||||
|
||||
/**********************
|
||||
@@ -386,28 +386,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) {
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
*********************/
|
||||
#define GPU_SIZE_LIMIT 240
|
||||
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
@@ -401,6 +400,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
||||
bool chroma_key, bool alpha_byte);
|
||||
|
||||
static void show_error(const lv_area_t * coords, const lv_area_t * clip_area, const char * msg);
|
||||
static void draw_cleanup(lv_img_cache_entry_t * cache);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@@ -267,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);
|
||||
@@ -279,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);
|
||||
@@ -306,6 +309,7 @@ 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;
|
||||
}
|
||||
|
||||
@@ -318,6 +322,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;
|
||||
}
|
||||
|
||||
@@ -649,3 +654,13 @@ 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
|
||||
}
|
||||
|
||||
|
||||
@@ -93,4 +93,4 @@ bool lv_img_cf_has_alpha(lv_img_cf_t cf);
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_TEMPL_H*/
|
||||
#endif /*LV_DRAW_IMG_H*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1028,10 +1029,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1043,7 +1044,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;
|
||||
}
|
||||
@@ -1061,10 +1062,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);
|
||||
@@ -1124,7 +1125,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t
|
||||
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;
|
||||
@@ -1295,8 +1296,16 @@ static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, con
|
||||
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;
|
||||
@@ -1321,7 +1330,11 @@ static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, con
|
||||
label_dsc.color = dsc->value_color;
|
||||
label_dsc.opa = dsc->value_opa;
|
||||
|
||||
lv_draw_label(&value_area, clip, &label_dsc, dsc->value_str, NULL);
|
||||
lv_draw_label(&value_area, clip, &label_dsc, str, NULL);
|
||||
|
||||
#if LV_USE_ARABIC_PERSIAN_CHARS
|
||||
_lv_mem_buf_release(str);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -58,29 +58,53 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are
|
||||
if(point_cnt < 3) return;
|
||||
if(points == NULL) return;
|
||||
|
||||
int16_t i;
|
||||
/*Join adjacent points if they are on the same coordinate*/
|
||||
lv_point_t * p = _lv_mem_buf_get(point_cnt * sizeof(lv_point_t));
|
||||
if(p == NULL) return;
|
||||
uint16_t i;
|
||||
uint16_t pcnt = 0;
|
||||
p[0] = points[0];
|
||||
for(i = 0; i < point_cnt - 1; i++) {
|
||||
if(points[i].x != points[i + 1].x || points[i].y != points[i + 1].y) {
|
||||
p[pcnt] = points[i];
|
||||
pcnt++;
|
||||
}
|
||||
}
|
||||
/*The first and the last points are also adjacent */
|
||||
if(points[0].x != points[point_cnt - 1].x || points[0].y != points[point_cnt - 1].y) {
|
||||
p[pcnt] = points[point_cnt - 1];
|
||||
pcnt++;
|
||||
}
|
||||
|
||||
point_cnt = pcnt;
|
||||
if(point_cnt < 3) {
|
||||
_lv_mem_buf_release(p);
|
||||
return;
|
||||
}
|
||||
|
||||
lv_area_t poly_coords = {.x1 = LV_COORD_MAX, .y1 = LV_COORD_MAX, .x2 = LV_COORD_MIN, .y2 = LV_COORD_MIN};
|
||||
|
||||
for(i = 0; i < point_cnt; i++) {
|
||||
poly_coords.x1 = LV_MATH_MIN(poly_coords.x1, points[i].x);
|
||||
poly_coords.y1 = LV_MATH_MIN(poly_coords.y1, points[i].y);
|
||||
poly_coords.x2 = LV_MATH_MAX(poly_coords.x2, points[i].x);
|
||||
poly_coords.y2 = LV_MATH_MAX(poly_coords.y2, points[i].y);
|
||||
poly_coords.x1 = LV_MATH_MIN(poly_coords.x1, p[i].x);
|
||||
poly_coords.y1 = LV_MATH_MIN(poly_coords.y1, p[i].y);
|
||||
poly_coords.x2 = LV_MATH_MAX(poly_coords.x2, p[i].x);
|
||||
poly_coords.y2 = LV_MATH_MAX(poly_coords.y2, p[i].y);
|
||||
}
|
||||
|
||||
|
||||
bool is_common;
|
||||
lv_area_t poly_mask;
|
||||
is_common = _lv_area_intersect(&poly_mask, &poly_coords, clip_area);
|
||||
if(!is_common) return;
|
||||
|
||||
if(!is_common) {
|
||||
_lv_mem_buf_release(p);
|
||||
return;
|
||||
}
|
||||
/*Find the lowest point*/
|
||||
lv_coord_t y_min = points[0].y;
|
||||
lv_coord_t y_min = p[0].y;
|
||||
int16_t y_min_i = 0;
|
||||
|
||||
for(i = 1; i < point_cnt; i++) {
|
||||
if(points[i].y < y_min) {
|
||||
y_min = points[i].y;
|
||||
if(p[i].y < y_min) {
|
||||
y_min = p[i].y;
|
||||
y_min_i = i;
|
||||
}
|
||||
}
|
||||
@@ -94,16 +118,28 @@ 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 +157,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 +172,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 +193,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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -423,14 +423,14 @@ void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc)
|
||||
dsc->tmp.pivot_y_256 = dsc->cfg.pivot_y * 256;
|
||||
|
||||
int32_t angle_low = dsc->cfg.angle / 10;
|
||||
int32_t angle_hight = angle_low + 1;
|
||||
int32_t angle_high = angle_low + 1;
|
||||
int32_t angle_rem = dsc->cfg.angle - (angle_low * 10);
|
||||
|
||||
int32_t s1 = _lv_trigo_sin(-angle_low);
|
||||
int32_t s2 = _lv_trigo_sin(-angle_hight);
|
||||
int32_t s2 = _lv_trigo_sin(-angle_high);
|
||||
|
||||
int32_t c1 = _lv_trigo_sin(-angle_low + 90);
|
||||
int32_t c2 = _lv_trigo_sin(-angle_hight + 90);
|
||||
int32_t c2 = _lv_trigo_sin(-angle_high + 90);
|
||||
|
||||
dsc->tmp.sinma = (s1 * (10 - angle_rem) + s2 * angle_rem) / 10;
|
||||
dsc->tmp.cosma = (c1 * (10 - angle_rem) + c2 * angle_rem) / 10;
|
||||
@@ -500,14 +500,14 @@ void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t
|
||||
}
|
||||
|
||||
int32_t angle_low = angle / 10;
|
||||
int32_t angle_hight = angle_low + 1;
|
||||
int32_t angle_high = angle_low + 1;
|
||||
int32_t angle_rem = angle - (angle_low * 10);
|
||||
|
||||
int32_t s1 = _lv_trigo_sin(angle_low);
|
||||
int32_t s2 = _lv_trigo_sin(angle_hight);
|
||||
int32_t s2 = _lv_trigo_sin(angle_high);
|
||||
|
||||
int32_t c1 = _lv_trigo_sin(angle_low + 90);
|
||||
int32_t c2 = _lv_trigo_sin(angle_hight + 90);
|
||||
int32_t c2 = _lv_trigo_sin(angle_high + 90);
|
||||
|
||||
int32_t sinma = (s1 * (10 - angle_rem) + s2 * angle_rem) / 10;
|
||||
int32_t cosma = (c1 * (10 - angle_rem) + c2 * angle_rem) / 10;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
/*********************
|
||||
* 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 +29,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 +36,16 @@
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
#if LV_IMG_CACHE_DEF_SIZE == 0
|
||||
static lv_img_cache_entry_t cache_temp;
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static uint16_t entry_cnt;
|
||||
#if LV_IMG_CACHE_DEF_SIZE
|
||||
static uint16_t entry_cnt;
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
@@ -64,6 +65,10 @@ static uint16_t entry_cnt;
|
||||
*/
|
||||
lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color)
|
||||
{
|
||||
/*Is the image cached?*/
|
||||
lv_img_cache_entry_t * cached_src = NULL;
|
||||
|
||||
#if LV_IMG_CACHE_DEF_SIZE
|
||||
if(entry_cnt == 0) {
|
||||
LV_LOG_WARN("lv_img_cache_open: the cache size is 0");
|
||||
return NULL;
|
||||
@@ -79,8 +84,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 +107,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 +163,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 +188,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 +198,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 +212,7 @@ void lv_img_cache_invalidate_src(const void * src)
|
||||
_lv_memset_00(&cache[i], sizeof(lv_img_cache_entry_t));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_IMG_DEOCER_H
|
||||
#define LV_IMG_DEOCER_H
|
||||
#ifndef LV_IMG_DECODER_H
|
||||
#define LV_IMG_DECODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -267,4 +267,4 @@ void lv_img_decoder_built_in_close(lv_img_decoder_t * decoder, lv_img_decoder_ds
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_TEMPL_H*/
|
||||
#endif /*LV_IMG_DECODER_H*/
|
||||
|
||||
@@ -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
|
||||
@@ -227,6 +222,10 @@ LV_FONT_DECLARE(lv_font_montserrat_12_subpx)
|
||||
LV_FONT_DECLARE(lv_font_unscii_8)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_UNSCII_16
|
||||
LV_FONT_DECLARE(lv_font_unscii_16)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_DEJAVU_16_PERSIAN_HEBREW
|
||||
LV_FONT_DECLARE(lv_font_dejavu_16_persian_hebrew)
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
CSRCS += lv_font.c
|
||||
CSRCS += lv_font_fmt_txt.c
|
||||
CSRCS += lv_font_loader.c
|
||||
CSRCS += lv_font_montserrat_8.c
|
||||
CSRCS += lv_font_montserrat_10.c
|
||||
CSRCS += lv_font_montserrat_12.c
|
||||
CSRCS += lv_font_montserrat_14.c
|
||||
CSRCS += lv_font_montserrat_16.c
|
||||
|
||||
@@ -42,22 +42,26 @@ static int32_t unicode_list_compare(const void * ref, const void * element);
|
||||
static int32_t kern_pair_8_compare(const void * ref, const void * element);
|
||||
static int32_t kern_pair_16_compare(const void * ref, const void * element);
|
||||
|
||||
static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord_t h, uint8_t bpp, bool prefilter);
|
||||
static inline void decompress_line(uint8_t * out, lv_coord_t w);
|
||||
static inline uint8_t get_bits(const uint8_t * in, uint32_t bit_pos, uint8_t len);
|
||||
static inline void bits_write(uint8_t * out, uint32_t bit_pos, uint8_t val, uint8_t len);
|
||||
static inline void rle_init(const uint8_t * in, uint8_t bpp);
|
||||
static inline uint8_t rle_next(void);
|
||||
#if LV_USE_FONT_COMPRESSED
|
||||
static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord_t h, uint8_t bpp, bool prefilter);
|
||||
static inline void decompress_line(uint8_t * out, lv_coord_t w);
|
||||
static inline uint8_t get_bits(const uint8_t * in, uint32_t bit_pos, uint8_t len);
|
||||
static inline void bits_write(uint8_t * out, uint32_t bit_pos, uint8_t val, uint8_t len);
|
||||
static inline void rle_init(const uint8_t * in, uint8_t bpp);
|
||||
static inline uint8_t rle_next(void);
|
||||
#endif /* LV_USE_FONT_COMPRESSED */
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static 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
|
||||
@@ -338,6 +342,7 @@ static int32_t kern_pair_16_compare(const void * ref, const void * element)
|
||||
else return (int32_t) ref16_p[1] - element16_p[1];
|
||||
}
|
||||
|
||||
#if LV_USE_FONT_COMPRESSED
|
||||
/**
|
||||
* The compress a glyph's bitmap
|
||||
* @param in the compressed bitmap
|
||||
@@ -567,6 +572,7 @@ static inline uint8_t rle_next(void)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* LV_USE_FONT_COMPRESSED */
|
||||
|
||||
/** Code Comparator.
|
||||
*
|
||||
|
||||
635
src/lv_font/lv_font_unscii_16.c
Normal file
635
src/lv_font/lv_font_unscii_16.c
Normal file
@@ -0,0 +1,635 @@
|
||||
#include "../../lvgl.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* Size: 16 px
|
||||
* Bpp: 1
|
||||
* Opts:
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef LV_FONT_UNSCII_16
|
||||
#define LV_FONT_UNSCII_16 1
|
||||
#endif
|
||||
|
||||
#if LV_FONT_UNSCII_16
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
/* U+20 " " */
|
||||
0x0,
|
||||
|
||||
/* U+21 "!" */
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0xff,
|
||||
|
||||
/* U+22 "\"" */
|
||||
0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf,
|
||||
|
||||
/* U+23 "#" */
|
||||
0x3c, 0xf0, 0xf3, 0xc3, 0xcf, 0xf, 0x3c, 0xff,
|
||||
0xff, 0xff, 0xf3, 0xcf, 0xf, 0x3c, 0xff, 0xff,
|
||||
0xff, 0xf3, 0xcf, 0xf, 0x3c, 0x3c, 0xf0, 0xf3,
|
||||
0xc0,
|
||||
|
||||
/* U+24 "$" */
|
||||
0xf, 0x0, 0xf0, 0x3f, 0xf3, 0xff, 0xf0, 0xf,
|
||||
0x0, 0x3f, 0xc3, 0xfc, 0x0, 0xf0, 0xf, 0xff,
|
||||
0xcf, 0xfc, 0xf, 0x0, 0xf0,
|
||||
|
||||
/* U+25 "%" */
|
||||
0xf0, 0x3f, 0xc0, 0xff, 0xf, 0x3c, 0x3c, 0x3,
|
||||
0xc0, 0xf, 0x0, 0xf0, 0x3, 0xc0, 0x3c, 0x3c,
|
||||
0xf0, 0xff, 0x3, 0xfc, 0xf,
|
||||
|
||||
/* U+26 "&" */
|
||||
0xf, 0xc0, 0x3f, 0x3, 0xcf, 0xf, 0x3c, 0xf,
|
||||
0xc0, 0x3f, 0x3, 0xf3, 0xcf, 0xcf, 0xf3, 0xf3,
|
||||
0xcf, 0xcf, 0xf, 0x3c, 0x3c, 0x3f, 0x3c, 0xfc,
|
||||
0xf0,
|
||||
|
||||
/* U+27 "'" */
|
||||
0x3c, 0xf3, 0xcf, 0xf3, 0xc0,
|
||||
|
||||
/* U+28 "(" */
|
||||
0xf, 0xf, 0x3c, 0x3c, 0xf0, 0xf0, 0xf0, 0xf0,
|
||||
0xf0, 0xf0, 0x3c, 0x3c, 0xf, 0xf,
|
||||
|
||||
/* U+29 ")" */
|
||||
0xf0, 0xf0, 0x3c, 0x3c, 0xf, 0xf, 0xf, 0xf,
|
||||
0xf, 0xf, 0x3c, 0x3c, 0xf0, 0xf0,
|
||||
|
||||
/* U+2A "*" */
|
||||
0x3c, 0x3c, 0x3c, 0x3c, 0xf, 0xf0, 0xf, 0xf0,
|
||||
0xff, 0xff, 0xff, 0xff, 0xf, 0xf0, 0xf, 0xf0,
|
||||
0x3c, 0x3c, 0x3c, 0x3c,
|
||||
|
||||
/* U+2B "+" */
|
||||
0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xff, 0xff,
|
||||
0xff, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0,
|
||||
|
||||
/* U+2C "," */
|
||||
0x3c, 0xf3, 0xcf, 0xf3, 0xc0,
|
||||
|
||||
/* U+2D "-" */
|
||||
0xff, 0xff, 0xff,
|
||||
|
||||
/* U+2E "." */
|
||||
0xff, 0xff,
|
||||
|
||||
/* U+2F "/" */
|
||||
0x0, 0xf, 0x0, 0xf, 0x0, 0x3c, 0x0, 0x3c,
|
||||
0x0, 0xf0, 0x0, 0xf0, 0x3, 0xc0, 0x3, 0xc0,
|
||||
0xf, 0x0, 0xf, 0x0, 0x3c, 0x0, 0x3c, 0x0,
|
||||
0xf0, 0x0, 0xf0, 0x0,
|
||||
|
||||
/* U+30 "0" */
|
||||
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf3, 0xff,
|
||||
0x3f, 0xfc, 0xff, 0xcf, 0xf0, 0xff, 0xf, 0xf0,
|
||||
0xff, 0xf, 0x3f, 0xc3, 0xfc,
|
||||
|
||||
/* U+31 "1" */
|
||||
0xf, 0x0, 0xf0, 0x3f, 0x3, 0xf0, 0xf, 0x0,
|
||||
0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf,
|
||||
0x0, 0xf0, 0xff, 0xff, 0xff,
|
||||
|
||||
/* U+32 "2" */
|
||||
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0x3, 0xc0,
|
||||
0x3c, 0xf, 0x0, 0xf0, 0x3c, 0x3, 0xc0, 0xf0,
|
||||
0xf, 0x0, 0xff, 0xff, 0xff,
|
||||
|
||||
/* U+33 "3" */
|
||||
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0x0, 0xf0,
|
||||
0xf, 0xf, 0xc0, 0xfc, 0x0, 0xf0, 0xf, 0xf0,
|
||||
0xff, 0xf, 0x3f, 0xc3, 0xfc,
|
||||
|
||||
/* U+34 "4" */
|
||||
0x3, 0xf0, 0xf, 0xc0, 0xff, 0x3, 0xfc, 0x3c,
|
||||
0xf0, 0xf3, 0xcf, 0xf, 0x3c, 0x3c, 0xff, 0xff,
|
||||
0xff, 0xf0, 0xf, 0x0, 0x3c, 0x0, 0xf0, 0x3,
|
||||
0xc0,
|
||||
|
||||
/* U+35 "5" */
|
||||
0xff, 0xff, 0xff, 0xf0, 0xf, 0x0, 0xff, 0xcf,
|
||||
0xfc, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf, 0xf0,
|
||||
0xff, 0xf, 0x3f, 0xc3, 0xfc,
|
||||
|
||||
/* U+36 "6" */
|
||||
0xf, 0xc0, 0xfc, 0x3c, 0x3, 0xc0, 0xf0, 0xf,
|
||||
0x0, 0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0,
|
||||
0xff, 0xf, 0x3f, 0xc3, 0xfc,
|
||||
|
||||
/* U+37 "7" */
|
||||
0xff, 0xff, 0xff, 0x0, 0xf0, 0xf, 0x0, 0xf0,
|
||||
0xf, 0x3, 0xc0, 0x3c, 0xf, 0x0, 0xf0, 0xf,
|
||||
0x0, 0xf0, 0xf, 0x0, 0xf0,
|
||||
|
||||
/* U+38 "8" */
|
||||
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0,
|
||||
0xff, 0xf, 0x3f, 0xc3, 0xfc,
|
||||
|
||||
/* U+39 "9" */
|
||||
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0x3f, 0xf3, 0xff, 0x0, 0xf0, 0xf, 0x3,
|
||||
0xc0, 0x3c, 0x3f, 0x3, 0xf0,
|
||||
|
||||
/* U+3A ":" */
|
||||
0xff, 0xff, 0x0, 0x0, 0xff, 0xff,
|
||||
|
||||
/* U+3B ";" */
|
||||
0x3c, 0xf3, 0xcf, 0x0, 0x0, 0x0, 0x3c, 0xf3,
|
||||
0xcf, 0xf3, 0xc0,
|
||||
|
||||
/* U+3C "<" */
|
||||
0x3, 0xc0, 0xf0, 0xf0, 0x3c, 0x3c, 0xf, 0xf,
|
||||
0x3, 0xc0, 0x3c, 0xf, 0x0, 0xf0, 0x3c, 0x3,
|
||||
0xc0, 0xf0,
|
||||
|
||||
/* U+3D "=" */
|
||||
0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0xff, 0xff,
|
||||
0xff,
|
||||
|
||||
/* U+3E ">" */
|
||||
0xf0, 0x3c, 0x3, 0xc0, 0xf0, 0xf, 0x3, 0xc0,
|
||||
0x3c, 0xf, 0xf, 0x3, 0xc3, 0xc0, 0xf0, 0xf0,
|
||||
0x3c, 0x0,
|
||||
|
||||
/* U+3F "?" */
|
||||
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0x0, 0xf0,
|
||||
0xf, 0x3, 0xc0, 0x3c, 0xf, 0x0, 0xf0, 0x0,
|
||||
0x0, 0x0, 0xf, 0x0, 0xf0,
|
||||
|
||||
/* U+40 "@" */
|
||||
0x3f, 0xf0, 0xff, 0xcf, 0x3, 0xfc, 0xf, 0xf3,
|
||||
0xff, 0xcf, 0xff, 0x3f, 0xfc, 0xff, 0xf3, 0xff,
|
||||
0xcf, 0xff, 0x0, 0x3c, 0x0, 0x3f, 0xf0, 0xff,
|
||||
0xc0,
|
||||
|
||||
/* U+41 "A" */
|
||||
0xf, 0x0, 0xf0, 0x3f, 0xc3, 0xfc, 0xf0, 0xff,
|
||||
0xf, 0xf0, 0xff, 0xf, 0xff, 0xff, 0xff, 0xf0,
|
||||
0xff, 0xf, 0xf0, 0xff, 0xf,
|
||||
|
||||
/* U+42 "B" */
|
||||
0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0,
|
||||
0xff, 0xf, 0xff, 0xcf, 0xfc,
|
||||
|
||||
/* U+43 "C" */
|
||||
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xf,
|
||||
0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0,
|
||||
0xff, 0xf, 0x3f, 0xc3, 0xfc,
|
||||
|
||||
/* U+44 "D" */
|
||||
0xff, 0xf, 0xf0, 0xf3, 0xcf, 0x3c, 0xf0, 0xff,
|
||||
0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf3,
|
||||
0xcf, 0x3c, 0xff, 0xf, 0xf0,
|
||||
|
||||
/* U+45 "E" */
|
||||
0xff, 0xff, 0xff, 0xf0, 0xf, 0x0, 0xf0, 0xf,
|
||||
0x0, 0xff, 0xcf, 0xfc, 0xf0, 0xf, 0x0, 0xf0,
|
||||
0xf, 0x0, 0xff, 0xff, 0xff,
|
||||
|
||||
/* U+46 "F" */
|
||||
0xff, 0xff, 0xff, 0xf0, 0xf, 0x0, 0xf0, 0xf,
|
||||
0x0, 0xff, 0xcf, 0xfc, 0xf0, 0xf, 0x0, 0xf0,
|
||||
0xf, 0x0, 0xf0, 0xf, 0x0,
|
||||
|
||||
/* U+47 "G" */
|
||||
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xf,
|
||||
0x0, 0xf3, 0xff, 0x3f, 0xf0, 0xff, 0xf, 0xf0,
|
||||
0xff, 0xf, 0x3f, 0xf3, 0xff,
|
||||
|
||||
/* U+48 "H" */
|
||||
0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xf, 0xf0,
|
||||
0xff, 0xf, 0xf0, 0xff, 0xf,
|
||||
|
||||
/* U+49 "I" */
|
||||
0xff, 0xff, 0xff, 0xf, 0x0, 0xf0, 0xf, 0x0,
|
||||
0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf,
|
||||
0x0, 0xf0, 0xff, 0xff, 0xff,
|
||||
|
||||
/* U+4A "J" */
|
||||
0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0,
|
||||
0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf, 0xf0,
|
||||
0xff, 0xf, 0x3f, 0xc3, 0xfc,
|
||||
|
||||
/* U+4B "K" */
|
||||
0xf0, 0x3f, 0xc0, 0xff, 0xf, 0x3c, 0x3c, 0xf3,
|
||||
0xc3, 0xcf, 0xf, 0xf0, 0x3f, 0xc0, 0xf3, 0xc3,
|
||||
0xcf, 0xf, 0xf, 0x3c, 0x3c, 0xf0, 0x3f, 0xc0,
|
||||
0xf0,
|
||||
|
||||
/* U+4C "L" */
|
||||
0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf,
|
||||
0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0,
|
||||
0xf, 0x0, 0xff, 0xff, 0xff,
|
||||
|
||||
/* U+4D "M" */
|
||||
0xf0, 0x3f, 0xc0, 0xff, 0xcf, 0xff, 0x3f, 0xff,
|
||||
0xff, 0xff, 0xff, 0x33, 0xfc, 0xcf, 0xf0, 0x3f,
|
||||
0xc0, 0xff, 0x3, 0xfc, 0xf, 0xf0, 0x3f, 0xc0,
|
||||
0xf0,
|
||||
|
||||
/* U+4E "N" */
|
||||
0xf0, 0x3f, 0xc0, 0xff, 0xc3, 0xff, 0xf, 0xff,
|
||||
0x3f, 0xfc, 0xff, 0x3f, 0xfc, 0xff, 0xf0, 0xff,
|
||||
0xc3, 0xff, 0x3, 0xfc, 0xf, 0xf0, 0x3f, 0xc0,
|
||||
0xf0,
|
||||
|
||||
/* U+4F "O" */
|
||||
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0,
|
||||
0xff, 0xf, 0x3f, 0xc3, 0xfc,
|
||||
|
||||
/* U+50 "P" */
|
||||
0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0xff, 0xcf, 0xfc, 0xf0, 0xf, 0x0, 0xf0,
|
||||
0xf, 0x0, 0xf0, 0xf, 0x0,
|
||||
|
||||
/* U+51 "Q" */
|
||||
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf3,
|
||||
0xcf, 0x3c, 0x3c, 0xf3, 0xcf,
|
||||
|
||||
/* U+52 "R" */
|
||||
0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0xff, 0xcf, 0xfc, 0xf3, 0xcf, 0x3c, 0xf0,
|
||||
0xff, 0xf, 0xf0, 0xff, 0xf,
|
||||
|
||||
/* U+53 "S" */
|
||||
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xf,
|
||||
0x0, 0x3f, 0xc3, 0xfc, 0x0, 0xf0, 0xf, 0xf0,
|
||||
0xff, 0xf, 0x3f, 0xc3, 0xfc,
|
||||
|
||||
/* U+54 "T" */
|
||||
0xff, 0xff, 0xff, 0xf, 0x0, 0xf0, 0xf, 0x0,
|
||||
0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf,
|
||||
0x0, 0xf0, 0xf, 0x0, 0xf0,
|
||||
|
||||
/* U+55 "U" */
|
||||
0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0,
|
||||
0xff, 0xf, 0x3f, 0xc3, 0xfc,
|
||||
|
||||
/* U+56 "V" */
|
||||
0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0x3f,
|
||||
0xc3, 0xfc, 0xf, 0x0, 0xf0,
|
||||
|
||||
/* U+57 "W" */
|
||||
0xf0, 0x3f, 0xc0, 0xff, 0x3, 0xfc, 0xf, 0xf0,
|
||||
0x3f, 0xc0, 0xff, 0x33, 0xfc, 0xcf, 0xff, 0xff,
|
||||
0xff, 0xff, 0xcf, 0xff, 0x3f, 0xf0, 0x3f, 0xc0,
|
||||
0xf0,
|
||||
|
||||
/* U+58 "X" */
|
||||
0xf0, 0xf, 0xf0, 0xf, 0x3c, 0x3c, 0x3c, 0x3c,
|
||||
0xf, 0xf0, 0xf, 0xf0, 0x3, 0xc0, 0x3, 0xc0,
|
||||
0xf, 0xf0, 0xf, 0xf0, 0x3c, 0x3c, 0x3c, 0x3c,
|
||||
0xf0, 0xf, 0xf0, 0xf,
|
||||
|
||||
/* U+59 "Y" */
|
||||
0xf0, 0xf, 0xf0, 0xf, 0x3c, 0x3c, 0x3c, 0x3c,
|
||||
0xf, 0xf0, 0xf, 0xf0, 0x3, 0xc0, 0x3, 0xc0,
|
||||
0x3, 0xc0, 0x3, 0xc0, 0x3, 0xc0, 0x3, 0xc0,
|
||||
0x3, 0xc0, 0x3, 0xc0,
|
||||
|
||||
/* U+5A "Z" */
|
||||
0xff, 0xff, 0xff, 0x0, 0xf0, 0xf, 0x3, 0xc0,
|
||||
0x3c, 0xf, 0x0, 0xf0, 0x3c, 0x3, 0xc0, 0xf0,
|
||||
0xf, 0x0, 0xff, 0xff, 0xff,
|
||||
|
||||
/* U+5B "[" */
|
||||
0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
|
||||
0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff,
|
||||
|
||||
/* U+5C "\\" */
|
||||
0xf0, 0x0, 0xf0, 0x0, 0x3c, 0x0, 0x3c, 0x0,
|
||||
0xf, 0x0, 0xf, 0x0, 0x3, 0xc0, 0x3, 0xc0,
|
||||
0x0, 0xf0, 0x0, 0xf0, 0x0, 0x3c, 0x0, 0x3c,
|
||||
0x0, 0xf, 0x0, 0xf,
|
||||
|
||||
/* U+5D "]" */
|
||||
0xff, 0xff, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf,
|
||||
0xf, 0xf, 0xf, 0xf, 0xff, 0xff,
|
||||
|
||||
/* U+5E "^" */
|
||||
0x3, 0x0, 0xc, 0x0, 0xfc, 0x3, 0xf0, 0x3c,
|
||||
0xf0, 0xf3, 0xcf, 0x3, 0xfc, 0xf,
|
||||
|
||||
/* U+5F "_" */
|
||||
0xff, 0xff, 0xff, 0xff,
|
||||
|
||||
/* U+60 "`" */
|
||||
0xf0, 0xf0, 0x3c, 0x3c, 0xf, 0xf,
|
||||
|
||||
/* U+61 "a" */
|
||||
0x3f, 0xc3, 0xfc, 0x0, 0xf0, 0xf, 0x3f, 0xf3,
|
||||
0xff, 0xf0, 0xff, 0xf, 0x3f, 0xf3, 0xff,
|
||||
|
||||
/* U+62 "b" */
|
||||
0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xff, 0xcf,
|
||||
0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0,
|
||||
0xff, 0xf, 0xff, 0xcf, 0xfc,
|
||||
|
||||
/* U+63 "c" */
|
||||
0x3f, 0xcf, 0xff, 0x3, 0xc0, 0xf0, 0x3c, 0xf,
|
||||
0x3, 0xc0, 0x3f, 0xcf, 0xf0,
|
||||
|
||||
/* U+64 "d" */
|
||||
0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf, 0x3f, 0xf3,
|
||||
0xff, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0,
|
||||
0xff, 0xf, 0x3f, 0xf3, 0xff,
|
||||
|
||||
/* U+65 "e" */
|
||||
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xff, 0xff,
|
||||
0xff, 0xf0, 0xf, 0x0, 0x3f, 0xc3, 0xfc,
|
||||
|
||||
/* U+66 "f" */
|
||||
0xf, 0xc3, 0xf3, 0xc0, 0xf0, 0xff, 0xff, 0xf3,
|
||||
0xc0, 0xf0, 0x3c, 0xf, 0x3, 0xc0, 0xf0, 0x3c,
|
||||
0xf, 0x0,
|
||||
|
||||
/* U+67 "g" */
|
||||
0x3f, 0xf3, 0xff, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0x3f, 0xf3, 0xff, 0x0, 0xf0, 0xf, 0xff,
|
||||
0xcf, 0xfc,
|
||||
|
||||
/* U+68 "h" */
|
||||
0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xff, 0xcf,
|
||||
0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0,
|
||||
0xff, 0xf, 0xf0, 0xff, 0xf,
|
||||
|
||||
/* U+69 "i" */
|
||||
0x3c, 0xf, 0x0, 0x0, 0x0, 0xfc, 0x3f, 0x3,
|
||||
0xc0, 0xf0, 0x3c, 0xf, 0x3, 0xc0, 0xf0, 0x3f,
|
||||
0xcf, 0xf0,
|
||||
|
||||
/* U+6A "j" */
|
||||
0x3, 0xc0, 0xf0, 0x0, 0x0, 0x3, 0xc0, 0xf0,
|
||||
0x3c, 0xf, 0x3, 0xc0, 0xf0, 0x3c, 0xf, 0x3,
|
||||
0xc0, 0xff, 0xf3, 0xfc,
|
||||
|
||||
/* U+6B "k" */
|
||||
0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0, 0xf0, 0xff,
|
||||
0xf, 0xf3, 0xcf, 0x3c, 0xff, 0xf, 0xf0, 0xf3,
|
||||
0xcf, 0x3c, 0xf0, 0xff, 0xf,
|
||||
|
||||
/* U+6C "l" */
|
||||
0xfc, 0x3f, 0x3, 0xc0, 0xf0, 0x3c, 0xf, 0x3,
|
||||
0xc0, 0xf0, 0x3c, 0xf, 0x3, 0xc0, 0xf0, 0x3f,
|
||||
0xcf, 0xf0,
|
||||
|
||||
/* U+6D "m" */
|
||||
0xf0, 0xf3, 0xc3, 0xcf, 0xff, 0xff, 0xff, 0xf3,
|
||||
0x3f, 0xcc, 0xff, 0x33, 0xfc, 0xcf, 0xf0, 0x3f,
|
||||
0xc0, 0xf0,
|
||||
|
||||
/* U+6E "n" */
|
||||
0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf,
|
||||
|
||||
/* U+6F "o" */
|
||||
0x3f, 0xc3, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0xf0, 0xff, 0xf, 0x3f, 0xc3, 0xfc,
|
||||
|
||||
/* U+70 "p" */
|
||||
0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0xff, 0xcf, 0xfc, 0xf0, 0xf, 0x0, 0xf0,
|
||||
0xf, 0x0,
|
||||
|
||||
/* U+71 "q" */
|
||||
0x3f, 0xf3, 0xff, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0x3f, 0xf3, 0xff, 0x0, 0xf0, 0xf, 0x0,
|
||||
0xf0, 0xf,
|
||||
|
||||
/* U+72 "r" */
|
||||
0xff, 0xcf, 0xfc, 0xf0, 0xff, 0xf, 0xf0, 0xf,
|
||||
0x0, 0xf0, 0xf, 0x0, 0xf0, 0xf, 0x0,
|
||||
|
||||
/* U+73 "s" */
|
||||
0x3f, 0xf3, 0xff, 0xf0, 0xf, 0x0, 0x3f, 0xc3,
|
||||
0xfc, 0x0, 0xf0, 0xf, 0xff, 0xcf, 0xfc,
|
||||
|
||||
/* U+74 "t" */
|
||||
0x3c, 0x3, 0xc0, 0x3c, 0x3, 0xc0, 0xff, 0xff,
|
||||
0xff, 0x3c, 0x3, 0xc0, 0x3c, 0x3, 0xc0, 0x3c,
|
||||
0x3, 0xc0, 0xf, 0xf0, 0xff,
|
||||
|
||||
/* U+75 "u" */
|
||||
0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0xf0, 0xff, 0xf, 0x3f, 0xf3, 0xff,
|
||||
|
||||
/* U+76 "v" */
|
||||
0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0x3f, 0xc3, 0xfc, 0xf, 0x0, 0xf0,
|
||||
|
||||
/* U+77 "w" */
|
||||
0xf0, 0x3f, 0xc0, 0xff, 0x3, 0xfc, 0xf, 0xf3,
|
||||
0x3f, 0xcc, 0xf3, 0xff, 0xf, 0xfc, 0x3c, 0xf0,
|
||||
0xf3, 0xc0,
|
||||
|
||||
/* U+78 "x" */
|
||||
0xf0, 0x3f, 0xc0, 0xf3, 0xcf, 0xf, 0x3c, 0xf,
|
||||
0xc0, 0x3f, 0x3, 0xcf, 0xf, 0x3c, 0xf0, 0x3f,
|
||||
0xc0, 0xf0,
|
||||
|
||||
/* U+79 "y" */
|
||||
0xf0, 0xff, 0xf, 0xf0, 0xff, 0xf, 0xf0, 0xff,
|
||||
0xf, 0x3f, 0xf3, 0xff, 0x0, 0xf0, 0xf, 0x3f,
|
||||
0xc3, 0xfc,
|
||||
|
||||
/* U+7A "z" */
|
||||
0xff, 0xff, 0xff, 0x3, 0xc0, 0x3c, 0xf, 0x0,
|
||||
0xf0, 0x3c, 0x3, 0xc0, 0xff, 0xff, 0xff,
|
||||
|
||||
/* U+7B "{" */
|
||||
0x3, 0xf0, 0x3f, 0xf, 0x0, 0xf0, 0xf, 0x0,
|
||||
0xf0, 0xfc, 0xf, 0xc0, 0xf, 0x0, 0xf0, 0xf,
|
||||
0x0, 0xf0, 0x3, 0xf0, 0x3f,
|
||||
|
||||
/* U+7C "|" */
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
|
||||
/* U+7D "}" */
|
||||
0xfc, 0xf, 0xc0, 0xf, 0x0, 0xf0, 0xf, 0x0,
|
||||
0xf0, 0x3, 0xf0, 0x3f, 0xf, 0x0, 0xf0, 0xf,
|
||||
0x0, 0xf0, 0xfc, 0xf, 0xc0,
|
||||
|
||||
/* U+7E "~" */
|
||||
0x3f, 0x3c, 0xfc, 0xff, 0x3f, 0x3c, 0xfc,
|
||||
|
||||
/* U+7F "" */
|
||||
0xf0, 0x3, 0xc0, 0xc, 0xc0, 0x33, 0x0, 0xcc,
|
||||
0xff, 0x33, 0xfc, 0xc3, 0x33, 0xc, 0xf0, 0x33,
|
||||
0xc0, 0xc0, 0x3, 0x0, 0xc, 0x0, 0x30, 0x0,
|
||||
0xc0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
|
||||
{.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
|
||||
{.bitmap_index = 0, .adv_w = 256, .box_w = 1, .box_h = 1, .ofs_x = 0, .ofs_y = 16},
|
||||
{.bitmap_index = 1, .adv_w = 256, .box_w = 4, .box_h = 14, .ofs_x = 6, .ofs_y = 2},
|
||||
{.bitmap_index = 8, .adv_w = 256, .box_w = 12, .box_h = 6, .ofs_x = 2, .ofs_y = 10},
|
||||
{.bitmap_index = 17, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 42, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 63, .adv_w = 256, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 84, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 109, .adv_w = 256, .box_w = 6, .box_h = 6, .ofs_x = 4, .ofs_y = 10},
|
||||
{.bitmap_index = 114, .adv_w = 256, .box_w = 8, .box_h = 14, .ofs_x = 4, .ofs_y = 2},
|
||||
{.bitmap_index = 128, .adv_w = 256, .box_w = 8, .box_h = 14, .ofs_x = 4, .ofs_y = 2},
|
||||
{.bitmap_index = 142, .adv_w = 256, .box_w = 16, .box_h = 10, .ofs_x = 0, .ofs_y = 4},
|
||||
{.bitmap_index = 162, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 4},
|
||||
{.bitmap_index = 177, .adv_w = 256, .box_w = 6, .box_h = 6, .ofs_x = 4, .ofs_y = 0},
|
||||
{.bitmap_index = 182, .adv_w = 256, .box_w = 12, .box_h = 2, .ofs_x = 2, .ofs_y = 8},
|
||||
{.bitmap_index = 185, .adv_w = 256, .box_w = 4, .box_h = 4, .ofs_x = 6, .ofs_y = 2},
|
||||
{.bitmap_index = 187, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 215, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 236, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 257, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 278, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 299, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 324, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 345, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 366, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 387, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 408, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 429, .adv_w = 256, .box_w = 4, .box_h = 12, .ofs_x = 6, .ofs_y = 2},
|
||||
{.bitmap_index = 435, .adv_w = 256, .box_w = 6, .box_h = 14, .ofs_x = 4, .ofs_y = 0},
|
||||
{.bitmap_index = 446, .adv_w = 256, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 464, .adv_w = 256, .box_w = 12, .box_h = 6, .ofs_x = 2, .ofs_y = 6},
|
||||
{.bitmap_index = 473, .adv_w = 256, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 491, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 512, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 537, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 558, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 579, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 600, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 621, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 642, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 663, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 684, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 705, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 726, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 747, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 772, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 793, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 818, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 843, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 864, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 885, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 906, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 927, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 948, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 969, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 990, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1011, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 1036, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 1064, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 1092, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1113, .adv_w = 256, .box_w = 8, .box_h = 14, .ofs_x = 4, .ofs_y = 2},
|
||||
{.bitmap_index = 1127, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 1155, .adv_w = 256, .box_w = 8, .box_h = 14, .ofs_x = 4, .ofs_y = 2},
|
||||
{.bitmap_index = 1169, .adv_w = 256, .box_w = 14, .box_h = 8, .ofs_x = 0, .ofs_y = 8},
|
||||
{.bitmap_index = 1183, .adv_w = 256, .box_w = 16, .box_h = 2, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1187, .adv_w = 256, .box_w = 8, .box_h = 6, .ofs_x = 6, .ofs_y = 10},
|
||||
{.bitmap_index = 1193, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1208, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1229, .adv_w = 256, .box_w = 10, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1242, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1263, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1278, .adv_w = 256, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1296, .adv_w = 256, .box_w = 12, .box_h = 12, .ofs_x = 2, .ofs_y = 0},
|
||||
{.bitmap_index = 1314, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1335, .adv_w = 256, .box_w = 10, .box_h = 14, .ofs_x = 4, .ofs_y = 2},
|
||||
{.bitmap_index = 1353, .adv_w = 256, .box_w = 10, .box_h = 16, .ofs_x = 2, .ofs_y = 0},
|
||||
{.bitmap_index = 1373, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1394, .adv_w = 256, .box_w = 10, .box_h = 14, .ofs_x = 4, .ofs_y = 2},
|
||||
{.bitmap_index = 1412, .adv_w = 256, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 1430, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1445, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1460, .adv_w = 256, .box_w = 12, .box_h = 12, .ofs_x = 2, .ofs_y = 0},
|
||||
{.bitmap_index = 1478, .adv_w = 256, .box_w = 12, .box_h = 12, .ofs_x = 2, .ofs_y = 0},
|
||||
{.bitmap_index = 1496, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1511, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1526, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1547, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1562, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1577, .adv_w = 256, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 1595, .adv_w = 256, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 1613, .adv_w = 256, .box_w = 12, .box_h = 12, .ofs_x = 2, .ofs_y = 0},
|
||||
{.bitmap_index = 1631, .adv_w = 256, .box_w = 12, .box_h = 10, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1646, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1667, .adv_w = 256, .box_w = 4, .box_h = 14, .ofs_x = 6, .ofs_y = 2},
|
||||
{.bitmap_index = 1674, .adv_w = 256, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = 2},
|
||||
{.bitmap_index = 1695, .adv_w = 256, .box_w = 14, .box_h = 4, .ofs_x = 0, .ofs_y = 12},
|
||||
{.bitmap_index = 1702, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = 2}
|
||||
};
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] = {
|
||||
{
|
||||
.range_start = 32, .range_length = 96, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.glyph_bitmap = gylph_bitmap,
|
||||
.glyph_dsc = glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = NULL,
|
||||
.kern_scale = 0,
|
||||
.cmap_num = 1,
|
||||
.bpp = 1,
|
||||
.kern_classes = 0,
|
||||
.bitmap_format = 0
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
lv_font_t lv_font_unscii_16 = {
|
||||
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
|
||||
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
|
||||
.line_height = 17, /*The maximum line height required by the font*/
|
||||
.base_line = 0, /*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 = 0,
|
||||
.underline_thickness = 0,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if LV_FONT_UNSCII_16*/
|
||||
@@ -19,288 +19,289 @@
|
||||
/*Store the image of the glyphs*/
|
||||
static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
/* U+20 " " */
|
||||
0x0,
|
||||
|
||||
/* U+21 "!" */
|
||||
0xf2,
|
||||
0xff, 0xcc,
|
||||
|
||||
/* U+22 "\"" */
|
||||
0x99, 0x90,
|
||||
0xcf, 0x3c, 0xc0,
|
||||
|
||||
/* U+23 "#" */
|
||||
0x49, 0x2f, 0xd2, 0xfd, 0x24, 0x80,
|
||||
0x6c, 0xdb, 0xfb, 0x6f, 0xed, 0x9b, 0x0,
|
||||
|
||||
/* U+24 "$" */
|
||||
0x23, 0xe8, 0xe2, 0xf8, 0x80,
|
||||
0x31, 0xfc, 0x1e, 0xf, 0xe3, 0x0,
|
||||
|
||||
/* U+25 "%" */
|
||||
0xc7, 0x21, 0x8, 0x4e, 0x30,
|
||||
0xc7, 0x98, 0x61, 0x86, 0x78, 0xc0,
|
||||
|
||||
/* U+26 "&" */
|
||||
0x62, 0x49, 0x18, 0x96, 0x27, 0x40,
|
||||
0x38, 0xd8, 0xe3, 0xbd, 0xd9, 0x9d, 0x80,
|
||||
|
||||
/* U+27 "'" */
|
||||
0x2a, 0x0,
|
||||
0x6f, 0x0,
|
||||
|
||||
/* U+28 "(" */
|
||||
0x2a, 0x48, 0x88,
|
||||
0x36, 0xcc, 0xc6, 0x30,
|
||||
|
||||
/* U+29 ")" */
|
||||
0x88, 0x92, 0xa0,
|
||||
0xc6, 0x33, 0x36, 0xc0,
|
||||
|
||||
/* U+2A "*" */
|
||||
0x25, 0x5c, 0x47, 0x54, 0x80,
|
||||
0x66, 0x3c, 0xff, 0x3c, 0x66,
|
||||
|
||||
/* U+2B "+" */
|
||||
0x21, 0x3e, 0x42, 0x0,
|
||||
0x30, 0xcf, 0xcc, 0x30,
|
||||
|
||||
/* U+2C "," */
|
||||
0x58,
|
||||
0x6f, 0x0,
|
||||
|
||||
/* U+2D "-" */
|
||||
0xf8,
|
||||
0xfc,
|
||||
|
||||
/* U+2E "." */
|
||||
0x80,
|
||||
0xf0,
|
||||
|
||||
/* U+2F "/" */
|
||||
0x2, 0x8, 0x20, 0x82, 0x8, 0x20, 0x0,
|
||||
0x3, 0x6, 0xc, 0x18, 0x30, 0x60, 0xc0,
|
||||
|
||||
/* U+30 "0" */
|
||||
0x74, 0x67, 0x5c, 0xc5, 0xc0,
|
||||
0x7b, 0x3d, 0xfb, 0xcf, 0x37, 0x80,
|
||||
|
||||
/* U+31 "1" */
|
||||
0x23, 0x28, 0x42, 0x13, 0xe0,
|
||||
0x31, 0xc3, 0xc, 0x30, 0xcf, 0xc0,
|
||||
|
||||
/* U+32 "2" */
|
||||
0x74, 0x42, 0x26, 0x43, 0xe0,
|
||||
0x7b, 0x31, 0x8c, 0x63, 0xf, 0xc0,
|
||||
|
||||
/* U+33 "3" */
|
||||
0x74, 0x42, 0x60, 0xc5, 0xc0,
|
||||
0x7b, 0x30, 0xce, 0xf, 0x37, 0x80,
|
||||
|
||||
/* U+34 "4" */
|
||||
0x11, 0x95, 0x2f, 0x88, 0x40,
|
||||
0x1c, 0x79, 0xb6, 0x6f, 0xe1, 0x83, 0x0,
|
||||
|
||||
/* U+35 "5" */
|
||||
0xfc, 0x3c, 0x10, 0xc5, 0xc0,
|
||||
0xff, 0xf, 0x83, 0xf, 0x37, 0x80,
|
||||
|
||||
/* U+36 "6" */
|
||||
0x3a, 0x21, 0xe8, 0xc5, 0xc0,
|
||||
0x39, 0x8c, 0x3e, 0xcf, 0x37, 0x80,
|
||||
|
||||
/* U+37 "7" */
|
||||
0xf8, 0x44, 0x44, 0x21, 0x0,
|
||||
0xfc, 0x30, 0xc6, 0x30, 0xc3, 0x0,
|
||||
|
||||
/* U+38 "8" */
|
||||
0x74, 0x62, 0xe8, 0xc5, 0xc0,
|
||||
0x7b, 0x3c, 0xde, 0xcf, 0x37, 0x80,
|
||||
|
||||
/* U+39 "9" */
|
||||
0x74, 0x62, 0xf0, 0x8b, 0x80,
|
||||
0x7b, 0x3c, 0xdf, 0xc, 0x67, 0x0,
|
||||
|
||||
/* U+3A ":" */
|
||||
0x90,
|
||||
0xf0, 0xf0,
|
||||
|
||||
/* U+3B ";" */
|
||||
0x41, 0x60,
|
||||
0x6c, 0x6, 0xf0,
|
||||
|
||||
/* U+3C "<" */
|
||||
0x12, 0x48, 0x42, 0x10,
|
||||
0x19, 0x99, 0x86, 0x18, 0x60,
|
||||
|
||||
/* U+3D "=" */
|
||||
0xf8, 0x3e,
|
||||
0xfc, 0xf, 0xc0,
|
||||
|
||||
/* U+3E ">" */
|
||||
0x84, 0x21, 0x24, 0x80,
|
||||
0xc3, 0xc, 0x33, 0x33, 0x0,
|
||||
|
||||
/* U+3F "?" */
|
||||
0x7a, 0x10, 0x84, 0x10, 0x1, 0x0,
|
||||
0x7b, 0x30, 0xc6, 0x30, 0x3, 0x0,
|
||||
|
||||
/* U+40 "@" */
|
||||
0x7a, 0x19, 0x6b, 0x9a, 0x7, 0x80,
|
||||
0x7d, 0x8f, 0x7e, 0xfd, 0xf8, 0x1f, 0x0,
|
||||
|
||||
/* U+41 "A" */
|
||||
0x31, 0x28, 0x7f, 0x86, 0x18, 0x40,
|
||||
0x31, 0xec, 0xf3, 0xff, 0x3c, 0xc0,
|
||||
|
||||
/* U+42 "B" */
|
||||
0xfa, 0x18, 0x7e, 0x86, 0x1f, 0x80,
|
||||
0xfb, 0x3c, 0xfe, 0xcf, 0x3f, 0x80,
|
||||
|
||||
/* U+43 "C" */
|
||||
0x7a, 0x18, 0x20, 0x82, 0x17, 0x80,
|
||||
0x7b, 0x3c, 0x30, 0xc3, 0x37, 0x80,
|
||||
|
||||
/* U+44 "D" */
|
||||
0xf2, 0x28, 0x61, 0x86, 0x2f, 0x0,
|
||||
0xf3, 0x6c, 0xf3, 0xcf, 0x6f, 0x0,
|
||||
|
||||
/* U+45 "E" */
|
||||
0xfe, 0x8, 0x3c, 0x82, 0xf, 0xc0,
|
||||
0xff, 0xc, 0x3e, 0xc3, 0xf, 0xc0,
|
||||
|
||||
/* U+46 "F" */
|
||||
0xfe, 0x8, 0x3c, 0x82, 0x8, 0x0,
|
||||
0xff, 0xc, 0x3e, 0xc3, 0xc, 0x0,
|
||||
|
||||
/* U+47 "G" */
|
||||
0x7a, 0x18, 0x27, 0x86, 0x17, 0x80,
|
||||
0x7b, 0x3c, 0x37, 0xcf, 0x37, 0xc0,
|
||||
|
||||
/* U+48 "H" */
|
||||
0x86, 0x18, 0x7f, 0x86, 0x18, 0x40,
|
||||
0xcf, 0x3c, 0xff, 0xcf, 0x3c, 0xc0,
|
||||
|
||||
/* U+49 "I" */
|
||||
0xe9, 0x24, 0xb8,
|
||||
0xfc, 0xc3, 0xc, 0x30, 0xcf, 0xc0,
|
||||
|
||||
/* U+4A "J" */
|
||||
0x8, 0x42, 0x10, 0xc5, 0xc0,
|
||||
0xc, 0x30, 0xc3, 0xf, 0x37, 0x80,
|
||||
|
||||
/* U+4B "K" */
|
||||
0x86, 0x29, 0x38, 0x92, 0x28, 0x40,
|
||||
0xc7, 0x9b, 0x67, 0x8d, 0x99, 0xb1, 0x80,
|
||||
|
||||
/* U+4C "L" */
|
||||
0x82, 0x8, 0x20, 0x82, 0xf, 0xc0,
|
||||
0xc3, 0xc, 0x30, 0xc3, 0xf, 0xc0,
|
||||
|
||||
/* U+4D "M" */
|
||||
0x87, 0x3b, 0x61, 0x86, 0x18, 0x40,
|
||||
0xc7, 0xdf, 0xfe, 0xbc, 0x78, 0xf1, 0x80,
|
||||
|
||||
/* U+4E "N" */
|
||||
0x87, 0x1a, 0x65, 0x8e, 0x18, 0x40,
|
||||
0xc7, 0xcf, 0xde, 0xfc, 0xf8, 0xf1, 0x80,
|
||||
|
||||
/* U+4F "O" */
|
||||
0x7a, 0x18, 0x61, 0x86, 0x17, 0x80,
|
||||
0x7b, 0x3c, 0xf3, 0xcf, 0x37, 0x80,
|
||||
|
||||
/* U+50 "P" */
|
||||
0xfa, 0x18, 0x7e, 0x82, 0x8, 0x0,
|
||||
0xfb, 0x3c, 0xfe, 0xc3, 0xc, 0x0,
|
||||
|
||||
/* U+51 "Q" */
|
||||
0x7a, 0x18, 0x61, 0x96, 0x27, 0x40,
|
||||
0x7b, 0x3c, 0xf3, 0xcf, 0x66, 0xc0,
|
||||
|
||||
/* U+52 "R" */
|
||||
0xfa, 0x18, 0x7e, 0x92, 0x28, 0x40,
|
||||
0xfb, 0x3c, 0xfe, 0xdb, 0x3c, 0xc0,
|
||||
|
||||
/* U+53 "S" */
|
||||
0x7a, 0x18, 0x1e, 0x6, 0x17, 0x80,
|
||||
0x7b, 0x3c, 0x1e, 0xf, 0x37, 0x80,
|
||||
|
||||
/* U+54 "T" */
|
||||
0xf9, 0x8, 0x42, 0x10, 0x80,
|
||||
0xfc, 0xc3, 0xc, 0x30, 0xc3, 0x0,
|
||||
|
||||
/* U+55 "U" */
|
||||
0x86, 0x18, 0x61, 0x86, 0x17, 0x80,
|
||||
0xcf, 0x3c, 0xf3, 0xcf, 0x37, 0x80,
|
||||
|
||||
/* U+56 "V" */
|
||||
0x86, 0x18, 0x61, 0x85, 0x23, 0x0,
|
||||
0xcf, 0x3c, 0xf3, 0xcd, 0xe3, 0x0,
|
||||
|
||||
/* U+57 "W" */
|
||||
0x86, 0x18, 0x61, 0xb7, 0x38, 0x40,
|
||||
0xc7, 0x8f, 0x1e, 0xbf, 0xfd, 0xf1, 0x80,
|
||||
|
||||
/* U+58 "X" */
|
||||
0x86, 0x14, 0x8c, 0x4a, 0x18, 0x40,
|
||||
0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3,
|
||||
|
||||
/* U+59 "Y" */
|
||||
0x8c, 0x62, 0xe2, 0x10, 0x80,
|
||||
0xc3, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18,
|
||||
|
||||
/* U+5A "Z" */
|
||||
0xf8, 0x44, 0x44, 0x43, 0xe0,
|
||||
0xfc, 0x31, 0x8c, 0x63, 0xf, 0xc0,
|
||||
|
||||
/* U+5B "[" */
|
||||
0xf2, 0x49, 0x38,
|
||||
0xfc, 0xcc, 0xcc, 0xf0,
|
||||
|
||||
/* U+5C "\\" */
|
||||
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
|
||||
0xc0, 0x60, 0x30, 0x18, 0xc, 0x6, 0x3,
|
||||
|
||||
/* U+5D "]" */
|
||||
0xe4, 0x92, 0x78,
|
||||
0xf3, 0x33, 0x33, 0xf0,
|
||||
|
||||
/* U+5E "^" */
|
||||
0x22, 0xa2,
|
||||
0x10, 0x71, 0xb6, 0x30,
|
||||
|
||||
/* U+5F "_" */
|
||||
0xf8,
|
||||
|
||||
/* U+60 "`" */
|
||||
0x88, 0x80,
|
||||
|
||||
/* U+61 "a" */
|
||||
0x70, 0x5f, 0x17, 0x80,
|
||||
|
||||
/* U+62 "b" */
|
||||
0x84, 0x3d, 0x18, 0xc7, 0xc0,
|
||||
|
||||
/* U+63 "c" */
|
||||
0x74, 0x61, 0x17, 0x0,
|
||||
|
||||
/* U+64 "d" */
|
||||
0x8, 0x5f, 0x18, 0xc5, 0xe0,
|
||||
|
||||
/* U+65 "e" */
|
||||
0x74, 0x7f, 0x7, 0x0,
|
||||
|
||||
/* U+66 "f" */
|
||||
0x18, 0x92, 0x3e, 0x20, 0x82, 0x0,
|
||||
|
||||
/* U+67 "g" */
|
||||
0x7c, 0x62, 0xf0, 0xb8,
|
||||
|
||||
/* U+68 "h" */
|
||||
0x84, 0x3d, 0x18, 0xc6, 0x20,
|
||||
|
||||
/* U+69 "i" */
|
||||
0x43, 0x24, 0xb8,
|
||||
|
||||
/* U+6A "j" */
|
||||
0x10, 0x31, 0x11, 0x96,
|
||||
|
||||
/* U+6B "k" */
|
||||
0x84, 0x23, 0x2e, 0x4a, 0x20,
|
||||
|
||||
/* U+6C "l" */
|
||||
0xc9, 0x24, 0xb8,
|
||||
|
||||
/* U+6D "m" */
|
||||
0xd5, 0x6b, 0x5a, 0x80,
|
||||
|
||||
/* U+6E "n" */
|
||||
0xf4, 0x63, 0x18, 0x80,
|
||||
|
||||
/* U+6F "o" */
|
||||
0x74, 0x63, 0x17, 0x0,
|
||||
|
||||
/* U+70 "p" */
|
||||
0xf4, 0x63, 0xe8, 0x40,
|
||||
|
||||
/* U+71 "q" */
|
||||
0x7c, 0x62, 0xf0, 0x84,
|
||||
|
||||
/* U+72 "r" */
|
||||
0xbe, 0x21, 0x8, 0x0,
|
||||
|
||||
/* U+73 "s" */
|
||||
0x7c, 0x1c, 0x1f, 0x0,
|
||||
|
||||
/* U+74 "t" */
|
||||
0x42, 0x3c, 0x84, 0x24, 0xc0,
|
||||
|
||||
/* U+75 "u" */
|
||||
0x8c, 0x63, 0x17, 0x0,
|
||||
|
||||
/* U+76 "v" */
|
||||
0x8c, 0x62, 0xa2, 0x0,
|
||||
|
||||
/* U+77 "w" */
|
||||
0x8d, 0x6b, 0x55, 0x0,
|
||||
|
||||
/* U+78 "x" */
|
||||
0x8a, 0x88, 0xa8, 0x80,
|
||||
|
||||
/* U+79 "y" */
|
||||
0x8c, 0x62, 0xf0, 0xb8,
|
||||
|
||||
/* U+7A "z" */
|
||||
0xf8, 0x88, 0x8f, 0x80,
|
||||
|
||||
/* U+7B "{" */
|
||||
0x34, 0x48, 0x44, 0x30,
|
||||
|
||||
/* U+7C "|" */
|
||||
0xff,
|
||||
|
||||
/* U+60 "`" */
|
||||
0xc6, 0x30,
|
||||
|
||||
/* U+61 "a" */
|
||||
0x78, 0x37, 0xf3, 0x7c,
|
||||
|
||||
/* U+62 "b" */
|
||||
0xc3, 0xf, 0xb3, 0xcf, 0x3f, 0x80,
|
||||
|
||||
/* U+63 "c" */
|
||||
0x7e, 0x31, 0x87, 0x80,
|
||||
|
||||
/* U+64 "d" */
|
||||
0xc, 0x37, 0xf3, 0xcf, 0x37, 0xc0,
|
||||
|
||||
/* U+65 "e" */
|
||||
0x7b, 0x3f, 0xf0, 0x78,
|
||||
|
||||
/* U+66 "f" */
|
||||
0x3b, 0x3e, 0xc6, 0x31, 0x80,
|
||||
|
||||
/* U+67 "g" */
|
||||
0x7f, 0x3c, 0xdf, 0xf, 0xe0,
|
||||
|
||||
/* U+68 "h" */
|
||||
0xc3, 0xf, 0xb3, 0xcf, 0x3c, 0xc0,
|
||||
|
||||
/* U+69 "i" */
|
||||
0x60, 0x38, 0xc6, 0x31, 0xe0,
|
||||
|
||||
/* U+6A "j" */
|
||||
0x18, 0x6, 0x31, 0x8c, 0x7e,
|
||||
|
||||
/* U+6B "k" */
|
||||
0xc3, 0xc, 0xf6, 0xf3, 0x6c, 0xc0,
|
||||
|
||||
/* U+6C "l" */
|
||||
0xe3, 0x18, 0xc6, 0x31, 0xe0,
|
||||
|
||||
/* U+6D "m" */
|
||||
0xcd, 0xff, 0x5e, 0xbc, 0x60,
|
||||
|
||||
/* U+6E "n" */
|
||||
0xfb, 0x3c, 0xf3, 0xcc,
|
||||
|
||||
/* U+6F "o" */
|
||||
0x7b, 0x3c, 0xf3, 0x78,
|
||||
|
||||
/* U+70 "p" */
|
||||
0xfb, 0x3c, 0xfe, 0xc3, 0x0,
|
||||
|
||||
/* U+71 "q" */
|
||||
0x7f, 0x3c, 0xdf, 0xc, 0x30,
|
||||
|
||||
/* U+72 "r" */
|
||||
0xfb, 0x3c, 0x30, 0xc0,
|
||||
|
||||
/* U+73 "s" */
|
||||
0x7f, 0x7, 0x83, 0xf8,
|
||||
|
||||
/* U+74 "t" */
|
||||
0x61, 0x8f, 0xd8, 0x61, 0x83, 0xc0,
|
||||
|
||||
/* U+75 "u" */
|
||||
0xcf, 0x3c, 0xf3, 0x7c,
|
||||
|
||||
/* U+76 "v" */
|
||||
0xcf, 0x3c, 0xde, 0x30,
|
||||
|
||||
/* U+77 "w" */
|
||||
0xc7, 0x8f, 0x5b, 0xe6, 0xc0,
|
||||
|
||||
/* U+78 "x" */
|
||||
0xc6, 0xd8, 0xe3, 0x6c, 0x60,
|
||||
|
||||
/* U+79 "y" */
|
||||
0xcf, 0x3c, 0xdf, 0xd, 0xe0,
|
||||
|
||||
/* U+7A "z" */
|
||||
0xfc, 0x63, 0x18, 0xfc,
|
||||
|
||||
/* U+7B "{" */
|
||||
0x1c, 0xc3, 0x38, 0x30, 0xc1, 0xc0,
|
||||
|
||||
/* U+7C "|" */
|
||||
0xff, 0xfc,
|
||||
|
||||
/* U+7D "}" */
|
||||
0xc2, 0x21, 0x22, 0xc0,
|
||||
0xe0, 0xc3, 0x7, 0x30, 0xce, 0x0,
|
||||
|
||||
/* U+7E "~" */
|
||||
0x45, 0x44,
|
||||
0x77, 0xb8,
|
||||
|
||||
/* U+7F "" */
|
||||
0xc1, 0x42, 0xbd, 0x2c, 0x40, 0x81, 0x0
|
||||
@@ -312,103 +313,103 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
*--------------------*/
|
||||
|
||||
static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
|
||||
{.bitmap_index = 0, .adv_w = 0, .box_h = 0, .box_w = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
|
||||
{.bitmap_index = 0, .adv_w = 128, .box_h = 0, .box_w = 0, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 0, .adv_w = 128, .box_h = 7, .box_w = 1, .ofs_x = 3, .ofs_y = -1},
|
||||
{.bitmap_index = 1, .adv_w = 128, .box_h = 3, .box_w = 4, .ofs_x = 2, .ofs_y = 3},
|
||||
{.bitmap_index = 3, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 9, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 14, .adv_w = 128, .box_h = 6, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 19, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 25, .adv_w = 128, .box_h = 3, .box_w = 3, .ofs_x = 2, .ofs_y = 3},
|
||||
{.bitmap_index = 27, .adv_w = 128, .box_h = 7, .box_w = 3, .ofs_x = 2, .ofs_y = -1},
|
||||
{.bitmap_index = 30, .adv_w = 128, .box_h = 7, .box_w = 3, .ofs_x = 2, .ofs_y = -1},
|
||||
{.bitmap_index = 33, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 38, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 42, .adv_w = 128, .box_h = 3, .box_w = 2, .ofs_x = 3, .ofs_y = -2},
|
||||
{.bitmap_index = 43, .adv_w = 128, .box_h = 1, .box_w = 5, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 44, .adv_w = 128, .box_h = 1, .box_w = 1, .ofs_x = 3, .ofs_y = -1},
|
||||
{.bitmap_index = 45, .adv_w = 128, .box_h = 7, .box_w = 7, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 52, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 57, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 62, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 67, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 72, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 77, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 82, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 87, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 92, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 97, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 102, .adv_w = 128, .box_h = 4, .box_w = 1, .ofs_x = 3, .ofs_y = 0},
|
||||
{.bitmap_index = 103, .adv_w = 128, .box_h = 6, .box_w = 2, .ofs_x = 2, .ofs_y = -2},
|
||||
{.bitmap_index = 105, .adv_w = 128, .box_h = 7, .box_w = 4, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 109, .adv_w = 128, .box_h = 3, .box_w = 5, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 111, .adv_w = 128, .box_h = 7, .box_w = 4, .ofs_x = 2, .ofs_y = -1},
|
||||
{.bitmap_index = 115, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 121, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 127, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 133, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 139, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 145, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 151, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 157, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 163, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 169, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 175, .adv_w = 128, .box_h = 7, .box_w = 3, .ofs_x = 2, .ofs_y = -1},
|
||||
{.bitmap_index = 178, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 183, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 189, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 195, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 201, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 207, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 213, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 219, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 225, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 231, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 237, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 242, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 248, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 254, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 260, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 266, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 271, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 276, .adv_w = 128, .box_h = 7, .box_w = 3, .ofs_x = 2, .ofs_y = -1},
|
||||
{.bitmap_index = 279, .adv_w = 128, .box_h = 7, .box_w = 7, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 286, .adv_w = 128, .box_h = 7, .box_w = 3, .ofs_x = 2, .ofs_y = -1},
|
||||
{.bitmap_index = 289, .adv_w = 128, .box_h = 3, .box_w = 5, .ofs_x = 1, .ofs_y = 3},
|
||||
{.bitmap_index = 291, .adv_w = 128, .box_h = 1, .box_w = 5, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 292, .adv_w = 128, .box_h = 3, .box_w = 3, .ofs_x = 2, .ofs_y = 3},
|
||||
{.bitmap_index = 294, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 298, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 303, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 307, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 312, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 316, .adv_w = 128, .box_h = 7, .box_w = 6, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 322, .adv_w = 128, .box_h = 6, .box_w = 5, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 326, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 331, .adv_w = 128, .box_h = 7, .box_w = 3, .ofs_x = 2, .ofs_y = -1},
|
||||
{.bitmap_index = 334, .adv_w = 128, .box_h = 8, .box_w = 4, .ofs_x = 2, .ofs_y = -2},
|
||||
{.bitmap_index = 338, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 343, .adv_w = 128, .box_h = 7, .box_w = 3, .ofs_x = 2, .ofs_y = -1},
|
||||
{.bitmap_index = 346, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 350, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 354, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 358, .adv_w = 128, .box_h = 6, .box_w = 5, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 362, .adv_w = 128, .box_h = 6, .box_w = 5, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 366, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 370, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 374, .adv_w = 128, .box_h = 7, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 379, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 383, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 387, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 391, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 395, .adv_w = 128, .box_h = 6, .box_w = 5, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 399, .adv_w = 128, .box_h = 5, .box_w = 5, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 403, .adv_w = 128, .box_h = 7, .box_w = 4, .ofs_x = 1, .ofs_y = -1},
|
||||
{.bitmap_index = 407, .adv_w = 128, .box_h = 8, .box_w = 1, .ofs_x = 3, .ofs_y = -2},
|
||||
{.bitmap_index = 408, .adv_w = 128, .box_h = 7, .box_w = 4, .ofs_x = 2, .ofs_y = -1},
|
||||
{.bitmap_index = 412, .adv_w = 128, .box_h = 3, .box_w = 5, .ofs_x = 1, .ofs_y = 3},
|
||||
{.bitmap_index = 414, .adv_w = 128, .box_h = 7, .box_w = 7, .ofs_x = 0, .ofs_y = -1}
|
||||
{.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
|
||||
{.bitmap_index = 0, .adv_w = 128, .box_w = 1, .box_h = 1, .ofs_x = 0, .ofs_y = 8},
|
||||
{.bitmap_index = 1, .adv_w = 128, .box_w = 2, .box_h = 7, .ofs_x = 3, .ofs_y = 1},
|
||||
{.bitmap_index = 3, .adv_w = 128, .box_w = 6, .box_h = 3, .ofs_x = 1, .ofs_y = 5},
|
||||
{.bitmap_index = 6, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 13, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 19, .adv_w = 128, .box_w = 7, .box_h = 6, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 25, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 32, .adv_w = 128, .box_w = 3, .box_h = 3, .ofs_x = 2, .ofs_y = 5},
|
||||
{.bitmap_index = 34, .adv_w = 128, .box_w = 4, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
|
||||
{.bitmap_index = 38, .adv_w = 128, .box_w = 4, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
|
||||
{.bitmap_index = 42, .adv_w = 128, .box_w = 8, .box_h = 5, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 47, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 2},
|
||||
{.bitmap_index = 51, .adv_w = 128, .box_w = 3, .box_h = 3, .ofs_x = 2, .ofs_y = 0},
|
||||
{.bitmap_index = 53, .adv_w = 128, .box_w = 6, .box_h = 1, .ofs_x = 1, .ofs_y = 4},
|
||||
{.bitmap_index = 54, .adv_w = 128, .box_w = 2, .box_h = 2, .ofs_x = 3, .ofs_y = 1},
|
||||
{.bitmap_index = 55, .adv_w = 128, .box_w = 8, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 62, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 68, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 74, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 80, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 86, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 93, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 99, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 105, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 111, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 117, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 123, .adv_w = 128, .box_w = 2, .box_h = 6, .ofs_x = 3, .ofs_y = 1},
|
||||
{.bitmap_index = 125, .adv_w = 128, .box_w = 3, .box_h = 7, .ofs_x = 2, .ofs_y = 0},
|
||||
{.bitmap_index = 128, .adv_w = 128, .box_w = 5, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 133, .adv_w = 128, .box_w = 6, .box_h = 3, .ofs_x = 1, .ofs_y = 3},
|
||||
{.bitmap_index = 136, .adv_w = 128, .box_w = 5, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 141, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 147, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 154, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 160, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 166, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 172, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 178, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 184, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 190, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 196, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 202, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 208, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 214, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 221, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 227, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 234, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 241, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 247, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 253, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 259, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 265, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 271, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 277, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 283, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 289, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 296, .adv_w = 128, .box_w = 8, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 303, .adv_w = 128, .box_w = 8, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 310, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 316, .adv_w = 128, .box_w = 4, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
|
||||
{.bitmap_index = 320, .adv_w = 128, .box_w = 8, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 327, .adv_w = 128, .box_w = 4, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
|
||||
{.bitmap_index = 331, .adv_w = 128, .box_w = 7, .box_h = 4, .ofs_x = 0, .ofs_y = 4},
|
||||
{.bitmap_index = 335, .adv_w = 128, .box_w = 8, .box_h = 1, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 336, .adv_w = 128, .box_w = 4, .box_h = 3, .ofs_x = 3, .ofs_y = 5},
|
||||
{.bitmap_index = 338, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 342, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 348, .adv_w = 128, .box_w = 5, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 352, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 358, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 362, .adv_w = 128, .box_w = 5, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 367, .adv_w = 128, .box_w = 6, .box_h = 6, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 372, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 378, .adv_w = 128, .box_w = 5, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
|
||||
{.bitmap_index = 383, .adv_w = 128, .box_w = 5, .box_h = 8, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 388, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 394, .adv_w = 128, .box_w = 5, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
|
||||
{.bitmap_index = 399, .adv_w = 128, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 404, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 408, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 412, .adv_w = 128, .box_w = 6, .box_h = 6, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 417, .adv_w = 128, .box_w = 6, .box_h = 6, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 422, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 426, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 430, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 436, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 440, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 444, .adv_w = 128, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 449, .adv_w = 128, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 454, .adv_w = 128, .box_w = 6, .box_h = 6, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 459, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 463, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 469, .adv_w = 128, .box_w = 2, .box_h = 7, .ofs_x = 3, .ofs_y = 1},
|
||||
{.bitmap_index = 471, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
|
||||
{.bitmap_index = 477, .adv_w = 128, .box_w = 7, .box_h = 2, .ofs_x = 0, .ofs_y = 6},
|
||||
{.bitmap_index = 479, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1}
|
||||
};
|
||||
|
||||
/*---------------------
|
||||
@@ -420,8 +421,8 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] = {
|
||||
{
|
||||
.range_start = 32, .range_length = 96, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY,
|
||||
.glyph_id_start = 1, .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0
|
||||
.range_start = 32, .range_length = 96, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
}
|
||||
};
|
||||
|
||||
@@ -436,12 +437,12 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
.glyph_bitmap = gylph_bitmap,
|
||||
.glyph_dsc = glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = NULL,
|
||||
.kern_scale = 0,
|
||||
.cmap_num = 1,
|
||||
.bpp = 1,
|
||||
|
||||
.kern_scale = 0,
|
||||
.kern_dsc = NULL,
|
||||
.kern_classes = 0,
|
||||
.bitmap_format = 0
|
||||
};
|
||||
|
||||
|
||||
@@ -451,11 +452,20 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
lv_font_t lv_font_unscii_8 = {
|
||||
.dsc = &font_dsc, /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
|
||||
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
|
||||
.line_height = 8, /*The maximum line height required by the font*/
|
||||
.base_line = 2, /*Baseline measured from the bottom of the line*/
|
||||
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
|
||||
.line_height = 9, /*The maximum line height required by the font*/
|
||||
.base_line = 0, /*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 = 0,
|
||||
.underline_thickness = 0,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if LV_FONT_UNSCII_8*/
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
* INCLUDES
|
||||
*********************/
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "../lv_conf_internal.h"
|
||||
|
||||
#if LV_USE_GPU_NXP_PXP
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
#define PXP_OUT_PIXEL_FORMAT kPXP_OutputPixelFormatRGB565
|
||||
#define PXP_AS_PIXEL_FORMAT kPXP_AsPixelFormatRGB565
|
||||
#define PXP_PS_PIXEL_FORMAT kPXP_PsPixelFormatRGB565
|
||||
#elif
|
||||
#else
|
||||
#error Only 16bit color depth is supported. Set LV_COLOR_DEPTH to 16.
|
||||
#endif
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
* INCLUDES
|
||||
*********************/
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "../lv_conf_internal.h"
|
||||
|
||||
#if LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "../lv_conf_internal.h"
|
||||
|
||||
#if LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT
|
||||
extern lv_nxp_pxp_cfg_t pxp_default_cfg;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
* INCLUDES
|
||||
*********************/
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "../lv_conf_internal.h"
|
||||
|
||||
#if LV_USE_GPU_NXP_VG_LITE
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef LV_GPU_NXP_VG_LITE_LOG_ERRORS
|
||||
/** Enable logging of VG-Lite erors (\see LV_LOG_ERROR) */
|
||||
/** Enable logging of VG-Lite errors (\see LV_LOG_ERROR) */
|
||||
#define LV_GPU_NXP_VG_LITE_LOG_ERRORS 1
|
||||
#endif
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static void invalidate_cache(void);
|
||||
static void dma2d_wait(void);
|
||||
static void wait_finish(void);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@@ -104,7 +104,7 @@ void lv_gpu_stm32_dma2d_fill(lv_color_t * buf, lv_coord_t buf_w, lv_color_t colo
|
||||
/* start transfer */
|
||||
DMA2D->CR |= DMA2D_CR_START_Msk;
|
||||
|
||||
dma2d_wait();
|
||||
wait_finish();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,7 +149,7 @@ void lv_gpu_stm32_dma2d_fill_mask(lv_color_t * buf, lv_coord_t buf_w, lv_color_t
|
||||
HAL_DMA2D_ConfigLayer(&hdma2d, 0);
|
||||
HAL_DMA2D_ConfigLayer(&hdma2d, 1);
|
||||
HAL_DMA2D_BlendingStart(&hdma2d, (uint32_t) mask, (uint32_t) buf, (uint32_t)buf, fill_w, fill_h);
|
||||
dma2d_wait();
|
||||
wait_finish();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ void lv_gpu_stm32_dma2d_copy(lv_color_t * buf, lv_coord_t buf_w, const lv_color_
|
||||
|
||||
/* start transfer */
|
||||
DMA2D->CR |= DMA2D_CR_START_Msk;
|
||||
dma2d_wait();
|
||||
wait_finish();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -217,7 +217,19 @@ void lv_gpu_stm32_dma2d_blend(lv_color_t * buf, lv_coord_t buf_w, const lv_color
|
||||
|
||||
/* start transfer */
|
||||
DMA2D->CR |= DMA2D_CR_START_Msk;
|
||||
dma2d_wait();
|
||||
wait_finish();
|
||||
}
|
||||
|
||||
void lv_gpu_stm32_dma2d_wait_cb(lv_disp_drv_t * drv)
|
||||
{
|
||||
if(drv && drv->wait_cb) {
|
||||
while(DMA2D->CR & DMA2D_CR_START_Msk) {
|
||||
drv->wait_cb(drv);
|
||||
}
|
||||
}
|
||||
else {
|
||||
while(DMA2D->CR & DMA2D_CR_START_Msk);
|
||||
}
|
||||
}
|
||||
|
||||
/**********************
|
||||
@@ -230,14 +242,17 @@ static void invalidate_cache(void)
|
||||
if(disp->driver.clean_dcache_cb) disp->driver.clean_dcache_cb(&disp->driver);
|
||||
else {
|
||||
#if __CORTEX_M >= 0x07
|
||||
SCB_CleanInvalidateDCache();
|
||||
if((SCB->CCR) & (uint32_t)SCB_CCR_DC_Msk)
|
||||
SCB_CleanInvalidateDCache();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static void dma2d_wait(void)
|
||||
static void wait_finish(void)
|
||||
{
|
||||
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
||||
if(disp->driver.gpu_wait_cb) return;
|
||||
|
||||
while(DMA2D->CR & DMA2D_CR_START_Msk) {
|
||||
if(disp->driver.wait_cb) disp->driver.wait_cb(&disp->driver);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ extern "C" {
|
||||
*********************/
|
||||
#include "../lv_misc/lv_area.h"
|
||||
#include "../lv_misc/lv_color.h"
|
||||
#include "../lv_hal/lv_hal_disp.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -91,6 +92,14 @@ void lv_gpu_stm32_dma2d_copy(lv_color_t * buf, lv_coord_t buf_w, const lv_color_
|
||||
*/
|
||||
void lv_gpu_stm32_dma2d_blend(lv_color_t * buf, lv_coord_t buf_w, const lv_color_t * map, lv_opa_t opa,
|
||||
lv_coord_t map_w, lv_coord_t copy_w, lv_coord_t copy_h);
|
||||
|
||||
|
||||
/**
|
||||
* Can be used as `gpu_wait_cb` in display driver to
|
||||
* let the MCU run while the GPU is working
|
||||
*/
|
||||
void lv_gpu_stm32_dma2d_wait_cb(lv_disp_drv_t * drv);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
@@ -153,8 +153,11 @@ typedef struct _disp_t {
|
||||
|
||||
/** Screens of the display*/
|
||||
lv_ll_t scr_ll;
|
||||
struct _lv_obj_t * act_scr; /**< Currently active screen on this display */
|
||||
struct _lv_obj_t * prev_scr; /**< Previous screen. Used during screen animations */
|
||||
struct _lv_obj_t * act_scr; /**< Currently active screen on this display */
|
||||
struct _lv_obj_t * prev_scr; /**< Previous screen. Used during screen animations */
|
||||
#if LV_USE_ANIMATION
|
||||
struct _lv_obj_t * scr_to_load; /**< The screen prepared to load in lv_scr_load_anim*/
|
||||
#endif
|
||||
struct _lv_obj_t * top_layer; /**< @see lv_disp_get_layer_top */
|
||||
struct _lv_obj_t * sys_layer; /**< @see lv_disp_get_layer_sys */
|
||||
|
||||
|
||||
@@ -150,9 +150,9 @@ bool _lv_indev_read(lv_indev_t * indev, lv_indev_data_t * data)
|
||||
}
|
||||
|
||||
if(indev->driver.read_cb) {
|
||||
LV_LOG_TRACE("idnev read started");
|
||||
LV_LOG_TRACE("indev read started");
|
||||
cont = indev->driver.read_cb(&indev->driver, data);
|
||||
LV_LOG_TRACE("idnev read finished");
|
||||
LV_LOG_TRACE("indev read finished");
|
||||
}
|
||||
else {
|
||||
LV_LOG_WARN("indev function registered");
|
||||
|
||||
@@ -341,7 +341,7 @@ lv_anim_value_t lv_anim_path_overshoot(const lv_anim_path_t * path, const lv_ani
|
||||
else
|
||||
t = (uint32_t)((uint32_t)a->act_time * 1024) / a->time;
|
||||
|
||||
int32_t step = _lv_bezier3(t, 0, 1000, 2000, 1024);
|
||||
int32_t step = _lv_bezier3(t, 0, 1000, 1300, 1024);
|
||||
|
||||
int32_t new_value;
|
||||
new_value = (int32_t)step * (a->end - a->start);
|
||||
@@ -362,7 +362,7 @@ lv_anim_value_t lv_anim_path_bounce(const lv_anim_path_t * path, const lv_anim_t
|
||||
LV_UNUSED(path);
|
||||
|
||||
/*Calculate the current step*/
|
||||
uint32_t t;
|
||||
int32_t t;
|
||||
if(a->time == a->act_time)
|
||||
t = 1024;
|
||||
else
|
||||
@@ -381,31 +381,32 @@ lv_anim_value_t lv_anim_path_bounce(const lv_anim_path_t * path, const lv_anim_t
|
||||
t -= 408;
|
||||
t = t * 5; /*to [0..1024] range*/
|
||||
t = 1024 - t;
|
||||
diff = diff / 6;
|
||||
diff = diff / 20;
|
||||
}
|
||||
else if(t >= 614 && t < 819) {
|
||||
/*Fall back*/
|
||||
t -= 614;
|
||||
t = t * 5; /*to [0..1024] range*/
|
||||
diff = diff / 6;
|
||||
diff = diff / 20;
|
||||
}
|
||||
else if(t >= 819 && t < 921) {
|
||||
/*Second bounce back*/
|
||||
t -= 819;
|
||||
t = t * 10; /*to [0..1024] range*/
|
||||
t = 1024 - t;
|
||||
diff = diff / 16;
|
||||
diff = diff / 40;
|
||||
}
|
||||
else if(t >= 921 && t <= 1024) {
|
||||
/*Fall back*/
|
||||
t -= 921;
|
||||
t = t * 10; /*to [0..1024] range*/
|
||||
diff = diff / 16;
|
||||
diff = diff / 40;
|
||||
}
|
||||
|
||||
if(t > 1024) t = 1024;
|
||||
if(t < 0) t = 0;
|
||||
|
||||
int32_t step = _lv_bezier3(t, 1024, 1024, 800, 0);
|
||||
int32_t step = _lv_bezier3(t, 1024, 800, 500, 0);
|
||||
|
||||
int32_t new_value;
|
||||
new_value = (int32_t)step * diff;
|
||||
|
||||
@@ -59,4 +59,4 @@ lv_res_t lv_async_call(lv_async_cb_t async_xcb, void * user_data);
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_TEMPL_H*/
|
||||
#endif /*LV_ASYNC_H*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file lv_bifi.h
|
||||
* @file lv_bidi.h
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -108,9 +108,9 @@ enum {
|
||||
* Macros for all existing color depths
|
||||
* to set/get values of the color channels
|
||||
*------------------------------------------*/
|
||||
# define LV_COLOR_SET_R1(c, v) (c).ch.red = (uint8_t)((v) & 0x1);
|
||||
# define LV_COLOR_SET_G1(c, v) (c).ch.green = (uint8_t)((v) & 0x1);
|
||||
# define LV_COLOR_SET_B1(c, v) (c).ch.blue = (uint8_t)((v) & 0x1);
|
||||
# define LV_COLOR_SET_R1(c, v) (c).ch.red = (uint8_t)((v) & 0x1)
|
||||
# define LV_COLOR_SET_G1(c, v) (c).ch.green = (uint8_t)((v) & 0x1)
|
||||
# define LV_COLOR_SET_B1(c, v) (c).ch.blue = (uint8_t)((v) & 0x1)
|
||||
# define LV_COLOR_SET_A1(c, v)
|
||||
|
||||
# define LV_COLOR_GET_R1(c) (c).ch.red
|
||||
@@ -118,9 +118,9 @@ enum {
|
||||
# define LV_COLOR_GET_B1(c) (c).ch.blue
|
||||
# define LV_COLOR_GET_A1(c) 1
|
||||
|
||||
# define LV_COLOR_SET_R8(c, v) (c).ch.red = (uint8_t)(v) & 0x7U;
|
||||
# define LV_COLOR_SET_G8(c, v) (c).ch.green = (uint8_t)(v) & 0x7U;
|
||||
# define LV_COLOR_SET_B8(c, v) (c).ch.blue = (uint8_t)(v) & 0x3U;
|
||||
# define LV_COLOR_SET_R8(c, v) (c).ch.red = (uint8_t)(v) & 0x7U
|
||||
# define LV_COLOR_SET_G8(c, v) (c).ch.green = (uint8_t)(v) & 0x7U
|
||||
# define LV_COLOR_SET_B8(c, v) (c).ch.blue = (uint8_t)(v) & 0x3U
|
||||
# define LV_COLOR_SET_A8(c, v) do {} while(0)
|
||||
|
||||
# define LV_COLOR_GET_R8(c) (c).ch.red
|
||||
@@ -128,10 +128,10 @@ enum {
|
||||
# define LV_COLOR_GET_B8(c) (c).ch.blue
|
||||
# define LV_COLOR_GET_A8(c) 0xFF
|
||||
|
||||
# define LV_COLOR_SET_R16(c, v) (c).ch.red = (uint8_t)(v) & 0x1FU;
|
||||
# define LV_COLOR_SET_G16(c, v) (c).ch.green = (uint8_t)(v) & 0x3FU;
|
||||
# define LV_COLOR_SET_R16(c, v) (c).ch.red = (uint8_t)(v) & 0x1FU
|
||||
# define LV_COLOR_SET_G16(c, v) (c).ch.green = (uint8_t)(v) & 0x3FU
|
||||
# define LV_COLOR_SET_G16_SWAP(c, v) {(c).ch.green_h = (uint8_t)(((v) >> 3) & 0x7); (c).ch.green_l = (uint8_t)((v) & 0x7);}
|
||||
# define LV_COLOR_SET_B16(c, v) (c).ch.blue = (uint8_t)(v) & 0x1FU;
|
||||
# define LV_COLOR_SET_B16(c, v) (c).ch.blue = (uint8_t)(v) & 0x1FU
|
||||
# define LV_COLOR_SET_A16(c, v) do {} while(0)
|
||||
|
||||
# define LV_COLOR_GET_R16(c) (c).ch.red
|
||||
@@ -140,10 +140,10 @@ enum {
|
||||
# define LV_COLOR_GET_B16(c) (c).ch.blue
|
||||
# define LV_COLOR_GET_A16(c) 0xFF
|
||||
|
||||
# define LV_COLOR_SET_R32(c, v) (c).ch.red = (uint32_t)((v) & 0xFF);
|
||||
# define LV_COLOR_SET_G32(c, v) (c).ch.green = (uint32_t)((v) & 0xFF);
|
||||
# define LV_COLOR_SET_B32(c, v) (c).ch.blue = (uint32_t)((v) & 0xFF);
|
||||
# define LV_COLOR_SET_A32(c, v) (c).ch.alpha = (uint32_t)((v) & 0xFF);
|
||||
# define LV_COLOR_SET_R32(c, v) (c).ch.red = (uint32_t)((v) & 0xFF)
|
||||
# define LV_COLOR_SET_G32(c, v) (c).ch.green = (uint32_t)((v) & 0xFF)
|
||||
# define LV_COLOR_SET_B32(c, v) (c).ch.blue = (uint32_t)((v) & 0xFF)
|
||||
# define LV_COLOR_SET_A32(c, v) (c).ch.alpha = (uint32_t)((v) & 0xFF)
|
||||
|
||||
# define LV_COLOR_GET_R32(c) (c).ch.red
|
||||
# define LV_COLOR_GET_G32(c) (c).ch.green
|
||||
@@ -267,7 +267,11 @@ typedef lv_color8_t lv_color_t;
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
typedef uint16_t lv_color_int_t;
|
||||
typedef lv_color16_t lv_color_t;
|
||||
#define _LV_COLOR_ZERO_INITIALIZER {{0x00, 0x00, 0x00}}
|
||||
# if LV_COLOR_16_SWAP == 0
|
||||
# define _LV_COLOR_ZERO_INITIALIZER {{0x00, 0x00, 0x00}}
|
||||
# else
|
||||
# define _LV_COLOR_ZERO_INITIALIZER {{0x00, 0x00, 0x00, 0x00}}
|
||||
# endif
|
||||
#elif LV_COLOR_DEPTH == 32
|
||||
typedef uint32_t lv_color_int_t;
|
||||
typedef lv_color32_t lv_color_t;
|
||||
|
||||
@@ -348,8 +348,8 @@ lv_fs_res_t lv_fs_rename(const char * oldname, const char * newname)
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize a 'fs_read_dir_t' variable for directory reading
|
||||
* @param rddir_p pointer to a 'fs_read_dir_t' variable
|
||||
* Initialize a 'lv_fs_dir_t' variable for directory reading
|
||||
* @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
|
||||
*/
|
||||
@@ -387,7 +387,7 @@ lv_fs_res_t lv_fs_dir_open(lv_fs_dir_t * rddir_p, const char * path)
|
||||
/**
|
||||
* Read the next filename form a directory.
|
||||
* The name of the directories will begin with '/'
|
||||
* @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
|
||||
*/
|
||||
@@ -409,7 +409,7 @@ lv_fs_res_t lv_fs_dir_read(lv_fs_dir_t * rddir_p, char * fn)
|
||||
|
||||
/**
|
||||
* Close the directory reading
|
||||
* @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
|
||||
*/
|
||||
lv_fs_res_t lv_fs_dir_close(lv_fs_dir_t * rddir_p)
|
||||
|
||||
@@ -221,7 +221,7 @@ lv_fs_res_t lv_fs_rename(const char * oldname, const char * newname);
|
||||
|
||||
/**
|
||||
* Initialize a 'fs_dir_t' variable for directory reading
|
||||
* @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
|
||||
*/
|
||||
@@ -230,7 +230,7 @@ lv_fs_res_t lv_fs_dir_open(lv_fs_dir_t * rddir_p, const char * path);
|
||||
/**
|
||||
* Read the next filename form a directory.
|
||||
* The name of the directories will begin with '/'
|
||||
* @param rddir_p pointer to an initialized 'fs_rdir_t' variable
|
||||
* @param rddir_p pointer to an initialized '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
|
||||
*/
|
||||
|
||||
@@ -536,7 +536,7 @@ void * _lv_mem_buf_get(uint32_t size)
|
||||
}
|
||||
}
|
||||
|
||||
LV_DEBUG_ASSERT(false, "No free buffer. Increase LV_DRAW_BUF_MAX_NUM.", 0x00);
|
||||
LV_DEBUG_ASSERT(false, "No free buffer. Increase LV_MEM_BUF_MAX_NUM.", 0x00);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,12 @@
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <stdarg.h>
|
||||
#include "lv_txt.h"
|
||||
#include "lv_txt_ap.h"
|
||||
#include "lv_math.h"
|
||||
#include "lv_log.h"
|
||||
#include "lv_debug.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -389,7 +392,7 @@ lv_coord_t _lv_txt_get_width(const char * txt, uint32_t length, const lv_font_t
|
||||
/**
|
||||
* Check next character in a string and decide if the character is part of the command or not
|
||||
* @param state pointer to a txt_cmd_state_t variable which stores the current state of command
|
||||
* processing (Initied. to TXT_CMD_STATE_WAIT )
|
||||
* processing (Inited to TXT_CMD_STATE_WAIT )
|
||||
* @param c the current character
|
||||
* @return true: the character is part of a command and should not be written,
|
||||
* false: the character should be written
|
||||
@@ -473,9 +476,57 @@ void _lv_txt_cut(char * txt, uint32_t pos, uint32_t len)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* return a new formatted text. Memory will be allocated to store the text.
|
||||
* @param fmt `printf`-like format
|
||||
* @return pointer to the allocated text string.
|
||||
*/
|
||||
char * _lv_txt_set_text_vfmt(const char * fmt, va_list ap)
|
||||
{
|
||||
/*Allocate space for the new text by using trick from C99 standard section 7.19.6.12 */
|
||||
va_list ap_copy;
|
||||
va_copy(ap_copy, ap);
|
||||
uint32_t len = lv_vsnprintf(NULL, 0, fmt, ap_copy);
|
||||
va_end(ap_copy);
|
||||
|
||||
char * text = 0;
|
||||
#if LV_USE_ARABIC_PERSIAN_CHARS
|
||||
/*Put together the text according to the format string*/
|
||||
char * raw_txt = _lv_mem_buf_get(len + 1);
|
||||
LV_ASSERT_MEM(raw_txt);
|
||||
if(raw_txt == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
lv_vsnprintf(raw_txt, len + 1, fmt, ap);
|
||||
|
||||
/*Get the size of the Arabic text and process it*/
|
||||
size_t len_ap = _lv_txt_ap_calc_bytes_cnt(raw_txt);
|
||||
text = lv_mem_alloc(len_ap + 1);
|
||||
LV_ASSERT_MEM(text);
|
||||
if(text == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
_lv_txt_ap_proc(raw_txt, text);
|
||||
|
||||
_lv_mem_buf_release(raw_txt);
|
||||
#else
|
||||
text = lv_mem_alloc(len + 1);
|
||||
LV_ASSERT_MEM(text);
|
||||
if(text == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
text[len] = 0; /* Ensure NULL termination */
|
||||
|
||||
lv_vsnprintf(text, len + 1, fmt, ap);
|
||||
#endif
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
#if LV_TXT_ENC == LV_TXT_ENC_UTF8
|
||||
/*******************************
|
||||
* UTF-8 ENCODER/DECOER
|
||||
* UTF-8 ENCODER/DECODER
|
||||
******************************/
|
||||
|
||||
/**
|
||||
@@ -743,7 +794,7 @@ static uint8_t lv_txt_iso8859_1_size(const char * str)
|
||||
*/
|
||||
static uint32_t lv_txt_unicode_to_iso8859_1(uint32_t letter_uni)
|
||||
{
|
||||
if(letter_uni < 128)
|
||||
if(letter_uni < 256)
|
||||
return letter_uni;
|
||||
else
|
||||
return ' ';
|
||||
|
||||
@@ -16,9 +16,11 @@ extern "C" {
|
||||
#include "../lv_conf_internal.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdarg.h>
|
||||
#include "lv_area.h"
|
||||
#include "lv_area.h"
|
||||
#include "../lv_font/lv_font.h"
|
||||
#include "lv_printf.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -127,8 +129,15 @@ void _lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt);
|
||||
*/
|
||||
void _lv_txt_cut(char * txt, uint32_t pos, uint32_t len);
|
||||
|
||||
/**
|
||||
* return a new formatted text. Memory will be allocated to store the text.
|
||||
* @param fmt `printf`-like format
|
||||
* @return pointer to the allocated text string.
|
||||
*/
|
||||
char * _lv_txt_set_text_vfmt(const char * fmt, va_list ap);
|
||||
|
||||
/***************************************************************
|
||||
* GLOBAL FUNCTION POINTERS FOR CAHRACTER ENCODING INTERFACE
|
||||
* GLOBAL FUNCTION POINTERS FOR CHARACTER ENCODING INTERFACE
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
|
||||
@@ -69,7 +69,7 @@ const ap_chars_map_t ap_chars_map[] = {
|
||||
{36, 0xFEE6, 1, 2, -1, {1, 1}}, // ن
|
||||
{38, 0xFEEE, -1, 0, -1, {1, 0}}, // و
|
||||
{37, 0xFEEA, 1, 2, -1, {1, 1}}, // ه
|
||||
{39, 0xFBFD, 1, 2, -1, {1, 1}}, // ي
|
||||
{39, 0xFEF0, 0, 0, -1, {1, 0}}, // ى
|
||||
{40, 0xFEF2, 1, 2, -1, {1, 1}}, // ي
|
||||
{170, 0xFBFD, 1, 2, -1, {1, 1}}, // ی
|
||||
{7, 0xFE94, 1, 2, -1, {1, 0}}, // ة
|
||||
@@ -211,6 +211,12 @@ static uint32_t lv_ap_get_char_index(uint16_t c)
|
||||
for(uint8_t i = 0; ap_chars_map[i].char_end_form; i++) {
|
||||
if(c == (ap_chars_map[i].char_offset + LV_AP_ALPHABET_BASE_CODE))
|
||||
return i;
|
||||
else if(c == ap_chars_map[i].char_end_form //is it an End form
|
||||
|| c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_begining_form_offset) //is it a Begining form
|
||||
|| c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_middle_form_offset) //is it a middle form
|
||||
|| c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_isolated_form_offset)) { //is it an isolated form
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return LV_UNDEF_ARABIC_PERSIAN_CHARS;
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ static void clear_styles(lv_obj_t * obj, lv_theme_style_t name)
|
||||
#if LV_USE_TABVIEW
|
||||
case LV_THEME_TABVIEW:
|
||||
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG);
|
||||
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG_SCRLLABLE);
|
||||
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG_SCROLLABLE);
|
||||
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_TAB_BG);
|
||||
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_INDIC);
|
||||
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_TAB_BTN);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
/*BUTTON*/
|
||||
#define COLOR_BTN (IS_LIGHT ? lv_color_hex(0xffffff) : lv_color_hex(0x586273))
|
||||
#define COLOR_BTN_PR (IS_LIGHT ? lv_color_mix(theme.color_primary, COLOR_BTN, LV_OPA_10) : lv_color_mix(theme.color_primary, COLOR_BTN, LV_OPA_30))
|
||||
#define COLOR_BTN_PR (IS_LIGHT ? lv_color_mix(theme.color_primary, COLOR_BTN, LV_OPA_20) : lv_color_mix(theme.color_primary, COLOR_BTN, LV_OPA_30))
|
||||
|
||||
#define COLOR_BTN_CHK (theme.color_primary)
|
||||
#define COLOR_BTN_CHK_PR (lv_color_darken(theme.color_primary, LV_OPA_30))
|
||||
@@ -316,10 +316,10 @@ static void basic_init(void)
|
||||
style_init_reset(&styles->pad_inner);
|
||||
|
||||
lv_style_set_pad_inner(&styles->pad_inner, LV_STATE_DEFAULT,
|
||||
lv_disp_get_size_category(NULL) <= LV_DISP_MEDIUM_LIMIT ? LV_DPX(20) : LV_DPX(40));
|
||||
lv_disp_get_size_category(NULL) <= LV_DISP_SIZE_MEDIUM ? LV_DPX(20) : LV_DPX(40));
|
||||
|
||||
style_init_reset(&styles->pad_small);
|
||||
lv_style_int_t pad_small_value = lv_disp_get_size_category(NULL) <= LV_DISP_MEDIUM_LIMIT ? LV_DPX(10) : LV_DPX(20);
|
||||
lv_style_int_t pad_small_value = lv_disp_get_size_category(NULL) <= LV_DISP_SIZE_MEDIUM ? LV_DPX(10) : LV_DPX(20);
|
||||
lv_style_set_pad_left(&styles->pad_small, LV_STATE_DEFAULT, pad_small_value);
|
||||
lv_style_set_pad_right(&styles->pad_small, LV_STATE_DEFAULT, pad_small_value);
|
||||
lv_style_set_pad_top(&styles->pad_small, LV_STATE_DEFAULT, pad_small_value);
|
||||
@@ -844,10 +844,6 @@ static void tabview_win_shared_init(void)
|
||||
style_init_reset(&styles->tabview_btns_bg);
|
||||
lv_style_set_bg_opa(&styles->tabview_btns_bg, LV_STATE_DEFAULT, LV_OPA_COVER);
|
||||
lv_style_set_bg_color(&styles->tabview_btns_bg, LV_STATE_DEFAULT, COLOR_BG);
|
||||
lv_style_set_border_color(&styles->tabview_btns_bg, LV_STATE_DEFAULT,
|
||||
IS_LIGHT ? lv_color_hex(0xe4eaf0) : lv_color_hex(0x3b3e42));
|
||||
lv_style_set_border_width(&styles->tabview_btns_bg, LV_STATE_DEFAULT, LV_DPX(5));
|
||||
lv_style_set_border_side(&styles->tabview_btns_bg, LV_STATE_DEFAULT, LV_BORDER_SIDE_BOTTOM);
|
||||
lv_style_set_text_color(&styles->tabview_btns_bg, LV_STATE_DEFAULT, COLOR_SCR_TEXT);
|
||||
lv_style_set_image_recolor(&styles->tabview_btns_bg, LV_STATE_DEFAULT, lv_color_hex(0x979a9f));
|
||||
lv_style_set_pad_top(&styles->tabview_btns_bg, LV_STATE_DEFAULT, LV_DPX(7));
|
||||
|
||||
@@ -618,7 +618,7 @@ void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
|
||||
list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG);
|
||||
_lv_style_list_add_style(list, &styles->bg);
|
||||
|
||||
list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG_SCRLLABLE);
|
||||
list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG_SCROLLABLE);
|
||||
_lv_style_list_add_style(list, &styles->bg);
|
||||
_lv_style_list_add_style(list, &styles->color);
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ lv_obj_t * lv_arc_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
ext->arc_angle_end = 270;
|
||||
ext->type = LV_ARC_TYPE_NORMAL;
|
||||
ext->cur_value = -1;
|
||||
ext->min_close = 1;
|
||||
ext->min_value = 0;
|
||||
ext->max_value = 100;
|
||||
ext->dragging = false;
|
||||
@@ -272,6 +273,8 @@ void lv_arc_set_bg_start_angle(lv_obj_t * arc, uint16_t start)
|
||||
}
|
||||
|
||||
ext->bg_angle_start = start;
|
||||
|
||||
value_update(arc);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -304,6 +307,8 @@ void lv_arc_set_bg_end_angle(lv_obj_t * arc, uint16_t end)
|
||||
lv_obj_invalidate(arc);
|
||||
}
|
||||
|
||||
value_update(arc);
|
||||
|
||||
ext->bg_angle_end = end;
|
||||
}
|
||||
|
||||
@@ -328,6 +333,8 @@ void lv_arc_set_bg_angles(lv_obj_t * arc, uint16_t start, uint16_t end)
|
||||
ext->bg_angle_end = end;
|
||||
|
||||
inv_arc_area(arc, ext->bg_angle_start, ext->bg_angle_end, LV_ARC_PART_BG);
|
||||
|
||||
value_update(arc);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -751,6 +758,9 @@ static lv_res_t lv_arc_signal(lv_obj_t * arc, lv_signal_t sign, void * param)
|
||||
/*It must be in "dragging" mode to turn the arc*/
|
||||
if(ext->dragging == false) return res;
|
||||
|
||||
/*No angle can be determined if exactly the middle of the arc is being pressed*/
|
||||
if(p.x == 0 && p.y == 0) return res;
|
||||
|
||||
/*Calculate the angle of the pressed point*/
|
||||
int16_t angle;
|
||||
int16_t bg_end = ext->bg_angle_end;
|
||||
@@ -758,13 +768,31 @@ static lv_res_t lv_arc_signal(lv_obj_t * arc, lv_signal_t sign, void * param)
|
||||
bg_end = ext->bg_angle_end + 360;
|
||||
}
|
||||
|
||||
angle = 360 - _lv_atan2(p.x, p.y) + 90; /*Some transformation is required*/
|
||||
|
||||
angle = _lv_atan2(p.y, p.x);
|
||||
angle -= ext->rotation_angle;
|
||||
if(angle < ext->bg_angle_start) angle = ext->bg_angle_start;
|
||||
if(angle > bg_end) angle = bg_end;
|
||||
angle -= ext->bg_angle_start; /*Make the angle relative to the start angle*/
|
||||
if(angle < 0) angle += 360;
|
||||
|
||||
int16_t deg_range = bg_end - ext->bg_angle_start;
|
||||
|
||||
int16_t last_angle_rel = ext->last_angle - ext->bg_angle_start;
|
||||
int16_t delta_angle = angle - last_angle_rel;
|
||||
|
||||
/* Do not allow big jumps.
|
||||
* It's mainly to avoid jumping to the opposite end if the "dead" range between min. an max. is crossed.
|
||||
* Check which and was closer on the last valid press (ext->min_close) and prefer that end */
|
||||
if(LV_MATH_ABS(delta_angle) > 180) {
|
||||
if(ext->min_close) angle = 0;
|
||||
else angle = deg_range;
|
||||
}
|
||||
else {
|
||||
if(angle < deg_range / 2) ext->min_close = 1;
|
||||
else ext->min_close = 0;
|
||||
}
|
||||
|
||||
/*Calculate the slew rate limited angle based on change rate (degrees/sec)*/
|
||||
int16_t delta_angle = angle - ext->last_angle;
|
||||
delta_angle = angle - last_angle_rel;
|
||||
uint32_t delta_tick = lv_tick_elaps(ext->last_tick);
|
||||
int16_t delta_angle_max = (ext->chg_rate * delta_tick) / 1000;
|
||||
|
||||
@@ -775,13 +803,15 @@ static lv_res_t lv_arc_signal(lv_obj_t * arc, lv_signal_t sign, void * param)
|
||||
delta_angle = -delta_angle_max;
|
||||
}
|
||||
|
||||
angle = ext->last_angle + delta_angle; /*Apply the limited angle change*/
|
||||
angle = last_angle_rel + delta_angle; /*Apply the limited angle change*/
|
||||
|
||||
/*Rounding for symmetry*/
|
||||
int32_t round = ((bg_end - ext->bg_angle_start) * 8) / (ext->max_value - ext->min_value);
|
||||
round = (round + 4) >> 4;
|
||||
angle += round;
|
||||
|
||||
angle += ext->bg_angle_start; /*Make the angle absolute again*/
|
||||
|
||||
/*Set the new value*/
|
||||
int16_t old_value = ext->cur_value;
|
||||
int16_t new_value = _lv_map(angle, ext->bg_angle_start, bg_end, ext->min_value, ext->max_value);
|
||||
@@ -831,6 +861,12 @@ static lv_res_t lv_arc_signal(lv_obj_t * arc, lv_signal_t sign, void * param)
|
||||
if(res != LV_RES_OK) return res;
|
||||
}
|
||||
}
|
||||
else if(sign == LV_SIGNAL_GET_EDITABLE) {
|
||||
#if LV_USE_GROUP
|
||||
bool * editable = (bool *)param;
|
||||
*editable = true;
|
||||
#endif
|
||||
}
|
||||
else if(sign == LV_SIGNAL_CLEANUP) {
|
||||
lv_obj_clean_style_list(arc, LV_ARC_PART_KNOB);
|
||||
lv_obj_clean_style_list(arc, LV_ARC_PART_INDIC);
|
||||
|
||||
@@ -51,6 +51,7 @@ typedef struct {
|
||||
uint16_t dragging : 1;
|
||||
uint16_t type : 2;
|
||||
uint16_t adjustable : 1;
|
||||
uint16_t min_close : 1; /*1: the last pressed angle was closer to minimum end*/
|
||||
uint16_t chg_rate; /*Drag angle rate of change of the arc (degrees/sec)*/
|
||||
uint32_t last_tick; /*Last dragging event timestamp of the arc*/
|
||||
int16_t last_angle; /*Last dragging angle of the arc*/
|
||||
|
||||
@@ -157,9 +157,11 @@ void lv_bar_set_value(lv_obj_t * bar, int16_t value, lv_anim_enable_t anim)
|
||||
lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar);
|
||||
if(ext->cur_value == value) return;
|
||||
|
||||
int16_t new_value;
|
||||
new_value = value > ext->max_value ? ext->max_value : value;
|
||||
int16_t new_value = value;
|
||||
new_value = value > ext->max_value ? ext->max_value : new_value;
|
||||
new_value = new_value < ext->min_value ? ext->min_value : new_value;
|
||||
new_value = new_value < ext->start_value ? ext->start_value : new_value;
|
||||
|
||||
|
||||
if(ext->cur_value == new_value) return;
|
||||
#if LV_USE_ANIMATION == 0
|
||||
@@ -184,9 +186,10 @@ void lv_bar_set_start_value(lv_obj_t * bar, int16_t start_value, lv_anim_enable_
|
||||
lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar);
|
||||
if(ext->start_value == start_value) return;
|
||||
|
||||
int16_t new_value;
|
||||
new_value = start_value > ext->max_value ? ext->max_value : start_value;
|
||||
new_value = new_value < ext->min_value ? ext->min_value : start_value;
|
||||
int16_t new_value = start_value;
|
||||
new_value = new_value > ext->max_value ? ext->max_value : new_value;
|
||||
new_value = new_value < ext->min_value ? ext->min_value : new_value;
|
||||
new_value = new_value > ext->cur_value ? ext->cur_value : new_value;
|
||||
|
||||
if(ext->start_value == new_value) return;
|
||||
#if LV_USE_ANIMATION == 0
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "../lv_core/lv_refr.h"
|
||||
#include "../lv_themes/lv_theme.h"
|
||||
#include "../lv_misc/lv_txt.h"
|
||||
#include "../lv_misc/lv_txt_ap.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -43,7 +44,6 @@ static bool button_get_tgl_state(lv_btnmatrix_ctrl_t ctrl_bits);
|
||||
static uint16_t get_button_from_point(lv_obj_t * btnm, lv_point_t * p);
|
||||
static void allocate_btn_areas_and_controls(const lv_obj_t * btnm, const char ** map);
|
||||
static void invalidate_button_area(const lv_obj_t * btnm, uint16_t btn_idx);
|
||||
static bool maps_are_identical(const char ** map1, const char ** map2);
|
||||
static void make_one_button_toggled(lv_obj_t * btnm, uint16_t btn_idx);
|
||||
|
||||
/**********************
|
||||
@@ -152,11 +152,9 @@ void lv_btnmatrix_set_map(lv_obj_t * btnm, const char * map[])
|
||||
* set/allocation when map hasn't changed.
|
||||
*/
|
||||
lv_btnmatrix_ext_t * ext = lv_obj_get_ext_attr(btnm);
|
||||
if(!maps_are_identical(ext->map_p, map)) {
|
||||
|
||||
/*Analyze the map and create the required number of buttons*/
|
||||
allocate_btn_areas_and_controls(btnm, map);
|
||||
}
|
||||
/*Analyze the map and create the required number of buttons*/
|
||||
allocate_btn_areas_and_controls(btnm, map);
|
||||
ext->map_p = map;
|
||||
|
||||
/*Set size and positions of the buttons*/
|
||||
@@ -322,7 +320,7 @@ void lv_btnmatrix_set_recolor(const lv_obj_t * btnm, bool en)
|
||||
* @param btnm pointer to button matrix object
|
||||
* @param btn_id 0 based index of the button to modify. (Not counting new lines)
|
||||
*/
|
||||
void lv_btnmatrix_set_btn_ctrl(const lv_obj_t * btnm, uint16_t btn_id, lv_btnmatrix_ctrl_t ctrl)
|
||||
void lv_btnmatrix_set_btn_ctrl(lv_obj_t * btnm, uint16_t btn_id, lv_btnmatrix_ctrl_t ctrl)
|
||||
{
|
||||
LV_ASSERT_OBJ(btnm, LV_OBJX_NAME);
|
||||
|
||||
@@ -330,6 +328,12 @@ void lv_btnmatrix_set_btn_ctrl(const lv_obj_t * btnm, uint16_t btn_id, lv_btnmat
|
||||
|
||||
if(btn_id >= ext->btn_cnt) return;
|
||||
|
||||
/*Uncheck all buttons if required*/
|
||||
if(ext->one_check && (ctrl & LV_BTNMATRIX_CTRL_CHECK_STATE)) {
|
||||
lv_btnmatrix_clear_btn_ctrl_all(btnm, LV_BTNMATRIX_CTRL_CHECK_STATE);
|
||||
ext->btn_id_act = btn_id;
|
||||
}
|
||||
|
||||
ext->ctrl_bits[btn_id] |= ctrl;
|
||||
invalidate_button_area(btnm, btn_id);
|
||||
}
|
||||
@@ -677,6 +681,10 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl
|
||||
lv_style_int_t padding_top = lv_obj_get_style_pad_top(btnm, LV_BTNMATRIX_PART_BG);
|
||||
lv_style_int_t padding_bottom = lv_obj_get_style_pad_bottom(btnm, LV_BTNMATRIX_PART_BG);
|
||||
|
||||
#if LV_USE_ARABIC_PERSIAN_CHARS
|
||||
const size_t txt_ap_size = 256 ;
|
||||
char * txt_ap = _lv_mem_buf_get(txt_ap_size);
|
||||
#endif
|
||||
for(btn_i = 0; btn_i < ext->btn_cnt; btn_i++, txt_i++) {
|
||||
/*Search the next valid text in the map*/
|
||||
while(strcmp(ext->map_p[txt_i], "\n") == 0) {
|
||||
@@ -792,6 +800,16 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl
|
||||
lv_style_int_t letter_space = draw_label_dsc_act->letter_space;
|
||||
lv_style_int_t line_space = draw_label_dsc_act->line_space;
|
||||
const char * txt = ext->map_p[txt_i];
|
||||
|
||||
#if LV_USE_ARABIC_PERSIAN_CHARS
|
||||
/*Get the size of the Arabic text and process it*/
|
||||
size_t len_ap = _lv_txt_ap_calc_bytes_cnt(txt);
|
||||
if(len_ap < txt_ap_size) {
|
||||
_lv_txt_ap_proc(txt, txt_ap);
|
||||
txt = txt_ap;
|
||||
}
|
||||
#endif
|
||||
|
||||
lv_point_t txt_size;
|
||||
_lv_txt_get_size(&txt_size, txt, font, letter_space,
|
||||
line_space, lv_area_get_width(&area_btnm), txt_flag);
|
||||
@@ -803,6 +821,10 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl
|
||||
|
||||
lv_draw_label(&area_tmp, clip_area, draw_label_dsc_act, txt, NULL);
|
||||
}
|
||||
|
||||
#if LV_USE_ARABIC_PERSIAN_CHARS
|
||||
_lv_mem_buf_release(txt_ap);
|
||||
#endif
|
||||
}
|
||||
else if(mode == LV_DESIGN_DRAW_POST) {
|
||||
ancestor_design_f(btnm, clip_area, mode);
|
||||
@@ -1126,6 +1148,10 @@ static void allocate_btn_areas_and_controls(const lv_obj_t * btnm, const char **
|
||||
|
||||
lv_btnmatrix_ext_t * ext = lv_obj_get_ext_attr(btnm);
|
||||
|
||||
/*Do not allocate memory for the same amount of buttons*/
|
||||
if(btn_cnt == ext->btn_cnt) return;
|
||||
|
||||
|
||||
if(ext->button_areas != NULL) {
|
||||
lv_mem_free(ext->button_areas);
|
||||
ext->button_areas = NULL;
|
||||
@@ -1263,25 +1289,6 @@ static void invalidate_button_area(const lv_obj_t * btnm, uint16_t btn_idx)
|
||||
lv_obj_invalidate_area(btnm, &btn_area);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two button matrix maps for equality
|
||||
* @param map1 map to compare
|
||||
* @param map2 map to compare
|
||||
* @return true if maps are identical in length and content
|
||||
*/
|
||||
static bool maps_are_identical(const char ** map1, const char ** map2)
|
||||
{
|
||||
if(map1 == map2) return true;
|
||||
if(map1 == NULL || map2 == NULL) return map1 == map2;
|
||||
|
||||
uint16_t i = 0;
|
||||
while(map1[i][0] != '\0' && map2[i][0] != '\0') {
|
||||
if(strcmp(map1[i], map2[i]) != 0) return false;
|
||||
i++;
|
||||
}
|
||||
return map1[i][0] == '\0' && map2[i][0] == '\0';
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforces a single button being toggled on the button matrix.
|
||||
* It simply clears the toggle flag on other buttons.
|
||||
|
||||
@@ -127,7 +127,7 @@ void lv_btnmatrix_set_recolor(const lv_obj_t * btnm, bool en);
|
||||
* @param btnm pointer to button matrix object
|
||||
* @param btn_id 0 based index of the button to modify. (Not counting new lines)
|
||||
*/
|
||||
void lv_btnmatrix_set_btn_ctrl(const lv_obj_t * btnm, uint16_t btn_id, lv_btnmatrix_ctrl_t ctrl);
|
||||
void lv_btnmatrix_set_btn_ctrl(lv_obj_t * btnm, uint16_t btn_id, lv_btnmatrix_ctrl_t ctrl);
|
||||
|
||||
/**
|
||||
* Clear the attributes of a button of the button matrix
|
||||
|
||||
@@ -44,7 +44,6 @@ static lv_coord_t get_day_names_height(lv_obj_t * calendar);
|
||||
static void draw_header(lv_obj_t * calendar, const lv_area_t * mask);
|
||||
static void draw_day_names(lv_obj_t * calendar, const lv_area_t * mask);
|
||||
static void draw_dates(lv_obj_t * calendar, const lv_area_t * clip_area);
|
||||
static uint8_t get_day_of_week(uint32_t year, uint32_t month, uint32_t day);
|
||||
static bool is_highlighted(lv_obj_t * calendar, day_draw_state_t draw_state, int32_t year, int32_t month, int32_t day);
|
||||
static bool is_pressed(lv_obj_t * calendar, day_draw_state_t draw_state, int32_t year, int32_t month, int32_t day);
|
||||
static const char * get_day_name(lv_obj_t * calendar, uint8_t day);
|
||||
@@ -365,6 +364,27 @@ const char ** lv_calendar_get_month_names(const lv_obj_t * calendar)
|
||||
return ext->month_names;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the day of the week
|
||||
* @param year a year
|
||||
* @param month a month (1..12)
|
||||
* @param day a day (1..31)
|
||||
* @return [0..6] which means [Sun..Sat] or [Mon..Sun] depending on LV_CALENDAR_WEEK_STARTS_MONDAY
|
||||
*/
|
||||
uint8_t lv_calendar_get_day_of_week(uint32_t year, uint32_t month, uint32_t day)
|
||||
{
|
||||
uint32_t a = month < 3 ? 1 : 0;
|
||||
uint32_t b = year - a;
|
||||
|
||||
#if LV_CALENDAR_WEEK_STARTS_MONDAY
|
||||
uint32_t day_of_week = (day + (31 * (month - 2 + 12 * a) / 12) + b + (b / 4) - (b / 100) + (b / 400) - 1) % 7;
|
||||
#else
|
||||
uint32_t day_of_week = (day + (31 * (month - 2 + 12 * a) / 12) + b + (b / 4) - (b / 100) + (b / 400)) % 7;
|
||||
#endif
|
||||
|
||||
return day_of_week;
|
||||
}
|
||||
|
||||
/*=====================
|
||||
* Other functions
|
||||
*====================*/
|
||||
@@ -617,22 +637,22 @@ static bool calculate_touched_day(lv_obj_t * calendar, const lv_point_t * touche
|
||||
uint8_t i_pos = 0;
|
||||
i_pos = (y_pos * 7) + x_pos;
|
||||
lv_calendar_ext_t * ext = lv_obj_get_ext_attr(calendar);
|
||||
if(i_pos < get_day_of_week(ext->showed_date.year, ext->showed_date.month, 1)) {
|
||||
if(i_pos < lv_calendar_get_day_of_week(ext->showed_date.year, ext->showed_date.month, 1)) {
|
||||
ext->pressed_date.year = ext->showed_date.year - (ext->showed_date.month == 1 ? 1 : 0);
|
||||
ext->pressed_date.month = ext->showed_date.month == 1 ? 12 : (ext->showed_date.month - 1);
|
||||
ext->pressed_date.day = get_month_length(ext->pressed_date.year, ext->pressed_date.month) -
|
||||
get_day_of_week(ext->showed_date.year, ext->showed_date.month, 1) + 1 + i_pos;
|
||||
lv_calendar_get_day_of_week(ext->showed_date.year, ext->showed_date.month, 1) + 1 + i_pos;
|
||||
}
|
||||
else if(i_pos < (get_day_of_week(ext->showed_date.year, ext->showed_date.month, 1) +
|
||||
else if(i_pos < (lv_calendar_get_day_of_week(ext->showed_date.year, ext->showed_date.month, 1) +
|
||||
get_month_length(ext->showed_date.year, ext->showed_date.month))) {
|
||||
ext->pressed_date.year = ext->showed_date.year;
|
||||
ext->pressed_date.month = ext->showed_date.month;
|
||||
ext->pressed_date.day = i_pos + 1 - get_day_of_week(ext->showed_date.year, ext->showed_date.month, 1);
|
||||
ext->pressed_date.day = i_pos + 1 - lv_calendar_get_day_of_week(ext->showed_date.year, ext->showed_date.month, 1);
|
||||
}
|
||||
else if(i_pos < 42) {
|
||||
ext->pressed_date.year = ext->showed_date.year + (ext->showed_date.month == 12 ? 1 : 0);
|
||||
ext->pressed_date.month = ext->showed_date.month == 12 ? 1 : (ext->showed_date.month + 1);
|
||||
ext->pressed_date.day = i_pos + 1 - get_day_of_week(ext->showed_date.year, ext->showed_date.month, 1) -
|
||||
ext->pressed_date.day = i_pos + 1 - lv_calendar_get_day_of_week(ext->showed_date.year, ext->showed_date.month, 1) -
|
||||
get_month_length(ext->showed_date.year, ext->showed_date.month);
|
||||
}
|
||||
return true;
|
||||
@@ -826,7 +846,7 @@ static void draw_dates(lv_obj_t * calendar, const lv_area_t * clip_area)
|
||||
lv_coord_t box_h = (days_h - 5 * date_inner) / 6;
|
||||
lv_coord_t box_size = LV_MATH_MIN(box_w, box_h);
|
||||
|
||||
uint8_t month_start_day = get_day_of_week(ext->showed_date.year, ext->showed_date.month, 1);
|
||||
uint8_t month_start_day = lv_calendar_get_day_of_week(ext->showed_date.year, ext->showed_date.month, 1);
|
||||
|
||||
day_draw_state_t draw_state;
|
||||
|
||||
@@ -1067,25 +1087,4 @@ static uint8_t is_leap_year(uint32_t year)
|
||||
return (year % 4) || ((year % 100 == 0) && (year % 400)) ? 0 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the day of the week
|
||||
* @param year a year
|
||||
* @param month a month
|
||||
* @param day a day
|
||||
* @return [0..6] which means [Sun..Sat] or [Mon..Sun] depending on LV_CALENDAR_WEEK_STARTS_MONDAY
|
||||
*/
|
||||
static uint8_t get_day_of_week(uint32_t year, uint32_t month, uint32_t day)
|
||||
{
|
||||
uint32_t a = month < 3 ? 1 : 0;
|
||||
uint32_t b = year - a;
|
||||
|
||||
#if LV_CALENDAR_WEEK_STARTS_MONDAY
|
||||
uint32_t day_of_week = (day + (31 * (month - 2 + 12 * a) / 12) + b + (b / 4) - (b / 100) + (b / 400) - 1) % 7;
|
||||
#else
|
||||
uint32_t day_of_week = (day + (31 * (month - 2 + 12 * a) / 12) + b + (b / 4) - (b / 100) + (b / 400)) % 7;
|
||||
#endif
|
||||
|
||||
return day_of_week;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -182,6 +182,15 @@ const char ** lv_calendar_get_day_names(const lv_obj_t * calendar);
|
||||
*/
|
||||
const char ** lv_calendar_get_month_names(const lv_obj_t * calendar);
|
||||
|
||||
/**
|
||||
* Get the day of the week
|
||||
* @param year a year
|
||||
* @param month a month (1..12)
|
||||
* @param day a day (1..31)
|
||||
* @return [0..6] which means [Sun..Sat] or [Mon..Sun] depending on LV_CALENDAR_WEEK_STARTS_MONDAY
|
||||
*/
|
||||
uint8_t lv_calendar_get_day_of_week(uint32_t year, uint32_t month, uint32_t day);
|
||||
|
||||
/*=====================
|
||||
* Other functions
|
||||
*====================*/
|
||||
|
||||
@@ -195,6 +195,7 @@ lv_chart_series_t * lv_chart_add_series(lv_obj_t * chart, lv_color_t color)
|
||||
|
||||
ser->start_point = 0;
|
||||
ser->ext_buf_assigned = false;
|
||||
ser->hidden = 0;
|
||||
ser->y_axis = LV_CHART_AXIS_PRIMARY_Y;
|
||||
|
||||
uint16_t i;
|
||||
@@ -207,6 +208,33 @@ lv_chart_series_t * lv_chart_add_series(lv_obj_t * chart, lv_color_t color)
|
||||
return ser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deallocate and remove a data series from a chart
|
||||
* @param chart pointer to a chart object
|
||||
* @param series pointer to a data series on 'chart'
|
||||
*/
|
||||
void lv_chart_remove_series(lv_obj_t * chart, lv_chart_series_t * series)
|
||||
{
|
||||
LV_ASSERT_OBJ(chart, LV_OBJX_NAME);
|
||||
LV_ASSERT_NULL(series);
|
||||
|
||||
if(chart == NULL || series == NULL) return;
|
||||
lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
|
||||
if(!series->ext_buf_assigned && series->points) lv_mem_free(series->points);
|
||||
|
||||
_lv_ll_remove(&ext->series_ll, series);
|
||||
lv_mem_free(series);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a cursor with a given color
|
||||
* @param chart pointer to chart object
|
||||
* @param color color of the cursor
|
||||
* @param dir direction of the cursor. `LV_CHART_CURSOR_RIGHT/LEFT/TOP/DOWN`. OR-ed values are possible
|
||||
* @return pointer to the created cursor
|
||||
*/
|
||||
lv_chart_cursor_t * lv_chart_add_cursor(lv_obj_t * chart, lv_color_t color, lv_cursor_direction_t axes)
|
||||
{
|
||||
LV_ASSERT_OBJ(chart, LV_OBJX_NAME);
|
||||
@@ -246,6 +274,22 @@ void lv_chart_clear_series(lv_obj_t * chart, lv_chart_series_t * series)
|
||||
series->start_point = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide/Unhide a single series of a chart.
|
||||
* @param chart pointer to a chart object.
|
||||
* @param series pointer to a series object
|
||||
* @param hide true: hide the series
|
||||
*/
|
||||
void lv_chart_hide_series(lv_obj_t * chart, lv_chart_series_t * series, bool hide)
|
||||
{
|
||||
LV_ASSERT_OBJ(chart, LV_OBJX_NAME);
|
||||
LV_ASSERT_NULL(series);
|
||||
|
||||
series->hidden = hide ? 1 : 0;
|
||||
lv_chart_refresh(chart);
|
||||
}
|
||||
|
||||
|
||||
/*=====================
|
||||
* Setter functions
|
||||
*====================*/
|
||||
@@ -289,7 +333,7 @@ void lv_chart_set_y_range(lv_obj_t * chart, lv_chart_axis_t axis, lv_coord_t ymi
|
||||
if(ext->ymin[axis] == ymin && ext->ymax[axis] == ymax) return;
|
||||
|
||||
ext->ymin[axis] = ymin;
|
||||
ext->ymax[axis] = ymax;
|
||||
ext->ymax[axis] = (ymax == ymin ? ymax + 1 : ymax);
|
||||
|
||||
lv_chart_refresh(chart);
|
||||
}
|
||||
@@ -666,6 +710,7 @@ void lv_chart_set_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_
|
||||
lv_chart_refresh(chart);
|
||||
}
|
||||
|
||||
|
||||
/*=====================
|
||||
* Getter functions
|
||||
*====================*/
|
||||
@@ -1135,6 +1180,7 @@ static void draw_series_line(lv_obj_t * chart, const lv_area_t * series_area, co
|
||||
|
||||
/*Go through all data lines*/
|
||||
_LV_LL_READ_BACK(ext->series_ll, ser) {
|
||||
if(ser->hidden) continue;
|
||||
line_dsc.color = ser->color;
|
||||
point_dsc.bg_color = ser->color;
|
||||
area_dsc.bg_color = ser->color;
|
||||
@@ -1148,7 +1194,7 @@ static void draw_series_line(lv_obj_t * chart, const lv_area_t * series_area, co
|
||||
lv_coord_t p_act = start_point;
|
||||
lv_coord_t p_prev = start_point;
|
||||
int32_t y_tmp = (int32_t)((int32_t)ser->points[p_prev] - ext->ymin[ser->y_axis]) * h;
|
||||
y_tmp = y_tmp / (ext->ymax[ser->y_axis] - ext->ymin[ser->y_axis]);
|
||||
y_tmp = y_tmp / (ext->ymax[ser->y_axis] - ext->ymin[ser->y_axis]);
|
||||
p2.y = h - y_tmp + y_ofs;
|
||||
|
||||
for(i = 0; i < ext->point_cnt; i++) {
|
||||
@@ -1271,6 +1317,7 @@ static void draw_series_column(lv_obj_t * chart, const lv_area_t * series_area,
|
||||
|
||||
/*Draw the current point of all data line*/
|
||||
_LV_LL_READ_BACK(ext->series_ll, ser) {
|
||||
if(ser->hidden) continue;
|
||||
lv_coord_t start_point = ext->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->start_point : 0;
|
||||
|
||||
col_a.x1 = x_act;
|
||||
|
||||
@@ -42,7 +42,6 @@ enum {
|
||||
LV_CHART_TYPE_NONE = 0x00, /**< Don't draw the series*/
|
||||
LV_CHART_TYPE_LINE = 0x01, /**< Connect the points with lines*/
|
||||
LV_CHART_TYPE_COLUMN = 0x02, /**< Draw columns*/
|
||||
LV_CHART_TYPE_SCATTER = 0x03, /**< X/Y chart, points and/or lines*/
|
||||
};
|
||||
typedef uint8_t lv_chart_type_t;
|
||||
|
||||
@@ -75,6 +74,7 @@ typedef struct {
|
||||
lv_color_t color;
|
||||
uint16_t start_point;
|
||||
uint8_t ext_buf_assigned : 1;
|
||||
uint8_t hidden : 1;
|
||||
lv_chart_axis_t y_axis : 1;
|
||||
} lv_chart_series_t;
|
||||
|
||||
@@ -154,11 +154,18 @@ lv_obj_t * lv_chart_create(lv_obj_t * par, const lv_obj_t * copy);
|
||||
*/
|
||||
lv_chart_series_t * lv_chart_add_series(lv_obj_t * chart, lv_color_t color);
|
||||
|
||||
/**
|
||||
* Deallocate and remove a data series from a chart
|
||||
* @param chart pointer to a chart object
|
||||
* @param series pointer to a data series on 'chart'
|
||||
*/
|
||||
void lv_chart_remove_series(lv_obj_t * chart, lv_chart_series_t * series);
|
||||
|
||||
/**
|
||||
* Add a cursor with a given color
|
||||
* @param chart pointer to chart object
|
||||
* @param color color of the cursor
|
||||
* @param dir direction of the cursor. `LV_CHART_CURSOR_RIGHT/LEFT/TOP/DOWN`. OR-ed vaéues are possible
|
||||
* @param dir direction of the cursor. `LV_CHART_CURSOR_RIGHT/LEFT/TOP/DOWN`. OR-ed values are possible
|
||||
* @return pointer to the created cursor
|
||||
*/
|
||||
lv_chart_cursor_t * lv_chart_add_cursor(lv_obj_t * chart, lv_color_t color, lv_cursor_direction_t dir);
|
||||
@@ -170,6 +177,15 @@ lv_chart_cursor_t * lv_chart_add_cursor(lv_obj_t * chart, lv_color_t color, lv_c
|
||||
*/
|
||||
void lv_chart_clear_series(lv_obj_t * chart, lv_chart_series_t * series);
|
||||
|
||||
/**
|
||||
* Hide/Unhide a single series of a chart.
|
||||
* @param chart pointer to a chart object.
|
||||
* @param series pointer to a series object
|
||||
* @param hide true: hide the series
|
||||
*/
|
||||
void lv_chart_hide_series(lv_obj_t * chart, lv_chart_series_t * series, bool hide);
|
||||
|
||||
|
||||
/*=====================
|
||||
* Setter functions
|
||||
*====================*/
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
*********************/
|
||||
#define LV_OBJX_NAME "lv_cont"
|
||||
|
||||
#ifndef LV_LAYOUT_MAX_RECURSION
|
||||
#define LV_LAYOUT_MAX_RECURSION 10
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
@@ -664,142 +668,152 @@ static void lv_cont_refr_autofit(lv_obj_t * cont)
|
||||
return;
|
||||
}
|
||||
|
||||
lv_area_t tight_area;
|
||||
lv_area_t ori;
|
||||
lv_obj_t * child_i;
|
||||
static int recursion_level = 0;
|
||||
recursion_level++;
|
||||
/*Ensure it won't keep recursing forever*/
|
||||
if(recursion_level <= LV_LAYOUT_MAX_RECURSION) {
|
||||
lv_area_t tight_area;
|
||||
lv_area_t ori;
|
||||
lv_obj_t * child_i;
|
||||
|
||||
lv_obj_t * par = lv_obj_get_parent(cont);
|
||||
lv_area_t parent_area;
|
||||
lv_area_copy(&parent_area, &par->coords);
|
||||
parent_area.x1 += lv_obj_get_style_pad_left(par, LV_OBJ_PART_MAIN);
|
||||
parent_area.x2 -= lv_obj_get_style_pad_right(par, LV_OBJ_PART_MAIN);
|
||||
parent_area.y1 += lv_obj_get_style_pad_top(par, LV_OBJ_PART_MAIN);
|
||||
parent_area.y2 -= lv_obj_get_style_pad_bottom(par, LV_OBJ_PART_MAIN);
|
||||
lv_obj_t * par = lv_obj_get_parent(cont);
|
||||
lv_area_t parent_area;
|
||||
lv_area_copy(&parent_area, &par->coords);
|
||||
parent_area.x1 += lv_obj_get_style_pad_left(par, LV_OBJ_PART_MAIN);
|
||||
parent_area.x2 -= lv_obj_get_style_pad_right(par, LV_OBJ_PART_MAIN);
|
||||
parent_area.y1 += lv_obj_get_style_pad_top(par, LV_OBJ_PART_MAIN);
|
||||
parent_area.y2 -= lv_obj_get_style_pad_bottom(par, LV_OBJ_PART_MAIN);
|
||||
|
||||
/*Search the side coordinates of the children*/
|
||||
lv_obj_get_coords(cont, &ori);
|
||||
lv_obj_get_coords(cont, &tight_area);
|
||||
/*Search the side coordinates of the children*/
|
||||
lv_obj_get_coords(cont, &ori);
|
||||
lv_obj_get_coords(cont, &tight_area);
|
||||
|
||||
bool has_children = _lv_ll_is_empty(&cont->child_ll) ? false : true;
|
||||
bool has_children = _lv_ll_is_empty(&cont->child_ll) ? false : true;
|
||||
|
||||
if(has_children) {
|
||||
tight_area.x1 = LV_COORD_MAX;
|
||||
tight_area.y1 = LV_COORD_MAX;
|
||||
tight_area.x2 = LV_COORD_MIN;
|
||||
tight_area.y2 = LV_COORD_MIN;
|
||||
if(has_children) {
|
||||
tight_area.x1 = LV_COORD_MAX;
|
||||
tight_area.y1 = LV_COORD_MAX;
|
||||
tight_area.x2 = LV_COORD_MIN;
|
||||
tight_area.y2 = LV_COORD_MIN;
|
||||
|
||||
_LV_LL_READ(cont->child_ll, child_i) {
|
||||
if(lv_obj_get_hidden(child_i) != false) continue;
|
||||
_LV_LL_READ(cont->child_ll, child_i) {
|
||||
if(lv_obj_get_hidden(child_i) != false) continue;
|
||||
|
||||
if(ext->fit_left != LV_FIT_PARENT) {
|
||||
lv_style_int_t mleft = lv_obj_get_style_margin_left(child_i, LV_OBJ_PART_MAIN);
|
||||
tight_area.x1 = LV_MATH_MIN(tight_area.x1, child_i->coords.x1 - mleft);
|
||||
if(ext->fit_left != LV_FIT_PARENT) {
|
||||
lv_style_int_t mleft = lv_obj_get_style_margin_left(child_i, LV_OBJ_PART_MAIN);
|
||||
tight_area.x1 = LV_MATH_MIN(tight_area.x1, child_i->coords.x1 - mleft);
|
||||
}
|
||||
|
||||
if(ext->fit_right != LV_FIT_PARENT) {
|
||||
lv_style_int_t mright = lv_obj_get_style_margin_right(child_i, LV_OBJ_PART_MAIN);
|
||||
tight_area.x2 = LV_MATH_MAX(tight_area.x2, child_i->coords.x2 + mright);
|
||||
}
|
||||
|
||||
if(ext->fit_top != LV_FIT_PARENT) {
|
||||
lv_style_int_t mtop = lv_obj_get_style_margin_top(child_i, LV_OBJ_PART_MAIN);
|
||||
tight_area.y1 = LV_MATH_MIN(tight_area.y1, child_i->coords.y1 - mtop);
|
||||
}
|
||||
|
||||
if(ext->fit_bottom != LV_FIT_PARENT) {
|
||||
lv_style_int_t mbottom = lv_obj_get_style_margin_bottom(child_i, LV_OBJ_PART_MAIN);
|
||||
tight_area.y2 = LV_MATH_MAX(tight_area.y2, child_i->coords.y2 + mbottom);
|
||||
}
|
||||
}
|
||||
|
||||
if(ext->fit_right != LV_FIT_PARENT) {
|
||||
lv_style_int_t mright = lv_obj_get_style_margin_right(child_i, LV_OBJ_PART_MAIN);
|
||||
tight_area.x2 = LV_MATH_MAX(tight_area.x2, child_i->coords.x2 + mright);
|
||||
}
|
||||
|
||||
if(ext->fit_top != LV_FIT_PARENT) {
|
||||
lv_style_int_t mtop = lv_obj_get_style_margin_top(child_i, LV_OBJ_PART_MAIN);
|
||||
tight_area.y1 = LV_MATH_MIN(tight_area.y1, child_i->coords.y1 - mtop);
|
||||
}
|
||||
|
||||
if(ext->fit_bottom != LV_FIT_PARENT) {
|
||||
lv_style_int_t mbottom = lv_obj_get_style_margin_bottom(child_i, LV_OBJ_PART_MAIN);
|
||||
tight_area.y2 = LV_MATH_MAX(tight_area.y2, child_i->coords.y2 + mbottom);
|
||||
}
|
||||
tight_area.x1 -= lv_obj_get_style_pad_left(cont, LV_CONT_PART_MAIN);
|
||||
tight_area.x2 += lv_obj_get_style_pad_right(cont, LV_CONT_PART_MAIN);
|
||||
tight_area.y1 -= lv_obj_get_style_pad_top(cont, LV_CONT_PART_MAIN);
|
||||
tight_area.y2 += lv_obj_get_style_pad_bottom(cont, LV_CONT_PART_MAIN);
|
||||
}
|
||||
|
||||
tight_area.x1 -= lv_obj_get_style_pad_left(cont, LV_CONT_PART_MAIN);
|
||||
tight_area.x2 += lv_obj_get_style_pad_right(cont, LV_CONT_PART_MAIN);
|
||||
tight_area.y1 -= lv_obj_get_style_pad_top(cont, LV_CONT_PART_MAIN);
|
||||
tight_area.y2 += lv_obj_get_style_pad_bottom(cont, LV_CONT_PART_MAIN);
|
||||
}
|
||||
lv_area_t new_area;
|
||||
lv_area_copy(&new_area, &ori);
|
||||
|
||||
lv_area_t new_area;
|
||||
lv_area_copy(&new_area, &ori);
|
||||
|
||||
switch(ext->fit_left) {
|
||||
case LV_FIT_TIGHT:
|
||||
new_area.x1 = tight_area.x1;
|
||||
break;
|
||||
case LV_FIT_PARENT:
|
||||
new_area.x1 = parent_area.x1;
|
||||
break;
|
||||
case LV_FIT_MAX:
|
||||
new_area.x1 = has_children ? LV_MATH_MIN(tight_area.x1, parent_area.x1) : parent_area.x1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch(ext->fit_right) {
|
||||
case LV_FIT_TIGHT:
|
||||
new_area.x2 = tight_area.x2;
|
||||
break;
|
||||
case LV_FIT_PARENT:
|
||||
new_area.x2 = parent_area.x2;
|
||||
break;
|
||||
case LV_FIT_MAX:
|
||||
new_area.x2 = has_children ? LV_MATH_MAX(tight_area.x2, parent_area.x2) : parent_area.x2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch(ext->fit_top) {
|
||||
case LV_FIT_TIGHT:
|
||||
new_area.y1 = tight_area.y1;
|
||||
break;
|
||||
case LV_FIT_PARENT:
|
||||
new_area.y1 = parent_area.y1;
|
||||
break;
|
||||
case LV_FIT_MAX:
|
||||
new_area.y1 = has_children ? LV_MATH_MIN(tight_area.y1, parent_area.y1) : parent_area.y1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch(ext->fit_bottom) {
|
||||
case LV_FIT_TIGHT:
|
||||
new_area.y2 = tight_area.y2;
|
||||
break;
|
||||
case LV_FIT_PARENT:
|
||||
new_area.y2 = parent_area.y2;
|
||||
break;
|
||||
case LV_FIT_MAX:
|
||||
new_area.y2 = has_children ? LV_MATH_MAX(tight_area.y2, parent_area.y2) : parent_area.y2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/*Do nothing if the coordinates are not changed*/
|
||||
if(cont->coords.x1 != new_area.x1 || cont->coords.y1 != new_area.y1 || cont->coords.x2 != new_area.x2 ||
|
||||
cont->coords.y2 != new_area.y2) {
|
||||
|
||||
lv_obj_invalidate(cont);
|
||||
lv_area_copy(&cont->coords, &new_area);
|
||||
lv_obj_invalidate(cont);
|
||||
|
||||
/*Notify the object about its new coordinates*/
|
||||
cont->signal_cb(cont, LV_SIGNAL_COORD_CHG, &ori);
|
||||
|
||||
/*Inform the parent about the new coordinates*/
|
||||
par->signal_cb(par, LV_SIGNAL_CHILD_CHG, cont);
|
||||
|
||||
if(lv_obj_get_auto_realign(cont)) {
|
||||
lv_obj_realign(cont);
|
||||
switch(ext->fit_left) {
|
||||
case LV_FIT_TIGHT:
|
||||
new_area.x1 = tight_area.x1;
|
||||
break;
|
||||
case LV_FIT_PARENT:
|
||||
new_area.x1 = parent_area.x1;
|
||||
break;
|
||||
case LV_FIT_MAX:
|
||||
new_area.x1 = has_children ? LV_MATH_MIN(tight_area.x1, parent_area.x1) : parent_area.x1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/*Tell the children the parent's size has changed*/
|
||||
_LV_LL_READ(cont->child_ll, child_i) {
|
||||
child_i->signal_cb(child_i, LV_SIGNAL_PARENT_SIZE_CHG, &ori);
|
||||
switch(ext->fit_right) {
|
||||
case LV_FIT_TIGHT:
|
||||
new_area.x2 = tight_area.x2;
|
||||
break;
|
||||
case LV_FIT_PARENT:
|
||||
new_area.x2 = parent_area.x2;
|
||||
break;
|
||||
case LV_FIT_MAX:
|
||||
new_area.x2 = has_children ? LV_MATH_MAX(tight_area.x2, parent_area.x2) : parent_area.x2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch(ext->fit_top) {
|
||||
case LV_FIT_TIGHT:
|
||||
new_area.y1 = tight_area.y1;
|
||||
break;
|
||||
case LV_FIT_PARENT:
|
||||
new_area.y1 = parent_area.y1;
|
||||
break;
|
||||
case LV_FIT_MAX:
|
||||
new_area.y1 = has_children ? LV_MATH_MIN(tight_area.y1, parent_area.y1) : parent_area.y1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch(ext->fit_bottom) {
|
||||
case LV_FIT_TIGHT:
|
||||
new_area.y2 = tight_area.y2;
|
||||
break;
|
||||
case LV_FIT_PARENT:
|
||||
new_area.y2 = parent_area.y2;
|
||||
break;
|
||||
case LV_FIT_MAX:
|
||||
new_area.y2 = has_children ? LV_MATH_MAX(tight_area.y2, parent_area.y2) : parent_area.y2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/*Do nothing if the coordinates are not changed*/
|
||||
if(cont->coords.x1 != new_area.x1 || cont->coords.y1 != new_area.y1 || cont->coords.x2 != new_area.x2 ||
|
||||
cont->coords.y2 != new_area.y2) {
|
||||
|
||||
lv_obj_invalidate(cont);
|
||||
lv_area_copy(&cont->coords, &new_area);
|
||||
lv_obj_invalidate(cont);
|
||||
|
||||
/*Notify the object about its new coordinates*/
|
||||
cont->signal_cb(cont, LV_SIGNAL_COORD_CHG, &ori);
|
||||
|
||||
/*Inform the parent about the new coordinates*/
|
||||
par->signal_cb(par, LV_SIGNAL_CHILD_CHG, cont);
|
||||
|
||||
if(lv_obj_get_auto_realign(cont)) {
|
||||
lv_obj_realign(cont);
|
||||
}
|
||||
|
||||
/*Tell the children the parent's size has changed*/
|
||||
_LV_LL_READ(cont->child_ll, child_i) {
|
||||
child_i->signal_cb(child_i, LV_SIGNAL_PARENT_SIZE_CHG, &ori);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
LV_LOG_ERROR("LV_LAYOUT_MAX_RECURSION reached! You may have encountered issue #1539.");
|
||||
}
|
||||
|
||||
recursion_level--;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -33,7 +33,7 @@ enum {
|
||||
LV_LAYOUT_CENTER, /**< Center objects */
|
||||
|
||||
/**
|
||||
* COULMN:
|
||||
* COLUMN:
|
||||
* - Place the object below each other
|
||||
* - Keep `pad_top` space on the top
|
||||
* - Keep `pad_inner` space between the objects
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "../lv_font/lv_symbol_def.h"
|
||||
#include "../lv_misc/lv_anim.h"
|
||||
#include "../lv_misc/lv_math.h"
|
||||
#include "../lv_misc/lv_txt_ap.h"
|
||||
#include <string.h>
|
||||
|
||||
/*********************
|
||||
@@ -44,7 +45,7 @@ typedef struct {
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static lv_design_res_t lv_dropdown_design(lv_obj_t * ddlist, const lv_area_t * clip_area, lv_design_mode_t mode);
|
||||
static lv_design_res_t lv_dropdown_page_design(lv_obj_t * ddlist, const lv_area_t * clip_area, lv_design_mode_t mode);
|
||||
static lv_design_res_t lv_dropdown_page_design(lv_obj_t * page, const lv_area_t * clip_area, lv_design_mode_t mode);
|
||||
static lv_res_t lv_dropdown_signal(lv_obj_t * ddlist, lv_signal_t sign, void * param);
|
||||
static lv_res_t lv_dropdown_page_signal(lv_obj_t * page, lv_signal_t sign, void * param);
|
||||
static lv_res_t lv_dropdown_page_scrl_signal(lv_obj_t * scrl, lv_signal_t sign, void * param);
|
||||
@@ -217,7 +218,12 @@ void lv_dropdown_set_options(lv_obj_t * ddlist, const char * options)
|
||||
ext->sel_opt_id_orig = 0;
|
||||
|
||||
/*Allocate space for the new text*/
|
||||
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
|
||||
size_t len = strlen(options) + 1;
|
||||
#else
|
||||
size_t len = _lv_txt_ap_calc_bytes_cnt(options) + 1;
|
||||
#endif
|
||||
|
||||
if(ext->options != NULL && ext->static_txt == 0) {
|
||||
lv_mem_free(ext->options);
|
||||
ext->options = NULL;
|
||||
@@ -228,7 +234,11 @@ void lv_dropdown_set_options(lv_obj_t * ddlist, const char * options)
|
||||
LV_ASSERT_MEM(ext->options);
|
||||
if(ext->options == NULL) return;
|
||||
|
||||
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
|
||||
strcpy(ext->options, options);
|
||||
#else
|
||||
_lv_txt_ap_proc(options, ext->options);
|
||||
#endif
|
||||
|
||||
/*Now the text is dynamically allocated*/
|
||||
ext->static_txt = 0;
|
||||
@@ -293,7 +303,12 @@ void lv_dropdown_add_option(lv_obj_t * ddlist, const char * option, uint32_t pos
|
||||
|
||||
/*Allocate space for the new option*/
|
||||
size_t old_len = (ext->options == NULL) ? 0 : strlen(ext->options);
|
||||
size_t ins_len = strlen(option);
|
||||
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
|
||||
size_t ins_len = strlen(option) + 1;
|
||||
#else
|
||||
size_t ins_len = _lv_txt_ap_calc_bytes_cnt(option) + 1;
|
||||
#endif
|
||||
|
||||
size_t new_len = ins_len + old_len + 2; /* +2 for terminating NULL and possible \n */
|
||||
ext->options = lv_mem_realloc(ext->options, new_len + 1);
|
||||
LV_ASSERT_MEM(ext->options);
|
||||
@@ -321,9 +336,13 @@ void lv_dropdown_add_option(lv_obj_t * ddlist, const char * option, uint32_t pos
|
||||
char * ins_buf = _lv_mem_buf_get(ins_len + 2); /* + 2 for terminating NULL and possible \n */
|
||||
LV_ASSERT_MEM(ins_buf);
|
||||
if(ins_buf == NULL) return;
|
||||
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
|
||||
strcpy(ins_buf, option);
|
||||
if(pos < ext->option_cnt)
|
||||
strcat(ins_buf, "\n");
|
||||
#else
|
||||
_lv_txt_ap_proc(option, ins_buf);
|
||||
#endif
|
||||
if(pos < ext->option_cnt) strcat(ins_buf, "\n");
|
||||
|
||||
_lv_txt_ins(ext->options, _lv_txt_encoded_get_char_id(ext->options, insert_pos), ins_buf);
|
||||
_lv_mem_buf_release(ins_buf);
|
||||
|
||||
@@ -346,10 +365,8 @@ void lv_dropdown_set_selected(lv_obj_t * ddlist, uint16_t sel_opt)
|
||||
|
||||
ext->sel_opt_id = sel_opt < ext->option_cnt ? sel_opt : ext->option_cnt - 1;
|
||||
ext->sel_opt_id_orig = ext->sel_opt_id;
|
||||
/*Move the list to show the current option*/
|
||||
if(ext->page != NULL) {
|
||||
lv_obj_invalidate(ddlist);
|
||||
}
|
||||
|
||||
lv_obj_invalidate(ddlist);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -197,15 +197,9 @@ void lv_gauge_set_value(lv_obj_t * gauge, uint8_t needle_id, int32_t value)
|
||||
int32_t old_value = ext->values[needle_id];
|
||||
ext->values[needle_id] = value;
|
||||
|
||||
// lv_obj_invalidate(gauge);
|
||||
|
||||
lv_style_int_t pad = lv_obj_get_style_pad_inner(gauge, LV_GAUGE_PART_NEEDLE);
|
||||
lv_style_int_t left = lv_obj_get_style_pad_left(gauge, LV_GAUGE_PART_MAIN);
|
||||
lv_style_int_t right = lv_obj_get_style_pad_right(gauge, LV_GAUGE_PART_MAIN);
|
||||
lv_style_int_t top = lv_obj_get_style_pad_top(gauge, LV_GAUGE_PART_MAIN);
|
||||
lv_coord_t r = (lv_obj_get_width(gauge) - left - right) / 2 - pad;
|
||||
lv_coord_t x_ofs = gauge->coords.x1 + r + left + pad;
|
||||
lv_coord_t y_ofs = gauge->coords.y1 + r + top + pad;
|
||||
lv_coord_t r = lv_obj_get_width(gauge) / 2;
|
||||
lv_coord_t x_ofs = gauge->coords.x1 + r;
|
||||
lv_coord_t y_ofs = gauge->coords.y1 + r;
|
||||
uint16_t angle = lv_linemeter_get_scale_angle(gauge);
|
||||
int16_t angle_ofs = 90 + (360 - angle) / 2 + lv_gauge_get_angle_offset(gauge);
|
||||
lv_point_t p_mid;
|
||||
@@ -586,8 +580,15 @@ static void lv_gauge_draw_needle(lv_obj_t * gauge, const lv_area_t * clip_area)
|
||||
uint8_t i;
|
||||
|
||||
lv_draw_line_dsc_t line_dsc;
|
||||
lv_draw_line_dsc_init(&line_dsc);
|
||||
lv_obj_init_draw_line_dsc(gauge, LV_GAUGE_PART_NEEDLE, &line_dsc);
|
||||
lv_draw_img_dsc_t img_dsc;
|
||||
if(ext->needle_img == NULL) {
|
||||
lv_draw_line_dsc_init(&line_dsc);
|
||||
lv_obj_init_draw_line_dsc(gauge, LV_GAUGE_PART_NEEDLE, &line_dsc);
|
||||
}
|
||||
else {
|
||||
lv_draw_img_dsc_init(&img_dsc);
|
||||
lv_obj_init_draw_img_dsc(gauge, LV_GAUGE_PART_NEEDLE, &img_dsc);
|
||||
}
|
||||
|
||||
p_mid.x = x_ofs;
|
||||
p_mid.y = y_ofs;
|
||||
@@ -616,14 +617,10 @@ static void lv_gauge_draw_needle(lv_obj_t * gauge, const lv_area_t * clip_area)
|
||||
a.y1 = gauge->coords.y1 + lv_area_get_height(&gauge->coords) / 2 - ext->needle_img_pivot.y;
|
||||
a.x2 = a.x1 + info.w - 1;
|
||||
a.y2 = a.y1 + info.h - 1;
|
||||
lv_draw_img_dsc_t img_dsc;
|
||||
lv_draw_img_dsc_init(&img_dsc);
|
||||
lv_obj_init_draw_img_dsc(gauge, LV_GAUGE_PART_MAIN, &img_dsc);
|
||||
img_dsc.pivot.x = ext->needle_img_pivot.x;
|
||||
img_dsc.pivot.y = ext->needle_img_pivot.y;
|
||||
|
||||
if(ext->needle_colors != NULL)
|
||||
img_dsc.recolor = ext->needle_colors[i];
|
||||
if(ext->needle_colors != NULL) img_dsc.recolor = ext->needle_colors[i];
|
||||
|
||||
needle_angle = (needle_angle * 10);
|
||||
if(needle_angle > 3600) needle_angle -= 3600;
|
||||
|
||||
@@ -390,20 +390,20 @@ void lv_img_set_zoom(lv_obj_t * img, uint16_t zoom)
|
||||
lv_coord_t h = lv_obj_get_height(img);
|
||||
lv_area_t a;
|
||||
_lv_img_buf_get_transformed_area(&a, w, h, transf_angle, (transf_zoom * ext->zoom) >> 8, &ext->pivot);
|
||||
a.x1 += img->coords.x1;
|
||||
a.y1 += img->coords.y1;
|
||||
a.x2 += img->coords.x1;
|
||||
a.y2 += img->coords.y1;
|
||||
a.x1 += img->coords.x1 - 1;
|
||||
a.y1 += img->coords.y1 - 1;
|
||||
a.x2 += img->coords.x1 + 1;
|
||||
a.y2 += img->coords.y1 + 1;
|
||||
lv_obj_invalidate_area(img, &a);
|
||||
|
||||
ext->zoom = zoom;
|
||||
lv_obj_refresh_ext_draw_pad(img);
|
||||
|
||||
_lv_img_buf_get_transformed_area(&a, w, h, transf_angle, (transf_zoom * ext->zoom) >> 8, &ext->pivot);
|
||||
a.x1 += img->coords.x1;
|
||||
a.y1 += img->coords.y1;
|
||||
a.x2 += img->coords.x1;
|
||||
a.y2 += img->coords.y1;
|
||||
a.x1 += img->coords.x1 - 1;
|
||||
a.y1 += img->coords.y1 - 1;
|
||||
a.x2 += img->coords.x1 + 1;
|
||||
a.y2 += img->coords.y1 + 1;
|
||||
lv_obj_invalidate_area(img, &a);
|
||||
}
|
||||
|
||||
@@ -681,16 +681,16 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area
|
||||
if(zoomed_src_w <= 0) return LV_DESIGN_RES_OK;
|
||||
lv_coord_t zoomed_src_h = (int32_t)((int32_t)ext->h * zoom_final) >> 8;
|
||||
if(zoomed_src_h <= 0) return LV_DESIGN_RES_OK;
|
||||
lv_area_t zommed_coords;
|
||||
lv_obj_get_coords(img, &zommed_coords);
|
||||
lv_area_t zoomed_coords;
|
||||
lv_obj_get_coords(img, &zoomed_coords);
|
||||
|
||||
zommed_coords.x1 += (int32_t)((int32_t)ext->offset.x * zoom_final) >> 8;
|
||||
zommed_coords.y1 += (int32_t)((int32_t)ext->offset.y * zoom_final) >> 8;
|
||||
zommed_coords.x2 = zommed_coords.x1 + ((int32_t)((int32_t)(obj_w - 1) * zoom_final) >> 8);
|
||||
zommed_coords.y2 = zommed_coords.y1 + ((int32_t)((int32_t)(obj_h - 1) * zoom_final) >> 8);
|
||||
zoomed_coords.x1 += (int32_t)((int32_t)ext->offset.x * zoom_final) >> 8;
|
||||
zoomed_coords.y1 += (int32_t)((int32_t)ext->offset.y * zoom_final) >> 8;
|
||||
zoomed_coords.x2 = zoomed_coords.x1 + ((int32_t)((int32_t)(obj_w - 1) * zoom_final) >> 8);
|
||||
zoomed_coords.y2 = zoomed_coords.y1 + ((int32_t)((int32_t)(obj_h - 1) * zoom_final) >> 8);
|
||||
|
||||
if(zommed_coords.x1 > img->coords.x1) zommed_coords.x1 -= ext->w;
|
||||
if(zommed_coords.y1 > img->coords.y1) zommed_coords.y1 -= ext->h;
|
||||
if(zoomed_coords.x1 > img->coords.x1) zoomed_coords.x1 -= ext->w;
|
||||
if(zoomed_coords.y1 > img->coords.y1) zoomed_coords.y1 -= ext->h;
|
||||
|
||||
lv_area_t clip_real;
|
||||
_lv_img_buf_get_transformed_area(&clip_real, lv_obj_get_width(img), lv_obj_get_height(img), angle_final, zoom_final,
|
||||
@@ -703,13 +703,13 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area
|
||||
if(_lv_area_intersect(&clip_real, &clip_real, clip_area) == false) return LV_DESIGN_RES_OK;
|
||||
|
||||
lv_area_t coords_tmp;
|
||||
coords_tmp.y1 = zommed_coords.y1;
|
||||
coords_tmp.y2 = zommed_coords.y1 + ext->h - 1;
|
||||
coords_tmp.y1 = zoomed_coords.y1;
|
||||
coords_tmp.y2 = zoomed_coords.y1 + ext->h - 1;
|
||||
|
||||
for(; coords_tmp.y1 < zommed_coords.y2; coords_tmp.y1 += zoomed_src_h, coords_tmp.y2 += zoomed_src_h) {
|
||||
coords_tmp.x1 = zommed_coords.x1;
|
||||
coords_tmp.x2 = zommed_coords.x1 + ext->w - 1;
|
||||
for(; coords_tmp.x1 < zommed_coords.x2; coords_tmp.x1 += zoomed_src_w, coords_tmp.x2 += zoomed_src_w) {
|
||||
for(; coords_tmp.y1 < zoomed_coords.y2; coords_tmp.y1 += zoomed_src_h, coords_tmp.y2 += zoomed_src_h) {
|
||||
coords_tmp.x1 = zoomed_coords.x1;
|
||||
coords_tmp.x2 = zoomed_coords.x1 + ext->w - 1;
|
||||
for(; coords_tmp.x1 < zoomed_coords.x2; coords_tmp.x1 += zoomed_src_w, coords_tmp.x2 += zoomed_src_w) {
|
||||
lv_draw_img(&coords_tmp, &clip_real, ext->src, &img_dsc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
static lv_design_res_t lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * clip_area, lv_design_mode_t mode);
|
||||
static lv_res_t lv_imgbtn_signal(lv_obj_t * imgbtn, lv_signal_t sign, void * param);
|
||||
static void refr_img(lv_obj_t * imgbtn);
|
||||
static lv_btn_state_t suggest_state(lv_obj_t * imgbtn, lv_btn_state_t state);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@@ -187,7 +188,7 @@ void lv_imgbtn_set_state(lv_obj_t * imgbtn, lv_btn_state_t state)
|
||||
*/
|
||||
void lv_imgbtn_toggle(lv_obj_t * imgbtn)
|
||||
{
|
||||
lv_imgbtn_toggle(imgbtn);
|
||||
lv_btn_toggle(imgbtn);
|
||||
refr_img(imgbtn);
|
||||
}
|
||||
/*=====================
|
||||
@@ -327,7 +328,7 @@ static lv_design_res_t lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * cli
|
||||
|
||||
/*Just draw an image*/
|
||||
lv_imgbtn_ext_t * ext = lv_obj_get_ext_attr(imgbtn);
|
||||
lv_btn_state_t state = lv_imgbtn_get_state(imgbtn);
|
||||
lv_btn_state_t state = suggest_state(imgbtn, lv_imgbtn_get_state(imgbtn));
|
||||
|
||||
/*Simply draw the middle src if no tiled*/
|
||||
if(!ext->tiled) {
|
||||
@@ -440,7 +441,6 @@ static lv_design_res_t lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * cli
|
||||
draw_dsc.shadow_opa = LV_OPA_TRANSP;
|
||||
lv_obj_init_draw_rect_dsc(imgbtn, LV_OBJ_PART_MAIN, &draw_dsc);
|
||||
|
||||
|
||||
lv_area_t bg_coords;
|
||||
lv_area_copy(&bg_coords, &imgbtn->coords);
|
||||
bg_coords.x1 -= lv_obj_get_style_pad_left(imgbtn, LV_IMGBTN_PART_MAIN);
|
||||
@@ -501,7 +501,7 @@ static lv_res_t lv_imgbtn_signal(lv_obj_t * imgbtn, lv_signal_t sign, void * par
|
||||
static void refr_img(lv_obj_t * imgbtn)
|
||||
{
|
||||
lv_imgbtn_ext_t * ext = lv_obj_get_ext_attr(imgbtn);
|
||||
lv_btn_state_t state = lv_imgbtn_get_state(imgbtn);
|
||||
lv_btn_state_t state = suggest_state(imgbtn, lv_imgbtn_get_state(imgbtn));
|
||||
lv_img_header_t header;
|
||||
|
||||
const void * src = ext->img_src_mid[state];
|
||||
@@ -531,4 +531,42 @@ static void refr_img(lv_obj_t * imgbtn)
|
||||
lv_obj_invalidate(imgbtn);
|
||||
}
|
||||
|
||||
/**
|
||||
* If `src` is not defined for the current state try to get a state which is related to the current but has `src`.
|
||||
* E.g. if the PRESSED src is not set but the RELEASED does, use the RELEASED.
|
||||
* @param imgbtn pointer to an image button
|
||||
* @param state the state to convert
|
||||
* @return the suggested state
|
||||
*/
|
||||
static lv_btn_state_t suggest_state(lv_obj_t * imgbtn, lv_btn_state_t state)
|
||||
{
|
||||
lv_imgbtn_ext_t * ext = lv_obj_get_ext_attr(imgbtn);
|
||||
if(ext->img_src_mid[state] == NULL) {
|
||||
switch(state) {
|
||||
case LV_BTN_STATE_PRESSED:
|
||||
if(ext->img_src_mid[LV_BTN_STATE_RELEASED]) return LV_BTN_STATE_RELEASED;
|
||||
break;
|
||||
case LV_BTN_STATE_CHECKED_RELEASED:
|
||||
if(ext->img_src_mid[LV_BTN_STATE_RELEASED]) return LV_BTN_STATE_RELEASED;
|
||||
break;
|
||||
case LV_BTN_STATE_CHECKED_PRESSED:
|
||||
if(ext->img_src_mid[LV_BTN_STATE_CHECKED_RELEASED]) return LV_BTN_STATE_CHECKED_RELEASED;
|
||||
if(ext->img_src_mid[LV_BTN_STATE_PRESSED]) return LV_BTN_STATE_PRESSED;
|
||||
if(ext->img_src_mid[LV_BTN_STATE_RELEASED]) return LV_BTN_STATE_RELEASED;
|
||||
break;
|
||||
case LV_BTN_STATE_DISABLED:
|
||||
if(ext->img_src_mid[LV_BTN_STATE_RELEASED]) return LV_BTN_STATE_RELEASED;
|
||||
break;
|
||||
case LV_BTN_STATE_CHECKED_DISABLED:
|
||||
if(ext->img_src_mid[LV_BTN_STATE_CHECKED_RELEASED]) return LV_BTN_STATE_CHECKED_RELEASED;
|
||||
if(ext->img_src_mid[LV_BTN_STATE_RELEASED]) return LV_BTN_STATE_RELEASED;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
**********************/
|
||||
static lv_res_t lv_label_signal(lv_obj_t * label, lv_signal_t sign, void * param);
|
||||
static lv_design_res_t lv_label_design(lv_obj_t * label, const lv_area_t * clip_area, lv_design_mode_t mode);
|
||||
static void lv_label_refr_text(lv_obj_t * label);
|
||||
static void lv_label_revert_dots(lv_obj_t * label);
|
||||
|
||||
#if LV_USE_ANIMATION
|
||||
@@ -186,11 +185,8 @@ void lv_label_set_text(lv_obj_t * label, const char * text)
|
||||
|
||||
lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
|
||||
|
||||
/*If text is NULL then refresh */
|
||||
if(text == NULL) {
|
||||
lv_label_refr_text(label);
|
||||
return;
|
||||
}
|
||||
/*If text is NULL then just refresh with the current text */
|
||||
if(text == NULL) text = ext->text;
|
||||
|
||||
LV_ASSERT_STR(text);
|
||||
|
||||
@@ -271,50 +267,10 @@ void lv_label_set_text_fmt(lv_obj_t * label, const char * fmt, ...)
|
||||
ext->text = NULL;
|
||||
}
|
||||
|
||||
|
||||
va_list ap, ap2;
|
||||
va_start(ap, fmt);
|
||||
va_copy(ap2, ap);
|
||||
|
||||
/*Allocate space for the new text by using trick from C99 standard section 7.19.6.12 */
|
||||
uint32_t len = lv_vsnprintf(NULL, 0, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
#if LV_USE_ARABIC_PERSIAN_CHARS
|
||||
/*Put together the text according to the format string*/
|
||||
char * raw_txt = _lv_mem_buf_get(len + 1);
|
||||
LV_ASSERT_MEM(raw_txt);
|
||||
if(raw_txt == NULL) {
|
||||
va_end(ap2);
|
||||
return;
|
||||
}
|
||||
|
||||
lv_vsnprintf(raw_txt, len + 1, fmt, ap2);
|
||||
|
||||
/*Get the size of the Arabic text and process it*/
|
||||
size_t len_ap = _lv_txt_ap_calc_bytes_cnt(raw_txt);
|
||||
ext->text = lv_mem_alloc(len_ap + 1);
|
||||
LV_ASSERT_MEM(ext->text);
|
||||
if(ext->text == NULL) {
|
||||
va_end(ap2);
|
||||
return;
|
||||
}
|
||||
_lv_txt_ap_proc(raw_txt, ext->text);
|
||||
|
||||
_lv_mem_buf_release(raw_txt);
|
||||
#else
|
||||
ext->text = lv_mem_alloc(len + 1);
|
||||
LV_ASSERT_MEM(ext->text);
|
||||
if(ext->text == NULL) {
|
||||
va_end(ap2);
|
||||
return;
|
||||
}
|
||||
ext->text[len - 1] = 0; /* Ensure NULL termination */
|
||||
|
||||
lv_vsnprintf(ext->text, len + 1, fmt, ap2);
|
||||
#endif
|
||||
|
||||
va_end(ap2);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
ext->text = _lv_txt_set_text_vfmt(fmt, args);
|
||||
va_end(args);
|
||||
ext->static_txt = 0; /*Now the text is dynamically allocated*/
|
||||
|
||||
lv_label_refr_text(label);
|
||||
@@ -414,11 +370,11 @@ void lv_label_set_recolor(lv_obj_t * label, bool en)
|
||||
ext->recolor = en == false ? 0 : 1;
|
||||
|
||||
lv_label_refr_text(label); /*Refresh the text because the potential color codes in text needs to
|
||||
be hided or revealed*/
|
||||
be hidden or revealed*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the label's animation speed in LV_LABEL_LONG_SROLL/SCROLL_CIRC modes
|
||||
* Set the label's animation speed in LV_LABEL_LONG_SROLL/SROLL_CIRC modes
|
||||
* @param label pointer to a label object
|
||||
* @param anim_speed speed of animation in px/sec unit
|
||||
*/
|
||||
@@ -1003,7 +959,7 @@ void lv_label_ins_text(lv_obj_t * label, uint32_t pos, const char * txt)
|
||||
#else
|
||||
_lv_txt_ins(ext->text, pos, txt);
|
||||
#endif
|
||||
lv_label_refr_text(label);
|
||||
lv_label_set_text(label, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1032,185 +988,11 @@ void lv_label_cut_text(lv_obj_t * label, uint32_t pos, uint32_t cnt)
|
||||
lv_label_refr_text(label);
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Handle the drawing related tasks of the labels
|
||||
* @param label pointer to a label object
|
||||
* @param clip_area the object will be drawn only in this area
|
||||
* @param mode LV_DESIGN_COVER_CHK: only check if the object fully covers the 'mask_p' area
|
||||
* (return 'true' if yes)
|
||||
* LV_DESIGN_DRAW: draw the object (always return 'true')
|
||||
* LV_DESIGN_DRAW_POST: drawing after every children are drawn
|
||||
* @param return an element of `lv_design_res_t`
|
||||
*/
|
||||
static lv_design_res_t lv_label_design(lv_obj_t * label, const lv_area_t * clip_area, lv_design_mode_t mode)
|
||||
{
|
||||
/* A label never covers an area */
|
||||
if(mode == LV_DESIGN_COVER_CHK)
|
||||
return LV_DESIGN_RES_NOT_COVER;
|
||||
else if(mode == LV_DESIGN_DRAW_MAIN) {
|
||||
lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
|
||||
|
||||
lv_coord_t w = lv_obj_get_style_transform_width(label, LV_LABEL_PART_MAIN);
|
||||
lv_coord_t h = lv_obj_get_style_transform_height(label, LV_LABEL_PART_MAIN);
|
||||
lv_area_t bg_coords;
|
||||
lv_area_copy(&bg_coords, &label->coords);
|
||||
bg_coords.x1 -= w;
|
||||
bg_coords.x2 += w;
|
||||
bg_coords.y1 -= h;
|
||||
bg_coords.y2 += h;
|
||||
|
||||
lv_draw_rect_dsc_t draw_rect_dsc;
|
||||
lv_draw_rect_dsc_init(&draw_rect_dsc);
|
||||
lv_obj_init_draw_rect_dsc(label, LV_LABEL_PART_MAIN, &draw_rect_dsc);
|
||||
|
||||
lv_draw_rect(&bg_coords, clip_area, &draw_rect_dsc);
|
||||
|
||||
lv_area_t txt_coords;
|
||||
get_txt_coords(label, &txt_coords);
|
||||
|
||||
lv_area_t txt_clip;
|
||||
bool is_common = _lv_area_intersect(&txt_clip, clip_area, &txt_coords);
|
||||
if(!is_common) return LV_DESIGN_RES_OK;
|
||||
|
||||
lv_label_align_t align = lv_label_get_align(label);
|
||||
|
||||
lv_txt_flag_t flag = LV_TXT_FLAG_NONE;
|
||||
if(ext->recolor != 0) flag |= LV_TXT_FLAG_RECOLOR;
|
||||
if(ext->expand != 0) flag |= LV_TXT_FLAG_EXPAND;
|
||||
if(ext->long_mode == LV_LABEL_LONG_EXPAND) flag |= LV_TXT_FLAG_FIT;
|
||||
if(align == LV_LABEL_ALIGN_CENTER) flag |= LV_TXT_FLAG_CENTER;
|
||||
if(align == LV_LABEL_ALIGN_RIGHT) flag |= LV_TXT_FLAG_RIGHT;
|
||||
|
||||
lv_draw_label_dsc_t label_draw_dsc;
|
||||
lv_draw_label_dsc_init(&label_draw_dsc);
|
||||
|
||||
label_draw_dsc.sel_start = lv_label_get_text_sel_start(label);
|
||||
label_draw_dsc.sel_end = lv_label_get_text_sel_end(label);
|
||||
label_draw_dsc.ofs_x = ext->offset.x;
|
||||
label_draw_dsc.ofs_y = ext->offset.y;
|
||||
label_draw_dsc.flag = flag;
|
||||
lv_obj_init_draw_label_dsc(label, LV_LABEL_PART_MAIN, &label_draw_dsc);
|
||||
|
||||
/* In SCROLL and SCROLL_CIRC mode the CENTER and RIGHT are pointless so remove them.
|
||||
* (In addition they will result misalignment is this case)*/
|
||||
if((ext->long_mode == LV_LABEL_LONG_SROLL || ext->long_mode == LV_LABEL_LONG_SROLL_CIRC) &&
|
||||
(ext->align == LV_LABEL_ALIGN_CENTER || ext->align == LV_LABEL_ALIGN_RIGHT)) {
|
||||
lv_point_t size;
|
||||
_lv_txt_get_size(&size, ext->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space,
|
||||
LV_COORD_MAX, flag);
|
||||
if(size.x > lv_area_get_width(&txt_coords)) {
|
||||
label_draw_dsc.flag &= ~LV_TXT_FLAG_RIGHT;
|
||||
label_draw_dsc.flag &= ~LV_TXT_FLAG_CENTER;
|
||||
}
|
||||
}
|
||||
#if LV_LABEL_LONG_TXT_HINT
|
||||
lv_draw_label_hint_t * hint = &ext->hint;
|
||||
if(ext->long_mode == LV_LABEL_LONG_SROLL_CIRC || lv_area_get_height(&txt_coords) < LV_LABEL_HINT_HEIGHT_LIMIT)
|
||||
hint = NULL;
|
||||
|
||||
#else
|
||||
/*Just for compatibility*/
|
||||
lv_draw_label_hint_t * hint = NULL;
|
||||
#endif
|
||||
|
||||
lv_draw_label(&txt_coords, &txt_clip, &label_draw_dsc, ext->text, hint);
|
||||
|
||||
if(ext->long_mode == LV_LABEL_LONG_SROLL_CIRC) {
|
||||
lv_point_t size;
|
||||
_lv_txt_get_size(&size, ext->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space,
|
||||
LV_COORD_MAX, flag);
|
||||
|
||||
/*Draw the text again next to the original to make an circular effect */
|
||||
if(size.x > lv_area_get_width(&txt_coords)) {
|
||||
label_draw_dsc.ofs_x = ext->offset.x + size.x +
|
||||
lv_font_get_glyph_width(label_draw_dsc.font, ' ', ' ') * LV_LABEL_WAIT_CHAR_COUNT;
|
||||
label_draw_dsc.ofs_y = ext->offset.y;
|
||||
|
||||
lv_draw_label(&txt_coords, &txt_clip, &label_draw_dsc, ext->text, hint);
|
||||
}
|
||||
|
||||
/*Draw the text again below the original to make an circular effect */
|
||||
if(size.y > lv_area_get_height(&txt_coords)) {
|
||||
label_draw_dsc.ofs_x = ext->offset.x;
|
||||
label_draw_dsc.ofs_y = ext->offset.y + size.y + lv_font_get_line_height(label_draw_dsc.font);
|
||||
|
||||
lv_draw_label(&txt_coords, &txt_clip, &label_draw_dsc, ext->text, hint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return LV_DESIGN_RES_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Signal function of the label
|
||||
* @param label pointer to a label object
|
||||
* @param sign a signal type from lv_signal_t enum
|
||||
* @param param pointer to a signal specific variable
|
||||
* @return LV_RES_OK: the object is not deleted in the function; LV_RES_INV: the object is deleted
|
||||
*/
|
||||
static lv_res_t lv_label_signal(lv_obj_t * label, lv_signal_t sign, void * param)
|
||||
{
|
||||
lv_res_t res;
|
||||
|
||||
if(sign == LV_SIGNAL_GET_STYLE) {
|
||||
lv_get_style_info_t * info = param;
|
||||
info->result = lv_label_get_style(label, info->part);
|
||||
if(info->result != NULL) return LV_RES_OK;
|
||||
else return ancestor_signal(label, sign, param);
|
||||
}
|
||||
|
||||
/* Include the ancient signal function */
|
||||
res = ancestor_signal(label, sign, param);
|
||||
if(res != LV_RES_OK) return res;
|
||||
if(sign == LV_SIGNAL_GET_TYPE) return lv_obj_handle_get_type_signal(param, LV_OBJX_NAME);
|
||||
|
||||
lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
|
||||
if(sign == LV_SIGNAL_CLEANUP) {
|
||||
if(ext->static_txt == 0) {
|
||||
lv_mem_free(ext->text);
|
||||
ext->text = NULL;
|
||||
}
|
||||
lv_label_dot_tmp_free(label);
|
||||
}
|
||||
else if(sign == LV_SIGNAL_STYLE_CHG) {
|
||||
/*Revert dots for proper refresh*/
|
||||
lv_label_revert_dots(label);
|
||||
lv_label_refr_text(label);
|
||||
}
|
||||
else if(sign == LV_SIGNAL_COORD_CHG) {
|
||||
if(lv_area_get_width(&label->coords) != lv_area_get_width(param) ||
|
||||
lv_area_get_height(&label->coords) != lv_area_get_height(param)) {
|
||||
lv_label_revert_dots(label);
|
||||
lv_label_refr_text(label);
|
||||
}
|
||||
}
|
||||
else if(sign == LV_SIGNAL_BASE_DIR_CHG) {
|
||||
#if LV_USE_BIDI
|
||||
if(ext->static_txt == 0) lv_label_set_text(label, NULL);
|
||||
#endif
|
||||
}
|
||||
else if(sign == LV_SIGNAL_GET_TYPE) {
|
||||
lv_obj_type_t * buf = param;
|
||||
uint8_t i;
|
||||
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
|
||||
if(buf->type[i] == NULL) break;
|
||||
}
|
||||
buf->type[i] = "lv_label";
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh the label with its text stored in its extended data
|
||||
* @param label pointer to a label object
|
||||
*/
|
||||
static void lv_label_refr_text(lv_obj_t * label)
|
||||
void lv_label_refr_text(lv_obj_t * label)
|
||||
{
|
||||
lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
|
||||
|
||||
@@ -1383,13 +1165,22 @@ static void lv_label_refr_text(lv_obj_t * label)
|
||||
}
|
||||
else {
|
||||
lv_point_t p;
|
||||
lv_coord_t y_overed;
|
||||
p.x = lv_area_get_width(&txt_coords) -
|
||||
(lv_font_get_glyph_width(font, '.', '.') + letter_space) *
|
||||
LV_LABEL_DOT_NUM; /*Shrink with dots*/
|
||||
p.y = lv_area_get_height(&txt_coords);
|
||||
p.y -= p.y %
|
||||
(lv_font_get_line_height(font) + line_space); /*Round down to the last line*/
|
||||
p.y -= line_space; /*Trim the last line space*/
|
||||
y_overed = p.y %
|
||||
(lv_font_get_line_height(font) + line_space); /*Round down to the last line*/
|
||||
if(y_overed >= lv_font_get_line_height(font)) {
|
||||
p.y -= y_overed;
|
||||
p.y += lv_font_get_line_height(font);
|
||||
}
|
||||
else {
|
||||
p.y -= y_overed;
|
||||
p.y -= line_space;
|
||||
}
|
||||
|
||||
uint32_t letter_id = lv_label_get_letter_on(label, &p);
|
||||
|
||||
|
||||
@@ -1397,7 +1188,7 @@ static void lv_label_refr_text(lv_obj_t * label)
|
||||
size_t txt_len = strlen(ext->text);
|
||||
uint32_t byte_id = _lv_txt_encoded_get_byte_id(ext->text, letter_id);
|
||||
while(byte_id + LV_LABEL_DOT_NUM > txt_len) {
|
||||
byte_id -= _lv_txt_encoded_size(&ext->text[byte_id]);
|
||||
_lv_txt_encoded_prev(ext->text, &byte_id);
|
||||
letter_id--;
|
||||
}
|
||||
|
||||
@@ -1432,6 +1223,180 @@ static void lv_label_refr_text(lv_obj_t * label)
|
||||
lv_obj_invalidate(label);
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Handle the drawing related tasks of the labels
|
||||
* @param label pointer to a label object
|
||||
* @param clip_area the object will be drawn only in this area
|
||||
* @param mode LV_DESIGN_COVER_CHK: only check if the object fully covers the 'mask_p' area
|
||||
* (return 'true' if yes)
|
||||
* LV_DESIGN_DRAW: draw the object (always return 'true')
|
||||
* LV_DESIGN_DRAW_POST: drawing after every children are drawn
|
||||
* @param return an element of `lv_design_res_t`
|
||||
*/
|
||||
static lv_design_res_t lv_label_design(lv_obj_t * label, const lv_area_t * clip_area, lv_design_mode_t mode)
|
||||
{
|
||||
/* A label never covers an area */
|
||||
if(mode == LV_DESIGN_COVER_CHK)
|
||||
return LV_DESIGN_RES_NOT_COVER;
|
||||
else if(mode == LV_DESIGN_DRAW_MAIN) {
|
||||
lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
|
||||
|
||||
lv_coord_t w = lv_obj_get_style_transform_width(label, LV_LABEL_PART_MAIN);
|
||||
lv_coord_t h = lv_obj_get_style_transform_height(label, LV_LABEL_PART_MAIN);
|
||||
lv_area_t bg_coords;
|
||||
lv_area_copy(&bg_coords, &label->coords);
|
||||
bg_coords.x1 -= w;
|
||||
bg_coords.x2 += w;
|
||||
bg_coords.y1 -= h;
|
||||
bg_coords.y2 += h;
|
||||
|
||||
lv_draw_rect_dsc_t draw_rect_dsc;
|
||||
lv_draw_rect_dsc_init(&draw_rect_dsc);
|
||||
lv_obj_init_draw_rect_dsc(label, LV_LABEL_PART_MAIN, &draw_rect_dsc);
|
||||
|
||||
lv_draw_rect(&bg_coords, clip_area, &draw_rect_dsc);
|
||||
|
||||
lv_area_t txt_coords;
|
||||
get_txt_coords(label, &txt_coords);
|
||||
|
||||
lv_area_t txt_clip;
|
||||
bool is_common = _lv_area_intersect(&txt_clip, clip_area, &txt_coords);
|
||||
if(!is_common) return LV_DESIGN_RES_OK;
|
||||
|
||||
lv_label_align_t align = lv_label_get_align(label);
|
||||
|
||||
lv_txt_flag_t flag = LV_TXT_FLAG_NONE;
|
||||
if(ext->recolor != 0) flag |= LV_TXT_FLAG_RECOLOR;
|
||||
if(ext->expand != 0) flag |= LV_TXT_FLAG_EXPAND;
|
||||
if(ext->long_mode == LV_LABEL_LONG_EXPAND) flag |= LV_TXT_FLAG_FIT;
|
||||
if(align == LV_LABEL_ALIGN_CENTER) flag |= LV_TXT_FLAG_CENTER;
|
||||
if(align == LV_LABEL_ALIGN_RIGHT) flag |= LV_TXT_FLAG_RIGHT;
|
||||
|
||||
lv_draw_label_dsc_t label_draw_dsc;
|
||||
lv_draw_label_dsc_init(&label_draw_dsc);
|
||||
|
||||
label_draw_dsc.sel_start = lv_label_get_text_sel_start(label);
|
||||
label_draw_dsc.sel_end = lv_label_get_text_sel_end(label);
|
||||
label_draw_dsc.ofs_x = ext->offset.x;
|
||||
label_draw_dsc.ofs_y = ext->offset.y;
|
||||
label_draw_dsc.flag = flag;
|
||||
lv_obj_init_draw_label_dsc(label, LV_LABEL_PART_MAIN, &label_draw_dsc);
|
||||
|
||||
/* In SROLL and SROLL_CIRC mode the CENTER and RIGHT are pointless so remove them.
|
||||
* (In addition they will result misalignment is this case)*/
|
||||
if((ext->long_mode == LV_LABEL_LONG_SROLL || ext->long_mode == LV_LABEL_LONG_SROLL_CIRC) &&
|
||||
(ext->align == LV_LABEL_ALIGN_CENTER || ext->align == LV_LABEL_ALIGN_RIGHT)) {
|
||||
lv_point_t size;
|
||||
_lv_txt_get_size(&size, ext->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space,
|
||||
LV_COORD_MAX, flag);
|
||||
if(size.x > lv_area_get_width(&txt_coords)) {
|
||||
label_draw_dsc.flag &= ~LV_TXT_FLAG_RIGHT;
|
||||
label_draw_dsc.flag &= ~LV_TXT_FLAG_CENTER;
|
||||
}
|
||||
}
|
||||
#if LV_LABEL_LONG_TXT_HINT
|
||||
lv_draw_label_hint_t * hint = &ext->hint;
|
||||
if(ext->long_mode == LV_LABEL_LONG_SROLL_CIRC || lv_area_get_height(&txt_coords) < LV_LABEL_HINT_HEIGHT_LIMIT)
|
||||
hint = NULL;
|
||||
|
||||
#else
|
||||
/*Just for compatibility*/
|
||||
lv_draw_label_hint_t * hint = NULL;
|
||||
#endif
|
||||
|
||||
lv_draw_label(&txt_coords, &txt_clip, &label_draw_dsc, ext->text, hint);
|
||||
|
||||
if(ext->long_mode == LV_LABEL_LONG_SROLL_CIRC) {
|
||||
lv_point_t size;
|
||||
_lv_txt_get_size(&size, ext->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space,
|
||||
LV_COORD_MAX, flag);
|
||||
|
||||
/*Draw the text again next to the original to make an circular effect */
|
||||
if(size.x > lv_area_get_width(&txt_coords)) {
|
||||
label_draw_dsc.ofs_x = ext->offset.x + size.x +
|
||||
lv_font_get_glyph_width(label_draw_dsc.font, ' ', ' ') * LV_LABEL_WAIT_CHAR_COUNT;
|
||||
label_draw_dsc.ofs_y = ext->offset.y;
|
||||
|
||||
lv_draw_label(&txt_coords, &txt_clip, &label_draw_dsc, ext->text, hint);
|
||||
}
|
||||
|
||||
/*Draw the text again below the original to make an circular effect */
|
||||
if(size.y > lv_area_get_height(&txt_coords)) {
|
||||
label_draw_dsc.ofs_x = ext->offset.x;
|
||||
label_draw_dsc.ofs_y = ext->offset.y + size.y + lv_font_get_line_height(label_draw_dsc.font);
|
||||
|
||||
lv_draw_label(&txt_coords, &txt_clip, &label_draw_dsc, ext->text, hint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return LV_DESIGN_RES_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Signal function of the label
|
||||
* @param label pointer to a label object
|
||||
* @param sign a signal type from lv_signal_t enum
|
||||
* @param param pointer to a signal specific variable
|
||||
* @return LV_RES_OK: the object is not deleted in the function; LV_RES_INV: the object is deleted
|
||||
*/
|
||||
static lv_res_t lv_label_signal(lv_obj_t * label, lv_signal_t sign, void * param)
|
||||
{
|
||||
lv_res_t res;
|
||||
|
||||
if(sign == LV_SIGNAL_GET_STYLE) {
|
||||
lv_get_style_info_t * info = param;
|
||||
info->result = lv_label_get_style(label, info->part);
|
||||
if(info->result != NULL) return LV_RES_OK;
|
||||
else return ancestor_signal(label, sign, param);
|
||||
}
|
||||
|
||||
/* Include the ancient signal function */
|
||||
res = ancestor_signal(label, sign, param);
|
||||
if(res != LV_RES_OK) return res;
|
||||
if(sign == LV_SIGNAL_GET_TYPE) return lv_obj_handle_get_type_signal(param, LV_OBJX_NAME);
|
||||
|
||||
lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
|
||||
if(sign == LV_SIGNAL_CLEANUP) {
|
||||
if(ext->static_txt == 0) {
|
||||
lv_mem_free(ext->text);
|
||||
ext->text = NULL;
|
||||
}
|
||||
lv_label_dot_tmp_free(label);
|
||||
}
|
||||
else if(sign == LV_SIGNAL_STYLE_CHG) {
|
||||
/*Revert dots for proper refresh*/
|
||||
lv_label_revert_dots(label);
|
||||
lv_label_refr_text(label);
|
||||
}
|
||||
else if(sign == LV_SIGNAL_COORD_CHG) {
|
||||
if(lv_area_get_width(&label->coords) != lv_area_get_width(param) ||
|
||||
lv_area_get_height(&label->coords) != lv_area_get_height(param)) {
|
||||
lv_label_revert_dots(label);
|
||||
lv_label_refr_text(label);
|
||||
}
|
||||
}
|
||||
else if(sign == LV_SIGNAL_BASE_DIR_CHG) {
|
||||
#if LV_USE_BIDI
|
||||
if(ext->static_txt == 0) lv_label_set_text(label, NULL);
|
||||
#endif
|
||||
}
|
||||
else if(sign == LV_SIGNAL_GET_TYPE) {
|
||||
lv_obj_type_t * buf = param;
|
||||
uint8_t i;
|
||||
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
|
||||
if(buf->type[i] == NULL) break;
|
||||
}
|
||||
buf->type[i] = "lv_label";
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static void lv_label_revert_dots(lv_obj_t * label)
|
||||
{
|
||||
lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
|
||||
|
||||
@@ -167,7 +167,7 @@ void lv_label_set_align(lv_obj_t * label, lv_label_align_t align);
|
||||
void lv_label_set_recolor(lv_obj_t * label, bool en);
|
||||
|
||||
/**
|
||||
* Set the label's animation speed in LV_LABEL_LONG_SROLL/SCROLL_CIRC modes
|
||||
* Set the label's animation speed in LV_LABEL_LONG_SROLL/SROLL_CIRC modes
|
||||
* @param label pointer to a label object
|
||||
* @param anim_speed speed of animation in px/sec unit
|
||||
*/
|
||||
@@ -186,7 +186,6 @@ void lv_label_set_text_sel_start(lv_obj_t * label, uint32_t index);
|
||||
* @param index index to set. `LV_LABEL_TXT_SEL_OFF` to select nothing.
|
||||
*/
|
||||
void lv_label_set_text_sel_end(lv_obj_t * label, uint32_t index);
|
||||
|
||||
/*=====================
|
||||
* Getter functions
|
||||
*====================*/
|
||||
@@ -291,6 +290,12 @@ void lv_label_ins_text(lv_obj_t * label, uint32_t pos, const char * txt);
|
||||
*/
|
||||
void lv_label_cut_text(lv_obj_t * label, uint32_t pos, uint32_t cnt);
|
||||
|
||||
/**
|
||||
* Refresh the label with its text stored in its extended data
|
||||
* @param label pointer to a label object
|
||||
*/
|
||||
void lv_label_refr_text(lv_obj_t * label);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
@@ -131,83 +131,9 @@ void lv_linemeter_set_value(lv_obj_t * lmeter, int32_t value)
|
||||
int16_t level_new =
|
||||
(int32_t)((int32_t)(ext->cur_value - ext->min_value) * (ext->line_cnt - 1)) / (ext->max_value - ext->min_value);
|
||||
|
||||
if(level_new == level_old) {
|
||||
return;
|
||||
}
|
||||
|
||||
lv_style_int_t left = lv_obj_get_style_pad_left(lmeter, LV_LINEMETER_PART_MAIN);
|
||||
lv_style_int_t right = lv_obj_get_style_pad_right(lmeter, LV_LINEMETER_PART_MAIN);
|
||||
lv_style_int_t top = lv_obj_get_style_pad_top(lmeter, LV_LINEMETER_PART_MAIN);
|
||||
lv_style_int_t bottom = lv_obj_get_style_pad_bottom(lmeter, LV_LINEMETER_PART_MAIN);
|
||||
|
||||
lv_coord_t r_out = (lv_obj_get_width(lmeter) - left - right) / 2 ;
|
||||
lv_coord_t r_in = r_out - lv_obj_get_style_scale_width(lmeter, LV_LINEMETER_PART_MAIN);
|
||||
if(r_in < 1) r_in = 1;
|
||||
|
||||
lv_coord_t x_ofs = lmeter->coords.x1 + r_out + left;
|
||||
lv_coord_t y_ofs = lmeter->coords.y1 + r_out + top;
|
||||
int16_t angle_ofs = ext->angle_ofs + 90 + (360 - ext->scale_angle) / 2;
|
||||
|
||||
lv_style_int_t line_width = lv_obj_get_style_scale_end_line_width(lmeter, LV_LINEMETER_PART_MAIN);
|
||||
lv_style_int_t end_line_width = lv_obj_get_style_scale_end_line_width(lmeter, LV_LINEMETER_PART_MAIN);
|
||||
line_width = LV_MATH_MAX(line_width, end_line_width);
|
||||
|
||||
int32_t angle_old = (level_old * ext->scale_angle) / (ext->line_cnt - 1);
|
||||
|
||||
/*Use smaller clip area only around the visible line*/
|
||||
int32_t y_in_old = (int32_t)((int32_t)_lv_trigo_sin(angle_old + angle_ofs) * r_in) >> LV_TRIGO_SHIFT;
|
||||
int32_t x_in_old = (int32_t)((int32_t)_lv_trigo_sin(angle_old + 90 + angle_ofs) * r_in) >> LV_TRIGO_SHIFT;
|
||||
|
||||
|
||||
int32_t y_out_old = (int32_t)((int32_t)_lv_trigo_sin(angle_old + angle_ofs) * r_out) >> LV_TRIGO_SHIFT;
|
||||
int32_t x_out_old = (int32_t)((int32_t)_lv_trigo_sin(angle_old + 90 + angle_ofs) * r_out) >> LV_TRIGO_SHIFT;
|
||||
|
||||
|
||||
|
||||
int32_t angle_new = (level_new * ext->scale_angle) / (ext->line_cnt - 1);
|
||||
|
||||
/*Use smaller clip area only around the visible line*/
|
||||
int32_t y_in_new = (int32_t)((int32_t)_lv_trigo_sin(angle_new + angle_ofs) * r_in) >> LV_TRIGO_SHIFT;
|
||||
int32_t x_in_new = (int32_t)((int32_t)_lv_trigo_sin(angle_new + 90 + angle_ofs) * r_in) >> LV_TRIGO_SHIFT;
|
||||
|
||||
|
||||
int32_t y_out_new = (int32_t)((int32_t)_lv_trigo_sin(angle_new + angle_ofs) * r_out) >> LV_TRIGO_SHIFT;
|
||||
int32_t x_out_new = (int32_t)((int32_t)_lv_trigo_sin(angle_new + 90 + angle_ofs) * r_out) >> LV_TRIGO_SHIFT;
|
||||
|
||||
lv_area_t a;
|
||||
if(x_out_old < 0 && x_out_new < 0) {
|
||||
a.x1 = lmeter->coords.x1 + left - line_width;
|
||||
a.y1 = LV_MATH_MIN4(y_out_old, y_out_new, y_in_old, y_in_new) + y_ofs - line_width;
|
||||
a.x2 = LV_MATH_MAX(x_in_old, x_in_new) + x_ofs + line_width;
|
||||
a.y2 = LV_MATH_MAX4(y_out_old, y_out_new, y_in_old, y_in_new) + y_ofs + line_width;
|
||||
}
|
||||
else if(x_out_old > 0 && x_out_new > 0) {
|
||||
a.x1 = LV_MATH_MIN(x_in_old, x_in_new) + x_ofs - line_width;
|
||||
a.y1 = LV_MATH_MIN4(y_out_old, y_out_new, y_in_old, y_in_new) + y_ofs - line_width;
|
||||
a.x2 = lmeter->coords.x2 - right + line_width;
|
||||
a.y2 = LV_MATH_MAX4(y_out_old, y_out_new, y_in_old, y_in_new) + y_ofs + line_width;
|
||||
}
|
||||
else if(y_out_old < 0 && y_out_new < 0) {
|
||||
a.x1 = LV_MATH_MIN4(x_out_old, x_out_new, x_in_old, x_in_new) + x_ofs - line_width;
|
||||
a.y1 = lmeter->coords.y1 + top - line_width;
|
||||
a.x2 = LV_MATH_MAX4(x_out_old, x_out_new, x_in_old, x_in_new) + x_ofs + line_width;
|
||||
a.y2 = LV_MATH_MAX(y_in_old, y_in_new) + y_ofs + line_width;
|
||||
}
|
||||
else if(y_out_old > 0 && y_out_new > 0) {
|
||||
a.x1 = LV_MATH_MIN4(x_out_old, x_out_new, x_in_old, x_in_new) + x_ofs - line_width;
|
||||
a.y1 = LV_MATH_MIN(y_in_old, y_in_new) + y_ofs - line_width;
|
||||
a.x2 = LV_MATH_MAX4(x_out_old, x_out_new, x_in_old, x_in_new) + x_ofs + line_width;
|
||||
a.y2 = lmeter->coords.y2 - bottom + line_width;
|
||||
}
|
||||
else {
|
||||
a.x1 = lmeter->coords.x1 + left - line_width;
|
||||
a.y1 = lmeter->coords.y1 + top - line_width;
|
||||
a.x2 = lmeter->coords.x2 - right + line_width;
|
||||
a.y2 = lmeter->coords.y2 - bottom + line_width;
|
||||
}
|
||||
|
||||
lv_obj_invalidate_area(lmeter, &a);
|
||||
if(level_new == level_old) return;
|
||||
|
||||
lv_obj_invalidate(lmeter);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -250,10 +250,16 @@ bool lv_list_remove(const lv_obj_t * list, uint16_t index)
|
||||
{
|
||||
LV_ASSERT_OBJ(list, LV_OBJX_NAME);
|
||||
|
||||
lv_list_ext_t * ext = lv_obj_get_ext_attr(list);
|
||||
uint16_t count = 0;
|
||||
lv_obj_t * e = lv_list_get_next_btn(list, NULL);
|
||||
while(e != NULL) {
|
||||
if(count == index) {
|
||||
#if LV_USE_GROUP
|
||||
if(e == ext->last_sel_btn) ext->last_sel_btn = NULL;
|
||||
#endif
|
||||
if(e == ext->act_sel_btn) ext->act_sel_btn = NULL;
|
||||
|
||||
lv_obj_del(e);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ void lv_list_down(const lv_obj_t * list);
|
||||
/**
|
||||
* Focus on a list button. It ensures that the button will be visible on the list.
|
||||
* @param btn pointer to a list button to focus
|
||||
* @param anim LV_ANOM_ON: scroll with animation, LV_ANIM_OFF: without animation
|
||||
* @param anim LV_ANIM_ON: scroll with animation, LV_ANIM_OFF: without animation
|
||||
*/
|
||||
void lv_list_focus(const lv_obj_t * btn, lv_anim_enable_t anim);
|
||||
|
||||
|
||||
@@ -198,6 +198,38 @@ void lv_msgbox_set_text(lv_obj_t * mbox, const char * txt)
|
||||
mbox_realign(mbox);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a formatted text for the message box
|
||||
* @param mbox pointer to a message box
|
||||
* @param fmt `printf`-like format
|
||||
*/
|
||||
void lv_msgbox_set_text_fmt(lv_obj_t * mbox, const char * fmt, ...)
|
||||
{
|
||||
LV_ASSERT_OBJ(mbox, LV_OBJX_NAME);
|
||||
LV_ASSERT_STR(fmt);
|
||||
|
||||
lv_msgbox_ext_t * msgbox_ext = lv_obj_get_ext_attr(mbox);
|
||||
lv_label_ext_t * label_ext = lv_obj_get_ext_attr(msgbox_ext->text);
|
||||
|
||||
/*If text is NULL then refresh */
|
||||
if(fmt == NULL) {
|
||||
lv_label_refr_text(msgbox_ext->text);
|
||||
return;
|
||||
}
|
||||
|
||||
if(label_ext->text != NULL) {
|
||||
lv_mem_free(label_ext->text);
|
||||
label_ext->text = NULL;
|
||||
}
|
||||
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
label_ext->text = _lv_txt_set_text_vfmt(fmt, args);
|
||||
va_end(args);
|
||||
lv_label_refr_text(msgbox_ext->text);
|
||||
mbox_realign(mbox);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set animation duration
|
||||
* @param mbox pointer to a message box object
|
||||
|
||||
@@ -99,6 +99,13 @@ void lv_msgbox_add_btns(lv_obj_t * mbox, const char * btn_mapaction[]);
|
||||
*/
|
||||
void lv_msgbox_set_text(lv_obj_t * mbox, const char * txt);
|
||||
|
||||
/**
|
||||
* Set a formatted text for the message box
|
||||
* @param mbox pointer to a message box
|
||||
* @param fmt `printf`-like format
|
||||
*/
|
||||
void lv_msgbox_set_text_fmt(lv_obj_t * mbox, const char * fmt, ...);
|
||||
|
||||
/**
|
||||
* Set animation duration
|
||||
* @param mbox pointer to a message box object
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* TEMPL -> object short name with upper case (e.g. BTN, LABEL etc.)
|
||||
*
|
||||
* You can remove the defined() clause from the #if statement below. This exists because
|
||||
* LV_USE_TEMPL is not in lv_conf.h or lv_conf_templ.h by default.
|
||||
* LV_USE_TEMPL is not in lv_conf.h or lv_conf_template.h by default.
|
||||
*/
|
||||
|
||||
/*********************
|
||||
|
||||
@@ -1250,8 +1250,22 @@ static void scrlbar_refresh(lv_obj_t * page)
|
||||
(scrl_w + bg_left + bg_right - obj_w),
|
||||
obj_h - sb_width - sb_bottom);
|
||||
|
||||
if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO ||
|
||||
ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.hor_draw = 1;
|
||||
if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO) ext->scrlbar.hor_draw = 1;
|
||||
else if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) {
|
||||
lv_indev_t * indev = lv_indev_get_next(NULL);
|
||||
while(indev) {
|
||||
if(indev->driver.type == LV_INDEV_TYPE_POINTER && (indev->proc.types.pointer.drag_dir & LV_DRAG_DIR_HOR)) {
|
||||
lv_obj_t * drag_obj = indev->proc.types.pointer.act_obj;
|
||||
while(drag_obj && drag_obj->drag_parent) drag_obj = lv_obj_get_parent(drag_obj);
|
||||
|
||||
if(drag_obj && drag_obj == scrl) {
|
||||
ext->scrlbar.hor_draw = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
indev = lv_indev_get_next(indev);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*Full sized vertical scroll bar*/
|
||||
@@ -1275,8 +1289,22 @@ static void scrlbar_refresh(lv_obj_t * page)
|
||||
(obj_h - size_tmp - 2 * sb_ver_pad)) /
|
||||
(scrl_h + bg_top + bg_bottom - obj_h));
|
||||
|
||||
if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO ||
|
||||
ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.ver_draw = 1;
|
||||
if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO) ext->scrlbar.ver_draw = 1;
|
||||
else if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) {
|
||||
lv_indev_t * indev = lv_indev_get_next(NULL);
|
||||
while(indev) {
|
||||
if(indev->driver.type == LV_INDEV_TYPE_POINTER && (indev->proc.types.pointer.drag_dir & LV_DRAG_DIR_VER)) {
|
||||
lv_obj_t * drag_obj = indev->proc.types.pointer.act_obj;
|
||||
while(drag_obj && drag_obj->drag_parent) drag_obj = lv_obj_get_parent(drag_obj);
|
||||
|
||||
if(drag_obj && drag_obj == scrl) {
|
||||
ext->scrlbar.ver_draw = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
indev = lv_indev_get_next(indev);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*Invalidate the new scrollbar areas*/
|
||||
|
||||
@@ -177,7 +177,7 @@ void lv_roller_set_options(lv_obj_t * roller, const char * options, lv_roller_mo
|
||||
lv_label_set_text(label, options);
|
||||
}
|
||||
else {
|
||||
ext->mode = LV_ROLLER_MODE_INIFINITE;
|
||||
ext->mode = LV_ROLLER_MODE_INFINITE;
|
||||
|
||||
size_t opt_len = strlen(options) + 1; /*+1 to add '\n' after option lists*/
|
||||
char * opt_extra = _lv_mem_buf_get(opt_len * LV_ROLLER_INF_PAGES);
|
||||
@@ -238,7 +238,7 @@ void lv_roller_set_selected(lv_obj_t * roller, uint16_t sel_opt, lv_anim_enable_
|
||||
lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);
|
||||
|
||||
/*In infinite mode interpret the new ID relative to the currently visible "page"*/
|
||||
if(ext->mode == LV_ROLLER_MODE_INIFINITE) {
|
||||
if(ext->mode == LV_ROLLER_MODE_INFINITE) {
|
||||
int32_t sel_opt_signed = sel_opt;
|
||||
uint16_t page = ext->sel_opt_id / LV_ROLLER_INF_PAGES;
|
||||
|
||||
@@ -302,7 +302,7 @@ uint16_t lv_roller_get_selected(const lv_obj_t * roller)
|
||||
LV_ASSERT_OBJ(roller, LV_OBJX_NAME);
|
||||
|
||||
lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);
|
||||
if(ext->mode == LV_ROLLER_MODE_INIFINITE) {
|
||||
if(ext->mode == LV_ROLLER_MODE_INFINITE) {
|
||||
uint16_t real_id_cnt = ext->option_cnt / LV_ROLLER_INF_PAGES;
|
||||
return ext->sel_opt_id % real_id_cnt;
|
||||
}
|
||||
@@ -355,7 +355,7 @@ uint16_t lv_roller_get_option_cnt(const lv_obj_t * roller)
|
||||
LV_ASSERT_OBJ(roller, LV_OBJX_NAME);
|
||||
|
||||
lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);
|
||||
if(ext->mode == LV_ROLLER_MODE_INIFINITE) {
|
||||
if(ext->mode == LV_ROLLER_MODE_INFINITE) {
|
||||
return ext->option_cnt / LV_ROLLER_INF_PAGES;
|
||||
}
|
||||
else {
|
||||
@@ -1005,7 +1005,7 @@ static void inf_normalize(void * scrl)
|
||||
lv_obj_t * roller = lv_obj_get_parent(roller_scrl);
|
||||
lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);
|
||||
|
||||
if(ext->mode == LV_ROLLER_MODE_INIFINITE) {
|
||||
if(ext->mode == LV_ROLLER_MODE_INFINITE) {
|
||||
uint16_t real_id_cnt = ext->option_cnt / LV_ROLLER_INF_PAGES;
|
||||
ext->sel_opt_id = ext->sel_opt_id % real_id_cnt;
|
||||
ext->sel_opt_id += (LV_ROLLER_INF_PAGES / 2) * real_id_cnt; /*Select the middle page*/
|
||||
|
||||
@@ -37,7 +37,7 @@ extern "C" {
|
||||
/** Roller mode. */
|
||||
enum {
|
||||
LV_ROLLER_MODE_NORMAL, /**< Normal mode (roller ends at the end of the options). */
|
||||
LV_ROLLER_MODE_INIFINITE, /**< Infinite mode (roller can be scrolled forever). */
|
||||
LV_ROLLER_MODE_INFINITE, /**< Infinite mode (roller can be scrolled forever). */
|
||||
};
|
||||
|
||||
typedef uint8_t lv_roller_mode_t;
|
||||
@@ -99,7 +99,7 @@ void lv_roller_set_align(lv_obj_t * roller, lv_label_align_t align);
|
||||
* Set the selected option
|
||||
* @param roller pointer to a roller object
|
||||
* @param sel_opt id of the selected option (0 ... number of option - 1);
|
||||
* @param anim LV_ANOM_ON: set with animation; LV_ANIM_OFF set immediately
|
||||
* @param anim LV_ANIM_ON: set with animation; LV_ANIM_OFF set immediately
|
||||
*/
|
||||
void lv_roller_set_selected(lv_obj_t * roller, uint16_t sel_opt, lv_anim_enable_t anim);
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ lv_obj_t * lv_slider_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
/*Initialize the allocated 'ext' */
|
||||
ext->value_to_set = NULL;
|
||||
ext->dragging = 0;
|
||||
ext->left_knob_focus = 0;
|
||||
lv_style_list_init(&ext->style_knob);
|
||||
|
||||
/*The signal and design functions are not copied so set them here*/
|
||||
@@ -327,6 +328,8 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par
|
||||
}
|
||||
}
|
||||
else if(sign == LV_SIGNAL_PRESSING && ext->value_to_set != NULL) {
|
||||
if(lv_indev_get_type(param) != LV_INDEV_TYPE_POINTER) return res;
|
||||
|
||||
lv_indev_get_point(param, &p);
|
||||
lv_bidi_dir_t base_dir = lv_obj_get_base_dir(slider);
|
||||
|
||||
@@ -390,11 +393,25 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par
|
||||
bool editing = lv_group_get_editing(g);
|
||||
lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act());
|
||||
if(indev_type == LV_INDEV_TYPE_ENCODER) {
|
||||
if(editing) lv_group_set_editing(g, false);
|
||||
if(editing) {
|
||||
if(lv_slider_get_type(slider) == LV_SLIDER_TYPE_RANGE) {
|
||||
if(ext->left_knob_focus == 0) ext->left_knob_focus = 1;
|
||||
else {
|
||||
ext->left_knob_focus = 0;
|
||||
lv_group_set_editing(g, false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
lv_group_set_editing(g, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
else if(sign == LV_SIGNAL_FOCUS) {
|
||||
ext->left_knob_focus = 0;
|
||||
}
|
||||
else if(sign == LV_SIGNAL_COORD_CHG) {
|
||||
/* The knob size depends on slider size.
|
||||
* During the drawing method the ext. size is used by the knob so refresh the ext. size.*/
|
||||
@@ -425,12 +442,16 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par
|
||||
char c = *((char *)param);
|
||||
|
||||
if(c == LV_KEY_RIGHT || c == LV_KEY_UP) {
|
||||
lv_slider_set_value(slider, lv_slider_get_value(slider) + 1, LV_ANIM_ON);
|
||||
if(!ext->left_knob_focus) lv_slider_set_value(slider, lv_slider_get_value(slider) + 1, LV_ANIM_ON);
|
||||
else lv_slider_set_left_value(slider, lv_slider_get_left_value(slider) + 1, LV_ANIM_ON);
|
||||
|
||||
res = lv_event_send(slider, LV_EVENT_VALUE_CHANGED, NULL);
|
||||
if(res != LV_RES_OK) return res;
|
||||
}
|
||||
else if(c == LV_KEY_LEFT || c == LV_KEY_DOWN) {
|
||||
lv_slider_set_value(slider, lv_slider_get_value(slider) - 1, LV_ANIM_ON);
|
||||
if(!ext->left_knob_focus) lv_slider_set_value(slider, lv_slider_get_value(slider) - 1, LV_ANIM_ON);
|
||||
else lv_slider_set_left_value(slider, lv_slider_get_left_value(slider) - 1, LV_ANIM_ON);
|
||||
|
||||
res = lv_event_send(slider, LV_EVENT_VALUE_CHANGED, NULL);
|
||||
if(res != LV_RES_OK) return res;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ typedef struct {
|
||||
lv_area_t right_knob_area;
|
||||
int16_t * value_to_set; /* Which bar value to set */
|
||||
uint8_t dragging : 1; /*1: the slider is being dragged*/
|
||||
uint8_t left_knob_focus : 1; /*1: with encoder now the right knob can be adjusted*/
|
||||
} lv_slider_ext_t;
|
||||
|
||||
/** Built-in styles of slider*/
|
||||
|
||||
@@ -198,6 +198,8 @@ void lv_spinbox_set_step(lv_obj_t * spinbox, uint32_t step)
|
||||
if(ext == NULL) return;
|
||||
|
||||
ext->step = step;
|
||||
|
||||
lv_spinbox_updatevalue(spinbox);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
static lv_res_t lv_switch_signal(lv_obj_t * sw, lv_signal_t sign, void * param);
|
||||
static lv_design_res_t lv_switch_design(lv_obj_t * sw, const lv_area_t * clip_area, lv_design_mode_t mode);
|
||||
static lv_style_list_t * lv_switch_get_style(lv_obj_t * sw, uint8_t part);
|
||||
static lv_style_list_t * lv_switch_get_style(lv_obj_t * sw, uint8_t part);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@@ -117,7 +116,7 @@ lv_obj_t * lv_switch_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
/**
|
||||
* Turn ON the switch
|
||||
* @param sw pointer to a switch object
|
||||
* @param anim LV_ANOM_ON: set the value with an animation; LV_ANIM_OFF: change the value immediately
|
||||
* @param anim LV_ANIM_ON: set the value with an animation; LV_ANIM_OFF: change the value immediately
|
||||
*/
|
||||
void lv_switch_on(lv_obj_t * sw, lv_anim_enable_t anim)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user