LVGL 9 as submodule (#52)

This commit is contained in:
Ken Van Hoeylandt 2024-02-28 17:59:30 +11:00 committed by GitHub
parent a2e2c0ad67
commit c3d2083399
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
673 changed files with 4 additions and 356165 deletions

3
.gitmodules vendored
View File

@ -13,3 +13,6 @@
[submodule "libs/mbedtls"]
path = libs/mbedtls
url = https://github.com/Mbed-TLS/mbedtls.git
[submodule "libs/lvgl"]
path = libs/lvgl
url = https://github.com/lvgl/lvgl.git

1
libs/lvgl Submodule

@ -0,0 +1 @@
Subproject commit 09cb87cdc6a0168a98bc0a3182a8439b13249ead

View File

@ -1,8 +0,0 @@
codecov:
notify:
require_ci_to_pass: true
comment: off
coverage:
status:
patch: off
project: off

View File

@ -1,6 +0,0 @@
[*.{c,h,ino}]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

View File

@ -1 +0,0 @@
open_collective: lvgl

View File

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

View File

@ -1,14 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Documentation
url: https://docs.lvgl.io
about: Be sure to read to documentation first
- name: Forum
url: https://forum.lvgl.io
about: For topics like How-to, Getting started, Feature request
- name: CONTIBUTING.md
url: https://github.com/lvgl/lvgl/blob/master/docs/CONTRIBUTING.md#faq-about-contributing
about: The basic rules of contributing
- name: CODING_STYLE.md
url: https://github.com/lvgl/lvgl/blob/master/docs/CODING_STYLE.md
about: Quick summary of LVGL's code style

View File

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

View File

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

View File

@ -1,8 +0,0 @@
### 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)
- [ ] Run `code-format.py` from the `scripts` folder. [astyle](http://astyle.sourceforge.net/install.html) needs to be installed.
- [ ] Update the documentation

View File

@ -1,15 +0,0 @@
name: Arduino Lint
on:
push:
branches: [ master, release/v8.* ]
pull_request:
branches: [ master, release/v8.* ]
jobs:
lint:
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: arduino/arduino-lint-action@v1
with:
library-manager: update

View File

@ -1,74 +0,0 @@
name: Micropython CI
on:
push:
pull_request:
jobs:
build:
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
name: Build ${{ matrix.port }} port
runs-on: ubuntu-20.04
continue-on-error: true
strategy:
matrix:
port: ['unix', 'esp32', 'stm32', 'rp2']
steps:
- uses: ammaraskar/gcc-problem-matcher@master
- name: Install Dependencies
run: |
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
sudo apt-get update -y -qq
sudo apt-get install libsdl2-dev parallel libfreetype-dev librlottie-dev
- name: Clone lv_micropython
run: |
git clone https://github.com/lvgl/lv_micropython.git .
git checkout release/v8
- name: Initialize lv_bindings submodule
run: git submodule update --init --recursive lib/lv_bindings
- name: Update ${{ matrix.port }} port submodules
if: matrix.port != 'esp32'
# VARIANT needed for unix
run: make -C ports/${{ matrix.port }} VARIANT=dev DEBUG=1 USER_C_MODULES=../../lib/lv_bindings/bindings.cmake submodules
- name: Checkout LVGL submodule
working-directory: ./lib/lv_bindings/lvgl
run: |
git fetch --force ${{ github.event.repository.html_url }} "+refs/heads/*:refs/remotes/origin/*"
git fetch --force ${{ github.event.repository.html_url }} "+refs/pull/*:refs/remotes/origin/pr/*"
git checkout ${{ github.sha }} || git checkout ${{ github.event.pull_request.head.sha }}
git submodule update --init --recursive
- name: Build mpy-cross
run: make -j $(nproc) -C mpy-cross
# ESP32 port
- name: Setup ESP-IDF
if: matrix.port == 'esp32'
run: |
source tools/ci.sh && ci_esp32_idf44_setup
- name: Build ESP32 port
if: matrix.port == 'esp32'
run: |
source tools/ci.sh && ci_esp32_build
# STM32 & RPi Pico port
- name: arm-none-eabi-gcc
if: matrix.port == 'stm32' || matrix.port == 'rp2'
uses: carlosperate/arm-none-eabi-gcc-action@v1.3.0
with:
release: '9-2019-q4' # The arm-none-eabi-gcc release to use.
- name: Build STM32 port
if: matrix.port == 'stm32'
run: make -j $(nproc) -C ports/stm32 BOARD=STM32F7DISC
- name: Build Raspberry Pi PICO port
if: matrix.port == 'rp2'
run: make -j $(nproc) -C ports/rp2 BOARD=PICO USER_C_MODULES=../../lib/lv_bindings/bindings.cmake
# Unix port
- name: Build Unix port
if: matrix.port == 'unix'
run: make -j $(nproc) -C ports/unix VARIANT=dev DEBUG=1
- name: Run tests
if: success() && matrix.port == 'unix'
run: |
export XDG_RUNTIME_DIR=/tmp
lib/lv_bindings/tests/run.sh

View File

@ -1,96 +0,0 @@
name: C/C++ CI
on:
push:
branches: [ master, release/v8.* ]
pull_request:
branches: [ master, release/v8.* ]
jobs:
build:
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
runs-on: ubuntu-latest
strategy:
matrix:
# A valid option parameter to the cmake file.
# See BUILD_OPTIONS in tests/CMakeLists.txt.
build_option: ['OPTIONS_MINIMAL_MONOCHROME',
'OPTIONS_NORMAL_8BIT',
'OPTIONS_16BIT',
'OPTIONS_16BIT_SWAP',
'OPTIONS_FULL_32BIT']
name: Build ${{ matrix.build_option }}
steps:
- uses: actions/checkout@v2
- uses: ammaraskar/gcc-problem-matcher@master
- name: Install prerequisites
run: scripts/install-prerequisites.sh
- name: Building ${{ matrix.build_option }}
run: python tests/main.py --build-option=${{ matrix.build_option }} build
test-native:
runs-on: ubuntu-latest
name: amd64 Executable Tests
steps:
- uses: actions/checkout@v2
- uses: ammaraskar/gcc-problem-matcher@master
- name: Install prerequisites
run: scripts/install-prerequisites.sh
- name: Run tests
run: python tests/main.py --report test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
if: github.event_name == 'push'
with:
fail_ci_if_error: true
verbose: true
test-cross:
# The host should always be linux
runs-on: ubuntu-latest
name: ${{ matrix.arch }} Executable Tests
# Run steps on a matrix of 3 arch/distro combinations
strategy:
matrix:
arch: [ 'aarch64', 'armv6', 'armv7' ]
steps:
- uses: actions/checkout@v2.1.0
- uses: ammaraskar/gcc-problem-matcher@master
- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.ccache
key: lvgl_ci_cross_test_ccache_${{ matrix.arch }}_${{ github.sha }}
restore-keys: |
lvgl_ci_cross_test_ccache_${{ matrix.arch }}
- uses: uraimo/run-on-arch-action@v2.1.1
name: Run tests
id: build
with:
arch: ${{ matrix.arch }}
distro: bullseye
# Not required, but speeds up builds
githubToken: ${{ github.token }}
# The shell to run commands with in the container
shell: /bin/bash
# Create cached/volume directories on host
setup: |
mkdir -p ~/.ccache
# Mount cached directories in the container for faster builds
dockerRunArgs: |
--volume "${HOME}/.ccache:/root/.ccache"
install: |
apt-get update -y
apt-get install build-essential ccache python3 libpng-dev ruby-full gcovr cmake -q -y
/usr/sbin/update-ccache-symlinks
echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc
run: |
env PATH="/usr/lib/ccache:$PATH" ASAN_OPTIONS=detect_leaks=0 python3 tests/main.py test

View File

@ -1,24 +0,0 @@
name: Verify that lv_conf_internal.h matches repository state
on:
push:
pull_request:
jobs:
verify-conf-internal:
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Generate lv_conf_internal.h
run: python lv_conf_internal_gen.py
working-directory: scripts
- name: Check that repository is clean
run: git diff --exit-code >/dev/null 2>&1 || (echo "Please regenerate lv_conf_internal.h using scripts/lv_conf_internal_gen.py"; false)

View File

@ -1,31 +0,0 @@
name: Verify code formatting
on:
push:
pull_request:
jobs:
verify-formatting:
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Install astyle
run: |
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
sudo apt-get update -y -qq
sudo apt-get install astyle
- name: Format code
run: python code-format.py
working-directory: scripts
- name: Check that repository is clean
shell: bash
run: |
set -o pipefail
if ! (git diff --exit-code --color=always | tee /tmp/lvgl_diff.patch); then
echo "Please apply the preceding diff to your code or run scripts/code-format.py"
exit 1
fi

View File

@ -1,29 +0,0 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'
workflow_dispatch:
jobs:
stale:
if: github.repository == 'lvgl/lvgl'
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.LVGL_BOT_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
stale-pr-message: |
We need some feedback on this issue.
Now we mark this as "stale" because there was no activity here for 14 days.
Remove the "stale" label or comment else this will be closed in 7 days.
close-issue-message: |
As there was no activity here for a while we close this issue. But don't worry, the conversation is still here and you can get back to it at any time.
So feel free to comment if you have remarks or ideas on this topic.
days-before-stale: 14
days-before-close: 7
exempt-issue-labels: 'pinned'
exempt-pr-labels: 'pinned'

View File

@ -1,93 +0,0 @@
name: Build docs
on:
push:
branches:
- master
- 'release/*'
env:
EM_VERSION: 2.0.4
EM_CACHE_FOLDER: 'emsdk-cache'
jobs:
build-and-deploy:
if: github.repository == 'lvgl/lvgl'
runs-on: ubuntu-latest
concurrency: docs-build-and-deploy
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Cache Python packages
uses: actions/cache@v2
with:
# Cache the Python package environment, excluding pip and setuptools installed by setup-python
path: |
~/.cache/pip
${{ env.pythonLocation }}/bin/*
${{ env.pythonLocation }}/include
${{ env.pythonLocation }}/lib/python*/site-packages/*
!${{ env.pythonLocation }}/bin/pip*
!${{ env.pythonLocation }}/lib/python*/site-packages/pip*
!${{ env.pythonLocation }}/lib/python*/site-packages/setuptools*
key: ${{ env.pythonLocation }}-${{ hashFiles('docs/requirements.txt') }}
- name: Install Doxygen and Latex dependencies
run: |
sudo apt-get update
sudo apt-get install doxygen texlive-xetex texlive-binaries texlive-lang-english latexmk fonts-freefont-otf
- name: Install requirements
run: |
pip install -r docs/requirements.txt
- name: Setup Emscripten cache
id: cache-system-libraries
uses: actions/cache@v2
with:
path: ${{env.EM_CACHE_FOLDER}}
key: ${{env.EM_VERSION}}-${{ runner.os }}
- uses: mymindstorm/setup-emsdk@v9
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
- name: ccache
uses: hendrikmuhs/ccache-action@v1
- name: Build examples (with cache)
run: scripts/build_html_examples.sh
- name: Build docs
run: docs/build.py
- name: Remove .doctrees
run: rm -rf out_html/.doctrees
- name: Retrieve version
run: |
echo "::set-output name=VERSION_NAME::$(scripts/find_version.sh)"
id: version
- name: Deploy to subfolder
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACCESS_TOKEN: ${{ secrets.LVGL_BOT_TOKEN }}
REPOSITORY_NAME: lvgl/docs
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: out_html # The folder the action should deploy.
TARGET_FOLDER: ${{ steps.version.outputs.VERSION_NAME }}
GIT_CONFIG_NAME: lvgl-bot
GIT_CONFIG_EMAIL: lvgl-bot@users.noreply.github.com
PRESERVE: true
SINGLE_COMMIT: true
- name: Deploy to master
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACCESS_TOKEN: ${{ secrets.LVGL_BOT_TOKEN }}
REPOSITORY_NAME: lvgl/docs
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: out_html # The folder the action should deploy.
TARGET_FOLDER: master
GIT_CONFIG_NAME: lvgl-bot
GIT_CONFIG_EMAIL: lvgl-bot@users.noreply.github.com
PRESERVE: true
SINGLE_COMMIT: true

View File

@ -1,23 +0,0 @@
name: Push LVGL release to Espressif Component Service
# If the commit is tagged, it will be uploaded. Other scenario silently fail.
on:
push:
tags:
- v*
jobs:
upload_components:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Upload component to component registry
uses: espressif/upload-components-ci-action@v1
with:
name: "lvgl"
version: ${{ github.ref_name }}
namespace: "lvgl"
api_token: ${{ secrets.ESP_IDF_COMPONENT_API_TOKEN }}

View File

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

View File

@ -1,21 +0,0 @@
name: Check Makefile
on:
push:
branches: [ master, release/v8.* ]
pull_request:
branches: [ master, release/v8.* ]
jobs:
build:
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
runs-on: ubuntu-latest
name: Build using Makefile
steps:
- uses: actions/checkout@v2
- uses: ammaraskar/gcc-problem-matcher@master
- name: Install prerequisites
run: scripts/install-prerequisites.sh
- name: Build
working-directory: tests/makefile
run: make test_file

View File

@ -1,27 +0,0 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # 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/docs/CHANGELOG.md)
draft: false
prerelease: false

27
libs/lvgl/.gitignore vendored
View File

@ -1,27 +0,0 @@
**/*.o
**/*bin
**/*.swp
**/*.swo
**/*.gcda
**/*.gcno
tags
docs/api_doc
scripts/cppcheck_res.txt
scripts/built_in_font/lv_font_*
docs/doxygen_html
docs/xml
docs/examples.md
docs/out_latex
docs/_static/built_lv_examples
docs/LVGL.pdf
docs/env
out_html
__pycache__
/emscripten_builder
test_screenshot_error.h
build/
tests/build_*/
tests/report/
.DS_Store
.vscode
*.bak

View File

@ -1,30 +0,0 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- repo: local
hooks:
# Run astyle over the staged files with c and h extension found in the directories
# listed in the files regex pattern. Ignoring the files in the exclude pattern.
- id: format-source
name: Formatting source files
entry: astyle --options=scripts/code-format.cfg --ignore-exclude-errors
stages: [ commit ]
language: system
pass_filenames: true
verbose: true
files: |
(?x)^(
src/ |
tests/src/test_cases/
)
exclude: |
(?x)^(
src/extra/libs/ |
src/lv_conf_internal.h
)
types_or: ["c", "header"]

View File

@ -1,36 +0,0 @@
cmake_minimum_required(VERSION 3.12.4)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
if(NOT ESP_PLATFORM)
project(lvgl LANGUAGES C CXX ASM HOMEPAGE_URL https://github.com/lvgl/lvgl)
endif()
set(LVGL_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR})
if(ESP_PLATFORM)
include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/esp.cmake)
elseif(ZEPHYR_BASE)
include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/zephyr.cmake)
elseif(MICROPY_DIR)
include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/micropython.cmake)
else()
include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/custom.cmake)
endif()
#[[
unfortunately CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS does not work for global data.
for global data we still need decl specs.
Check out the docs to learn more about the limitations of CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
https://cmake.org/cmake/help/latest/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html#prop_tgt:WINDOWS_EXPORT_ALL_SYMBOLS
For all compiled sources within the library (i.e. basically all lvgl files) we need to use dllexport.
For all compiled sources from outside the library (i.e. files which include lvgl headers) we need to use dllimport.
We can do this by using CMakes INTERFACE and PRIVATE keyword.
]]
if (MSVC)
target_compile_definitions(lvgl
INTERFACE LV_ATTRIBUTE_EXTERN_DATA=__declspec\(dllimport\)
PRIVATE LV_ATTRIBUTE_EXTERN_DATA=__declspec\(dllexport\)
)
endif()

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
MIT licence
Copyright (c) 2021 LVGL Kft
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,478 +0,0 @@
<a href="https://github.com/sponsors/lvgl" target="_blank"><img align="left" src="https://lvgl.io/assets/images/sponsor.png" height="32px"></a>
<p align="right">
<b>English</b> | <a href="./docs/README_zh.rst">中文</a> | <a href="./docs/README_pt_BR.md">Português do Brasil</a> | <a href="./docs/README_jp.md">日本語</a>
</p>
<br>
<p align="center">
  <img src="https://lvgl.io/assets/images/logo_lvgl.png">
</p>
  <h1 align="center">Light and Versatile Graphics Library</h1>
  <br>
<div align="center">
<img src="https://github.com/kisvegabor/test/raw/master/smartwatch_demo.gif">
&nbsp;
  <img border="1px" src="https://lvgl.io/assets/images/lvgl_widgets_demo.gif">
</div>
<br>
<p align="center">
<a href="https://lvgl.io" title="Homepage of LVGL">Website </a> |
<a href="https://docs.lvgl.io/" title="Detailed documentation with 100+ examples">Docs</a> |
<a href="https://forum.lvgl.io" title="Get help and help others">Forum</a> |
<a href="https://lvgl.io/demos" title="Demos running in your browser">Demos</a> |
<a href="https://lvgl.io/services" title="Graphics design, UI implementation and consulting">Services</a> |
<a href="https://squareline.io/" title="UI Editor for LVGL">SquareLine Studio</a>
</p>
<br>
## :ledger: Overview
**Mature and Well-known**<br>
LVGL is the most popular free and open source embedded graphics library to create beautiful UIs for any MCU, MPU and display type. It's supported by industry leading vendors and projects like  Arm, STM32, NXP, Espressif, Nuvoton, Arduino, RT-Thread, Zephyr, NuttX, Adafruit and many more.
**Feature Rich**<br>
It has all the features to create modern and beautiful GUIs: 30+ built-in widgets, a powerful style system, web inspired layout managers, and a typography system supporting many languages. To integrate LVGL into your platform, all you need is at least 32kB RAM and 128 kB Flash, a C compiler, a frame buffer, and at least an 1/10 screen sized buffer for rendering.
**UI Editor**<br>
SquareLine Studio is a professional yet affordable drag and drop UI editor for LVGL. It runs on Windows, Linux and MacOS too and you can try it out even without registering to the website.
**Services**<br>
Our team is ready to help you with graphics design, UI implementation and consulting services. Contact us if you need some support during the development of your next GUI project.
## :rocket: Features
**Free and Portable**
- A fully portable C (C++ compatible) library with no external dependencies.
- Can be compiled to any MCU or MPU, with any (RT)OS.
- Supports monochrome, ePaper, OLED or TFT displays, or even monitors. [Porting Guide](https://docs.lvgl.io/master/porting/project.html)
- Distributed under the MIT license, so you can easily use it in commercial projects too.
- Needs only 32kB RAM and 128 kB Flash, a frame buffer, and at least an 1/10 screen sized buffer for rendering.
- OS, External memory and GPU are supported but not required.
**Widgets, Styles, Layouts and more**
- 30+ built-in [Widgets](https://docs.lvgl.io/master/widgets/index.html):  Button, Label, Slider, Chart, Keyboard, Meter, Arc, Table and many more.
- Flexible [Style system](https://docs.lvgl.io/master/overview/style.html) with  ~100 style properties to customize any part of the widgets in any state.
- [Flexbox](https://docs.lvgl.io/master/layouts/flex.html) and [Grid](https://docs.lvgl.io/master/layouts/grid.html)-like layouts engines to automatically size and position the widgets in a responsive way.
- Texts are rendered with UTF-8 encoding supporting CJK, Thai, Hindi, Arabic, Persian writing systems.
- Word wrapping, kerning, text scrolling, sub-pixel rendering, Pinyin-IME Chinese input, Emojis in texts.
- Rendering engine supporting animations, anti-aliasing, opacity, smooth scrolling, shadows, image transformation, etc  
- Supports Mouse, Touchpad, Keypad, Keyboard, External buttons, Encoder [Input devices](https://docs.lvgl.io/master/porting/indev.html).
- [Multiple display](https://docs.lvgl.io/master/overview/disp.html#multiple-display-support) support.
**Binding and Build Support**
- [Micropython Binding](https://blog.lvgl.io/2019-02-20/micropython-bindings) exposes LVGL API
- [PikaScript Binding](https://blog.lvgl.io/2022-08-24/pikascript-and-lvgl) python on MCU lighter and easier.
- No custom build system is used. You can build LVGL as you build the other files of your project.
- Support for Make and [CMake](https://docs.lvgl.io/master/get-started/platforms/cmake.html) is included out of the box.
- [Develop on PC](https://docs.lvgl.io/master/get-started/platforms/pc-simulator.html) and use the same UI code on embedded hardware.
- Convert the C UI code to HTML file with our [Emscripten port](https://github.com/lvgl/lv_web_emscripten).
**Docs, Tools, and Services**
- Detailed [Documentation](https://docs.lvgl.io/) with [100+ simple examples](https://docs.lvgl.io/master/index.html)
- [SquareLine Studio](https://squareline.io/) - A professional and easy-to-use UI editor software to speed up and simplify the UI development.
- [Services](https://lvgl.io/services) such as User interface design, Implementation and Consulting to make UI development simpler and faster.
## :heart: Sponsor
If LVGL saved you a lot of time and money or you just had fun using it, consider [Supporting its Development](https://github.com/sponsors/lvgl).
**How do we spend the donations?**<br>
Our goal is to provide financial compensation for people who do the most for LVGL. It means not only the maintainers but anyone who implements a great feature should get a payment from the accumulated money. We use the donations to cover our operational costs like servers and related services.
**How to donate?**<br>
We use [GitHub Sponsors](https://github.com/sponsors/lvgl) where you can easily send one time or recurring donations. You can also see all of our expenses in a transparent way.
**How to get paid for your contribution?**<br>
If someone implements or fixes an issue labeled as [Sponsored](https://github.com/lvgl/lvgl/labels/Sponsored) he or she will get a payment for that work. We estimate the required time, complexity and importance of the issue and set a price accordingly. To jump in just comment on a [Sponsored](https://github.com/lvgl/lvgl/labels/Sponsored) issue saying "Hi, I'd like to deal with it. This is how I'm planning to fix/implement it...". A work is considered ready when it's approved and merged by a maintainer. After that you can submit and expense at [opencollective.com](https://opencollective.com/lvgl) and you will receive the payment in a few days.
**Organizations supporting LVGL**<br>
[![Sponsors of LVGL](https://opencollective.com/lvgl/organizations.svg?width=600)](https://opencollective.com/lvgl)
**Individuals supporting LVGL**<br>
[![Backers of LVGL](https://opencollective.com/lvgl/individuals.svg?width=600)](https://opencollective.com/lvgl)
## :package: Packages
LVGL is available as:
- [Arduino library](https://docs.lvgl.io/master/integration/framework/arduino.html)
- [PlatformIO package](https://registry.platformio.org/libraries/lvgl/lvgl)
- [Zephyr library](https://docs.lvgl.io/master/integration/os/zephyr.html)
- [ESP-IDF(ESP32) component](https://components.espressif.com/components/lvgl/lvgl)
- [NXP MCUXpresso component](https://www.nxp.com/design/software/embedded-software/lvgl-open-source-graphics-library:LITTLEVGL-OPEN-SOURCE-GRAPHICS-LIBRARY)
- [NuttX library](https://docs.lvgl.io/master/integration/os/nuttx.html)
- [RT-Thread RTOS](https://docs.lvgl.io/master/integration/os/rt-thread.html)
- CMSIS-Pack
- [RIOT OS package](https://doc.riot-os.org/group__pkg__lvgl.html#details)
## :robot: Examples
See some examples of creating widgets, using layouts and applying styles. You will find C and MicroPython code, and links to try out or edit the examples in an online MicroPython editor.
For more examples check out the [Examples](https://github.com/lvgl/lvgl/tree/master/examples) folder.
### Hello world label
![Simple Hello world label example in LVGL](https://github.com/kisvegabor/test/raw/master/readme_example_1.png)
<details>
<summary>C code</summary>
```c
/*Change the active screen's background color*/
lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0x003a57), LV_PART_MAIN);
/*Create a white label, set its text and align it to the center*/
lv_obj_t * label = lv_label_create(lv_screen_active());
lv_label_set_text(label, "Hello world");
lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0xffffff), LV_PART_MAIN);
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
```
</details>
<details>
<summary>MicroPython code | <a href="https://sim.lvgl.io/v8.3/micropython/ports/javascript/index.html?script_direct=4ab7c40c35b0dc349aa2f0c3b00938d7d8e8ac9f" target="_blank">Online Simulator</a></summary>
```python
# Change the active screen's background color
scr = lv.screen_active()
scr.set_style_bg_color(lv.color_hex(0x003a57), lv.PART.MAIN)
# Create a white label, set its text and align it to the center
label = lv.label(lv.screen_active())
label.set_text("Hello world")
label.set_style_text_color(lv.color_hex(0xffffff), lv.PART.MAIN)
label.align(lv.ALIGN.CENTER, 0, 0)
```
</details>
<br>
### Button with Click Event
![LVGL button with label example](https://github.com/kisvegabor/test/raw/master/readme_example_2.gif)
<details>
<summary>C code</summary>
```c
lv_obj_t * button = lv_button_create(lv_screen_active());                   /*Add a button to the current screen*/
lv_obj_center(button);                                     /*Set its position*/
lv_obj_set_size(button, 100, 50);                                  /*Set its size*/
lv_obj_add_event_cb(button, button_event_cb, LV_EVENT_CLICKED, NULL); /*Assign a callback to the button*/
lv_obj_t * label = lv_label_create(button);                        /*Add a label to the button*/
lv_label_set_text(label, "Button");                             /*Set the labels text*/
lv_obj_center(label);                                           /*Align the label to the center*/
...
void button_event_cb(lv_event_t * e)
{
  printf("Clicked\n");
}
```
</details>
<details>
<summary>MicroPython code | <a href="https://sim.lvgl.io/v8.3/micropython/ports/javascript/index.html?script_startup=https://raw.githubusercontent.com/lvgl/lvgl/0d9ab4ee0e591aad1970e3c9164fd7c544ecce70/examples/header.py&script=https://raw.githubusercontent.com/lvgl/lvgl/0d9ab4ee0e591aad1970e3c9164fd7c544ecce70/examples/widgets/slider/lv_example_slider_2.py&script_direct=926bde43ec7af0146c486de470c53f11f167491e" target="_blank">Online Simulator</a></summary>
```python
def button_event_cb(e):
  print("Clicked")
# Create a Button and a Label
button = lv.button(lv.screen_active())
button.center()
button.set_size(100, 50)
button.add_event_cb(button_event_cb, lv.EVENT.CLICKED, None)
label = lv.label(button)
label.set_text("Button")
label.center()
```
</details>
<br>
### Checkboxes with Layout
![Checkboxes with layout in LVGL](https://github.com/kisvegabor/test/raw/master/readme_example_3.gif)
<details>
<summary>C code</summary>
```c
lv_obj_set_flex_flow(lv_screen_active(), LV_FLEX_FLOW_COLUMN);
lv_obj_set_flex_align(lv_screen_active(), LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER);
lv_obj_t * cb;
cb = lv_checkbox_create(lv_screen_active());
lv_checkbox_set_text(cb, "Apple");
lv_obj_add_event_cb(cb, event_handler, LV_EVENT_ALL, NULL);
cb = lv_checkbox_create(lv_screen_active());
lv_checkbox_set_text(cb, "Banana");
lv_obj_add_state(cb, LV_STATE_CHECKED);
lv_obj_add_event_cb(cb, event_handler, LV_EVENT_ALL, NULL);
cb = lv_checkbox_create(lv_screen_active());
lv_checkbox_set_text(cb, "Lemon");
lv_obj_add_state(cb, LV_STATE_DISABLED);
lv_obj_add_event_cb(cb, event_handler, LV_EVENT_ALL, NULL);
cb = lv_checkbox_create(lv_screen_active());
lv_obj_add_state(cb, LV_STATE_CHECKED | LV_STATE_DISABLED);
lv_checkbox_set_text(cb, "Melon\nand a new line");
lv_obj_add_event_cb(cb, event_handler, LV_EVENT_ALL, NULL);
```
</details>
<details>
<summary>MicroPython code | <a href="https://sim.lvgl.io/v8.3/micropython/ports/javascript/index.html?script_startup=https://raw.githubusercontent.com/lvgl/lvgl/0d9ab4ee0e591aad1970e3c9164fd7c544ecce70/examples/header.py&script=https://raw.githubusercontent.com/lvgl/lvgl/0d9ab4ee0e591aad1970e3c9164fd7c544ecce70/examples/widgets/slider/lv_example_slider_2.py&script_direct=311d37e5f70daf1cb0d2cad24c7f72751b5f1792" target="_blank">Online Simulator</a></summary>
```python
def event_handler(e):
code = e.get_code()
obj = e.get_target_obj()
if code == lv.EVENT.VALUE_CHANGED:
txt = obj.get_text()
if obj.get_state() & lv.STATE.CHECKED:
state = "Checked"
else:
state = "Unchecked"
print(txt + ":" + state)
lv.screen_active().set_flex_flow(lv.FLEX_FLOW.COLUMN)
lv.screen_active().set_flex_align(lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.START, lv.FLEX_ALIGN.CENTER)
cb = lv.checkbox(lv.screen_active())
cb.set_text("Apple")
cb.add_event_cb(event_handler, lv.EVENT.ALL, None)
cb = lv.checkbox(lv.screen_active())
cb.set_text("Banana")
cb.add_state(lv.STATE.CHECKED)
cb.add_event_cb(event_handler, lv.EVENT.ALL, None)
cb = lv.checkbox(lv.screen_active())
cb.set_text("Lemon")
cb.add_state(lv.STATE.DISABLED)
cb.add_event_cb(event_handler, lv.EVENT.ALL, None)
cb = lv.checkbox(lv.screen_active())
cb.add_state(lv.STATE.CHECKED | lv.STATE.DISABLED)
cb.set_text("Melon")
cb.add_event_cb(event_handler, lv.EVENT.ALL, None)
```
</details>
<br>
### Styling a Slider
![Styling a slider with LVGL](https://github.com/kisvegabor/test/raw/master/readme_example_4.gif)
<details>
<summary>C code</summary>
```c
lv_obj_t * slider = lv_slider_create(lv_screen_active());
lv_slider_set_value(slider, 70, LV_ANIM_OFF);
lv_obj_set_size(slider, 300, 20);
lv_obj_center(slider);
/*Add local styles to MAIN part (background rectangle)*/
lv_obj_set_style_bg_color(slider, lv_color_hex(0x0F1215), LV_PART_MAIN);
lv_obj_set_style_bg_opa(slider, 255, LV_PART_MAIN);
lv_obj_set_style_border_color(slider, lv_color_hex(0x333943), LV_PART_MAIN);
lv_obj_set_style_border_width(slider, 5, LV_PART_MAIN);
lv_obj_set_style_pad_all(slider, 5, LV_PART_MAIN);
/*Create a reusable style sheet for the INDICATOR part*/
static lv_style_t style_indicator;
lv_style_init(&style_indicator);
lv_style_set_bg_color(&style_indicator, lv_color_hex(0x37B9F5));
lv_style_set_bg_grad_color(&style_indicator, lv_color_hex(0x1464F0));
lv_style_set_bg_grad_dir(&style_indicator, LV_GRAD_DIR_HOR);
lv_style_set_shadow_color(&style_indicator, lv_color_hex(0x37B9F5));
lv_style_set_shadow_width(&style_indicator, 15);
lv_style_set_shadow_spread(&style_indicator, 5);
4
/*Add the style sheet to the slider's INDICATOR part*/
lv_obj_add_style(slider, &style_indicator, LV_PART_INDICATOR);
/*Add the same style to the KNOB part too and locally overwrite some properties*/
lv_obj_add_style(slider, &style_indicator, LV_PART_KNOB);
lv_obj_set_style_outline_color(slider, lv_color_hex(0x0096FF), LV_PART_KNOB);
lv_obj_set_style_outline_width(slider, 3, LV_PART_KNOB);
lv_obj_set_style_outline_pad(slider, -5, LV_PART_KNOB);
lv_obj_set_style_shadow_spread(slider, 2, LV_PART_KNOB);
```
</details>
<details>
<summary>MicroPython code |
<a href="https://sim.lvgl.io/v8.3/micropython/ports/javascript/index.html?script_startup=https://raw.githubusercontent.com/lvgl/lvgl/0d9ab4ee0e591aad1970e3c9164fd7c544ecce70/examples/header.py&script=https://raw.githubusercontent.com/lvgl/lvgl/0d9ab4ee0e591aad1970e3c9164fd7c544ecce70/examples/widgets/slider/lv_example_slider_2.py&script_direct=c431c7b4dfd2cc0dd9c392b74365d5af6ea986f0" target="_blank">Online Simulator</a>
</summary>
```python
# Create a slider and add the style
slider = lv.slider(lv.screen_active())
slider.set_value(70, lv.ANIM.OFF)
slider.set_size(300, 20)
slider.center()
# Add local styles to MAIN part (background rectangle)
slider.set_style_bg_color(lv.color_hex(0x0F1215), lv.PART.MAIN)
slider.set_style_bg_opa(255, lv.PART.MAIN)
slider.set_style_border_color(lv.color_hex(0x333943), lv.PART.MAIN)
slider.set_style_border_width(5, lv.PART.MAIN)
slider.set_style_pad_all(5, lv.PART.MAIN)
# Create a reusable style sheet for the INDICATOR part
style_indicator = lv.style_t()
style_indicator.init()
style_indicator.set_bg_color(lv.color_hex(0x37B9F5))
style_indicator.set_bg_grad_color(lv.color_hex(0x1464F0))
style_indicator.set_bg_grad_dir(lv.GRAD_DIR.HOR)
style_indicator.set_shadow_color(lv.color_hex(0x37B9F5))
style_indicator.set_shadow_width(15)
style_indicator.set_shadow_spread(5)
# Add the style sheet to the slider's INDICATOR part
slider.add_style(style_indicator, lv.PART.INDICATOR)
slider.add_style(style_indicator, lv.PART.KNOB)
# Add the same style to the KNOB part too and locally overwrite some properties
slider.set_style_outline_color(lv.color_hex(0x0096FF), lv.PART.KNOB)
slider.set_style_outline_width(3, lv.PART.KNOB)
slider.set_style_outline_pad(-5, lv.PART.KNOB)
slider.set_style_shadow_spread(2, lv.PART.KNOB)
```
</details>
<br>
### English, Hebrew (mixed LTR-RTL) and Chinese texts
![English, Hebrew and Chinese texts with LVGL](https://github.com/kisvegabor/test/raw/master/readme_example_5.png)
<details>
<summary>C code</summary>
```c
lv_obj_t * ltr_label = lv_label_create(lv_screen_active());
lv_label_set_text(ltr_label, "In modern terminology, a microcontroller is similar to a system on a chip (SoC).");
lv_obj_set_style_text_font(ltr_label, &lv_font_montserrat_16, 0);
lv_obj_set_width(ltr_label, 310);
lv_obj_align(ltr_label, LV_ALIGN_TOP_LEFT, 5, 5);
lv_obj_t * rtl_label = lv_label_create(lv_screen_active());
lv_label_set_text(rtl_label,"מעבד, או בשמו המלא יחידת עיבוד מרכזית (באנגלית: CPU - Central Processing Unit).");
lv_obj_set_style_base_dir(rtl_label, LV_BASE_DIR_RTL, 0);
lv_obj_set_style_text_font(rtl_label, &lv_font_dejavu_16_persian_hebrew, 0);
lv_obj_set_width(rtl_label, 310);
lv_obj_align(rtl_label, LV_ALIGN_LEFT_MID, 5, 0);
lv_obj_t * cz_label = lv_label_create(lv_screen_active());
lv_label_set_text(cz_label,
"嵌入式系统Embedded System\n是一种嵌入机械或电气系统内部、具有专一功能和实时计算性能的计算机系统。");
lv_obj_set_style_text_font(cz_label, &lv_font_simsun_16_cjk, 0);
lv_obj_set_width(cz_label, 310);
lv_obj_align(cz_label, LV_ALIGN_BOTTOM_LEFT, 5, -5);
```
</details>
<details>
<summary>MicroPython code | <a href="https://sim.lvgl.io/v8.3/micropython/ports/javascript/index.html?script_startup=https://raw.githubusercontent.com/lvgl/lvgl/0d9ab4ee0e591aad1970e3c9164fd7c544ecce70/examples/header.py&script=https://raw.githubusercontent.com/lvgl/lvgl/0d9ab4ee0e591aad1970e3c9164fd7c544ecce70/examples/widgets/slider/lv_example_slider_2.py&script_direct=18bb38200a64e10ead1aa17a65c977fc18131842" target="_blank">Online Simulator</a></summary>
```python
ltr_label = lv.label(lv.screen_active())
ltr_label.set_text("In modern terminology, a microcontroller is similar to a system on a chip (SoC).")
ltr_label.set_style_text_font(lv.font_montserrat_16, 0);
ltr_label.set_width(310)
ltr_label.align(lv.ALIGN.TOP_LEFT, 5, 5)
rtl_label = lv.label(lv.screen_active())
rtl_label.set_text("מעבד, או בשמו המלא יחידת עיבוד מרכזית (באנגלית: CPU - Central Processing Unit).")
rtl_label.set_style_base_dir(lv.BASE_DIR.RTL, 0)
rtl_label.set_style_text_font(lv.font_dejavu_16_persian_hebrew, 0)
rtl_label.set_width(310)
rtl_label.align(lv.ALIGN.LEFT_MID, 5, 0)
font_simsun_16_cjk = lv.font_load("S:../../assets/font/lv_font_simsun_16_cjk.fnt")
cz_label = lv.label(lv.screen_active())
cz_label.set_style_text_font(font_simsun_16_cjk, 0)
cz_label.set_text("嵌入式系统Embedded System\n是一种嵌入机械或电气系统内部、具有专一功能和实时计算性能的计算机系统。")
cz_label.set_width(310)
cz_label.align(lv.ALIGN.BOTTOM_LEFT, 5, -5)
```
</details>
## :arrow_forward: Get started
This list will guide you to get started with LVGL step-by-step.
**Get Familiar with LVGL**
1. Check the [Online demos](https://lvgl.io/demos) to see LVGL in action (3 minutes)
2. Read the [Introduction](https://docs.lvgl.io/master/intro/index.html) page of the documentation (5 minutes)
3. Get familiar with the basics on the [Quick overview](https://docs.lvgl.io/master/get-started/quick-overview.html) page (15 minutes)
**Start to Use LVGL**
4. Set up a [Simulator](https://docs.lvgl.io/master/integration/ide/pc-simulator.html#simulator) (10 minutes)
5. Try out some [Examples](https://github.com/lvgl/lvgl/tree/master/examples)
6. Port LVGL to a board. See the [Porting](https://docs.lvgl.io/master/porting/index.html) guide or check the ready to use [Projects](https://github.com/lvgl?q=lv_port_)
**Become a Pro**
7. Read the [Overview](https://docs.lvgl.io/master/overview/index.html) page to get a better understanding of the library (2-3 hours)
8. Check the documentation of the [Widgets](https://docs.lvgl.io/master/widgets/index.html) to see their features and usage
**Get Help and Help Others**
9. If you have questions go to the [Forum](http://forum.lvgl.io/)
10. Read the [Contributing](https://docs.lvgl.io/master/CONTRIBUTING.html) guide to see how you can help to improve LVGL (15 minutes)
**Go for More**
11. Download and try out [SquareLine Studio](https://squareline.io/).
12. Contact us for [Services](https://lvgl.io/services).
## :handshake: Services
LVGL LLC was established to provide a solid background for LVGL library and to offer several type of services to help you in UI development. With 15+ years of experience in the user interface and graphics industry we can help you the bring your UI to the next level.
- **Graphics design** Our in-house graphics designers are experts in creating beautiful modern designs which fit to your product and the resources of your hardware.
- **UI implementation** We can also implement your UI based on the design you or we have created. You can be sure that we will make the most out of your hardware and LVGL. If a feature or widget is missing from LVGL, don't worry, we will implement it for you.
- **Consulting and Support** We can support you with consulting as well to avoid pricey and time consuming mistakes during the UI development.
- **Board certification** For companies who are offering development boards, or production ready kits we do board certification which shows how board can run LVGL.
Check out our [Demos](https://lvgl.io/demos) as reference. For more information take look at the [Services page](https://lvgl.io/services).
[Contact us](https://lvgl.io/#contact) and tell how we can help.
## :star2: Contributing
LVGL is an open project and contribution is very welcome. There are many ways to contribute from simply speaking about your project, through writing examples, improving the documentation, fixing bugs or even hosting your own project under the LVGL organization.
For a detailed description of contribution opportunities visit the [Contributing](https://docs.lvgl.io/master/CONTRIBUTING.html) section of the documentation.
More than 300 people already left their fingerprint in LVGL. Be one them! See your here! :slightly_smiling_face:
<a href="https://github.com/lvgl/lvgl/graphs/contributors">
<img src="https://contrib.rocks/image?repo=lvgl/lvgl&max=48" />
</a>
... and many other.

View File

@ -1,11 +0,0 @@
# RT-Thread building script for bridge
import os
from building import *
objs = []
cwd = GetCurrentDir()
objs = objs + SConscript(cwd + '/env_support/rt-thread/SConscript')
Return('objs')

View File

@ -1,66 +0,0 @@
# ESP-IDF component file for make based commands
COMPONENT_SRCDIRS := . \
src \
src/core \
src/draw \
src/extra \
src/font \
src/hal \
src/misc \
src/widgets \
src/draw/arm2d \
src/draw/nxp \
src/draw/sdl \
src/draw/stm32_dma2d \
src/draw/sw \
src/draw/swm342_dma2d \
src/extra/layouts \
src/extra/libs \
src/extra/others \
src/extra/themes \
src/extra/widgets \
src/extra/layouts/flex \
src/extra/layouts/grid \
src/extra/libs/bmp \
src/extra/libs/ffmpeg \
src/extra/libs/freetype \
src/extra/libs/fsdrv \
src/extra/libs/gif \
src/extra/libs/png \
src/extra/libs/qrcode \
src/extra/libs/rlottie \
src/extra/libs/sjgp \
src/extra/others/fragment \
src/extra/others/gridnav \
src/extra/others/ime \
src/extra/others/imgfont \
src/extra/others/monkey \
src/extra/others/msg \
src/extra/others/snapshot \
src/extra/themes/basic \
src/extra/themes/default \
src/extra/themes/mono \
src/extra/widgets/animimg \
src/extra/widgets/calendar \
src/extra/widgets/chart \
src/extra/widgets/colorwheel \
src/extra/widgets/imgbtn \
src/extra/widgets/keyboard \
src/extra/widgets/led \
src/extra/widgets/list \
src/extra/widgets/menu \
src/extra/widgets/meter \
src/extra/widgets/msgbox \
src/extra/widgets/span \
src/extra/widgets/spinbox \
src/extra/widgets/spinner \
src/extra/widgets/tabview \
src/extra/widgets/tileview \
src/extra/widgets/win
ifeq ($(CONFIG_LV_USE_THORVG_INTERNAL),y)
COMPONENT_SRCDIRS += src/extra/libs/thorvg
endif
COMPONENT_ADD_INCLUDEDIRS := $(COMPONENT_SRCDIRS) .

View File

@ -1,88 +0,0 @@
# Option to define LV_LVGL_H_INCLUDE_SIMPLE, default: ON
option(LV_LVGL_H_INCLUDE_SIMPLE
"Use #include \"lvgl.h\" instead of #include \"../../lvgl.h\"" ON)
# Option to define LV_CONF_INCLUDE_SIMPLE, default: ON
option(LV_CONF_INCLUDE_SIMPLE
"Use #include \"lv_conf.h\" instead of #include \"../../lv_conf.h\"" ON)
# Option LV_CONF_PATH, which should be the path for lv_conf.h
# If set parent path LV_CONF_DIR is added to includes
if( LV_CONF_PATH )
get_filename_component(LV_CONF_DIR ${LV_CONF_PATH} DIRECTORY)
endif( LV_CONF_PATH )
# Option to build shared libraries (as opposed to static), default: OFF
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
# Set sources used for LVGL components
file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c ${LVGL_ROOT_DIR}/src/*.S)
file(GLOB_RECURSE THORVG_SOURCES ${LVGL_ROOT_DIR}/src/libs/thorvg/*.cpp ${LVGL_ROOT_DIR}/src/others/vg_lite_tvg/*.cpp)
# Build LVGL library
add_library(lvgl ${SOURCES})
add_library(lvgl::lvgl ALIAS lvgl)
target_compile_definitions(
lvgl PUBLIC $<$<BOOL:${LV_LVGL_H_INCLUDE_SIMPLE}>:LV_LVGL_H_INCLUDE_SIMPLE>
$<$<BOOL:${LV_CONF_INCLUDE_SIMPLE}>:LV_CONF_INCLUDE_SIMPLE>
$<$<COMPILE_LANGUAGE:ASM>:__ASSEMBLY__>)
# Add definition of LV_CONF_PATH only if needed
if(LV_CONF_PATH)
target_compile_definitions(lvgl PUBLIC LV_CONF_PATH=${LV_CONF_PATH})
endif()
# Include root and optional parent path of LV_CONF_PATH
target_include_directories(lvgl SYSTEM PUBLIC ${LVGL_ROOT_DIR} ${LV_CONF_DIR})
if(NOT LV_CONF_BUILD_DISABLE_THORVG_INTERNAL)
add_library(lvgl_thorvg ${THORVG_SOURCES})
add_library(lvgl::thorvg ALIAS lvgl_thorvg)
target_include_directories(lvgl_thorvg SYSTEM PUBLIC ${LVGL_ROOT_DIR}/src/libs/thorvg)
if(LV_CONF_PATH)
target_compile_definitions(lvgl_thorvg PUBLIC LV_CONF_PATH=${LV_CONF_PATH})
endif()
endif()
# Lbrary and headers can be installed to system using make install
file(GLOB LVGL_PUBLIC_HEADERS "${CMAKE_SOURCE_DIR}/lv_conf.h"
"${CMAKE_SOURCE_DIR}/lvgl.h")
if("${LIB_INSTALL_DIR}" STREQUAL "")
set(LIB_INSTALL_DIR "lib")
endif()
if("${RUNTIME_INSTALL_DIR}" STREQUAL "")
set(RUNTIME_INSTALL_DIR "bin")
endif()
if("${INC_INSTALL_DIR}" STREQUAL "")
set(INC_INSTALL_DIR "include/lvgl")
endif()
install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src"
DESTINATION "${CMAKE_INSTALL_PREFIX}/${INC_INSTALL_DIR}/"
FILES_MATCHING
PATTERN "*.h")
configure_file("${LVGL_ROOT_DIR}/lvgl.pc.in" lvgl.pc @ONLY)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/lvgl.pc"
DESTINATION "${LIB_INSTALL_DIR}/pkgconfig/")
set_target_properties(
lvgl
PROPERTIES OUTPUT_NAME lvgl
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
PUBLIC_HEADER "${LVGL_PUBLIC_HEADERS}")
install(
TARGETS lvgl
ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
RUNTIME DESTINATION "${RUNTIME_INSTALL_DIR}"
PUBLIC_HEADER DESTINATION "${INC_INSTALL_DIR}")

View File

@ -1,31 +0,0 @@
file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c)
idf_build_get_property(LV_MICROPYTHON LV_MICROPYTHON)
if(LV_MICROPYTHON)
idf_component_register(
SRCS
${SOURCES}
INCLUDE_DIRS
${LVGL_ROOT_DIR}
${LVGL_ROOT_DIR}/src
${LVGL_ROOT_DIR}/../
REQUIRES
main)
else()
if(CONFIG_LV_BUILD_EXAMPLES)
file(GLOB_RECURSE EXAMPLE_SOURCES ${LVGL_ROOT_DIR}/examples/*.c)
set_source_files_properties(${EXAMPLE_SOURCES} COMPILE_FLAGS "-Wno-unused-variable -Wno-format")
endif()
idf_component_register(SRCS ${SOURCES} ${EXAMPLE_SOURCES}
INCLUDE_DIRS ${LVGL_ROOT_DIR} ${LVGL_ROOT_DIR}/src ${LVGL_ROOT_DIR}/../
REQUIRES esp_timer)
endif()
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_CONF_INCLUDE_SIMPLE")
if(CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM)
target_compile_definitions(${COMPONENT_LIB}
PUBLIC "-DLV_ATTRIBUTE_FAST_MEM=IRAM_ATTR")
endif()

View File

@ -1,18 +0,0 @@
file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c)
file(GLOB_RECURSE EXAMPLE_SOURCES ${LVGL_ROOT_DIR}/examples/*.c)
# With micropython, build lvgl as interface library, link chain is:
# lvgl_interface [lvgl] usermod_lvgl_bindings [lv_bindings] usermod
# [micropython] firmware [micropython]
add_library(lvgl_interface INTERFACE)
# ${SOURCES} must NOT be given to add_library directly for some reason (won't be
# built)
target_sources(lvgl_interface INTERFACE ${SOURCES})
# Micropython builds with -Werror; we need to suppress some warnings, such as:
#
# /home/test/build/lv_micropython/ports/rp2/build-PICO/lv_mp.c:29316:16: error:
# 'lv_style_transition_dsc_t_path_xcb_callback' defined but not used
# [-Werror=unused-function] 29316 | STATIC int32_t
# lv_style_transition_dsc_t_path_xcb_callback(const lv_anim_t * arg0) |
# ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
target_compile_options(lvgl_interface INTERFACE -Wno-unused-function)

View File

@ -1,14 +0,0 @@
if(CONFIG_LVGL)
zephyr_include_directories(${ZEPHYR_BASE}/lib/gui/lvgl)
target_include_directories(lvgl INTERFACE ${LVGL_ROOT_DIR})
zephyr_compile_definitions(LV_CONF_KCONFIG_EXTERNAL_INCLUDE=<autoconf.h>)
zephyr_library()
file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c)
zephyr_library_sources(${SOURCES})
endif(CONFIG_LVGL)

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<index schemaVersion="1.0.0" xs:noNamespaceSchemaLocation="PackIndex.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<vendor>LVGL</vendor>
<url>https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/</url>
<timestamp>2024-01-22</timestamp>
<pindex>
<pdsc url="https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/" vendor="LVGL" name="lvgl" version="9.0.0"/>
</pindex>
</index>

View File

@ -1,268 +0,0 @@
# How to Create CMSIS-Pack
## STEP 1 Update 'lv_conf_cmsis.h'
1. Copy the **lv_conf_template.h** to '**cmsis-pack**' directory
2. Set the macro protector to '1'
```c
...
/* clang-format off */
#if 1 /*Set it to "1" to enable content*/
...
```
remove the misleading guide above this code segment.
```c
/*
* Copy this file as `lv_conf.h`
* 1. simply next to the `lvgl` folder
* 2. or any other places and
* - define `LV_CONF_INCLUDE_SIMPLE`
* - add the path as include path
*/
```
3. Add including for '**RTE_Components.h**'
```c
#ifndef LV_CONF_H
#define LV_CONF_H
#include "RTE_Components.h"
...
```
4. Remove macro definitions for
- LV_USE_DEMO_WIDGETS
- LV_USE_DEMO_BENCHMARK
- LV_USE_IME_PINYIN
- LV_USE_OS
- LV_USE_FILE_EXPLORER
- LV_USE_DEMO_WIDGETS
- LV_USE_DEMO_KEYPAD_AND_ENCODER
- LV_USE_DEMO_BENCHMARK
- LV_USE_DEMO_RENDER
- LV_USE_DEMO_STRESS
- LV_USE_DEMO_MUSIC
- LV_USE_DEMO_FLEX_LAYOUT
- LV_USE_DEMO_MULTILANG
- LV_USE_DEMO_TRANSFORM
- LV_USE_DEMO_SCROLL
- LV_USE_DEMO_VECTOR_GRAPHIC
- LV_USE_DRAW_VGLITE
- LV_USE_DRAW_VG_LITE
- LV_USE_DRAW_PXP
- LV_USE_DRAW_SDL
- LV_USE_DRAW_ARM2D
- LV_USE_SNAPSHOT
- LV_USE_MONKEY
- LV_USE_GRIDNAV
- LV_USE_FRAGMENT
- LV_USE_IMGFONT
- LV_USE_LINUX_DRM
- LV_USE_TFT_ESPI
- LV_USE_ST7735
- LV_USE_ST7789
- LV_USE_ST7796
- LV_USE_ILI9341
5. Update `LV_LOG_PRINTF` to `1` and `LV_LOG_LEVEL` to `LV_LOG_LEVEL_USER`
6. Set `LV_FONT_MONTSERRAT_12`, `LV_FONT_MONTSERRAT_24` and `LV_FONT_MONTSERRAT_16` to `1` (So Widgets and Benchmark can be compiled correctly, this is for improving the out of box experience.)
7. Update macro `LV_ATTRIBUTE_MEM_ALIGN` and `LV_ATTRIBUTE_MEM_ALIGN_SIZE` to force a WORD alignment.
```c
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1
#define LV_DRAW_BUF_STRIDE_ALIGN 4
#define LV_ATTRIBUTE_MEM_ALIGN __attribute__((aligned(4)))
```
Make sure `LV_MEM_SIZE` is no less than `(96*1024U)`.
8. Remove following macro definitions in the `3rd party libraries` section:
- \#define LV_USE_FS_STDIO 0
- \#define LV_USE_FS_POSIX 0
- \#define LV_USE_FS_WIN32 0
- \#define LV_USE_FS_FATFS 0
- #define LV_USE_FS_MEMFS 0
- \#define LV_USE_LODEPNG 0
- #define LV_USE_LIBPNG 0
- \#define LV_USE_BMP 0
- \#define LV_USE_RLE 0
- #define LV_USE_TJPGD 0
- #define LV_USE_LIBJPEG_TURBO 0
- \#define LV_USE_GIF 0
- \#define LV_USE_BARCODE 0
- \#define LV_USE_QRCODE 0
- \#define LV_USE_FREETYPE 0
- \#define LV_USE_TINY_TTF 0
- \#define LV_USE_RLOTTIE 0
- \#define LV_USE_FFMPEG 0
9. update the definition of following macros: `LV_USE_VECTOR_GRAPHIC`, `LV_USE_THORVE_INTERNAL` and `LV_USE_THORVE_EXTERNAL` as
```c
/*Enable Vector Graphic APIs*/
#ifndef LV_USE_VECTOR_GRAPHIC
# define LV_USE_VECTOR_GRAPHIC 0
/* Enable ThorVG (vector graphics library) from the src/libs folder */
# define LV_USE_THORVG_INTERNAL 0
/* Enable ThorVG by assuming that its installed and linked to the project */
# define LV_USE_THORVG_EXTERNAL 0
#endif
```
10. update the definition of following macros: `LV_USE_LZ4`, `LV_USE_LZ4_INTERNAL` and `LV_USE_LZ4_EXTERNAL` as
```c
/*Enable LZ4 compress/decompress lib*/
#ifndef LV_USE_LZ4
# define LV_USE_LZ4 0
/*Use lvgl built-in LZ4 lib*/
# define LV_USE_LZ4_INTERNAL 0
/*Use external LZ4 library*/
# define LV_USE_LZ4_EXTERNAL 0
#endif
```
11. Add the following code to `HAL SETTINGS`:
```c
/*customize tick-get */
#if defined(__PERF_COUNTER__) && __PERF_COUNTER__
#define LV_GLOBAL_INIT(__GLOBAL_PTR) \
do { \
lv_global_init((lv_global_t *)(__GLOBAL_PTR)); \
extern uint32_t perfc_tick_get(void); \
(__GLOBAL_PTR)->tick_state.tick_get_cb = perfc_tick_get; \
} while(0)
#endif
```
12. Replace the macro definition:
```c
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
```
with:
```c
#if !defined(LV_USE_DRAW_SW_ASM) && defined(RTE_Acceleration_Arm_2D)
/*turn-on helium acceleration when Arm-2D and the Helium-powered device are detected */
#if defined(__ARM_FEATURE_MVE) && __ARM_FEATURE_MVE
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_HELIUM
#define LV_USE_DRAW_ARM2D 1
#endif
#endif
#ifndef LV_USE_DRAW_SW_ASM
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
#endif
```
13. Update macro `LV_PROFILER_INCLUDE`:
```c
#define LV_PROFILER_INCLUDE "src/misc/lv_profiler_builtin.h"
```
14. rename '**lv_conf_template.h**' to '**lv_conf_cmsis.h**'.
## STEP 2 Check, Update and Run the 'gen_pack.sh'
```sh
if [ `uname -s` = "Linux" ]
then
CMSIS_PACK_PATH="/home/$USER/.arm/Packs/ARM/CMSIS/5.7.0/"
PATH_TO_ADD="$CMSIS_PACK_PATH/CMSIS/Utilities/Linux64/"
else
CMSIS_PACK_PATH="/C/Users/$USER/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0"
PATH_TO_ADD="/C/Program Files (x86)/7-Zip/:$CMSIS_PACK_PATH/CMSIS/Utilities/Win32/:/C/xmllint/"
fi
[[ ":$PATH:" != *":$PATH_TO_ADD}:"* ]] && PATH="${PATH}:${PATH_TO_ADD}"
echo $PATH_TO_ADD appended to PATH
echo " "
```
### A. For Windows users
Update the '**CMSIS_PACK_PATH**' accordingly (Usually just replace the name gabriel with your own windows account name is sufficient.).
Update the '**PATH_TO_ADD**' to point to the installation folders of **7Zip** and **xmllint**.
Launch the git-bash and go to the cmsis-pack folder.
enter the following command:
```sh
./gen_pack.sh
```
### B. For Linux Users
Update '**PATH_TO_ADD**' if necessary.
go to the **cmsis-pack** folder.
enter the following command:
```sh
./gen_pack.sh
```

View File

@ -1,236 +0,0 @@
#!/bin/bash
# Version: 1.1
# Date: 2022-01-11
# This bash script generates a CMSIS Software Pack:
#
# Pre-requisites:
# - bash shell (for Windows: install git for Windows)
# - 7z in path (zip archiving utility)
# e.g. Ubuntu: sudo apt-get install p7zip-full p7zip-rar)
# - PackChk in path with execute permission
# (see CMSIS-Pack: CMSIS/Utilities/<os>/PackChk)
# - xmllint in path (XML schema validation)
# e.g. Ubuntu: sudo apt-get install libxml2-utils
# Windows: download from https://www.zlatkovic.com/pub/libxml/
############### EDIT BELOW ###############
# Extend Path environment variable locally
#
if [ `uname -s` = "Linux" ]
then
CMSIS_PACK_PATH="/home/$USER/.arm/Packs/ARM/CMSIS/5.7.0/"
PATH_TO_ADD="$CMSIS_PACK_PATH/CMSIS/Utilities/Linux64/"
else
CMSIS_PACK_PATH="/C/Users/$USER/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0"
PATH_TO_ADD="/C/Program Files (x86)/7-Zip/:/C/Program Files/7-Zip/:$CMSIS_PACK_PATH/CMSIS/Utilities/Win32/:/C/xmllint/"
fi
[[ ":$PATH:" != *":$PATH_TO_ADD}:"* ]] && PATH="${PATH}:${PATH_TO_ADD}"
echo $PATH_TO_ADD appended to PATH
echo " "
# Pack warehouse directory - destination
PACK_WAREHOUSE=./
# Temporary pack build directory
PACK_BUILD=build/
# Specify directories included in pack relative to base directory
# All directories:
# PACK_DIRS=`ls -d */`
# Do not include the build directory if it is local
# PACK_DIRS=${PACK_DIRS//$PACK_BUILD/}
# PACK_DIRS=${PACK_DIRS//$PACK_WAREHOUSE/}
# alternative: specify directory names to be added to pack base directory
PACK_DIRS="
../../src
../../demos
../../env_support/pikascript
"
# Specify file names to be added to pack base directory
PACK_BASE_FILES="
../../LICENCE.txt
../../README.md
../../lvgl.h
lv_conf_cmsis.h
lv_cmsis_pack.txt
"
############ DO NOT EDIT BELOW ###########
echo Starting CMSIS-Pack Generation: `date`
# Zip utility check
ZIP=7z
type -a $ZIP
errorlevel=$?
if [ $errorlevel -gt 0 ]
then
echo "Error: No 7zip Utility found"
echo "Action: Add 7zip to your path"
echo " "
exit
fi
# Pack checking utility check
PACKCHK=PackChk
type -a $PACKCHK
errorlevel=$?
if [ $errorlevel != 0 ]
then
echo "Error: No PackChk Utility found"
echo "Action: Add PackChk to your path"
echo "Hint: Included in CMSIS Pack:"
echo "<pack_root_dir>/ARM/CMSIS/<version>/CMSIS/Utilities/<os>/"
echo " "
exit
fi
echo " "
# XML syntax checking utility check
XMLLINT=xmllint
type -a $XMLLINT
errorlevel=$?
if [ $errorlevel != 0 ]
then
echo "Error: No xmllint found"
echo "Action: Add xmllint to your path"
echo " "
exit
fi
echo " "
# Locate Package Description file
# check whether there is more than one pdsc file
NUM_PDSCS=`ls -1 *.pdsc | wc -l`
PACK_DESCRIPTION_FILE=`ls *.pdsc`
if [ $NUM_PDSCS -lt 1 ]
then
echo "Error: No *.pdsc file found in current directory"
echo " "
elif [ $NUM_PDSCS -gt 1 ]
then
echo "Error: Only one PDSC file allowed in directory structure:"
echo "Found:"
echo "$PACK_DESCRIPTION_FILE"
echo "Action: Delete unused pdsc files"
echo " "
exit
fi
SAVEIFS=$IFS
IFS=.
set $PACK_DESCRIPTION_FILE
# Pack Vendor
PACK_VENDOR=$1
# Pack Name
PACK_NAME=$2
echo Generating Pack Version: for $PACK_VENDOR.$PACK_NAME
echo " "
IFS=$SAVEIFS
#if $PACK_BUILD directory does not exist, create it.
if [ ! -d $PACK_BUILD ]; then
mkdir -p $PACK_BUILD
fi
mkdir -p ${PACK_BUILD}/examples
mkdir -p ${PACK_BUILD}/examples/porting
# directories
echo Adding directories to pack:
echo $PACK_DIRS
echo " "
for d in ${PACK_DIRS}
do
cp -r "$d" ${PACK_BUILD}
done
# files for base directory
echo Adding files to pack:
echo $PACK_BASE_FILES
echo " "
for f in $PACK_BASE_FILES
do
cp -f "$f" $PACK_BUILD/
done
# Copy files into build base directory: $PACK_BUILD
# pdsc file is mandatory in base directory:
cp -f ./$PACK_VENDOR.$PACK_NAME.pdsc ${PACK_BUILD}
cp -f ../../examples/porting/* ${PACK_BUILD}/examples/porting
cp -f ./lv_os_custom_c.txt ${PACK_BUILD}/src/osal/lv_os_custom.c
cp -f ./lv_os_custom_h.txt ${PACK_BUILD}/src/osal/lv_os_custom.h
mv "${PACK_BUILD}/lv_cmsis_pack.txt" "${PACK_BUILD}/lv_cmsis_pack.c"
# Run Schema Check (for Linux only):
# sudo apt-get install libxml2-utils
echo Running schema check for $PACK_VENDOR.$PACK_NAME.pdsc
$XMLLINT --noout --schema ${CMSIS_PACK_PATH}/CMSIS/Utilities/PACK.xsd $PACK_BUILD/$PACK_VENDOR.$PACK_NAME.pdsc
errorlevel=$?
if [ $errorlevel -ne 0 ]; then
echo "build aborted: Schema check of $PACK_VENDOR.$PACK_NAME.pdsc against PACK.xsd failed"
echo " "
exit
fi
# Run Pack Check and generate PackName file with version
$PACKCHK $PACK_BUILD/$PACK_VENDOR.$PACK_NAME.pdsc -n PackName.txt -x M362
errorlevel=$?
if [ $errorlevel -ne 0 ]; then
echo "build aborted: pack check failed"
echo " "
exit
fi
PACKNAME=`cat PackName.txt`
rm -rf PackName.txt
# echo apply patches...
# rm -rf $PACK_BUILD/demos/lv_demos.h
# cp -f ./lv_demos.h $PACK_BUILD/demos/
echo delete files...
find $PACK_BUILD/demos/ -type f -name "*.png" -delete
find $PACK_BUILD/demos/ -type f -name "*.gif" -delete
find $PACK_BUILD/demos/ -type f -name "*.gif" -delete
find $PACK_BUILD/demos/ -type f -name "*.ttf" -delete
find $PACK_BUILD/demos/ -type f -name "*.otf" -delete
find $PACK_BUILD/demos/ -type f -name "*.jpg" -delete
find $PACK_BUILD/demos/ -type f -name "*.fnt" -delete
# Archiving
# $ZIP a $PACKNAME
echo creating pack file $PACKNAME
#if $PACK_WAREHOUSE directory does not exist create it
if [ ! -d $PACK_WAREHOUSE ]; then
mkdir -p $PACK_WAREHOUSE
fi
pushd $PACK_WAREHOUSE
PACK_WAREHOUSE=`pwd`
popd
pushd $PACK_BUILD
"$ZIP" a $PACK_WAREHOUSE/$PACKNAME -tzip
popd
errorlevel=$?
if [ $errorlevel -ne 0 ]; then
echo "build aborted: archiving failed"
exit
fi
# cp -f ./$PACK_VENDOR.$PACK_NAME.pdsc ${PACK_WAREHOUSE}
echo "build of pack succeeded"
# Clean up
echo "cleaning up ..."
rm -rf $PACK_BUILD
echo " "
echo Completed CMSIS-Pack Generation: `date`

View File

@ -1,139 +0,0 @@
/****************************************************************************
* Copyright 2022 Gorgon Meducer (Email:embedded_zhuoran@hotmail.com) *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
****************************************************************************/
/**
* @file lv_cmsis_pack.c
*
* @brief This file will only be used by cmsis-pack.
*/
/*********************
* INCLUDES
*********************/
#include "RTE_Components.h"
#include <time.h>
#if defined(__PERF_COUNTER__) && __PERF_COUNTER__
# include "perf_counter.h"
#endif
#include <stdint.h>
#include <stddef.h>
#include "lv_global.h"
/*********************
* DEFINES
*********************/
#define state LV_GLOBAL_DEFAULT()->tick_state
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/*! \name The macros to identify the compiler */
/*! @{ */
/*! \note for IAR */
#undef __IS_COMPILER_IAR__
#if defined(__IAR_SYSTEMS_ICC__)
# define __IS_COMPILER_IAR__ 1
#endif
/*! \note for arm compiler 5 */
#undef __IS_COMPILER_ARM_COMPILER_5__
#if ((__ARMCC_VERSION >= 5000000) && (__ARMCC_VERSION < 6000000))
# define __IS_COMPILER_ARM_COMPILER_5__ 1
#endif
/*! @} */
/*! \note for arm compiler 6 */
#undef __IS_COMPILER_ARM_COMPILER_6__
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
# define __IS_COMPILER_ARM_COMPILER_6__ 1
#endif
#undef __IS_COMPILER_ARM_COMPILER__
#if defined(__IS_COMPILER_ARM_COMPILER_5__) && __IS_COMPILER_ARM_COMPILER_5__ \
|| defined(__IS_COMPILER_ARM_COMPILER_6__) && __IS_COMPILER_ARM_COMPILER_6__
# define __IS_COMPILER_ARM_COMPILER__ 1
#endif
#undef __IS_COMPILER_LLVM__
#if defined(__clang__) && !__IS_COMPILER_ARM_COMPILER_6__
# define __IS_COMPILER_LLVM__ 1
#else
/*! \note for gcc */
# undef __IS_COMPILER_GCC__
# if defined(__GNUC__) && !( defined(__IS_COMPILER_ARM_COMPILER__) \
|| defined(__IS_COMPILER_LLVM__))
# define __IS_COMPILER_GCC__ 1
# endif
/*! @} */
#endif
/*! @} */
/**********************
* GLOBAL FUNCTIONS
**********************/
/* When Arm Compilers using the MicroLib, provide an empty implementation for
* time() which is not included in the MicroLib
*/
#if defined(__IS_COMPILER_ARM_COMPILER__) && __IS_COMPILER_ARM_COMPILER__
# if defined(__MICROLIB)
__attribute__((weak))
_ARMABI time_t time(time_t * time)
{
return (time_t)(-1);
}
# endif
# if defined(__PERF_COUNTER__) && __PERF_COUNTER__
/**
* Get the elapsed milliseconds since start up from perf_counter
* @return the elapsed milliseconds
*/
uint32_t perfc_tick_get(void)
{
return (uint32_t)get_system_ms();
}
# endif
#endif

View File

@ -1,838 +0,0 @@
/**
* @file lv_conf.h
* Configuration file for v9.0.0
*/
/* clang-format off */
#if 1 /*Set it to "1" to enable content*/
#ifndef LV_CONF_H
#define LV_CONF_H
#include "RTE_Components.h"
/*====================
COLOR SETTINGS
*====================*/
/*Color depth: 8 (A8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888)*/
#define LV_COLOR_DEPTH 16
/*=========================
STDLIB WRAPPER SETTINGS
*=========================*/
/* Possible values
* - LV_STDLIB_BUILTIN: LVGL's built in implementation
* - LV_STDLIB_CLIB: Standard C functions, like malloc, strlen, etc
* - LV_STDLIB_MICROPYTHON: MicroPython implementation
* - LV_STDLIB_RTTHREAD: RT-Thread implementation
* - LV_STDLIB_CUSTOM: Implement the functions externally
*/
#define LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN
#define LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN
#define LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN
#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN
/*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/
#define LV_MEM_SIZE (96 * 1024U) /*[bytes]*/
/*Size of the memory expand for `lv_malloc()` in bytes*/
#define LV_MEM_POOL_EXPAND_SIZE 0
/*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/
#define LV_MEM_ADR 0 /*0: unused*/
/*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/
#if LV_MEM_ADR == 0
#undef LV_MEM_POOL_INCLUDE
#undef LV_MEM_POOL_ALLOC
#endif
#endif /*LV_USE_MALLOC == LV_STDLIB_BUILTIN*/
/*====================
HAL SETTINGS
*====================*/
/*Default display refresh, input device read and animation step period.*/
#define LV_DEF_REFR_PERIOD 33 /*[ms]*/
/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
*(Not so important, you can adjust it to modify default sizes and spaces)*/
#define LV_DPI_DEF 130 /*[px/inch]*/
/*customize tick-get */
#if defined(__PERF_COUNTER__) && __PERF_COUNTER__
#define LV_GLOBAL_INIT(__GLOBAL_PTR) \
do { \
lv_global_init((lv_global_t *)(__GLOBAL_PTR)); \
extern uint32_t perfc_tick_get(void); \
(__GLOBAL_PTR)->tick_state.tick_get_cb = perfc_tick_get; \
} while(0)
#endif
/*=================
* OPERATING SYSTEM
*=================*/
#if LV_USE_OS == LV_OS_CUSTOM
#define LV_OS_CUSTOM_INCLUDE <stdint.h>
#endif
/*========================
* RENDERING CONFIGURATION
*========================*/
/*Align the stride of all layers and images to this bytes*/
#define LV_DRAW_BUF_STRIDE_ALIGN 1
/*Align the start address of draw_buf addresses to this bytes*/
#define LV_DRAW_BUF_ALIGN 4
#define LV_USE_DRAW_SW 1
#if LV_USE_DRAW_SW == 1
/* Set the number of draw unit.
* > 1 requires an operating system enabled in `LV_USE_OS`
* > 1 means multiply threads will render the screen in parallel */
#define LV_DRAW_SW_DRAW_UNIT_CNT 1
/* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode
* it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks.
* "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers
* and can't be drawn in chunks. */
/*The target buffer size for simple layer chunks.*/
#define LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/
/* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only
* 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */
#define LV_DRAW_SW_COMPLEX 1
#if LV_DRAW_SW_COMPLEX == 1
/*Allow buffering some shadow calculation.
*LV_DRAW_SW_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius`
*Caching has LV_DRAW_SW_SHADOW_CACHE_SIZE^2 RAM cost*/
#define LV_DRAW_SW_SHADOW_CACHE_SIZE 0
/* Set number of maximally cached circle data.
* The circumference of 1/4 circle are saved for anti-aliasing
* radius * 4 bytes are used per circle (the most often used radiuses are saved)
* 0: to disable caching */
#define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4
#endif
#if !defined(LV_USE_DRAW_SW_ASM) && defined(RTE_Acceleration_Arm_2D)
/*turn-on helium acceleration when Arm-2D and the Helium-powered device are detected */
#if defined(__ARM_FEATURE_MVE) && __ARM_FEATURE_MVE
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_HELIUM
#define LV_USE_DRAW_ARM2D_SYNC 1
#endif
#endif
#ifndef LV_USE_DRAW_SW_ASM
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
#endif
#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM
#define LV_DRAW_SW_ASM_CUSTOM_INCLUDE ""
#endif
#endif
#if LV_USE_DRAW_VGLITE
/* Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels. */
#define LV_USE_VGLITE_BLIT_SPLIT 0
#if LV_USE_OS
/* Enable VGLite draw async. Queue multiple tasks and flash them once to the GPU. */
#define LV_USE_VGLITE_DRAW_ASYNC 1
#endif
/* Enable VGLite asserts. */
#define LV_USE_VGLITE_ASSERT 0
#endif
#if LV_USE_DRAW_PXP
/* Enable PXP asserts. */
#define LV_USE_PXP_ASSERT 0
#endif
/* Use VG-Lite GPU. */
#define LV_USE_DRAW_VG_LITE 0
#if LV_USE_DRAW_VG_LITE
/* Enable VG-Lite custom external 'gpu_init()' function */
#define LV_VG_LITE_USE_GPU_INIT 0
/* Enable VG-Lite assert. */
#define LV_VG_LITE_USE_ASSERT 0
#endif
/*=======================
* FEATURE CONFIGURATION
*=======================*/
/*-------------
* Logging
*-----------*/
/*Enable the log module*/
#define LV_USE_LOG 0
#if LV_USE_LOG
/*How important log should be added:
*LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
*LV_LOG_LEVEL_INFO Log important events
*LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
*LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
*LV_LOG_LEVEL_USER Only logs added by the user
*LV_LOG_LEVEL_NONE Do not log anything*/
#define LV_LOG_LEVEL LV_LOG_LEVEL_USER
/*1: Print the log with 'printf';
*0: User need to register a callback with `lv_log_register_print_cb()`*/
#define LV_LOG_PRINTF 1
/*1: Enable print timestamp;
*0: Disable print timestamp*/
#define LV_LOG_USE_TIMESTAMP 1
/*1: Print file and line number of the log;
*0: Do not print file and line number of the log*/
#define LV_LOG_USE_FILE_LINE 1
/*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/
#define LV_LOG_TRACE_MEM 1
#define LV_LOG_TRACE_TIMER 1
#define LV_LOG_TRACE_INDEV 1
#define LV_LOG_TRACE_DISP_REFR 1
#define LV_LOG_TRACE_EVENT 1
#define LV_LOG_TRACE_OBJ_CREATE 1
#define LV_LOG_TRACE_LAYOUT 1
#define LV_LOG_TRACE_ANIM 1
#define LV_LOG_TRACE_CACHE 1
#endif /*LV_USE_LOG*/
/*-------------
* Asserts
*-----------*/
/*Enable asserts if an operation is failed or an invalid data is found.
*If LV_USE_LOG is enabled an error message will be printed on failure*/
#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/
#define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/
#define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/
#define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/
#define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/
/*Add a custom handler when assert happens e.g. to restart the MCU*/
#define LV_ASSERT_HANDLER_INCLUDE <stdint.h>
#define LV_ASSERT_HANDLER while(1); /*Halt by default*/
/*-------------
* Debug
*-----------*/
/*1: Draw random colored rectangles over the redrawn areas*/
#define LV_USE_REFR_DEBUG 0
/*1: Draw a red overlay for ARGB layers and a green overlay for RGB layers*/
#define LV_USE_LAYER_DEBUG 0
/*1: Draw overlays with different colors for each draw_unit's tasks.
*Also add the index number of the draw unit on white background.
*For layers add the index number of the draw unit on black background.*/
#define LV_USE_PARALLEL_DRAW_DEBUG 0
/*-------------
* Others
*-----------*/
#define LV_ENABLE_GLOBAL_CUSTOM 0
#if LV_ENABLE_GLOBAL_CUSTOM
/*Header to include for the custom 'lv_global' function"*/
#define LV_GLOBAL_CUSTOM_INCLUDE <stdint.h>
#endif
/*Default cache size in bytes.
*Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory.
*Data larger than the size of the cache also can be allocated but
*will be dropped immediately after usage.*/
#define LV_CACHE_DEF_SIZE 0
/*Default number of image header cache entries. The cache is used to store the headers of images
*The main logic is like `LV_CACHE_DEF_SIZE` but for image headers.*/
#define LV_IMAGE_HEADER_CACHE_DEF_CNT 0
/*Number of stops allowed per gradient. Increase this to allow more stops.
*This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/
#define LV_GRADIENT_MAX_STOPS 2
/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently.
* 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */
#define LV_COLOR_MIX_ROUND_OFS 0
/* Add 2 x 32 bit variables to each lv_obj_t to speed up getting style properties */
#define LV_OBJ_STYLE_CACHE 0
/* Add `id` field to `lv_obj_t` */
#define LV_USE_OBJ_ID 0
/* Use lvgl builtin method for obj ID */
#define LV_USE_OBJ_ID_BUILTIN 0
/*Use obj property set/get API*/
#define LV_USE_OBJ_PROPERTY 0
/*=====================
* COMPILER SETTINGS
*====================*/
/*For big endian systems set to 1*/
#define LV_BIG_ENDIAN_SYSTEM 0
/*Define a custom attribute to `lv_tick_inc` function*/
#define LV_ATTRIBUTE_TICK_INC
/*Define a custom attribute to `lv_timer_handler` function*/
#define LV_ATTRIBUTE_TIMER_HANDLER
/*Define a custom attribute to `lv_display_flush_ready` function*/
#define LV_ATTRIBUTE_FLUSH_READY
/*Required alignment size for buffers*/
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 4
/*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default).
* E.g. __attribute__((aligned(4)))*/
#define LV_ATTRIBUTE_MEM_ALIGN __attribute__((aligned(4)))
/*Attribute to mark large constant arrays for example font's bitmaps*/
#define LV_ATTRIBUTE_LARGE_CONST
/*Compiler prefix for a big array declaration in RAM*/
#define LV_ATTRIBUTE_LARGE_RAM_ARRAY
/*Place performance critical functions into a faster memory (e.g RAM)*/
#define LV_ATTRIBUTE_FAST_MEM
/*Export integer constant to binding. This macro is used with constants in the form of LV_<CONST> that
*should also appear on LVGL binding API such as Micropython.*/
#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/
/*Prefix all global extern data with this*/
#define LV_ATTRIBUTE_EXTERN_DATA
/* Use `float` as `lv_value_precise_t` */
#define LV_USE_FLOAT 0
/*==================
* FONT USAGE
*===================*/
/*Montserrat fonts with ASCII range and some symbols using bpp = 4
*https://fonts.google.com/specimen/Montserrat*/
#define LV_FONT_MONTSERRAT_8 0
#define LV_FONT_MONTSERRAT_10 0
#define LV_FONT_MONTSERRAT_12 1
#define LV_FONT_MONTSERRAT_14 1
#define LV_FONT_MONTSERRAT_16 1
#define LV_FONT_MONTSERRAT_18 0
#define LV_FONT_MONTSERRAT_20 0
#define LV_FONT_MONTSERRAT_22 0
#define LV_FONT_MONTSERRAT_24 1
#define LV_FONT_MONTSERRAT_26 0
#define LV_FONT_MONTSERRAT_28 0
#define LV_FONT_MONTSERRAT_30 0
#define LV_FONT_MONTSERRAT_32 0
#define LV_FONT_MONTSERRAT_34 0
#define LV_FONT_MONTSERRAT_36 0
#define LV_FONT_MONTSERRAT_38 0
#define LV_FONT_MONTSERRAT_40 0
#define LV_FONT_MONTSERRAT_42 0
#define LV_FONT_MONTSERRAT_44 0
#define LV_FONT_MONTSERRAT_46 0
#define LV_FONT_MONTSERRAT_48 0
/*Demonstrate special features*/
#define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/
#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/
#define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/
/*Pixel perfect monospace fonts*/
#define LV_FONT_UNSCII_8 0
#define LV_FONT_UNSCII_16 0
/*Optionally declare custom fonts here.
*You can use these fonts as default font too and they will be available globally.
*E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/
#define LV_FONT_CUSTOM_DECLARE
/*Always set a default font*/
#define LV_FONT_DEFAULT &lv_font_montserrat_14
/*Enable handling large font and/or fonts with a lot of characters.
*The limit depends on the font size, font face and bpp.
*Compiler error will be triggered if a font needs it.*/
#define LV_FONT_FMT_TXT_LARGE 0
/*Enables/disables support for compressed fonts.*/
#define LV_USE_FONT_COMPRESSED 0
/*Enable drawing placeholders when glyph dsc is not found*/
#define LV_USE_FONT_PLACEHOLDER 1
/*=================
* TEXT SETTINGS
*=================*/
/**
* Select a character encoding for strings.
* Your IDE or editor should have the same character encoding
* - LV_TXT_ENC_UTF8
* - LV_TXT_ENC_ASCII
*/
#define LV_TXT_ENC LV_TXT_ENC_UTF8
/*Can break (wrap) texts on these chars*/
#define LV_TXT_BREAK_CHARS " ,.;:-_)]}"
/*If a word is at least this long, will break wherever "prettiest"
*To disable, set to a value <= 0*/
#define LV_TXT_LINE_BREAK_LONG_LEN 0
/*Minimum number of characters in a long word to put on a line before a break.
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3
/*Minimum number of characters in a long word to put on a line after a break.
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3
/*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts.
*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
/*Set the default direction. Supported values:
*`LV_BASE_DIR_LTR` Left-to-Right
*`LV_BASE_DIR_RTL` Right-to-Left
*`LV_BASE_DIR_AUTO` detect texts base direction*/
#define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO
#endif
/*Enable Arabic/Persian processing
*In these languages characters should be replaced with an other form based on their position in the text*/
#define LV_USE_ARABIC_PERSIAN_CHARS 0
/*==================
* WIDGETS
*================*/
/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/
#define LV_WIDGETS_HAS_DEFAULT_VALUE 1
#define LV_USE_ANIMIMG 1
#define LV_USE_ARC 1
#define LV_USE_BAR 1
#define LV_USE_BUTTON 1
#define LV_USE_BUTTONMATRIX 1
#define LV_USE_CALENDAR 1
#if LV_USE_CALENDAR
#define LV_CALENDAR_WEEK_STARTS_MONDAY 0
#if LV_CALENDAR_WEEK_STARTS_MONDAY
#define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"}
#else
#define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"}
#endif
#define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
#define LV_USE_CALENDAR_HEADER_ARROW 1
#define LV_USE_CALENDAR_HEADER_DROPDOWN 1
#endif /*LV_USE_CALENDAR*/
#define LV_USE_CANVAS 1
#define LV_USE_CHART 1
#define LV_USE_CHECKBOX 1
#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/
#define LV_USE_IMAGE 1 /*Requires: lv_label*/
#define LV_USE_IMAGEBUTTON 1
#define LV_USE_KEYBOARD 1
#define LV_USE_LABEL 1
#if LV_USE_LABEL
#define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/
#define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/
#define LV_LABEL_WAIT_CHAR_COUNT 3 /*The count of wait chart*/
#endif
#define LV_USE_LED 1
#define LV_USE_LINE 1
#define LV_USE_LIST 1
#define LV_USE_MENU 1
#define LV_USE_MSGBOX 1
#define LV_USE_ROLLER 1 /*Requires: lv_label*/
#define LV_USE_SCALE 1
#define LV_USE_SLIDER 1 /*Requires: lv_bar*/
#define LV_USE_SPAN 1
#if LV_USE_SPAN
/*A line text can contain maximum num of span descriptor */
#define LV_SPAN_SNIPPET_STACK_SIZE 64
#endif
#define LV_USE_SPINBOX 1
#define LV_USE_SPINNER 1
#define LV_USE_SWITCH 1
#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/
#if LV_USE_TEXTAREA != 0
#define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/
#endif
#define LV_USE_TABLE 1
#define LV_USE_TABVIEW 1
#define LV_USE_TILEVIEW 1
#define LV_USE_WIN 1
/*==================
* THEMES
*==================*/
/*A simple, impressive and very complete theme*/
#define LV_USE_THEME_DEFAULT 1
#if LV_USE_THEME_DEFAULT
/*0: Light mode; 1: Dark mode*/
#define LV_THEME_DEFAULT_DARK 0
/*1: Enable grow on press*/
#define LV_THEME_DEFAULT_GROW 1
/*Default transition time in [ms]*/
#define LV_THEME_DEFAULT_TRANSITION_TIME 80
#endif /*LV_USE_THEME_DEFAULT*/
/*A very simple theme that is a good starting point for a custom theme*/
#define LV_USE_THEME_SIMPLE 1
/*A theme designed for monochrome displays*/
#define LV_USE_THEME_MONO 1
/*==================
* LAYOUTS
*==================*/
/*A layout similar to Flexbox in CSS.*/
#define LV_USE_FLEX 1
/*A layout similar to Grid in CSS.*/
#define LV_USE_GRID 1
/*====================
* 3RD PARTS LIBRARIES
*====================*/
/*File system interfaces for common APIs */
/*API for fopen, fread, etc*/
#if LV_USE_FS_STDIO
#define LV_FS_STDIO_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
#define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for open, read, etc*/
#if LV_USE_FS_POSIX
#define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
#define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for CreateFile, ReadFile, etc*/
#if LV_USE_FS_WIN32
#define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
#define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/
#if LV_USE_FS_FATFS
#define LV_FS_FATFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for memory-mapped file access. */
#if LV_USE_FS_MEMFS
#define LV_FS_MEMFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#endif
/*GIF decoder library*/
#if LV_USE_GIF
/*GIF decoder accelerate*/
#define LV_GIF_CACHE_DECODE_DATA 0
#endif
/*Decode bin images to RAM*/
#define LV_BIN_DECODER_RAM_LOAD 0
/*FreeType library*/
#if LV_USE_FREETYPE
/*Memory used by FreeType to cache characters in kilobytes*/
#define LV_FREETYPE_CACHE_SIZE 768
/*Let FreeType to use LVGL memory and file porting*/
#define LV_FREETYPE_USE_LVGL_PORT 0
/*FreeType cache type:
* LV_FREETYPE_CACHE_TYPE_IMAGE - Image cache
* LV_FREETYPE_CACHE_TYPE_SBIT - Sbit cache
* LV_FREETYPE_CACHE_TYPE_OUTLINE - Outline cache*/
#define LV_FREETYPE_CACHE_TYPE LV_FREETYPE_CACHE_TYPE_IMAGE
/* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */
/* (0:use system defaults) */
#define LV_FREETYPE_CACHE_FT_FACES 8
#define LV_FREETYPE_CACHE_FT_SIZES 8
#define LV_FREETYPE_CACHE_FT_OUTLINES 256
#endif
/* Built-in TTF decoder */
#if LV_USE_TINY_TTF
/* Enable loading TTF data from files */
#define LV_TINY_TTF_FILE_SUPPORT 0
#endif
/*Enable Vector Graphic APIs*/
#ifndef LV_USE_VECTOR_GRAPHIC
# define LV_USE_VECTOR_GRAPHIC 0
/* Enable ThorVG (vector graphics library) from the src/libs folder */
# define LV_USE_THORVG_INTERNAL 0
/* Enable ThorVG by assuming that its installed and linked to the project */
# define LV_USE_THORVG_EXTERNAL 0
#endif
/*Enable LZ4 compress/decompress lib*/
#ifndef LV_USE_LZ4
# define LV_USE_LZ4 0
/*Use lvgl built-in LZ4 lib*/
# define LV_USE_LZ4_INTERNAL 0
/*Use external LZ4 library*/
# define LV_USE_LZ4_EXTERNAL 0
#endif
/*FFmpeg library for image decoding and playing videos
*Supports all major image formats so do not enable other image decoder with it*/
#if LV_USE_FFMPEG
/*Dump input information to stderr*/
#define LV_FFMPEG_DUMP_FORMAT 0
#endif
/*==================
* OTHERS
*==================*/
/*1: Enable system monitor component*/
#define LV_USE_SYSMON 0
#if LV_USE_SYSMON
/*1: Show CPU usage and FPS count
* Requires `LV_USE_SYSMON = 1`*/
#define LV_USE_PERF_MONITOR 0
#if LV_USE_PERF_MONITOR
#define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
/*0: Displays performance data on the screen, 1: Prints performance data using log.*/
#define LV_USE_PERF_MONITOR_LOG_MODE 0
#endif
/*1: Show the used memory and the memory fragmentation
* Requires `LV_USE_BUILTIN_MALLOC = 1`
* Requires `LV_USE_SYSMON = 1`*/
#define LV_USE_MEM_MONITOR 0
#if LV_USE_MEM_MONITOR
#define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
#endif
#endif /*LV_USE_SYSMON*/
/*1: Enable the runtime performance profiler*/
#define LV_USE_PROFILER 0
#if LV_USE_PROFILER
/*1: Enable the built-in profiler*/
#define LV_USE_PROFILER_BUILTIN 1
#if LV_USE_PROFILER_BUILTIN
/*Default profiler trace buffer size*/
#define LV_PROFILER_BUILTIN_BUF_SIZE (16 * 1024) /*[bytes]*/
#endif
/*Header to include for the profiler*/
#define LV_PROFILER_INCLUDE "src/misc/lv_profiler_builtin.h"
/*Profiler start point function*/
#define LV_PROFILER_BEGIN LV_PROFILER_BUILTIN_BEGIN
/*Profiler end point function*/
#define LV_PROFILER_END LV_PROFILER_BUILTIN_END
/*Profiler start point function with custom tag*/
#define LV_PROFILER_BEGIN_TAG LV_PROFILER_BUILTIN_BEGIN_TAG
/*Profiler end point function with custom tag*/
#define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG
#endif
/*1: Enable an observer pattern implementation*/
#define LV_USE_OBSERVER 1
/*1: Enable Pinyin input method*/
/*Requires: lv_keyboard*/
#if LV_USE_IME_PINYIN
/*1: Use default thesaurus*/
/*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesauruss*/
#define LV_IME_PINYIN_USE_DEFAULT_DICT 1
/*Set the maximum number of candidate panels that can be displayed*/
/*This needs to be adjusted according to the size of the screen*/
#define LV_IME_PINYIN_CAND_TEXT_NUM 6
/*Use 9 key input(k9)*/
#define LV_IME_PINYIN_USE_K9_MODE 1
#if LV_IME_PINYIN_USE_K9_MODE == 1
#define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3
#endif /*LV_IME_PINYIN_USE_K9_MODE*/
#endif
/*1: Enable file explorer*/
/*Requires: lv_table*/
#if LV_USE_FILE_EXPLORER
/*Maximum length of path*/
#define LV_FILE_EXPLORER_PATH_MAX_LEN (128)
/*Quick access bar, 1:use, 0:not use*/
/*Requires: lv_list*/
#define LV_FILE_EXPLORER_QUICK_ACCESS 1
#endif
/*==================
* DEVICES
*==================*/
/*Use SDL to open window on PC and handle mouse and keyboard*/
#define LV_USE_SDL 0
#if LV_USE_SDL
#define LV_SDL_INCLUDE_PATH <SDL2/SDL.h>
#define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /*LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance*/
#define LV_SDL_BUF_COUNT 1 /*1 or 2*/
#define LV_SDL_FULLSCREEN 0 /*1: Make the window full screen by default*/
#define LV_SDL_DIRECT_EXIT 1 /*1: Exit the application when all SDL windows are closed*/
#endif
/*Use X11 to open window on Linux desktop and handle mouse and keyboard*/
#define LV_USE_X11 0
#if LV_USE_X11
#define LV_X11_DIRECT_EXIT 1 /*Exit the application when all X11 windows have been closed*/
#define LV_X11_DOUBLE_BUFFER 1 /*Use double buffers for endering*/
/*select only 1 of the following render modes (LV_X11_RENDER_MODE_PARTIAL preferred!)*/
#define LV_X11_RENDER_MODE_PARTIAL 1 /*Partial render mode (preferred)*/
#define LV_X11_RENDER_MODE_DIRECT 0 /*direct render mode*/
#define LV_X11_RENDER_MODE_FULL 0 /*Full render mode*/
#endif
/*Driver for /dev/fb*/
#define LV_USE_LINUX_FBDEV 0
#if LV_USE_LINUX_FBDEV
#define LV_LINUX_FBDEV_BSD 0
#define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL
#define LV_LINUX_FBDEV_BUFFER_COUNT 0
#define LV_LINUX_FBDEV_BUFFER_SIZE 60
#endif
/*Use Nuttx to open window and handle touchscreen*/
#define LV_USE_NUTTX 0
#if LV_USE_NUTTX
#define LV_USE_NUTTX_LIBUV 0
/*Use Nuttx custom init API to open window and handle touchscreen*/
#define LV_USE_NUTTX_CUSTOM_INIT 0
/*Driver for /dev/lcd*/
#define LV_USE_NUTTX_LCD 0
#if LV_USE_NUTTX_LCD
#define LV_NUTTX_LCD_BUFFER_COUNT 0
#define LV_NUTTX_LCD_BUFFER_SIZE 60
#endif
/*Driver for /dev/input*/
#define LV_USE_NUTTX_TOUCHSCREEN 0
#endif
/*Driver for evdev input devices*/
#define LV_USE_EVDEV 0
#define LV_USE_GENERIC_MIPI (LV_USE_ST7735 | LV_USE_ST7789 | LV_USE_ST7796 | LV_USE_ILI9341)
/*==================
* EXAMPLES
*==================*/
/*Enable the examples to be built with the library*/
#define LV_BUILD_EXAMPLES 1
/*===================
* DEMO USAGE
====================*/
/*Show some widget. It might be required to increase `LV_MEM_SIZE` */
#if LV_USE_DEMO_WIDGETS
#define LV_DEMO_WIDGETS_SLIDESHOW 0
#endif
/*Music player demo*/
#if LV_USE_DEMO_MUSIC
#define LV_DEMO_MUSIC_SQUARE 0
#define LV_DEMO_MUSIC_LANDSCAPE 0
#define LV_DEMO_MUSIC_ROUND 0
#define LV_DEMO_MUSIC_LARGE 0
#define LV_DEMO_MUSIC_AUTO_PLAY 0
#endif
/*--END OF LV_CONF_H--*/
#endif /*LV_CONF_H*/
#endif /*End of "Content enable"*/

View File

@ -1,120 +0,0 @@
/**
* @file lv_os_custom.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_os.h"
#if LV_USE_OS == LV_OS_CUSTOM
#include "../misc/lv_types.h"
#include "../misc/lv_assert.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
lv_result_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size,
void * user_data)
{
LV_UNUSED(thread);
LV_UNUSED(callback);
LV_UNUSED(prio);
LV_UNUSED(stack_size);
LV_UNUSED(user_data);
LV_ASSERT(0);
return LV_RESULT_INVALID;
}
lv_result_t lv_thread_delete(lv_thread_t * thread)
{
LV_UNUSED(thread);
LV_ASSERT(0);
return LV_RESULT_INVALID;
}
lv_result_t lv_mutex_init(lv_mutex_t * mutex)
{
LV_UNUSED(mutex);
return LV_RESULT_OK;
}
lv_result_t lv_mutex_lock(lv_mutex_t * mutex)
{
LV_UNUSED(mutex);
return LV_RESULT_OK;
}
lv_result_t lv_mutex_lock_isr(lv_mutex_t * mutex)
{
LV_UNUSED(mutex);
return LV_RESULT_OK;
}
lv_result_t lv_mutex_unlock(lv_mutex_t * mutex)
{
LV_UNUSED(mutex);
return LV_RESULT_OK;
}
lv_result_t lv_mutex_delete(lv_mutex_t * mutex)
{
LV_UNUSED(mutex);
return LV_RESULT_OK;
}
lv_result_t lv_thread_sync_init(lv_thread_sync_t * sync)
{
LV_UNUSED(sync);
LV_ASSERT(0);
return LV_RESULT_INVALID;
}
lv_result_t lv_thread_sync_wait(lv_thread_sync_t * sync)
{
LV_UNUSED(sync);
LV_ASSERT(0);
return LV_RESULT_INVALID;
}
lv_result_t lv_thread_sync_signal(lv_thread_sync_t * sync)
{
LV_UNUSED(sync);
LV_ASSERT(0);
return LV_RESULT_INVALID;
}
lv_result_t lv_thread_sync_delete(lv_thread_sync_t * sync)
{
LV_UNUSED(sync);
LV_ASSERT(0);
return LV_RESULT_INVALID;
}
/**********************
* STATIC FUNCTIONS
**********************/
#endif /*LV_USE_OS == LV_OS_CUSTOM*/

View File

@ -1,43 +0,0 @@
/**
* @file lv_os_custom.h
*
*/
#ifndef LV_OS_CUSTOM_H
#define LV_OS_CUSTOM_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#if LV_USE_OS == LV_OS_CUSTOM
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef int lv_mutex_t;
typedef int lv_thread_t;
typedef int lv_thread_sync_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/**********************
* MACROS
**********************/
#endif /*LV_USE_OS == LV_OS_CUSTOM*/
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*LV_OS_CUSTOM_H*/

View File

@ -1,90 +0,0 @@
From 18083a559734d297838e4cf34a856a4770062319 Mon Sep 17 00:00:00 2001
From: tvanfossen <vanfosst@gmail.com>
Date: Tue, 23 Aug 2022 10:06:53 -0400
Subject: [PATCH] changes to compile with esp-idf
---
CMakeLists.txt | 11 ++++++-----
src/vector/vimageloader.cpp | 23 +++++++++++++----------
2 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 38a9862..ee6d2cd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -95,10 +95,11 @@ if (NOT APPLE AND NOT WIN32)
)
endif()
-if (LOTTIE_MODULE)
- # for dlopen, dlsym and dlclose dependency
- target_link_libraries(rlottie PRIVATE ${CMAKE_DL_LIBS})
-endif()
+# No Sym links in ESP-IDF
+# if (LOTTIE_MODULE)
+# # for dlopen, dlsym and dlclose dependency
+# target_link_libraries(rlottie PRIVATE ${CMAKE_DL_LIBS})
+# endif()
if (NOT LOTTIE_ASAN)
if(APPLE)
@@ -137,7 +138,7 @@ endif (NOT LIB_INSTALL_DIR)
#declare source and include files
add_subdirectory(inc)
add_subdirectory(src)
-add_subdirectory(example)
+# add_subdirectory(example) // We dont need example dir in ESP-IDF
if (LOTTIE_TEST)
enable_testing()
diff --git a/src/vector/vimageloader.cpp b/src/vector/vimageloader.cpp
index c2446be..3df4c6a 100644
--- a/src/vector/vimageloader.cpp
+++ b/src/vector/vimageloader.cpp
@@ -6,7 +6,7 @@
#ifdef _WIN32
# include <windows.h>
#else
-# include <dlfcn.h>
+// # include <dlfcn.h> //Does not work on ESP-IDF
#endif // _WIN32
using lottie_image_load_f = unsigned char *(*)(const char *filename, int *x,
@@ -61,22 +61,25 @@ struct VImageLoader::Impl {
void *dl_handle{nullptr};
void init()
{
- imageLoad = reinterpret_cast<lottie_image_load_f>(
- dlsym(dl_handle, "lottie_image_load"));
- imageFree = reinterpret_cast<lottie_image_free_f>(
- dlsym(dl_handle, "lottie_image_free"));
- imageFromData = reinterpret_cast<lottie_image_load_data_f>(
- dlsym(dl_handle, "lottie_image_load_from_data"));
+ // No sym links in ESP-iDF
+ // imageLoad = reinterpret_cast<lottie_image_load_f>(
+ // dlsym(dl_handle, "lottie_image_load"));
+ // imageFree = reinterpret_cast<lottie_image_free_f>(
+ // dlsym(dl_handle, "lottie_image_free"));
+ // imageFromData = reinterpret_cast<lottie_image_load_data_f>(
+ // dlsym(dl_handle, "lottie_image_load_from_data"));
}
void moduleFree()
{
- if (dl_handle) dlclose(dl_handle);
+ // if (dl_handle) dlclose(dl_handle); // No sym links in ESP-iDF
}
bool moduleLoad()
{
- dl_handle = dlopen(LOTTIE_IMAGE_MODULE_PLUGIN, RTLD_LAZY);
- return (dl_handle == nullptr);
+ // No sym links in ESP idf
+ // dl_handle = dlopen(LOTTIE_IMAGE_MODULE_PLUGIN, RTLD_LAZY);
+ // return (dl_handle == nullptr);
+ return true
}
# endif // _WIN32
#else // LOTTIE_IMAGE_MODULE_SUPPORT
--
2.34.1

View File

@ -1,24 +0,0 @@
cmake_minimum_required(VERSION 3.5)
if (0)
if (LV_USE_RLOTTIE)
idf_component_register(SRCS ${SOURCES}
INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/rlottie/inc"
)
set(LOTTIE_MODULE OFF)
set(LOTTIE_THREAD OFF)
set(BUILD_SHARED_LIBS OFF)
option(BUILD_TESTING OFF)
function(install)
endfunction()
function(export)
endfunction()
add_subdirectory(rlottie)
target_link_libraries(${COMPONENT_LIB} INTERFACE rlottie)
endif()
endif()

View File

@ -1,11 +0,0 @@
# PikaScript Binding for LVGL
[PikaScript](https://github.com/pikasTech/pikascript) is an ultralightweight python engine that can run with 4KB of RAM and 32KB of Flash (such as STM32G030C8 and STM32F103C8), and is very easy to deploy and expand.
More details to see: [PikaScript and lvgl: Make Python Lighter, Easier and Smarter](https://blog.lvgl.io/2022-08-24/pikascript-and-lvgl)
The available Python APIs are in the `pika_lvgl.pyi`, and you need copy the `pika_lvgl.pyi` to the root path of pikascript, then `import pika_lvgl` in `main.py`.
The available simulation project on windows: https://github.com/pikasTech/lv_pikascript
More document about PikaScript: https://pikadoc.readthedocs.io/en/latest/index.html

View File

@ -1,16 +0,0 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "../../lvgl.h"
#endif
#ifdef PIKASCRIPT
#include "pika_lvgl_point_t.h"
void pika_lvgl_point_t___init__(PikaObj* self) {
lv_point_t lv_point = {0};
args_setStruct(self->list, "lv_point_struct", lv_point);
obj_setPtr(self, "lv_point", args_getStruct(self->list, "lv_point_struct"));
}
#endif

View File

@ -1,44 +0,0 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "../../lvgl.h"
#endif
#ifdef PIKASCRIPT
#include "pika_lvgl_lv_timer_t.h"
PikaEventListener* g_pika_lv_timer_event_listener;
void __pika_timer_cb(lv_timer_t* timer) {
PikaObj* eventHandleObj = pks_eventLisener_getEventHandleObj(
g_pika_lv_timer_event_listener, (uint32_t)timer);
obj_newDirectObj(eventHandleObj, "timer", New_pika_lvgl_lv_timer_t);
obj_setPtr(obj_getPtr(eventHandleObj, "timer"), "lv_timer", timer);
obj_run(eventHandleObj, "eventCallBack(timer)");
}
void pika_lvgl_lv_timer_t_set_period(PikaObj* self, int period) {
lv_timer_t* lv_timer = obj_getPtr(self, "lv_timer");
lv_timer_set_period(lv_timer, period);
}
void pika_lvgl_lv_timer_t_set_cb(PikaObj* self, Arg* cb) {
lv_timer_t* lv_timer = obj_getPtr(self, "lv_timer");
lv_timer_set_cb(lv_timer, __pika_timer_cb);
obj_setArg(self, "eventCallBack", cb);
/* init event_listener for the first time */
if (NULL == g_pika_lv_timer_event_listener) {
pks_eventLisener_init(&g_pika_lv_timer_event_listener);
}
pks_eventLicener_registerEvent(g_pika_lv_timer_event_listener,
(uint32_t)lv_timer, self);
}
void pika_lvgl_lv_timer_t__delete(PikaObj* self) {
lv_timer_t* lv_timer = obj_getPtr(self, "lv_timer");
lv_timer_delete(lv_timer);
}
#endif

View File

@ -1,364 +0,0 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "../../lvgl.h"
#endif
#ifdef PIKASCRIPT
#include "BaseObj.h"
#include "pika_lvgl.h"
#include "pika_lvgl_arc.h"
#include "pika_lvgl_bar.h"
#include "pika_lvgl_btn.h"
#include "pika_lvgl_checkbox.h"
#include "pika_lvgl_dropdown.h"
#include "pika_lvgl_label.h"
#include "pika_lvgl_lv_obj.h"
#include "pika_lvgl_roller.h"
#include "pika_lvgl_slider.h"
#include "pika_lvgl_switch.h"
#include "pika_lvgl_table.h"
#include "pika_lvgl_textarea.h"
void pika_lvgl_arc___init__(PikaObj* self, PikaObj* parent) {
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
lv_obj_t* lv_obj = lv_arc_create(lv_parent);
obj_setPtr(self, "lv_obj", lv_obj);
obj_setInt(self, "MODE_NORMAL", LV_ARC_MODE_NORMAL);
obj_setInt(self, "MODE_SYMMETRICAL", LV_ARC_MODE_SYMMETRICAL);
obj_setInt(self, "MODE_REVERSE", LV_ARC_MODE_REVERSE);
}
void pika_lvgl_arc_set_end_angle(PikaObj* self, int angle) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_arc_set_end_angle(lv_obj, angle);
}
void pika_lvgl_arc_set_bg_angles(PikaObj* self, int start, int end) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_arc_set_bg_angles(lv_obj, start, end);
}
void pika_lvgl_arc_set_angles(PikaObj* self, int start, int end) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_arc_set_angles(lv_obj, start, end);
}
int pika_lvgl_arc_get_angle_end(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_arc_get_angle_end(lv_obj);
}
int pika_lvgl_arc_get_angle_start(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_arc_get_angle_start(lv_obj);
}
int pika_lvgl_arc_get_bg_angle_end(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_arc_get_bg_angle_end(lv_obj);
}
int pika_lvgl_arc_get_bg_angle_start(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_arc_get_bg_angle_start(lv_obj);
}
int pika_lvgl_arc_get_max_value(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_arc_get_max_value(lv_obj);
}
int pika_lvgl_arc_get_min_value(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_arc_get_min_value(lv_obj);
}
int pika_lvgl_arc_get_mode(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_arc_get_mode(lv_obj);
}
// int pika_lvgl_arc_get_rotation(PikaObj *self){
// lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
// return lv_arc_get_rotation(lv_obj);
// }
int pika_lvgl_arc_get_value(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_arc_get_value(lv_obj);
}
void pika_lvgl_arc_set_mode(PikaObj *self, int mode){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_arc_set_mode(lv_obj, mode);
}
void pika_lvgl_arc_set_range(PikaObj *self, int min, int max){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_arc_set_range(lv_obj, min, max);
}
void pika_lvgl_arc_set_rotation(PikaObj *self, int rotation){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_arc_set_rotation(lv_obj, rotation);
}
void pika_lvgl_arc_set_start_angle(PikaObj *self, int start){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_arc_set_start_angle(lv_obj, start);
}
void pika_lvgl_arc_set_value(PikaObj *self, int value){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_arc_set_value(lv_obj, value);
}
void pika_lvgl_arc_set_bg_end_angle(PikaObj *self, int angle){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_arc_set_bg_end_angle(lv_obj, angle);
}
void pika_lvgl_arc_set_bg_start_angle(PikaObj *self, int start){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_arc_set_bg_start_angle(lv_obj, start);
}
void pika_lvgl_arc_set_change_rate(PikaObj *self, int rate){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_arc_set_change_rate(lv_obj, rate);
}
void pika_lvgl_bar___init__(PikaObj* self, PikaObj* parent) {
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
lv_obj_t* lv_obj = lv_bar_create(lv_parent);
obj_setPtr(self, "lv_obj", lv_obj);
}
void pika_lvgl_bar_set_value(PikaObj* self, int value, int anim) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_bar_set_value(lv_obj, value, value);
}
int pika_lvgl_bar_get_max_value(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_bar_get_max_value(lv_obj);
}
int pika_lvgl_bar_get_min_value(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_bar_get_min_value(lv_obj);
}
int pika_lvgl_bar_get_mode(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_bar_get_mode(lv_obj);
}
int pika_lvgl_bar_get_start_value(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_bar_get_start_value(lv_obj);
}
int pika_lvgl_bar_get_value(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_bar_get_value(lv_obj);
}
void pika_lvgl_bar_set_mode(PikaObj *self, int mode){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_bar_set_mode(lv_obj, mode);
}
void pika_lvgl_bar_set_range(PikaObj *self, int min, int max){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_bar_set_range(lv_obj, min, max);
}
void pika_lvgl_bar_set_start_value(PikaObj *self, int start_value, int anim){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_bar_set_start_value(lv_obj, start_value, anim);
}
void pika_lvgl_btn___init__(PikaObj* self, PikaObj* parent) {
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
lv_obj_t* lv_obj = lv_button_create(lv_parent);
obj_setPtr(self, "lv_obj", lv_obj);
}
void pika_lvgl_checkbox___init__(PikaObj* self, PikaObj* parent) {
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
lv_obj_t* lv_obj = lv_checkbox_create(lv_parent);
obj_setPtr(self, "lv_obj", lv_obj);
}
void pika_lvgl_checkbox_set_text(PikaObj* self, char* txt) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_checkbox_set_text(lv_obj, txt);
}
void pika_lvgl_checkbox_set_text_static(PikaObj *self, char* txt){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_checkbox_set_text_static(lv_obj, txt);
}
char* pika_lvgl_checkbox_get_text(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return (char*) lv_checkbox_get_text(lv_obj);
}
void pika_lvgl_dropdown___init__(PikaObj* self, PikaObj* parent) {
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
lv_obj_t* lv_obj = lv_dropdown_create(lv_parent);
obj_setPtr(self, "lv_obj", lv_obj);
}
void pika_lvgl_dropdown_set_options(PikaObj* self, char* options) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_dropdown_set_options(lv_obj, options);
}
void pika_lvgl_dropdown_add_option(PikaObj *self, char* options, int pos){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_dropdown_add_option(lv_obj, options, pos);
}
void pika_lvgl_dropdown_clear_options(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_dropdown_clear_options(lv_obj);
}
void pika_lvgl_dropdown_close(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_dropdown_close(lv_obj);
}
int pika_lvgl_dropdown_get_dir(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_dropdown_get_dir(lv_obj);
}
// PikaObj* pika_lvgl_dropdown_get_list(PikaObj *self){
// lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
// return obj_getObj(lv_dropdown_get_list(lv_obj));
// }
int pika_lvgl_dropdown_get_option_count(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_dropdown_get_option_count(lv_obj);
}
int pika_lvgl_dropdown_get_option_index(PikaObj *self, char* txt){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_dropdown_get_option_index(lv_obj, txt);
}
char* pika_lvgl_dropdown_get_options(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return (char*) lv_dropdown_get_options(lv_obj);
}
int pika_lvgl_dropdown_get_selected(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_dropdown_get_selected(lv_obj);
}
int pika_lvgl_dropdown_get_selected_highlight(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_dropdown_get_selected_highlight(lv_obj);
}
char* pika_lvgl_dropdown_get_selected_str(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
obj_setBytes(self, "_buff",NULL, 128);
char* _buff = (char*)obj_getBytes(self, "_buff");
lv_dropdown_get_selected_str(lv_obj, _buff, 128);
return _buff;
}
char* pika_lvgl_dropdown_get_symbol(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return (char*)lv_dropdown_get_symbol(lv_obj);
}
char* pika_lvgl_dropdown_get_text(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return (char*)lv_dropdown_get_text(lv_obj);
}
int pika_lvgl_dropdown_is_open(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_dropdown_is_open(lv_obj);
}
void pika_lvgl_dropdown_open(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_dropdown_open(lv_obj);
}
void pika_lvgl_dropdown_set_dir(PikaObj *self, int dir){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_dropdown_set_dir(lv_obj, dir);
}
void pika_lvgl_dropdown_set_selected(PikaObj *self, int sel_opt){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_dropdown_set_selected(lv_obj, sel_opt);
}
void pika_lvgl_dropdown_set_selected_highlight(PikaObj *self, int en){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_dropdown_set_selected_highlight(lv_obj, en);
}
void pika_lvgl_dropdown_set_symbol(PikaObj *self, char* symbol){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_dropdown_set_symbol(lv_obj, symbol);
}
void pika_lvgl_dropdown_set_text(PikaObj *self, char* txt){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_dropdown_set_text(lv_obj, txt);
}
void pika_lvgl_label___init__(PikaObj* self, PikaObj* parent) {
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
lv_obj_t* lv_obj = lv_label_create(lv_parent);
obj_setPtr(self, "lv_obj", lv_obj);
}
void pika_lvgl_label_set_long_mode(PikaObj* self, int mode) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_label_set_long_mode(lv_obj, mode);
}
void pika_lvgl_label_set_recolor(PikaObj* self, int en) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_label_set_recolor(lv_obj, en);
}
void pika_lvgl_label_set_text(PikaObj* self, char* txt) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_label_set_text(lv_obj, txt);
}
void pika_lvgl_label_set_style_text_align(PikaObj* self,
int value,
int selector) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_style_text_align(lv_obj, value, selector);
}
void pika_lvgl_roller___init__(PikaObj* self, PikaObj* parent) {
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
lv_obj_t* lv_obj = lv_roller_create(lv_parent);
obj_setPtr(self, "lv_obj", lv_obj);
}
void pika_lvgl_roller_set_options(PikaObj* self, char* options, int mode) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_roller_set_options(lv_obj, options, mode);
}
void pika_lvgl_roller_set_visible_row_count(PikaObj* self, int row_cnt) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_roller_set_visible_row_count(lv_obj, row_cnt);
}
void pika_lvgl_slider___init__(PikaObj* self, PikaObj* parent) {
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
lv_obj_t* lv_obj = lv_slider_create(lv_parent);
obj_setPtr(self, "lv_obj", lv_obj);
}
void pika_lvgl_switch___init__(PikaObj* self, PikaObj* parent) {
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
lv_obj_t* lv_obj = lv_switch_create(lv_parent);
obj_setPtr(self, "lv_obj", lv_obj);
}
void pika_lvgl_table___init__(PikaObj* self, PikaObj* parent) {
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
lv_obj_t* lv_obj = lv_table_create(lv_parent);
obj_setPtr(self, "lv_obj", lv_obj);
}
void pika_lvgl_table_set_cell_value(PikaObj* self,
int row,
int col,
char* txt) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_table_set_cell_value(lv_obj, row, col, txt);
}
void pika_lvgl_textarea___init__(PikaObj* self, PikaObj* parent) {
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
lv_obj_t* lv_obj = lv_textarea_create(lv_parent);
obj_setPtr(self, "lv_obj", lv_obj);
}
void pika_lvgl_textarea_set_one_line(PikaObj* self, int en) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_textarea_set_one_line(lv_obj, en);
}
#endif

View File

@ -1,199 +0,0 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "../../lvgl.h"
#endif
#ifdef PIKASCRIPT
#include "pika_lvgl.h"
#include "BaseObj.h"
#include "pika_lvgl_ALIGN.h"
#include "pika_lvgl_ANIM.h"
#include "pika_lvgl_EVENT.h"
#include "pika_lvgl_OPA.h"
#include "pika_lvgl_PALETTE.h"
#include "pika_lvgl_STATE.h"
#include "pika_lvgl_arc.h"
#include "pika_lvgl_lv_color_t.h"
#include "pika_lvgl_lv_obj.h"
#include "pika_lvgl_indev_t.h"
#include "pika_lvgl_lv_timer_t.h"
PikaObj* pika_lv_event_listener_g;
void pika_lvgl_STATE___init__(PikaObj* self) {
obj_setInt(self, "DEFAULT", LV_STATE_DEFAULT);
obj_setInt(self, "CHECKED", LV_STATE_CHECKED);
obj_setInt(self, "FOCUSED", LV_STATE_FOCUSED);
obj_setInt(self, "FOCUS_KEY", LV_STATE_FOCUS_KEY);
obj_setInt(self, "EDITED", LV_STATE_EDITED);
obj_setInt(self, "HOVERED", LV_STATE_HOVERED);
obj_setInt(self, "PRESSED", LV_STATE_PRESSED);
obj_setInt(self, "SCROLLED", LV_STATE_SCROLLED);
obj_setInt(self, "DISABLED", LV_STATE_DISABLED);
obj_setInt(self, "USER_1", LV_STATE_USER_1);
obj_setInt(self, "USER_2", LV_STATE_USER_2);
obj_setInt(self, "USER_3", LV_STATE_USER_3);
obj_setInt(self, "USER_4", LV_STATE_USER_4);
obj_setInt(self, "ANY", LV_STATE_ANY);
}
void pika_lvgl_ANIM___init__(PikaObj* self) {
obj_setInt(self, "ON", LV_ANIM_OFF);
obj_setInt(self, "OFF", LV_ANIM_ON);
}
void pika_lvgl_ALIGN___init__(PikaObj* self) {
obj_setInt(self, "CENTER", LV_ALIGN_CENTER);
obj_setInt(self, "DEFAULT", LV_ALIGN_DEFAULT);
obj_setInt(self, "TOP_LEFT", LV_ALIGN_TOP_LEFT);
obj_setInt(self, "TOP_MID", LV_ALIGN_TOP_MID);
obj_setInt(self, "TOP_RIGHT", LV_ALIGN_TOP_RIGHT);
obj_setInt(self, "BOTTOM_LEFT", LV_ALIGN_BOTTOM_LEFT);
obj_setInt(self, "BOTTOM_MID", LV_ALIGN_BOTTOM_MID);
obj_setInt(self, "BOTTOM_RIGHT", LV_ALIGN_BOTTOM_RIGHT);
obj_setInt(self, "LEFT_MID", LV_ALIGN_LEFT_MID);
obj_setInt(self, "RIGHT_MID", LV_ALIGN_RIGHT_MID);
obj_setInt(self, "OUT_TOP_LEFT", LV_ALIGN_OUT_TOP_LEFT);
obj_setInt(self, "OUT_TOP_MID", LV_ALIGN_OUT_TOP_MID);
obj_setInt(self, "OUT_TOP_RIGHT", LV_ALIGN_OUT_TOP_RIGHT);
obj_setInt(self, "OUT_BOTTOM_LEFT", LV_ALIGN_OUT_BOTTOM_LEFT);
obj_setInt(self, "OUT_BOTTOM_MID", LV_ALIGN_OUT_BOTTOM_MID);
obj_setInt(self, "OUT_BOTTOM_RIGHT", LV_ALIGN_OUT_BOTTOM_RIGHT);
obj_setInt(self, "OUT_LEFT_TOP", LV_ALIGN_OUT_LEFT_TOP);
obj_setInt(self, "OUT_LEFT_MID", LV_ALIGN_OUT_LEFT_MID);
obj_setInt(self, "OUT_LEFT_BOTTOM", LV_ALIGN_OUT_LEFT_BOTTOM);
obj_setInt(self, "OUT_RIGHT_TOP", LV_ALIGN_OUT_RIGHT_TOP);
obj_setInt(self, "OUT_RIGHT_MID", LV_ALIGN_OUT_RIGHT_MID);
obj_setInt(self, "OUT_RIGHT_BOTTOM", LV_ALIGN_OUT_RIGHT_BOTTOM);
}
void pika_lvgl_EVENT___init__(PikaObj* self) {
obj_setInt(self, "ALL", LV_EVENT_ALL);
obj_setInt(self, "PRESSED", LV_EVENT_PRESSED);
obj_setInt(self, "PRESSING", LV_EVENT_PRESSING);
obj_setInt(self, "PRESS_LOST", LV_EVENT_PRESS_LOST);
obj_setInt(self, "SHORT_CLICKED", LV_EVENT_SHORT_CLICKED);
obj_setInt(self, "LONG_PRESSED", LV_EVENT_LONG_PRESSED);
obj_setInt(self, "LONG_PRESSED_REPEAT", LV_EVENT_LONG_PRESSED_REPEAT);
obj_setInt(self, "CLICKED", LV_EVENT_CLICKED);
obj_setInt(self, "RELEASED", LV_EVENT_RELEASED);
obj_setInt(self, "SCROLL_BEGIN", LV_EVENT_SCROLL_BEGIN);
obj_setInt(self, "SCROLL_END", LV_EVENT_SCROLL_END);
obj_setInt(self, "SCROLL", LV_EVENT_SCROLL);
obj_setInt(self, "GESTURE", LV_EVENT_GESTURE);
obj_setInt(self, "KEY", LV_EVENT_KEY);
obj_setInt(self, "FOCUSED", LV_EVENT_FOCUSED);
obj_setInt(self, "DEFOCUSED", LV_EVENT_DEFOCUSED);
obj_setInt(self, "LEAVE", LV_EVENT_LEAVE);
obj_setInt(self, "HIT_TEST", LV_EVENT_HIT_TEST);
obj_setInt(self, "COVER_CHECK", LV_EVENT_COVER_CHECK);
obj_setInt(self, "REFR_EXT_DRAW_SIZE", LV_EVENT_REFR_EXT_DRAW_SIZE);
obj_setInt(self, "DRAW_MAIN_BEGIN", LV_EVENT_DRAW_MAIN_BEGIN);
obj_setInt(self, "DRAW_MAIN", LV_EVENT_DRAW_MAIN);
obj_setInt(self, "DRAW_MAIN_END", LV_EVENT_DRAW_MAIN_END);
obj_setInt(self, "DRAW_POST_BEGIN", LV_EVENT_DRAW_POST_BEGIN);
obj_setInt(self, "DRAW_POST", LV_EVENT_DRAW_POST);
obj_setInt(self, "DRAW_POST_END", LV_EVENT_DRAW_POST_END);
obj_setInt(self, "DRAW_PART_BEGIN", LV_EVENT_DRAW_PART_BEGIN);
obj_setInt(self, "DRAW_PART_END", LV_EVENT_DRAW_PART_END);
obj_setInt(self, "VALUE_CHANGED", LV_EVENT_VALUE_CHANGED);
obj_setInt(self, "INSERT", LV_EVENT_INSERT);
obj_setInt(self, "REFRESH", LV_EVENT_REFRESH);
obj_setInt(self, "READY", LV_EVENT_READY);
obj_setInt(self, "CANCEL", LV_EVENT_CANCEL);
obj_setInt(self, "DELETE", LV_EVENT_DELETE);
obj_setInt(self, "CHILD_CHANGED", LV_EVENT_CHILD_CHANGED);
obj_setInt(self, "CHILD_CREATED", LV_EVENT_CHILD_CREATED);
obj_setInt(self, "CHILD_DELETED", LV_EVENT_CHILD_DELETED);
obj_setInt(self, "SCREEN_UNLOAD_START", LV_EVENT_SCREEN_UNLOAD_START);
obj_setInt(self, "SCREEN_LOAD_START", LV_EVENT_SCREEN_LOAD_START);
obj_setInt(self, "SCREEN_LOADED", LV_EVENT_SCREEN_LOADED);
obj_setInt(self, "SCREEN_UNLOADED", LV_EVENT_SCREEN_UNLOADED);
obj_setInt(self, "SIZE_CHANGED", LV_EVENT_SIZE_CHANGED);
obj_setInt(self, "STYLE_CHANGED", LV_EVENT_STYLE_CHANGED);
obj_setInt(self, "LAYOUT_CHANGED", LV_EVENT_LAYOUT_CHANGED);
obj_setInt(self, "GET_SELF_SIZE", LV_EVENT_GET_SELF_SIZE);
obj_setInt(self, "PREPROCESS", LV_EVENT_PREPROCESS);
}
void pika_lvgl_OPA___init__(PikaObj* self) {
obj_setInt(self, "TRANSP", LV_OPA_TRANSP);
obj_setInt(self, "COVER", LV_OPA_COVER);
}
void pika_lvgl_PALETTE___init__(PikaObj* self) {
obj_setInt(self, "RED", LV_PALETTE_RED);
obj_setInt(self, "PINK", LV_PALETTE_PINK);
obj_setInt(self, "PURPLE", LV_PALETTE_PURPLE);
obj_setInt(self, "DEEP_PURPLE", LV_PALETTE_DEEP_PURPLE);
obj_setInt(self, "INDIGO", LV_PALETTE_INDIGO);
obj_setInt(self, "BLUE", LV_PALETTE_BLUE);
obj_setInt(self, "LIGHT_BLUE", LV_PALETTE_LIGHT_BLUE);
obj_setInt(self, "CYAN", LV_PALETTE_CYAN);
obj_setInt(self, "TEAL", LV_PALETTE_TEAL);
obj_setInt(self, "GREEN", LV_PALETTE_GREEN);
obj_setInt(self, "LIGHT_GREEN", LV_PALETTE_LIGHT_GREEN);
obj_setInt(self, "LIME", LV_PALETTE_LIME);
obj_setInt(self, "YELLOW", LV_PALETTE_YELLOW);
obj_setInt(self, "AMBER", LV_PALETTE_AMBER);
obj_setInt(self, "ORANGE", LV_PALETTE_ORANGE);
obj_setInt(self, "DEEP_ORANGE", LV_PALETTE_DEEP_ORANGE);
obj_setInt(self, "BROWN", LV_PALETTE_BROWN);
obj_setInt(self, "BLUE_GREY", LV_PALETTE_BLUE_GREY);
obj_setInt(self, "GREY", LV_PALETTE_GREY);
obj_setInt(self, "NONE", LV_PALETTE_NONE);
}
PikaObj* pika_lvgl_screen_active(PikaObj* self) {
PikaObj* new_obj = newNormalObj(New_TinyObj);
lv_obj_t* lv_obj = lv_screen_active();
obj_setPtr(new_obj, "lv_obj", lv_obj);
return new_obj;
}
void pika_lvgl___init__(PikaObj* self) {
obj_newDirectObj(self, "lv_event_listener", New_TinyObj);
pika_lv_event_listener_g = obj_getObj(self, "lv_event_listener");
}
PikaObj* pika_lvgl_obj(PikaObj* self, PikaObj* parent) {
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
lv_obj_t* lv_obj = lv_obj_create(lv_parent);
PikaObj* new_obj = newNormalObj(New_pika_lvgl_lv_obj);
obj_setPtr(new_obj, "lv_obj", lv_obj);
return new_obj;
}
PikaObj* pika_lvgl_palette_lighten(PikaObj *self, int p, int lvl){
PikaObj* new_obj = newNormalObj(New_pika_lvgl_lv_color_t);
lv_color_t lv_color = lv_palette_lighten(p, lvl);
args_setStruct(new_obj->list, "lv_color_struct", lv_color);
lv_color_t* plv_color = args_getStruct(new_obj->list, "lv_color_struct");
obj_setPtr(new_obj, "lv_color", plv_color);
return new_obj;
}
PikaObj* pika_lvgl_palette_main(PikaObj* self, int p) {
PikaObj* new_obj = newNormalObj(New_pika_lvgl_lv_color_t);
lv_color_t lv_color = lv_palette_main(p);
args_setStruct(new_obj->list, "lv_color_struct", lv_color);
obj_setPtr(new_obj, "lv_color",
args_getStruct(new_obj->list, "lv_color_struct"));
return new_obj;
}
PikaObj* pika_lvgl_indev_get_active(PikaObj *self){
PikaObj* new_obj = newNormalObj(New_pika_lvgl_indev_t);
lv_indev_t *lv_indev = lv_indev_active();
obj_setPtr(new_obj,"lv_indev", lv_indev);
return new_obj;
}
PikaObj* pika_lvgl_timer_create_basic(PikaObj *self){
PikaObj* new_obj = newNormalObj(New_pika_lvgl_lv_timer_t);
lv_timer_t *lv_timer = lv_timer_create_basic();
obj_setPtr(new_obj,"lv_timer", lv_timer);
return new_obj;
}
#endif

View File

@ -1,263 +0,0 @@
from PikaObj import *
def __init__(): ...
class EVENT:
ALL: int
PRESSED: int
PRESSING: int
PRESS_LOST: int
SHORT_CLICKED: int
LONG_PRESSED: int
LONG_PRESSED_REPEAT: int
CLICKED: int
RELEASED: int
SCROLL_BEGIN: int
SCROLL_END: int
SCROLL: int
GESTURE: int
KEY: int
FOCUSED: int
DEFOCUSED: int
LEAVE: int
HIT_TEST: int
COVER_CHECK: int
REFR_EXT_DRAW_SIZE: int
DRAW_MAIN_BEGIN: int
DRAW_MAIN: int
DRAW_MAIN_END: int
DRAW_POST_BEGIN: int
DRAW_POST: int
DRAW_POST_END: int
DRAW_PART_BEGIN: int
DRAW_PART_END: int
VALUE_CHANGED: int
INSERT: int
REFRESH: int
READY: int
CANCEL: int
DELETE: int
CHILD_CHANGED: int
CHILD_CREATED: int
CHILD_DELETED: int
SCREEN_UNLOAD_START: int
SCREEN_LOAD_START: int
SCREEN_LOADED: int
SCREEN_UNLOADED: int
SIZE_CHANGED: int
STYLE_CHANGED: int
LAYOUT_CHANGED: int
GET_SELF_SIZE: int
PREPROCESS: int
def __init__(self): ...
class ALIGN:
DEFAULT: int
TOP_LEFT: int
TOP_MID: int
TOP_RIGHT: int
BOTTOM_LEFT: int
BOTTOM_MID: int
BOTTOM_RIGHT: int
LEFT_MID: int
RIGHT_MID: int
CENTER: int
OUT_TOP_LEFT: int
OUT_TOP_MID: int
OUT_TOP_RIGHT: int
OUT_BOTTOM_LEFT: int
OUT_BOTTOM_MID: int
OUT_BOTTOM_RIGHT: int
OUT_LEFT_TOP: int
OUT_LEFT_MID: int
OUT_LEFT_BOTTOM: int
OUT_RIGHT_TOP: int
OUT_RIGHT_MID: int
OUT_RIGHT_BOTTOM: int
def __init__(self): ...
class PALETTE:
RED: int
PINK: int
PURPLE: int
DEEP_PURPLE: int
INDIGO: int
BLUE: int
LIGHT_BLUE: int
CYAN: int
TEAL: int
GREEN: int
LIGHT_GREEN: int
LIME: int
YELLOW: int
AMBER: int
ORANGE: int
DEEP_ORANGE: int
BROWN: int
BLUE_GREY: int
GREY: int
NONE: int
def __init__(self): ...
class OPA:
TRANSP: int
COVER: int
def __init__(self): ...
class ANIM:
OFF: int
ON: int
def __init__(self): ...
class STATE:
def __init__(self): ...
class lv_event:
def get_code(self) -> int: ...
def get_target(self) -> lv_obj: ...
class lv_color_t: ...
class lv_timer_t:
def set_period(period: int): ...
def set_cb(cb: any): ...
def _del(self): ...
def palette_lighten(p: int, lvl: int) -> lv_color_t: ...
def palette_main(p: int) -> lv_color_t: ...
class style_t:
def __init__(self): ...
def init(self): ...
def set_radius(self, radius: int): ...
def set_bg_opa(self, opa: int): ...
def set_bg_color(self, color: lv_color_t): ...
def set_outline_width(self, w: int): ...
def set_outline_color(self, color: lv_color_t): ...
def set_outline_pad(self, pad: int): ...
def set_shadow_width(self, w: int): ...
def set_shadow_spread(self, s: int): ...
def set_shadow_color(self, color: lv_color_t): ...
class lv_obj:
def center(self): ...
def set_size(self, size_x: int, size_y: int): ...
def align(self, align: int, x_ofs: int, y_ofs: int): ...
def set_height(self, h: int): ...
def update_layout(self): ...
def set_width(self, w: int): ...
def add_state(self, state: int): ...
def add_event(self, event_cb: any, filter: int, user_data: pointer): ...
def add_style(self, style: style_t, selector: int): ...
def get_x(self) -> int: ...
def get_y(self) -> int: ...
def set_pos(self, x: int, y: int): ...
class indev_t:
def get_vect(self, point: point_t): ...
def obj(parent: lv_obj) -> lv_obj: ...
def indev_get_act() -> indev_t: ...
class point_t:
def __init__(self): ...
class arc(lv_obj):
MODE_NORMAL: int
MODE_SYMMETRICAL: int
MODE_REVERSE: int
def __init__(self, parent: lv_obj): ...
def set_start_angle(self, start: int): ...
def set_end_angle(self, angle: int): ...
def set_angles(self, start: int, end: int): ...
def set_bg_start_angle(self, start: int): ...
def set_bg_end_angle(self, angle: int): ...
def set_bg_angles(self, start: int, end: int): ...
def set_rotation(self, rotation: int): ...
def set_mode(self, mode: int): ...
def set_value(self, value: int): ...
def set_range(self, min: int, max: int): ...
def set_change_rate(self, rate: int): ...
def get_angle_start(self) -> int: ...
def get_angle_end(self) -> int: ...
def get_bg_angle_start(self) -> int: ...
def get_bg_angle_end(self) -> int: ...
def get_value(self) -> int: ...
def get_min_value(self) -> int: ...
def get_max_value(self) -> int: ...
def get_mode(self) -> int: ...
# def get_rotation(self) -> int: ...
class bar(lv_obj):
def __init__(self, parent: lv_obj): ...
def set_value(self, value: int, anim: int): ...
def set_start_value(self, start_value: int, anim: int): ...
def set_range(self, min: int, max: int): ...
def set_mode(self, mode: int): ...
def get_value(self) -> int: ...
def get_start_value(self) -> int: ...
def get_min_value(self) -> int: ...
def get_max_value(self) -> int: ...
def get_mode(self) -> int: ...
class btn(lv_obj):
def __init__(self, parent: lv_obj): ...
class checkbox(lv_obj):
def __init__(self, parent: lv_obj): ...
def set_text(self, txt: str): ...
def set_text_static(self, txt: str): ...
def get_text(self) -> str: ...
class dropdown(lv_obj):
def __init__(self, parent: lv_obj): ...
def set_text(self, txt: str): ...
def set_options(self, options: str): ...
def add_option(self, option: str, pos:int): ...
def clear_options(self): ...
def set_selected(self, sel_opt: int): ...
def set_dir(self, dir: int): ...
def set_symbol(self, symbol: str): ...
def set_selected_highlight(self, en: int): ...
# def get_list(self) -> lv_obj: ...
def get_text(self) -> str: ...
def get_options(self) -> str: ...
def get_selected(self) -> int: ...
def get_option_cnt(self) -> int: ...
def get_selected_str(self) -> str: ...
def get_option_index(self, option: str) -> int: ...
def get_symbol(self) -> str: ...
def get_selected_highlight(self) -> int: ...
def get_dir(self) -> int: ...
def open(self): ...
def close(self): ...
def is_open(self) -> int: ...
class label(lv_obj):
def __init__(self, parent: lv_obj): ...
def set_text(self, txt: str): ...
def set_long_mode(self, mode: int): ...
def set_recolor(self, en: int): ...
def set_style_text_align(self, value: int, selector: int): ...
class roller(lv_obj):
def __init__(self, parent: lv_obj): ...
def set_options(self, options: str, mode: int): ...
def set_visible_row_count(self, row_cnt: int): ...
class slider(lv_obj):
def __init__(self, parent: lv_obj): ...
class switch(lv_obj):
def __init__(self, parent: lv_obj): ...
class table(lv_obj):
def __init__(self, parent: lv_obj): ...
def set_cell_value(self, row: int, col: int, txt: str): ...
class textarea(lv_obj):
def __init__(self, parent: lv_obj): ...
def set_one_line(en: int): ...
def scr_act() -> lv_obj: ...
def timer_create_basic() -> lv_timer_t: ...

View File

@ -1,18 +0,0 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "../../lvgl.h"
#endif
#ifdef PIKASCRIPT
#include "pika_lvgl_indev_t.h"
void pika_lvgl_indev_t_get_vect(PikaObj* self, PikaObj* point) {
lv_indev_t* lv_indev = obj_getPtr(self, "lv_indev");
lv_point_t* lv_point = obj_getPtr(point, "lv_point");
lv_indev_get_vect(lv_indev, lv_point);
obj_setInt(point, "x", lv_point->x);
obj_setInt(point, "y", lv_point->y);
}
#endif

View File

@ -1,24 +0,0 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "../../lvgl.h"
#endif
#ifdef PIKASCRIPT
#include "pika_lvgl_lv_event.h"
int pika_lvgl_lv_event_get_code(PikaObj *self){
lv_event_t *lv_event = obj_getPtr(self, "lv_event");
return lv_event_get_code(lv_event);
}
PikaObj *New_pika_lvgl_lv_obj(Args *args);
PikaObj* pika_lvgl_lv_event_get_target(PikaObj *self){
lv_event_t *lv_event = obj_getPtr(self, "lv_event");
lv_obj_t* lv_obj = lv_event_get_target(lv_event);
PikaObj* new_obj = newNormalObj(New_pika_lvgl_lv_obj);
obj_setPtr(new_obj, "lv_obj", lv_obj);
return new_obj;
}
#endif

View File

@ -1,116 +0,0 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "../../lvgl.h"
#endif
#ifdef PIKASCRIPT
#include "pika_lvgl_lv_obj.h"
#include "BaseObj.h"
#include "dataStrs.h"
#include "pika_lvgl.h"
#include "pika_lvgl_arc.h"
#include "pika_lvgl_lv_event.h"
extern PikaObj* pika_lv_event_listener_g;
void pika_lvgl_lv_obj_center(PikaObj* self) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_center(lv_obj);
}
void pika_lvgl_lv_obj_set_size(PikaObj* self, int size_x, int size_y) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_size(lv_obj, size_x, size_y);
}
void pika_lvgl_lv_obj_align(PikaObj* self, int align, int x_ofs, int y_ofs) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_align(lv_obj, align, x_ofs, y_ofs);
}
void pika_lvgl_lv_obj_set_height(PikaObj* self, int h) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_height(lv_obj, h);
}
void pika_lvgl_lv_obj_update_layout(PikaObj* self) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_update_layout(lv_obj);
}
void pika_lvgl_lv_obj_set_width(PikaObj* self, int w) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_width(lv_obj, w);
}
void pika_lvgl_lv_obj_add_state(PikaObj* self, int state) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_add_state(lv_obj, state);
}
PikaObj* eventLisener_getHandler(PikaObj* self, uintptr_t event_id) {
Args buffs = {0};
char* event_name =
strsFormat(&buffs, PIKA_SPRINTF_BUFF_SIZE, "%d", event_id);
PikaObj* event_item = obj_getObj(self, event_name);
PikaObj* event_handler = obj_getPtr(event_item, "handler");
strsDeinit(&buffs);
return event_handler;
}
static void __pika_event_cb(lv_event_t* e) {
lv_obj_t* target = lv_event_get_target(e);
PikaObj* event_handler =
eventLisener_getHandler(pika_lv_event_listener_g, (uintptr_t)target);
PikaObj* evt = obj_getObj(event_handler, "_event_evt");
obj_setPtr(evt, "lv_event", e);
obj_run(event_handler, "_event_cb(_event_evt)");
}
void eventLicener_registerEvent(PikaObj* self,
uintptr_t event_id,
PikaObj* event_handler) {
Args buffs = {0};
char* event_name =
strsFormat(&buffs, PIKA_SPRINTF_BUFF_SIZE, "%d", event_id);
obj_newDirectObj(self, event_name, New_TinyObj);
PikaObj* event_item = obj_getObj(self, event_name);
obj_setRef(event_item, "handler", event_handler);
strsDeinit(&buffs);
}
void pika_lvgl_lv_obj_add_event_cb(PikaObj* self,
Arg* event_cb,
int filter,
void* user_data) {
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_add_event_cb(lv_obj, __pika_event_cb, filter, NULL);
obj_setArg(self, "_event_cb", event_cb);
obj_setPtr(self, "_event_user_data", user_data);
obj_newDirectObj(self, "_event_evt", New_pika_lvgl_lv_event);
eventLicener_registerEvent(pika_lv_event_listener_g, (uintptr_t)lv_obj, self);
}
void pika_lvgl_lv_obj_add_style(PikaObj *self, PikaObj* style, int selector){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_style_t* lv_style = obj_getPtr(style, "lv_style");
lv_obj_add_style(lv_obj, lv_style, selector);
}
int pika_lvgl_lv_obj_get_x(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_obj_get_x(lv_obj);
}
int pika_lvgl_lv_obj_get_y(PikaObj *self){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
return lv_obj_get_y(lv_obj);
}
void pika_lvgl_lv_obj_set_pos(PikaObj *self, int x, int y){
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
lv_obj_set_pos(lv_obj, x, y);
}
#endif

View File

@ -1,70 +0,0 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "../../lvgl.h"
#endif
#ifdef PIKASCRIPT
#include "pika_lvgl_style_t.h"
void pika_lvgl_style_t_init(PikaObj* self) {
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
lv_style_init(lv_style);
}
void pika_lvgl_style_t_set_bg_color(PikaObj* self, PikaObj* color) {
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
lv_color_t* lv_color = obj_getPtr(color, "lv_color");
lv_style_set_bg_color(lv_style, *lv_color);
}
void pika_lvgl_style_t_set_bg_opa(PikaObj* self, int opa) {
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
lv_style_set_bg_opa(lv_style, opa);
}
void pika_lvgl_style_t_set_outline_color(PikaObj* self, PikaObj* color) {
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
lv_color_t* lv_color = obj_getPtr(color, "lv_color");
lv_style_set_outline_color(lv_style, *lv_color);
}
void pika_lvgl_style_t_set_outline_pad(PikaObj* self, int pad) {
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
lv_style_set_outline_pad(lv_style, pad);
}
void pika_lvgl_style_t_set_outline_width(PikaObj* self, int w) {
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
lv_style_set_outline_width(lv_style, w);
}
void pika_lvgl_style_t_set_radius(PikaObj* self, int radius) {
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
lv_style_set_radius(lv_style, radius);
}
void pika_lvgl_style_t___init__(PikaObj* self) {
lv_style_t lv_style_stack = {0};
args_setStruct(self->list, "lv_style_struct", lv_style_stack);
lv_style_t* lv_style = args_getStruct(self->list, "lv_style_struct");
obj_setPtr(self, "lv_style", lv_style);
}
void pika_lvgl_style_t_set_shadow_color(PikaObj *self, PikaObj* color){
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
lv_color_t* lv_color = obj_getPtr(color, "lv_color");
lv_style_set_shadow_color(lv_style, *lv_color);
}
void pika_lvgl_style_t_set_shadow_spread(PikaObj *self, int s){
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
lv_style_set_shadow_spread(lv_style, s);
}
void pika_lvgl_style_t_set_shadow_width(PikaObj *self, int w){
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
lv_style_set_shadow_width(lv_style, w);
}
#endif

View File

@ -1,69 +0,0 @@
from building import *
import rtconfig
import os
src = []
inc = []
group = []
cwd = GetCurrentDir() # get current dir path
port_src = Glob('*.c')
port_inc = [cwd]
group = group + DefineGroup('LVGL-port', port_src, depend = ['PKG_USING_LVGL'], CPPPATH = port_inc)
# check if .h or .hpp files exists
def check_h_hpp_exists(path):
file_dirs = os.listdir(path)
for file_dir in file_dirs:
if os.path.splitext(file_dir)[1] in ['.h', '.hpp']:
return True
return False
lvgl_cwd = cwd + '/../../'
lvgl_src_cwd = lvgl_cwd + 'src/'
inc = inc + [lvgl_src_cwd]
for root, dirs, files in os.walk(lvgl_src_cwd):
for dir in dirs:
current_path = os.path.join(root, dir)
src = src + Glob(os.path.join(current_path,'*.c')) # add all .c files
if check_h_hpp_exists(current_path): # add .h and .hpp path
inc = inc + [current_path]
if GetDepend('PKG_LVGL_USING_EXAMPLES'):
lvgl_src_cwd = lvgl_cwd + 'examples/'
inc = inc + [lvgl_src_cwd]
for root, dirs, files in os.walk(lvgl_src_cwd):
for dir in dirs:
current_path = os.path.join(root, dir)
src = src + Glob(os.path.join(current_path,'*.c'))
if check_h_hpp_exists(current_path):
inc = inc + [current_path]
if GetDepend('PKG_LVGL_USING_DEMOS'):
lvgl_src_cwd = lvgl_cwd + 'demos/'
inc = inc + [lvgl_src_cwd]
for root, dirs, files in os.walk(lvgl_src_cwd):
for dir in dirs:
current_path = os.path.join(root, dir)
src = src + Glob(os.path.join(current_path,'*.c'))
if check_h_hpp_exists(current_path):
inc = inc + [current_path]
LOCAL_CFLAGS = ''
if rtconfig.PLATFORM == 'gcc' or rtconfig.PLATFORM == 'armclang': # GCC or Keil AC6
LOCAL_CFLAGS += ' -std=c99'
elif rtconfig.PLATFORM == 'armcc': # Keil AC5
LOCAL_CFLAGS += ' --c99 --gnu'
group = group + DefineGroup('LVGL', src, depend = ['PKG_USING_LVGL'], CPPPATH = inc, LOCAL_CFLAGS = LOCAL_CFLAGS)
list = os.listdir(cwd)
for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
group = group + SConscript(os.path.join(d, 'SConscript'))
Return('group')

View File

@ -1,76 +0,0 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: MIT
*
* Change Logs:
* Date Author Notes
* 2021-10-15 Meco Man The first version
*/
#ifndef LV_RT_THREAD_CONF_H
#define LV_RT_THREAD_CONF_H
#ifdef __RTTHREAD__
#include <lvgl.h>
#define LV_RTTHREAD_INCLUDE <rtthread.h>
#include LV_RTTHREAD_INCLUDE
/*=========================
STDLIB WRAPPER SETTINGS
*=========================*/
#ifdef RT_USING_HEAP
#define LV_USE_STDLIB_MALLOC LV_STDLIB_RTTHREAD
#endif
#define LV_USE_STDLIB_STRING LV_STDLIB_RTTHREAD
#if LV_USE_FLOAT == 0
#define LV_USE_STDLIB_SPRINTF LV_STDLIB_RTTHREAD
#endif
/*=================
* OPERATING SYSTEM
*=================*/
#define LV_USE_OS LV_OS_RTTHREAD
/*-------------
* Asserts
*-----------*/
#define LV_ASSERT_HANDLER_INCLUDE LV_RTTHREAD_INCLUDE
#define LV_ASSERT_HANDLER RT_ASSERT(0);
/*=====================
* COMPILER SETTINGS
*====================*/
#ifdef ARCH_CPU_BIG_ENDIAN
#define LV_BIG_ENDIAN_SYSTEM 1
#else
#define LV_BIG_ENDIAN_SYSTEM 0
#endif
#ifdef rt_align /* >= RT-Thread v5.0.0 */
#define LV_ATTRIBUTE_MEM_ALIGN rt_align(RT_ALIGN_SIZE)
#else
#define LV_ATTRIBUTE_MEM_ALIGN ALIGN(RT_ALIGN_SIZE)
#endif
/*==================
* EXAMPLES
*==================*/
#ifdef PKG_LVGL_USING_EXAMPLES
#define LV_BUILD_EXAMPLES 1
#endif
/*--END OF LV_RT_THREAD_CONF_H--*/
#endif /*__RTTHREAD__*/
#endif /*LV_CONF_H*/

View File

@ -1,90 +0,0 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: MIT
*
* Change Logs:
* Date Author Notes
* 2021-10-18 Meco Man the first version
* 2022-05-10 Meco Man improve rt-thread initialization process
*/
#ifdef __RTTHREAD__
#include <lvgl.h>
#include <rtthread.h>
#define DBG_TAG "LVGL"
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
#ifndef PKG_LVGL_THREAD_STACK_SIZE
#define PKG_LVGL_THREAD_STACK_SIZE 4096
#endif /* PKG_LVGL_THREAD_STACK_SIZE */
#ifndef PKG_LVGL_THREAD_PRIO
#define PKG_LVGL_THREAD_PRIO (RT_THREAD_PRIORITY_MAX*2/3)
#endif /* PKG_LVGL_THREAD_PRIO */
#ifndef PKG_LVGL_DISP_REFR_PERIOD
#define PKG_LVGL_DISP_REFR_PERIOD 33
#endif /* PKG_LVGL_DISP_REFR_PERIOD */
extern void lv_port_disp_init(void);
extern void lv_port_indev_init(void);
extern void lv_user_gui_init(void);
static struct rt_thread lvgl_thread;
#ifdef rt_align
rt_align(RT_ALIGN_SIZE)
#else
ALIGN(RT_ALIGN_SIZE)
#endif
static rt_uint8_t lvgl_thread_stack[PKG_LVGL_THREAD_STACK_SIZE];
#if LV_USE_LOG
static void lv_rt_log(const char *buf)
{
LOG_I(buf);
}
#endif /* LV_USE_LOG */
static void lvgl_thread_entry(void *parameter)
{
#if LV_USE_LOG
lv_log_register_print_cb(lv_rt_log);
#endif /* LV_USE_LOG */
lv_init();
lv_port_disp_init();
lv_port_indev_init();
lv_user_gui_init();
lv_tick_set_cb(&rt_tick_get_millisecond);
/* handle the tasks of LVGL */
while(1)
{
lv_task_handler();
rt_thread_mdelay(PKG_LVGL_DISP_REFR_PERIOD);
}
}
static int lvgl_thread_init(void)
{
rt_err_t err;
err = rt_thread_init(&lvgl_thread, "LVGL", lvgl_thread_entry, RT_NULL,
&lvgl_thread_stack[0], sizeof(lvgl_thread_stack), PKG_LVGL_THREAD_PRIO, 10);
if(err != RT_EOK)
{
LOG_E("Failed to create LVGL thread");
return -1;
}
rt_thread_startup(&lvgl_thread);
return 0;
}
INIT_ENV_EXPORT(lvgl_thread_init);
#endif /*__RTTHREAD__*/

View File

@ -1,4 +0,0 @@
This folder is for LVGL SquareLine Studio
SquareLine Studio can automatically put the generated C files into `ui` folder, so that rt-thread will automatically detect them; or, as a user, you can move the generated C files into `ui` folder manually.

View File

@ -1,25 +0,0 @@
from building import *
cwd = GetCurrentDir()
src = Glob('*.c')
inc = [cwd]
# check if .h or .hpp files exists
def check_h_hpp_exists(path):
file_dirs = os.listdir(path)
for file_dir in file_dirs:
if os.path.splitext(file_dir)[1] in ['.h', '.hpp']:
return True
return False
sls_src_cwd = cwd
for root, dirs, files in os.walk(sls_src_cwd):
for dir in dirs:
current_path = os.path.join(root, dir)
src = src + Glob(os.path.join(current_path,'*.c')) # add all .c files
if check_h_hpp_exists(current_path): # add .h and .hpp path
inc = inc + [current_path]
group = DefineGroup('LVGL-SquareLine', src, depend = ['PKG_USING_LVGL_SQUARELINE'], CPPPATH = inc)
Return('group')

View File

@ -1,19 +0,0 @@
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: MIT
*
* Change Logs:
* Date Author Notes
* 2022-05-13 Meco Man First version
*/
#ifdef __RTTHREAD__
void lv_user_gui_init(void)
{
extern void ui_init(void);
ui_init();
}
#endif /* __RTTHREAD__ */

View File

@ -1,15 +0,0 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: MIT
*
* Change Logs:
* Date Author Notes
* 2022-11-20 Meco Man The first version
*/
#ifdef __RTTHREAD__
#include "../../../../../lvgl.h" /* back to the root folder's lvgl.h */
#endif /* __RTTHREAD__ */

View File

@ -1,2 +0,0 @@
build:
cmake: .

View File

@ -1,5 +0,0 @@
description: LVGL - Light and Versatile Graphics Library
url: https://lvgl.io/
repository: https://github.com/lvgl/lvgl.git
documentation: https://docs.lvgl.io/
issues: https://github.com/lvgl/lvgl/issues

View File

@ -1,17 +0,0 @@
{
"name": "lvgl",
"version": "9.0.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": {
"type": "git",
"url": "https://github.com/lvgl/lvgl.git"
},
"build": {
"includeDir": "."
},
"license": "MIT",
"homepage": "https://lvgl.io",
"frameworks": "*",
"platforms": "*"
}

View File

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

View File

@ -1,954 +0,0 @@
/**
* @file lv_conf.h
* Configuration file for v9.0.0
*/
/*
* Copy this file as `lv_conf.h`
* 1. simply next to the `lvgl` folder
* 2. or any other places and
* - define `LV_CONF_INCLUDE_SIMPLE`
* - add the path as include path
*/
/* clang-format off */
#if 0 /*Set it to "1" to enable content*/
#ifndef LV_CONF_H
#define LV_CONF_H
/*====================
COLOR SETTINGS
*====================*/
/*Color depth: 8 (A8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888)*/
#define LV_COLOR_DEPTH 16
/*=========================
STDLIB WRAPPER SETTINGS
*=========================*/
/* Possible values
* - LV_STDLIB_BUILTIN: LVGL's built in implementation
* - LV_STDLIB_CLIB: Standard C functions, like malloc, strlen, etc
* - LV_STDLIB_MICROPYTHON: MicroPython implementation
* - LV_STDLIB_RTTHREAD: RT-Thread implementation
* - LV_STDLIB_CUSTOM: Implement the functions externally
*/
#define LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN
#define LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN
#define LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN
#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN
/*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/
#define LV_MEM_SIZE (64 * 1024U) /*[bytes]*/
/*Size of the memory expand for `lv_malloc()` in bytes*/
#define LV_MEM_POOL_EXPAND_SIZE 0
/*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/
#define LV_MEM_ADR 0 /*0: unused*/
/*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/
#if LV_MEM_ADR == 0
#undef LV_MEM_POOL_INCLUDE
#undef LV_MEM_POOL_ALLOC
#endif
#endif /*LV_USE_MALLOC == LV_STDLIB_BUILTIN*/
/*====================
HAL SETTINGS
*====================*/
/*Default display refresh, input device read and animation step period.*/
#define LV_DEF_REFR_PERIOD 33 /*[ms]*/
/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
*(Not so important, you can adjust it to modify default sizes and spaces)*/
#define LV_DPI_DEF 130 /*[px/inch]*/
/*=================
* OPERATING SYSTEM
*=================*/
/*Select an operating system to use. Possible options:
* - LV_OS_NONE
* - LV_OS_PTHREAD
* - LV_OS_FREERTOS
* - LV_OS_CMSIS_RTOS2
* - LV_OS_RTTHREAD
* - LV_OS_WINDOWS
* - LV_OS_CUSTOM */
#define LV_USE_OS LV_OS_NONE
#if LV_USE_OS == LV_OS_CUSTOM
#define LV_OS_CUSTOM_INCLUDE <stdint.h>
#endif
/*========================
* RENDERING CONFIGURATION
*========================*/
/*Align the stride of all layers and images to this bytes*/
#define LV_DRAW_BUF_STRIDE_ALIGN 1
/*Align the start address of draw_buf addresses to this bytes*/
#define LV_DRAW_BUF_ALIGN 4
#define LV_USE_DRAW_SW 1
#if LV_USE_DRAW_SW == 1
/* Set the number of draw unit.
* > 1 requires an operating system enabled in `LV_USE_OS`
* > 1 means multiply threads will render the screen in parallel */
#define LV_DRAW_SW_DRAW_UNIT_CNT 1
/* Use Arm-2D to accelerate the sw render */
#define LV_USE_DRAW_ARM2D_SYNC 0
/* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode
* it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks.
* "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers
* and can't be drawn in chunks. */
/*The target buffer size for simple layer chunks.*/
#define LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/
/* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only
* 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */
#define LV_DRAW_SW_COMPLEX 1
#if LV_DRAW_SW_COMPLEX == 1
/*Allow buffering some shadow calculation.
*LV_DRAW_SW_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius`
*Caching has LV_DRAW_SW_SHADOW_CACHE_SIZE^2 RAM cost*/
#define LV_DRAW_SW_SHADOW_CACHE_SIZE 0
/* Set number of maximally cached circle data.
* The circumference of 1/4 circle are saved for anti-aliasing
* radius * 4 bytes are used per circle (the most often used radiuses are saved)
* 0: to disable caching */
#define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4
#endif
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM
#define LV_DRAW_SW_ASM_CUSTOM_INCLUDE ""
#endif
#endif
/* Use NXP's VG-Lite GPU on iMX RTxxx platforms. */
#define LV_USE_DRAW_VGLITE 0
#if LV_USE_DRAW_VGLITE
/* Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels. */
#define LV_USE_VGLITE_BLIT_SPLIT 0
#if LV_USE_OS
/* Enable VGLite draw async. Queue multiple tasks and flash them once to the GPU. */
#define LV_USE_VGLITE_DRAW_ASYNC 1
#endif
/* Enable VGLite asserts. */
#define LV_USE_VGLITE_ASSERT 0
#endif
/* Use NXP's PXP on iMX RTxxx platforms. */
#define LV_USE_DRAW_PXP 0
#if LV_USE_DRAW_PXP
/* Enable PXP asserts. */
#define LV_USE_PXP_ASSERT 0
#endif
/* Use Renesas Dave2D on RA platforms. */
#define LV_USE_DRAW_DAVE2D 0
/* Draw using cached SDL textures*/
#define LV_USE_DRAW_SDL 0
/* Use VG-Lite GPU. */
#define LV_USE_DRAW_VG_LITE 0
#if LV_USE_DRAW_VG_LITE
/* Enable VG-Lite custom external 'gpu_init()' function */
#define LV_VG_LITE_USE_GPU_INIT 0
/* Enable VG-Lite assert. */
#define LV_VG_LITE_USE_ASSERT 0
#endif
/*=======================
* FEATURE CONFIGURATION
*=======================*/
/*-------------
* Logging
*-----------*/
/*Enable the log module*/
#define LV_USE_LOG 0
#if LV_USE_LOG
/*How important log should be added:
*LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
*LV_LOG_LEVEL_INFO Log important events
*LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
*LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
*LV_LOG_LEVEL_USER Only logs added by the user
*LV_LOG_LEVEL_NONE Do not log anything*/
#define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
/*1: Print the log with 'printf';
*0: User need to register a callback with `lv_log_register_print_cb()`*/
#define LV_LOG_PRINTF 0
/*1: Enable print timestamp;
*0: Disable print timestamp*/
#define LV_LOG_USE_TIMESTAMP 1
/*1: Print file and line number of the log;
*0: Do not print file and line number of the log*/
#define LV_LOG_USE_FILE_LINE 1
/*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/
#define LV_LOG_TRACE_MEM 1
#define LV_LOG_TRACE_TIMER 1
#define LV_LOG_TRACE_INDEV 1
#define LV_LOG_TRACE_DISP_REFR 1
#define LV_LOG_TRACE_EVENT 1
#define LV_LOG_TRACE_OBJ_CREATE 1
#define LV_LOG_TRACE_LAYOUT 1
#define LV_LOG_TRACE_ANIM 1
#define LV_LOG_TRACE_CACHE 1
#endif /*LV_USE_LOG*/
/*-------------
* Asserts
*-----------*/
/*Enable asserts if an operation is failed or an invalid data is found.
*If LV_USE_LOG is enabled an error message will be printed on failure*/
#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/
#define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/
#define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/
#define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/
#define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/
/*Add a custom handler when assert happens e.g. to restart the MCU*/
#define LV_ASSERT_HANDLER_INCLUDE <stdint.h>
#define LV_ASSERT_HANDLER while(1); /*Halt by default*/
/*-------------
* Debug
*-----------*/
/*1: Draw random colored rectangles over the redrawn areas*/
#define LV_USE_REFR_DEBUG 0
/*1: Draw a red overlay for ARGB layers and a green overlay for RGB layers*/
#define LV_USE_LAYER_DEBUG 0
/*1: Draw overlays with different colors for each draw_unit's tasks.
*Also add the index number of the draw unit on white background.
*For layers add the index number of the draw unit on black background.*/
#define LV_USE_PARALLEL_DRAW_DEBUG 0
/*-------------
* Others
*-----------*/
#define LV_ENABLE_GLOBAL_CUSTOM 0
#if LV_ENABLE_GLOBAL_CUSTOM
/*Header to include for the custom 'lv_global' function"*/
#define LV_GLOBAL_CUSTOM_INCLUDE <stdint.h>
#endif
/*Default cache size in bytes.
*Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory.
*If size is not set to 0, the decoder will fail to decode when the cache is full.
*If size is 0, the cache function is not enabled and the decoded mem will be released immediately after use.*/
#define LV_CACHE_DEF_SIZE 0
/*Default number of image header cache entries. The cache is used to store the headers of images
*The main logic is like `LV_CACHE_DEF_SIZE` but for image headers.*/
#define LV_IMAGE_HEADER_CACHE_DEF_CNT 0
/*Number of stops allowed per gradient. Increase this to allow more stops.
*This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/
#define LV_GRADIENT_MAX_STOPS 2
/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently.
* 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */
#define LV_COLOR_MIX_ROUND_OFS 0
/* Add 2 x 32 bit variables to each lv_obj_t to speed up getting style properties */
#define LV_OBJ_STYLE_CACHE 0
/* Add `id` field to `lv_obj_t` */
#define LV_USE_OBJ_ID 0
/* Use lvgl builtin method for obj ID */
#define LV_USE_OBJ_ID_BUILTIN 0
/*Use obj property set/get API*/
#define LV_USE_OBJ_PROPERTY 0
/* VG-Lite Simulator */
/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */
#define LV_USE_VG_LITE_THORVG 0
#if LV_USE_VG_LITE_THORVG
/*Enable LVGL's blend mode support*/
#define LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT 0
/*Enable YUV color format support*/
#define LV_VG_LITE_THORVG_YUV_SUPPORT 0
/*Enable 16 pixels alignment*/
#define LV_VG_LITE_THORVG_16PIXELS_ALIGN 1
/*Enable multi-thread render*/
#define LV_VG_LITE_THORVG_THREAD_RENDER 0
#endif
/*=====================
* COMPILER SETTINGS
*====================*/
/*For big endian systems set to 1*/
#define LV_BIG_ENDIAN_SYSTEM 0
/*Define a custom attribute to `lv_tick_inc` function*/
#define LV_ATTRIBUTE_TICK_INC
/*Define a custom attribute to `lv_timer_handler` function*/
#define LV_ATTRIBUTE_TIMER_HANDLER
/*Define a custom attribute to `lv_display_flush_ready` function*/
#define LV_ATTRIBUTE_FLUSH_READY
/*Required alignment size for buffers*/
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1
/*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default).
* E.g. __attribute__((aligned(4)))*/
#define LV_ATTRIBUTE_MEM_ALIGN
/*Attribute to mark large constant arrays for example font's bitmaps*/
#define LV_ATTRIBUTE_LARGE_CONST
/*Compiler prefix for a big array declaration in RAM*/
#define LV_ATTRIBUTE_LARGE_RAM_ARRAY
/*Place performance critical functions into a faster memory (e.g RAM)*/
#define LV_ATTRIBUTE_FAST_MEM
/*Export integer constant to binding. This macro is used with constants in the form of LV_<CONST> that
*should also appear on LVGL binding API such as Micropython.*/
#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/
/*Prefix all global extern data with this*/
#define LV_ATTRIBUTE_EXTERN_DATA
/* Use `float` as `lv_value_precise_t` */
#define LV_USE_FLOAT 0
/*==================
* FONT USAGE
*===================*/
/*Montserrat fonts with ASCII range and some symbols using bpp = 4
*https://fonts.google.com/specimen/Montserrat*/
#define LV_FONT_MONTSERRAT_8 0
#define LV_FONT_MONTSERRAT_10 0
#define LV_FONT_MONTSERRAT_12 0
#define LV_FONT_MONTSERRAT_14 1
#define LV_FONT_MONTSERRAT_16 0
#define LV_FONT_MONTSERRAT_18 0
#define LV_FONT_MONTSERRAT_20 0
#define LV_FONT_MONTSERRAT_22 0
#define LV_FONT_MONTSERRAT_24 0
#define LV_FONT_MONTSERRAT_26 0
#define LV_FONT_MONTSERRAT_28 0
#define LV_FONT_MONTSERRAT_30 0
#define LV_FONT_MONTSERRAT_32 0
#define LV_FONT_MONTSERRAT_34 0
#define LV_FONT_MONTSERRAT_36 0
#define LV_FONT_MONTSERRAT_38 0
#define LV_FONT_MONTSERRAT_40 0
#define LV_FONT_MONTSERRAT_42 0
#define LV_FONT_MONTSERRAT_44 0
#define LV_FONT_MONTSERRAT_46 0
#define LV_FONT_MONTSERRAT_48 0
/*Demonstrate special features*/
#define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/
#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/
#define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/
/*Pixel perfect monospace fonts*/
#define LV_FONT_UNSCII_8 0
#define LV_FONT_UNSCII_16 0
/*Optionally declare custom fonts here.
*You can use these fonts as default font too and they will be available globally.
*E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/
#define LV_FONT_CUSTOM_DECLARE
/*Always set a default font*/
#define LV_FONT_DEFAULT &lv_font_montserrat_14
/*Enable handling large font and/or fonts with a lot of characters.
*The limit depends on the font size, font face and bpp.
*Compiler error will be triggered if a font needs it.*/
#define LV_FONT_FMT_TXT_LARGE 0
/*Enables/disables support for compressed fonts.*/
#define LV_USE_FONT_COMPRESSED 0
/*Enable drawing placeholders when glyph dsc is not found*/
#define LV_USE_FONT_PLACEHOLDER 1
/*=================
* TEXT SETTINGS
*=================*/
/**
* Select a character encoding for strings.
* Your IDE or editor should have the same character encoding
* - LV_TXT_ENC_UTF8
* - LV_TXT_ENC_ASCII
*/
#define LV_TXT_ENC LV_TXT_ENC_UTF8
/*Can break (wrap) texts on these chars*/
#define LV_TXT_BREAK_CHARS " ,.;:-_)]}"
/*If a word is at least this long, will break wherever "prettiest"
*To disable, set to a value <= 0*/
#define LV_TXT_LINE_BREAK_LONG_LEN 0
/*Minimum number of characters in a long word to put on a line before a break.
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3
/*Minimum number of characters in a long word to put on a line after a break.
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3
/*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts.
*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
/*Set the default direction. Supported values:
*`LV_BASE_DIR_LTR` Left-to-Right
*`LV_BASE_DIR_RTL` Right-to-Left
*`LV_BASE_DIR_AUTO` detect texts base direction*/
#define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO
#endif
/*Enable Arabic/Persian processing
*In these languages characters should be replaced with an other form based on their position in the text*/
#define LV_USE_ARABIC_PERSIAN_CHARS 0
/*==================
* WIDGETS
*================*/
/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/
#define LV_WIDGETS_HAS_DEFAULT_VALUE 1
#define LV_USE_ANIMIMG 1
#define LV_USE_ARC 1
#define LV_USE_BAR 1
#define LV_USE_BUTTON 1
#define LV_USE_BUTTONMATRIX 1
#define LV_USE_CALENDAR 1
#if LV_USE_CALENDAR
#define LV_CALENDAR_WEEK_STARTS_MONDAY 0
#if LV_CALENDAR_WEEK_STARTS_MONDAY
#define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"}
#else
#define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"}
#endif
#define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
#define LV_USE_CALENDAR_HEADER_ARROW 1
#define LV_USE_CALENDAR_HEADER_DROPDOWN 1
#endif /*LV_USE_CALENDAR*/
#define LV_USE_CANVAS 1
#define LV_USE_CHART 1
#define LV_USE_CHECKBOX 1
#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/
#define LV_USE_IMAGE 1 /*Requires: lv_label*/
#define LV_USE_IMAGEBUTTON 1
#define LV_USE_KEYBOARD 1
#define LV_USE_LABEL 1
#if LV_USE_LABEL
#define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/
#define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/
#define LV_LABEL_WAIT_CHAR_COUNT 3 /*The count of wait chart*/
#endif
#define LV_USE_LED 1
#define LV_USE_LINE 1
#define LV_USE_LIST 1
#define LV_USE_MENU 1
#define LV_USE_MSGBOX 1
#define LV_USE_ROLLER 1 /*Requires: lv_label*/
#define LV_USE_SCALE 1
#define LV_USE_SLIDER 1 /*Requires: lv_bar*/
#define LV_USE_SPAN 1
#if LV_USE_SPAN
/*A line text can contain maximum num of span descriptor */
#define LV_SPAN_SNIPPET_STACK_SIZE 64
#endif
#define LV_USE_SPINBOX 1
#define LV_USE_SPINNER 1
#define LV_USE_SWITCH 1
#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/
#if LV_USE_TEXTAREA != 0
#define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/
#endif
#define LV_USE_TABLE 1
#define LV_USE_TABVIEW 1
#define LV_USE_TILEVIEW 1
#define LV_USE_WIN 1
/*==================
* THEMES
*==================*/
/*A simple, impressive and very complete theme*/
#define LV_USE_THEME_DEFAULT 1
#if LV_USE_THEME_DEFAULT
/*0: Light mode; 1: Dark mode*/
#define LV_THEME_DEFAULT_DARK 0
/*1: Enable grow on press*/
#define LV_THEME_DEFAULT_GROW 1
/*Default transition time in [ms]*/
#define LV_THEME_DEFAULT_TRANSITION_TIME 80
#endif /*LV_USE_THEME_DEFAULT*/
/*A very simple theme that is a good starting point for a custom theme*/
#define LV_USE_THEME_SIMPLE 1
/*A theme designed for monochrome displays*/
#define LV_USE_THEME_MONO 1
/*==================
* LAYOUTS
*==================*/
/*A layout similar to Flexbox in CSS.*/
#define LV_USE_FLEX 1
/*A layout similar to Grid in CSS.*/
#define LV_USE_GRID 1
/*====================
* 3RD PARTS LIBRARIES
*====================*/
/*File system interfaces for common APIs */
/*API for fopen, fread, etc*/
#define LV_USE_FS_STDIO 0
#if LV_USE_FS_STDIO
#define LV_FS_STDIO_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
#define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for open, read, etc*/
#define LV_USE_FS_POSIX 0
#if LV_USE_FS_POSIX
#define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
#define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for CreateFile, ReadFile, etc*/
#define LV_USE_FS_WIN32 0
#if LV_USE_FS_WIN32
#define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
#define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/
#define LV_USE_FS_FATFS 0
#if LV_USE_FS_FATFS
#define LV_FS_FATFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for memory-mapped file access. */
#define LV_USE_FS_MEMFS 0
#if LV_USE_FS_MEMFS
#define LV_FS_MEMFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#endif
/*LODEPNG decoder library*/
#define LV_USE_LODEPNG 0
/*PNG decoder(libpng) library*/
#define LV_USE_LIBPNG 0
/*BMP decoder library*/
#define LV_USE_BMP 0
/* JPG + split JPG decoder library.
* Split JPG is a custom format optimized for embedded systems. */
#define LV_USE_TJPGD 0
/* libjpeg-turbo decoder library.
* Supports complete JPEG specifications and high-performance JPEG decoding. */
#define LV_USE_LIBJPEG_TURBO 0
/*GIF decoder library*/
#define LV_USE_GIF 0
#if LV_USE_GIF
/*GIF decoder accelerate*/
#define LV_GIF_CACHE_DECODE_DATA 0
#endif
/*Decode bin images to RAM*/
#define LV_BIN_DECODER_RAM_LOAD 0
/*RLE decompress library*/
#define LV_USE_RLE 0
/*QR code library*/
#define LV_USE_QRCODE 0
/*Barcode code library*/
#define LV_USE_BARCODE 0
/*FreeType library*/
#define LV_USE_FREETYPE 0
#if LV_USE_FREETYPE
/*Memory used by FreeType to cache characters in kilobytes*/
#define LV_FREETYPE_CACHE_SIZE 768
/*Let FreeType to use LVGL memory and file porting*/
#define LV_FREETYPE_USE_LVGL_PORT 0
/* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */
/* (0:use system defaults) */
#define LV_FREETYPE_CACHE_FT_FACES 8
#define LV_FREETYPE_CACHE_FT_SIZES 8
#define LV_FREETYPE_CACHE_FT_GLYPH_CNT 256
#endif
/* Built-in TTF decoder */
#define LV_USE_TINY_TTF 0
#if LV_USE_TINY_TTF
/* Enable loading TTF data from files */
#define LV_TINY_TTF_FILE_SUPPORT 0
#endif
/*Rlottie library*/
#define LV_USE_RLOTTIE 0
/*Enable Vector Graphic APIs*/
#define LV_USE_VECTOR_GRAPHIC 0
/* Enable ThorVG (vector graphics library) from the src/libs folder */
#define LV_USE_THORVG_INTERNAL 0
/* Enable ThorVG by assuming that its installed and linked to the project */
#define LV_USE_THORVG_EXTERNAL 0
/*Enable LZ4 compress/decompress lib*/
#define LV_USE_LZ4 0
/*Use lvgl built-in LZ4 lib*/
#define LV_USE_LZ4_INTERNAL 0
/*Use external LZ4 library*/
#define LV_USE_LZ4_EXTERNAL 0
/*FFmpeg library for image decoding and playing videos
*Supports all major image formats so do not enable other image decoder with it*/
#define LV_USE_FFMPEG 0
#if LV_USE_FFMPEG
/*Dump input information to stderr*/
#define LV_FFMPEG_DUMP_FORMAT 0
#endif
/*==================
* OTHERS
*==================*/
/*1: Enable API to take snapshot for object*/
#define LV_USE_SNAPSHOT 0
/*1: Enable system monitor component*/
#define LV_USE_SYSMON 0
#if LV_USE_SYSMON
/*Get the idle percentage. E.g. uint32_t my_get_idle(void);*/
#define LV_SYSMON_GET_IDLE lv_timer_get_idle
/*1: Show CPU usage and FPS count
* Requires `LV_USE_SYSMON = 1`*/
#define LV_USE_PERF_MONITOR 0
#if LV_USE_PERF_MONITOR
#define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
/*0: Displays performance data on the screen, 1: Prints performance data using log.*/
#define LV_USE_PERF_MONITOR_LOG_MODE 0
#endif
/*1: Show the used memory and the memory fragmentation
* Requires `LV_USE_BUILTIN_MALLOC = 1`
* Requires `LV_USE_SYSMON = 1`*/
#define LV_USE_MEM_MONITOR 0
#if LV_USE_MEM_MONITOR
#define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
#endif
#endif /*LV_USE_SYSMON*/
/*1: Enable the runtime performance profiler*/
#define LV_USE_PROFILER 0
#if LV_USE_PROFILER
/*1: Enable the built-in profiler*/
#define LV_USE_PROFILER_BUILTIN 1
#if LV_USE_PROFILER_BUILTIN
/*Default profiler trace buffer size*/
#define LV_PROFILER_BUILTIN_BUF_SIZE (16 * 1024) /*[bytes]*/
#endif
/*Header to include for the profiler*/
#define LV_PROFILER_INCLUDE "lvgl/src/misc/lv_profiler_builtin.h"
/*Profiler start point function*/
#define LV_PROFILER_BEGIN LV_PROFILER_BUILTIN_BEGIN
/*Profiler end point function*/
#define LV_PROFILER_END LV_PROFILER_BUILTIN_END
/*Profiler start point function with custom tag*/
#define LV_PROFILER_BEGIN_TAG LV_PROFILER_BUILTIN_BEGIN_TAG
/*Profiler end point function with custom tag*/
#define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG
#endif
/*1: Enable Monkey test*/
#define LV_USE_MONKEY 0
/*1: Enable grid navigation*/
#define LV_USE_GRIDNAV 0
/*1: Enable lv_obj fragment*/
#define LV_USE_FRAGMENT 0
/*1: Support using images as font in label or span widgets */
#define LV_USE_IMGFONT 0
/*1: Enable an observer pattern implementation*/
#define LV_USE_OBSERVER 1
/*1: Enable Pinyin input method*/
/*Requires: lv_keyboard*/
#define LV_USE_IME_PINYIN 0
#if LV_USE_IME_PINYIN
/*1: Use default thesaurus*/
/*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesauruss*/
#define LV_IME_PINYIN_USE_DEFAULT_DICT 1
/*Set the maximum number of candidate panels that can be displayed*/
/*This needs to be adjusted according to the size of the screen*/
#define LV_IME_PINYIN_CAND_TEXT_NUM 6
/*Use 9 key input(k9)*/
#define LV_IME_PINYIN_USE_K9_MODE 1
#if LV_IME_PINYIN_USE_K9_MODE == 1
#define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3
#endif /*LV_IME_PINYIN_USE_K9_MODE*/
#endif
/*1: Enable file explorer*/
/*Requires: lv_table*/
#define LV_USE_FILE_EXPLORER 0
#if LV_USE_FILE_EXPLORER
/*Maximum length of path*/
#define LV_FILE_EXPLORER_PATH_MAX_LEN (128)
/*Quick access bar, 1:use, 0:not use*/
/*Requires: lv_list*/
#define LV_FILE_EXPLORER_QUICK_ACCESS 1
#endif
/*==================
* DEVICES
*==================*/
/*Use SDL to open window on PC and handle mouse and keyboard*/
#define LV_USE_SDL 0
#if LV_USE_SDL
#define LV_SDL_INCLUDE_PATH <SDL2/SDL.h>
#define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /*LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance*/
#define LV_SDL_BUF_COUNT 1 /*1 or 2*/
#define LV_SDL_FULLSCREEN 0 /*1: Make the window full screen by default*/
#define LV_SDL_DIRECT_EXIT 1 /*1: Exit the application when all SDL windows are closed*/
#endif
/*Use X11 to open window on Linux desktop and handle mouse and keyboard*/
#define LV_USE_X11 0
#if LV_USE_X11
#define LV_X11_DIRECT_EXIT 1 /*Exit the application when all X11 windows have been closed*/
#define LV_X11_DOUBLE_BUFFER 1 /*Use double buffers for endering*/
/*select only 1 of the following render modes (LV_X11_RENDER_MODE_PARTIAL preferred!)*/
#define LV_X11_RENDER_MODE_PARTIAL 1 /*Partial render mode (preferred)*/
#define LV_X11_RENDER_MODE_DIRECT 0 /*direct render mode*/
#define LV_X11_RENDER_MODE_FULL 0 /*Full render mode*/
#endif
/*Driver for /dev/fb*/
#define LV_USE_LINUX_FBDEV 0
#if LV_USE_LINUX_FBDEV
#define LV_LINUX_FBDEV_BSD 0
#define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL
#define LV_LINUX_FBDEV_BUFFER_COUNT 0
#define LV_LINUX_FBDEV_BUFFER_SIZE 60
#endif
/*Use Nuttx to open window and handle touchscreen*/
#define LV_USE_NUTTX 0
#if LV_USE_NUTTX
#define LV_USE_NUTTX_LIBUV 0
/*Use Nuttx custom init API to open window and handle touchscreen*/
#define LV_USE_NUTTX_CUSTOM_INIT 0
/*Driver for /dev/lcd*/
#define LV_USE_NUTTX_LCD 0
#if LV_USE_NUTTX_LCD
#define LV_NUTTX_LCD_BUFFER_COUNT 0
#define LV_NUTTX_LCD_BUFFER_SIZE 60
#endif
/*Driver for /dev/input*/
#define LV_USE_NUTTX_TOUCHSCREEN 0
#endif
/*Driver for /dev/dri/card*/
#define LV_USE_LINUX_DRM 0
/*Interface for TFT_eSPI*/
#define LV_USE_TFT_ESPI 0
/*Driver for evdev input devices*/
#define LV_USE_EVDEV 0
/*Drivers for LCD devices connected via SPI/parallel port*/
#define LV_USE_ST7735 0
#define LV_USE_ST7789 0
#define LV_USE_ST7796 0
#define LV_USE_ILI9341 0
#define LV_USE_GENERIC_MIPI (LV_USE_ST7735 | LV_USE_ST7789 | LV_USE_ST7796 | LV_USE_ILI9341)
/* LVGL Windows backend */
#define LV_USE_WINDOWS 0
/*==================
* EXAMPLES
*==================*/
/*Enable the examples to be built with the library*/
#define LV_BUILD_EXAMPLES 1
/*===================
* DEMO USAGE
====================*/
/*Show some widget. It might be required to increase `LV_MEM_SIZE` */
#define LV_USE_DEMO_WIDGETS 0
#if LV_USE_DEMO_WIDGETS
#define LV_DEMO_WIDGETS_SLIDESHOW 0
#endif
/*Demonstrate the usage of encoder and keyboard*/
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
/*Benchmark your system*/
#define LV_USE_DEMO_BENCHMARK 0
/*Render test for each primitives. Requires at least 480x272 display*/
#define LV_USE_DEMO_RENDER 0
/*Stress test for LVGL*/
#define LV_USE_DEMO_STRESS 0
/*Music player demo*/
#define LV_USE_DEMO_MUSIC 0
#if LV_USE_DEMO_MUSIC
#define LV_DEMO_MUSIC_SQUARE 0
#define LV_DEMO_MUSIC_LANDSCAPE 0
#define LV_DEMO_MUSIC_ROUND 0
#define LV_DEMO_MUSIC_LARGE 0
#define LV_DEMO_MUSIC_AUTO_PLAY 0
#endif
/*Flex layout demo*/
#define LV_USE_DEMO_FLEX_LAYOUT 0
/*Smart-phone like multi-language demo*/
#define LV_USE_DEMO_MULTILANG 0
/*Widget transformation demo*/
#define LV_USE_DEMO_TRANSFORM 0
/*Demonstrate scroll settings*/
#define LV_USE_DEMO_SCROLL 0
/*Vector graphic demo*/
#define LV_USE_DEMO_VECTOR_GRAPHIC 0
/*--END OF LV_CONF_H--*/
#endif /*LV_CONF_H*/
#endif /*End of "Content enable"*/

View File

@ -1,188 +0,0 @@
/**
* @file lvgl.h
* Include all LVGL related headers
*/
#ifndef LVGL_H
#define LVGL_H
#ifdef __cplusplus
extern "C" {
#endif
/***************************
* CURRENT VERSION OF LVGL
***************************/
#define LVGL_VERSION_MAJOR 9
#define LVGL_VERSION_MINOR 0
#define LVGL_VERSION_PATCH 0
#define LVGL_VERSION_INFO ""
/*********************
* INCLUDES
*********************/
#include "src/lv_init.h"
#include "src/stdlib/lv_mem.h"
#include "src/stdlib/lv_string.h"
#include "src/stdlib/lv_sprintf.h"
#include "src/misc/lv_log.h"
#include "src/misc/lv_timer.h"
#include "src/misc/lv_math.h"
#include "src/misc/lv_array.h"
#include "src/misc/lv_async.h"
#include "src/misc/lv_anim_timeline.h"
#include "src/misc/lv_profiler_builtin.h"
#include "src/misc/lv_rb.h"
#include "src/tick/lv_tick.h"
#include "src/core/lv_obj.h"
#include "src/core/lv_group.h"
#include "src/indev/lv_indev.h"
#include "src/core/lv_refr.h"
#include "src/display/lv_display.h"
#include "src/font/lv_font.h"
#include "src/font/lv_binfont_loader.h"
#include "src/font/lv_font_fmt_txt.h"
#include "src/widgets/animimage/lv_animimage.h"
#include "src/widgets/arc/lv_arc.h"
#include "src/widgets/bar/lv_bar.h"
#include "src/widgets/button/lv_button.h"
#include "src/widgets/buttonmatrix/lv_buttonmatrix.h"
#include "src/widgets/calendar/lv_calendar.h"
#include "src/widgets/canvas/lv_canvas.h"
#include "src/widgets/chart/lv_chart.h"
#include "src/widgets/checkbox/lv_checkbox.h"
#include "src/widgets/dropdown/lv_dropdown.h"
#include "src/widgets/image/lv_image.h"
#include "src/widgets/imagebutton/lv_imagebutton.h"
#include "src/widgets/keyboard/lv_keyboard.h"
#include "src/widgets/label/lv_label.h"
#include "src/widgets/led/lv_led.h"
#include "src/widgets/line/lv_line.h"
#include "src/widgets/list/lv_list.h"
#include "src/widgets/menu/lv_menu.h"
#include "src/widgets/msgbox/lv_msgbox.h"
#include "src/widgets/roller/lv_roller.h"
#include "src/widgets/scale/lv_scale.h"
#include "src/widgets/slider/lv_slider.h"
#include "src/widgets/span/lv_span.h"
#include "src/widgets/spinbox/lv_spinbox.h"
#include "src/widgets/spinner/lv_spinner.h"
#include "src/widgets/switch/lv_switch.h"
#include "src/widgets/table/lv_table.h"
#include "src/widgets/tabview/lv_tabview.h"
#include "src/widgets/textarea/lv_textarea.h"
#include "src/widgets/tileview/lv_tileview.h"
#include "src/widgets/win/lv_win.h"
#include "src/others/snapshot/lv_snapshot.h"
#include "src/others/sysmon/lv_sysmon.h"
#include "src/others/monkey/lv_monkey.h"
#include "src/others/gridnav/lv_gridnav.h"
#include "src/others/fragment/lv_fragment.h"
#include "src/others/imgfont/lv_imgfont.h"
#include "src/others/observer/lv_observer.h"
#include "src/others/ime/lv_ime_pinyin.h"
#include "src/others/file_explorer/lv_file_explorer.h"
#include "src/libs/barcode/lv_barcode.h"
#include "src/libs/bin_decoder/lv_bin_decoder.h"
#include "src/libs/bmp/lv_bmp.h"
#include "src/libs/rle/lv_rle.h"
#include "src/libs/fsdrv/lv_fsdrv.h"
#include "src/libs/lodepng/lv_lodepng.h"
#include "src/libs/libpng/lv_libpng.h"
#include "src/libs/gif/lv_gif.h"
#include "src/libs/qrcode/lv_qrcode.h"
#include "src/libs/tjpgd/lv_tjpgd.h"
#include "src/libs/libjpeg_turbo/lv_libjpeg_turbo.h"
#include "src/libs/freetype/lv_freetype.h"
#include "src/libs/rlottie/lv_rlottie.h"
#include "src/libs/ffmpeg/lv_ffmpeg.h"
#include "src/libs/tiny_ttf/lv_tiny_ttf.h"
#include "src/layouts/lv_layout.h"
#include "src/draw/lv_draw.h"
#include "src/draw/lv_draw_vector.h"
#include "src/themes/lv_theme.h"
#include "src/drivers/lv_drivers.h"
#include "src/lv_api_map.h"
#include "src/core/lv_global.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
/**********************
* MACROS
**********************/
/** Gives 1 if the x.y.z version is supported in the current version
* Usage:
*
* - Require v6
* #if LV_VERSION_CHECK(6,0,0)
* new_func_in_v6();
* #endif
*
*
* - Require at least v5.3
* #if LV_VERSION_CHECK(5,3,0)
* new_feature_from_v5_3();
* #endif
*
*
* - Require v5.3.2 bugfixes
* #if LV_VERSION_CHECK(5,3,2)
* bugfix_in_v5_3_2();
* #endif
*
*/
#define LV_VERSION_CHECK(x,y,z) (x == LVGL_VERSION_MAJOR && (y < LVGL_VERSION_MINOR || (y == LVGL_VERSION_MINOR && z <= LVGL_VERSION_PATCH)))
/**
* Wrapper functions for VERSION macros
*/
static inline int lv_version_major(void)
{
return LVGL_VERSION_MAJOR;
}
static inline int lv_version_minor(void)
{
return LVGL_VERSION_MINOR;
}
static inline int lv_version_patch(void)
{
return LVGL_VERSION_PATCH;
}
static inline const char * lv_version_info(void)
{
return LVGL_VERSION_INFO;
}
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*LVGL_H*/

View File

@ -1,12 +0,0 @@
LVGL_PATH ?= ${shell pwd}/lvgl
ASRCS += $(shell find $(LVGL_PATH)/src -type f -name '*.S')
CSRCS += $(shell find $(LVGL_PATH)/src -type f -name '*.c')
CSRCS += $(shell find $(LVGL_PATH)/demos -type f -name '*.c')
CSRCS += $(shell find $(LVGL_PATH)/examples -type f -name '*.c')
CXXEXT := .cpp
CXXSRCS += $(shell find $(LVGL_PATH)/src/libs/thorvg -type f -name '*${CXXEXT}')
AFLAGS += "-I$(LVGL_PATH)"
CFLAGS += "-I$(LVGL_PATH)"
CXXFLAGS += "-I$(LVGL_PATH)"

View File

@ -1,10 +0,0 @@
prefix="@CMAKE_INSTALL_PREFIX@"
includedir="${prefix}/@INC_INSTALL_DIR@"
libdir=${prefix}/lib
Name: lvgl
Description: Light and Versatile Graphics Library
URL: https://lvgl.io/
Version: 9.0.0
Cflags: -I${includedir}
Libs: -L${libdir} -llvgl

View File

@ -1 +0,0 @@
CHANGELOG_LAST.md

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +0,0 @@
#!/bin/bash
set -e
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
CURRENT_REF="$(git rev-parse HEAD)"
rm -rf emscripten_builder
git clone https://github.com/lvgl/lv_sim_emscripten.git emscripten_builder
scripts/genexamplelist.sh > emscripten_builder/examplelist.c
cd emscripten_builder
git submodule update --init -- lvgl
cd lvgl
git checkout $CURRENT_REF
cd ..
mkdir cmbuild
cd cmbuild
emcmake cmake .. -DLVGL_CHOSEN_DEMO=lv_example_noop -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
emmake make -j$(nproc)
rm -rf CMakeFiles
cd ../..
cp -a emscripten_builder/cmbuild docs/_static/built_lv_examples

View File

@ -1,62 +0,0 @@
#!/usr/bin/env python3
import argparse
from argparse import RawTextHelpFormatter
import os
import sys
parser = argparse.ArgumentParser(description="""Create fonts for LVGL including the built-in symbols. lv_font_conv needs to be installed. See https://github.com/lvgl/lv_font_conv
Example: python built_in_font_gen.py --size 16 -o lv_font_roboto_16.c --bpp 4 -r 0x20-0x7F""", formatter_class=RawTextHelpFormatter)
parser.add_argument('-s', '--size',
type=int,
metavar = 'px',
nargs='?',
help='Size of the font in px')
parser.add_argument('--bpp',
type=int,
metavar = '1,2,4',
nargs='?',
help='Bit per pixel')
parser.add_argument('-r', '--range',
nargs='+',
metavar = 'start-end',
default=['0x20-0x7F,0xB0,0x2022'],
help='Ranges and/or characters to include. Default is 0x20-7F (ASCII). E.g. -r 0x20-0x7F, 0x200, 324')
parser.add_argument('--symbols',
nargs='+',
metavar = 'sym',
default=[''],
help=u'Symbols to include. E.g. -s ÁÉŐ'.encode('utf-8'))
parser.add_argument('--font',
metavar = 'file',
nargs='?',
default='Montserrat-Medium.ttf',
help='A TTF or WOFF file')
parser.add_argument('-o', '--output',
nargs='?',
metavar='file',
help='Output file name. E.g. my_font_20.c')
parser.add_argument('--compressed', action='store_true',
help='Compress the bitmaps')
parser.add_argument('--subpx', action='store_true',
help='3 times wider letters for sub pixel rendering')
args = parser.parse_args()
if args.compressed == False:
compr = "--no-compress --no-prefilter"
else:
compr = ""
if len(args.symbols[0]) != 0:
args.symbols[0] = "--symbols " + args.symbols[0]
subpx = ""
if args.subpx: subpx = "--lcd"
#Built in symbols
syms = "61441,61448,61451,61452,61452,61453,61457,61459,61461,61465,61468,61473,61478,61479,61480,61502,61507,61512,61515,61516,61517,61521,61522,61523,61524,61543,61544,61550,61552,61553,61556,61559,61560,61561,61563,61587,61589,61636,61637,61639,61641,61664,61671,61674,61683,61724,61732,61787,61931,62016,62017,62018,62019,62020,62087,62099,62212,62189,62810,63426,63650"
#Run the command (Add degree and bullet symbol)
cmd = "lv_font_conv {} {} --bpp {} --size {} --font {} -r {} {} --font FontAwesome5-Solid+Brands+Regular.woff -r {} --format lvgl -o {} --force-fast-kern-format".format(subpx, compr, args.bpp, args.size, args.font, args.range[0], args.symbols[0], syms, args.output)
os.system(cmd)

View File

@ -1,88 +0,0 @@
#!/usr/bin/env python3
import os
print("Generating 8 px")
os.system("./built_in_font_gen.py --size 8 -o lv_font_montserrat_8.c --bpp 4")
print("\nGenerating 10 px")
os.system("./built_in_font_gen.py --size 10 -o lv_font_montserrat_10.c --bpp 4")
print("\nGenerating 12 px")
os.system("./built_in_font_gen.py --size 12 -o lv_font_montserrat_12.c --bpp 4")
print("\nGenerating 14 px")
os.system("./built_in_font_gen.py --size 14 -o lv_font_montserrat_14.c --bpp 4")
print("\nGenerating 16 px")
os.system("./built_in_font_gen.py --size 16 -o lv_font_montserrat_16.c --bpp 4")
print("\nGenerating 18 px")
os.system("./built_in_font_gen.py --size 18 -o lv_font_montserrat_18.c --bpp 4")
print("\nGenerating 20 px")
os.system("./built_in_font_gen.py --size 20 -o lv_font_montserrat_20.c --bpp 4")
print("\nGenerating 22 px")
os.system("./built_in_font_gen.py --size 22 -o lv_font_montserrat_22.c --bpp 4")
print("\nGenerating 24 px")
os.system("./built_in_font_gen.py --size 24 -o lv_font_montserrat_24.c --bpp 4")
print("\nGenerating 26 px")
os.system("./built_in_font_gen.py --size 26 -o lv_font_montserrat_26.c --bpp 4")
print("\nGenerating 28 px")
os.system("./built_in_font_gen.py --size 28 -o lv_font_montserrat_28.c --bpp 4")
print("\nGenerating 30 px")
os.system("./built_in_font_gen.py --size 30 -o lv_font_montserrat_30.c --bpp 4")
print("\nGenerating 32 px")
os.system("./built_in_font_gen.py --size 32 -o lv_font_montserrat_32.c --bpp 4")
print("\nGenerating 34 px")
os.system("./built_in_font_gen.py --size 34 -o lv_font_montserrat_34.c --bpp 4")
print("\nGenerating 36 px")
os.system("./built_in_font_gen.py --size 36 -o lv_font_montserrat_36.c --bpp 4")
print("\nGenerating 38 px")
os.system("./built_in_font_gen.py --size 38 -o lv_font_montserrat_38.c --bpp 4")
print("\nGenerating 40 px")
os.system("./built_in_font_gen.py --size 40 -o lv_font_montserrat_40.c --bpp 4")
print("\nGenerating 42 px")
os.system("./built_in_font_gen.py --size 42 -o lv_font_montserrat_42.c --bpp 4")
print("\nGenerating 44 px")
os.system("./built_in_font_gen.py --size 44 -o lv_font_montserrat_44.c --bpp 4")
print("\nGenerating 46 px")
os.system("./built_in_font_gen.py --size 46 -o lv_font_montserrat_46.c --bpp 4")
print("\nGenerating 48 px")
os.system("./built_in_font_gen.py --size 48 -o lv_font_montserrat_48.c --bpp 4")
print("\nGenerating 12 px subpx")
os.system("./built_in_font_gen.py --size 12 -o lv_font_montserrat_12_subpx.c --bpp 4 --subpx")
print("\nGenerating 28 px compressed")
os.system("./built_in_font_gen.py --size 28 -o lv_font_montserrat_28_compressed.c --bpp 4 --compressed")
print("\nGenerating 16 px Hebrew, Persian")
os.system("./built_in_font_gen.py --size 16 -o lv_font_dejavu_16_persian_hebrew.c --bpp 4 --font DejaVuSans.ttf -r 0x20-0x7f,0x5d0-0x5ea,0x600-0x6FF,0xFB50-0xFDFF,0xFE70-0xFEFF")
print("\nGenerating 16 px CJK")
os.system(u"./built_in_font_gen.py --size 16 -o lv_font_simsun_16_cjk.c --bpp 4 --font SimSun.woff -r 0x20-0x7f --symbols 盗提陽帯鼻画輕ッ冊ェル写父ぁフ結想正四O夫源庭場天續鳥れ講猿苦階給了製守8祝己妳薄泣塩帰ぺ吃変輪那着仍嗯爭熱創味保字宿捨準查達肯ァ薬得査障該降察ね網加昼料等図邪秋コ態品屬久原殊候路願楽確針上被怕悲風份重歡っ附ぷ既4黨價娘朝凍僅際洋止右航よ专角應酸師個比則響健昇豐筆歷適修據細忙跟管長令家ザ期般花越ミ域泳通些油乏ラ。營ス返調農叫樹刊愛間包知把ヤ貧橋拡普聞前ジ建当繰ネ送習渇用補ィ覺體法遊宙ョ酔余利壊語くつ払皆時辺追奇そ們只胸械勝住全沈力光ん深溝二類北面社值試9和五勵ゃ貿幾逐打課ゲて領3鼓辦発評渉詳暇込计駄供嘛郵頃腦反構絵お容規借身妻国慮剛急乗静必議置克土オ乎荷更肉還混古渡授合主離條値決季晴東大尚央州が嗎験流先医亦林田星晩拿60旅婦量為痛テ孫う環友況玩務其ぼち揺坐一肩腰犯タょ希即果ぶ物練待み高九找やヶ都グ去」サ、气仮雑酒許終企笑録形リ銀切ギ快問滿役単黄集森毎實研喜蘇司鉛洲川条媽才兩話言雖媒出客づ卻現異故り誌逮同訊已視本題ぞを横開音第席費持眾怎選元退限ー賽処喝就残無いガ多ケ沒義遠歌隣錢某雪析嬉採自透き側員予ゼ白婚电へ顯呀始均畫似懸格車騒度わ親店週維億締慣免帳電甚來園浴ゅ愈京と杯各海怒ぜ排敗挙老買7極模実紀ヒ携隻告シ並屋這孩讓質ワブ富賃争康由辞マ火於短樣削弟材注節另室ダ招擁ぃ若套底波行勤關著泊背疲狭作念推ぐ民貸祖介說ビ代温契你我レ入描變再札ソ派頭智遅私聽舉灣山伸放直安ト誕煙付符幅ふ絡她届耳飲忘参革團仕様載ど歩獲嫌息の汚交興魚指資雙與館初学年幸史位柱族走括び考青也共腕Lで販擔理病イ今逃當寺猫邊菓係ム秘示解池影ド文例斷曾事茶寫明科桃藝売便え導禁財飛替而亡到し具空寝辛業ウ府セ國何基菜厳市努張缺雲根外だ断万砂ゴ超使台实ぽ礼最慧算軟界段律像夕丈窓助刻月夏政呼ぴざ擇趣除動従涼方勉名線対存請子氏將5少否諸論美感或西者定食御表は參歳緑命進易性錯房も捕皿判中觀戦ニ緩町ピ番ず金千ろ?不た象治関ャ每看徒卒統じ手範訪押座步号ベ旁以母すほ密減成往歲件緒読歯效院种七謂凝濃嵌震喉繼クュ拭死円2積水欲如ポにさ寒道區精啦姐ア聯能足及停思壓春且メ裏株官答概黒過氷柿戻厚ぱ党祭織引計け委暗複誘港バ失下村較続神ぇ尤強秀膝兒来績十書済化服破新廠1紹您情半式產系好教暑早め樂地休協良な哪常要揮周かエ麗境働避護ンツ香夜太見設非改広聲他検求危清彼經未在起葉控靴所差內造寄南望尺換向展備眠點完約ぎ裡分説申童優伝島机須塊日立拉,鉄軽單気信很転識支布数紙此迎受心輸坊モ處「訳三曇兄野顔戰增ナ伊列又髪両有取左毛至困吧昔赤狀相夠整別士経頼然簡ホ会發隨営需脱ヨば接永居冬迫圍甘醫誰部充消連弱宇會咲覚姉麼的増首统帶糖朋術商担移景功育庫曲總劃牛程駅犬報ロ學責因パ嚴八世後平負公げ曜陸專午之閉ぬ談ご災昨冷職悪謝對它近射敢意運船臉局難什産頗!球真記ま但蔵究制機案湖臺ひ害券男留内木驗雨施種特復句末濟キ色訴依せ百型る石牠討呢时任執飯歐宅組傳配小活ゆべ暖ズ漸站素らボ束価チ浅回女片独妹英目從認生違策僕楚ペ米こ掛む爸六状落漢プ投カ校做啊洗声探あ割体項履触々訓技ハ低工映是標速善点人デ口次可".encode('utf-8'))
print("\nGenerating 8 px unscii")
os.system("lv_font_conv --no-compress --no-prefilter --bpp 1 --size 8 --font unscii-8.ttf -r 0x20-0x7F --format lvgl -o lv_font_unscii_8.c --force-fast-kern-format")
print("\nGenerating 16 px unscii")
os.system("lv_font_conv --no-compress --no-prefilter --bpp 1 --size 16 --font unscii-8.ttf -r 0x20-0x7F --format lvgl -o lv_font_unscii_16.c --force-fast-kern-format")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_*.c')
os.system('astyle --ignore-exclude-errors --options=../code-format.cfg "lv_font_*.c"')
os.system('mv lv_font_*.c ../../src/font/')

View File

@ -1,149 +0,0 @@
{{#each releases}}
`{{title}} <{{href}}>`__ {{niceDate}}
---------------------------------------------------------------------------------------------------------------------------------------------------
Breaking Changes
~~~~~~~~~~~~~~~~
{{#commit-list merges heading='' message='BREAKING CHANGE'}}
- .. warning: {{message}}
`{{id}} <{{href}}>`__
{{/commit-list}}
{{#commit-list commits heading='' message='BREAKING CHANGE'}}
- .. warning: {{subject}}
`{{shorthash}} <{{href}}>`__
{{/commit-list}}
{{#commit-list fixes heading='' message='BREAKING CHANGE'}}
- **{{commit.subject}}**
`{{commit.shorthash}} <{{commit.href}}>`__
{{/commit-list}}
Architectural
~~~~~~~~~~~~~
{{#commit-list merges heading='' message='^arch' exclude='BREAKING CHANGE'}}
- **{{message}}**
`{{id}} <{{href}}>`__
{{/commit-list}}
{{#commit-list commits heading='' message='^arch' exclude='BREAKING CHANGE'}}
- **{{subject}}**
`{{shorthash}} <{{href}}>`__
{{/commit-list}}
{{#commit-list fixes heading='' message='^arch' exclude='BREAKING CHANGE'}}
- **{{commit.subject}}**
`{{commit.shorthash}} <{{commit.href}}>`__
{{/commit-list}}
New Features
~~~~~~~~~~~~
{{#commit-list merges heading='' message='^feat' exclude='BREAKING CHANGE'}}
- **{{message}}**
`{{id}} <{{href}}>`__
{{/commit-list}}
{{#commit-list commits heading='' message='^feat' exclude='BREAKING CHANGE'}}
- **{{subject}}**
`{{shorthash}} <{{href}}>`__
{{/commit-list}}
{{#commit-list fixes heading='' message='^feat' exclude='BREAKING CHANGE'}}
- **{{commit.subject}}**
`{{commit.shorthash}} <{{commit.href}}>`__
{{/commit-list}}
Performance
~~~~~~~~~~~
{{#commit-list merges heading='' message='^perf' exclude='BREAKING CHANGE'}}
- **{{message}}**
`{{id}} <{{href}}>`__
{{/commit-list}}
{{#commit-list commits heading='' message='^perf' exclude='BREAKING CHANGE'}}
- **{{subject}}**
`{{shorthash}} <{{href}}>`__
{{/commit-list}}
{{#commit-list fixes heading='' message='^perf' exclude='BREAKING CHANGE'}}
- **{{commit.subject}}**
`{{commit.shorthash}} <{{commit.href}}>`__
{{/commit-list}}
Fixes
~~~~~
{{#commit-list merges heading='' message='^fix' exclude='(^fix conflict|^fix warning|BREAKING CHANGE)'}}
- **{{message}}**
`{{id}} <{{href}}>`__
{{/commit-list}}
{{#commit-list commits heading='' message='^fix' exclude='(^fix conflict|^fix warning|BREAKING CHANGE)'}}
- **{{subject}}**
`{{shorthash}} <{{href}}>`__
{{/commit-list}}
{{#commit-list fixes heading='' message='^fix' exclude='(^fix conflict|^fix warning|BREAKING CHANGE)'}}
- **{{commit.subject}}**
`{{commit.shorthash}} <{{commit.href}}>`__
{{/commit-list}}
Examples
~~~~~~~~
{{#commit-list merges heading='' message='^example'}}
- **{{message}}**
`{{id}} <({{href}})>`__
{{/commit-list}}
{{#commit-list commits heading='' message='^example'}}
- **{{subject}}**
`{{shorthash}} <{{href}}>`__
{{/commit-list}}
{{#commit-list fixes heading='' message='^example'}}
- **{{commit.subject}}**
`{{commit.shorthash}} <{{commit.href}}>`__
{{/commit-list}}
Docs
~~~~
{{#commit-list merges heading='' message='^docs'}}
- **{{message}}**
`{{id}} <{{href}}>`__
{{/commit-list}}
{{#commit-list commits heading='' message='^docs'}}
- **{{subject}}**
`{{shorthash}} <{{href}}>`__
{{/commit-list}}
{{#commit-list fixes heading='' message='^docs'}}
- **{{commit.subject}}**
`{{commit.shorthash}} <{{commit.href}}>`__
{{/commit-list}}
CI and tests
~~~~~~~~~~~~
{{#commit-list merges heading='' message='(^ci|^test)'}}
- **{{message}}**
`{{id}} <{{href}}>`__
{{/commit-list}}
{{#commit-list commits heading='' message='(^ci|^test)'}}
- **{{subject}}**
`{{shorthash }} <{{href}}>`__
{{/commit-list}}
{{#commit-list fixes heading='' message='(^ci|^test)'}}
- **{{commit.subject}}**
`{{commit.shorthash}} <{{commit.href}}>`__
{{/commit-list}}
Others
~~~~~~
{{#commit-list merges heading='' exclude='(^fix|^feat|^perf|^docs|^example|^ci|^test)'}}
- **{{message}}**
`{{id }} <{{href}}>`__
{{/commit-list}}
{{#commit-list commits heading='' exclude='(^fix|^feat|^perf|^docs|^example|^ci|^test)'}}
- **{{subject}}**
`{{shorthash }} <{{href}}>`__
{{/commit-list}}
{{#commit-list fixes heading='' exclude='(^fix|^feat|^perf|^docs|^example|^ci|^test)'}}
- **{{commit.subject}}**
`{{commit.shorthash}} <{{commit.href}}>`__
{{/commit-list}}
{{/each}}

View File

@ -1,16 +0,0 @@
#!/bin/sh
# Generate CHANGELOG_LAST.md from changes since the last version tag. (vx.y.z-dev tags are ignored)
# CHANGELOG_LAST.md can be edited manually if required and manually added to docs/CHANGELOG.md
#
# Requirements:
# npm install -g auto-changelog
#
# Usage:
# changelog-gen <next-version>
#
# Example: if the latest version is v5.6.7 the following can be used for bugfix, minor or major versions:
# changelog-gen v5.6.8
# changelog-gen v5.7.0
# changelog-gen v6.0.0
auto-changelog -t changelog-template.hbs -l false --latest-version $1 --unreleased-only --tag-pattern ^v[0-9]+.[0-9]+.[0-9]+$ -o CHANGELOG_LAST.rst

View File

@ -1,49 +0,0 @@
--style=kr
--indent=spaces=4
--indent-classes
--indent-switches
--indent-cases
--indent-preproc-block
--indent-preproc-define
--indent-col1-comments
--pad-oper
--unpad-paren
--align-pointer=middle
--align-reference=middle
--convert-tabs
--max-code-length=120
--break-after-logical
--break-closing-braces
--attach-closing-while
--min-conditional-indent=0
--max-continuation-indent=120
--mode=c
--lineend=linux
--suffix=none
--preserve-date
--formatted
--ignore-exclude-errors
--ignore-exclude-errors-x
--exclude=assets
--exclude=test_assets
--exclude=test_fonts
--exclude=../src/lv_conf_internal.h
--exclude=../src/core/lv_obj_style_gen.c
--exclude=../src/core/lv_obj_style_gen.h
--exclude=../src/libs/gif/gifdec.c
--exclude=../src/libs/gif/gifdec.h
--exclude=../src/libs/lodepng/lodepng.c
--exclude=../src/libs/lodepng/lodepng.h
--exclude=../src/libs/qrcode/qrcodegen.c
--exclude=../src/libs/qrcode/qrcodegen.h
--exclude=../src/libs/tjpgd/tjpgd.c
--exclude=../src/libs/tjpgd/tjpgd.h
--exclude=../src/libs/tjpgd/tjpgdcnf.h
--exclude=../src/libs/thorvg
--exclude=../src/libs/lz4
--exclude=../src/others/vg_lite_tvg/vg_lite.h
--exclude=../tests/unity/unity.c
--exclude=../tests/unity/unity_internals.h
--exclude=../tests/unity/unity_support.c
--exclude=../tests/unity/unity_support.h
--exclude=../tests/test_images

View File

@ -1,19 +0,0 @@
#!/usr/bin/env python3
import os
script_dir = os.path.realpath(__file__)
script_dir = os.path.dirname(script_dir)
cfg_file = os.path.join(script_dir, 'code-format.cfg')
print("\nFormatting demos")
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../demos/*.c,*.cpp,*.h"')
print("\nFormatting examples")
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../examples/*.c,*.cpp,*.h"')
print("Formatting src")
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../src/*.c,*.cpp,*.h"')
print("\nFormatting tests")
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../tests/*.c,*.cpp,*.h"')

View File

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

View File

@ -1,11 +0,0 @@
#!/usr/bin/env python3
import sys
with open(sys.argv[1], 'r') as file:
s = file.read()
b = bytearray()
b.extend(map(ord, s))
for a in b: print(hex(a), end =", ")

View File

@ -1,8 +0,0 @@
#!/bin/bash
# Credit: https://stackoverflow.com/a/4774063
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
TMPENVFILE=$(mktemp /tmp/lvgl.script.XXXXXX)
cat $SCRIPTPATH/../lvgl.h | grep "#define LVGL_VERSION_" | sed 's/#define //g' | sed -r 's/\s+/=/' > $TMPENVFILE
. $TMPENVFILE
rm $TMPENVFILE
echo $LVGL_VERSION_MAJOR.$LVGL_VERSION_MINOR

View File

@ -1,15 +0,0 @@
#!/bin/bash
echo "/* Autogenerated */"
echo '#include <stddef.h>'
echo '#include "examplelist.h"'
TMPFILE=$(mktemp)
find examples demos -name \*.h | xargs grep -hE "^void lv_(example|demo)" | sed 's/(/ /g' | awk '{print $2}' > $TMPFILE
cat $TMPFILE | while read -r line; do
echo "extern void ${line}(void);"
done
echo "const struct lv_ci_example lv_ci_example_list[] = {"
cat $TMPFILE | while read -r line; do
echo " { \"$line\", $line },";
done
echo " { NULL, NULL }"
echo "};"

View File

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

View File

@ -1,10 +0,0 @@
#!/bin/sh
# Install Linux package prerequisites needed for LVGL development
# and testing. Some less-common development packages are not included
# here, such as MicroPython and PC simulator packages.
#
# Note: This script is run by the CI workflows.
sudo apt update
sudo apt install gcc python3 libpng-dev ruby-full gcovr cmake libjpeg-turbo8-dev libfreetype6-dev pngquant
pip3 install pypng lz4

View File

@ -1,140 +0,0 @@
#!/usr/bin/env python3
##################################################################
# sjpeg converter script version 1.0
# Dependencies: (PYTHON-3)
##################################################################
SJPG_FILE_FORMAT_VERSION = "V1.00" #
JPEG_SPLIT_HEIGHT = 16
##################################################################
import math, os, sys, time
from PIL import Image
OUTPUT_FILE_NAME = ""
INPUT_FILE = ""
if len(sys.argv) == 2:
INPUT_FILE = sys.argv[1]
OUTPUT_FILE_NAME = INPUT_FILE.split("/")[-1].split("\\")[-1].split(".")[0]
else:
print("usage:\n\t python " + sys.argv[0] + " input_file.jpg")
sys.exit(0)
try:
im = Image.open(INPUT_FILE)
except:
print("\nFile not found!")
sys.exit(0)
print("\nConversion started...\n")
start_time = time.time()
width, height = im.size
print("Input:")
print("\t" + INPUT_FILE)
print("\tRES = " + str(width) + " x " + str(height) + '\n')
lenbuf = []
block_size = JPEG_SPLIT_HEIGHT;
spilts = math.ceil(height/block_size)
c_code = '''//LVGL SJPG C ARRAY\n#include "lvgl/lvgl.h"\n\nconst uint8_t ''' + OUTPUT_FILE_NAME + '''_map[] = {\n'''
sjpeg_data = bytearray()
sjpeg = bytearray()
row_remaining = height;
for i in range(spilts):
if row_remaining < block_size:
crop = im.crop((0, i*block_size, width, row_remaining + i*block_size))
else:
crop = im.crop((0, i*block_size, width, block_size + i*block_size))
row_remaining = row_remaining - block_size;
crop.save(str(i)+".jpg", quality=90)
for i in range(spilts):
f = open(str(i)+".jpg", "rb")
a = f.read()
f.close()
sjpeg_data = sjpeg_data + a
lenbuf.append(len(a))
header = bytearray()
#4 BYTES
header = header + bytearray("_SJPG__".encode("UTF-8"));
#6 BYTES VERSION
header = header + bytearray(("\x00" + SJPG_FILE_FORMAT_VERSION + "\x00").encode("UTF-8"));
#WIDTH 2 BYTES
header = header + width.to_bytes(2, byteorder='little');
#HEIGHT 2 BYTES
header = header + height.to_bytes(2, byteorder='little');
#NUMBER OF ITEMS 2 BYTES
header = header + spilts.to_bytes(2, byteorder='little');
#NUMBER OF ITEMS 2 BYTES
header = header + int(JPEG_SPLIT_HEIGHT).to_bytes(2, byteorder='little');
for item_len in lenbuf:
# WIDTH 2 BYTES
header = header + item_len.to_bytes(2, byteorder='little');
data = bytearray()
sjpeg = header + sjpeg_data;
if 1:
for i in range(len(lenbuf)):
os.remove(str(i) + ".jpg")
f = open(OUTPUT_FILE_NAME+".sjpg","wb");
f.write(sjpeg)
f.close()
new_line_threshold = 0
for i in range(len(sjpeg)):
c_code = c_code + "\t" + str(hex(sjpeg[i])) + ","
new_line_threshold = new_line_threshold + 1
if (new_line_threshold >= 16):
c_code = c_code + "\n"
new_line_threshold = 0
c_code = c_code + "\n};\n\nlv_image_dsc_t "
c_code = c_code + OUTPUT_FILE_NAME + " = {\n"
c_code = c_code + "\t.header.always_zero = 0,\n"
c_code = c_code + "\t.header.w = " + str(width) + ",\n"
c_code = c_code + "\t.header.h = " + str(height) + ",\n"
c_code = c_code + "\t.data_size = " + str(len(sjpeg)) + ",\n"
c_code = c_code + "\t.header.cf = LV_IMG_CF_RAW,\n"
c_code = c_code + "\t.data = " + OUTPUT_FILE_NAME+"_map" + ",\n};"
f = open(OUTPUT_FILE_NAME + '.c', 'w')
f.write(c_code)
f.close()
time_taken = (time.time() - start_time)
print("Output:")
print("\tTime taken = " + str(round(time_taken,2)) + " sec")
print("\tbin size = " + str(round(len(sjpeg)/1024, 1)) + " KB" )
print("\t" + OUTPUT_FILE_NAME + ".sjpg\t(bin file)" + "\n\t" + OUTPUT_FILE_NAME + ".c\t\t(c array)")
print("\nAll good!")

View File

@ -1,205 +0,0 @@
#!/usr/bin/env python3
'''
Generates lv_conf_internal.h from lv_conf_template.h to provide default values
'''
import os
import sys
import re
SCRIPT_DIR = os.path.dirname(__file__)
LV_CONF_TEMPLATE = os.path.join(SCRIPT_DIR, "..", "lv_conf_template.h")
LV_CONF_INTERNAL = os.path.join(SCRIPT_DIR, "..", "src", "lv_conf_internal.h")
if sys.version_info < (3,6,0):
print("Python >=3.6 is required", file=sys.stderr)
exit(1)
fin = open(LV_CONF_TEMPLATE)
fout = open(LV_CONF_INTERNAL, "w", newline='')
fout.write(
'''/**
* GENERATED FILE, DO NOT EDIT IT!
* @file lv_conf_internal.h
* Make sure all the defines of lv_conf.h have a default value
**/
#ifndef LV_CONF_INTERNAL_H
#define LV_CONF_INTERNAL_H
/* clang-format off */
/*Config options*/
#define LV_OS_NONE 0
#define LV_OS_PTHREAD 1
#define LV_OS_FREERTOS 2
#define LV_OS_CMSIS_RTOS2 3
#define LV_OS_RTTHREAD 4
#define LV_OS_WINDOWS 5
#define LV_OS_CUSTOM 255
#define LV_STDLIB_BUILTIN 0
#define LV_STDLIB_CLIB 1
#define LV_STDLIB_MICROPYTHON 2
#define LV_STDLIB_RTTHREAD 3
#define LV_STDLIB_CUSTOM 255
#define LV_DRAW_SW_ASM_NONE 0
#define LV_DRAW_SW_ASM_NEON 1
#define LV_DRAW_SW_ASM_HELIUM 2
#define LV_DRAW_SW_ASM_CUSTOM 255
/* Handle special Kconfig options */
#ifndef LV_KCONFIG_IGNORE
#include "lv_conf_kconfig.h"
#ifdef CONFIG_LV_CONF_SKIP
#define LV_CONF_SKIP
#endif
#endif
/*If "lv_conf.h" is available from here try to use it later.*/
#ifdef __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*/
#ifndef LV_CONF_SKIP
#ifdef LV_CONF_PATH /*If there is a path defined for lv_conf.h use it*/
#define __LV_TO_STR_AUX(x) #x
#define __LV_TO_STR(x) __LV_TO_STR_AUX(x)
#include __LV_TO_STR(LV_CONF_PATH)
#undef __LV_TO_STR_AUX
#undef __LV_TO_STR
#elif defined(LV_CONF_INCLUDE_SIMPLE) /*Or simply include lv_conf.h is enabled*/
#include "lv_conf.h"
#else
#include "../../lv_conf.h" /*Else assume lv_conf.h is next to the lvgl folder*/
#endif
#if !defined(LV_CONF_H) && !defined(LV_CONF_SUPPRESS_DEFINE_CHECK)
/* #include will sometimes silently fail when __has_include is used */
/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80753 */
#pragma message("Possible failure to include lv_conf.h, please read the comment in this file if you get errors")
#endif
#endif
#ifdef CONFIG_LV_COLOR_DEPTH
#define _LV_KCONFIG_PRESENT
#endif
/*----------------------------------
* Start parsing lv_conf_template.h
-----------------------------------*/
'''
)
started = 0
for line in fin.read().splitlines():
if not started:
if '#define LV_CONF_H' in line:
started = 1
continue
else:
continue
if '/*--END OF LV_CONF_H--*/' in line: break
#Is there a #define in this line?
r = re.search(r'^([\s]*)#[\s]*(undef|define)[\s]+([^\s]+).*$', line) # \s means any white space character
if r:
indent = r[1]
name = r[3]
name = re.sub('\(.*?\)', '', name, 1) #remove parentheses from macros. E.g. MY_FUNC(5) -> MY_FUNC
line = re.sub('[\s]*', '', line, 1)
#If the value should be 1 (enabled) by default use a more complex structure for Kconfig checks because
#if a not defined CONFIG_... value should be interpreted as 0 and not the LVGL default
is_one = re.search(r'#[\s]*define[\s]*[A-Z0-9_]+[\s]+1([\s]*$|[\s]+)', line)
if is_one:
#1. Use the value if already set from lv_conf.h or anything else (i.e. do nothing)
#2. In Kconfig environment use the CONFIG_... value if set, else use 0
#3. In not Kconfig environment use the LVGL's default value
fout.write(
f'{indent}#ifndef {name}\n'
f'{indent} #ifdef _LV_KCONFIG_PRESENT\n'
f'{indent} #ifdef CONFIG_{name.upper()}\n'
f'{indent} #define {name} CONFIG_{name.upper()}\n'
f'{indent} #else\n'
f'{indent} #define {name} 0\n'
f'{indent} #endif\n'
f'{indent} #else\n'
f'{indent} {line}\n'
f'{indent} #endif\n'
f'{indent}#endif\n'
)
else:
#1. Use the value if already set from lv_conf.h or anything else (i.e. do nothing)
#2. Use the Kconfig value if set
#3. Use the LVGL's default value
fout.write(
f'{indent}#ifndef {name}\n'
f'{indent} #ifdef CONFIG_{name.upper()}\n'
f'{indent} #define {name} CONFIG_{name.upper()}\n'
f'{indent} #else\n'
f'{indent} {line}\n'
f'{indent} #endif\n'
f'{indent}#endif\n'
)
elif re.search('^ *typedef .*;.*$', line):
continue #ignore typedefs to avoid redeclaration
else:
fout.write(f'{line}\n')
fout.write(
'''
/*----------------------------------
* End of parsing lv_conf_template.h
-----------------------------------*/
#ifndef __ASSEMBLY__
LV_EXPORT_CONST_INT(LV_DPI_DEF);
LV_EXPORT_CONST_INT(LV_DRAW_BUF_STRIDE_ALIGN);
LV_EXPORT_CONST_INT(LV_DRAW_BUF_ALIGN);
#endif
#undef _LV_KCONFIG_PRESENT
/*Set some defines if a dependency is disabled*/
#if LV_USE_LOG == 0
#define LV_LOG_LEVEL LV_LOG_LEVEL_NONE
#define LV_LOG_TRACE_MEM 0
#define LV_LOG_TRACE_TIMER 0
#define LV_LOG_TRACE_INDEV 0
#define LV_LOG_TRACE_DISP_REFR 0
#define LV_LOG_TRACE_EVENT 0
#define LV_LOG_TRACE_OBJ_CREATE 0
#define LV_LOG_TRACE_LAYOUT 0
#define LV_LOG_TRACE_ANIM 0
#endif /*LV_USE_LOG*/
/*If running without lv_conf.h add typedefs with default value*/
#ifdef LV_CONF_SKIP
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /*Disable warnings for Visual Studio*/
#define _CRT_SECURE_NO_WARNINGS
#endif
#endif /*defined(LV_CONF_SKIP)*/
#endif /*LV_CONF_INTERNAL_H*/
'''
)
fin.close()
fout.close()

View File

@ -1,108 +0,0 @@
#!/usr/bin/env python3
import sys
import os.path
from os import path
import os, fnmatch
import re
import subprocess
import com
def cmd(c, ask_on_err = True):
print("\n" + c)
r = os.system(c)
if r:
print("### Error: " + str(r))
if ask_on_err:
input("Press Enter to continue execution...")
def define_set(fn, name, value):
print("In " + fn + " set " + name + " to " + value)
new_content = ""
s = r'^ *# *define +' + str(name).rstrip() + ' +'
f = open(fn, "r")
for i in f.read().splitlines():
r = re.search(s, i)
if r:
d = i.split("define")
i = d[0] + "define " + name + " " + value
new_content += i + '\n'
f.close()
f = open(fn, "w")
f.write(new_content)
f.close()
def ver_format(ver):
s = "v" + str(ver[0]) + "." + str(ver[1]) + "." + str(ver[2])
if(ver[3] != ""): s = s + "-" + ver[3]
return s
def get_lvgl_version():
print("Get lvgl's version ")
ver = [0, 0, 0, ""]
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()
print("Version found: " + ver_format(ver))
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] + "\"")
cmd("git commit -am 'Update versions to " + ver_str + "'")

View File

@ -1,74 +0,0 @@
#!/usr/bin/env python3
# Applies a commit or commits on branch or branches
# USAGE:
# patch.py -c <commit-list> -b <branch-list> [-p] [-t]
# - <commit-list>: list of commit SHAs to apply.
# - <branch-list>: branches where the commit should be applied. * can be used as wildchar
# - p: push the changes to <branch-list>
# - t: increment version number and create a tag
import os, subprocess, com, re
push = False
def clone(repo):
com.cmd("git clone --recurse-submodules https://github.com/lvgl/" + repo)
os.chdir("./" + repo)
com.cmd("git checkout master")
com.cmd("git remote update origin --prune")
com.cmd("git pull origin --tags")
os.chdir("..")
# Get the list of related minor version branches
#clone("lvgl")
os.chdir("lvgl")
cmd = "git branch --remotes | grep origin/release/v8"
branches, error = subprocess.Popen(cmd, shell=True, executable="/bin/bash", stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
branches = str(branches)
branches = branches.replace("b'", "")
branches = branches.replace("'", "")
branches = branches.replace("origin/", "")
branches = branches.replace(" ", " ")
branches = branches.replace("\\n", "")
branches = branches.split(" ")
branches = list(filter(len, branches))
commits = []
with open('../commits.txt') as f:
for line in f:
commits.insert(0, line)
print(commits)
for br in branches:
com.cmd("git checkout " + br)
print("Applying commits")
for c in commits:
h = c.split(" ")
com.cmd("git cherry-pick " + h[0])
ver = com.get_lvgl_version(br)
ver_new = ver.copy()
ver_new[2] = str(int(ver_new[2]) + 1)
print("Updating branch '" + br + "' from '" + com.ver_format(ver) + "' to '" + com.ver_format(ver_new) + "'")
com.update_version(ver_new)
com.cmd("git tag -a " + com.ver_format(ver_new) + "-m \"Release " + com.ver_format(ver_new) + "\"")
if push:
com.cmd("git push origin " + br + "--tags")
com.cmd("git checkout master")
ver = com.get_lvgl_version("master")
ver = com.get_lvgl_version(br)
ver_new[2] = str(int(ver_new[2]) + 1)
t = com.ver_format(ver_new) + "-dev"
com.cmd("git tag -a " + t + " -m \"Start " + t + "\"")
if push:
com.cmd("git push origin master --tags")

View File

@ -1,17 +0,0 @@
#!/usr/bin/env python3
# Create a new release from master. Execute the following:
# - On lvgl, lv_demos, and lv_drivers:
# - Detect the current version of master. E.g. 8.1-dev
# - Create a new branch from the master for the release. E.g. release/v8.1
# - Remove the "-dev" postfix from the version numbers
# - Create a tag for the new version. E.g. v8.1
# - Push the new branch and tag
# - Get the relevant changes from docs/CHANGELOG.md and create a blog post from it
# - Increment the version number in master. E.g.g 8.1-dev to 8.2-dev
# - Add a new section to the CHANGELOG with the new version
# - Update the simulator and lv_port projects
#
# USAGE:
# release.py <type>
# - <type>: -minor or -major

View File

@ -1,688 +0,0 @@
#!/usr/bin/env python3
import os
import re
import sys
props = [
{'section': 'Size and position', 'dsc':'Properties related to size, position, alignment and layout of the objects.' },
{'name': 'WIDTH',
'style_type': 'num', 'var_type': 'int32_t' , 'default':'Widget dependent', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the width of object. Pixel, percentage and `LV_SIZE_CONTENT` values can be used. Percentage values are relative to the width of the parent's content area."},
{'name': 'MIN_WIDTH',
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets a minimal width. Pixel and percentage values can be used. Percentage values are relative to the width of the parent's content area."},
{'name': 'MAX_WIDTH',
'style_type': 'num', 'var_type': 'int32_t' , 'default':'LV_COORD_MAX', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets a maximal width. Pixel and percentage values can be used. Percentage values are relative to the width of the parent's content area."},
{'name': 'HEIGHT',
'style_type': 'num', 'var_type': 'int32_t' , 'default':'Widget dependent', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the height of object. Pixel, percentage and `LV_SIZE_CONTENT` can be used. Percentage values are relative to the height of the parent's content area."},
{'name': 'MIN_HEIGHT',
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets a minimal height. Pixel and percentage values can be used. Percentage values are relative to the width of the parent's content area."},
{'name': 'MAX_HEIGHT',
'style_type': 'num', 'var_type': 'int32_t' , 'default':'LV_COORD_MAX', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets a maximal height. Pixel and percentage values can be used. Percentage values are relative to the height of the parent's content area."},
{'name': 'LENGTH',
'style_type': 'num', 'var_type': 'int32_t' , 'default':'0', 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Its meaning depends on the type of the widget. For example in case of lv_scale it means the length of the ticks."},
{'name': 'X',
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the X coordinate of the object considering the set `align`. Pixel and percentage values can be used. Percentage values are relative to the width of the parent's content area."},
{'name': 'Y',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the Y coordinate of the object considering the set `align`. Pixel and percentage values can be used. Percentage values are relative to the height of the parent's content area."},
{'name': 'ALIGN',
'style_type': 'num', 'var_type': 'lv_align_t', 'default':'`LV_ALIGN_DEFAULT`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the alignment which tells from which point of the parent the X and Y coordinates should be interpreted. The possible values are: `LV_ALIGN_DEFAULT`, `LV_ALIGN_TOP_LEFT/MID/RIGHT`, `LV_ALIGN_BOTTOM_LEFT/MID/RIGHT`, `LV_ALIGN_LEFT/RIGHT_MID`, `LV_ALIGN_CENTER`. `LV_ALIGN_DEFAULT` means `LV_ALIGN_TOP_LEFT` with LTR base direction and `LV_ALIGN_TOP_RIGHT` with RTL base direction."},
{'name': 'TRANSFORM_WIDTH',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Make the object wider on both sides with this value. Pixel and percentage (with `lv_pct(x)`) values can be used. Percentage values are relative to the object's width." },
{'name': 'TRANSFORM_HEIGHT',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Make the object higher on both sides with this value. Pixel and percentage (with `lv_pct(x)`) values can be used. Percentage values are relative to the object's height." },
{'name': 'TRANSLATE_X',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Move the object with this value in X direction. Applied after layouts, aligns and other positioning. Pixel and percentage (with `lv_pct(x)`) values can be used. Percentage values are relative to the object's width." },
{'name': 'TRANSLATE_Y',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Move the object with this value in Y direction. Applied after layouts, aligns and other positioning. Pixel and percentage (with `lv_pct(x)`) values can be used. Percentage values are relative to the object's height." },
{'name': 'TRANSFORM_SCALE_X',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 1,
'dsc': "Zoom an objects horizontally. The value 256 (or `LV_SCALE_NONE`) means normal size, 128 half size, 512 double size, and so on" },
{'name': 'TRANSFORM_SCALE_Y',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 1,
'dsc': "Zoom an objects vertically. The value 256 (or `LV_SCALE_NONE`) means normal size, 128 half size, 512 double size, and so on" },
{'name': 'TRANSFORM_ROTATION',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 1,
'dsc': "Rotate an objects. The value is interpreted in 0.1 degree units. E.g. 450 means 45 deg."},
{'name': 'TRANSFORM_PIVOT_X',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the pivot point's X coordinate for transformations. Relative to the object's top left corner'"},
{'name': 'TRANSFORM_PIVOT_Y',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the pivot point's Y coordinate for transformations. Relative to the object's top left corner'"},
{'name': 'TRANSFORM_SKEW_X',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 1,
'dsc': "Skew an object horizontally. The value is interpreted in 0.1 degree units. E.g. 450 means 45 deg."},
{'name': 'TRANSFORM_SKEW_Y',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 1,
'dsc': "Skew an object vertically. The value is interpreted in 0.1 degree units. E.g. 450 means 45 deg."},
{'section': 'Padding', 'dsc' : "Properties to describe spacing between the parent's sides and the children and among the children. Very similar to the padding properties in HTML."},
{'name': 'PAD_TOP',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the padding on the top. It makes the content area smaller in this direction."},
{'name': 'PAD_BOTTOM',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the padding on the bottom. It makes the content area smaller in this direction."},
{'name': 'PAD_LEFT',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the padding on the left. It makes the content area smaller in this direction."},
{'name': 'PAD_RIGHT',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the padding on the right. It makes the content area smaller in this direction."},
{'name': 'PAD_ROW',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the padding between the rows. Used by the layouts."},
{'name': 'PAD_COLUMN',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the padding between the columns. Used by the layouts."},
{'section': 'Margin', 'dsc' : "Properties to describe spacing around an object. Very similar to the margin properties in HTML."},
{'name': 'MARGIN_TOP',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the margin on the top. The object will keep this space from its siblings in layouts. "},
{'name': 'MARGIN_BOTTOM',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the margin on the bottom. The object will keep this space from its siblings in layouts."},
{'name': 'MARGIN_LEFT',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the margin on the left. The object will keep this space from its siblings in layouts."},
{'name': 'MARGIN_RIGHT',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the margin on the right. The object will keep this space from its siblings in layouts."},
{'section': 'Background', 'dsc':'Properties to describe the background color and image of the objects.' },
{'name': 'BG_COLOR',
'style_type': 'color', 'var_type': 'lv_color_t', 'default':'`0xffffff`', 'inherited': 0, 'layout': 0, 'ext_draw': 0, 'filtered': 1,
'dsc': "Set the background color of the object."},
{'name': 'BG_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':'`LV_OPA_TRANSP`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the opacity of the background. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
{'name': 'BG_GRAD_COLOR',
'style_type': 'color', 'var_type': 'lv_color_t', 'default':'`0x000000`', 'inherited': 0, 'layout': 0, 'ext_draw': 0, 'filtered': 1,
'dsc': "Set the gradient color of the background. Used only if `grad_dir` is not `LV_GRAD_DIR_NONE`"},
{'name': 'BG_GRAD_DIR',
'style_type': 'num', 'var_type': 'lv_grad_dir_t', 'default':'`LV_GRAD_DIR_NONE`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the direction of the gradient of the background. The possible values are `LV_GRAD_DIR_NONE/HOR/VER`."},
{'name': 'BG_MAIN_STOP',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the point from which the background color should start for gradients. 0 means to top/left side, 255 the bottom/right side, 128 the center, and so on"},
{'name': 'BG_GRAD_STOP',
'style_type': 'num', 'var_type': 'int32_t', 'default':255, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the point from which the background's gradient color should start. 0 means to top/left side, 255 the bottom/right side, 128 the center, and so on"},
{'name': 'BG_MAIN_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':255, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the opacity of the first gradient color"},
{'name': 'BG_GRAD_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':255, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the opacity of the second gradient color"},
{'name': 'BG_GRAD',
'style_type': 'ptr', 'var_type': 'const lv_grad_dsc_t *', 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the gradient definition. The pointed instance must exist while the object is alive. NULL to disable. It wraps `BG_GRAD_COLOR`, `BG_GRAD_DIR`, `BG_MAIN_STOP` and `BG_GRAD_STOP` into one descriptor and allows creating gradients with more colors too. If it's set other gradient related properties will be ignored'"},
{'name': 'BG_IMAGE_SRC',
'style_type': 'ptr', 'var_type': 'const void *', 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set a background image. Can be a pointer to `lv_image_dsc_t`, a path to a file or an `LV_SYMBOL_...`"},
{'name': 'BG_IMAGE_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':'`LV_OPA_COVER`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the opacity of the background image. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
{'name': 'BG_IMAGE_RECOLOR',
'style_type': 'color', 'var_type': 'lv_color_t', 'default':'`0x000000`', 'inherited': 0, 'layout': 0, 'ext_draw': 0, 'filtered': 1,
'dsc': "Set a color to mix to the background image."},
{'name': 'BG_IMAGE_RECOLOR_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':'`LV_OPA_TRANSP`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the intensity of background image recoloring. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means no mixing, 255, `LV_OPA_100` or `LV_OPA_COVER` means full recoloring, other values or LV_OPA_10, LV_OPA_20, etc are interpreted proportionally."},
{'name': 'BG_IMAGE_TILED',
'style_type': 'num', 'var_type': 'bool', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "If enabled the background image will be tiled. The possible values are `true` or `false`."},
{'section': 'Border', 'dsc':'Properties to describe the borders' },
{'name': 'BORDER_COLOR',
'style_type': 'color', 'var_type': 'lv_color_t', 'default':'`0x000000`', 'inherited': 0, 'layout': 0, 'ext_draw': 0, 'filtered': 1,
'dsc': "Set the color of the border"},
{'name': 'BORDER_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':'`LV_OPA_COVER`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the opacity of the border. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
{'name': 'BORDER_WIDTH',
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the width of the border. Only pixel values can be used."},
{'name': 'BORDER_SIDE',
'style_type': 'num', 'var_type': 'lv_border_side_t', 'default':'`LV_BORDER_SIDE_NONE`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set only which side(s) the border should be drawn. The possible values are `LV_BORDER_SIDE_NONE/TOP/BOTTOM/LEFT/RIGHT/INTERNAL`. OR-ed values can be used as well, e.g. `LV_BORDER_SIDE_TOP | LV_BORDER_SIDE_LEFT`."},
{'name': 'BORDER_POST',
'style_type': 'num', 'var_type': 'bool' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Sets whether the border should be drawn before or after the children are drawn. `true`: after children, `false`: before children"},
{'section': 'Outline', 'dsc':'Properties to describe the outline. It\'s like a border but drawn outside of the rectangles.' },
{'name': 'OUTLINE_WIDTH',
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set the width of the outline in pixels. "},
{'name': 'OUTLINE_COLOR',
'style_type': 'color', 'var_type': 'lv_color_t' , 'default':'`0x000000`', 'inherited': 0, 'layout': 0, 'ext_draw': 0, 'filtered': 1,
'dsc': "Set the color of the outline."},
{'name': 'OUTLINE_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':'`LV_OPA_COVER`', 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set the opacity of the outline. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
{'name': 'OUTLINE_PAD',
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set the padding of the outline, i.e. the gap between object and the outline."},
{'section': 'Shadow', 'dsc':'Properties to describe the shadow drawn under the rectangles.' },
{'name': 'SHADOW_WIDTH',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set the width of the shadow in pixels. The value should be >= 0."},
{'name': 'SHADOW_OFFSET_X',
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set an offset on the shadow in pixels in X direction. "},
{'name': 'SHADOW_OFFSET_Y',
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set an offset on the shadow in pixels in Y direction. "},
{'name': 'SHADOW_SPREAD',
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Make the shadow calculation to use a larger or smaller rectangle as base. The value can be in pixel to make the area larger/smaller"},
{'name': 'SHADOW_COLOR',
'style_type': 'color', 'var_type': 'lv_color_t' , 'default':'`0x000000`', 'inherited': 0, 'layout': 0, 'ext_draw': 0, 'filtered': 1,
'dsc': "Set the color of the shadow"},
{'name': 'SHADOW_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':'`LV_OPA_COVER`', 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set the opacity of the shadow. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
{'section': 'Image', 'dsc':'Properties to describe the images' },
{'name': 'IMAGE_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':'`LV_OPA_COVER`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the opacity of an image. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
{'name': 'IMAGE_RECOLOR',
'style_type': 'color', 'var_type': 'lv_color_t', 'default':'`0x000000`', 'inherited': 0, 'layout': 0, 'ext_draw': 0, 'filtered': 1,
'dsc': "Set color to mixt to the image."},
{'name': 'IMAGE_RECOLOR_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the intensity of the color mixing. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
{'section': 'Line', 'dsc':'Properties to describe line-like objects' },
{'name': 'LINE_WIDTH',
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set the width of the lines in pixel."},
{'name': 'LINE_DASH_WIDTH',
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the width of dashes in pixel. Note that dash works only on horizontal and vertical lines"},
{'name': 'LINE_DASH_GAP',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the gap between dashes in pixel. Note that dash works only on horizontal and vertical lines"},
{'name': 'LINE_ROUNDED',
'style_type': 'num', 'var_type': 'bool' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Make the end points of the lines rounded. `true`: rounded, `false`: perpendicular line ending "},
{'name': 'LINE_COLOR',
'style_type': 'color', 'var_type': 'lv_color_t' , 'default':'`0x000000`', 'inherited': 0, 'layout': 0, 'ext_draw': 0, 'filtered': 1,
'dsc': "Set the color of the lines."},
{'name': 'LINE_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':'`LV_OPA_COVER`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the opacity of the lines."},
{'section': 'Arc', 'dsc':'TODO' },
{'name': 'ARC_WIDTH',
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set the width (thickness) of the arcs in pixel."},
{'name': 'ARC_ROUNDED',
'style_type': 'num', 'var_type': 'bool' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Make the end points of the arcs rounded. `true`: rounded, `false`: perpendicular line ending "},
{'name': 'ARC_COLOR',
'style_type': 'color', 'var_type': 'lv_color_t', 'default':'`0x000000`', 'inherited': 0, 'layout': 0, 'ext_draw': 0, 'filtered': 1,
'dsc': "Set the color of the arc."},
{'name': 'ARC_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':'`LV_OPA_COVER`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the opacity of the arcs."},
{'name': 'ARC_IMAGE_SRC',
'style_type': 'ptr', 'var_type': 'const void *', 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set an image from which the arc will be masked out. It's useful to display complex effects on the arcs. Can be a pointer to `lv_image_dsc_t` or a path to a file"},
{'section': 'Text', 'dsc':'Properties to describe the properties of text. All these properties are inherited.' },
{'name': 'TEXT_COLOR',
'style_type': 'color', 'var_type': 'lv_color_t', 'default':'`0x000000`', 'inherited': 1, 'layout': 0, 'ext_draw': 0, 'filtered': 1,
'dsc': "Sets the color of the text."},
{'name': 'TEXT_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':'`LV_OPA_COVER`', 'inherited': 1, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the opacity of the text. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
{'name': 'TEXT_FONT',
'style_type': 'ptr', 'var_type': 'const lv_font_t *', 'default':'`LV_FONT_DEFAULT`', 'inherited': 1, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the font of the text (a pointer `lv_font_t *`). "},
{'name': 'TEXT_LETTER_SPACE',
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 1, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the letter space in pixels"},
{'name': 'TEXT_LINE_SPACE',
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 1, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the line space in pixels."},
{'name': 'TEXT_DECOR',
'style_type': 'num', 'var_type': 'lv_text_decor_t' , 'default':'`LV_TEXT_DECOR_NONE`', 'inherited': 1, 'layout': 0, 'ext_draw': 0,
'dsc': "Set decoration for the text. The possible values are `LV_TEXT_DECOR_NONE/UNDERLINE/STRIKETHROUGH`. OR-ed values can be used as well." },
{'name': 'TEXT_ALIGN',
'style_type': 'num', 'var_type': 'lv_text_align_t' , 'default':'`LV_TEXT_ALIGN_AUTO`', 'inherited': 1, 'layout': 1, 'ext_draw': 0,
'dsc': "Set how to align the lines of the text. Note that it doesn't align the object itself, only the lines inside the object. The possible values are `LV_TEXT_ALIGN_LEFT/CENTER/RIGHT/AUTO`. `LV_TEXT_ALIGN_AUTO` detect the text base direction and uses left or right alignment accordingly"},
{'section': 'Miscellaneous', 'dsc':'Mixed properties for various purposes.' },
{'name': 'RADIUS',
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the radius on every corner. The value is interpreted in pixel (>= 0) or `LV_RADIUS_CIRCLE` for max. radius"},
{'name': 'CLIP_CORNER',
'style_type': 'num', 'var_type': 'bool', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Enable to clip the overflowed content on the rounded corner. Can be `true` or `false`." },
{'name': 'OPA',
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':'`LV_OPA_COVER`', 'inherited': 1, 'layout': 0, 'ext_draw': 0,
'dsc': "Scale down all opacity values of the object by this factor. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency." },
{'name': 'OPA_LAYERED',
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':'`LV_OPA_COVER`', 'inherited': 1, 'layout': 0, 'ext_draw': 0,
'dsc': "First draw the object on the layer, then scale down layer opacity factor. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency." },
{'name': 'COLOR_FILTER_DSC',
'style_type': 'ptr', 'var_type': 'const lv_color_filter_dsc_t *', 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Mix a color to all colors of the object." },
{'name': 'COLOR_FILTER_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':'`LV_OPA_TRANSP`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "The intensity of mixing of color filter."},
{'name': 'ANIM',
'style_type': 'ptr', 'var_type': 'const lv_anim_t *', 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "The animation template for the object's animation. Should be a pointer to `lv_anim_t`. The animation parameters are widget specific, e.g. animation time could be the E.g. blink time of the cursor on the text area or scroll time of a roller. See the widgets' documentation to learn more."},
{'name': 'ANIM_DURATION',
'style_type': 'num', 'var_type': 'uint32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "The animation duration in milliseconds. Its meaning is widget specific. E.g. blink time of the cursor on the text area or scroll time of a roller. See the widgets' documentation to learn more."},
{'name': 'TRANSITION',
'style_type': 'ptr', 'var_type': 'const lv_style_transition_dsc_t *' , 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "An initialized `lv_style_transition_dsc_t` to describe a transition."},
{'name': 'BLEND_MODE',
'style_type': 'num', 'var_type': 'lv_blend_mode_t' , 'default':'`LV_BLEND_MODE_NORMAL`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Describes how to blend the colors to the background. The possible values are `LV_BLEND_MODE_NORMAL/ADDITIVE/SUBTRACTIVE/MULTIPLY`"},
{'name': 'LAYOUT',
'style_type': 'num', 'var_type': 'uint16_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the layout if the object. The children will be repositioned and resized according to the policies set for the layout. For the possible values see the documentation of the layouts."},
{'name': 'BASE_DIR',
'style_type': 'num', 'var_type': 'lv_base_dir_t', 'default':'`LV_BASE_DIR_AUTO`', 'inherited': 1, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the base direction of the object. The possible values are `LV_BIDI_DIR_LTR/RTL/AUTO`."},
{'section': 'Flex', 'dsc':'Flex layout properties.', 'guard':'LV_USE_FLEX'},
{'name': 'FLEX_FLOW',
'style_type': 'num', 'var_type': 'lv_flex_flow_t', 'default':'`LV_FLEX_FLOW_NONE`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Defines in which direct the flex layout should arrange the children"},
{'name': 'FLEX_MAIN_PLACE',
'style_type': 'num', 'var_type': 'lv_flex_align_t', 'default':'`LV_FLEX_ALIGN_NONE`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Defines how to align the children in the direction of flex flow"},
{'name': 'FLEX_CROSS_PLACE',
'style_type': 'num', 'var_type': 'lv_flex_align_t', 'default':'`LV_FLEX_ALIGN_NONE`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Defines how to align the children perpendicular to the direction of flex flow"},
{'name': 'FLEX_TRACK_PLACE',
'style_type': 'num', 'var_type': 'lv_flex_align_t', 'default':'`LV_FLEX_ALIGN_NONE`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Defines how to align the tracks of the flow"},
{'name': 'FLEX_GROW',
'style_type': 'num', 'var_type': 'uint8_t', 'default':'`LV_FLEX_ALIGN_ROW`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Defines how mayn space to take proprtionally the free space of the object's trach"},
{'section': 'Grid', 'dsc':'Grid layout properties.', 'guard':'LV_USE_GRID'},
{'name': 'GRID_COLUMN_DSC_ARRAY',
'style_type': 'ptr', 'var_type': 'const int32_t *', 'default':'`NULL`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "An array to describe the columns of the grid. Should be LV_GRID_TEMPLATE_LAST terminated"},
{'name': 'GRID_COLUMN_ALIGN',
'style_type': 'num', 'var_type': 'lv_grid_align_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Defines how to distribute the columns"},
{'name': 'GRID_ROW_DSC_ARRAY',
'style_type': 'ptr', 'var_type': 'const int32_t *', 'default':'`NULL`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "An array to describe the rows of the grid. Should be LV_GRID_TEMPLATE_LAST terminated"},
{'name': 'GRID_ROW_ALIGN',
'style_type': 'num', 'var_type': 'lv_grid_align_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Defines how to distribute the rows."},
{'name': 'GRID_CELL_COLUMN_POS',
'style_type': 'num', 'var_type': 'int32_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the column in which the object should be placed"},
{'name': 'GRID_CELL_X_ALIGN',
'style_type': 'num', 'var_type': 'lv_grid_align_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set how to align the object horizontally."},
{'name': 'GRID_CELL_COLUMN_SPAN',
'style_type': 'num', 'var_type': 'int32_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set how many columns the object should span. Needs to be >= 1"},
{'name': 'GRID_CELL_ROW_POS',
'style_type': 'num', 'var_type': 'int32_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the row in which the object should be placed"},
{'name': 'GRID_CELL_Y_ALIGN',
'style_type': 'num', 'var_type': 'lv_grid_align_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set how to align the object vertically."},
{'name': 'GRID_CELL_ROW_SPAN',
'style_type': 'num', 'var_type': 'int32_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set how many rows the object should span. Needs to be >= 1"},
]
def style_get_cast(style_type, var_type):
cast = ""
if style_type != 'color':
cast = "(" + var_type + ")"
return cast
def obj_style_get(p):
if 'section' in p: return
cast = style_get_cast(p['style_type'], p['var_type'])
print("static inline " + p['var_type'] + " lv_obj_get_style_" + p['name'].lower() +"(const lv_obj_t * obj, uint32_t part)")
print("{")
print(" lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_" + p['name'] + ");")
print(" return " + cast + "v." + p['style_type'] + ";")
print("}")
print("")
if 'filtered' in p and p['filtered']:
print("static inline " + p['var_type'] + " lv_obj_get_style_" + p['name'].lower() +"_filtered(const lv_obj_t * obj, uint32_t part)")
print("{")
print(" lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_" + p['name'] + "));")
print(" return " + cast + "v." + p['style_type'] + ";")
print("}")
print("")
def style_set_cast(style_type):
cast = ""
if style_type == 'num':
cast = "(int32_t)"
return cast
def style_set_c(p):
if 'section' in p: return
cast = style_set_cast(p['style_type'])
print("")
print("void lv_style_set_" + p['name'].lower() +"(lv_style_t * style, "+ p['var_type'] +" value)")
print("{")
print(" lv_style_value_t v = {")
print(" ." + p['style_type'] +" = " + cast + "value")
print(" };")
print(" lv_style_set_prop(style, LV_STYLE_" + p['name'] +", v);")
print("}")
print("")
print("const lv_style_prop_t _lv_style_const_prop_id_" + p['name'] + " = LV_STYLE_" + p['name'] + ";")
def style_set_h(p):
if 'section' in p: return
print("void lv_style_set_" + p['name'].lower() +"(lv_style_t * style, "+ p['var_type'] +" value);")
print("LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_" + p['name'] + ";")
def local_style_set_c(p):
if 'section' in p: return
cast = style_set_cast(p['style_type'])
print("")
print("void lv_obj_set_style_" + p['name'].lower() + "(lv_obj_t * obj, " + p['var_type'] +" value, lv_style_selector_t selector)")
print("{")
print(" lv_style_value_t v = {")
print(" ." + p['style_type'] +" = " + cast + "value")
print(" };")
print(" lv_obj_set_local_style_prop(obj, LV_STYLE_" + p['name'] +", v, selector);")
print("}")
def local_style_set_h(p):
if 'section' in p: return
print("void lv_obj_set_style_" + p['name'].lower() + "(lv_obj_t * obj, " + p['var_type'] +" value, lv_style_selector_t selector);")
def style_const_set(p):
if 'section' in p: return
cast = style_set_cast(p['style_type'])
print("")
print("#define LV_STYLE_CONST_" + p['name'] + "(val) \\")
print(" { \\")
print(" .prop_ptr = &_lv_style_const_prop_id_" + p['name'] + ", .value = { ." + p['style_type'] +" = " + cast + "val } \\")
print(" }")
def docs(p):
if "section" in p:
print("")
print("## " + p['section'])
print(p['dsc'])
return
if "default" not in p: return
d = str(p["default"])
i = "No"
if p["inherited"]: i = "Yes"
l = "No"
if p["layout"]: l = "Yes"
e = "No"
if p["ext_draw"]: e = "Yes"
li_style = "style='display:inline; margin-right: 20px; margin-left: 0px"
dsc = p['dsc']
print("")
print("### " + p["name"].lower())
print(dsc)
print("<ul>")
print("<li " + li_style + "'><strong>Default</strong> " + d + "</li>")
print("<li " + li_style + "'><strong>Inherited</strong> " + i + "</li>")
print("<li " + li_style + "'><strong>Layout</strong> " + l + "</li>")
print("<li " + li_style + "'><strong>Ext. draw</strong> " + e + "</li>")
print("</ul>")
def guard_proc(p):
global guard
if 'section' in p:
if guard:
guard_close()
if 'guard' in p:
guard = p['guard']
print(f"#if {guard}\n")
def guard_close():
global guard
if guard:
print(f"#endif /*{guard}*/\n")
guard = ""
base_dir = os.path.abspath(os.path.dirname(__file__))
sys.stdout = open(base_dir + '/../src/core/lv_obj_style_gen.h', 'w')
HEADING = f'''
/*
**********************************************************************
* DO NOT EDIT
* This file is automatically generated by "{os.path.split(__file__)[-1]}"
**********************************************************************
*/
'''
print(HEADING)
print('#ifndef LV_OBJ_STYLE_GEN_H')
print('#define LV_OBJ_STYLE_GEN_H')
print()
print("#include \"../misc/lv_area.h\"")
print("#include \"../misc/lv_style.h\"")
print("#include \"../core/lv_obj_style.h\"")
print()
guard = ""
for p in props:
guard_proc(p)
obj_style_get(p)
guard_close()
for p in props:
guard_proc(p)
local_style_set_h(p)
guard_close()
print()
print('#endif /* LV_OBJ_STYLE_GEN_H */')
sys.stdout = open(base_dir + '/../src/core/lv_obj_style_gen.c', 'w')
print(HEADING)
print("#include \"lv_obj.h\"")
print()
for p in props:
guard_proc(p)
local_style_set_c(p)
guard_close()
sys.stdout = open(base_dir + '/../src/misc/lv_style_gen.c', 'w')
print(HEADING)
print("#include \"lv_style.h\"")
print()
for p in props:
guard_proc(p)
style_set_c(p)
guard_close()
sys.stdout = open(base_dir + '/../src/misc/lv_style_gen.h', 'w')
print(HEADING)
print('#ifndef LV_STYLE_GEN_H')
print('#define LV_STYLE_GEN_H')
print()
for p in props:
guard_proc(p)
style_set_h(p)
guard_close()
for p in props:
guard_proc(p)
style_const_set(p)
guard_close()
print()
print('#endif /* LV_STYLE_GEN_H */')
sys.stdout = open(base_dir + '/../docs/overview/style-props.md', 'w')
print('# Style properties')
for p in props:
docs(p)

View File

@ -1,41 +0,0 @@
#!/usr/bin/env python3
import argparse
import re
MARK_LIST = ['tracing_mark_write']
def get_arg():
parser = argparse.ArgumentParser(description='Filter a log file to a trace file.')
parser.add_argument('log_file', metavar='log_file', type=str,
help='The input log file to process.')
parser.add_argument('trace_file', metavar='trace_file', type=str, nargs='?', default='trace.systrace',
help='The output trace file. If not provided, defaults to \'trace.systrace\'.')
args = parser.parse_args()
print('log_file: ' + args.log_file)
print('trace_file: ' + args.trace_file)
return args
if __name__ == '__main__':
args = get_arg()
with open(args.log_file, 'r') as f:
content = f.read()
# compile regex pattern
pattern = re.compile(r'(^.+-[0-9]+\s\[[0-9]]\s[0-9]+\.[0-9]+:\s('
+ "|".join(MARK_LIST)
+ r'):\s[B|E]\|[0-9]+\|.+$)', re.M)
matches = pattern.findall(content)
# write to args.trace_file
with open(args.trace_file, 'w') as f:
f.write('# tracer: nop\n#\n')
for match in matches:
f.write(match[0] + '\n')

View File

@ -1,229 +0,0 @@
/**
* @file lv_global.h
*
*/
#ifndef LV_GLOBAL_H
#define LV_GLOBAL_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../lv_conf_internal.h"
#include <stdbool.h>
#include "../misc/lv_types.h"
#include "../draw/lv_draw.h"
#if LV_USE_DRAW_SW
#include "../draw/sw/lv_draw_sw.h"
#endif
#include "../misc/lv_anim.h"
#include "../misc/lv_area.h"
#include "../misc/lv_color_op.h"
#include "../misc/lv_ll.h"
#include "../misc/lv_log.h"
#include "../misc/lv_profiler_builtin.h"
#include "../misc/lv_style.h"
#include "../misc/lv_timer.h"
#include "../others/sysmon/lv_sysmon.h"
#include "../stdlib/builtin/lv_tlsf.h"
#if LV_USE_FONT_COMPRESSED
#include "../font/lv_font_fmt_txt.h"
#endif
#include "../tick/lv_tick.h"
#include "../layouts/lv_layout.h"
/*********************
* DEFINES
*********************/
#define ZERO_MEM_SENTINEL 0xa1b2c3d4
/**********************
* TYPEDEFS
**********************/
#if LV_USE_SPAN != 0
struct _snippet_stack;
#endif
#if LV_USE_FREETYPE
struct _lv_freetype_context_t;
#endif
typedef struct _lv_global_t {
bool inited;
bool deinit_in_progress; /**< Can be used e.g. in the LV_EVENT_DELETE to deinit the drivers too */
lv_ll_t disp_ll;
lv_display_t * disp_refresh;
lv_display_t * disp_default;
lv_ll_t style_trans_ll;
bool style_refresh;
uint32_t style_custom_table_size;
uint32_t style_last_custom_prop_id;
uint8_t * style_custom_prop_flag_lookup_table;
lv_ll_t group_ll;
lv_group_t * group_default;
lv_ll_t indev_ll;
lv_indev_t * indev_active;
lv_obj_t * indev_obj_active;
uint32_t layout_count;
lv_layout_dsc_t * layout_list;
bool layout_update_mutex;
uint32_t memory_zero;
uint32_t math_rand_seed;
lv_area_transform_cache_t area_trans_cache;
lv_event_t * event_header;
uint32_t event_last_register_id;
lv_timer_state_t timer_state;
lv_anim_state_t anim_state;
lv_tick_state_t tick_state;
lv_draw_buf_handlers_t draw_buf_handlers;
lv_ll_t img_decoder_ll;
#if LV_CACHE_DEF_SIZE > 0
lv_cache_t * img_cache;
#endif
#if LV_IMAGE_HEADER_CACHE_DEF_CNT > 0
lv_cache_t * img_header_cache;
#endif
lv_draw_global_info_t draw_info;
#if defined(LV_DRAW_SW_SHADOW_CACHE_SIZE) && LV_DRAW_SW_SHADOW_CACHE_SIZE > 0
lv_draw_sw_shadow_cache_t sw_shadow_cache;
#endif
#if LV_DRAW_SW_COMPLEX
_lv_draw_sw_mask_radius_circle_dsc_arr_t sw_circle_cache;
#endif
#if LV_USE_LOG
lv_log_print_g_cb_t custom_log_print_cb;
#endif
#if LV_USE_LOG && LV_LOG_USE_TIMESTAMP
uint32_t log_last_log_time;
#endif
#if LV_USE_THEME_SIMPLE
void * theme_simple;
#endif
#if LV_USE_THEME_DEFAULT
void * theme_default;
#endif
#if LV_USE_THEME_MONO
void * theme_mono;
#endif
#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN
lv_tlsf_state_t tlsf_state;
#endif
lv_ll_t fsdrv_ll;
#if LV_USE_FS_STDIO != '\0'
lv_fs_drv_t stdio_fs_drv;
#endif
#if LV_USE_FS_POSIX
lv_fs_drv_t posix_fs_drv;
#endif
#if LV_USE_FS_FATFS
lv_fs_drv_t fatfs_fs_drv;
#endif
#if LV_USE_FS_WIN32 != '\0'
lv_fs_drv_t win32_fs_drv;
#endif
#if LV_USE_FREETYPE
struct _lv_freetype_context_t * ft_context;
#endif
#if LV_USE_TINY_TTF
lv_cache_t * tiny_ttf_cache;
#endif
#if LV_USE_FONT_COMPRESSED
lv_font_fmt_rle_t font_fmt_rle;
#endif
#if LV_USE_SPAN != 0
struct _snippet_stack * span_snippet_stack;
#endif
#if LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN
lv_profiler_builtin_ctx_t profiler_context;
#endif
#if LV_USE_FILE_EXPLORER != 0
lv_style_t fe_list_button_style;
#endif
#if LV_USE_SYSMON && LV_USE_PERF_MONITOR
lv_sysmon_backend_data_t sysmon_perf;
#endif
#if LV_USE_SYSMON && LV_USE_MEM_MONITOR
lv_sysmon_backend_data_t sysmon_mem;
#endif
#if LV_USE_IME_PINYIN != 0
size_t ime_cand_len;
#endif
#if LV_USE_OBJ_ID_BUILTIN
void * objid_array;
uint32_t objid_count;
#endif
void * user_data;
} lv_global_t;
/**********************
* MACROS
**********************/
#if LV_ENABLE_GLOBAL_CUSTOM
#include LV_GLOBAL_CUSTOM_INCLUDE
#ifndef LV_GLOBAL_CUSTOM
#define LV_GLOBAL_CUSTOM() lv_global_default()
#endif
#define LV_GLOBAL_DEFAULT() LV_GLOBAL_CUSTOM()
#else
LV_ATTRIBUTE_EXTERN_DATA extern lv_global_t lv_global;
#define LV_GLOBAL_DEFAULT() (&lv_global)
#endif
/**********************
* GLOBAL PROTOTYPES
**********************/
#if LV_ENABLE_GLOBAL_CUSTOM
/**
* Get the default global object for current thread
* @return pointer to the default global object
*/
lv_global_t * lv_global_default(void);
#endif
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*LV_GLOBAL_H*/

View File

@ -1,517 +0,0 @@
/**
* @file lv_group.c
*
*/
/*********************
* INCLUDES
*********************/
#include <stddef.h>
#include "lv_group.h"
#include "../core/lv_obj.h"
#include "../core/lv_global.h"
#include "../indev/lv_indev.h"
/*********************
* DEFINES
*********************/
#define default_group LV_GLOBAL_DEFAULT()->group_default
#define group_ll_p &(LV_GLOBAL_DEFAULT()->group_ll)
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static bool focus_next_core(lv_group_t * group, void * (*begin)(const lv_ll_t *),
void * (*move)(const lv_ll_t *, const void *));
static void lv_group_refocus(lv_group_t * g);
static lv_indev_t * get_indev(const lv_group_t * g);
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void _lv_group_init(void)
{
_lv_ll_init(group_ll_p, sizeof(lv_group_t));
}
void _lv_group_deinit(void)
{
_lv_ll_clear(group_ll_p);
}
lv_group_t * lv_group_create(void)
{
lv_group_t * group = _lv_ll_ins_head(group_ll_p);
LV_ASSERT_MALLOC(group);
if(group == NULL) return NULL;
_lv_ll_init(&group->obj_ll, sizeof(lv_obj_t *));
group->obj_focus = NULL;
group->frozen = 0;
group->focus_cb = NULL;
group->edge_cb = NULL;
group->editing = 0;
group->refocus_policy = LV_GROUP_REFOCUS_POLICY_PREV;
group->wrap = 1;
group->user_data = NULL;
return group;
}
void lv_group_delete(lv_group_t * group)
{
/*Defocus the currently focused object*/
if(group->obj_focus != NULL) {
lv_obj_send_event(*group->obj_focus, LV_EVENT_DEFOCUSED, get_indev(group));
lv_obj_invalidate(*group->obj_focus);
}
/*Remove the objects from the group*/
lv_obj_t ** obj;
_LV_LL_READ(&group->obj_ll, obj) {
if((*obj)->spec_attr)(*obj)->spec_attr->group_p = NULL;
}
/*Remove the group from any indev devices */
lv_indev_t * indev = lv_indev_get_next(NULL);
while(indev) {
if(lv_indev_get_group(indev) == group) {
lv_indev_set_group(indev, NULL);
}
indev = lv_indev_get_next(indev);
}
/*If the group is the default group, set the default group as NULL*/
if(group == lv_group_get_default()) lv_group_set_default(NULL);
_lv_ll_clear(&(group->obj_ll));
_lv_ll_remove(group_ll_p, group);
lv_free(group);
}
void lv_group_set_default(lv_group_t * group)
{
default_group = group;
}
lv_group_t * lv_group_get_default(void)
{
return default_group;
}
void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj)
{
if(group == NULL) return;
LV_LOG_TRACE("begin");
/*Be sure the object is removed from its current group*/
lv_group_remove_obj(obj);
/*Do not add the object twice*/
lv_obj_t ** obj_i;
_LV_LL_READ(&group->obj_ll, obj_i) {
if((*obj_i) == obj) {
LV_LOG_INFO("the object is already added to this group");
return;
}
}
/*If the object is already in a group and focused then refocus it*/
lv_group_t * group_cur = lv_obj_get_group(obj);
if(group_cur) {
if(obj->spec_attr->group_p && *(obj->spec_attr->group_p->obj_focus) == obj) {
lv_group_refocus(group_cur);
LV_LOG_INFO("changing object's group");
}
}
if(obj->spec_attr == NULL) lv_obj_allocate_spec_attr(obj);
obj->spec_attr->group_p = group;
lv_obj_t ** next = _lv_ll_ins_tail(&group->obj_ll);
LV_ASSERT_MALLOC(next);
if(next == NULL) return;
*next = obj;
/*If the head and the tail is equal then there is only one object in the linked list.
*In this case automatically activate it*/
if(_lv_ll_get_head(&group->obj_ll) == next) {
lv_group_refocus(group);
}
LV_LOG_TRACE("finished");
}
void lv_group_swap_obj(lv_obj_t * obj1, lv_obj_t * obj2)
{
lv_group_t * g1 = lv_obj_get_group(obj1);
lv_group_t * g2 = lv_obj_get_group(obj2);
if(g1 != g2) return;
if(g1 == NULL) return;
/*Do not add the object twice*/
lv_obj_t ** obj_i;
_LV_LL_READ(&g1->obj_ll, obj_i) {
if((*obj_i) == obj1)(*obj_i) = obj2;
else if((*obj_i) == obj2)(*obj_i) = obj1;
}
if(*g1->obj_focus == obj1) lv_group_focus_obj(obj2);
else if(*g1->obj_focus == obj2) lv_group_focus_obj(obj1);
}
void lv_group_remove_obj(lv_obj_t * obj)
{
lv_group_t * g = lv_obj_get_group(obj);
if(g == NULL) return;
LV_LOG_TRACE("begin");
/*Focus on the next object*/
if(g->obj_focus && *g->obj_focus == obj) {
if(g->frozen) g->frozen = 0;
/*If this is the only object in the group then focus to nothing.*/
if(_lv_ll_get_head(&g->obj_ll) == g->obj_focus && _lv_ll_get_tail(&g->obj_ll) == g->obj_focus) {
lv_obj_send_event(*g->obj_focus, LV_EVENT_DEFOCUSED, get_indev(g));
}
/*If there more objects in the group then focus to the next/prev object*/
else {
lv_group_refocus(g);
}
}
/*If the focuses object is still the same then it was the only object in the group but it will
*be deleted. Set the `obj_focus` to NULL to get back to the initial state of the group with
*zero objects*/
if(g->obj_focus && *g->obj_focus == obj) {
g->obj_focus = NULL;
}
/*Search the object and remove it from its group*/
lv_obj_t ** i;
_LV_LL_READ(&g->obj_ll, i) {
if(*i == obj) {
_lv_ll_remove(&g->obj_ll, i);
lv_free(i);
if(obj->spec_attr) obj->spec_attr->group_p = NULL;
break;
}
}
LV_LOG_TRACE("finished");
}
void lv_group_remove_all_objs(lv_group_t * group)
{
/*Defocus the currently focused object*/
if(group->obj_focus != NULL) {
lv_obj_send_event(*group->obj_focus, LV_EVENT_DEFOCUSED, get_indev(group));
lv_obj_invalidate(*group->obj_focus);
group->obj_focus = NULL;
}
/*Remove the objects from the group*/
lv_obj_t ** obj;
_LV_LL_READ(&group->obj_ll, obj) {
if((*obj)->spec_attr)(*obj)->spec_attr->group_p = NULL;
}
_lv_ll_clear(&(group->obj_ll));
}
void lv_group_focus_obj(lv_obj_t * obj)
{
if(obj == NULL) return;
lv_group_t * g = lv_obj_get_group(obj);
if(g == NULL) return;
if(g->frozen != 0) return;
/*On defocus edit mode must be leaved*/
lv_group_set_editing(g, false);
lv_obj_t ** i;
_LV_LL_READ(&g->obj_ll, i) {
if(*i == obj) {
if(g->obj_focus != NULL && obj != *g->obj_focus) { /*Do not defocus if the same object needs to be focused again*/
lv_result_t res = lv_obj_send_event(*g->obj_focus, LV_EVENT_DEFOCUSED, get_indev(g));
if(res != LV_RESULT_OK) return;
lv_obj_invalidate(*g->obj_focus);
}
g->obj_focus = i;
if(g->obj_focus != NULL) {
if(g->focus_cb) g->focus_cb(g);
lv_result_t res = lv_obj_send_event(*g->obj_focus, LV_EVENT_FOCUSED, get_indev(g));
if(res != LV_RESULT_OK) return;
lv_obj_invalidate(*g->obj_focus);
}
break;
}
}
}
void lv_group_focus_next(lv_group_t * group)
{
bool focus_changed = focus_next_core(group, _lv_ll_get_head, _lv_ll_get_next);
if(group->edge_cb) {
if(!focus_changed)
group->edge_cb(group, true);
}
}
void lv_group_focus_prev(lv_group_t * group)
{
bool focus_changed = focus_next_core(group, _lv_ll_get_tail, _lv_ll_get_prev);
if(group->edge_cb) {
if(!focus_changed)
group->edge_cb(group, false);
}
}
void lv_group_focus_freeze(lv_group_t * group, bool en)
{
if(en == false) group->frozen = 0;
else group->frozen = 1;
}
lv_result_t lv_group_send_data(lv_group_t * group, uint32_t c)
{
lv_obj_t * act = lv_group_get_focused(group);
if(act == NULL) return LV_RESULT_OK;
if(lv_obj_has_state(act, LV_STATE_DISABLED)) return LV_RESULT_OK;
return lv_obj_send_event(act, LV_EVENT_KEY, &c);
}
void lv_group_set_focus_cb(lv_group_t * group, lv_group_focus_cb_t focus_cb)
{
group->focus_cb = focus_cb;
}
void lv_group_set_edge_cb(lv_group_t * group, lv_group_edge_cb_t edge_cb)
{
group->edge_cb = edge_cb;
}
void lv_group_set_editing(lv_group_t * group, bool edit)
{
if(group == NULL) return;
uint8_t en_val = edit ? 1 : 0;
if(en_val == group->editing) return; /*Do not set the same mode again*/
group->editing = en_val;
lv_obj_t * focused = lv_group_get_focused(group);
if(focused) {
lv_result_t res = lv_obj_send_event(*group->obj_focus, LV_EVENT_FOCUSED, get_indev(group));
if(res != LV_RESULT_OK) return;
lv_obj_invalidate(focused);
}
}
void lv_group_set_refocus_policy(lv_group_t * group, lv_group_refocus_policy_t policy)
{
group->refocus_policy = policy & 0x01;
}
void lv_group_set_wrap(lv_group_t * group, bool en)
{
group->wrap = en ? 1 : 0;
}
lv_obj_t * lv_group_get_focused(const lv_group_t * group)
{
if(!group) return NULL;
if(group->obj_focus == NULL) return NULL;
return *group->obj_focus;
}
lv_group_focus_cb_t lv_group_get_focus_cb(const lv_group_t * group)
{
if(!group) return NULL;
return group->focus_cb;
}
lv_group_edge_cb_t lv_group_get_edge_cb(const lv_group_t * group)
{
if(!group) return NULL;
return group->edge_cb;
}
bool lv_group_get_editing(const lv_group_t * group)
{
if(!group) return false;
return group->editing;
}
bool lv_group_get_wrap(lv_group_t * group)
{
if(!group) return false;
return group->wrap;
}
uint32_t lv_group_get_obj_count(lv_group_t * group)
{
return _lv_ll_get_len(&group->obj_ll);
}
uint32_t lv_group_get_count(void)
{
return _lv_ll_get_len(group_ll_p);
}
lv_group_t * lv_group_by_index(uint32_t index)
{
uint32_t len = 0;
void * node;
for(node = _lv_ll_get_tail(group_ll_p); node != NULL; node = _lv_ll_get_prev(group_ll_p, node)) {
if(len == index) {
return (lv_group_t *) node;
}
len++;
}
return NULL;
}
/**********************
* STATIC FUNCTIONS
**********************/
static void lv_group_refocus(lv_group_t * g)
{
/*Refocus must temporarily allow wrapping to work correctly*/
uint8_t temp_wrap = g->wrap;
g->wrap = 1;
if(g->refocus_policy == LV_GROUP_REFOCUS_POLICY_NEXT)
lv_group_focus_next(g);
else if(g->refocus_policy == LV_GROUP_REFOCUS_POLICY_PREV)
lv_group_focus_prev(g);
/*Restore wrap property*/
g->wrap = temp_wrap;
}
static bool focus_next_core(lv_group_t * group, void * (*begin)(const lv_ll_t *),
void * (*move)(const lv_ll_t *, const void *))
{
bool focus_changed = false;
if(group->frozen) return focus_changed;
lv_obj_t ** obj_next = group->obj_focus;
lv_obj_t ** obj_sentinel = NULL;
bool can_move = true;
bool can_begin = true;
for(;;) {
if(obj_next == NULL) {
if(group->wrap || obj_sentinel == NULL) {
if(!can_begin) return focus_changed;
obj_next = begin(&group->obj_ll);
can_move = false;
can_begin = false;
}
else {
/*Currently focused object is the last/first in the group, keep it that way*/
return focus_changed;
}
}
if(obj_sentinel == NULL) {
obj_sentinel = obj_next;
if(obj_sentinel == NULL) return focus_changed; /*Group is empty*/
}
if(can_move) {
obj_next = move(&group->obj_ll, obj_next);
/*Give up if we walked the entire list and haven't found another visible object*/
if(obj_next == obj_sentinel) return focus_changed;
}
can_move = true;
if(obj_next == NULL) continue;
if(lv_obj_get_state(*obj_next) & LV_STATE_DISABLED) continue;
/*Hidden objects don't receive focus.
*If any parent is hidden, the object is also hidden)*/
lv_obj_t * parent = *obj_next;
while(parent) {
if(lv_obj_has_flag(parent, LV_OBJ_FLAG_HIDDEN)) break;
parent = lv_obj_get_parent(parent);
}
if(parent && lv_obj_has_flag(parent, LV_OBJ_FLAG_HIDDEN)) continue;
/*If we got her a good candidate is found*/
break;
}
if(obj_next == group->obj_focus) return focus_changed; /*There's only one visible object and it's already focused*/
if(group->obj_focus) {
lv_result_t res = lv_obj_send_event(*group->obj_focus, LV_EVENT_DEFOCUSED, get_indev(group));
if(res != LV_RESULT_OK) return focus_changed;
lv_obj_invalidate(*group->obj_focus);
}
group->obj_focus = obj_next;
lv_result_t res = lv_obj_send_event(*group->obj_focus, LV_EVENT_FOCUSED, get_indev(group));
if(res != LV_RESULT_OK) return focus_changed;
lv_obj_invalidate(*group->obj_focus);
if(group->focus_cb) group->focus_cb(group);
focus_changed = true;
return focus_changed;
}
/**
* Find an indev preferably with POINTER type (because it's the most generic) that uses the given group.
* In other words, find an indev, that is related to the given group.
* In the worst case simply return the latest indev
* @param g a group the find in the indevs
* @return the suggested indev
*/
static lv_indev_t * get_indev(const lv_group_t * g)
{
lv_indev_t * indev_guess = NULL;
lv_indev_t * indev = lv_indev_get_next(NULL);
while(indev) {
lv_indev_type_t indev_type = lv_indev_get_type(indev);
/*Prefer POINTER*/
if(indev_type == LV_INDEV_TYPE_POINTER) return indev;
if(lv_indev_get_group(indev) == g) {
indev_guess = indev;
}
indev = lv_indev_get_next(indev);
}
return indev_guess;
}

View File

@ -1,275 +0,0 @@
/**
* @file lv_group.h
*
*/
#ifndef LV_GROUP_H
#define LV_GROUP_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../lv_conf_internal.h"
#include <stdint.h>
#include <stdbool.h>
#include "../misc/lv_types.h"
#include "../misc/lv_ll.h"
/*********************
* DEFINES
*********************/
/*Predefined keys to control the focused object via lv_group_send(group, c)*/
enum _lv_key_t {
LV_KEY_UP = 17, /*0x11*/
LV_KEY_DOWN = 18, /*0x12*/
LV_KEY_RIGHT = 19, /*0x13*/
LV_KEY_LEFT = 20, /*0x14*/
LV_KEY_ESC = 27, /*0x1B*/
LV_KEY_DEL = 127, /*0x7F*/
LV_KEY_BACKSPACE = 8, /*0x08*/
LV_KEY_ENTER = 10, /*0x0A, '\n'*/
LV_KEY_NEXT = 9, /*0x09, '\t'*/
LV_KEY_PREV = 11, /*0x0B, '*/
LV_KEY_HOME = 2, /*0x02, STX*/
LV_KEY_END = 3, /*0x03, ETX*/
};
/**********************
* TYPEDEFS
**********************/
typedef void (*lv_group_focus_cb_t)(lv_group_t *);
typedef void (*lv_group_edge_cb_t)(lv_group_t *, bool);
/**
* Groups can be used to logically hold objects so that they can be individually focused.
* They are NOT for laying out objects on a screen (try layouts for that).
*/
struct _lv_group_t {
lv_ll_t obj_ll; /**< Linked list to store the objects in the group*/
lv_obj_t ** obj_focus; /**< The object in focus*/
lv_group_focus_cb_t focus_cb; /**< A function to call when a new object is focused (optional)*/
lv_group_edge_cb_t edge_cb; /**< A function to call when an edge is reached, no more focus
targets are available in this direction (to allow edge feedback
like a sound or a scroll bounce) */
void * user_data;
uint8_t frozen : 1; /**< 1: can't focus to new object*/
uint8_t editing : 1; /**< 1: Edit mode, 0: Navigate mode*/
uint8_t refocus_policy : 1; /**< 1: Focus prev if focused on deletion. 0: Focus next if focused on
deletion.*/
uint8_t wrap : 1; /**< 1: Focus next/prev can wrap at end of list. 0: Focus next/prev stops at end
of list.*/
};
typedef enum {
LV_GROUP_REFOCUS_POLICY_NEXT = 0,
LV_GROUP_REFOCUS_POLICY_PREV = 1
} lv_group_refocus_policy_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Init the group module
* @remarks Internal function, do not call directly.
*/
void _lv_group_init(void);
/**
* Deinit the group module
* @remarks Internal function, do not call directly.
*/
void _lv_group_deinit(void);
/**
* Create a new object group
* @return pointer to the new object group
*/
lv_group_t * lv_group_create(void);
/**
* Delete a group object
* @param group pointer to a group
*/
void lv_group_delete(lv_group_t * group);
/**
* Set a default group. New object are added to this group if it's enabled in their class with `add_to_def_group = true`
* @param group pointer to a group (can be `NULL`)
*/
void lv_group_set_default(lv_group_t * group);
/**
* Get the default group
* @return pointer to the default group
*/
lv_group_t * lv_group_get_default(void);
/**
* Add an object to a group
* @param group pointer to a group
* @param obj pointer to an object to add
*/
void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj);
/**
* Swap 2 object in a group. The object must be in the same group
* @param obj1 pointer to an object
* @param obj2 pointer to an other object
*/
void lv_group_swap_obj(lv_obj_t * obj1, lv_obj_t * obj2);
/**
* Remove an object from its group
* @param obj pointer to an object to remove
*/
void lv_group_remove_obj(lv_obj_t * obj);
/**
* Remove all objects from a group
* @param group pointer to a group
*/
void lv_group_remove_all_objs(lv_group_t * group);
/**
* Focus on an object (defocus the current)
* @param obj pointer to an object to focus on
*/
void lv_group_focus_obj(lv_obj_t * obj);
/**
* Focus the next object in a group (defocus the current)
* @param group pointer to a group
*/
void lv_group_focus_next(lv_group_t * group);
/**
* Focus the previous object in a group (defocus the current)
* @param group pointer to a group
*/
void lv_group_focus_prev(lv_group_t * group);
/**
* Do not let to change the focus from the current object
* @param group pointer to a group
* @param en true: freeze, false: release freezing (normal mode)
*/
void lv_group_focus_freeze(lv_group_t * group, bool en);
/**
* Send a control character to the focuses object of a group
* @param group pointer to a group
* @param c a character (use LV_KEY_.. to navigate)
* @return result of focused object in group.
*/
lv_result_t lv_group_send_data(lv_group_t * group, uint32_t c);
/**
* Set a function for a group which will be called when a new object is focused
* @param group pointer to a group
* @param focus_cb the call back function or NULL if unused
*/
void lv_group_set_focus_cb(lv_group_t * group, lv_group_focus_cb_t focus_cb);
/**
* Set a function for a group which will be called when a focus edge is reached
* @param group pointer to a group
* @param edge_cb the call back function or NULL if unused
*/
void lv_group_set_edge_cb(lv_group_t * group, lv_group_edge_cb_t edge_cb);
/**
* Set whether the next or previous item in a group is focused if the currently focused obj is
* deleted.
* @param group pointer to a group
* @param policy new refocus policy enum
*/
void lv_group_set_refocus_policy(lv_group_t * group, lv_group_refocus_policy_t policy);
/**
* Manually set the current mode (edit or navigate).
* @param group pointer to group
* @param edit true: edit mode; false: navigate mode
*/
void lv_group_set_editing(lv_group_t * group, bool edit);
/**
* Set whether focus next/prev will allow wrapping from first->last or last->first object.
* @param group pointer to group
* @param en true: wrapping enabled; false: wrapping disabled
*/
void lv_group_set_wrap(lv_group_t * group, bool en);
/**
* Get the focused object or NULL if there isn't one
* @param group pointer to a group
* @return pointer to the focused object
*/
lv_obj_t * lv_group_get_focused(const lv_group_t * group);
/**
* Get the focus callback function of a group
* @param group pointer to a group
* @return the call back function or NULL if not set
*/
lv_group_focus_cb_t lv_group_get_focus_cb(const lv_group_t * group);
/**
* Get the edge callback function of a group
* @param group pointer to a group
* @return the call back function or NULL if not set
*/
lv_group_edge_cb_t lv_group_get_edge_cb(const lv_group_t * group);
/**
* Get the current mode (edit or navigate).
* @param group pointer to group
* @return true: edit mode; false: navigate mode
*/
bool lv_group_get_editing(const lv_group_t * group);
/**
* Get whether focus next/prev will allow wrapping from first->last or last->first object.
* @param group pointer to group
* @param en true: wrapping enabled; false: wrapping disabled
*/
bool lv_group_get_wrap(lv_group_t * group);
/**
* Get the number of object in the group
* @param group pointer to a group
* @return number of objects in the group
*/
uint32_t lv_group_get_obj_count(lv_group_t * group);
/**
* Get the number of groups
* @return number of groups
*/
uint32_t lv_group_get_count(void);
/**
* Get a group by its index
* @return pointer to the group
*/
lv_group_t * lv_group_by_index(uint32_t index);
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*LV_GROUP_H*/

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