diff --git a/lib/libesp32_lvgl/lv_berry/generate/be_lv_c_mapping.h b/lib/libesp32_lvgl/lv_berry/generate/be_lv_c_mapping.h index 3dd268c7d..30fe69786 100644 --- a/lib/libesp32_lvgl/lv_berry/generate/be_lv_c_mapping.h +++ b/lib/libesp32_lvgl/lv_berry/generate/be_lv_c_mapping.h @@ -12,6 +12,11 @@ extern "C" { /* `lv_style` methods */ const be_ntv_func_def_t lv_style_func[] = { + { "get_prop", { (const void*) &lv_style_get_prop, "i", "(lv.lv_style)i(lv.lv_style_value)" } }, + { "get_prop_inlined", { (const void*) &lv_style_get_prop_inlined, "i", "(lv.lv_style)i(lv.lv_style_value)" } }, + { "is_empty", { (const void*) &lv_style_is_empty, "b", "(lv.lv_style)" } }, + { "remove_prop", { (const void*) &lv_style_remove_prop, "b", "(lv.lv_style)i" } }, + { "reset", { (const void*) &lv_style_reset, "", "(lv.lv_style)" } }, { "set_align", { (const void*) &lv_style_set_align, "", "(lv.lv_style)i" } }, { "set_anim_speed", { (const void*) &lv_style_set_anim_speed, "", "(lv.lv_style)i" } }, { "set_anim_time", { (const void*) &lv_style_set_anim_time, "", "(lv.lv_style)i" } }, @@ -84,12 +89,17 @@ const be_ntv_func_def_t lv_style_func[] = { { "set_outline_opa", { (const void*) &lv_style_set_outline_opa, "", "(lv.lv_style)i" } }, { "set_outline_pad", { (const void*) &lv_style_set_outline_pad, "", "(lv.lv_style)i" } }, { "set_outline_width", { (const void*) &lv_style_set_outline_width, "", "(lv.lv_style)i" } }, + { "set_pad_all", { (const void*) &lv_style_set_pad_all, "", "(lv.lv_style)i" } }, { "set_pad_bottom", { (const void*) &lv_style_set_pad_bottom, "", "(lv.lv_style)i" } }, { "set_pad_column", { (const void*) &lv_style_set_pad_column, "", "(lv.lv_style)i" } }, + { "set_pad_gap", { (const void*) &lv_style_set_pad_gap, "", "(lv.lv_style)i" } }, + { "set_pad_hor", { (const void*) &lv_style_set_pad_hor, "", "(lv.lv_style)i" } }, { "set_pad_left", { (const void*) &lv_style_set_pad_left, "", "(lv.lv_style)i" } }, { "set_pad_right", { (const void*) &lv_style_set_pad_right, "", "(lv.lv_style)i" } }, { "set_pad_row", { (const void*) &lv_style_set_pad_row, "", "(lv.lv_style)i" } }, { "set_pad_top", { (const void*) &lv_style_set_pad_top, "", "(lv.lv_style)i" } }, + { "set_pad_ver", { (const void*) &lv_style_set_pad_ver, "", "(lv.lv_style)i" } }, + { "set_prop", { (const void*) &lv_style_set_prop, "", "(lv.lv_style)ii" } }, { "set_radius", { (const void*) &lv_style_set_radius, "", "(lv.lv_style)i" } }, { "set_shadow_color", { (const void*) &lv_style_set_shadow_color, "", "(lv.lv_style)(lv.lv_color)" } }, { "set_shadow_color_filtered", { (const void*) &lv_style_set_shadow_color_filtered, "", "(lv.lv_style)(lv.lv_color)" } }, @@ -98,6 +108,7 @@ const be_ntv_func_def_t lv_style_func[] = { { "set_shadow_opa", { (const void*) &lv_style_set_shadow_opa, "", "(lv.lv_style)i" } }, { "set_shadow_spread", { (const void*) &lv_style_set_shadow_spread, "", "(lv.lv_style)i" } }, { "set_shadow_width", { (const void*) &lv_style_set_shadow_width, "", "(lv.lv_style)i" } }, + { "set_size", { (const void*) &lv_style_set_size, "", "(lv.lv_style)i" } }, { "set_text_align", { (const void*) &lv_style_set_text_align, "", "(lv.lv_style)i" } }, { "set_text_color", { (const void*) &lv_style_set_text_color, "", "(lv.lv_style)(lv.lv_color)" } }, { "set_text_color_filtered", { (const void*) &lv_style_set_text_color_filtered, "", "(lv.lv_style)(lv.lv_color)" } }, @@ -208,7 +219,7 @@ const be_ntv_func_def_t lv_obj_func[] = { { "get_group", { (const void*) &lv_obj_get_group, ".", "(lv.lv_obj)" } }, { "get_height", { (const void*) &lv_obj_get_height, "i", "(lv.lv_obj)" } }, { "get_index", { (const void*) &lv_obj_get_index, "i", "(lv.lv_obj)" } }, - { "get_local_style_prop", { (const void*) &lv_obj_get_local_style_prop, "i", "(lv.lv_obj)(lv.lv_style_prop)(lv.lv_style_value)i" } }, + { "get_local_style_prop", { (const void*) &lv_obj_get_local_style_prop, "i", "(lv.lv_obj)i(lv.lv_style_value)i" } }, { "get_parent", { (const void*) &lv_obj_get_parent, "lv.lv_obj", "(lv.lv_obj)" } }, { "get_screen", { (const void*) &lv_obj_get_screen, "lv.lv_obj", "(lv.lv_obj)" } }, { "get_scroll_bottom", { (const void*) &lv_obj_get_scroll_bottom, "i", "(lv.lv_obj)" } }, @@ -304,7 +315,7 @@ const be_ntv_func_def_t lv_obj_func[] = { { "get_style_pad_right", { (const void*) &lv_obj_get_style_pad_right, "i", "(lv.lv_obj)i" } }, { "get_style_pad_row", { (const void*) &lv_obj_get_style_pad_row, "i", "(lv.lv_obj)i" } }, { "get_style_pad_top", { (const void*) &lv_obj_get_style_pad_top, "i", "(lv.lv_obj)i" } }, - { "get_style_prop", { (const void*) &lv_obj_get_style_prop, "i", "(lv.lv_obj)i(lv.lv_style_prop)" } }, + { "get_style_prop", { (const void*) &lv_obj_get_style_prop, "i", "(lv.lv_obj)ii" } }, { "get_style_radius", { (const void*) &lv_obj_get_style_radius, "i", "(lv.lv_obj)i" } }, { "get_style_shadow_color", { (const void*) &lv_obj_get_style_shadow_color, "lv.lv_color", "(lv.lv_obj)i" } }, { "get_style_shadow_color_filtered", { (const void*) &lv_obj_get_style_shadow_color_filtered, "lv.lv_color", "(lv.lv_obj)i" } }, @@ -368,11 +379,11 @@ const be_ntv_func_def_t lv_obj_func[] = { { "refr_size", { (const void*) &lv_obj_refr_size, "b", "(lv.lv_obj)" } }, { "refresh_ext_draw_size", { (const void*) &lv_obj_refresh_ext_draw_size, "", "(lv.lv_obj)" } }, { "refresh_self_size", { (const void*) &lv_obj_refresh_self_size, "b", "(lv.lv_obj)" } }, - { "refresh_style", { (const void*) &lv_obj_refresh_style, "", "(lv.lv_obj)i(lv.lv_style_prop)" } }, + { "refresh_style", { (const void*) &lv_obj_refresh_style, "", "(lv.lv_obj)ii" } }, { "remove_event_cb", { (const void*) &lv_obj_remove_event_cb, "b", "(lv.lv_obj)." } }, { "remove_event_cb_with_user_data", { (const void*) &lv_obj_remove_event_cb_with_user_data, "b", "(lv.lv_obj).." } }, { "remove_event_dsc", { (const void*) &lv_obj_remove_event_dsc, "b", "(lv.lv_obj)i" } }, - { "remove_local_style_prop", { (const void*) &lv_obj_remove_local_style_prop, "b", "(lv.lv_obj)(lv.lv_style_prop)i" } }, + { "remove_local_style_prop", { (const void*) &lv_obj_remove_local_style_prop, "b", "(lv.lv_obj)ii" } }, { "remove_style", { (const void*) &lv_obj_remove_style, "", "(lv.lv_obj)(lv.lv_style)i" } }, { "remove_style_all", { (const void*) &lv_obj_remove_style_all, "", "(lv.lv_obj)" } }, { "scroll_by", { (const void*) &lv_obj_scroll_by, "", "(lv.lv_obj)ii(lv.lv_anim_enable)" } }, @@ -394,7 +405,7 @@ const be_ntv_func_def_t lv_obj_func[] = { { "set_grid_dsc_array", { (const void*) &lv_obj_set_grid_dsc_array, "", "(lv.lv_obj)(lv.lv_coord_arr)(lv.lv_coord_arr)" } }, { "set_height", { (const void*) &lv_obj_set_height, "", "(lv.lv_obj)i" } }, { "set_layout", { (const void*) &lv_obj_set_layout, "", "(lv.lv_obj)i" } }, - { "set_local_style_prop", { (const void*) &lv_obj_set_local_style_prop, "", "(lv.lv_obj)(lv.lv_style_prop)ii" } }, + { "set_local_style_prop", { (const void*) &lv_obj_set_local_style_prop, "", "(lv.lv_obj)iii" } }, { "set_parent", { (const void*) &lv_obj_set_parent, "", "(lv.lv_obj)(lv.lv_obj)" } }, { "set_pos", { (const void*) &lv_obj_set_pos, "", "(lv.lv_obj)ii" } }, { "set_scroll_dir", { (const void*) &lv_obj_set_scroll_dir, "", "(lv.lv_obj)i" } }, diff --git a/lib/libesp32_lvgl/lv_berry/generate/be_lvgl_module.c b/lib/libesp32_lvgl/lv_berry/generate/be_lvgl_module.c index 18677a91e..10d3d9ebc 100644 --- a/lib/libesp32_lvgl/lv_berry/generate/be_lvgl_module.c +++ b/lib/libesp32_lvgl/lv_berry/generate/be_lvgl_module.c @@ -117,6 +117,9 @@ const be_ntv_func_def_t lv_func[] = { { "scr_act", { (const void*) &lv_scr_act, "lv.lv_obj", "" } }, { "scr_load", { (const void*) &lv_scr_load, "", "(lv.lv_obj)" } }, { "scr_load_anim", { (const void*) &lv_scr_load_anim, "", "(lv.lv_obj)iiib" } }, + { "style_prop_get_default", { (const void*) &lv_style_prop_get_default, "i", "i" } }, + { "style_register_prop", { (const void*) &lv_style_register_prop, "i", "" } }, + { "style_transition_dsc_init", { (const void*) &lv_style_transition_dsc_init, "", "(lv.lv_style_transition_dsc)(lv.lv_style_prop)^lv_anim_path_cb^ii." } }, { "task_handler", { (const void*) &lv_task_handler, "i", "" } }, { "theme_apply", { (const void*) &lv_theme_apply, "", "(lv.lv_obj)" } }, { "theme_default_get", { (const void*) &lv_theme_default_get, "lv.lv_theme", "" } }, diff --git a/lib/libesp32_lvgl/lv_berry/generate/be_lvgl_widgets_lib.c b/lib/libesp32_lvgl/lv_berry/generate/be_lvgl_widgets_lib.c index 22e823250..88141c5eb 100644 --- a/lib/libesp32_lvgl/lv_berry/generate/be_lvgl_widgets_lib.c +++ b/lib/libesp32_lvgl/lv_berry/generate/be_lvgl_widgets_lib.c @@ -44,6 +44,17 @@ extern int lvbe_style_set_grid_cell_row_pos(bvm *vm); extern int lvbe_style_set_grid_cell_row_span(bvm *vm); extern int lvbe_style_set_grid_cell_x_align(bvm *vm); extern int lvbe_style_set_grid_cell_y_align(bvm *vm); +extern int lvbe_style_reset(bvm *vm); +extern int lvbe_style_remove_prop(bvm *vm); +extern int lvbe_style_set_prop(bvm *vm); +extern int lvbe_style_get_prop(bvm *vm); +extern int lvbe_style_get_prop_inlined(bvm *vm); +extern int lvbe_style_is_empty(bvm *vm); +extern int lvbe_style_set_pad_all(bvm *vm); +extern int lvbe_style_set_pad_hor(bvm *vm); +extern int lvbe_style_set_pad_ver(bvm *vm); +extern int lvbe_style_set_pad_gap(bvm *vm); +extern int lvbe_style_set_size(bvm *vm); extern int lvbe_style_set_width(bvm *vm); extern int lvbe_style_set_min_width(bvm *vm); extern int lvbe_style_set_max_width(bvm *vm); diff --git a/lib/libesp32_lvgl/lv_berry/mapping/lv_funcs.h b/lib/libesp32_lvgl/lv_berry/mapping/lv_funcs.h index 6f38c63ee..0fad203ad 100644 --- a/lib/libesp32_lvgl/lv_berry/mapping/lv_funcs.h +++ b/lib/libesp32_lvgl/lv_berry/mapping/lv_funcs.h @@ -721,6 +721,23 @@ static inline lv_color_t lv_color_black(void) lv_color_t lv_palette_lighten(lv_palette_t p, uint8_t lvl) 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) +lv_style_prop_t lv_style_register_prop(void) +bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop) +void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_t value) +lv_res_t lv_style_get_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value) +static inline lv_res_t lv_style_get_prop_inlined(lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value) +void lv_style_transition_dsc_init(lv_style_transition_dsc_t * tr, const lv_style_prop_t props[], lv_anim_path_cb_t path_cb, uint32_t time, uint32_t delay, void * user_data) +lv_style_value_t lv_style_prop_get_default(lv_style_prop_t prop) +bool lv_style_is_empty(const lv_style_t * style) +static inline void lv_style_set_pad_all(lv_style_t * style, lv_coord_t value) +static inline void lv_style_set_pad_hor(lv_style_t * style, lv_coord_t value) +static inline void lv_style_set_pad_ver(lv_style_t * style, lv_coord_t value) +static inline void lv_style_set_pad_gap(lv_style_t * style, lv_coord_t value) +static inline void lv_style_set_size(lv_style_t * style, lv_coord_t value) + // ../../lvgl/src/misc/lv_style_gen.h void lv_style_set_width(lv_style_t * style, lv_coord_t value) void lv_style_set_min_width(lv_style_t * style, lv_coord_t value) diff --git a/lib/libesp32_lvgl/lv_berry/tools/convert.py b/lib/libesp32_lvgl/lv_berry/tools/convert.py index 63230eadb..5cd26a2b9 100644 --- a/lib/libesp32_lvgl/lv_berry/tools/convert.py +++ b/lib/libesp32_lvgl/lv_berry/tools/convert.py @@ -101,6 +101,7 @@ return_types = { "lv_draw_mask_res_t": "i", "lv_img_size_mode_t": "i", "lv_palette_t": "i", + "lv_style_prop_t": "i", # layouts "lv_flex_align_t": "i", "lv_flex_flow_t": "i", diff --git a/lib/libesp32_lvgl/lv_berry/tools/preprocessor.py b/lib/libesp32_lvgl/lv_berry/tools/preprocessor.py index 151727dca..7f6bafe75 100644 --- a/lib/libesp32_lvgl/lv_berry/tools/preprocessor.py +++ b/lib/libesp32_lvgl/lv_berry/tools/preprocessor.py @@ -68,6 +68,7 @@ lv_fun_globs = [ "draw/*.h", "misc/lv_style_gen.h", "misc/lv_color.h", + "misc/lv_style.h", #"misc/lv_area.h", #"**/*.h", ]