lv_theme.h
API reference for lv_theme.h
Functions
lv_theme_set_parent
Set a base theme for a theme. The styles from the base them will be added before the styles of the current theme. Arbitrary long chain of themes can be created by setting base themes.
void lv_theme_set_parent(lv_theme_t *theme, lv_theme_t *parent)| Name | Type | Description |
|---|---|---|
theme | lv_theme_t * | pointer to theme which base should be set |
parent | lv_theme_t * | pointer to the base theme May be NULL.. When NULL the theme doesn't inherit any properties |
lv_theme_set_apply_cb
Set an apply callback for a theme. The apply callback is used to add styles to different objects
void lv_theme_set_apply_cb(lv_theme_t *theme, lv_theme_apply_cb_t apply_cb)| Name | Type | Description |
|---|---|---|
theme | lv_theme_t * | pointer to theme which callback should be set |
apply_cb | lv_theme_apply_cb_t | pointer to the callback |
lv_theme_set_user_data
Set the user_data field of the theme
void lv_theme_set_user_data(lv_theme_t *theme, void *user_data)| Name | Type | Description |
|---|---|---|
theme | lv_theme_t * | pointer to a theme |
user_data | void * | pointer to the new user_data. May be NULL. |
lv_theme_set_external_data
Attaches external user data and destructor callback to the theme.
Associates custom user data with an LVGL theme and specifies a destructor function that will be automatically invoked when the theme is deleted to properly clean up the associated resources.
void lv_theme_set_external_data(lv_theme_t *theme, void *user_data, void(*free_cb)(void *data))| Name | Type | Description |
|---|---|---|
theme | lv_theme_t * | Pointer to theme which callback should be set |
user_data | void * | User-defined data pointer to associate with the theme May be NULL. |
free_cb | void(*)(void *data) | Callback function for cleaning up ext_data when theme is deleted. Receives user_data as parameter. May be NULL.. NULL means no cleanup required. |
lv_theme_get_from_obj
Get the theme assigned to the display of the object
lv_theme_t * lv_theme_get_from_obj(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a widget May be NULL.. When NULL the default display's theme is returned. |
Returns: lv_theme_t * — the theme of the object's display (can be NULL)
lv_theme_get_font_small
Get the small font of the theme
const lv_font_t * lv_theme_get_font_small(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a widget May be NULL.. When NULL the default display's theme is used. |
Returns: const lv_font_t * — pointer to the font
lv_theme_get_font_normal
Get the normal font of the theme
const lv_font_t * lv_theme_get_font_normal(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a widget May be NULL.. When NULL the default display's theme is used. |
Returns: const lv_font_t * — pointer to the font
lv_theme_get_font_large
Get the subtitle font of the theme
const lv_font_t * lv_theme_get_font_large(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a widget May be NULL.. When NULL the default display's theme is used. |
Returns: const lv_font_t * — pointer to the font
lv_theme_get_color_primary
Get the primary color of the theme
lv_color_t lv_theme_get_color_primary(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a widget May be NULL.. When NULL the default display's theme is used. |
Returns: lv_color_t — the color
lv_theme_get_color_secondary
Get the secondary color of the theme
lv_color_t lv_theme_get_color_secondary(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a widget May be NULL.. When NULL the default display's theme is used. |
Returns: lv_color_t — the color
lv_theme_get_user_data
Get the user_data field of the theme
void * lv_theme_get_user_data(const lv_theme_t *theme)| Name | Type | Description |
|---|---|---|
theme | const lv_theme_t * | pointer to a theme |
Returns: void * — the pointer to the user_data of the theme (can be NULL if not set)
lv_theme_create
Creates a new theme
lv_theme_t * lv_theme_create(void)Returns: lv_theme_t * — the new theme or NULL if allocation failed
lv_theme_copy
Copy 'src' theme into 'dst'
void lv_theme_copy(lv_theme_t *dst, const lv_theme_t *src)| Name | Type | Description |
|---|---|---|
dst | lv_theme_t * | pointer to the destination theme |
src | const lv_theme_t * | pointer to the source theme |
lv_theme_apply
Apply the active theme on an object
void lv_theme_apply(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an object |
lv_theme_delete
Delete a theme
void lv_theme_delete(lv_theme_t *theme)| Name | Type | Description |
|---|---|---|
theme | lv_theme_t * | the theme to destroy May be NULL. |
Typedefs
lv_theme_apply_cb_t
typedef void(* lv_theme_apply_cb_t) (lv_theme_t *, lv_obj_t *)Used by 1 function
lv_theme_set_apply_cb— paramapply_cb
Dependencies
Indirect dependencies
lv_anim.hlv_area.hlv_assert.hlv_bidi.hlv_color.hlv_color_op.hlv_conf_internal.hlv_display.hlv_draw.hlv_draw_arc.hlv_draw_blur.hlv_draw_buf.hlv_draw_image.hlv_draw_label.hlv_draw_line.hlv_draw_rect.hlv_draw_triangle.hlv_event.hlv_ext_data.hlv_flex.hlv_font.hlv_fs.hlv_grad.hlv_grid.hlv_group.hlv_image_decoder.hlv_image_dsc.hlv_indev.hlv_layout.hlv_log.hlv_math.hlv_matrix.hlv_mem.hlv_obj_class.hlv_obj_draw.hlv_obj_event.hlv_obj_pos.hlv_obj_property.hlv_obj_scroll.hlv_obj_style.hlv_obj_style_gen.hlv_obj_tree.hlv_palette.hlv_profiler.hlv_profiler_builtin.hlv_sprintf.hlv_string.hlv_style.hlv_style_gen.hlv_symbol_def.hlv_text.hlv_timer.hlv_types.h
Last updated on