docs(macros): fix many macro links to API docs (#9533)

This commit is contained in:
Victor Wheeler
2026-01-26 08:31:31 -07:00
committed by GitHub
parent 4d9d354355
commit bcfba6b442
52 changed files with 337 additions and 314 deletions
+8 -2
View File
@@ -68,6 +68,10 @@ doxy_src_file_ext_list = [
'.h++' '.h++'
] ]
# Excluded from doxygen via EXCLUDE config item. (This config
# item is set in `doxygen_xml.py`.)
_cfg_exclude_list = ['lv_conf_internal.h']
# Multi-line match ``API + newline + \*\*\* + whitespace``. # Multi-line match ``API + newline + \*\*\* + whitespace``.
# NB: the ``\s*`` at the end forces the regex to match the whitespace # NB: the ``\s*`` at the end forces the regex to match the whitespace
# at the end including all \r\n's. This will match UP TO: # at the end including all \r\n's. This will match UP TO:
@@ -794,7 +798,9 @@ def _recursively_create_api_rst_files(depth: int,
# `ext` is converted to lower case so that any incidental case change # `ext` is converted to lower case so that any incidental case change
# in the extension on Windows will not break this algorithm. # in the extension on Windows will not break this algorithm.
if ext.lower() in doxy_src_file_ext_list: if ext.lower() in doxy_src_file_ext_list:
eligible = (dir_item in doxygen_xml.files) eligible = (dir_item in doxygen_xml.files
and dir_item not in _cfg_exclude_list)
if eligible: if eligible:
elig_h_files.append(path_bep) # Add file to list. elig_h_files.append(path_bep) # Add file to list.
elig_h_file_count += 1 elig_h_file_count += 1
@@ -818,7 +824,7 @@ def _recursively_create_api_rst_files(depth: int,
elig_sub_dirs.sort() elig_sub_dirs.sort()
elig_h_files.sort() elig_h_files.sort()
# Create index.rst plus .RST files for any .H* file directly in in dir. # Create index.rst plus .RST files for any .H* file directly in dir.
_create_rst_files_for_dir(src_root_len, _create_rst_files_for_dir(src_root_len,
src_dir_bep, src_dir_bep,
elig_h_files, elig_h_files,
+150 -152
View File
File diff suppressed because it is too large Load Diff
+9
View File
@@ -1640,6 +1640,15 @@ class DoxygenXml(object):
full_path = os.path.join(lvgl_src_dir, 'libs', 'gltf', 'fastgltf', 'lv_fastgltf.hpp') full_path = os.path.join(lvgl_src_dir, 'libs', 'gltf', 'fastgltf', 'lv_fastgltf.hpp')
exclude_paths.append(full_path) exclude_paths.append(full_path)
# As of 07-Jan-2026, LVGL doc-build now replaces `lv_conf_internal.h`
# (which has no Doxygen documentation) with a temporary `lv_conf.h`
# generated ONLY for the purpose of doc-builds, which file goes away
# after Doxygen is done. This causes conflicts of symbols between
# these 2 files because the former is a "generated copy" of the latter.
# So this exclusion removes the file with no documentation in it.
full_path = os.path.join(lvgl_src_dir, 'lv_conf_internal.h')
exclude_paths.append(full_path)
cfg.set('EXCLUDE', exclude_paths) cfg.set('EXCLUDE', exclude_paths)
# Include TAGFILES if requested. # Include TAGFILES if requested.
@@ -4,7 +4,8 @@
{#- Only this block is redefined (overridden) from furo/components/view-this-page.html. {#- Only this block is redefined (overridden) from furo/components/view-this-page.html.
All else remains intact. -#} All else remains intact. -#}
{% block link_available -%} {% block link_available -%}
{#- Ensure `page_source_suffix` exists, else `determine_page_view_link()` fails. -#} {#- Ensure `page_source_suffix` exists, else `determine_page_view_link()` fails
during generation of the `genindex` page at the end. -#}
{%- if page_source_suffix -%} {%- if page_source_suffix -%}
{%- set page_link = determine_page_view_link() -%} {%- set page_link = determine_page_view_link() -%}
{%- if "docs/src/API/" in page_link -%} {%- if "docs/src/API/" in page_link -%}
@@ -12,6 +13,10 @@
{%- set page_link = page_link.replace("docs/src/API/", "src/") -%} {%- set page_link = page_link.replace("docs/src/API/", "src/") -%}
{%- set page_link = page_link.replace("_h.rst", ".h") -%} {%- set page_link = page_link.replace("_h.rst", ".h") -%}
{%- set page_link = page_link.replace("?plain=true", "") -%} {%- set page_link = page_link.replace("?plain=true", "") -%}
{#- Redirect "src/lv_conf.h" => "lv_conf_template.h" -#}
{%- if page_link.endswith("/src/lv_conf.h") -%}
{%- set page_link = page_link.replace("/src/lv_conf.h", "/lv_conf_template.h") -%}
{%- endif -%}
{%- endif -%} {%- endif -%}
{{ furo_view_button(page_link) }} {{ furo_view_button(page_link) }}
{%- endif -%} {%- endif -%}
+1 -1
View File
@@ -90,7 +90,7 @@ If the tag is not found at all, the tag itself will be used as a fallback as wel
Dynamically Updating UI Text Dynamically Updating UI Text
**************************** ****************************
When :cpp:expr:`lv_translation_set_language("language")` is called, LVGL sends ``LV_EVENT_TRANSLATION_LANGUAGE_CHANGED`` to every widget, allowing you to update text automatically. When :cpp:expr:`lv_translation_set_language("language")` is called, LVGL sends :cpp:enumerator:`LV_EVENT_TRANSLATION_LANGUAGE_CHANGED` to every widget, allowing you to update text automatically.
The new language can be retrieved by either calling :cpp:expr:`lv_translation_get_language()` or by getting the event parameter in the event callback with :cpp:expr:`lv_event_get_param(e)` The new language can be retrieved by either calling :cpp:expr:`lv_translation_get_language()` or by getting the event parameter in the event callback with :cpp:expr:`lv_event_get_param(e)`
@@ -269,7 +269,7 @@ automatically as the parents size changes.
Content Content
------- -------
Use ``LV_SIZE_CONTENT`` to size the widget based on its children: Use :c:macro:`LV_SIZE_CONTENT` to size the widget based on its children:
.. code-block:: c .. code-block:: c
@@ -277,8 +277,8 @@ Use ``LV_SIZE_CONTENT`` to size the widget based on its children:
lv_obj_t * label = lv_label_create(cont); lv_obj_t * label = lv_label_create(cont);
lv_label_set_text(label, "Some text"); lv_label_set_text(label, "Some text");
Ignored for hidden (``LV_OBJ_FLAG_HIDDEN``) or floating (``LV_OBJ_FLAG_FLOATING``) Ignored for hidden (:cpp:enumerator:`LV_OBJ_FLAG_HIDDEN`) or floating
widgets. (:cpp:enumerator:`LV_OBJ_FLAG_FLOATING`) widgets.
Layouts Layouts
------- -------
@@ -294,7 +294,7 @@ Min and Max Size
LVGL supports ``min-width``, ``max-width``, ``min-height``, and ``max-height``. LVGL supports ``min-width``, ``max-width``, ``min-height``, and ``max-height``.
Use them to set limits when using ``LV_SIZE_CONTENT`` or percentage sizes: Use them to set limits when using :c:macro:`LV_SIZE_CONTENT` or percentage sizes:
.. code-block:: c .. code-block:: c
@@ -326,7 +326,7 @@ Useful for hover or press effects.
Percentage-based translation is relative to the widgets own size (not the parent). Percentage-based translation is relative to the widgets own size (not the parent).
Coordinate translation applies after layout and affects scrollbars and Coordinate translation applies after layout and affects scrollbars and
``LV_SIZE_CONTENT``. :c:macro:`LV_SIZE_CONTENT`.
+1 -1
View File
@@ -35,7 +35,7 @@ The available flags are:
- :cpp:enumerator:`LV_OBJ_FLAG_ADV_HITTEST`: Enable more accurate hit (click) testing (e.g., account for rounded corners). - :cpp:enumerator:`LV_OBJ_FLAG_ADV_HITTEST`: Enable more accurate hit (click) testing (e.g., account for rounded corners).
- :cpp:enumerator:`LV_OBJ_FLAG_IGNORE_LAYOUT`: Exclude the widget from layout positioning. - :cpp:enumerator:`LV_OBJ_FLAG_IGNORE_LAYOUT`: Exclude the widget from layout positioning.
- :cpp:enumerator:`LV_OBJ_FLAG_FLOATING`: Do not scroll with the parent and ignore layout. - :cpp:enumerator:`LV_OBJ_FLAG_FLOATING`: Do not scroll with the parent and ignore layout.
- :cpp:enumerator:`LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS`: Enable sending ``LV_EVENT_DRAW_TASK_ADDED`` events. - :cpp:enumerator:`LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS`: Enable sending :cpp:enumerator:`LV_EVENT_DRAW_TASK_ADDED` events.
- :cpp:enumerator:`LV_OBJ_FLAG_OVERFLOW_VISIBLE`: Allow children to overflow outside the widget's bounds. - :cpp:enumerator:`LV_OBJ_FLAG_OVERFLOW_VISIBLE`: Allow children to overflow outside the widget's bounds.
- :cpp:enumerator:`LV_OBJ_FLAG_RADIO_BUTTON`: Allow only one ``RADIO_BUTTON`` sibling to be checked. - :cpp:enumerator:`LV_OBJ_FLAG_RADIO_BUTTON`: Allow only one ``RADIO_BUTTON`` sibling to be checked.
- :cpp:enumerator:`LV_OBJ_FLAG_FLEX_IN_NEW_TRACK`: Start a new flex track on this item. - :cpp:enumerator:`LV_OBJ_FLAG_FLEX_IN_NEW_TRACK`: Start a new flex track on this item.
@@ -140,7 +140,7 @@ Limitations:
- The sub-grid is resolved only to a depth of 1 level. That is, a grid can have a - The sub-grid is resolved only to a depth of 1 level. That is, a grid can have a
sub-grid child, but that sub-grid cannot have another sub-grid. sub-grid child, but that sub-grid cannot have another sub-grid.
- ``LV_GRID_CONTENT`` tracks on the grid are not handled in the sub-grid, only in its - :c:macro:`LV_GRID_CONTENT` tracks on the grid are not handled in the sub-grid, only in its
own grid. own grid.
The sub-grid feature works the same as in CSS. For further information, see The sub-grid feature works the same as in CSS. For further information, see
+1 -1
View File
@@ -67,7 +67,7 @@ Setting Names
------------- -------------
To address these issues, LVGL introduces a powerful Widget naming system that can be enabled To address these issues, LVGL introduces a powerful Widget naming system that can be enabled
by setting ``LV_USE_OBJ_NAME`` in ``lv_conf.h``. by setting :c:macro:`LV_USE_OBJ_NAME` in ``lv_conf.h``.
A custom name can be assigned using :cpp:expr:`lv_obj_set_name(obj, "name")` or A custom name can be assigned using :cpp:expr:`lv_obj_set_name(obj, "name")` or
:cpp:expr:`lv_obj_set_name_static(obj, "name")`. The "static" variant requires that the passed :cpp:expr:`lv_obj_set_name_static(obj, "name")`. The "static" variant requires that the passed
+1 -5
View File
@@ -211,10 +211,6 @@ html_theme = 'furo'
# #
# Various other builders are derived from the HTML output, and also make use # Various other builders are derived from the HTML output, and also make use
# of these options. # of these options.
# Note: 'display_version' option is now obsolete in the current (08-Oct-2024)
# version of sphinx-rtd-theme (upgraded for Sphinx v8.x). The removed line
# is preserved by commenting it out in case it is ever needed again.
html_theme_options = { html_theme_options = {
"sidebar_hide_name": True, # True when the logo carries project name "sidebar_hide_name": True, # True when the logo carries project name
"light_logo": "images/logo-light.svg", "light_logo": "images/logo-light.svg",
@@ -453,7 +449,7 @@ todo_include_todos = True
# See https://sphinx-sitemap.readthedocs.io/en/latest/index.html # See https://sphinx-sitemap.readthedocs.io/en/latest/index.html
sitemap_url_scheme = "{link}" sitemap_url_scheme = "{link}"
# Prettyfy output using 4 spaces to indent. # Prettyfy output using 4 spaces to indent.
sitemap_prettify = 4 sitemap_indent = 4
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Options for breathe extension # Options for breathe extension
+10 -10
View File
@@ -65,21 +65,21 @@ Using Logging
You use the log module via the following macros: You use the log module via the following macros:
- ``LV_LOG_TRACE(text)`` - :c:macro:`LV_LOG_TRACE`\ (text)
- ``LV_LOG_INFO(text)`` - :c:macro:`LV_LOG_INFO`\ (text)
- ``LV_LOG_WARN(text)`` - :c:macro:`LV_LOG_WARN`\ (text)
- ``LV_LOG_ERROR(text)`` - :c:macro:`LV_LOG_ERROR`\ (text)
- ``LV_LOG_USER(text)`` - :c:macro:`LV_LOG_USER`\ (text)
- ``LV_LOG(text)`` - :c:macro:`LV_LOG`\ (text)
The first 5 macros append the following information to your ``text``: The first 5 macros append the following information to your ``text``:
- Log Level name ("Trace", "Info", "Warn", "Error", "User") - Log Level name ("Trace", "Info", "Warn", "Error", "User")
- \__FILE\_\_ - ``__FILE__``
- \__LINE\_\_ - ``__LINE__``
- \__func\_\_ - ``__func__``
``LV_LOG(text)`` is similar to ``LV_LOG_USER`` but has no extra information added. :c:macro:`LV_LOG`\ (text) is similar to :c:macro:`LV_LOG_USER` but has no extra information added.
+4 -4
View File
@@ -13,9 +13,9 @@ metrics directly on your display. It supports both performance monitoring
Dependencies Dependencies
************ ************
- Requires ``LV_USE_LABEL = 1`` in lv_conf.h - Requires :c:macro:`LV_USE_LABEL` = 1 in lv_conf.h
- Requires ``LV_USE_OBSERVER = 1`` in lv_conf.h - Requires :c:macro:`LV_USE_OBSERVER` = 1 in lv_conf.h
- Requires ``LV_USE_SYSMON = 1`` in lv_conf.h - Requires :c:macro:`LV_USE_SYSMON` = 1 in lv_conf.h
@@ -168,4 +168,4 @@ Timers
- Performance: ``perf_update_timer_cb`` - Performance: ``perf_update_timer_cb``
- Memory: ``mem_update_timer_cb`` - Memory: ``mem_update_timer_cb``
- Default period: 300ms (``LV_SYSMON_REFR_PERIOD_DEF``) - Default period: 300ms (:c:macro:`LV_SYSMON_REFR_PERIOD_DEF`)
+5 -5
View File
@@ -27,7 +27,7 @@ where there are no memory constraints.
Usage Usage
***** *****
The Test module can be enabled by configuring ``LV_USE_TEST`` to a non-zero value, The Test module can be enabled by configuring :c:macro:`LV_USE_TEST` to a non-zero value,
and it consists of the following components: and it consists of the following components:
- Helpers - Helpers
@@ -56,7 +56,7 @@ widget coordinates are recalculated.
Memory Usage Memory Usage
~~~~~~~~~~~~ ~~~~~~~~~~~~
If ``LV_USE_STDLIB_MALLOC`` is set to ``LV_STDLIB_BUILTIN``, memory usage and memory leaks can be monitored. If :c:macro:`LV_USE_STDLIB_MALLOC` is set to :c:macro:`LV_STDLIB_BUILTIN`, memory usage and memory leaks can be monitored.
.. code-block:: c .. code-block:: c
@@ -137,7 +137,7 @@ This function works in a practical way:
- If the folder(s) referenced in ``fn_ref`` do not exist, they will be created automatically. - If the folder(s) referenced in ``fn_ref`` do not exist, they will be created automatically.
- If the reference image is not found, it will be created automatically from the rendered screen - If the reference image is not found, it will be created automatically from the rendered screen
(unless ``LV_TEST_SCREENSHOT_CREATE_REFERENCE_IMAGE`` is ``0``). (unless :c:macro:`LV_TEST_SCREENSHOT_CREATE_REFERENCE_IMAGE` is ``0``).
- If the comparison fails, an ``<image_name>_err.png`` file will be created with the rendered content next to the reference image. - If the comparison fails, an ``<image_name>_err.png`` file will be created with the rendered content next to the reference image.
- If the comparison fails, the X and Y coordinates of the first divergent pixel, along with the actual and expected colors, will also be printed. - If the comparison fails, the X and Y coordinates of the first divergent pixel, along with the actual and expected colors, will also be printed.
@@ -162,10 +162,10 @@ To read and decode PNG images and to store the converted rendered image, a few M
The screenshot comparison uses ``lodepng`` which is built-in to LVGL and just needs to be enabled with The screenshot comparison uses ``lodepng`` which is built-in to LVGL and just needs to be enabled with
``LV_USE_LODEPNG``. :c:macro:`LV_USE_LODEPNG`.
To avoid making the entire Test module dependent on ``lodepng``, screenshot comparison can be individually enabled by To avoid making the entire Test module dependent on ``lodepng``, screenshot comparison can be individually enabled by
``LV_USE_TEST_SCREENSHOT_COMPARE``. :c:macro:`LV_USE_TEST_SCREENSHOT_COMPARE`.
.. _test_api: .. _test_api:
@@ -227,7 +227,7 @@ Solving the Problem
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
- Replace the global/static local var with :cpp:expr:`(LV_GLOBAL_DEFAULT()->_var)` - Replace the global/static local var with :cpp:expr:`(LV_GLOBAL_DEFAULT()->_var)`
- Include ``lv_global.h`` on files that use ``LV_GLOBAL_DEFAULT`` - Include ``lv_global.h`` on files that use :c:macro:`LV_GLOBAL_DEFAULT`
- Add ``_var`` to ``lv_global_t`` on ``lv_global.h`` - Add ``_var`` to ``lv_global_t`` on ``lv_global.h``
@@ -26,7 +26,7 @@ How to Use
In general: In general:
- you can set the macro :c:macro:`LV_USE_DRAW_ARM2D_SYNC` to ``1`` and - you can set the macro :c:macro:`LV_USE_DRAW_ARM2D_SYNC` to ``1`` and
:c:macro:`LV_DRAW_SW_ASM` to ``LV_DRAW_SW_ASM_HELIUM`` in ``lv_conf.h`` to :c:macro:`LV_DRAW_SW_ASM` to :c:macro:`LV_DRAW_SW_ASM_HELIUM` in ``lv_conf.h`` to
enable Arm-2D synchronous acceleration for LVGL. enable Arm-2D synchronous acceleration for LVGL.
- You can set - You can set
the macro :c:macro:`LV_USE_DRAW_ARM2D_ASYNC` to ``1`` in ``lv_conf.h`` to enable the macro :c:macro:`LV_USE_DRAW_ARM2D_ASYNC` to ``1`` in ``lv_conf.h`` to enable
@@ -61,7 +61,7 @@ LVGL has built-in support to improve the performance of software rendering by ut
Architecture Support Architecture Support
-------------------- --------------------
Both 32-bit and 64-bit ARM architectures are supported. Simply set ``LV_USE_DRAW_SW_ASM`` to ``LV_DRAW_SW_ASM_NEON`` in ``lv_conf``. Both 32-bit and 64-bit ARM architectures are supported. Simply set :c:macro:`LV_USE_DRAW_SW_ASM` to :c:macro:`LV_DRAW_SW_ASM_NEON` in ``lv_conf``.
.. note:: .. note::
All ARM Cortex-A and Cortex-R 64-bit processors include Neon support as a mandatory feature starting with the ARMv8 architecture specification. This makes Neon acceleration universally available on all 64-bit ARM platforms, including current and future ARM architectures. All ARM Cortex-A and Cortex-R 64-bit processors include Neon support as a mandatory feature starting with the ARMv8 architecture specification. This makes Neon acceleration universally available on all 64-bit ARM platforms, including current and future ARM architectures.
@@ -94,4 +94,4 @@ can enable LVGL's support for the corresponding RTOS and LVGL will use the
thread creation and synchronization primitives of the respective RTOS when thread creation and synchronization primitives of the respective RTOS when
rendering, depending on the renderers enabled. rendering, depending on the renderers enabled.
Set ``LV_USE_OS`` to ``LV_OS_FREERTOS`` or ``LV_OS_CMSIS_RTOS2``. Set :c:macro:`LV_USE_OS` to :c:macro:`LV_OS_FREERTOS` or :c:macro:`LV_OS_CMSIS_RTOS2`.
@@ -30,9 +30,9 @@ that use standard color formats, no gradient, no transforms, and no radius.
Usage Usage
***** *****
To use DMA2D in your project now, set ``LV_USE_DRAW_DMA2D`` To use DMA2D in your project now, set :c:macro:`LV_USE_DRAW_DMA2D`
to ``1`` in ``lv_conf.h``. You will need to specify the header for LVGL to ``1`` in ``lv_conf.h``. You will need to specify the header for LVGL
to include internally for DMA2D definitions. Set ``LV_DRAW_DMA2D_HAL_INCLUDE`` to include internally for DMA2D definitions. Set :c:macro:`LV_DRAW_DMA2D_HAL_INCLUDE`
to the corresponding header. E.g., if your STM32 model is an STM32U5, the to the corresponding header. E.g., if your STM32 model is an STM32U5, the
header name will likely be ``"stm32u5xx_hal.h"``. If you're using a framework, header name will likely be ``"stm32u5xx_hal.h"``. If you're using a framework,
ensure it will not be in contention with LVGL over the DMA2D peripheral. ensure it will not be in contention with LVGL over the DMA2D peripheral.
@@ -49,9 +49,9 @@ completion of before continuing, LVGL will spin waiting for
DMA2D to complete. If you would like the CPU to sleep or be scheduled to DMA2D to complete. If you would like the CPU to sleep or be scheduled to
other RTOS tasks while a DMA2D transfer is ongoing, do the following: other RTOS tasks while a DMA2D transfer is ongoing, do the following:
1. An RTOS/OS must be present. Set ``LV_USE_OS`` to one of the supported values 1. An RTOS/OS must be present. Set :c:macro:`LV_USE_OS` to one of the supported values
in ``lv_conf_template.h`` corresponding to the RTOS you're using. in ``lv_conf_template.h`` corresponding to the RTOS you're using.
2. Set ``LV_USE_DRAW_DMA2D_INTERRUPT`` to ``1`` in ``lv_conf.h``. 2. Set :c:macro:`LV_USE_DRAW_DMA2D_INTERRUPT` to ``1`` in ``lv_conf.h``.
3. You must call 3. You must call
:cpp:expr:`lv_draw_dma2d_transfer_complete_interrupt_handler()` :cpp:expr:`lv_draw_dma2d_transfer_complete_interrupt_handler()`
when you receive the global interrupt that signals when you receive the global interrupt that signals
@@ -61,7 +61,7 @@ other RTOS tasks while a DMA2D transfer is ongoing, do the following:
Interop with LTDC and NeoChrom Interop with LTDC and NeoChrom
****************************** ******************************
DMA2D usage can be freely mixed with LTDC usage as long as ``LV_ST_LTDC_USE_DMA2D_FLUSH`` DMA2D usage can be freely mixed with LTDC usage as long as :c:macro:`LV_ST_LTDC_USE_DMA2D_FLUSH`
is **not** enabled. LTDC will use the DMA2D peripheral for flushing, if that is enabled. is **not** enabled. LTDC will use the DMA2D peripheral for flushing, if that is enabled.
NeoChrom and DMA2D may be enabled at the same time. They are both draw units NeoChrom and DMA2D may be enabled at the same time. They are both draw units
@@ -94,15 +94,14 @@ To use vector graphics with NeoChrom, you should enable the following configs in
LV_USE_MATRIX 1 LV_USE_MATRIX 1
LV_USE_FLOAT 1 LV_USE_FLOAT 1
To use the SVG widget, additionally enable ``LV_USE_SVG``. To use the SVG widget, additionally enable :c:macro:`LV_USE_SVG`.
If there is RAM available, SVG performance can be increased by enabling the image cache, If there is RAM available, SVG performance can be increased by enabling the image cache, :c:macro:`LV_CACHE_DEF_SIZE`.
``LV_CACHE_DEF_SIZE``. :c:macro:`LV_CACHE_DEF_SIZE` is a cache size in bytes. If it is large enough for your SVGs,
``LV_CACHE_DEF_SIZE`` is a cache size in bytes. If it is large enough for your SVGs,
it will cache decoded SVG data so it does not need to be parsed every refresh, significantly it will cache decoded SVG data so it does not need to be parsed every refresh, significantly
reducing SVG redraw time. reducing SVG redraw time.
``LV_USE_DEMO_VECTOR_GRAPHIC`` is a demo you can enable which draws some vector graphics shapes. :c:macro:`LV_USE_DEMO_VECTOR_GRAPHIC` is a demo you can enable which draws some vector graphics shapes.
Gradient and image fills are not supported yet, as well as dashed strokes. These are Gradient and image fills are not supported yet, as well as dashed strokes. These are
missing from the demo when it is run with the NeoChrom driver. missing from the demo when it is run with the NeoChrom driver.
@@ -146,7 +146,7 @@ To enable this, set the following options in your ``lv_conf.h`` (or via Kconfig/
#define LV_USE_OPENGLES 1 #define LV_USE_OPENGLES 1
#define LV_USE_DRAW_OPENGLES 1 /* optional but recommended for performance */ #define LV_USE_DRAW_OPENGLES 1 /* optional but recommended for performance */
When ``LV_LINUX_DRM_USE_EGL`` is enabled, the DRM driver will automatically initialize EGL. When :c:macro:`LV_LINUX_DRM_USE_EGL` is enabled, the DRM driver will automatically initialize EGL.
No special setup is required beyond the basic DRM initialization shown in :ref:`linux_drm_basic_usage`. No special setup is required beyond the basic DRM initialization shown in :ref:`linux_drm_basic_usage`.
For a detailed overview of EGL usage and configuration, see :ref:`egl_driver`. For a detailed overview of EGL usage and configuration, see :ref:`egl_driver`.
@@ -157,7 +157,7 @@ Selecting Display Mode
.. note:: .. note::
Custom mode selection is currently only supported when using DRM with EGL Custom mode selection is currently only supported when using DRM with EGL
(``LV_LINUX_DRM_USE_EGL`` enabled). When using DRM without EGL, the driver (:c:macro:`LV_LINUX_DRM_USE_EGL` enabled). When using DRM without EGL, the driver
will always use the preferred display mode. will always use the preferred display mode.
By default, the DRM driver automatically selects the preferred display mode for the connected display. However, you can customize this behavior by providing a mode selection callback. By default, the DRM driver automatically selects the preferred display mode for the connected display. However, you can customize this behavior by providing a mode selection callback.
@@ -20,7 +20,7 @@ EGL with DRM
EGL can be used together with the DRM driver for hardware-accelerated rendering. EGL can be used together with the DRM driver for hardware-accelerated rendering.
When ``LV_LINUX_DRM_USE_EGL`` is enabled, the DRM driver will automatically set up EGL. When :c:macro:`LV_LINUX_DRM_USE_EGL` is enabled, the DRM driver will automatically set up EGL.
No additional initialization is required beyond the normal DRM setup. No additional initialization is required beyond the normal DRM setup.
See :ref:`linux_drm` for configuration and a basic usage example. See :ref:`linux_drm` for configuration and a basic usage example.
@@ -32,7 +32,7 @@ EGL without DRM (Experimental)
This feature is experimental and the API is private. Expect breaking changes. This feature is experimental and the API is private. Expect breaking changes.
If you want to use EGL without being tied to DRM, you can enable ``LV_USE_EGL`` using a compiler definition. If you want to use EGL without being tied to DRM, you can enable :c:macro:`LV_USE_EGL` using a compiler definition.
This API is currently private and experimental, and people should expect breaking changes. This API is currently private and experimental, and people should expect breaking changes.
.. code-block:: bash .. code-block:: bash
@@ -22,8 +22,8 @@ mode.
.. code-block:: c .. code-block:: c
#define LV_USE_LINUX_FBDEV 1 #define LV_USE_LINUX_FBDEV 1
#define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL #define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL
Usage Usage
----- -----
@@ -33,12 +33,13 @@ node on the display (usually this is ``/dev/fb0``).
.. code-block:: c .. code-block:: c
lv_display_t *disp = lv_linux_fbdev_create(); lv_display_t *disp = lv_linux_fbdev_create();
lv_linux_fbdev_set_file(disp, "/dev/fb0"); lv_linux_fbdev_set_file(disp, "/dev/fb0");
If your screen stays black or only draws partially, you can try enabling direct rendering via ``LV_DISPLAY_RENDER_MODE_DIRECT``. Additionally, If your screen stays black or only draws partially, you can try enabling direct
you can activate a force refresh mode with ``lv_linux_fbdev_set_force_refresh(true)``. This usually has a performance impact though and shouldn't rendering via :cpp:enumerator:`LV_DISPLAY_RENDER_MODE_DIRECT`. Additionally, you can
be enabled unless really needed. activate a force refresh mode with ``lv_linux_fbdev_set_force_refresh(true)``. This
usually has a performance impact though and shouldn't be enabled unless really needed.
Hide the cursor Hide the cursor
--------------- ---------------
@@ -47,8 +48,8 @@ You may encounter a blinking cursor on the screen. The method to hide it
varies depending on the platform. For instance, here is how it can be done varies depending on the platform. For instance, here is how it can be done
on a Raspberry Pi: on a Raspberry Pi:
1. Edit ``/boot/cmdline.txt`` file. 1. Edit ``/boot/cmdline.txt`` file.
2. Add ``vt.global_cursor_default=0``. 2. Add ``vt.global_cursor_default=0``.
Common mistakes Common mistakes
--------------- ---------------
@@ -74,7 +75,7 @@ device, such as resolution, pixel depth, and timings.
.. code-block:: .. code-block::
fbset -fb /dev/fb0 fbset -fb /dev/fb0
To prevent display-related issues, it is recommended to ensure all devices, To prevent display-related issues, it is recommended to ensure all devices,
including the HDMI display, are connected and powered on before powering up including the HDMI display, are connected and powered on before powering up
@@ -56,13 +56,13 @@ Usage
----- -----
To set up an input device via the libinput driver, all you need to do is call ``lv_libinput_create`` with the respective device type To set up an input device via the libinput driver, all you need to do is call ``lv_libinput_create`` with the respective device type
(``LV_INDEV_TYPE_POINTER`` or ``LV_INDEV_TYPE_KEYPAD``) and device node path (e.g. ``/dev/input/event5``). (:cpp:enumerator:`LV_INDEV_TYPE_POINTER` or :cpp:enumerator:`LV_INDEV_TYPE_KEYPAD`) and device node path (e.g. ``/dev/input/event5``).
.. code-block:: c .. code-block:: c
lv_indev_t *indev = lv_libinput_create(LV_INDEV_TYPE_POINTER, "/dev/input/event5"); lv_indev_t *indev = lv_libinput_create(LV_INDEV_TYPE_POINTER, "/dev/input/event5");
Note that touchscreens are treated as (absolute) pointer devices by the libinput driver and require ``LV_INDEV_TYPE_POINTER``. Note that touchscreens are treated as (absolute) pointer devices by the libinput driver and require :cpp:enumerator:`LV_INDEV_TYPE_POINTER`.
Depending on your system, the device node paths might not be stable across reboots. If this is the case, you can use ``lv_libinput_find_dev`` Depending on your system, the device node paths might not be stable across reboots. If this is the case, you can use ``lv_libinput_find_dev``
to find the first device that has a specific capability. to find the first device that has a specific capability.
@@ -161,7 +161,7 @@ Getting started
#. In ``main.c`` ``#include "lv_drivers/wayland/wayland.h"`` #. In ``main.c`` ``#include "lv_drivers/wayland/wayland.h"``
#. Enable the Wayland driver in ``lv_conf.h`` with ``LV_USE_WAYLAND 1`` #. Enable the Wayland driver in ``lv_conf.h`` with ``LV_USE_WAYLAND 1``
#. ``LV_COLOR_DEPTH`` should be set either to ``32`` or ``16`` in ``lv_conf.h`` #. :c:macro:`LV_COLOR_DEPTH` should be set either to ``32`` or ``16`` in ``lv_conf.h``
#. Add a display using ``lv_wayland_window_create()``, #. Add a display using ``lv_wayland_window_create()``,
possibly with a close callback to track the status of each display: possibly with a close callback to track the status of each display:
@@ -303,7 +303,7 @@ The wayland driver is currently under construction, bug reports, contributions a
It is however important to create detailed issues when a problem is encountered, logs and screenshots of the problem are of great help. It is however important to create detailed issues when a problem is encountered, logs and screenshots of the problem are of great help.
Please enable ``LV_USE_LOG`` and launch the simulator executable like so Please enable :c:macro:`LV_USE_LOG` and launch the simulator executable like so
.. code:: .. code::
@@ -227,7 +227,8 @@ are available if needed. They are wrappers around ``EVE_memRead8()``, etc.
Register definitions and other EVE enumerations are available when you include Register definitions and other EVE enumerations are available when you include
``lvgl.h`` under the prefix namespace ``LV_EVE_``. I.e., ``REG_ID`` is available ``lvgl.h`` under the prefix namespace ``LV_EVE_``. I.e., ``REG_ID`` is available
as ``LV_EVE_REG_ID`` and ``EVE_ROM_CHIPID`` is available as ``LV_EVE_EVE_ROM_CHIPID``, etc. as :c:macro:`LV_EVE_REG_ID` and :c:macro:`EVE_ROM_CHIPID` is available as
:c:macro:`LV_EVE_EVE_ROM_CHIPID`, etc.
Further Reading Further Reading
@@ -299,8 +299,8 @@ The commands must be put into a 'uint8_t' array:
lv_lcd_generic_mipi_send_cmd_list(my_disp, init_cmd_list); lv_lcd_generic_mipi_send_cmd_list(my_disp, init_cmd_list);
You can add a delay between the commands by using the pseudo-command You can add a delay between the commands by using the pseudo-command
``LV_LCD_CMD_DELAY_MS``, which must be followed by the delay given in 10ms units. To :c:macro:`LV_LCD_CMD_DELAY_MS`, which must be followed by the delay given in 10ms units. To
terminate the command list you must use a delay with a value of ``LV_LCD_CMD_EOF``, terminate the command list you must use a delay with a value of :c:macro:`LV_LCD_CMD_EOF`,
as shown above. as shown above.
See an actual example of sending a command list See an actual example of sending a command list
+1 -1
View File
@@ -91,7 +91,7 @@ Use of MUTEXes requires:
2. releasing the MUTEX (unlocking it) afterwards. 2. releasing the MUTEX (unlocking it) afterwards.
If your OS is integrated with LVGL (the macro :c:macro:`LV_USE_OS` has a value If your OS is integrated with LVGL (the macro :c:macro:`LV_USE_OS` has a value
other than ``LV_OS_NONE`` in ``lv_conf.h``) you can use :cpp:func:`lv_lock()` and other than :c:macro:`LV_OS_NONE` in ``lv_conf.h``) you can use :cpp:func:`lv_lock()` and
:cpp:func:`lv_unlock()` to perform #1 and #2. :cpp:func:`lv_unlock()` to perform #1 and #2.
When this is the case, :cpp:func:`lv_timer_handler` calls :cpp:func:`lv_lock()` When this is the case, :cpp:func:`lv_timer_handler` calls :cpp:func:`lv_lock()`
+2 -2
View File
@@ -239,8 +239,8 @@ reasonable as NuttX fully implements these standard library APIs. Whether or
not you choose to use NuttX's ``malloc`` depends on whether you want LVGL not you choose to use NuttX's ``malloc`` depends on whether you want LVGL
to allocate from the NuttX global heap or use its own. to allocate from the NuttX global heap or use its own.
Where is ``LV_OS_NUTTX``? Where is :c:macro:`LV_OS_NUTTX`?
------------------------- --------------------------------
NuttX tries to be POSIX compliant where possible, meaning it supports NuttX tries to be POSIX compliant where possible, meaning it supports
pthreads (POSIX threads). To enable OS features in LVGL on NuttX, pthreads (POSIX threads). To enable OS features in LVGL on NuttX,
+1 -1
View File
@@ -133,7 +133,7 @@ This is achieved by setting the style attributes with the
You will have to account for the increased width and height of letter due to the added letter outline, You will have to account for the increased width and height of letter due to the added letter outline,
to avoid letters overlapping space them out using :cpp:func:`lv_style_set_text_letter_space` to avoid letters overlapping space them out using :cpp:func:`lv_style_set_text_letter_space`
To use vector fonts with ThorVG, you will have to enable ``LV_USE_VECTOR_GRAPHICS`` in ``lv_conf.h`` To use vector fonts with ThorVG, you will have to enable :c:macro:`LV_USE_VECTOR_GRAPHICS` in ``lv_conf.h``
.. note:: .. note::
+2 -2
View File
@@ -70,8 +70,8 @@ blob builds.
Usage in LVGL Usage in LVGL
************* *************
Set ``LV_USE_FS_FROGFS`` to ``1`` in your ``lv_conf.h``. Set Set :c:macro:`LV_USE_FS_FROGFS` to ``1`` in your ``lv_conf.h``. Set
``LV_FS_FROGFS_LETTER`` to a letter like ``'F'``. :c:macro:`LV_FS_FROGFS_LETTER` to a letter like ``'F'``.
.. code-block:: c .. code-block:: c
+14 -9
View File
@@ -357,7 +357,7 @@ In order to read them, you must first register an event callback.
This event callback will be called every time the node properties change. This event callback will be called every time the node properties change.
Property values can only be read from within the ``LV_EVENT_VALUE_CHANGED`` Property values can only be read from within the :cpp:enumerator:`LV_EVENT_VALUE_CHANGED`
callback to ensure data validity. callback to ensure data validity.
.. code-block:: c .. code-block:: c
@@ -407,15 +407,20 @@ Note: World position registration incurs additional computational cost due to ma
.. important:: .. important::
- The ``LV_EVENT_VALUE_CHANGED`` event fires only when node properties are modified, not every frame - The :cpp:enumerator:`LV_EVENT_VALUE_CHANGED` event fires only when node
- Getter functions return ``LV_RESULT_INVALID`` if called outside the event callback, ensuring you never read stale data properties are modified, not every frame.
- Calling :cpp:func:`lv_gltf_model_node_get_world_position` without world position registration will return ``LV_RESULT_INVALID`` - Getter functions return :cpp:enumerator:`LV_RESULT_INVALID` if called outside
the event callback, ensuring you never read stale data.
- Calling :cpp:func:`lv_gltf_model_node_get_world_position` without world
position registration will return :cpp:enumerator:`LV_RESULT_INVALID`.
.. tip:: .. tip::
When using the root node, the local position will equal the world position, meaning you can subscribe to
:cpp:func:`lv_gltf_model_node_add_event_cb` instead of :cpp:func:`lv_gltf_model_node_add_event_cb_with_world_position` When using the root node, the local position will equal the world position, meaning
and use :cpp:func:`lv_gltf_model_node_get_local_position` to get the world position without the computational you can subscribe to :cpp:func:`lv_gltf_model_node_add_event_cb` instead of
overhead of matrix calculations. :cpp:func:`lv_gltf_model_node_add_event_cb_with_world_position` and use
:cpp:func:`lv_gltf_model_node_get_local_position` to get the world position without
the computational overhead of matrix calculations.
Finding Nodes Finding Nodes
------------- -------------
@@ -579,7 +584,7 @@ Animation Speed System
Animation speeds use integer values to avoid floating-point arithmetic: Animation speeds use integer values to avoid floating-point arithmetic:
- The speed ratio is calculated as: ``speed_value / LV_GLTF_ANIM_SPEED_NORMAL`` - The speed ratio is calculated as: ``speed_value / LV_GLTF_ANIM_SPEED_NORMAL``
- ``LV_GLTF_ANIM_SPEED_NORMAL`` equals 1000, representing 1.0x (normal) speed - :c:macro:`LV_GLTF_ANIM_SPEED_NORMAL` equals 1000, representing 1.0x (normal) speed
- Values greater than 1000 speed up animations (e.g., 2000 = 2.0x speed) - Values greater than 1000 speed up animations (e.g., 2000 = 2.0x speed)
- Values less than 1000 slow down animations (e.g., 500 = 0.5x speed) - Values less than 1000 slow down animations (e.g., 500 = 0.5x speed)
+3 -3
View File
@@ -20,10 +20,10 @@ binary data is directly decoded to RAM.
Which Library Which Library
************* *************
If ``LV_USE_LZ4_INTERNAL`` is enabled in ``lv_conf.h``, LVGL's internal copy of the If :c:macro:`LV_USE_LZ4_INTERNAL` is enabled in ``lv_conf.h``, LVGL's internal copy of the
LZ4 decompression algorithm is used (``./src/libs/lz4/lz4.c``). LZ4 decompression algorithm is used (``./src/libs/lz4/lz4.c``).
If ``LV_USE_LZ4_EXTERNAL`` is enabled, the LVGL project is assumed to be compiled and If :c:macro:`LV_USE_LZ4_EXTERNAL` is enabled, the LVGL project is assumed to be compiled and
linked with an external LZ4 library that provides the :cpp:func:`LZ4_decompress_safe` linked with an external LZ4 library that provides the :cpp:func:`LZ4_decompress_safe`
function. function.
@@ -50,7 +50,7 @@ Usage
***** *****
To use the LZ4 Decoder, enable it in ``lv_conf.h`` configuration file by setting To use the LZ4 Decoder, enable it in ``lv_conf.h`` configuration file by setting
either ``LV_USE_LZ4_INTERNAL`` or ``LV_USE_LZ4_EXTERNAL`` to ``1``. LZ4 images can either :c:macro:`LV_USE_LZ4_INTERNAL` or :c:macro:`LV_USE_LZ4_EXTERNAL` to ``1``. LZ4 images can
then be used in the same way as other images. then be used in the same way as other images.
.. code-block:: c .. code-block:: c
+40 -40
View File
@@ -19,7 +19,7 @@ LVGL's GStreamer implementation provides comprehensive media playback capabiliti
**Media Source Support:** **Media Source Support:**
* Local files via file:// URIs * Local files via ``file://`` URIs
* Network streaming with HTTP/HTTPS support * Network streaming with HTTP/HTTPS support
* RTSP streaming for live video feeds * RTSP streaming for live video feeds
* UDP streaming for low-latency applications * UDP streaming for low-latency applications
@@ -30,7 +30,7 @@ LVGL's GStreamer implementation provides comprehensive media playback capabiliti
**URI Scheme Support:** **URI Scheme Support:**
Using the URI factory (``LV_GSTREAMER_FACTORY_URI_DECODE``), you can specify various URI schemes as media sources: Using the URI factory (:c:macro:`LV_GSTREAMER_FACTORY_URI_DECODE`), you can specify various URI schemes as media sources:
* **Local files**: ``file://path/to/video.mp4`` * **Local files**: ``file://path/to/video.mp4``
* **Web streams**: ``http://example.com/stream.webm``, ``https://secure.example.com/video.mp4`` * **Web streams**: ``http://example.com/stream.webm``, ``https://secure.example.com/video.mp4``
@@ -89,58 +89,58 @@ Setup
**Option 1: Direct linking with LVGL (Recommended)** **Option 1: Direct linking with LVGL (Recommended)**
.. code-block:: cmake .. code-block:: cmake
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)
# Find GStreamer packages # Find GStreamer packages
pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0) pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0)
pkg_check_modules(GSTREAMER_VIDEO REQUIRED gstreamer-video-1.0) pkg_check_modules(GSTREAMER_VIDEO REQUIRED gstreamer-video-1.0)
pkg_check_modules(GSTREAMER_APP REQUIRED gstreamer-app-1.0) pkg_check_modules(GSTREAMER_APP REQUIRED gstreamer-app-1.0)
# Link with LVGL # Link with LVGL
target_include_directories(lvgl PUBLIC target_include_directories(lvgl PUBLIC
${GSTREAMER_INCLUDE_DIRS} ${GSTREAMER_INCLUDE_DIRS}
${GSTREAMER_VIDEO_INCLUDE_DIRS} ${GSTREAMER_VIDEO_INCLUDE_DIRS}
${GSTREAMER_APP_INCLUDE_DIRS}) ${GSTREAMER_APP_INCLUDE_DIRS})
target_link_libraries(lvgl PUBLIC target_link_libraries(lvgl PUBLIC
${GSTREAMER_LIBRARIES} ${GSTREAMER_LIBRARIES}
${GSTREAMER_VIDEO_LIBRARIES} ${GSTREAMER_VIDEO_LIBRARIES}
${GSTREAMER_APP_LIBRARIES}) ${GSTREAMER_APP_LIBRARIES})
4. **Manual Compilation with pkg-config** 4. **Manual Compilation with pkg-config**
You can also compile manually using pkg-config to query the necessary flags: You can also compile manually using pkg-config to query the necessary flags:
.. code-block:: bash .. code-block:: bash
# Get compilation flags # Get compilation flags
gcc $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-video-1.0 gstreamer-app-1.0) \ gcc $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-video-1.0 gstreamer-app-1.0) \
-o your_app your_app.c lvgl.a -o your_app your_app.c lvgl.a
5. **Basic Setup Example** 5. **Basic Setup Example**
.. code-block:: c .. code-block:: c
int main(void) int main(void)
{ {
/* Initialize LVGL */ /* Initialize LVGL */
lv_init(); lv_init();
/* Setup display driver */ /* Setup display driver */
lv_display_t *display = lv_display_create(800, 480); lv_display_t *display = lv_display_create(800, 480);
/* ... configure display driver ... */ /* ... configure display driver ... */
/* Create and run your GStreamer application */ /* Create and run your GStreamer application */
lv_example_gstreamer_1(); lv_example_gstreamer_1();
while (1) { while (1) {
lv_timer_handler(); lv_timer_handler();
}
return 0;
} }
return 0;
}
Usage Usage
***** *****
@@ -280,10 +280,10 @@ State Management
The GStreamer widget maintains these states: The GStreamer widget maintains these states:
- ``LV_GSTREAMER_STATE_NULL``: Initial state, no media loaded - :cpp:enumerator:`LV_GSTREAMER_STATE_NULL`: Initial state, no media loaded
- ``LV_GSTREAMER_STATE_READY``: Media loaded and ready to play - :cpp:enumerator:`LV_GSTREAMER_STATE_READY`: Media loaded and ready to play
- ``LV_GSTREAMER_STATE_PAUSED``: Playback paused - :cpp:enumerator:`LV_GSTREAMER_STATE_PAUSED`: Playback paused
- ``LV_GSTREAMER_STATE_PLAYING``: Active playback - :cpp:enumerator:`LV_GSTREAMER_STATE_PLAYING`: Active playback
Media Information Access Media Information Access
------------------------ ------------------------
+5 -2
View File
@@ -19,8 +19,8 @@ def lvgl_version(version_file):
if version_file is not None: if version_file is not None:
with open(version_file, 'r') as file: with open(version_file, 'r') as file:
major_re = re.compile(r'define\s+LVGL_VERSION_MAJOR\s+(\d+)') major_re = re.compile(r'#\s*define\s+LVGL_VERSION_MAJOR\s+(\d+)')
minor_re = re.compile(r'define\s+LVGL_VERSION_MINOR\s+(\d+)') minor_re = re.compile(r'#\s*define\s+LVGL_VERSION_MINOR\s+(\d+)')
for line in file.readlines(): for line in file.readlines():
# Skip if line not long enough to match. # Skip if line not long enough to match.
@@ -30,6 +30,9 @@ def lvgl_version(version_file):
match = major_re.search(line) match = major_re.search(line)
if match is not None: if match is not None:
major = match[1] major = match[1]
# Exit early if we have both values.
if len(major) > 0 and len(minor) > 0:
break
else: else:
match = minor_re.search(line) match = minor_re.search(line)
if match is not None: if match is not None:
@@ -394,7 +394,7 @@ shapes, text, or images. It includes the following fields:
:spread: Expands the rectangle in all directions; can be negative. :spread: Expands the rectangle in all directions; can be negative.
:ofs_x: Horizontal offset. :ofs_x: Horizontal offset.
:ofs_y: Vertical offset. :ofs_y: Vertical offset.
:opa: Opacity (0--255 range). Values like ``LV_OPA_TRANSP``, ``LV_OPA_10``, :opa: Opacity (0--255 range). Values like :cpp:enumerator:`LV_OPA_TRANSP`, :cpp:enumerator:`LV_OPA_10`,
etc., can also be used. etc., can also be used.
:bg_cover: Set to 1 if the background will cover the shadow (a hint for the :bg_cover: Set to 1 if the background will cover the shadow (a hint for the
renderer to skip masking). renderer to skip masking).
@@ -421,7 +421,7 @@ image drawing. It is a complex descriptor with the following options:
:src: The image source, either a pointer to `lv_image_dsc_t` or a file path. :src: The image source, either a pointer to `lv_image_dsc_t` or a file path.
:opa: Opacity in the 0--255 range. Options like :opa: Opacity in the 0--255 range. Options like
``LV_OPA_TRANSP``, ``LV_OPA_10``, etc., can also be used. :cpp:enumerator:`LV_OPA_TRANSP`, :cpp:enumerator:`LV_OPA_10`, etc., can also be used.
:clip_radius: Clips the corners of the image with this radius. Use :clip_radius: Clips the corners of the image with this radius. Use
`LV_RADIUS_CIRCLE` for the maximum radius. `LV_RADIUS_CIRCLE` for the maximum radius.
:rotation: Image rotation in 0.1-degree units (e.g., 234 means 23.4\ |deg|\ ). :rotation: Image rotation in 0.1-degree units (e.g., 234 means 23.4\ |deg|\ ).
@@ -496,7 +496,7 @@ for controlling text rendering:
:ofs_y: Vertical text offset. :ofs_y: Vertical text offset.
:sel_start: Index of the first character for selection (character index, not byte :sel_start: Index of the first character for selection (character index, not byte
index, since some characters can be multi-byte characters). index, since some characters can be multi-byte characters).
``LV_DRAW_LABEL_NO_TXT_SEL`` means no selection. :c:macro:`LV_DRAW_LABEL_NO_TXT_SEL` means no selection.
:sel_end: Index of the last character for selection. :sel_end: Index of the last character for selection.
:sel_color: Color of selected characters. :sel_color: Color of selected characters.
:sel_bg_color: Background color for selected characters. :sel_bg_color: Background color for selected characters.
@@ -610,7 +610,7 @@ Triangles are defined by :cpp:type:`lv_draw_triangle_dsc_t`, which includes:
:p[3]: 3 points for the triangle's vertices. :p[3]: 3 points for the triangle's vertices.
:color: Triangle color. :color: Triangle color.
:opa: Triangle opacity. :opa: Triangle opacity.
:grad: Gradient options. If ``grad.dir`` is not ``LV_GRAD_DIR_NONE``, the :grad: Gradient options. If ``grad.dir`` is not :cpp:enumerator:`LV_GRAD_DIR_NONE`, the
``color`` field is ignored. The ``opa`` field adjusts overall opacity. ``color`` field is ignored. The ``opa`` field adjusts overall opacity.
Functions for triangle drawing: Functions for triangle drawing:
+2 -2
View File
@@ -36,7 +36,7 @@ The following style properties trigger the creation of a "Simple Layer":
- ``bitmap_mask_src`` - ``bitmap_mask_src``
- ``blend_mode`` - ``blend_mode``
In this case, the Widget will be sliced into ``LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE`` In this case, the Widget will be sliced into :c:macro:`LV_DRAW_LAYER_SIMPLE_BUF_SIZE`
sized chunks. sized chunks.
If there is no memory for a new chunk, LVGL will try allocating the layer after If there is no memory for a new chunk, LVGL will try allocating the layer after
@@ -102,7 +102,7 @@ line, it will:
Result of Clip Corner Style Result of Clip Corner Style
There is a temporary RAM cost to doing this. With ``LV_USE_LAYER_DEBUG`` on... There is a temporary RAM cost to doing this. With :c:macro:`LV_USE_LAYER_DEBUG` on...
.. figure:: /_static/images/clip_corner_3_layers_created.png .. figure:: /_static/images/clip_corner_3_layers_created.png
:align: center :align: center
+1 -1
View File
@@ -109,7 +109,7 @@ functions are in :cpp:func:`lv_init`.
Thread Priority Thread Priority
--------------- ---------------
If ``LV_USE_OS`` is set to something other than ``LV_OS_NONE``, draw units might use a thread to If :c:macro:`LV_USE_OS` is set to something other than :c:macro:`LV_OS_NONE`, draw units might use a thread to
allow waiting for the completion of rendering in a non-blocking way. allow waiting for the completion of rendering in a non-blocking way.
The thread priority can be set using the :c:macro:`LV_DRAW_THREAD_PRIO` The thread priority can be set using the :c:macro:`LV_DRAW_THREAD_PRIO`
+2 -2
View File
@@ -133,8 +133,8 @@ Symbols
******* *******
LVGL supports some predefined "symbols". A symbol is a specific Unicode character LVGL supports some predefined "symbols". A symbol is a specific Unicode character
in a font with an icon-like image. The symbols have names like ``LV_SYMBOL_OK``, in a font with an icon-like image. The symbols have names like :c:macro:`LV_SYMBOL_OK`,
``LV_SYMBOL_HOME``, etc. See the full list of predefined symbols below: :c:macro:`LV_SYMBOL_HOME`, etc. See the full list of predefined symbols below:
.. image:: /_static/images/symbols.png .. image:: /_static/images/symbols.png
+1 -1
View File
@@ -381,7 +381,7 @@ will be updated to reflect the written content.
------------------------------------------------------ ------------------------------------------------------
The driver's ``seek`` will not actually be called unless the ``whence`` The driver's ``seek`` will not actually be called unless the ``whence``
is ``LV_FS_SEEK_END``, in which case ``seek`` and ``tell`` will be called is :cpp:enumerator:`LV_FS_SEEK_END`, in which case ``seek`` and ``tell`` will be called
to determine where the end of the file is. to determine where the end of the file is.
``lv_fs_tell`` :sub:`(behavior when cache is enabled)` ``lv_fs_tell`` :sub:`(behavior when cache is enabled)`
@@ -81,8 +81,8 @@ Another way you can add an image to your project is by using the
this with a target color format matching the Display the image is going to be sent this with a target color format matching the Display the image is going to be sent
to. Optionally, you can use a command-line argument to cause the image contents to to. Optionally, you can use a command-line argument to cause the image contents to
be compressed using RLE or LZ4 compression as well. Of course, the decompression be compressed using RLE or LZ4 compression as well. Of course, the decompression
logic must be part of your project by enabling appropriate ``LV_USE_RLE``, logic must be part of your project by enabling appropriate :c:macro:`LV_USE_RLE`,
``LV_USE_LZ4_INTERNAL``, and/or ``LV_USE_LZ4_EXTERNAL`` macros in your ``lv_conf.h`` :c:macro:`LV_USE_LZ4_INTERNAL`, and/or :c:macro:`LV_USE_LZ4_EXTERNAL` macros in your ``lv_conf.h``
file. file.
This enables the drawing logic to have a very low RAM footprint because the pixels This enables the drawing logic to have a very low RAM footprint because the pixels
@@ -59,7 +59,7 @@ The following image pixel color formats have built-in decoding support:
| RAW_ALPHA [2]_ | ? | n/a | See :ref:`custom_image_formats` | | RAW_ALPHA [2]_ | ? | n/a | See :ref:`custom_image_formats` |
+------------------------+-----+------------+-----------------------------------------------------------------+ +------------------------+-----+------------+-----------------------------------------------------------------+
.. [1] I1, I2, I4 and I8 indexed formats require ``LV_DRAW_SW_SUPPORT_ARGB8888`` to .. [1] I1, I2, I4 and I8 indexed formats require :c:macro:`LV_DRAW_SW_SUPPORT_ARGB8888` to
be configured to ``1`` in your ``lv_conf.h`` file. Palette colors are be configured to ``1`` in your ``lv_conf.h`` file. Palette colors are
always ``ARGB8888``. always ``ARGB8888``.
+2 -2
View File
@@ -32,8 +32,8 @@ To assign Hardware Buttons to coordinates, use
The index of the pressed button should be set in ``data->btn_id`` in the ``read_cb``. The index of the pressed button should be set in ``data->btn_id`` in the ``read_cb``.
``data->state`` should also be set to either ``LV_INDEV_STATE_PRESSED`` or ``data->state`` should also be set to either :cpp:enumerator:`LV_INDEV_STATE_PRESSED` or
``LV_INDEV_STATE_RELEASED``. :cpp:enumerator:`LV_INDEV_STATE_RELEASED`.
+4 -4
View File
@@ -75,7 +75,7 @@ gestures are supported:
- Two fingers rotation - Two fingers rotation
- Two fingers swipe (infinite) - Two fingers swipe (infinite)
To enable multi-touch gesture recognition, set the ``LV_USE_GESTURE_RECOGNITION`` To enable multi-touch gesture recognition, set the :c:macro:`LV_USE_GESTURE_RECOGNITION`
option in the ``lv_conf.h`` file. option in the ``lv_conf.h`` file.
@@ -125,16 +125,16 @@ Here is a generic example of the ``read_cb``:
LVGL sends events if the gestures are in one of the following states: LVGL sends events if the gestures are in one of the following states:
- ``LV_INDEV_GESTURE_STATE_RECOGNIZED``: The gesture has been recognized and is now - :cpp:enumerator:`LV_INDEV_GESTURE_STATE_RECOGNIZED`: The gesture has been recognized and is now
active. active.
- ``LV_INDEV_GESTURE_STATE_ENDED``: The gesture has ended. - :cpp:enumerator:`LV_INDEV_GESTURE_STATE_ENDED`: The gesture has ended.
Events Events
------ ------
Once a gesture is recognized or ended, a ``LV_EVENT_GESTURE`` is sent. The user can Once a gesture is recognized or ended, a :cpp:enumerator:`LV_EVENT_GESTURE` is sent. The user can
use these functions to gather more information about the gesture: use these functions to gather more information about the gesture:
- :cpp:expr:`lv_event_get_gesture_type(lv_event_t * e)`: Get the type of the gesture. - :cpp:expr:`lv_event_get_gesture_type(lv_event_t * e)`: Get the type of the gesture.
+1 -1
View File
@@ -152,7 +152,7 @@ value directly. Note that this is a two-way binding (Subject <===> Widget), so
user's direct interaction with the Arc Widget updates the Subject's value and vice user's direct interaction with the Arc Widget updates the Subject's value and vice
versa. versa.
It supports integer subjects and, when ``LV_USE_FLOAT`` is enabled, float subjects. It supports integer subjects and, when :c:macro:`LV_USE_FLOAT` is enabled, float subjects.
- :cpp:expr:`lv_arc_bind_value(arc, &subject)` - :cpp:expr:`lv_arc_bind_value(arc, &subject)`
+2 -2
View File
@@ -171,7 +171,7 @@ Very long text
LVGL can efficiently handle very long (e.g. > 40k characters) Labels by LVGL can efficiently handle very long (e.g. > 40k characters) Labels by
saving some extra data (~12 bytes) to speed up drawing. To enable this saving some extra data (~12 bytes) to speed up drawing. To enable this
feature, set ``LV_LABEL_LONG_TXT_HINT`` to ``1`` in ``lv_conf.h``. feature, set :c:macro:`LV_LABEL_LONG_TXT_HINT` to ``1`` in ``lv_conf.h``.
.. _lv_label_custom_scrolling_animations: .. _lv_label_custom_scrolling_animations:
@@ -220,7 +220,7 @@ the Subject's value is used to update the Label's text as follows:
:float Subject: Subject's float value is used with the ``format_string`` argument. :float Subject: Subject's float value is used with the ``format_string`` argument.
Requires ``LV_USE_FLOAT``. Requires :c:macro:`LV_USE_FLOAT`.
See :ref:`observer_format_string` for details. See :ref:`observer_format_string` for details.
Note that this is a one-way binding (Subject ===> Widget). Note that this is a one-way binding (Subject ===> Widget).
+2 -2
View File
@@ -44,8 +44,8 @@ a predefined ON or OFF value. The :cpp:expr:`lv_led_toggle(led)` toggles between
the ON and OFF state. the ON and OFF state.
You can set custom LED ON and OFF brightness values by defining macros You can set custom LED ON and OFF brightness values by defining macros
``LV_LED_BRIGHT_MAX`` and ``LV_LED_BRIGHT_MIN`` in your project. Their default :c:macro:`LV_LED_BRIGHT_MAX` and :c:macro:`LV_LED_BRIGHT_MIN` in your project. Their default
values are 80 and 255. These too must be in the range [0..255]. values are 255 and 80. These too must be in the range [0..255].
+1 -1
View File
@@ -56,7 +56,7 @@ If you want to add an [OK] or [Cancel] or other buttons for the
user to have a choice of responses, add each button using the user to have a choice of responses, add each button using the
:cpp:expr:`lv_msgbox_add_footer_button(msgbox, btn_text)` function. Calling this :cpp:expr:`lv_msgbox_add_footer_button(msgbox, btn_text)` function. Calling this
function adds a footer (container) if one was not already present, and it returns a function adds a footer (container) if one was not already present, and it returns a
pointer to the button created, which can be used to add ``LV_EVENT_CLICKED`` (or pointer to the button created, which can be used to add :cpp:enumerator:`LV_EVENT_CLICKED` (or
other) events to detect and act on the user's response. other) events to detect and act on the user's response.
Footer buttons so added are evenly spaced and centered. Footer buttons so added are evenly spaced and centered.
+1 -1
View File
@@ -108,7 +108,7 @@ to set text alignment.
Modes Modes
----- -----
**DEPRECATED**, set the width to ``LV_SIZE_CONTENT`` or fixed value to control expanding/wrapping. **DEPRECATED**, set the width to :c:macro:`LV_SIZE_CONTENT` or fixed value to control expanding/wrapping.
A Spangroup can be set to one the following modes: A Spangroup can be set to one the following modes:
+2 -2
View File
@@ -58,11 +58,11 @@ LVGL source files typically use this include pattern:
#include "lvgl/lvgl.h" #include "lvgl/lvgl.h"
#endif #endif
The ``LV_LVGL_H_INCLUDE_SIMPLE`` define controls how LVGL headers are included. The :c:macro:`LV_LVGL_H_INCLUDE_SIMPLE` define controls how LVGL headers are included.
However, the Arduino IDE does not provide a way to add custom compiler symbols through its interface. However, the Arduino IDE does not provide a way to add custom compiler symbols through its interface.
Instead, you must modify the ``platform.txt`` file for the specific board core you are using. Instead, you must modify the ``platform.txt`` file for the specific board core you are using.
To ensure correct compilation, you need to instruct the Arduino build system to define ``LV_LVGL_H_INCLUDE_SIMPLE`` during compilation. To ensure correct compilation, you need to instruct the Arduino build system to define :c:macro:`LV_LVGL_H_INCLUDE_SIMPLE` during compilation.
1. Locate the ``platform.txt`` file for your Arduino core. 1. Locate the ``platform.txt`` file for your Arduino core.
Example paths: Example paths:
+1 -1
View File
@@ -8,7 +8,7 @@ Overview
******** ********
When C code is exported from LVGL's UI Editor, no XML is needed at all When C code is exported from LVGL's UI Editor, no XML is needed at all
(``LV_USE_XML`` can be ``0``), and it's very similar to the case when the C code is (:c:macro:`LV_USE_XML` can be ``0``), and it's very similar to the case when the C code is
written by hand. written by hand.
The exported C code can simply be dropped into the project and compiled into the The exported C code can simply be dropped into the project and compiled into the

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