diff --git a/CHANGELOG.md b/CHANGELOG.md index 488cceee7..3bf27a2a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file. - TM1638 button and led support are handled as virtual switches and relays (#11031) ### Changed +- LVGL allow access to `lv.LAYOUT_GRID` and `lv.LAYOUT_FLEX` ### Fixed - ESP8266 Fix TLS SNI which would prevent AWS IoT connection (#17936) diff --git a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c index a0122baf3..f628ac3a9 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c +++ b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c @@ -8,15 +8,19 @@ #include "lvgl.h" #include "be_mapping.h" +#include "be_ctypes.h" #include "lv_berry.h" #include "lv_theme_haspmota.h" +// declare accessors for non-const ints +int32_t be_LV_LAYOUT_GRID(void) { return LV_LAYOUT_GRID; }; BE_VAR_CTYPE_DECLARE(be_LV_LAYOUT_GRID, "i"); +int32_t be_LV_LAYOUT_FLEX(void) { return LV_LAYOUT_FLEX; }; BE_VAR_CTYPE_DECLARE(be_LV_LAYOUT_FLEX, "i"); + extern int lv0_member(bvm *vm); // resolve virtual members extern int lv0_load_font(bvm *vm); extern lv_ts_calibration_t * lv_get_ts_calibration(void); - static int lv_get_hor_res(void) { return lv_disp_get_hor_res(lv_disp_get_default()); } @@ -502,6 +506,8 @@ const be_const_member_t lv0_constants[] = { { "LAYER_TYPE_NONE", be_cconst_int(LV_LAYER_TYPE_NONE) }, { "LAYER_TYPE_SIMPLE", be_cconst_int(LV_LAYER_TYPE_SIMPLE) }, { "LAYER_TYPE_TRANSFORM", be_cconst_int(LV_LAYER_TYPE_TRANSFORM) }, + { ">LAYOUT_FLEX", be_ctype(be_LV_LAYOUT_FLEX) }, + { ">LAYOUT_GRID", be_ctype(be_LV_LAYOUT_GRID) }, { "LED_DRAW_PART_RECTANGLE", be_cconst_int(LV_LED_DRAW_PART_RECTANGLE) }, { "LOG_LEVEL_ERROR", be_cconst_int(LV_LOG_LEVEL_ERROR) }, { "LOG_LEVEL_INFO", be_cconst_int(LV_LOG_LEVEL_INFO) }, diff --git a/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_enum.h b/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_enum.h index 71d8989ed..dd05cec1b 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_enum.h +++ b/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_enum.h @@ -12,6 +12,8 @@ anim_path_ease_out=&lv_anim_path_ease_out anim_path_linear=&lv_anim_path_linear anim_path_overshoot=&lv_anim_path_overshoot anim_path_step=&lv_anim_path_step +LV_LAYOUT_GRID=>be_LV_LAYOUT_GRID +LV_LAYOUT_FLEX=>be_LV_LAYOUT_FLEX // ====================================================================== // Colors diff --git a/lib/libesp32_lvgl/lv_binding_berry/src/solidify/solidified_lvgl_extra.h b/lib/libesp32_lvgl/lv_binding_berry/src/solidify/solidified_lvgl_extra.h index 12539d82d..446b427ec 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/src/solidify/solidified_lvgl_extra.h +++ b/lib/libesp32_lvgl/lv_binding_berry/src/solidify/solidified_lvgl_extra.h @@ -49,6 +49,8 @@ be_local_closure(lv_extra__anonymous_, /* name */ /*******************************************************************/ +extern const bclass be_class_lv_coord_arr; + /******************************************************************** ** Solidified function: init ********************************************************************/ @@ -217,6 +219,8 @@ be_local_class(lv_coord_arr, be_str_weak(lv_coord_arr) ); +extern const bclass be_class_lv_point_arr; + /******************************************************************** ** Solidified function: init ********************************************************************/ @@ -319,6 +323,8 @@ be_local_class(lv_point_arr, be_str_weak(lv_point_arr) ); +extern const bclass be_class_lv_style_prop_arr; + /******************************************************************** ** Solidified function: init ********************************************************************/ diff --git a/lib/libesp32_lvgl/lv_binding_berry/src/solidify/solidified_lvgl_glob.h b/lib/libesp32_lvgl/lv_binding_berry/src/solidify/solidified_lvgl_glob.h index 4800b5d69..b4f4c5e9e 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/src/solidify/solidified_lvgl_glob.h +++ b/lib/libesp32_lvgl/lv_binding_berry/src/solidify/solidified_lvgl_glob.h @@ -4,6 +4,8 @@ \********************************************************************/ #include "be_constobj.h" +extern const bclass be_class_LVGL_glob; + /******************************************************************** ** Solidified function: get_object_from_ptr ********************************************************************/ diff --git a/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py b/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py index e3df18958..8089c817e 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py +++ b/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py @@ -718,15 +718,19 @@ print("""/******************************************************************** #include "lvgl.h" #include "be_mapping.h" +#include "be_ctypes.h" #include "lv_berry.h" #include "lv_theme_haspmota.h" +// declare accessors for non-const ints +int32_t be_LV_LAYOUT_GRID(void) { return LV_LAYOUT_GRID; }; BE_VAR_CTYPE_DECLARE(be_LV_LAYOUT_GRID, "i"); +int32_t be_LV_LAYOUT_FLEX(void) { return LV_LAYOUT_FLEX; }; BE_VAR_CTYPE_DECLARE(be_LV_LAYOUT_FLEX, "i"); + extern int lv0_member(bvm *vm); // resolve virtual members extern int lv0_load_font(bvm *vm); extern lv_ts_calibration_t * lv_get_ts_calibration(void); - static int lv_get_hor_res(void) { return lv_disp_get_hor_res(lv_disp_get_default()); } @@ -810,6 +814,7 @@ for k in sorted(lv_module2): if v[0] == '"': v_prefix = "$"; v_macro = "be_cconst_string" if v[0] == '&': v_prefix = "&"; v_macro = "be_cconst_ptr" if v[0] == '@': v_prefix = "@"; v_macro = "be_cconst_ptr"; v = "&" + v[1:] + if v[0] == '>': v_prefix = ">"; v_macro = "be_ctype"; v = v[1:] print(f" {{ \"{v_prefix}{k}\", {v_macro}({v}) }},") else: print(f" {{ \"{k}\", be_cconst_int(LV_{k}) }},") diff --git a/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py b/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py index cafb3d817..f71335eb9 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py +++ b/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py @@ -213,6 +213,8 @@ anim_path_ease_out=&lv_anim_path_ease_out anim_path_linear=&lv_anim_path_linear anim_path_overshoot=&lv_anim_path_overshoot anim_path_step=&lv_anim_path_step +LV_LAYOUT_GRID=>be_LV_LAYOUT_GRID +LV_LAYOUT_FLEX=>be_LV_LAYOUT_FLEX // ====================================================================== // Colors