ESP32 LVGL library from v9.2.2 to v9.3.0 (#23518)

This commit is contained in:
s-hadinger 2025-06-06 23:54:17 +02:00 committed by GitHub
parent 5522f3f6ba
commit 8da8c97d4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
789 changed files with 142829 additions and 18101 deletions

View File

@ -25,6 +25,7 @@ All notable changes to this project will be documented in this file.
- Increase number of supported LoRaWan nodes from 4 to 16
- Berry change number parser for json to reuse same parser as lexer (#23505)
- Berry increase web hooks from 16 to 32 (#23507)
- ESP32 LVGL library from v9.2.2 to v9.3.0
### Fixed
- Haspmota `haspmota.parse()` page parsing (#23403)

View File

@ -176,9 +176,6 @@ struct _haspmota_theme_t {
bool inited;
haspmota_theme_styles_t styles;
lv_color_filter_dsc_t dark_filter;
lv_color_filter_dsc_t grey_filter;
#if LV_THEME_DEFAULT_TRANSITION_TIME
lv_style_transition_dsc_t trans_delayed;
lv_style_transition_dsc_t trans_normal;
@ -226,7 +223,8 @@ static void style_init(haspmota_theme_t * theme)
LV_STYLE_TRANSLATE_Y, LV_STYLE_TRANSLATE_X,
LV_STYLE_TRANSFORM_ROTATION,
LV_STYLE_TRANSFORM_SCALE_X, LV_STYLE_TRANSFORM_SCALE_Y,
LV_STYLE_COLOR_FILTER_OPA, LV_STYLE_COLOR_FILTER_DSC,
LV_STYLE_RECOLOR_OPA, LV_STYLE_RECOLOR,
// LV_STYLE_COLOR_FILTER_OPA, LV_STYLE_COLOR_FILTER_DSC,
0
};
#endif
@ -301,30 +299,28 @@ static void style_init(haspmota_theme_t * theme)
LV_DPX_CALC(theme->disp_dpi, theme->disp_size == DISP_LARGE ? 16 : theme->disp_size == DISP_MEDIUM ? 12 : 10)); // Tasmota min 10
lv_style_set_bg_opa(&theme->styles.btn, LV_OPA_COVER);
lv_style_set_bg_color(&theme->styles.btn, theme->color_grey);
// if(!(theme->base.flags & MODE_DARK)) {
// lv_style_set_shadow_color(&theme->styles.btn, lv_palette_main(LV_PALETTE_GREY));
// lv_style_set_shadow_width(&theme->styles.btn, LV_DPX(3));
// lv_style_set_shadow_opa(&theme->styles.btn, LV_OPA_50);
// lv_style_set_shadow_offset_y(&theme->styles.btn, LV_DPX_CALC(theme->disp_dpi, LV_DPX(4)));
// }
lv_style_set_text_color(&theme->styles.btn, theme->color_text);
lv_style_set_pad_hor(&theme->styles.btn, PAD_DEF);
lv_style_set_pad_ver(&theme->styles.btn, PAD_SMALL);
lv_style_set_pad_column(&theme->styles.btn, LV_DPX_CALC(theme->disp_dpi, 5));
lv_style_set_pad_row(&theme->styles.btn, LV_DPX_CALC(theme->disp_dpi, 5));
style_init_reset(&theme->styles.btn_border_color);
lv_style_set_border_color(&theme->styles.btn_border_color, lv_color_mix(theme->color_text, theme->color_grey, LV_OPA_80));
style_init_reset(&theme->styles.btn_border);
lv_style_set_border_width(&theme->styles.btn_border, BORDER_WIDTH);
lv_style_set_border_side(&theme->styles.btn_border, LV_BORDER_SIDE_FULL);
lv_style_set_border_opa(&theme->styles.btn_border, LV_OPA_COVER);
lv_color_filter_dsc_init(&theme->dark_filter, dark_color_filter_cb);
lv_color_filter_dsc_init(&theme->grey_filter, grey_filter_cb);
style_init_reset(&theme->styles.pressed);
lv_style_set_color_filter_dsc(&theme->styles.pressed, &theme->dark_filter);
lv_style_set_color_filter_opa(&theme->styles.pressed, LV_OPA_60); // Tasmota from 35 ot LV_OPA_60 (153)
lv_style_set_recolor(&theme->styles.pressed, lv_color_black());
lv_style_set_recolor_opa(&theme->styles.pressed, 70);
style_init_reset(&theme->styles.disabled);
lv_style_set_color_filter_dsc(&theme->styles.disabled, &theme->grey_filter);
lv_style_set_color_filter_opa(&theme->styles.disabled, LV_OPA_50);
if(theme_def->base.flags & MODE_DARK)
lv_style_set_recolor(&theme->styles.disabled, lv_palette_darken(LV_PALETTE_GREY, 2));
else
lv_style_set_recolor(&theme->styles.disabled, lv_palette_lighten(LV_PALETTE_GREY, 2));
lv_style_set_recolor_opa(&theme->styles.disabled, LV_OPA_50);
style_init_reset(&theme->styles.clip_corner);
lv_style_set_clip_corner(&theme->styles.clip_corner, true);
@ -430,7 +426,6 @@ static void style_init(haspmota_theme_t * theme)
style_init_reset(&theme->styles.dropdown_list);
lv_style_set_max_height(&theme->styles.dropdown_list, LV_DPI_DEF * 2);
#endif
#if LV_USE_CHECKBOX
style_init_reset(&theme->styles.cb_marker);
lv_style_set_pad_all(&theme->styles.cb_marker, LV_DPX_CALC(theme->disp_dpi, 3));
@ -1083,6 +1078,13 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
lv_obj_add_style(obj, &theme->styles.bg_color_secondary_muted, LV_PART_ITEMS | LV_STATE_EDITED);
}
#endif
#if LV_USE_LABEL && LV_USE_TEXTAREA
else if(lv_obj_check_type(obj, &lv_label_class) && lv_obj_check_type(parent, &lv_textarea_class)) {
lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_SELECTED);
}
#endif
#if LV_USE_LIST
else if(lv_obj_check_type(obj, &lv_list_class)) {
lv_obj_add_style(obj, &theme->styles.card, 0);

View File

@ -18,6 +18,7 @@
"+<base/ftbitmap.c>",
"+<base/ftbase.c>",
"+<base/ftstroke.c>",
"+<base/ftbbox.c>",
"+<base/ftglyph.c>",

View File

@ -15,6 +15,7 @@ anim_delete_all|||[lv_anim_delete_all](https://docs.lvgl.io/9.0/search.html?q=lv
anim_get|\<any\>, comptr|lv.anim|[lv_anim_get](https://docs.lvgl.io/9.0/search.html?q=lv_anim_get)
anim_get_timer||lv.timer|[lv_anim_get_timer](https://docs.lvgl.io/9.0/search.html?q=lv_anim_get_timer)
anim_refr_now|||[lv_anim_refr_now](https://docs.lvgl.io/9.0/search.html?q=lv_anim_refr_now)
anim_resolve_speed|int, int, int|int|[lv_anim_resolve_speed](https://docs.lvgl.io/9.0/search.html?q=lv_anim_resolve_speed)
anim_speed|int|int|[lv_anim_speed](https://docs.lvgl.io/9.0/search.html?q=lv_anim_speed)
anim_speed_clamped|int, int, int|int|[lv_anim_speed_clamped](https://docs.lvgl.io/9.0/search.html?q=lv_anim_speed_clamped)
anim_speed_to_time|int, int, int|int|[lv_anim_speed_to_time](https://docs.lvgl.io/9.0/search.html?q=lv_anim_speed_to_time)
@ -50,7 +51,10 @@ color_luminance|lv.color|int|[lv_color_luminance](https://docs.lvgl.io/9.0/searc
color_make|int, int, int|lv.color|[lv_color_make](https://docs.lvgl.io/9.0/search.html?q=lv_color_make)
color_mix|lv.color, lv.color, int|lv.color|[lv_color_mix](https://docs.lvgl.io/9.0/search.html?q=lv_color_mix)
color_mix32|int, int|int|[lv_color_mix32](https://docs.lvgl.io/9.0/search.html?q=lv_color_mix32)
color_mix32_premultiplied|int, int|int|[lv_color_mix32_premultiplied](https://docs.lvgl.io/9.0/search.html?q=lv_color_mix32_premultiplied)
color_over32|int, int|int|[lv_color_over32](https://docs.lvgl.io/9.0/search.html?q=lv_color_over32)
color_rgb_to_hsv|int, int, int|int|[lv_color_rgb_to_hsv](https://docs.lvgl.io/9.0/search.html?q=lv_color_rgb_to_hsv)
color_swap_16|int|int|[lv_color_swap_16](https://docs.lvgl.io/9.0/search.html?q=lv_color_swap_16)
color_to_32|lv.color, int|int|[lv_color_to_32](https://docs.lvgl.io/9.0/search.html?q=lv_color_to_32)
color_to_hsv|lv.color|int|[lv_color_to_hsv](https://docs.lvgl.io/9.0/search.html?q=lv_color_to_hsv)
color_to_int|lv.color|int|[lv_color_to_int](https://docs.lvgl.io/9.0/search.html?q=lv_color_to_int)
@ -59,6 +63,7 @@ color_to_u32|lv.color|int|[lv_color_to_u32](https://docs.lvgl.io/9.0/search.html
color_white||lv.color|[lv_color_white](https://docs.lvgl.io/9.0/search.html?q=lv_color_white)
display_create|int, int|lv.display|[lv_display_create](https://docs.lvgl.io/9.0/search.html?q=lv_display_create)
display_get_default||lv.display|[lv_display_get_default](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_default)
display_refr_timer|lv.timer||[lv_display_refr_timer](https://docs.lvgl.io/9.0/search.html?q=lv_display_refr_timer)
dpx|int|int|[lv_dpx](https://docs.lvgl.io/9.0/search.html?q=lv_dpx)
draw_arc|lv.layer, lv.draw_arc_dsc||[lv_draw_arc](https://docs.lvgl.io/9.0/search.html?q=lv_draw_arc)
draw_arc_dsc_init|lv.draw_arc_dsc||[lv_draw_arc_dsc_init](https://docs.lvgl.io/9.0/search.html?q=lv_draw_arc_dsc_init)
@ -77,17 +82,24 @@ draw_label_dsc_init|lv.draw_label_dsc||[lv_draw_label_dsc_init](https://docs.lvg
draw_layer_alloc_buf|lv.layer|comptr|[lv_draw_layer_alloc_buf](https://docs.lvgl.io/9.0/search.html?q=lv_draw_layer_alloc_buf)
draw_layer_create|lv.layer, int, lv.area|lv.layer|[lv_draw_layer_create](https://docs.lvgl.io/9.0/search.html?q=lv_draw_layer_create)
draw_layer_go_to_xy|lv.layer, int, int|comptr|[lv_draw_layer_go_to_xy](https://docs.lvgl.io/9.0/search.html?q=lv_draw_layer_go_to_xy)
draw_layer_init|lv.layer, lv.layer, int, lv.area||[lv_draw_layer_init](https://docs.lvgl.io/9.0/search.html?q=lv_draw_layer_init)
draw_letter|lv.layer, lv.draw_letter_dsc, comptr||[lv_draw_letter](https://docs.lvgl.io/9.0/search.html?q=lv_draw_letter)
draw_letter_dsc_init|lv.draw_letter_dsc||[lv_draw_letter_dsc_init](https://docs.lvgl.io/9.0/search.html?q=lv_draw_letter_dsc_init)
draw_line|lv.layer, lv.draw_line_dsc||[lv_draw_line](https://docs.lvgl.io/9.0/search.html?q=lv_draw_line)
draw_line_dsc_init|lv.draw_line_dsc||[lv_draw_line_dsc_init](https://docs.lvgl.io/9.0/search.html?q=lv_draw_line_dsc_init)
draw_rect|lv.layer, lv.draw_rect_dsc, lv.area||[lv_draw_rect](https://docs.lvgl.io/9.0/search.html?q=lv_draw_rect)
draw_rect_dsc_init|lv.draw_rect_dsc||[lv_draw_rect_dsc_init](https://docs.lvgl.io/9.0/search.html?q=lv_draw_rect_dsc_init)
draw_wait_for_finish|||[lv_draw_wait_for_finish](https://docs.lvgl.io/9.0/search.html?q=lv_draw_wait_for_finish)
event_code_get_name|int|string|[lv_event_code_get_name](https://docs.lvgl.io/9.0/search.html?q=lv_event_code_get_name)
event_dsc_get_cb|lv.event_dsc|lv.event_cb|[lv_event_dsc_get_cb](https://docs.lvgl.io/9.0/search.html?q=lv_event_dsc_get_cb)
event_dsc_get_user_data|lv.event_dsc|comptr|[lv_event_dsc_get_user_data](https://docs.lvgl.io/9.0/search.html?q=lv_event_dsc_get_user_data)
event_register_id||int|[lv_event_register_id](https://docs.lvgl.io/9.0/search.html?q=lv_event_register_id)
flex_init|||[lv_flex_init](https://docs.lvgl.io/9.0/search.html?q=lv_flex_init)
font_get_default||lv.font|[lv_font_get_default](https://docs.lvgl.io/9.0/search.html?q=lv_font_get_default)
font_get_glyph_width|lv.font, int, int|int|[lv_font_get_glyph_width](https://docs.lvgl.io/9.0/search.html?q=lv_font_get_glyph_width)
font_get_line_height|lv.font|int|[lv_font_get_line_height](https://docs.lvgl.io/9.0/search.html?q=lv_font_get_line_height)
font_has_static_bitmap|lv.font|bool|[lv_font_has_static_bitmap](https://docs.lvgl.io/9.0/search.html?q=lv_font_has_static_bitmap)
font_info_is_equal|lv.font_info, lv.font_info|bool|[lv_font_info_is_equal](https://docs.lvgl.io/9.0/search.html?q=lv_font_info_is_equal)
font_set_kerning|lv.font, int||[lv_font_set_kerning](https://docs.lvgl.io/9.0/search.html?q=lv_font_set_kerning)
get_hor_res||int|[lv_get_hor_res](https://docs.lvgl.io/9.0/search.html?q=lv_get_hor_res)
get_ts_calibration||lv.ts_calibration|[lv_get_ts_calibration](https://docs.lvgl.io/9.0/search.html?q=lv_get_ts_calibration)
@ -102,6 +114,8 @@ indev_create||lv.indev|[lv_indev_create](https://docs.lvgl.io/9.0/search.html?q=
indev_get_active_obj||lv.obj|[lv_indev_get_active_obj](https://docs.lvgl.io/9.0/search.html?q=lv_indev_get_active_obj)
indev_read_timer_cb|lv.timer||[lv_indev_read_timer_cb](https://docs.lvgl.io/9.0/search.html?q=lv_indev_read_timer_cb)
layer_bottom||lv.obj|[lv_layer_bottom](https://docs.lvgl.io/9.0/search.html?q=lv_layer_bottom)
layer_init|lv.layer||[lv_layer_init](https://docs.lvgl.io/9.0/search.html?q=lv_layer_init)
layer_reset|lv.layer||[lv_layer_reset](https://docs.lvgl.io/9.0/search.html?q=lv_layer_reset)
layer_sys||lv.obj|[lv_layer_sys](https://docs.lvgl.io/9.0/search.html?q=lv_layer_sys)
layer_top||lv.obj|[lv_layer_top](https://docs.lvgl.io/9.0/search.html?q=lv_layer_top)
obj_assign_id|lv.obj_class, lv.obj||[lv_obj_assign_id](https://docs.lvgl.io/9.0/search.html?q=lv_obj_assign_id)
@ -145,6 +159,8 @@ style_register_prop|int|int|[lv_style_register_prop](https://docs.lvgl.io/9.0/se
task_handler||int|[lv_task_handler](https://docs.lvgl.io/9.0/search.html?q=lv_task_handler)
text_get_size|comptr, string, lv.font, int, int, int, int||[lv_text_get_size](https://docs.lvgl.io/9.0/search.html?q=lv_text_get_size)
text_get_width|string, int, lv.font, int|int|[lv_text_get_width](https://docs.lvgl.io/9.0/search.html?q=lv_text_get_width)
text_get_width_with_flags|string, int, lv.font, int, int|int|[lv_text_get_width_with_flags](https://docs.lvgl.io/9.0/search.html?q=lv_text_get_width_with_flags)
text_is_cmd|comptr, int|bool|[lv_text_is_cmd](https://docs.lvgl.io/9.0/search.html?q=lv_text_is_cmd)
theme_apply|lv.obj||[lv_theme_apply](https://docs.lvgl.io/9.0/search.html?q=lv_theme_apply)
theme_get_color_primary|lv.obj|lv.color|[lv_theme_get_color_primary](https://docs.lvgl.io/9.0/search.html?q=lv_theme_get_color_primary)
theme_get_color_secondary|lv.obj|lv.color|[lv_theme_get_color_secondary](https://docs.lvgl.io/9.0/search.html?q=lv_theme_get_color_secondary)
@ -182,6 +198,10 @@ get_repeat_count||int|[lv_anim_get_repeat_count](https://docs.lvgl.io/9.0/search
get_time||int|[lv_anim_get_time](https://docs.lvgl.io/9.0/search.html?q=lv_anim_get_time)
get_user_data||comptr|[lv_anim_get_user_data](https://docs.lvgl.io/9.0/search.html?q=lv_anim_get_user_data)
init|||[lv_anim_init](https://docs.lvgl.io/9.0/search.html?q=lv_anim_init)
is_paused||bool|[lv_anim_is_paused](https://docs.lvgl.io/9.0/search.html?q=lv_anim_is_paused)
pause|||[lv_anim_pause](https://docs.lvgl.io/9.0/search.html?q=lv_anim_pause)
pause_for|int||[lv_anim_pause_for](https://docs.lvgl.io/9.0/search.html?q=lv_anim_pause_for)
resume|||[lv_anim_resume](https://docs.lvgl.io/9.0/search.html?q=lv_anim_resume)
set_bezier3_param|int, int, int, int||[lv_anim_set_bezier3_param](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_bezier3_param)
set_completed_cb|comptr||[lv_anim_set_completed_cb](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_completed_cb)
set_custom_exec_cb|comptr||[lv_anim_set_custom_exec_cb](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_custom_exec_cb)
@ -191,14 +211,13 @@ set_early_apply|bool||[lv_anim_set_early_apply](https://docs.lvgl.io/9.0/search.
set_exec_cb|comptr||[lv_anim_set_exec_cb](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_exec_cb)
set_get_value_cb|comptr||[lv_anim_set_get_value_cb](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_get_value_cb)
set_path_cb|comptr||[lv_anim_set_path_cb](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_path_cb)
set_playback_delay|int||[lv_anim_set_playback_delay](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_playback_delay)
set_playback_duration|int||[lv_anim_set_playback_duration](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_playback_duration)
set_playback_time|int||[lv_anim_set_playback_time](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_playback_time)
set_ready_cb|comptr||[lv_anim_set_completed_cb](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_completed_cb)
set_repeat_count|int||[lv_anim_set_repeat_count](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_repeat_count)
set_repeat_delay|int||[lv_anim_set_repeat_delay](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_repeat_delay)
set_reverse_delay|int||[lv_anim_set_reverse_delay](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_reverse_delay)
set_reverse_duration|int||[lv_anim_set_reverse_duration](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_reverse_duration)
set_reverse_time|int||[lv_anim_set_reverse_time](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_reverse_time)
set_start_cb|comptr||[lv_anim_set_start_cb](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_start_cb)
set_time|int||[lv_anim_set_time](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_time)
set_user_data|\<any\>||[lv_anim_set_user_data](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_user_data)
set_values|int, int||[lv_anim_set_values](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_values)
set_var|\<any\>||[lv_anim_set_var](https://docs.lvgl.io/9.0/search.html?q=lv_anim_set_var)
@ -222,6 +241,7 @@ get_antialiasing||bool|[lv_display_get_antialiasing](https://docs.lvgl.io/9.0/se
get_color_format||int|[lv_display_get_color_format](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_color_format)
get_dpi||int|[lv_display_get_dpi](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_dpi)
get_dpi||int|[lv_display_get_dpi](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_dpi)
get_draw_buf_size||int|[lv_display_get_draw_buf_size](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_draw_buf_size)
get_driver_data||comptr|[lv_display_get_driver_data](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_driver_data)
get_event_count||int|[lv_display_get_event_count](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_event_count)
get_event_dsc|int|lv.event_dsc|[lv_display_get_event_dsc](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_event_dsc)
@ -229,17 +249,21 @@ get_hor_res||int|[lv_display_get_horizontal_resolution](https://docs.lvgl.io/9.0
get_horizontal_resolution||int|[lv_display_get_horizontal_resolution](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_horizontal_resolution)
get_inactive_time||int|[lv_display_get_inactive_time](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_inactive_time)
get_inactive_time||int|[lv_display_get_inactive_time](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_inactive_time)
get_invalidated_draw_buf_size|int, int|int|[lv_display_get_invalidated_draw_buf_size](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_invalidated_draw_buf_size)
get_layer_bottom||lv.obj|[lv_display_get_layer_bottom](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_layer_bottom)
get_layer_sys||lv.obj|[lv_display_get_layer_sys](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_layer_sys)
get_layer_sys||lv.obj|[lv_display_get_layer_sys](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_layer_sys)
get_layer_top||lv.obj|[lv_display_get_layer_top](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_layer_top)
get_layer_top||lv.obj|[lv_display_get_layer_top](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_layer_top)
get_matrix_rotation||bool|[lv_display_get_matrix_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_matrix_rotation)
get_next||lv.display|[lv_display_get_next](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_next)
get_next||lv.display|[lv_display_get_next](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_next)
get_offset_x||int|[lv_display_get_offset_x](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_offset_x)
get_offset_x||int|[lv_display_get_offset_x](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_offset_x)
get_offset_y||int|[lv_display_get_offset_y](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_offset_y)
get_offset_y||int|[lv_display_get_offset_y](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_offset_y)
get_original_horizontal_resolution||int|[lv_display_get_original_horizontal_resolution](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_original_horizontal_resolution)
get_original_vertical_resolution||int|[lv_display_get_original_vertical_resolution](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_original_vertical_resolution)
get_physical_hor_res||int|[lv_display_get_physical_horizontal_resolution](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_physical_horizontal_resolution)
get_physical_horizontal_resolution||int|[lv_display_get_physical_horizontal_resolution](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_physical_horizontal_resolution)
get_physical_ver_res||int|[lv_display_get_physical_vertical_resolution](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_physical_vertical_resolution)
@ -253,25 +277,30 @@ get_screen_active||lv.obj|[lv_display_get_screen_active](https://docs.lvgl.io/9.
get_screen_prev||lv.obj|[lv_display_get_screen_prev](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_screen_prev)
get_theme||lv.theme|[lv_display_get_theme](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_theme)
get_theme||lv.theme|[lv_display_get_theme](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_theme)
get_tile_cnt||int|[lv_display_get_tile_cnt](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_tile_cnt)
get_user_data||comptr|[lv_display_get_user_data](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_user_data)
get_ver_res||int|[lv_display_get_vertical_resolution](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_vertical_resolution)
get_vertical_resolution||int|[lv_display_get_vertical_resolution](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_vertical_resolution)
is_double_buffered||bool|[lv_display_is_double_buffered](https://docs.lvgl.io/9.0/search.html?q=lv_display_is_double_buffered)
is_invalidation_enabled||bool|[lv_display_is_invalidation_enabled](https://docs.lvgl.io/9.0/search.html?q=lv_display_is_invalidation_enabled)
is_invalidation_enabled||bool|[lv_display_is_invalidation_enabled](https://docs.lvgl.io/9.0/search.html?q=lv_display_is_invalidation_enabled)
register_vsync_event|\<closure\>, \<any\>|bool|[lv_display_register_vsync_event](https://docs.lvgl.io/9.0/search.html?q=lv_display_register_vsync_event)
remove|||[lv_display_delete](https://docs.lvgl.io/9.0/search.html?q=lv_display_delete)
remove_event_cb_with_user_data|\<any\>, \<any\>|int|[lv_display_remove_event_cb_with_user_data](https://docs.lvgl.io/9.0/search.html?q=lv_display_remove_event_cb_with_user_data)
rotate_area|lv.area||[lv_display_rotate_area](https://docs.lvgl.io/9.0/search.html?q=lv_display_rotate_area)
send_event|int, \<any\>|int|[lv_display_send_event](https://docs.lvgl.io/9.0/search.html?q=lv_display_send_event)
send_event|int, \<any\>|int|[lv_display_send_event](https://docs.lvgl.io/9.0/search.html?q=lv_display_send_event)
send_vsync_event|\<any\>|int|[lv_display_send_vsync_event](https://docs.lvgl.io/9.0/search.html?q=lv_display_send_vsync_event)
set_angle|int||[lv_display_set_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_rotation)
set_antialiasing|bool||[lv_display_set_antialiasing](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_antialiasing)
set_buffers|\<any\>, \<any\>, int, int||[lv_display_set_buffers](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_buffers)
set_buffers_with_stride|\<any\>, \<any\>, int, int, int||[lv_display_set_buffers_with_stride](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_buffers_with_stride)
set_color_format|int||[lv_display_set_color_format](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_color_format)
set_default|||[lv_display_set_default](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_default)
set_default|||[lv_display_set_default](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_default)
set_dpi|int||[lv_display_set_dpi](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_dpi)
set_driver_data|\<any\>||[lv_display_set_driver_data](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_driver_data)
set_matrix_rotation|bool||[lv_display_set_matrix_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_matrix_rotation)
set_offset|int, int||[lv_display_set_offset](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_offset)
set_physical_resolution|int, int||[lv_display_set_physical_resolution](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_physical_resolution)
set_render_mode|int||[lv_display_set_render_mode](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_render_mode)
@ -280,9 +309,11 @@ set_rotation|int||[lv_display_set_rotation](https://docs.lvgl.io/9.0/search.html
set_rotation|int||[lv_display_set_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_rotation)
set_theme|lv.theme||[lv_display_set_theme](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_theme)
set_theme|lv.theme||[lv_display_set_theme](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_theme)
set_tile_cnt|int||[lv_display_set_tile_cnt](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_tile_cnt)
set_user_data|\<any\>||[lv_display_set_user_data](https://docs.lvgl.io/9.0/search.html?q=lv_display_set_user_data)
trig_activity|||[lv_display_trigger_activity](https://docs.lvgl.io/9.0/search.html?q=lv_display_trigger_activity)
trigger_activity|||[lv_display_trigger_activity](https://docs.lvgl.io/9.0/search.html?q=lv_display_trigger_activity)
unregister_vsync_event|\<closure\>, \<any\>|bool|[lv_display_unregister_vsync_event](https://docs.lvgl.io/9.0/search.html?q=lv_display_unregister_vsync_event)
### class `lv.event`
@ -294,6 +325,7 @@ get_current_target||comptr|[lv_event_get_current_target](https://docs.lvgl.io/9.
get_current_target_obj||lv.obj|[lv_event_get_current_target_obj](https://docs.lvgl.io/9.0/search.html?q=lv_event_get_current_target_obj)
get_hit_test_info||comptr|[lv_event_get_hit_test_info](https://docs.lvgl.io/9.0/search.html?q=lv_event_get_hit_test_info)
get_indev||lv.indev|[lv_event_get_indev](https://docs.lvgl.io/9.0/search.html?q=lv_event_get_indev)
get_invalidated_area||lv.area|[lv_event_get_invalidated_area](https://docs.lvgl.io/9.0/search.html?q=lv_event_get_invalidated_area)
get_key||int|[lv_event_get_key](https://docs.lvgl.io/9.0/search.html?q=lv_event_get_key)
get_layer||lv.layer|[lv_event_get_layer](https://docs.lvgl.io/9.0/search.html?q=lv_event_get_layer)
get_old_size||lv.area|[lv_event_get_old_size](https://docs.lvgl.io/9.0/search.html?q=lv_event_get_old_size)
@ -347,6 +379,7 @@ add_event_cb|\<closure\>, int, \<any\>||[lv_indev_add_event_cb](https://docs.lvg
del|||[lv_indev_delete](https://docs.lvgl.io/9.0/search.html?q=lv_indev_delete)
delete|||[lv_indev_delete](https://docs.lvgl.io/9.0/search.html?q=lv_indev_delete)
enable|bool||[lv_indev_enable](https://docs.lvgl.io/9.0/search.html?q=lv_indev_enable)
get_cursor||lv.obj|[lv_indev_get_cursor](https://docs.lvgl.io/9.0/search.html?q=lv_indev_get_cursor)
get_disp||lv.display|[lv_indev_get_display](https://docs.lvgl.io/9.0/search.html?q=lv_indev_get_display)
get_display||lv.display|[lv_indev_get_display](https://docs.lvgl.io/9.0/search.html?q=lv_indev_get_display)
get_driver_data||comptr|[lv_indev_get_driver_data](https://docs.lvgl.io/9.0/search.html?q=lv_indev_get_driver_data)
@ -363,6 +396,7 @@ get_press_moved||bool|[lv_indev_get_press_moved](https://docs.lvgl.io/9.0/search
get_read_timer||lv.timer|[lv_indev_get_read_timer](https://docs.lvgl.io/9.0/search.html?q=lv_indev_get_read_timer)
get_scroll_dir||int|[lv_indev_get_scroll_dir](https://docs.lvgl.io/9.0/search.html?q=lv_indev_get_scroll_dir)
get_scroll_obj||lv.obj|[lv_indev_get_scroll_obj](https://docs.lvgl.io/9.0/search.html?q=lv_indev_get_scroll_obj)
get_short_click_streak||int|[lv_indev_get_short_click_streak](https://docs.lvgl.io/9.0/search.html?q=lv_indev_get_short_click_streak)
get_state||int|[lv_indev_get_state](https://docs.lvgl.io/9.0/search.html?q=lv_indev_get_state)
get_type||int|[lv_indev_get_type](https://docs.lvgl.io/9.0/search.html?q=lv_indev_get_type)
get_user_data||comptr|[lv_indev_get_user_data](https://docs.lvgl.io/9.0/search.html?q=lv_indev_get_user_data)
@ -382,6 +416,7 @@ set_disp|lv.display||[lv_indev_set_display](https://docs.lvgl.io/9.0/search.html
set_display|lv.display||[lv_indev_set_display](https://docs.lvgl.io/9.0/search.html?q=lv_indev_set_display)
set_driver_data|\<any\>||[lv_indev_set_driver_data](https://docs.lvgl.io/9.0/search.html?q=lv_indev_set_driver_data)
set_group|lv.group||[lv_indev_set_group](https://docs.lvgl.io/9.0/search.html?q=lv_indev_set_group)
set_long_press_repeat_time|int||[lv_indev_set_long_press_repeat_time](https://docs.lvgl.io/9.0/search.html?q=lv_indev_set_long_press_repeat_time)
set_long_press_time|int||[lv_indev_set_long_press_time](https://docs.lvgl.io/9.0/search.html?q=lv_indev_set_long_press_time)
set_mode|int||[lv_indev_set_mode](https://docs.lvgl.io/9.0/search.html?q=lv_indev_set_mode)
set_scroll_limit|int||[lv_indev_set_scroll_limit](https://docs.lvgl.io/9.0/search.html?q=lv_indev_set_scroll_limit)
@ -395,6 +430,7 @@ wait_release|||[lv_indev_wait_release](https://docs.lvgl.io/9.0/search.html?q=lv
Method|Arguments|Return type|LVGL equivalent
:---|:---|:---|:---
copy|lv.style||[lv_style_copy](https://docs.lvgl.io/9.0/search.html?q=lv_style_copy)
is_const||bool|[lv_style_is_const](https://docs.lvgl.io/9.0/search.html?q=lv_style_is_const)
is_empty||bool|[lv_style_is_empty](https://docs.lvgl.io/9.0/search.html?q=lv_style_is_empty)
remove_prop|int|bool|[lv_style_remove_prop](https://docs.lvgl.io/9.0/search.html?q=lv_style_remove_prop)
@ -468,10 +504,13 @@ set_line_dash_width|int||[lv_style_set_line_dash_width](https://docs.lvgl.io/9.0
set_line_opa|int||[lv_style_set_line_opa](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_line_opa)
set_line_rounded|bool||[lv_style_set_line_rounded](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_line_rounded)
set_line_width|int||[lv_style_set_line_width](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_line_width)
set_margin_all|int||[lv_style_set_margin_all](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_margin_all)
set_margin_bottom|int||[lv_style_set_margin_bottom](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_margin_bottom)
set_margin_hor|int||[lv_style_set_margin_hor](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_margin_hor)
set_margin_left|int||[lv_style_set_margin_left](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_margin_left)
set_margin_right|int||[lv_style_set_margin_right](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_margin_right)
set_margin_top|int||[lv_style_set_margin_top](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_margin_top)
set_margin_ver|int||[lv_style_set_margin_ver](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_margin_ver)
set_max_height|int||[lv_style_set_max_height](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_max_height)
set_max_width|int||[lv_style_set_max_width](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_max_width)
set_min_height|int||[lv_style_set_min_height](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_min_height)
@ -488,12 +527,16 @@ set_pad_column|int||[lv_style_set_pad_column](https://docs.lvgl.io/9.0/search.ht
set_pad_gap|int||[lv_style_set_pad_gap](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_pad_gap)
set_pad_hor|int||[lv_style_set_pad_hor](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_pad_hor)
set_pad_left|int||[lv_style_set_pad_left](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_pad_left)
set_pad_radial|int||[lv_style_set_pad_radial](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_pad_radial)
set_pad_right|int||[lv_style_set_pad_right](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_pad_right)
set_pad_row|int||[lv_style_set_pad_row](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_pad_row)
set_pad_top|int||[lv_style_set_pad_top](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_pad_top)
set_pad_ver|int||[lv_style_set_pad_ver](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_pad_ver)
set_prop|int, int||[lv_style_set_prop](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_prop)
set_radial_offset|int||[lv_style_set_radial_offset](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_radial_offset)
set_radius|int||[lv_style_set_radius](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_radius)
set_recolor|lv.color||[lv_style_set_recolor](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_recolor)
set_recolor_opa|int||[lv_style_set_recolor_opa](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_recolor_opa)
set_rotary_sensitivity|int||[lv_style_set_rotary_sensitivity](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_rotary_sensitivity)
set_shadow_color|lv.color||[lv_style_set_shadow_color](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_shadow_color)
set_shadow_offset_x|int||[lv_style_set_shadow_offset_x](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_shadow_offset_x)
@ -511,6 +554,9 @@ set_text_font|lv.font||[lv_style_set_text_font](https://docs.lvgl.io/9.0/search.
set_text_letter_space|int||[lv_style_set_text_letter_space](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_text_letter_space)
set_text_line_space|int||[lv_style_set_text_line_space](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_text_line_space)
set_text_opa|int||[lv_style_set_text_opa](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_text_opa)
set_text_outline_stroke_color|lv.color||[lv_style_set_text_outline_stroke_color](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_text_outline_stroke_color)
set_text_outline_stroke_opa|int||[lv_style_set_text_outline_stroke_opa](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_text_outline_stroke_opa)
set_text_outline_stroke_width|int||[lv_style_set_text_outline_stroke_width](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_text_outline_stroke_width)
set_transform_angle|int||[lv_style_set_transform_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_transform_rotation)
set_transform_height|int||[lv_style_set_transform_height](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_transform_height)
set_transform_pivot_x|int||[lv_style_set_transform_pivot_x](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_transform_pivot_x)
@ -524,6 +570,7 @@ set_transform_skew_y|int||[lv_style_set_transform_skew_y](https://docs.lvgl.io/9
set_transform_width|int||[lv_style_set_transform_width](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_transform_width)
set_transform_zoom|int||[lv_style_set_transform_scale](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_transform_scale)
set_transition|lv.style_transition_dsc||[lv_style_set_transition](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_transition)
set_translate_radial|int||[lv_style_set_translate_radial](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_translate_radial)
set_translate_x|int||[lv_style_set_translate_x](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_translate_x)
set_translate_y|int||[lv_style_set_translate_y](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_translate_y)
set_width|int||[lv_style_set_width](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_width)
@ -581,9 +628,9 @@ delete_delayed|int||[lv_obj_delete_delayed](https://docs.lvgl.io/9.0/search.html
dump_tree|||[lv_obj_dump_tree](https://docs.lvgl.io/9.0/search.html?q=lv_obj_dump_tree)
fade_in|int, int||[lv_obj_fade_in](https://docs.lvgl.io/9.0/search.html?q=lv_obj_fade_in)
fade_out|int, int||[lv_obj_fade_out](https://docs.lvgl.io/9.0/search.html?q=lv_obj_fade_out)
find_by_id|\<any\>|lv.obj|[lv_obj_find_by_id](https://docs.lvgl.io/9.0/search.html?q=lv_obj_find_by_id)
free_id|||[lv_obj_free_id](https://docs.lvgl.io/9.0/search.html?q=lv_obj_free_id)
get_child|int|lv.obj|[lv_obj_get_child](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_child)
get_child_by_id|\<any\>|lv.obj|[lv_obj_get_child_by_id](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_child_by_id)
get_child_by_type|int, lv.obj_class|lv.obj|[lv_obj_get_child_by_type](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_child_by_type)
get_child_cnt||int|[lv_obj_get_child_count](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_child_count)
get_child_count||int|[lv_obj_get_child_count](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_child_count)
@ -713,11 +760,16 @@ get_style_outline_width|int|int|[lv_obj_get_style_outline_width](https://docs.lv
get_style_pad_bottom|int|int|[lv_obj_get_style_pad_bottom](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_pad_bottom)
get_style_pad_column|int|int|[lv_obj_get_style_pad_column](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_pad_column)
get_style_pad_left|int|int|[lv_obj_get_style_pad_left](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_pad_left)
get_style_pad_radial|int|int|[lv_obj_get_style_pad_radial](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_pad_radial)
get_style_pad_right|int|int|[lv_obj_get_style_pad_right](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_pad_right)
get_style_pad_row|int|int|[lv_obj_get_style_pad_row](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_pad_row)
get_style_pad_top|int|int|[lv_obj_get_style_pad_top](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_pad_top)
get_style_prop|int, int|int|[lv_obj_get_style_prop](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_prop)
get_style_radial_offset|int|int|[lv_obj_get_style_radial_offset](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_radial_offset)
get_style_radius|int|int|[lv_obj_get_style_radius](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_radius)
get_style_recolor|int|lv.color|[lv_obj_get_style_recolor](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_recolor)
get_style_recolor_opa|int|int|[lv_obj_get_style_recolor_opa](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_recolor_opa)
get_style_recolor_recursive|int|int|[lv_obj_get_style_recolor_recursive](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_recolor_recursive)
get_style_rotary_sensitivity|int|int|[lv_obj_get_style_rotary_sensitivity](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_rotary_sensitivity)
get_style_shadow_color|int|lv.color|[lv_obj_get_style_shadow_color](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_shadow_color)
get_style_shadow_color_filtered|int|lv.color|[lv_obj_get_style_shadow_color_filtered](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_shadow_color_filtered)
@ -740,6 +792,10 @@ get_style_text_font|int|lv.font|[lv_obj_get_style_text_font](https://docs.lvgl.i
get_style_text_letter_space|int|int|[lv_obj_get_style_text_letter_space](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_text_letter_space)
get_style_text_line_space|int|int|[lv_obj_get_style_text_line_space](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_text_line_space)
get_style_text_opa|int|int|[lv_obj_get_style_text_opa](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_text_opa)
get_style_text_outline_stroke_color|int|lv.color|[lv_obj_get_style_text_outline_stroke_color](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_text_outline_stroke_color)
get_style_text_outline_stroke_color_filtered|int|lv.color|[lv_obj_get_style_text_outline_stroke_color_filtered](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_text_outline_stroke_color_filtered)
get_style_text_outline_stroke_opa|int|int|[lv_obj_get_style_text_outline_stroke_opa](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_text_outline_stroke_opa)
get_style_text_outline_stroke_width|int|int|[lv_obj_get_style_text_outline_stroke_width](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_text_outline_stroke_width)
get_style_transform_angle|int|int|[lv_obj_get_style_transform_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_transform_rotation)
get_style_transform_height|int|int|[lv_obj_get_style_transform_height](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_transform_height)
get_style_transform_pivot_x|int|int|[lv_obj_get_style_transform_pivot_x](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_transform_pivot_x)
@ -753,6 +809,7 @@ get_style_transform_skew_x|int|int|[lv_obj_get_style_transform_skew_x](https://d
get_style_transform_skew_y|int|int|[lv_obj_get_style_transform_skew_y](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_transform_skew_y)
get_style_transform_width|int|int|[lv_obj_get_style_transform_width](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_transform_width)
get_style_transition|int|lv.style_transition_dsc|[lv_obj_get_style_transition](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_transition)
get_style_translate_radial|int|int|[lv_obj_get_style_translate_radial](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_translate_radial)
get_style_translate_x|int|int|[lv_obj_get_style_translate_x](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_translate_x)
get_style_translate_y|int|int|[lv_obj_get_style_translate_y](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_translate_y)
get_style_width|int|int|[lv_obj_get_style_width](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_width)
@ -801,7 +858,7 @@ refresh_self_size||bool|[lv_obj_refresh_self_size](https://docs.lvgl.io/9.0/sear
refresh_style|int, int||[lv_obj_refresh_style](https://docs.lvgl.io/9.0/search.html?q=lv_obj_refresh_style)
remove|||[lv_obj_delete](https://docs.lvgl.io/9.0/search.html?q=lv_obj_delete)
remove_event|int|bool|[lv_obj_remove_event](https://docs.lvgl.io/9.0/search.html?q=lv_obj_remove_event)
remove_event_cb|\<any\>|bool|[lv_obj_remove_event_cb](https://docs.lvgl.io/9.0/search.html?q=lv_obj_remove_event_cb)
remove_event_cb|\<any\>|int|[lv_obj_remove_event_cb](https://docs.lvgl.io/9.0/search.html?q=lv_obj_remove_event_cb)
remove_event_cb_with_user_data|\<any\>, \<any\>|int|[lv_obj_remove_event_cb_with_user_data](https://docs.lvgl.io/9.0/search.html?q=lv_obj_remove_event_cb_with_user_data)
remove_event_dsc|lv.event_dsc|bool|[lv_obj_remove_event_dsc](https://docs.lvgl.io/9.0/search.html?q=lv_obj_remove_event_dsc)
remove_flag|int||[lv_obj_remove_flag](https://docs.lvgl.io/9.0/search.html?q=lv_obj_remove_flag)
@ -810,6 +867,7 @@ remove_state|int||[lv_obj_remove_state](https://docs.lvgl.io/9.0/search.html?q=l
remove_style|lv.style, int||[lv_obj_remove_style](https://docs.lvgl.io/9.0/search.html?q=lv_obj_remove_style)
remove_style_all|||[lv_obj_remove_style_all](https://docs.lvgl.io/9.0/search.html?q=lv_obj_remove_style_all)
replace_style|lv.style, lv.style, int|bool|[lv_obj_replace_style](https://docs.lvgl.io/9.0/search.html?q=lv_obj_replace_style)
reset_transform|||[lv_obj_reset_transform](https://docs.lvgl.io/9.0/search.html?q=lv_obj_reset_transform)
scroll_by|int, int, int||[lv_obj_scroll_by](https://docs.lvgl.io/9.0/search.html?q=lv_obj_scroll_by)
scroll_by_bounded|int, int, int||[lv_obj_scroll_by_bounded](https://docs.lvgl.io/9.0/search.html?q=lv_obj_scroll_by_bounded)
scroll_to|int, int, int||[lv_obj_scroll_to](https://docs.lvgl.io/9.0/search.html?q=lv_obj_scroll_to)
@ -824,6 +882,7 @@ set_align|int||[lv_obj_set_align](https://docs.lvgl.io/9.0/search.html?q=lv_obj_
set_content_height|int||[lv_obj_set_content_height](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_content_height)
set_content_width|int||[lv_obj_set_content_width](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_content_width)
set_ext_click_area|int||[lv_obj_set_ext_click_area](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_ext_click_area)
set_flag|int, bool||[lv_obj_set_flag](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_flag)
set_flex_align|int, int, int||[lv_obj_set_flex_align](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_flex_align)
set_flex_flow|int||[lv_obj_set_flex_flow](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_flex_flow)
set_flex_grow|int||[lv_obj_set_flex_grow](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_flex_grow)
@ -929,11 +988,15 @@ set_style_pad_column|int, int||[lv_obj_set_style_pad_column](https://docs.lvgl.i
set_style_pad_gap|int, int||[lv_obj_set_style_pad_gap](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_pad_gap)
set_style_pad_hor|int, int||[lv_obj_set_style_pad_hor](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_pad_hor)
set_style_pad_left|int, int||[lv_obj_set_style_pad_left](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_pad_left)
set_style_pad_radial|int, int||[lv_obj_set_style_pad_radial](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_pad_radial)
set_style_pad_right|int, int||[lv_obj_set_style_pad_right](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_pad_right)
set_style_pad_row|int, int||[lv_obj_set_style_pad_row](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_pad_row)
set_style_pad_top|int, int||[lv_obj_set_style_pad_top](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_pad_top)
set_style_pad_ver|int, int||[lv_obj_set_style_pad_ver](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_pad_ver)
set_style_radial_offset|int, int||[lv_obj_set_style_radial_offset](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_radial_offset)
set_style_radius|int, int||[lv_obj_set_style_radius](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_radius)
set_style_recolor|lv.color, int||[lv_obj_set_style_recolor](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_recolor)
set_style_recolor_opa|int, int||[lv_obj_set_style_recolor_opa](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_recolor_opa)
set_style_rotary_sensitivity|int, int||[lv_obj_set_style_rotary_sensitivity](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_rotary_sensitivity)
set_style_shadow_color|lv.color, int||[lv_obj_set_style_shadow_color](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_shadow_color)
set_style_shadow_offset_x|int, int||[lv_obj_set_style_shadow_offset_x](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_shadow_offset_x)
@ -951,6 +1014,9 @@ set_style_text_font|lv.font, int||[lv_obj_set_style_text_font](https://docs.lvgl
set_style_text_letter_space|int, int||[lv_obj_set_style_text_letter_space](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_text_letter_space)
set_style_text_line_space|int, int||[lv_obj_set_style_text_line_space](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_text_line_space)
set_style_text_opa|int, int||[lv_obj_set_style_text_opa](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_text_opa)
set_style_text_outline_stroke_color|lv.color, int||[lv_obj_set_style_text_outline_stroke_color](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_text_outline_stroke_color)
set_style_text_outline_stroke_opa|int, int||[lv_obj_set_style_text_outline_stroke_opa](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_text_outline_stroke_opa)
set_style_text_outline_stroke_width|int, int||[lv_obj_set_style_text_outline_stroke_width](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_text_outline_stroke_width)
set_style_transform_angle|int, int||[lv_obj_set_style_transform_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_transform_rotation)
set_style_transform_height|int, int||[lv_obj_set_style_transform_height](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_transform_height)
set_style_transform_pivot_x|int, int||[lv_obj_set_style_transform_pivot_x](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_transform_pivot_x)
@ -964,6 +1030,7 @@ set_style_transform_skew_y|int, int||[lv_obj_set_style_transform_skew_y](https:/
set_style_transform_width|int, int||[lv_obj_set_style_transform_width](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_transform_width)
set_style_transform_zoom|int, int||[lv_obj_set_style_transform_scale](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_transform_scale)
set_style_transition|lv.style_transition_dsc, int||[lv_obj_set_style_transition](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_transition)
set_style_translate_radial|int, int||[lv_obj_set_style_translate_radial](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_translate_radial)
set_style_translate_x|int, int||[lv_obj_set_style_translate_x](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_translate_x)
set_style_translate_y|int, int||[lv_obj_set_style_translate_y](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_translate_y)
set_style_width|int, int||[lv_obj_set_style_width](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_width)
@ -973,12 +1040,13 @@ set_user_data|\<any\>||[lv_obj_set_user_data](https://docs.lvgl.io/9.0/search.ht
set_width|int||[lv_obj_set_width](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_width)
set_x|int||[lv_obj_set_x](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_x)
set_y|int||[lv_obj_set_y](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_y)
stop_scroll_anim|||[lv_obj_stop_scroll_anim](https://docs.lvgl.io/9.0/search.html?q=lv_obj_stop_scroll_anim)
stringify_id|comptr, int|string|[lv_obj_stringify_id](https://docs.lvgl.io/9.0/search.html?q=lv_obj_stringify_id)
style_apply_color_filter|int, int|int|[lv_obj_style_apply_color_filter](https://docs.lvgl.io/9.0/search.html?q=lv_obj_style_apply_color_filter)
style_apply_recolor|int, int|int|[lv_obj_style_apply_recolor](https://docs.lvgl.io/9.0/search.html?q=lv_obj_style_apply_recolor)
swap|lv.obj||[lv_obj_swap](https://docs.lvgl.io/9.0/search.html?q=lv_obj_swap)
transform_point|comptr, int||[lv_obj_transform_point](https://docs.lvgl.io/9.0/search.html?q=lv_obj_transform_point)
transform_point_array|lv.point_arr, int, int||[lv_obj_transform_point_array](https://docs.lvgl.io/9.0/search.html?q=lv_obj_transform_point_array)
update_flag|int, bool||[lv_obj_update_flag](https://docs.lvgl.io/9.0/search.html?q=lv_obj_update_flag)
update_layout|||[lv_obj_update_layout](https://docs.lvgl.io/9.0/search.html?q=lv_obj_update_layout)
update_snap|int||[lv_obj_update_snap](https://docs.lvgl.io/9.0/search.html?q=lv_obj_update_snap)
@ -1127,6 +1195,10 @@ get_scale||int|[lv_image_get_scale](https://docs.lvgl.io/9.0/search.html?q=lv_im
get_scale_x||int|[lv_image_get_scale_x](https://docs.lvgl.io/9.0/search.html?q=lv_image_get_scale_x)
get_scale_y||int|[lv_image_get_scale_y](https://docs.lvgl.io/9.0/search.html?q=lv_image_get_scale_y)
get_src||comptr|[lv_image_get_src](https://docs.lvgl.io/9.0/search.html?q=lv_image_get_src)
get_src_height||int|[lv_image_get_src_height](https://docs.lvgl.io/9.0/search.html?q=lv_image_get_src_height)
get_src_width||int|[lv_image_get_src_width](https://docs.lvgl.io/9.0/search.html?q=lv_image_get_src_width)
get_transformed_height||int|[lv_image_get_transformed_height](https://docs.lvgl.io/9.0/search.html?q=lv_image_get_transformed_height)
get_transformed_width||int|[lv_image_get_transformed_width](https://docs.lvgl.io/9.0/search.html?q=lv_image_get_transformed_width)
get_zoom||int|[lv_image_get_scale](https://docs.lvgl.io/9.0/search.html?q=lv_image_get_scale)
set_angle|int||[lv_image_set_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_image_set_rotation)
set_antialias|bool||[lv_image_set_antialias](https://docs.lvgl.io/9.0/search.html?q=lv_image_set_antialias)
@ -1153,12 +1225,14 @@ cut_text|int, int||[lv_label_cut_text](https://docs.lvgl.io/9.0/search.html?q=lv
get_letter_on|comptr, bool|int|[lv_label_get_letter_on](https://docs.lvgl.io/9.0/search.html?q=lv_label_get_letter_on)
get_letter_pos|int, comptr||[lv_label_get_letter_pos](https://docs.lvgl.io/9.0/search.html?q=lv_label_get_letter_pos)
get_long_mode||int|[lv_label_get_long_mode](https://docs.lvgl.io/9.0/search.html?q=lv_label_get_long_mode)
get_recolor||bool|[lv_label_get_recolor](https://docs.lvgl.io/9.0/search.html?q=lv_label_get_recolor)
get_text||string|[lv_label_get_text](https://docs.lvgl.io/9.0/search.html?q=lv_label_get_text)
get_text_selection_end||int|[lv_label_get_text_selection_end](https://docs.lvgl.io/9.0/search.html?q=lv_label_get_text_selection_end)
get_text_selection_start||int|[lv_label_get_text_selection_start](https://docs.lvgl.io/9.0/search.html?q=lv_label_get_text_selection_start)
ins_text|int, string||[lv_label_ins_text](https://docs.lvgl.io/9.0/search.html?q=lv_label_ins_text)
is_char_under_pos|comptr|bool|[lv_label_is_char_under_pos](https://docs.lvgl.io/9.0/search.html?q=lv_label_is_char_under_pos)
set_long_mode|int||[lv_label_set_long_mode](https://docs.lvgl.io/9.0/search.html?q=lv_label_set_long_mode)
set_recolor|bool||[lv_label_set_recolor](https://docs.lvgl.io/9.0/search.html?q=lv_label_set_recolor)
set_text|string||[lv_label_set_text](https://docs.lvgl.io/9.0/search.html?q=lv_label_set_text)
set_text_fmt|string, [\<any\>]||[lv_label_set_text_fmt](https://docs.lvgl.io/9.0/search.html?q=lv_label_set_text_fmt)
set_text_selection_end|int||[lv_label_set_text_selection_end](https://docs.lvgl.io/9.0/search.html?q=lv_label_set_text_selection_end)
@ -1189,6 +1263,7 @@ get_selected||int|[lv_roller_get_selected](https://docs.lvgl.io/9.0/search.html?
get_selected_str|comptr, int||[lv_roller_get_selected_str](https://docs.lvgl.io/9.0/search.html?q=lv_roller_get_selected_str)
set_options|string, int||[lv_roller_set_options](https://docs.lvgl.io/9.0/search.html?q=lv_roller_set_options)
set_selected|int, int||[lv_roller_set_selected](https://docs.lvgl.io/9.0/search.html?q=lv_roller_set_selected)
set_selected_str|string, int|bool|[lv_roller_set_selected_str](https://docs.lvgl.io/9.0/search.html?q=lv_roller_set_selected_str)
set_visible_row_cnt|int||[lv_roller_set_visible_row_count](https://docs.lvgl.io/9.0/search.html?q=lv_roller_set_visible_row_count)
set_visible_row_count|int||[lv_roller_set_visible_row_count](https://docs.lvgl.io/9.0/search.html?q=lv_roller_set_visible_row_count)
@ -1200,24 +1275,27 @@ get_left_value||int|[lv_slider_get_left_value](https://docs.lvgl.io/9.0/search.h
get_max_value||int|[lv_slider_get_max_value](https://docs.lvgl.io/9.0/search.html?q=lv_slider_get_max_value)
get_min_value||int|[lv_slider_get_min_value](https://docs.lvgl.io/9.0/search.html?q=lv_slider_get_min_value)
get_mode||int|[lv_slider_get_mode](https://docs.lvgl.io/9.0/search.html?q=lv_slider_get_mode)
get_orientation||int|[lv_slider_get_orientation](https://docs.lvgl.io/9.0/search.html?q=lv_slider_get_orientation)
get_value||int|[lv_slider_get_value](https://docs.lvgl.io/9.0/search.html?q=lv_slider_get_value)
is_dragged||bool|[lv_slider_is_dragged](https://docs.lvgl.io/9.0/search.html?q=lv_slider_is_dragged)
is_symmetrical||bool|[lv_slider_is_symmetrical](https://docs.lvgl.io/9.0/search.html?q=lv_slider_is_symmetrical)
set_left_value|int, int||[lv_slider_set_left_value](https://docs.lvgl.io/9.0/search.html?q=lv_slider_set_left_value)
set_mode|int||[lv_slider_set_mode](https://docs.lvgl.io/9.0/search.html?q=lv_slider_set_mode)
set_orientation|int||[lv_slider_set_orientation](https://docs.lvgl.io/9.0/search.html?q=lv_slider_set_orientation)
set_range|int, int||[lv_slider_set_range](https://docs.lvgl.io/9.0/search.html?q=lv_slider_set_range)
set_start_value|int, int||[lv_slider_set_start_value](https://docs.lvgl.io/9.0/search.html?q=lv_slider_set_start_value)
set_value|int, int||[lv_slider_set_value](https://docs.lvgl.io/9.0/search.html?q=lv_slider_set_value)
### widget `lv.switch`
Method|Arguments|Return type|LVGL equivalent
:---|:---|:---|:---
get_orientation||int|[lv_switch_get_orientation](https://docs.lvgl.io/9.0/search.html?q=lv_switch_get_orientation)
set_orientation|int||[lv_switch_set_orientation](https://docs.lvgl.io/9.0/search.html?q=lv_switch_set_orientation)
### widget `lv.table`
Method|Arguments|Return type|LVGL equivalent
:---|:---|:---|:---
add_cell_ctrl|int, int, int||[lv_table_add_cell_ctrl](https://docs.lvgl.io/9.0/search.html?q=lv_table_add_cell_ctrl)
clear_cell_ctrl|int, int, int||[lv_table_clear_cell_ctrl](https://docs.lvgl.io/9.0/search.html?q=lv_table_clear_cell_ctrl)
get_cell_user_data|int, int|comptr|[lv_table_get_cell_user_data](https://docs.lvgl.io/9.0/search.html?q=lv_table_get_cell_user_data)
get_cell_value|int, int|string|[lv_table_get_cell_value](https://docs.lvgl.io/9.0/search.html?q=lv_table_get_cell_value)
@ -1229,6 +1307,7 @@ get_row_cnt||int|[lv_table_get_row_count](https://docs.lvgl.io/9.0/search.html?q
get_row_count||int|[lv_table_get_row_count](https://docs.lvgl.io/9.0/search.html?q=lv_table_get_row_count)
get_selected_cell|lv.int_arr, lv.int_arr||[lv_table_get_selected_cell](https://docs.lvgl.io/9.0/search.html?q=lv_table_get_selected_cell)
has_cell_ctrl|int, int, int|bool|[lv_table_has_cell_ctrl](https://docs.lvgl.io/9.0/search.html?q=lv_table_has_cell_ctrl)
set_cell_ctrl|int, int, int||[lv_table_set_cell_ctrl](https://docs.lvgl.io/9.0/search.html?q=lv_table_set_cell_ctrl)
set_cell_user_data|int, int, \<any\>||[lv_table_set_cell_user_data](https://docs.lvgl.io/9.0/search.html?q=lv_table_set_cell_user_data)
set_cell_value|int, int, string||[lv_table_set_cell_value](https://docs.lvgl.io/9.0/search.html?q=lv_table_set_cell_value)
set_cell_value_fmt|int, int, string, [\<any\>]||[lv_table_set_cell_value_fmt](https://docs.lvgl.io/9.0/search.html?q=lv_table_set_cell_value_fmt)
@ -1285,6 +1364,7 @@ text_is_selected||bool|[lv_textarea_text_is_selected](https://docs.lvgl.io/9.0/s
Method|Arguments|Return type|LVGL equivalent
:---|:---|:---|:---
add_span||lv.span|[lv_spangroup_add_span](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_add_span)
delete_span|lv.span||[lv_spangroup_delete_span](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_delete_span)
get_align||int|[lv_spangroup_get_align](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_get_align)
get_child|int|lv.span|[lv_spangroup_get_child](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_get_child)
@ -1295,22 +1375,28 @@ get_max_line_height||int|[lv_spangroup_get_max_line_height](https://docs.lvgl.io
get_max_lines||int|[lv_spangroup_get_max_lines](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_get_max_lines)
get_mode||int|[lv_spangroup_get_mode](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_get_mode)
get_overflow||int|[lv_spangroup_get_overflow](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_get_overflow)
get_span_by_point|comptr|lv.span|[lv_spangroup_get_span_by_point](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_get_span_by_point)
get_span_coords|lv.span|lv.span_coords|[lv_spangroup_get_span_coords](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_get_span_coords)
get_span_count||int|[lv_spangroup_get_span_count](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_get_span_count)
new_span||lv.span|[lv_spangroup_new_span](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_new_span)
refr_mode|||[lv_spangroup_refr_mode](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_refr_mode)
refresh|||[lv_spangroup_refresh](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_refresh)
set_align|int||[lv_spangroup_set_align](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_set_align)
set_indent|int||[lv_spangroup_set_indent](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_set_indent)
set_max_lines|int||[lv_spangroup_set_max_lines](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_set_max_lines)
set_mode|int||[lv_spangroup_set_mode](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_set_mode)
set_overflow|int||[lv_spangroup_set_overflow](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_set_overflow)
set_span_style|lv.span, lv.style||[lv_spangroup_set_span_style](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_set_span_style)
set_span_text|lv.span, string||[lv_spangroup_set_span_text](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_set_span_text)
set_span_text_static|lv.span, string||[lv_spangroup_set_span_text_static](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_set_span_text_static)
### widget `lv.span`
Method|Arguments|Return type|LVGL equivalent
:---|:---|:---|:---
get_style||lv.style|[lv_span_get_style](https://docs.lvgl.io/9.0/search.html?q=lv_span_get_style)
get_text||string|[lv_span_get_text](https://docs.lvgl.io/9.0/search.html?q=lv_span_get_text)
set_text|string||[lv_span_set_text](https://docs.lvgl.io/9.0/search.html?q=lv_span_set_text)
set_text_static|string||[lv_span_set_text_static](https://docs.lvgl.io/9.0/search.html?q=lv_span_set_text_static)
set_text_static|string||[lv_span_set_text_static](https://docs.lvgl.io/9.0/search.html?q=lv_span_set_text_static)
### widget `lv.scale_section`
@ -1324,12 +1410,15 @@ set_style|int, lv.style||[lv_scale_section_set_style](https://docs.lvgl.io/9.0/s
Method|Arguments|Return type|LVGL equivalent
:---|:---|:---|:---
add_section||lv.scale_section|[lv_scale_add_section](https://docs.lvgl.io/9.0/search.html?q=lv_scale_add_section)
get_angle||int|[lv_scale_get_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_scale_get_rotation)
get_angle_range||int|[lv_scale_get_angle_range](https://docs.lvgl.io/9.0/search.html?q=lv_scale_get_angle_range)
get_label_show||bool|[lv_scale_get_label_show](https://docs.lvgl.io/9.0/search.html?q=lv_scale_get_label_show)
get_major_tick_every||int|[lv_scale_get_major_tick_every](https://docs.lvgl.io/9.0/search.html?q=lv_scale_get_major_tick_every)
get_mode||int|[lv_scale_get_mode](https://docs.lvgl.io/9.0/search.html?q=lv_scale_get_mode)
get_range_max_value||int|[lv_scale_get_range_max_value](https://docs.lvgl.io/9.0/search.html?q=lv_scale_get_range_max_value)
get_range_min_value||int|[lv_scale_get_range_min_value](https://docs.lvgl.io/9.0/search.html?q=lv_scale_get_range_min_value)
get_rotation||int|[lv_scale_get_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_scale_get_rotation)
get_rotation||int|[lv_scale_get_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_scale_get_rotation)
get_total_tick_count||int|[lv_scale_get_total_tick_count](https://docs.lvgl.io/9.0/search.html?q=lv_scale_get_total_tick_count)
set_angle|int||[lv_scale_set_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_rotation)
set_angle_range|int||[lv_scale_set_angle_range](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_angle_range)
@ -1343,6 +1432,10 @@ set_post_draw|bool||[lv_scale_set_post_draw](https://docs.lvgl.io/9.0/search.htm
set_range|int, int||[lv_scale_set_range](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_range)
set_rotation|int||[lv_scale_set_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_rotation)
set_rotation|int||[lv_scale_set_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_rotation)
set_section_range|lv.scale_section, int, int||[lv_scale_set_section_range](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_section_range)
set_section_style_indicator|lv.scale_section, lv.style||[lv_scale_set_section_style_indicator](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_section_style_indicator)
set_section_style_items|lv.scale_section, lv.style||[lv_scale_set_section_style_items](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_section_style_items)
set_section_style_main|lv.scale_section, lv.style||[lv_scale_set_section_style_main](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_section_style_main)
set_text_src|lv.str_arr||[lv_scale_set_text_src](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_text_src)
set_total_tick_count|int||[lv_scale_set_total_tick_count](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_total_tick_count)
@ -1359,28 +1452,32 @@ get_point_pos_by_id|lv.chart_series, int, comptr||[lv_chart_get_point_pos_by_id]
get_pressed_point||int|[lv_chart_get_pressed_point](https://docs.lvgl.io/9.0/search.html?q=lv_chart_get_pressed_point)
get_series_color|lv.chart_series|lv.color|[lv_chart_get_series_color](https://docs.lvgl.io/9.0/search.html?q=lv_chart_get_series_color)
get_series_next|lv.chart_series|lv.chart_series|[lv_chart_get_series_next](https://docs.lvgl.io/9.0/search.html?q=lv_chart_get_series_next)
get_series_x_array|lv.chart_series|lv.int_arr|[lv_chart_get_series_x_array](https://docs.lvgl.io/9.0/search.html?q=lv_chart_get_series_x_array)
get_series_y_array|lv.chart_series|lv.int_arr|[lv_chart_get_series_y_array](https://docs.lvgl.io/9.0/search.html?q=lv_chart_get_series_y_array)
get_type||int|[lv_chart_get_type](https://docs.lvgl.io/9.0/search.html?q=lv_chart_get_type)
get_x_array|lv.chart_series|lv.int_arr|[lv_chart_get_x_array](https://docs.lvgl.io/9.0/search.html?q=lv_chart_get_x_array)
get_x_start_point|lv.chart_series|int|[lv_chart_get_x_start_point](https://docs.lvgl.io/9.0/search.html?q=lv_chart_get_x_start_point)
get_y_array|lv.chart_series|lv.int_arr|[lv_chart_get_y_array](https://docs.lvgl.io/9.0/search.html?q=lv_chart_get_y_array)
hide_series|lv.chart_series, bool||[lv_chart_hide_series](https://docs.lvgl.io/9.0/search.html?q=lv_chart_hide_series)
refresh|||[lv_chart_refresh](https://docs.lvgl.io/9.0/search.html?q=lv_chart_refresh)
remove_series|lv.chart_series||[lv_chart_remove_series](https://docs.lvgl.io/9.0/search.html?q=lv_chart_remove_series)
set_all_value|lv.chart_series, int||[lv_chart_set_all_value](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_all_value)
set_all_values|lv.chart_series, int||[lv_chart_set_all_values](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_all_values)
set_axis_range|int, int, int||[lv_chart_set_axis_range](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_axis_range)
set_cursor_point|lv.chart_cursor, lv.chart_series, int||[lv_chart_set_cursor_point](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_cursor_point)
set_cursor_pos|lv.chart_cursor, comptr||[lv_chart_set_cursor_pos](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_cursor_pos)
set_cursor_pos_x|lv.chart_cursor, int||[lv_chart_set_cursor_pos_x](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_cursor_pos_x)
set_cursor_pos_y|lv.chart_cursor, int||[lv_chart_set_cursor_pos_y](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_cursor_pos_y)
set_div_line_count|int, int||[lv_chart_set_div_line_count](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_div_line_count)
set_ext_x_array|lv.chart_series, lv.int_arr||[lv_chart_set_ext_x_array](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_ext_x_array)
set_ext_y_array|lv.chart_series, lv.int_arr||[lv_chart_set_ext_y_array](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_ext_y_array)
set_next_value|lv.chart_series, int||[lv_chart_set_next_value](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_next_value)
set_next_value2|lv.chart_series, int, int||[lv_chart_set_next_value2](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_next_value2)
set_point_count|int||[lv_chart_set_point_count](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_point_count)
set_range|int, int, int||[lv_chart_set_range](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_range)
set_series_color|lv.chart_series, lv.color||[lv_chart_set_series_color](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_series_color)
set_series_ext_x_array|lv.chart_series, lv.int_arr||[lv_chart_set_series_ext_x_array](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_series_ext_x_array)
set_series_ext_y_array|lv.chart_series, lv.int_arr||[lv_chart_set_series_ext_y_array](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_series_ext_y_array)
set_series_value_by_id|lv.chart_series, int, int||[lv_chart_set_series_value_by_id](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_series_value_by_id)
set_series_value_by_id2|lv.chart_series, int, int, int||[lv_chart_set_series_value_by_id2](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_series_value_by_id2)
set_series_values|lv.chart_series, lv.int_arr, int||[lv_chart_set_series_values](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_series_values)
set_series_values2|lv.chart_series, lv.int_arr, lv.int_arr, int||[lv_chart_set_series_values2](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_series_values2)
set_type|int||[lv_chart_set_type](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_type)
set_update_mode|int||[lv_chart_set_update_mode](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_update_mode)
set_value_by_id|lv.chart_series, int, int||[lv_chart_set_value_by_id](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_value_by_id)
set_value_by_id2|lv.chart_series, int, int, int||[lv_chart_set_value_by_id2](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_value_by_id2)
set_x_start_point|lv.chart_series, int||[lv_chart_set_x_start_point](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_x_start_point)
### widget `lv.imagebutton`
@ -1501,25 +1598,36 @@ set_button_text|lv.obj, string||[lv_list_set_button_text](https://docs.lvgl.io/9
Method|Arguments|Return type|LVGL equivalent
:---|:---|:---|:---
del||bool|[lv_animimg_delete](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_delete)
delete||bool|[lv_animimg_delete](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_delete)
get_anim||lv.anim|[lv_animimg_get_anim](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_get_anim)
get_duration||int|[lv_animimg_get_duration](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_get_duration)
get_repeat_count||int|[lv_animimg_get_repeat_count](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_get_repeat_count)
get_src_count||int|[lv_animimg_get_src_count](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_get_src_count)
remove||bool|[lv_animimg_delete](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_delete)
set_completed_cb|comptr||[lv_animimg_set_completed_cb](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_set_completed_cb)
set_duration|int||[lv_animimg_set_duration](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_set_duration)
set_ready_cb|comptr||[lv_animimg_set_completed_cb](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_set_completed_cb)
set_repeat_count|int||[lv_animimg_set_repeat_count](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_set_repeat_count)
set_reverse_delay|int||[lv_animimg_set_reverse_delay](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_set_reverse_delay)
set_reverse_duration|int||[lv_animimg_set_reverse_duration](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_set_reverse_duration)
set_src|comptr, int||[lv_animimg_set_src](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_set_src)
set_src_reverse|comptr, int||[lv_animimg_set_src_reverse](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_set_src_reverse)
set_start_cb|comptr||[lv_animimg_set_start_cb](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_set_start_cb)
start|||[lv_animimg_start](https://docs.lvgl.io/9.0/search.html?q=lv_animimg_start)
### widget `lv.calendar`
Method|Arguments|Return type|LVGL equivalent
:---|:---|:---|:---
add_header_arrow||lv.obj|[lv_calendar_add_header_arrow](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_add_header_arrow)
add_header_dropdown||lv.obj|[lv_calendar_add_header_dropdown](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_add_header_dropdown)
get_btnmatrix||lv.obj|[lv_calendar_get_btnmatrix](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_get_btnmatrix)
get_highlighted_dates_num||int|[lv_calendar_get_highlighted_dates_num](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_get_highlighted_dates_num)
header_dropdown_set_year_list|string||[lv_calendar_header_dropdown_set_year_list](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_header_dropdown_set_year_list)
set_chinese_mode|bool||[lv_calendar_set_chinese_mode](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_set_chinese_mode)
set_day_names|comptr||[lv_calendar_set_day_names](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_set_day_names)
set_showed_date|int, int||[lv_calendar_set_showed_date](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_set_showed_date)
set_month_shown|int, int||[lv_calendar_set_month_shown](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_set_month_shown)
set_today_date|int, int, int||[lv_calendar_set_today_date](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_set_today_date)
### widget `lv.menu_page`

View File

@ -13,6 +13,7 @@ extern "C" {
/* `lv_style` methods */
const be_ntv_func_def_t lv_style_func[] = {
{ "copy", { (const void*) &lv_style_copy, "", "(lv.style)(lv.style)" } },
{ "is_const", { (const void*) &lv_style_is_const, "b", "(lv.style)" } },
{ "is_empty", { (const void*) &lv_style_is_empty, "b", "(lv.style)" } },
{ "remove_prop", { (const void*) &lv_style_remove_prop, "b", "(lv.style)i" } },
@ -86,10 +87,13 @@ const be_ntv_func_def_t lv_style_func[] = {
{ "set_line_opa", { (const void*) &lv_style_set_line_opa, "", "(lv.style)i" } },
{ "set_line_rounded", { (const void*) &lv_style_set_line_rounded, "", "(lv.style)b" } },
{ "set_line_width", { (const void*) &lv_style_set_line_width, "", "(lv.style)i" } },
{ "set_margin_all", { (const void*) &lv_style_set_margin_all, "", "(lv.style)i" } },
{ "set_margin_bottom", { (const void*) &lv_style_set_margin_bottom, "", "(lv.style)i" } },
{ "set_margin_hor", { (const void*) &lv_style_set_margin_hor, "", "(lv.style)i" } },
{ "set_margin_left", { (const void*) &lv_style_set_margin_left, "", "(lv.style)i" } },
{ "set_margin_right", { (const void*) &lv_style_set_margin_right, "", "(lv.style)i" } },
{ "set_margin_top", { (const void*) &lv_style_set_margin_top, "", "(lv.style)i" } },
{ "set_margin_ver", { (const void*) &lv_style_set_margin_ver, "", "(lv.style)i" } },
{ "set_max_height", { (const void*) &lv_style_set_max_height, "", "(lv.style)i" } },
{ "set_max_width", { (const void*) &lv_style_set_max_width, "", "(lv.style)i" } },
{ "set_min_height", { (const void*) &lv_style_set_min_height, "", "(lv.style)i" } },
@ -106,12 +110,16 @@ const be_ntv_func_def_t lv_style_func[] = {
{ "set_pad_gap", { (const void*) &lv_style_set_pad_gap, "", "(lv.style)i" } },
{ "set_pad_hor", { (const void*) &lv_style_set_pad_hor, "", "(lv.style)i" } },
{ "set_pad_left", { (const void*) &lv_style_set_pad_left, "", "(lv.style)i" } },
{ "set_pad_radial", { (const void*) &lv_style_set_pad_radial, "", "(lv.style)i" } },
{ "set_pad_right", { (const void*) &lv_style_set_pad_right, "", "(lv.style)i" } },
{ "set_pad_row", { (const void*) &lv_style_set_pad_row, "", "(lv.style)i" } },
{ "set_pad_top", { (const void*) &lv_style_set_pad_top, "", "(lv.style)i" } },
{ "set_pad_ver", { (const void*) &lv_style_set_pad_ver, "", "(lv.style)i" } },
{ "set_prop", { (const void*) &lv_style_set_prop, "", "(lv.style)ii" } },
{ "set_radial_offset", { (const void*) &lv_style_set_radial_offset, "", "(lv.style)i" } },
{ "set_radius", { (const void*) &lv_style_set_radius, "", "(lv.style)i" } },
{ "set_recolor", { (const void*) &lv_style_set_recolor, "", "(lv.style)(lv.color)" } },
{ "set_recolor_opa", { (const void*) &lv_style_set_recolor_opa, "", "(lv.style)i" } },
{ "set_rotary_sensitivity", { (const void*) &lv_style_set_rotary_sensitivity, "", "(lv.style)i" } },
{ "set_shadow_color", { (const void*) &lv_style_set_shadow_color, "", "(lv.style)(lv.color)" } },
{ "set_shadow_offset_x", { (const void*) &lv_style_set_shadow_offset_x, "", "(lv.style)i" } },
@ -129,6 +137,9 @@ const be_ntv_func_def_t lv_style_func[] = {
{ "set_text_letter_space", { (const void*) &lv_style_set_text_letter_space, "", "(lv.style)i" } },
{ "set_text_line_space", { (const void*) &lv_style_set_text_line_space, "", "(lv.style)i" } },
{ "set_text_opa", { (const void*) &lv_style_set_text_opa, "", "(lv.style)i" } },
{ "set_text_outline_stroke_color", { (const void*) &lv_style_set_text_outline_stroke_color, "", "(lv.style)(lv.color)" } },
{ "set_text_outline_stroke_opa", { (const void*) &lv_style_set_text_outline_stroke_opa, "", "(lv.style)i" } },
{ "set_text_outline_stroke_width", { (const void*) &lv_style_set_text_outline_stroke_width, "", "(lv.style)i" } },
{ "set_transform_angle", { (const void*) &lv_style_set_transform_rotation, "", "(lv.style)i" } },
{ "set_transform_height", { (const void*) &lv_style_set_transform_height, "", "(lv.style)i" } },
{ "set_transform_pivot_x", { (const void*) &lv_style_set_transform_pivot_x, "", "(lv.style)i" } },
@ -142,6 +153,7 @@ const be_ntv_func_def_t lv_style_func[] = {
{ "set_transform_width", { (const void*) &lv_style_set_transform_width, "", "(lv.style)i" } },
{ "set_transform_zoom", { (const void*) &lv_style_set_transform_scale, "", "(lv.style)i" } },
{ "set_transition", { (const void*) &lv_style_set_transition, "", "(lv.style)(lv.style_transition_dsc)" } },
{ "set_translate_radial", { (const void*) &lv_style_set_translate_radial, "", "(lv.style)i" } },
{ "set_translate_x", { (const void*) &lv_style_set_translate_x, "", "(lv.style)i" } },
{ "set_translate_y", { (const void*) &lv_style_set_translate_y, "", "(lv.style)i" } },
{ "set_width", { (const void*) &lv_style_set_width, "", "(lv.style)i" } },
@ -216,9 +228,9 @@ const be_ntv_func_def_t lv_obj_func[] = {
{ "dump_tree", { (const void*) &lv_obj_dump_tree, "", "(lv.obj)" } },
{ "fade_in", { (const void*) &lv_obj_fade_in, "", "(lv.obj)ii" } },
{ "fade_out", { (const void*) &lv_obj_fade_out, "", "(lv.obj)ii" } },
{ "find_by_id", { (const void*) &lv_obj_find_by_id, "lv.obj", "(lv.obj)." } },
{ "free_id", { (const void*) &lv_obj_free_id, "", "(lv.obj)" } },
{ "get_child", { (const void*) &lv_obj_get_child, "lv.obj", "(lv.obj)i" } },
{ "get_child_by_id", { (const void*) &lv_obj_get_child_by_id, "lv.obj", "(lv.obj)." } },
{ "get_child_by_type", { (const void*) &lv_obj_get_child_by_type, "lv.obj", "(lv.obj)i(lv.obj_class)" } },
{ "get_child_cnt", { (const void*) &lv_obj_get_child_count, "i", "(lv.obj)" } },
{ "get_child_count", { (const void*) &lv_obj_get_child_count, "i", "(lv.obj)" } },
@ -348,11 +360,16 @@ const be_ntv_func_def_t lv_obj_func[] = {
{ "get_style_pad_bottom", { (const void*) &lv_obj_get_style_pad_bottom, "i", "(lv.obj)i" } },
{ "get_style_pad_column", { (const void*) &lv_obj_get_style_pad_column, "i", "(lv.obj)i" } },
{ "get_style_pad_left", { (const void*) &lv_obj_get_style_pad_left, "i", "(lv.obj)i" } },
{ "get_style_pad_radial", { (const void*) &lv_obj_get_style_pad_radial, "i", "(lv.obj)i" } },
{ "get_style_pad_right", { (const void*) &lv_obj_get_style_pad_right, "i", "(lv.obj)i" } },
{ "get_style_pad_row", { (const void*) &lv_obj_get_style_pad_row, "i", "(lv.obj)i" } },
{ "get_style_pad_top", { (const void*) &lv_obj_get_style_pad_top, "i", "(lv.obj)i" } },
{ "get_style_prop", { (const void*) &lv_obj_get_style_prop, "i", "(lv.obj)ii" } },
{ "get_style_radial_offset", { (const void*) &lv_obj_get_style_radial_offset, "i", "(lv.obj)i" } },
{ "get_style_radius", { (const void*) &lv_obj_get_style_radius, "i", "(lv.obj)i" } },
{ "get_style_recolor", { (const void*) &lv_obj_get_style_recolor, "lv.color", "(lv.obj)i" } },
{ "get_style_recolor_opa", { (const void*) &lv_obj_get_style_recolor_opa, "i", "(lv.obj)i" } },
{ "get_style_recolor_recursive", { (const void*) &lv_obj_get_style_recolor_recursive, "i", "(lv.obj)i" } },
{ "get_style_rotary_sensitivity", { (const void*) &lv_obj_get_style_rotary_sensitivity, "i", "(lv.obj)i" } },
{ "get_style_shadow_color", { (const void*) &lv_obj_get_style_shadow_color, "lv.color", "(lv.obj)i" } },
{ "get_style_shadow_color_filtered", { (const void*) &lv_obj_get_style_shadow_color_filtered, "lv.color", "(lv.obj)i" } },
@ -375,6 +392,10 @@ const be_ntv_func_def_t lv_obj_func[] = {
{ "get_style_text_letter_space", { (const void*) &lv_obj_get_style_text_letter_space, "i", "(lv.obj)i" } },
{ "get_style_text_line_space", { (const void*) &lv_obj_get_style_text_line_space, "i", "(lv.obj)i" } },
{ "get_style_text_opa", { (const void*) &lv_obj_get_style_text_opa, "i", "(lv.obj)i" } },
{ "get_style_text_outline_stroke_color", { (const void*) &lv_obj_get_style_text_outline_stroke_color, "lv.color", "(lv.obj)i" } },
{ "get_style_text_outline_stroke_color_filtered", { (const void*) &lv_obj_get_style_text_outline_stroke_color_filtered, "lv.color", "(lv.obj)i" } },
{ "get_style_text_outline_stroke_opa", { (const void*) &lv_obj_get_style_text_outline_stroke_opa, "i", "(lv.obj)i" } },
{ "get_style_text_outline_stroke_width", { (const void*) &lv_obj_get_style_text_outline_stroke_width, "i", "(lv.obj)i" } },
{ "get_style_transform_angle", { (const void*) &lv_obj_get_style_transform_rotation, "i", "(lv.obj)i" } },
{ "get_style_transform_height", { (const void*) &lv_obj_get_style_transform_height, "i", "(lv.obj)i" } },
{ "get_style_transform_pivot_x", { (const void*) &lv_obj_get_style_transform_pivot_x, "i", "(lv.obj)i" } },
@ -388,6 +409,7 @@ const be_ntv_func_def_t lv_obj_func[] = {
{ "get_style_transform_skew_y", { (const void*) &lv_obj_get_style_transform_skew_y, "i", "(lv.obj)i" } },
{ "get_style_transform_width", { (const void*) &lv_obj_get_style_transform_width, "i", "(lv.obj)i" } },
{ "get_style_transition", { (const void*) &lv_obj_get_style_transition, "lv.style_transition_dsc", "(lv.obj)i" } },
{ "get_style_translate_radial", { (const void*) &lv_obj_get_style_translate_radial, "i", "(lv.obj)i" } },
{ "get_style_translate_x", { (const void*) &lv_obj_get_style_translate_x, "i", "(lv.obj)i" } },
{ "get_style_translate_y", { (const void*) &lv_obj_get_style_translate_y, "i", "(lv.obj)i" } },
{ "get_style_width", { (const void*) &lv_obj_get_style_width, "i", "(lv.obj)i" } },
@ -435,7 +457,7 @@ const be_ntv_func_def_t lv_obj_func[] = {
{ "refresh_style", { (const void*) &lv_obj_refresh_style, "", "(lv.obj)ii" } },
{ "remove", { (const void*) &lv_obj_delete, "", "(lv.obj)" } },
{ "remove_event", { (const void*) &lv_obj_remove_event, "b", "(lv.obj)i" } },
{ "remove_event_cb", { (const void*) &lv_obj_remove_event_cb, "b", "(lv.obj)." } },
{ "remove_event_cb", { (const void*) &lv_obj_remove_event_cb, "i", "(lv.obj)." } },
{ "remove_event_cb_with_user_data", { (const void*) &lv_obj_remove_event_cb_with_user_data, "i", "(lv.obj).." } },
{ "remove_event_dsc", { (const void*) &lv_obj_remove_event_dsc, "b", "(lv.obj)(lv.event_dsc)" } },
{ "remove_flag", { (const void*) &lv_obj_remove_flag, "", "(lv.obj)i" } },
@ -444,6 +466,7 @@ const be_ntv_func_def_t lv_obj_func[] = {
{ "remove_style", { (const void*) &lv_obj_remove_style, "", "(lv.obj)(lv.style)i" } },
{ "remove_style_all", { (const void*) &lv_obj_remove_style_all, "", "(lv.obj)" } },
{ "replace_style", { (const void*) &lv_obj_replace_style, "b", "(lv.obj)(lv.style)(lv.style)i" } },
{ "reset_transform", { (const void*) &lv_obj_reset_transform, "", "(lv.obj)" } },
{ "scroll_by", { (const void*) &lv_obj_scroll_by, "", "(lv.obj)iii" } },
{ "scroll_by_bounded", { (const void*) &lv_obj_scroll_by_bounded, "", "(lv.obj)iii" } },
{ "scroll_to", { (const void*) &lv_obj_scroll_to, "", "(lv.obj)iii" } },
@ -457,6 +480,7 @@ const be_ntv_func_def_t lv_obj_func[] = {
{ "set_content_height", { (const void*) &lv_obj_set_content_height, "", "(lv.obj)i" } },
{ "set_content_width", { (const void*) &lv_obj_set_content_width, "", "(lv.obj)i" } },
{ "set_ext_click_area", { (const void*) &lv_obj_set_ext_click_area, "", "(lv.obj)i" } },
{ "set_flag", { (const void*) &lv_obj_set_flag, "", "(lv.obj)ib" } },
{ "set_flex_align", { (const void*) &lv_obj_set_flex_align, "", "(lv.obj)iii" } },
{ "set_flex_flow", { (const void*) &lv_obj_set_flex_flow, "", "(lv.obj)i" } },
{ "set_flex_grow", { (const void*) &lv_obj_set_flex_grow, "", "(lv.obj)i" } },
@ -562,11 +586,15 @@ const be_ntv_func_def_t lv_obj_func[] = {
{ "set_style_pad_gap", { (const void*) &lv_obj_set_style_pad_gap, "", "(lv.obj)ii" } },
{ "set_style_pad_hor", { (const void*) &lv_obj_set_style_pad_hor, "", "(lv.obj)ii" } },
{ "set_style_pad_left", { (const void*) &lv_obj_set_style_pad_left, "", "(lv.obj)ii" } },
{ "set_style_pad_radial", { (const void*) &lv_obj_set_style_pad_radial, "", "(lv.obj)ii" } },
{ "set_style_pad_right", { (const void*) &lv_obj_set_style_pad_right, "", "(lv.obj)ii" } },
{ "set_style_pad_row", { (const void*) &lv_obj_set_style_pad_row, "", "(lv.obj)ii" } },
{ "set_style_pad_top", { (const void*) &lv_obj_set_style_pad_top, "", "(lv.obj)ii" } },
{ "set_style_pad_ver", { (const void*) &lv_obj_set_style_pad_ver, "", "(lv.obj)ii" } },
{ "set_style_radial_offset", { (const void*) &lv_obj_set_style_radial_offset, "", "(lv.obj)ii" } },
{ "set_style_radius", { (const void*) &lv_obj_set_style_radius, "", "(lv.obj)ii" } },
{ "set_style_recolor", { (const void*) &lv_obj_set_style_recolor, "", "(lv.obj)(lv.color)i" } },
{ "set_style_recolor_opa", { (const void*) &lv_obj_set_style_recolor_opa, "", "(lv.obj)ii" } },
{ "set_style_rotary_sensitivity", { (const void*) &lv_obj_set_style_rotary_sensitivity, "", "(lv.obj)ii" } },
{ "set_style_shadow_color", { (const void*) &lv_obj_set_style_shadow_color, "", "(lv.obj)(lv.color)i" } },
{ "set_style_shadow_offset_x", { (const void*) &lv_obj_set_style_shadow_offset_x, "", "(lv.obj)ii" } },
@ -584,6 +612,9 @@ const be_ntv_func_def_t lv_obj_func[] = {
{ "set_style_text_letter_space", { (const void*) &lv_obj_set_style_text_letter_space, "", "(lv.obj)ii" } },
{ "set_style_text_line_space", { (const void*) &lv_obj_set_style_text_line_space, "", "(lv.obj)ii" } },
{ "set_style_text_opa", { (const void*) &lv_obj_set_style_text_opa, "", "(lv.obj)ii" } },
{ "set_style_text_outline_stroke_color", { (const void*) &lv_obj_set_style_text_outline_stroke_color, "", "(lv.obj)(lv.color)i" } },
{ "set_style_text_outline_stroke_opa", { (const void*) &lv_obj_set_style_text_outline_stroke_opa, "", "(lv.obj)ii" } },
{ "set_style_text_outline_stroke_width", { (const void*) &lv_obj_set_style_text_outline_stroke_width, "", "(lv.obj)ii" } },
{ "set_style_transform_angle", { (const void*) &lv_obj_set_style_transform_rotation, "", "(lv.obj)ii" } },
{ "set_style_transform_height", { (const void*) &lv_obj_set_style_transform_height, "", "(lv.obj)ii" } },
{ "set_style_transform_pivot_x", { (const void*) &lv_obj_set_style_transform_pivot_x, "", "(lv.obj)ii" } },
@ -597,6 +628,7 @@ const be_ntv_func_def_t lv_obj_func[] = {
{ "set_style_transform_width", { (const void*) &lv_obj_set_style_transform_width, "", "(lv.obj)ii" } },
{ "set_style_transform_zoom", { (const void*) &lv_obj_set_style_transform_scale, "", "(lv.obj)ii" } },
{ "set_style_transition", { (const void*) &lv_obj_set_style_transition, "", "(lv.obj)(lv.style_transition_dsc)i" } },
{ "set_style_translate_radial", { (const void*) &lv_obj_set_style_translate_radial, "", "(lv.obj)ii" } },
{ "set_style_translate_x", { (const void*) &lv_obj_set_style_translate_x, "", "(lv.obj)ii" } },
{ "set_style_translate_y", { (const void*) &lv_obj_set_style_translate_y, "", "(lv.obj)ii" } },
{ "set_style_width", { (const void*) &lv_obj_set_style_width, "", "(lv.obj)ii" } },
@ -606,12 +638,13 @@ const be_ntv_func_def_t lv_obj_func[] = {
{ "set_width", { (const void*) &lv_obj_set_width, "", "(lv.obj)i" } },
{ "set_x", { (const void*) &lv_obj_set_x, "", "(lv.obj)i" } },
{ "set_y", { (const void*) &lv_obj_set_y, "", "(lv.obj)i" } },
{ "stop_scroll_anim", { (const void*) &lv_obj_stop_scroll_anim, "", "(lv.obj)" } },
{ "stringify_id", { (const void*) &lv_obj_stringify_id, "s", "(lv.obj)ci" } },
{ "style_apply_color_filter", { (const void*) &lv_obj_style_apply_color_filter, "i", "(lv.obj)ii" } },
{ "style_apply_recolor", { (const void*) &lv_obj_style_apply_recolor, "i", "(lv.obj)ii" } },
{ "swap", { (const void*) &lv_obj_swap, "", "(lv.obj)(lv.obj)" } },
{ "transform_point", { (const void*) &lv_obj_transform_point, "", "(lv.obj)ci" } },
{ "transform_point_array", { (const void*) &lv_obj_transform_point_array, "", "(lv.obj)(lv.point_arr)ii" } },
{ "update_flag", { (const void*) &lv_obj_update_flag, "", "(lv.obj)ib" } },
{ "update_layout", { (const void*) &lv_obj_update_layout, "", "(lv.obj)" } },
{ "update_snap", { (const void*) &lv_obj_update_snap, "", "(lv.obj)i" } },
};
@ -625,6 +658,7 @@ const be_ntv_func_def_t lv_event_func[] = {
{ "get_current_target_obj", { (const void*) &lv_event_get_current_target_obj, "lv.obj", "(lv.event)" } },
{ "get_hit_test_info", { (const void*) &lv_event_get_hit_test_info, "c", "(lv.event)" } },
{ "get_indev", { (const void*) &lv_event_get_indev, "lv.indev", "(lv.event)" } },
{ "get_invalidated_area", { (const void*) &lv_event_get_invalidated_area, "lv.area", "(lv.event)" } },
{ "get_key", { (const void*) &lv_event_get_key, "i", "(lv.event)" } },
{ "get_layer", { (const void*) &lv_event_get_layer, "lv.layer", "(lv.event)" } },
{ "get_old_size", { (const void*) &lv_event_get_old_size, "lv.area", "(lv.event)" } },
@ -654,18 +688,23 @@ const be_ntv_func_def_t lv_display_func[] = {
{ "get_antialiasing", { (const void*) &lv_display_get_antialiasing, "b", "(lv.display)" } },
{ "get_color_format", { (const void*) &lv_display_get_color_format, "i", "(lv.display)" } },
{ "get_dpi", { (const void*) &lv_display_get_dpi, "i", "(lv.display)" } },
{ "get_draw_buf_size", { (const void*) &lv_display_get_draw_buf_size, "i", "(lv.display)" } },
{ "get_driver_data", { (const void*) &lv_display_get_driver_data, "c", "(lv.display)" } },
{ "get_event_count", { (const void*) &lv_display_get_event_count, "i", "(lv.display)" } },
{ "get_event_dsc", { (const void*) &lv_display_get_event_dsc, "lv.event_dsc", "(lv.display)i" } },
{ "get_hor_res", { (const void*) &lv_display_get_horizontal_resolution, "i", "(lv.display)" } },
{ "get_horizontal_resolution", { (const void*) &lv_display_get_horizontal_resolution, "i", "(lv.display)" } },
{ "get_inactive_time", { (const void*) &lv_display_get_inactive_time, "i", "(lv.display)" } },
{ "get_invalidated_draw_buf_size", { (const void*) &lv_display_get_invalidated_draw_buf_size, "i", "(lv.display)ii" } },
{ "get_layer_bottom", { (const void*) &lv_display_get_layer_bottom, "lv.obj", "(lv.display)" } },
{ "get_layer_sys", { (const void*) &lv_display_get_layer_sys, "lv.obj", "(lv.display)" } },
{ "get_layer_top", { (const void*) &lv_display_get_layer_top, "lv.obj", "(lv.display)" } },
{ "get_matrix_rotation", { (const void*) &lv_display_get_matrix_rotation, "b", "(lv.display)" } },
{ "get_next", { (const void*) &lv_display_get_next, "lv.display", "(lv.display)" } },
{ "get_offset_x", { (const void*) &lv_display_get_offset_x, "i", "(lv.display)" } },
{ "get_offset_y", { (const void*) &lv_display_get_offset_y, "i", "(lv.display)" } },
{ "get_original_horizontal_resolution", { (const void*) &lv_display_get_original_horizontal_resolution, "i", "(lv.display)" } },
{ "get_original_vertical_resolution", { (const void*) &lv_display_get_original_vertical_resolution, "i", "(lv.display)" } },
{ "get_physical_hor_res", { (const void*) &lv_display_get_physical_horizontal_resolution, "i", "(lv.display)" } },
{ "get_physical_horizontal_resolution", { (const void*) &lv_display_get_physical_horizontal_resolution, "i", "(lv.display)" } },
{ "get_physical_ver_res", { (const void*) &lv_display_get_physical_vertical_resolution, "i", "(lv.display)" } },
@ -677,31 +716,38 @@ const be_ntv_func_def_t lv_display_func[] = {
{ "get_screen_active", { (const void*) &lv_display_get_screen_active, "lv.obj", "(lv.display)" } },
{ "get_screen_prev", { (const void*) &lv_display_get_screen_prev, "lv.obj", "(lv.display)" } },
{ "get_theme", { (const void*) &lv_display_get_theme, "lv.theme", "(lv.display)" } },
{ "get_tile_cnt", { (const void*) &lv_display_get_tile_cnt, "i", "(lv.display)" } },
{ "get_user_data", { (const void*) &lv_display_get_user_data, "c", "(lv.display)" } },
{ "get_ver_res", { (const void*) &lv_display_get_vertical_resolution, "i", "(lv.display)" } },
{ "get_vertical_resolution", { (const void*) &lv_display_get_vertical_resolution, "i", "(lv.display)" } },
{ "is_double_buffered", { (const void*) &lv_display_is_double_buffered, "b", "(lv.display)" } },
{ "is_invalidation_enabled", { (const void*) &lv_display_is_invalidation_enabled, "b", "(lv.display)" } },
{ "register_vsync_event", { (const void*) &lv_display_register_vsync_event, "b", "(lv.display)^lv_event_cb^." } },
{ "remove", { (const void*) &lv_display_delete, "", "(lv.display)" } },
{ "remove_event_cb_with_user_data", { (const void*) &lv_display_remove_event_cb_with_user_data, "i", "(lv.display).." } },
{ "rotate_area", { (const void*) &lv_display_rotate_area, "", "(lv.display)(lv.area)" } },
{ "send_event", { (const void*) &lv_display_send_event, "i", "(lv.display)i." } },
{ "send_vsync_event", { (const void*) &lv_display_send_vsync_event, "i", "(lv.display)." } },
{ "set_angle", { (const void*) &lv_display_set_rotation, "", "(lv.display)i" } },
{ "set_antialiasing", { (const void*) &lv_display_set_antialiasing, "", "(lv.display)b" } },
{ "set_buffers", { (const void*) &lv_display_set_buffers, "", "(lv.display)..ii" } },
{ "set_buffers_with_stride", { (const void*) &lv_display_set_buffers_with_stride, "", "(lv.display)..iii" } },
{ "set_color_format", { (const void*) &lv_display_set_color_format, "", "(lv.display)i" } },
{ "set_default", { (const void*) &lv_display_set_default, "", "(lv.display)" } },
{ "set_dpi", { (const void*) &lv_display_set_dpi, "", "(lv.display)i" } },
{ "set_driver_data", { (const void*) &lv_display_set_driver_data, "", "(lv.display)." } },
{ "set_matrix_rotation", { (const void*) &lv_display_set_matrix_rotation, "", "(lv.display)b" } },
{ "set_offset", { (const void*) &lv_display_set_offset, "", "(lv.display)ii" } },
{ "set_physical_resolution", { (const void*) &lv_display_set_physical_resolution, "", "(lv.display)ii" } },
{ "set_render_mode", { (const void*) &lv_display_set_render_mode, "", "(lv.display)i" } },
{ "set_resolution", { (const void*) &lv_display_set_resolution, "", "(lv.display)ii" } },
{ "set_rotation", { (const void*) &lv_display_set_rotation, "", "(lv.display)i" } },
{ "set_theme", { (const void*) &lv_display_set_theme, "", "(lv.display)(lv.theme)" } },
{ "set_tile_cnt", { (const void*) &lv_display_set_tile_cnt, "", "(lv.display)i" } },
{ "set_user_data", { (const void*) &lv_display_set_user_data, "", "(lv.display)." } },
{ "trig_activity", { (const void*) &lv_display_trigger_activity, "", "(lv.display)" } },
{ "trigger_activity", { (const void*) &lv_display_trigger_activity, "", "(lv.display)" } },
{ "unregister_vsync_event", { (const void*) &lv_display_unregister_vsync_event, "b", "(lv.display)^lv_event_cb^." } },
};
/* `lv_indev` methods */
@ -710,6 +756,7 @@ const be_ntv_func_def_t lv_indev_func[] = {
{ "del", { (const void*) &lv_indev_delete, "", "(lv.indev)" } },
{ "delete", { (const void*) &lv_indev_delete, "", "(lv.indev)" } },
{ "enable", { (const void*) &lv_indev_enable, "", "(lv.indev)b" } },
{ "get_cursor", { (const void*) &lv_indev_get_cursor, "lv.obj", "(lv.indev)" } },
{ "get_disp", { (const void*) &lv_indev_get_display, "lv.display", "(lv.indev)" } },
{ "get_display", { (const void*) &lv_indev_get_display, "lv.display", "(lv.indev)" } },
{ "get_driver_data", { (const void*) &lv_indev_get_driver_data, "c", "(lv.indev)" } },
@ -725,6 +772,7 @@ const be_ntv_func_def_t lv_indev_func[] = {
{ "get_read_timer", { (const void*) &lv_indev_get_read_timer, "lv.timer", "(lv.indev)" } },
{ "get_scroll_dir", { (const void*) &lv_indev_get_scroll_dir, "i", "(lv.indev)" } },
{ "get_scroll_obj", { (const void*) &lv_indev_get_scroll_obj, "lv.obj", "(lv.indev)" } },
{ "get_short_click_streak", { (const void*) &lv_indev_get_short_click_streak, "i", "(lv.indev)" } },
{ "get_state", { (const void*) &lv_indev_get_state, "i", "(lv.indev)" } },
{ "get_type", { (const void*) &lv_indev_get_type, "i", "(lv.indev)" } },
{ "get_user_data", { (const void*) &lv_indev_get_user_data, "c", "(lv.indev)" } },
@ -743,6 +791,7 @@ const be_ntv_func_def_t lv_indev_func[] = {
{ "set_display", { (const void*) &lv_indev_set_display, "", "(lv.indev)(lv.display)" } },
{ "set_driver_data", { (const void*) &lv_indev_set_driver_data, "", "(lv.indev)." } },
{ "set_group", { (const void*) &lv_indev_set_group, "", "(lv.indev)(lv.group)" } },
{ "set_long_press_repeat_time", { (const void*) &lv_indev_set_long_press_repeat_time, "", "(lv.indev)i" } },
{ "set_long_press_time", { (const void*) &lv_indev_set_long_press_time, "", "(lv.indev)i" } },
{ "set_mode", { (const void*) &lv_indev_set_mode, "", "(lv.indev)i" } },
{ "set_scroll_limit", { (const void*) &lv_indev_set_scroll_limit, "", "(lv.indev)i" } },
@ -773,6 +822,10 @@ const be_ntv_func_def_t lv_anim_func[] = {
{ "get_time", { (const void*) &lv_anim_get_time, "i", "(lv.anim)" } },
{ "get_user_data", { (const void*) &lv_anim_get_user_data, "c", "(lv.anim)" } },
{ "init", { (const void*) &lv_anim_init, "", "(lv.anim)" } },
{ "is_paused", { (const void*) &lv_anim_is_paused, "b", "(lv.anim)" } },
{ "pause", { (const void*) &lv_anim_pause, "", "(lv.anim)" } },
{ "pause_for", { (const void*) &lv_anim_pause_for, "", "(lv.anim)i" } },
{ "resume", { (const void*) &lv_anim_resume, "", "(lv.anim)" } },
{ "set_bezier3_param", { (const void*) &lv_anim_set_bezier3_param, "", "(lv.anim)iiii" } },
{ "set_completed_cb", { (const void*) &lv_anim_set_completed_cb, "", "(lv.anim)c" } },
{ "set_custom_exec_cb", { (const void*) &lv_anim_set_custom_exec_cb, "", "(lv.anim)c" } },
@ -782,14 +835,13 @@ const be_ntv_func_def_t lv_anim_func[] = {
{ "set_exec_cb", { (const void*) &lv_anim_set_exec_cb, "", "(lv.anim)c" } },
{ "set_get_value_cb", { (const void*) &lv_anim_set_get_value_cb, "", "(lv.anim)c" } },
{ "set_path_cb", { (const void*) &lv_anim_set_path_cb, "", "(lv.anim)c" } },
{ "set_playback_delay", { (const void*) &lv_anim_set_playback_delay, "", "(lv.anim)i" } },
{ "set_playback_duration", { (const void*) &lv_anim_set_playback_duration, "", "(lv.anim)i" } },
{ "set_playback_time", { (const void*) &lv_anim_set_playback_time, "", "(lv.anim)i" } },
{ "set_ready_cb", { (const void*) &lv_anim_set_completed_cb, "", "(lv.anim)c" } },
{ "set_repeat_count", { (const void*) &lv_anim_set_repeat_count, "", "(lv.anim)i" } },
{ "set_repeat_delay", { (const void*) &lv_anim_set_repeat_delay, "", "(lv.anim)i" } },
{ "set_reverse_delay", { (const void*) &lv_anim_set_reverse_delay, "", "(lv.anim)i" } },
{ "set_reverse_duration", { (const void*) &lv_anim_set_reverse_duration, "", "(lv.anim)i" } },
{ "set_reverse_time", { (const void*) &lv_anim_set_reverse_time, "", "(lv.anim)i" } },
{ "set_start_cb", { (const void*) &lv_anim_set_start_cb, "", "(lv.anim)c" } },
{ "set_time", { (const void*) &lv_anim_set_time, "", "(lv.anim)i" } },
{ "set_user_data", { (const void*) &lv_anim_set_user_data, "", "(lv.anim)." } },
{ "set_values", { (const void*) &lv_anim_set_values, "", "(lv.anim)ii" } },
{ "set_var", { (const void*) &lv_anim_set_var, "", "(lv.anim)." } },
@ -818,13 +870,22 @@ const be_ntv_func_def_t lv_timer_func[] = {
/* `lv_animimg` methods */
#ifdef BE_LV_WIDGET_ANIMIMG
const be_ntv_func_def_t lv_animimg_func[] = {
{ "del", { (const void*) &lv_animimg_delete, "b", "(lv.obj)" } },
{ "delete", { (const void*) &lv_animimg_delete, "b", "(lv.obj)" } },
{ "get_anim", { (const void*) &lv_animimg_get_anim, "lv.anim", "(lv.obj)" } },
{ "get_duration", { (const void*) &lv_animimg_get_duration, "i", "(lv.obj)" } },
{ "get_repeat_count", { (const void*) &lv_animimg_get_repeat_count, "i", "(lv.obj)" } },
{ "get_src_count", { (const void*) &lv_animimg_get_src_count, "i", "(lv.obj)" } },
{ "remove", { (const void*) &lv_animimg_delete, "b", "(lv.obj)" } },
{ "set_completed_cb", { (const void*) &lv_animimg_set_completed_cb, "", "(lv.obj)c" } },
{ "set_duration", { (const void*) &lv_animimg_set_duration, "", "(lv.obj)i" } },
{ "set_ready_cb", { (const void*) &lv_animimg_set_completed_cb, "", "(lv.obj)c" } },
{ "set_repeat_count", { (const void*) &lv_animimg_set_repeat_count, "", "(lv.obj)i" } },
{ "set_reverse_delay", { (const void*) &lv_animimg_set_reverse_delay, "", "(lv.obj)i" } },
{ "set_reverse_duration", { (const void*) &lv_animimg_set_reverse_duration, "", "(lv.obj)i" } },
{ "set_src", { (const void*) &lv_animimg_set_src, "", "(lv.obj)ci" } },
{ "set_src_reverse", { (const void*) &lv_animimg_set_src_reverse, "", "(lv.obj)ci" } },
{ "set_start_cb", { (const void*) &lv_animimg_set_start_cb, "", "(lv.obj)c" } },
{ "start", { (const void*) &lv_animimg_start, "", "(lv.obj)" } },
};
#endif // BE_LV_WIDGET_ANIMIMG
@ -909,12 +970,14 @@ const be_ntv_func_def_t lv_buttonmatrix_func[] = {
/* `lv_calendar` methods */
#ifdef BE_LV_WIDGET_CALENDAR
const be_ntv_func_def_t lv_calendar_func[] = {
{ "add_header_arrow", { (const void*) &lv_calendar_add_header_arrow, "lv.obj", "(lv.obj)" } },
{ "add_header_dropdown", { (const void*) &lv_calendar_add_header_dropdown, "lv.obj", "(lv.obj)" } },
{ "get_btnmatrix", { (const void*) &lv_calendar_get_btnmatrix, "lv.obj", "(lv.obj)" } },
{ "get_highlighted_dates_num", { (const void*) &lv_calendar_get_highlighted_dates_num, "i", "(lv.obj)" } },
{ "header_dropdown_set_year_list", { (const void*) &lv_calendar_header_dropdown_set_year_list, "", "(lv.obj)s" } },
{ "set_chinese_mode", { (const void*) &lv_calendar_set_chinese_mode, "", "(lv.obj)b" } },
{ "set_day_names", { (const void*) &lv_calendar_set_day_names, "", "(lv.obj)c" } },
{ "set_showed_date", { (const void*) &lv_calendar_set_showed_date, "", "(lv.obj)ii" } },
{ "set_month_shown", { (const void*) &lv_calendar_set_month_shown, "", "(lv.obj)ii" } },
{ "set_today_date", { (const void*) &lv_calendar_set_today_date, "", "(lv.obj)iii" } },
};
#endif // BE_LV_WIDGET_CALENDAR
@ -946,28 +1009,32 @@ const be_ntv_func_def_t lv_chart_func[] = {
{ "get_pressed_point", { (const void*) &lv_chart_get_pressed_point, "i", "(lv.obj)" } },
{ "get_series_color", { (const void*) &lv_chart_get_series_color, "lv.color", "(lv.obj)(lv.chart_series)" } },
{ "get_series_next", { (const void*) &lv_chart_get_series_next, "lv.chart_series", "(lv.obj)(lv.chart_series)" } },
{ "get_series_x_array", { (const void*) &lv_chart_get_series_x_array, "lv.int_arr", "(lv.obj)(lv.chart_series)" } },
{ "get_series_y_array", { (const void*) &lv_chart_get_series_y_array, "lv.int_arr", "(lv.obj)(lv.chart_series)" } },
{ "get_type", { (const void*) &lv_chart_get_type, "i", "(lv.obj)" } },
{ "get_x_array", { (const void*) &lv_chart_get_x_array, "lv.int_arr", "(lv.obj)(lv.chart_series)" } },
{ "get_x_start_point", { (const void*) &lv_chart_get_x_start_point, "i", "(lv.obj)(lv.chart_series)" } },
{ "get_y_array", { (const void*) &lv_chart_get_y_array, "lv.int_arr", "(lv.obj)(lv.chart_series)" } },
{ "hide_series", { (const void*) &lv_chart_hide_series, "", "(lv.obj)(lv.chart_series)b" } },
{ "refresh", { (const void*) &lv_chart_refresh, "", "(lv.obj)" } },
{ "remove_series", { (const void*) &lv_chart_remove_series, "", "(lv.obj)(lv.chart_series)" } },
{ "set_all_value", { (const void*) &lv_chart_set_all_value, "", "(lv.obj)(lv.chart_series)i" } },
{ "set_all_values", { (const void*) &lv_chart_set_all_values, "", "(lv.obj)(lv.chart_series)i" } },
{ "set_axis_range", { (const void*) &lv_chart_set_axis_range, "", "(lv.obj)iii" } },
{ "set_cursor_point", { (const void*) &lv_chart_set_cursor_point, "", "(lv.obj)(lv.chart_cursor)(lv.chart_series)i" } },
{ "set_cursor_pos", { (const void*) &lv_chart_set_cursor_pos, "", "(lv.obj)(lv.chart_cursor)c" } },
{ "set_cursor_pos_x", { (const void*) &lv_chart_set_cursor_pos_x, "", "(lv.obj)(lv.chart_cursor)i" } },
{ "set_cursor_pos_y", { (const void*) &lv_chart_set_cursor_pos_y, "", "(lv.obj)(lv.chart_cursor)i" } },
{ "set_div_line_count", { (const void*) &lv_chart_set_div_line_count, "", "(lv.obj)ii" } },
{ "set_ext_x_array", { (const void*) &lv_chart_set_ext_x_array, "", "(lv.obj)(lv.chart_series)(lv.int_arr)" } },
{ "set_ext_y_array", { (const void*) &lv_chart_set_ext_y_array, "", "(lv.obj)(lv.chart_series)(lv.int_arr)" } },
{ "set_next_value", { (const void*) &lv_chart_set_next_value, "", "(lv.obj)(lv.chart_series)i" } },
{ "set_next_value2", { (const void*) &lv_chart_set_next_value2, "", "(lv.obj)(lv.chart_series)ii" } },
{ "set_point_count", { (const void*) &lv_chart_set_point_count, "", "(lv.obj)i" } },
{ "set_range", { (const void*) &lv_chart_set_range, "", "(lv.obj)iii" } },
{ "set_series_color", { (const void*) &lv_chart_set_series_color, "", "(lv.obj)(lv.chart_series)(lv.color)" } },
{ "set_series_ext_x_array", { (const void*) &lv_chart_set_series_ext_x_array, "", "(lv.obj)(lv.chart_series)(lv.int_arr)" } },
{ "set_series_ext_y_array", { (const void*) &lv_chart_set_series_ext_y_array, "", "(lv.obj)(lv.chart_series)(lv.int_arr)" } },
{ "set_series_value_by_id", { (const void*) &lv_chart_set_series_value_by_id, "", "(lv.obj)(lv.chart_series)ii" } },
{ "set_series_value_by_id2", { (const void*) &lv_chart_set_series_value_by_id2, "", "(lv.obj)(lv.chart_series)iii" } },
{ "set_series_values", { (const void*) &lv_chart_set_series_values, "", "(lv.obj)(lv.chart_series)(lv.int_arr)i" } },
{ "set_series_values2", { (const void*) &lv_chart_set_series_values2, "", "(lv.obj)(lv.chart_series)(lv.int_arr)(lv.int_arr)i" } },
{ "set_type", { (const void*) &lv_chart_set_type, "", "(lv.obj)i" } },
{ "set_update_mode", { (const void*) &lv_chart_set_update_mode, "", "(lv.obj)i" } },
{ "set_value_by_id", { (const void*) &lv_chart_set_value_by_id, "", "(lv.obj)(lv.chart_series)ii" } },
{ "set_value_by_id2", { (const void*) &lv_chart_set_value_by_id2, "", "(lv.obj)(lv.chart_series)iii" } },
{ "set_x_start_point", { (const void*) &lv_chart_set_x_start_point, "", "(lv.obj)(lv.chart_series)i" } },
};
#endif // BE_LV_WIDGET_CHART
@ -1026,6 +1093,10 @@ const be_ntv_func_def_t lv_image_func[] = {
{ "get_scale_x", { (const void*) &lv_image_get_scale_x, "i", "(lv.obj)" } },
{ "get_scale_y", { (const void*) &lv_image_get_scale_y, "i", "(lv.obj)" } },
{ "get_src", { (const void*) &lv_image_get_src, "c", "(lv.obj)" } },
{ "get_src_height", { (const void*) &lv_image_get_src_height, "i", "(lv.obj)" } },
{ "get_src_width", { (const void*) &lv_image_get_src_width, "i", "(lv.obj)" } },
{ "get_transformed_height", { (const void*) &lv_image_get_transformed_height, "i", "(lv.obj)" } },
{ "get_transformed_width", { (const void*) &lv_image_get_transformed_width, "i", "(lv.obj)" } },
{ "get_zoom", { (const void*) &lv_image_get_scale, "i", "(lv.obj)" } },
{ "set_angle", { (const void*) &lv_image_set_rotation, "", "(lv.obj)i" } },
{ "set_antialias", { (const void*) &lv_image_set_antialias, "", "(lv.obj)b" } },
@ -1076,12 +1147,14 @@ const be_ntv_func_def_t lv_label_func[] = {
{ "get_letter_on", { (const void*) &lv_label_get_letter_on, "i", "(lv.obj)cb" } },
{ "get_letter_pos", { (const void*) &lv_label_get_letter_pos, "", "(lv.obj)ic" } },
{ "get_long_mode", { (const void*) &lv_label_get_long_mode, "i", "(lv.obj)" } },
{ "get_recolor", { (const void*) &lv_label_get_recolor, "b", "(lv.obj)" } },
{ "get_text", { (const void*) &lv_label_get_text, "s", "(lv.obj)" } },
{ "get_text_selection_end", { (const void*) &lv_label_get_text_selection_end, "i", "(lv.obj)" } },
{ "get_text_selection_start", { (const void*) &lv_label_get_text_selection_start, "i", "(lv.obj)" } },
{ "ins_text", { (const void*) &lv_label_ins_text, "", "(lv.obj)is" } },
{ "is_char_under_pos", { (const void*) &lv_label_is_char_under_pos, "b", "(lv.obj)c" } },
{ "set_long_mode", { (const void*) &lv_label_set_long_mode, "", "(lv.obj)i" } },
{ "set_recolor", { (const void*) &lv_label_set_recolor, "", "(lv.obj)b" } },
{ "set_text", { (const void*) &lv_label_set_text, "", "(lv.obj)s" } },
{ "set_text_fmt", { (const void*) &lv_label_set_text_fmt, "", "(lv.obj)s[......]" } },
{ "set_text_selection_end", { (const void*) &lv_label_set_text_selection_end, "", "(lv.obj)i" } },
@ -1201,6 +1274,7 @@ const be_ntv_func_def_t lv_roller_func[] = {
{ "get_selected_str", { (const void*) &lv_roller_get_selected_str, "", "(lv.obj)ci" } },
{ "set_options", { (const void*) &lv_roller_set_options, "", "(lv.obj)si" } },
{ "set_selected", { (const void*) &lv_roller_set_selected, "", "(lv.obj)ii" } },
{ "set_selected_str", { (const void*) &lv_roller_set_selected_str, "b", "(lv.obj)si" } },
{ "set_visible_row_cnt", { (const void*) &lv_roller_set_visible_row_count, "", "(lv.obj)i" } },
{ "set_visible_row_count", { (const void*) &lv_roller_set_visible_row_count, "", "(lv.obj)i" } },
};
@ -1210,12 +1284,14 @@ const be_ntv_func_def_t lv_roller_func[] = {
#ifdef BE_LV_WIDGET_SCALE
const be_ntv_func_def_t lv_scale_func[] = {
{ "add_section", { (const void*) &lv_scale_add_section, "lv.scale_section", "(lv.obj)" } },
{ "get_angle", { (const void*) &lv_scale_get_rotation, "i", "(lv.obj)" } },
{ "get_angle_range", { (const void*) &lv_scale_get_angle_range, "i", "(lv.obj)" } },
{ "get_label_show", { (const void*) &lv_scale_get_label_show, "b", "(lv.obj)" } },
{ "get_major_tick_every", { (const void*) &lv_scale_get_major_tick_every, "i", "(lv.obj)" } },
{ "get_mode", { (const void*) &lv_scale_get_mode, "i", "(lv.obj)" } },
{ "get_range_max_value", { (const void*) &lv_scale_get_range_max_value, "i", "(lv.obj)" } },
{ "get_range_min_value", { (const void*) &lv_scale_get_range_min_value, "i", "(lv.obj)" } },
{ "get_rotation", { (const void*) &lv_scale_get_rotation, "i", "(lv.obj)" } },
{ "get_total_tick_count", { (const void*) &lv_scale_get_total_tick_count, "i", "(lv.obj)" } },
{ "set_angle", { (const void*) &lv_scale_set_rotation, "", "(lv.obj)i" } },
{ "set_angle_range", { (const void*) &lv_scale_set_angle_range, "", "(lv.obj)i" } },
@ -1228,6 +1304,10 @@ const be_ntv_func_def_t lv_scale_func[] = {
{ "set_post_draw", { (const void*) &lv_scale_set_post_draw, "", "(lv.obj)b" } },
{ "set_range", { (const void*) &lv_scale_set_range, "", "(lv.obj)ii" } },
{ "set_rotation", { (const void*) &lv_scale_set_rotation, "", "(lv.obj)i" } },
{ "set_section_range", { (const void*) &lv_scale_set_section_range, "", "(lv.obj)(lv.scale_section)ii" } },
{ "set_section_style_indicator", { (const void*) &lv_scale_set_section_style_indicator, "", "(lv.obj)(lv.scale_section)(lv.style)" } },
{ "set_section_style_items", { (const void*) &lv_scale_set_section_style_items, "", "(lv.obj)(lv.scale_section)(lv.style)" } },
{ "set_section_style_main", { (const void*) &lv_scale_set_section_style_main, "", "(lv.obj)(lv.scale_section)(lv.style)" } },
{ "set_text_src", { (const void*) &lv_scale_set_text_src, "", "(lv.obj)(lv.str_arr)" } },
{ "set_total_tick_count", { (const void*) &lv_scale_set_total_tick_count, "", "(lv.obj)i" } },
};
@ -1248,12 +1328,14 @@ const be_ntv_func_def_t lv_slider_func[] = {
{ "get_max_value", { (const void*) &lv_slider_get_max_value, "i", "(lv.obj)" } },
{ "get_min_value", { (const void*) &lv_slider_get_min_value, "i", "(lv.obj)" } },
{ "get_mode", { (const void*) &lv_slider_get_mode, "i", "(lv.obj)" } },
{ "get_orientation", { (const void*) &lv_slider_get_orientation, "i", "(lv.obj)" } },
{ "get_value", { (const void*) &lv_slider_get_value, "i", "(lv.obj)" } },
{ "is_dragged", { (const void*) &lv_slider_is_dragged, "b", "(lv.obj)" } },
{ "is_symmetrical", { (const void*) &lv_slider_is_symmetrical, "b", "(lv.obj)" } },
{ "set_left_value", { (const void*) &lv_slider_set_left_value, "", "(lv.obj)ii" } },
{ "set_mode", { (const void*) &lv_slider_set_mode, "", "(lv.obj)i" } },
{ "set_orientation", { (const void*) &lv_slider_set_orientation, "", "(lv.obj)i" } },
{ "set_range", { (const void*) &lv_slider_set_range, "", "(lv.obj)ii" } },
{ "set_start_value", { (const void*) &lv_slider_set_start_value, "", "(lv.obj)ii" } },
{ "set_value", { (const void*) &lv_slider_set_value, "", "(lv.obj)ii" } },
};
#endif // BE_LV_WIDGET_SLIDER
@ -1262,6 +1344,7 @@ const be_ntv_func_def_t lv_slider_func[] = {
#ifdef BE_LV_WIDGET_SPAN
const be_ntv_func_def_t lv_span_func[] = {
{ "get_style", { (const void*) &lv_span_get_style, "lv.style", "(lv.span)" } },
{ "get_text", { (const void*) &lv_span_get_text, "s", "(lv.span)" } },
{ "set_text", { (const void*) &lv_span_set_text, "", "(lv.span)s" } },
{ "set_text_static", { (const void*) &lv_span_set_text_static, "", "(lv.span)s" } },
};
@ -1270,6 +1353,7 @@ const be_ntv_func_def_t lv_span_func[] = {
/* `lv_spangroup` methods */
#ifdef BE_LV_WIDGET_SPANGROUP
const be_ntv_func_def_t lv_spangroup_func[] = {
{ "add_span", { (const void*) &lv_spangroup_add_span, "lv.span", "(lv.obj)" } },
{ "delete_span", { (const void*) &lv_spangroup_delete_span, "", "(lv.obj)(lv.span)" } },
{ "get_align", { (const void*) &lv_spangroup_get_align, "i", "(lv.obj)" } },
{ "get_child", { (const void*) &lv_spangroup_get_child, "lv.span", "(lv.obj)i" } },
@ -1280,14 +1364,18 @@ const be_ntv_func_def_t lv_spangroup_func[] = {
{ "get_max_lines", { (const void*) &lv_spangroup_get_max_lines, "i", "(lv.obj)" } },
{ "get_mode", { (const void*) &lv_spangroup_get_mode, "i", "(lv.obj)" } },
{ "get_overflow", { (const void*) &lv_spangroup_get_overflow, "i", "(lv.obj)" } },
{ "get_span_by_point", { (const void*) &lv_spangroup_get_span_by_point, "lv.span", "(lv.obj)c" } },
{ "get_span_coords", { (const void*) &lv_spangroup_get_span_coords, "lv.span_coords", "(lv.obj)(lv.span)" } },
{ "get_span_count", { (const void*) &lv_spangroup_get_span_count, "i", "(lv.obj)" } },
{ "new_span", { (const void*) &lv_spangroup_new_span, "lv.span", "(lv.obj)" } },
{ "refr_mode", { (const void*) &lv_spangroup_refr_mode, "", "(lv.obj)" } },
{ "refresh", { (const void*) &lv_spangroup_refresh, "", "(lv.obj)" } },
{ "set_align", { (const void*) &lv_spangroup_set_align, "", "(lv.obj)i" } },
{ "set_indent", { (const void*) &lv_spangroup_set_indent, "", "(lv.obj)i" } },
{ "set_max_lines", { (const void*) &lv_spangroup_set_max_lines, "", "(lv.obj)i" } },
{ "set_mode", { (const void*) &lv_spangroup_set_mode, "", "(lv.obj)i" } },
{ "set_overflow", { (const void*) &lv_spangroup_set_overflow, "", "(lv.obj)i" } },
{ "set_span_style", { (const void*) &lv_spangroup_set_span_style, "", "(lv.obj)(lv.span)(lv.style)" } },
{ "set_span_text", { (const void*) &lv_spangroup_set_span_text, "", "(lv.obj)(lv.span)s" } },
{ "set_span_text_static", { (const void*) &lv_spangroup_set_span_text_static, "", "(lv.obj)(lv.span)s" } },
};
#endif // BE_LV_WIDGET_SPANGROUP
@ -1321,13 +1409,14 @@ const be_ntv_func_def_t lv_spinner_func[] = {
/* `lv_switch` methods */
#ifdef BE_LV_WIDGET_SWITCH
const be_ntv_func_def_t lv_switch_func[] = {
{ "get_orientation", { (const void*) &lv_switch_get_orientation, "i", "(lv.obj)" } },
{ "set_orientation", { (const void*) &lv_switch_set_orientation, "", "(lv.obj)i" } },
};
#endif // BE_LV_WIDGET_SWITCH
/* `lv_table` methods */
#ifdef BE_LV_WIDGET_TABLE
const be_ntv_func_def_t lv_table_func[] = {
{ "add_cell_ctrl", { (const void*) &lv_table_add_cell_ctrl, "", "(lv.obj)iii" } },
{ "clear_cell_ctrl", { (const void*) &lv_table_clear_cell_ctrl, "", "(lv.obj)iii" } },
{ "get_cell_user_data", { (const void*) &lv_table_get_cell_user_data, "c", "(lv.obj)ii" } },
{ "get_cell_value", { (const void*) &lv_table_get_cell_value, "s", "(lv.obj)ii" } },
@ -1339,6 +1428,7 @@ const be_ntv_func_def_t lv_table_func[] = {
{ "get_row_count", { (const void*) &lv_table_get_row_count, "i", "(lv.obj)" } },
{ "get_selected_cell", { (const void*) &lv_table_get_selected_cell, "", "(lv.obj)(lv.int_arr)(lv.int_arr)" } },
{ "has_cell_ctrl", { (const void*) &lv_table_has_cell_ctrl, "b", "(lv.obj)iii" } },
{ "set_cell_ctrl", { (const void*) &lv_table_set_cell_ctrl, "", "(lv.obj)iii" } },
{ "set_cell_user_data", { (const void*) &lv_table_set_cell_user_data, "", "(lv.obj)ii." } },
{ "set_cell_value", { (const void*) &lv_table_set_cell_value, "", "(lv.obj)iis" } },
{ "set_cell_value_fmt", { (const void*) &lv_table_set_cell_value_fmt, "", "(lv.obj)iis[......]" } },
@ -1663,12 +1753,6 @@ const size_t lv_classes_size = sizeof(lv_classes) / sizeof(lv_classes[0]);
/* `lv_calendar` methods */
#ifdef BE_LV_WIDGET_CALENDAR
int be_ntv_lv_calendar_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_calendar_create, "+_p", "(lv.obj)"); }
#endif // BE_LV_WIDGET_CALENDAR
#ifdef BE_LV_WIDGET_CALENDAR
int be_ntv_lv_calendar_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_calendar_header_arrow_create, "+_p", "(lv.obj)"); }
#endif // BE_LV_WIDGET_CALENDAR
#ifdef BE_LV_WIDGET_CALENDAR
int be_ntv_lv_calendar_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_calendar_header_dropdown_create, "+_p", "(lv.obj)"); }
#endif // BE_LV_WIDGET_CALENDAR
/* `lv_canvas` methods */
#ifdef BE_LV_WIDGET_CANVAS

View File

@ -37,6 +37,7 @@ const be_ntv_func_def_t lv_func[] = {
{ "anim_get", { (const void*) &lv_anim_get, "lv.anim", ".c" } },
{ "anim_get_timer", { (const void*) &lv_anim_get_timer, "lv.timer", "" } },
{ "anim_refr_now", { (const void*) &lv_anim_refr_now, "", "" } },
{ "anim_resolve_speed", { (const void*) &lv_anim_resolve_speed, "i", "iii" } },
{ "anim_speed", { (const void*) &lv_anim_speed, "i", "i" } },
{ "anim_speed_clamped", { (const void*) &lv_anim_speed_clamped, "i", "iii" } },
{ "anim_speed_to_time", { (const void*) &lv_anim_speed_to_time, "i", "iii" } },
@ -72,7 +73,10 @@ const be_ntv_func_def_t lv_func[] = {
{ "color_make", { (const void*) &lv_color_make, "lv.color", "iii" } },
{ "color_mix", { (const void*) &lv_color_mix, "lv.color", "(lv.color)(lv.color)i" } },
{ "color_mix32", { (const void*) &lv_color_mix32, "i", "ii" } },
{ "color_mix32_premultiplied", { (const void*) &lv_color_mix32_premultiplied, "i", "ii" } },
{ "color_over32", { (const void*) &lv_color_over32, "i", "ii" } },
{ "color_rgb_to_hsv", { (const void*) &lv_color_rgb_to_hsv, "i", "iii" } },
{ "color_swap_16", { (const void*) &lv_color_swap_16, "i", "i" } },
{ "color_to_32", { (const void*) &lv_color_to_32, "i", "(lv.color)i" } },
{ "color_to_hsv", { (const void*) &lv_color_to_hsv, "i", "(lv.color)" } },
{ "color_to_int", { (const void*) &lv_color_to_int, "i", "(lv.color)" } },
@ -81,6 +85,7 @@ const be_ntv_func_def_t lv_func[] = {
{ "color_white", { (const void*) &lv_color_white, "lv.color", "" } },
{ "display_create", { (const void*) &lv_display_create, "lv.display", "ii" } },
{ "display_get_default", { (const void*) &lv_display_get_default, "lv.display", "" } },
{ "display_refr_timer", { (const void*) &lv_display_refr_timer, "", "(lv.timer)" } },
{ "dpx", { (const void*) &lv_dpx, "i", "i" } },
{ "draw_arc", { (const void*) &lv_draw_arc, "", "(lv.layer)(lv.draw_arc_dsc)" } },
{ "draw_arc_dsc_init", { (const void*) &lv_draw_arc_dsc_init, "", "(lv.draw_arc_dsc)" } },
@ -99,17 +104,24 @@ const be_ntv_func_def_t lv_func[] = {
{ "draw_layer_alloc_buf", { (const void*) &lv_draw_layer_alloc_buf, "c", "(lv.layer)" } },
{ "draw_layer_create", { (const void*) &lv_draw_layer_create, "lv.layer", "(lv.layer)i(lv.area)" } },
{ "draw_layer_go_to_xy", { (const void*) &lv_draw_layer_go_to_xy, "c", "(lv.layer)ii" } },
{ "draw_layer_init", { (const void*) &lv_draw_layer_init, "", "(lv.layer)(lv.layer)i(lv.area)" } },
{ "draw_letter", { (const void*) &lv_draw_letter, "", "(lv.layer)(lv.draw_letter_dsc)c" } },
{ "draw_letter_dsc_init", { (const void*) &lv_draw_letter_dsc_init, "", "(lv.draw_letter_dsc)" } },
{ "draw_line", { (const void*) &lv_draw_line, "", "(lv.layer)(lv.draw_line_dsc)" } },
{ "draw_line_dsc_init", { (const void*) &lv_draw_line_dsc_init, "", "(lv.draw_line_dsc)" } },
{ "draw_rect", { (const void*) &lv_draw_rect, "", "(lv.layer)(lv.draw_rect_dsc)(lv.area)" } },
{ "draw_rect_dsc_init", { (const void*) &lv_draw_rect_dsc_init, "", "(lv.draw_rect_dsc)" } },
{ "draw_wait_for_finish", { (const void*) &lv_draw_wait_for_finish, "", "" } },
{ "event_code_get_name", { (const void*) &lv_event_code_get_name, "s", "i" } },
{ "event_dsc_get_cb", { (const void*) &lv_event_dsc_get_cb, "lv.event_cb", "(lv.event_dsc)" } },
{ "event_dsc_get_user_data", { (const void*) &lv_event_dsc_get_user_data, "c", "(lv.event_dsc)" } },
{ "event_register_id", { (const void*) &lv_event_register_id, "i", "" } },
{ "flex_init", { (const void*) &lv_flex_init, "", "" } },
{ "font_get_default", { (const void*) &lv_font_get_default, "lv.font", "" } },
{ "font_get_glyph_width", { (const void*) &lv_font_get_glyph_width, "i", "(lv.font)ii" } },
{ "font_get_line_height", { (const void*) &lv_font_get_line_height, "i", "(lv.font)" } },
{ "font_has_static_bitmap", { (const void*) &lv_font_has_static_bitmap, "b", "(lv.font)" } },
{ "font_info_is_equal", { (const void*) &lv_font_info_is_equal, "b", "(lv.font_info)(lv.font_info)" } },
{ "font_set_kerning", { (const void*) &lv_font_set_kerning, "", "(lv.font)i" } },
{ "get_hor_res", { (const void*) &lv_get_hor_res, "i", "" } },
{ "get_ts_calibration", { (const void*) &lv_get_ts_calibration, "lv.ts_calibration", "" } },
@ -124,6 +136,8 @@ const be_ntv_func_def_t lv_func[] = {
{ "indev_get_active_obj", { (const void*) &lv_indev_get_active_obj, "lv.obj", "" } },
{ "indev_read_timer_cb", { (const void*) &lv_indev_read_timer_cb, "", "(lv.timer)" } },
{ "layer_bottom", { (const void*) &lv_layer_bottom, "lv.obj", "" } },
{ "layer_init", { (const void*) &lv_layer_init, "", "(lv.layer)" } },
{ "layer_reset", { (const void*) &lv_layer_reset, "", "(lv.layer)" } },
{ "layer_sys", { (const void*) &lv_layer_sys, "lv.obj", "" } },
{ "layer_top", { (const void*) &lv_layer_top, "lv.obj", "" } },
{ "obj_assign_id", { (const void*) &lv_obj_assign_id, "", "(lv.obj_class)(lv.obj)" } },
@ -167,6 +181,8 @@ const be_ntv_func_def_t lv_func[] = {
{ "task_handler", { (const void*) &lv_task_handler, "i", "" } },
{ "text_get_size", { (const void*) &lv_text_get_size, "", "cs(lv.font)iiii" } },
{ "text_get_width", { (const void*) &lv_text_get_width, "i", "si(lv.font)i" } },
{ "text_get_width_with_flags", { (const void*) &lv_text_get_width_with_flags, "i", "si(lv.font)ii" } },
{ "text_is_cmd", { (const void*) &lv_text_is_cmd, "b", "ci" } },
{ "theme_apply", { (const void*) &lv_theme_apply, "", "(lv.obj)" } },
{ "theme_get_color_primary", { (const void*) &lv_theme_get_color_primary, "lv.color", "(lv.obj)" } },
{ "theme_get_color_secondary", { (const void*) &lv_theme_get_color_secondary, "lv.color", "(lv.obj)" } },
@ -221,8 +237,6 @@ const be_const_member_t lv0_constants[] = {
{ "ALIGN_TOP_MID", be_cconst_int(LV_ALIGN_TOP_MID) },
{ "ALIGN_TOP_RIGHT", be_cconst_int(LV_ALIGN_TOP_RIGHT) },
{ "ANIM_IMAGE_PART_MAIN", be_cconst_int(LV_ANIM_IMAGE_PART_MAIN) },
{ "ANIM_OFF", be_cconst_int(LV_ANIM_OFF) },
{ "ANIM_ON", be_cconst_int(LV_ANIM_ON) },
{ "ANIM_PLAYTIME_INFINITE", be_cconst_int(LV_ANIM_PLAYTIME_INFINITE) },
{ "ANIM_REPEAT_INFINITE", be_cconst_int(LV_ANIM_REPEAT_INFINITE) },
{ "ARC_MODE_NORMAL", be_cconst_int(LV_ARC_MODE_NORMAL) },
@ -240,6 +254,7 @@ const be_const_member_t lv0_constants[] = {
{ "BASE_DIR_RTL", be_cconst_int(LV_BASE_DIR_RTL) },
{ "BASE_DIR_WEAK", be_cconst_int(LV_BASE_DIR_WEAK) },
{ "BLEND_MODE_ADDITIVE", be_cconst_int(LV_BLEND_MODE_ADDITIVE) },
{ "BLEND_MODE_DIFFERENCE", be_cconst_int(LV_BLEND_MODE_DIFFERENCE) },
{ "BLEND_MODE_MULTIPLY", be_cconst_int(LV_BLEND_MODE_MULTIPLY) },
{ "BLEND_MODE_NORMAL", be_cconst_int(LV_BLEND_MODE_NORMAL) },
{ "BLEND_MODE_SUBTRACTIVE", be_cconst_int(LV_BLEND_MODE_SUBTRACTIVE) },
@ -268,11 +283,27 @@ const be_const_member_t lv0_constants[] = {
{ "BUTTONMATRIX_CTRL_CUSTOM_2", be_cconst_int(LV_BUTTONMATRIX_CTRL_CUSTOM_2) },
{ "BUTTONMATRIX_CTRL_DISABLED", be_cconst_int(LV_BUTTONMATRIX_CTRL_DISABLED) },
{ "BUTTONMATRIX_CTRL_HIDDEN", be_cconst_int(LV_BUTTONMATRIX_CTRL_HIDDEN) },
{ "BUTTONMATRIX_CTRL_NONE", be_cconst_int(LV_BUTTONMATRIX_CTRL_NONE) },
{ "BUTTONMATRIX_CTRL_NO_REPEAT", be_cconst_int(LV_BUTTONMATRIX_CTRL_NO_REPEAT) },
{ "BUTTONMATRIX_CTRL_POPOVER", be_cconst_int(LV_BUTTONMATRIX_CTRL_POPOVER) },
{ "BUTTONMATRIX_CTRL_RECOLOR", be_cconst_int(LV_BUTTONMATRIX_CTRL_RECOLOR) },
{ "BUTTONMATRIX_CTRL_RESERVED_1", be_cconst_int(LV_BUTTONMATRIX_CTRL_RESERVED_1) },
{ "BUTTONMATRIX_CTRL_RESERVED_2", be_cconst_int(LV_BUTTONMATRIX_CTRL_RESERVED_2) },
{ "BUTTONMATRIX_CTRL_RESERVED_3", be_cconst_int(LV_BUTTONMATRIX_CTRL_RESERVED_3) },
{ "BUTTONMATRIX_CTRL_WIDTH_1", be_cconst_int(LV_BUTTONMATRIX_CTRL_WIDTH_1) },
{ "BUTTONMATRIX_CTRL_WIDTH_10", be_cconst_int(LV_BUTTONMATRIX_CTRL_WIDTH_10) },
{ "BUTTONMATRIX_CTRL_WIDTH_11", be_cconst_int(LV_BUTTONMATRIX_CTRL_WIDTH_11) },
{ "BUTTONMATRIX_CTRL_WIDTH_12", be_cconst_int(LV_BUTTONMATRIX_CTRL_WIDTH_12) },
{ "BUTTONMATRIX_CTRL_WIDTH_13", be_cconst_int(LV_BUTTONMATRIX_CTRL_WIDTH_13) },
{ "BUTTONMATRIX_CTRL_WIDTH_14", be_cconst_int(LV_BUTTONMATRIX_CTRL_WIDTH_14) },
{ "BUTTONMATRIX_CTRL_WIDTH_15", be_cconst_int(LV_BUTTONMATRIX_CTRL_WIDTH_15) },
{ "BUTTONMATRIX_CTRL_WIDTH_2", be_cconst_int(LV_BUTTONMATRIX_CTRL_WIDTH_2) },
{ "BUTTONMATRIX_CTRL_WIDTH_3", be_cconst_int(LV_BUTTONMATRIX_CTRL_WIDTH_3) },
{ "BUTTONMATRIX_CTRL_WIDTH_4", be_cconst_int(LV_BUTTONMATRIX_CTRL_WIDTH_4) },
{ "BUTTONMATRIX_CTRL_WIDTH_5", be_cconst_int(LV_BUTTONMATRIX_CTRL_WIDTH_5) },
{ "BUTTONMATRIX_CTRL_WIDTH_6", be_cconst_int(LV_BUTTONMATRIX_CTRL_WIDTH_6) },
{ "BUTTONMATRIX_CTRL_WIDTH_7", be_cconst_int(LV_BUTTONMATRIX_CTRL_WIDTH_7) },
{ "BUTTONMATRIX_CTRL_WIDTH_8", be_cconst_int(LV_BUTTONMATRIX_CTRL_WIDTH_8) },
{ "BUTTONMATRIX_CTRL_WIDTH_9", be_cconst_int(LV_BUTTONMATRIX_CTRL_WIDTH_9) },
{ "CHART_AXIS_LAST", be_cconst_int(LV_CHART_AXIS_LAST) },
{ "CHART_AXIS_PRIMARY_X", be_cconst_int(LV_CHART_AXIS_PRIMARY_X) },
{ "CHART_AXIS_PRIMARY_Y", be_cconst_int(LV_CHART_AXIS_PRIMARY_Y) },
@ -301,8 +332,12 @@ const be_const_member_t lv0_constants[] = {
{ "COLOR_FORMAT_A4", be_cconst_int(LV_COLOR_FORMAT_A4) },
{ "COLOR_FORMAT_A8", be_cconst_int(LV_COLOR_FORMAT_A8) },
{ "COLOR_FORMAT_AL88", be_cconst_int(LV_COLOR_FORMAT_AL88) },
{ "COLOR_FORMAT_ARGB1555", be_cconst_int(LV_COLOR_FORMAT_ARGB1555) },
{ "COLOR_FORMAT_ARGB2222", be_cconst_int(LV_COLOR_FORMAT_ARGB2222) },
{ "COLOR_FORMAT_ARGB4444", be_cconst_int(LV_COLOR_FORMAT_ARGB4444) },
{ "COLOR_FORMAT_ARGB8565", be_cconst_int(LV_COLOR_FORMAT_ARGB8565) },
{ "COLOR_FORMAT_ARGB8888", be_cconst_int(LV_COLOR_FORMAT_ARGB8888) },
{ "COLOR_FORMAT_ARGB8888_PREMULTIPLIED", be_cconst_int(LV_COLOR_FORMAT_ARGB8888_PREMULTIPLIED) },
{ "COLOR_FORMAT_I1", be_cconst_int(LV_COLOR_FORMAT_I1) },
{ "COLOR_FORMAT_I2", be_cconst_int(LV_COLOR_FORMAT_I2) },
{ "COLOR_FORMAT_I4", be_cconst_int(LV_COLOR_FORMAT_I4) },
@ -314,12 +349,22 @@ const be_const_member_t lv0_constants[] = {
{ "COLOR_FORMAT_L8", be_cconst_int(LV_COLOR_FORMAT_L8) },
{ "COLOR_FORMAT_NATIVE", be_cconst_int(LV_COLOR_FORMAT_NATIVE) },
{ "COLOR_FORMAT_NATIVE_WITH_ALPHA", be_cconst_int(LV_COLOR_FORMAT_NATIVE_WITH_ALPHA) },
{ "COLOR_FORMAT_NEMA_TSC12", be_cconst_int(LV_COLOR_FORMAT_NEMA_TSC12) },
{ "COLOR_FORMAT_NEMA_TSC12A", be_cconst_int(LV_COLOR_FORMAT_NEMA_TSC12A) },
{ "COLOR_FORMAT_NEMA_TSC4", be_cconst_int(LV_COLOR_FORMAT_NEMA_TSC4) },
{ "COLOR_FORMAT_NEMA_TSC6", be_cconst_int(LV_COLOR_FORMAT_NEMA_TSC6) },
{ "COLOR_FORMAT_NEMA_TSC6A", be_cconst_int(LV_COLOR_FORMAT_NEMA_TSC6A) },
{ "COLOR_FORMAT_NEMA_TSC6AP", be_cconst_int(LV_COLOR_FORMAT_NEMA_TSC6AP) },
{ "COLOR_FORMAT_NEMA_TSC_END", be_cconst_int(LV_COLOR_FORMAT_NEMA_TSC_END) },
{ "COLOR_FORMAT_NEMA_TSC_START", be_cconst_int(LV_COLOR_FORMAT_NEMA_TSC_START) },
{ "COLOR_FORMAT_NV12", be_cconst_int(LV_COLOR_FORMAT_NV12) },
{ "COLOR_FORMAT_NV21", be_cconst_int(LV_COLOR_FORMAT_NV21) },
{ "COLOR_FORMAT_PROPRIETARY_START", be_cconst_int(LV_COLOR_FORMAT_PROPRIETARY_START) },
{ "COLOR_FORMAT_RAW", be_cconst_int(LV_COLOR_FORMAT_RAW) },
{ "COLOR_FORMAT_RAW_ALPHA", be_cconst_int(LV_COLOR_FORMAT_RAW_ALPHA) },
{ "COLOR_FORMAT_RGB565", be_cconst_int(LV_COLOR_FORMAT_RGB565) },
{ "COLOR_FORMAT_RGB565A8", be_cconst_int(LV_COLOR_FORMAT_RGB565A8) },
{ "COLOR_FORMAT_RGB565_SWAPPED", be_cconst_int(LV_COLOR_FORMAT_RGB565_SWAPPED) },
{ "COLOR_FORMAT_RGB888", be_cconst_int(LV_COLOR_FORMAT_RGB888) },
{ "COLOR_FORMAT_UNKNOWN", be_cconst_int(LV_COLOR_FORMAT_UNKNOWN) },
{ "COLOR_FORMAT_UYVY", be_cconst_int(LV_COLOR_FORMAT_UYVY) },
@ -397,12 +442,12 @@ const be_const_member_t lv0_constants[] = {
{ "DRAW_TASK_TYPE_IMAGE", be_cconst_int(LV_DRAW_TASK_TYPE_IMAGE) },
{ "DRAW_TASK_TYPE_LABEL", be_cconst_int(LV_DRAW_TASK_TYPE_LABEL) },
{ "DRAW_TASK_TYPE_LAYER", be_cconst_int(LV_DRAW_TASK_TYPE_LAYER) },
{ "DRAW_TASK_TYPE_LETTER", be_cconst_int(LV_DRAW_TASK_TYPE_LETTER) },
{ "DRAW_TASK_TYPE_LINE", be_cconst_int(LV_DRAW_TASK_TYPE_LINE) },
{ "DRAW_TASK_TYPE_MASK_BITMAP", be_cconst_int(LV_DRAW_TASK_TYPE_MASK_BITMAP) },
{ "DRAW_TASK_TYPE_MASK_RECTANGLE", be_cconst_int(LV_DRAW_TASK_TYPE_MASK_RECTANGLE) },
{ "DRAW_TASK_TYPE_NONE", be_cconst_int(LV_DRAW_TASK_TYPE_NONE) },
{ "DRAW_TASK_TYPE_TRIANGLE", be_cconst_int(LV_DRAW_TASK_TYPE_TRIANGLE) },
{ "DRAW_TASK_TYPE_VECTOR", be_cconst_int(LV_DRAW_TASK_TYPE_VECTOR) },
{ "DROPDOWN_POS_LAST", be_cconst_int(LV_DROPDOWN_POS_LAST) },
{ "EVENT_ALL", be_cconst_int(LV_EVENT_ALL) },
{ "EVENT_CANCEL", be_cconst_int(LV_EVENT_CANCEL) },
@ -415,6 +460,7 @@ const be_const_member_t lv0_constants[] = {
{ "EVENT_CREATE", be_cconst_int(LV_EVENT_CREATE) },
{ "EVENT_DEFOCUSED", be_cconst_int(LV_EVENT_DEFOCUSED) },
{ "EVENT_DELETE", be_cconst_int(LV_EVENT_DELETE) },
{ "EVENT_DOUBLE_CLICKED", be_cconst_int(LV_EVENT_DOUBLE_CLICKED) },
{ "EVENT_DRAW_MAIN", be_cconst_int(LV_EVENT_DRAW_MAIN) },
{ "EVENT_DRAW_MAIN_BEGIN", be_cconst_int(LV_EVENT_DRAW_MAIN_BEGIN) },
{ "EVENT_DRAW_MAIN_END", be_cconst_int(LV_EVENT_DRAW_MAIN_END) },
@ -441,6 +487,7 @@ const be_const_member_t lv0_constants[] = {
{ "EVENT_LEAVE", be_cconst_int(LV_EVENT_LEAVE) },
{ "EVENT_LONG_PRESSED", be_cconst_int(LV_EVENT_LONG_PRESSED) },
{ "EVENT_LONG_PRESSED_REPEAT", be_cconst_int(LV_EVENT_LONG_PRESSED_REPEAT) },
{ "EVENT_MARKED_DELETING", be_cconst_int(LV_EVENT_MARKED_DELETING) },
{ "EVENT_PREPROCESS", be_cconst_int(LV_EVENT_PREPROCESS) },
{ "EVENT_PRESSED", be_cconst_int(LV_EVENT_PRESSED) },
{ "EVENT_PRESSING", be_cconst_int(LV_EVENT_PRESSING) },
@ -465,10 +512,13 @@ const be_const_member_t lv0_constants[] = {
{ "EVENT_SCROLL_END", be_cconst_int(LV_EVENT_SCROLL_END) },
{ "EVENT_SCROLL_THROW_BEGIN", be_cconst_int(LV_EVENT_SCROLL_THROW_BEGIN) },
{ "EVENT_SHORT_CLICKED", be_cconst_int(LV_EVENT_SHORT_CLICKED) },
{ "EVENT_SINGLE_CLICKED", be_cconst_int(LV_EVENT_SINGLE_CLICKED) },
{ "EVENT_SIZE_CHANGED", be_cconst_int(LV_EVENT_SIZE_CHANGED) },
{ "EVENT_STYLE_CHANGED", be_cconst_int(LV_EVENT_STYLE_CHANGED) },
{ "EVENT_TRIPLE_CLICKED", be_cconst_int(LV_EVENT_TRIPLE_CLICKED) },
{ "EVENT_VALUE_CHANGED", be_cconst_int(LV_EVENT_VALUE_CHANGED) },
{ "EVENT_VSYNC", be_cconst_int(LV_EVENT_VSYNC) },
{ "EVENT_VSYNC_REQUEST", be_cconst_int(LV_EVENT_VSYNC_REQUEST) },
{ "FLEX_ALIGN_CENTER", be_cconst_int(LV_FLEX_ALIGN_CENTER) },
{ "FLEX_ALIGN_END", be_cconst_int(LV_FLEX_ALIGN_END) },
{ "FLEX_ALIGN_SPACE_AROUND", be_cconst_int(LV_FLEX_ALIGN_SPACE_AROUND) },
@ -537,6 +587,8 @@ const be_const_member_t lv0_constants[] = {
{ "IMAGE_ALIGN_BOTTOM_MID", be_cconst_int(LV_IMAGE_ALIGN_BOTTOM_MID) },
{ "IMAGE_ALIGN_BOTTOM_RIGHT", be_cconst_int(LV_IMAGE_ALIGN_BOTTOM_RIGHT) },
{ "IMAGE_ALIGN_CENTER", be_cconst_int(LV_IMAGE_ALIGN_CENTER) },
{ "IMAGE_ALIGN_CONTAIN", be_cconst_int(LV_IMAGE_ALIGN_CONTAIN) },
{ "IMAGE_ALIGN_COVER", be_cconst_int(LV_IMAGE_ALIGN_COVER) },
{ "IMAGE_ALIGN_DEFAULT", be_cconst_int(LV_IMAGE_ALIGN_DEFAULT) },
{ "IMAGE_ALIGN_LEFT_MID", be_cconst_int(LV_IMAGE_ALIGN_LEFT_MID) },
{ "IMAGE_ALIGN_RIGHT_MID", be_cconst_int(LV_IMAGE_ALIGN_RIGHT_MID) },
@ -550,6 +602,7 @@ const be_const_member_t lv0_constants[] = {
{ "IMAGE_COMPRESS_RLE", be_cconst_int(LV_IMAGE_COMPRESS_RLE) },
{ "IMAGE_FLAGS_ALLOCATED", be_cconst_int(LV_IMAGE_FLAGS_ALLOCATED) },
{ "IMAGE_FLAGS_COMPRESSED", be_cconst_int(LV_IMAGE_FLAGS_COMPRESSED) },
{ "IMAGE_FLAGS_CUSTOM_DRAW", be_cconst_int(LV_IMAGE_FLAGS_CUSTOM_DRAW) },
{ "IMAGE_FLAGS_MODIFIABLE", be_cconst_int(LV_IMAGE_FLAGS_MODIFIABLE) },
{ "IMAGE_FLAGS_PREMULTIPLIED", be_cconst_int(LV_IMAGE_FLAGS_PREMULTIPLIED) },
{ "IMAGE_FLAGS_USER1", be_cconst_int(LV_IMAGE_FLAGS_USER1) },
@ -588,11 +641,16 @@ const be_const_member_t lv0_constants[] = {
{ "KEY_RIGHT", be_cconst_int(LV_KEY_RIGHT) },
{ "KEY_UP", be_cconst_int(LV_KEY_UP) },
{ "LABEL_DOT_NUM", be_cconst_int(LV_LABEL_DOT_NUM) },
{ "LABEL_LONG_CLIP", be_cconst_int(LV_LABEL_LONG_CLIP) },
{ "LABEL_LONG_DOT", be_cconst_int(LV_LABEL_LONG_DOT) },
{ "LABEL_LONG_SCROLL", be_cconst_int(LV_LABEL_LONG_SCROLL) },
{ "LABEL_LONG_SCROLL_CIRCULAR", be_cconst_int(LV_LABEL_LONG_SCROLL_CIRCULAR) },
{ "LABEL_LONG_WRAP", be_cconst_int(LV_LABEL_LONG_WRAP) },
{ "LABEL_LONG_CLIP", be_cconst_int(LV_LABEL_LONG_MODE_CLIP) },
{ "LABEL_LONG_DOT", be_cconst_int(LV_LABEL_LONG_MODE_DOTS) },
{ "LABEL_LONG_MODE_CLIP", be_cconst_int(LV_LABEL_LONG_MODE_CLIP) },
{ "LABEL_LONG_MODE_DOTS", be_cconst_int(LV_LABEL_LONG_MODE_DOTS) },
{ "LABEL_LONG_MODE_SCROLL", be_cconst_int(LV_LABEL_LONG_MODE_SCROLL) },
{ "LABEL_LONG_MODE_SCROLL_CIRCULAR", be_cconst_int(LV_LABEL_LONG_MODE_SCROLL_CIRCULAR) },
{ "LABEL_LONG_MODE_WRAP", be_cconst_int(LV_LABEL_LONG_MODE_WRAP) },
{ "LABEL_LONG_SCROLL", be_cconst_int(LV_LABEL_LONG_MODE_SCROLL) },
{ "LABEL_LONG_SCROLL_CIRCULAR", be_cconst_int(LV_LABEL_LONG_MODE_SCROLL_CIRCULAR) },
{ "LABEL_LONG_WRAP", be_cconst_int(LV_LABEL_LONG_MODE_WRAP) },
{ "LABEL_POS_LAST", be_cconst_int(LV_LABEL_POS_LAST) },
{ "LABEL_TEXT_SELECTION_OFF", be_cconst_int(LV_LABEL_TEXT_SELECTION_OFF) },
{ "LAYER_TYPE_NONE", be_cconst_int(LV_LAYER_TYPE_NONE) },
@ -713,6 +771,8 @@ const be_const_member_t lv0_constants[] = {
{ "ROLLER_MODE_INFINITE", be_cconst_int(LV_ROLLER_MODE_INFINITE) },
{ "ROLLER_MODE_NORMAL", be_cconst_int(LV_ROLLER_MODE_NORMAL) },
{ "SCALE_LABEL_ENABLED_DEFAULT", be_cconst_int(LV_SCALE_LABEL_ENABLED_DEFAULT) },
{ "SCALE_LABEL_ROTATE_KEEP_UPRIGHT", be_cconst_int(LV_SCALE_LABEL_ROTATE_KEEP_UPRIGHT) },
{ "SCALE_LABEL_ROTATE_MATCH_TICKS", be_cconst_int(LV_SCALE_LABEL_ROTATE_MATCH_TICKS) },
{ "SCALE_MAJOR_TICK_EVERY_DEFAULT", be_cconst_int(LV_SCALE_MAJOR_TICK_EVERY_DEFAULT) },
{ "SCALE_MODE_HORIZONTAL_BOTTOM", be_cconst_int(LV_SCALE_MODE_HORIZONTAL_BOTTOM) },
{ "SCALE_MODE_HORIZONTAL_TOP", be_cconst_int(LV_SCALE_MODE_HORIZONTAL_TOP) },
@ -722,6 +782,7 @@ const be_const_member_t lv0_constants[] = {
{ "SCALE_MODE_VERTICAL_LEFT", be_cconst_int(LV_SCALE_MODE_VERTICAL_LEFT) },
{ "SCALE_MODE_VERTICAL_RIGHT", be_cconst_int(LV_SCALE_MODE_VERTICAL_RIGHT) },
{ "SCALE_NONE", be_cconst_int(LV_SCALE_NONE) },
{ "SCALE_ROTATION_ANGLE_MASK", be_cconst_int(LV_SCALE_ROTATION_ANGLE_MASK) },
{ "SCALE_TOTAL_TICK_COUNT_DEFAULT", be_cconst_int(LV_SCALE_TOTAL_TICK_COUNT_DEFAULT) },
{ "SCROLLBAR_MODE_ACTIVE", be_cconst_int(LV_SCROLLBAR_MODE_ACTIVE) },
{ "SCROLLBAR_MODE_AUTO", be_cconst_int(LV_SCROLLBAR_MODE_AUTO) },
@ -751,6 +812,9 @@ const be_const_member_t lv0_constants[] = {
{ "SLIDER_MODE_NORMAL", be_cconst_int(LV_SLIDER_MODE_NORMAL) },
{ "SLIDER_MODE_RANGE", be_cconst_int(LV_SLIDER_MODE_RANGE) },
{ "SLIDER_MODE_SYMMETRICAL", be_cconst_int(LV_SLIDER_MODE_SYMMETRICAL) },
{ "SLIDER_ORIENTATION_AUTO", be_cconst_int(LV_SLIDER_ORIENTATION_AUTO) },
{ "SLIDER_ORIENTATION_HORIZONTAL", be_cconst_int(LV_SLIDER_ORIENTATION_HORIZONTAL) },
{ "SLIDER_ORIENTATION_VERTICAL", be_cconst_int(LV_SLIDER_ORIENTATION_VERTICAL) },
{ "SPAN_MODE_BREAK", be_cconst_int(LV_SPAN_MODE_BREAK) },
{ "SPAN_MODE_EXPAND", be_cconst_int(LV_SPAN_MODE_EXPAND) },
{ "SPAN_MODE_FIXED", be_cconst_int(LV_SPAN_MODE_FIXED) },
@ -856,13 +920,17 @@ const be_const_member_t lv0_constants[] = {
{ "STYLE_PAD_BOTTOM", be_cconst_int(LV_STYLE_PAD_BOTTOM) },
{ "STYLE_PAD_COLUMN", be_cconst_int(LV_STYLE_PAD_COLUMN) },
{ "STYLE_PAD_LEFT", be_cconst_int(LV_STYLE_PAD_LEFT) },
{ "STYLE_PAD_RADIAL", be_cconst_int(LV_STYLE_PAD_RADIAL) },
{ "STYLE_PAD_RIGHT", be_cconst_int(LV_STYLE_PAD_RIGHT) },
{ "STYLE_PAD_ROW", be_cconst_int(LV_STYLE_PAD_ROW) },
{ "STYLE_PAD_TOP", be_cconst_int(LV_STYLE_PAD_TOP) },
{ "STYLE_PROP_ANY", be_cconst_int(LV_STYLE_PROP_ANY) },
{ "STYLE_PROP_CONST", be_cconst_int(LV_STYLE_PROP_CONST) },
{ "STYLE_PROP_INV", be_cconst_int(LV_STYLE_PROP_INV) },
{ "STYLE_RADIAL_OFFSET", be_cconst_int(LV_STYLE_RADIAL_OFFSET) },
{ "STYLE_RADIUS", be_cconst_int(LV_STYLE_RADIUS) },
{ "STYLE_RECOLOR", be_cconst_int(LV_STYLE_RECOLOR) },
{ "STYLE_RECOLOR_OPA", be_cconst_int(LV_STYLE_RECOLOR_OPA) },
{ "STYLE_RES_FOUND", be_cconst_int(LV_STYLE_RES_FOUND) },
{ "STYLE_RES_NOT_FOUND", be_cconst_int(LV_STYLE_RES_NOT_FOUND) },
{ "STYLE_ROTARY_SENSITIVITY", be_cconst_int(LV_STYLE_ROTARY_SENSITIVITY) },
@ -885,6 +953,9 @@ const be_const_member_t lv0_constants[] = {
{ "STYLE_TEXT_LETTER_SPACE", be_cconst_int(LV_STYLE_TEXT_LETTER_SPACE) },
{ "STYLE_TEXT_LINE_SPACE", be_cconst_int(LV_STYLE_TEXT_LINE_SPACE) },
{ "STYLE_TEXT_OPA", be_cconst_int(LV_STYLE_TEXT_OPA) },
{ "STYLE_TEXT_OUTLINE_STROKE_COLOR", be_cconst_int(LV_STYLE_TEXT_OUTLINE_STROKE_COLOR) },
{ "STYLE_TEXT_OUTLINE_STROKE_OPA", be_cconst_int(LV_STYLE_TEXT_OUTLINE_STROKE_OPA) },
{ "STYLE_TEXT_OUTLINE_STROKE_WIDTH", be_cconst_int(LV_STYLE_TEXT_OUTLINE_STROKE_WIDTH) },
{ "STYLE_TRANSFORM_ANGLE", be_cconst_int(LV_STYLE_TRANSFORM_ROTATION) },
{ "STYLE_TRANSFORM_HEIGHT", be_cconst_int(LV_STYLE_TRANSFORM_HEIGHT) },
{ "STYLE_TRANSFORM_PIVOT_X", be_cconst_int(LV_STYLE_TRANSFORM_PIVOT_X) },
@ -896,11 +967,15 @@ const be_const_member_t lv0_constants[] = {
{ "STYLE_TRANSFORM_SKEW_Y", be_cconst_int(LV_STYLE_TRANSFORM_SKEW_Y) },
{ "STYLE_TRANSFORM_WIDTH", be_cconst_int(LV_STYLE_TRANSFORM_WIDTH) },
{ "STYLE_TRANSITION", be_cconst_int(LV_STYLE_TRANSITION) },
{ "STYLE_TRANSLATE_RADIAL", be_cconst_int(LV_STYLE_TRANSLATE_RADIAL) },
{ "STYLE_TRANSLATE_X", be_cconst_int(LV_STYLE_TRANSLATE_X) },
{ "STYLE_TRANSLATE_Y", be_cconst_int(LV_STYLE_TRANSLATE_Y) },
{ "STYLE_WIDTH", be_cconst_int(LV_STYLE_WIDTH) },
{ "STYLE_X", be_cconst_int(LV_STYLE_X) },
{ "STYLE_Y", be_cconst_int(LV_STYLE_Y) },
{ "SWITCH_ORIENTATION_AUTO", be_cconst_int(LV_SWITCH_ORIENTATION_AUTO) },
{ "SWITCH_ORIENTATION_HORIZONTAL", be_cconst_int(LV_SWITCH_ORIENTATION_HORIZONTAL) },
{ "SWITCH_ORIENTATION_VERTICAL", be_cconst_int(LV_SWITCH_ORIENTATION_VERTICAL) },
{ "$SYMBOL_AUDIO", be_cconst_string("\xef\x80\x81") },
{ "$SYMBOL_BACKSPACE", be_cconst_string("\xef\x95\x9A") },
{ "$SYMBOL_BATTERY_1", be_cconst_string("\xef\x89\x83") },
@ -965,6 +1040,7 @@ const be_const_member_t lv0_constants[] = {
{ "TABLE_CELL_CTRL_CUSTOM_3", be_cconst_int(LV_TABLE_CELL_CTRL_CUSTOM_3) },
{ "TABLE_CELL_CTRL_CUSTOM_4", be_cconst_int(LV_TABLE_CELL_CTRL_CUSTOM_4) },
{ "TABLE_CELL_CTRL_MERGE_RIGHT", be_cconst_int(LV_TABLE_CELL_CTRL_MERGE_RIGHT) },
{ "TABLE_CELL_CTRL_NONE", be_cconst_int(LV_TABLE_CELL_CTRL_NONE) },
{ "TABLE_CELL_CTRL_TEXT_CROP", be_cconst_int(LV_TABLE_CELL_CTRL_TEXT_CROP) },
{ "TABLE_CELL_NONE", be_cconst_int(LV_TABLE_CELL_NONE) },
{ "TEXTAREA_CURSOR_LAST", be_cconst_int(LV_TEXTAREA_CURSOR_LAST) },
@ -972,6 +1048,9 @@ const be_const_member_t lv0_constants[] = {
{ "TEXT_ALIGN_CENTER", be_cconst_int(LV_TEXT_ALIGN_CENTER) },
{ "TEXT_ALIGN_LEFT", be_cconst_int(LV_TEXT_ALIGN_LEFT) },
{ "TEXT_ALIGN_RIGHT", be_cconst_int(LV_TEXT_ALIGN_RIGHT) },
{ "TEXT_CMD_STATE_IN", be_cconst_int(LV_TEXT_CMD_STATE_IN) },
{ "TEXT_CMD_STATE_PAR", be_cconst_int(LV_TEXT_CMD_STATE_PAR) },
{ "TEXT_CMD_STATE_WAIT", be_cconst_int(LV_TEXT_CMD_STATE_WAIT) },
{ "TEXT_DECOR_NONE", be_cconst_int(LV_TEXT_DECOR_NONE) },
{ "TEXT_DECOR_STRIKETHROUGH", be_cconst_int(LV_TEXT_DECOR_STRIKETHROUGH) },
{ "TEXT_DECOR_UNDERLINE", be_cconst_int(LV_TEXT_DECOR_UNDERLINE) },
@ -979,6 +1058,9 @@ const be_const_member_t lv0_constants[] = {
{ "TEXT_FLAG_EXPAND", be_cconst_int(LV_TEXT_FLAG_EXPAND) },
{ "TEXT_FLAG_FIT", be_cconst_int(LV_TEXT_FLAG_FIT) },
{ "TEXT_FLAG_NONE", be_cconst_int(LV_TEXT_FLAG_NONE) },
{ "TEXT_FLAG_RECOLOR", be_cconst_int(LV_TEXT_FLAG_RECOLOR) },
{ "TREE_WALK_POST_ORDER", be_cconst_int(LV_TREE_WALK_POST_ORDER) },
{ "TREE_WALK_PRE_ORDER", be_cconst_int(LV_TREE_WALK_PRE_ORDER) },
{ "ZOOM_NONE", be_cconst_int(LV_SCALE_NONE) },
{ "&anim_path_bounce", be_cconst_ptr(&lv_anim_path_bounce) },
{ "&anim_path_ease_in", be_cconst_ptr(&lv_anim_path_ease_in) },

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,6 @@ lv_coord_t lv_get_ver_res(void);
// Generated from headers
// ======================================================================
// ../../lvgl/src/../lvgl.h
static inline int lv_version_major(void)
static inline int lv_version_minor(void)
@ -60,7 +59,7 @@ lv_group_t * lv_group_by_index(uint32_t index)
lv_obj_t * lv_obj_create(lv_obj_t * parent)
void lv_obj_add_flag(lv_obj_t * obj, lv_obj_flag_t f)
void lv_obj_remove_flag(lv_obj_t * obj, lv_obj_flag_t f)
void lv_obj_update_flag(lv_obj_t * obj, lv_obj_flag_t f, bool v)
void lv_obj_set_flag(lv_obj_t * obj, lv_obj_flag_t f, bool v)
void lv_obj_add_state(lv_obj_t * obj, lv_state_t state)
void lv_obj_remove_state(lv_obj_t * obj, lv_state_t state)
void lv_obj_set_state(lv_obj_t * obj, lv_state_t state, bool v)
@ -79,7 +78,7 @@ bool lv_obj_is_valid(const lv_obj_t * obj)
void lv_obj_null_on_delete(lv_obj_t ** obj_ptr)
void lv_obj_set_id(lv_obj_t * obj, void * id)
void * lv_obj_get_id(const lv_obj_t * obj)
lv_obj_t * lv_obj_get_child_by_id(const lv_obj_t * obj, const void * id)
lv_obj_t * lv_obj_find_by_id(const lv_obj_t * obj, const void * id)
void lv_obj_assign_id(const lv_obj_class_t * class_p, lv_obj_t * obj)
void lv_obj_free_id(lv_obj_t * obj)
int lv_obj_id_compare(const void * id1, const void * id2)
@ -110,8 +109,8 @@ lv_event_dsc_t * lv_obj_add_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb, lv_
uint32_t lv_obj_get_event_count(lv_obj_t * obj)
lv_event_dsc_t * lv_obj_get_event_dsc(lv_obj_t * obj, uint32_t index)
bool lv_obj_remove_event(lv_obj_t * obj, uint32_t index)
bool lv_obj_remove_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb)
bool lv_obj_remove_event_dsc(lv_obj_t * obj, lv_event_dsc_t * dsc)
uint32_t lv_obj_remove_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb)
uint32_t lv_obj_remove_event_cb_with_user_data(lv_obj_t * obj, lv_event_cb_t event_cb, void * user_data)
lv_indev_t * lv_event_get_indev(lv_event_t * e)
lv_layer_t * lv_event_get_layer(lv_event_t * e)
@ -144,6 +143,8 @@ void lv_obj_set_align(lv_obj_t * obj, lv_align_t align)
void lv_obj_align(lv_obj_t * obj, lv_align_t align, int32_t x_ofs, int32_t y_ofs)
void lv_obj_align_to(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, int32_t x_ofs, int32_t y_ofs)
void lv_obj_center(lv_obj_t * obj)
void lv_obj_set_transform(lv_obj_t * obj, const lv_matrix_t * matrix)
void lv_obj_reset_transform(lv_obj_t * obj)
void lv_obj_get_coords(const lv_obj_t * obj, lv_area_t * coords)
int32_t lv_obj_get_x(const lv_obj_t * obj)
int32_t lv_obj_get_x2(const lv_obj_t * obj)
@ -162,6 +163,7 @@ bool lv_obj_refresh_self_size(lv_obj_t * obj)
void lv_obj_refr_pos(lv_obj_t * obj)
void lv_obj_move_to(lv_obj_t * obj, int32_t x, int32_t y)
void lv_obj_move_children_by(lv_obj_t * obj, int32_t x_diff, int32_t y_diff, bool ignore_floating)
const lv_matrix_t * lv_obj_get_transform(const lv_obj_t * obj)
void lv_obj_transform_point(const lv_obj_t * obj, lv_point_t * p, lv_obj_point_transform_flag_t flags)
void lv_obj_transform_point_array(const lv_obj_t * obj, lv_point_t points[], size_t count, lv_obj_point_transform_flag_t flags)
void lv_obj_get_transformed_area(const lv_obj_t * obj, lv_area_t * area, lv_obj_point_transform_flag_t flags)
@ -186,12 +188,12 @@ lv_scroll_snap_t lv_obj_get_scroll_snap_x(const lv_obj_t * obj)
lv_scroll_snap_t lv_obj_get_scroll_snap_y(const lv_obj_t * obj)
int32_t lv_obj_get_scroll_x(const lv_obj_t * obj)
int32_t lv_obj_get_scroll_y(const lv_obj_t * obj)
int32_t lv_obj_get_scroll_top(lv_obj_t * obj)
int32_t lv_obj_get_scroll_bottom(lv_obj_t * obj)
int32_t lv_obj_get_scroll_left(lv_obj_t * obj)
int32_t lv_obj_get_scroll_right(lv_obj_t * obj)
int32_t lv_obj_get_scroll_top(const lv_obj_t * obj)
int32_t lv_obj_get_scroll_bottom(const lv_obj_t * obj)
int32_t lv_obj_get_scroll_left(const lv_obj_t * obj)
int32_t lv_obj_get_scroll_right(const lv_obj_t * obj)
void lv_obj_get_scroll_end(lv_obj_t * obj, lv_point_t * end)
void lv_obj_scroll_by(lv_obj_t * obj, int32_t x, int32_t y, lv_anim_enable_t anim_en)
void lv_obj_scroll_by(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_enable_t anim_en)
void lv_obj_scroll_by_bounded(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_enable_t anim_en)
void lv_obj_scroll_to(lv_obj_t * obj, int32_t x, int32_t y, lv_anim_enable_t anim_en)
void lv_obj_scroll_to_x(lv_obj_t * obj, int32_t x, lv_anim_enable_t anim_en)
@ -199,6 +201,7 @@ void lv_obj_scroll_to_y(lv_obj_t * obj, int32_t y, lv_anim_enable_t anim_en)
void lv_obj_scroll_to_view(lv_obj_t * obj, lv_anim_enable_t anim_en)
void lv_obj_scroll_to_view_recursive(lv_obj_t * obj, lv_anim_enable_t anim_en)
bool lv_obj_is_scrolling(const lv_obj_t * obj)
void lv_obj_stop_scroll_anim(const lv_obj_t * obj)
void lv_obj_update_snap(lv_obj_t * obj, lv_anim_enable_t anim_en)
void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor, lv_area_t * ver)
void lv_obj_scrollbar_invalidate(lv_obj_t * obj)
@ -239,6 +242,8 @@ lv_text_align_t lv_obj_calculate_style_text_align(const lv_obj_t * obj, lv_part_
static inline int32_t lv_obj_get_style_transform_scale_x_safe(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_transform_scale_y_safe(const lv_obj_t * obj, lv_part_t part)
lv_opa_t lv_obj_get_style_opa_recursive(const lv_obj_t * obj, lv_part_t part)
lv_color32_t lv_obj_style_apply_recolor(const lv_obj_t * obj, lv_part_t part, lv_color32_t color)
lv_color32_t lv_obj_get_style_recolor_recursive(const lv_obj_t * obj, lv_part_t part)
// ../../lvgl/src/core/lv_obj_style_gen.h
static inline int32_t lv_obj_get_style_width(const lv_obj_t * obj, lv_part_t part)
@ -255,6 +260,7 @@ static inline int32_t lv_obj_get_style_transform_width(const lv_obj_t * obj, lv_
static inline int32_t lv_obj_get_style_transform_height(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_translate_x(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_translate_y(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_translate_radial(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_transform_scale_x(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_transform_scale_y(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_transform_rotation(const lv_obj_t * obj, lv_part_t part)
@ -268,6 +274,7 @@ static inline int32_t lv_obj_get_style_pad_left(const lv_obj_t * obj, lv_part_t
static inline int32_t lv_obj_get_style_pad_right(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_pad_row(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_pad_column(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_pad_radial(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_margin_top(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_margin_bottom(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_margin_left(const lv_obj_t * obj, lv_part_t part)
@ -332,12 +339,19 @@ static inline int32_t lv_obj_get_style_text_letter_space(const lv_obj_t * obj, l
static inline int32_t lv_obj_get_style_text_line_space(const lv_obj_t * obj, lv_part_t part)
static inline lv_text_decor_t lv_obj_get_style_text_decor(const lv_obj_t * obj, lv_part_t part)
static inline lv_text_align_t lv_obj_get_style_text_align(const lv_obj_t * obj, lv_part_t part)
static inline lv_color_t lv_obj_get_style_text_outline_stroke_color(const lv_obj_t * obj, lv_part_t part)
static inline lv_color_t lv_obj_get_style_text_outline_stroke_color_filtered(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_text_outline_stroke_width(const lv_obj_t * obj, lv_part_t part)
static inline lv_opa_t lv_obj_get_style_text_outline_stroke_opa(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_radius(const lv_obj_t * obj, lv_part_t part)
static inline int32_t lv_obj_get_style_radial_offset(const lv_obj_t * obj, lv_part_t part)
static inline bool lv_obj_get_style_clip_corner(const lv_obj_t * obj, lv_part_t part)
static inline lv_opa_t lv_obj_get_style_opa(const lv_obj_t * obj, lv_part_t part)
static inline lv_opa_t lv_obj_get_style_opa_layered(const lv_obj_t * obj, lv_part_t part)
static inline const lv_color_filter_dsc_t * lv_obj_get_style_color_filter_dsc(const lv_obj_t * obj, lv_part_t part)
static inline lv_opa_t lv_obj_get_style_color_filter_opa(const lv_obj_t * obj, lv_part_t part)
static inline lv_color_t lv_obj_get_style_recolor(const lv_obj_t * obj, lv_part_t part)
static inline lv_opa_t lv_obj_get_style_recolor_opa(const lv_obj_t * obj, lv_part_t part)
static inline const lv_anim_t * lv_obj_get_style_anim(const lv_obj_t * obj, lv_part_t part)
static inline uint32_t lv_obj_get_style_anim_duration(const lv_obj_t * obj, lv_part_t part)
static inline const lv_style_transition_dsc_t * lv_obj_get_style_transition(const lv_obj_t * obj, lv_part_t part)
@ -375,6 +389,7 @@ void lv_obj_set_style_transform_width(lv_obj_t * obj, int32_t value, lv_style_se
void lv_obj_set_style_transform_height(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_translate_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_translate_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_translate_radial(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_transform_scale_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_transform_scale_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_transform_rotation(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
@ -388,6 +403,7 @@ void lv_obj_set_style_pad_left(lv_obj_t * obj, int32_t value, lv_style_selector_
void lv_obj_set_style_pad_right(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_pad_row(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_pad_column(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_pad_radial(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_margin_top(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_margin_bottom(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_margin_left(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
@ -442,12 +458,18 @@ void lv_obj_set_style_text_letter_space(lv_obj_t * obj, int32_t value, lv_style_
void lv_obj_set_style_text_line_space(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_text_decor(lv_obj_t * obj, lv_text_decor_t value, lv_style_selector_t selector)
void lv_obj_set_style_text_align(lv_obj_t * obj, lv_text_align_t value, lv_style_selector_t selector)
void lv_obj_set_style_text_outline_stroke_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
void lv_obj_set_style_text_outline_stroke_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_text_outline_stroke_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
void lv_obj_set_style_radius(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_radial_offset(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
void lv_obj_set_style_clip_corner(lv_obj_t * obj, bool value, lv_style_selector_t selector)
void lv_obj_set_style_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
void lv_obj_set_style_opa_layered(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
void lv_obj_set_style_color_filter_dsc(lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector)
void lv_obj_set_style_color_filter_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
void lv_obj_set_style_recolor(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
void lv_obj_set_style_recolor_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
void lv_obj_set_style_anim(lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector)
void lv_obj_set_style_anim_duration(lv_obj_t * obj, uint32_t value, lv_style_selector_t selector)
void lv_obj_set_style_transition(lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector)
@ -498,6 +520,7 @@ void lv_obj_dump_tree(lv_obj_t * start_obj)
// ../../lvgl/src/core/lv_refr.h
void lv_refr_now(lv_display_t * disp)
void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj)
void lv_display_refr_timer(lv_timer_t * timer)
// ../../lvgl/src/display/lv_display.h
lv_display_t * lv_display_create(int32_t hor_res, int32_t ver_res)
@ -509,22 +532,30 @@ void lv_display_set_resolution(lv_display_t * disp, int32_t hor_res, int32_t ver
void lv_display_set_physical_resolution(lv_display_t * disp, int32_t hor_res, int32_t ver_res)
void lv_display_set_offset(lv_display_t * disp, int32_t x, int32_t y)
void lv_display_set_rotation(lv_display_t * disp, lv_display_rotation_t rotation)
void lv_display_set_matrix_rotation(lv_display_t * disp, bool enable)
void lv_display_set_dpi(lv_display_t * disp, int32_t dpi)
int32_t lv_display_get_horizontal_resolution(const lv_display_t * disp)
int32_t lv_display_get_vertical_resolution(const lv_display_t * disp)
int32_t lv_display_get_original_horizontal_resolution(const lv_display_t * disp)
int32_t lv_display_get_original_vertical_resolution(const lv_display_t * disp)
int32_t lv_display_get_physical_horizontal_resolution(const lv_display_t * disp)
int32_t lv_display_get_physical_vertical_resolution(const lv_display_t * disp)
int32_t lv_display_get_offset_x(const lv_display_t * disp)
int32_t lv_display_get_offset_y(const lv_display_t * disp)
lv_display_rotation_t lv_display_get_rotation(lv_display_t * disp)
bool lv_display_get_matrix_rotation(lv_display_t * disp)
int32_t lv_display_get_dpi(const lv_display_t * disp)
void lv_display_set_buffers(lv_display_t * disp, void * buf1, void * buf2, uint32_t buf_size, lv_display_render_mode_t render_mode)
void lv_display_set_buffers_with_stride(lv_display_t * disp, void * buf1, void * buf2, uint32_t buf_size, uint32_t stride, lv_display_render_mode_t render_mode)
void lv_display_set_draw_buffers(lv_display_t * disp, lv_draw_buf_t * buf1, lv_draw_buf_t * buf2)
void lv_display_set_3rd_draw_buffer(lv_display_t * disp, lv_draw_buf_t * buf3)
void lv_display_set_render_mode(lv_display_t * disp, lv_display_render_mode_t render_mode)
void lv_display_set_flush_cb(lv_display_t * disp, lv_display_flush_cb_t flush_cb)
void lv_display_set_flush_wait_cb(lv_display_t * disp, lv_display_flush_wait_cb_t wait_cb)
void lv_display_set_color_format(lv_display_t * disp, lv_color_format_t color_format)
lv_color_format_t lv_display_get_color_format(lv_display_t * disp)
void lv_display_set_tile_cnt(lv_display_t * disp, uint32_t tile_cnt)
uint32_t lv_display_get_tile_cnt(lv_display_t * disp)
void lv_display_set_antialiasing(lv_display_t * disp, bool en)
bool lv_display_get_antialiasing(lv_display_t * disp)
bool lv_display_is_double_buffered(lv_display_t * disp)
@ -533,7 +564,7 @@ lv_obj_t * lv_display_get_screen_prev(lv_display_t * disp)
lv_obj_t * lv_display_get_layer_top(lv_display_t * disp)
lv_obj_t * lv_display_get_layer_sys(lv_display_t * disp)
lv_obj_t * lv_display_get_layer_bottom(lv_display_t * disp)
void lv_screen_load(struct lv_obj_t * scr)
void lv_screen_load(struct _lv_obj_t * scr)
void lv_screen_load_anim(lv_obj_t * scr, lv_screen_load_anim_t anim_type, uint32_t time, uint32_t delay, bool auto_del)
lv_obj_t * lv_screen_active(void)
lv_obj_t * lv_layer_top(void)
@ -545,6 +576,7 @@ lv_event_dsc_t * lv_display_get_event_dsc(lv_display_t * disp, uint32_t index)
bool lv_display_delete_event(lv_display_t * disp, uint32_t index)
uint32_t lv_display_remove_event_cb_with_user_data(lv_display_t * disp, lv_event_cb_t event_cb, void * user_data)
lv_result_t lv_display_send_event(lv_display_t * disp, lv_event_code_t code, void * param)
lv_area_t * lv_event_get_invalidated_area(lv_event_t * e)
void lv_display_set_theme(lv_display_t * disp, lv_theme_t * th)
lv_theme_t * lv_display_get_theme(lv_display_t * disp)
uint32_t lv_display_get_inactive_time(const lv_display_t * disp)
@ -553,12 +585,17 @@ void lv_display_enable_invalidation(lv_display_t * disp, bool en)
bool lv_display_is_invalidation_enabled(lv_display_t * disp)
lv_timer_t * lv_display_get_refr_timer(lv_display_t * disp)
void lv_display_delete_refr_timer(lv_display_t * disp)
bool lv_display_register_vsync_event(lv_display_t * disp, lv_event_cb_t event_cb, void * user_data)
bool lv_display_unregister_vsync_event(lv_display_t * disp, lv_event_cb_t event_cb, void * user_data)
lv_result_t lv_display_send_vsync_event(lv_display_t * disp, void * param)
void lv_display_set_user_data(lv_display_t * disp, void * user_data)
void lv_display_set_driver_data(lv_display_t * disp, void * driver_data)
void * lv_display_get_user_data(lv_display_t * disp)
void * lv_display_get_driver_data(lv_display_t * disp)
lv_draw_buf_t * lv_display_get_buf_active(lv_display_t * disp)
void lv_display_rotate_area(lv_display_t * disp, lv_area_t * area)
uint32_t lv_display_get_draw_buf_size(lv_display_t * disp)
uint32_t lv_display_get_invalidated_draw_buf_size(lv_display_t * disp, uint32_t width, uint32_t height)
int32_t lv_dpx(int32_t n)
int32_t lv_display_dpx(const lv_display_t * disp, int32_t n)
@ -566,7 +603,7 @@ int32_t lv_display_dpx(const lv_display_t * disp, int32_t n)
void lv_draw_init(void)
void lv_draw_deinit(void)
void * lv_draw_create_unit(size_t size)
lv_draw_task_t * lv_draw_add_task(lv_layer_t * layer, const lv_area_t * coords)
lv_draw_task_t * lv_draw_add_task(lv_layer_t * layer, const lv_area_t * coords, lv_draw_task_type_t type)
void lv_draw_finalize_task_creation(lv_layer_t * layer, lv_draw_task_t * t)
void lv_draw_dispatch(void)
bool lv_draw_dispatch_layer(lv_display_t * disp, lv_layer_t * layer)
@ -574,9 +611,13 @@ void lv_draw_dispatch_wait_for_request(void)
void lv_draw_wait_for_finish(void)
void lv_draw_dispatch_request(void)
uint32_t lv_draw_get_unit_count(void)
lv_draw_task_t * lv_draw_get_available_task(lv_layer_t * layer, lv_draw_task_t * t_prev, uint8_t draw_unit_id)
lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_task_t * t_prev, uint8_t draw_unit_id)
uint32_t lv_draw_get_dependent_count(lv_draw_task_t * t_check)
void lv_layer_init(lv_layer_t * layer)
void lv_layer_reset(lv_layer_t * layer)
lv_layer_t * lv_draw_layer_create(lv_layer_t * parent_layer, lv_color_format_t color_format, const lv_area_t * area)
void lv_draw_layer_init(lv_layer_t * layer, lv_layer_t * parent_layer, lv_color_format_t color_format, const lv_area_t * area)
void * lv_draw_layer_alloc_buf(lv_layer_t * layer)
void * lv_draw_layer_go_to_xy(lv_layer_t * layer, int32_t x, int32_t y)
lv_draw_task_type_t lv_draw_task_get_type(const lv_draw_task_t * t)
@ -590,12 +631,15 @@ void lv_draw_arc(lv_layer_t * layer, const lv_draw_arc_dsc_t * dsc)
void lv_draw_arc_get_area(int32_t x, int32_t y, uint16_t radius, lv_value_precise_t start_angle, lv_value_precise_t end_angle, int32_t w, bool rounded, lv_area_t * area)
// ../../lvgl/src/draw/lv_draw_label.h
void lv_draw_letter_dsc_init(lv_draw_letter_dsc_t * dsc)
void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc)
lv_draw_label_dsc_t * lv_draw_task_get_label_dsc(lv_draw_task_t * task)
void lv_draw_glyph_dsc_init(lv_draw_glyph_dsc_t * dsc)
void lv_draw_label(lv_layer_t * layer, const lv_draw_label_dsc_t * dsc, const lv_area_t * coords)
void lv_draw_character(lv_layer_t * layer, lv_draw_label_dsc_t * dsc, const lv_point_t * point, uint32_t unicode_letter)
void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc, const lv_area_t * coords, lv_draw_glyph_cb_t cb)
void lv_draw_letter(lv_layer_t * layer, lv_draw_letter_dsc_t * dsc, const lv_point_t * point)
void lv_draw_label_iterate_characters(lv_draw_task_t * t, const lv_draw_label_dsc_t * dsc, const lv_area_t * coords, lv_draw_glyph_cb_t cb)
void lv_draw_unit_draw_letter(lv_draw_task_t * t, lv_draw_glyph_dsc_t * dsc, const lv_point_t * pos, const lv_font_t * font, uint32_t letter, lv_draw_glyph_cb_t cb)
// ../../lvgl/src/draw/lv_draw_line.h
void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc)
@ -611,10 +655,13 @@ void lv_draw_mask_rect(lv_layer_t * layer, const lv_draw_mask_rect_dsc_t * dsc)
void lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc)
void lv_draw_fill_dsc_init(lv_draw_fill_dsc_t * dsc)
lv_draw_fill_dsc_t * lv_draw_task_get_fill_dsc(lv_draw_task_t * task)
void lv_draw_fill(lv_layer_t * layer, const lv_draw_fill_dsc_t * dsc, const lv_area_t * coords)
void lv_draw_border_dsc_init(lv_draw_border_dsc_t * dsc)
lv_draw_border_dsc_t * lv_draw_task_get_border_dsc(lv_draw_task_t * task)
void lv_draw_border(lv_layer_t * layer, const lv_draw_border_dsc_t * dsc, const lv_area_t * coords)
void lv_draw_box_shadow_dsc_init(lv_draw_box_shadow_dsc_t * dsc)
lv_draw_box_shadow_dsc_t * lv_draw_task_get_box_shadow_dsc(lv_draw_task_t * task)
void lv_draw_box_shadow(lv_layer_t * layer, const lv_draw_box_shadow_dsc_t * dsc, const lv_area_t * coords)
void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords)
// ../../lvgl/src/draw/lv_draw_triangle.h
@ -624,11 +671,15 @@ void lv_draw_triangle(lv_layer_t * layer, const lv_draw_triangle_dsc_t * draw_ds
// ../../lvgl/src/font/lv_font.h
const void * lv_font_get_glyph_bitmap(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf_t * draw_buf)
const void * lv_font_get_glyph_static_bitmap(lv_font_glyph_dsc_t * g_dsc)
bool lv_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t letter, uint32_t letter_next)
void lv_font_glyph_release_draw_data(lv_font_glyph_dsc_t * g_dsc)
uint16_t lv_font_get_glyph_width(const lv_font_t * font, uint32_t letter, uint32_t letter_next)
int32_t lv_font_get_line_height(const lv_font_t * font)
void lv_font_set_kerning(lv_font_t * font, lv_font_kerning_t kerning)
const lv_font_t * lv_font_get_default(void)
bool lv_font_info_is_equal(const lv_font_info_t * ft_info_1, const lv_font_info_t * ft_info_2)
bool lv_font_has_static_bitmap(const lv_font_t * font)
// ../../lvgl/src/indev/lv_indev.h
lv_indev_t * lv_indev_create(void)
@ -642,8 +693,9 @@ void lv_indev_set_type(lv_indev_t * indev, lv_indev_type_t indev_type)
void lv_indev_set_read_cb(lv_indev_t * indev, lv_indev_read_cb_t read_cb)
void lv_indev_set_user_data(lv_indev_t * indev, void * user_data)
void lv_indev_set_driver_data(lv_indev_t * indev, void * driver_data)
void lv_indev_set_display(lv_indev_t * indev, struct lv_display_t * disp)
void lv_indev_set_display(lv_indev_t * indev, struct _lv_display_t * disp)
void lv_indev_set_long_press_time(lv_indev_t * indev, uint16_t long_press_time)
void lv_indev_set_long_press_repeat_time(lv_indev_t * indev, uint16_t long_press_repeat_time)
void lv_indev_set_scroll_limit(lv_indev_t * indev, uint8_t scroll_limit)
void lv_indev_set_scroll_throw(lv_indev_t * indev, uint8_t scroll_throw)
lv_indev_type_t lv_indev_get_type(const lv_indev_t * indev)
@ -663,9 +715,11 @@ void lv_indev_set_button_points(lv_indev_t * indev, const lv_point_t points[])
void lv_indev_get_point(const lv_indev_t * indev, lv_point_t * point)
lv_dir_t lv_indev_get_gesture_dir(const lv_indev_t * indev)
uint32_t lv_indev_get_key(const lv_indev_t * indev)
uint8_t lv_indev_get_short_click_streak(const lv_indev_t * indev)
lv_dir_t lv_indev_get_scroll_dir(const lv_indev_t * indev)
lv_obj_t * lv_indev_get_scroll_obj(const lv_indev_t * indev)
void lv_indev_get_vect(const lv_indev_t * indev, lv_point_t * point)
lv_obj_t * lv_indev_get_cursor(lv_indev_t * indev)
void lv_indev_wait_release(lv_indev_t * indev)
lv_obj_t * lv_indev_get_active_obj(void)
lv_timer_t * lv_indev_get_read_timer(lv_indev_t * indev)
@ -713,8 +767,11 @@ void lv_anim_init(lv_anim_t * a)
void lv_anim_set_var(lv_anim_t * a, void * var)
void lv_anim_set_exec_cb(lv_anim_t * a, lv_anim_exec_xcb_t exec_cb)
void lv_anim_set_duration(lv_anim_t * a, uint32_t duration)
void lv_anim_set_time(lv_anim_t * a, uint32_t duration)
void lv_anim_set_delay(lv_anim_t * a, uint32_t delay)
void lv_anim_resume(lv_anim_t * a)
void lv_anim_pause(lv_anim_t * a)
void lv_anim_pause_for(lv_anim_t * a, uint32_t ms)
bool lv_anim_is_paused(lv_anim_t * a)
void lv_anim_set_values(lv_anim_t * a, int32_t start, int32_t end)
void lv_anim_set_custom_exec_cb(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb)
void lv_anim_set_path_cb(lv_anim_t * a, lv_anim_path_cb_t path_cb)
@ -722,9 +779,9 @@ void lv_anim_set_start_cb(lv_anim_t * a, lv_anim_start_cb_t start_cb)
void lv_anim_set_get_value_cb(lv_anim_t * a, lv_anim_get_value_cb_t get_value_cb)
void lv_anim_set_completed_cb(lv_anim_t * a, lv_anim_completed_cb_t completed_cb)
void lv_anim_set_deleted_cb(lv_anim_t * a, lv_anim_deleted_cb_t deleted_cb)
void lv_anim_set_playback_duration(lv_anim_t * a, uint32_t duration)
void lv_anim_set_playback_time(lv_anim_t * a, uint32_t duration)
void lv_anim_set_playback_delay(lv_anim_t * a, uint32_t delay)
void lv_anim_set_reverse_duration(lv_anim_t * a, uint32_t duration)
void lv_anim_set_reverse_time(lv_anim_t * a, uint32_t duration)
void lv_anim_set_reverse_delay(lv_anim_t * a, uint32_t delay)
void lv_anim_set_repeat_count(lv_anim_t * a, uint32_t cnt)
void lv_anim_set_repeat_delay(lv_anim_t * a, uint32_t delay)
void lv_anim_set_early_apply(lv_anim_t * a, bool en)
@ -745,6 +802,7 @@ lv_anim_t * lv_anim_custom_get(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb)
uint16_t lv_anim_count_running(void)
uint32_t lv_anim_speed(uint32_t speed)
uint32_t lv_anim_speed_clamped(uint32_t speed, uint32_t min_time, uint32_t max_time)
uint32_t lv_anim_resolve_speed(uint32_t speed, int32_t start, int32_t end)
uint32_t lv_anim_speed_to_time(uint32_t speed, int32_t start, int32_t end)
void lv_anim_refr_now(void)
@ -798,12 +856,15 @@ uint8_t lv_color_luminance(lv_color_t c)
uint8_t lv_color16_luminance(const lv_color16_t c)
uint8_t lv_color24_luminance(const uint8_t * c)
uint8_t lv_color32_luminance(lv_color32_t c)
static inline uint16_t lv_color_swap_16(uint16_t c)
// ../../lvgl/src/misc/lv_color_op.h
lv_color_t lv_color_mix(lv_color_t c1, lv_color_t c2, uint8_t mix)
lv_color32_t lv_color_mix32(lv_color32_t fg, lv_color32_t bg)
lv_color32_t lv_color_mix32_premultiplied(lv_color32_t fg, lv_color32_t bg)
uint8_t lv_color_brightness(lv_color_t c)
void lv_color_filter_dsc_init(lv_color_filter_dsc_t * dsc, lv_color_filter_cb_t cb)
lv_color32_t lv_color_over32(lv_color32_t fg, lv_color32_t bg)
// ../../lvgl/src/misc/lv_event.h
lv_result_t lv_event_send(lv_event_list_t * list, lv_event_t * e, bool preprocess)
@ -823,6 +884,7 @@ void * lv_event_get_user_data(lv_event_t * e)
void lv_event_stop_bubbling(lv_event_t * e)
void lv_event_stop_processing(lv_event_t * e)
uint32_t lv_event_register_id(void)
const char * lv_event_code_get_name(lv_event_code_t code)
// ../../lvgl/src/misc/lv_palette.h
lv_color_t lv_palette_main(lv_palette_t p)
@ -832,6 +894,7 @@ lv_color_t lv_palette_darken(lv_palette_t p, uint8_t lvl)
// ../../lvgl/src/misc/lv_style.h
void lv_style_init(lv_style_t * style)
void lv_style_reset(lv_style_t * style)
void lv_style_copy(lv_style_t * dst, const lv_style_t * src)
static inline bool lv_style_is_const(const lv_style_t * style)
lv_style_prop_t lv_style_register_prop(uint8_t flag)
lv_style_prop_t lv_style_get_num_custom_props(void)
@ -849,6 +912,9 @@ static inline void lv_style_set_pad_all(lv_style_t * style, int32_t value)
static inline void lv_style_set_pad_hor(lv_style_t * style, int32_t value)
static inline void lv_style_set_pad_ver(lv_style_t * style, int32_t value)
static inline void lv_style_set_pad_gap(lv_style_t * style, int32_t value)
static inline void lv_style_set_margin_hor(lv_style_t * style, int32_t value)
static inline void lv_style_set_margin_ver(lv_style_t * style, int32_t value)
static inline void lv_style_set_margin_all(lv_style_t * style, int32_t value)
static inline void lv_style_set_transform_scale(lv_style_t * style, int32_t value)
static inline bool lv_style_prop_has_flag(lv_style_prop_t prop, uint8_t flag)
@ -867,6 +933,7 @@ void lv_style_set_transform_width(lv_style_t * style, int32_t value)
void lv_style_set_transform_height(lv_style_t * style, int32_t value)
void lv_style_set_translate_x(lv_style_t * style, int32_t value)
void lv_style_set_translate_y(lv_style_t * style, int32_t value)
void lv_style_set_translate_radial(lv_style_t * style, int32_t value)
void lv_style_set_transform_scale_x(lv_style_t * style, int32_t value)
void lv_style_set_transform_scale_y(lv_style_t * style, int32_t value)
void lv_style_set_transform_rotation(lv_style_t * style, int32_t value)
@ -880,6 +947,7 @@ void lv_style_set_pad_left(lv_style_t * style, int32_t value)
void lv_style_set_pad_right(lv_style_t * style, int32_t value)
void lv_style_set_pad_row(lv_style_t * style, int32_t value)
void lv_style_set_pad_column(lv_style_t * style, int32_t value)
void lv_style_set_pad_radial(lv_style_t * style, int32_t value)
void lv_style_set_margin_top(lv_style_t * style, int32_t value)
void lv_style_set_margin_bottom(lv_style_t * style, int32_t value)
void lv_style_set_margin_left(lv_style_t * style, int32_t value)
@ -934,12 +1002,18 @@ void lv_style_set_text_letter_space(lv_style_t * style, int32_t value)
void lv_style_set_text_line_space(lv_style_t * style, int32_t value)
void lv_style_set_text_decor(lv_style_t * style, lv_text_decor_t value)
void lv_style_set_text_align(lv_style_t * style, lv_text_align_t value)
void lv_style_set_text_outline_stroke_color(lv_style_t * style, lv_color_t value)
void lv_style_set_text_outline_stroke_width(lv_style_t * style, int32_t value)
void lv_style_set_text_outline_stroke_opa(lv_style_t * style, lv_opa_t value)
void lv_style_set_radius(lv_style_t * style, int32_t value)
void lv_style_set_radial_offset(lv_style_t * style, int32_t value)
void lv_style_set_clip_corner(lv_style_t * style, bool value)
void lv_style_set_opa(lv_style_t * style, lv_opa_t value)
void lv_style_set_opa_layered(lv_style_t * style, lv_opa_t value)
void lv_style_set_color_filter_dsc(lv_style_t * style, const lv_color_filter_dsc_t * value)
void lv_style_set_color_filter_opa(lv_style_t * style, lv_opa_t value)
void lv_style_set_recolor(lv_style_t * style, lv_color_t value)
void lv_style_set_recolor_opa(lv_style_t * style, lv_opa_t value)
void lv_style_set_anim(lv_style_t * style, const lv_anim_t * value)
void lv_style_set_anim_duration(lv_style_t * style, uint32_t value)
void lv_style_set_transition(lv_style_t * style, const lv_style_transition_dsc_t * value)
@ -967,6 +1041,8 @@ void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value)
// ../../lvgl/src/misc/lv_text.h
void lv_text_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, int32_t letter_space, int32_t line_space, int32_t max_width, lv_text_flag_t flag)
int32_t lv_text_get_width(const char * txt, uint32_t length, const lv_font_t * font, int32_t letter_space)
int32_t lv_text_get_width_with_flags(const char * txt, uint32_t length, const lv_font_t * font, int32_t letter_space, lv_text_flag_t flags)
bool lv_text_is_cmd(lv_text_cmd_state_t * state, uint32_t c)
// ../../lvgl/src/misc/lv_timer.h
uint32_t lv_timer_handler(void)
@ -1005,15 +1081,21 @@ lv_color_t lv_theme_get_color_secondary(lv_obj_t * obj)
// ../../lvgl/src/widgets/animimage/lv_animimage.h
lv_obj_t * lv_animimg_create(lv_obj_t * parent)
void lv_animimg_set_src(lv_obj_t * img, const void * dsc[], size_t num)
void lv_animimg_set_src(lv_obj_t * obj, const void * dsc[], size_t num)
void lv_animimg_set_src_reverse(lv_obj_t * obj, const void * dsc[], size_t num)
void lv_animimg_start(lv_obj_t * obj)
void lv_animimg_set_duration(lv_obj_t * img, uint32_t duration)
void lv_animimg_set_repeat_count(lv_obj_t * img, uint32_t count)
const void ** lv_animimg_get_src(lv_obj_t * img)
uint8_t lv_animimg_get_src_count(lv_obj_t * img)
uint32_t lv_animimg_get_duration(lv_obj_t * img)
uint32_t lv_animimg_get_repeat_count(lv_obj_t * img)
lv_anim_t * lv_animimg_get_anim(lv_obj_t * img)
bool lv_animimg_delete(lv_obj_t * obj)
void lv_animimg_set_duration(lv_obj_t * obj, uint32_t duration)
void lv_animimg_set_repeat_count(lv_obj_t * obj, uint32_t count)
void lv_animimg_set_reverse_duration(lv_obj_t * obj, uint32_t duration)
void lv_animimg_set_reverse_delay(lv_obj_t * obj, uint32_t duration)
void lv_animimg_set_start_cb(lv_obj_t * obj, lv_anim_start_cb_t start_cb)
void lv_animimg_set_completed_cb(lv_obj_t * obj, lv_anim_completed_cb_t completed_cb)
const void ** lv_animimg_get_src(lv_obj_t * obj)
uint8_t lv_animimg_get_src_count(lv_obj_t * obj)
uint32_t lv_animimg_get_duration(lv_obj_t * obj)
uint32_t lv_animimg_get_repeat_count(lv_obj_t * obj)
lv_anim_t * lv_animimg_get_anim(lv_obj_t * obj)
// ../../lvgl/src/widgets/arc/lv_arc.h
lv_obj_t * lv_arc_create(lv_obj_t * parent)
@ -1080,7 +1162,7 @@ bool lv_buttonmatrix_get_one_checked(const lv_obj_t * obj)
// ../../lvgl/src/widgets/calendar/lv_calendar.h
lv_obj_t * lv_calendar_create(lv_obj_t * parent)
void lv_calendar_set_today_date(lv_obj_t * obj, uint32_t year, uint32_t month, uint32_t day)
void lv_calendar_set_showed_date(lv_obj_t * obj, uint32_t year, uint32_t month)
void lv_calendar_set_month_shown(lv_obj_t * obj, uint32_t year, uint32_t month)
void lv_calendar_set_highlighted_dates(lv_obj_t * obj, lv_calendar_date_t highlighted[], size_t date_num)
void lv_calendar_set_day_names(lv_obj_t * obj, const char ** day_names)
lv_obj_t * lv_calendar_get_btnmatrix(const lv_obj_t * obj)
@ -1096,10 +1178,10 @@ const char * lv_calendar_get_day_name(lv_calendar_date_t * gregorian)
void lv_calendar_gregorian_to_chinese(lv_calendar_date_t * gregorian_time, lv_calendar_chinese_t * chinese_time)
// ../../lvgl/src/widgets/calendar/lv_calendar_header_arrow.h
lv_obj_t * lv_calendar_header_arrow_create(lv_obj_t * parent)
lv_obj_t * lv_calendar_add_header_arrow(lv_obj_t * parent)
// ../../lvgl/src/widgets/calendar/lv_calendar_header_dropdown.h
lv_obj_t * lv_calendar_header_dropdown_create(lv_obj_t * parent)
lv_obj_t * lv_calendar_add_header_dropdown(lv_obj_t * parent)
void lv_calendar_header_dropdown_set_year_list(lv_obj_t * parent, const char * years_list)
// ../../lvgl/src/widgets/canvas/lv_canvas.h
@ -1122,7 +1204,7 @@ uint32_t lv_canvas_buf_size(int32_t w, int32_t h, uint8_t bpp, uint8_t stride)
lv_obj_t * lv_chart_create(lv_obj_t * parent)
void lv_chart_set_type(lv_obj_t * obj, lv_chart_type_t type)
void lv_chart_set_point_count(lv_obj_t * obj, uint32_t cnt)
void lv_chart_set_range(lv_obj_t * obj, lv_chart_axis_t axis, int32_t min, int32_t max)
void lv_chart_set_axis_range(lv_obj_t * obj, lv_chart_axis_t axis, int32_t min, int32_t max)
void lv_chart_set_update_mode(lv_obj_t * obj, lv_chart_update_mode_t update_mode)
void lv_chart_set_div_line_count(lv_obj_t * obj, uint8_t hdiv, uint8_t vdiv)
lv_chart_type_t lv_chart_get_type(const lv_obj_t * obj)
@ -1139,17 +1221,21 @@ void lv_chart_set_x_start_point(lv_obj_t * obj, lv_chart_series_t * ser, uint32_
lv_chart_series_t * lv_chart_get_series_next(const lv_obj_t * chart, const lv_chart_series_t * ser)
lv_chart_cursor_t * lv_chart_add_cursor(lv_obj_t * obj, lv_color_t color, lv_dir_t dir)
void lv_chart_set_cursor_pos(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_point_t * pos)
void lv_chart_set_cursor_pos_x(lv_obj_t * chart, lv_chart_cursor_t * cursor, int32_t x)
void lv_chart_set_cursor_pos_y(lv_obj_t * chart, lv_chart_cursor_t * cursor, int32_t y)
void lv_chart_set_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_chart_series_t * ser, uint32_t point_id)
lv_point_t lv_chart_get_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor)
void lv_chart_set_all_value(lv_obj_t * obj, lv_chart_series_t * ser, int32_t value)
void lv_chart_set_all_values(lv_obj_t * obj, lv_chart_series_t * ser, int32_t value)
void lv_chart_set_next_value(lv_obj_t * obj, lv_chart_series_t * ser, int32_t value)
void lv_chart_set_next_value2(lv_obj_t * obj, lv_chart_series_t * ser, int32_t x_value, int32_t y_value)
void lv_chart_set_value_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, int32_t value)
void lv_chart_set_value_by_id2(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, int32_t x_value, int32_t y_value)
void lv_chart_set_ext_y_array(lv_obj_t * obj, lv_chart_series_t * ser, int32_t array[])
void lv_chart_set_ext_x_array(lv_obj_t * obj, lv_chart_series_t * ser, int32_t array[])
int32_t * lv_chart_get_y_array(const lv_obj_t * obj, lv_chart_series_t * ser)
int32_t * lv_chart_get_x_array(const lv_obj_t * obj, lv_chart_series_t * ser)
void lv_chart_set_series_values(lv_obj_t * obj, lv_chart_series_t * ser, const int32_t values[], size_t values_cnt)
void lv_chart_set_series_values2(lv_obj_t * obj, lv_chart_series_t * ser, const int32_t x_values[], const int32_t y_values[], size_t values_cnt)
void lv_chart_set_series_value_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, int32_t value)
void lv_chart_set_series_value_by_id2(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, int32_t x_value, int32_t y_value)
void lv_chart_set_series_ext_y_array(lv_obj_t * obj, lv_chart_series_t * ser, int32_t array[])
void lv_chart_set_series_ext_x_array(lv_obj_t * obj, lv_chart_series_t * ser, int32_t array[])
int32_t * lv_chart_get_series_y_array(const lv_obj_t * obj, lv_chart_series_t * ser)
int32_t * lv_chart_get_series_x_array(const lv_obj_t * obj, lv_chart_series_t * ser)
uint32_t lv_chart_get_pressed_point(const lv_obj_t * obj)
int32_t lv_chart_get_first_point_center_offset(lv_obj_t * obj)
@ -1206,6 +1292,10 @@ void lv_image_get_pivot(lv_obj_t * obj, lv_point_t * pivot)
int32_t lv_image_get_scale(lv_obj_t * obj)
int32_t lv_image_get_scale_x(lv_obj_t * obj)
int32_t lv_image_get_scale_y(lv_obj_t * obj)
int32_t lv_image_get_src_width(lv_obj_t * obj)
int32_t lv_image_get_src_height(lv_obj_t * obj)
int32_t lv_image_get_transformed_width(lv_obj_t * obj)
int32_t lv_image_get_transformed_height(lv_obj_t * obj)
lv_blend_mode_t lv_image_get_blend_mode(lv_obj_t * obj)
bool lv_image_get_antialias(lv_obj_t * obj)
lv_image_align_t lv_image_get_inner_align(lv_obj_t * obj)
@ -1237,6 +1327,7 @@ void lv_label_set_text_static(lv_obj_t * obj, const char * text)
void lv_label_set_long_mode(lv_obj_t * obj, lv_label_long_mode_t long_mode)
void lv_label_set_text_selection_start(lv_obj_t * obj, uint32_t index)
void lv_label_set_text_selection_end(lv_obj_t * obj, uint32_t index)
void lv_label_set_recolor(lv_obj_t * obj, bool en)
char * lv_label_get_text(const lv_obj_t * obj)
lv_label_long_mode_t lv_label_get_long_mode(const lv_obj_t * obj)
void lv_label_get_letter_pos(const lv_obj_t * obj, uint32_t char_id, lv_point_t * pos)
@ -1244,6 +1335,7 @@ uint32_t lv_label_get_letter_on(const lv_obj_t * obj, lv_point_t * pos_in, bool
bool lv_label_is_char_under_pos(const lv_obj_t * obj, lv_point_t * pos)
uint32_t lv_label_get_text_selection_start(const lv_obj_t * obj)
uint32_t lv_label_get_text_selection_end(const lv_obj_t * obj)
bool lv_label_get_recolor(const lv_obj_t * obj)
void lv_label_ins_text(lv_obj_t * obj, uint32_t pos, const char * txt)
void lv_label_cut_text(lv_obj_t * obj, uint32_t pos, uint32_t cnt)
@ -1276,7 +1368,7 @@ void lv_list_set_button_text(lv_obj_t * list, lv_obj_t * btn, const char * txt)
// ../../lvgl/src/widgets/menu/lv_menu.h
lv_obj_t * lv_menu_create(lv_obj_t * parent)
lv_obj_t * lv_menu_page_create(lv_obj_t * parent, char const * const title)
lv_obj_t * lv_menu_page_create(lv_obj_t * menu, char const * const title)
lv_obj_t * lv_menu_cont_create(lv_obj_t * parent)
lv_obj_t * lv_menu_section_create(lv_obj_t * parent)
lv_obj_t * lv_menu_separator_create(lv_obj_t * parent)
@ -1316,6 +1408,7 @@ void lv_msgbox_close_async(lv_obj_t * mbox)
lv_obj_t * lv_roller_create(lv_obj_t * parent)
void lv_roller_set_options(lv_obj_t * obj, const char * options, lv_roller_mode_t mode)
void lv_roller_set_selected(lv_obj_t * obj, uint32_t sel_opt, lv_anim_enable_t anim)
bool lv_roller_set_selected_str(lv_obj_t * obj, const char * sel_opt, lv_anim_enable_t anim)
void lv_roller_set_visible_row_count(lv_obj_t * obj, uint32_t row_cnt)
uint32_t lv_roller_get_selected(const lv_obj_t * obj)
void lv_roller_get_selected_str(const lv_obj_t * obj, char * buf, uint32_t buf_size)
@ -1337,11 +1430,16 @@ void lv_scale_set_text_src(lv_obj_t * obj, const char * txt_src[])
void lv_scale_set_post_draw(lv_obj_t * obj, bool en)
void lv_scale_set_draw_ticks_on_top(lv_obj_t * obj, bool en)
lv_scale_section_t * lv_scale_add_section(lv_obj_t * obj)
void lv_scale_section_set_range(lv_scale_section_t * section, int32_t minor_range, int32_t major_range)
void lv_scale_section_set_range(lv_scale_section_t * section, int32_t min, int32_t max)
void lv_scale_set_section_range(lv_obj_t * scale, lv_scale_section_t * section, int32_t min, int32_t max)
void lv_scale_section_set_style(lv_scale_section_t * section, lv_part_t part, lv_style_t * section_part_style)
void lv_scale_set_section_style_main(lv_obj_t * scale, lv_scale_section_t * section, const lv_style_t * style)
void lv_scale_set_section_style_indicator(lv_obj_t * scale, lv_scale_section_t * section, const lv_style_t * style)
void lv_scale_set_section_style_items(lv_obj_t * scale, lv_scale_section_t * section, const lv_style_t * style)
lv_scale_mode_t lv_scale_get_mode(lv_obj_t * obj)
int32_t lv_scale_get_total_tick_count(lv_obj_t * obj)
int32_t lv_scale_get_major_tick_every(lv_obj_t * obj)
int32_t lv_scale_get_rotation(lv_obj_t * obj)
bool lv_scale_get_label_show(lv_obj_t * obj)
uint32_t lv_scale_get_angle_range(lv_obj_t * obj)
int32_t lv_scale_get_range_min_value(lv_obj_t * obj)
@ -1350,31 +1448,38 @@ int32_t lv_scale_get_range_max_value(lv_obj_t * obj)
// ../../lvgl/src/widgets/slider/lv_slider.h
lv_obj_t * lv_slider_create(lv_obj_t * parent)
void lv_slider_set_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim)
void lv_slider_set_left_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim)
void lv_slider_set_start_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim)
void lv_slider_set_range(lv_obj_t * obj, int32_t min, int32_t max)
void lv_slider_set_mode(lv_obj_t * obj, lv_slider_mode_t mode)
void lv_slider_set_orientation(lv_obj_t * obj, lv_slider_orientation_t orientation)
int32_t lv_slider_get_value(const lv_obj_t * obj)
int32_t lv_slider_get_left_value(const lv_obj_t * obj)
int32_t lv_slider_get_min_value(const lv_obj_t * obj)
int32_t lv_slider_get_max_value(const lv_obj_t * obj)
bool lv_slider_is_dragged(const lv_obj_t * obj)
lv_slider_mode_t lv_slider_get_mode(lv_obj_t * slider)
lv_slider_orientation_t lv_slider_get_orientation(lv_obj_t * slider)
bool lv_slider_is_symmetrical(lv_obj_t * obj)
// ../../lvgl/src/widgets/span/lv_span.h
void lv_span_stack_init(void)
void lv_span_stack_deinit(void)
lv_obj_t * lv_spangroup_create(lv_obj_t * parent)
lv_span_t * lv_spangroup_new_span(lv_obj_t * obj)
lv_span_t * lv_spangroup_add_span(lv_obj_t * obj)
void lv_spangroup_delete_span(lv_obj_t * obj, lv_span_t * span)
void lv_span_set_text(lv_span_t * span, const char * text)
void lv_span_set_text_static(lv_span_t * span, const char * text)
void lv_spangroup_set_span_text(lv_obj_t * obj, lv_span_t * span, const char * text)
void lv_spangroup_set_span_text_static(lv_obj_t * obj, lv_span_t * span, const char * text)
void lv_span_set_text_static(lv_span_t * span, const char * text)
void lv_spangroup_set_span_style(lv_obj_t * obj, lv_span_t * span, const lv_style_t * style)
void lv_spangroup_set_align(lv_obj_t * obj, lv_text_align_t align)
void lv_spangroup_set_overflow(lv_obj_t * obj, lv_span_overflow_t overflow)
void lv_spangroup_set_indent(lv_obj_t * obj, int32_t indent)
void lv_spangroup_set_mode(lv_obj_t * obj, lv_span_mode_t mode)
void lv_spangroup_set_max_lines(lv_obj_t * obj, int32_t lines)
lv_style_t * lv_span_get_style(lv_span_t * span)
const char * lv_span_get_text(lv_span_t * span)
lv_span_t * lv_spangroup_get_child(const lv_obj_t * obj, int32_t id)
uint32_t lv_spangroup_get_span_count(const lv_obj_t * obj)
lv_text_align_t lv_spangroup_get_align(lv_obj_t * obj)
@ -1385,7 +1490,9 @@ int32_t lv_spangroup_get_max_lines(lv_obj_t * obj)
int32_t lv_spangroup_get_max_line_height(lv_obj_t * obj)
uint32_t lv_spangroup_get_expand_width(lv_obj_t * obj, uint32_t max_width)
int32_t lv_spangroup_get_expand_height(lv_obj_t * obj, int32_t width)
void lv_spangroup_refr_mode(lv_obj_t * obj)
lv_span_coords_t lv_spangroup_get_span_coords(lv_obj_t * obj, const lv_span_t * span)
lv_span_t * lv_spangroup_get_span_by_point(lv_obj_t * obj, const lv_point_t * point)
void lv_spangroup_refresh(lv_obj_t * obj)
// ../../lvgl/src/widgets/spinbox/lv_spinbox.h
lv_obj_t * lv_spinbox_create(lv_obj_t * parent)
@ -1410,6 +1517,8 @@ void lv_spinner_set_anim_params(lv_obj_t * obj, uint32_t t, uint32_t angle)
// ../../lvgl/src/widgets/switch/lv_switch.h
lv_obj_t * lv_switch_create(lv_obj_t * parent)
void lv_switch_set_orientation(lv_obj_t * obj, lv_switch_orientation_t orientation)
lv_switch_orientation_t lv_switch_get_orientation(lv_obj_t * obj)
// ../../lvgl/src/widgets/table/lv_table.h
lv_obj_t * lv_table_create(lv_obj_t * parent)
@ -1418,7 +1527,7 @@ void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint32_t row, uint32_t col, con
void lv_table_set_row_count(lv_obj_t * obj, uint32_t row_cnt)
void lv_table_set_column_count(lv_obj_t * obj, uint32_t col_cnt)
void lv_table_set_column_width(lv_obj_t * obj, uint32_t col_id, int32_t w)
void lv_table_add_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl)
void lv_table_set_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl)
void lv_table_clear_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl)
void lv_table_set_cell_user_data(lv_obj_t * obj, uint16_t row, uint16_t col, void * user_data)
void lv_table_set_selected_cell(lv_obj_t * obj, uint16_t row, uint16_t col)

View File

@ -41,6 +41,16 @@ const be_ctypes_structure_t be_lv_area = {
{ "y2", 12, 0, 0, ctypes_i32, 0 },
}};
const be_ctypes_structure_t be_lv_grad_stop = {
8, /* size in bytes */
3, /* number of elements */
be_ctypes_instance_mappings,
(const be_ctypes_structure_item_t[3]) {
{ "color", 0, 0, 0, ctypes_u24, 1 },
{ "frac", 4, 0, 0, ctypes_u8, 0 },
{ "opa", 3, 0, 0, ctypes_u8, 0 },
}};
const be_ctypes_structure_t be_lv_gradient_stop = {
8, /* size in bytes */
3, /* number of elements */
@ -56,8 +66,8 @@ const be_ctypes_structure_t be_lv_grad_dsc = {
9, /* number of elements */
be_ctypes_instance_mappings,
(const be_ctypes_structure_item_t[9]) {
{ "dir", 11, 0, 3, ctypes_bf, 0 },
{ "extend", 11, 3, 2, ctypes_bf, 0 },
{ "dir", 11, 0, 4, ctypes_bf, 0 },
{ "extend", 11, 4, 3, ctypes_bf, 0 },
{ "stops_0_color", 0, 0, 0, ctypes_u24, 1 },
{ "stops_0_frac", 4, 0, 0, ctypes_u8, 0 },
{ "stops_0_opa", 3, 0, 0, ctypes_u8, 0 },
@ -94,8 +104,8 @@ const be_ctypes_structure_t be_lv_draw_rect_dsc = {
{ "base_part", 4, 0, 0, ctypes_u32, 0 },
{ "base_user_data", 24, 0, 0, ctypes_ptr32, 0 },
{ "bg_color", 33, 0, 0, ctypes_u24, 1 },
{ "bg_grad_dir", 47, 0, 3, ctypes_bf, 0 },
{ "bg_grad_extend", 47, 3, 2, ctypes_bf, 0 },
{ "bg_grad_dir", 47, 0, 4, ctypes_bf, 0 },
{ "bg_grad_extend", 47, 4, 3, ctypes_bf, 0 },
{ "bg_grad_stops_0_color", 36, 0, 0, ctypes_u24, 1 },
{ "bg_grad_stops_0_frac", 40, 0, 0, ctypes_u8, 0 },
{ "bg_grad_stops_0_opa", 39, 0, 0, ctypes_u8, 0 },
@ -130,9 +140,9 @@ const be_ctypes_structure_t be_lv_draw_rect_dsc = {
const be_ctypes_structure_t be_lv_draw_line_dsc = {
64, /* size in bytes */
20, /* number of elements */
19, /* number of elements */
be_ctypes_instance_mappings,
(const be_ctypes_structure_item_t[20]) {
(const be_ctypes_structure_item_t[19]) {
{ "base_dsc_size", 20, 0, 0, ctypes_u32, 0 },
{ "base_id1", 8, 0, 0, ctypes_u32, 0 },
{ "base_id2", 12, 0, 0, ctypes_u32, 0 },
@ -140,7 +150,6 @@ const be_ctypes_structure_t be_lv_draw_line_dsc = {
{ "base_obj", 0, 0, 0, ctypes_ptr32, 0 },
{ "base_part", 4, 0, 0, ctypes_u32, 0 },
{ "base_user_data", 24, 0, 0, ctypes_ptr32, 0 },
{ "blend_mode", 61, 0, 2, ctypes_bf, 0 },
{ "color", 44, 0, 0, ctypes_u24, 1 },
{ "dash_gap", 56, 0, 0, ctypes_i32, 0 },
{ "dash_width", 52, 0, 0, ctypes_i32, 0 },
@ -149,9 +158,9 @@ const be_ctypes_structure_t be_lv_draw_line_dsc = {
{ "p1_y", 32, 0, 0, ctypes_i32, 0 },
{ "p2_x", 36, 0, 0, ctypes_i32, 0 },
{ "p2_y", 40, 0, 0, ctypes_i32, 0 },
{ "raw_end", 61, 4, 1, ctypes_bf, 0 },
{ "round_end", 61, 3, 1, ctypes_bf, 0 },
{ "round_start", 61, 2, 1, ctypes_bf, 0 },
{ "raw_end", 61, 2, 1, ctypes_bf, 0 },
{ "round_end", 61, 1, 1, ctypes_bf, 0 },
{ "round_start", 61, 0, 1, ctypes_bf, 0 },
{ "width", 48, 0, 0, ctypes_i32, 0 },
}};
@ -198,7 +207,7 @@ const be_ctypes_structure_t be_lv_draw_image_dsc = {
35, /* number of elements */
be_ctypes_instance_mappings,
(const be_ctypes_structure_item_t[35]) {
{ "antialias", 77, 4, 1, ctypes_bf, 0 },
{ "antialias", 81, 4, 1, ctypes_bf, 0 },
{ "base_dsc_size", 20, 0, 0, ctypes_u32, 0 },
{ "base_id1", 8, 0, 0, ctypes_u32, 0 },
{ "base_id2", 12, 0, 0, ctypes_u32, 0 },
@ -207,8 +216,8 @@ const be_ctypes_structure_t be_lv_draw_image_dsc = {
{ "base_part", 4, 0, 0, ctypes_u32, 0 },
{ "base_user_data", 24, 0, 0, ctypes_ptr32, 0 },
{ "bitmap_mask_src", 104, 0, 0, ctypes_ptr32, 0 },
{ "blend_mode", 77, 0, 4, ctypes_bf, 0 },
{ "clip_radius", 100, 0, 0, ctypes_i32, 0 },
{ "blend_mode", 81, 0, 4, ctypes_bf, 0 },
{ "clip_radius", 44, 0, 0, ctypes_i32, 0 },
{ "header_cf", 33, 0, 0, ctypes_u8, 0 },
{ "header_flags", 34, 0, 0, ctypes_u16, 0 },
{ "header_h", 38, 0, 0, ctypes_u16, 0 },
@ -216,31 +225,31 @@ const be_ctypes_structure_t be_lv_draw_image_dsc = {
{ "header_reserved_2", 42, 0, 0, ctypes_u16, 0 },
{ "header_stride", 40, 0, 0, ctypes_u16, 0 },
{ "header_w", 36, 0, 0, ctypes_u16, 0 },
{ "image_area_x1", 84, 0, 0, ctypes_i32, 0 },
{ "image_area_x2", 92, 0, 0, ctypes_i32, 0 },
{ "image_area_y1", 88, 0, 0, ctypes_i32, 0 },
{ "image_area_y2", 96, 0, 0, ctypes_i32, 0 },
{ "opa", 76, 0, 0, ctypes_u8, 0 },
{ "pivot_x", 64, 0, 0, ctypes_i32, 0 },
{ "pivot_y", 68, 0, 0, ctypes_i32, 0 },
{ "recolor", 72, 0, 0, ctypes_u24, 1 },
{ "recolor_opa", 75, 0, 0, ctypes_u8, 0 },
{ "rotation", 44, 0, 0, ctypes_i32, 0 },
{ "scale_x", 48, 0, 0, ctypes_i32, 0 },
{ "scale_y", 52, 0, 0, ctypes_i32, 0 },
{ "skew_x", 56, 0, 0, ctypes_i32, 0 },
{ "skew_y", 60, 0, 0, ctypes_i32, 0 },
{ "image_area_x1", 88, 0, 0, ctypes_i32, 0 },
{ "image_area_x2", 96, 0, 0, ctypes_i32, 0 },
{ "image_area_y1", 92, 0, 0, ctypes_i32, 0 },
{ "image_area_y2", 100, 0, 0, ctypes_i32, 0 },
{ "opa", 80, 0, 0, ctypes_u8, 0 },
{ "pivot_x", 68, 0, 0, ctypes_i32, 0 },
{ "pivot_y", 72, 0, 0, ctypes_i32, 0 },
{ "recolor", 76, 0, 0, ctypes_u24, 1 },
{ "recolor_opa", 79, 0, 0, ctypes_u8, 0 },
{ "rotation", 48, 0, 0, ctypes_i32, 0 },
{ "scale_x", 52, 0, 0, ctypes_i32, 0 },
{ "scale_y", 56, 0, 0, ctypes_i32, 0 },
{ "skew_x", 60, 0, 0, ctypes_i32, 0 },
{ "skew_y", 64, 0, 0, ctypes_i32, 0 },
{ "src", 28, 0, 0, ctypes_ptr32, 0 },
{ "sup", 80, 0, 0, ctypes_ptr32, 0 },
{ "tile", 77, 5, 1, ctypes_bf, 0 },
{ "sup", 84, 0, 0, ctypes_ptr32, 0 },
{ "tile", 81, 5, 1, ctypes_bf, 0 },
}};
const be_ctypes_structure_t be_lv_draw_label_dsc = {
84, /* size in bytes */
26, /* number of elements */
108, /* size in bytes */
35, /* number of elements */
be_ctypes_instance_mappings,
(const be_ctypes_structure_item_t[26]) {
{ "align", 74, 0, 0, ctypes_u8, 0 },
(const be_ctypes_structure_item_t[35]) {
{ "align", 89, 0, 0, ctypes_u8, 0 },
{ "base_dsc_size", 20, 0, 0, ctypes_u32, 0 },
{ "base_id1", 8, 0, 0, ctypes_u32, 0 },
{ "base_id2", 12, 0, 0, ctypes_u32, 0 },
@ -248,24 +257,33 @@ const be_ctypes_structure_t be_lv_draw_label_dsc = {
{ "base_obj", 0, 0, 0, ctypes_ptr32, 0 },
{ "base_part", 4, 0, 0, ctypes_u32, 0 },
{ "base_user_data", 24, 0, 0, ctypes_ptr32, 0 },
{ "bidi_dir", 73, 0, 0, ctypes_u8, 0 },
{ "blend_mode", 76, 3, 3, ctypes_bf, 0 },
{ "bidi_dir", 90, 0, 0, ctypes_u8, 0 },
{ "blend_mode", 93, 0, 3, ctypes_bf, 0 },
{ "color", 44, 0, 0, ctypes_u24, 1 },
{ "decor", 76, 0, 3, ctypes_bf, 0 },
{ "flag", 75, 0, 0, ctypes_u8, 0 },
{ "font", 32, 0, 0, ctypes_ptr32, 0 },
{ "hint", 80, 0, 0, ctypes_ptr32, 0 },
{ "letter_space", 60, 0, 0, ctypes_i32, 0 },
{ "line_space", 56, 0, 0, ctypes_i32, 0 },
{ "ofs_x", 64, 0, 0, ctypes_i32, 0 },
{ "ofs_y", 68, 0, 0, ctypes_i32, 0 },
{ "opa", 72, 0, 0, ctypes_u8, 0 },
{ "sel_bg_color", 50, 0, 0, ctypes_u24, 1 },
{ "sel_color", 47, 0, 0, ctypes_u24, 1 },
{ "sel_end", 40, 0, 0, ctypes_u32, 0 },
{ "sel_start", 36, 0, 0, ctypes_u32, 0 },
{ "decor", 92, 0, 3, ctypes_bf, 0 },
{ "flag", 92, 3, 5, ctypes_bf, 0 },
{ "font", 40, 0, 0, ctypes_ptr32, 0 },
{ "has_bided", 93, 5, 1, ctypes_bf, 0 },
{ "hint", 96, 0, 0, ctypes_ptr32, 0 },
{ "letter_space", 52, 0, 0, ctypes_i32, 0 },
{ "line_space", 48, 0, 0, ctypes_i32, 0 },
{ "ofs_x", 56, 0, 0, ctypes_i32, 0 },
{ "ofs_y", 60, 0, 0, ctypes_i32, 0 },
{ "opa", 88, 0, 0, ctypes_u8, 0 },
{ "outline_stroke_color", 101, 0, 0, ctypes_u24, 1 },
{ "outline_stroke_opa", 100, 0, 0, ctypes_u8, 0 },
{ "outline_stroke_width", 104, 0, 0, ctypes_i32, 0 },
{ "rotation", 64, 0, 0, ctypes_i32, 0 },
{ "sel_bg_color", 79, 0, 0, ctypes_u24, 1 },
{ "sel_color", 76, 0, 0, ctypes_u24, 1 },
{ "sel_end", 72, 0, 0, ctypes_u32, 0 },
{ "sel_start", 68, 0, 0, ctypes_u32, 0 },
{ "text", 28, 0, 0, ctypes_ptr32, 0 },
{ "text_local", 76, 6, 1, ctypes_bf, 0 },
{ "text_length", 84, 0, 0, ctypes_u32, 0 },
{ "text_local", 93, 3, 1, ctypes_bf, 0 },
{ "text_size_x", 32, 0, 0, ctypes_i32, 0 },
{ "text_size_y", 36, 0, 0, ctypes_i32, 0 },
{ "text_static", 93, 4, 1, ctypes_bf, 0 },
}};
const be_ctypes_structure_t be_lv_chart_series = {
@ -334,10 +352,10 @@ const be_ctypes_structure_t be_lv_event = {
}};
const be_ctypes_structure_t be_lv_image_dsc = {
24, /* size in bytes */
10, /* number of elements */
28, /* size in bytes */
11, /* number of elements */
be_ctypes_instance_mappings,
(const be_ctypes_structure_item_t[10]) {
(const be_ctypes_structure_item_t[11]) {
{ "data", 16, 0, 0, ctypes_ptr32, 0 },
{ "data_size", 12, 0, 0, ctypes_u32, 0 },
{ "header_cf", 1, 0, 0, ctypes_u8, 0 },
@ -348,6 +366,7 @@ const be_ctypes_structure_t be_lv_image_dsc = {
{ "header_stride", 8, 0, 0, ctypes_u16, 0 },
{ "header_w", 4, 0, 0, ctypes_u16, 0 },
{ "reserved", 20, 0, 0, ctypes_ptr32, 0 },
{ "reserved_2", 24, 0, 0, ctypes_ptr32, 0 },
}};
const be_ctypes_structure_t be_lv_style_transition_dsc = {
@ -363,10 +382,10 @@ const be_ctypes_structure_t be_lv_style_transition_dsc = {
}};
const be_ctypes_structure_t be_lv_layer = {
72, /* size in bytes */
18, /* number of elements */
84, /* size in bytes */
21, /* number of elements */
be_ctypes_instance_mappings,
(const be_ctypes_structure_item_t[18]) {
(const be_ctypes_structure_item_t[21]) {
{ "_clip_area_x1", 24, 0, 0, ctypes_i32, 0 },
{ "_clip_area_x2", 32, 0, 0, ctypes_i32, 0 },
{ "_clip_area_y1", 28, 0, 0, ctypes_i32, 0 },
@ -377,14 +396,17 @@ const be_ctypes_structure_t be_lv_layer = {
{ "buf_area_y2", 16, 0, 0, ctypes_i32, 0 },
{ "color_format", 20, 0, 0, ctypes_u32, 0 },
{ "draw_buf", 0, 0, 0, ctypes_ptr32, 0 },
{ "draw_task_head", 56, 0, 0, ctypes_ptr32, 0 },
{ "next", 64, 0, 0, ctypes_ptr32, 0 },
{ "parent", 60, 0, 0, ctypes_ptr32, 0 },
{ "draw_task_head", 68, 0, 0, ctypes_ptr32, 0 },
{ "next", 76, 0, 0, ctypes_ptr32, 0 },
{ "opa", 56, 0, 0, ctypes_u8, 0 },
{ "parent", 72, 0, 0, ctypes_ptr32, 0 },
{ "partial_y_offset", 64, 0, 0, ctypes_i32, 0 },
{ "phy_clip_area_x1", 40, 0, 0, ctypes_i32, 0 },
{ "phy_clip_area_x2", 48, 0, 0, ctypes_i32, 0 },
{ "phy_clip_area_y1", 44, 0, 0, ctypes_i32, 0 },
{ "phy_clip_area_y2", 52, 0, 0, ctypes_i32, 0 },
{ "user_data", 68, 0, 0, ctypes_ptr32, 0 },
{ "recolor", 60, 0, 0, ctypes_u32, 0 },
{ "user_data", 80, 0, 0, ctypes_ptr32, 0 },
}};
const be_ctypes_structure_t be_lv_color_filter_dsc = {
@ -432,6 +454,68 @@ const be_ctypes_structure_t be_lv_ts_calibration = {
{ "y", 12, 0, 0, ctypes_i32, 0 },
}};
const be_ctypes_structure_t be_lv_span_coords = {
48, /* size in bytes */
12, /* number of elements */
be_ctypes_instance_mappings,
(const be_ctypes_structure_item_t[12]) {
{ "heading_x1", 0, 0, 0, ctypes_i32, 0 },
{ "heading_x2", 8, 0, 0, ctypes_i32, 0 },
{ "heading_y1", 4, 0, 0, ctypes_i32, 0 },
{ "heading_y2", 12, 0, 0, ctypes_i32, 0 },
{ "middle_x1", 16, 0, 0, ctypes_i32, 0 },
{ "middle_x2", 24, 0, 0, ctypes_i32, 0 },
{ "middle_y1", 20, 0, 0, ctypes_i32, 0 },
{ "middle_y2", 28, 0, 0, ctypes_i32, 0 },
{ "trailing_x1", 32, 0, 0, ctypes_i32, 0 },
{ "trailing_x2", 40, 0, 0, ctypes_i32, 0 },
{ "trailing_y1", 36, 0, 0, ctypes_i32, 0 },
{ "trailing_y2", 44, 0, 0, ctypes_i32, 0 },
}};
const be_ctypes_structure_t be_lv_font_info = {
24, /* size in bytes */
6, /* number of elements */
be_ctypes_instance_mappings,
(const be_ctypes_structure_item_t[6]) {
{ "class_p", 4, 0, 0, ctypes_ptr32, 0 },
{ "kerning", 20, 0, 0, ctypes_u32, 0 },
{ "name", 0, 0, 0, ctypes_ptr32, 0 },
{ "render_mode", 12, 0, 0, ctypes_u32, 0 },
{ "size", 8, 0, 0, ctypes_u32, 0 },
{ "style", 16, 0, 0, ctypes_u32, 0 },
}};
const be_ctypes_structure_t be_lv_draw_letter_dsc = {
80, /* size in bytes */
23, /* number of elements */
be_ctypes_instance_mappings,
(const be_ctypes_structure_item_t[23]) {
{ "base_dsc_size", 20, 0, 0, ctypes_u32, 0 },
{ "base_id1", 8, 0, 0, ctypes_u32, 0 },
{ "base_id2", 12, 0, 0, ctypes_u32, 0 },
{ "base_layer", 16, 0, 0, ctypes_ptr32, 0 },
{ "base_obj", 0, 0, 0, ctypes_ptr32, 0 },
{ "base_part", 4, 0, 0, ctypes_u32, 0 },
{ "base_user_data", 24, 0, 0, ctypes_ptr32, 0 },
{ "blend_mode", 69, 3, 3, ctypes_bf, 0 },
{ "color", 36, 0, 0, ctypes_u24, 1 },
{ "decor", 69, 0, 3, ctypes_bf, 0 },
{ "font", 32, 0, 0, ctypes_ptr32, 0 },
{ "opa", 68, 0, 0, ctypes_u8, 0 },
{ "outline_stroke_color", 76, 0, 0, ctypes_u24, 1 },
{ "outline_stroke_opa", 70, 0, 0, ctypes_u8, 0 },
{ "outline_stroke_width", 72, 0, 0, ctypes_i32, 0 },
{ "pivot_x", 60, 0, 0, ctypes_i32, 0 },
{ "pivot_y", 64, 0, 0, ctypes_i32, 0 },
{ "rotation", 40, 0, 0, ctypes_i32, 0 },
{ "scale_x", 44, 0, 0, ctypes_i32, 0 },
{ "scale_y", 48, 0, 0, ctypes_i32, 0 },
{ "skew_x", 52, 0, 0, ctypes_i32, 0 },
{ "skew_y", 56, 0, 0, ctypes_i32, 0 },
{ "unicode", 28, 0, 0, ctypes_u32, 0 },
}};
static const char * be_ctypes_instance_mappings[] = {
"lv.color",
NULL
@ -445,11 +529,14 @@ static be_define_ctypes_class(lv_draw_arc_dsc, &be_lv_draw_arc_dsc, &be_class_ct
static be_define_ctypes_class(lv_draw_dsc_base, &be_lv_draw_dsc_base, &be_class_ctypes_bytes, "lv_draw_dsc_base");
static be_define_ctypes_class(lv_draw_image_dsc, &be_lv_draw_image_dsc, &be_class_ctypes_bytes, "lv_draw_image_dsc");
static be_define_ctypes_class(lv_draw_label_dsc, &be_lv_draw_label_dsc, &be_class_ctypes_bytes, "lv_draw_label_dsc");
static be_define_ctypes_class(lv_draw_letter_dsc, &be_lv_draw_letter_dsc, &be_class_ctypes_bytes, "lv_draw_letter_dsc");
static be_define_ctypes_class(lv_draw_line_dsc, &be_lv_draw_line_dsc, &be_class_ctypes_bytes, "lv_draw_line_dsc");
static be_define_ctypes_class(lv_draw_rect_dsc, &be_lv_draw_rect_dsc, &be_class_ctypes_bytes, "lv_draw_rect_dsc");
static be_define_ctypes_class(lv_event, &be_lv_event, &be_class_ctypes_bytes, "lv_event");
static be_define_ctypes_class(lv_event_dsc, &be_lv_event_dsc, &be_class_ctypes_bytes, "lv_event_dsc");
static be_define_ctypes_class(lv_font_info, &be_lv_font_info, &be_class_ctypes_bytes, "lv_font_info");
static be_define_ctypes_class(lv_grad_dsc, &be_lv_grad_dsc, &be_class_ctypes_bytes, "lv_grad_dsc");
static be_define_ctypes_class(lv_grad_stop, &be_lv_grad_stop, &be_class_ctypes_bytes, "lv_grad_stop");
static be_define_ctypes_class(lv_gradient_stop, &be_lv_gradient_stop, &be_class_ctypes_bytes, "lv_gradient_stop");
static be_define_ctypes_class(lv_image_dsc, &be_lv_image_dsc, &be_class_ctypes_bytes, "lv_image_dsc");
static be_define_ctypes_class(lv_image_header, &be_lv_image_header, &be_class_ctypes_bytes, "lv_image_header");
@ -457,6 +544,7 @@ static be_define_ctypes_class(lv_layer, &be_lv_layer, &be_class_ctypes_bytes, "l
static be_define_ctypes_class(lv_obj_class, &be_lv_obj_class, &be_class_ctypes_bytes, "lv_obj_class");
static be_define_ctypes_class(lv_point, &be_lv_point, &be_class_ctypes_bytes, "lv_point");
static be_define_ctypes_class(lv_point_precise, &be_lv_point_precise, &be_class_ctypes_bytes, "lv_point_precise");
static be_define_ctypes_class(lv_span_coords, &be_lv_span_coords, &be_class_ctypes_bytes, "lv_span_coords");
static be_define_ctypes_class(lv_style_transition_dsc, &be_lv_style_transition_dsc, &be_class_ctypes_bytes, "lv_style_transition_dsc");
static be_define_ctypes_class(lv_timer_ntv, &be_lv_timer_ntv, &be_class_ctypes_bytes, "lv_timer_ntv");
static be_define_ctypes_class(lv_ts_calibration, &be_lv_ts_calibration, &be_class_ctypes_bytes, "lv_ts_calibration");
@ -470,11 +558,14 @@ be_ctypes_class_by_name_t be_ctypes_lvgl_classes[] = {
{ "lv_draw_dsc_base", &be_class_lv_draw_dsc_base },
{ "lv_draw_image_dsc", &be_class_lv_draw_image_dsc },
{ "lv_draw_label_dsc", &be_class_lv_draw_label_dsc },
{ "lv_draw_letter_dsc", &be_class_lv_draw_letter_dsc },
{ "lv_draw_line_dsc", &be_class_lv_draw_line_dsc },
{ "lv_draw_rect_dsc", &be_class_lv_draw_rect_dsc },
{ "lv_event", &be_class_lv_event },
{ "lv_event_dsc", &be_class_lv_event_dsc },
{ "lv_font_info", &be_class_lv_font_info },
{ "lv_grad_dsc", &be_class_lv_grad_dsc },
{ "lv_grad_stop", &be_class_lv_grad_stop },
{ "lv_gradient_stop", &be_class_lv_gradient_stop },
{ "lv_image_dsc", &be_class_lv_image_dsc },
{ "lv_image_header", &be_class_lv_image_header },
@ -482,6 +573,7 @@ be_ctypes_class_by_name_t be_ctypes_lvgl_classes[] = {
{ "lv_obj_class", &be_class_lv_obj_class },
{ "lv_point", &be_class_lv_point },
{ "lv_point_precise", &be_class_lv_point_precise },
{ "lv_span_coords", &be_class_lv_span_coords },
{ "lv_style_transition_dsc", &be_class_lv_style_transition_dsc },
{ "lv_timer_ntv", &be_class_lv_timer_ntv },
{ "lv_ts_calibration", &be_class_lv_ts_calibration },

View File

@ -18,6 +18,7 @@ ct.print_types()
lv_style_int = ct.i16
lv_color = [ct.u24, "lv.color"] # cast to the class instance, constructor is called with 2 args: (nil, value)
lv_color32 = ct.u32
lv_grad_dir = ct.u8
lv_meter_indicator_type_t = ct.u8
lv_opa = ct.u8
@ -51,7 +52,7 @@ int32_t = ct.i32
size_t = ct.u32
ptr = ct.ptr32
lv_point = [ # valid LVGL92
lv_point = [ # valid LVGL93
[int32_t, "x"],
[int32_t, "y"],
]
@ -61,13 +62,13 @@ lv_point = ct.structure(lv_point, "lv_point")
# lv_value_precise_t x;
# lv_value_precise_t y;
# } lv_point_precise_t;
lv_point_precise = [ # valid LVGL92
lv_point_precise = [ # valid LVGL93
[lv_value_precise, "x"],
[lv_value_precise, "y"],
]
lv_point_precise = ct.structure(lv_point_precise, "lv_point_precise")
lv_area = [ # valid LVGL92
lv_area = [ # valid LVGL93
[int32_t, "x1"],
[int32_t, "y1"],
[int32_t, "x2"],
@ -81,24 +82,49 @@ lv_area = ct.structure(lv_area, "lv_area")
# lv_color_t color; /**< The stop color */
# lv_opa_t opa; /**< The opacity of the color*/
# uint8_t frac; /**< The stop position in 1/255 unit */
# } lv_gradient_stop_t;
lv_gradient_stop = [ # valid LVGL92
# } lv_grad_stop_t;
lv_gradient_stop = [ # valid LVGL93
[lv_color, "color"],
[lv_opa, "opa"],
[uint8_t, "frac"],
]
lv_grad_stop = ct.structure(lv_gradient_stop, "lv_grad_stop")
lv_gradient_stop = ct.structure(lv_gradient_stop, "lv_gradient_stop")
# typedef struct {
# lv_gradient_stop_t stops[LV_GRADIENT_MAX_STOPS]; /**< A gradient stop array */
# uint8_t stops_count; /**< The number of used stops in the array */
# lv_grad_dir_t dir : 3; /**< The gradient direction.
# lv_grad_stop_t stops[LV_GRADIENT_MAX_STOPS]; /**< A gradient stop array */
# uint8_t stops_count; /**< The number of used stops in the array */
# lv_grad_dir_t dir : 4; /**< The gradient direction.
# * Any of LV_GRAD_DIR_NONE, LV_GRAD_DIR_VER, LV_GRAD_DIR_HOR,
# * LV_GRAD_TYPE_LINEAR, LV_GRAD_TYPE_RADIAL, LV_GRAD_TYPE_CONICAL */
# lv_grad_extend_t extend : 2; /**< Behaviour outside the defined range.
# * Any of LV_GRAD_DIR_HOR, LV_GRAD_DIR_VER, LV_GRAD_DIR_NONE */
# lv_grad_extend_t extend : 3; /**< Behaviour outside the defined range.
# * LV_GRAD_EXTEND_NONE, LV_GRAD_EXTEND_PAD, LV_GRAD_EXTEND_REPEAT, LV_GRAD_EXTEND_REFLECT */
# #if LV_USE_DRAW_SW_COMPLEX_GRADIENTS
# union {
# /*Linear gradient parameters*/
# struct {
# lv_point_t start; /**< Linear gradient vector start point */
# lv_point_t end; /**< Linear gradient vector end point */
# } linear;
# /*Radial gradient parameters*/
# struct {
# lv_point_t focal; /**< Center of the focal (starting) circle in local coordinates */
# /* (can be the same as the ending circle to create concentric circles) */
# lv_point_t focal_extent; /**< Point on the circle (can be the same as the center) */
# lv_point_t end; /**< Center of the ending circle in local coordinates */
# lv_point_t end_extent; /**< Point on the circle determining the radius of the gradient */
# } radial;
# /*Conical gradient parameters*/
# struct {
# lv_point_t center; /**< Conical gradient center point */
# int16_t start_angle; /**< Start angle 0..3600 */
# int16_t end_angle; /**< End angle 0..3600 */
# } conical;
# } params;
# void * state;
# #endif
# } lv_grad_dsc_t;
lv_grad_dsc = [ # valid LVGL92
lv_grad_dsc = [ # valid LVGL93
# since it's an array and not two structures, we need to explicitly unroll it here or the alignment is wrong
# [lv_gradient_stop, "stops_0"],
[lv_color, "stops_0_color"],
@ -110,22 +136,35 @@ lv_grad_dsc = [ # valid LVGL92
[uint8_t, "stops_1_frac"],
[uint8_t, "stops_count"],
[uint8_t_3, "dir"],
[uint8_t_2, "extend"],
[uint8_t_4, "dir"],
[uint8_t_3, "extend"],
]
lv_grad_dsc = ct.structure(lv_grad_dsc, "lv_grad_dsc")
# typedef struct {
# /**The widget for which draw descriptor was created */
# lv_obj_t * obj;
# uint32_t part;
# /**The widget part for which draw descriptor was created */
# lv_part_t part;
# /**A widget type specific ID (e.g. table row index). See the docs of the given widget.*/
# uint32_t id1;
# /**A widget type specific ID (e.g. table column index). See the docs of the given widget.*/
# uint32_t id2;
# /**The target layer */
# lv_layer_t * layer;
# /**Size of the specific draw descriptor into which this base descriptor is embedded*/
# size_t dsc_size;
# /**Any custom user data*/
# void * user_data;
# } lv_draw_dsc_base_t;
lv_draw_dsc_base = [ # valid LVGL92
lv_draw_dsc_base = [ # valid LVGL93
[ptr, "obj"],
[uint32_t, "part"],
[uint32_t, "id1"],
@ -175,7 +214,7 @@ lv_draw_dsc_base = ct.structure(lv_draw_dsc_base, "lv_draw_dsc_base")
# int32_t shadow_spread;
# lv_opa_t shadow_opa;
# } lv_draw_rect_dsc_t;
lv_draw_rect_dsc = [ # valid LVGL92
lv_draw_rect_dsc = [ # valid LVGL93
[lv_draw_dsc_base, "base"],
[int32_t, "radius"],
@ -219,19 +258,38 @@ lv_draw_rect_dsc = ct.structure(lv_draw_rect_dsc, "lv_draw_rect_dsc")
# typedef struct {
# lv_draw_dsc_base_t base;
# /**The first point of the line. If `LV_USE_FLOAT` is enabled float number can be also used*/
# lv_point_precise_t p1;
# /**The second point of the line. If `LV_USE_FLOAT` is enabled float number can be also used*/
# lv_point_precise_t p2;
# /**The color of the line*/
# lv_color_t color;
# /**The width (thickness) of the line*/
# int32_t width;
# /** The length of a dash (0: don't dash)*/
# int32_t dash_width;
# /** The length of the gaps between dashes (0: don't dash)*/
# int32_t dash_gap;
# /**Opacity of the line in 0...255 range.
# * LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/
# lv_opa_t opa;
# lv_blend_mode_t blend_mode : 2;
# /**Make the line start rounded*/
# uint8_t round_start : 1;
# /**Make the line end rounded*/
# uint8_t round_end : 1;
# uint8_t raw_end : 1; /*Do not bother with perpendicular line ending if it's not visible for any reason*/
# /**1: Do not bother with line ending (if it's not visible for any reason) */
# uint8_t raw_end : 1;
# } lv_draw_line_dsc_t;
lv_draw_line_dsc = [ # valid LVGL92
lv_draw_line_dsc = [ # valid LVGL93
[lv_draw_dsc_base, "base"],
[lv_point_precise, "p1"],
@ -241,7 +299,6 @@ lv_draw_line_dsc = [ # valid LVGL92
[int32_t, "dash_width"],
[int32_t, "dash_gap"],
[lv_opa, "opa"],
[uint8_t_2, "blend_mode"],
[uint8_t_1, "round_start"],
[uint8_t_1, "round_end"],
[uint8_t_1, "raw_end"],
@ -251,17 +308,36 @@ lv_draw_line_dsc = ct.structure(lv_draw_line_dsc, "lv_draw_line_dsc")
# typedef struct {
# lv_draw_dsc_base_t base;
# /**The color of the arc*/
# lv_color_t color;
# /**The width (thickness) of the arc */
# int32_t width;
# /**The start angle in 1 degree units (if `LV_USE_FLOAT` is enabled a float number can be also used)
# * 0° is the 3 o'clock position, 90° is the 6 o'clock, etc. */
# lv_value_precise_t start_angle;
# /**The end angle, similarly to start_angle. */
# lv_value_precise_t end_angle;
# /**The center point of the arc. */
# lv_point_t center;
# /**The outer radius of the arc*/
# uint16_t radius;
# /**An image source to be used instead of `color`. `NULL` if unused*/
# const void * img_src;
# /**Opacity of the arc in 0...255 range.
# * LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/
# lv_opa_t opa;
# /**1: Make the arc ends rounded*/
# uint8_t rounded : 1;
# } lv_draw_arc_dsc_t;
lv_draw_arc_dsc = [ # valid LVGL92
lv_draw_arc_dsc = [ # valid LVGL93
[lv_draw_dsc_base, "base"],
[lv_color, "color"],
@ -278,16 +354,16 @@ lv_draw_arc_dsc = ct.structure(lv_draw_arc_dsc, "lv_draw_arc_dsc")
# typedef struct {
# uint32_t magic: 8; /*Magic number. Must be LV_IMAGE_HEADER_MAGIC*/
# uint32_t cf : 8; /*Color format: See `lv_color_format_t`*/
# uint32_t flags: 16; /*Image flags, see `lv_image_flags_t`*/
# uint32_t magic: 8; /**< Magic number. Must be LV_IMAGE_HEADER_MAGIC*/
# uint32_t cf : 8; /**< Color format: See `lv_color_format_t`*/
# uint32_t flags: 16; /**< Image flags, see `lv_image_flags_t`*/
# uint32_t w: 16;
# uint32_t h: 16;
# uint32_t stride: 16; /*Number of bytes in a row*/
# uint32_t reserved_2: 16; /*Reserved to be used later*/
# uint32_t stride: 16; /**< Number of bytes in a row*/
# uint32_t reserved_2: 16; /**< Reserved to be used later*/
# } lv_image_header_t;
lv_image_header = [ # valid LVGL92
lv_image_header = [ # valid LVGL93
[uint8_t, "magic"],
[uint8_t, "cf"],
[uint16_t, "flags"],
@ -299,40 +375,83 @@ lv_image_header = [ # valid LVGL92
]
lv_image_header = ct.structure(lv_image_header, "lv_image_header")
# typedef struct _lv_draw_image_dsc_t {
# struct _lv_draw_image_dsc_t {
# lv_draw_dsc_base_t base;
# /**The image source: pointer to `lv_image_dsc_t` or a path to a file*/
# const void * src;
# /**The header of the image. Initialized internally in `lv_draw_image` */
# lv_image_header_t header;
# /**Clip the corner of the image with this radius. Use `LV_RADIUS_CIRCLE` for max. radius */
# int32_t clip_radius;
# /**The rotation of the image in 0.1 degree unit. E.g. 234 means 23.4° */
# int32_t rotation;
# /**Horizontal scale (zoom) of the image.
# * 256 (LV_SCALE_NONE): means no zoom, 512 double size, 128 half size.*/
# int32_t scale_x;
# /**Same as `scale_y` but vertically*/
# int32_t scale_y;
# /**Parallelogram like transformation of the image horizontally in 0.1 degree unit. E.g. 456 means 45.6°.*/
# int32_t skew_x;
# /**Same as `skew_x` but vertically*/
# int32_t skew_y;
# /**The pivot point of transformation (scale and rotation).
# * 0;0 is the top left corner of the image. Can be outside of the image too.*/
# lv_point_t pivot;
# /**Mix this color to the images. In case of `LV_COLOR_FORMAT_A8` it will be the color of the visible pixels*/
# lv_color_t recolor;
# /**The intensity of recoloring. 0 means, no recolor, 255 means full cover (transparent pixels remain transparent)*/
# lv_opa_t recolor_opa;
# /**Opacity in 0...255 range.
# * LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/
# lv_opa_t opa;
# /**Describes how to blend the pixels of the image to the background.
# * See `lv_blend_mode_t` for more details.
# */
# lv_blend_mode_t blend_mode : 4;
# /**1: perform the transformation with anti-alaising */
# uint16_t antialias : 1;
# /**If the image is smaller than the `image_area` field of `lv_draw_image_dsc_t`
# * tile the image (repeat is both horizontally and vertically) to fill the
# * `image_area` area*/
# uint16_t tile : 1;
# /**Used internally to store some information about the palette or the color of A8 images*/
# lv_draw_image_sup_t * sup;
# /** Might be used to indicate the original size of the image if only a small portion is rendered now.
# * Used when a part of a layer is rendered to show the total layer size*/
# lv_area_t original_area;
# /** Used to indicate the entire original, non-clipped area where the image is to be drawn.
# * This is important for:
# * 1. Layer rendering, where it might happen that only a smaller area of the layer is rendered and e.g.
# * `clip_radius` needs to know what the original image was.
# * 2. Tiled images, where the target draw area is larger than the image to be tiled.
# */
# lv_area_t image_area;
# /**Pointer to an A8 or L8 image descriptor to mask the image with.
# * The mask is always center aligned. */
# const lv_image_dsc_t * bitmap_mask_src;
# } lv_draw_image_dsc_t;
lv_draw_image_dsc = [ # valid LVGL92
# };
lv_draw_image_dsc = [ # valid LVGL93
[lv_draw_dsc_base, "base"],
[ptr, "src"],
[lv_image_header, "header"],
[int32_t, "clip_radius"],
[int32_t, "rotation"],
[int32_t, "scale_x"],
[int32_t, "scale_y"],
@ -350,62 +469,126 @@ lv_draw_image_dsc = [ # valid LVGL92
[ptr, "sup"],
[lv_area, "image_area"],
[int32_t, "clip_radius"],
[ptr, "bitmap_mask_src"],
]
lv_draw_image_dsc = ct.structure(lv_draw_image_dsc, "lv_draw_image_dsc")
# typedef struct {
# lv_draw_dsc_base_t base;
# /**The text to draw*/
# const char * text;
# /**The size of the text*/
# lv_point_t text_size;
# /**The font to use. Fallback fonts are also handled.*/
# const lv_font_t * font;
# uint32_t sel_start;
# uint32_t sel_end;
# /**Color of the text*/
# lv_color_t color;
# lv_color_t sel_color;
# lv_color_t sel_bg_color;
# /**Extra space between the lines*/
# int32_t line_space;
# /**Extra space between the characters*/
# int32_t letter_space;
# /**Offset the text with this value horizontally*/
# int32_t ofs_x;
# /**Offset the text with this value vertically*/
# int32_t ofs_y;
# /**Rotation of the letters in 0.1 degree unit*/
# int32_t rotation;
# /**The first characters index for selection (not byte index). `LV_DRAW_LABEL_NO_TXT_SEL` for no selection*/
# uint32_t sel_start;
# /**The last characters's index for selection (not byte index). `LV_DRAW_LABEL_NO_TXT_SEL` for no selection*/
# uint32_t sel_end;
# /**Color of the selected characters*/
# lv_color_t sel_color;
# /**Background color of the selected characters*/
# lv_color_t sel_bg_color;
# /**The number of characters to render. 0: means render until reaching the `\0` termination.*/
# uint32_t text_length;
# /**Opacity of the text in 0...255 range.
# * LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/
# lv_opa_t opa;
# lv_base_dir_t bidi_dir;
# /**The alignment of the text `LV_TEXT_ALIGN_LEFT/RIGHT/CENTER`*/
# lv_text_align_t align;
# lv_text_flag_t flag;
# /**The base direction. Used when type setting Right-to-left (e.g. Arabic) texts*/
# lv_base_dir_t bidi_dir;
# /**Text decoration, e.g. underline*/
# lv_text_decor_t decor : 3;
# lv_blend_mode_t blend_mode : 3;
# /**
# * < 1: malloc buffer and copy `text` there.
# * 0: `text` is const and it's pointer will be valid during rendering.*/
# /**Some flags to control type setting*/
# lv_text_flag_t flag : 5;
# /**1: malloc a buffer and copy `text` there.
# * 0: `text` will be valid during rendering.*/
# uint8_t text_local : 1;
# /**Indicate that the text is constant and its pointer can be safely saved e.g. in a cache.*/
# uint8_t text_static : 1;
# /**1: already executed lv_bidi_process_paragraph.
# * 0: has not been executed lv_bidi_process_paragraph.*/
# uint8_t has_bided : 1;
# /**Pointer to an externally stored struct where some data can be cached to speed up rendering*/
# lv_draw_label_hint_t * hint;
# /* Properties of the letter outlines */
# lv_opa_t outline_stroke_opa;
# lv_color_t outline_stroke_color;
# int32_t outline_stroke_width;
# } lv_draw_label_dsc_t;
lv_draw_label_dsc = [ # valid LVGL92
lv_draw_label_dsc = [ # valid LVGL93
[lv_draw_dsc_base, "base"],
[ptr, "text"],
[lv_point, "text_size"],
[ptr, "font"],
[uint32_t, "sel_start"],
[uint32_t, "sel_end"],
[lv_color, "color"],
[lv_color, "sel_color"],
[lv_color, "sel_bg_color"],
[int32_t, "line_space"],
[int32_t, "letter_space"],
[int32_t, "ofs_x"],
[int32_t, "ofs_y"],
[int32_t, "rotation"],
[uint32_t, "sel_start"],
[uint32_t, "sel_end"],
[lv_color, "sel_color"],
[lv_color, "sel_bg_color"],
[uint32_t, "text_length"],
[lv_opa, "opa"],
[lv_base_dir, "bidi_dir"],
[lv_text_align, "align"],
[lv_base_dir, "bidi_dir"],
[lv_text_flag, "flag"],
[uint8_t_3, "decor"],
[uint8_t_5, "flag"],
[uint8_t_3, "blend_mode"],
[uint8_t_1, "text_local"],
[uint8_t_1, "text_static"],
[uint8_t_1, "has_bided"],
[ptr, "hint"],
[lv_opa, "outline_stroke_opa"],
[lv_color, "outline_stroke_color"],
[int32_t, "outline_stroke_width"],
]
lv_draw_label_dsc = ct.structure(lv_draw_label_dsc, "lv_draw_label_dsc")
# typedef struct {
# struct _lv_chart_series_t {
# int32_t * x_points;
# int32_t * y_points;
# lv_color_t color;
@ -415,8 +598,8 @@ lv_draw_label_dsc = ct.structure(lv_draw_label_dsc, "lv_draw_label_dsc")
# uint32_t y_ext_buf_assigned : 1;
# uint32_t x_axis_sec : 1;
# uint32_t y_axis_sec : 1;
# } lv_chart_series_t;
lv_chart_series = [ # valid LVGL92
# };
lv_chart_series = [ # valid LVGL93
[ptr, "x_points"],
[ptr, "y_points"],
[lv_color, "color"],
@ -429,15 +612,15 @@ lv_chart_series = [ # valid LVGL92
]
lv_chart_series = ct.structure(lv_chart_series, "lv_chart_series")
# typedef struct {
# struct _lv_chart_cursor_t {
# lv_point_t pos;
# int32_t point_id;
# lv_color_t color;
# lv_chart_series_t * ser;
# lv_dir_t dir;
# uint32_t pos_set: 1; /*1: pos is set; 0: point_id is set*/
# } lv_chart_cursor_t;
lv_chart_cursor = [ # valid LVGL92
# uint32_t pos_set: 1; /**< 1: pos is set; 0: point_id is set */
# };
lv_chart_cursor = [ # valid LVGL93
[lv_point, "pos"],
[int32_t, "point_id"],
[lv_color, "color"],
@ -457,15 +640,28 @@ event_cb = ptr # callback
lv_event_code = ct.i32
# struct lv_obj_class_t {
# struct _lv_obj_class_t {
# const lv_obj_class_t * base_class;
# /** class_p is the final class while obj->class_p is the class currently being [de]constructed. */
# void (*constructor_cb)(const lv_obj_class_t * class_p, lv_obj_t * obj);
# void (*destructor_cb)(const lv_obj_class_t * class_p, lv_obj_t * obj);
#
# /** class_p is the class in which event is being processed. */
# void (*event_cb)(const lv_obj_class_t * class_p, lv_event_t * e); /**< Widget type specific event function*/
#
# #if LV_USE_OBJ_PROPERTY
# uint32_t prop_index_start;
# uint32_t prop_index_end;
# const lv_property_ops_t * properties;
# uint32_t properties_count;
# #if LV_USE_OBJ_PROPERTY_NAME
# /* An array of property ID and name */
# const lv_property_name_t * property_names;
# uint32_t names_count;
# #endif
# #endif
# void * user_data;
# const char * name;
# int32_t width_def;
@ -475,7 +671,7 @@ lv_event_code = ct.i32
# uint32_t instance_size : 16;
# uint32_t theme_inheritable : 1; /**< Value from ::lv_obj_class_theme_inheritable_t*/
# };
lv_obj_class = [ # valid LVGL92
lv_obj_class = [ # valid LVGL93
[lv_obj_class_ptr, "base_class"],
[constructor_cb, "constructor_cb"],
[destructor_cb, "destructor_cb"],
@ -491,7 +687,7 @@ lv_obj_class = [ # valid LVGL92
]
lv_obj_class = ct.structure(lv_obj_class, "lv_obj_class")
# struct lv_event_t {
# struct _lv_event_t {
# void * current_target;
# void * original_target;
# lv_event_code_t code;
@ -502,7 +698,7 @@ lv_obj_class = ct.structure(lv_obj_class, "lv_obj_class")
# uint8_t stop_processing : 1;
# uint8_t stop_bubbling : 1;
# };
lv_event = [ # valid LVGL92
lv_event = [ # valid LVGL93
[lv_obj_ptr, "current_target"],
[lv_obj_ptr, "original_target"],
[lv_event_code, "code"],
@ -523,12 +719,14 @@ lv_event = ct.structure(lv_event, "lv_event")
# uint32_t data_size; /**< Size of the image in bytes*/
# const uint8_t * data; /**< Pointer to the data of the image*/
# const void * reserved; /**< A reserved field to make it has same size as lv_draw_buf_t*/
# const void * reserved_2; /**< A reserved field to make it has same size as lv_draw_buf_t*/
# } lv_image_dsc_t;
lv_image_dsc = [ # valid LVGL92
lv_image_dsc = [ # valid LVGL93
[lv_image_header, "header"],
[uint32_t, "data_size"],
[ptr, "data"],
[ptr, "reserved"],
[ptr, "reserved_2"],
]
lv_image_dsc = ct.structure(lv_image_dsc, "lv_image_dsc")
@ -538,11 +736,11 @@ lv_image_dsc = ct.structure(lv_image_dsc, "lv_image_dsc")
# typedef struct {
# const lv_style_prop_t * props; /**< An array with the properties to animate.*/
# void * user_data; /**< A custom user data that will be passed to the animation's user_data */
# lv_anim_path_cb_t path_xcb; /**< A path for the animation.*/
# lv_anim_path_cb_t path_xcb; /**< A path for the animation.*/
# uint32_t time; /**< Duration of the transition in [ms]*/
# uint32_t delay; /**< Delay before the transition in [ms]*/
# } lv_style_transition_dsc_t;
lv_style_transition_dsc = [ # valid LVGL92
lv_style_transition_dsc = [ # valid LVGL93
[ptr, "props"],
[ptr, "user_data"],
[ptr, "path_xcb"],
@ -552,17 +750,17 @@ lv_style_transition_dsc = [ # valid LVGL92
lv_style_transition_dsc = ct.structure(lv_style_transition_dsc, "lv_style_transition_dsc")
# struct lv_layer_t {
#
# struct _lv_layer_t {
# /** Target draw buffer of the layer*/
# lv_draw_buf_t * draw_buf;
#
# /** The absolute coordinates of the buffer */
# lv_area_t buf_area;
#
# /** The color format of the layer. LV_COLOR_FORMAT_... */
# lv_color_format_t color_format;
#
# /**
# * NEVER USE IT DRAW UNITS. USED INTERNALLY DURING DRAW TASK CREATION.
# * The current clip area with absolute coordinates, always the same or smaller than `buf_area`
@ -572,31 +770,43 @@ lv_style_transition_dsc = ct.structure(lv_style_transition_dsc, "lv_style_transi
# * During drawing the layer's clip area shouldn't be used as it might be already changed for other draw tasks.
# */
# lv_area_t _clip_area;
#
# /**
# * The physical clipping area relative to the display.
# */
# lv_area_t phy_clip_area;
#
# #if LV_DRAW_TRANSFORM_USE_MATRIX
# /** Transform matrix to be applied when rendering the layer */
# lv_matrix_t matrix;
# #endif
#
# /** Opacity of the layer */
# lv_opa_t opa;
# /*Recolor of the layer*/
# lv_color32_t recolor;
# /** Partial y offset */
# int32_t partial_y_offset;
# /** Linked list of draw tasks */
# lv_draw_task_t * draw_task_head;
#
# lv_layer_t * parent;
# lv_layer_t * next;
# bool all_tasks_added;
# void * user_data;
# };
lv_layer = [ # valid LVGL92
lv_layer = [ # valid LVGL93
[ptr, "draw_buf"],
[lv_area, "buf_area"],
[uint32_t, "color_format"],
[lv_area, "_clip_area"],
[lv_area, "phy_clip_area"],
[lv_opa, "opa"],
[lv_color32, "recolor"],
[int32_t, "partial_y_offset"],
[ptr, "draw_task_head"],
[ptr, "parent"],
[ptr, "next"],
@ -608,11 +818,11 @@ lv_layer = ct.structure(lv_layer, "lv_layer")
#######################################################################
# lv_color
# typedef struct _lv_color_filter_dsc_t {
# struct _lv_color_filter_dsc_t {
# lv_color_filter_cb_t filter_cb;
# void * user_data;
# } lv_color_filter_dsc_t;
lv_color_filter_dsc = [ # valid LVGL92
# };
lv_color_filter_dsc = [ # valid LVGL93
[ptr, "filter_cb"],
[ptr, "user_data"],
]
@ -621,7 +831,7 @@ lv_color_filter_dsc = ct.structure(lv_color_filter_dsc, "lv_color_filter_dsc")
#######################################################################
# lv_timer native, superseded by lv_timer
# struct lv_timer_t {
# struct _lv_timer_t {
# uint32_t period; /**< How often the timer should run */
# uint32_t last_run; /**< Last time the timer ran */
# lv_timer_cb_t timer_cb; /**< Timer function */
@ -630,7 +840,7 @@ lv_color_filter_dsc = ct.structure(lv_color_filter_dsc, "lv_color_filter_dsc")
# uint32_t paused : 1;
# uint32_t auto_delete : 1;
# };
lv_timer_ntv = [ # valid LVGL92
lv_timer_ntv = [ # valid LVGL93
[uint32_t, "period"],
[uint32_t, "last_run"],
[ptr, "timer_cb"],
@ -644,12 +854,12 @@ lv_timer_ntv = ct.structure(lv_timer_ntv, "lv_timer_ntv")
#######################################################################
# lv_event_dsc
# typedef struct {
# struct _lv_event_dsc_t {
# lv_event_cb_t cb;
# void * user_data;
# uint32_t filter;
# } lv_event_dsc_t;
lv_event_dsc = [ # valid LVGL92
# };
lv_event_dsc = [ # valid LVGL93
[ptr, "cb"],
[ptr, "user_data"],
[uint32_t, "filter"],
@ -659,7 +869,7 @@ lv_event_dsc = ct.structure(lv_event_dsc, "lv_event_dsc")
#######################################################################
# Special structure used to calibrate resistive touchscreens
#######################################################################
lv_ts_calibration = [ # valid LVGL91
lv_ts_calibration = [ # valid LVGL93
[lv_coord_t, "raw_x"],
[lv_coord_t, "raw_y"],
[lv_coord_t, "x"],
@ -668,5 +878,91 @@ lv_ts_calibration = [ # valid LVGL91
]
lv_ts_calibration = ct.structure(lv_ts_calibration, "lv_ts_calibration")
#######################################################################
# New in LVGL 9.3.0
#######################################################################
# /** Coords of a span */
# typedef struct _lv_span_coords_t {
# lv_area_t heading;
# lv_area_t middle;
# lv_area_t trailing;
# } lv_span_coords_t;
lv_span_coords = [
[lv_area, "heading"],
[lv_area, "middle"],
[lv_area, "trailing"],
]
lv_span_coords = ct.structure(lv_span_coords, "lv_span_coords")
#######################################################################
# lv_font_info
# struct _lv_font_info_t {
# const char * name; /**< Font name, used to distinguish different font resources*/
# const lv_font_class_t * class_p; /**< Font backend implementation*/
# uint32_t size; /**< Font size in pixel*/
# uint32_t render_mode; /**< Font rendering mode, see `lv_freetype_font_render_mode_t`*/
# uint32_t style; /**< Font style, see `lv_freetype_font_style_t`*/
# lv_font_kerning_t kerning; /**< Font kerning, see `lv_font_kerning_t`*/
# };
lv_font_info = [ # valid LVGL92
[ptr, "name"],
[ptr, "class_p"],
[uint32_t, "size"],
[uint32_t, "render_mode"],
[uint32_t, "style"],
[uint32_t, "kerning"],
]
lv_font_info = ct.structure(lv_font_info, "lv_font_info")
#######################################################################
# lv_draw_letter
# typedef struct {
# lv_draw_dsc_base_t base;
# uint32_t unicode;
# const lv_font_t * font;
# lv_color_t color;
# int32_t rotation;
# int32_t scale_x;
# int32_t scale_y;
# int32_t skew_x;
# int32_t skew_y;
# lv_point_t pivot;
# lv_opa_t opa;
# lv_text_decor_t decor : 3;
# lv_blend_mode_t blend_mode : 3;
# /* Properties of the letter outlines */
# lv_opa_t outline_stroke_opa;
# int32_t outline_stroke_width;
# lv_color_t outline_stroke_color;
# } lv_draw_letter_dsc_t;
lv_draw_letter_dsc = [ # valid LVGL93
[lv_draw_dsc_base, "base"],
[uint32_t, "unicode"],
[ptr, "font"],
[lv_color, "color"],
[int32_t, "rotation"],
[int32_t, "scale_x"],
[int32_t, "scale_y"],
[int32_t, "skew_x"],
[int32_t, "skew_y"],
[lv_point, "pivot"],
[lv_opa, "opa"],
[uint8_t_3, "decor"],
[uint8_t_3, "blend_mode"],
[lv_opa, "outline_stroke_opa"],
[int32_t, "outline_stroke_width"],
[lv_color, "outline_stroke_color"],
]
lv_draw_letter_dsc = ct.structure(lv_draw_letter_dsc, "lv_draw_letter_dsc")
#
ct.print_classes("lvgl")

View File

@ -431,8 +431,9 @@ class type_mapper_class:
"lv_point_precise_t *": "lv_point_precise",
"lv_draw_image_dsc_t *": "lv_draw_image_dsc",
"lv_event_dsc_t *": "lv_event_dsc",
"lv_span_coords_t": "lv_span_coords",
# "_lv_obj_t *": "lv_obj", // no more used in LVGL 9.2
"_lv_obj_t *": "lv_obj",
"lv_obj_t *": "lv_obj",
"lv_event_t *": "lv_event",
"lv_color_t": "lv_color",
@ -441,7 +442,7 @@ class type_mapper_class:
"lv_font_t *": "lv_font",
"lv_theme_t *": "lv_theme",
"lv_display_t *": "lv_display",
# '_lv_display_t *': "lv_display", // no more used in LVGL 9.2
'_lv_display_t *': "lv_display",
"lv_indev_t *": "lv_indev",
"lv_point_t []": "lv_point_arr",
"lv_span_t *": "lv_span",
@ -461,6 +462,12 @@ class type_mapper_class:
"constchar **": "c", # treat as a simple pointer, decoding needs to be done at Berry level
"void * []": "c", # treat as a simple pointer, decoding needs to be done at Berry level
"constchar * *": "c",
# new in 9.3.0
"lv_text_cmd_state_t *": "c",
"lv_font_info_t *": "lv_font_info",
"lv_switch_orientation_t": "i",
"lv_slider_orientation_t": "i",
"lv_draw_letter_dsc_t *": "lv_draw_letter_dsc",
# callbacks
"lv_group_focus_cb_t": "lv_group_focus_cb",

View File

@ -1,105 +1,265 @@
#!/usr/bin/env python3
"""
LVGL Header Preprocessor
Extracts function signatures and enums from LVGL header files.
Generates mapping files for Berry scripting integration.
"""
import re
import sys
import glob
import argparse
from pathlib import Path
from typing import List, Set, Tuple, Optional
import logging
# https://stackoverflow.com/a/241506
def comment_remover(text):
def replacer(match):
s = match.group(0)
if s.startswith('/'):
return " " # note: a space and not an empty string
else:
return s
pattern = re.compile(
r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
re.DOTALL | re.MULTILINE
)
return re.sub(pattern, replacer, text)
# Configure logging
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')
logger = logging.getLogger(__name__)
# compute a sorted list of files from a prefix and a list of glob patterns
def list_files(prefix, glob_list):
r = []
for g in glob_list:
r += glob.glob(prefix + g, recursive=True)
return sorted(r)
def clean_source(raw):
raw = comment_remover(raw) # remove comments
# convert cr/lf or cr to lf
raw = re.sub(r'\r\n ', '\n', raw)
raw = re.sub(r'\r', '\n', raw)
# group multilines into a single line, i.e. if line ends with '\', put in a single line
raw = re.sub(r'\\\n', ' ', raw)
# remove preprocessor directives
raw = re.sub(r'\n[ \t]*#[^\n]*(?=\n)', '', raw)
raw = re.sub(r'^[ \t]*#[^\n]*\n', '', raw)
raw = re.sub(r'\n[ \t]*#[^\n]*$', '', raw)
class LVGLPreprocessor:
"""Main preprocessor class for LVGL headers."""
def __init__(self, lv_src_prefix: str = "../../lvgl/src/"):
self.lv_src_prefix = Path(lv_src_prefix)
self.headers_exclude_suffix = {
"_private.h",
"lv_lottie.h",
"lv_obj_property.h",
"lv_obj_property_names.h",
"lv_style_properties.h",
"lv_3dtexture.h",
}
# Function exclusion patterns
self.function_exclude_patterns = [
r"^_", # skip if function name starts with '_'
r"^lv_debug", # all debug functions
r"^lv_init", r"^lv_deinit",
r"^lv_templ_",
r"^lv_imagebutton_get_src_", # LV_IMGBTN_TILED == 0
r"^lv_imagebitton_set_src_tiled", # !LV_IMGBTN_TILED
r"^lv_refr_get_fps_", # no LV_USE_PERF_MONITOR
r"^lv_image_cache_",
r"^lv_image_decoder_",
r"^lv_image_cf_",
r"^lv_image_buf_",
r"^lv_indev_scroll_",
r"^lv_pow",
r"^lv_keyboard_def_event_cb", # need to fix conditional include
r"^lv_refr_reset_fps_counter",
r"^lv_refr_get_fps_avg",
r"^lv_anim_path_", # callbacks for animation are moved to constants
r"^lv_obj_set_property", # LV_USE_OBJ_PROPERTY 0
r"^lv_obj_set_properties",
r"^lv_obj_get_property",
r"^lv_win_",
r"^lv_obj.*name", # we don't enable #if LV_USE_OBJ_NAME
]
# Enum exclusion patterns
self.enum_exclude_prefixes = {
"_", "LV_BIDI_DIR_", "LV_FONT_", "LV_SIGNAL_", "LV_TEMPL_",
"LV_TASK_PRIO_", "LV_THEME_", "LV_LRU_", "LV_VECTOR_",
"LV_KEYBOARD_MODE_TEXT_ARABIC", "LV_DRAW_TASK_TYPE_3D",
"LV_DRAW_TASK_TYPE_VECTOR",
}
# remove extern "C" {}
raw = re.sub(r'extern\s+"C"\s+{(.*)}', '\\1', raw, flags=re.DOTALL)
def comment_remover(self, text: str) -> str:
"""Remove C/C++ style comments from source code."""
def replacer(match):
s = match.group(0)
return " " if s.startswith('/') else s
pattern = re.compile(
r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
re.DOTALL | re.MULTILINE
)
return re.sub(pattern, replacer, text)
# remove empty lines
raw = re.sub(r'\n[ \t]*(?=\n)', '', raw)
raw = re.sub(r'^[ \t]*\n', '', raw) # remove first empty line
raw = re.sub(r'\n[ \t]*$', '', raw) # remove last empty line
return raw
def list_files(self, prefix: Path, glob_patterns: List[str]) -> List[Path]:
"""Compute a sorted list of files from a prefix and glob patterns."""
files = []
for pattern in glob_patterns:
files.extend(Path(prefix).glob(pattern))
return sorted(files)
# ################################################################################
# Parse function signatures
# ################################################################################
def clean_source(self, raw: str) -> str:
"""Clean source code by removing comments, preprocessor directives, etc."""
raw = self.comment_remover(raw)
# Normalize line endings
raw = re.sub(r'\r\n', '\n', raw)
raw = re.sub(r'\r', '\n', raw)
# Handle line continuations
raw = re.sub(r'\\\n', ' ', raw)
# Remove preprocessor directives
raw = re.sub(r'\n[ \t]*#[^\n]*(?=\n)', '', raw)
raw = re.sub(r'^[ \t]*#[^\n]*\n', '', raw)
raw = re.sub(r'\n[ \t]*#[^\n]*$', '', raw)
lv_src_prefix = "../../lvgl/src/"
lv_fun_globs = [
"lv_api*.h",
"widgets/*/*.h", # all widgets
"libs/qrcode/lv_qrcode.h",
"core/*.h",
"indev/lv_indev.h",
"layouts/*/*.h",
# "draw/*.h",
"themes/lv_theme.h",
"draw/lv_draw_arc.h",
"draw/lv_draw_label.h",
"draw/lv_draw_line.h",
"draw/lv_draw_mask.h",
"draw/lv_draw_rect.h",
"draw/lv_draw_triangle.h",
# "draw/lv_draw_vector.h",
"draw/lv_draw.h",
"display/*.h",
"misc/lv_anim.h",
"misc/lv_area.h",
"misc/lv_color.h",
"misc/lv_color_op.h",
"misc/lv_palette.h",
"misc/lv_event.h",
"misc/lv_style_gen.h",
"misc/lv_style.h",
"misc/lv_timer.h",
"misc/lv_text.h",
"font/lv_font.h",
# add version information
"../lvgl.h",
]
headers_exlude_suffix = [
"_private.h",
"lv_lottie.h",
"lv_obj_property.h",
"lv_obj_property_names.h",
"lv_style_properties.h",
]
# Remove extern "C" blocks
raw = re.sub(r'extern\s+"C"\s+{(.*)}', r'\1', raw, flags=re.DOTALL)
headers_names = list_files(lv_src_prefix, lv_fun_globs)
headers_names += list_files("../../LVGL_assets/src/", ["lv_theme_haspmota.h"])
headers_names += list_files("../src/", ["lv_berry.h", "lv_colorwheel.h"])
# Remove empty lines
raw = re.sub(r'\n[ \t]*(?=\n)', '', raw)
raw = re.sub(r'^[ \t]*\n', '', raw)
raw = re.sub(r'\n[ \t]*$', '', raw)
return raw
# filter out from headers_exlude_suffix
headers_names = [x for x in headers_names if not any(x.endswith(suffix) for suffix in headers_exlude_suffix)]
def extract_functions(self, source: str) -> List[str]:
"""Extract function signatures from cleaned source code."""
# Remove content within braces
while True:
source, repl_count = re.subn(r'\{[^{]*?\}', ';', source, flags=re.DOTALL)
if repl_count == 0:
break
output_filename = "../mapping/lv_funcs.h"
sys.stdout = open(output_filename, 'w', encoding='utf-8')
# Find function signatures
pattern = r'(^|;|})\s*([^;{}]+\(.*?\))\s*(?=(;|{))'
matches = re.findall(pattern, source, flags=re.DOTALL)
functions = []
for match in matches:
func_def = match[1]
# Clean up whitespace
func_def = re.sub(r'[ \t\r\n]+', ' ', func_def)
# Remove LVGL-specific attributes
func_def = re.sub(r'LV_ATTRIBUTE_FAST_MEM ', '', func_def)
func_def = re.sub(r'LV_ATTRIBUTE_TIMER_HANDLER ', '', func_def)
func_def = re.sub(r'extern ', '', func_def)
# Skip excluded function types
if any(func_def.startswith(prefix) for prefix in ["typedef", "_LV_", "LV_"]):
continue
# Extract function name
name_match = re.search(r'\s(\w+)\([^\(]*$', func_def)
if not name_match:
continue
func_name = name_match.group(1)
# Check exclusion patterns
if any(re.search(pattern, func_name) for pattern in self.function_exclude_patterns):
continue
functions.append(func_def)
return functions
print("""
def extract_enums(self, source: str) -> Set[str]:
"""Extract enum values from cleaned source code."""
enum_values = set()
# Find enum definitions
enum_matches = re.findall(r'enum\s+\w*\s*{(.*?)}', source, flags=re.DOTALL)
for enum_content in enum_matches:
# Skip LV_PROPERTY_ID enums (disabled feature)
if 'LV_PROPERTY_ID' in enum_content:
continue
# Remove macro-defined enums
enum_content = re.sub(r'\S+\((.*?),.*?\),', r'\1,', enum_content)
# Split by commas and clean up
for item in enum_content.split(','):
item = re.sub(r'[ \t\n]', '', item) # Remove whitespace
item = re.sub(r'=.*$', '', item) # Remove assignment
if not item: # Skip empty items
continue
# Check exclusion patterns
if any(item.startswith(prefix) for prefix in self.enum_exclude_prefixes):
continue
enum_values.add(item)
# Extract LV_EXPORT_CONST_INT constants
const_ints = re.findall(r'LV_EXPORT_CONST_INT\((\w+)\)', source, flags=re.DOTALL)
enum_values.update(const_ints)
return enum_values
def get_function_headers(self) -> List[Path]:
"""Get list of header files for function extraction."""
patterns = [
"lv_api*.h",
"widgets/*/*.h",
"libs/qrcode/lv_qrcode.h",
"core/*.h",
"indev/lv_indev.h",
"layouts/*/*.h",
"themes/lv_theme.h",
"draw/lv_draw_arc.h",
"draw/lv_draw_label.h",
"draw/lv_draw_line.h",
"draw/lv_draw_mask.h",
"draw/lv_draw_rect.h",
"draw/lv_draw_triangle.h",
"draw/lv_draw.h",
"display/*.h",
"misc/lv_anim.h",
"misc/lv_area.h",
"misc/lv_color.h",
"misc/lv_color_op.h",
"misc/lv_palette.h",
"misc/lv_event.h",
"misc/lv_style_gen.h",
"misc/lv_style.h",
"misc/lv_timer.h",
"misc/lv_text.h",
"font/lv_font.h",
"../lvgl.h",
]
headers = self.list_files(self.lv_src_prefix, patterns)
# Add additional headers
additional_paths = [
Path("../../LVGL_assets/src/lv_theme_haspmota.h"),
Path("../src/lv_berry.h"),
Path("../src/lv_colorwheel.h"),
]
for path in additional_paths:
if path.exists():
headers.append(path)
# Filter out excluded files
return [h for h in headers if not any(str(h).endswith(suffix) for suffix in self.headers_exclude_suffix)]
def get_enum_headers(self) -> List[Path]:
"""Get list of header files for enum extraction."""
patterns = [
"core/*.h",
"draw/*.h",
"hal/*.h",
"misc/*.h",
"widgets/*/*.h",
"display/lv_display.h",
"layouts/**/*.h",
]
headers = self.list_files(self.lv_src_prefix, patterns)
return [h for h in headers if not any(str(h).endswith(suffix) for suffix in self.headers_exclude_suffix)]
def generate_functions_header(self, output_path: Path):
"""Generate the functions header file."""
logger.info(f"Generating functions header: {output_path}")
headers = self.get_function_headers()
with open(output_path, 'w', encoding='utf-8') as f:
f.write("""
// Automatically generated from LVGL source with `python3 preprocessor.py`
// Extract function signatures from LVGL APIs in headers
@ -119,105 +279,51 @@ lv_coord_t lv_get_ver_res(void);
// ======================================================================
""")
for header_path in headers:
try:
with open(header_path, encoding='utf-8-sig') as header_file:
f.write(f"// {header_path}\n")
raw_content = self.clean_source(header_file.read())
functions = self.extract_functions(raw_content)
for func in functions:
f.write(f"{func}\n")
f.write("\n")
except Exception as e:
logger.error(f"Error processing {header_path}: {e}")
for header_name in headers_names:
with open(header_name, encoding='utf-8-sig') as f:
print("// " + header_name)
raw = clean_source(f.read())
# remove anything in '{' '}'
while True:
(raw, repl) = re.subn(r'\{[^{]*?\}', ';', raw, flags=re.DOTALL) # replace with ';' to make pattern matching still work
if (repl == 0): break # no more replace, stop
raw_f = re.findall(r'(^|;|})\s*([^;{}]+\(.*?\))\s*(?=(;|{))', raw, flags=re.DOTALL)
fun_defs = [ x[1] for x in raw_f]
# remove any CRLF or multi-space
fun_defs = [ re.sub(r'[ \t\r\n]+', ' ', x) for x in fun_defs]
# parse individual
for fun in fun_defs:
# remove LV_ATTRIBUTE_FAST_MEM
fun = re.sub(r'LV_ATTRIBUTE_FAST_MEM ', '', fun)
# remove LV_ATTRIBUTE_TIMER_HANDLER
fun = re.sub(r'LV_ATTRIBUTE_TIMER_HANDLER ', '', fun)
# remove extern
fun = re.sub(r'extern ', '', fun)
exclude = False
for exclude_prefix in ["typedef", "_LV_", "LV_"]:
if fun.startswith(exclude_prefix): exclude = True
if exclude: continue
# extrac the function name
fun_name = re.search(r'\s(\w+)\([^\(]*$', fun)
if fun_name != None:
fun_name = fun_name.group(1) # we now have the function name
def generate_enums_header(self, output_path: Path):
"""Generate the enums header file."""
logger.info(f"Generating enums header: {output_path}")
# exclude specific names
for exclude_pattern in [
"^_", # skip if function name starts with '_'
"^lv_debug", # all debug functions
"^lv_init", "^lv_deinit",
"^lv_templ_",
"^lv_imagebutton_get_src_", # LV_IMGBTN_TILED == 0
"^lv_imagebitton_set_src_tiled",# !LV_IMGBTN_TILED
#"^lv_disp_",
"^lv_refr_get_fps_", # no LV_USE_PERF_MONITOR
"^lv_image_cache_",
"^lv_image_decoder_",
"^lv_image_cf_",
"^lv_image_buf_",
"^lv_indev_scroll_",
"^lv_pow",
"^lv_keyboard_def_event_cb", # need to fix conditional include
# "^lv_event_get_", # event_getters not needed
"^lv_refr_reset_fps_counter",
"^lv_refr_get_fps_avg",
"^lv_anim_path_", # callbacks for animation are moved to constants
# LV_USE_OBJ_PROPERTY 0
"^lv_obj_set_property",
"^lv_obj_set_properties",
"^lv_obj_get_property",
"^lv_win_",
]:
if re.search(exclude_pattern, fun_name): exclude = True
if exclude: continue
print(fun)
print()
headers = self.get_enum_headers()
with open(output_path, 'w', encoding='utf-8') as f:
# Write the static content first
f.write(self._get_static_enum_content())
# Process headers for dynamic enums
for header_path in headers:
try:
with open(header_path, encoding='utf-8-sig') as header_file:
f.write(f"// File: {header_path}\n")
raw_content = self.clean_source(header_file.read())
enum_values = self.extract_enums(raw_content)
for enum_value in sorted(enum_values):
f.write(f"{enum_value}\n")
f.write("\n")
except Exception as e:
logger.error(f"Error processing {header_path}: {e}")
sys.stdout.close()
# ################################################################################
# Parse 'enum'
# ################################################################################
lv_src_prefix = "../../lvgl/src/"
lv_fun_globs = [
"core/*.h",
"draw/*.h",
"hal/*.h",
"misc/*.h",
"widgets/*/*.h",
"display/lv_display.h",
"layouts/**/*.h",
]
headers_exlude_suffix = [
"_private.h",
"lv_lottie.h",
"lv_obj_property.h",
"lv_obj_property_names.h",
"lv_style_properties.h",
]
headers_names = list_files(lv_src_prefix, lv_fun_globs)
# filter out from headers_exlude_suffix
headers_names = [x for x in headers_names if not any(x.endswith(suffix) for suffix in headers_exlude_suffix)]
output_filename = "../mapping/lv_enum.h"
sys.stdout = open(output_filename, 'w', encoding='utf-8')
print("""// ======================================================================
def _get_static_enum_content(self) -> str:
"""Get the static content for enum header."""
return """// ======================================================================
// Functions
// ======================================================================
@ -268,7 +374,6 @@ COLOR_IVORY=0xFFFFF0
COLOR_LINEN=0xFAF0E6
COLOR_BEIGE=0xF5F5DC
COLOR_AZURE=0xF0FFFF
COLOR_SILVER=0xC0C0C0
COLOR_PINK=0xFFC0CB
COLOR_PLUM=0xDDA0DD
COLOR_ORCHID=0xDA70D6
@ -397,47 +502,59 @@ LV_STYLE_TRANSFORM_ANGLE=LV_STYLE_TRANSFORM_ROTATION
LV_ZOOM_NONE=LV_SCALE_NONE
// LVGL 9.3
LV_LABEL_LONG_WRAP=LV_LABEL_LONG_MODE_WRAP
LV_LABEL_LONG_DOT=LV_LABEL_LONG_MODE_DOTS
LV_LABEL_LONG_SCROLL=LV_LABEL_LONG_MODE_SCROLL
LV_LABEL_LONG_SCROLL_CIRCULAR=LV_LABEL_LONG_MODE_SCROLL_CIRCULAR
LV_LABEL_LONG_CLIP=LV_LABEL_LONG_MODE_CLIP
// ======================================================================
// Generated from headers
// ======================================================================
""")
"""
for header_name in headers_names:
with open(header_name) as f:
raw = clean_source(f.read())
def run(self, functions_output: str = "../mapping/lv_funcs.h",
enums_output: str = "../mapping/lv_enum.h"):
"""Run the complete preprocessing pipeline."""
functions_path = Path(functions_output)
enums_path = Path(enums_output)
# Create output directories if they don't exist
functions_path.parent.mkdir(parents=True, exist_ok=True)
enums_path.parent.mkdir(parents=True, exist_ok=True)
# Generate both files
self.generate_functions_header(functions_path)
self.generate_enums_header(enums_path)
logger.info("Preprocessing complete!")
print(f"// File: {header_name}")
# extract enums
enums = re.findall(r'enum\s+\w*\s*{(.*?)}', raw, flags=re.DOTALL)
for enum in enums: # iterate on all matches
# exclude LV_PROPERTY_ID
# we compile with `#define LV_USE_OBJ_PROPERTY 0`
# and remove all instances of `LV_PROPERTY_ID(OBJ, FLAG_START, LV_PROPERTY_TYPE_INT, 0),`
if re.search('LV_PROPERTY_ID', enum): continue
# remove enums defined via a macro
enum = re.sub(r'\S+\((.*?),.*?\),', '\\1,', enum) # turn 'LV_STYLE_PROP_INIT(LV_STYLE_SIZE, 0x0, LV_STYLE_ID_VALUE + 3, LV_STYLE_ATTR_NONE),' into 'LV_STYLE_SIZE'
#
enum_elt = enum.split(",")
for enum_item in enum_elt:
# remove any space
enum_item = re.sub(r'[ \t\n]', '', enum_item)
# remove anything after '='
enum_item = re.sub(r'=.*$', '', enum_item)
# item is ready
exclude = False
for exclude_prefix in ["_", "LV_BIDI_DIR_", "LV_FONT_",
"LV_SIGNAL_", "LV_TEMPL_", "LV_TASK_PRIO_", "LV_THEME_",
"LV_LRU_",
"LV_VECTOR_",
"LV_KEYBOARD_MODE_TEXT_ARABIC"]:
if enum_item.startswith(exclude_prefix): exclude = True
if exclude: continue
def main():
"""Main entry point with command line argument parsing."""
parser = argparse.ArgumentParser(description="LVGL Header Preprocessor")
parser.add_argument("--lv-src", default="../../lvgl/src/",
help="Path to LVGL source directory")
parser.add_argument("--functions-output", default="../mapping/lv_funcs.h",
help="Output path for functions header")
parser.add_argument("--enums-output", default="../mapping/lv_enum.h",
help="Output path for enums header")
parser.add_argument("--verbose", "-v", action="store_true",
help="Enable verbose logging")
args = parser.parse_args()
if args.verbose:
logging.getLogger().setLevel(logging.DEBUG)
try:
preprocessor = LVGLPreprocessor(args.lv_src)
preprocessor.run(args.functions_output, args.enums_output)
except Exception as e:
logger.error(f"Preprocessing failed: {e}")
sys.exit(1)
print(enum_item)
# extract `LV_EXPORT_CONST_INT()` int constants
constints = re.findall(r'LV_EXPORT_CONST_INT\((\w+)\)', raw, flags=re.DOTALL)
for constint in constints:
print(constint)
sys.stdout.close()
if __name__ == "__main__":
main()

View File

@ -1,5 +1,5 @@
# LVGL integer constants
# LVGL version 9
# LVGL version 9.3.0
lv.ALIGN_BOTTOM_LEFT = 4
lv.ALIGN_BOTTOM_MID = 5
@ -24,8 +24,6 @@ lv.ALIGN_TOP_LEFT = 1
lv.ALIGN_TOP_MID = 2
lv.ALIGN_TOP_RIGHT = 3
lv.ANIM_IMAGE_PART_MAIN = 0
lv.ANIM_OFF = 0
lv.ANIM_ON = 1
lv.ANIM_PLAYTIME_INFINITE = -1
lv.ANIM_REPEAT_INFINITE = -1
lv.ARC_MODE_NORMAL = 0
@ -43,6 +41,7 @@ lv.BASE_DIR_NEUTRAL = 32
lv.BASE_DIR_RTL = 1
lv.BASE_DIR_WEAK = 33
lv.BLEND_MODE_ADDITIVE = 1
lv.BLEND_MODE_DIFFERENCE = 4
lv.BLEND_MODE_MULTIPLY = 3
lv.BLEND_MODE_NORMAL = 0
lv.BLEND_MODE_SUBTRACTIVE = 2
@ -71,11 +70,27 @@ lv.BUTTONMATRIX_CTRL_CUSTOM_1 = 16384
lv.BUTTONMATRIX_CTRL_CUSTOM_2 = 32768
lv.BUTTONMATRIX_CTRL_DISABLED = 64
lv.BUTTONMATRIX_CTRL_HIDDEN = 16
lv.BUTTONMATRIX_CTRL_NONE = 0
lv.BUTTONMATRIX_CTRL_NO_REPEAT = 32
lv.BUTTONMATRIX_CTRL_POPOVER = 1024
lv.BUTTONMATRIX_CTRL_RESERVED_1 = 2048
lv.BUTTONMATRIX_CTRL_RESERVED_2 = 4096
lv.BUTTONMATRIX_CTRL_RESERVED_3 = 8192
lv.BUTTONMATRIX_CTRL_RECOLOR = 2048
lv.BUTTONMATRIX_CTRL_RESERVED_1 = 4096
lv.BUTTONMATRIX_CTRL_RESERVED_2 = 8192
lv.BUTTONMATRIX_CTRL_WIDTH_1 = 1
lv.BUTTONMATRIX_CTRL_WIDTH_10 = 10
lv.BUTTONMATRIX_CTRL_WIDTH_11 = 11
lv.BUTTONMATRIX_CTRL_WIDTH_12 = 12
lv.BUTTONMATRIX_CTRL_WIDTH_13 = 13
lv.BUTTONMATRIX_CTRL_WIDTH_14 = 14
lv.BUTTONMATRIX_CTRL_WIDTH_15 = 15
lv.BUTTONMATRIX_CTRL_WIDTH_2 = 2
lv.BUTTONMATRIX_CTRL_WIDTH_3 = 3
lv.BUTTONMATRIX_CTRL_WIDTH_4 = 4
lv.BUTTONMATRIX_CTRL_WIDTH_5 = 5
lv.BUTTONMATRIX_CTRL_WIDTH_6 = 6
lv.BUTTONMATRIX_CTRL_WIDTH_7 = 7
lv.BUTTONMATRIX_CTRL_WIDTH_8 = 8
lv.BUTTONMATRIX_CTRL_WIDTH_9 = 9
lv.CHART_AXIS_LAST = 5
lv.CHART_AXIS_PRIMARY_X = 2
lv.CHART_AXIS_PRIMARY_Y = 0
@ -89,8 +104,14 @@ lv.CHART_TYPE_SCATTER = 3
lv.CHART_UPDATE_MODE_CIRCULAR = 1
lv.CHART_UPDATE_MODE_SHIFT = 0
lv.COLOR_AQUA = 65535
lv.COLOR_AZURE = 15794175
lv.COLOR_BEIGE = 16119260
lv.COLOR_BISQUE = 16770244
lv.COLOR_BLACK = 0
lv.COLOR_BLUE = 255
lv.COLOR_BLUSH = 11534336
lv.COLOR_BROWN = 10824234
lv.COLOR_CORAL = 16744272
lv.COLOR_CYAN = 65535
lv.COLOR_DEPTH = 16
lv.COLOR_FORMAT_A1 = 11
@ -98,8 +119,12 @@ lv.COLOR_FORMAT_A2 = 12
lv.COLOR_FORMAT_A4 = 13
lv.COLOR_FORMAT_A8 = 14
lv.COLOR_FORMAT_AL88 = 21
lv.COLOR_FORMAT_ARGB1555 = 22
lv.COLOR_FORMAT_ARGB2222 = 24
lv.COLOR_FORMAT_ARGB4444 = 23
lv.COLOR_FORMAT_ARGB8565 = 19
lv.COLOR_FORMAT_ARGB8888 = 16
lv.COLOR_FORMAT_ARGB8888_PREMULTIPLIED = 26
lv.COLOR_FORMAT_I1 = 7
lv.COLOR_FORMAT_I2 = 8
lv.COLOR_FORMAT_I4 = 9
@ -111,12 +136,22 @@ lv.COLOR_FORMAT_I8 = 10
lv.COLOR_FORMAT_L8 = 6
lv.COLOR_FORMAT_NATIVE = 18
lv.COLOR_FORMAT_NATIVE_WITH_ALPHA = 20
lv.COLOR_FORMAT_NEMA_TSC12 = 52
lv.COLOR_FORMAT_NEMA_TSC12A = 53
lv.COLOR_FORMAT_NEMA_TSC4 = 48
lv.COLOR_FORMAT_NEMA_TSC6 = 49
lv.COLOR_FORMAT_NEMA_TSC6A = 50
lv.COLOR_FORMAT_NEMA_TSC6AP = 51
lv.COLOR_FORMAT_NEMA_TSC_END = 53
lv.COLOR_FORMAT_NEMA_TSC_START = 48
lv.COLOR_FORMAT_NV12 = 37
lv.COLOR_FORMAT_NV21 = 36
lv.COLOR_FORMAT_PROPRIETARY_START = 48
lv.COLOR_FORMAT_RAW = 1
lv.COLOR_FORMAT_RAW_ALPHA = 2
lv.COLOR_FORMAT_RGB565 = 18
lv.COLOR_FORMAT_RGB565A8 = 20
lv.COLOR_FORMAT_RGB565_SWAPPED = 27
lv.COLOR_FORMAT_RGB888 = 15
lv.COLOR_FORMAT_UNKNOWN = 0
lv.COLOR_FORMAT_UYVY = 39
@ -124,18 +159,36 @@ lv.COLOR_FORMAT_XRGB8888 = 17
lv.COLOR_FORMAT_YUV_END = 39
lv.COLOR_FORMAT_YUV_START = 32
lv.COLOR_FORMAT_YUY2 = 38
lv.COLOR_FUCHSIA = 16711935
lv.COLOR_GOLD = 16766720
lv.COLOR_GRAY = 8421504
lv.COLOR_GREEN = 32768
lv.COLOR_GREY = 8421504
lv.COLOR_INDIGO = 4915330
lv.COLOR_IVORY = 16777200
lv.COLOR_KHAKI = 15787660
lv.COLOR_LIME = 65280
lv.COLOR_LINEN = 16445670
lv.COLOR_MAGENTA = 16711935
lv.COLOR_MAROON = 8388608
lv.COLOR_NAVY = 128
lv.COLOR_OLIVE = 8421376
lv.COLOR_ORANGE = 16744192
lv.COLOR_ORANGE = 16753920
lv.COLOR_ORCHID = 14315734
lv.COLOR_PERU = 13468991
lv.COLOR_PINK = 16761035
lv.COLOR_PLUM = 14524637
lv.COLOR_PURPLE = 8388736
lv.COLOR_RED = 16711680
lv.COLOR_SALMON = 16416882
lv.COLOR_SIENNA = 10506797
lv.COLOR_SILVER = 12632256
lv.COLOR_SNOW = 16775930
lv.COLOR_TAN = 13808780
lv.COLOR_TEAL = 32896
lv.COLOR_TOMATO = 16737095
lv.COLOR_VIOLET = 15631086
lv.COLOR_WHEAT = 16113331
lv.COLOR_WHITE = 16777215
lv.COLOR_YELLOW = 16776960
lv.COORD_MAX = 536870911
@ -169,85 +222,90 @@ lv.DRAW_TASK_STATE_IN_PROGRESS = 2
lv.DRAW_TASK_STATE_QUEUED = 1
lv.DRAW_TASK_STATE_READY = 3
lv.DRAW_TASK_STATE_WAITING = 0
lv.DRAW_TASK_TYPE_ARC = 8
lv.DRAW_TASK_TYPE_ARC = 9
lv.DRAW_TASK_TYPE_BORDER = 2
lv.DRAW_TASK_TYPE_BOX_SHADOW = 3
lv.DRAW_TASK_TYPE_FILL = 1
lv.DRAW_TASK_TYPE_IMAGE = 5
lv.DRAW_TASK_TYPE_LABEL = 4
lv.DRAW_TASK_TYPE_LAYER = 6
lv.DRAW_TASK_TYPE_LINE = 7
lv.DRAW_TASK_TYPE_MASK_BITMAP = 11
lv.DRAW_TASK_TYPE_MASK_RECTANGLE = 10
lv.DRAW_TASK_TYPE_IMAGE = 6
lv.DRAW_TASK_TYPE_LABEL = 5
lv.DRAW_TASK_TYPE_LAYER = 7
lv.DRAW_TASK_TYPE_LETTER = 4
lv.DRAW_TASK_TYPE_LINE = 8
lv.DRAW_TASK_TYPE_MASK_BITMAP = 12
lv.DRAW_TASK_TYPE_MASK_RECTANGLE = 11
lv.DRAW_TASK_TYPE_NONE = 0
lv.DRAW_TASK_TYPE_TRIANGLE = 9
lv.DRAW_TASK_TYPE_VECTOR = 12
lv.DRAW_TASK_TYPE_TRIANGLE = 10
lv.DROPDOWN_POS_LAST = 65535
lv.EVENT_ALL = 0
lv.EVENT_CANCEL = 36
lv.EVENT_CHILD_CHANGED = 39
lv.EVENT_CHILD_CREATED = 40
lv.EVENT_CHILD_DELETED = 41
lv.EVENT_CLICKED = 7
lv.EVENT_COLOR_FORMAT_CHANGED = 52
lv.EVENT_COVER_CHECK = 23
lv.EVENT_CREATE = 37
lv.EVENT_DEFOCUSED = 17
lv.EVENT_DELETE = 38
lv.EVENT_DRAW_MAIN = 26
lv.EVENT_DRAW_MAIN_BEGIN = 25
lv.EVENT_DRAW_MAIN_END = 27
lv.EVENT_DRAW_POST = 29
lv.EVENT_DRAW_POST_BEGIN = 28
lv.EVENT_DRAW_POST_END = 30
lv.EVENT_DRAW_TASK_ADDED = 31
lv.EVENT_FLUSH_FINISH = 59
lv.EVENT_FLUSH_START = 58
lv.EVENT_FLUSH_WAIT_FINISH = 61
lv.EVENT_FLUSH_WAIT_START = 60
lv.EVENT_FOCUSED = 16
lv.EVENT_GESTURE = 13
lv.EVENT_GET_SELF_SIZE = 49
lv.EVENT_HIT_TEST = 19
lv.EVENT_HOVER_LEAVE = 22
lv.EVENT_HOVER_OVER = 21
lv.EVENT_INDEV_RESET = 20
lv.EVENT_INSERT = 33
lv.EVENT_INVALIDATE_AREA = 50
lv.EVENT_KEY = 14
lv.EVENT_LAST = 63
lv.EVENT_LAYOUT_CHANGED = 48
lv.EVENT_LEAVE = 18
lv.EVENT_LONG_PRESSED = 5
lv.EVENT_LONG_PRESSED_REPEAT = 6
lv.EVENT_CANCEL = 39
lv.EVENT_CHILD_CHANGED = 42
lv.EVENT_CHILD_CREATED = 43
lv.EVENT_CHILD_DELETED = 44
lv.EVENT_CLICKED = 10
lv.EVENT_COLOR_FORMAT_CHANGED = 55
lv.EVENT_COVER_CHECK = 26
lv.EVENT_CREATE = 40
lv.EVENT_DEFOCUSED = 20
lv.EVENT_DELETE = 41
lv.EVENT_DOUBLE_CLICKED = 6
lv.EVENT_DRAW_MAIN = 29
lv.EVENT_DRAW_MAIN_BEGIN = 28
lv.EVENT_DRAW_MAIN_END = 30
lv.EVENT_DRAW_POST = 32
lv.EVENT_DRAW_POST_BEGIN = 31
lv.EVENT_DRAW_POST_END = 33
lv.EVENT_DRAW_TASK_ADDED = 34
lv.EVENT_FLUSH_FINISH = 62
lv.EVENT_FLUSH_START = 61
lv.EVENT_FLUSH_WAIT_FINISH = 64
lv.EVENT_FLUSH_WAIT_START = 63
lv.EVENT_FOCUSED = 19
lv.EVENT_GESTURE = 16
lv.EVENT_GET_SELF_SIZE = 52
lv.EVENT_HIT_TEST = 22
lv.EVENT_HOVER_LEAVE = 25
lv.EVENT_HOVER_OVER = 24
lv.EVENT_INDEV_RESET = 23
lv.EVENT_INSERT = 36
lv.EVENT_INVALIDATE_AREA = 53
lv.EVENT_KEY = 17
lv.EVENT_LAST = 67
lv.EVENT_LAYOUT_CHANGED = 51
lv.EVENT_LEAVE = 21
lv.EVENT_LONG_PRESSED = 8
lv.EVENT_LONG_PRESSED_REPEAT = 9
lv.EVENT_MARKED_DELETING = 65536
lv.EVENT_PREPROCESS = 32768
lv.EVENT_PRESSED = 1
lv.EVENT_PRESSING = 2
lv.EVENT_PRESS_LOST = 3
lv.EVENT_READY = 35
lv.EVENT_REFRESH = 34
lv.EVENT_REFR_EXT_DRAW_SIZE = 24
lv.EVENT_REFR_READY = 55
lv.EVENT_REFR_REQUEST = 53
lv.EVENT_REFR_START = 54
lv.EVENT_RELEASED = 8
lv.EVENT_RENDER_READY = 57
lv.EVENT_RENDER_START = 56
lv.EVENT_RESOLUTION_CHANGED = 51
lv.EVENT_ROTARY = 15
lv.EVENT_SCREEN_LOADED = 44
lv.EVENT_SCREEN_LOAD_START = 43
lv.EVENT_SCREEN_UNLOADED = 45
lv.EVENT_SCREEN_UNLOAD_START = 42
lv.EVENT_SCROLL = 12
lv.EVENT_SCROLL_BEGIN = 9
lv.EVENT_SCROLL_END = 11
lv.EVENT_SCROLL_THROW_BEGIN = 10
lv.EVENT_READY = 38
lv.EVENT_REFRESH = 37
lv.EVENT_REFR_EXT_DRAW_SIZE = 27
lv.EVENT_REFR_READY = 58
lv.EVENT_REFR_REQUEST = 56
lv.EVENT_REFR_START = 57
lv.EVENT_RELEASED = 11
lv.EVENT_RENDER_READY = 60
lv.EVENT_RENDER_START = 59
lv.EVENT_RESOLUTION_CHANGED = 54
lv.EVENT_ROTARY = 18
lv.EVENT_SCREEN_LOADED = 47
lv.EVENT_SCREEN_LOAD_START = 46
lv.EVENT_SCREEN_UNLOADED = 48
lv.EVENT_SCREEN_UNLOAD_START = 45
lv.EVENT_SCROLL = 15
lv.EVENT_SCROLL_BEGIN = 12
lv.EVENT_SCROLL_END = 14
lv.EVENT_SCROLL_THROW_BEGIN = 13
lv.EVENT_SHORT_CLICKED = 4
lv.EVENT_SIZE_CHANGED = 46
lv.EVENT_STYLE_CHANGED = 47
lv.EVENT_VALUE_CHANGED = 32
lv.EVENT_VSYNC = 62
lv.EVENT_SINGLE_CLICKED = 5
lv.EVENT_SIZE_CHANGED = 49
lv.EVENT_STYLE_CHANGED = 50
lv.EVENT_TRIPLE_CLICKED = 7
lv.EVENT_VALUE_CHANGED = 35
lv.EVENT_VSYNC = 65
lv.EVENT_VSYNC_REQUEST = 66
lv.FLEX_ALIGN_CENTER = 2
lv.FLEX_ALIGN_END = 1
lv.FLEX_ALIGN_SPACE_AROUND = 4
@ -316,6 +374,8 @@ lv.IMAGE_ALIGN_BOTTOM_LEFT = 4
lv.IMAGE_ALIGN_BOTTOM_MID = 5
lv.IMAGE_ALIGN_BOTTOM_RIGHT = 6
lv.IMAGE_ALIGN_CENTER = 9
lv.IMAGE_ALIGN_CONTAIN = 13
lv.IMAGE_ALIGN_COVER = 14
lv.IMAGE_ALIGN_DEFAULT = 0
lv.IMAGE_ALIGN_LEFT_MID = 7
lv.IMAGE_ALIGN_RIGHT_MID = 8
@ -329,6 +389,7 @@ lv.IMAGE_COMPRESS_NONE = 0
lv.IMAGE_COMPRESS_RLE = 1
lv.IMAGE_FLAGS_ALLOCATED = 16
lv.IMAGE_FLAGS_COMPRESSED = 8
lv.IMAGE_FLAGS_CUSTOM_DRAW = 64
lv.IMAGE_FLAGS_MODIFIABLE = 32
lv.IMAGE_FLAGS_PREMULTIPLIED = 1
lv.IMAGE_FLAGS_USER1 = 256
@ -367,11 +428,11 @@ lv.KEY_PREV = 11
lv.KEY_RIGHT = 19
lv.KEY_UP = 17
lv.LABEL_DOT_NUM = 3
lv.LABEL_LONG_CLIP = 4
lv.LABEL_LONG_DOT = 1
lv.LABEL_LONG_SCROLL = 2
lv.LABEL_LONG_SCROLL_CIRCULAR = 3
lv.LABEL_LONG_WRAP = 0
lv.LABEL_LONG_MODE_CLIP = 4
lv.LABEL_LONG_MODE_DOTS = 1
lv.LABEL_LONG_MODE_SCROLL = 2
lv.LABEL_LONG_MODE_SCROLL_CIRCULAR = 3
lv.LABEL_LONG_MODE_WRAP = 0
lv.LABEL_POS_LAST = 65535
lv.LABEL_TEXT_SELECTION_OFF = 65535
lv.LAYER_TYPE_NONE = 0
@ -492,6 +553,8 @@ lv.RES_OK = 1
lv.ROLLER_MODE_INFINITE = 1
lv.ROLLER_MODE_NORMAL = 0
lv.SCALE_LABEL_ENABLED_DEFAULT = 1
lv.SCALE_LABEL_ROTATE_KEEP_UPRIGHT = 524288
lv.SCALE_LABEL_ROTATE_MATCH_TICKS = 1048576
lv.SCALE_MAJOR_TICK_EVERY_DEFAULT = 5
lv.SCALE_MODE_HORIZONTAL_BOTTOM = 1
lv.SCALE_MODE_HORIZONTAL_TOP = 0
@ -501,6 +564,7 @@ lv.SCALE_MODE_ROUND_OUTER = 16
lv.SCALE_MODE_VERTICAL_LEFT = 2
lv.SCALE_MODE_VERTICAL_RIGHT = 4
lv.SCALE_NONE = 256
lv.SCALE_ROTATION_ANGLE_MASK = 524287
lv.SCALE_TOTAL_TICK_COUNT_DEFAULT = 11
lv.SCROLLBAR_MODE_ACTIVE = 2
lv.SCROLLBAR_MODE_AUTO = 3
@ -530,6 +594,9 @@ lv.SIZE_CONTENT = 1073741823
lv.SLIDER_MODE_NORMAL = 0
lv.SLIDER_MODE_RANGE = 2
lv.SLIDER_MODE_SYMMETRICAL = 1
lv.SLIDER_ORIENTATION_AUTO = 0
lv.SLIDER_ORIENTATION_HORIZONTAL = 1
lv.SLIDER_ORIENTATION_VERTICAL = 2
lv.SPAN_MODE_BREAK = 2
lv.SPAN_MODE_EXPAND = 1
lv.SPAN_MODE_FIXED = 0
@ -553,9 +620,9 @@ lv.STATE_USER_3 = 16384
lv.STATE_USER_4 = 32768
lv.STRIDE_AUTO = 0
lv.STYLE_ALIGN = 10
lv.STYLE_ANIM = 99
lv.STYLE_ANIM_DURATION = 100
lv.STYLE_ANIM_TIME = 100
lv.STYLE_ANIM = 102
lv.STYLE_ANIM_DURATION = 103
lv.STYLE_ANIM_TIME = 103
lv.STYLE_ARC_COLOR = 82
lv.STYLE_ARC_IMAGE_SRC = 84
lv.STYLE_ARC_OPA = 83
@ -576,31 +643,31 @@ lv.STYLE_BG_IMAGE_TILED = 44
lv.STYLE_BG_MAIN_OPA = 36
lv.STYLE_BG_MAIN_STOP = 33
lv.STYLE_BG_OPA = 29
lv.STYLE_BITMAP_MASK_SRC = 115
lv.STYLE_BLEND_MODE = 103
lv.STYLE_BITMAP_MASK_SRC = 117
lv.STYLE_BLEND_MODE = 105
lv.STYLE_BORDER_COLOR = 49
lv.STYLE_BORDER_OPA = 50
lv.STYLE_BORDER_POST = 53
lv.STYLE_BORDER_SIDE = 52
lv.STYLE_BORDER_WIDTH = 48
lv.STYLE_CLIP_CORNER = 45
lv.STYLE_COLOR_FILTER_DSC = 97
lv.STYLE_COLOR_FILTER_OPA = 98
lv.STYLE_FLEX_CROSS_PLACE = 127
lv.STYLE_FLEX_FLOW = 125
lv.STYLE_FLEX_GROW = 129
lv.STYLE_FLEX_MAIN_PLACE = 126
lv.STYLE_FLEX_TRACK_PLACE = 128
lv.STYLE_GRID_CELL_COLUMN_POS = 134
lv.STYLE_GRID_CELL_COLUMN_SPAN = 135
lv.STYLE_GRID_CELL_ROW_POS = 137
lv.STYLE_GRID_CELL_ROW_SPAN = 138
lv.STYLE_GRID_CELL_X_ALIGN = 136
lv.STYLE_GRID_CELL_Y_ALIGN = 139
lv.STYLE_GRID_COLUMN_ALIGN = 130
lv.STYLE_GRID_COLUMN_DSC_ARRAY = 133
lv.STYLE_GRID_ROW_ALIGN = 131
lv.STYLE_GRID_ROW_DSC_ARRAY = 132
lv.STYLE_COLOR_FILTER_DSC = 100
lv.STYLE_COLOR_FILTER_OPA = 101
lv.STYLE_FLEX_CROSS_PLACE = 124
lv.STYLE_FLEX_FLOW = 122
lv.STYLE_FLEX_GROW = 126
lv.STYLE_FLEX_MAIN_PLACE = 123
lv.STYLE_FLEX_TRACK_PLACE = 125
lv.STYLE_GRID_CELL_COLUMN_POS = 131
lv.STYLE_GRID_CELL_COLUMN_SPAN = 132
lv.STYLE_GRID_CELL_ROW_POS = 134
lv.STYLE_GRID_CELL_ROW_SPAN = 135
lv.STYLE_GRID_CELL_X_ALIGN = 133
lv.STYLE_GRID_CELL_Y_ALIGN = 136
lv.STYLE_GRID_COLUMN_ALIGN = 127
lv.STYLE_GRID_COLUMN_DSC_ARRAY = 130
lv.STYLE_GRID_ROW_ALIGN = 128
lv.STYLE_GRID_ROW_DSC_ARRAY = 129
lv.STYLE_HEIGHT = 2
lv.STYLE_IMAGE_OPA = 68
lv.STYLE_IMAGE_RECOLOR = 69
@ -608,7 +675,7 @@ lv.STYLE_IMAGE_RECOLOR_OPA = 70
lv.STYLE_IMG_OPA = 68
lv.STYLE_IMG_RECOLOR = 69
lv.STYLE_IMG_RECOLOR_OPA = 70
lv.STYLE_LAST_BUILT_IN_PROP = 140
lv.STYLE_LAST_BUILT_IN_PROP = 137
lv.STYLE_LAYOUT = 22
lv.STYLE_LENGTH = 3
lv.STYLE_LINE_COLOR = 76
@ -625,9 +692,9 @@ lv.STYLE_MAX_HEIGHT = 7
lv.STYLE_MAX_WIDTH = 5
lv.STYLE_MIN_HEIGHT = 6
lv.STYLE_MIN_WIDTH = 4
lv.STYLE_NUM_BUILT_IN_PROPS = 141
lv.STYLE_OPA = 95
lv.STYLE_OPA_LAYERED = 96
lv.STYLE_NUM_BUILT_IN_PROPS = 138
lv.STYLE_OPA = 98
lv.STYLE_OPA_LAYERED = 99
lv.STYLE_OUTLINE_COLOR = 57
lv.STYLE_OUTLINE_OPA = 58
lv.STYLE_OUTLINE_PAD = 59
@ -635,16 +702,20 @@ lv.STYLE_OUTLINE_WIDTH = 56
lv.STYLE_PAD_BOTTOM = 17
lv.STYLE_PAD_COLUMN = 21
lv.STYLE_PAD_LEFT = 18
lv.STYLE_PAD_RADIAL = 14
lv.STYLE_PAD_RIGHT = 19
lv.STYLE_PAD_ROW = 20
lv.STYLE_PAD_TOP = 16
lv.STYLE_PROP_ANY = 255
lv.STYLE_PROP_CONST = 255
lv.STYLE_PROP_INV = 0
lv.STYLE_RADIAL_OFFSET = 13
lv.STYLE_RADIUS = 12
lv.STYLE_RECOLOR = 120
lv.STYLE_RECOLOR_OPA = 121
lv.STYLE_RES_FOUND = 1
lv.STYLE_RES_NOT_FOUND = 0
lv.STYLE_ROTARY_SENSITIVITY = 116
lv.STYLE_ROTARY_SENSITIVITY = 118
lv.STYLE_SHADOW_COLOR = 61
lv.STYLE_SHADOW_OFFSET_X = 64
lv.STYLE_SHADOW_OFFSET_Y = 65
@ -664,27 +735,35 @@ lv.STYLE_TEXT_FONT = 90
lv.STYLE_TEXT_LETTER_SPACE = 91
lv.STYLE_TEXT_LINE_SPACE = 92
lv.STYLE_TEXT_OPA = 89
lv.STYLE_TRANSFORM_ANGLE = 110
lv.STYLE_TRANSFORM_HEIGHT = 105
lv.STYLE_TRANSFORM_PIVOT_X = 111
lv.STYLE_TRANSFORM_PIVOT_Y = 112
lv.STYLE_TRANSFORM_ROTATION = 110
lv.STYLE_TRANSFORM_SCALE_X = 108
lv.STYLE_TRANSFORM_SCALE_Y = 109
lv.STYLE_TRANSFORM_SKEW_X = 113
lv.STYLE_TRANSFORM_SKEW_Y = 114
lv.STYLE_TRANSFORM_WIDTH = 104
lv.STYLE_TRANSITION = 102
lv.STYLE_TRANSLATE_X = 106
lv.STYLE_TRANSLATE_Y = 107
lv.STYLE_TEXT_OUTLINE_STROKE_COLOR = 97
lv.STYLE_TEXT_OUTLINE_STROKE_OPA = 96
lv.STYLE_TEXT_OUTLINE_STROKE_WIDTH = 95
lv.STYLE_TRANSFORM_ANGLE = 112
lv.STYLE_TRANSFORM_HEIGHT = 107
lv.STYLE_TRANSFORM_PIVOT_X = 113
lv.STYLE_TRANSFORM_PIVOT_Y = 114
lv.STYLE_TRANSFORM_ROTATION = 112
lv.STYLE_TRANSFORM_SCALE_X = 110
lv.STYLE_TRANSFORM_SCALE_Y = 111
lv.STYLE_TRANSFORM_SKEW_X = 115
lv.STYLE_TRANSFORM_SKEW_Y = 116
lv.STYLE_TRANSFORM_WIDTH = 106
lv.STYLE_TRANSITION = 104
lv.STYLE_TRANSLATE_RADIAL = 119
lv.STYLE_TRANSLATE_X = 108
lv.STYLE_TRANSLATE_Y = 109
lv.STYLE_WIDTH = 1
lv.STYLE_X = 8
lv.STYLE_Y = 9
lv.SWITCH_ORIENTATION_AUTO = 0
lv.SWITCH_ORIENTATION_HORIZONTAL = 1
lv.SWITCH_ORIENTATION_VERTICAL = 2
lv.TABLE_CELL_CTRL_CUSTOM_1 = 16
lv.TABLE_CELL_CTRL_CUSTOM_2 = 32
lv.TABLE_CELL_CTRL_CUSTOM_3 = 64
lv.TABLE_CELL_CTRL_CUSTOM_4 = 128
lv.TABLE_CELL_CTRL_MERGE_RIGHT = 1
lv.TABLE_CELL_CTRL_NONE = 0
lv.TABLE_CELL_CTRL_TEXT_CROP = 2
lv.TABLE_CELL_NONE = 65535
lv.TEXTAREA_CURSOR_LAST = 32767
@ -692,6 +771,9 @@ lv.TEXT_ALIGN_AUTO = 0
lv.TEXT_ALIGN_CENTER = 2
lv.TEXT_ALIGN_LEFT = 1
lv.TEXT_ALIGN_RIGHT = 3
lv.TEXT_CMD_STATE_IN = 2
lv.TEXT_CMD_STATE_PAR = 1
lv.TEXT_CMD_STATE_WAIT = 0
lv.TEXT_DECOR_NONE = 0
lv.TEXT_DECOR_STRIKETHROUGH = 2
lv.TEXT_DECOR_UNDERLINE = 1
@ -699,4 +781,7 @@ lv.TEXT_FLAG_BREAK_ALL = 4
lv.TEXT_FLAG_EXPAND = 1
lv.TEXT_FLAG_FIT = 2
lv.TEXT_FLAG_NONE = 0
lv.TEXT_FLAG_RECOLOR = 8
lv.TREE_WALK_POST_ORDER = 1
lv.TREE_WALK_PRE_ORDER = 0
lv.ZOOM_NONE = 256

View File

@ -4705,13 +4705,13 @@ be_local_class(lvh_obj,
{ be_const_key_weak(_event_map, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(7,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(7, -1), be_nested_str_weak(up) },
{ be_const_key_int(8, 2), be_nested_str_weak(release) },
{ be_const_key_int(35, -1), be_nested_str_weak(changed) },
{ be_const_key_int(8, 5), be_nested_str_weak(long) },
{ be_const_key_int(9, -1), be_nested_str_weak(hold) },
{ be_const_key_int(10, 6), be_nested_str_weak(up) },
{ be_const_key_int(11, -1), be_nested_str_weak(release) },
{ be_const_key_int(1, -1), be_nested_str_weak(down) },
{ be_const_key_int(3, -1), be_nested_str_weak(lost) },
{ be_const_key_int(32, -1), be_nested_str_weak(changed) },
{ be_const_key_int(5, -1), be_nested_str_weak(long) },
{ be_const_key_int(6, -1), be_nested_str_weak(hold) },
})) ) } )) },
{ be_const_key_weak(register_event_cb, -1), be_const_closure(class_lvh_obj_register_event_cb_closure) },
{ be_const_key_weak(get_pad_left, 11), be_const_closure(class_lvh_obj_get_pad_left_closure) },
@ -4745,7 +4745,7 @@ be_local_class(lvh_obj,
{ be_const_key_weak(_lv_label, -1), be_const_var(0) },
{ be_const_key_weak(get_pad_right, 9), be_const_closure(class_lvh_obj_get_pad_right_closure) },
{ be_const_key_weak(set_value_font, -1), be_const_closure(class_lvh_obj_set_value_font_closure) },
{ be_const_key_weak(_EVENTS, 16), be_const_bytes_instance(010703080520) },
{ be_const_key_weak(_EVENTS, 16), be_const_bytes_instance(010A030B0823) },
{ be_const_key_weak(get_pad_bottom, 50), be_const_closure(class_lvh_obj_get_pad_bottom_closure) },
{ be_const_key_weak(set_text_font, -1), be_const_closure(class_lvh_obj_set_text_font_closure) },
{ be_const_key_weak(set_pad_right2, -1), be_const_closure(class_lvh_obj_set_pad_right2_closure) },

View File

@ -1,5 +1,5 @@
MIT licence
Copyright (c) 2021 LVGL Kft
Copyright (c) 2025 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:

View File

@ -2,7 +2,7 @@
<a href="https://github.com/sponsors/lvgl" target="_blank"><img align="left" src="https://lvgl.io/github-assets/sponsor.png" height="32px"></a>
<p align="right">
<b>English</b> | <a href="./docs/README_zh.rst">中文</a> | <a href="./docs/README_pt_BR.rst">Português do Brasil</a> | <a href="./docs/README_jp.rst">日本語</a>
<b>English</b> | <a href="./docs/README_zh.md">中文</a> | <a href="./docs/README_pt_BR.md">Português do Brasil</a> | <a href="./docs/README_jp.md">日本語</a>
</p>
<br>
@ -44,31 +44,31 @@ Our team is ready to help you with graphics design, UI implementation and consul
**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)
- Supports monochrome, ePaper, OLED or TFT displays, or even monitors. [Displays](https://docs.lvgl.io/master/details/main-modules/display/index.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.
- 30+ built-in [Widgets](https://docs.lvgl.io/master/details/widgets/index.html):  Button, Label, Slider, Chart, Keyboard, Meter, Arc, Table and many more.
- Flexible [Style system](https://docs.lvgl.io/master/details/common-widget-features/styles/style.html) with  ~100 style properties to customize any part of the widgets in any state.
- [Flexbox](https://docs.lvgl.io/master/details/common-widget-features/layouts/flex.html) and [Grid](https://docs.lvgl.io/master/details/common-widget-features/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/display.html#multiple-display-support) support.
- Supports Mouse, Touchpad, Keypad, Keyboard, External buttons, Encoder [Input devices](https://docs.lvgl.io/master/details/main-modules/indev.html).
- [Multiple display](https://docs.lvgl.io/master/details/main-modules/display/overview.html#how-many-displays-can-lvgl-use) 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/integration/building/cmake.html) is included out of the box.
- [Develop on PC](https://docs.lvgl.io/master/integration/ide/pc-simulator.html) and use the same UI code on embedded hardware.
- Support for Make and [CMake](https://docs.lvgl.io/master/details/integration/building/cmake.html) is included out of the box.
- [Develop on PC](https://docs.lvgl.io/master/details/integration/ide/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)
- Detailed [Documentation](https://docs.lvgl.io/) with [100+ simple examples](https://docs.lvgl.io/master/examples.html)
- [Services](https://lvgl.io/services) such as User interface design, Implementation and Consulting to make UI development simpler and faster.
## :heart: Sponsor
@ -88,17 +88,17 @@ If someone implements or fixes an issue labeled as [Sponsored](https://github.co
[![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)
[![Backers of LVGL](https://contrib.rocks/image?repo=lvgl/lvgl&max=48)](https://opencollective.com/lvgl)
## :package: Packages
LVGL is available as:
- [Arduino library](https://docs.lvgl.io/master/integration/framework/arduino.html)
- [Arduino library](https://docs.lvgl.io/master/details/integration/framework/arduino.html)
- [PlatformIO package](https://registry.platformio.org/libraries/lvgl/lvgl)
- [Zephyr library](https://docs.lvgl.io/master/integration/os/zephyr.html)
- [Zephyr library](https://docs.lvgl.io/master/details/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)
- [NuttX library](https://docs.lvgl.io/master/details/integration/os/nuttx.html)
- [RT-Thread RTOS](https://docs.lvgl.io/master/details/integration/os/rt-thread.html)
- CMSIS-Pack
- [RIOT OS package](https://doc.riot-os.org/group__pkg__lvgl.html#details)
@ -378,7 +378,7 @@ 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_style_text_font(cz_label, &lv_font_source_han_sans_sc_16_cjk, 0);
lv_obj_set_width(cz_label, 310);
lv_obj_align(cz_label, LV_ALIGN_BOTTOM_LEFT, 5, -5);
```
@ -403,10 +403,10 @@ 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")
font_hans_sans_16_cjk = lv.font_load("S:../../assets/font/lv_font_source_han_sans_sc_16_cjk.fnt")
cz_label = lv.label(lv.screen_active())
cz_label.set_style_text_font(font_simsun_16_cjk, 0)
cz_label.set_style_text_font(font_hans_sans_16_cjk, 0)
cz_label.set_text("嵌入式系统Embedded System\n是一种嵌入机械或电气系统内部、具有专一功能和实时计算性能的计算机系统。")
cz_label.set_width(310)
cz_label.align(lv.ALIGN.BOTTOM_LEFT, 5, -5)
@ -419,25 +419,25 @@ 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)
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/intro/getting_started.html#lvgl-basics) 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_)
4. Set up a [Simulator](https://docs.lvgl.io/master/details/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/details/integration/adding-lvgl-to-your-project/index.html) guide or check out 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
7. Read the [Main-Modules](https://docs.lvgl.io/master/details/main-modules/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/details/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)
10. Read the [Contributing](https://docs.lvgl.io/master/contributing/index.html) guide to see how you can help to improve LVGL (15 minutes)
## :handshake: Services
@ -457,7 +457,7 @@ Check out our [Demos](https://lvgl.io/demos) as reference. For more information
## :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.
For a detailed description of contribution opportunities visit the [Contributing](https://docs.lvgl.io/master/contributing/index.html) section of the documentation.
More than 300 people already left their fingerprint in LVGL. Be one them! See you here! :slightly_smiling_face:

View File

@ -1,6 +1,6 @@
{
"name": "lvgl",
"version": "9.2.2",
"version": "9.3.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": {

View File

@ -1,5 +1,5 @@
name=lvgl
version=9.2.2
version=9.3.0
author=kisvegabor
maintainer=kisvegabor,embeddedt,pete-pjb
sentence=Full-featured Graphics Library for Embedded Systems

File diff suppressed because it is too large Load Diff

View File

@ -7,8 +7,8 @@
#define LVGL_VERSION_H
#define LVGL_VERSION_MAJOR 9
#define LVGL_VERSION_MINOR 2
#define LVGL_VERSION_PATCH 2
#define LVGL_VERSION_MINOR 3
#define LVGL_VERSION_PATCH 0
#define LVGL_VERSION_INFO ""
#endif /* LVGL_VERSION_H */

View File

@ -33,12 +33,17 @@ extern "C" {
#include "src/misc/lv_profiler_builtin.h"
#include "src/misc/lv_rb.h"
#include "src/misc/lv_utils.h"
#include "src/misc/lv_iter.h"
#include "src/misc/lv_circle_buf.h"
#include "src/misc/lv_tree.h"
#include "src/misc/cache/lv_cache.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/indev/lv_indev_gesture.h"
#include "src/core/lv_refr.h"
#include "src/display/lv_display.h"
@ -78,6 +83,7 @@ extern "C" {
#include "src/widgets/textarea/lv_textarea.h"
#include "src/widgets/tileview/lv_tileview.h"
#include "src/widgets/win/lv_win.h"
#include "src/widgets/3dtexture/lv_3dtexture.h"
#include "src/others/snapshot/lv_snapshot.h"
#include "src/others/sysmon/lv_sysmon.h"
@ -88,6 +94,10 @@ extern "C" {
#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/others/font_manager/lv_font_manager.h"
#include "src/others/xml/lv_xml.h"
#include "src/others/xml/lv_xml_component.h"
#include "src/others/test/lv_test.h"
#include "src/libs/barcode/lv_barcode.h"
#include "src/libs/bin_decoder/lv_bin_decoder.h"
@ -104,13 +114,14 @@ extern "C" {
#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/libs/svg/lv_svg.h"
#include "src/libs/svg/lv_svg_render.h"
#include "src/layouts/lv_layout.h"
#include "src/draw/lv_draw.h"
#include "src/draw/lv_draw_buf.h"
#include "src/draw/lv_draw_vector.h"
#include "src/draw/sw/lv_draw_sw.h"
#include "src/draw/sw/lv_draw_sw_utils.h"
#include "src/themes/lv_theme.h"
@ -124,6 +135,7 @@ extern "C" {
#include "src/lvgl_private.h"
#endif
/*********************
* DEFINES
*********************/

View File

@ -0,0 +1,127 @@
/**
* @file lvgl_private.h
*
*/
#ifndef LVGL_PRIVATE_H
#define LVGL_PRIVATE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "src/core/lv_global.h"
#include "src/display/lv_display_private.h"
#include "src/indev/lv_indev_private.h"
#include "src/misc/lv_text_private.h"
#include "src/misc/cache/lv_cache_entry_private.h"
#include "src/misc/cache/lv_cache_private.h"
#include "src/layouts/lv_layout_private.h"
#include "src/stdlib/lv_mem_private.h"
#include "src/others/file_explorer/lv_file_explorer_private.h"
#include "src/others/sysmon/lv_sysmon_private.h"
#include "src/others/monkey/lv_monkey_private.h"
#include "src/others/ime/lv_ime_pinyin_private.h"
#include "src/others/fragment/lv_fragment_private.h"
#include "src/others/observer/lv_observer_private.h"
#include "src/others/xml/lv_xml_private.h"
#include "src/libs/qrcode/lv_qrcode_private.h"
#include "src/libs/barcode/lv_barcode_private.h"
#include "src/libs/gif/lv_gif_private.h"
#include "src/draw/lv_draw_triangle_private.h"
#include "src/draw/lv_draw_private.h"
#include "src/draw/lv_draw_rect_private.h"
#include "src/draw/lv_draw_image_private.h"
#include "src/draw/lv_image_decoder_private.h"
#include "src/draw/lv_draw_label_private.h"
#include "src/draw/lv_draw_vector_private.h"
#include "src/draw/lv_draw_buf_private.h"
#include "src/draw/lv_draw_mask_private.h"
#include "src/draw/sw/lv_draw_sw_private.h"
#include "src/draw/sw/lv_draw_sw_mask_private.h"
#include "src/draw/sw/blend/lv_draw_sw_blend_private.h"
#include "src/drivers/libinput/lv_xkb_private.h"
#include "src/drivers/libinput/lv_libinput_private.h"
#include "src/drivers/evdev/lv_evdev_private.h"
#include "src/font/lv_font_fmt_txt_private.h"
#include "src/themes/lv_theme_private.h"
#include "src/core/lv_refr_private.h"
#include "src/core/lv_obj_style_private.h"
#include "src/core/lv_obj_private.h"
#include "src/core/lv_obj_scroll_private.h"
#include "src/core/lv_obj_draw_private.h"
#include "src/core/lv_obj_class_private.h"
#include "src/core/lv_group_private.h"
#include "src/core/lv_obj_event_private.h"
#include "src/misc/lv_timer_private.h"
#include "src/misc/lv_area_private.h"
#include "src/misc/lv_fs_private.h"
#include "src/misc/lv_profiler_builtin_private.h"
#include "src/misc/lv_event_private.h"
#include "src/misc/lv_bidi_private.h"
#include "src/misc/lv_rb_private.h"
#include "src/misc/lv_style_private.h"
#include "src/misc/lv_color_op_private.h"
#include "src/misc/lv_anim_private.h"
#include "src/widgets/msgbox/lv_msgbox_private.h"
#include "src/widgets/buttonmatrix/lv_buttonmatrix_private.h"
#include "src/widgets/slider/lv_slider_private.h"
#include "src/widgets/switch/lv_switch_private.h"
#include "src/widgets/calendar/lv_calendar_private.h"
#include "src/widgets/imagebutton/lv_imagebutton_private.h"
#include "src/widgets/bar/lv_bar_private.h"
#include "src/widgets/image/lv_image_private.h"
#include "src/widgets/textarea/lv_textarea_private.h"
#include "src/widgets/table/lv_table_private.h"
#include "src/widgets/checkbox/lv_checkbox_private.h"
#include "src/widgets/roller/lv_roller_private.h"
#include "src/widgets/win/lv_win_private.h"
#include "src/widgets/keyboard/lv_keyboard_private.h"
#include "src/widgets/line/lv_line_private.h"
#include "src/widgets/animimage/lv_animimage_private.h"
#include "src/widgets/dropdown/lv_dropdown_private.h"
#include "src/widgets/menu/lv_menu_private.h"
#include "src/widgets/chart/lv_chart_private.h"
#include "src/widgets/button/lv_button_private.h"
#include "src/widgets/scale/lv_scale_private.h"
#include "src/widgets/led/lv_led_private.h"
#include "src/widgets/arc/lv_arc_private.h"
#include "src/widgets/tileview/lv_tileview_private.h"
#include "src/widgets/spinbox/lv_spinbox_private.h"
#include "src/widgets/span/lv_span_private.h"
#include "src/widgets/label/lv_label_private.h"
#include "src/widgets/canvas/lv_canvas_private.h"
#include "src/widgets/tabview/lv_tabview_private.h"
#include "src/widgets/3dtexture/lv_3dtexture_private.h"
#include "src/tick/lv_tick_private.h"
#include "src/stdlib/builtin/lv_tlsf_private.h"
#include "src/libs/rlottie/lv_rlottie_private.h"
#include "src/libs/ffmpeg/lv_ffmpeg_private.h"
#include "src/widgets/lottie/lv_lottie_private.h"
#include "src/osal/lv_os_private.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*LVGL_PRIVATE_H*/

View File

@ -35,6 +35,10 @@ extern "C" {
#include "../font/lv_font_fmt_txt_private.h"
#endif
#if LV_USE_OS != LV_OS_NONE && defined(__linux__)
#include "../osal/lv_linux_private.h"
#endif
#include "../tick/lv_tick.h"
#include "../layouts/lv_layout.h"
@ -49,6 +53,7 @@ extern "C" {
#include "../draw/sw/lv_draw_sw_mask_private.h"
#include "../stdlib/builtin/lv_tlsf_private.h"
#include "../others/sysmon/lv_sysmon_private.h"
#include "../others/test/lv_test_private.h"
#include "../layouts/lv_layout_private.h"
/*********************
@ -65,18 +70,18 @@ struct _snippet_stack;
#endif
#if LV_USE_FREETYPE
struct lv_freetype_context_t;
struct _lv_freetype_context_t;
#endif
#if LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN
struct lv_profiler_builtin_ctx_t;
struct _lv_profiler_builtin_ctx_t;
#endif
#if LV_USE_NUTTX
struct lv_nuttx_ctx_t;
struct _lv_nuttx_ctx_t;
#endif
typedef struct lv_global_t {
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 */
@ -122,6 +127,7 @@ typedef struct lv_global_t {
lv_cache_t * img_header_cache;
lv_draw_global_info_t draw_info;
lv_ll_t draw_sw_blend_handler_ll;
#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
@ -169,6 +175,10 @@ typedef struct lv_global_t {
lv_fs_drv_t win32_fs_drv;
#endif
#if LV_USE_FS_UEFI
lv_fs_drv_t uefi_fs_drv;
#endif
#if LV_USE_FS_LITTLEFS
lv_fs_drv_t littlefs_fs_drv;
#endif
@ -182,7 +192,7 @@ typedef struct lv_global_t {
#endif
#if LV_USE_FREETYPE
struct lv_freetype_context_t * ft_context;
struct _lv_freetype_context_t * ft_context;
#endif
#if LV_USE_FONT_COMPRESSED
@ -194,7 +204,7 @@ typedef struct lv_global_t {
#endif
#if LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN
struct lv_profiler_builtin_ctx_t * profiler_context;
struct _lv_profiler_builtin_ctx_t * profiler_context;
#endif
#if LV_USE_FILE_EXPLORER != 0
@ -214,12 +224,19 @@ typedef struct lv_global_t {
uint32_t objid_count;
#endif
#if LV_USE_TEST
lv_test_state_t test_state;
#endif
#if LV_USE_NUTTX
struct lv_nuttx_ctx_t * nuttx_ctx;
struct _lv_nuttx_ctx_t * nuttx_ctx;
#endif
#if LV_USE_OS != LV_OS_NONE
lv_mutex_t lv_general_mutex;
#if defined(__linux__)
lv_proc_stat_t linux_last_proc_stat;
#endif
#endif
#if LV_USE_OS == LV_OS_FREERTOS
@ -229,6 +246,9 @@ typedef struct lv_global_t {
bool freertos_idle_task_running;
#endif
#if LV_USE_EVDEV
lv_evdev_discovery_t * evdev_discovery;
#endif
void * user_data;
} lv_global_t;

View File

@ -21,7 +21,7 @@ extern "C" {
/*********************
* DEFINES
*********************/
/** Predefined keys to control focused object via lv_group_send(group, c) */
/** Predefined keys to control which Widget has focus via lv_group_send(group, c) */
typedef enum {
LV_KEY_UP = 17, /*0x11*/
LV_KEY_DOWN = 18, /*0x12*/
@ -54,90 +54,91 @@ typedef enum {
**********************/
/**
* Create a new object group
* @return pointer to the new object group
* Create new Widget group.
* @return pointer to the new Widget group
*/
lv_group_t * lv_group_create(void);
/**
* Delete a group object
* Delete 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`
* Set default group. New Widgets will be 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
* Get default group.
* @return pointer to the default group
*/
lv_group_t * lv_group_get_default(void);
/**
* Add an object to a group
* Add an Widget to group.
* @param group pointer to a group
* @param obj pointer to an object to add
* @param obj pointer to a Widget 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 another object
* Swap 2 Widgets in group. Widgets must be in the same group.
* @param obj1 pointer to a Widget
* @param obj2 pointer to another Widget
*/
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
* Remove a Widget from its group.
* @param obj pointer to Widget to remove
*/
void lv_group_remove_obj(lv_obj_t * obj);
/**
* Remove all objects from a group
* Remove all Widgets 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
* Focus on a Widget (defocus the current).
* @param obj pointer to Widget to focus on
*/
void lv_group_focus_obj(lv_obj_t * obj);
/**
* Focus the next object in a group (defocus the current)
* Focus on next Widget 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)
* Focus on previous Widget 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
* Do not allow changing focus from current Widget.
* @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
* Send a control character to Widget that has focus in a group.
* @param group pointer to a group
* @param c a character (use LV_KEY_.. to navigate)
* @return result of focused object in group.
* @return result of Widget with focus 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
* Set a function for a group which will be called when a new Widget has focus.
* @param group pointer to a group
* @param focus_cb the call back function or NULL if unused
*/
@ -151,8 +152,8 @@ void lv_group_set_focus_cb(lv_group_t * group, lv_group_focus_cb_t focus_cb);
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.
* Set whether the next or previous Widget in a group gets focus when Widget that has
* focus is deleted.
* @param group pointer to a group
* @param policy new refocus policy enum
*/
@ -166,69 +167,71 @@ void lv_group_set_refocus_policy(lv_group_t * group, lv_group_refocus_policy_t p
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.
* Set whether moving focus to next/previous Widget will allow wrapping from
* first->last or last->first Widget.
* @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
* Get Widget that has focus, or NULL if there isn't one.
* @param group pointer to a group
* @return pointer to the focused object
* @return pointer to Widget with focus
*/
lv_obj_t * lv_group_get_focused(const lv_group_t * group);
/**
* Get the focus callback function of a group
* Get 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
* Get 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).
* Get 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.
* Get whether moving focus to next/previous Widget will allow wrapping from
* first->last or last->first Widget.
* @param group pointer to group
*/
bool lv_group_get_wrap(lv_group_t * group);
/**
* Get the number of object in the group
* Get number of Widgets in group.
* @param group pointer to a group
* @return number of objects in the group
* @return number of Widgets in the group
*/
uint32_t lv_group_get_obj_count(lv_group_t * group);
/**
* Get the nth object within a group
* Get nth Widget within group.
* @param group pointer to a group
* @param index index of object within the group
* @return pointer to the object
* @param index index of Widget within the group
* @return pointer to Widget
*/
lv_obj_t * lv_group_get_obj_by_index(lv_group_t * group, uint32_t index);
/**
* Get the number of groups
* Get the number of groups.
* @return number of groups
*/
uint32_t lv_group_get_count(void);
/**
* Get a group by its index
* Get a group by its index.
* @param index index of the group
* @return pointer to the group
*/

View File

@ -28,7 +28,7 @@ extern "C" {
* 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 {
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*/

View File

@ -187,7 +187,7 @@ const lv_obj_class_t lv_obj_class = {
.group_def = LV_OBJ_CLASS_GROUP_DEF_FALSE,
.instance_size = (sizeof(lv_obj_t)),
.base_class = NULL,
.name = "obj",
.name = "lv_obj",
#if LV_USE_OBJ_PROPERTY
.prop_index_start = LV_PROPERTY_OBJ_START,
.prop_index_end = LV_PROPERTY_OBJ_END,
@ -231,6 +231,8 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent)
void lv_obj_add_flag(lv_obj_t * obj, lv_obj_flag_t f)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
if(lv_obj_has_flag(obj, f)) /*Check if all flags are set*/
return;
bool was_on_layout = lv_obj_is_layout_positioned(obj);
@ -268,6 +270,8 @@ void lv_obj_add_flag(lv_obj_t * obj, lv_obj_flag_t f)
void lv_obj_remove_flag(lv_obj_t * obj, lv_obj_flag_t f)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
if(!lv_obj_has_flag_any(obj, f))
return;
bool was_on_layout = lv_obj_is_layout_positioned(obj);
if(f & LV_OBJ_FLAG_SCROLLABLE) {
@ -281,10 +285,8 @@ void lv_obj_remove_flag(lv_obj_t * obj, lv_obj_flag_t f)
if(f & LV_OBJ_FLAG_HIDDEN) {
lv_obj_invalidate(obj);
if(lv_obj_is_layout_positioned(obj)) {
lv_obj_mark_layout_as_dirty(lv_obj_get_parent(obj));
lv_obj_mark_layout_as_dirty(obj);
}
lv_obj_mark_layout_as_dirty(lv_obj_get_parent(obj));
lv_obj_mark_layout_as_dirty(obj);
}
if((was_on_layout != lv_obj_is_layout_positioned(obj)) || (f & (LV_OBJ_FLAG_LAYOUT_1 | LV_OBJ_FLAG_LAYOUT_2))) {
@ -293,7 +295,7 @@ void lv_obj_remove_flag(lv_obj_t * obj, lv_obj_flag_t f)
}
void lv_obj_update_flag(lv_obj_t * obj, lv_obj_flag_t f, bool v)
void lv_obj_set_flag(lv_obj_t * obj, lv_obj_flag_t f, bool v)
{
if(v) lv_obj_add_flag(obj, f);
else lv_obj_remove_flag(obj, f);
@ -305,11 +307,6 @@ void lv_obj_add_state(lv_obj_t * obj, lv_state_t state)
lv_state_t new_state = obj->state | state;
if(obj->state != new_state) {
if(new_state & ~obj->state & LV_STATE_DISABLED) {
lv_indev_reset(NULL, obj);
}
update_obj_state(obj, new_state);
}
}
@ -439,8 +436,10 @@ void * lv_obj_get_id(const lv_obj_t * obj)
return obj->id;
}
lv_obj_t * lv_obj_get_child_by_id(const lv_obj_t * obj, const void * id)
lv_obj_t * lv_obj_find_by_id(const lv_obj_t * obj, const void * id)
{
LV_LOG_WARN("DEPRECATED: IDs are used only to print the widget trees. To find a widget use obj_name");
if(obj == NULL) obj = lv_display_get_screen_active(NULL);
if(obj == NULL) return NULL;
@ -454,7 +453,7 @@ lv_obj_t * lv_obj_get_child_by_id(const lv_obj_t * obj, const void * id)
/*Search children*/
for(i = 0; i < child_cnt; i++) {
lv_obj_t * child = obj->spec_attr->children[i];
lv_obj_t * found = lv_obj_get_child_by_id(child, id);
lv_obj_t * found = lv_obj_find_by_id(child, id);
if(found != NULL) return found;
}
@ -536,6 +535,18 @@ static void lv_obj_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj)
}
lv_event_remove_all(&obj->spec_attr->event_list);
#if LV_USE_OBJ_NAME
if(obj->spec_attr->name && !obj->spec_attr->name_static) {
lv_free((void *)obj->spec_attr->name);
}
#endif
#if LV_DRAW_TRANSFORM_USE_MATRIX
if(obj->spec_attr->matrix) {
lv_free(obj->spec_attr->matrix);
obj->spec_attr->matrix = NULL;
}
#endif
lv_free(obj->spec_attr);
obj->spec_attr = NULL;
@ -582,7 +593,8 @@ static void lv_obj_draw(lv_event_t * e)
}
if(lv_obj_get_style_bg_grad_dir(obj, 0) != LV_GRAD_DIR_NONE) {
if(lv_obj_get_style_bg_grad_opa(obj, 0) < LV_OPA_MAX) {
if(lv_obj_get_style_bg_grad_opa(obj, 0) < LV_OPA_MAX ||
lv_obj_get_style_bg_main_opa(obj, 0) < LV_OPA_MAX) {
info->res = LV_COVER_RES_NOT_COVER;
return;
}
@ -603,6 +615,7 @@ static void lv_obj_draw(lv_event_t * e)
lv_layer_t * layer = lv_event_get_layer(e);
lv_draw_rect_dsc_t draw_dsc;
lv_draw_rect_dsc_init(&draw_dsc);
draw_dsc.base.layer = layer;
lv_obj_init_draw_rect_dsc(obj, LV_PART_MAIN, &draw_dsc);
/*If the border is drawn later disable loading its properties*/
@ -623,13 +636,15 @@ static void lv_obj_draw(lv_event_t * e)
draw_scrollbar(obj, layer);
/*If the border is drawn later disable loading other properties*/
if(lv_obj_get_style_border_post(obj, LV_PART_MAIN)) {
if(lv_obj_get_style_border_width(obj, LV_PART_MAIN) &&
lv_obj_get_style_border_post(obj, LV_PART_MAIN)) {
lv_draw_rect_dsc_t draw_dsc;
lv_draw_rect_dsc_init(&draw_dsc);
draw_dsc.bg_opa = LV_OPA_TRANSP;
draw_dsc.bg_image_opa = LV_OPA_TRANSP;
draw_dsc.outline_opa = LV_OPA_TRANSP;
draw_dsc.shadow_opa = LV_OPA_TRANSP;
draw_dsc.base.layer = layer;
lv_obj_init_draw_rect_dsc(obj, LV_PART_MAIN, &draw_dsc);
int32_t w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN);

View File

@ -252,7 +252,7 @@ void lv_obj_remove_flag(lv_obj_t * obj, lv_obj_flag_t f);
* @param f OR-ed values from `lv_obj_flag_t` to update.
* @param v true: add the flags; false: remove the flags
*/
void lv_obj_update_flag(lv_obj_t * obj, lv_obj_flag_t f, bool v);
void lv_obj_set_flag(lv_obj_t * obj, lv_obj_flag_t f, bool v);
/**
* Add one or more states to the object. The other state bits will remain unchanged.
@ -399,6 +399,9 @@ void lv_obj_set_id(lv_obj_t * obj, void * id);
void * lv_obj_get_id(const lv_obj_t * obj);
/**
* DEPRECATED IDs are used only to print the widget trees.
* To find a widget use `lv_obj_find_by_name`
*
* Get the child object by its id.
* It will check children and grandchildren recursively.
* Function `lv_obj_id_compare` is used to matched obj id with given id.
@ -407,7 +410,7 @@ void * lv_obj_get_id(const lv_obj_t * obj);
* @param id the id of the child object
* @return pointer to the child object or NULL if not found
*/
lv_obj_t * lv_obj_get_child_by_id(const lv_obj_t * obj, const void * id);
lv_obj_t * lv_obj_find_by_id(const lv_obj_t * obj, const void * id);
/**
* Assign id to object if not previously assigned.
@ -470,7 +473,7 @@ void lv_objid_builtin_destroy(void);
LV_ASSERT_MSG(lv_obj_is_valid(obj_p) == true, "The object is invalid, deleted or corrupted?"); \
} while(0)
# else
# define LV_ASSERT_OBJ(obj_p, obj_class) do{}while(0)
# define LV_ASSERT_OBJ(obj_p, obj_class) LV_ASSERT_NULL(obj_p)
#endif
#if LV_USE_LOG && LV_LOG_TRACE_OBJ_CREATE

View File

@ -28,7 +28,7 @@ extern "C" {
* Describe the common methods of every object.
* Similar to a C++ class.
*/
struct lv_obj_class_t {
struct _lv_obj_class_t {
const lv_obj_class_t * base_class;
/** class_p is the final class while obj->class_p is the class currently being [de]constructed. */
void (*constructor_cb)(const lv_obj_class_t * class_p, lv_obj_t * obj);

View File

@ -27,6 +27,12 @@
* STATIC PROTOTYPES
**********************/
static inline lv_opa_t get_layer_opa(const lv_obj_t * obj, lv_part_t part, const lv_draw_dsc_base_t * base_dsc);
static lv_color_t normal_apply_layer_recolor(const lv_obj_t * obj, lv_part_t part, const lv_draw_dsc_base_t * base_dsc,
lv_color_t color);
static lv_color32_t image_apply_layer_recolor(const lv_obj_t * obj, lv_part_t part,
const lv_draw_dsc_base_t * base_dsc, lv_color_t color, lv_opa_t opa);
/**********************
* STATIC VARIABLES
**********************/
@ -41,10 +47,11 @@
void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_t * draw_dsc)
{
LV_PROFILER_DRAW_BEGIN;
draw_dsc->base.obj = obj;
draw_dsc->base.part = part;
lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, part);
lv_opa_t opa = get_layer_opa(obj, part, &draw_dsc->base);
if(part != LV_PART_MAIN) {
if(opa <= LV_OPA_MIN) {
draw_dsc->bg_opa = LV_OPA_TRANSP;
@ -52,6 +59,7 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_
draw_dsc->border_opa = LV_OPA_TRANSP;
draw_dsc->outline_opa = LV_OPA_TRANSP;
draw_dsc->shadow_opa = LV_OPA_TRANSP;
LV_PROFILER_DRAW_END;
return;
}
}
@ -61,7 +69,8 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_
if(draw_dsc->bg_opa != LV_OPA_TRANSP) {
draw_dsc->bg_opa = lv_obj_get_style_bg_opa(obj, part);
if(draw_dsc->bg_opa > LV_OPA_MIN) {
draw_dsc->bg_color = lv_obj_get_style_bg_color_filtered(obj, part);
lv_color_t bg_color = lv_obj_get_style_bg_color_filtered(obj, part);
draw_dsc->bg_color = normal_apply_layer_recolor(obj, part, &draw_dsc->base, bg_color);
const lv_grad_dsc_t * grad = lv_obj_get_style_bg_grad(obj, part);
if(grad && grad->dir != LV_GRAD_DIR_NONE) {
lv_memcpy(&draw_dsc->bg_grad, grad, sizeof(*grad));
@ -69,8 +78,9 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_
else {
draw_dsc->bg_grad.dir = lv_obj_get_style_bg_grad_dir(obj, part);
if(draw_dsc->bg_grad.dir != LV_GRAD_DIR_NONE) {
draw_dsc->bg_grad.stops[0].color = lv_obj_get_style_bg_color_filtered(obj, part);
draw_dsc->bg_grad.stops[1].color = lv_obj_get_style_bg_grad_color_filtered(obj, part);
draw_dsc->bg_grad.stops[0].color = draw_dsc->bg_color;
lv_color_t bg_grad_color = lv_obj_get_style_bg_grad_color_filtered(obj, part);
draw_dsc->bg_grad.stops[1].color = normal_apply_layer_recolor(obj, part, &draw_dsc->base, bg_grad_color);
draw_dsc->bg_grad.stops[0].frac = lv_obj_get_style_bg_main_stop(obj, part);
draw_dsc->bg_grad.stops[1].frac = lv_obj_get_style_bg_grad_stop(obj, part);
draw_dsc->bg_grad.stops[0].opa = lv_obj_get_style_bg_main_opa(obj, part);
@ -86,7 +96,8 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_
draw_dsc->border_opa = lv_obj_get_style_border_opa(obj, part);
if(draw_dsc->border_opa > LV_OPA_MIN) {
draw_dsc->border_side = lv_obj_get_style_border_side(obj, part);
draw_dsc->border_color = lv_obj_get_style_border_color_filtered(obj, part);
lv_color_t border_color = lv_obj_get_style_border_color_filtered(obj, part);
draw_dsc->border_color = normal_apply_layer_recolor(obj, part, &draw_dsc->base, border_color);
}
}
}
@ -97,7 +108,8 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_
draw_dsc->outline_opa = lv_obj_get_style_outline_opa(obj, part);
if(draw_dsc->outline_opa > LV_OPA_MIN) {
draw_dsc->outline_pad = lv_obj_get_style_outline_pad(obj, part);
draw_dsc->outline_color = lv_obj_get_style_outline_color_filtered(obj, part);
lv_color_t outline_color = lv_obj_get_style_outline_color_filtered(obj, part);
draw_dsc->outline_color = normal_apply_layer_recolor(obj, part, &draw_dsc->base, outline_color);
}
}
}
@ -109,11 +121,15 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_
if(draw_dsc->bg_image_opa > LV_OPA_MIN) {
if(lv_image_src_get_type(draw_dsc->bg_image_src) == LV_IMAGE_SRC_SYMBOL) {
draw_dsc->bg_image_symbol_font = lv_obj_get_style_text_font(obj, part);
draw_dsc->bg_image_recolor = lv_obj_get_style_text_color_filtered(obj, part);
lv_color_t text_color = lv_obj_get_style_text_color_filtered(obj, part);
draw_dsc->bg_image_recolor = normal_apply_layer_recolor(obj, part, &draw_dsc->base, text_color);
}
else {
draw_dsc->bg_image_recolor = lv_obj_get_style_bg_image_recolor_filtered(obj, part);
draw_dsc->bg_image_recolor_opa = lv_obj_get_style_bg_image_recolor_opa(obj, part);
lv_color_t bg_image_recolor = lv_obj_get_style_bg_image_recolor_filtered(obj, part);
lv_opa_t bg_image_recolor_opa = lv_obj_get_style_bg_image_recolor_opa(obj, part);
lv_color32_t result = image_apply_layer_recolor(obj, part, &draw_dsc->base, bg_image_recolor, bg_image_recolor_opa);
draw_dsc->bg_image_recolor_opa = result.alpha;
draw_dsc->bg_image_recolor = lv_color_make(result.red, result.green, result.blue);
draw_dsc->bg_image_tiled = lv_obj_get_style_bg_image_tiled(obj, part);
}
}
@ -129,7 +145,8 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_
draw_dsc->shadow_offset_x = lv_obj_get_style_shadow_offset_x(obj, part);
draw_dsc->shadow_offset_y = lv_obj_get_style_shadow_offset_y(obj, part);
draw_dsc->shadow_spread = lv_obj_get_style_shadow_spread(obj, part);
draw_dsc->shadow_color = lv_obj_get_style_shadow_color_filtered(obj, part);
lv_color_t shadow_color = lv_obj_get_style_shadow_color_filtered(obj, part);
draw_dsc->shadow_color = normal_apply_layer_recolor(obj, part, &draw_dsc->base, shadow_color);
}
}
}
@ -142,27 +159,36 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_
draw_dsc->shadow_opa = LV_OPA_MIX2(draw_dsc->shadow_opa, opa);
draw_dsc->outline_opa = LV_OPA_MIX2(draw_dsc->outline_opa, opa);
}
LV_PROFILER_DRAW_END;
}
void lv_obj_init_draw_label_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_label_dsc_t * draw_dsc)
{
LV_PROFILER_DRAW_BEGIN;
draw_dsc->base.obj = obj;
draw_dsc->base.part = part;
draw_dsc->opa = lv_obj_get_style_text_opa(obj, part);
if(draw_dsc->opa <= LV_OPA_MIN) return;
if(draw_dsc->opa <= LV_OPA_MIN) {
LV_PROFILER_DRAW_END;
return;
}
lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, part);
lv_opa_t opa = get_layer_opa(obj, part, &draw_dsc->base);
if(opa < LV_OPA_MAX) {
draw_dsc->opa = LV_OPA_MIX2(draw_dsc->opa, opa);
}
if(draw_dsc->opa <= LV_OPA_MIN) return;
if(draw_dsc->opa <= LV_OPA_MIN) {
LV_PROFILER_DRAW_END;
return;
}
draw_dsc->color = lv_obj_get_style_text_color_filtered(obj, part);
lv_color_t text_color = lv_obj_get_style_text_color_filtered(obj, part);
draw_dsc->color = normal_apply_layer_recolor(obj, part, &draw_dsc->base, text_color);
draw_dsc->letter_space = lv_obj_get_style_text_letter_space(obj, part);
draw_dsc->line_space = lv_obj_get_style_text_line_space(obj, part);
draw_dsc->decor = lv_obj_get_style_text_decor(obj, part);
if(part != LV_PART_MAIN) draw_dsc->blend_mode = lv_obj_get_style_blend_mode(obj, part);
draw_dsc->font = lv_obj_get_style_text_font(obj, part);
@ -171,21 +197,30 @@ void lv_obj_init_draw_label_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_label_ds
#endif
draw_dsc->align = lv_obj_get_style_text_align(obj, part);
LV_PROFILER_DRAW_END;
}
void lv_obj_init_draw_image_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_image_dsc_t * draw_dsc)
{
LV_PROFILER_DRAW_BEGIN;
draw_dsc->base.obj = obj;
draw_dsc->base.part = part;
draw_dsc->opa = lv_obj_get_style_image_opa(obj, part);
if(draw_dsc->opa <= LV_OPA_MIN) return;
if(draw_dsc->opa <= LV_OPA_MIN) {
LV_PROFILER_DRAW_END;
return;
}
lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, part);
lv_opa_t opa = get_layer_opa(obj, part, &draw_dsc->base);
if(opa < LV_OPA_MAX) {
draw_dsc->opa = LV_OPA_MIX2(draw_dsc->opa, opa);
}
if(draw_dsc->opa <= LV_OPA_MIN) return;
if(draw_dsc->opa <= LV_OPA_MIN) {
LV_PROFILER_DRAW_END;
return;
}
draw_dsc->rotation = 0;
draw_dsc->scale_x = LV_SCALE_NONE;
@ -193,30 +228,46 @@ void lv_obj_init_draw_image_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_image_ds
draw_dsc->pivot.x = lv_area_get_width(&obj->coords) / 2;
draw_dsc->pivot.y = lv_area_get_height(&obj->coords) / 2;
draw_dsc->recolor_opa = lv_obj_get_style_image_recolor_opa(obj, part);
draw_dsc->recolor = lv_obj_get_style_image_recolor_filtered(obj, part);
lv_color_t recolor = lv_obj_get_style_image_recolor_filtered(obj, part);
lv_opa_t recolor_opa = lv_obj_get_style_image_recolor_opa(obj, part);
lv_color32_t result = image_apply_layer_recolor(obj, part, &draw_dsc->base, recolor, recolor_opa);
draw_dsc->recolor_opa = result.alpha;
draw_dsc->recolor = lv_color_make(result.red, result.green, result.blue);
if(part != LV_PART_MAIN) draw_dsc->blend_mode = lv_obj_get_style_blend_mode(obj, part);
LV_PROFILER_DRAW_END;
}
void lv_obj_init_draw_line_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_line_dsc_t * draw_dsc)
{
LV_PROFILER_DRAW_BEGIN;
draw_dsc->base.obj = obj;
draw_dsc->base.part = part;
draw_dsc->opa = lv_obj_get_style_line_opa(obj, part);
if(draw_dsc->opa <= LV_OPA_MIN) return;
if(draw_dsc->opa <= LV_OPA_MIN) {
LV_PROFILER_DRAW_END;
return;
}
lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, part);
lv_opa_t opa = get_layer_opa(obj, part, &draw_dsc->base);
if(opa < LV_OPA_MAX) {
draw_dsc->opa = LV_OPA_MIX2(draw_dsc->opa, opa);
}
if(draw_dsc->opa <= LV_OPA_MIN) return;
if(draw_dsc->opa <= LV_OPA_MIN) {
LV_PROFILER_DRAW_END;
return;
}
draw_dsc->width = lv_obj_get_style_line_width(obj, part);
if(draw_dsc->width == 0) return;
if(draw_dsc->width == 0) {
LV_PROFILER_DRAW_END;
return;
}
draw_dsc->color = lv_obj_get_style_line_color_filtered(obj, part);
lv_color_t line_color = lv_obj_get_style_line_color_filtered(obj, part);
draw_dsc->color = normal_apply_layer_recolor(obj, part, &draw_dsc->base, line_color);
draw_dsc->dash_width = lv_obj_get_style_line_dash_width(obj, part);
if(draw_dsc->dash_width) {
@ -226,34 +277,47 @@ void lv_obj_init_draw_line_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_line_dsc_
draw_dsc->round_start = lv_obj_get_style_line_rounded(obj, part);
draw_dsc->round_end = draw_dsc->round_start;
if(part != LV_PART_MAIN) draw_dsc->blend_mode = lv_obj_get_style_blend_mode(obj, part);
LV_PROFILER_DRAW_END;
}
void lv_obj_init_draw_arc_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_arc_dsc_t * draw_dsc)
{
LV_PROFILER_DRAW_BEGIN;
draw_dsc->base.obj = obj;
draw_dsc->base.part = part;
draw_dsc->width = lv_obj_get_style_arc_width(obj, part);
if(draw_dsc->width == 0) return;
if(draw_dsc->width == 0) {
LV_PROFILER_DRAW_END;
return;
}
draw_dsc->opa = lv_obj_get_style_arc_opa(obj, part);
if(draw_dsc->opa <= LV_OPA_MIN) return;
if(draw_dsc->opa <= LV_OPA_MIN) {
LV_PROFILER_DRAW_END;
return;
}
lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, part);
lv_opa_t opa = get_layer_opa(obj, part, &draw_dsc->base);
if(opa < LV_OPA_MAX) {
draw_dsc->opa = LV_OPA_MIX2(draw_dsc->opa, opa);
}
if(draw_dsc->opa <= LV_OPA_MIN) return;
if(draw_dsc->opa <= LV_OPA_MIN) {
LV_PROFILER_DRAW_END;
return;
}
draw_dsc->color = lv_obj_get_style_arc_color_filtered(obj, part);
lv_color_t arc_color = lv_obj_get_style_arc_color_filtered(obj, part);
draw_dsc->color = normal_apply_layer_recolor(obj, part, &draw_dsc->base, arc_color);
draw_dsc->img_src = lv_obj_get_style_arc_image_src(obj, part);
draw_dsc->rounded = lv_obj_get_style_arc_rounded(obj, part);
LV_PROFILER_DRAW_END;
}
int32_t lv_obj_calculate_ext_draw_size(lv_obj_t * obj, lv_part_t part)
{
LV_PROFILER_DRAW_BEGIN;
int32_t s = 0;
int32_t sh_width = lv_obj_get_style_shadow_width(obj, part);
@ -283,11 +347,13 @@ int32_t lv_obj_calculate_ext_draw_size(lv_obj_t * obj, lv_part_t part)
int32_t wh = LV_MAX(w, h);
if(wh > 0) s += wh;
LV_PROFILER_DRAW_END;
return s;
}
void lv_obj_refresh_ext_draw_size(lv_obj_t * obj)
{
LV_PROFILER_DRAW_BEGIN;
LV_ASSERT_OBJ(obj, MY_CLASS);
int32_t s_old = lv_obj_get_ext_draw_size(obj);
@ -306,6 +372,7 @@ void lv_obj_refresh_ext_draw_size(lv_obj_t * obj)
}
if(s_new != s_old) lv_obj_invalidate(obj);
LV_PROFILER_DRAW_END;
}
int32_t lv_obj_get_ext_draw_size(const lv_obj_t * obj)
@ -324,3 +391,64 @@ lv_layer_type_t lv_obj_get_layer_type(const lv_obj_t * obj)
/**********************
* STATIC FUNCTIONS
**********************/
static inline lv_opa_t get_layer_opa(const lv_obj_t * obj, lv_part_t part, const lv_draw_dsc_base_t * base_dsc)
{
if(base_dsc->layer) {
/* Accessing the layer opa directly is faster than using get style opa recursive */
if(part == LV_PART_MAIN) {
return base_dsc->layer->opa;
}
return LV_OPA_MIX2(base_dsc->layer->opa, lv_obj_get_style_opa(obj, part));
}
/* fallback to old recursive style opa */
return lv_obj_get_style_opa_recursive(obj, part);
}
static lv_color_t normal_apply_layer_recolor(const lv_obj_t * obj, lv_part_t part, const lv_draw_dsc_base_t * base_dsc,
lv_color_t color)
{
lv_color32_t recolor;
if(base_dsc->layer) {
recolor = base_dsc->layer->recolor;
if(part != LV_PART_MAIN) {
recolor = lv_obj_style_apply_recolor(obj, part, recolor);
}
}
else {
recolor = lv_obj_get_style_recolor_recursive(obj, part);
}
return lv_color_mix(lv_color_make(recolor.red, recolor.green, recolor.blue), color, recolor.alpha);
}
static lv_color32_t image_apply_layer_recolor(const lv_obj_t * obj, lv_part_t part,
const lv_draw_dsc_base_t * base_dsc, lv_color_t color, lv_opa_t opa)
{
lv_color32_t recolor;
if(base_dsc->layer) {
recolor = base_dsc->layer->recolor;
if(part != LV_PART_MAIN) {
recolor = lv_obj_style_apply_recolor(obj, part, recolor);
}
}
else {
recolor = lv_obj_get_style_recolor_recursive(obj, part);
}
if(opa > LV_OPA_TRANSP && recolor.alpha > LV_OPA_TRANSP) {
return lv_color_over32(recolor, lv_color_to_32(color, opa));
}
else if(recolor.alpha > LV_OPA_TRANSP) {
return recolor;
}
else {
return lv_color_to_32(color, opa);
}
}

View File

@ -19,6 +19,7 @@ extern "C" {
#include "../draw/lv_draw_image.h"
#include "../draw/lv_draw_line.h"
#include "../draw/lv_draw_arc.h"
#include "../draw/lv_draw_triangle.h"
/*********************
* DEFINES
@ -28,9 +29,23 @@ extern "C" {
* TYPEDEFS
**********************/
/** Store the type of layer required to render a widget.*/
typedef enum {
/**No layer is needed. */
LV_LAYER_TYPE_NONE,
/**Simple layer means that the layer can be rendered in chunks.
* For example with opa_layered = 140 it's possible to render only 10 lines
* from the layer. When it's ready go the the next 10 lines.
* It avoids large memory allocations for the layer buffer.
* The buffer size for a chunk can be set by `LV_DRAW_LAYER_SIMPLE_BUF_SIZE` in lv_conf.h.*/
LV_LAYER_TYPE_SIMPLE,
/**The widget is transformed and cannot be rendered in chunks.
* It's because - due to the transformations - pixel outside of
* a given area will also contribute to the final image.
* In this case there is no limitation on the buffer size.
* LVGL will allocate as large buffer as needed to render the transformed area.*/
LV_LAYER_TYPE_TRANSFORM,
} lv_layer_type_t;

View File

@ -86,7 +86,9 @@ lv_result_t lv_obj_event_base(const lv_obj_class_t * class_p, lv_event_t * e)
/*Call the actual event callback*/
e->user_data = NULL;
LV_PROFILER_EVENT_BEGIN_TAG(lv_event_code_get_name(e->code));
base->event_cb(base, e);
LV_PROFILER_EVENT_END_TAG(lv_event_code_get_name(e->code));
lv_result_t res = LV_RESULT_OK;
/*Stop if the object is deleted*/
@ -124,23 +126,6 @@ bool lv_obj_remove_event(lv_obj_t * obj, uint32_t index)
return lv_event_remove(&obj->spec_attr->event_list, index);
}
bool lv_obj_remove_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb)
{
LV_ASSERT_NULL(obj);
uint32_t event_cnt = lv_obj_get_event_count(obj);
uint32_t i;
for(i = 0; i < event_cnt; i++) {
lv_event_dsc_t * dsc = lv_obj_get_event_dsc(obj, i);
if(dsc->cb == event_cb) {
lv_obj_remove_event(obj, i);
return true;
}
}
return false;
}
bool lv_obj_remove_event_dsc(lv_obj_t * obj, lv_event_dsc_t * dsc)
{
LV_ASSERT_NULL(obj);
@ -149,6 +134,24 @@ bool lv_obj_remove_event_dsc(lv_obj_t * obj, lv_event_dsc_t * dsc)
return lv_event_remove_dsc(&obj->spec_attr->event_list, dsc);
}
uint32_t lv_obj_remove_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb)
{
LV_ASSERT_NULL(obj);
uint32_t event_cnt = lv_obj_get_event_count(obj);
uint32_t removed_count = 0;
uint32_t i;
for(i = 0; i < event_cnt; i++) {
lv_event_dsc_t * dsc = lv_obj_get_event_dsc(obj, i);
if(dsc && dsc->cb == event_cb) {
lv_obj_remove_event(obj, i);
removed_count++;
}
}
return removed_count;
}
uint32_t lv_obj_remove_event_cb_with_user_data(lv_obj_t * obj, lv_event_cb_t event_cb, void * user_data)
{
LV_ASSERT_NULL(obj);
@ -157,9 +160,11 @@ uint32_t lv_obj_remove_event_cb_with_user_data(lv_obj_t * obj, lv_event_cb_t eve
uint32_t removed_count = 0;
int32_t i;
if(event_cnt == 0) return 0;
for(i = event_cnt - 1; i >= 0; i--) {
lv_event_dsc_t * dsc = lv_obj_get_event_dsc(obj, i);
if(dsc && dsc->cb == event_cb && dsc->user_data == user_data) {
if(dsc && (event_cb == NULL || dsc->cb == event_cb) && dsc->user_data == user_data) {
lv_obj_remove_event(obj, i);
removed_count ++;
}
@ -371,7 +376,6 @@ static lv_result_t event_send_core(lv_event_t * e)
if(parent && event_is_bubbled(e)) {
e->current_target = parent;
res = event_send_core(e);
if(res != LV_RESULT_OK || e->stop_processing || e->stop_bubbling) return res;
}
return res;

View File

@ -86,10 +86,16 @@ lv_event_dsc_t * lv_obj_get_event_dsc(lv_obj_t * obj, uint32_t index);
bool lv_obj_remove_event(lv_obj_t * obj, uint32_t index);
bool lv_obj_remove_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb);
bool lv_obj_remove_event_dsc(lv_obj_t * obj, lv_event_dsc_t * dsc);
/**
* Remove an event_cb from an object
* @param obj pointer to a obj
* @param event_cb the event_cb of the event to remove
* @return the count of the event removed
*/
uint32_t lv_obj_remove_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb);
/**
* Remove an event_cb with user_data
* @param obj pointer to a obj

View File

@ -31,7 +31,7 @@ extern "C" {
* - If already set `true` and `point` shouldn't be clickable set to `false`
* - If already set to `true` you agree that `point` can click the object leave it as `true`
*/
struct lv_hit_test_info_t {
struct _lv_hit_test_info_t {
const lv_point_t * point; /**< A point relative to screen to check if it can click the object or not*/
bool res; /**< true: `point` can click the object; false: it cannot*/
};
@ -41,7 +41,7 @@ struct lv_hit_test_info_t {
* In the event use `const lv_area_t * area = lv_event_get_cover_area(e)` to get the area to check
* and `lv_event_set_cover_res(e, res)` to set the result.
*/
struct lv_cover_check_info_t {
struct _lv_cover_check_info_t {
lv_cover_res_t res;
const lv_area_t * area;
};

View File

@ -10,6 +10,7 @@
#include "../layouts/lv_layout_private.h"
#include "lv_obj_event_private.h"
#include "lv_obj_draw_private.h"
#include "lv_obj_style_private.h"
#include "lv_obj_private.h"
#include "../display/lv_display.h"
#include "../display/lv_display_private.h"
@ -33,6 +34,7 @@ static int32_t calc_content_width(lv_obj_t * obj);
static int32_t calc_content_height(lv_obj_t * obj);
static void layout_update_core(lv_obj_t * obj);
static void transform_point_array(const lv_obj_t * obj, lv_point_t * p, size_t p_count, bool inv);
static bool is_transformed(const lv_obj_t * obj);
/**********************
* STATIC VARIABLES
@ -296,7 +298,7 @@ void lv_obj_update_layout(const lv_obj_t * obj)
LV_LOG_TRACE("Already running, returning");
return;
}
LV_PROFILER_BEGIN;
LV_PROFILER_LAYOUT_BEGIN;
update_layout_mutex = true;
lv_obj_t * scr = lv_obj_get_screen(obj);
@ -309,7 +311,7 @@ void lv_obj_update_layout(const lv_obj_t * obj)
}
update_layout_mutex = false;
LV_PROFILER_END;
LV_PROFILER_LAYOUT_END;
}
void lv_obj_set_align(lv_obj_t * obj, lv_align_t align)
@ -624,8 +626,15 @@ void lv_obj_refr_pos(lv_obj_t * obj)
/*Handle percentage value*/
int32_t pw = lv_obj_get_content_width(parent);
int32_t ph = lv_obj_get_content_height(parent);
if(LV_COORD_IS_PCT(x)) x = (pw * LV_COORD_GET_PCT(x)) / 100;
if(LV_COORD_IS_PCT(y)) y = (ph * LV_COORD_GET_PCT(y)) / 100;
if(LV_COORD_IS_PCT(x)) {
if(lv_obj_get_style_width(parent, 0) == LV_SIZE_CONTENT) x = 0; /*Avoid circular dependency*/
else x = (pw * LV_COORD_GET_PCT(x)) / 100;
}
if(LV_COORD_IS_PCT(y)) {
if(lv_obj_get_style_height(parent, 0) == LV_SIZE_CONTENT) y = 0; /*Avoid circular dependency*/
y = (ph * LV_COORD_GET_PCT(y)) / 100;
}
/*Handle percentage value of translate*/
int32_t tr_x = lv_obj_get_style_translate_x(obj, LV_PART_MAIN);
@ -878,7 +887,9 @@ bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area)
/*The area is not on the object*/
if(!lv_area_intersect(area, area, &obj_coords)) return false;
lv_obj_get_transformed_area(obj, area, LV_OBJ_POINT_TRANSFORM_FLAG_RECURSIVE);
if(is_transformed(obj)) {
lv_obj_get_transformed_area(obj, area, LV_OBJ_POINT_TRANSFORM_FLAG_RECURSIVE);
}
/*Truncate recursively to the parents*/
lv_obj_t * parent = lv_obj_get_parent(obj);
@ -893,7 +904,9 @@ bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area)
lv_area_increase(&parent_coords, parent_ext_size, parent_ext_size);
}
lv_obj_get_transformed_area(parent, &parent_coords, LV_OBJ_POINT_TRANSFORM_FLAG_RECURSIVE);
if(is_transformed(parent)) {
lv_obj_get_transformed_area(parent, &parent_coords, LV_OBJ_POINT_TRANSFORM_FLAG_RECURSIVE);
}
if(!lv_area_intersect(area, area, &parent_coords)) return false;
parent = lv_obj_get_parent(parent);
@ -972,10 +985,95 @@ void lv_obj_center(lv_obj_t * obj)
lv_obj_align(obj, LV_ALIGN_CENTER, 0, 0);
}
void lv_obj_set_transform(lv_obj_t * obj, const lv_matrix_t * matrix)
{
#if LV_DRAW_TRANSFORM_USE_MATRIX
LV_ASSERT_OBJ(obj, MY_CLASS);
if(!matrix) {
lv_obj_reset_transform(obj);
return;
}
lv_obj_allocate_spec_attr(obj);
if(!obj->spec_attr->matrix) {
obj->spec_attr->matrix = lv_malloc(sizeof(lv_matrix_t));;
LV_ASSERT_MALLOC(obj->spec_attr->matrix);
}
/* Invalidate the old area */
lv_obj_invalidate(obj);
/* Copy the matrix */
*obj->spec_attr->matrix = *matrix;
/* Matrix is set. Update the layer type */
lv_obj_update_layer_type(obj);
/* Invalidate the new area */
lv_obj_invalidate(obj);
#else
LV_UNUSED(obj);
LV_UNUSED(matrix);
LV_LOG_WARN("Transform matrix is not used because LV_DRAW_TRANSFORM_USE_MATRIX is disabled");
#endif
}
void lv_obj_reset_transform(lv_obj_t * obj)
{
#if LV_DRAW_TRANSFORM_USE_MATRIX
LV_ASSERT_OBJ(obj, MY_CLASS);
if(!obj->spec_attr) {
return;
}
if(!obj->spec_attr->matrix) {
return;
}
/* Invalidate the old area */
lv_obj_invalidate(obj);
/* Free the matrix */
lv_free(obj->spec_attr->matrix);
obj->spec_attr->matrix = NULL;
/* Matrix is cleared. Update the layer type */
lv_obj_update_layer_type(obj);
/* Invalidate the new area */
lv_obj_invalidate(obj);
#else
LV_UNUSED(obj);
#endif
}
const lv_matrix_t * lv_obj_get_transform(const lv_obj_t * obj)
{
#if LV_DRAW_TRANSFORM_USE_MATRIX
LV_ASSERT_OBJ(obj, MY_CLASS);
if(obj->spec_attr) {
return obj->spec_attr->matrix;
}
#else
LV_UNUSED(obj);
#endif
return NULL;
}
/**********************
* STATIC FUNCTIONS
**********************/
static bool is_transformed(const lv_obj_t * obj)
{
while(obj) {
if(obj->spec_attr && obj->spec_attr->layer_type == LV_LAYER_TYPE_TRANSFORM) return true;
obj = obj->parent;
}
return false;
}
static int32_t calc_content_width(lv_obj_t * obj)
{
int32_t scroll_x_tmp = lv_obj_get_scroll_x(obj);
@ -1150,6 +1248,31 @@ static void layout_update_core(lv_obj_t * obj)
static void transform_point_array(const lv_obj_t * obj, lv_point_t * p, size_t p_count, bool inv)
{
#if LV_DRAW_TRANSFORM_USE_MATRIX
const lv_matrix_t * obj_matrix = lv_obj_get_transform(obj);
if(obj_matrix) {
lv_matrix_t m;
lv_matrix_identity(&m);
lv_matrix_translate(&m, obj->coords.x1, obj->coords.y1);
lv_matrix_multiply(&m, obj_matrix);
lv_matrix_translate(&m, -obj->coords.x1, -obj->coords.y1);
if(inv) {
lv_matrix_t inv_m;
lv_matrix_inverse(&inv_m, &m);
m = inv_m;
}
for(size_t i = 0; i < p_count; i++) {
lv_point_precise_t p_precise = lv_point_to_precise(&p[i]);
lv_point_precise_t res = lv_matrix_transform_precise_point(&m, &p_precise);
p[i] = lv_point_from_precise(&res);
}
return;
}
#endif /* LV_DRAW_TRANSFORM_USE_MATRIX */
int32_t angle = lv_obj_get_style_transform_rotation(obj, 0);
int32_t scale_x = lv_obj_get_style_transform_scale_x_safe(obj, 0);
int32_t scale_y = lv_obj_get_style_transform_scale_y_safe(obj, 0);

View File

@ -149,13 +149,13 @@ bool lv_obj_is_layout_positioned(const lv_obj_t * obj);
/**
* Mark the object for layout update.
* @param obj pointer to an object whose children needs to be updated
* @param obj pointer to an object whose children need to be updated
*/
void lv_obj_mark_layout_as_dirty(lv_obj_t * obj);
/**
* Update the layout of an object.
* @param obj pointer to an object whose children needs to be updated
* @param obj pointer to an object whose position and size needs to be updated
*/
void lv_obj_update_layout(const lv_obj_t * obj);
@ -197,6 +197,21 @@ void lv_obj_align_to(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, in
*/
void lv_obj_center(lv_obj_t * obj);
/**
* Set the transform matrix of an object
* @param obj pointer to an object
* @param matrix pointer to a matrix to set
* @note `LV_DRAW_TRANSFORM_USE_MATRIX` needs to be enabled.
*/
void lv_obj_set_transform(lv_obj_t * obj, const lv_matrix_t * matrix);
/**
* Reset the transform matrix of an object to identity matrix
* @param obj pointer to an object
* @note `LV_DRAW_TRANSFORM_USE_MATRIX` needs to be enabled.
*/
void lv_obj_reset_transform(lv_obj_t * obj);
/**
* Copy the coordinates of an object to an area
* @param obj pointer to an object
@ -342,6 +357,13 @@ void lv_obj_move_to(lv_obj_t * obj, int32_t x, int32_t y);
void lv_obj_move_children_by(lv_obj_t * obj, int32_t x_diff, int32_t y_diff, bool ignore_floating);
/**
* Get the transform matrix of an object
* @param obj pointer to an object
* @return pointer to the transform matrix or NULL if not set
*/
const lv_matrix_t * lv_obj_get_transform(const lv_obj_t * obj);
/**
* Transform a point using the angle and zoom style properties of an object
* @param obj pointer to an object whose style properties should be used

View File

@ -28,11 +28,16 @@ extern "C" {
* Special, rarely used attributes.
* They are allocated automatically if any elements is set.
*/
struct lv_obj_spec_attr_t {
struct _lv_obj_spec_attr_t {
lv_obj_t ** children; /**< Store the pointer of the children in an array.*/
lv_group_t * group_p;
#if LV_DRAW_TRANSFORM_USE_MATRIX
lv_matrix_t * matrix; /**< The transform matrix*/
#endif
lv_event_list_t event_list;
#if LV_USE_OBJ_NAME
const char * name; /**< Pointer to the name */
#endif
lv_point_t scroll; /**< The current X/Y scroll offset*/
int32_t ext_click_pad; /**< Extra click padding in all direction*/
@ -44,9 +49,10 @@ struct lv_obj_spec_attr_t {
uint16_t scroll_snap_y : 2; /**< Where to align the snappable children vertically*/
uint16_t scroll_dir : 4; /**< The allowed scroll direction(s), see `lv_dir_t`*/
uint16_t layer_type : 2; /**< Cache the layer type here. Element of lv_intermediate_layer_type_t */
uint16_t name_static : 1; /**< 1: `name` was not dynamically allocated */
};
struct lv_obj_t {
struct _lv_obj_t {
const lv_obj_class_t * class_p;
lv_obj_t * parent;
lv_obj_spec_attr_t * spec_attr;

View File

@ -19,24 +19,72 @@
* DEFINES
*********************/
#define HANDLE_PROPERTY_TYPE(type, field) \
if(!set) { \
value->field = ((lv_property_get_##type##_t)(prop->getter))(obj); \
} else { \
switch(LV_PROPERTY_ID_TYPE2(prop->id)) { \
case LV_PROPERTY_ID_INVALID: \
((lv_property_set_##type##_t)(prop->setter))(obj, value->field); \
break; \
case LV_PROPERTY_TYPE_INT: \
((lv_property_set_##type##_integer_t)(prop->setter))(obj, value->arg1.field, value->arg2.num); \
break; \
case LV_PROPERTY_TYPE_BOOL: \
((lv_property_set_##type##_boolean_t)(prop->setter))(obj, value->arg1.field, value->arg2.enable); \
break; \
case LV_PROPERTY_TYPE_PRECISE: \
((lv_property_set_##type##_precise_t)(prop->setter))(obj, value->arg1.field, value->arg2.precise); \
break; \
case LV_PROPERTY_TYPE_COLOR: \
((lv_property_set_##type##_color_t)(prop->setter))(obj, value->arg1.field, value->arg2.color); \
break; \
case LV_PROPERTY_TYPE_POINTER: \
case LV_PROPERTY_TYPE_IMGSRC: \
case LV_PROPERTY_TYPE_TEXT: \
case LV_PROPERTY_TYPE_OBJ: \
case LV_PROPERTY_TYPE_DISPLAY: \
case LV_PROPERTY_TYPE_FONT: \
((lv_property_set_##type##_pointer_t)(prop->setter))(obj, value->arg1.field, value->arg2.ptr); \
break; \
} \
}
/**********************
* TYPEDEFS
**********************/
typedef void (*lv_property_set_int_t)(lv_obj_t *, int32_t);
typedef void (*lv_property_set_bool_t)(lv_obj_t *, bool);
typedef void (*lv_property_set_precise_t)(lv_obj_t *, lv_value_precise_t);
typedef void (*lv_property_set_color_t)(lv_obj_t *, lv_color_t);
typedef int32_t integer;
typedef bool boolean;
typedef lv_value_precise_t precise;
typedef lv_color_t color;
typedef const void * pointer;
#define DEFINE_PROPERTY_SETTER_TYPES(type) \
typedef void (*lv_property_set_##type##_t)(lv_obj_t *, type); \
typedef void (*lv_property_set_##type##_integer_t)(lv_obj_t *, type, int32_t); \
typedef void (*lv_property_set_##type##_boolean_t)(lv_obj_t *, type, bool); \
typedef void (*lv_property_set_##type##_precise_t)(lv_obj_t *, type, lv_value_precise_t); \
typedef void (*lv_property_set_##type##_color_t)(lv_obj_t *, type, lv_color_t); \
typedef void (*lv_property_set_##type##_pointer_t)(lv_obj_t *, type, const void *)
DEFINE_PROPERTY_SETTER_TYPES(integer);
DEFINE_PROPERTY_SETTER_TYPES(boolean);
DEFINE_PROPERTY_SETTER_TYPES(precise);
DEFINE_PROPERTY_SETTER_TYPES(color);
DEFINE_PROPERTY_SETTER_TYPES(pointer);
typedef void (*lv_property_set_point_t)(lv_obj_t *, lv_point_t *);
typedef void (*lv_property_set_pointer_t)(lv_obj_t *, const void *);
typedef lv_result_t (*lv_property_setter_t)(lv_obj_t *, lv_prop_id_t, const lv_property_t *);
typedef int32_t (*lv_property_get_int_t)(const lv_obj_t *);
typedef bool (*lv_property_get_bool_t)(const lv_obj_t *);
typedef integer(*lv_property_get_integer_t)(const lv_obj_t *);
typedef bool (*lv_property_get_boolean_t)(const lv_obj_t *);
typedef lv_value_precise_t (*lv_property_get_precise_t)(const lv_obj_t *);
typedef lv_color_t (*lv_property_get_color_t)(const lv_obj_t *);
typedef lv_point_t (*lv_property_get_point_t)(lv_obj_t *);
typedef void * (*lv_property_get_pointer_t)(const lv_obj_t *);
typedef lv_point_t (*lv_property_get_point_t)(lv_obj_t *);
typedef lv_result_t (*lv_property_getter_t)(const lv_obj_t *, lv_prop_id_t, lv_property_t *);
/**********************
@ -240,41 +288,30 @@ static lv_result_t obj_property(lv_obj_t * obj, lv_prop_id_t id, lv_property_t *
if(!set) value->id = prop->id;
switch(LV_PROPERTY_ID_TYPE(prop->id)) {
case LV_PROPERTY_TYPE_INT: {
if(set)((lv_property_set_int_t)(prop->setter))(obj, value->num);
else value->num = ((lv_property_get_int_t)(prop->getter))(obj);
break;
}
case LV_PROPERTY_TYPE_BOOL: {
if(set)((lv_property_set_bool_t)(prop->setter))(obj, value->enable);
else value->enable = ((lv_property_get_bool_t)(prop->getter))(obj);
break;
}
case LV_PROPERTY_TYPE_PRECISE: {
if(set)((lv_property_set_precise_t)(prop->setter))(obj, value->precise);
else value->precise = ((lv_property_get_precise_t)(prop->getter))(obj);
break;
}
case LV_PROPERTY_TYPE_COLOR: {
if(set)((lv_property_set_color_t)prop->setter)(obj, value->color);
else value->color = ((lv_property_get_color_t)(prop->getter))(obj);
break;
}
case LV_PROPERTY_TYPE_POINT: {
lv_point_t * point = &value->point;
if(set)((lv_property_set_point_t)(prop->setter))(obj, point);
else *point = ((lv_property_get_point_t)(prop->getter))(obj);
break;
}
case LV_PROPERTY_TYPE_INT:
HANDLE_PROPERTY_TYPE(integer, num);
break;
case LV_PROPERTY_TYPE_BOOL:
HANDLE_PROPERTY_TYPE(boolean, enable);
break;
case LV_PROPERTY_TYPE_PRECISE:
HANDLE_PROPERTY_TYPE(precise, precise);
break;
case LV_PROPERTY_TYPE_COLOR:
HANDLE_PROPERTY_TYPE(color, color);
break;
case LV_PROPERTY_TYPE_POINTER:
case LV_PROPERTY_TYPE_IMGSRC:
case LV_PROPERTY_TYPE_TEXT:
case LV_PROPERTY_TYPE_OBJ:
case LV_PROPERTY_TYPE_DISPLAY:
case LV_PROPERTY_TYPE_FONT: {
if(set)((lv_property_set_pointer_t)(prop->setter))(obj, value->ptr);
else value->ptr = ((lv_property_get_pointer_t)(prop->getter))(obj);
case LV_PROPERTY_TYPE_FONT:
HANDLE_PROPERTY_TYPE(pointer, ptr);
break;
case LV_PROPERTY_TYPE_POINT: {
lv_point_t * point = &value->point;
if(set)((lv_property_set_point_t)(prop->setter))(obj, point);
else *point = ((lv_property_get_point_t)(prop->getter))(obj);
break;
}
default: {

View File

@ -37,9 +37,12 @@ extern "C" {
#define LV_PROPERTY_TYPE_BOOL 11 /*int32_t type*/
#define LV_PROPERTY_TYPE_SHIFT 28
#define LV_PROPERTY_ID(clz, name, type, index) LV_PROPERTY_## clz ##_##name = (LV_PROPERTY_## clz ##_START + (index)) | ((type) << LV_PROPERTY_TYPE_SHIFT)
#define LV_PROPERTY_TYPE2_SHIFT 24
#define LV_PROPERTY_ID(clz, name, type, index) LV_PROPERTY_## clz ##_##name = (LV_PROPERTY_## clz ##_START + (index)) | ((type) << LV_PROPERTY_TYPE_SHIFT)
#define LV_PROPERTY_ID2(clz, name, type, type2, index) LV_PROPERTY_ID(clz, name, type, index) | ((type2) << LV_PROPERTY_TYPE2_SHIFT)
#define LV_PROPERTY_ID_TYPE(id) ((id) >> LV_PROPERTY_TYPE_SHIFT)
#define LV_PROPERTY_ID_TYPE2(id) ((id) >> LV_PROPERTY_TYPE_SHIFT)
#define LV_PROPERTY_ID_INDEX(id) ((id) & 0xfffffff)
/*Set properties from an array of lv_property_t*/
@ -68,6 +71,8 @@ enum {
LV_PROPERTY_TEXTAREA_START = 0x0500, /* lv_textarea.c */
LV_PROPERTY_ROLLER_START = 0x0600, /* lv_roller.c */
LV_PROPERTY_DROPDOWN_START = 0x0700, /* lv_dropdown.c */
LV_PROPERTY_SLIDER_START = 0x0800, /* lv_slider.c */
LV_PROPERTY_ANIMIMAGE_START = 0x0900, /* lv_animimage.c */
/*Special ID, use it to extend ID and make sure it's unique and compile time determinant*/
LV_PROPERTY_ID_BUILTIN_LAST = 0xffff, /*ID of 0x10000 ~ 0xfffffff is reserved for user*/
@ -75,7 +80,7 @@ enum {
LV_PROPERTY_ID_ANY = 0x7ffffffe, /*Special ID used by lvgl to intercept all setter/getter call.*/
};
struct lv_property_name_t {
struct _lv_property_name_t {
const char * name;
lv_prop_id_t id;
};
@ -83,12 +88,14 @@ struct lv_property_name_t {
typedef struct {
lv_prop_id_t id;
union {
int32_t num; /**< Number integer number (opacity, enums, booleans or "normal" numbers)*/
bool enable; /**< booleans*/
const void * ptr; /**< Constant pointers (font, cone text, etc)*/
lv_color_t color; /**< Colors*/
lv_value_precise_t precise; /**< float or int for precise value*/
lv_point_t point; /**< Point*/
int32_t num; /**< Signed integer number (enums or "normal" numbers)*/
uint32_t num_u; /**< Unsigned integer number (opacity, Booleans) */
bool enable; /**< Booleans */
const void * ptr; /**< Constant pointers (font, cone text, etc.) */
lv_color_t color; /**< Colors */
lv_value_precise_t precise; /**< float or int for precise value */
lv_point_t point; /**< Point, contains two int32_t */
struct {
/**
* Note that place struct member `style` at first place is intended.
@ -113,6 +120,21 @@ typedef struct {
lv_style_value_t style; /**< Make sure it's the first element in struct. */
uint32_t selector; /**< Style selector, lv_part_t | lv_state_t */
};
/**
* For some properties like slider range, it contains two simple (4-byte) values
* so we can use `arg1.num` and `arg2.num` to set the argument.
*/
struct {
union {
int32_t num;
uint32_t num_u;
bool enable;
const void * ptr;
lv_color_t color;
lv_value_precise_t precise;
} arg1, arg2;
};
};
} lv_property_t;
@ -132,19 +154,19 @@ typedef struct {
*====================*/
/**
* Set widget property.
* @param obj pointer to an object
* @param value The property value to set
* @return return LV_RESULT_OK if success
* Set Widget property.
* @param obj pointer to Widget
* @param value property value to set
* @return return LV_RESULT_OK if call succeeded
*/
lv_result_t lv_obj_set_property(lv_obj_t * obj, const lv_property_t * value);
/**
* Set multiple widget properties. Helper `LV_OBJ_SET_PROPERTY_ARRAY` can be used for constant property array.
* @param obj pointer to an object
* @param value The property value array to set
* @param count The count of the property value array
* @return return LV_RESULT_OK if success
* Set multiple Widget properties. Helper `LV_OBJ_SET_PROPERTY_ARRAY` can be used for constant property array.
* @param obj pointer to Widget
* @param value property value array to set
* @param count number of array elements
* @return return LV_RESULT_OK if call succeeded
*/
lv_result_t lv_obj_set_properties(lv_obj_t * obj, const lv_property_t * value, uint32_t count);
@ -153,41 +175,44 @@ lv_result_t lv_obj_set_properties(lv_obj_t * obj, const lv_property_t * value, u
*====================*/
/**
* Read property value from object.
* If id is a style property, the style selector is default to 0.
* @param obj pointer to an object
* @param id ID of which property to read
* @return return the property value read. The returned property ID is set to `LV_PROPERTY_ID_INVALID` if failed.
* Read property value from Widget.
* If id is a style property. Style selector is 0 by default.
* @param obj pointer to Widget
* @param id ID of property to read
* @return return property value read. The returned property ID is set to `LV_PROPERTY_ID_INVALID` if read failed.
*/
lv_property_t lv_obj_get_property(lv_obj_t * obj, lv_prop_id_t id);
/**
* Read a style property value from object
* @param obj pointer to an object
* Read style property value from Widget
* @param obj pointer to Widget
* @param id ID of style property
* @param selector selector for the style property.
* @return return the property value read. The returned property ID is set to `LV_PROPERTY_ID_INVALID` if failed.
* @param selector selector for style property
* @return return property value read. The returned property ID is set to `LV_PROPERTY_ID_INVALID` if read failed.
*/
lv_property_t lv_obj_get_style_property(lv_obj_t * obj, lv_prop_id_t id, uint32_t selector);
/**
* Get the property ID by name recursively to base classes. Requires to enable `LV_USE_OBJ_PROPERTY_NAME`.
* @param obj pointer to an object that has specified property or base class has.
* Get property ID by recursively searching for name in Widget's class hierarchy, and
* if still not found, then search style properties.
* Requires to enabling `LV_USE_OBJ_PROPERTY_NAME`.
* @param obj pointer to Widget whose class and base-class hierarchy are to be searched.
* @param name property name
* @return property ID found or `LV_PROPERTY_ID_INVALID` if not found.
*/
lv_prop_id_t lv_obj_property_get_id(const lv_obj_t * obj, const char * name);
/**
* Get the property ID by name without check base class recursively. Requires to enable `LV_USE_OBJ_PROPERTY_NAME`.
* @param clz pointer to an object class that has specified property or base class has.
* Get property ID by doing a non-recursive search for name directly in Widget class properties.
* Requires enabling `LV_USE_OBJ_PROPERTY_NAME`.
* @param clz pointer to Widget class that has specified property.
* @param name property name
* @return property ID found or `LV_PROPERTY_ID_INVALID` if not found.
*/
lv_prop_id_t lv_obj_class_property_get_id(const lv_obj_class_t * clz, const char * name);
/**
* Get the style property ID by name. Requires to enable `LV_USE_OBJ_PROPERTY_NAME`.
* Get style property ID by name. Requires enabling `LV_USE_OBJ_PROPERTY_NAME`.
* @param name property name
* @return property ID found or `LV_PROPERTY_ID_INVALID` if not found.
*/

View File

@ -127,13 +127,13 @@ int32_t lv_obj_get_scroll_y(const lv_obj_t * obj)
return -obj->spec_attr->scroll.y;
}
int32_t lv_obj_get_scroll_top(lv_obj_t * obj)
int32_t lv_obj_get_scroll_top(const lv_obj_t * obj)
{
if(obj->spec_attr == NULL) return 0;
return -obj->spec_attr->scroll.y;
}
int32_t lv_obj_get_scroll_bottom(lv_obj_t * obj)
int32_t lv_obj_get_scroll_bottom(const lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
@ -141,7 +141,7 @@ int32_t lv_obj_get_scroll_bottom(lv_obj_t * obj)
uint32_t i;
uint32_t child_cnt = lv_obj_get_child_count(obj);
for(i = 0; i < child_cnt; i++) {
lv_obj_t * child = obj->spec_attr->children[i];
const lv_obj_t * child = obj->spec_attr->children[i];
if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue;
int32_t tmp_y = child->coords.y2 + lv_obj_get_style_margin_bottom(child, LV_PART_MAIN);
@ -161,7 +161,7 @@ int32_t lv_obj_get_scroll_bottom(lv_obj_t * obj)
return LV_MAX(child_res, self_h);
}
int32_t lv_obj_get_scroll_left(lv_obj_t * obj)
int32_t lv_obj_get_scroll_left(const lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
@ -182,7 +182,7 @@ int32_t lv_obj_get_scroll_left(lv_obj_t * obj)
int32_t x1 = LV_COORD_MAX;
uint32_t child_cnt = lv_obj_get_child_count(obj);
for(i = 0; i < child_cnt; i++) {
lv_obj_t * child = obj->spec_attr->children[i];
const lv_obj_t * child = obj->spec_attr->children[i];
if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue;
int32_t tmp_x = child->coords.x1 - lv_obj_get_style_margin_left(child, LV_PART_MAIN);
@ -204,7 +204,7 @@ int32_t lv_obj_get_scroll_left(lv_obj_t * obj)
return LV_MAX(child_res, self_w);
}
int32_t lv_obj_get_scroll_right(lv_obj_t * obj)
int32_t lv_obj_get_scroll_right(const lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
@ -220,7 +220,7 @@ int32_t lv_obj_get_scroll_right(lv_obj_t * obj)
uint32_t i;
uint32_t child_cnt = lv_obj_get_child_count(obj);
for(i = 0; i < child_cnt; i++) {
lv_obj_t * child = obj->spec_attr->children[i];
const lv_obj_t * child = obj->spec_attr->children[i];
if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue;
int32_t tmp_x = child->coords.x2 + lv_obj_get_style_margin_right(child, LV_PART_MAIN);
@ -306,7 +306,7 @@ void lv_obj_scroll_by_bounded(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_en
void lv_obj_scroll_by(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_enable_t anim_en)
{
if(dx == 0 && dy == 0) return;
if(anim_en == LV_ANIM_ON) {
if(anim_en) {
lv_display_t * d = lv_obj_get_display(obj);
lv_anim_t a;
lv_anim_init(&a);
@ -434,9 +434,20 @@ bool lv_obj_is_scrolling(const lv_obj_t * obj)
indev = lv_indev_get_next(indev);
}
if(lv_anim_get((lv_obj_t *)obj, scroll_x_anim) != NULL ||
lv_anim_get((lv_obj_t *)obj, scroll_y_anim) != NULL) {
return true;
}
return false;
}
void lv_obj_stop_scroll_anim(const lv_obj_t * obj)
{
lv_anim_delete((lv_obj_t *)obj, scroll_y_anim);
lv_anim_delete((lv_obj_t *)obj, scroll_x_anim);
}
void lv_obj_update_snap(lv_obj_t * obj, lv_anim_enable_t anim_en)
{
lv_obj_update_layout(obj);
@ -499,6 +510,7 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t *
int32_t left_space = lv_obj_get_style_pad_left(obj, LV_PART_SCROLLBAR);
int32_t right_space = lv_obj_get_style_pad_right(obj, LV_PART_SCROLLBAR);
int32_t thickness = lv_obj_get_style_width(obj, LV_PART_SCROLLBAR);
int32_t length = lv_obj_get_style_length(obj, LV_PART_SCROLLBAR);
int32_t obj_h = lv_obj_get_height(obj);
int32_t obj_w = lv_obj_get_width(obj);
@ -508,8 +520,8 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t *
int32_t hor_req_space = hor_draw ? thickness : 0;
int32_t rem;
if(lv_obj_get_style_bg_opa(obj, LV_PART_SCROLLBAR) < LV_OPA_MIN &&
lv_obj_get_style_border_opa(obj, LV_PART_SCROLLBAR) < LV_OPA_MIN) {
if(lv_obj_get_style_bg_opa(obj, LV_PART_SCROLLBAR) <= LV_OPA_MIN &&
lv_obj_get_style_border_opa(obj, LV_PART_SCROLLBAR) <= LV_OPA_MIN) {
return;
}
@ -528,7 +540,8 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t *
}
int32_t sb_h = ((obj_h - top_space - bottom_space - hor_req_space) * obj_h) / content_h;
sb_h = LV_MAX(sb_h, SCROLLBAR_MIN_SIZE);
sb_h = LV_MAX(length > 0 ? length : sb_h, SCROLLBAR_MIN_SIZE); /*Style-defined size, calculated size, or minimum size*/
sb_h = LV_MIN(sb_h, obj_h); /*Limit scrollbar length to parent height*/
rem = (obj_h - top_space - bottom_space - hor_req_space) -
sb_h; /*Remaining size from the scrollbar track that is not the scrollbar itself*/
int32_t scroll_h = content_h - obj_h; /*The size of the content which can be really scrolled*/
@ -566,7 +579,8 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t *
hor_area->x2 = obj->coords.x2;
int32_t sb_w = ((obj_w - left_space - right_space - ver_reg_space) * obj_w) / content_w;
sb_w = LV_MAX(sb_w, SCROLLBAR_MIN_SIZE);
sb_w = LV_MAX(length > 0 ? length : sb_w, SCROLLBAR_MIN_SIZE); /*Style-defined size, calculated size, or minimum size*/
sb_w = LV_MIN(sb_w, obj_w); /*Limit scrollbar length to parent width*/
rem = (obj_w - left_space - right_space - ver_reg_space) -
sb_w; /*Remaining size from the scrollbar track that is not the scrollbar itself*/
int32_t scroll_w = content_w - obj_w; /*The size of the content which can be really scrolled*/
@ -793,7 +807,7 @@ static void scroll_area_into_view(const lv_area_t * area, lv_obj_t * child, lv_p
if((scroll_dir & LV_DIR_TOP) == 0 && y_scroll < 0) y_scroll = 0;
if((scroll_dir & LV_DIR_BOTTOM) == 0 && y_scroll > 0) y_scroll = 0;
scroll_value->x += anim_en == LV_ANIM_OFF ? 0 : x_scroll;
scroll_value->y += anim_en == LV_ANIM_OFF ? 0 : y_scroll;
scroll_value->x += anim_en ? x_scroll : 0;
scroll_value->y += anim_en ? y_scroll : 0;
lv_obj_scroll_by(parent, x_scroll, y_scroll, anim_en);
}

View File

@ -31,7 +31,7 @@ extern "C" {
typedef enum {
LV_SCROLLBAR_MODE_OFF, /**< Never show scrollbars*/
LV_SCROLLBAR_MODE_ON, /**< Always show scrollbars*/
LV_SCROLLBAR_MODE_ACTIVE, /**< Show scroll bars when object is being scrolled*/
LV_SCROLLBAR_MODE_ACTIVE, /**< Show scroll bars when Widget is being scrolled*/
LV_SCROLLBAR_MODE_AUTO, /**< Show scroll bars when the content is large enough to be scrolled*/
} lv_scrollbar_mode_t;
@ -53,29 +53,29 @@ typedef enum {
/**
* Set how the scrollbars should behave.
* @param obj pointer to an object
* @param obj pointer to Widget
* @param mode LV_SCROLL_MODE_ON/OFF/AUTO/ACTIVE
*/
void lv_obj_set_scrollbar_mode(lv_obj_t * obj, lv_scrollbar_mode_t mode);
/**
* Set the object in which directions can be scrolled
* @param obj pointer to an object
* @param dir the allow scroll directions. An element or OR-ed values of `lv_dir_t`
* Set direction Widget can be scrolled
* @param obj pointer to Widget
* @param dir one or more bit-wise OR-ed values of `lv_dir_t` enumeration
*/
void lv_obj_set_scroll_dir(lv_obj_t * obj, lv_dir_t dir);
/**
* Set where to snap the children when scrolling ends horizontally
* @param obj pointer to an object
* @param align the snap align to set from `lv_scroll_snap_t`
* @param obj pointer to Widget
* @param align value from `lv_scroll_snap_t` enumeration
*/
void lv_obj_set_scroll_snap_x(lv_obj_t * obj, lv_scroll_snap_t align);
/**
* Set where to snap the children when scrolling ends vertically
* @param obj pointer to an object
* @param align the snap align to set from `lv_scroll_snap_t`
* @param obj pointer to Widget
* @param align value from `lv_scroll_snap_t` enumeration
*/
void lv_obj_set_scroll_snap_y(lv_obj_t * obj, lv_scroll_snap_t align);
@ -85,92 +85,97 @@ void lv_obj_set_scroll_snap_y(lv_obj_t * obj, lv_scroll_snap_t align);
/**
* Get the current scroll mode (when to hide the scrollbars)
* @param obj pointer to an object
* @param obj pointer to Widget
* @return the current scroll mode from `lv_scrollbar_mode_t`
*/
lv_scrollbar_mode_t lv_obj_get_scrollbar_mode(const lv_obj_t * obj);
/**
* Get the object in which directions can be scrolled
* @param obj pointer to an object
* Get directions Widget can be scrolled (set with `lv_obj_set_scroll_dir()`)
* @param obj pointer to Widget
* @return current scroll direction bit(s)
*/
lv_dir_t lv_obj_get_scroll_dir(const lv_obj_t * obj);
/**
* Get where to snap the children when scrolling ends horizontally
* @param obj pointer to an object
* @return the current snap align from `lv_scroll_snap_t`
* Get where to snap child Widgets when horizontal scrolling ends.
* @param obj pointer to Widget
* @return current snap value from `lv_scroll_snap_t`
*/
lv_scroll_snap_t lv_obj_get_scroll_snap_x(const lv_obj_t * obj);
/**
* Get where to snap the children when scrolling ends vertically
* @param obj pointer to an object
* @return the current snap align from `lv_scroll_snap_t`
* Get where to snap child Widgets when vertical scrolling ends.
* @param obj pointer to Widget
* @return current snap value from `lv_scroll_snap_t`
*/
lv_scroll_snap_t lv_obj_get_scroll_snap_y(const lv_obj_t * obj);
/**
* Get current X scroll position.
* @param obj pointer to an object
* @return the current scroll position from the left edge.
* If the object is not scrolled return 0
* If scrolled return > 0
* If scrolled in (elastic scroll) return < 0
* Get current X scroll position. Identical to `lv_obj_get_scroll_left()`.
* @param obj pointer to scrollable container Widget
* @return current scroll position from left edge
* - If Widget is not scrolled return 0.
* - If scrolled return > 0.
* - If scrolled inside (elastic scroll) return < 0.
*/
int32_t lv_obj_get_scroll_x(const lv_obj_t * obj);
/**
* Get current Y scroll position.
* @param obj pointer to an object
* @return the current scroll position from the top edge.
* If the object is not scrolled return 0
* If scrolled return > 0
* If scrolled inside return < 0
* Get current Y scroll position. Identical to `lv_obj_get_scroll_top()`.
* @param obj pointer to scrollable container Widget
* @return current scroll position from top edge
* - If Widget is not scrolled return 0.
* - If scrolled return > 0.
* - If scrolled inside (elastic scroll) return < 0.
*/
int32_t lv_obj_get_scroll_y(const lv_obj_t * obj);
/**
* Return the height of the area above the object.
* That is the number of pixels the object can be scrolled down.
* Normally positive but can be negative when scrolled inside.
* @param obj pointer to an object
* @return the scrollable area above the object in pixels
* Number of pixels a scrollable container Widget can be scrolled down
* before its top edge appears. When LV_OBJ_FLAG_SCROLL_ELASTIC flag
* is set in Widget, this value can go negative while Widget is being
* dragged below its normal top-edge boundary.
* @param obj pointer to scrollable container Widget
* @return pixels Widget can be scrolled down before its top edge appears
*/
int32_t lv_obj_get_scroll_top(lv_obj_t * obj);
int32_t lv_obj_get_scroll_top(const lv_obj_t * obj);
/**
* Return the height of the area below the object.
* That is the number of pixels the object can be scrolled down.
* Normally positive but can be negative when scrolled inside.
* @param obj pointer to an object
* @return the scrollable area below the object in pixels
* Number of pixels a scrollable container Widget can be scrolled up
* before its bottom edge appears. When LV_OBJ_FLAG_SCROLL_ELASTIC flag
* is set in Widget, this value can go negative while Widget is being
* dragged above its normal bottom-edge boundary.
* @param obj pointer to scrollable container Widget
* @return pixels Widget can be scrolled up before its bottom edge appears
*/
int32_t lv_obj_get_scroll_bottom(lv_obj_t * obj);
int32_t lv_obj_get_scroll_bottom(const lv_obj_t * obj);
/**
* Return the width of the area on the left the object.
* That is the number of pixels the object can be scrolled down.
* Normally positive but can be negative when scrolled inside.
* @param obj pointer to an object
* @return the scrollable area on the left the object in pixels
* Number of pixels a scrollable container Widget can be scrolled right
* before its left edge appears. When LV_OBJ_FLAG_SCROLL_ELASTIC flag
* is set in Widget, this value can go negative while Widget is being
* dragged farther right than its normal left-edge boundary.
* @param obj pointer to scrollable container Widget
* @return pixels Widget can be scrolled right before its left edge appears
*/
int32_t lv_obj_get_scroll_left(lv_obj_t * obj);
int32_t lv_obj_get_scroll_left(const lv_obj_t * obj);
/**
* Return the width of the area on the right the object.
* That is the number of pixels the object can be scrolled down.
* Normally positive but can be negative when scrolled inside.
* @param obj pointer to an object
* @return the scrollable area on the right the object in pixels
* Number of pixels a scrollable container Widget can be scrolled left
* before its right edge appears. When LV_OBJ_FLAG_SCROLL_ELASTIC flag
* is set in Widget, this value can go negative while Widget is being
* dragged farther left than its normal right-edge boundary.
* @param obj pointer to scrollable container Widget
* @return pixels Widget can be scrolled left before its right edge appears
*/
int32_t lv_obj_get_scroll_right(lv_obj_t * obj);
int32_t lv_obj_get_scroll_right(const lv_obj_t * obj);
/**
* Get the X and Y coordinates where the scrolling will end for this object if a scrolling animation is in progress.
* Get the X and Y coordinates where the scrolling will end for Widget if a scrolling animation is in progress.
* If no scrolling animation, give the current `x` or `y` scroll position.
* @param obj pointer to an object
* @param end pointer to store the result
* @param obj pointer to scrollable Widget
* @param end pointer to `lv_point_t` object in which to store result
*/
void lv_obj_get_scroll_end(lv_obj_t * obj, lv_point_t * end);
@ -179,20 +184,20 @@ void lv_obj_get_scroll_end(lv_obj_t * obj, lv_point_t * end);
*====================*/
/**
* Scroll by a given amount of pixels
* @param obj pointer to an object to scroll
* @param x pixels to scroll horizontally
* @param y pixels to scroll vertically
* Scroll by given amount of pixels.
* @param obj pointer to scrollable Widget to scroll
* @param dx pixels to scroll horizontally
* @param dy pixels to scroll vertically
* @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately
* @note > 0 value means scroll right/bottom (show the more content on the right/bottom)
* @note e.g. dy = -20 means scroll down 20 px
*/
void lv_obj_scroll_by(lv_obj_t * obj, int32_t x, int32_t y, lv_anim_enable_t anim_en);
void lv_obj_scroll_by(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_enable_t anim_en);
/**
* Scroll by a given amount of pixels.
* Scroll by given amount of pixels.
* `dx` and `dy` will be limited internally to allow scrolling only on the content area.
* @param obj pointer to an object to scroll
* @param obj pointer to scrollable Widget to scroll
* @param dx pixels to scroll horizontally
* @param dy pixels to scroll vertically
* @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately
@ -201,9 +206,9 @@ void lv_obj_scroll_by(lv_obj_t * obj, int32_t x, int32_t y, lv_anim_enable_t ani
void lv_obj_scroll_by_bounded(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_enable_t anim_en);
/**
* Scroll to a given coordinate on an object.
* Scroll to given coordinate on Widget.
* `x` and `y` will be limited internally to allow scrolling only on the content area.
* @param obj pointer to an object to scroll
* @param obj pointer to scrollable Widget to scroll
* @param x pixels to scroll horizontally
* @param y pixels to scroll vertically
* @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately
@ -211,56 +216,62 @@ void lv_obj_scroll_by_bounded(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_en
void lv_obj_scroll_to(lv_obj_t * obj, int32_t x, int32_t y, lv_anim_enable_t anim_en);
/**
* Scroll to a given X coordinate on an object.
* Scroll to X coordinate on Widget.
* `x` will be limited internally to allow scrolling only on the content area.
* @param obj pointer to an object to scroll
* @param obj pointer to scrollable Widget to scroll
* @param x pixels to scroll horizontally
* @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately
*/
void lv_obj_scroll_to_x(lv_obj_t * obj, int32_t x, lv_anim_enable_t anim_en);
/**
* Scroll to a given Y coordinate on an object
* Scroll to Y coordinate on Widget.
* `y` will be limited internally to allow scrolling only on the content area.
* @param obj pointer to an object to scroll
* @param obj pointer to scrollable Widget to scroll
* @param y pixels to scroll vertically
* @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately
*/
void lv_obj_scroll_to_y(lv_obj_t * obj, int32_t y, lv_anim_enable_t anim_en);
/**
* Scroll to an object until it becomes visible on its parent
* @param obj pointer to an object to scroll into view
* Scroll `obj`'s parent Widget until `obj` becomes visible.
* @param obj pointer to Widget to scroll into view
* @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately
*/
void lv_obj_scroll_to_view(lv_obj_t * obj, lv_anim_enable_t anim_en);
/**
* Scroll to an object until it becomes visible on its parent.
* Do the same on the parent's parent, and so on.
* Therefore the object will be scrolled into view even it has nested scrollable parents
* @param obj pointer to an object to scroll into view
* Scroll `obj`'s parent Widgets recursively until `obj` becomes visible.
* Widget will be scrolled into view even it has nested scrollable parents.
* @param obj pointer to Widget to scroll into view
* @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately
*/
void lv_obj_scroll_to_view_recursive(lv_obj_t * obj, lv_anim_enable_t anim_en);
/**
* Tell whether an object is being scrolled or not at this moment
* @param obj pointer to an object
* Tell whether Widget is being scrolled or not at this moment
* @param obj pointer to Widget
* @return true: `obj` is being scrolled
*/
bool lv_obj_is_scrolling(const lv_obj_t * obj);
/**
* Check the children of `obj` and scroll `obj` to fulfill the scroll_snap settings
* @param obj an object whose children needs to checked and snapped
* Stop scrolling the current object
*
* @param obj The object being scrolled
*/
void lv_obj_stop_scroll_anim(const lv_obj_t * obj);
/**
* Check children of `obj` and scroll `obj` to fulfill scroll_snap settings.
* @param obj Widget whose children need to be checked and snapped
* @param anim_en LV_ANIM_ON/OFF
*/
void lv_obj_update_snap(lv_obj_t * obj, lv_anim_enable_t anim_en);
/**
* Get the area of the scrollbars
* @param obj pointer to an object
* @param obj pointer to Widget
* @param hor pointer to store the area of the horizontal scrollbar
* @param ver pointer to store the area of the vertical scrollbar
*/
@ -268,13 +279,13 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor, lv_area_t * ver)
/**
* Invalidate the area of the scrollbars
* @param obj pointer to an object
* @param obj pointer to Widget
*/
void lv_obj_scrollbar_invalidate(lv_obj_t * obj);
/**
* Checks if the content is scrolled "in" and adjusts it to a normal position.
* @param obj pointer to an object
* @param obj pointer to Widget
* @param anim_en LV_ANIM_ON/OFF
*/
void lv_obj_readjust_scroll(lv_obj_t * obj, lv_anim_enable_t anim_en);

View File

@ -278,6 +278,8 @@ void lv_obj_refresh_style(lv_obj_t * obj, lv_style_selector_t selector, lv_style
if(!style_refr) return;
LV_PROFILER_STYLE_BEGIN;
lv_obj_invalidate(obj);
lv_part_t part = lv_obj_style_get_selector_part(selector);
@ -316,6 +318,8 @@ void lv_obj_refresh_style(lv_obj_t * obj, lv_style_selector_t selector, lv_style
refresh_children_style(obj);
}
}
LV_PROFILER_STYLE_END;
}
void lv_obj_enable_style_refresh(bool en)
@ -353,7 +357,9 @@ bool lv_obj_has_style_prop(const lv_obj_t * obj, lv_style_selector_t selector, l
void lv_obj_set_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t value,
lv_style_selector_t selector)
{
/*Stop running transitions wit this property */
LV_PROFILER_STYLE_BEGIN;
/*Stop running transitions with this property */
trans_delete(obj, lv_obj_style_get_selector_part(selector), prop, NULL);
lv_style_t * style = get_local_style(obj, selector);
@ -374,6 +380,7 @@ void lv_obj_set_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_
#endif
lv_obj_refresh_style(obj, selector, prop);
LV_PROFILER_STYLE_END;
}
lv_style_res_t lv_obj_get_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t * value,
@ -472,12 +479,18 @@ void lv_obj_style_create_transition(lv_obj_t * obj, lv_part_t part, lv_state_t p
lv_style_value_t lv_obj_style_apply_color_filter(const lv_obj_t * obj, lv_part_t part, lv_style_value_t v)
{
#if LV_USE_COLOR_FILTER
if(obj == NULL) return v;
const lv_color_filter_dsc_t * f = lv_obj_get_style_color_filter_dsc(obj, part);
if(f && f->filter_cb) {
lv_opa_t f_opa = lv_obj_get_style_color_filter_opa(obj, part);
if(f_opa != 0) v.color = f->filter_cb(f, v.color, f_opa);
}
#else
LV_UNUSED(obj);
LV_UNUSED(part);
LV_UNUSED(v);
#endif
return v;
}
@ -577,9 +590,12 @@ lv_text_align_t lv_obj_calculate_style_text_align(const lv_obj_t * obj, lv_part_
lv_opa_t lv_obj_get_style_opa_recursive(const lv_obj_t * obj, lv_part_t part)
{
LV_PROFILER_STYLE_BEGIN;
lv_opa_t opa_obj = lv_obj_get_style_opa(obj, part);
if(opa_obj <= LV_OPA_MIN) return LV_OPA_TRANSP;
if(opa_obj <= LV_OPA_MIN) {
LV_PROFILER_STYLE_END;
return LV_OPA_TRANSP;
}
lv_opa_t opa_final = LV_OPA_COVER;
if(opa_obj < LV_OPA_MAX) {
@ -595,7 +611,10 @@ lv_opa_t lv_obj_get_style_opa_recursive(const lv_obj_t * obj, lv_part_t part)
while(obj) {
opa_obj = lv_obj_get_style_opa(obj, part);
if(opa_obj <= LV_OPA_MIN) return LV_OPA_TRANSP;
if(opa_obj <= LV_OPA_MIN) {
LV_PROFILER_STYLE_END;
return LV_OPA_TRANSP;
}
if(opa_obj < LV_OPA_MAX) {
opa_final = LV_OPA_MIX2(opa_final, opa_obj);
}
@ -603,8 +622,17 @@ lv_opa_t lv_obj_get_style_opa_recursive(const lv_obj_t * obj, lv_part_t part)
obj = lv_obj_get_parent(obj);
}
if(opa_final <= LV_OPA_MIN) return LV_OPA_TRANSP;
if(opa_final >= LV_OPA_MAX) return LV_OPA_COVER;
if(opa_final <= LV_OPA_MIN) {
LV_PROFILER_STYLE_END;
return LV_OPA_TRANSP;
}
if(opa_final >= LV_OPA_MAX) {
LV_PROFILER_STYLE_END;
return LV_OPA_COVER;
}
LV_PROFILER_STYLE_END;
return opa_final;
}
@ -618,6 +646,41 @@ void lv_obj_update_layer_type(lv_obj_t * obj)
}
}
lv_color32_t lv_obj_style_apply_recolor(const lv_obj_t * obj, lv_part_t part, lv_color32_t color)
{
lv_opa_t opa = lv_obj_get_style_recolor_opa(obj, part);
if(opa > LV_OPA_TRANSP) {
lv_color_t recolor = lv_obj_get_style_recolor(obj, part);
color = lv_color_over32(color, lv_color_to_32(recolor, opa));
}
return color;
}
lv_color32_t lv_obj_get_style_recolor_recursive(const lv_obj_t * obj, lv_part_t part)
{
lv_color32_t result;
lv_color_t color = lv_obj_get_style_recolor(obj, part);
lv_opa_t opa = lv_obj_get_style_recolor_opa(obj, part);
result = lv_color_to_32(color, opa);
if(part != LV_PART_MAIN) {
part = LV_PART_MAIN;
}
else {
obj = lv_obj_get_parent(obj);
}
while(obj) {
result = lv_obj_style_apply_recolor(obj, part, result);
obj = lv_obj_get_parent(obj);
}
return result;
}
/**********************
* STATIC FUNCTIONS
**********************/
@ -652,7 +715,7 @@ static lv_style_t * get_local_style(lv_obj_t * obj, lv_style_selector_t selector
}
lv_memzero(&obj->styles[i], sizeof(lv_obj_style_t));
obj->styles[i].style = lv_malloc(sizeof(lv_style_t));
obj->styles[i].style = lv_malloc_zeroed(sizeof(lv_style_t));
lv_style_init((lv_style_t *)obj->styles[i].style);
obj->styles[i].is_local = 1;
@ -861,6 +924,7 @@ static void trans_anim_cb(void * _tr, int32_t v)
else if(v < 128) value_final.ptr = tr->start_value.ptr;
else value_final.ptr = tr->end_value.ptr;
break;
case LV_STYLE_RECOLOR:
case LV_STYLE_BG_COLOR:
case LV_STYLE_BG_GRAD_COLOR:
case LV_STYLE_BORDER_COLOR:
@ -959,6 +1023,9 @@ static void trans_anim_completed_cb(lv_anim_t * a)
static lv_layer_type_t calculate_layer_type(lv_obj_t * obj)
{
#if LV_DRAW_TRANSFORM_USE_MATRIX
if(lv_obj_get_transform(obj) != NULL) return LV_LAYER_TYPE_TRANSFORM;
#endif
if(lv_obj_get_style_transform_rotation(obj, 0) != 0) return LV_LAYER_TYPE_TRANSFORM;
if(lv_obj_get_style_transform_scale_x(obj, 0) != 256) return LV_LAYER_TYPE_TRANSFORM;
if(lv_obj_get_style_transform_scale_y(obj, 0) != 256) return LV_LAYER_TYPE_TRANSFORM;

View File

@ -307,6 +307,25 @@ static inline int32_t lv_obj_get_style_transform_scale_y_safe(const lv_obj_t * o
*/
lv_opa_t lv_obj_get_style_opa_recursive(const lv_obj_t * obj, lv_part_t part);
/**
* Apply recolor effect to the input color based on the object's style properties.
* @param obj the target object containing recolor style properties
* @param part the part to retrieve recolor styles.
* @param color the original color to be modified
* @return the blended color after applying recolor and opacity
*/
lv_color32_t lv_obj_style_apply_recolor(const lv_obj_t * obj, lv_part_t part, lv_color32_t color);
/**
* Get the `recolor` style property from all parents and blend them recursively.
* @param obj the object whose recolor value should be retrieved
* @param part the target part to check. Non-MAIN parts will also consider
* the `recolor` value from the MAIN part during calculation
* @return the final blended recolor value combining all parent's recolor values
*/
lv_color32_t lv_obj_get_style_recolor_recursive(const lv_obj_t * obj, lv_part_t part);
/**********************
* MACROS
**********************/

View File

@ -122,6 +122,14 @@ void lv_obj_set_style_translate_y(lv_obj_t * obj, int32_t value, lv_style_select
lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSLATE_Y, v, selector);
}
void lv_obj_set_style_translate_radial(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
};
lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSLATE_RADIAL, v, selector);
}
void lv_obj_set_style_transform_scale_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
@ -226,6 +234,14 @@ void lv_obj_set_style_pad_column(lv_obj_t * obj, int32_t value, lv_style_selecto
lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_COLUMN, v, selector);
}
void lv_obj_set_style_pad_radial(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
};
lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_RADIAL, v, selector);
}
void lv_obj_set_style_margin_top(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
@ -658,6 +674,30 @@ void lv_obj_set_style_text_align(lv_obj_t * obj, lv_text_align_t value, lv_style
lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_ALIGN, v, selector);
}
void lv_obj_set_style_text_outline_stroke_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.color = value
};
lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_OUTLINE_STROKE_COLOR, v, selector);
}
void lv_obj_set_style_text_outline_stroke_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
};
lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_OUTLINE_STROKE_WIDTH, v, selector);
}
void lv_obj_set_style_text_outline_stroke_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
};
lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_OUTLINE_STROKE_OPA, v, selector);
}
void lv_obj_set_style_radius(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
@ -666,6 +706,14 @@ void lv_obj_set_style_radius(lv_obj_t * obj, int32_t value, lv_style_selector_t
lv_obj_set_local_style_prop(obj, LV_STYLE_RADIUS, v, selector);
}
void lv_obj_set_style_radial_offset(lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
};
lv_obj_set_local_style_prop(obj, LV_STYLE_RADIAL_OFFSET, v, selector);
}
void lv_obj_set_style_clip_corner(lv_obj_t * obj, bool value, lv_style_selector_t selector)
{
lv_style_value_t v = {
@ -706,6 +754,22 @@ void lv_obj_set_style_color_filter_opa(lv_obj_t * obj, lv_opa_t value, lv_style_
lv_obj_set_local_style_prop(obj, LV_STYLE_COLOR_FILTER_OPA, v, selector);
}
void lv_obj_set_style_recolor(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.color = value
};
lv_obj_set_local_style_prop(obj, LV_STYLE_RECOLOR, v, selector);
}
void lv_obj_set_style_recolor_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
};
lv_obj_set_local_style_prop(obj, LV_STYLE_RECOLOR_OPA, v, selector);
}
void lv_obj_set_style_anim(lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector)
{
lv_style_value_t v = {

View File

@ -103,6 +103,12 @@ static inline int32_t lv_obj_get_style_translate_y(const lv_obj_t * obj, lv_part
return (int32_t)v.num;
}
static inline int32_t lv_obj_get_style_translate_radial(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSLATE_RADIAL);
return (int32_t)v.num;
}
static inline int32_t lv_obj_get_style_transform_scale_x(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_SCALE_X);
@ -181,6 +187,12 @@ static inline int32_t lv_obj_get_style_pad_column(const lv_obj_t * obj, lv_part_
return (int32_t)v.num;
}
static inline int32_t lv_obj_get_style_pad_radial(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_RADIAL);
return (int32_t)v.num;
}
static inline int32_t lv_obj_get_style_margin_top(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MARGIN_TOP);
@ -231,8 +243,7 @@ static inline lv_color_t lv_obj_get_style_bg_grad_color(const lv_obj_t * obj, lv
static inline lv_color_t lv_obj_get_style_bg_grad_color_filtered(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
LV_STYLE_BG_GRAD_COLOR));
lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_COLOR));
return v.color;
}
@ -292,8 +303,7 @@ static inline lv_color_t lv_obj_get_style_bg_image_recolor(const lv_obj_t * obj,
static inline lv_color_t lv_obj_get_style_bg_image_recolor_filtered(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
LV_STYLE_BG_IMAGE_RECOLOR));
lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMAGE_RECOLOR));
return v.color;
}
@ -317,8 +327,7 @@ static inline lv_color_t lv_obj_get_style_border_color(const lv_obj_t * obj, lv_
static inline lv_color_t lv_obj_get_style_border_color_filtered(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
LV_STYLE_BORDER_COLOR));
lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_COLOR));
return v.color;
}
@ -360,8 +369,7 @@ static inline lv_color_t lv_obj_get_style_outline_color(const lv_obj_t * obj, lv
static inline lv_color_t lv_obj_get_style_outline_color_filtered(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
LV_STYLE_OUTLINE_COLOR));
lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_COLOR));
return v.color;
}
@ -409,8 +417,7 @@ static inline lv_color_t lv_obj_get_style_shadow_color(const lv_obj_t * obj, lv_
static inline lv_color_t lv_obj_get_style_shadow_color_filtered(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
LV_STYLE_SHADOW_COLOR));
lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_COLOR));
return v.color;
}
@ -434,8 +441,7 @@ static inline lv_color_t lv_obj_get_style_image_recolor(const lv_obj_t * obj, lv
static inline lv_color_t lv_obj_get_style_image_recolor_filtered(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
LV_STYLE_IMAGE_RECOLOR));
lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_IMAGE_RECOLOR));
return v.color;
}
@ -571,12 +577,42 @@ static inline lv_text_align_t lv_obj_get_style_text_align(const lv_obj_t * obj,
return (lv_text_align_t)v.num;
}
static inline lv_color_t lv_obj_get_style_text_outline_stroke_color(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_OUTLINE_STROKE_COLOR);
return v.color;
}
static inline lv_color_t lv_obj_get_style_text_outline_stroke_color_filtered(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_OUTLINE_STROKE_COLOR));
return v.color;
}
static inline int32_t lv_obj_get_style_text_outline_stroke_width(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_OUTLINE_STROKE_WIDTH);
return (int32_t)v.num;
}
static inline lv_opa_t lv_obj_get_style_text_outline_stroke_opa(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_OUTLINE_STROKE_OPA);
return (lv_opa_t)v.num;
}
static inline int32_t lv_obj_get_style_radius(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_RADIUS);
return (int32_t)v.num;
}
static inline int32_t lv_obj_get_style_radial_offset(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_RADIAL_OFFSET);
return (int32_t)v.num;
}
static inline bool lv_obj_get_style_clip_corner(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CLIP_CORNER);
@ -607,6 +643,18 @@ static inline lv_opa_t lv_obj_get_style_color_filter_opa(const lv_obj_t * obj, l
return (lv_opa_t)v.num;
}
static inline lv_color_t lv_obj_get_style_recolor(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_RECOLOR);
return v.color;
}
static inline lv_opa_t lv_obj_get_style_recolor_opa(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_RECOLOR_OPA);
return (lv_opa_t)v.num;
}
static inline const lv_anim_t * lv_obj_get_style_anim(const lv_obj_t * obj, lv_part_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ANIM);
@ -765,6 +813,7 @@ void lv_obj_set_style_transform_width(lv_obj_t * obj, int32_t value, lv_style_se
void lv_obj_set_style_transform_height(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_translate_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_translate_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_translate_radial(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_scale_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_scale_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_rotation(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
@ -778,6 +827,7 @@ void lv_obj_set_style_pad_left(lv_obj_t * obj, int32_t value, lv_style_selector_
void lv_obj_set_style_pad_right(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_row(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_column(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_radial(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_margin_top(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_margin_bottom(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_margin_left(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
@ -832,12 +882,18 @@ void lv_obj_set_style_text_letter_space(lv_obj_t * obj, int32_t value, lv_style_
void lv_obj_set_style_text_line_space(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_decor(lv_obj_t * obj, lv_text_decor_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_align(lv_obj_t * obj, lv_text_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_outline_stroke_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_outline_stroke_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_outline_stroke_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_radius(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_radial_offset(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_clip_corner(lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_opa_layered(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_color_filter_dsc(lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector);
void lv_obj_set_style_color_filter_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_recolor(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_recolor_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_anim(lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector);
void lv_obj_set_style_anim_duration(lv_obj_t * obj, uint32_t value, lv_style_selector_t selector);
void lv_obj_set_style_transition(lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector);

View File

@ -24,14 +24,14 @@ extern "C" {
* TYPEDEFS
**********************/
struct lv_obj_style_t {
struct _lv_obj_style_t {
const lv_style_t * style;
uint32_t selector : 24;
uint32_t is_local : 1;
uint32_t is_trans : 1;
};
struct lv_obj_style_transition_dsc_t {
struct _lv_obj_style_transition_dsc_t {
uint16_t time;
uint16_t delay;
lv_style_selector_t selector;

View File

@ -23,6 +23,7 @@
#define disp_ll_p &(LV_GLOBAL_DEFAULT()->disp_ll)
#define OBJ_DUMP_STRING_LEN 128
#define LV_OBJ_NAME_MAX_LEN 128
/**********************
* TYPEDEFS
@ -36,6 +37,9 @@ static void obj_delete_core(lv_obj_t * obj);
static lv_obj_tree_walk_res_t walk_core(lv_obj_t * obj, lv_obj_tree_walk_cb_t cb, void * user_data);
static void dump_tree_core(lv_obj_t * obj, int32_t depth);
static lv_obj_t * lv_obj_get_first_not_deleting_child(lv_obj_t * obj);
#if LV_USE_OBJ_NAME
static lv_obj_t * find_by_name_direct(const lv_obj_t * parent, const char * name, size_t len);
#endif /*LV_USE_OBJ_NAME*/
/**********************
* STATIC VARIABLES
@ -416,6 +420,166 @@ uint32_t lv_obj_get_child_count_by_type(const lv_obj_t * obj, const lv_obj_class
return cnt;
}
#if LV_USE_OBJ_NAME
void lv_obj_set_name(lv_obj_t * obj, const char * name)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
lv_obj_allocate_spec_attr(obj);
if(!obj->spec_attr->name_static && obj->spec_attr->name) lv_free((void *)obj->spec_attr->name);
if(name == NULL) {
obj->spec_attr->name = NULL;
obj->spec_attr->name_static = 1;
}
else {
obj->spec_attr->name = lv_strdup(name);
obj->spec_attr->name_static = 0;
}
}
void lv_obj_set_name_static(lv_obj_t * obj, const char * name)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
lv_obj_allocate_spec_attr(obj);
if(!obj->spec_attr->name_static && obj->spec_attr->name) lv_free((void *)obj->spec_attr->name);
obj->spec_attr->name = name;
obj->spec_attr->name_static = 1;
}
const char * lv_obj_get_name(const lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
if(obj->spec_attr == NULL) return NULL;
else return obj->spec_attr->name;
}
void lv_obj_get_name_resolved(const lv_obj_t * obj, char buf[], size_t buf_size)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
const char * name = lv_obj_get_name(obj);
/*Use a default name which auto-indexing*/
char name_buf[LV_OBJ_NAME_MAX_LEN];
if(name == NULL) {
lv_snprintf(name_buf, sizeof(name_buf), "%s_#", obj->class_p->name);
name = name_buf;
}
size_t name_len = lv_strlen(name);
lv_obj_t * parent = lv_obj_get_parent(obj);
/*If the last character is # automatically index the children with the same name start*/
if(parent && name_len > 0 && name[name_len - 1] == '#') {
uint32_t child_cnt = lv_obj_get_child_count(parent);
uint32_t cnt = 0;
uint32_t i;
for(i = 0; i < child_cnt; i++) {
lv_obj_t * child = lv_obj_get_child(parent, i);
/*All siblings older siblings are checked, craft the name of this widget*/
if(child == obj) {
char num_buf[8];
size_t num_len;
num_len = lv_snprintf(num_buf, sizeof(num_buf), "%d", cnt);
/*Is there enough space for the name and the index?*/
if(buf_size > name_len + num_len) {
/*E.g. buf = "some_name_", so trim the # from the end*/
lv_strncpy(buf, name, name_len - 1);
lv_strcpy(&buf[name_len - 1], num_buf);
}
else {
/*Use the name as it is as a fallback*/
lv_strlcpy(buf, obj->spec_attr->name, buf_size);
}
break;
}
/*Check the older siblings. IF they start with the same name count them*/
else {
const char * child_name = lv_obj_get_name(child);
if(child_name == NULL) {
/*If the name we are looking for start with the child's class name
*increment the index. E.g. <class_name>_#*/
size_t class_name_len = lv_strlen(child->class_p->name);
if(name_len > 3 && class_name_len == name_len - 2 &&
lv_strncmp(child->class_p->name, name, class_name_len) == 0) {
cnt++;
}
}
/*The name is set, check if it's e.g. <some_name>#*/
else {
if(lv_strcmp(child->spec_attr->name, name) == 0) {
cnt++;
}
}
}
}
}
else {
/*Just use the set name*/
lv_strlcpy(buf, obj->spec_attr->name, buf_size);
}
}
lv_obj_t * lv_obj_get_child_by_name(const lv_obj_t * parent, const char * path)
{
LV_ASSERT_OBJ(parent, MY_CLASS);
if(parent == NULL || parent->spec_attr == NULL || path == NULL) return NULL;
while(*path) {
const char * segment = path;
uint32_t len = 0;
/* Calculate the length of the current segment */
while(path[len] && path[len] != '/')
len++;
/* Look for a child whose resolved name exactly matches the segment */
lv_obj_t * child = find_by_name_direct(parent, segment, len);
if(!child) return NULL; /*Segment not found*/
/* Advance to the next segment */
path += len;
if(*path == '/') path++; /* Skip the '/' */
/* If there is no further segment, we've found the target child */
if(*path == '\0') return child;
parent = child;
}
return NULL;
}
lv_obj_t * lv_obj_find_by_name(const lv_obj_t * parent, const char * name)
{
if(parent == NULL) parent = lv_display_get_screen_active(NULL);
if(parent == NULL) return NULL;
lv_obj_t * child = find_by_name_direct(parent, name, UINT16_MAX);
if(child) return child;
/*Search children recursively*/
uint32_t child_cnt = lv_obj_get_child_count(parent);
uint32_t i;
for(i = 0; i < child_cnt; i++) {
child = parent->spec_attr->children[i];
lv_obj_t * found = lv_obj_find_by_name(child, name);
if(found != NULL) return found;
}
return NULL;
}
#endif /*LV_USE_OBJ_NAME*/
int32_t lv_obj_get_index(const lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
@ -634,7 +798,7 @@ static void dump_tree_core(lv_obj_t * obj, int32_t depth)
#endif
/*id of `obj0` is an invalid id for builtin id*/
LV_LOG_USER("parent:%p, obj:%p, id:%s;", (void *)(obj ? obj->parent : NULL), (void *)obj, id);
LV_LOG_USER("%*sobj:%p, id:%s;", (int)(2 * depth), "", (void *)obj, id);
#endif /*LV_USE_LOG*/
if(obj && obj->spec_attr && obj->spec_attr->child_cnt) {
@ -660,3 +824,22 @@ static lv_obj_t * lv_obj_get_first_not_deleting_child(lv_obj_t * obj)
return NULL;
}
#if LV_USE_OBJ_NAME
static lv_obj_t * find_by_name_direct(const lv_obj_t * parent, const char * name, size_t len)
{
uint32_t i;
uint32_t child_cnt = lv_obj_get_child_count(parent);
for(i = 0; i < child_cnt; i++) {
lv_obj_t * child = parent->spec_attr->children[i];
char child_name_resolved[LV_OBJ_NAME_MAX_LEN];
lv_obj_get_name_resolved(child, child_name_resolved, sizeof(child_name_resolved));
if(lv_strncmp(child_name_resolved, name, len) == 0) return child;
}
return NULL;
}
#endif /*LV_USE_OBJ_NAME*/

View File

@ -193,6 +193,90 @@ uint32_t lv_obj_get_child_count(const lv_obj_t * obj);
uint32_t lv_obj_get_child_count_by_type(const lv_obj_t * obj, const lv_obj_class_t * class_p);
#if LV_USE_OBJ_NAME
/**
* Set a name for a widget. The name will be allocated and freed when the
* widget is deleted or a new name is set.
* @param obj pointer to an object
* @param name the name to set. If set to `NULL` the default "<widget_type>_#"
* name will be used.
* @note If the name ends with a `#`, older siblings with the same name
* will be counted, and the `#` will be replaced by the index of the
* given widget. For example, creating multiple widgets with the name
* "mybtn_#" will result in resolved names like "mybtn_0", "mybtn_1",
* "mybtn_2", etc. The name is resolved when `lv_obj_get_name_resolved`
* is called, so the result reflects the currently existing widgets at
* that time.
*/
void lv_obj_set_name(lv_obj_t * obj, const char * name);
/**
* Set a name for a widget. Only a pointer will be saved.
* @param obj pointer to an object
* @param name the name to set. If set to `NULL` the default "<widget_type>_#"
* name will be used.
* @note If the name ends with a `#`, older siblings with the same name
* will be counted, and the `#` will be replaced by the index of the
* given widget. For example, creating multiple widgets with the name
* "mybtn_#" will result in resolved names like "mybtn_0", "mybtn_1",
* "mybtn_2", etc. The name is resolved when `lv_obj_get_name_resolved`
* is called, so the result reflects the currently existing widgets at
* that time.
*/
void lv_obj_set_name_static(lv_obj_t * obj, const char * name);
/**
* Get the set name as it was set.
* @param obj pointer to an object
* @return get the set name or NULL if it wasn't set yet
*/
const char * lv_obj_get_name(const lv_obj_t * obj);
/**
* Get the set name or craft a name automatically.
* @param obj pointer to an object
* @param buf buffer to store the name
* @param buf_size the size of the buffer in bytes
* @note If the name ends with a `#`, older siblings with the same name
* will be counted, and the `#` will be replaced by the index of the
* given widget. For example, creating multiple widgets with the name
* "mybtn_#" will result in resolved names like "mybtn_0", "mybtn_1",
* "mybtn_2", etc. The name is resolved when `lv_obj_get_name_resolved`
* is called, so the result reflects the currently existing widgets at
* that time.
*/
void lv_obj_get_name_resolved(const lv_obj_t * obj, char buf[], size_t buf_size);
/**
* Find a child with a given name on a parent. This child doesn't have to be the
* direct child of the parent. First direct children of the parent will be checked,
* and the direct children of the first child, etc. (Breadth-first search).
*
* If the name of a widget was not set a name like "lv_button_1" will
* be created for it using `lv_obj_get_name_resolved`.
*
* @param parent the widget where the search should start
* @return the found widget or NULL if not found.
*/
lv_obj_t * lv_obj_find_by_name(const lv_obj_t * parent, const char * name);
/**
* Get an object by name. The name can be a path too, for example
* "main_container/lv_button_1/label".
* In this case the first part of the name-path should be the direct child of the parent,
* the second part, should the direct child of first one, etc.
*
* If the name of a widget was not set a name like "lv_button_1" will
* be created for it using `lv_obj_get_name_resolved`.
*
* @param parent the widget where the search should start
* @return the found widget or NULL if not found.
*/
lv_obj_t * lv_obj_get_child_by_name(const lv_obj_t * parent, const char * name_path);
#endif /*LV_USE_OBJ_NAME*/
/**
* Get the index of a child.
* @param obj pointer to an object

View File

@ -42,8 +42,8 @@
static void lv_refr_join_area(void);
static void refr_invalid_areas(void);
static void refr_sync_areas(void);
static void refr_area(const lv_area_t * area_p);
static void refr_area_part(lv_layer_t * layer);
static void refr_area(const lv_area_t * area_p, int32_t y_offset);
static void refr_configured_layer(lv_layer_t * layer);
static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj);
static void refr_obj_and_children(lv_layer_t * layer, lv_obj_t * top_obj);
static void refr_obj(lv_layer_t * layer, lv_obj_t * obj);
@ -99,6 +99,7 @@ void lv_refr_now(lv_display_t * disp)
void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj)
{
LV_PROFILER_REFR_BEGIN;
lv_area_t clip_area_ori = layer->_clip_area;
lv_area_t clip_coords_for_obj;
@ -108,7 +109,10 @@ void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj)
int32_t ext_draw_size = lv_obj_get_ext_draw_size(obj);
lv_area_increase(&obj_coords_ext, ext_draw_size, ext_draw_size);
if(!lv_area_intersect(&clip_coords_for_obj, &clip_area_ori, &obj_coords_ext)) return;
if(!lv_area_intersect(&clip_coords_for_obj, &clip_area_ori, &obj_coords_ext)) {
LV_PROFILER_REFR_END;
return;
}
/*If the object is visible on the current clip area*/
layer->_clip_area = clip_coords_for_obj;
@ -136,7 +140,7 @@ void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj)
}
lv_area_t clip_coords_for_children;
bool refr_children = true;
if(!lv_area_intersect(&clip_coords_for_children, &clip_area_ori, obj_coords)) {
if(!lv_area_intersect(&clip_coords_for_children, &layer->_clip_area, obj_coords) || layer->opa <= LV_OPA_MIN) {
refr_children = false;
}
@ -145,7 +149,6 @@ void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj)
uint32_t child_cnt = lv_obj_get_child_count(obj);
if(child_cnt == 0) {
/*If the object was visible on the clip area call the post draw events too*/
layer->_clip_area = clip_coords_for_obj;
/*If all the children are redrawn make 'post draw' draw*/
lv_obj_send_event(obj, LV_EVENT_DRAW_POST_BEGIN, layer);
lv_obj_send_event(obj, LV_EVENT_DRAW_POST, layer);
@ -168,7 +171,6 @@ void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj)
}
/*If the object was visible on the clip area call the post draw events too*/
layer->_clip_area = clip_coords_for_obj;
/*If all the children are redrawn make 'post draw' draw*/
lv_obj_send_event(obj, LV_EVENT_DRAW_POST_BEGIN, layer);
lv_obj_send_event(obj, LV_EVENT_DRAW_POST, layer);
@ -189,7 +191,7 @@ void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj)
lv_area_t bottom = obj->coords;
bottom.y1 = bottom.y2 - rout + 1;
if(lv_area_intersect(&bottom, &bottom, &clip_area_ori)) {
if(lv_area_intersect(&bottom, &bottom, &layer->_clip_area)) {
layer_children = lv_draw_layer_create(layer, LV_COLOR_FORMAT_ARGB8888, &bottom);
for(i = 0; i < child_cnt; i++) {
@ -210,7 +212,7 @@ void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj)
lv_area_t top = obj->coords;
top.y2 = top.y1 + rout - 1;
if(lv_area_intersect(&top, &top, &clip_area_ori)) {
if(lv_area_intersect(&top, &top, &layer->_clip_area)) {
layer_children = lv_draw_layer_create(layer, LV_COLOR_FORMAT_ARGB8888, &top);
for(i = 0; i < child_cnt; i++) {
@ -233,7 +235,7 @@ void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj)
lv_area_t mid = obj->coords;
mid.y1 += rout;
mid.y2 -= rout;
if(lv_area_intersect(&mid, &mid, &clip_area_ori)) {
if(lv_area_intersect(&mid, &mid, &layer->_clip_area)) {
layer->_clip_area = mid;
for(i = 0; i < child_cnt; i++) {
lv_obj_t * child = obj->spec_attr->children[i];
@ -252,6 +254,7 @@ void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj)
}
layer->_clip_area = clip_area_ori;
LV_PROFILER_REFR_END;
}
void lv_inv_area(lv_display_t * disp, const lv_area_t * area_p)
@ -347,7 +350,7 @@ void lv_refr_set_disp_refreshing(lv_display_t * disp)
void lv_display_refr_timer(lv_timer_t * tmr)
{
LV_PROFILER_BEGIN;
LV_PROFILER_REFR_BEGIN;
LV_TRACE_REFR("begin");
if(tmr) {
@ -365,26 +368,28 @@ void lv_display_refr_timer(lv_timer_t * tmr)
if(disp_refr == NULL) {
LV_LOG_WARN("No display registered");
LV_PROFILER_REFR_END;
return;
}
lv_draw_buf_t * buf_act = disp_refr->buf_act;
if(!(buf_act && buf_act->data && buf_act->data_size)) {
LV_LOG_WARN("No draw buffer");
LV_PROFILER_REFR_END;
return;
}
lv_display_send_event(disp_refr, LV_EVENT_REFR_START, NULL);
/*Refresh the screen's layout if required*/
LV_PROFILER_BEGIN_TAG("layout");
LV_PROFILER_LAYOUT_BEGIN_TAG("layout");
lv_obj_update_layout(disp_refr->act_scr);
if(disp_refr->prev_scr) lv_obj_update_layout(disp_refr->prev_scr);
lv_obj_update_layout(disp_refr->bottom_layer);
lv_obj_update_layout(disp_refr->top_layer);
lv_obj_update_layout(disp_refr->sys_layer);
LV_PROFILER_END_TAG("layout");
LV_PROFILER_LAYOUT_END_TAG("layout");
/*Do nothing if there is no active screen*/
if(disp_refr->act_scr == NULL) {
@ -398,10 +403,6 @@ void lv_display_refr_timer(lv_timer_t * tmr)
refr_invalid_areas();
if(disp_refr->inv_p == 0) goto refr_finish;
/*If refresh happened ...*/
lv_display_send_event(disp_refr, LV_EVENT_RENDER_READY, NULL);
/*In double buffered direct mode save the updated areas.
*They will be used on the next call to synchronize the buffers.*/
if(lv_display_is_double_buffered(disp_refr) && disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_DIRECT) {
@ -428,7 +429,7 @@ refr_finish:
lv_display_send_event(disp_refr, LV_EVENT_REFR_READY, NULL);
LV_TRACE_REFR("finished");
LV_PROFILER_END;
LV_PROFILER_REFR_END;
}
/**********************
@ -440,7 +441,7 @@ refr_finish:
*/
static void lv_refr_join_area(void)
{
LV_PROFILER_BEGIN;
LV_PROFILER_REFR_BEGIN;
uint32_t join_from;
uint32_t join_in;
lv_area_t joined_area;
@ -471,7 +472,7 @@ static void lv_refr_join_area(void)
}
}
}
LV_PROFILER_END;
LV_PROFILER_REFR_END;
}
/**
@ -488,7 +489,7 @@ static void refr_sync_areas(void)
/*Do not sync if no sync areas*/
if(lv_ll_is_empty(&disp_refr->sync_areas)) return;
LV_PROFILER_BEGIN;
LV_PROFILER_REFR_BEGIN;
/*With double buffered direct mode synchronize the rendered areas to the other buffer*/
/*We need to wait for ready here to not mess up the active screen*/
wait_for_flushing(disp_refr);
@ -496,7 +497,22 @@ static void refr_sync_areas(void)
/*The buffers are already swapped.
*So the active buffer is the off screen buffer where LVGL will render*/
lv_draw_buf_t * off_screen = disp_refr->buf_act;
lv_draw_buf_t * on_screen = disp_refr->buf_act == disp_refr->buf_1 ? disp_refr->buf_2 : disp_refr->buf_1;
/*Triple buffer sync buffer for off-screen2 updates.*/
lv_draw_buf_t * off_screen2;
lv_draw_buf_t * on_screen;
if(disp_refr->buf_act == disp_refr->buf_1) {
off_screen2 = disp_refr->buf_2;
on_screen = disp_refr->buf_3 ? disp_refr->buf_3 : disp_refr->buf_2;
}
else if(disp_refr->buf_act == disp_refr->buf_2) {
off_screen2 = disp_refr->buf_3 ? disp_refr->buf_3 : disp_refr->buf_1;
on_screen = disp_refr->buf_1;
}
else {
off_screen2 = disp_refr->buf_1;
on_screen = disp_refr->buf_2;
}
uint32_t hor_res = lv_display_get_horizontal_resolution(disp_refr);
uint32_t ver_res = lv_display_get_vertical_resolution(disp_refr);
@ -543,13 +559,22 @@ static void refr_sync_areas(void)
/**
* @todo Resize SDL window will trigger crash because of sync_area is larger than disp_area
*/
lv_area_intersect(sync_area, sync_area, &disp_area);
if(!lv_area_intersect(sync_area, sync_area, &disp_area)) {
continue;
}
#if LV_DRAW_TRANSFORM_USE_MATRIX
if(lv_display_get_matrix_rotation(disp_refr)) {
lv_display_rotate_area(disp_refr, sync_area);
}
#endif
lv_draw_buf_copy(off_screen, sync_area, on_screen, sync_area);
if(off_screen2 != on_screen)
lv_draw_buf_copy(off_screen2, sync_area, on_screen, sync_area);
}
/*Clear sync areas*/
lv_ll_clear(&disp_refr->sync_areas);
LV_PROFILER_END;
LV_PROFILER_REFR_END;
}
/**
@ -558,7 +583,7 @@ static void refr_sync_areas(void)
static void refr_invalid_areas(void)
{
if(disp_refr->inv_p == 0) return;
LV_PROFILER_BEGIN;
LV_PROFILER_REFR_BEGIN;
/*Find the last area which will be drawn*/
int32_t i;
@ -579,16 +604,59 @@ static void refr_invalid_areas(void)
for(i = 0; i < (int32_t)disp_refr->inv_p; i++) {
/*Refresh the unjoined areas*/
if(disp_refr->inv_area_joined[i] == 0) {
if(disp_refr->inv_area_joined[i]) continue;
if(i == last_i) disp_refr->last_area = 1;
disp_refr->last_part = 0;
refr_area(&disp_refr->inv_areas[i]);
if(i == last_i) disp_refr->last_area = 1;
disp_refr->last_part = 0;
lv_area_t inv_a = disp_refr->inv_areas[i];
if(disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_PARTIAL) {
/*Calculate the max row num*/
int32_t w = lv_area_get_width(&inv_a);
int32_t h = lv_area_get_height(&inv_a);
int32_t max_row = get_max_row(disp_refr, w, h);
int32_t row;
int32_t row_last = 0;
lv_area_t sub_area;
sub_area.x1 = inv_a.x1;
sub_area.x2 = inv_a.x2;
int32_t y_off = 0;
for(row = inv_a.y1; row + max_row - 1 <= inv_a.y2; row += max_row) {
/*Calc. the next y coordinates of draw_buf*/
sub_area.y1 = row;
sub_area.y2 = row + max_row - 1;
if(sub_area.y2 > inv_a.y2) sub_area.y2 = inv_a.y2;
row_last = sub_area.y2;
if(inv_a.y2 == row_last) disp_refr->last_part = 1;
refr_area(&sub_area, y_off);
y_off += lv_area_get_height(&sub_area);
draw_buf_flush(disp_refr);
}
/*If the last y coordinates are not handled yet ...*/
if(inv_a.y2 != row_last) {
/*Calc. the next y coordinates of draw_buf*/
sub_area.y1 = row;
sub_area.y2 = inv_a.y2;
disp_refr->last_part = 1;
refr_area(&sub_area, y_off);
y_off += lv_area_get_height(&sub_area);
draw_buf_flush(disp_refr);
}
}
else if(disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_FULL ||
disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_DIRECT) {
disp_refr->last_part = 1;
refr_area(&disp_refr->inv_areas[i], 0);
draw_buf_flush(disp_refr);
}
}
lv_display_send_event(disp_refr, LV_EVENT_RENDER_READY, NULL);
disp_refr->rendering_in_progress = false;
LV_PROFILER_END;
LV_PROFILER_REFR_END;
}
/**
@ -611,96 +679,174 @@ static void layer_reshape_draw_buf(lv_layer_t * layer, uint32_t stride)
* Refresh an area if there is Virtual Display Buffer
* @param area_p pointer to an area to refresh
*/
static void refr_area(const lv_area_t * area_p)
static void refr_area(const lv_area_t * area_p, int32_t y_offset)
{
LV_PROFILER_BEGIN;
LV_PROFILER_REFR_BEGIN;
lv_layer_t * layer = disp_refr->layer_head;
layer->draw_buf = disp_refr->buf_act;
layer->_clip_area = *area_p;
layer->phy_clip_area = *area_p;
layer->partial_y_offset = y_offset;
#if LV_DRAW_TRANSFORM_USE_MATRIX
lv_matrix_identity(&layer->matrix);
#endif
/*With full refresh just redraw directly into the buffer*/
/*In direct mode draw directly on the absolute coordinates of the buffer*/
if(disp_refr->render_mode != LV_DISPLAY_RENDER_MODE_PARTIAL) {
if(disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_PARTIAL) {
/*In partial mode render this area to the buffer*/
layer->buf_area = *area_p;
layer_reshape_draw_buf(layer, LV_STRIDE_AUTO);
}
else if(disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_DIRECT ||
disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_FULL) {
/*In direct mode and full mode the the buffer area is always the whole screen, not considering rotation*/
layer->buf_area.x1 = 0;
layer->buf_area.y1 = 0;
layer->buf_area.x2 = lv_display_get_horizontal_resolution(disp_refr) - 1;
layer->buf_area.y2 = lv_display_get_vertical_resolution(disp_refr) - 1;
lv_area_t disp_area;
lv_area_set(&disp_area, 0, 0, lv_display_get_horizontal_resolution(disp_refr) - 1,
lv_display_get_vertical_resolution(disp_refr) - 1);
if(disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_FULL) {
disp_refr->last_part = 1;
layer_reshape_draw_buf(layer, layer->draw_buf->header.stride);
layer->_clip_area = disp_area;
layer->phy_clip_area = disp_area;
refr_area_part(layer);
if(lv_display_get_matrix_rotation(disp_refr)) {
layer->buf_area.x2 = lv_display_get_original_horizontal_resolution(disp_refr) - 1;
layer->buf_area.y2 = lv_display_get_original_vertical_resolution(disp_refr) - 1;
}
else if(disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_DIRECT) {
disp_refr->last_part = disp_refr->last_area;
layer_reshape_draw_buf(layer, layer->draw_buf->header.stride);
layer->_clip_area = *area_p;
layer->phy_clip_area = *area_p;
refr_area_part(layer);
else {
layer->buf_area.x2 = lv_display_get_horizontal_resolution(disp_refr) - 1;
layer->buf_area.y2 = lv_display_get_vertical_resolution(disp_refr) - 1;
}
LV_PROFILER_END;
return;
layer_reshape_draw_buf(layer, disp_refr->stride_is_auto ? LV_STRIDE_AUTO : layer->draw_buf->header.stride);
}
/*Normal refresh: draw the area in parts*/
/*Calculate the max row num*/
int32_t w = lv_area_get_width(area_p);
int32_t h = lv_area_get_height(area_p);
int32_t y2 = area_p->y2 >= lv_display_get_vertical_resolution(disp_refr) ?
lv_display_get_vertical_resolution(disp_refr) - 1 : area_p->y2;
/*Try to divide the area to smaller tiles*/
uint32_t tile_cnt = 1;
int32_t tile_h = lv_area_get_height(area_p);
if(LV_COLOR_FORMAT_IS_INDEXED(layer->color_format) == false) {
/* Assume that the the buffer size (can be screen sized or smaller in case of partial mode)
* and max tile size are the optimal scenario. From this calculate the ideal tile size
* and set the tile count and tile height accordingly.
*/
uint32_t max_tile_cnt = disp_refr->tile_cnt;
uint32_t total_buf_size = layer->draw_buf->data_size;
uint32_t ideal_tile_size = total_buf_size / max_tile_cnt;
uint32_t area_buf_size = lv_area_get_size(area_p) * lv_color_format_get_size(layer->color_format);
int32_t max_row = get_max_row(disp_refr, w, h);
int32_t row;
int32_t row_last = 0;
lv_area_t sub_area;
for(row = area_p->y1; row + max_row - 1 <= y2; row += max_row) {
/*Calc. the next y coordinates of draw_buf*/
sub_area.x1 = area_p->x1;
sub_area.x2 = area_p->x2;
sub_area.y1 = row;
sub_area.y2 = row + max_row - 1;
layer->draw_buf = disp_refr->buf_act;
layer->buf_area = sub_area;
layer->_clip_area = sub_area;
layer->phy_clip_area = sub_area;
layer_reshape_draw_buf(layer, LV_STRIDE_AUTO);
if(sub_area.y2 > y2) sub_area.y2 = y2;
row_last = sub_area.y2;
if(y2 == row_last) disp_refr->last_part = 1;
refr_area_part(layer);
tile_cnt = (area_buf_size + (ideal_tile_size - 1)) / ideal_tile_size; /*Round up*/
tile_h = lv_area_get_height(area_p) / tile_cnt;
}
/*If the last y coordinates are not handled yet ...*/
if(y2 != row_last) {
/*Calc. the next y coordinates of draw_buf*/
sub_area.x1 = area_p->x1;
sub_area.x2 = area_p->x2;
sub_area.y1 = row;
sub_area.y2 = y2;
layer->draw_buf = disp_refr->buf_act;
layer->buf_area = sub_area;
layer->_clip_area = sub_area;
layer->phy_clip_area = sub_area;
layer_reshape_draw_buf(layer, LV_STRIDE_AUTO);
disp_refr->last_part = 1;
refr_area_part(layer);
if(tile_cnt == 1) {
refr_configured_layer(layer);
}
LV_PROFILER_END;
else {
/* Don't draw to the layers buffer of the display but create smaller dummy layers which are using the
* display's layer buffer. These will be the tiles. By using tiles it's more likely that there will
* be independent areas for each draw unit. */
lv_layer_t * tile_layers = lv_malloc(tile_cnt * sizeof(lv_layer_t));
LV_ASSERT_MALLOC(tile_layers);
if(tile_layers == NULL) {
disp_refr->refreshed_area = *area_p;
LV_PROFILER_REFR_END;
return;
}
uint32_t i;
for(i = 0; i < tile_cnt; i++) {
lv_area_t tile_area;
lv_area_set(&tile_area, area_p->x1, area_p->y1 + i * tile_h,
area_p->x2, area_p->y1 + (i + 1) * tile_h - 1);
if(i == tile_cnt - 1) {
tile_area.y2 = area_p->y2;
}
lv_layer_t * tile_layer = &tile_layers[i];
lv_draw_layer_init(tile_layer, NULL, layer->color_format, &tile_area);
tile_layer->buf_area = layer->buf_area; /*the buffer is still large*/
tile_layer->draw_buf = layer->draw_buf;
refr_configured_layer(tile_layer);
}
/*Wait until all tiles are ready and destroy remove them*/
for(i = 0; i < tile_cnt; i++) {
lv_layer_t * tile_layer = &tile_layers[i];
while(tile_layer->draw_task_head) {
lv_draw_dispatch_wait_for_request();
lv_draw_dispatch();
}
lv_layer_t * layer_i = disp_refr->layer_head;
while(layer_i) {
if(layer_i->next == tile_layer) {
layer_i->next = tile_layer->next;
break;
}
layer_i = layer_i->next;
}
if(disp_refr->layer_deinit) disp_refr->layer_deinit(disp_refr, tile_layer);
}
lv_free(tile_layers);
}
disp_refr->refreshed_area = *area_p;
LV_PROFILER_REFR_END;
}
static void refr_area_part(lv_layer_t * layer)
static void refr_configured_layer(lv_layer_t * layer)
{
LV_PROFILER_BEGIN;
disp_refr->refreshed_area = layer->_clip_area;
LV_PROFILER_REFR_BEGIN;
lv_layer_reset(layer);
#if LV_DRAW_TRANSFORM_USE_MATRIX
if(lv_display_get_matrix_rotation(disp_refr)) {
const lv_display_rotation_t rotation = lv_display_get_rotation(disp_refr);
if(rotation != LV_DISPLAY_ROTATION_0) {
lv_display_rotate_area(disp_refr, &layer->phy_clip_area);
/**
* The screen rotation direction defined by LVGL is opposite to the drawing angle.
* Use direct matrix assignment to reduce precision loss and improve efficiency.
*/
switch(rotation) {
case LV_DISPLAY_ROTATION_90:
/**
* lv_matrix_rotate(&layer->matrix, 270);
* lv_matrix_translate(&layer->matrix, -disp_refr->ver_res, 0);
*/
layer->matrix.m[0][0] = 0;
layer->matrix.m[0][1] = 1;
layer->matrix.m[0][2] = 0;
layer->matrix.m[1][0] = -1;
layer->matrix.m[1][1] = 0;
layer->matrix.m[1][2] = disp_refr->ver_res;
break;
case LV_DISPLAY_ROTATION_180:
/**
* lv_matrix_rotate(&layer->matrix, 180);
* lv_matrix_translate(&layer->matrix, -disp_refr->hor_res, -disp_refr->ver_res);
*/
layer->matrix.m[0][0] = -1;
layer->matrix.m[0][1] = 0;
layer->matrix.m[0][2] = disp_refr->hor_res;
layer->matrix.m[1][0] = 0;
layer->matrix.m[1][1] = -1;
layer->matrix.m[1][2] = disp_refr->ver_res;
break;
case LV_DISPLAY_ROTATION_270:
/**
* lv_matrix_rotate(&layer->matrix, 90);
* lv_matrix_translate(&layer->matrix, 0, -disp_refr->hor_res);
*/
layer->matrix.m[0][0] = 0;
layer->matrix.m[0][1] = -1;
layer->matrix.m[0][2] = disp_refr->hor_res;
layer->matrix.m[1][0] = 1;
layer->matrix.m[1][1] = 0;
layer->matrix.m[1][2] = 0;
break;
default:
LV_LOG_WARN("Invalid rotation: %d", rotation);
break;
}
}
}
#endif /* LV_DRAW_TRANSFORM_USE_MATRIX */
/* In single buffered mode wait here until the buffer is freed.
* Else we would draw into the buffer while it's still being transferred to the display*/
@ -709,13 +855,9 @@ static void refr_area_part(lv_layer_t * layer)
}
/*If the screen is transparent initialize it when the flushing is ready*/
if(lv_color_format_has_alpha(disp_refr->color_format)) {
lv_area_t a = disp_refr->refreshed_area;
if(disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_PARTIAL) {
/*The area always starts at 0;0*/
lv_area_move(&a, -disp_refr->refreshed_area.x1, -disp_refr->refreshed_area.y1);
}
lv_draw_buf_clear(layer->draw_buf, &a);
lv_area_t clear_area = layer->_clip_area;
lv_area_move(&clear_area, -layer->buf_area.x1, -layer->buf_area.y1);
lv_draw_buf_clear(layer->draw_buf, &clear_area);
}
lv_obj_t * top_act_scr = NULL;
@ -757,8 +899,7 @@ static void refr_area_part(lv_layer_t * layer)
refr_obj_and_children(layer, lv_display_get_layer_top(disp_refr));
refr_obj_and_children(layer, lv_display_get_layer_sys(disp_refr));
draw_buf_flush(disp_refr);
LV_PROFILER_END;
LV_PROFILER_REFR_END;
}
/**
@ -774,6 +915,7 @@ static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj)
if(lv_area_is_in(area_p, &obj->coords, 0) == false) return NULL;
if(lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) return NULL;
if(lv_obj_get_layer_type(obj) != LV_LAYER_TYPE_NONE) return NULL;
if(lv_obj_get_style_opa(obj, LV_PART_MAIN) < LV_OPA_MAX) return NULL;
/*If this object is fully cover the draw area then check the children too*/
lv_cover_check_info_t info;
@ -815,16 +957,21 @@ static void refr_obj_and_children(lv_layer_t * layer, lv_obj_t * top_obj)
if(top_obj == NULL) top_obj = lv_display_get_screen_active(disp_refr);
if(top_obj == NULL) return; /*Shouldn't happen*/
LV_PROFILER_BEGIN;
/*Refresh the top object and its children*/
refr_obj(layer, top_obj);
LV_PROFILER_REFR_BEGIN;
/*Draw the 'younger' sibling objects because they can be on top_obj*/
lv_obj_t * parent;
lv_obj_t * border_p = top_obj;
parent = lv_obj_get_parent(top_obj);
/*Calculate the recolor before the parent*/
if(parent) {
layer->recolor = lv_obj_get_style_recolor_recursive(parent, LV_PART_MAIN);
}
/*Refresh the top object and its children*/
refr_obj(layer, top_obj);
/*Do until not reach the screen*/
while(parent != NULL) {
bool go = false;
@ -852,7 +999,7 @@ static void refr_obj_and_children(lv_layer_t * layer, lv_obj_t * top_obj)
/*Go a level deeper*/
parent = lv_obj_get_parent(parent);
}
LV_PROFILER_END;
LV_PROFILER_REFR_END;
}
static lv_result_t layer_get_area(lv_layer_t * layer, lv_obj_t * obj, lv_layer_type_t layer_type,
@ -915,11 +1062,17 @@ static bool alpha_test_area_on_obj(lv_obj_t * obj, const lv_area_t * area)
#if LV_DRAW_TRANSFORM_USE_MATRIX
static void refr_obj_matrix(lv_layer_t * layer, lv_obj_t * obj)
static bool obj_get_matrix(lv_obj_t * obj, lv_matrix_t * matrix)
{
lv_matrix_t ori_matrix = layer->matrix;
lv_matrix_t obj_matrix;
lv_matrix_identity(&obj_matrix);
lv_matrix_identity(matrix);
const lv_matrix_t * obj_matrix = lv_obj_get_transform(obj);
if(obj_matrix) {
lv_matrix_translate(matrix, obj->coords.x1, obj->coords.y1);
lv_matrix_multiply(matrix, obj_matrix);
lv_matrix_translate(matrix, -obj->coords.x1, -obj->coords.y1);
return true;
}
lv_point_t pivot = {
.x = lv_obj_get_style_transform_pivot_x(obj, 0),
@ -937,39 +1090,58 @@ static void refr_obj_matrix(lv_layer_t * layer, lv_obj_t * obj)
if(scale_x <= 0 || scale_y <= 0) {
/* NOT draw if scale is negative or zero */
return;
return false;
}
/* generate the obj matrix */
lv_matrix_translate(&obj_matrix, pivot.x, pivot.y);
lv_matrix_translate(matrix, pivot.x, pivot.y);
if(rotation != 0) {
lv_matrix_rotate(&obj_matrix, rotation * 0.1f);
lv_matrix_rotate(matrix, rotation * 0.1f);
}
if(scale_x != LV_SCALE_NONE || scale_y != LV_SCALE_NONE) {
lv_matrix_scale(
&obj_matrix,
matrix,
(float)scale_x / LV_SCALE_NONE,
(float)scale_y / LV_SCALE_NONE
);
}
if(skew_x != 0 || skew_y != 0) {
lv_matrix_skew(&obj_matrix, skew_x, skew_y);
lv_matrix_skew(matrix, skew_x, skew_y);
}
lv_matrix_translate(&obj_matrix, -pivot.x, -pivot.y);
lv_matrix_translate(matrix, -pivot.x, -pivot.y);
return true;
}
static void refr_obj_matrix(lv_layer_t * layer, lv_obj_t * obj)
{
LV_PROFILER_REFR_BEGIN;
lv_matrix_t obj_matrix;
if(!obj_get_matrix(obj, &obj_matrix)) {
/* NOT draw if obj matrix is not available */
LV_PROFILER_REFR_END;
return;
}
lv_matrix_t matrix_inv;
if(!lv_matrix_inverse(&matrix_inv, &obj_matrix)) {
/* NOT draw if matrix is not invertible */
LV_PROFILER_REFR_END;
return;
}
/* save original matrix */
lv_matrix_t ori_matrix = layer->matrix;
/* apply the obj matrix */
lv_matrix_multiply(&layer->matrix, &obj_matrix);
/* calculate clip area without transform */
lv_matrix_t matrix_reverse;
lv_matrix_inverse(&matrix_reverse, &obj_matrix);
lv_area_t clip_area = layer->_clip_area;
lv_area_t clip_area_ori = layer->_clip_area;
clip_area = lv_matrix_transform_area(&matrix_reverse, &clip_area);
clip_area = lv_matrix_transform_area(&matrix_inv, &clip_area);
/* increase the clip area by 1 pixel to avoid rounding errors */
if(!lv_matrix_is_identity_or_translation(&obj_matrix)) {
@ -985,6 +1157,7 @@ static void refr_obj_matrix(lv_layer_t * layer, lv_obj_t * obj)
layer->matrix = ori_matrix;
/* restore clip area */
layer->_clip_area = clip_area_ori;
LV_PROFILER_REFR_END;
}
static bool refr_check_obj_clip_overflow(lv_layer_t * layer, lv_obj_t * obj)
@ -1016,21 +1189,31 @@ static void refr_obj(lv_layer_t * layer, lv_obj_t * obj)
{
if(lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) return;
lv_opa_t opa = lv_obj_get_style_opa_layered(obj, 0);
if(opa < LV_OPA_MIN) return;
/*If `opa_layered != LV_OPA_COVER` draw the widget on a new layer and blend that layer with the given opacity.*/
const lv_opa_t opa_layered = lv_obj_get_style_opa_layered(obj, LV_PART_MAIN);
if(opa_layered <= LV_OPA_MIN) return;
#if LV_DRAW_TRANSFORM_USE_MATRIX
/*If the layer opa is full then use the matrix transform*/
if(opa >= LV_OPA_MAX && !refr_check_obj_clip_overflow(layer, obj)) {
refr_obj_matrix(layer, obj);
return;
const lv_opa_t layer_opa_ori = layer->opa;
const lv_color32_t layer_recolor = layer->recolor;
/*Normal `opa` (not layered) will just scale down `bg_opa`, `text_opa`, etc, in the upcoming drawings.*/
const lv_opa_t opa_main = lv_obj_get_style_opa(obj, LV_PART_MAIN);
if(opa_main < LV_OPA_MAX) {
layer->opa = LV_OPA_MIX2(layer_opa_ori, opa_main);
}
#endif /* LV_DRAW_TRANSFORM_USE_MATRIX */
layer->recolor = lv_obj_style_apply_recolor(obj, LV_PART_MAIN, layer->recolor);
lv_layer_type_t layer_type = lv_obj_get_layer_type(obj);
if(layer_type == LV_LAYER_TYPE_NONE) {
lv_obj_redraw(layer, obj);
}
#if LV_DRAW_TRANSFORM_USE_MATRIX
/*If the layer opa is full then use the matrix transform*/
else if(opa_layered >= LV_OPA_MAX && !refr_check_obj_clip_overflow(layer, obj)) {
refr_obj_matrix(layer, obj);
}
#endif /* LV_DRAW_TRANSFORM_USE_MATRIX */
else {
lv_area_t layer_area_full;
lv_area_t obj_draw_size;
@ -1058,7 +1241,10 @@ static void refr_obj(lv_layer_t * layer, lv_obj_t * obj)
* If it really doesn't need alpha use it. Else switch to the ARGB size*/
layer_area_act.y2 = layer_area_act.y1 + max_rgb_row_height - 1;
if(layer_area_act.y2 > layer_area_full.y2) layer_area_act.y2 = layer_area_full.y2;
bool area_need_alpha = alpha_test_area_on_obj(obj, &layer_area_act);
const void * bitmap_mask_src = lv_obj_get_style_bitmap_mask_src(obj, 0);
bool area_need_alpha = bitmap_mask_src || alpha_test_area_on_obj(obj, &layer_area_act);
if(area_need_alpha) {
layer_area_act.y2 = layer_area_act.y1 + max_argb_row_height - 1;
if(layer_area_act.y2 > layer_area_full.y2) layer_area_act.y2 = layer_area_full.y2;
@ -1085,7 +1271,7 @@ static void refr_obj(lv_layer_t * layer, lv_obj_t * obj)
layer_draw_dsc.pivot.x = obj->coords.x1 + pivot.x - new_layer->buf_area.x1;
layer_draw_dsc.pivot.y = obj->coords.y1 + pivot.y - new_layer->buf_area.y1;
layer_draw_dsc.opa = opa;
layer_draw_dsc.opa = opa_layered;
layer_draw_dsc.rotation = lv_obj_get_style_transform_rotation(obj, 0);
while(layer_draw_dsc.rotation > 3600) layer_draw_dsc.rotation -= 3600;
while(layer_draw_dsc.rotation < 0) layer_draw_dsc.rotation += 3600;
@ -1095,7 +1281,7 @@ static void refr_obj(lv_layer_t * layer, lv_obj_t * obj)
layer_draw_dsc.skew_y = lv_obj_get_style_transform_skew_y(obj, 0);
layer_draw_dsc.blend_mode = lv_obj_get_style_blend_mode(obj, 0);
layer_draw_dsc.antialias = disp_refr->antialiasing;
layer_draw_dsc.bitmap_mask_src = lv_obj_get_style_bitmap_mask_src(obj, 0);
layer_draw_dsc.bitmap_mask_src = bitmap_mask_src;
layer_draw_dsc.image_area = obj_draw_size;
layer_draw_dsc.src = new_layer;
@ -1104,6 +1290,10 @@ static void refr_obj(lv_layer_t * layer, lv_obj_t * obj)
layer_area_act.y1 = layer_area_act.y2 + 1;
}
}
/* Restore the original layer opa and recolor */
layer->opa = layer_opa_ori;
layer->recolor = layer_recolor;
}
static uint32_t get_max_row(lv_display_t * disp, int32_t area_w, int32_t area_h)
@ -1112,6 +1302,11 @@ static uint32_t get_max_row(lv_display_t * disp, int32_t area_w, int32_t area_h)
uint32_t stride = lv_draw_buf_width_to_stride(area_w, cf);
uint32_t overhead = LV_COLOR_INDEXED_PALETTE_SIZE(cf) * sizeof(lv_color32_t);
if(stride == 0) {
LV_LOG_WARN("Invalid stride. Value is 0");
return 0;
}
int32_t max_row = (uint32_t)(disp->buf_act->data_size - overhead) / stride;
if(max_row > area_h) max_row = area_h;
@ -1182,6 +1377,9 @@ static void draw_buf_flush(lv_display_t * disp)
if(disp->buf_act == disp->buf_1) {
disp->buf_act = disp->buf_2;
}
else if(disp->buf_act == disp->buf_2) {
disp->buf_act = disp->buf_3 ? disp->buf_3 : disp->buf_1;
}
else {
disp->buf_act = disp->buf_1;
}
@ -1190,7 +1388,7 @@ static void draw_buf_flush(lv_display_t * disp)
static void call_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map)
{
LV_PROFILER_BEGIN;
LV_PROFILER_REFR_BEGIN;
LV_TRACE_REFR("Calling flush_cb on (%d;%d)(%d;%d) area with %p image pointer",
(int)area->x1, (int)area->y1, (int)area->x2, (int)area->y2, (void *)px_map);
@ -1211,12 +1409,12 @@ static void call_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t *
disp->flush_cb(disp, &offset_area, px_map);
lv_display_send_event(disp, LV_EVENT_FLUSH_FINISH, &offset_area);
LV_PROFILER_END;
LV_PROFILER_REFR_END;
}
static void wait_for_flushing(lv_display_t * disp)
{
LV_PROFILER_BEGIN;
LV_PROFILER_REFR_BEGIN;
LV_LOG_TRACE("begin");
lv_display_send_event(disp, LV_EVENT_FLUSH_WAIT_START, NULL);
@ -1224,8 +1422,8 @@ static void wait_for_flushing(lv_display_t * disp)
if(disp->flush_wait_cb) {
if(disp->flushing) {
disp->flush_wait_cb(disp);
disp->flushing = 0;
}
disp->flushing = 0;
}
else {
while(disp->flushing);
@ -1235,5 +1433,5 @@ static void wait_for_flushing(lv_display_t * disp)
lv_display_send_event(disp, LV_EVENT_FLUSH_WAIT_FINISH, NULL);
LV_LOG_TRACE("end");
LV_PROFILER_END;
LV_PROFILER_REFR_END;
}

View File

@ -57,6 +57,12 @@ void lv_refr_now(lv_display_t * disp);
*/
void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj);
/**
* Called periodically to handle the refreshing
* @param timer pointer to the timer itself, or `NULL`
*/
void lv_display_refr_timer(lv_timer_t * timer);
/**********************
* STATIC FUNCTIONS
**********************/

View File

@ -58,12 +58,6 @@ lv_display_t * lv_refr_get_disp_refreshing(void);
*/
void lv_refr_set_disp_refreshing(lv_display_t * disp);
/**
* Called periodically to handle the refreshing
* @param timer pointer to the timer itself
*/
void lv_display_refr_timer(lv_timer_t * timer);
/**********************
* MACROS
**********************/

View File

@ -77,9 +77,17 @@ lv_display_t * lv_display_create(int32_t hor_res, int32_t ver_res)
disp->dpi = LV_DPI_DEF;
disp->color_format = LV_COLOR_FORMAT_NATIVE;
disp->layer_head = lv_malloc_zeroed(sizeof(lv_layer_t));
#if defined(LV_DRAW_SW_DRAW_UNIT_CNT) && (LV_DRAW_SW_DRAW_UNIT_CNT != 0)
disp->tile_cnt = LV_DRAW_SW_DRAW_UNIT_CNT;
#else
disp->tile_cnt = 1;
#endif
disp->layer_head = lv_malloc(sizeof(lv_layer_t));
LV_ASSERT_MALLOC(disp->layer_head);
if(disp->layer_head == NULL) return NULL;
lv_layer_init(disp->layer_head);
if(disp->layer_init) disp->layer_init(disp, disp->layer_head);
disp->layer_head->buf_area.x1 = 0;
@ -119,6 +127,13 @@ lv_display_t * lv_display_create(int32_t hor_res, int32_t ver_res)
else {
disp->theme = lv_theme_simple_get();
}
#elif LV_USE_THEME_MONO
if(lv_theme_mono_is_inited() == false) {
disp->theme = lv_theme_mono_init(disp, false, LV_FONT_DEFAULT);
}
else {
disp->theme = lv_theme_mono_get();
}
#endif
disp->bottom_layer = lv_obj_create(NULL); /*Create bottom layer on the display*/
@ -314,6 +329,26 @@ int32_t lv_display_get_vertical_resolution(const lv_display_t * disp)
}
}
int32_t lv_display_get_original_horizontal_resolution(const lv_display_t * disp)
{
if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) {
return 0;
}
return disp->hor_res;
}
int32_t lv_display_get_original_vertical_resolution(const lv_display_t * disp)
{
if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) {
return 0;
}
return disp->ver_res;
}
int32_t lv_display_get_physical_horizontal_resolution(const lv_display_t * disp)
{
if(disp == NULL) disp = lv_display_get_default();
@ -411,6 +446,19 @@ void lv_display_set_draw_buffers(lv_display_t * disp, lv_draw_buf_t * buf1, lv_d
disp->buf_1 = buf1;
disp->buf_2 = buf2;
disp->buf_act = disp->buf_1;
disp->stride_is_auto = 0;
}
void lv_display_set_3rd_draw_buffer(lv_display_t * disp, lv_draw_buf_t * buf3)
{
if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
LV_ASSERT_MSG(disp->buf_1 != NULL, "buf1 is null");
LV_ASSERT_MSG(disp->buf_2 != NULL, "buf2 is null");
disp->buf_3 = buf3;
}
void lv_display_set_buffers(lv_display_t * disp, void * buf1, void * buf2, uint32_t buf_size,
@ -418,9 +466,8 @@ void lv_display_set_buffers(lv_display_t * disp, void * buf1, void * buf2, uint3
{
LV_ASSERT_MSG(buf1 != NULL, "Null buffer");
lv_color_format_t cf = lv_display_get_color_format(disp);
uint32_t w = lv_display_get_horizontal_resolution(disp);
uint32_t h = lv_display_get_vertical_resolution(disp);
uint32_t w = lv_display_get_original_horizontal_resolution(disp);
uint32_t h = lv_display_get_original_vertical_resolution(disp);
LV_ASSERT_MSG(w != 0 && h != 0, "display resolution is 0");
/* buf1 or buf2 is not aligned according to LV_DRAW_BUF_ALIGN */
@ -428,6 +475,40 @@ void lv_display_set_buffers(lv_display_t * disp, void * buf1, void * buf2, uint3
LV_ASSERT_FORMAT_MSG(buf2 == NULL || buf2 == lv_draw_buf_align(buf2, cf), "buf2 is not aligned: %p", buf2);
uint32_t stride = lv_draw_buf_width_to_stride(w, cf);
if(render_mode == LV_DISPLAY_RENDER_MODE_PARTIAL) {
LV_ASSERT_FORMAT_MSG(stride != 0, "stride is 0, check your color format %d and width: %" LV_PRIu32, cf, w);
/* for partial mode, we calculate the height based on the buf_size and stride */
h = buf_size / stride;
LV_ASSERT_MSG(h != 0, "the buffer is too small");
}
else {
LV_ASSERT_FORMAT_MSG(stride * h <= buf_size, "%s mode requires screen sized buffer(s)",
render_mode == LV_DISPLAY_RENDER_MODE_FULL ? "FULL" : "DIRECT");
}
lv_draw_buf_init(&disp->_static_buf1, w, h, cf, stride, buf1, buf_size);
lv_draw_buf_init(&disp->_static_buf2, w, h, cf, stride, buf2, buf_size);
lv_display_set_draw_buffers(disp, &disp->_static_buf1, buf2 ? &disp->_static_buf2 : NULL);
lv_display_set_render_mode(disp, render_mode);
/* the stride was not set explicitly */
disp->stride_is_auto = 1;
}
void lv_display_set_buffers_with_stride(lv_display_t * disp, void * buf1, void * buf2, uint32_t buf_size,
uint32_t stride, lv_display_render_mode_t render_mode)
{
if(stride == LV_STRIDE_AUTO) {
lv_display_set_buffers(disp, buf1, buf2, buf_size, render_mode);
return;
}
LV_ASSERT_MSG(buf1 != NULL, "Null buffer");
lv_color_format_t cf = lv_display_get_color_format(disp);
uint32_t w = lv_display_get_original_horizontal_resolution(disp);
uint32_t h = lv_display_get_original_vertical_resolution(disp);
LV_ASSERT_MSG(w != 0 && h != 0, "display resolution is 0");
if(render_mode == LV_DISPLAY_RENDER_MODE_PARTIAL) {
/* for partial mode, we calculate the height based on the buf_size and stride */
h = buf_size / stride;
@ -442,6 +523,8 @@ void lv_display_set_buffers(lv_display_t * disp, void * buf1, void * buf2, uint3
lv_draw_buf_init(&disp->_static_buf2, w, h, cf, stride, buf2, buf_size);
lv_display_set_draw_buffers(disp, &disp->_static_buf1, buf2 ? &disp->_static_buf2 : NULL);
lv_display_set_render_mode(disp, render_mode);
disp->stride_is_auto = 0;
}
void lv_display_set_render_mode(lv_display_t * disp, lv_display_render_mode_t render_mode)
@ -476,6 +559,7 @@ void lv_display_set_color_format(lv_display_t * disp, lv_color_format_t color_fo
disp->layer_head->color_format = color_format;
if(disp->buf_1) disp->buf_1->header.cf = color_format;
if(disp->buf_2) disp->buf_2->header.cf = color_format;
if(disp->buf_3) disp->buf_3->header.cf = color_format;
lv_display_send_event(disp, LV_EVENT_COLOR_FORMAT_CHANGED, NULL);
}
@ -488,6 +572,24 @@ lv_color_format_t lv_display_get_color_format(lv_display_t * disp)
return disp->color_format;
}
void lv_display_set_tile_cnt(lv_display_t * disp, uint32_t tile_cnt)
{
LV_ASSERT_FORMAT_MSG(tile_cnt < 256, "tile_cnt must be smaller than 256 (%" LV_PRId32 " was used)", tile_cnt);
if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
disp->tile_cnt = tile_cnt;
}
uint32_t lv_display_get_tile_cnt(lv_display_t * disp)
{
if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return 0;
return disp->tile_cnt;
}
void lv_display_set_antialiasing(lv_display_t * disp, bool en)
{
if(disp == NULL) disp = lv_display_get_default();
@ -578,7 +680,7 @@ lv_obj_t * lv_display_get_layer_bottom(lv_display_t * disp)
return disp->bottom_layer;
}
void lv_screen_load(struct lv_obj_t * scr)
void lv_screen_load(struct _lv_obj_t * scr)
{
lv_screen_load_anim(scr, LV_SCR_LOAD_ANIM_NONE, 0, 0, false);
}
@ -796,6 +898,17 @@ lv_result_t lv_display_send_event(lv_display_t * disp, lv_event_code_t code, voi
return res;
}
lv_area_t * lv_event_get_invalidated_area(lv_event_t * e)
{
if(e->code == LV_EVENT_INVALIDATE_AREA) {
return lv_event_get_param(e);
}
else {
LV_LOG_WARN("Not interpreted with this event code");
return NULL;
}
}
void lv_display_set_rotation(lv_display_t * disp, lv_display_rotation_t rotation)
{
if(disp == NULL) disp = lv_display_get_default();
@ -812,6 +925,32 @@ lv_display_rotation_t lv_display_get_rotation(lv_display_t * disp)
return disp->rotation;
}
void lv_display_set_matrix_rotation(lv_display_t * disp, bool enable)
{
#if LV_DRAW_TRANSFORM_USE_MATRIX
if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
if(!(disp->render_mode == LV_DISPLAY_RENDER_MODE_DIRECT || disp->render_mode == LV_DISPLAY_RENDER_MODE_FULL)) {
LV_LOG_WARN("Unsupported rendering mode: %d", disp->render_mode);
return;
}
disp->matrix_rotation = enable;
#else
(void)disp;
(void)enable;
LV_LOG_WARN("LV_DRAW_TRANSFORM_USE_MATRIX was not enabled");
#endif
}
bool lv_display_get_matrix_rotation(lv_display_t * disp)
{
if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return false;
return disp->matrix_rotation;
}
void lv_display_set_theme(lv_display_t * disp, lv_theme_t * th)
{
if(!disp) disp = lv_display_get_default();
@ -902,6 +1041,49 @@ void lv_display_delete_refr_timer(lv_display_t * disp)
disp->refr_timer = NULL;
}
lv_result_t lv_display_send_vsync_event(lv_display_t * disp, void * param)
{
if(!disp) disp = lv_display_get_default();
if(!disp) return LV_RESULT_INVALID;
if(disp->vsync_count > 0)
return lv_display_send_event(disp, LV_EVENT_VSYNC, param);
return LV_RESULT_INVALID;
}
bool lv_display_register_vsync_event(lv_display_t * disp, lv_event_cb_t event_cb, void * user_data)
{
if(!disp) disp = lv_display_get_default();
if(!disp) return false;
lv_display_add_event_cb(disp, event_cb, LV_EVENT_VSYNC, user_data);
/*only send once*/
if(disp->vsync_count == 0)
lv_display_send_event(disp, LV_EVENT_VSYNC_REQUEST, disp);
disp->vsync_count++;
return true;
}
bool lv_display_unregister_vsync_event(lv_display_t * disp, lv_event_cb_t event_cb, void * user_data)
{
if(!disp) disp = lv_display_get_default();
if(!disp) return false;
uint32_t removed_count = lv_display_remove_event_cb_with_user_data(disp, event_cb, user_data);
if(removed_count == 0)
return false;
disp->vsync_count -= removed_count;
/*only send once*/
if(disp->vsync_count == 0)
lv_display_send_event(disp, LV_EVENT_VSYNC_REQUEST, NULL);
return true;
}
void lv_display_set_user_data(lv_display_t * disp, void * user_data)
{
if(!disp) disp = lv_display_get_default();
@ -943,12 +1125,12 @@ void lv_display_rotate_area(lv_display_t * disp, lv_area_t * area)
{
lv_display_rotation_t rotation = lv_display_get_rotation(disp);
if(rotation == LV_DISPLAY_ROTATION_0) return;
int32_t w = lv_area_get_width(area);
int32_t h = lv_area_get_height(area);
switch(rotation) {
case LV_DISPLAY_ROTATION_0:
return;
case LV_DISPLAY_ROTATION_90:
area->y2 = disp->ver_res - area->x1 - 1;
area->x1 = area->y1;
@ -967,9 +1149,43 @@ void lv_display_rotate_area(lv_display_t * disp, lv_area_t * area)
area->x2 = area->x1 + h - 1;
area->y1 = area->y2 - w + 1;
break;
default:
break;
}
}
uint32_t lv_display_get_draw_buf_size(lv_display_t * disp)
{
if(!disp) disp = lv_display_get_default();
if(!disp) return 0;
if(disp->buf_1) {
return disp->buf_1->data_size;
}
return 0;
}
uint32_t lv_display_get_invalidated_draw_buf_size(lv_display_t * disp, uint32_t width, uint32_t height)
{
if(!disp) disp = lv_display_get_default();
if(!disp) return 0;
if(disp->render_mode == LV_DISPLAY_RENDER_MODE_FULL) {
width = lv_display_get_horizontal_resolution(disp);
height = lv_display_get_vertical_resolution(disp);
}
lv_color_format_t cf = lv_display_get_color_format(disp);
uint32_t stride = lv_draw_buf_width_to_stride(width, cf);
uint32_t buf_size = stride * height;
LV_ASSERT(disp->buf_1 && disp->buf_1->data_size >= buf_size);
if(disp->buf_2) LV_ASSERT(disp->buf_2->data_size >= buf_size);
if(disp->buf_3) LV_ASSERT(disp->buf_3->data_size >= buf_size);
return buf_size;
}
lv_obj_t * lv_screen_active(void)
{
return lv_display_get_screen_active(lv_display_get_default());

View File

@ -17,7 +17,7 @@ extern "C" {
#include "../misc/lv_timer.h"
#include "../misc/lv_event.h"
#include "../misc/lv_color.h"
#include "../draw/lv_draw.h"
#include "../misc/lv_area.h"
/*********************
* DEFINES
@ -54,7 +54,7 @@ typedef enum {
/**
* Always redraw the whole screen even if only one pixel has been changed.
* With 2 buffers in flush_cb only and address change is required.
* With 2 buffers in flush_cb only an address change is required.
*/
LV_DISPLAY_RENDER_MODE_FULL,
} lv_display_render_mode_t;
@ -158,6 +158,13 @@ void lv_display_set_offset(lv_display_t * disp, int32_t x, int32_t y);
*/
void lv_display_set_rotation(lv_display_t * disp, lv_display_rotation_t rotation);
/**
* Use matrix rotation for the display. This function is depended on `LV_DRAW_TRANSFORM_USE_MATRIX`
* @param disp pointer to a display (NULL to use the default display)
* @param enable true: enable matrix rotation, false: disable
*/
void lv_display_set_matrix_rotation(lv_display_t * disp, bool enable);
/**
* Set the DPI (dot per inch) of the display.
* dpi = sqrt(hor_res^2 + ver_res^2) / diagonal"
@ -180,6 +187,20 @@ int32_t lv_display_get_horizontal_resolution(const lv_display_t * disp);
*/
int32_t lv_display_get_vertical_resolution(const lv_display_t * disp);
/**
* Get the original horizontal resolution of a display without considering rotation
* @param disp pointer to a display (NULL to use the default display)
* @return the horizontal resolution of the display.
*/
int32_t lv_display_get_original_horizontal_resolution(const lv_display_t * disp);
/**
* Get the original vertical resolution of a display without considering rotation
* @param disp pointer to a display (NULL to use the default display)
* @return the vertical resolution of the display
*/
int32_t lv_display_get_original_vertical_resolution(const lv_display_t * disp);
/**
* Get the physical horizontal resolution of a display
* @param disp pointer to a display (NULL to use the default display)
@ -215,6 +236,13 @@ int32_t lv_display_get_offset_y(const lv_display_t * disp);
*/
lv_display_rotation_t lv_display_get_rotation(lv_display_t * disp);
/**
* Get if matrix rotation is enabled for a display or not
* @param disp pointer to a display (NULL to use the default display)
* @return true: matrix rotation is enabled; false: disabled
*/
bool lv_display_get_matrix_rotation(lv_display_t * disp);
/**
* Get the DPI of the display
* @param disp pointer to a display (NULL to use the default display)
@ -239,6 +267,21 @@ int32_t lv_display_get_dpi(const lv_display_t * disp);
void lv_display_set_buffers(lv_display_t * disp, void * buf1, void * buf2, uint32_t buf_size,
lv_display_render_mode_t render_mode);
/**
* Set the frame buffers for a display, similarly to `lv_display_set_buffers`, but allow
* for a custom stride as required by a display controller.
* This allows the frame buffers to have a stride alignment different from the rest of
* the buffers`
* @param disp pointer to a display
* @param buf1 first buffer
* @param buf2 second buffer (can be `NULL`)
* @param buf_size buffer size in byte
* @param stride buffer stride in bytes
* @param render_mode LV_DISPLAY_RENDER_MODE_PARTIAL/DIRECT/FULL
*/
void lv_display_set_buffers_with_stride(lv_display_t * disp, void * buf1, void * buf2, uint32_t buf_size,
uint32_t stride, lv_display_render_mode_t render_mode);
/**
* Set the buffers for a display, accept a draw buffer pointer.
* Normally use `lv_display_set_buffers` is enough for most cases.
@ -249,6 +292,13 @@ void lv_display_set_buffers(lv_display_t * disp, void * buf1, void * buf2, uint3
*/
void lv_display_set_draw_buffers(lv_display_t * disp, lv_draw_buf_t * buf1, lv_draw_buf_t * buf2);
/**
* Set the third draw buffer for a display.
* @param disp pointer to a display
* @param buf3 third buffer
*/
void lv_display_set_3rd_draw_buffer(lv_display_t * disp, lv_draw_buf_t * buf3);
/**
* Set display render mode
* @param disp pointer to a display
@ -293,6 +343,20 @@ void lv_display_set_color_format(lv_display_t * disp, lv_color_format_t color_fo
*/
lv_color_format_t lv_display_get_color_format(lv_display_t * disp);
/**
* Set the number of tiles for parallel rendering.
* @param disp pointer to a display
* @param tile_cnt number of tiles (1 =< tile_cnt < 256)
*/
void lv_display_set_tile_cnt(lv_display_t * disp, uint32_t tile_cnt);
/**
* Get the number of tiles used for parallel rendering
* @param disp pointer to a display
* @return number of tiles
*/
uint32_t lv_display_get_tile_cnt(lv_display_t * disp);
/**
* Enable anti-aliasing for the render engine
* @param disp pointer to a display
@ -307,8 +371,6 @@ void lv_display_set_antialiasing(lv_display_t * disp, bool en);
*/
bool lv_display_get_antialiasing(lv_display_t * disp);
//! @cond Doxygen_Suppress
/**
* Call from the display driver when the flushing is finished
* @param disp pointer to display whose `flush_cb` was called
@ -324,8 +386,6 @@ LV_ATTRIBUTE_FLUSH_READY void lv_display_flush_ready(lv_display_t * disp);
*/
LV_ATTRIBUTE_FLUSH_READY bool lv_display_flush_is_last(lv_display_t * disp);
//! @endcond
bool lv_display_is_double_buffered(lv_display_t * disp);
/*---------------------
@ -374,7 +434,7 @@ lv_obj_t * lv_display_get_layer_bottom(lv_display_t * disp);
* Load a screen on the default display
* @param scr pointer to a screen
*/
void lv_screen_load(struct lv_obj_t * scr);
void lv_screen_load(struct _lv_obj_t * scr);
/**
* Switch screen with animation
@ -465,6 +525,13 @@ uint32_t lv_display_remove_event_cb_with_user_data(lv_display_t * disp, lv_event
*/
lv_result_t lv_display_send_event(lv_display_t * disp, lv_event_code_t code, void * param);
/**
* Get the area to be invalidated. Can be used in `LV_EVENT_INVALIDATE_AREA`
* @param e pointer to an event
* @return the area to invalidated (can be modified as required)
*/
lv_area_t * lv_event_get_invalidated_area(lv_event_t * e);
/**
* Set the theme of a display. If there are no user created widgets yet the screens' theme will be updated
* @param disp pointer to a display
@ -520,6 +587,33 @@ lv_timer_t * lv_display_get_refr_timer(lv_display_t * disp);
*/
void lv_display_delete_refr_timer(lv_display_t * disp);
/**
* Register vsync event of a display. `LV_EVENT_VSYNC` event will be sent periodically.
* Please don't use it in display event listeners, as it may cause memory leaks and illegal access issues.
*
* @param disp pointer to a display
* @param event_cb an event callback
* @param user_data optional user_data
*/
bool lv_display_register_vsync_event(lv_display_t * disp, lv_event_cb_t event_cb, void * user_data);
/**
* Unregister vsync event of a display. `LV_EVENT_VSYNC` event won't be sent periodically.
* Please don't use it in display event listeners, as it may cause memory leaks and illegal access issues.
* @param disp pointer to a display
* @param event_cb an event callback
* @param user_data optional user_data
*/
bool lv_display_unregister_vsync_event(lv_display_t * disp, lv_event_cb_t event_cb, void * user_data);
/**
* Send an vsync event to a display
* @param disp pointer to a display
* @param param optional param
* @return LV_RESULT_OK: disp wasn't deleted in the event.
*/
lv_result_t lv_display_send_vsync_event(lv_display_t * disp, void * param);
void lv_display_set_user_data(lv_display_t * disp, void * user_data);
void lv_display_set_driver_data(lv_display_t * disp, void * driver_data);
void * lv_display_get_user_data(lv_display_t * disp);
@ -533,6 +627,24 @@ lv_draw_buf_t * lv_display_get_buf_active(lv_display_t * disp);
*/
void lv_display_rotate_area(lv_display_t * disp, lv_area_t * area);
/**
* Get the size of the draw buffers
* @param disp pointer to a display
* @return the size of the draw buffer in bytes for valid display, 0 otherwise
*/
uint32_t lv_display_get_draw_buf_size(lv_display_t * disp);
/**
* Get the size of the invalidated draw buffer. Can be used in the flush callback
* to get the number of bytes used in the current render buffer.
* @param disp pointer to a display
* @param width the width of the invalidated area
* @param height the height of the invalidated area
* @return the size of the invalidated draw buffer in bytes, not accounting for
* any preceding palette information for a valid display, 0 otherwise
*/
uint32_t lv_display_get_invalidated_draw_buf_size(lv_display_t * disp, uint32_t width, uint32_t height);
/**********************
* MACROS
**********************/
@ -557,32 +669,37 @@ void lv_display_rotate_area(lv_display_t * disp, lv_area_t * area);
#endif
/**
* See `lv_dpx()` and `lv_display_dpx()`.
* Same as Android's DIP. (Different name is chosen to avoid mistype between LV_DPI and LV_DIP)
* 1 dip is 1 px on a 160 DPI screen
* 1 dip is 2 px on a 320 DPI screen
* https://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dip-dp-and-sp
*
* - 40 dip is 40 px on a 160 DPI screen (distance = 1/4 inch).
* - 40 dip is 80 px on a 320 DPI screen (distance still = 1/4 inch).
*
* @sa https://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dip-dp-and-sp
*/
#define LV_DPX_CALC(dpi, n) ((n) == 0 ? 0 :LV_MAX((( (dpi) * (n) + 80) / 160), 1)) /*+80 for rounding*/
#define LV_DPX(n) LV_DPX_CALC(lv_display_get_dpi(NULL), n)
/**
* Scale the given number of pixels (a distance or size) relative to a 160 DPI display
* considering the DPI of the default display.
* It ensures that e.g. `lv_dpx(100)` will have the same physical size regardless to the
* DPI of the display.
* @param n the number of pixels to scale
* @return `n x current_dpi/160`
* For default display, computes the number of pixels (a distance or size) as if the
* display had 160 DPI. This allows you to specify 1/160-th fractions of an inch to
* get real distance on the display that will be consistent regardless of its current
* DPI. It ensures `lv_dpx(100)`, for example, will have the same physical size
* regardless to the DPI of the display.
* @param n number of 1/160-th-inch units to compute with
* @return number of pixels to use to make that distance
*/
int32_t lv_dpx(int32_t n);
/**
* Scale the given number of pixels (a distance or size) relative to a 160 DPI display
* considering the DPI of the given display.
* It ensures that e.g. `lv_dpx(100)` will have the same physical size regardless to the
* DPI of the display.
* @param disp a display whose dpi should be considered
* @param n the number of pixels to scale
* @return `n x current_dpi/160`
* For specified display, computes the number of pixels (a distance or size) as if the
* display had 160 DPI. This allows you to specify 1/160-th fractions of an inch to
* get real distance on the display that will be consistent regardless of its current
* DPI. It ensures `lv_dpx(100)`, for example, will have the same physical size
* regardless to the DPI of the display.
* @param disp pointer to display whose dpi should be considered
* @param n number of 1/160-th-inch units to compute with
* @return number of pixels to use to make that distance
*/
int32_t lv_display_dpx(const lv_display_t * disp, int32_t n);

View File

@ -33,7 +33,7 @@ extern "C" {
* TYPEDEFS
**********************/
struct lv_display_t {
struct _lv_display_t {
/*---------------------
* Resolution
@ -65,6 +65,7 @@ struct lv_display_t {
*--------------------*/
lv_draw_buf_t * buf_1;
lv_draw_buf_t * buf_2;
lv_draw_buf_t * buf_3;
/** Internal, used by the library*/
lv_draw_buf_t * buf_act;
@ -91,6 +92,9 @@ struct lv_display_t {
lv_display_render_mode_t render_mode;
uint32_t antialiasing : 1; /**< 1: anti-aliasing is enabled on this display.*/
uint32_t tile_cnt : 8; /**< Divide the display buffer into these number of tiles */
uint32_t stride_is_auto : 1; /**< 1: The stride of the buffers was not set explicitly. */
/** 1: The current screen rendering is in progress*/
uint32_t rendering_in_progress : 1;
@ -143,6 +147,8 @@ struct lv_display_t {
uint32_t rotation : 3; /**< Element of lv_display_rotation_t*/
uint32_t matrix_rotation : 1; /**< 1: Use matrix for display rotation*/
lv_theme_t * theme; /**< The theme assigned to the screen*/
/** A timer which periodically checks the dirty areas and refreshes them*/
@ -153,6 +159,7 @@ struct lv_display_t {
/** The area being refreshed*/
lv_area_t refreshed_area;
uint32_t vsync_count;
#if LV_USE_PERF_MONITOR
lv_obj_t * perf_label;

View File

@ -0,0 +1,472 @@
/**
* @file lv_draw_dma2d.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_draw_dma2d_private.h"
#if LV_USE_DRAW_DMA2D
#include "../sw/lv_draw_sw.h"
#include "../../misc/lv_area_private.h"
#if !LV_DRAW_DMA2D_ASYNC && LV_USE_DRAW_DMA2D_INTERRUPT
#warning LV_USE_DRAW_DMA2D_INTERRUPT is 1 but has no effect because LV_USE_OS is LV_OS_NONE
#endif
/*********************
* DEFINES
*********************/
#define DRAW_UNIT_ID_DMA2D 5
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static int32_t evaluate_cb(lv_draw_unit_t * draw_unit, lv_draw_task_t * task);
static int32_t dispatch_cb(lv_draw_unit_t * draw_unit, lv_layer_t * layer);
static int32_t delete_cb(lv_draw_unit_t * draw_unit);
#if LV_DRAW_DMA2D_ASYNC
static void thread_cb(void * arg);
#endif
#if !LV_DRAW_DMA2D_ASYNC
static bool check_transfer_completion(void);
#endif
static void post_transfer_tasks(lv_draw_dma2d_unit_t * u);
/**********************
* STATIC VARIABLES
**********************/
#if LV_DRAW_DMA2D_ASYNC
static lv_draw_dma2d_unit_t * g_unit;
#endif
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_draw_dma2d_init(void)
{
lv_draw_dma2d_unit_t * draw_dma2d_unit = lv_draw_create_unit(sizeof(lv_draw_dma2d_unit_t));
draw_dma2d_unit->base_unit.evaluate_cb = evaluate_cb;
draw_dma2d_unit->base_unit.dispatch_cb = dispatch_cb;
draw_dma2d_unit->base_unit.delete_cb = delete_cb;
draw_dma2d_unit->base_unit.name = "DMA2D";
#if LV_DRAW_DMA2D_ASYNC
g_unit = draw_dma2d_unit;
lv_result_t res = lv_thread_init(&draw_dma2d_unit->thread, "dma2d", LV_DRAW_THREAD_PRIO, thread_cb, 2 * 1024,
draw_dma2d_unit);
LV_ASSERT(res == LV_RESULT_OK);
#endif
/* enable the DMA2D clock */
#if defined(STM32F4) || defined(STM32F7) || defined(STM32U5)
RCC->AHB1ENR |= RCC_AHB1ENR_DMA2DEN;
#elif defined(STM32H7)
RCC->AHB3ENR |= RCC_AHB3ENR_DMA2DEN;
#elif defined(STM32H7RS)
RCC->AHB5ENR |= RCC_AHB5ENR_DMA2DEN;
#else
#warning "LVGL can't enable the clock for DMA2D"
#endif
/* disable dead time */
DMA2D->AMTCR = 0;
/* enable the interrupt */
NVIC_EnableIRQ(DMA2D_IRQn);
}
void lv_draw_dma2d_deinit(void)
{
/* disable the interrupt */
NVIC_DisableIRQ(DMA2D_IRQn);
/* disable the DMA2D clock */
#if defined(STM32F4) || defined(STM32F7) || defined(STM32U5) || defined(STM32L4)
RCC->AHB1ENR &= ~RCC_AHB1ENR_DMA2DEN;
#elif defined(STM32H7)
RCC->AHB3ENR &= ~RCC_AHB3ENR_DMA2DEN;
#elif defined(STM32H7RS)
RCC->AHB5ENR &= ~RCC_AHB5ENR_DMA2DEN;
#endif
#if LV_DRAW_DMA2D_ASYNC
lv_result_t res = lv_thread_delete(&g_unit->thread);
LV_ASSERT(res == LV_RESULT_OK);
res = lv_thread_sync_delete(&g_unit->interrupt_signal);
LV_ASSERT(res == LV_RESULT_OK);
g_unit = NULL;
#endif
}
#if LV_USE_DRAW_DMA2D_INTERRUPT
void lv_draw_dma2d_transfer_complete_interrupt_handler(void)
{
#if LV_DRAW_DMA2D_ASYNC
lv_thread_sync_signal_isr(&g_unit->interrupt_signal);
#endif
}
#endif
lv_draw_dma2d_output_cf_t lv_draw_dma2d_cf_to_dma2d_output_cf(lv_color_format_t cf)
{
switch(cf) {
case LV_COLOR_FORMAT_ARGB8888:
case LV_COLOR_FORMAT_XRGB8888:
return LV_DRAW_DMA2D_OUTPUT_CF_ARGB8888;
case LV_COLOR_FORMAT_RGB888:
return LV_DRAW_DMA2D_OUTPUT_CF_RGB888;
case LV_COLOR_FORMAT_RGB565:
return LV_DRAW_DMA2D_OUTPUT_CF_RGB565;
case LV_COLOR_FORMAT_ARGB1555:
return LV_DRAW_DMA2D_OUTPUT_CF_ARGB1555;
default:
LV_ASSERT_MSG(false, "unsupported output color format");
}
return LV_DRAW_DMA2D_OUTPUT_CF_RGB565;
}
uint32_t lv_draw_dma2d_color_to_dma2d_color(lv_draw_dma2d_output_cf_t cf, lv_color_t color)
{
switch(cf) {
case LV_DRAW_DMA2D_OUTPUT_CF_ARGB8888:
case LV_DRAW_DMA2D_OUTPUT_CF_RGB888:
return lv_color_to_u32(color);
case LV_DRAW_DMA2D_OUTPUT_CF_RGB565:
return lv_color_to_u16(color);
default:
LV_ASSERT_MSG(false, "unsupported output color format");
}
return 0;
}
void lv_draw_dma2d_configure_and_start_transfer(const lv_draw_dma2d_configuration_t * conf)
{
/* number of lines register */
DMA2D->NLR = (conf->w << DMA2D_NLR_PL_Pos) | (conf->h << DMA2D_NLR_NL_Pos);
/* output */
/* output memory address register */
DMA2D->OMAR = (uint32_t)(uintptr_t) conf->output_address;
/* output offset register */
DMA2D->OOR = conf->output_offset;
/* output pixel format converter control register */
DMA2D->OPFCCR = ((uint32_t) conf->output_cf) << DMA2D_OPFCCR_CM_Pos;
/* Fill color. Only for mode LV_DRAW_DMA2D_MODE_REGISTER_TO_MEMORY */
DMA2D->OCOLR = conf->reg_to_mem_mode_color;
/* foreground */
/* foreground memory address register */
DMA2D->FGMAR = (uint32_t)(uintptr_t) conf->fg_address;
/* foreground offset register */
DMA2D->FGOR = conf->fg_offset;
/* foreground color. only for mem-to-mem with blending and fixed-color foreground */
DMA2D->FGCOLR = conf->fg_color;
/* foreground pixel format converter control register */
DMA2D->FGPFCCR = (((uint32_t) conf->fg_cf) << DMA2D_FGPFCCR_CM_Pos)
| (conf->fg_alpha << DMA2D_FGPFCCR_ALPHA_Pos)
| (conf->fg_alpha_mode << DMA2D_FGPFCCR_AM_Pos);
/* background */
DMA2D->BGMAR = (uint32_t)(uintptr_t) conf->bg_address;
DMA2D->BGOR = conf->bg_offset;
DMA2D->BGCOLR = conf->bg_color;
DMA2D->BGPFCCR = (((uint32_t) conf->bg_cf) << DMA2D_BGPFCCR_CM_Pos)
| (conf->bg_alpha << DMA2D_BGPFCCR_ALPHA_Pos)
| (conf->bg_alpha_mode << DMA2D_BGPFCCR_AM_Pos);
/* ensure the DMA2D register values are observed before the start transfer bit is set */
__DSB();
/* start the transfer (also set mode and enable transfer complete interrupt) */
DMA2D->CR = DMA2D_CR_START | (((uint32_t) conf->mode) << DMA2D_CR_MODE_Pos)
#if LV_USE_DRAW_DMA2D_INTERRUPT
| DMA2D_CR_TCIE
#endif
;
}
#if LV_DRAW_DMA2D_CACHE
void lv_draw_dma2d_invalidate_cache(const lv_draw_dma2d_cache_area_t * mem_area)
{
if((SCB->CCR & SCB_CCR_DC_Msk) == 0) return; /* data cache is disabled */
uint32_t rows_remaining = mem_area->height;
uint32_t row_addr = (uint32_t)(uintptr_t) mem_area->first_byte;
uint32_t row_end_addr = 0;
__DSB();
while(rows_remaining) {
uint32_t addr = row_addr & ~(__SCB_DCACHE_LINE_SIZE - 1U);
uint32_t cache_lines = ((((row_addr + mem_area->width_bytes - 1) & ~(__SCB_DCACHE_LINE_SIZE - 1U)) - addr) /
__SCB_DCACHE_LINE_SIZE) + 1;
if(addr == row_end_addr) {
addr += __SCB_DCACHE_LINE_SIZE;
cache_lines--;
}
while(cache_lines) {
SCB->DCIMVAC = addr;
addr += __SCB_DCACHE_LINE_SIZE;
cache_lines--;
}
row_end_addr = addr - __SCB_DCACHE_LINE_SIZE;
row_addr += mem_area->stride;
rows_remaining--;
};
__DSB();
__ISB();
}
void lv_draw_dma2d_clean_cache(const lv_draw_dma2d_cache_area_t * mem_area)
{
if((SCB->CCR & SCB_CCR_DC_Msk) == 0) return; /* data cache is disabled */
uint32_t rows_remaining = mem_area->height;
uint32_t row_addr = (uint32_t)(uintptr_t) mem_area->first_byte;
uint32_t row_end_addr = 0;
__DSB();
while(rows_remaining) {
uint32_t addr = row_addr & ~(__SCB_DCACHE_LINE_SIZE - 1U);
uint32_t cache_lines = ((((row_addr + mem_area->width_bytes - 1) & ~(__SCB_DCACHE_LINE_SIZE - 1U)) - addr) /
__SCB_DCACHE_LINE_SIZE) + 1;
if(addr == row_end_addr) {
addr += __SCB_DCACHE_LINE_SIZE;
cache_lines--;
}
while(cache_lines) {
SCB->DCCMVAC = addr;
addr += __SCB_DCACHE_LINE_SIZE;
cache_lines--;
}
row_end_addr = addr - __SCB_DCACHE_LINE_SIZE;
row_addr += mem_area->stride;
rows_remaining--;
};
__DSB();
__ISB();
}
#endif
/**********************
* STATIC FUNCTIONS
**********************/
static int32_t evaluate_cb(lv_draw_unit_t * draw_unit, lv_draw_task_t * task)
{
switch(task->type) {
case LV_DRAW_TASK_TYPE_FILL: {
lv_draw_fill_dsc_t * dsc = task->draw_dsc;
if(!(dsc->radius == 0
&& dsc->grad.dir == LV_GRAD_DIR_NONE
&& (dsc->base.layer->color_format == LV_COLOR_FORMAT_ARGB8888
|| dsc->base.layer->color_format == LV_COLOR_FORMAT_XRGB8888
|| dsc->base.layer->color_format == LV_COLOR_FORMAT_RGB888
|| dsc->base.layer->color_format == LV_COLOR_FORMAT_RGB565))) {
return 0;
}
}
break;
case LV_DRAW_TASK_TYPE_IMAGE: {
lv_draw_image_dsc_t * dsc = task->draw_dsc;
if(!(dsc->header.cf < LV_COLOR_FORMAT_PROPRIETARY_START
&& dsc->clip_radius == 0
&& dsc->bitmap_mask_src == NULL
&& dsc->sup == NULL
&& dsc->tile == 0
&& dsc->blend_mode == LV_BLEND_MODE_NORMAL
&& dsc->recolor_opa <= LV_OPA_MIN
&& dsc->skew_y == 0
&& dsc->skew_x == 0
&& dsc->scale_x == 256
&& dsc->scale_y == 256
&& dsc->rotation == 0
&& lv_image_src_get_type(dsc->src) == LV_IMAGE_SRC_VARIABLE
&& (dsc->header.cf == LV_COLOR_FORMAT_ARGB8888
|| dsc->header.cf == LV_COLOR_FORMAT_XRGB8888
|| dsc->header.cf == LV_COLOR_FORMAT_RGB888
|| dsc->header.cf == LV_COLOR_FORMAT_RGB565
|| dsc->header.cf == LV_COLOR_FORMAT_ARGB1555)
&& (dsc->base.layer->color_format == LV_COLOR_FORMAT_ARGB8888
|| dsc->base.layer->color_format == LV_COLOR_FORMAT_XRGB8888
|| dsc->base.layer->color_format == LV_COLOR_FORMAT_RGB888
|| dsc->base.layer->color_format == LV_COLOR_FORMAT_RGB565))) {
return 0;
}
}
break;
default:
return 0;
}
task->preferred_draw_unit_id = DRAW_UNIT_ID_DMA2D;
task->preference_score = 0;
return 0;
}
static int32_t dispatch_cb(lv_draw_unit_t * draw_unit, lv_layer_t * layer)
{
lv_draw_dma2d_unit_t * draw_dma2d_unit = (lv_draw_dma2d_unit_t *) draw_unit;
if(draw_dma2d_unit->task_act) {
#if LV_DRAW_DMA2D_ASYNC
/*Return immediately if it's busy with draw task*/
return 0;
#else
if(!check_transfer_completion()) {
return LV_DRAW_UNIT_IDLE;
}
post_transfer_tasks(draw_dma2d_unit);
#endif
}
lv_draw_task_t * t = lv_draw_get_available_task(layer, NULL, DRAW_UNIT_ID_DMA2D);
if(t == NULL) {
return LV_DRAW_UNIT_IDLE;
}
void * buf = lv_draw_layer_alloc_buf(layer);
if(buf == NULL) {
return LV_DRAW_UNIT_IDLE;
}
t->state = LV_DRAW_TASK_STATE_IN_PROGRESS;
t->draw_unit = draw_unit;
draw_dma2d_unit->task_act = t;
if(t->type == LV_DRAW_TASK_TYPE_FILL) {
lv_draw_fill_dsc_t * dsc = t->draw_dsc;
const lv_area_t * coords = &t->area;
lv_area_t clipped_coords;
if(!lv_area_intersect(&clipped_coords, coords, &t->clip_area)) {
return LV_DRAW_UNIT_IDLE;
}
void * dest = lv_draw_layer_go_to_xy(layer,
clipped_coords.x1 - layer->buf_area.x1,
clipped_coords.y1 - layer->buf_area.y1);
if(dsc->opa >= LV_OPA_MAX) {
lv_draw_dma2d_opaque_fill(t,
dest,
lv_area_get_width(&clipped_coords),
lv_area_get_height(&clipped_coords),
lv_draw_buf_width_to_stride(lv_area_get_width(&layer->buf_area), dsc->base.layer->color_format));
}
else {
lv_draw_dma2d_fill(t,
dest,
lv_area_get_width(&clipped_coords),
lv_area_get_height(&clipped_coords),
lv_draw_buf_width_to_stride(lv_area_get_width(&layer->buf_area), dsc->base.layer->color_format));
}
}
else if(t->type == LV_DRAW_TASK_TYPE_IMAGE) {
lv_draw_image_dsc_t * dsc = t->draw_dsc;
const lv_area_t * coords = &t->area;
lv_area_t clipped_coords;
if(!lv_area_intersect(&clipped_coords, coords, &t->clip_area)) {
return LV_DRAW_UNIT_IDLE;
}
void * dest = lv_draw_layer_go_to_xy(layer,
clipped_coords.x1 - layer->buf_area.x1,
clipped_coords.y1 - layer->buf_area.y1);
if(dsc->opa >= LV_OPA_MAX) {
lv_draw_dma2d_opaque_image(
t,
dest,
&clipped_coords,
lv_draw_buf_width_to_stride(lv_area_get_width(&layer->buf_area), dsc->base.layer->color_format));
}
else {
lv_draw_dma2d_image(
t,
dest,
&clipped_coords,
lv_draw_buf_width_to_stride(lv_area_get_width(&layer->buf_area), dsc->base.layer->color_format));
}
}
#if !LV_DRAW_DMA2D_ASYNC
lv_draw_dispatch_request();
#endif
return 1;
}
static int32_t delete_cb(lv_draw_unit_t * draw_unit)
{
return 0;
}
#if LV_DRAW_DMA2D_ASYNC
static void thread_cb(void * arg)
{
lv_draw_dma2d_unit_t * u = arg;
lv_thread_sync_init(&u->interrupt_signal);
while(1) {
do {
lv_thread_sync_wait(&u->interrupt_signal);
} while(u->task_act != NULL);
post_transfer_tasks(u);
lv_draw_dispatch_request();
}
}
#endif
#if !LV_DRAW_DMA2D_ASYNC
static bool check_transfer_completion(void)
{
return !(DMA2D->CR & DMA2D_CR_START);
}
#endif
static void post_transfer_tasks(lv_draw_dma2d_unit_t * u)
{
#if LV_DRAW_DMA2D_CACHE
lv_draw_dma2d_invalidate_cache(&u->writing_area);
#endif
u->task_act->state = LV_DRAW_TASK_STATE_READY;
u->task_act = NULL;
}
#endif /*LV_USE_DRAW_DMA2D*/

View File

@ -0,0 +1,49 @@
/**
* @file lv_draw_dma2d.h
*
*/
#ifndef LV_DRAW_DMA2D_H
#define LV_DRAW_DMA2D_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../../lv_conf_internal.h"
#if LV_USE_DRAW_DMA2D
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_draw_dma2d_init(void);
void lv_draw_dma2d_deinit(void);
#if LV_USE_DRAW_DMA2D_INTERRUPT
void lv_draw_dma2d_transfer_complete_interrupt_handler(void);
#endif
/**********************
* MACROS
**********************/
#endif /*LV_USE_DRAW_DMA2D*/
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*LV_DRAW_DMA2D_H*/

View File

@ -0,0 +1,127 @@
/**
* @file lv_draw_dma2d_fill.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_draw_dma2d_private.h"
#if LV_USE_DRAW_DMA2D
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_draw_dma2d_opaque_fill(lv_draw_task_t * t, void * first_pixel, int32_t w, int32_t h, int32_t stride)
{
lv_draw_fill_dsc_t * dsc = t->draw_dsc;
lv_color_format_t cf = dsc->base.layer->color_format;
lv_draw_dma2d_output_cf_t output_cf = lv_draw_dma2d_cf_to_dma2d_output_cf(cf);
uint32_t cf_size = LV_COLOR_FORMAT_GET_SIZE(cf);
uint32_t reg_to_mem_color = lv_draw_dma2d_color_to_dma2d_color(output_cf, dsc->color);
#if LV_DRAW_DMA2D_CACHE
lv_draw_dma2d_cache_area_t cache_area = {
.first_byte = first_pixel,
.width_bytes = w * cf_size,
.height = h,
.stride = stride
};
lv_draw_dma2d_unit_t * u = (lv_draw_dma2d_unit_t *) t->draw_unit;
lv_memcpy(&u->writing_area, &cache_area, sizeof(lv_draw_dma2d_cache_area_t));
#endif
lv_draw_dma2d_configuration_t conf = {
.mode = LV_DRAW_DMA2D_MODE_REGISTER_TO_MEMORY,
.w = w,
.h = h,
.output_address = first_pixel,
.output_offset = (stride / cf_size) - w,
.output_cf = output_cf,
.reg_to_mem_mode_color = reg_to_mem_color
};
lv_draw_dma2d_configure_and_start_transfer(&conf);
}
void lv_draw_dma2d_fill(lv_draw_task_t * t, void * first_pixel, int32_t w, int32_t h, int32_t stride)
{
lv_draw_fill_dsc_t * dsc = t->draw_dsc;
lv_color_t color = dsc->color;
lv_color_format_t cf = dsc->base.layer->color_format;
lv_opa_t opa = dsc->opa;
lv_draw_dma2d_output_cf_t output_cf = lv_draw_dma2d_cf_to_dma2d_output_cf(cf);
uint32_t cf_size = LV_COLOR_FORMAT_GET_SIZE(cf);
#if LV_DRAW_DMA2D_CACHE
lv_draw_dma2d_cache_area_t cache_area = {
.first_byte = first_pixel,
.width_bytes = w * cf_size,
.height = h,
.stride = stride
};
lv_draw_dma2d_unit_t * u = (lv_draw_dma2d_unit_t *) t->draw_unit;
lv_memcpy(&u->writing_area, &cache_area, sizeof(lv_draw_dma2d_cache_area_t));
/* make sure the background area DMA2D is blending is up-to-date in main memory */
lv_draw_dma2d_clean_cache(&cache_area);
#endif
uint32_t output_offset = (stride / cf_size) - w;
lv_draw_dma2d_configuration_t conf = {
.mode = LV_DRAW_DMA2D_MODE_MEMORY_TO_MEMORY_WITH_BLENDING_AND_FIXED_COLOR_FG,
.w = w,
.h = h,
.output_address = first_pixel,
.output_offset = output_offset,
.output_cf = output_cf,
.fg_color = lv_color_to_u32(color),
.fg_alpha_mode = LV_DRAW_DMA2D_ALPHA_MODE_REPLACE_ALPHA_CHANNEL,
.fg_alpha = opa,
.bg_address = first_pixel,
.bg_offset = output_offset,
.bg_cf = (lv_draw_dma2d_fgbg_cf_t) output_cf
};
/* Background alpha channel should be treated as 0xFF if the cf is XRGB */
if(cf == LV_COLOR_FORMAT_XRGB8888) {
conf.bg_alpha_mode = LV_DRAW_DMA2D_ALPHA_MODE_REPLACE_ALPHA_CHANNEL;
conf.bg_alpha = 0xff;
}
lv_draw_dma2d_configure_and_start_transfer(&conf);
}
/**********************
* STATIC FUNCTIONS
**********************/
#endif /*LV_USE_DRAW_DMA2D*/

View File

@ -0,0 +1,210 @@
/**
* @file lv_draw_dma2d_image.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_draw_dma2d_private.h"
#if LV_USE_DRAW_DMA2D
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_draw_dma2d_opaque_image(lv_draw_task_t * t, void * dest_first_pixel, lv_area_t * clipped_coords,
int32_t dest_stride)
{
int32_t w = lv_area_get_width(clipped_coords);
int32_t h = lv_area_get_height(clipped_coords);
lv_draw_image_dsc_t * dsc = t->draw_dsc;
lv_color_format_t output_cf = dsc->base.layer->color_format;
lv_color_format_t image_cf = dsc->header.cf;
lv_draw_dma2d_output_cf_t output_cf_dma2d = lv_draw_dma2d_cf_to_dma2d_output_cf(output_cf);
uint32_t output_cf_size = LV_COLOR_FORMAT_GET_SIZE(output_cf);
lv_draw_dma2d_fgbg_cf_t image_cf_dma2d = (lv_draw_dma2d_fgbg_cf_t) lv_draw_dma2d_cf_to_dma2d_output_cf(image_cf);
uint32_t image_cf_size = LV_COLOR_FORMAT_GET_SIZE(image_cf);
const lv_image_dsc_t * img_dsc = dsc->src;
uint32_t image_stride = img_dsc->header.stride;
if(image_stride == 0) image_stride = image_cf_size * img_dsc->header.w;
#if LV_DRAW_DMA2D_CACHE
lv_draw_dma2d_cache_area_t dest_area = {
.first_byte = dest_first_pixel,
.width_bytes = w * output_cf_size,
.height = h,
.stride = dest_stride
};
lv_draw_dma2d_unit_t * u = (lv_draw_dma2d_unit_t *) t->draw_unit;
lv_memcpy(&u->writing_area, &dest_area, sizeof(lv_draw_dma2d_cache_area_t));
if(lv_color_format_has_alpha(image_cf)) {
/* make sure the background area DMA2D is blending is up-to-date in main memory */
lv_draw_dma2d_clean_cache(&dest_area);
}
#endif
const void * image_first_byte = img_dsc->data
+ (image_stride * (clipped_coords->y1 - dsc->image_area.y1))
+ (image_cf_size * (clipped_coords->x1 - dsc->image_area.x1));
#if LV_DRAW_DMA2D_CACHE
lv_draw_dma2d_cache_area_t src_area = {
.first_byte = image_first_byte,
.width_bytes = w * image_cf_size,
.height = h,
.stride = image_stride
};
/* make sure the image area is up-to-date in main memory for DMA2D */
lv_draw_dma2d_clean_cache(&src_area);
#endif
uint32_t output_offset = (dest_stride / output_cf_size) - w;
lv_draw_dma2d_configuration_t conf = {
.mode = LV_DRAW_DMA2D_MODE_MEMORY_TO_MEMORY_WITH_PFC,
.w = w,
.h = h,
.output_address = dest_first_pixel,
.output_offset = output_offset,
.output_cf = output_cf_dma2d,
.fg_address = image_first_byte,
.fg_offset = (image_stride / image_cf_size) - w,
.fg_cf = image_cf_dma2d
};
/* only process the background if the image might be transparent */
if(lv_color_format_has_alpha(image_cf)) {
conf.mode = LV_DRAW_DMA2D_MODE_MEMORY_TO_MEMORY_WITH_BLENDING;
conf.bg_address = dest_first_pixel;
conf.bg_offset = output_offset;
conf.bg_cf = output_cf_dma2d;
}
/* Alpha channel should be treated as 0xFF if the cf is XRGB */
if(image_cf == LV_COLOR_FORMAT_XRGB8888) {
conf.fg_alpha_mode = LV_DRAW_DMA2D_ALPHA_MODE_REPLACE_ALPHA_CHANNEL;
conf.fg_alpha = 0xff;
}
if(output_cf == LV_COLOR_FORMAT_XRGB8888) {
conf.bg_alpha_mode = LV_DRAW_DMA2D_ALPHA_MODE_REPLACE_ALPHA_CHANNEL;
conf.bg_alpha = 0xff;
}
lv_draw_dma2d_configure_and_start_transfer(&conf);
}
void lv_draw_dma2d_image(lv_draw_task_t * t, void * dest_first_pixel, lv_area_t * clipped_coords,
int32_t dest_stride)
{
int32_t w = lv_area_get_width(clipped_coords);
int32_t h = lv_area_get_height(clipped_coords);
lv_draw_image_dsc_t * dsc = t->draw_dsc;
lv_color_format_t output_cf = dsc->base.layer->color_format;
lv_color_format_t image_cf = dsc->header.cf;
lv_opa_t opa = dsc->opa;
lv_draw_dma2d_output_cf_t output_cf_dma2d = lv_draw_dma2d_cf_to_dma2d_output_cf(output_cf);
uint32_t output_cf_size = LV_COLOR_FORMAT_GET_SIZE(output_cf);
lv_draw_dma2d_fgbg_cf_t image_cf_dma2d = (lv_draw_dma2d_fgbg_cf_t) lv_draw_dma2d_cf_to_dma2d_output_cf(image_cf);
uint32_t image_cf_size = LV_COLOR_FORMAT_GET_SIZE(image_cf);
const lv_image_dsc_t * img_dsc = dsc->src;
uint32_t image_stride = img_dsc->header.stride;
if(image_stride == 0) image_stride = image_cf_size * img_dsc->header.w;
#if LV_DRAW_DMA2D_CACHE
lv_draw_dma2d_cache_area_t dest_area = {
.first_byte = dest_first_pixel,
.width_bytes = w * output_cf_size,
.height = h,
.stride = dest_stride
};
lv_draw_dma2d_unit_t * u = (lv_draw_dma2d_unit_t *) t->draw_unit;
lv_memcpy(&u->writing_area, &dest_area, sizeof(lv_draw_dma2d_cache_area_t));
/* make sure the background area DMA2D is blending is up-to-date in main memory */
lv_draw_dma2d_clean_cache(&dest_area);
#endif
const void * image_first_byte = img_dsc->data
+ (image_stride * (clipped_coords->y1 - dsc->image_area.y1))
+ (image_cf_size * (clipped_coords->x1 - dsc->image_area.x1));
#if LV_DRAW_DMA2D_CACHE
lv_draw_dma2d_cache_area_t src_area = {
.first_byte = image_first_byte,
.width_bytes = w * image_cf_size,
.height = h,
.stride = image_stride
};
/* make sure the image area is up-to-date in main memory for DMA2D */
lv_draw_dma2d_clean_cache(&src_area);
#endif
uint32_t output_offset = (dest_stride / output_cf_size) - w;
lv_draw_dma2d_configuration_t conf = {
.mode = LV_DRAW_DMA2D_MODE_MEMORY_TO_MEMORY_WITH_BLENDING,
.w = w,
.h = h,
.output_address = dest_first_pixel,
.output_offset = output_offset,
.output_cf = output_cf_dma2d,
.fg_address = image_first_byte,
.fg_offset = (image_stride / image_cf_size) - w,
.fg_cf = image_cf_dma2d,
.fg_alpha_mode = LV_DRAW_DMA2D_ALPHA_MODE_MULTIPLY_IMAGE_ALPHA_CHANNEL,
.fg_alpha = opa,
.bg_address = dest_first_pixel,
.bg_offset = output_offset,
.bg_cf = output_cf_dma2d,
};
/* Alpha channel should be treated as 0xFF if the cf is XRGB */
if(image_cf == LV_COLOR_FORMAT_XRGB8888) {
conf.fg_alpha_mode = LV_DRAW_DMA2D_ALPHA_MODE_REPLACE_ALPHA_CHANNEL;
}
if(output_cf == LV_COLOR_FORMAT_XRGB8888) {
conf.bg_alpha_mode = LV_DRAW_DMA2D_ALPHA_MODE_REPLACE_ALPHA_CHANNEL;
conf.bg_alpha = 0xff;
}
lv_draw_dma2d_configure_and_start_transfer(&conf);
}
/**********************
* STATIC FUNCTIONS
**********************/
#endif /*LV_USE_DRAW_DMA2D*/

View File

@ -0,0 +1,156 @@
/**
* @file lv_draw_dma2d_private.h
*
*/
#ifndef LV_DRAW_DMA2D_PRIVATE_H
#define LV_DRAW_DMA2D_PRIVATE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lv_draw_dma2d.h"
#if LV_USE_DRAW_DMA2D
#include "../lv_draw_private.h"
#include "../sw/lv_draw_sw.h"
#include LV_DRAW_DMA2D_HAL_INCLUDE
/*********************
* DEFINES
*********************/
#if LV_USE_DRAW_DMA2D_INTERRUPT && LV_USE_OS
#define LV_DRAW_DMA2D_ASYNC 1
#else
#define LV_DRAW_DMA2D_ASYNC 0
#endif
#if defined(__CORTEX_M) && (__CORTEX_M == 7)
#define LV_DRAW_DMA2D_CACHE 1
#else
#define LV_DRAW_DMA2D_CACHE 0
#endif
/**********************
* TYPEDEFS
**********************/
typedef enum {
LV_DRAW_DMA2D_OUTPUT_CF_ARGB8888 = 0,
LV_DRAW_DMA2D_OUTPUT_CF_RGB888,
LV_DRAW_DMA2D_OUTPUT_CF_RGB565,
LV_DRAW_DMA2D_OUTPUT_CF_ARGB1555,
LV_DRAW_DMA2D_OUTPUT_CF_ARGB4444
} lv_draw_dma2d_output_cf_t;
typedef enum {
LV_DRAW_DMA2D_FGBG_CF_ARGB8888 = 0,
LV_DRAW_DMA2D_FGBG_CF_RGB888,
LV_DRAW_DMA2D_FGBG_CF_RGB565,
LV_DRAW_DMA2D_FGBG_CF_ARGB1555,
LV_DRAW_DMA2D_FGBG_CF_ARGB4444,
LV_DRAW_DMA2D_FGBG_CF_L8,
LV_DRAW_DMA2D_FGBG_CF_AL44,
LV_DRAW_DMA2D_FGBG_CF_AL88,
LV_DRAW_DMA2D_FGBG_CF_L4,
LV_DRAW_DMA2D_FGBG_CF_A8,
LV_DRAW_DMA2D_FGBG_CF_A4,
LV_DRAW_DMA2D_FGBG_CF_YCBCR
} lv_draw_dma2d_fgbg_cf_t;
typedef enum {
LV_DRAW_DMA2D_MODE_MEMORY_TO_MEMORY = 0,
LV_DRAW_DMA2D_MODE_MEMORY_TO_MEMORY_WITH_PFC,
LV_DRAW_DMA2D_MODE_MEMORY_TO_MEMORY_WITH_BLENDING,
LV_DRAW_DMA2D_MODE_REGISTER_TO_MEMORY,
LV_DRAW_DMA2D_MODE_MEMORY_TO_MEMORY_WITH_BLENDING_AND_FIXED_COLOR_FG,
LV_DRAW_DMA2D_MODE_MEMORY_TO_MEMORY_WITH_BLENDING_AND_FIXED_COLOR_BG
} lv_draw_dma2d_mode_t;
typedef enum {
LV_DRAW_DMA2D_ALPHA_MODE_NO_MODIFY_IMAGE_ALPHA_CHANNEL = 0,
LV_DRAW_DMA2D_ALPHA_MODE_REPLACE_ALPHA_CHANNEL,
LV_DRAW_DMA2D_ALPHA_MODE_MULTIPLY_IMAGE_ALPHA_CHANNEL
} lv_draw_dma2d_alpha_mode_t;
typedef struct {
lv_draw_dma2d_mode_t mode;
uint32_t w;
uint32_t h;
void * output_address;
uint32_t output_offset;
lv_draw_dma2d_output_cf_t output_cf;
uint32_t reg_to_mem_mode_color;
const void * fg_address;
uint32_t fg_offset;
lv_draw_dma2d_fgbg_cf_t fg_cf;
uint32_t fg_color;
uint32_t fg_alpha_mode;
uint32_t fg_alpha;
const void * bg_address;
uint32_t bg_offset;
lv_draw_dma2d_fgbg_cf_t bg_cf;
uint32_t bg_color;
uint32_t bg_alpha_mode;
uint32_t bg_alpha;
} lv_draw_dma2d_configuration_t;
typedef struct {
const void * first_byte;
uint32_t width_bytes;
uint32_t height;
uint32_t stride;
} lv_draw_dma2d_cache_area_t;
typedef struct {
lv_draw_unit_t base_unit;
lv_draw_task_t * volatile task_act;
#if LV_DRAW_DMA2D_CACHE
lv_draw_dma2d_cache_area_t writing_area;
#endif
#if LV_DRAW_DMA2D_ASYNC
lv_thread_t thread;
lv_thread_sync_t interrupt_signal;
#endif
} lv_draw_dma2d_unit_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_draw_dma2d_opaque_fill(lv_draw_task_t * t, void * first_pixel, int32_t w, int32_t h, int32_t stride);
void lv_draw_dma2d_fill(lv_draw_task_t * t, void * first_pixel, int32_t w, int32_t h, int32_t stride);
void lv_draw_dma2d_opaque_image(lv_draw_task_t * t, void * dest_first_pixel, lv_area_t * clipped_coords,
int32_t dest_stride);
void lv_draw_dma2d_image(lv_draw_task_t * t, void * dest_first_pixel, lv_area_t * clipped_coords,
int32_t dest_stride);
lv_draw_dma2d_output_cf_t lv_draw_dma2d_cf_to_dma2d_output_cf(lv_color_format_t cf);
uint32_t lv_draw_dma2d_color_to_dma2d_color(lv_draw_dma2d_output_cf_t cf, lv_color_t color);
void lv_draw_dma2d_configure_and_start_transfer(const lv_draw_dma2d_configuration_t * conf);
#if LV_DRAW_DMA2D_CACHE
void lv_draw_dma2d_invalidate_cache(const lv_draw_dma2d_cache_area_t * mem_area);
void lv_draw_dma2d_clean_cache(const lv_draw_dma2d_cache_area_t * mem_area);
#endif
/**********************
* MACROS
**********************/
#endif /*LV_USE_DRAW_DMA2D*/
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*LV_DRAW_DMA2D_PRIVATE_H*/

View File

@ -11,7 +11,11 @@
* INCLUDES
*********************/
#include "../misc/lv_area_private.h"
#include "../misc/lv_assert.h"
#include "lv_draw_private.h"
#include "lv_draw_mask_private.h"
#include "lv_draw_vector_private.h"
#include "lv_draw_3d.h"
#include "sw/lv_draw_sw.h"
#include "../display/lv_display_private.h"
#include "../core/lv_global.h"
@ -31,14 +35,16 @@
* STATIC PROTOTYPES
**********************/
static bool is_independent(lv_layer_t * layer, lv_draw_task_t * t_check);
static void cleanup_task(lv_draw_task_t * t, lv_display_t * disp);
static inline size_t get_draw_dsc_size(lv_draw_task_type_t type);
static lv_draw_task_t * get_first_available_task(lv_layer_t * layer);
#if LV_LOG_LEVEL <= LV_LOG_LEVEL_INFO
static inline uint32_t get_layer_size_kb(uint32_t size_byte)
{
return size_byte < 1024 ? 1 : size_byte >> 10;
return (size_byte + 1023) >> 10;
}
/**********************
* STATIC VARIABLES
**********************/
#endif
/**********************
* STATIC VARIABLES
@ -79,25 +85,33 @@ void lv_draw_deinit(void)
void * lv_draw_create_unit(size_t size)
{
lv_draw_unit_t * new_unit = lv_malloc_zeroed(size);
LV_ASSERT_MALLOC(new_unit);
new_unit->next = _draw_info.unit_head;
_draw_info.unit_head = new_unit;
_draw_info.unit_cnt++;
new_unit->idx = _draw_info.unit_cnt;
return new_unit;
}
lv_draw_task_t * lv_draw_add_task(lv_layer_t * layer, const lv_area_t * coords)
lv_draw_task_t * lv_draw_add_task(lv_layer_t * layer, const lv_area_t * coords, lv_draw_task_type_t type)
{
LV_PROFILER_BEGIN;
lv_draw_task_t * new_task = lv_malloc_zeroed(sizeof(lv_draw_task_t));
LV_PROFILER_DRAW_BEGIN;
size_t dsc_size = get_draw_dsc_size(type);
LV_ASSERT_FORMAT_MSG(dsc_size > 0, "Draw task size is 0 for type %d", type);
lv_draw_task_t * new_task = lv_malloc_zeroed(LV_ALIGN_UP(sizeof(lv_draw_task_t), 8) + dsc_size);
LV_ASSERT_MALLOC(new_task);
new_task->area = *coords;
new_task->_real_area = *coords;
new_task->target_layer = layer;
new_task->clip_area = layer->_clip_area;
#if LV_DRAW_TRANSFORM_USE_MATRIX
new_task->matrix = layer->matrix;
#endif
new_task->type = type;
new_task->draw_dsc = (uint8_t *)new_task + LV_ALIGN_UP(sizeof(lv_draw_task_t), 8);
new_task->state = LV_DRAW_TASK_STATE_QUEUED;
/*Find the tail*/
@ -111,13 +125,13 @@ lv_draw_task_t * lv_draw_add_task(lv_layer_t * layer, const lv_area_t * coords)
tail->next = new_task;
}
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
return new_task;
}
void lv_draw_finalize_task_creation(lv_layer_t * layer, lv_draw_task_t * t)
{
LV_PROFILER_BEGIN;
LV_PROFILER_DRAW_BEGIN;
lv_draw_dsc_base_t * base_dsc = t->draw_dsc;
base_dsc->layer = layer;
@ -140,11 +154,22 @@ void lv_draw_finalize_task_creation(lv_layer_t * layer, lv_draw_task_t * t)
t->preferred_draw_unit_id = 0;
lv_draw_unit_t * u = info->unit_head;
while(u) {
if(u->evaluate_cb) u->evaluate_cb(u, t);
if(u->evaluate_cb) {
LV_PROFILER_DRAW_BEGIN_TAG("evaluate_cb");
LV_PROFILER_DRAW_BEGIN_TAG(u->name);
u->evaluate_cb(u, t);
LV_PROFILER_DRAW_END_TAG(u->name);
LV_PROFILER_DRAW_END_TAG("evaluate_cb");
}
u = u->next;
}
lv_draw_dispatch();
if(t->preferred_draw_unit_id == LV_DRAW_UNIT_NONE) {
LV_LOG_WARN("the draw task was not taken by any units");
t->state = LV_DRAW_TASK_STATE_READY;
}
else {
lv_draw_dispatch();
}
}
else {
/*Let the draw units set their preference score*/
@ -152,28 +177,41 @@ void lv_draw_finalize_task_creation(lv_layer_t * layer, lv_draw_task_t * t)
t->preferred_draw_unit_id = 0;
lv_draw_unit_t * u = info->unit_head;
while(u) {
if(u->evaluate_cb) u->evaluate_cb(u, t);
if(u->evaluate_cb) {
LV_PROFILER_DRAW_BEGIN_TAG("evaluate_cb");
LV_PROFILER_DRAW_BEGIN_TAG(u->name);
u->evaluate_cb(u, t);
LV_PROFILER_DRAW_END_TAG(u->name);
LV_PROFILER_DRAW_END_TAG("evaluate_cb");
}
u = u->next;
}
}
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
}
void lv_draw_wait_for_finish(void)
{
#if LV_USE_OS
LV_PROFILER_DRAW_BEGIN;
lv_draw_unit_t * u = _draw_info.unit_head;
while(u) {
if(u->wait_for_finish_cb)
if(u->wait_for_finish_cb) {
LV_PROFILER_DRAW_BEGIN_TAG("wait_for_finish_cb");
LV_PROFILER_DRAW_BEGIN_TAG(u->name);
u->wait_for_finish_cb(u);
LV_PROFILER_DRAW_END_TAG(u->name);
LV_PROFILER_DRAW_END_TAG("wait_for_finish_cb");
}
u = u->next;
}
LV_PROFILER_DRAW_END;
#endif
}
void lv_draw_dispatch(void)
{
LV_PROFILER_BEGIN;
LV_PROFILER_DRAW_BEGIN;
bool task_dispatched = false;
lv_display_t * disp = lv_display_get_next(NULL);
while(disp) {
@ -189,59 +227,26 @@ void lv_draw_dispatch(void)
}
disp = lv_display_get_next(disp);
}
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
}
bool lv_draw_dispatch_layer(lv_display_t * disp, lv_layer_t * layer)
{
LV_PROFILER_BEGIN;
LV_PROFILER_DRAW_BEGIN;
/*Remove the finished tasks first*/
lv_draw_task_t * t_prev = NULL;
lv_draw_task_t * t = layer->draw_task_head;
lv_draw_task_t * t_next;
bool remove_task = false;
while(t) {
lv_draw_task_t * t_next = t->next;
t_next = t->next;
if(t->state == LV_DRAW_TASK_STATE_READY) {
if(t_prev) t_prev->next = t->next; /*Remove it by assigning the next task to the previous*/
else layer->draw_task_head = t_next; /*If it was the head, set the next as head*/
/*If it was layer drawing free the layer too*/
if(t->type == LV_DRAW_TASK_TYPE_LAYER) {
lv_draw_image_dsc_t * draw_image_dsc = t->draw_dsc;
lv_layer_t * layer_drawn = (lv_layer_t *)draw_image_dsc->src;
if(layer_drawn->draw_buf) {
int32_t h = lv_area_get_height(&layer_drawn->buf_area);
uint32_t layer_size_byte = h * layer_drawn->draw_buf->header.stride;
_draw_info.used_memory_for_layers_kb -= get_layer_size_kb(layer_size_byte);
LV_LOG_INFO("Layer memory used: %" LV_PRIu32 " kB\n", _draw_info.used_memory_for_layers_kb);
lv_draw_buf_destroy(layer_drawn->draw_buf);
layer_drawn->draw_buf = NULL;
}
/*Remove the layer from the display's*/
if(disp) {
lv_layer_t * l2 = disp->layer_head;
while(l2) {
if(l2->next == layer_drawn) {
l2->next = layer_drawn->next;
break;
}
l2 = l2->next;
}
if(disp->layer_deinit) disp->layer_deinit(disp, layer_drawn);
lv_free(layer_drawn);
}
}
lv_draw_label_dsc_t * draw_label_dsc = lv_draw_task_get_label_dsc(t);
if(draw_label_dsc && draw_label_dsc->text_local) {
lv_free((void *)draw_label_dsc->text);
draw_label_dsc->text = NULL;
}
lv_free(t->draw_dsc);
lv_free(t);
cleanup_task(t, disp);
remove_task = true;
if(t_prev != NULL)
t_prev->next = t_next;
else
layer->draw_task_head = t_next;
}
else {
t_prev = t;
@ -268,38 +273,46 @@ bool lv_draw_dispatch_layer(lv_display_t * disp, lv_layer_t * layer)
}
}
/*Assign draw tasks to the draw_units*/
else {
else if(remove_task || layer->draw_task_head) {
/*Find a draw unit which is not busy and can take at least one task*/
/*Let all draw units to pick draw tasks*/
lv_draw_unit_t * u = _draw_info.unit_head;
while(u) {
LV_PROFILER_DRAW_BEGIN_TAG("dispatch_cb");
LV_PROFILER_DRAW_BEGIN_TAG(u->name);
int32_t taken_cnt = u->dispatch_cb(u, layer);
LV_PROFILER_DRAW_END_TAG(u->name);
LV_PROFILER_DRAW_END_TAG("dispatch_cb");
if(taken_cnt != LV_DRAW_UNIT_IDLE) task_dispatched = true;
u = u->next;
}
}
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
return task_dispatched;
}
void lv_draw_dispatch_wait_for_request(void)
{
LV_PROFILER_DRAW_BEGIN;
#if LV_USE_OS
lv_thread_sync_wait(&_draw_info.sync);
#else
while(!_draw_info.dispatch_req);
_draw_info.dispatch_req = 0;
#endif
LV_PROFILER_DRAW_END;
}
void lv_draw_dispatch_request(void)
{
LV_PROFILER_DRAW_BEGIN;
#if LV_USE_OS
lv_thread_sync_signal(&_draw_info.sync);
#else
_draw_info.dispatch_req = 1;
#endif
LV_PROFILER_DRAW_END;
}
uint32_t lv_draw_get_unit_count(void)
@ -307,43 +320,19 @@ uint32_t lv_draw_get_unit_count(void)
return _draw_info.unit_cnt;
}
lv_draw_task_t * lv_draw_get_available_task(lv_layer_t * layer, lv_draw_task_t * t_prev, uint8_t draw_unit_id)
{
if(_draw_info.unit_cnt == 1) {
return get_first_available_task(layer);
}
else {
return lv_draw_get_next_available_task(layer, t_prev, draw_unit_id);
}
}
lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_task_t * t_prev, uint8_t draw_unit_id)
{
LV_PROFILER_BEGIN;
/* If there is only 1 draw unit the task can be consumed linearly as
* they are added in the correct order. However, it can happen that
* there is a `LV_DRAW_TASK_TYPE_LAYER` which can be blended only when
* all its tasks are ready. As other areas might be on top of that
* layer-to-blend don't skip it. Instead stop there, so that the
* draw tasks of that layer can be consumed and can be finished.
* After that this layer-to-blenf will have `LV_DRAW_TASK_STATE_QUEUED`
* so it can be blended normally.*/
if(_draw_info.unit_cnt <= 1) {
lv_draw_task_t * t = layer->draw_task_head;
while(t) {
/*Mark unsupported draw tasks as ready as no one else will consume them*/
if(t->state == LV_DRAW_TASK_STATE_QUEUED &&
t->preferred_draw_unit_id != LV_DRAW_UNIT_NONE &&
t->preferred_draw_unit_id != draw_unit_id) {
t->state = LV_DRAW_TASK_STATE_READY;
}
/*Not queued yet, leave this layer while the first task will be queued*/
else if(t->state != LV_DRAW_TASK_STATE_QUEUED) {
t = NULL;
break;
}
/*It's a supported and queued task, process it*/
else {
break;
}
t = t->next;
}
LV_PROFILER_END;
return t;
}
/*Handle the case of multiply draw units*/
LV_PROFILER_DRAW_BEGIN;
/*If the first task is screen sized, there cannot be independent areas*/
if(layer->draw_task_head) {
@ -353,7 +342,7 @@ lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_tas
if(t->state != LV_DRAW_TASK_STATE_QUEUED &&
t->area.x1 <= 0 && t->area.x2 >= hor_res - 1 &&
t->area.y1 <= 0 && t->area.y2 >= ver_res - 1) {
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
return NULL;
}
}
@ -364,13 +353,13 @@ lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_tas
if(t->state == LV_DRAW_TASK_STATE_QUEUED &&
(t->preferred_draw_unit_id == LV_DRAW_UNIT_NONE || t->preferred_draw_unit_id == draw_unit_id) &&
is_independent(layer, t)) {
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
return t;
}
t = t->next;
}
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
return NULL;
}
@ -379,7 +368,7 @@ uint32_t lv_draw_get_dependent_count(lv_draw_task_t * t_check)
if(t_check == NULL) return 0;
if(t_check->next == NULL) return 0;
LV_PROFILER_BEGIN;
LV_PROFILER_DRAW_BEGIN;
uint32_t cnt = 0;
lv_draw_task_t * t = t_check->next;
@ -391,43 +380,82 @@ uint32_t lv_draw_get_dependent_count(lv_draw_task_t * t_check)
t = t->next;
}
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
return cnt;
}
void lv_layer_init(lv_layer_t * layer)
{
LV_ASSERT_NULL(layer);
lv_memzero(layer, sizeof(lv_layer_t));
lv_layer_reset(layer);
}
void lv_layer_reset(lv_layer_t * layer)
{
LV_ASSERT_NULL(layer);
#if LV_DRAW_TRANSFORM_USE_MATRIX
lv_matrix_identity(&layer->matrix);
#endif
layer->opa = LV_OPA_COVER;
layer->recolor = lv_color32_make(0, 0, 0, 0);
}
lv_layer_t * lv_draw_layer_create(lv_layer_t * parent_layer, lv_color_format_t color_format, const lv_area_t * area)
{
lv_display_t * disp = lv_refr_get_disp_refreshing();
LV_PROFILER_DRAW_BEGIN;
lv_layer_t * new_layer = lv_malloc_zeroed(sizeof(lv_layer_t));
LV_ASSERT_MALLOC(new_layer);
if(new_layer == NULL) return NULL;
if(new_layer == NULL) {
LV_PROFILER_DRAW_END;
return NULL;
}
new_layer->parent = parent_layer;
new_layer->_clip_area = *area;
new_layer->buf_area = *area;
new_layer->phy_clip_area = *area;
new_layer->color_format = color_format;
lv_draw_layer_init(new_layer, parent_layer, color_format, area);
#if LV_DRAW_TRANSFORM_USE_MATRIX
lv_matrix_identity(&new_layer->matrix);
#endif
/*Inherits transparency from parent*/
if(parent_layer) {
new_layer->opa = parent_layer->opa;
new_layer->recolor = parent_layer->recolor;
}
LV_PROFILER_DRAW_END;
return new_layer;
}
void lv_draw_layer_init(lv_layer_t * layer, lv_layer_t * parent_layer, lv_color_format_t color_format,
const lv_area_t * area)
{
LV_PROFILER_DRAW_BEGIN;
lv_layer_init(layer);
lv_display_t * disp = lv_refr_get_disp_refreshing();
layer->parent = parent_layer;
layer->_clip_area = *area;
layer->buf_area = *area;
layer->phy_clip_area = *area;
layer->color_format = color_format;
if(disp->layer_init) disp->layer_init(disp, layer);
if(disp->layer_head) {
lv_layer_t * tail = disp->layer_head;
while(tail->next) tail = tail->next;
tail->next = new_layer;
tail->next = layer;
}
else {
disp->layer_head = new_layer;
disp->layer_head = layer;
}
return new_layer;
LV_PROFILER_DRAW_END;
}
void * lv_draw_layer_alloc_buf(lv_layer_t * layer)
{
LV_PROFILER_DRAW_BEGIN;
/*If the buffer of the layer is already allocated return it*/
if(layer->draw_buf != NULL) {
LV_PROFILER_DRAW_END;
return layer->draw_buf->data;
}
@ -436,20 +464,31 @@ void * lv_draw_layer_alloc_buf(lv_layer_t * layer)
int32_t h = lv_area_get_height(&layer->buf_area);
uint32_t layer_size_byte = h * lv_draw_buf_width_to_stride(w, layer->color_format);
#if LV_DRAW_LAYER_MAX_MEMORY > 0
/* Do not allocate the layer if the sum of allocated layer sizes
* will exceed `LV_DRAW_LAYER_MAX_MEMORY` */
if((_draw_info.used_memory_for_layers + layer_size_byte) > LV_DRAW_LAYER_MAX_MEMORY) {
LV_LOG_WARN("LV_DRAW_LAYER_MAX_MEMORY was reached when allocating the layer.");
return NULL;
}
#endif
layer->draw_buf = lv_draw_buf_create(w, h, layer->color_format, 0);
if(layer->draw_buf == NULL) {
LV_LOG_WARN("Allocating layer buffer failed. Try later");
LV_PROFILER_DRAW_END;
return NULL;
}
_draw_info.used_memory_for_layers_kb += get_layer_size_kb(layer_size_byte);
LV_LOG_INFO("Layer memory used: %" LV_PRIu32 " kB\n", _draw_info.used_memory_for_layers_kb);
_draw_info.used_memory_for_layers += layer_size_byte;
LV_LOG_INFO("Layer memory used: %" LV_PRIu32 " kB", get_layer_size_kb(_draw_info.used_memory_for_layers));
if(lv_color_format_has_alpha(layer->color_format)) {
lv_draw_buf_clear(layer->draw_buf, NULL);
}
LV_PROFILER_DRAW_END;
return layer->draw_buf->data;
}
@ -485,7 +524,7 @@ void lv_draw_task_get_area(const lv_draw_task_t * t, lv_area_t * area)
*/
static bool is_independent(lv_layer_t * layer, lv_draw_task_t * t_check)
{
LV_PROFILER_BEGIN;
LV_PROFILER_DRAW_BEGIN;
lv_draw_task_t * t = layer->draw_task_head;
/*If t_check is outside of the older tasks then it's independent*/
@ -493,13 +532,152 @@ static bool is_independent(lv_layer_t * layer, lv_draw_task_t * t_check)
if(t->state != LV_DRAW_TASK_STATE_READY) {
lv_area_t a;
if(lv_area_intersect(&a, &t->_real_area, &t_check->_real_area)) {
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
return false;
}
}
t = t->next;
}
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
return true;
}
/**
* Get the size of the draw descriptor of a draw task
* @param type type of the draw task
* @return size of the draw descriptor in bytes
*/
static inline size_t get_draw_dsc_size(lv_draw_task_type_t type)
{
switch(type) {
case LV_DRAW_TASK_TYPE_NONE:
return 0;
case LV_DRAW_TASK_TYPE_FILL:
return sizeof(lv_draw_fill_dsc_t);
case LV_DRAW_TASK_TYPE_BORDER:
return sizeof(lv_draw_border_dsc_t);
case LV_DRAW_TASK_TYPE_BOX_SHADOW:
return sizeof(lv_draw_box_shadow_dsc_t);
case LV_DRAW_TASK_TYPE_LETTER:
return sizeof(lv_draw_letter_dsc_t);
case LV_DRAW_TASK_TYPE_LABEL:
return sizeof(lv_draw_label_dsc_t);
case LV_DRAW_TASK_TYPE_IMAGE:
return sizeof(lv_draw_image_dsc_t);
case LV_DRAW_TASK_TYPE_LAYER:
return sizeof(lv_draw_image_dsc_t);
case LV_DRAW_TASK_TYPE_LINE:
return sizeof(lv_draw_line_dsc_t);
case LV_DRAW_TASK_TYPE_ARC:
return sizeof(lv_draw_arc_dsc_t);
case LV_DRAW_TASK_TYPE_TRIANGLE:
return sizeof(lv_draw_triangle_dsc_t);
case LV_DRAW_TASK_TYPE_MASK_RECTANGLE:
return sizeof(lv_draw_mask_rect_dsc_t);
/* no struct match for LV_DRAW_TASK_TYPE_MASK_BITMAP, set it to zero now */
case LV_DRAW_TASK_TYPE_MASK_BITMAP:
return 0;
#if LV_USE_VECTOR_GRAPHIC
case LV_DRAW_TASK_TYPE_VECTOR:
return sizeof(lv_draw_vector_task_dsc_t);
#endif
#if LV_USE_3DTEXTURE
case LV_DRAW_TASK_TYPE_3D:
return sizeof(lv_draw_3d_dsc_t);
#endif
/* Note that default is not added here because when adding new draw task type,
* if forget to add case, the compiler will automatically report a warning.
*/
}
return 0;
}
/**
* Clean-up resources allocated by a finished task
* @param t pointer to a draw task
* @param disp pointer to a display on which the task was drawn
*/
static void cleanup_task(lv_draw_task_t * t, lv_display_t * disp)
{
LV_PROFILER_DRAW_BEGIN;
/*If it was layer drawing free the layer too*/
if(t->type == LV_DRAW_TASK_TYPE_LAYER) {
lv_draw_image_dsc_t * draw_image_dsc = t->draw_dsc;
lv_layer_t * layer_drawn = (lv_layer_t *)draw_image_dsc->src;
if(layer_drawn->draw_buf) {
int32_t h = lv_area_get_height(&layer_drawn->buf_area);
uint32_t layer_size_byte = h * layer_drawn->draw_buf->header.stride;
if(_draw_info.used_memory_for_layers >= layer_size_byte) {
_draw_info.used_memory_for_layers -= layer_size_byte;
}
else {
_draw_info.used_memory_for_layers = 0;
LV_LOG_WARN("More layers were freed than allocated");
}
LV_LOG_INFO("Layer memory used: %" LV_PRIu32 " kB", get_layer_size_kb(_draw_info.used_memory_for_layers));
lv_draw_buf_destroy(layer_drawn->draw_buf);
layer_drawn->draw_buf = NULL;
}
/*Remove the layer from the display's*/
if(disp) {
lv_layer_t * l2 = disp->layer_head;
while(l2) {
if(l2->next == layer_drawn) {
l2->next = layer_drawn->next;
break;
}
l2 = l2->next;
}
if(disp->layer_deinit) {
LV_PROFILER_DRAW_BEGIN_TAG("layer_deinit");
disp->layer_deinit(disp, layer_drawn);
LV_PROFILER_DRAW_END_TAG("layer_deinit");
}
lv_free(layer_drawn);
}
}
lv_draw_label_dsc_t * draw_label_dsc = lv_draw_task_get_label_dsc(t);
if(draw_label_dsc && draw_label_dsc->text_local) {
lv_free((void *)draw_label_dsc->text);
draw_label_dsc->text = NULL;
}
lv_free(t);
LV_PROFILER_DRAW_END;
}
static lv_draw_task_t * get_first_available_task(lv_layer_t * layer)
{
LV_PROFILER_DRAW_BEGIN;
/* If there is only 1 draw unit the task can be consumed linearly as
* they are added in the correct order. However, it can happen that
* there is a `LV_DRAW_TASK_TYPE_LAYER` which can be blended only when
* all its tasks are ready. As other areas might be on top of that
* layer-to-blend don't skip it. Instead stop there, so that the
* draw tasks of that layer can be consumed and can be finished.
* After that this layer-to-blenf will have `LV_DRAW_TASK_STATE_QUEUED`
* so it can be blended normally.*/
lv_draw_task_t * t = layer->draw_task_head;
while(t) {
/*Not queued yet, leave this layer while the first task is queued*/
if(t->state != LV_DRAW_TASK_STATE_QUEUED) {
t = NULL;
break;
}
/*It's a supported and queued task, process it*/
else {
break;
}
t = t->next;
}
LV_PROFILER_DRAW_END;
return t;
}

View File

@ -25,7 +25,6 @@ extern "C" {
#include "../misc/lv_profiler.h"
#include "../misc/lv_matrix.h"
#include "lv_image_decoder.h"
#include "../osal/lv_os.h"
#include "lv_draw_buf.h"
/*********************
@ -49,6 +48,7 @@ typedef enum {
LV_DRAW_TASK_TYPE_FILL,
LV_DRAW_TASK_TYPE_BORDER,
LV_DRAW_TASK_TYPE_BOX_SHADOW,
LV_DRAW_TASK_TYPE_LETTER,
LV_DRAW_TASK_TYPE_LABEL,
LV_DRAW_TASK_TYPE_IMAGE,
LV_DRAW_TASK_TYPE_LAYER,
@ -57,7 +57,12 @@ typedef enum {
LV_DRAW_TASK_TYPE_TRIANGLE,
LV_DRAW_TASK_TYPE_MASK_RECTANGLE,
LV_DRAW_TASK_TYPE_MASK_BITMAP,
#if LV_USE_VECTOR_GRAPHIC
LV_DRAW_TASK_TYPE_VECTOR,
#endif
#if LV_USE_3DTEXTURE
LV_DRAW_TASK_TYPE_3D,
#endif
} lv_draw_task_type_t;
typedef enum {
@ -67,7 +72,7 @@ typedef enum {
LV_DRAW_TASK_STATE_READY,
} lv_draw_task_state_t;
struct lv_layer_t {
struct _lv_layer_t {
/** Target draw buffer of the layer*/
lv_draw_buf_t * draw_buf;
@ -98,6 +103,15 @@ struct lv_layer_t {
lv_matrix_t matrix;
#endif
/** Opacity of the layer */
lv_opa_t opa;
/*Recolor of the layer*/
lv_color32_t recolor;
/** Partial y offset */
int32_t partial_y_offset;
/** Linked list of draw tasks */
lv_draw_task_t * draw_task_head;
@ -108,12 +122,25 @@ struct lv_layer_t {
};
typedef struct {
/**The widget for which draw descriptor was created */
lv_obj_t * obj;
/**The widget part for which draw descriptor was created */
lv_part_t part;
/**A widget type specific ID (e.g. table row index). See the docs of the given widget.*/
uint32_t id1;
/**A widget type specific ID (e.g. table column index). See the docs of the given widget.*/
uint32_t id2;
/**The target layer */
lv_layer_t * layer;
/**Size of the specific draw descriptor into which this base descriptor is embedded*/
size_t dsc_size;
/**Any custom user data*/
void * user_data;
} lv_draw_dsc_base_t;
@ -145,7 +172,7 @@ void * lv_draw_create_unit(size_t size);
* @return the created draw task which needs to be
* further configured e.g. by added a draw descriptor
*/
lv_draw_task_t * lv_draw_add_task(lv_layer_t * layer, const lv_area_t * coords);
lv_draw_task_t * lv_draw_add_task(lv_layer_t * layer, const lv_area_t * coords, lv_draw_task_type_t type);
/**
* Needs to be called when a draw task is created and configured.
@ -193,11 +220,21 @@ void lv_draw_dispatch_request(void);
uint32_t lv_draw_get_unit_count(void);
/**
* Find and available draw task
* @param layer the draw ctx to search in
* If there is only one draw unit check the first draw task if it's available.
* If there are multiple draw units call `lv_draw_get_next_available_task` to find a task.
* @param layer the draw layer to search in
* @param t_prev continue searching from this task
* @param draw_unit_id check the task where `preferred_draw_unit_id` equals this value or `LV_DRAW_UNIT_NONE`
* @return tan available draw task or NULL if there is no any
* @return an available draw task or NULL if there is not any
*/
lv_draw_task_t * lv_draw_get_available_task(lv_layer_t * layer, lv_draw_task_t * t_prev, uint8_t draw_unit_id);
/**
* Find and available draw task
* @param layer the draw layer to search in
* @param t_prev continue searching from this task
* @param draw_unit_id check the task where `preferred_draw_unit_id` equals this value or `LV_DRAW_UNIT_NONE`
* @return an available draw task or NULL if there is not any
*/
lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_task_t * t_prev, uint8_t draw_unit_id);
@ -212,7 +249,19 @@ lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_tas
uint32_t lv_draw_get_dependent_count(lv_draw_task_t * t_check);
/**
* Create a new layer on a parent layer
* Initialize a layer
* @param layer pointer to a layer to initialize
*/
void lv_layer_init(lv_layer_t * layer);
/**
* Reset the layer to a drawable state
* @param layer pointer to a layer to reset
*/
void lv_layer_reset(lv_layer_t * layer);
/**
* Create (allocate) a new layer on a parent layer
* @param parent_layer the parent layer to which the layer will be merged when it's rendered
* @param color_format the color format of the layer
* @param area the areas of the layer (absolute coordinates)
@ -220,6 +269,17 @@ uint32_t lv_draw_get_dependent_count(lv_draw_task_t * t_check);
*/
lv_layer_t * lv_draw_layer_create(lv_layer_t * parent_layer, lv_color_format_t color_format, const lv_area_t * area);
/**
* Initialize a layer which is allocated by the user
* @param layer pointer the layer to initialize (its lifetime needs to be managed by the user)
* @param parent_layer the parent layer to which the layer will be merged when it's rendered
* @param color_format the color format of the layer
* @param area the areas of the layer (absolute coordinates)
* @return the new target_layer or NULL on error
*/
void lv_draw_layer_init(lv_layer_t * layer, lv_layer_t * parent_layer, lv_color_format_t color_format,
const lv_area_t * area);
/**
* Try to allocate a buffer for the layer.
* @param layer pointer to a layer

View File

@ -0,0 +1,69 @@
/**
* @file lv_draw_3d.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_draw_3d.h"
#if LV_USE_3DTEXTURE
#include "lv_draw_private.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_draw_3d_dsc_init(lv_draw_3d_dsc_t * dsc)
{
lv_memzero(dsc, sizeof(lv_draw_3d_dsc_t));
dsc->base.dsc_size = sizeof(lv_draw_3d_dsc_t);
dsc->tex_id = LV_3DTEXTURE_ID_NULL;
dsc->opa = LV_OPA_COVER;
}
lv_draw_3d_dsc_t * lv_draw_task_get_3d_dsc(lv_draw_task_t * task)
{
return task->type == LV_DRAW_TASK_TYPE_3D ? (lv_draw_3d_dsc_t *)task->draw_dsc : NULL;
}
void lv_draw_3d(lv_layer_t * layer, const lv_draw_3d_dsc_t * dsc, const lv_area_t * coords)
{
LV_PROFILER_DRAW_BEGIN;
lv_draw_task_t * t = lv_draw_add_task(layer, coords, LV_DRAW_TASK_TYPE_3D);
lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc));
lv_draw_finalize_task_creation(layer, t);
LV_PROFILER_DRAW_END;
}
/**********************
* STATIC FUNCTIONS
**********************/
#endif /*LV_USE_3DTEXTURE*/

View File

@ -0,0 +1,70 @@
/**
* @file lv_draw_3d.h
*
*/
#ifndef LV_DRAW_3D_H
#define LV_DRAW_3D_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../lv_conf_internal.h"
#if LV_USE_3DTEXTURE
#include "lv_draw.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef struct {
lv_draw_dsc_base_t base;
lv_3dtexture_id_t tex_id;
lv_opa_t opa;
} lv_draw_3d_dsc_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Initialize a 3D draw descriptor
* @param dsc pointer to a draw descriptor
*/
void lv_draw_3d_dsc_init(lv_draw_3d_dsc_t * dsc);
/**
* Try to get a 3D draw descriptor from a draw task.
* @param task draw task
* @return the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_3D
*/
lv_draw_3d_dsc_t * lv_draw_task_get_3d_dsc(lv_draw_task_t * task);
/**
* Create a 3D draw task
* @param layer pointer to a layer
* @param dsc pointer to an initialized `lv_draw_3d_dsc_t` variable
*/
void lv_draw_3d(lv_layer_t * layer, const lv_draw_3d_dsc_t * dsc, const lv_area_t * coords);
/**********************
* MACROS
**********************/
#endif /*LV_USE_3DTEXTURE*/
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*LV_DRAW_3D_H*/

View File

@ -56,21 +56,19 @@ void lv_draw_arc(lv_layer_t * layer, const lv_draw_arc_dsc_t * dsc)
if(dsc->width == 0) return;
if(dsc->start_angle == dsc->end_angle) return;
LV_PROFILER_BEGIN;
LV_PROFILER_DRAW_BEGIN;
lv_area_t a;
a.x1 = dsc->center.x - dsc->radius;
a.y1 = dsc->center.y - dsc->radius;
a.x2 = dsc->center.x + dsc->radius - 1;
a.y2 = dsc->center.y + dsc->radius - 1;
lv_draw_task_t * t = lv_draw_add_task(layer, &a);
lv_draw_task_t * t = lv_draw_add_task(layer, &a, LV_DRAW_TASK_TYPE_ARC);
t->draw_dsc = lv_malloc(sizeof(*dsc));
lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc));
t->type = LV_DRAW_TASK_TYPE_ARC;
lv_draw_finalize_task_creation(layer, t);
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
}
void lv_draw_arc_get_area(int32_t x, int32_t y, uint16_t radius, lv_value_precise_t start_angle,

View File

@ -29,14 +29,33 @@ extern "C" {
typedef struct {
lv_draw_dsc_base_t base;
/**The color of the arc*/
lv_color_t color;
/**The width (thickness) of the arc */
int32_t width;
/**The start angle in 1 degree units (if `LV_USE_FLOAT` is enabled a float number can be also used)
* 0° is the 3 o'clock position, 90° is the 6 o'clock, etc. */
lv_value_precise_t start_angle;
/**The end angle, similarly to start_angle. */
lv_value_precise_t end_angle;
/**The center point of the arc. */
lv_point_t center;
/**The outer radius of the arc*/
uint16_t radius;
/**An image source to be used instead of `color`. `NULL` if unused*/
const void * img_src;
/**Opacity of the arc in 0...255 range.
* LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/
lv_opa_t opa;
/**1: Make the arc ends rounded*/
uint8_t rounded : 1;
} lv_draw_arc_dsc_t;

View File

@ -126,6 +126,8 @@ void lv_draw_buf_invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_
return;
}
LV_PROFILER_DRAW_BEGIN;
lv_area_t full;
if(area == NULL) {
draw_buf_get_full_area(draw_buf, &full);
@ -133,6 +135,7 @@ void lv_draw_buf_invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_
}
handlers->invalidate_cache_cb(draw_buf, area);
LV_PROFILER_DRAW_END;
}
void lv_draw_buf_flush_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area)
@ -145,6 +148,8 @@ void lv_draw_buf_flush_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * a
return;
}
LV_PROFILER_DRAW_BEGIN;
lv_area_t full;
if(area == NULL) {
draw_buf_get_full_area(draw_buf, &full);
@ -152,11 +157,13 @@ void lv_draw_buf_flush_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * a
}
handlers->flush_cache_cb(draw_buf, area);
LV_PROFILER_DRAW_END;
}
void lv_draw_buf_clear(lv_draw_buf_t * draw_buf, const lv_area_t * a)
{
LV_ASSERT_NULL(draw_buf);
LV_PROFILER_DRAW_BEGIN;
const lv_image_header_t * header = &draw_buf->header;
uint32_t stride = header->stride;
@ -164,6 +171,8 @@ void lv_draw_buf_clear(lv_draw_buf_t * draw_buf, const lv_area_t * a)
if(a == NULL) {
uint8_t * buf = lv_draw_buf_goto_xy(draw_buf, 0, 0);
lv_memzero(buf, header->h * stride);
lv_draw_buf_flush_cache(draw_buf, a);
LV_PROFILER_DRAW_END;
return;
}
@ -174,9 +183,20 @@ void lv_draw_buf_clear(lv_draw_buf_t * draw_buf, const lv_area_t * a)
a_draw_buf.y2 = draw_buf->header.h - 1;
lv_area_t a_clipped;
if(!lv_area_intersect(&a_clipped, a, &a_draw_buf)) return;
if(lv_area_get_width(&a_clipped) <= 0) return;
if(lv_area_get_height(&a_clipped) <= 0) return;
if(!lv_area_intersect(&a_clipped, a, &a_draw_buf)) {
LV_PROFILER_DRAW_END;
return;
}
if(lv_area_get_width(&a_clipped) <= 0) {
LV_PROFILER_DRAW_END;
return;
}
if(lv_area_get_height(&a_clipped) <= 0) {
LV_PROFILER_DRAW_END;
return;
}
uint8_t * buf = lv_draw_buf_goto_xy(draw_buf, a_clipped.x1, a_clipped.y1);
uint8_t bpp = lv_color_format_get_bpp(header->cf);
@ -186,11 +206,14 @@ void lv_draw_buf_clear(lv_draw_buf_t * draw_buf, const lv_area_t * a)
lv_memzero(buf, line_length);
buf += stride;
}
lv_draw_buf_flush_cache(draw_buf, a);
LV_PROFILER_DRAW_END;
}
void lv_draw_buf_copy(lv_draw_buf_t * dest, const lv_area_t * dest_area,
const lv_draw_buf_t * src, const lv_area_t * src_area)
{
LV_PROFILER_DRAW_BEGIN;
uint8_t * dest_bufc;
uint8_t * src_bufc;
int32_t line_width;
@ -213,6 +236,7 @@ void lv_draw_buf_copy(lv_draw_buf_t * dest, const lv_area_t * dest_area,
if((src_area == NULL && line_width != src->header.w) || \
(src_area != NULL && line_width != lv_area_get_width(src_area))) {
LV_ASSERT_MSG(0, "Source and destination areas have different width");
LV_PROFILER_DRAW_END;
return;
}
@ -241,6 +265,7 @@ void lv_draw_buf_copy(lv_draw_buf_t * dest, const lv_area_t * dest_area,
dest_bufc += dest_stride;
src_bufc += src_stride;
}
LV_PROFILER_DRAW_END;
}
lv_result_t lv_draw_buf_init(lv_draw_buf_t * draw_buf, uint32_t w, uint32_t h, lv_color_format_t cf, uint32_t stride,
@ -283,9 +308,13 @@ lv_draw_buf_t * lv_draw_buf_create(uint32_t w, uint32_t h, lv_color_format_t cf,
lv_draw_buf_t * lv_draw_buf_create_ex(const lv_draw_buf_handlers_t * handlers, uint32_t w, uint32_t h,
lv_color_format_t cf, uint32_t stride)
{
LV_PROFILER_DRAW_BEGIN;
lv_draw_buf_t * draw_buf = lv_malloc_zeroed(sizeof(lv_draw_buf_t));
LV_ASSERT_MALLOC(draw_buf);
if(draw_buf == NULL) return NULL;
if(draw_buf == NULL) {
LV_PROFILER_DRAW_END;
return NULL;
}
if(stride == 0) stride = lv_draw_buf_width_to_stride(w, cf);
uint32_t size = _calculate_draw_buf_size(w, h, cf, stride);
@ -296,6 +325,7 @@ lv_draw_buf_t * lv_draw_buf_create_ex(const lv_draw_buf_handlers_t * handlers, u
LV_LOG_WARN("No memory: %"LV_PRIu32"x%"LV_PRIu32", cf: %d, stride: %"LV_PRIu32", %"LV_PRIu32"Byte, ",
w, h, cf, stride, size);
lv_free(draw_buf);
LV_PROFILER_DRAW_END;
return NULL;
}
@ -309,6 +339,7 @@ lv_draw_buf_t * lv_draw_buf_create_ex(const lv_draw_buf_handlers_t * handlers, u
draw_buf->unaligned_data = buf;
draw_buf->data_size = size;
draw_buf->handlers = handlers;
LV_PROFILER_DRAW_END;
return draw_buf;
}
@ -319,9 +350,13 @@ lv_draw_buf_t * lv_draw_buf_dup(const lv_draw_buf_t * draw_buf)
lv_draw_buf_t * lv_draw_buf_dup_ex(const lv_draw_buf_handlers_t * handlers, const lv_draw_buf_t * draw_buf)
{
LV_PROFILER_DRAW_BEGIN;
const lv_image_header_t * header = &draw_buf->header;
lv_draw_buf_t * new_buf = lv_draw_buf_create_ex(handlers, header->w, header->h, header->cf, header->stride);
if(new_buf == NULL) return NULL;
if(new_buf == NULL) {
LV_PROFILER_DRAW_END;
return NULL;
}
new_buf->header.flags = draw_buf->header.flags;
new_buf->header.flags |= LV_IMAGE_FLAGS_MODIFIABLE | LV_IMAGE_FLAGS_ALLOCATED;
@ -331,6 +366,7 @@ lv_draw_buf_t * lv_draw_buf_dup_ex(const lv_draw_buf_handlers_t * handlers, cons
/*Copy image data*/
lv_memcpy(new_buf->data, draw_buf->data, size);
LV_PROFILER_DRAW_END;
return new_buf;
}
@ -338,6 +374,7 @@ lv_draw_buf_t * lv_draw_buf_reshape(lv_draw_buf_t * draw_buf, lv_color_format_t
uint32_t stride)
{
if(draw_buf == NULL) return NULL;
LV_PROFILER_DRAW_BEGIN;
/*If color format is unknown, keep using the original color format.*/
if(cf == LV_COLOR_FORMAT_UNKNOWN) cf = draw_buf->header.cf;
@ -347,6 +384,7 @@ lv_draw_buf_t * lv_draw_buf_reshape(lv_draw_buf_t * draw_buf, lv_color_format_t
if(size > draw_buf->data_size) {
LV_LOG_TRACE("Draw buf too small for new shape");
LV_PROFILER_DRAW_END;
return NULL;
}
@ -355,6 +393,7 @@ lv_draw_buf_t * lv_draw_buf_reshape(lv_draw_buf_t * draw_buf, lv_color_format_t
draw_buf->header.h = h;
draw_buf->header.stride = stride;
LV_PROFILER_DRAW_END;
return draw_buf;
}
@ -362,6 +401,7 @@ void lv_draw_buf_destroy(lv_draw_buf_t * draw_buf)
{
LV_ASSERT_NULL(draw_buf);
if(draw_buf == NULL) return;
LV_PROFILER_DRAW_BEGIN;
if(draw_buf->header.flags & LV_IMAGE_FLAGS_ALLOCATED) {
LV_ASSERT_NULL(draw_buf->handlers);
@ -373,6 +413,7 @@ void lv_draw_buf_destroy(lv_draw_buf_t * draw_buf)
else {
LV_LOG_ERROR("draw buffer is not allocated, ignored");
}
LV_PROFILER_DRAW_END;
}
void * lv_draw_buf_goto_xy(const lv_draw_buf_t * buf, uint32_t x, uint32_t y)
@ -397,12 +438,14 @@ lv_result_t lv_draw_buf_adjust_stride(lv_draw_buf_t * src, uint32_t stride)
LV_ASSERT_NULL(src->data);
if(src == NULL) return LV_RESULT_INVALID;
if(src->data == NULL) return LV_RESULT_INVALID;
LV_PROFILER_DRAW_BEGIN;
const lv_image_header_t * header = &src->header;
uint32_t w = header->w;
uint32_t h = header->h;
if(!lv_draw_buf_has_flag(src, LV_IMAGE_FLAGS_MODIFIABLE)) {
LV_PROFILER_DRAW_END;
return LV_RESULT_INVALID;
}
@ -410,19 +453,24 @@ lv_result_t lv_draw_buf_adjust_stride(lv_draw_buf_t * src, uint32_t stride)
if(stride == 0) stride = lv_draw_buf_width_to_stride(w, header->cf);
/*Check if stride already match*/
if(header->stride == stride) return LV_RESULT_OK;
if(header->stride == stride) {
LV_PROFILER_DRAW_END;
return LV_RESULT_OK;
}
/*Calculate the minimal stride allowed from bpp*/
uint32_t bpp = lv_color_format_get_bpp(header->cf);
uint32_t min_stride = (w * bpp + 7) >> 3;
if(stride < min_stride) {
LV_LOG_WARN("New stride is too small. min: %" LV_PRId32, min_stride);
LV_PROFILER_DRAW_END;
return LV_RESULT_INVALID;
}
/*Check if buffer has enough space. */
uint32_t new_size = _calculate_draw_buf_size(w, h, header->cf, stride);
if(new_size > src->data_size) {
LV_PROFILER_DRAW_END;
return LV_RESULT_INVALID;
}
@ -451,6 +499,7 @@ lv_result_t lv_draw_buf_adjust_stride(lv_draw_buf_t * src, uint32_t stride)
src->header.stride = stride;
LV_PROFILER_DRAW_END;
return LV_RESULT_OK;
}
@ -464,6 +513,7 @@ lv_result_t lv_draw_buf_premultiply(lv_draw_buf_t * draw_buf)
LV_LOG_WARN("draw buf is not modifiable: 0x%04x", draw_buf->header.flags);
return LV_RESULT_INVALID;
}
LV_PROFILER_DRAW_BEGIN;
/*Premultiply color with alpha, do case by case by judging color format*/
lv_color_format_t cf = draw_buf->header.cf;
@ -529,6 +579,7 @@ lv_result_t lv_draw_buf_premultiply(lv_draw_buf_t * draw_buf)
draw_buf->header.flags |= LV_IMAGE_FLAGS_PREMULTIPLIED;
LV_PROFILER_DRAW_END;
return LV_RESULT_OK;
}
@ -561,11 +612,16 @@ void lv_draw_buf_clear_flag(lv_draw_buf_t * draw_buf, lv_image_flags_t flag)
draw_buf->header.flags &= ~flag;
}
void lv_draw_buf_from_image(lv_draw_buf_t * buf, const lv_image_dsc_t * img)
lv_result_t lv_draw_buf_from_image(lv_draw_buf_t * buf, const lv_image_dsc_t * img)
{
lv_draw_buf_init(buf, img->header.w, img->header.h, img->header.cf, img->header.stride,
(void *)img->data, img->data_size);
const lv_result_t res = lv_draw_buf_init(buf, img->header.w, img->header.h, img->header.cf, img->header.stride,
(void *)img->data, img->data_size);
if(res != LV_RESULT_OK) {
return res;
}
buf->header.flags = img->header.flags;
return res;
}
void lv_draw_buf_to_image(const lv_draw_buf_t * buf, lv_image_dsc_t * img)

View File

@ -48,7 +48,7 @@ LV_EXPORT_CONST_INT(LV_STRIDE_AUTO);
* For platform that needs special buffer alignment, call LV_DRAW_BUF_INIT_STATIC.
*/
#define LV_DRAW_BUF_DEFINE_STATIC(name, _w, _h, _cf) \
static uint8_t buf_##name[LV_DRAW_BUF_SIZE(_w, _h, _cf)]; \
static LV_ATTRIBUTE_MEM_ALIGN uint8_t buf_##name[LV_DRAW_BUF_SIZE(_w, _h, _cf)]; \
static lv_draw_buf_t name = { \
.header = { \
.magic = LV_IMAGE_HEADER_MAGIC, \
@ -85,7 +85,7 @@ typedef void (*lv_draw_buf_cache_operation_cb)(const lv_draw_buf_t * draw_buf, c
typedef uint32_t (*lv_draw_buf_width_to_stride_cb)(uint32_t w, lv_color_format_t color_format);
struct lv_draw_buf_t {
struct _lv_draw_buf_t {
lv_image_header_t header;
uint32_t data_size; /**< Total buf size in bytes */
uint8_t * data;
@ -318,7 +318,7 @@ void lv_draw_buf_clear_flag(lv_draw_buf_t * draw_buf, lv_image_flags_t flag);
* And is interchangeable with `lv_image_dsc_t`.
*/
void lv_draw_buf_from_image(lv_draw_buf_t * buf, const lv_image_dsc_t * img);
lv_result_t lv_draw_buf_from_image(lv_draw_buf_t * buf, const lv_image_dsc_t * img);
void lv_draw_buf_to_image(const lv_draw_buf_t * buf, lv_image_dsc_t * img);

View File

@ -24,7 +24,7 @@ extern "C" {
* TYPEDEFS
**********************/
struct lv_draw_buf_handlers_t {
struct _lv_draw_buf_handlers_t {
lv_draw_buf_malloc_cb buf_malloc_cb;
lv_draw_buf_free_cb buf_free_cb;
lv_draw_buf_align_cb align_pointer_cb;

View File

@ -14,6 +14,7 @@
#include "../misc/lv_log.h"
#include "../misc/lv_math.h"
#include "../core/lv_refr.h"
#include "../core/lv_obj_private.h"
#include "../stdlib/lv_mem.h"
#include "../stdlib/lv_string.h"
@ -29,7 +30,7 @@
* STATIC PROTOTYPES
**********************/
static void img_decode_and_draw(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc,
static void img_decode_and_draw(lv_draw_task_t * t, const lv_draw_image_dsc_t * draw_dsc,
lv_image_decoder_dsc_t * decoder_dsc, lv_area_t * relative_decoded_area,
const lv_area_t * img_area, const lv_area_t * clipped_img_area,
lv_draw_image_core_cb draw_core_cb);
@ -70,24 +71,31 @@ void lv_draw_layer(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv
return;
}
lv_draw_task_t * t = lv_draw_add_task(layer, coords);
LV_PROFILER_DRAW_BEGIN;
t->draw_dsc = lv_malloc(sizeof(*dsc));
lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc));
t->type = LV_DRAW_TASK_TYPE_LAYER;
lv_draw_task_t * t = lv_draw_add_task(layer, coords, LV_DRAW_TASK_TYPE_LAYER);
lv_draw_image_dsc_t * new_image_dsc = t->draw_dsc;
lv_memcpy(new_image_dsc, dsc, sizeof(*dsc));
t->state = LV_DRAW_TASK_STATE_WAITING;
lv_image_buf_get_transformed_area(&t->_real_area, lv_area_get_width(coords), lv_area_get_height(coords),
dsc->rotation, dsc->scale_x, dsc->scale_y, &dsc->pivot);
lv_area_move(&t->_real_area, coords->x1, coords->y1);
/*If the image_area is not set assume that it's the same as the rendering area */
if(new_image_dsc->image_area.x2 == LV_COORD_MIN) {
new_image_dsc->image_area = *coords;
}
lv_layer_t * layer_to_draw = (lv_layer_t *)dsc->src;
layer_to_draw->all_tasks_added = true;
lv_draw_finalize_task_creation(layer, t);
LV_PROFILER_DRAW_END;
}
void lv_draw_image(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords)
void lv_draw_image(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv_area_t * image_coords)
{
if(dsc->src == NULL) {
LV_LOG_WARN("Image draw: src is NULL");
@ -100,27 +108,81 @@ void lv_draw_image(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv
return;
}
LV_PROFILER_BEGIN;
LV_PROFILER_DRAW_BEGIN;
lv_draw_image_dsc_t * new_image_dsc = lv_malloc(sizeof(*dsc));
lv_memcpy(new_image_dsc, dsc, sizeof(*dsc));
lv_result_t res = lv_image_decoder_get_info(new_image_dsc->src, &new_image_dsc->header);
lv_draw_image_dsc_t new_image_dsc;
lv_memcpy(&new_image_dsc, dsc, sizeof(*dsc));
lv_result_t res = lv_image_decoder_get_info(new_image_dsc.src, &new_image_dsc.header);
if(res != LV_RESULT_OK) {
LV_LOG_WARN("Couldn't get info about the image");
lv_free(new_image_dsc);
LV_PROFILER_DRAW_END;
return;
}
lv_draw_task_t * t = lv_draw_add_task(layer, coords);
t->draw_dsc = new_image_dsc;
t->type = LV_DRAW_TASK_TYPE_IMAGE;
/*If the image_area is not set assume that it's the same as the rendering area */
if(new_image_dsc.image_area.x2 == LV_COORD_MIN) {
new_image_dsc.image_area = *image_coords;
}
lv_image_buf_get_transformed_area(&t->_real_area, lv_area_get_width(coords), lv_area_get_height(coords),
dsc->rotation, dsc->scale_x, dsc->scale_y, &dsc->pivot);
lv_area_move(&t->_real_area, coords->x1, coords->y1);
/*Typical case, draw the image as bitmap*/
if(!(new_image_dsc.header.flags & LV_IMAGE_FLAGS_CUSTOM_DRAW)) {
lv_draw_task_t * t = lv_draw_add_task(layer, image_coords, LV_DRAW_TASK_TYPE_IMAGE);
lv_memcpy(t->draw_dsc, &new_image_dsc, sizeof(lv_draw_image_dsc_t));
lv_draw_finalize_task_creation(layer, t);
LV_PROFILER_END;
lv_image_buf_get_transformed_area(&t->_real_area, lv_area_get_width(image_coords), lv_area_get_height(image_coords),
dsc->rotation, dsc->scale_x, dsc->scale_y, &dsc->pivot);
lv_area_move(&t->_real_area, image_coords->x1, image_coords->y1);
lv_draw_finalize_task_creation(layer, t);
}
/*Use a custom draw callback*/
else {
lv_image_decoder_dsc_t decoder_dsc;
res = lv_image_decoder_open(&decoder_dsc, new_image_dsc.src, NULL);
if(res != LV_RESULT_OK) {
LV_LOG_ERROR("Failed to open image");
LV_PROFILER_DRAW_END;
return;
}
if(decoder_dsc.decoder && decoder_dsc.decoder->custom_draw_cb) {
lv_area_t draw_area = layer->buf_area;
lv_area_t coords_area = *image_coords;
lv_area_t obj_area = dsc->base.obj->coords;
if(layer->parent) { /* child layer */
if(lv_area_intersect(&coords_area, &coords_area, &obj_area)) {
int32_t xpos = image_coords->x1 - draw_area.x1;
int32_t ypos = image_coords->y1 - draw_area.y1;
lv_area_move(&coords_area, -(image_coords->x1 - xpos), -(image_coords->y1 - ypos));
layer->_clip_area = coords_area;
decoder_dsc.decoder->custom_draw_cb(layer, &decoder_dsc, &coords_area, &new_image_dsc, &coords_area);
}
}
else {
lv_area_t clip_area = draw_area;
if(lv_area_intersect(&clip_area, &clip_area, &coords_area)) {
lv_image_buf_get_transformed_area(&coords_area, lv_area_get_width(image_coords), lv_area_get_height(image_coords),
dsc->rotation, dsc->scale_x, dsc->scale_y, &dsc->pivot);
lv_area_move(&coords_area, image_coords->x1, image_coords->y1);
lv_image_buf_get_transformed_area(&clip_area, lv_area_get_width(image_coords), lv_area_get_height(image_coords),
dsc->rotation, dsc->scale_x, dsc->scale_y, &dsc->pivot);
lv_area_move(&clip_area, image_coords->x1, image_coords->y1);
if(lv_area_intersect(&clip_area, &clip_area, &obj_area)) {
decoder_dsc.decoder->custom_draw_cb(layer, &decoder_dsc, &coords_area, &new_image_dsc, &clip_area);
}
}
}
}
}
LV_PROFILER_DRAW_END;
}
lv_image_src_t lv_image_src_get_type(const void * src)
@ -140,7 +202,7 @@ lv_image_src_t lv_image_src_get_type(const void * src)
}
}
void lv_draw_image_normal_helper(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc,
void lv_draw_image_normal_helper(lv_draw_task_t * t, const lv_draw_image_dsc_t * draw_dsc,
const lv_area_t * coords, lv_draw_image_core_cb draw_core_cb)
{
if(draw_core_cb == NULL) {
@ -164,7 +226,7 @@ void lv_draw_image_normal_helper(lv_draw_unit_t * draw_unit, const lv_draw_image
}
lv_area_t clipped_img_area;
if(!lv_area_intersect(&clipped_img_area, &draw_area, draw_unit->clip_area)) {
if(!lv_area_intersect(&clipped_img_area, &draw_area, &t->clip_area)) {
return;
}
@ -175,12 +237,12 @@ void lv_draw_image_normal_helper(lv_draw_unit_t * draw_unit, const lv_draw_image
return;
}
img_decode_and_draw(draw_unit, draw_dsc, &decoder_dsc, NULL, coords, &clipped_img_area, draw_core_cb);
img_decode_and_draw(t, draw_dsc, &decoder_dsc, NULL, coords, &clipped_img_area, draw_core_cb);
lv_image_decoder_close(&decoder_dsc);
}
void lv_draw_image_tiled_helper(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc,
void lv_draw_image_tiled_helper(lv_draw_task_t * t, const lv_draw_image_dsc_t * draw_dsc,
const lv_area_t * coords, lv_draw_image_core_cb draw_core_cb)
{
if(draw_core_cb == NULL) {
@ -222,7 +284,7 @@ void lv_draw_image_tiled_helper(lv_draw_unit_t * draw_unit, const lv_draw_image_
lv_area_t clipped_img_area;
if(lv_area_intersect(&clipped_img_area, &tile_area, coords)) {
img_decode_and_draw(draw_unit, draw_dsc, &decoder_dsc, &relative_decoded_area, &tile_area, &clipped_img_area,
img_decode_and_draw(t, draw_dsc, &decoder_dsc, &relative_decoded_area, &tile_area, &clipped_img_area,
draw_core_cb);
}
@ -270,7 +332,7 @@ void lv_image_buf_get_transformed_area(lv_area_t * res, int32_t w, int32_t h, in
* STATIC FUNCTIONS
**********************/
static void img_decode_and_draw(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc,
static void img_decode_and_draw(lv_draw_task_t * t, const lv_draw_image_dsc_t * draw_dsc,
lv_image_decoder_dsc_t * decoder_dsc, lv_area_t * relative_decoded_area,
const lv_area_t * img_area, const lv_area_t * clipped_img_area,
lv_draw_image_core_cb draw_core_cb)
@ -282,7 +344,7 @@ static void img_decode_and_draw(lv_draw_unit_t * draw_unit, const lv_draw_image_
/*The whole image is available, just draw it*/
if(decoder_dsc->decoded && (relative_decoded_area == NULL || relative_decoded_area->x1 == LV_COORD_MIN)) {
draw_core_cb(draw_unit, draw_dsc, decoder_dsc, &sup, img_area, clipped_img_area);
draw_core_cb(t, draw_dsc, decoder_dsc, &sup, img_area, clipped_img_area);
}
/*Draw in smaller pieces*/
else {
@ -305,7 +367,7 @@ static void img_decode_and_draw(lv_draw_unit_t * draw_unit, const lv_draw_image_
/*Limit draw area to the current decoded area and draw the image*/
lv_area_t clipped_img_area_sub;
if(lv_area_intersect(&clipped_img_area_sub, clipped_img_area, &absolute_decoded_area)) {
draw_core_cb(draw_unit, draw_dsc, decoder_dsc, &sup,
draw_core_cb(t, draw_dsc, decoder_dsc, &sup,
&absolute_decoded_area, &clipped_img_area_sub);
}
}

View File

@ -26,51 +26,87 @@ extern "C" {
* MACROS
**********************/
typedef struct lv_draw_image_dsc_t {
struct _lv_draw_image_dsc_t {
lv_draw_dsc_base_t base;
/**The image source: pointer to `lv_image_dsc_t` or a path to a file*/
const void * src;
/**The header of the image. Initialized internally in `lv_draw_image` */
lv_image_header_t header;
/**Clip the corner of the image with this radius. Use `LV_RADIUS_CIRCLE` for max. radius */
int32_t clip_radius;
/**The rotation of the image in 0.1 degree unit. E.g. 234 means 23.4° */
int32_t rotation;
/**Horizontal scale (zoom) of the image.
* 256 (LV_SCALE_NONE): means no zoom, 512 double size, 128 half size.*/
int32_t scale_x;
/**Same as `scale_y` but vertically*/
int32_t scale_y;
/**Parallelogram like transformation of the image horizontally in 0.1 degree unit. E.g. 456 means 45.6°.*/
int32_t skew_x;
/**Same as `skew_x` but vertically*/
int32_t skew_y;
/**The pivot point of transformation (scale and rotation).
* 0;0 is the top left corner of the image. Can be outside of the image too.*/
lv_point_t pivot;
/**Mix this color to the images. In case of `LV_COLOR_FORMAT_A8` it will be the color of the visible pixels*/
lv_color_t recolor;
/**The intensity of recoloring. 0 means, no recolor, 255 means full cover (transparent pixels remain transparent)*/
lv_opa_t recolor_opa;
/**Opacity in 0...255 range.
* LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/
lv_opa_t opa;
/**Describes how to blend the pixels of the image to the background.
* See `lv_blend_mode_t` for more details.
*/
lv_blend_mode_t blend_mode : 4;
/**1: perform the transformation with anti-alaising */
uint16_t antialias : 1;
/**If the image is smaller than the `image_area` field of `lv_draw_image_dsc_t`
* tile the image (repeat is both horizontally and vertically) to fill the
* `image_area` area*/
uint16_t tile : 1;
/**Used internally to store some information about the palette or the color of A8 images*/
lv_draw_image_sup_t * sup;
/** Used to indicate the entire original, non-clipped area where the image is to be drawn.
* This is important for:
* 1. Layer rendering, where it might happen that only a smaller area of the layer is rendered.
* 1. Layer rendering, where it might happen that only a smaller area of the layer is rendered and e.g.
* `clip_radius` needs to know what the original image was.
* 2. Tiled images, where the target draw area is larger than the image to be tiled.
*/
lv_area_t image_area;
int32_t clip_radius;
/**Pointer to an A8 or L8 image descriptor to mask the image with.
* The mask is always center aligned. */
const lv_image_dsc_t * bitmap_mask_src;
} lv_draw_image_dsc_t;
};
/**
* PErform the actual rendering of a decoded image
* @param draw_unit pointer to a draw unit
* @param t pointer to a draw task
* @param draw_dsc the draw descriptor of the image
* @param decoder_dsc pointer to the decoded image's descriptor
* @param sup supplementary data
* @param img_coords the absolute coordinates of the image
* @param clipped_img_area the absolute clip coordinates
*/
typedef void (*lv_draw_image_core_cb)(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc,
typedef void (*lv_draw_image_core_cb)(lv_draw_task_t * t, const lv_draw_image_dsc_t * draw_dsc,
const lv_image_decoder_dsc_t * decoder_dsc, lv_draw_image_sup_t * sup,
const lv_area_t * img_coords, const lv_area_t * clipped_img_area);
@ -105,7 +141,7 @@ void lv_draw_image(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv
/**
* Create a draw task to blend a layer to another layer
* @param layer pointer to a layer
* @param dsc pointer to an initialized draw descriptor
* @param dsc pointer to an initialized draw descriptor. `src` must be set to the layer to blend
* @param coords the coordinates of the layer.
* @note `coords` can be small than the total widget area from which the layer is created
* (if only a part of the widget was rendered to a layer)

View File

@ -28,7 +28,7 @@ extern "C" {
* TYPEDEFS
**********************/
struct lv_draw_image_sup_t {
struct _lv_draw_image_sup_t {
lv_color_t alpha_color;
const lv_color32_t * palette;
uint32_t palette_size : 9;
@ -42,23 +42,23 @@ struct lv_draw_image_sup_t {
/**
* Can be used by draw units to handle the decoding and
* prepare everything for the actual image rendering
* @param draw_unit pointer to a draw unit
* @param t pointer to a draw task
* @param draw_dsc the draw descriptor of the image
* @param coords the absolute coordinates of the image
* @param draw_core_cb a callback to perform the actual rendering
*/
void lv_draw_image_normal_helper(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc,
void lv_draw_image_normal_helper(lv_draw_task_t * t, const lv_draw_image_dsc_t * draw_dsc,
const lv_area_t * coords, lv_draw_image_core_cb draw_core_cb);
/**
* Can be used by draw units for TILED images to handle the decoding and
* prepare everything for the actual image rendering
* @param draw_unit pointer to a draw unit
* @param t pointer to a draw task
* @param draw_dsc the draw descriptor of the image
* @param coords the absolute coordinates of the image
* @param draw_core_cb a callback to perform the actual rendering
*/
void lv_draw_image_tiled_helper(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc,
void lv_draw_image_tiled_helper(lv_draw_task_t * t, const lv_draw_image_dsc_t * draw_dsc,
const lv_area_t * coords, lv_draw_image_core_cb draw_core_cb);
/**

View File

@ -32,12 +32,17 @@
/**********************
* TYPEDEFS
**********************/
enum {
RECOLOR_CMD_STATE_WAIT_FOR_PARAMETER,
RECOLOR_CMD_STATE_PARAMETER,
RECOLOR_CMD_STATE_TEXT_INPUT,
};
typedef unsigned char cmd_state_t;
/**********************
* STATIC PROTOTYPES
**********************/
static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc, const lv_point_t * pos,
const lv_font_t * font, uint32_t letter, lv_draw_glyph_cb_t cb);
static uint8_t hex_char_to_num(char hex);
/**********************
* STATIC VARIABLES
@ -55,11 +60,24 @@ static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc,
* GLOBAL FUNCTIONS
**********************/
void lv_draw_letter_dsc_init(lv_draw_letter_dsc_t * dsc)
{
lv_memzero(dsc, sizeof(lv_draw_letter_dsc_t));
dsc->opa = LV_OPA_COVER;
dsc->color = lv_color_black();
dsc->font = LV_FONT_DEFAULT;
dsc->rotation = 0;
dsc->scale_x = LV_SCALE_NONE;
dsc->scale_y = LV_SCALE_NONE;
dsc->base.dsc_size = sizeof(lv_draw_letter_dsc_t);
}
void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc)
{
lv_memzero(dsc, sizeof(lv_draw_label_dsc_t));
dsc->opa = LV_OPA_COVER;
dsc->color = lv_color_black();
dsc->text_length = LV_TEXT_LEN_MAX;
dsc->font = LV_FONT_DEFAULT;
dsc->sel_start = LV_DRAW_LABEL_NO_TXT_SEL;
dsc->sel_end = LV_DRAW_LABEL_NO_TXT_SEL;
@ -89,21 +107,20 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_label(lv_layer_t * layer, const lv_draw_label
return;
}
LV_PROFILER_BEGIN;
lv_draw_task_t * t = lv_draw_add_task(layer, coords);
LV_PROFILER_DRAW_BEGIN;
lv_draw_task_t * t = lv_draw_add_task(layer, coords, LV_DRAW_TASK_TYPE_LABEL);
t->draw_dsc = lv_malloc(sizeof(*dsc));
lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc));
t->type = LV_DRAW_TASK_TYPE_LABEL;
/*The text is stored in a local variable so malloc memory for it*/
if(dsc->text_local) {
lv_draw_label_dsc_t * new_dsc = t->draw_dsc;
new_dsc->text = lv_strdup(dsc->text);
new_dsc->text = lv_strndup(dsc->text, dsc->text_length);
LV_ASSERT_MALLOC(new_dsc->text);
}
lv_draw_finalize_task_creation(layer, t);
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
}
void LV_ATTRIBUTE_FAST_MEM lv_draw_character(lv_layer_t * layer, lv_draw_label_dsc_t * dsc,
@ -117,7 +134,7 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_character(lv_layer_t * layer, lv_draw_label_d
if(lv_text_is_marker(unicode_letter)) return;
LV_PROFILER_BEGIN;
LV_PROFILER_DRAW_BEGIN;
lv_font_glyph_dsc_t g;
lv_font_get_glyph_dsc(dsc->font, &g, unicode_letter, 0);
@ -143,18 +160,52 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_character(lv_layer_t * layer, lv_draw_label_d
dsc->text_local = 1;
lv_draw_label(layer, dsc, &a);
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
}
void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc,
void LV_ATTRIBUTE_FAST_MEM lv_draw_letter(lv_layer_t * layer, lv_draw_letter_dsc_t * dsc, const lv_point_t * point)
{
if(dsc->opa <= LV_OPA_MIN) return;
if(dsc->font == NULL) {
LV_LOG_WARN("dsc->font == NULL");
return;
}
const lv_font_t * font = dsc->font;
LV_PROFILER_DRAW_BEGIN;
lv_font_glyph_dsc_t g;
lv_font_get_glyph_dsc(font, &g, dsc->unicode, 0);
font = g.resolved_font ? g.resolved_font : dsc->font;
lv_area_t a;
a.x1 = point->x;
a.y1 = point->y;
a.x2 = a.x1 + g.adv_w;
a.y2 = a.y1 + lv_font_get_line_height(font);
dsc->pivot.x = g.adv_w / 2 ;
dsc->pivot.y = font->line_height - font->base_line;
lv_draw_task_t * t = lv_draw_add_task(layer, &a, LV_DRAW_TASK_TYPE_LETTER);
lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc));
lv_draw_finalize_task_creation(layer, t);
LV_PROFILER_DRAW_END;
}
void lv_draw_label_iterate_characters(lv_draw_task_t * t, const lv_draw_label_dsc_t * dsc,
const lv_area_t * coords,
lv_draw_glyph_cb_t cb)
{
lv_draw_dsc_base_t * base_dsc = t->draw_dsc;
const lv_font_t * font = dsc->font;
int32_t w;
lv_area_t clipped_area;
bool clip_ok = lv_area_intersect(&clipped_area, coords, draw_unit->clip_area);
bool clip_ok = lv_area_intersect(&clipped_area, coords, &t->clip_area);
if(!clip_ok) return;
lv_text_align_t align = dsc->align;
@ -168,10 +219,15 @@ void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_
}
else {
/*If EXPAND is enabled then not limit the text's width to the object's width*/
lv_point_t p;
lv_text_get_size(&p, dsc->text, dsc->font, dsc->letter_space, dsc->line_space, LV_COORD_MAX,
dsc->flag);
w = p.x;
if(base_dsc->obj && !lv_obj_has_flag(base_dsc->obj, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS)) {
w = dsc->text_size.x;
}
else {
lv_point_t p;
lv_text_get_size(&p, dsc->text, dsc->font, dsc->letter_space, dsc->line_space, LV_COORD_MAX,
dsc->flag);
w = p.x;
}
}
int32_t line_height_font = lv_font_get_line_height(font);
@ -206,14 +262,16 @@ void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_
pos.y += dsc->hint->y;
}
uint32_t line_end = line_start + lv_text_get_next_line(&dsc->text[line_start], font, dsc->letter_space, w, NULL,
dsc->flag);
uint32_t remaining_len = dsc->text_length;
uint32_t line_end = line_start + lv_text_get_next_line(&dsc->text[line_start], remaining_len, font, dsc->letter_space,
w, NULL, dsc->flag);
/*Go the first visible line*/
while(pos.y + line_height_font < draw_unit->clip_area->y1) {
while(pos.y + line_height_font < t->clip_area.y1) {
/*Go to next line*/
line_start = line_end;
line_end += lv_text_get_next_line(&dsc->text[line_start], font, dsc->letter_space, w, NULL, dsc->flag);
line_end += lv_text_get_next_line(&dsc->text[line_start], remaining_len, font, dsc->letter_space, w, NULL, dsc->flag);
pos.y += line_height;
/*Save at the threshold coordinate*/
@ -228,14 +286,16 @@ void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_
/*Align to middle*/
if(align == LV_TEXT_ALIGN_CENTER) {
line_width = lv_text_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space);
line_width = lv_text_get_width_with_flags(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space,
dsc->flag);
pos.x += (lv_area_get_width(coords) - line_width) / 2;
}
/*Align to the right*/
else if(align == LV_TEXT_ALIGN_RIGHT) {
line_width = lv_text_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space);
line_width = lv_text_get_width_with_flags(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space,
dsc->flag);
pos.x += lv_area_get_width(coords) - line_width;
}
@ -253,45 +313,147 @@ void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_
draw_letter_dsc.opa = dsc->opa;
draw_letter_dsc.bg_coords = &bg_coords;
draw_letter_dsc.color = dsc->color;
draw_letter_dsc.rotation = dsc->rotation;
/* Set letter outline stroke attributes */
draw_letter_dsc.outline_stroke_width = dsc->outline_stroke_width;
draw_letter_dsc.outline_stroke_opa = dsc->outline_stroke_opa;
draw_letter_dsc.outline_stroke_color = dsc->outline_stroke_color;
lv_draw_fill_dsc_t fill_dsc;
lv_draw_fill_dsc_init(&fill_dsc);
fill_dsc.opa = dsc->opa;
int32_t underline_width = font->underline_thickness ? font->underline_thickness : 1;
int32_t line_start_x;
uint32_t i;
uint32_t next_char_offset;
uint32_t recolor_command_start_index = 0;
int32_t letter_w;
cmd_state_t recolor_cmd_state = RECOLOR_CMD_STATE_WAIT_FOR_PARAMETER;
lv_color_t recolor = lv_color_black(); /* Holds the selected color inside the recolor command */
uint8_t is_first_space_after_cmd = 0;
/*Write out all lines*/
while(dsc->text[line_start] != '\0') {
while(remaining_len && dsc->text[line_start] != '\0') {
pos.x += x_ofs;
line_start_x = pos.x;
/*Write all letter of a line*/
i = 0;
recolor_cmd_state = RECOLOR_CMD_STATE_WAIT_FOR_PARAMETER;
next_char_offset = 0;
#if LV_USE_BIDI
char * bidi_txt = lv_malloc(line_end - line_start + 1);
size_t bidi_size = line_end - line_start;
char * bidi_txt = lv_malloc(bidi_size + 1);
LV_ASSERT_MALLOC(bidi_txt);
lv_bidi_process_paragraph(dsc->text + line_start, bidi_txt, line_end - line_start, base_dir, NULL, 0);
/**
* has_bided = 1: already executed lv_bidi_process_paragraph.
* has_bided = 0: has not been executed lv_bidi_process_paragraph.*/
if(dsc->has_bided) {
lv_memcpy(bidi_txt, &dsc->text[line_start], bidi_size);
}
else {
lv_bidi_process_paragraph(dsc->text + line_start, bidi_txt, bidi_size, base_dir, NULL, 0);
}
#else
const char * bidi_txt = dsc->text + line_start;
#endif
while(i < line_end - line_start) {
while(next_char_offset < remaining_len && next_char_offset < line_end - line_start) {
uint32_t logical_char_pos = 0;
if(sel_start != 0xFFFF && sel_end != 0xFFFF) {
/* Check if the text selection is enabled */
if(sel_start != LV_DRAW_LABEL_NO_TXT_SEL && sel_end != LV_DRAW_LABEL_NO_TXT_SEL) {
#if LV_USE_BIDI
logical_char_pos = lv_text_encoded_get_char_id(dsc->text, line_start);
uint32_t t = lv_text_encoded_get_char_id(bidi_txt, i);
logical_char_pos += lv_bidi_get_logical_pos(bidi_txt, NULL, line_end - line_start, base_dir, t, NULL);
if(dsc->has_bided) {
logical_char_pos = lv_text_encoded_get_char_id(dsc->text, line_start + next_char_offset);
}
else {
logical_char_pos = lv_text_encoded_get_char_id(dsc->text, line_start);
uint32_t c_idx = lv_text_encoded_get_char_id(bidi_txt, next_char_offset);
logical_char_pos += lv_bidi_get_logical_pos(bidi_txt, NULL, line_end - line_start, base_dir, c_idx, NULL);
}
#else
logical_char_pos = lv_text_encoded_get_char_id(dsc->text, line_start + i);
logical_char_pos = lv_text_encoded_get_char_id(dsc->text, line_start + next_char_offset);
#endif
}
uint32_t letter;
uint32_t letter_next;
lv_text_encoded_letter_next_2(bidi_txt, &letter, &letter_next, &i);
lv_text_encoded_letter_next_2(bidi_txt, &letter, &letter_next, &next_char_offset);
/* If recolor is enabled */
if((dsc->flag & LV_TEXT_FLAG_RECOLOR) != 0) {
if(letter == (uint32_t)LV_TXT_COLOR_CMD[0]) {
/* Handle the recolor command marker depending of the current recolor state */
if(recolor_cmd_state == RECOLOR_CMD_STATE_WAIT_FOR_PARAMETER) {
recolor_command_start_index = next_char_offset;
recolor_cmd_state = RECOLOR_CMD_STATE_PARAMETER;
continue;
}
/*Other start char in parameter escaped cmd. char*/
else if(recolor_cmd_state == RECOLOR_CMD_STATE_PARAMETER) {
recolor_cmd_state = RECOLOR_CMD_STATE_WAIT_FOR_PARAMETER;
}
/* If letter is LV_TXT_COLOR_CMD and we were in the CMD_STATE_IN then the recolor close marked has been found */
else if(recolor_cmd_state == RECOLOR_CMD_STATE_TEXT_INPUT) {
recolor_cmd_state = RECOLOR_CMD_STATE_WAIT_FOR_PARAMETER;
continue;
}
}
/* Find the first space (aka ' ') after the recolor command parameter, we need to skip rendering it */
if((recolor_cmd_state == RECOLOR_CMD_STATE_PARAMETER) && (letter == ' ') && (is_first_space_after_cmd == 0)) {
is_first_space_after_cmd = 1;
}
else {
is_first_space_after_cmd = 0;
}
/* Skip the color parameter and wait the space after it
* Once we have reach the space ' ', then we will extract the color information
* and store it into the recolor variable */
if(recolor_cmd_state == RECOLOR_CMD_STATE_PARAMETER) {
/* Not an space? Continue with the next character */
if(letter != ' ') {
continue;
}
/*Get the recolor parameter*/
if((next_char_offset - recolor_command_start_index) == LABEL_RECOLOR_PAR_LENGTH + 1) {
/* Temporary buffer to hold the recolor information */
char buf[LABEL_RECOLOR_PAR_LENGTH + 1];
lv_memcpy(buf, &bidi_txt[recolor_command_start_index], LABEL_RECOLOR_PAR_LENGTH);
buf[LABEL_RECOLOR_PAR_LENGTH] = '\0';
uint8_t r, g, b;
r = (hex_char_to_num(buf[0]) << 4) + hex_char_to_num(buf[1]);
g = (hex_char_to_num(buf[2]) << 4) + hex_char_to_num(buf[3]);
b = (hex_char_to_num(buf[4]) << 4) + hex_char_to_num(buf[5]);
recolor = lv_color_make(r, g, b);
}
else {
recolor.red = dsc->color.red;
recolor.blue = dsc->color.blue;
recolor.green = dsc->color.green;
}
/*After the parameter the text is in the command*/
recolor_cmd_state = RECOLOR_CMD_STATE_TEXT_INPUT;
}
/* Don't draw the first space after the recolor command */
if(is_first_space_after_cmd) {
continue;
}
}
/* If we're in the CMD_STATE_IN state then we need to subtract the recolor command length */
if(((dsc->flag & LV_TEXT_FLAG_RECOLOR) != 0) && (recolor_cmd_state == RECOLOR_CMD_STATE_TEXT_INPUT)) {
logical_char_pos -= (LABEL_RECOLOR_PAR_LENGTH + 1);
}
letter_w = lv_font_get_glyph_width(font, letter, letter_next);
@ -301,7 +463,7 @@ void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_
bg_coords.x2 = pos.x + letter_w - 1;
bg_coords.y2 = pos.y + line_height - 1;
if(i >= line_end - line_start) {
if(next_char_offset >= line_end - line_start) {
if(dsc->decor & LV_TEXT_DECOR_UNDERLINE) {
lv_area_t fill_area;
fill_area.x1 = line_start_x;
@ -310,7 +472,7 @@ void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_
fill_area.y2 = fill_area.y1 + underline_width - 1;
fill_dsc.color = dsc->color;
cb(draw_unit, NULL, &fill_dsc, &fill_area);
cb(t, NULL, &fill_dsc, &fill_area);
}
if(dsc->decor & LV_TEXT_DECOR_STRIKETHROUGH) {
lv_area_t fill_area;
@ -320,20 +482,25 @@ void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_
fill_area.y2 = fill_area.y1 + underline_width - 1;
fill_dsc.color = dsc->color;
cb(draw_unit, NULL, &fill_dsc, &fill_area);
cb(t, NULL, &fill_dsc, &fill_area);
}
}
if(sel_start != 0xFFFF && sel_end != 0xFFFF && logical_char_pos >= sel_start && logical_char_pos < sel_end) {
/* Handle text selection */
if(sel_start != LV_DRAW_LABEL_NO_TXT_SEL && sel_end != LV_DRAW_LABEL_NO_TXT_SEL
&& logical_char_pos >= sel_start && logical_char_pos < sel_end) {
draw_letter_dsc.color = dsc->sel_color;
fill_dsc.color = dsc->sel_bg_color;
cb(draw_unit, NULL, &fill_dsc, &bg_coords);
cb(t, NULL, &fill_dsc, &bg_coords);
}
else if(recolor_cmd_state == RECOLOR_CMD_STATE_TEXT_INPUT) {
draw_letter_dsc.color = recolor;
}
else {
draw_letter_dsc.color = dsc->color;
}
draw_letter(draw_unit, &draw_letter_dsc, &pos, font, letter, cb);
lv_draw_unit_draw_letter(t, &draw_letter_dsc, &pos, font, letter, cb);
if(letter_w > 0) {
pos.x += letter_w + dsc->letter_space;
@ -345,28 +512,31 @@ void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_
bidi_txt = NULL;
#endif
/*Go to next line*/
remaining_len -= line_end - line_start;
line_start = line_end;
line_end += lv_text_get_next_line(&dsc->text[line_start], font, dsc->letter_space, w, NULL, dsc->flag);
if(remaining_len) {
line_end += lv_text_get_next_line(&dsc->text[line_start], remaining_len, font, dsc->letter_space, w, NULL, dsc->flag);
}
pos.x = coords->x1;
/*Align to middle*/
if(align == LV_TEXT_ALIGN_CENTER) {
line_width =
lv_text_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space);
lv_text_get_width_with_flags(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag);
pos.x += (lv_area_get_width(coords) - line_width) / 2;
}
/*Align to the right*/
else if(align == LV_TEXT_ALIGN_RIGHT) {
line_width =
lv_text_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space);
lv_text_get_width_with_flags(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag);
pos.x += lv_area_get_width(coords) - line_width;
}
/*Go the next line position*/
pos.y += line_height;
if(pos.y > draw_unit->clip_area->y2) break;
if(pos.y > t->clip_area.y2) break;
}
if(draw_letter_dsc._draw_buf) lv_draw_buf_destroy(draw_letter_dsc._draw_buf);
@ -378,15 +548,27 @@ void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_
* STATIC FUNCTIONS
**********************/
static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc, const lv_point_t * pos,
const lv_font_t * font, uint32_t letter, lv_draw_glyph_cb_t cb)
/**
* Convert a hexadecimal characters to a number (0..15)
* @param hex Pointer to a hexadecimal character (0..9, A..F)
* @return the numerical value of `hex` or 0 on error
*/
static uint8_t hex_char_to_num(char hex)
{
if(hex >= '0' && hex <= '9') return hex - '0';
if(hex >= 'a') hex -= 'a' - 'A'; /*Convert to upper case*/
return 'A' <= hex && hex <= 'F' ? hex - 'A' + 10 : 0;
}
void lv_draw_unit_draw_letter(lv_draw_task_t * t, lv_draw_glyph_dsc_t * dsc, const lv_point_t * pos,
const lv_font_t * font, uint32_t letter, lv_draw_glyph_cb_t cb)
{
lv_font_glyph_dsc_t g;
if(lv_text_is_marker(letter)) /*Markers are valid letters but should not be rendered.*/
return;
LV_PROFILER_BEGIN;
LV_PROFILER_DRAW_BEGIN;
bool g_ret = lv_font_get_glyph_dsc(font, &g, letter, '\0');
if(g_ret == false) {
/*Add warning if the dsc is not found*/
@ -395,7 +577,7 @@ static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc,
/*Don't draw anything if the character is empty. E.g. space*/
if((g.box_h == 0) || (g.box_w == 0)) {
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
return;
}
@ -404,11 +586,13 @@ static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc,
letter_coords.x2 = letter_coords.x1 + g.box_w - 1;
letter_coords.y1 = pos->y + (font->line_height - font->base_line) - g.box_h - g.ofs_y;
letter_coords.y2 = letter_coords.y1 + g.box_h - 1;
lv_area_move(&letter_coords, -dsc->pivot.x, -dsc->pivot.y);
/*If the letter is completely out of mask don't draw it*/
if(lv_area_is_out(&letter_coords, draw_unit->clip_area, 0) &&
lv_area_is_out(dsc->bg_coords, draw_unit->clip_area, 0)) {
LV_PROFILER_END;
if(lv_area_is_out(&letter_coords, &t->clip_area, 0) &&
dsc->bg_coords &&
lv_area_is_out(dsc->bg_coords, &t->clip_area, 0)) {
LV_PROFILER_DRAW_END;
return;
}
@ -420,8 +604,7 @@ static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc,
if(draw_buf == NULL) {
if(dsc->_draw_buf) lv_draw_buf_destroy(dsc->_draw_buf);
uint32_t h = g.box_h;
if(h * g.box_w < 64) h *= 2; /*Alloc a slightly larger buffer*/
uint32_t h = LV_ROUND_UP(g.box_h, 32); /*Assume a larger size to avoid many reallocations*/
draw_buf = lv_draw_buf_create_ex(font_draw_buf_handlers, g.box_w, h, LV_COLOR_FORMAT_A8, LV_STRIDE_AUTO);
LV_ASSERT_MALLOC(draw_buf);
draw_buf->header.h = g.box_h;
@ -429,8 +612,15 @@ static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc,
}
}
dsc->glyph_data = (void *) lv_font_get_glyph_bitmap(&g, draw_buf);
dsc->format = dsc->glyph_data ? g.format : LV_FONT_GLYPH_FORMAT_NONE;
dsc->format = g.format;
if(g.format == LV_FONT_GLYPH_FORMAT_VECTOR) {
/*Load the outline of the glyph, even if the function says bitmap*/
g.outline_stroke_width = dsc->outline_stroke_width;
dsc->glyph_data = (void *) lv_font_get_glyph_bitmap(&g, draw_buf);
dsc->format = dsc->glyph_data ? g.format : LV_FONT_GLYPH_FORMAT_NONE;
}
}
else {
dsc->format = LV_FONT_GLYPH_FORMAT_NONE;
@ -438,9 +628,9 @@ static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc,
dsc->letter_coords = &letter_coords;
dsc->g = &g;
cb(draw_unit, dsc, NULL, NULL);
cb(t, dsc, NULL, NULL);
lv_font_glyph_release_draw_data(&g);
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
}

View File

@ -32,34 +32,114 @@ extern "C" {
typedef struct {
lv_draw_dsc_base_t base;
/**The text to draw*/
const char * text;
/**The size of the text*/
lv_point_t text_size;
/**The font to use. Fallback fonts are also handled.*/
const lv_font_t * font;
uint32_t sel_start;
uint32_t sel_end;
/**Color of the text*/
lv_color_t color;
lv_color_t sel_color;
lv_color_t sel_bg_color;
/**Extra space between the lines*/
int32_t line_space;
/**Extra space between the characters*/
int32_t letter_space;
/**Offset the text with this value horizontally*/
int32_t ofs_x;
/**Offset the text with this value vertically*/
int32_t ofs_y;
/**Rotation of the letters in 0.1 degree unit*/
int32_t rotation;
/**The first characters index for selection (not byte index). `LV_DRAW_LABEL_NO_TXT_SEL` for no selection*/
uint32_t sel_start;
/**The last characters's index for selection (not byte index). `LV_DRAW_LABEL_NO_TXT_SEL` for no selection*/
uint32_t sel_end;
/**Color of the selected characters*/
lv_color_t sel_color;
/**Background color of the selected characters*/
lv_color_t sel_bg_color;
/**The number of characters to render. 0: means render until reaching the `\0` termination.*/
uint32_t text_length;
/**Opacity of the text in 0...255 range.
* LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/
lv_opa_t opa;
lv_base_dir_t bidi_dir;
/**The alignment of the text `LV_TEXT_ALIGN_LEFT/RIGHT/CENTER`*/
lv_text_align_t align;
lv_text_flag_t flag;
/**The base direction. Used when type setting Right-to-left (e.g. Arabic) texts*/
lv_base_dir_t bidi_dir;
/**Text decoration, e.g. underline*/
lv_text_decor_t decor : 3;
/**Some flags to control type setting*/
lv_text_flag_t flag : 5;
/**1: malloc a buffer and copy `text` there.
* 0: `text` will be valid during rendering.*/
uint8_t text_local : 1;
/**Indicate that the text is constant and its pointer can be safely saved e.g. in a cache.*/
uint8_t text_static : 1;
/**1: already executed lv_bidi_process_paragraph.
* 0: has not been executed lv_bidi_process_paragraph.*/
uint8_t has_bided : 1;
/**Pointer to an externally stored struct where some data can be cached to speed up rendering*/
lv_draw_label_hint_t * hint;
/* Properties of the letter outlines */
lv_opa_t outline_stroke_opa;
lv_color_t outline_stroke_color;
int32_t outline_stroke_width;
} lv_draw_label_dsc_t;
typedef struct {
lv_draw_dsc_base_t base;
uint32_t unicode;
const lv_font_t * font;
lv_color_t color;
int32_t rotation;
int32_t scale_x;
int32_t scale_y;
int32_t skew_x;
int32_t skew_y;
lv_point_t pivot;
lv_opa_t opa;
lv_text_decor_t decor : 3;
lv_blend_mode_t blend_mode : 3;
/**
* < 1: malloc buffer and copy `text` there.
* 0: `text` is const and it's pointer will be valid during rendering.*/
uint8_t text_local : 1;
lv_draw_label_hint_t * hint;
} lv_draw_label_dsc_t;
/* Properties of the letter outlines */
lv_opa_t outline_stroke_opa;
int32_t outline_stroke_width;
lv_color_t outline_stroke_color;
} lv_draw_letter_dsc_t;
/**
* Passed as a parameter to `lv_draw_label_iterate_characters` to
* draw the characters one by one
* @param draw_unit pointer to a draw unit
* @param t pointer to a draw task
* @param dsc pointer to `lv_draw_glyph_dsc_t` to describe the character to draw
* if NULL don't draw character
* @param fill_dsc pointer to a fill descriptor to draw a background for the character or
@ -68,13 +148,15 @@ typedef struct {
* @param fill_area the area to fill
* if NULL do not fill anything
*/
typedef void(*lv_draw_glyph_cb_t)(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc, lv_draw_fill_dsc_t * fill_dsc,
typedef void(*lv_draw_glyph_cb_t)(lv_draw_task_t * t, lv_draw_glyph_dsc_t * dsc, lv_draw_fill_dsc_t * fill_dsc,
const lv_area_t * fill_area);
/**********************
* GLOBAL PROTOTYPES
**********************/
void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_letter_dsc_init(lv_draw_letter_dsc_t * dsc);
/**
* Initialize a label draw descriptor
* @param dsc pointer to a draw descriptor
@ -96,7 +178,7 @@ lv_draw_label_dsc_t * lv_draw_task_get_label_dsc(lv_draw_task_t * task);
void lv_draw_glyph_dsc_init(lv_draw_glyph_dsc_t * dsc);
/**
* Crate a draw task to render a text
* Create a draw task to render a text
* @param layer pointer to a layer
* @param dsc pointer to draw descriptor
* @param coords coordinates of the character
@ -105,7 +187,7 @@ void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_label(lv_layer_t * layer, const lv_draw
const lv_area_t * coords);
/**
* Crate a draw task to render a single character
* Create a draw task to render a single character
* @param layer pointer to a layer
* @param dsc pointer to draw descriptor
* @param point position of the label
@ -114,17 +196,45 @@ void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_label(lv_layer_t * layer, const lv_draw
void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_character(lv_layer_t * layer, lv_draw_label_dsc_t * dsc,
const lv_point_t * point, uint32_t unicode_letter);
/**
* Draw a single letter
* @param layer pointer to a layer
* @param dsc pointer to draw descriptor
* @param point position of the label
*/
void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_letter(lv_layer_t * layer, lv_draw_letter_dsc_t * dsc,
const lv_point_t * point);
/**
* Should be used during rendering the characters to get the position and other
* parameters of the characters
* @param draw_unit pointer to a draw unit
* @param t pointer to a draw task
* @param dsc pointer to draw descriptor
* @param coords coordinates of the label
* @param cb a callback to call to draw each glyphs one by one
*/
void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc,
void lv_draw_label_iterate_characters(lv_draw_task_t * t, const lv_draw_label_dsc_t * dsc,
const lv_area_t * coords, lv_draw_glyph_cb_t cb);
/**
* @brief Draw a single letter using the provided draw unit, glyph descriptor, position, font, and callback.
*
* This function is responsible for rendering a single character from a text string,
* applying the necessary styling described by the glyph descriptor (`dsc`). It handles
* the retrieval of the glyph's description, checks its visibility within the clipping area,
* and invokes the callback (`cb`) to render the glyph at the specified position (`pos`)
* using the given font (`font`).
*
* @param t Pointer to the drawing task.
* @param dsc Pointer to the descriptor containing styling for the glyph to be drawn.
* @param pos Pointer to the point coordinates where the letter should be drawn.
* @param font Pointer to the font containing the glyph.
* @param letter The Unicode code point of the letter to be drawn.
* @param cb Callback function to execute the actual rendering of the glyph.
*/
void lv_draw_unit_draw_letter(lv_draw_task_t * t, lv_draw_glyph_dsc_t * dsc, const lv_point_t * pos,
const lv_font_t * font, uint32_t letter, lv_draw_glyph_cb_t cb);
/***********************
* GLOBAL VARIABLES
***********************/

View File

@ -29,7 +29,7 @@ extern "C" {
* all the previous characters needs to be checked to calculate the positions.
* This structure stores an earlier (e.g. at -1000 px) coordinate and the index of that line.
* Therefore the calculations can start from here.*/
struct lv_draw_label_hint_t {
struct _lv_draw_label_hint_t {
/** Index of the line at `y` coordinate*/
int32_t line_start;
@ -41,14 +41,20 @@ struct lv_draw_label_hint_t {
int32_t coord_y;
};
struct lv_draw_glyph_dsc_t {
void * glyph_data; /**< Depends on `format` field, it could be image source or draw buf of bitmap or vector data. */
struct _lv_draw_glyph_dsc_t {
/** Depends on `format` field, it could be image source or draw buf of bitmap or vector data. */
const void * glyph_data;
lv_font_glyph_format_t format;
const lv_area_t * letter_coords;
const lv_area_t * bg_coords;
const lv_font_glyph_dsc_t * g;
lv_font_glyph_dsc_t * g;
lv_color_t color;
lv_opa_t opa;
lv_color_t outline_stroke_color;
lv_opa_t outline_stroke_opa;
int32_t outline_stroke_width;
int32_t rotation;
lv_point_t pivot; /**< Rotation pivot point associated with total glyph including line_height */
lv_draw_buf_t * _draw_buf; /**< a shared draw buf for get_bitmap, do not use it directly, use glyph_data instead */
};

View File

@ -55,21 +55,20 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_line(lv_layer_t * layer, const lv_draw_line_d
if(dsc->width == 0) return;
if(dsc->opa <= LV_OPA_MIN) return;
LV_PROFILER_BEGIN;
LV_PROFILER_DRAW_BEGIN;
lv_area_t a;
a.x1 = (int32_t)LV_MIN(dsc->p1.x, dsc->p2.x) - dsc->width;
a.x2 = (int32_t)LV_MAX(dsc->p1.x, dsc->p2.x) + dsc->width;
a.y1 = (int32_t)LV_MIN(dsc->p1.y, dsc->p2.y) - dsc->width;
a.y2 = (int32_t)LV_MAX(dsc->p1.y, dsc->p2.y) + dsc->width;
lv_draw_task_t * t = lv_draw_add_task(layer, &a);
lv_draw_task_t * t = lv_draw_add_task(layer, &a, LV_DRAW_TASK_TYPE_LINE);
t->draw_dsc = lv_malloc(sizeof(*dsc));
lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc));
t->type = LV_DRAW_TASK_TYPE_LINE;
lv_draw_finalize_task_creation(layer, t);
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
}
/**********************

View File

@ -28,17 +28,36 @@ extern "C" {
typedef struct {
lv_draw_dsc_base_t base;
/**The first point of the line. If `LV_USE_FLOAT` is enabled float number can be also used*/
lv_point_precise_t p1;
/**The second point of the line. If `LV_USE_FLOAT` is enabled float number can be also used*/
lv_point_precise_t p2;
/**The color of the line*/
lv_color_t color;
/**The width (thickness) of the line*/
int32_t width;
/** The length of a dash (0: don't dash)*/
int32_t dash_width;
/** The length of the gaps between dashes (0: don't dash)*/
int32_t dash_gap;
/**Opacity of the line in 0...255 range.
* LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/
lv_opa_t opa;
lv_blend_mode_t blend_mode : 2;
/**Make the line start rounded*/
uint8_t round_start : 1;
/**Make the line end rounded*/
uint8_t round_end : 1;
uint8_t raw_end : 1; /**< Do not bother with perpendicular line ending if it's not visible for any reason */
/**1: Do not bother with line ending (if it's not visible for any reason) */
uint8_t raw_end : 1;
} lv_draw_line_dsc_t;
/**********************

View File

@ -53,13 +53,11 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_mask_rect(lv_layer_t * layer, const lv_draw_m
LV_LOG_WARN("Only layers with alpha channel can be masked");
return;
}
LV_PROFILER_BEGIN;
LV_PROFILER_DRAW_BEGIN;
lv_draw_task_t * t = lv_draw_add_task(layer, &layer->buf_area);
lv_draw_task_t * t = lv_draw_add_task(layer, &layer->buf_area, LV_DRAW_TASK_TYPE_MASK_RECTANGLE);
t->draw_dsc = lv_malloc(sizeof(*dsc));
lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc));
t->type = LV_DRAW_TASK_TYPE_MASK_RECTANGLE;
lv_draw_dsc_base_t * base_dsc = t->draw_dsc;
base_dsc->layer = layer;
@ -73,7 +71,7 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_mask_rect(lv_layer_t * layer, const lv_draw_m
}
lv_draw_finalize_task_creation(layer, t);
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
}
/**********************

View File

@ -28,11 +28,18 @@ extern "C" {
/**********************
* TYPEDEFS
**********************/
struct lv_draw_mask_rect_dsc_t {
struct _lv_draw_mask_rect_dsc_t {
lv_draw_dsc_base_t base;
/**The area t mask.*/
lv_area_t area;
/**The radius of masking*/
int32_t radius;
/**0: clear the content out of the `area`.
* 1: don't touch the area out of `area`*/
uint32_t keep_outside : 1;
};

View File

@ -19,6 +19,8 @@ extern "C" {
*********************/
#include "lv_draw.h"
#include "../osal/lv_os.h"
#include "../misc/cache/lv_cache.h"
/*********************
* DEFINES
@ -28,7 +30,7 @@ extern "C" {
* TYPEDEFS
**********************/
struct lv_draw_task_t {
struct _lv_draw_task_t {
lv_draw_task_t * next;
lv_draw_task_type_t type;
@ -52,12 +54,16 @@ struct lv_draw_task_t {
* Therefore during drawing the layer's clip area shouldn't be used as it might be already changed for other draw tasks.
*/
lv_area_t clip_area;
lv_layer_t * target_layer;
#if LV_DRAW_TRANSFORM_USE_MATRIX
/** Transform matrix to be applied when rendering the layer */
lv_matrix_t matrix;
#endif
/* Reference to the draw unit for debug or draw context purposes */
lv_draw_unit_t * draw_unit;
volatile int state; /** int instead of lv_draw_task_state_t to be sure its atomic */
void * draw_dsc;
@ -77,19 +83,18 @@ struct lv_draw_task_t {
};
struct lv_draw_mask_t {
struct _lv_draw_mask_t {
void * user_data;
};
struct lv_draw_unit_t {
struct _lv_draw_unit_t {
lv_draw_unit_t * next;
/**
* The target_layer on which drawing should happen
* Name and ID of the draw unit, for debugging purposes only.
*/
lv_layer_t * target_layer;
const lv_area_t * clip_area;
const char * name;
int32_t idx;
/**
* Called to try to assign a draw task to itself.
@ -171,11 +176,11 @@ struct lv_draw_unit_t {
typedef struct {
lv_draw_unit_t * unit_head;
uint32_t unit_cnt;
uint32_t used_memory_for_layers_kb;
uint32_t used_memory_for_layers; /* measured as bytes */
#if LV_USE_OS
lv_thread_sync_t sync;
#else
int dispatch_req;
volatile int dispatch_req;
#endif
lv_mutex_t circle_cache_mutex;
bool task_running;

View File

@ -68,6 +68,19 @@ lv_draw_fill_dsc_t * lv_draw_task_get_fill_dsc(lv_draw_task_t * task)
return task->type == LV_DRAW_TASK_TYPE_FILL ? (lv_draw_fill_dsc_t *)task->draw_dsc : NULL;
}
void lv_draw_fill(lv_layer_t * layer, const lv_draw_fill_dsc_t * dsc, const lv_area_t * coords)
{
if(dsc->opa <= LV_OPA_MIN) return;
LV_PROFILER_DRAW_BEGIN;
lv_draw_task_t * t = lv_draw_add_task(layer, coords, LV_DRAW_TASK_TYPE_FILL);
lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc));
lv_draw_finalize_task_creation(layer, t);
LV_PROFILER_DRAW_END;
}
void lv_draw_border_dsc_init(lv_draw_border_dsc_t * dsc)
{
lv_memzero(dsc, sizeof(*dsc));
@ -81,6 +94,19 @@ lv_draw_border_dsc_t * lv_draw_task_get_border_dsc(lv_draw_task_t * task)
return task->type == LV_DRAW_TASK_TYPE_BORDER ? (lv_draw_border_dsc_t *)task->draw_dsc : NULL;
}
void lv_draw_border(lv_layer_t * layer, const lv_draw_border_dsc_t * dsc, const lv_area_t * coords)
{
if(dsc->opa <= LV_OPA_MIN) return;
LV_PROFILER_DRAW_BEGIN;
lv_draw_task_t * t = lv_draw_add_task(layer, coords, LV_DRAW_TASK_TYPE_BORDER);
lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc));
lv_draw_finalize_task_creation(layer, t);
LV_PROFILER_DRAW_END;
}
void lv_draw_box_shadow_dsc_init(lv_draw_box_shadow_dsc_t * dsc)
{
lv_memzero(dsc, sizeof(*dsc));
@ -93,10 +119,23 @@ lv_draw_box_shadow_dsc_t * lv_draw_task_get_box_shadow_dsc(lv_draw_task_t * task
return task->type == LV_DRAW_TASK_TYPE_BOX_SHADOW ? (lv_draw_box_shadow_dsc_t *)task->draw_dsc : NULL;
}
void lv_draw_box_shadow(lv_layer_t * layer, const lv_draw_box_shadow_dsc_t * dsc, const lv_area_t * coords)
{
if(dsc->opa <= LV_OPA_MIN) return;
LV_PROFILER_DRAW_BEGIN;
lv_draw_task_t * t = lv_draw_add_task(layer, coords, LV_DRAW_TASK_TYPE_BOX_SHADOW);
lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc));
lv_draw_finalize_task_creation(layer, t);
LV_PROFILER_DRAW_END;
}
void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords)
{
LV_PROFILER_BEGIN;
LV_PROFILER_DRAW_BEGIN;
bool has_shadow;
bool has_fill;
bool has_border;
@ -145,9 +184,9 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
/*Shadow*/
if(has_shadow) {
/*Check whether the shadow is visible*/
t = lv_draw_add_task(layer, coords);
lv_draw_box_shadow_dsc_t * shadow_dsc = lv_malloc(sizeof(lv_draw_box_shadow_dsc_t));
t->draw_dsc = shadow_dsc;
t = lv_draw_add_task(layer, coords, LV_DRAW_TASK_TYPE_BOX_SHADOW);
lv_draw_box_shadow_dsc_t * shadow_dsc = t->draw_dsc;
lv_area_increase(&t->_real_area, dsc->shadow_spread, dsc->shadow_spread);
lv_area_increase(&t->_real_area, dsc->shadow_width, dsc->shadow_width);
lv_area_move(&t->_real_area, dsc->shadow_offset_x, dsc->shadow_offset_y);
@ -161,7 +200,6 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
shadow_dsc->ofs_x = dsc->shadow_offset_x;
shadow_dsc->ofs_y = dsc->shadow_offset_y;
shadow_dsc->bg_cover = bg_cover;
t->type = LV_DRAW_TASK_TYPE_BOX_SHADOW;
lv_draw_finalize_task_creation(layer, t);
}
@ -176,17 +214,16 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
bg_coords.y2 -= (dsc->border_side & LV_BORDER_SIDE_BOTTOM) ? 1 : 0;
}
t = lv_draw_add_task(layer, &bg_coords);
lv_draw_fill_dsc_t * bg_dsc = lv_malloc(sizeof(lv_draw_fill_dsc_t));
t = lv_draw_add_task(layer, &bg_coords, LV_DRAW_TASK_TYPE_FILL);
lv_draw_fill_dsc_t * bg_dsc = t->draw_dsc;
lv_draw_fill_dsc_init(bg_dsc);
t->draw_dsc = bg_dsc;
bg_dsc->base = dsc->base;
bg_dsc->base.dsc_size = sizeof(lv_draw_fill_dsc_t);
bg_dsc->radius = dsc->radius;
bg_dsc->color = dsc->bg_color;
bg_dsc->grad = dsc->bg_grad;
bg_dsc->opa = dsc->bg_opa;
t->type = LV_DRAW_TASK_TYPE_FILL;
lv_draw_finalize_task_creation(layer, t);
}
@ -199,28 +236,29 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
if(src_type == LV_IMAGE_SRC_VARIABLE || src_type == LV_IMAGE_SRC_FILE) {
res = lv_image_decoder_get_info(dsc->bg_image_src, &header);
}
else if(src_type == LV_IMAGE_SRC_UNKNOWN) {
res = LV_RESULT_INVALID;
}
else {
lv_memzero(&header, sizeof(header));
if(src_type == LV_IMAGE_SRC_UNKNOWN) {
res = LV_RESULT_INVALID;
}
}
if(res == LV_RESULT_OK) {
if(src_type == LV_IMAGE_SRC_VARIABLE || src_type == LV_IMAGE_SRC_FILE) {
if(dsc->bg_image_tiled) {
t = lv_draw_add_task(layer, coords);
t = lv_draw_add_task(layer, coords, LV_DRAW_TASK_TYPE_IMAGE);
}
else {
lv_area_t a = {0, 0, header.w - 1, header.h - 1};
lv_area_align(coords, &a, LV_ALIGN_CENTER, 0, 0);
t = lv_draw_add_task(layer, &a);
t = lv_draw_add_task(layer, &a, LV_DRAW_TASK_TYPE_IMAGE);
}
lv_draw_image_dsc_t * bg_image_dsc = lv_malloc(sizeof(lv_draw_image_dsc_t));
lv_draw_image_dsc_t * bg_image_dsc = t->draw_dsc;
lv_draw_image_dsc_init(bg_image_dsc);
t->draw_dsc = bg_image_dsc;
bg_image_dsc->base = dsc->base;
bg_image_dsc->base.dsc_size = sizeof(lv_draw_image_dsc_t);
bg_image_dsc->src = dsc->bg_image_src;
@ -230,7 +268,7 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
bg_image_dsc->tile = dsc->bg_image_tiled;
bg_image_dsc->header = header;
bg_image_dsc->clip_radius = dsc->radius;
t->type = LV_DRAW_TASK_TYPE_IMAGE;
bg_image_dsc->image_area = *coords;
lv_draw_finalize_task_creation(layer, t);
}
else {
@ -239,11 +277,11 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
lv_area_t a = {0, 0, s.x - 1, s.y - 1};
lv_area_align(coords, &a, LV_ALIGN_CENTER, 0, 0);
t = lv_draw_add_task(layer, &a);
t = lv_draw_add_task(layer, &a, LV_DRAW_TASK_TYPE_LABEL);
lv_draw_label_dsc_t * bg_label_dsc = t->draw_dsc;
lv_draw_label_dsc_t * bg_label_dsc = lv_malloc(sizeof(lv_draw_label_dsc_t));
lv_draw_label_dsc_init(bg_label_dsc);
t->draw_dsc = bg_label_dsc;
bg_label_dsc->base = dsc->base;
bg_label_dsc->base.dsc_size = sizeof(lv_draw_label_dsc_t);
bg_label_dsc->color = dsc->bg_image_recolor;
@ -257,9 +295,9 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
/*Border*/
if(has_border) {
t = lv_draw_add_task(layer, coords);
lv_draw_border_dsc_t * border_dsc = lv_malloc(sizeof(lv_draw_border_dsc_t));
t->draw_dsc = border_dsc;
t = lv_draw_add_task(layer, coords, LV_DRAW_TASK_TYPE_BORDER);
lv_draw_border_dsc_t * border_dsc = t->draw_dsc;
border_dsc->base = dsc->base;
border_dsc->base.dsc_size = sizeof(lv_draw_border_dsc_t);
border_dsc->radius = dsc->radius;
@ -267,7 +305,6 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
border_dsc->opa = dsc->border_opa;
border_dsc->width = dsc->border_width;
border_dsc->side = dsc->border_side;
t->type = LV_DRAW_TASK_TYPE_BORDER;
lv_draw_finalize_task_creation(layer, t);
}
@ -275,9 +312,8 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
if(has_outline) {
lv_area_t outline_coords = *coords;
lv_area_increase(&outline_coords, dsc->outline_width + dsc->outline_pad, dsc->outline_width + dsc->outline_pad);
t = lv_draw_add_task(layer, &outline_coords);
lv_draw_border_dsc_t * outline_dsc = lv_malloc(sizeof(lv_draw_border_dsc_t));
t->draw_dsc = outline_dsc;
t = lv_draw_add_task(layer, &outline_coords, LV_DRAW_TASK_TYPE_BORDER);
lv_draw_border_dsc_t * outline_dsc = t->draw_dsc;
lv_area_increase(&t->_real_area, dsc->outline_width, dsc->outline_width);
lv_area_increase(&t->_real_area, dsc->outline_pad, dsc->outline_pad);
outline_dsc->base = dsc->base;
@ -288,13 +324,12 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
outline_dsc->opa = dsc->outline_opa;
outline_dsc->width = dsc->outline_width;
outline_dsc->side = LV_BORDER_SIDE_FULL;
t->type = LV_DRAW_TASK_TYPE_BORDER;
lv_draw_finalize_task_creation(layer, t);
}
LV_ASSERT_MEM_INTEGRITY();
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
}
/**********************

View File

@ -17,7 +17,6 @@ extern "C" {
#include "../misc/lv_color.h"
#include "../misc/lv_area.h"
#include "../misc/lv_style.h"
#include "sw/lv_draw_sw_gradient.h"
/*********************
* DEFINES
@ -72,21 +71,41 @@ typedef struct {
typedef struct {
lv_draw_dsc_base_t base;
/**Radius, LV_RADIUS_CIRCLE for max. radius */
int32_t radius;
/**Opacity in 0...255 range.
* LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/
lv_opa_t opa;
/**The color of the rectangle.
* If the gradient is set (grad.dir!=LV_GRAD_DIR_NONE) it's ignored. */
lv_color_t color;
/**Describe a gradient. If `grad.dir` is not `LV_GRAD_DIR_NONE` `color` will be ignored*/
lv_grad_dsc_t grad;
} lv_draw_fill_dsc_t;
typedef struct {
lv_draw_dsc_base_t base;
/**Radius, LV_RADIUS_CIRCLE for max. radius */
int32_t radius;
/**The color of the border. */
lv_color_t color;
/**The width of the border in pixels */
int32_t width;
/**Opacity in 0...255 range.
* LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/
lv_opa_t opa;
/**LV_BORDER_SIDE_NONE/LEFT/RIGHT/TOP/BOTTOM/FULL.
* LV_BORDER_SIDE_INTERNAL is an information for upper layers
* and shouldn't be used here. */
lv_border_side_t side : 5;
} lv_draw_border_dsc_t;
@ -94,14 +113,30 @@ typedef struct {
typedef struct {
lv_draw_dsc_base_t base;
/**Radius, LV_RADIUS_CIRCLE for max. radius */
int32_t radius;
/**Color of the the shadow */
lv_color_t color;
/**Width of the shadow. (radius of the blur)*/
int32_t width;
/**Make the rectangle larger with this value in all directions. Can be negative too. */
int32_t spread;
/**Offset the rectangle horizontally.*/
int32_t ofs_x;
/**Offset the rectangle vertically.*/
int32_t ofs_y;
/**Opacity in 0...255 range.
* LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/
lv_opa_t opa;
/**Set `bg_cover` to 1 if the background will cover the shadow.
* It's a hint to the renderer about it might skip some masking.*/
uint8_t bg_cover : 1;
} lv_draw_box_shadow_dsc_t;
@ -128,6 +163,14 @@ void lv_draw_fill_dsc_init(lv_draw_fill_dsc_t * dsc);
*/
lv_draw_fill_dsc_t * lv_draw_task_get_fill_dsc(lv_draw_task_t * task);
/**
* Fill an area
* @param layer pointer to a layer
* @param dsc pointer to an initialized draw descriptor variable
* @param coords the coordinates of the rectangle
*/
void lv_draw_fill(lv_layer_t * layer, const lv_draw_fill_dsc_t * dsc, const lv_area_t * coords);
/**
* Initialize a border draw descriptor.
* @param dsc pointer to a draw descriptor
@ -141,6 +184,14 @@ void lv_draw_border_dsc_init(lv_draw_border_dsc_t * dsc);
*/
lv_draw_border_dsc_t * lv_draw_task_get_border_dsc(lv_draw_task_t * task);
/**
* Draw a border
* @param layer pointer to a layer
* @param dsc pointer to an initialized draw descriptor variable
* @param coords the coordinates of the rectangle
*/
void lv_draw_border(lv_layer_t * layer, const lv_draw_border_dsc_t * dsc, const lv_area_t * coords);
/**
* Initialize a box shadow draw descriptor.
* @param dsc pointer to a draw descriptor
@ -154,6 +205,14 @@ void lv_draw_box_shadow_dsc_init(lv_draw_box_shadow_dsc_t * dsc);
*/
lv_draw_box_shadow_dsc_t * lv_draw_task_get_box_shadow_dsc(lv_draw_task_t * task);
/**
* Draw a box shadow
* @param layer pointer to a layer
* @param dsc pointer to an initialized draw descriptor variable
* @param coords the coordinates of the rectangle
*/
void lv_draw_box_shadow(lv_layer_t * layer, const lv_draw_box_shadow_dsc_t * dsc, const lv_area_t * coords);
/**
* The rectangle is a wrapper for fill, border, bg. image and box shadow.
* Internally fill, border, image and box shadow draw tasks will be created.

View File

@ -40,16 +40,16 @@
void lv_draw_triangle_dsc_init(lv_draw_triangle_dsc_t * dsc)
{
LV_PROFILER_BEGIN;
LV_PROFILER_DRAW_BEGIN;
lv_memzero(dsc, sizeof(lv_draw_triangle_dsc_t));
dsc->bg_color = lv_color_white();
dsc->bg_grad.stops[0].color = lv_color_white();
dsc->bg_grad.stops[1].color = lv_color_black();
dsc->bg_grad.stops[1].frac = 0xFF;
dsc->bg_grad.stops_count = 2;
dsc->bg_opa = LV_OPA_COVER;
dsc->color = lv_color_white();
dsc->grad.stops[0].color = lv_color_white();
dsc->grad.stops[1].color = lv_color_black();
dsc->grad.stops[1].frac = 0xFF;
dsc->grad.stops_count = 2;
dsc->opa = LV_OPA_COVER;
dsc->base.dsc_size = sizeof(lv_draw_triangle_dsc_t);
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
}
lv_draw_triangle_dsc_t * lv_draw_task_get_triangle_dsc(lv_draw_task_t * task)
@ -59,23 +59,22 @@ lv_draw_triangle_dsc_t * lv_draw_task_get_triangle_dsc(lv_draw_task_t * task)
void lv_draw_triangle(lv_layer_t * layer, const lv_draw_triangle_dsc_t * dsc)
{
if(dsc->bg_opa <= LV_OPA_MIN) return;
if(dsc->opa <= LV_OPA_MIN) return;
LV_PROFILER_DRAW_BEGIN;
LV_PROFILER_BEGIN;
lv_area_t a;
a.x1 = (int32_t)LV_MIN3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x);
a.y1 = (int32_t)LV_MIN3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y);
a.x2 = (int32_t)LV_MAX3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x);
a.y2 = (int32_t)LV_MAX3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y);
lv_draw_task_t * t = lv_draw_add_task(layer, &a);
lv_draw_task_t * t = lv_draw_add_task(layer, &a, LV_DRAW_TASK_TYPE_TRIANGLE);
t->draw_dsc = lv_malloc(sizeof(*dsc));
lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc));
t->type = LV_DRAW_TASK_TYPE_TRIANGLE;
lv_draw_finalize_task_creation(layer, t);
LV_PROFILER_END;
LV_PROFILER_DRAW_END;
}
/**********************

View File

@ -25,11 +25,19 @@ extern "C" {
typedef struct {
lv_draw_dsc_base_t base;
lv_opa_t bg_opa;
lv_color_t bg_color;
lv_grad_dsc_t bg_grad;
/**Points of the triangle. If `LV_USE_FLOAT` is enabled floats can be used here*/
lv_point_precise_t p[3];
/**Color of the triangle*/
lv_color_t color;
/**Opacity of the arc in 0...255 range.
* LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/
lv_opa_t opa;
/**Describe a gradient. If `grad.dir` is not `LV_GRAD_DIR_NONE` `color` will be ignored*/
lv_grad_dsc_t grad;
} lv_draw_triangle_dsc_t;
/**********************

View File

@ -228,10 +228,10 @@ void lv_vector_path_get_bounding(const lv_vector_path_t * path, lv_area_t * area
if(p[i].y > y2) y2 = p[i].y;
}
area->x1 = (int32_t)x1;
area->y1 = (int32_t)y1;
area->x2 = (int32_t)x2;
area->y2 = (int32_t)y2;
area->x1 = lroundf(x1);
area->y1 = lroundf(y1);
area->x2 = lroundf(x2);
area->y2 = lroundf(y2);
}
void lv_vector_path_append_rect(lv_vector_path_t * path, const lv_area_t * rect, float rx, float ry)
@ -412,6 +412,11 @@ void lv_vector_path_append_arc(lv_vector_path_t * path, const lv_fpoint_t * c, f
start.x + cx, start.y + cy
});
}
else {
lv_vector_path_move_to(path, &(lv_fpoint_t) {
start.x + cx, start.y + cy
});
}
for(int i = 0; i < n_curves; ++i) {
float end_angle = start_angle + ((i != n_curves - 1) ? MATH_HALF_PI * sweep_sign : fract);
@ -541,6 +546,11 @@ void lv_vector_dsc_set_fill_rule(lv_vector_dsc_t * dsc, lv_vector_fill_t rule)
dsc->current_dsc.fill_dsc.fill_rule = rule;
}
void lv_vector_dsc_set_fill_units(lv_vector_dsc_t * dsc, const lv_vector_fill_units_t units)
{
dsc->current_dsc.fill_dsc.fill_units = units;
}
void lv_vector_dsc_set_fill_image(lv_vector_dsc_t * dsc, const lv_draw_image_dsc_t * img_dsc)
{
dsc->current_dsc.fill_dsc.style = LV_VECTOR_DRAW_STYLE_PATTERN;
@ -571,7 +581,7 @@ void lv_vector_dsc_set_fill_gradient_spread(lv_vector_dsc_t * dsc, lv_vector_gra
dsc->current_dsc.fill_dsc.gradient.spread = spread;
}
void lv_vector_dsc_set_fill_gradient_color_stops(lv_vector_dsc_t * dsc, const lv_gradient_stop_t * stops,
void lv_vector_dsc_set_fill_gradient_color_stops(lv_vector_dsc_t * dsc, const lv_grad_stop_t * stops,
uint16_t count)
{
if(count > LV_GRADIENT_MAX_STOPS) {
@ -579,7 +589,7 @@ void lv_vector_dsc_set_fill_gradient_color_stops(lv_vector_dsc_t * dsc, const lv
count = LV_GRADIENT_MAX_STOPS;
}
lv_memcpy(&(dsc->current_dsc.fill_dsc.gradient.stops), stops, sizeof(lv_gradient_stop_t) * count);
lv_memcpy(&(dsc->current_dsc.fill_dsc.gradient.stops), stops, sizeof(lv_grad_stop_t) * count);
dsc->current_dsc.fill_dsc.gradient.stops_count = count;
}
@ -674,7 +684,7 @@ void lv_vector_dsc_set_stroke_gradient_spread(lv_vector_dsc_t * dsc, lv_vector_g
dsc->current_dsc.stroke_dsc.gradient.spread = spread;
}
void lv_vector_dsc_set_stroke_gradient_color_stops(lv_vector_dsc_t * dsc, const lv_gradient_stop_t * stops,
void lv_vector_dsc_set_stroke_gradient_color_stops(lv_vector_dsc_t * dsc, const lv_grad_stop_t * stops,
uint16_t count)
{
if(count > LV_GRADIENT_MAX_STOPS) {
@ -682,7 +692,7 @@ void lv_vector_dsc_set_stroke_gradient_color_stops(lv_vector_dsc_t * dsc, const
count = LV_GRADIENT_MAX_STOPS;
}
lv_memcpy(&(dsc->current_dsc.stroke_dsc.gradient.stops), stops, sizeof(lv_gradient_stop_t) * count);
lv_memcpy(&(dsc->current_dsc.stroke_dsc.gradient.stops), stops, sizeof(lv_grad_stop_t) * count);
dsc->current_dsc.stroke_dsc.gradient.stops_count = count;
}
@ -722,6 +732,11 @@ void lv_vector_clear_area(lv_vector_dsc_t * dsc, const lv_area_t * rect)
return;
}
lv_area_t final_rect;
if(!lv_area_intersect(&final_rect, &r, rect)) {
return;
}
if(!dsc->tasks.task_list) {
dsc->tasks.task_list = lv_malloc(sizeof(lv_ll_t));
LV_ASSERT_MALLOC(dsc->tasks.task_list);
@ -733,7 +748,7 @@ void lv_vector_clear_area(lv_vector_dsc_t * dsc, const lv_area_t * rect)
new_task->dsc.fill_dsc.color = dsc->current_dsc.fill_dsc.color;
new_task->dsc.fill_dsc.opa = dsc->current_dsc.fill_dsc.opa;
lv_area_copy(&(new_task->dsc.scissor_area), rect);
lv_area_copy(&(new_task->dsc.scissor_area), &final_rect);
}
void lv_draw_vector(lv_vector_dsc_t * dsc)
@ -744,9 +759,7 @@ void lv_draw_vector(lv_vector_dsc_t * dsc)
lv_layer_t * layer = dsc->layer;
lv_draw_task_t * t = lv_draw_add_task(layer, &(layer->_clip_area));
t->type = LV_DRAW_TASK_TYPE_VECTOR;
t->draw_dsc = lv_malloc(sizeof(lv_draw_vector_task_dsc_t));
lv_draw_task_t * t = lv_draw_add_task(layer, &(layer->_clip_area), LV_DRAW_TASK_TYPE_VECTOR);
lv_memcpy(t->draw_dsc, &(dsc->tasks), sizeof(lv_draw_vector_task_dsc_t));
lv_draw_finalize_task_creation(layer, t);
dsc->tasks.task_list = NULL;
@ -780,6 +793,8 @@ void lv_vector_dsc_skew(lv_vector_dsc_t * dsc, float skew_x, float skew_y)
void lv_vector_for_each_destroy_tasks(lv_ll_t * task_list, vector_draw_task_cb cb, void * data)
{
if(task_list == NULL) return;
lv_vector_draw_task * task = lv_ll_get_head(task_list);
lv_vector_draw_task * next_task = NULL;

View File

@ -86,7 +86,12 @@ typedef enum {
LV_VECTOR_GRADIENT_STYLE_RADIAL,
} lv_vector_gradient_style_t;
struct lv_fpoint_t {
typedef enum {
LV_VECTOR_FILL_UNITS_OBJECT_BOUNDING_BOX = 0, /** Relative coordinates relative to the object bounding box. */
LV_VECTOR_FILL_UNITS_USER_SPACE_ON_USE, /** Absolute coordinates relative to the layer's coordinate system */
} lv_vector_fill_units_t;
struct _lv_fpoint_t {
float x;
float y;
};
@ -272,6 +277,15 @@ void lv_vector_dsc_set_fill_opa(lv_vector_dsc_t * dsc, lv_opa_t opa);
*/
void lv_vector_dsc_set_fill_rule(lv_vector_dsc_t * dsc, lv_vector_fill_t rule);
/**
* Set the fill units for descriptor.
* @param dsc pointer to a vector graphic descriptor
* @param units the units to be set in lv_vector_fill_units_t format
* @note The units can be either relative to the object bounding box or absolute in user space.
* This API specifically affects the drawing position of the fill image and does not impact other elements.
*/
void lv_vector_dsc_set_fill_units(lv_vector_dsc_t * dsc, const lv_vector_fill_units_t units);
/**
* Set fill image for descriptor
* @param dsc pointer to a vector graphic descriptor
@ -309,10 +323,10 @@ void lv_vector_dsc_set_fill_gradient_spread(lv_vector_dsc_t * dsc, lv_vector_gra
/**
* Set fill gradient color stops for descriptor
* @param dsc pointer to a vector graphic descriptor
* @param stops an array of `lv_gradient_stop_t` variables
* @param stops an array of `lv_grad_stop_t` variables
* @param count the number of stops in the array, range: 0..LV_GRADIENT_MAX_STOPS
*/
void lv_vector_dsc_set_fill_gradient_color_stops(lv_vector_dsc_t * dsc, const lv_gradient_stop_t * stops,
void lv_vector_dsc_set_fill_gradient_color_stops(lv_vector_dsc_t * dsc, const lv_grad_stop_t * stops,
uint16_t count);
/**
@ -407,10 +421,10 @@ void lv_vector_dsc_set_stroke_gradient_spread(lv_vector_dsc_t * dsc, lv_vector_g
/**
* Set stroke color stops for descriptor
* @param dsc pointer to a vector graphic descriptor
* @param stops an array of `lv_gradient_stop_t` variables
* @param stops an array of `lv_grad_stop_t` variables
* @param count the number of stops in the array
*/
void lv_vector_dsc_set_stroke_gradient_color_stops(lv_vector_dsc_t * dsc, const lv_gradient_stop_t * stops,
void lv_vector_dsc_set_stroke_gradient_color_stops(lv_vector_dsc_t * dsc, const lv_grad_stop_t * stops,
uint16_t count);
/**

View File

@ -26,16 +26,16 @@ extern "C" {
* TYPEDEFS
**********************/
struct lv_vector_path_t {
struct _lv_vector_path_t {
lv_vector_path_quality_t quality;
lv_array_t ops;
lv_array_t points;
};
struct lv_vector_gradient_t {
struct _lv_vector_gradient_t {
lv_vector_gradient_style_t style;
lv_gradient_stop_t stops[LV_GRADIENT_MAX_STOPS]; /**< A gradient stop array */
uint16_t stops_count; /**< The number of used stops in the array */
lv_grad_stop_t stops[LV_GRADIENT_MAX_STOPS]; /**< A gradient stop array */
uint16_t stops_count; /**< The number of used stops in the array */
float x1;
float y1;
float x2;
@ -46,17 +46,18 @@ struct lv_vector_gradient_t {
lv_vector_gradient_spread_t spread;
};
struct lv_vector_fill_dsc_t {
struct _lv_vector_fill_dsc_t {
lv_vector_draw_style_t style;
lv_color32_t color;
lv_opa_t opa;
lv_vector_fill_t fill_rule;
lv_vector_fill_units_t fill_units;
lv_draw_image_dsc_t img_dsc;
lv_vector_gradient_t gradient;
lv_matrix_t matrix;
};
struct lv_vector_stroke_dsc_t {
struct _lv_vector_stroke_dsc_t {
lv_vector_draw_style_t style;
lv_color32_t color;
lv_opa_t opa;
@ -69,7 +70,7 @@ struct lv_vector_stroke_dsc_t {
lv_matrix_t matrix;
};
struct lv_vector_draw_dsc_t {
struct _lv_vector_draw_dsc_t {
lv_vector_fill_dsc_t fill_dsc;
lv_vector_stroke_dsc_t stroke_dsc;
lv_matrix_t matrix;
@ -77,19 +78,18 @@ struct lv_vector_draw_dsc_t {
lv_area_t scissor_area;
};
struct lv_draw_vector_task_dsc_t {
struct _lv_draw_vector_task_dsc_t {
lv_draw_dsc_base_t base;
lv_ll_t * task_list; /*draw task list.*/
};
struct lv_vector_dsc_t {
struct _lv_vector_dsc_t {
lv_layer_t * layer;
lv_vector_draw_dsc_t current_dsc;
/* private data */
lv_draw_vector_task_dsc_t tasks;
};
/**********************
* GLOBAL PROTOTYPES
**********************/

View File

@ -128,16 +128,20 @@ lv_result_t lv_image_decoder_open(lv_image_decoder_dsc_t * dsc, const void * src
* */
lv_result_t res = dsc->decoder->open_cb(dsc->decoder, dsc);
/* Flush the D-Cache if enabled and the image was successfully opened */
if(dsc->args.flush_cache && res == LV_RESULT_OK && dsc->decoded != NULL) {
lv_draw_buf_flush_cache(dsc->decoded, NULL);
LV_LOG_INFO("Flushed D-cache: src %p (%s) (W%d x H%d, data: %p cf: %d)",
src,
dsc->src_type == LV_IMAGE_SRC_FILE ? (const char *)src : "c-array",
dsc->decoded->header.w,
dsc->decoded->header.h,
(void *)dsc->decoded->data,
dsc->decoded->header.cf);
if(res == LV_RESULT_OK && dsc->decoded != NULL) {
LV_ASSERT_MSG(dsc->decoded->unaligned_data && dsc->decoded->handlers, "Invalid draw buffer");
/* Flush the D-Cache if enabled and the image was successfully opened */
if(dsc->args.flush_cache) {
lv_draw_buf_flush_cache(dsc->decoded, NULL);
LV_LOG_INFO("Flushed D-cache: src %p (%s) (W%d x H%d, data: %p cf: %d)",
src,
dsc->src_type == LV_IMAGE_SRC_FILE ? (const char *)src : "c-array",
dsc->decoded->header.w,
dsc->decoded->header.h,
(void *)dsc->decoded->data,
dsc->decoded->header.cf);
}
}
return res;
@ -335,15 +339,12 @@ static lv_image_decoder_t * image_decoder_get_info(lv_image_decoder_dsc_t * dsc,
}
/*Search the decoders*/
lv_image_decoder_t * decoder_prev = NULL;
LV_LL_READ(img_decoder_ll_p, decoder) {
/*Info and Open callbacks are required*/
if(decoder->info_cb && decoder->open_cb) {
lv_fs_seek(&dsc->file, 0, LV_FS_SEEK_SET);
lv_result_t res = decoder->info_cb(decoder, dsc, header);
if(decoder_prev) LV_LOG_TRACE("Can't open image with decoder %s. Trying next decoder.", decoder_prev->name);
if(res == LV_RESULT_OK) {
if(header->stride == 0) {
LV_LOG_INFO("Image decoder didn't set stride. Calculate it from width.");
@ -351,8 +352,9 @@ static lv_image_decoder_t * image_decoder_get_info(lv_image_decoder_dsc_t * dsc,
}
break;
}
decoder_prev = decoder;
else {
LV_LOG_TRACE("Can't open image with decoder %s. Trying next decoder.", decoder->name);
}
}
}

View File

@ -19,7 +19,6 @@ extern "C" {
#include "../misc/lv_fs.h"
#include "../misc/lv_types.h"
#include "../misc/lv_area.h"
#include "../misc/cache/lv_cache.h"
/*********************
* DEFINES
@ -76,6 +75,16 @@ typedef lv_result_t (*lv_image_decoder_get_area_cb_t)(lv_image_decoder_t * decod
*/
typedef void (*lv_image_decoder_close_f_t)(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc);
/**
* Custom drawing functions for special image formats.
* @param layer pointer to a layer
* @param dsc pointer to decoder descriptor
* @param coords the coordinates of the image
* @param draw_dsc the draw image descriptor
* @param clip_area the clip area of the image
*/
typedef void (*lv_image_decoder_custom_draw_t)(lv_layer_t * layer, const lv_image_decoder_dsc_t * dsc,
const lv_area_t * coords, const lv_draw_image_dsc_t * draw_dsc, const lv_area_t * clip_area);
/**********************
* GLOBAL PROTOTYPES
**********************/

View File

@ -13,8 +13,8 @@ extern "C" {
/*********************
* INCLUDES
*********************/
#include "lv_image_decoder.h"
#include "../misc/cache/lv_cache.h"
/*********************
* DEFINES
@ -33,7 +33,7 @@ extern "C" {
* Default args:
* all field are zero or false.
*/
struct lv_image_decoder_args_t {
struct _lv_image_decoder_args_t {
bool stride_align; /**< Whether stride should be aligned */
bool premultiply; /**< Whether image should be premultiplied or not after decoding */
bool no_cache; /**< When set, decoded image won't be put to cache, and decoder open will also ignore cache. */
@ -41,18 +41,20 @@ struct lv_image_decoder_args_t {
bool flush_cache; /**< Whether to flush the data cache after decoding */
};
struct lv_image_decoder_t {
struct _lv_image_decoder_t {
lv_image_decoder_info_f_t info_cb;
lv_image_decoder_open_f_t open_cb;
lv_image_decoder_get_area_cb_t get_area_cb;
lv_image_decoder_close_f_t close_cb;
lv_image_decoder_custom_draw_t custom_draw_cb;
const char * name;
void * user_data;
};
struct lv_image_cache_data_t {
struct _lv_image_cache_data_t {
lv_cache_slot_size_t slot;
const void * src;
@ -63,7 +65,7 @@ struct lv_image_cache_data_t {
void * user_data;
};
struct lv_image_header_cache_data_t {
struct _lv_image_header_cache_data_t {
const void * src;
lv_image_src_t src_type;
@ -72,7 +74,7 @@ struct lv_image_header_cache_data_t {
};
/**Describe an image decoding session. Stores data about the decoding*/
struct lv_image_decoder_dsc_t {
struct _lv_image_decoder_dsc_t {
/**The decoder which was able to open the image source*/
lv_image_decoder_t * decoder;

View File

@ -29,7 +29,7 @@ LV_EXPORT_CONST_INT(LV_IMAGE_HEADER_MAGIC);
* TYPEDEFS
**********************/
typedef enum lv_image_flags_t {
typedef enum _lvimage_flags_t {
/**
* For RGB map of the image data, mark if it's pre-multiplied with alpha.
* For indexed image, this bit indicated palette data is pre-multiplied with alpha.
@ -55,6 +55,11 @@ typedef enum lv_image_flags_t {
*/
LV_IMAGE_FLAGS_MODIFIABLE = 0x0020,
/**
* The image has custom drawing methods.
*/
LV_IMAGE_FLAGS_CUSTOM_DRAW = 0x0040,
/**
* Flags reserved for user, lvgl won't use these bits.
*/
@ -124,6 +129,7 @@ typedef struct {
uint32_t data_size; /**< Size of the image in bytes*/
const uint8_t * data; /**< Pointer to the data of the image*/
const void * reserved; /**< A reserved field to make it has same size as lv_draw_buf_t*/
const void * reserved_2; /**< A reserved field to make it has same size as lv_draw_buf_t*/
} lv_image_dsc_t;
/**********************

View File

@ -0,0 +1,405 @@
/**
* MIT License
*
* -----------------------------------------------------------------------------
* Copyright (c) 2008-24 Think Silicon Single Member PC
* -----------------------------------------------------------------------------
*
* 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 (including the next paragraph)
* 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.
*
*/
/**
* @file lv_draw_nema_gfx.c
*
*/
/*********************
* INCLUDES
*********************/
#include "../../core/lv_refr.h"
#if LV_USE_NEMA_GFX
#include "lv_draw_nema_gfx.h"
#include "../../font/lv_font.h"
#include "../../font/lv_font_fmt_txt.h"
/*********************
* DEFINES
*********************/
#define DRAW_UNIT_ID_NEMA_GFX 7
/**********************
* TYPEDEFS
**********************/
#if LV_USE_OS
/**
* Structure of pending nema_gfx draw task
*/
typedef struct _nema_gfx_draw_task_t {
lv_draw_task_t * task;
bool flushed;
} nema_gfx_draw_task_t;
#endif
/**********************
* STATIC PROTOTYPES
**********************/
#if LV_USE_OS
static void nema_gfx_render_thread_cb(void * ptr);
#endif
static void nema_gfx_execute_drawing(lv_draw_nema_gfx_unit_t * u);
static int32_t nema_gfx_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer);
static int32_t nema_gfx_evaluate(lv_draw_unit_t * draw_unit, lv_draw_task_t * task);
static int32_t nema_gfx_delete(lv_draw_unit_t * draw_unit);
static int32_t nema_gfx_wait_for_finish(lv_draw_unit_t * draw_unit);
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_draw_nema_gfx_init(void)
{
lv_draw_nema_gfx_unit_t * draw_nema_gfx_unit = lv_draw_create_unit(sizeof(lv_draw_nema_gfx_unit_t));
/*Initialize NemaGFX*/
nema_init();
draw_nema_gfx_unit->base_unit.dispatch_cb = nema_gfx_dispatch;
draw_nema_gfx_unit->base_unit.evaluate_cb = nema_gfx_evaluate;
draw_nema_gfx_unit->base_unit.delete_cb = nema_gfx_delete;
draw_nema_gfx_unit->base_unit.wait_for_finish_cb = nema_gfx_wait_for_finish;
draw_nema_gfx_unit->base_unit.name = "NEMA_GFX";
#if LV_USE_NEMA_VG
/*Initialize NemaVG */
nema_vg_init(LV_NEMA_GFX_MAX_RESX, LV_NEMA_GFX_MAX_RESY);
/* Allocate VG Buffers*/
draw_nema_gfx_unit->paint = nema_vg_paint_create();
draw_nema_gfx_unit->gradient = nema_vg_grad_create();
draw_nema_gfx_unit->path = nema_vg_path_create();
/*Initialize Freetype Support*/
lv_draw_nema_gfx_label_init(&(draw_nema_gfx_unit->base_unit));
#endif
/*Create GPU Command List*/
draw_nema_gfx_unit->cl = nema_cl_create();
/*Bind Command List*/
nema_cl_bind_circular(&(draw_nema_gfx_unit->cl));
#if LV_USE_OS
lv_thread_init(&draw_nema_gfx_unit->thread, "nemagfx", LV_DRAW_THREAD_PRIO, nema_gfx_render_thread_cb, 2 * 1024,
draw_nema_gfx_unit);
#endif
}
void lv_draw_nema_gfx_deinit(void)
{
return;
}
/**********************
* STATIC FUNCTIONS
**********************/
static int32_t nema_gfx_wait_for_finish(lv_draw_unit_t * draw_unit)
{
lv_draw_nema_gfx_unit_t * draw_nema_gfx_unit = (lv_draw_nema_gfx_unit_t *)draw_unit;
nema_cl_submit(&(draw_nema_gfx_unit->cl));
nema_cl_wait(&(draw_nema_gfx_unit->cl));
return 1;
}
static int32_t nema_gfx_evaluate(lv_draw_unit_t * draw_unit, lv_draw_task_t * task)
{
lv_draw_nema_gfx_unit_t * draw_nema_gfx_unit = (lv_draw_nema_gfx_unit_t *)draw_unit;
switch(task->type) {
case LV_DRAW_TASK_TYPE_LAYER: {
if(task->preference_score > 80) {
task->preference_score = 80;
task->preferred_draw_unit_id = DRAW_UNIT_ID_NEMA_GFX;
}
return 1;
}
#if LV_USE_NEMA_VG
case LV_DRAW_TASK_TYPE_TRIANGLE:
case LV_DRAW_TASK_TYPE_ARC:
case LV_DRAW_TASK_TYPE_FILL: {
if(task->preference_score > 80) {
task->preference_score = 80;
task->preferred_draw_unit_id = DRAW_UNIT_ID_NEMA_GFX;
}
return 1;
}
#else
case LV_DRAW_TASK_TYPE_FILL: {
lv_draw_fill_dsc_t * draw_fill_dsc = (lv_draw_fill_dsc_t *) task->draw_dsc;
if((draw_fill_dsc->grad.dir == (lv_grad_dir_t)LV_GRAD_DIR_NONE)) {
if(task->preference_score > 80) {
task->preference_score = 80;
task->preferred_draw_unit_id = DRAW_UNIT_ID_NEMA_GFX;
}
return 1;
}
break;
}
case LV_DRAW_TASK_TYPE_TRIANGLE: {
lv_draw_triangle_dsc_t * draw_triangle_dsc = (lv_draw_triangle_dsc_t *) task->draw_dsc;
if((draw_triangle_dsc->grad.dir == (lv_grad_dir_t)LV_GRAD_DIR_NONE)) {
if(task->preference_score > 80) {
task->preference_score = 80;
task->preferred_draw_unit_id = DRAW_UNIT_ID_NEMA_GFX;
}
return 1;
}
break;
}
#endif
case LV_DRAW_TASK_TYPE_IMAGE: {
lv_draw_image_dsc_t * draw_image_dsc = (lv_draw_image_dsc_t *) task->draw_dsc;
/*Guard for previous NemaGFX Version*/
#ifndef NEMA_BLOP_RECOLOR
if(draw_image_dsc->recolor_opa > LV_OPA_MIN)
break;
#endif
const lv_image_dsc_t * img_dsc = draw_image_dsc->src;
if(!lv_nemagfx_is_cf_supported(img_dsc->header.cf))
break;
if(draw_image_dsc->blend_mode != LV_BLEND_MODE_SUBTRACTIVE) {
if(task->preference_score > 80) {
task->preference_score = 80;
task->preferred_draw_unit_id = DRAW_UNIT_ID_NEMA_GFX;
}
return 1;
}
break;
}
case LV_DRAW_TASK_TYPE_LABEL: {
lv_draw_label_dsc_t * draw_label_dsc = (lv_draw_label_dsc_t *) task->draw_dsc;
lv_font_fmt_txt_dsc_t * fdsc = (lv_font_fmt_txt_dsc_t *)(draw_label_dsc->font->dsc);
if(fdsc->bitmap_format != LV_FONT_FMT_TXT_COMPRESSED) {
if(task->preference_score > 80) {
task->preference_score = 80;
task->preferred_draw_unit_id = DRAW_UNIT_ID_NEMA_GFX;
}
return 1;
}
break;
}
case LV_DRAW_TASK_TYPE_LINE: {
lv_draw_line_dsc_t * draw_line_dsc = (lv_draw_line_dsc_t *) task->draw_dsc;
bool is_dashed = (draw_line_dsc->dash_width && draw_line_dsc->dash_gap);
if(!is_dashed && !(draw_line_dsc->round_end || draw_line_dsc->round_start)) {
if(task->preference_score > 80) {
task->preference_score = 80;
task->preferred_draw_unit_id = DRAW_UNIT_ID_NEMA_GFX;
}
return 1;
}
break;
}
case LV_DRAW_TASK_TYPE_BORDER: {
const lv_draw_border_dsc_t * draw_dsc = (lv_draw_border_dsc_t *) task->draw_dsc;
if((!(draw_dsc->side != (lv_border_side_t)LV_BORDER_SIDE_FULL && draw_dsc->radius > 0)) &&
(draw_dsc->radius > draw_dsc->width)) {
if(task->preference_score > 80) {
task->preference_score = 80;
task->preferred_draw_unit_id = DRAW_UNIT_ID_NEMA_GFX;
}
return 1;
}
break;
}
case LV_DRAW_TASK_TYPE_BOX_SHADOW:
case LV_DRAW_TASK_TYPE_MASK_RECTANGLE:
case LV_DRAW_TASK_TYPE_MASK_BITMAP:
#if LV_USE_VECTOR_GRAPHIC
case LV_DRAW_TASK_TYPE_VECTOR:
#endif
default:
break;
}
nema_cl_wait(&(draw_nema_gfx_unit->cl));
return 0;
}
static int32_t nema_gfx_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer)
{
lv_draw_nema_gfx_unit_t * draw_nema_gfx_unit = (lv_draw_nema_gfx_unit_t *) draw_unit;
/* Return immediately if it's busy with draw task. */
if(draw_nema_gfx_unit->task_act)
return 0;
/* Try to get an ready to draw. */
lv_draw_task_t * t = lv_draw_get_available_task(layer, NULL, DRAW_UNIT_ID_NEMA_GFX);
/* Return 0 is no selection, some tasks can be supported by other units. */
if(t == NULL || t->preferred_draw_unit_id != DRAW_UNIT_ID_NEMA_GFX)
return LV_DRAW_UNIT_IDLE;
void * buf = lv_draw_layer_alloc_buf(layer);
if(buf == NULL)
return LV_DRAW_UNIT_IDLE;
t->state = LV_DRAW_TASK_STATE_IN_PROGRESS;
draw_nema_gfx_unit->task_act = t;
#if LV_USE_OS
/* Let the render thread work. */
if(draw_nema_gfx_unit->inited)
lv_thread_sync_signal(&draw_nema_gfx_unit->sync);
#else
nema_gfx_execute_drawing(draw_nema_gfx_unit);
draw_nema_gfx_unit->task_act->state = LV_DRAW_TASK_STATE_READY;
draw_nema_gfx_unit->task_act = NULL;
/* The draw unit is free now. Request a new dispatching as it can get a new task. */
lv_draw_dispatch_request();
#endif
return 1;
}
static void nema_gfx_execute_drawing(lv_draw_nema_gfx_unit_t * u)
{
lv_draw_task_t * t = u->task_act;
/* remember draw unit for access to unit's context */
t->draw_unit = (lv_draw_unit_t *)u;
switch(t->type) {
case LV_DRAW_TASK_TYPE_FILL:
lv_draw_nema_gfx_fill(t, t->draw_dsc, &t->area);
break;
case LV_DRAW_TASK_TYPE_IMAGE:
lv_draw_nema_gfx_img(t, t->draw_dsc, &t->area);
break;
case LV_DRAW_TASK_TYPE_TRIANGLE:
lv_draw_nema_gfx_triangle(t, t->draw_dsc);
break;
case LV_DRAW_TASK_TYPE_LABEL:
lv_draw_nema_gfx_label(t, t->draw_dsc, &t->area);
break;
case LV_DRAW_TASK_TYPE_LAYER:
lv_draw_nema_gfx_layer(t, t->draw_dsc, &t->area);
break;
case LV_DRAW_TASK_TYPE_LINE:
lv_draw_nema_gfx_line(t, t->draw_dsc);
break;
#if LV_USE_NEMA_VG
case LV_DRAW_TASK_TYPE_ARC:
lv_draw_nema_gfx_arc(t, t->draw_dsc, &t->area);
break;
#endif
case LV_DRAW_TASK_TYPE_BORDER:
lv_draw_nema_gfx_border(t, t->draw_dsc, &t->area);
break;
default:
break;
}
}
static int32_t nema_gfx_delete(lv_draw_unit_t * draw_unit)
{
#if LV_USE_NEMA_VG
/*Free VG Buffers*/
lv_draw_nema_gfx_unit_t * draw_nema_gfx_unit = (lv_draw_nema_gfx_unit_t *) draw_unit;
nema_vg_paint_destroy(draw_nema_gfx_unit->paint);
nema_vg_path_destroy(draw_nema_gfx_unit->path);
nema_vg_grad_destroy(draw_nema_gfx_unit->gradient);
#endif
#if LV_USE_OS
lv_draw_nema_gfx_unit_t * _draw_nema_gfx_unit = (lv_draw_nema_gfx_unit_t *) draw_unit;
LV_LOG_INFO("Cancel NemaGFX draw thread.");
_draw_nema_gfx_unit->exit_status = true;
if(_draw_nema_gfx_unit->inited)
lv_thread_sync_signal(&_draw_nema_gfx_unit->sync);
lv_result_t res = lv_thread_delete(&_draw_nema_gfx_unit->thread);
return res;
#endif
#if LV_USE_NEMA_VG == 0 && LV_USE_OS == LV_OS_NONE
LV_UNUSED(draw_unit);
#endif
return 0;
}
#if LV_USE_OS
static void nema_gfx_render_thread_cb(void * ptr)
{
lv_draw_nema_gfx_unit_t * u = ptr;
lv_thread_sync_init(&u->sync);
u->inited = true;
while(1) {
/* Wait for sync if there is no task set. */
while(u->task_act == NULL) {
if(u->exit_status)
break;
lv_thread_sync_wait(&u->sync);
}
if(u->exit_status) {
LV_LOG_INFO("Ready to exit NemaGFX draw thread.");
break;
}
if(u->task_act) {
nema_gfx_execute_drawing(u);
}
/* Signal the ready state to dispatcher. */
u->task_act->state = LV_DRAW_TASK_STATE_READY;
/* Cleanup. */
u->task_act = NULL;
/* The draw unit is free now. Request a new dispatching as it can get a new task. */
lv_draw_dispatch_request();
}
u->inited = false;
lv_thread_sync_delete(&u->sync);
LV_LOG_INFO("Exit NemaGFX draw thread.");
}
#endif
#endif

View File

@ -0,0 +1,124 @@
/**
* MIT License
*
* -----------------------------------------------------------------------------
* Copyright (c) 2008-24 Think Silicon Single Member PC
* -----------------------------------------------------------------------------
*
* 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 (including the next paragraph)
* 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.
*
*/
/**
* @file lv_draw_nema_gfx.h
*
*/
#ifndef LV_DRAW_NEMA_GFX_H
#define LV_DRAW_NEMA_GFX_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../../lv_conf_internal.h"
#if LV_USE_NEMA_GFX
#include "lv_draw_nema_gfx_utils.h"
#include "../lv_draw_private.h"
#include "../lv_draw_buf_private.h"
#include "../lv_draw_image_private.h"
#include "../lv_image_decoder_private.h"
#include "../lv_draw_label_private.h"
#include "../lv_draw_mask_private.h"
#include "../lv_draw_rect_private.h"
#include "../lv_draw_triangle_private.h"
#include "../lv_draw_vector_private.h"
#include "../../misc/lv_area_private.h"
/**********************
* TYPEDEFS
**********************/
typedef struct {
lv_draw_unit_t base_unit;
lv_draw_task_t * task_act;
#if LV_USE_OS
lv_thread_sync_t sync;
lv_thread_t thread;
volatile bool inited;
volatile bool exit_status;
#endif
uint32_t idx;
nema_cmdlist_t cl;
#if LV_USE_NEMA_VG
NEMA_VG_PAINT_HANDLE paint;
NEMA_VG_GRAD_HANDLE gradient;
NEMA_VG_PATH_HANDLE path;
#endif
} lv_draw_nema_gfx_unit_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_draw_nema_gfx_init(void);
void lv_draw_nema_gfx_deinit(void);
void lv_draw_nema_gfx_fill(lv_draw_task_t * t,
const lv_draw_fill_dsc_t * dsc, const lv_area_t * coords);
void lv_draw_nema_gfx_triangle(lv_draw_task_t * t, const lv_draw_triangle_dsc_t * dsc);
void lv_draw_nema_gfx_img(lv_draw_task_t * t, const lv_draw_image_dsc_t * dsc,
const lv_area_t * coords);
void lv_draw_nema_gfx_label(lv_draw_task_t * t, const lv_draw_label_dsc_t * dsc,
const lv_area_t * coords);
void lv_draw_nema_gfx_label_init(lv_draw_unit_t * draw_unit);
void lv_draw_nema_gfx_layer(lv_draw_task_t * t, const lv_draw_image_dsc_t * draw_dsc,
const lv_area_t * coords);
void lv_draw_nema_gfx_line(lv_draw_task_t * t, const lv_draw_line_dsc_t * dsc);
void lv_draw_nema_gfx_border(lv_draw_task_t * t, const lv_draw_border_dsc_t * dsc,
const lv_area_t * coords);
void lv_draw_nema_gfx_arc(lv_draw_task_t * t, const lv_draw_arc_dsc_t * dsc,
const lv_area_t * coords);
/**********************
* MACROS
**********************/
#endif /*LV_USE_NEMA_GFX*/
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*LV_DRAW_NEMA_GFX_H*/

View File

@ -0,0 +1,105 @@
/**
* MIT License
*
* -----------------------------------------------------------------------------
* Copyright (c) 2008-24 Think Silicon Single Member PC
* -----------------------------------------------------------------------------
*
* 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 (including the next paragraph)
* 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.
*
*/
/**
* @file lv_draw_nema_gfx_arc.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_draw_nema_gfx.h"
#if LV_USE_NEMA_GFX && LV_USE_NEMA_VG
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_draw_nema_gfx_arc(lv_draw_task_t * t, const lv_draw_arc_dsc_t * dsc, const lv_area_t * coords)
{
LV_UNUSED(coords);
if(dsc->opa <= (lv_opa_t)LV_OPA_MIN)
return;
if(dsc->width == 0)
return;
if(dsc->start_angle == dsc->end_angle)
return;
lv_draw_nema_gfx_unit_t * draw_nema_gfx_unit = (lv_draw_nema_gfx_unit_t *)t->draw_unit;
lv_layer_t * layer = t->target_layer;
lv_point_t center = {dsc->center.x - layer->buf_area.x1, dsc->center.y - layer->buf_area.y1};
lv_area_t clip_area;
lv_area_copy(&clip_area, &t->clip_area);
lv_area_move(&clip_area, -layer->buf_area.x1, -layer->buf_area.y1);
nema_set_clip(clip_area.x1, clip_area.y1, lv_area_get_width(&clip_area), lv_area_get_height(&clip_area));
lv_value_precise_t start_angle = dsc->start_angle;
lv_value_precise_t end_angle = dsc->end_angle;
if(start_angle >= end_angle) {
end_angle += 360.0f;
}
if(end_angle - start_angle > 360.0f) {
start_angle = 0.0f;
end_angle = 360.0f;
}
else {
while(end_angle > 360.0f) {
start_angle -= 360.0f;
end_angle -= 360.0f;
}
}
nema_vg_paint_clear(draw_nema_gfx_unit->paint);
nema_vg_paint_set_type(draw_nema_gfx_unit->paint, NEMA_VG_PAINT_COLOR);
lv_color32_t col32 = lv_color_to_32(dsc->color, dsc->opa);
uint32_t bg_color = nema_rgba(col32.red, col32.green, col32.blue, col32.alpha);
nema_vg_paint_set_paint_color(draw_nema_gfx_unit->paint, bg_color); // green
nema_vg_paint_set_stroke_width(draw_nema_gfx_unit->paint, dsc->width);
nema_vg_set_blend(NEMA_BL_SRC_OVER | NEMA_BLOP_SRC_PREMULT);
if(dsc->rounded == 1) {
nema_vg_draw_ring(center.x, center.y, (float)dsc->radius - (float)dsc->width * 0.5f, start_angle, end_angle,
draw_nema_gfx_unit->paint);
}
else {
nema_vg_draw_ring_generic(center.x, center.y, (float)dsc->radius - (float)dsc->width * 0.5f, start_angle,
end_angle, draw_nema_gfx_unit->paint, 0U);
}
nema_cl_submit(&(draw_nema_gfx_unit->cl));
}
#endif

View File

@ -0,0 +1,226 @@
/**
* MIT License
*
* -----------------------------------------------------------------------------
* Copyright (c) 2008-24 Think Silicon Single Member PC
* -----------------------------------------------------------------------------
*
* 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 (including the next paragraph)
* 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.
*
*/
/**
* @file lv_draw_nema_gfx_fill.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_draw_nema_gfx.h"
#if LV_USE_NEMA_GFX
#include <math.h>
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_draw_nema_gfx_border(lv_draw_task_t * t, const lv_draw_border_dsc_t * dsc, const lv_area_t * coords)
{
if(dsc->opa <= LV_OPA_MIN)
return;
if(dsc->width == 0)
return;
if(dsc->side == LV_BORDER_SIDE_NONE)
return;
lv_draw_nema_gfx_unit_t * draw_nema_gfx_unit = (lv_draw_nema_gfx_unit_t *)t->draw_unit;
lv_layer_t * layer = t->target_layer;
lv_area_t inward_coords;
int32_t width = dsc->width;
/* Move border inwards to align with software rendered border */
inward_coords.x1 = coords->x1 + ceil(width / 2.0f);
inward_coords.x2 = coords->x2 - floor(width / 2.0f);
inward_coords.y1 = coords->y1 + ceil(width / 2.0f);
inward_coords.y2 = coords->y2 - floor(width / 2.0f);
lv_area_move(&inward_coords, -layer->buf_area.x1, -layer->buf_area.y1);
lv_area_t clip_area;
lv_area_copy(&clip_area, &t->clip_area);
lv_area_move(&clip_area, -layer->buf_area.x1, -layer->buf_area.y1);
nema_set_clip(clip_area.x1, clip_area.y1, lv_area_get_width(&clip_area), lv_area_get_height(&clip_area));
lv_area_t clipped_coords;
if(!lv_area_intersect(&clipped_coords, &inward_coords, &clip_area))
return; /*Fully clipped, nothing to do*/
lv_color_format_t dst_cf = layer->draw_buf->header.cf;
uint32_t dst_nema_cf = lv_nemagfx_cf_to_nema(dst_cf);
/* the stride should be computed internally for NEMA_TSC images and images missing a stride value */
int32_t stride = (dst_cf >= LV_COLOR_FORMAT_NEMA_TSC_START && dst_cf <= LV_COLOR_FORMAT_NEMA_TSC_END) ?
-1 : lv_area_get_width(&(layer->buf_area)) * lv_color_format_get_size(dst_cf);
nema_bind_dst_tex((uintptr_t)NEMA_VIRT2PHYS(layer->draw_buf->data), lv_area_get_width(&(layer->buf_area)),
lv_area_get_height(&(layer->buf_area)), dst_nema_cf, stride);
/* Recalculate float Dimensions */
float x1 = (float)coords->x1 + ((float)width / 2.0f) - (float)layer->buf_area.x1;
float x2 = (float)coords->x2 - ((float)width / 2.0f) - (float)layer->buf_area.x1;
float y1 = (float)coords->y1 + ((float)width / 2.0f) - (float)layer->buf_area.y1;
float y2 = (float)coords->y2 - ((float)width / 2.0f) - (float)layer->buf_area.y1;
float coords_bg_w = x2 - x1 + 1;
float coords_bg_h = y2 - y1 + 1;
int32_t short_side = LV_MIN(coords_bg_w, coords_bg_h);
float radius = (float)LV_MIN(dsc->radius, short_side >> 1);
lv_color32_t col32 = lv_color_to_32(dsc->color, dsc->opa);
uint32_t bg_color = nema_rgba(col32.red, col32.green, col32.blue, col32.alpha);
if(col32.alpha < 255U) {
nema_set_blend_fill(NEMA_BL_SRC_OVER);
bg_color = nema_premultiply_rgba(bg_color);
}
else {
nema_set_blend_fill(NEMA_BL_SRC);
}
if(radius > 0.0f) {
nema_draw_rounded_rect_aa(x1, y1, coords_bg_w, coords_bg_h, radius, width, bg_color);
}
else {
lv_area_t rect_coords = *coords;
lv_area_move(&rect_coords, -layer->buf_area.x1, -layer->buf_area.y1);
int32_t border_width = lv_area_get_width(&rect_coords);
int32_t border_height = lv_area_get_height(&rect_coords);
if(dsc->side & LV_BORDER_SIDE_TOP) {
float x = rect_coords.x1 + width;
float y = rect_coords.y1;
float w = border_width - 2 * width;
float h = width;
nema_enable_aa(1, 0, 1, 0);
nema_fill_rect_f(x, y, w, h, bg_color);
}
if(dsc->side & LV_BORDER_SIDE_BOTTOM) {
float x = rect_coords.x1 + width;
float y = rect_coords.y1 + border_height - width;
float w = border_width - 2 * width;
float h = width;
nema_enable_aa(1, 0, 1, 0);
nema_fill_rect_f(x, y, w, h, bg_color);
}
if(dsc->side & LV_BORDER_SIDE_LEFT) {
float x = rect_coords.x1;
float y = rect_coords.y1 + width;
float w = width;
float h = border_height - 2 * width;
nema_enable_aa(0, 1, 0, 1);
nema_fill_rect_f(x, y, w, h, bg_color);
}
if(dsc->side & LV_BORDER_SIDE_RIGHT) {
float x = rect_coords.x1 + border_width - width;
float y = rect_coords.y1 + width;
float w = width;
float h = border_height - 2 * width;
nema_enable_aa(0, 1, 0, 1);
nema_fill_rect_f(x, y, w, h, bg_color);
}
/*Draw small corner rectangles
Top Left*/
if(dsc->side & LV_BORDER_SIDE_TOP || dsc->side & LV_BORDER_SIDE_LEFT) {
float x = rect_coords.x1;
float y = rect_coords.y1;
float w = width;
float h = width;
if(!(dsc->side & LV_BORDER_SIDE_TOP))
nema_enable_aa(1, 1, 0, 1);
else if(!(dsc->side & LV_BORDER_SIDE_LEFT))
nema_enable_aa(1, 0, 1, 1);
else
nema_enable_aa(1, 0, 0, 1);
nema_fill_rect_f(x, y, w, h, bg_color);
}
/*Top Right*/
if(dsc->side & LV_BORDER_SIDE_TOP || dsc->side & LV_BORDER_SIDE_RIGHT) {
float x = rect_coords.x1 + border_width - width;
float y = rect_coords.y1;
float w = width;
float h = width;
if(!(dsc->side & LV_BORDER_SIDE_TOP))
nema_enable_aa(1, 1, 0, 1);
else if(!(dsc->side & LV_BORDER_SIDE_RIGHT))
nema_enable_aa(1, 1, 1, 0);
else
nema_enable_aa(1, 1, 0, 0);
nema_fill_rect_f(x, y, w, h, bg_color);
}
/*Bottom Right*/
if(dsc->side & LV_BORDER_SIDE_BOTTOM || dsc->side & LV_BORDER_SIDE_RIGHT) {
float x = rect_coords.x1 + border_width - width;
float y = rect_coords.y1 + border_height - width;
float w = width;
float h = width;
if(!(dsc->side & LV_BORDER_SIDE_BOTTOM))
nema_enable_aa(0, 1, 1, 1);
else if(!(dsc->side & LV_BORDER_SIDE_RIGHT))
nema_enable_aa(1, 1, 1, 0);
else
nema_enable_aa(0, 1, 1, 0);
nema_fill_rect_f(x, y, w, h, bg_color);
}
/*Bottom Left*/
if(dsc->side & LV_BORDER_SIDE_BOTTOM || dsc->side & LV_BORDER_SIDE_LEFT) {
float x = rect_coords.x1;
float y = rect_coords.y1 + border_height - width;
float w = width;
float h = width;
if(!(dsc->side & LV_BORDER_SIDE_BOTTOM))
nema_enable_aa(0, 1, 1, 1);
else if(!(dsc->side & LV_BORDER_SIDE_LEFT))
nema_enable_aa(1, 0, 1, 1);
else
nema_enable_aa(0, 0, 1, 1);
nema_fill_rect_f(x, y, w, h, bg_color);
}
}
nema_cl_submit(&(draw_nema_gfx_unit->cl));
}
#endif

View File

@ -0,0 +1,149 @@
/**
* MIT License
*
* -----------------------------------------------------------------------------
* Copyright (c) 2008-24 Think Silicon Single Member PC
* -----------------------------------------------------------------------------
*
* 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 (including the next paragraph)
* 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.
*
*/
/**
* @file lv_draw_nema_gfx_fill.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_draw_nema_gfx.h"
#if LV_USE_NEMA_GFX
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_draw_nema_gfx_fill(lv_draw_task_t * t, const lv_draw_fill_dsc_t * dsc, const lv_area_t * coords)
{
if(dsc->opa <= LV_OPA_MIN) return;
lv_draw_nema_gfx_unit_t * draw_nema_gfx_unit = (lv_draw_nema_gfx_unit_t *)t->draw_unit;
lv_layer_t * layer = t->target_layer;
lv_area_t rel_coords;
lv_area_copy(&rel_coords, coords);
lv_area_move(&rel_coords, -layer->buf_area.x1, -layer->buf_area.y1);
lv_area_t rel_clip_area;
lv_area_copy(&rel_clip_area, &t->clip_area);
lv_area_move(&rel_clip_area, -layer->buf_area.x1, -layer->buf_area.y1);
nema_set_clip(rel_clip_area.x1, rel_clip_area.y1, lv_area_get_width(&rel_clip_area),
lv_area_get_height(&rel_clip_area));
lv_area_t clipped_coords;
if(!lv_area_intersect(&clipped_coords, &rel_coords, &rel_clip_area))
return; /*Fully clipped, nothing to do*/
lv_color_format_t dst_cf = layer->draw_buf->header.cf;
uint32_t dst_nema_cf = lv_nemagfx_cf_to_nema(dst_cf);
/* the stride should be computed internally for NEMA_TSC images and images missing a stride value */
int32_t stride = (dst_cf >= LV_COLOR_FORMAT_NEMA_TSC_START && dst_cf <= LV_COLOR_FORMAT_NEMA_TSC_END) ?
-1 : lv_area_get_width(&(layer->buf_area)) * lv_color_format_get_size(dst_cf);
nema_bind_dst_tex((uintptr_t)NEMA_VIRT2PHYS(layer->draw_buf->data), lv_area_get_width(&(layer->buf_area)),
lv_area_get_height(&(layer->buf_area)), dst_nema_cf, stride);
int32_t coords_bg_w = lv_area_get_width(&rel_coords);
int32_t coords_bg_h = lv_area_get_height(&rel_coords);
int32_t short_side = LV_MIN(coords_bg_w, coords_bg_h);
int32_t radius = LV_MIN(dsc->radius, short_side >> 1);
if((dsc->grad.dir == (lv_grad_dir_t)LV_GRAD_DIR_NONE)) {
lv_color32_t col32 = lv_color_to_32(dsc->color, dsc->opa);
uint32_t bg_color = nema_rgba(col32.red, col32.green, col32.blue, col32.alpha);
if(col32.alpha < 255U) {
nema_set_blend_fill(NEMA_BL_SRC_OVER);
bg_color = nema_premultiply_rgba(bg_color);
}
else {
nema_set_blend_fill(NEMA_BL_SRC);
}
if(radius > 0.f)
nema_fill_rounded_rect_aa(rel_coords.x1, rel_coords.y1, coords_bg_w, coords_bg_h, radius, bg_color);
else
nema_fill_rect(rel_coords.x1, rel_coords.y1, coords_bg_w, coords_bg_h, bg_color);
}
#if LV_USE_NEMA_VG
else {
nema_vg_paint_clear(draw_nema_gfx_unit->paint);
nema_vg_paint_set_type(draw_nema_gfx_unit->paint, NEMA_VG_PAINT_GRAD_LINEAR);
nema_vg_set_blend(NEMA_BL_SRC_OVER | NEMA_BLOP_SRC_PREMULT);
float stops[LV_GRADIENT_MAX_STOPS];
color_var_t colors[LV_GRADIENT_MAX_STOPS];
uint32_t cnt = LV_MAX(dsc->grad.stops_count, LV_GRADIENT_MAX_STOPS);
for(uint8_t i = 0; i < cnt; i++) {
stops[i] = (float)(dsc->grad.stops[i].frac) / 255.f;
colors[i].a = LV_OPA_MIX2(dsc->grad.stops[i].opa, dsc->opa);
colors[i].r = dsc->grad.stops[i].color.red;
colors[i].g = dsc->grad.stops[i].color.green;
colors[i].b = dsc->grad.stops[i].color.blue;
}
nema_vg_grad_set(draw_nema_gfx_unit->gradient, cnt, stops, colors);
float x0, y0, x1, y1;
if(dsc->grad.dir == LV_GRAD_DIR_HOR) {
x0 = rel_coords.x1;
x1 = rel_coords.x2;
y0 = rel_coords.y1;
y1 = rel_coords.y1;
}
else {
x0 = rel_coords.x1;
x1 = rel_coords.x1;
y0 = rel_coords.y1;
y1 = rel_coords.y2;
}
nema_vg_paint_set_grad_linear(draw_nema_gfx_unit->paint, draw_nema_gfx_unit->gradient, x0, y0, x1, y1,
NEMA_TEX_CLAMP | NEMA_FILTER_BL);
if(radius > 0.f)
nema_vg_draw_rounded_rect(rel_coords.x1, rel_coords.y1, coords_bg_w, coords_bg_h, radius, radius, NULL,
draw_nema_gfx_unit->paint);
else
nema_vg_draw_rect(rel_coords.x1, rel_coords.y1, coords_bg_w, coords_bg_h, NULL, draw_nema_gfx_unit->paint);
}
#endif
nema_cl_submit(&(draw_nema_gfx_unit->cl));
}
#endif

View File

@ -0,0 +1,283 @@
/**
* MIT License
*
* -----------------------------------------------------------------------------
* Copyright (c) 2008-24 Think Silicon Single Member PC
* -----------------------------------------------------------------------------
*
* 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 (including the next paragraph)
* 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.
*
*/
/**
* @file lv_draw_nema_gfx_fill.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_draw_nema_gfx.h"
#if LV_USE_NEMA_GFX
/**********************
* STATIC PROTOTYPES
**********************/
static void _draw_nema_gfx_tile(lv_draw_task_t * t, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords);
static void _draw_nema_gfx_img(lv_draw_task_t * t, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords);
static uint32_t lv_nemagfx_mask_cf_to_nema(lv_color_format_t cf);
/**********************
* STATIC FUNCTIONS
**********************/
static void _draw_nema_gfx_tile(lv_draw_task_t * t, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords)
{
lv_image_decoder_dsc_t decoder_dsc;
lv_result_t res = lv_image_decoder_open(&decoder_dsc, dsc->src, NULL);
if(res != LV_RESULT_OK) {
LV_LOG_ERROR("Failed to open image");
return;
}
int32_t img_w = dsc->header.w;
int32_t img_h = dsc->header.h;
lv_area_t tile_area;
if(lv_area_get_width(&dsc->image_area) >= 0) {
tile_area = dsc->image_area;
}
else {
tile_area = *coords;
}
lv_area_set_width(&tile_area, img_w);
lv_area_set_height(&tile_area, img_h);
int32_t tile_x_start = tile_area.x1;
while(tile_area.y1 <= t->clip_area.y2) {
while(tile_area.x1 <= t->clip_area.x2) {
lv_area_t clipped_img_area;
if(lv_area_intersect(&clipped_img_area, &tile_area, &t->clip_area)) {
_draw_nema_gfx_img(t, dsc, &tile_area);
}
tile_area.x1 += img_w;
tile_area.x2 += img_w;
}
tile_area.y1 += img_h;
tile_area.y2 += img_h;
tile_area.x1 = tile_x_start;
tile_area.x2 = tile_x_start + img_w - 1;
}
lv_image_decoder_close(&decoder_dsc);
}
static void _draw_nema_gfx_img(lv_draw_task_t * t, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords)
{
if(dsc->opa <= LV_OPA_MIN) return;
lv_draw_nema_gfx_unit_t * draw_nema_gfx_unit = (lv_draw_nema_gfx_unit_t *)t->draw_unit;
lv_layer_t * layer = t->target_layer;
const lv_image_dsc_t * img_dsc = dsc->src;
bool masked = dsc->bitmap_mask_src != NULL;
lv_area_t blend_area;
/*Let's get the blend area which is the intersection of the area to fill and the clip area.*/
if(!lv_area_intersect(&blend_area, coords, &t->clip_area))
return; /*Fully clipped, nothing to do*/
lv_area_t rel_clip_area;
lv_area_copy(&rel_clip_area, &t->clip_area);
lv_area_move(&rel_clip_area, -layer->buf_area.x1, -layer->buf_area.y1);
bool has_transform = (dsc->rotation != 0 || dsc->scale_x != LV_SCALE_NONE || dsc->scale_y != LV_SCALE_NONE);
bool recolor = (dsc->recolor_opa > LV_OPA_MIN);
/*Make the blend area relative to the buffer*/
lv_area_move(&blend_area, -layer->buf_area.x1, -layer->buf_area.y1);
uint32_t tex_w = lv_area_get_width(coords);
uint32_t tex_h = lv_area_get_height(coords);
nema_set_clip(rel_clip_area.x1, rel_clip_area.y1, lv_area_get_width(&rel_clip_area),
lv_area_get_height(&rel_clip_area));
lv_color_format_t dst_cf = layer->draw_buf->header.cf;
uint32_t dst_nema_cf = lv_nemagfx_cf_to_nema(dst_cf);
const void * src_buf = img_dsc->data;
uint32_t blending_mode = lv_nemagfx_blending_mode(dsc->blend_mode);
lv_color_format_t src_cf = img_dsc->header.cf;
/*Image contains Alpha*/
if(src_cf == LV_COLOR_FORMAT_ARGB8888 || src_cf == LV_COLOR_FORMAT_XRGB8888) {
blending_mode |= NEMA_BLOP_SRC_PREMULT;
}
uint32_t src_nema_cf = lv_nemagfx_cf_to_nema(src_cf);
/* the stride should be computed internally for NEMA_TSC images and images missing a stride value */
int32_t src_stride = (src_cf >= LV_COLOR_FORMAT_NEMA_TSC_START && src_cf <= LV_COLOR_FORMAT_NEMA_TSC_END)
|| img_dsc->header.stride == 0 ? -1 : (int32_t)img_dsc->header.stride;
int32_t stride = (dst_cf >= LV_COLOR_FORMAT_NEMA_TSC_START && dst_cf <= LV_COLOR_FORMAT_NEMA_TSC_END) ?
-1 : lv_area_get_width(&(layer->buf_area)) * lv_color_format_get_size(dst_cf);
nema_bind_dst_tex((uintptr_t)NEMA_VIRT2PHYS(layer->draw_buf->data), lv_area_get_width(&(layer->buf_area)),
lv_area_get_height(&(layer->buf_area)), dst_nema_cf, stride);
if(!LV_COLOR_FORMAT_IS_INDEXED(src_cf)) {
nema_bind_src_tex((uintptr_t)(src_buf), tex_w, tex_h, src_nema_cf, src_stride,
dsc->antialias ? NEMA_FILTER_BL : NEMA_FILTER_PS);
}
else {
nema_bind_lut_tex((uintptr_t)((uint8_t *)src_buf + LV_COLOR_INDEXED_PALETTE_SIZE(src_cf) * 4), tex_w, tex_h,
src_nema_cf, src_stride, NEMA_FILTER_PS, (uintptr_t)(src_buf), NEMA_BGRA8888);
blending_mode |= NEMA_BLOP_LUT;
}
/*Guard for previous NemaGFX Version*/
#ifdef NEMA_BLOP_RECOLOR
if(recolor) {
lv_color32_t col32 = lv_color_to_32(dsc->recolor, LV_OPA_MIX2(dsc->recolor_opa, dsc->opa));
uint32_t color = nema_rgba(col32.red, col32.green, col32.blue, col32.alpha);
nema_set_recolor_color(color);
blending_mode |= NEMA_BLOP_RECOLOR;
}
#endif
if(dsc->opa < 255) {
uint32_t rgba = ((uint32_t)dsc->opa << 24U) | ((uint32_t)dsc->opa << 16U) | ((uint32_t)dsc->opa << 8U) | ((
uint32_t)dsc->opa);
nema_set_const_color(rgba);
blending_mode |= NEMA_BLOP_MODULATE_A;
}
if(!has_transform && masked && !recolor) {
if(dsc->bitmap_mask_src->header.cf == LV_COLOR_FORMAT_A8 || dsc->bitmap_mask_src->header.cf == LV_COLOR_FORMAT_L8) {
blending_mode |= NEMA_BLOP_STENCIL_TXTY;
const lv_image_dsc_t * mask = dsc->bitmap_mask_src;
const void * mask_buf = mask->data;
const lv_area_t * image_area;
lv_area_t mask_area;
if(lv_area_get_width(&dsc->image_area) < 0) image_area = coords;
else image_area = &dsc->image_area;
lv_area_set(&mask_area, 0, 0, dsc->bitmap_mask_src->header.w - 1, dsc->bitmap_mask_src->header.h - 1);
lv_area_align(image_area, &mask_area, LV_ALIGN_CENTER, 0, 0);
mask_buf += dsc->bitmap_mask_src->header.w * (coords->y1 - mask_area.y1) + (coords->x1 - mask_area.x1);
nema_bind_tex(NEMA_TEX3, (uintptr_t)NEMA_VIRT2PHYS(mask_buf), mask->header.w, mask->header.h,
lv_nemagfx_mask_cf_to_nema(mask->header.cf),
mask->header.stride, NEMA_FILTER_BL);
}
}
nema_set_blend_blit(blending_mode);
if(!has_transform) {
nema_blit_rect((coords->x1 - layer->buf_area.x1),
(coords->y1 - layer->buf_area.y1), tex_w, tex_h);
}
else {
/*Calculate the transformed points*/
float x0 = (coords->x1 - layer->buf_area.x1);
float y0 = (coords->y1 - layer->buf_area.y1);
float x1 = x0 + tex_w ;
float y1 = y0;
float x2 = x0 + tex_w ;
float y2 = y0 + tex_h;
float x3 = x0 ;
float y3 = y0 + tex_h;
nema_matrix3x3_t m;
nema_mat3x3_load_identity(m);
nema_mat3x3_translate(m, -x0, -y0);
nema_mat3x3_translate(m, -(float)dsc->pivot.x, -(float)dsc->pivot.y);
nema_mat3x3_rotate(m, (dsc->rotation / 10.0f)); /* angle is 1/10 degree */
float scale_x = 1.f * dsc->scale_x / LV_SCALE_NONE;
float scale_y = 1.f * dsc->scale_y / LV_SCALE_NONE;
nema_mat3x3_scale(m, (float)scale_x, (float)scale_y);
nema_mat3x3_translate(m, (float)dsc->pivot.x, (float)dsc->pivot.y);
nema_mat3x3_translate(m, x0, y0);
/*Apply Transformation Matrix to Vertices*/
nema_mat3x3_mul_vec(m, &x0, &y0);
nema_mat3x3_mul_vec(m, &x1, &y1);
nema_mat3x3_mul_vec(m, &x2, &y2);
nema_mat3x3_mul_vec(m, &x3, &y3);
nema_blit_quad_fit(x0, y0,
x1, y1,
x2, y2,
x3, y3);
}
nema_cl_submit(&(draw_nema_gfx_unit->cl));
}
/*NemaGFX does mask operations with A8,A4,A2 and A1 formats*/
static uint32_t lv_nemagfx_mask_cf_to_nema(lv_color_format_t cf)
{
switch(cf) {
case LV_COLOR_FORMAT_A1:
return NEMA_A1;
case LV_COLOR_FORMAT_A2:
return NEMA_A2;
case LV_COLOR_FORMAT_A4:
return NEMA_A4;
case LV_COLOR_FORMAT_A8:
case LV_COLOR_FORMAT_L8:
default:
break;
}
return NEMA_A8;
}
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_draw_nema_gfx_img(lv_draw_task_t * t, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords)
{
if(!dsc->tile) {
_draw_nema_gfx_img(t, dsc, coords);
}
else {
_draw_nema_gfx_tile(t, dsc, coords);
}
}
#endif

View File

@ -0,0 +1,850 @@
/**
* MIT License
*
* -----------------------------------------------------------------------------
* Copyright (c) 2008-24 Think Silicon Single Member PC
* -----------------------------------------------------------------------------
*
* 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 (including the next paragraph)
* 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.
*
*/
/**
* @file lv_draw_nema_gfx_fill.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_draw_nema_gfx.h"
#if LV_USE_NEMA_GFX
#include "../../misc/lv_utils.h"
#include "../../misc/lv_bidi_private.h"
#include "../../misc/lv_text_private.h"
#include "../../lvgl.h"
#include "../../libs/freetype/lv_freetype_private.h"
#include "../../core/lv_global.h"
/*********************
* DEFINES
*********************/
#define LABEL_RECOLOR_PAR_LENGTH 6
#define LV_LABEL_HINT_UPDATE_TH 1024 /*Update the "hint" if the label's y coordinates have changed more then this*/
#define FT_F26DOT6_SHIFT 6
#define NEMA_COORD_LIMIT 2046
#define font_draw_buf_handlers &(LV_GLOBAL_DEFAULT()->font_draw_buf_handlers)
/** After converting the font reference size, it is also necessary to scale the 26dot6 data
* in the path to the real physical size
*/
#define FT_F26DOT6_TO_PATH_SCALE(x) (LV_FREETYPE_F26DOT6_TO_FLOAT(x) / (1 << FT_F26DOT6_SHIFT))
/*Forward declarations*/
void nema_set_matrix(nema_matrix3x3_t m);
void nema_raster_rect(int x, int y, int w, int h);
/**********************
* TYPEDEFS
**********************/
enum {
RECOLOR_CMD_STATE_WAIT_FOR_PARAMETER,
RECOLOR_CMD_STATE_PARAMETER,
RECOLOR_CMD_STATE_TEXT_INPUT,
};
typedef unsigned char cmd_state_t;
/**********************
* STATIC PROTOTYPES
**********************/
static void _draw_nema_gfx_letter(lv_draw_task_t * t, lv_draw_glyph_dsc_t * glyph_draw_dsc,
lv_draw_fill_dsc_t * fill_draw_dsc, const lv_area_t * fill_area);
static void _draw_label_iterate_characters(lv_draw_task_t * t, const lv_draw_label_dsc_t * dsc,
const lv_area_t * coords);
static inline uint8_t _bpp_nema_gfx_format(lv_draw_glyph_dsc_t * glyph_draw_dsc);
static void _draw_letter(lv_draw_task_t * t, lv_draw_glyph_dsc_t * dsc, const lv_point_t * pos,
const lv_font_t * font, uint32_t letter);
static uint8_t hex_char_to_num(char hex);
static bool is_raw_bitmap;
#if LV_USE_FREETYPE && LV_USE_NEMA_VG
#include "lv_nema_gfx_path.h"
static void _draw_nema_gfx_outline(lv_draw_task_t * t, lv_draw_glyph_dsc_t * glyph_draw_dsc);
static void freetype_outline_event_cb(lv_event_t * e);
static void lv_nema_gfx_outline_push(const lv_freetype_outline_event_param_t * param);
static void lv_nema_outline_event_alloc(const lv_freetype_outline_event_param_t * param);
#endif
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_draw_nema_gfx_label_init(lv_draw_unit_t * draw_unit)
{
#if LV_USE_FREETYPE
/*Set up the freetype outline event*/
lv_freetype_outline_add_event(freetype_outline_event_cb, LV_EVENT_ALL, draw_unit);
#else
LV_UNUSED(draw_unit);
#endif /* LV_USE_FREETYPE */
}
void lv_draw_nema_gfx_label(lv_draw_task_t * t, const lv_draw_label_dsc_t * dsc, const lv_area_t * coords)
{
if(dsc->opa <= LV_OPA_MIN) return;
lv_layer_t * layer = t->target_layer;
lv_area_t clip_area;
lv_area_copy(&clip_area, &t->clip_area);
lv_area_move(&clip_area, -layer->buf_area.x1, -layer->buf_area.y1);
lv_color_format_t dst_cf = layer->draw_buf->header.cf;
uint32_t dst_nema_cf = lv_nemagfx_cf_to_nema(dst_cf);
int32_t stride = (dst_cf >= LV_COLOR_FORMAT_NEMA_TSC_START && dst_cf <= LV_COLOR_FORMAT_NEMA_TSC_END) ?
-1 : lv_area_get_width(&(layer->buf_area)) * lv_color_format_get_size(dst_cf);
nema_bind_dst_tex((uintptr_t)NEMA_VIRT2PHYS(layer->draw_buf->data), lv_area_get_width(&(layer->buf_area)),
lv_area_get_height(&(layer->buf_area)), dst_nema_cf, stride);
nema_set_clip(clip_area.x1, clip_area.y1, lv_area_get_width(&clip_area), lv_area_get_height(&clip_area));
_draw_label_iterate_characters(t, dsc, coords);
lv_draw_nema_gfx_unit_t * draw_nema_gfx_unit = (lv_draw_nema_gfx_unit_t *)t->draw_unit;
nema_cl_submit(&(draw_nema_gfx_unit->cl));
nema_cl_wait(&(draw_nema_gfx_unit->cl));
}
/**********************
* STATIC FUNCTIONS
**********************/
#if LV_USE_FREETYPE && LV_USE_NEMA_VG
static void _draw_nema_gfx_outline(lv_draw_task_t * t, lv_draw_glyph_dsc_t * glyph_draw_dsc)
{
lv_area_t blend_area;
if(!_lv_area_intersect(&blend_area, glyph_draw_dsc->letter_coords, &t->clip_area))
return;
lv_draw_nema_gfx_unit_t * draw_nema_gfx_unit = (lv_draw_nema_gfx_unit_t *)t->draw_unit;
lv_nema_gfx_path_t * nema_gfx_path = (lv_nema_gfx_path_t *)glyph_draw_dsc->glyph_data;
lv_point_t pos = {glyph_draw_dsc->letter_coords->x1, glyph_draw_dsc->letter_coords->y1};
float scale = FT_F26DOT6_TO_PATH_SCALE(lv_freetype_outline_get_scale(glyph_draw_dsc->g->resolved_font));
/*Calculate Path Matrix*/
nema_matrix3x3_t matrix;
nema_mat3x3_load_identity(matrix);
nema_mat3x3_scale(matrix, scale, -scale);
nema_mat3x3_translate(matrix, pos.x - glyph_draw_dsc->g->ofs_x,
pos.y + glyph_draw_dsc->g->box_h + glyph_draw_dsc->g->ofs_y);
nema_vg_path_clear(nema_gfx_path->path);
nema_vg_paint_clear(nema_gfx_path->paint);
nema_vg_set_fill_rule(NEMA_VG_FILL_EVEN_ODD);
nema_vg_path_set_shape(nema_gfx_path->path, nema_gfx_path->seg_size, nema_gfx_path->seg, nema_gfx_path->data_size,
nema_gfx_path->data);
nema_vg_paint_set_type(nema_gfx_path->paint, NEMA_VG_PAINT_COLOR);
lv_color32_t dsc_col32 = lv_color_to_32(glyph_draw_dsc->color, glyph_draw_dsc->opa);
uint32_t nema_dsc_color = nema_rgba(dsc_col32.red, dsc_col32.green, dsc_col32.blue, dsc_col32.alpha);
nema_vg_paint_set_paint_color(nema_gfx_path->paint, nema_dsc_color);
nema_vg_path_set_matrix(nema_gfx_path->path, matrix);
nema_vg_draw_path(nema_gfx_path->path, nema_gfx_path->paint);
return;
}
static void freetype_outline_event_cb(lv_event_t * e)
{
LV_PROFILER_DRAW_BEGIN;
lv_event_code_t code = lv_event_get_code(e);
lv_freetype_outline_event_param_t * param = lv_event_get_param(e);
switch(code) {
case LV_EVENT_CREATE:
param->outline = lv_nema_gfx_path_create();
lv_nema_outline_event_alloc(param);
break;
case LV_EVENT_DELETE:
lv_nema_gfx_path_destroy(param->outline);
break;
case LV_EVENT_INSERT:
lv_nema_gfx_outline_push(param);
break;
default:
LV_LOG_WARN("unknown event code: %d", code);
break;
}
LV_PROFILER_DRAW_END;
}
static void lv_nema_gfx_outline_push(const lv_freetype_outline_event_param_t * param)
{
LV_PROFILER_DRAW_BEGIN;
lv_nema_gfx_path_t * outline = param->outline;
LV_ASSERT_NULL(outline);
lv_freetype_outline_type_t type = param->type;
switch(type) {
case LV_FREETYPE_OUTLINE_END:
lv_nema_gfx_path_end(outline);
break;
case LV_FREETYPE_OUTLINE_MOVE_TO:
lv_nema_gfx_path_move_to(outline, param->to.x, param->to.y);
break;
case LV_FREETYPE_OUTLINE_LINE_TO:
lv_nema_gfx_path_line_to(outline, param->to.x, param->to.y);
break;
case LV_FREETYPE_OUTLINE_CUBIC_TO:
lv_nema_gfx_path_cubic_to(outline, param->control1.x, param->control1.y,
param->control2.x, param->control2.y,
param->to.x, param->to.y);
break;
case LV_FREETYPE_OUTLINE_CONIC_TO:
lv_nema_gfx_path_quad_to(outline, param->control1.x, param->control1.y,
param->to.x, param->to.y);
break;
default:
LV_LOG_ERROR("unknown point type: %d", type);
LV_ASSERT(false);
break;
}
LV_PROFILER_DRAW_END;
}
static void lv_nema_outline_event_alloc(const lv_freetype_outline_event_param_t * param)
{
lv_nema_gfx_path_t * outline = param->outline;
outline->data_size = param->sizes.data_size;
outline->seg_size = param->sizes.segments_size;
lv_nema_gfx_path_alloc(outline);
}
#endif /* LV_USE_FREETYPE && LV_USE_NEMA_VG */
/**
* Convert a hexadecimal characters to a number (0..15)
* @param hex Pointer to a hexadecimal character (0..9, A..F)
* @return the numerical value of `hex` or 0 on error
*/
static uint8_t hex_char_to_num(char hex)
{
if(hex >= '0' && hex <= '9') return hex - '0';
if(hex >= 'a') hex -= 'a' - 'A'; /*Convert to upper case*/
return 'A' <= hex && hex <= 'F' ? hex - 'A' + 10 : 0;
}
static inline uint8_t _bpp_nema_gfx_format(lv_draw_glyph_dsc_t * glyph_draw_dsc)
{
uint32_t format = glyph_draw_dsc->g->format;
switch(format) {
case LV_FONT_GLYPH_FORMAT_A1:
return NEMA_A1;
case LV_FONT_GLYPH_FORMAT_A2:
return NEMA_A2;
case LV_FONT_GLYPH_FORMAT_A4:
return NEMA_A4;
case LV_FONT_GLYPH_FORMAT_A8:
default:
return NEMA_A8;
}
}
static void _draw_nema_gfx_letter(lv_draw_task_t * t, lv_draw_glyph_dsc_t * glyph_draw_dsc,
lv_draw_fill_dsc_t * fill_draw_dsc, const lv_area_t * fill_area)
{
if(glyph_draw_dsc) {
if(glyph_draw_dsc->format == LV_FONT_GLYPH_FORMAT_NONE) {
#if LV_USE_FONT_PLACEHOLDER
/* Draw a placeholder rectangle*/
lv_draw_border_dsc_t border_draw_dsc;
lv_draw_border_dsc_init(&border_draw_dsc);
border_draw_dsc.opa = glyph_draw_dsc->opa;
border_draw_dsc.color = glyph_draw_dsc->color;
border_draw_dsc.width = 1;
lv_draw_nema_gfx_border(t, &border_draw_dsc, glyph_draw_dsc->bg_coords);
#endif
}
else if(glyph_draw_dsc->format >= LV_FONT_GLYPH_FORMAT_A1 &&
glyph_draw_dsc->format <= LV_FONT_GLYPH_FORMAT_A8) {
/*Do not draw transparent things*/
if(glyph_draw_dsc->opa <= LV_OPA_MIN)
return;
lv_layer_t * layer = t->target_layer;
lv_area_t blend_area;
if(!lv_area_intersect(&blend_area, glyph_draw_dsc->letter_coords, &t->clip_area))
return;
const lv_draw_buf_t * draw_buf = glyph_draw_dsc->glyph_data;
const void * mask_buf;
uint32_t src_cf;
lv_area_t mask_area = *glyph_draw_dsc->letter_coords;
lv_area_t rel_coords;
lv_area_copy(&rel_coords, &blend_area);
lv_area_move(&rel_coords, -layer->buf_area.x1, -layer->buf_area.y1);
int32_t x, y, w, h;
/*Read the static font*/
if(is_raw_bitmap) {
mask_buf = glyph_draw_dsc->glyph_data;
src_cf = _bpp_nema_gfx_format(glyph_draw_dsc);
x = glyph_draw_dsc->letter_coords->x1 - layer->buf_area.x1;
y = glyph_draw_dsc->letter_coords->y1 - layer->buf_area.y1;
w = glyph_draw_dsc->g->box_w;
h = glyph_draw_dsc->g->box_h;
}
/*Read the draw buffer*/
else {
mask_buf = draw_buf->data;
src_cf = lv_nemagfx_cf_to_nema(draw_buf->header.cf);
mask_area.x2 = mask_area.x1 + lv_draw_buf_width_to_stride(lv_area_get_width(&mask_area), LV_COLOR_FORMAT_A8) - 1;
mask_buf += draw_buf->header.stride * (blend_area.y1 - mask_area.y1) + (blend_area.x1 - mask_area.x1);
x = rel_coords.x1;
y = rel_coords.y1;
w = lv_area_get_width(&rel_coords);
h = lv_area_get_height(&rel_coords);
}
if(is_raw_bitmap && (glyph_draw_dsc->format <= LV_FONT_GLYPH_FORMAT_A4)) {
nema_bind_src_tex((uintptr_t)(mask_buf), w * h, 1, src_cf, glyph_draw_dsc->g->stride, NEMA_FILTER_PS);
nema_matrix3x3_t m = {
{1, w, -x - (y * w) - (0.5 * w)},
{0, 1, 0},
{0, 0, 1}
};
nema_set_matrix(m);
nema_raster_rect(x, y, w, h);
}
else {
nema_bind_src_tex((uintptr_t)(mask_buf), lv_area_get_width(&mask_area), lv_area_get_height(&mask_area), src_cf,
glyph_draw_dsc->g->stride ? glyph_draw_dsc->g->stride : lv_area_get_width(&mask_area),
NEMA_FILTER_BL);
nema_blit_rect(x, y, w, h);
lv_draw_nema_gfx_unit_t * draw_nema_gfx_unit = (lv_draw_nema_gfx_unit_t *)t->draw_unit;
nema_cl_submit(&(draw_nema_gfx_unit->cl));
nema_cl_wait(&(draw_nema_gfx_unit->cl));
}
}
else if(glyph_draw_dsc->format == LV_FONT_GLYPH_FORMAT_IMAGE) {
#if LV_USE_IMGFONT
lv_draw_img_dsc_t img_dsc;
lv_draw_img_dsc_init(&img_dsc);
img_dsc.angle = 0;
img_dsc.zoom = LV_ZOOM_NONE;
img_dsc.opa = glyph_draw_dsc->opa;
img_dsc.src = glyph_draw_dsc->glyph_data;
lv_draw_nema_gfx_img(t, &img_dsc, glyph_draw_dsc->letter_coords);
#endif
}
#if LV_USE_FREETYPE && LV_USE_NEMA_VG
else if(glyph_draw_dsc->format == LV_FONT_GLYPH_FORMAT_VECTOR) {
if(lv_freetype_is_outline_font(glyph_draw_dsc->g->resolved_font)) {
_draw_nema_gfx_outline(t, glyph_draw_dsc);
}
}
#endif
}
if(fill_draw_dsc && fill_area) {
lv_draw_nema_gfx_fill(t, fill_draw_dsc, fill_area);
}
}
static inline void _set_color_blend(uint32_t color, uint8_t alpha)
{
nema_set_tex_color(color);
if(alpha < 255U) {
nema_set_blend_blit(NEMA_BL_SIMPLE | NEMA_BLOP_MODULATE_A);
nema_set_const_color(color);
}
else {
nema_set_blend_blit(NEMA_BL_SIMPLE);
}
}
static void _draw_label_iterate_characters(lv_draw_task_t * t, const lv_draw_label_dsc_t * dsc,
const lv_area_t * coords)
{
const lv_font_t * font = dsc->font;
int32_t w;
lv_area_t clipped_area;
bool clip_ok = lv_area_intersect(&clipped_area, coords, &t->clip_area);
if(!clip_ok) return;
lv_text_align_t align = dsc->align;
lv_base_dir_t base_dir = dsc->bidi_dir;
lv_bidi_calculate_align(&align, &base_dir, dsc->text);
if((dsc->flag & LV_TEXT_FLAG_EXPAND) == 0) {
/*Normally use the label's width as width*/
w = lv_area_get_width(coords);
}
else {
/*If EXPAND is enabled then not limit the text's width to the object's width*/
lv_point_t p;
lv_text_get_size(&p, dsc->text, dsc->font, dsc->letter_space, dsc->line_space, LV_COORD_MAX,
dsc->flag);
w = p.x;
}
int32_t line_height_font = lv_font_get_line_height(font);
int32_t line_height = line_height_font + dsc->line_space;
/*Init variables for the first line*/
int32_t line_width = 0;
lv_point_t pos;
lv_point_set(&pos, coords->x1, coords->y1);
int32_t x_ofs = 0;
int32_t y_ofs = 0;
x_ofs = dsc->ofs_x;
y_ofs = dsc->ofs_y;
pos.y += y_ofs;
uint32_t line_start = 0;
int32_t last_line_start = -1;
/*Check the hint to use the cached info*/
if(dsc->hint && y_ofs == 0 && coords->y1 < 0) {
/*If the label changed too much recalculate the hint.*/
if(LV_ABS(dsc->hint->coord_y - coords->y1) > LV_LABEL_HINT_UPDATE_TH - 2 * line_height) {
dsc->hint->line_start = -1;
}
last_line_start = dsc->hint->line_start;
}
/*Use the hint if it's valid*/
if(dsc->hint && last_line_start >= 0) {
line_start = last_line_start;
pos.y += dsc->hint->y;
}
uint32_t remaining_len = dsc->text_length;
uint32_t line_end = line_start + lv_text_get_next_line(&dsc->text[line_start], remaining_len, font, dsc->letter_space,
w, NULL, dsc->flag);
/*Go the first visible line*/
while(pos.y + line_height_font < t->clip_area.y1) {
/*Go to next line*/
line_start = line_end;
line_end += lv_text_get_next_line(&dsc->text[line_start], remaining_len, font, dsc->letter_space, w, NULL, dsc->flag);
pos.y += line_height;
/*Save at the threshold coordinate*/
if(dsc->hint && pos.y >= -LV_LABEL_HINT_UPDATE_TH && dsc->hint->line_start < 0) {
dsc->hint->line_start = line_start;
dsc->hint->y = pos.y - coords->y1;
dsc->hint->coord_y = coords->y1;
}
if(dsc->text[line_start] == '\0') return;
}
/*Align to middle*/
if(align == LV_TEXT_ALIGN_CENTER) {
line_width = lv_text_get_width_with_flags(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space,
dsc->flag);
pos.x += (lv_area_get_width(coords) - line_width) / 2;
}
/*Align to the right*/
else if(align == LV_TEXT_ALIGN_RIGHT) {
line_width = lv_text_get_width_with_flags(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space,
dsc->flag);
pos.x += lv_area_get_width(coords) - line_width;
}
uint32_t sel_start = dsc->sel_start;
uint32_t sel_end = dsc->sel_end;
if(sel_start > sel_end) {
uint32_t tmp = sel_start;
sel_start = sel_end;
sel_end = tmp;
}
lv_area_t bg_coords;
lv_draw_glyph_dsc_t draw_letter_dsc;
lv_draw_glyph_dsc_init(&draw_letter_dsc);
draw_letter_dsc.opa = dsc->opa;
draw_letter_dsc.bg_coords = &bg_coords;
draw_letter_dsc.color = dsc->color;
draw_letter_dsc.rotation = dsc->rotation;
lv_draw_fill_dsc_t fill_dsc;
lv_draw_fill_dsc_init(&fill_dsc);
fill_dsc.opa = dsc->opa;
int32_t underline_width = font->underline_thickness ? font->underline_thickness : 1;
int32_t line_start_x;
uint32_t next_char_offset;
uint32_t recolor_command_start_index = 0;
int32_t letter_w;
cmd_state_t recolor_cmd_state = RECOLOR_CMD_STATE_WAIT_FOR_PARAMETER;
lv_color_t recolor = lv_color_black(); /* Holds the selected color inside the recolor command */
uint8_t is_first_space_after_cmd = 0;
lv_color32_t dsc_col32 = lv_color_to_32(dsc->color, dsc->opa);
uint32_t nema_dsc_color = nema_rgba(dsc_col32.red, dsc_col32.green, dsc_col32.blue, dsc_col32.alpha);
lv_color32_t dsc_sel_col32 = lv_color_to_32(dsc->sel_color, dsc->opa);
uint32_t nema_dsc_sel_color = nema_rgba(dsc_sel_col32.red, dsc_sel_col32.green, dsc_sel_col32.blue,
dsc_sel_col32.alpha);
uint32_t blend_color;
uint8_t blend_alpha = 255;
_set_color_blend(nema_dsc_color, dsc_col32.alpha);
uint8_t cur_state = 2;
uint8_t prev_state = 2;
/*Write out all lines*/
while(remaining_len && dsc->text[line_start] != '\0') {
pos.x += x_ofs;
line_start_x = pos.x;
/*Write all letter of a line*/
recolor_cmd_state = RECOLOR_CMD_STATE_WAIT_FOR_PARAMETER;
next_char_offset = 0;
#if LV_USE_BIDI
char * bidi_txt = lv_malloc(line_end - line_start + 1);
LV_ASSERT_MALLOC(bidi_txt);
lv_bidi_process_paragraph(dsc->text + line_start, bidi_txt, line_end - line_start, base_dir, NULL, 0);
#else
const char * bidi_txt = dsc->text + line_start;
#endif
while(next_char_offset < remaining_len && next_char_offset < line_end - line_start) {
uint32_t logical_char_pos = 0;
/* Check if the text selection is enabled */
if(sel_start != LV_DRAW_LABEL_NO_TXT_SEL && sel_end != LV_DRAW_LABEL_NO_TXT_SEL) {
#if LV_USE_BIDI
logical_char_pos = lv_text_encoded_get_char_id(dsc->text, line_start);
uint32_t c_idx = lv_text_encoded_get_char_id(bidi_txt, next_char_offset);
logical_char_pos += lv_bidi_get_logical_pos(bidi_txt, NULL, line_end - line_start, base_dir, c_idx, NULL);
#else
logical_char_pos = lv_text_encoded_get_char_id(dsc->text, line_start + next_char_offset);
#endif
}
uint32_t letter;
uint32_t letter_next;
lv_text_encoded_letter_next_2(bidi_txt, &letter, &letter_next, &next_char_offset);
/* If recolor is enabled */
if((dsc->flag & LV_TEXT_FLAG_RECOLOR) != 0) {
if(letter == (uint32_t)LV_TXT_COLOR_CMD[0]) {
/* Handle the recolor command marker depending of the current recolor state */
if(recolor_cmd_state == RECOLOR_CMD_STATE_WAIT_FOR_PARAMETER) {
recolor_command_start_index = next_char_offset;
recolor_cmd_state = RECOLOR_CMD_STATE_PARAMETER;
continue;
}
/*Other start char in parameter escaped cmd. char*/
else if(recolor_cmd_state == RECOLOR_CMD_STATE_PARAMETER) {
recolor_cmd_state = RECOLOR_CMD_STATE_WAIT_FOR_PARAMETER;
}
/* If letter is LV_TXT_COLOR_CMD and we were in the CMD_STATE_IN then the recolor close marked has been found */
else if(recolor_cmd_state == RECOLOR_CMD_STATE_TEXT_INPUT) {
recolor_cmd_state = RECOLOR_CMD_STATE_WAIT_FOR_PARAMETER;
continue;
}
}
/* Find the first space (aka ' ') after the recolor command parameter, we need to skip rendering it */
if((recolor_cmd_state == RECOLOR_CMD_STATE_PARAMETER) && (letter == ' ') && (is_first_space_after_cmd == 0)) {
is_first_space_after_cmd = 1;
}
else {
is_first_space_after_cmd = 0;
}
/* Skip the color parameter and wait the space after it
* Once we have reach the space ' ', then we will extract the color information
* and store it into the recolor variable */
if(recolor_cmd_state == RECOLOR_CMD_STATE_PARAMETER) {
/* Not an space? Continue with the next character */
if(letter != ' ') {
continue;
}
/*Get the recolor parameter*/
if((next_char_offset - recolor_command_start_index) == LABEL_RECOLOR_PAR_LENGTH + 1) {
/* Temporary buffer to hold the recolor information */
char buf[LABEL_RECOLOR_PAR_LENGTH + 1];
lv_memcpy(buf, &bidi_txt[recolor_command_start_index], LABEL_RECOLOR_PAR_LENGTH);
buf[LABEL_RECOLOR_PAR_LENGTH] = '\0';
uint8_t r, g, b;
r = (hex_char_to_num(buf[0]) << 4) + hex_char_to_num(buf[1]);
g = (hex_char_to_num(buf[2]) << 4) + hex_char_to_num(buf[3]);
b = (hex_char_to_num(buf[4]) << 4) + hex_char_to_num(buf[5]);
recolor = lv_color_make(r, g, b);
}
else {
recolor.red = dsc->color.red;
recolor.blue = dsc->color.blue;
recolor.green = dsc->color.green;
}
/*After the parameter the text is in the command*/
recolor_cmd_state = RECOLOR_CMD_STATE_TEXT_INPUT;
}
/* Don't draw the first space after the recolor command */
if(is_first_space_after_cmd) {
continue;
}
}
/* If we're in the CMD_STATE_IN state then we need to subtract the recolor command length */
if(((dsc->flag & LV_TEXT_FLAG_RECOLOR) != 0) && (recolor_cmd_state == RECOLOR_CMD_STATE_TEXT_INPUT)) {
logical_char_pos -= (LABEL_RECOLOR_PAR_LENGTH + 1);
}
letter_w = lv_font_get_glyph_width(font, letter, letter_next);
/*Always set the bg_coordinates for placeholder drawing*/
bg_coords.x1 = pos.x;
bg_coords.y1 = pos.y;
bg_coords.x2 = pos.x + letter_w - 1;
bg_coords.y2 = pos.y + line_height - 1;
if(next_char_offset >= line_end - line_start) {
if(dsc->decor & LV_TEXT_DECOR_UNDERLINE) {
lv_area_t fill_area;
fill_area.x1 = line_start_x;
fill_area.x2 = pos.x + letter_w - 1;
fill_area.y1 = pos.y + font->line_height - font->base_line - font->underline_position;
fill_area.y2 = fill_area.y1 + underline_width - 1;
fill_dsc.color = dsc->color;
lv_draw_nema_gfx_fill(t, &fill_dsc, &fill_area);
}
if(dsc->decor & LV_TEXT_DECOR_STRIKETHROUGH) {
lv_area_t fill_area;
fill_area.x1 = line_start_x;
fill_area.x2 = pos.x + letter_w - 1;
fill_area.y1 = pos.y + (font->line_height - font->base_line) * 2 / 3 + font->underline_thickness / 2;
fill_area.y2 = fill_area.y1 + underline_width - 1;
fill_dsc.color = dsc->color;
lv_draw_nema_gfx_fill(t, &fill_dsc, &fill_area);
}
}
/* Handle text selection */
if(sel_start != LV_DRAW_LABEL_NO_TXT_SEL && sel_end != LV_DRAW_LABEL_NO_TXT_SEL
&& logical_char_pos >= sel_start && logical_char_pos < sel_end) {
draw_letter_dsc.color = dsc->sel_color;
fill_dsc.color = dsc->sel_bg_color;
lv_draw_nema_gfx_fill(t, &fill_dsc, &bg_coords);
cur_state = 0 ;
blend_alpha = dsc_sel_col32.alpha;
blend_color = nema_dsc_sel_color;
}
else if(recolor_cmd_state == RECOLOR_CMD_STATE_TEXT_INPUT) {
draw_letter_dsc.color = recolor;
cur_state = 1 ;
blend_alpha = dsc_col32.alpha;
lv_color32_t dsc_recolor_col32 = lv_color_to_32(recolor, dsc->opa);
blend_color = nema_rgba(dsc_recolor_col32.red, dsc_recolor_col32.green, dsc_recolor_col32.blue,
dsc_recolor_col32.alpha);
}
else {
draw_letter_dsc.color = dsc->color;
cur_state = 2;
blend_alpha = dsc_col32.alpha;
blend_color = nema_dsc_color;
}
if(cur_state != prev_state) {
_set_color_blend(blend_color, blend_alpha);
prev_state = cur_state;
}
_draw_letter(t, &draw_letter_dsc, &pos, font, letter);
if(letter_w > 0) {
pos.x += letter_w + dsc->letter_space;
}
}
#if LV_USE_BIDI
lv_free(bidi_txt);
bidi_txt = NULL;
#endif
/*Go to next line*/
remaining_len -= line_end - line_start;
line_start = line_end;
if(remaining_len) {
line_end += lv_text_get_next_line(&dsc->text[line_start], remaining_len, font, dsc->letter_space, w, NULL, dsc->flag);
}
pos.x = coords->x1;
/*Align to middle*/
if(align == LV_TEXT_ALIGN_CENTER) {
line_width =
lv_text_get_width_with_flags(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag);
pos.x += (lv_area_get_width(coords) - line_width) / 2;
}
/*Align to the right*/
else if(align == LV_TEXT_ALIGN_RIGHT) {
line_width =
lv_text_get_width_with_flags(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag);
pos.x += lv_area_get_width(coords) - line_width;
}
/*Go the next line position*/
pos.y += line_height;
if(pos.y > t->clip_area.y2) break;
}
if(draw_letter_dsc._draw_buf) lv_draw_buf_destroy(draw_letter_dsc._draw_buf);
LV_ASSERT_MEM_INTEGRITY();
}
static void _draw_letter(lv_draw_task_t * t, lv_draw_glyph_dsc_t * dsc, const lv_point_t * pos,
const lv_font_t * font, uint32_t letter)
{
lv_font_glyph_dsc_t g;
if(lv_text_is_marker(letter)) /*Markers are valid letters but should not be rendered.*/
return;
LV_PROFILER_DRAW_BEGIN;
bool g_ret = lv_font_get_glyph_dsc(font, &g, letter, '\0');
if(g_ret == false) {
/*Add warning if the dsc is not found*/
LV_LOG_WARN("lv_draw_letter: glyph dsc. not found for U+%" LV_PRIX32, letter);
}
/*Don't draw anything if the character is empty. E.g. space*/
if((g.box_h == 0) || (g.box_w == 0)) {
LV_PROFILER_DRAW_END;
return;
}
lv_area_t letter_coords;
letter_coords.x1 = pos->x + g.ofs_x;
letter_coords.x2 = letter_coords.x1 + g.box_w - 1;
letter_coords.y1 = pos->y + (font->line_height - font->base_line) - g.box_h - g.ofs_y;
letter_coords.y2 = letter_coords.y1 + g.box_h - 1;
lv_area_move(&letter_coords, -dsc->pivot.x, -dsc->pivot.y);
/*If the letter is completely out of mask don't draw it*/
if(lv_area_is_out(&letter_coords, &t->clip_area, 0) &&
dsc->bg_coords &&
lv_area_is_out(dsc->bg_coords, &t->clip_area, 0)) {
LV_PROFILER_DRAW_END;
return;
}
if(g.resolved_font) {
lv_draw_buf_t * draw_buf = NULL;
if(LV_FONT_GLYPH_FORMAT_NONE < g.format && g.format < LV_FONT_GLYPH_FORMAT_IMAGE) {
/*Only check draw buf for bitmap glyph*/
draw_buf = lv_draw_buf_reshape(dsc->_draw_buf, 0, g.box_w, g.box_h, LV_STRIDE_AUTO);
if(draw_buf == NULL) {
if(dsc->_draw_buf) lv_draw_buf_destroy(dsc->_draw_buf);
uint32_t h = LV_ROUND_UP(g.box_h, 32); /*Assume a larger size to avoid many reallocations*/
draw_buf = lv_draw_buf_create_ex(font_draw_buf_handlers, g.box_w, h, LV_COLOR_FORMAT_A8, LV_STRIDE_AUTO);
LV_ASSERT_MALLOC(draw_buf);
draw_buf->header.h = g.box_h;
dsc->_draw_buf = draw_buf;
}
}
/* Performance Optimization for lv_font_fmt_txt_dsc_t fonts, always request raw bitmaps */
/*Exception for w*h >= NEMA_COORD_LIMIT due to HW limitation on data handling*/
is_raw_bitmap = false;
if(g.box_h * g.box_w <= NEMA_COORD_LIMIT) {
g.req_raw_bitmap = 1;
if(font->get_glyph_bitmap == lv_font_get_bitmap_fmt_txt) {
lv_font_fmt_txt_dsc_t * fdsc = (lv_font_fmt_txt_dsc_t *)font->dsc;
if(fdsc->bitmap_format == LV_FONT_FMT_TXT_PLAIN) {
is_raw_bitmap = true;
}
}
}
dsc->glyph_data = g.resolved_font->get_glyph_bitmap(&g, draw_buf);
dsc->format = dsc->glyph_data ? g.format : LV_FONT_GLYPH_FORMAT_NONE;
}
else {
dsc->format = LV_FONT_GLYPH_FORMAT_NONE;
}
dsc->letter_coords = &letter_coords;
dsc->g = &g;
_draw_nema_gfx_letter(t, dsc, NULL, NULL);
if(g.resolved_font && font->release_glyph) {
lv_draw_nema_gfx_unit_t * draw_nema_gfx_unit = (lv_draw_nema_gfx_unit_t *)t->draw_unit;
nema_cl_submit(&(draw_nema_gfx_unit->cl));
nema_cl_wait(&(draw_nema_gfx_unit->cl));
font->release_glyph(font, &g);
}
LV_PROFILER_DRAW_END;
}
#endif /*LV_USE_NEMA_GFX*/

View File

@ -0,0 +1,57 @@
/**
* MIT License
*
* -----------------------------------------------------------------------------
* Copyright (c) 2008-24 Think Silicon Single Member PC
* -----------------------------------------------------------------------------
*
* 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 (including the next paragraph)
* 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.
*
*/
/**
* @file lv_draw_nema_gfx_fill.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_draw_nema_gfx.h"
#if LV_USE_NEMA_GFX
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_draw_nema_gfx_layer(lv_draw_task_t * t, const lv_draw_image_dsc_t * draw_dsc, const lv_area_t * coords)
{
lv_layer_t * layer_to_draw = (lv_layer_t *)draw_dsc->src;
/*It can happen that nothing was draw on a layer and therefore its buffer is not allocated.
*In this case just return. */
if(layer_to_draw->draw_buf == NULL) return;
lv_draw_image_dsc_t new_draw_dsc = *draw_dsc;
new_draw_dsc.src = layer_to_draw->draw_buf;
lv_draw_nema_gfx_img(t, &new_draw_dsc, coords);
}
#endif /*LV_USE_NEMA_GFX*/

View File

@ -0,0 +1,96 @@
/**
* MIT License
*
* -----------------------------------------------------------------------------
* Copyright (c) 2008-24 Think Silicon Single Member PC
* -----------------------------------------------------------------------------
*
* 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 (including the next paragraph)
* 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.
*
*/
/**
* @file lv_draw_nema_gfx_fill.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_draw_nema_gfx.h"
#if LV_USE_NEMA_GFX
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_draw_nema_gfx_line(lv_draw_task_t * t, const lv_draw_line_dsc_t * dsc)
{
if(dsc->width == 0)
return;
if(dsc->opa <= (lv_opa_t)LV_OPA_MIN)
return;
if(dsc->p1.x == dsc->p2.x && dsc->p1.y == dsc->p2.y)
return;
lv_draw_nema_gfx_unit_t * draw_nema_gfx_unit = (lv_draw_nema_gfx_unit_t *)t->draw_unit;
lv_layer_t * layer = t->target_layer;
lv_area_t clip_area;
clip_area.x1 = LV_MIN(dsc->p1.x, dsc->p2.x) - dsc->width / 2;
clip_area.x2 = LV_MAX(dsc->p1.x, dsc->p2.x) + dsc->width / 2;
clip_area.y1 = LV_MIN(dsc->p1.y, dsc->p2.y) - dsc->width / 2;
clip_area.y2 = LV_MAX(dsc->p1.y, dsc->p2.y) + dsc->width / 2;
if(!lv_area_intersect(&clip_area, &clip_area, &t->clip_area))
return; /*Fully clipped, nothing to do*/
lv_area_move(&clip_area, -layer->buf_area.x1, -layer->buf_area.y1);
lv_point_t point1 = {dsc->p1.x - layer->buf_area.x1, dsc->p1.y - layer->buf_area.y1};
lv_point_t point2 = {dsc->p2.x - layer->buf_area.x1, dsc->p2.y - layer->buf_area.y1};
nema_set_clip(clip_area.x1, clip_area.y1, lv_area_get_width(&clip_area), lv_area_get_height(&clip_area));
lv_color32_t col32 = lv_color_to_32(dsc->color, dsc->opa);
uint32_t bg_color = nema_rgba(col32.red, col32.green, col32.blue, col32.alpha);
lv_color_format_t dst_cf = layer->draw_buf->header.cf;
uint32_t dst_nema_cf = lv_nemagfx_cf_to_nema(dst_cf);
/* the stride should be computed internally for NEMA_TSC images and images missing a stride value */
int32_t stride = (dst_cf >= LV_COLOR_FORMAT_NEMA_TSC_START && dst_cf <= LV_COLOR_FORMAT_NEMA_TSC_END) ?
-1 : lv_area_get_width(&(layer->buf_area)) * lv_color_format_get_size(dst_cf);
nema_bind_dst_tex((uintptr_t)NEMA_VIRT2PHYS(layer->draw_buf->data), lv_area_get_width(&(layer->buf_area)),
lv_area_get_height(&(layer->buf_area)), dst_nema_cf, stride);
if(col32.alpha < 255U) {
nema_set_blend_fill(NEMA_BL_SIMPLE);
}
else {
nema_set_blend_fill(NEMA_BL_SRC);
}
nema_draw_line_aa(point1.x, point1.y, point2.x, point2.y, dsc->width, bg_color);
nema_cl_submit(&(draw_nema_gfx_unit->cl));
}
#endif

View File

@ -0,0 +1,254 @@
/**
* @file lv_draw_nema_gfx_hal.c
*
* Global functions that implement some HAL functionality
* which Nema will call directly.
*/
/*********************
* INCLUDES
*********************/
#include "../../lv_conf_internal.h"
#if LV_USE_NEMA_GFX
#if LV_USE_NEMA_HAL == LV_NEMA_HAL_STM32
#include "../../misc/lv_types.h"
#include "../../misc/lv_assert.h"
#include "../../stdlib/lv_string.h"
#include <nema_sys_defs.h>
#include <nema_core.h>
#include <assert.h>
#include <string.h>
#include LV_NEMA_STM32_HAL_INCLUDE
#include "tsi_malloc.h"
extern GPU2D_HandleTypeDef hgpu2d;
/*********************
* DEFINES
*********************/
#define RING_SIZE 1024 /* Ring Buffer Size in byte */
/* NemaGFX byte pool size in bytes.
* One byte per peixel for masking/stencling plus 10240 for additional allocations.
*/
#if defined(LV_NEMA_GFX_MAX_RESX) && defined(LV_NEMA_GFX_MAX_RESY)
#define NEMAGFX_MEM_POOL_SIZE ((LV_NEMA_GFX_MAX_RESX * LV_NEMA_GFX_MAX_RESY) + 10240)
#else
/* LV_USE_NEMA_VG is 0 so masking/stencling memory is not needed. */
#define NEMAGFX_MEM_POOL_SIZE 10240
#endif
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
#if (USE_HAL_GPU2D_REGISTER_CALLBACKS == 1)
static void GPU2D_CommandListCpltCallback(GPU2D_HandleTypeDef * hgpu2d, uint32_t CmdListID);
#endif
/**********************
* STATIC VARIABLES
**********************/
static uint8_t nemagfx_pool_mem[NEMAGFX_MEM_POOL_SIZE]; /* NemaGFX memory pool */
static nema_ringbuffer_t ring_buffer_str;
static volatile int last_cl_id = -1;
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
#if (USE_HAL_GPU2D_REGISTER_CALLBACKS == 1)
static void GPU2D_CommandListCpltCallback(GPU2D_HandleTypeDef * hgpu2d, uint32_t CmdListID)
#else
void HAL_GPU2D_CommandListCpltCallback(GPU2D_HandleTypeDef * hgpu2d, uint32_t CmdListID)
#endif
{
LV_UNUSED(hgpu2d);
last_cl_id = CmdListID;
}
int32_t nema_sys_init(void)
{
int error_code = 0;
/* Setup GPU2D Callback */
#if (USE_HAL_GPU2D_REGISTER_CALLBACKS == 1)
/* Register Command List Complete Callback */
HAL_GPU2D_RegisterCommandListCpltCallback(&hgpu2d, GPU2D_CommandListCpltCallback);
#endif
/* Initialise Mem Space */
error_code = tsi_malloc_init_pool_aligned(0, (void *)nemagfx_pool_mem, (uintptr_t)nemagfx_pool_mem,
NEMAGFX_MEM_POOL_SIZE, 1, 8);
LV_ASSERT(error_code == 0);
/* Allocate ring_buffer memory */
ring_buffer_str.bo = nema_buffer_create(RING_SIZE);
LV_ASSERT(ring_buffer_str.bo.base_virt);
/* Initialize Ring Buffer */
error_code = nema_rb_init(&ring_buffer_str, 1);
if(error_code < 0) {
return error_code;
}
/* Reset last_cl_id counter */
last_cl_id = 0;
return error_code;
}
uint32_t nema_reg_read(uint32_t reg)
{
return HAL_GPU2D_ReadRegister(&hgpu2d, reg);
}
void nema_reg_write(uint32_t reg, uint32_t value)
{
HAL_GPU2D_WriteRegister(&hgpu2d, reg, value);
}
int nema_wait_irq(void)
{
return 0;
}
int nema_wait_irq_cl(int cl_id)
{
while(last_cl_id < cl_id) {
(void)nema_wait_irq();
}
return 0;
}
int nema_wait_irq_brk(int brk_id)
{
while(nema_reg_read(GPU2D_BREAKPOINT) == 0U) {
(void)nema_wait_irq();
}
return 0;
}
void nema_host_free(void * ptr)
{
tsi_free(ptr);
}
void * nema_host_malloc(unsigned size)
{
return tsi_malloc(size);
}
nema_buffer_t nema_buffer_create(int size)
{
nema_buffer_t bo;
lv_memset(&bo, 0, sizeof(bo));
bo.base_virt = tsi_malloc(size);
bo.base_phys = (uint32_t)bo.base_virt;
bo.size = size;
LV_ASSERT_MSG(bo.base_virt != 0, "Unable to allocate memory in nema_buffer_create");
return bo;
}
nema_buffer_t nema_buffer_create_pool(int pool, int size)
{
LV_UNUSED(pool);
return nema_buffer_create(size);
}
void * nema_buffer_map(nema_buffer_t * bo)
{
return bo->base_virt;
}
void nema_buffer_unmap(nema_buffer_t * bo)
{
LV_UNUSED(bo);
}
void nema_buffer_destroy(nema_buffer_t * bo)
{
if(bo->fd == -1) {
return; /* Buffer weren't allocated! */
}
tsi_free(bo->base_virt);
bo->base_virt = (void *)0;
bo->base_phys = 0;
bo->size = 0;
bo->fd = -1; /* Buffer not allocated */
}
uintptr_t nema_buffer_phys(nema_buffer_t * bo)
{
return bo->base_phys;
}
void nema_buffer_flush(nema_buffer_t * bo)
{
LV_UNUSED(bo);
}
int nema_mutex_lock(int mutex_id)
{
int retval = 0;
LV_UNUSED(mutex_id);
return retval;
}
int nema_mutex_unlock(int mutex_id)
{
int retval = 0;
LV_UNUSED(mutex_id);
return retval;
}
void platform_disable_cache(void)
{
}
void platform_invalidate_cache(void)
{
}
/**********************
* STATIC FUNCTIONS
**********************/
#endif /* LV_USE_NEMA_HAL == LV_NEMA_HAL_STM32 */
#endif /* LV_USE_NEMA_GFX */

View File

@ -0,0 +1,171 @@
/**
* MIT License
*
* -----------------------------------------------------------------------------
* Copyright (c) 2008-24 Think Silicon Single Member PC
* -----------------------------------------------------------------------------
*
* 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 (including the next paragraph)
* 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.
*
*/
/**
* @file lv_draw_nema_gfx_fill.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_draw_nema_gfx.h"
#if LV_USE_NEMA_GFX
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_draw_nema_gfx_triangle(lv_draw_task_t * t, const lv_draw_triangle_dsc_t * dsc)
{
if(dsc->opa <= LV_OPA_MIN) return;
lv_draw_nema_gfx_unit_t * draw_nema_gfx_unit = (lv_draw_nema_gfx_unit_t *)t->draw_unit;
lv_layer_t * layer = t->target_layer;
lv_area_t rel_clip_area;
lv_area_copy(&rel_clip_area, &t->clip_area);
lv_area_move(&rel_clip_area, -layer->buf_area.x1, -layer->buf_area.y1);
lv_area_t coords;
coords.x1 = (int32_t)LV_MIN3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x);
coords.y1 = (int32_t)LV_MIN3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y);
coords.x2 = (int32_t)LV_MAX3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x);
coords.y2 = (int32_t)LV_MAX3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y);
lv_area_move(&coords, -layer->buf_area.x1, -layer->buf_area.y1);
lv_area_t clipped_coords;
if(!lv_area_intersect(&clipped_coords, &coords, &rel_clip_area))
return; /* Fully clipped, nothing to do */
nema_set_clip(rel_clip_area.x1, rel_clip_area.y1, lv_area_get_width(&rel_clip_area),
lv_area_get_height(&rel_clip_area));
lv_color_format_t dst_cf = layer->draw_buf->header.cf;
uint32_t dst_nema_cf = lv_nemagfx_cf_to_nema(dst_cf);
/* the stride should be computed internally for NEMA_TSC images and images missing a stride value */
int32_t stride = (dst_cf >= LV_COLOR_FORMAT_NEMA_TSC_START && dst_cf <= LV_COLOR_FORMAT_NEMA_TSC_END) ?
-1 : lv_area_get_width(&(layer->buf_area)) * lv_color_format_get_size(dst_cf);
nema_bind_dst_tex((uintptr_t)NEMA_VIRT2PHYS(layer->draw_buf->data), lv_area_get_width(&(layer->buf_area)),
lv_area_get_height(&(layer->buf_area)), dst_nema_cf, stride);
if(dsc->grad.dir == (lv_grad_dir_t)LV_GRAD_DIR_NONE) {
lv_color32_t col32 = lv_color_to_32(dsc->color, dsc->opa);
if(col32.alpha < 255U) {
nema_set_blend_fill(NEMA_BL_SIMPLE);
}
else {
nema_set_blend_fill(NEMA_BL_SRC);
}
uint32_t bg_color = nema_rgba(col32.red, col32.green, col32.blue, col32.alpha);
nema_enable_aa(1, 1, 1, 0);
nema_fill_triangle(dsc->p[0].x, dsc->p[0].y, dsc->p[1].x, dsc->p[1].y, dsc->p[2].x, dsc->p[2].y, bg_color);
}
#if LV_USE_NEMA_VG
else {
nema_vg_path_clear(draw_nema_gfx_unit->path);
nema_vg_paint_clear(draw_nema_gfx_unit->paint);
nema_vg_paint_set_type(draw_nema_gfx_unit->paint, NEMA_VG_PAINT_GRAD_LINEAR);
nema_vg_set_blend(NEMA_BL_SRC_OVER | NEMA_BLOP_SRC_PREMULT);
nema_vg_set_fill_rule(NEMA_VG_FILL_EVEN_ODD);
float stops[LV_GRADIENT_MAX_STOPS];
color_var_t colors[LV_GRADIENT_MAX_STOPS];
uint32_t cnt = LV_MAX(dsc->grad.stops_count, LV_GRADIENT_MAX_STOPS);
for(uint8_t i = 0; i < cnt; i++) {
stops[i] = (float)(dsc->grad.stops[i].frac) / 255.f;
colors[i].a = dsc->grad.stops[i].opa;
colors[i].r = dsc->grad.stops[i].color.red;
colors[i].g = dsc->grad.stops[i].color.green;
colors[i].b = dsc->grad.stops[i].color.blue;
}
nema_vg_grad_set(draw_nema_gfx_unit->gradient, cnt, stops, colors);
//Calculate Bounding Box
float min_x = LV_MIN(dsc->p[0].x, dsc->p[1].x);
min_x = LV_MIN(dsc->p[2].x, min_x);
float min_y = LV_MIN(dsc->p[0].y, dsc->p[1].y);
min_y = LV_MIN(dsc->p[2].y, min_y);
float max_x = LV_MAX(dsc->p[0].x, dsc->p[1].x);
max_x = LV_MAX(dsc->p[2].x, max_x);
float max_y = LV_MAX(dsc->p[0].y, dsc->p[1].y);
max_y = LV_MAX(dsc->p[2].y, max_y);
float x0, x1, y0, y1;
if(dsc->grad.dir == LV_GRAD_DIR_HOR) {
x0 = min_x;
x1 = max_x;
y0 = min_y;
y1 = min_y;
}
else {
x0 = min_x;
x1 = min_x;
y0 = min_y;
y1 = max_y;
}
y0 -= (float) layer->buf_area.y1;
y1 -= (float) layer->buf_area.y1;
x0 -= (float) layer->buf_area.x1;
x1 -= (float) layer->buf_area.x1;
uint8_t cmds_polygon[] = {NEMA_VG_PRIM_MOVE, NEMA_VG_PRIM_POLYGON};
float triangle_coords[] = {dsc->p[0].x - layer->buf_area.x1, dsc->p[0].y - layer->buf_area.y1,
4.0f,
dsc->p[1].x - layer->buf_area.x1, dsc->p[1].y - layer->buf_area.y1,
dsc->p[2].x - layer->buf_area.x1, dsc->p[2].y - layer->buf_area.y1
};
nema_enable_aa(0, 0, 0, 0);
nema_vg_paint_set_grad_linear(draw_nema_gfx_unit->paint, draw_nema_gfx_unit->gradient, x0, y0, x1, y1,
NEMA_TEX_CLAMP | NEMA_FILTER_BL);
nema_vg_path_set_shape(draw_nema_gfx_unit->path, 2, cmds_polygon, 7, triangle_coords);
nema_vg_draw_path(draw_nema_gfx_unit->path, draw_nema_gfx_unit->paint);
}
#endif
nema_cl_submit(&(draw_nema_gfx_unit->cl));
}
#endif

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