From 421a2ce1fb362e01b0eafd4fb3e09f492dddc4e1 Mon Sep 17 00:00:00 2001
From: Stephan Hadinger
Date: Sun, 2 Jan 2022 16:16:10 +0100
Subject: [PATCH] LVGL full support for grid layout
---
lib/libesp32/berry/default/be_modtab.c | 2 +
lib/libesp32/berry/generate/be_const_strtab.h | 8 +
.../berry/generate/be_const_strtab_def.h | 1918 +++++++++--------
lib/libesp32_lvgl/lv_berry/src/be_lv_extra.c | 244 +++
.../lv_berry/src/be_lvgl_glob_lib.c | 11 +-
.../lv_berry/src/embedded/lvgl_extra.be | 61 +
.../lv_berry/src/embedded/lvgl_glob.be | 2 +
tasmota/berry/lvgl_examples/test_grid.be | 83 +
8 files changed, 1372 insertions(+), 957 deletions(-)
create mode 100644 lib/libesp32_lvgl/lv_berry/src/be_lv_extra.c
create mode 100644 lib/libesp32_lvgl/lv_berry/src/embedded/lvgl_extra.be
create mode 100644 tasmota/berry/lvgl_examples/test_grid.be
diff --git a/lib/libesp32/berry/default/be_modtab.c b/lib/libesp32/berry/default/be_modtab.c
index 9a3aa2daf..dd11c8461 100644
--- a/lib/libesp32/berry/default/be_modtab.c
+++ b/lib/libesp32/berry/default/be_modtab.c
@@ -44,6 +44,7 @@ be_extern_native_module(unishox);
be_extern_native_module(animate);
#ifdef USE_LVGL
be_extern_native_module(lv);
+be_extern_native_module(lv_extra);
be_extern_native_module(lv_tasmota);
#endif // USE_LVGL
@@ -119,6 +120,7 @@ BERRY_LOCAL const bntvmodule* const be_module_table[] = {
#ifdef USE_LVGL
&be_native_module(lv),
+ &be_native_module(lv_extra),
&be_native_module(lv_tasmota),
#endif // USE_LVGL
#ifdef USE_ENERGY_SENSOR
diff --git a/lib/libesp32/berry/generate/be_const_strtab.h b/lib/libesp32/berry/generate/be_const_strtab.h
index cac9d30c2..8006a587a 100644
--- a/lib/libesp32/berry/generate/be_const_strtab.h
+++ b/lib/libesp32/berry/generate/be_const_strtab.h
@@ -220,6 +220,7 @@ extern const bcstring be_const_str_arg;
extern const bcstring be_const_str_arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj;
extern const bcstring be_const_str_arg_name;
extern const bcstring be_const_str_arg_size;
+extern const bcstring be_const_str_argument_X20must_X20be_X20a_X20list;
extern const bcstring be_const_str_as;
extern const bcstring be_const_str_asin;
extern const bcstring be_const_str_assert;
@@ -288,6 +289,7 @@ extern const bcstring be_const_str_content_send_style;
extern const bcstring be_const_str_content_start;
extern const bcstring be_const_str_content_stop;
extern const bcstring be_const_str_continue;
+extern const bcstring be_const_str_coord_arr;
extern const bcstring be_const_str_copy;
extern const bcstring be_const_str_cos;
extern const bcstring be_const_str_cosh;
@@ -330,6 +332,7 @@ extern const bcstring be_const_str_due;
extern const bcstring be_const_str_dump;
extern const bcstring be_const_str_duration;
extern const bcstring be_const_str_editable;
+extern const bcstring be_const_str_elements_X20must_X20be_X20a_X20lv_point;
extern const bcstring be_const_str_elif;
extern const bcstring be_const_str_else;
extern const bcstring be_const_str_enabled;
@@ -482,11 +485,15 @@ extern const bcstring be_const_str_lower;
extern const bcstring be_const_str_lv;
extern const bcstring be_const_str_lv_;
extern const bcstring be_const_str_lv_clock_icon;
+extern const bcstring be_const_str_lv_coord_arr;
extern const bcstring be_const_str_lv_event;
extern const bcstring be_const_str_lv_event_cb;
+extern const bcstring be_const_str_lv_extra;
extern const bcstring be_const_str_lv_module_init;
extern const bcstring be_const_str_lv_obj;
extern const bcstring be_const_str_lv_obj_class;
+extern const bcstring be_const_str_lv_point;
+extern const bcstring be_const_str_lv_point_arr;
extern const bcstring be_const_str_lv_signal_arcs;
extern const bcstring be_const_str_lv_signal_bars;
extern const bcstring be_const_str_lv_solidified;
@@ -543,6 +550,7 @@ extern const bcstring be_const_str_pixel_count;
extern const bcstring be_const_str_pixel_size;
extern const bcstring be_const_str_pixels_buffer;
extern const bcstring be_const_str_point;
+extern const bcstring be_const_str_point_arr;
extern const bcstring be_const_str_pop;
extern const bcstring be_const_str_pop_path;
extern const bcstring be_const_str_pow;
diff --git a/lib/libesp32/berry/generate/be_const_strtab_def.h b/lib/libesp32/berry/generate/be_const_strtab_def.h
index 0b5740a26..73f596f1e 100644
--- a/lib/libesp32/berry/generate/be_const_strtab_def.h
+++ b/lib/libesp32/berry/generate/be_const_strtab_def.h
@@ -1,723 +1,731 @@
-be_define_const_str(, "", 2166136261u, 0, 0, NULL);
-be_define_const_str(_X0A, "\n", 252472541u, 0, 1, NULL);
-be_define_const_str(_X20, " ", 621580159u, 0, 1, &be_const_str__settings_def);
-be_define_const_str(_X21_X3D, "!=", 2428715011u, 0, 2, &be_const_str_i2c_enabled);
-be_define_const_str(_X21_X3D_X3D, "!==", 559817114u, 0, 3, &be_const_str__X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E);
-be_define_const_str(_X23, "#", 638357778u, 0, 1, &be_const_str_cos);
-be_define_const_str(_X23autoexec_X2Ebat, "#autoexec.bat", 3382890497u, 0, 13, &be_const_str_constructor_cb);
-be_define_const_str(_X23autoexec_X2Ebe, "#autoexec.be", 1181757091u, 0, 12, NULL);
-be_define_const_str(_X23display_X2Eini, "#display.ini", 182218220u, 0, 12, &be_const_str__buffer);
-be_define_const_str(_X23init_X2Ebat, "#init.bat", 3297595077u, 0, 9, &be_const_str__X3C_X2Fform_X3E_X3C_X2Fp_X3E);
-be_define_const_str(_X23preinit_X2Ebe, "#preinit.be", 687035716u, 0, 11, &be_const_str_size);
-be_define_const_str(_X2502d_X25s_X2502d, "%02d%s%02d", 1587999717u, 0, 10, &be_const_str_get_option);
-be_define_const_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, "%04d-%02d-%02dT%02d:%02d:%02d", 3425528601u, 0, 29, &be_const_str_base_class);
-be_define_const_str(_X25s_X2Eautoconf, "%s.autoconf", 3560383524u, 0, 11, &be_const_str_CFG_X3A_X20ran_X20_X20);
-be_define_const_str(_X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, "<Error: apply new or remove>", 2855507949u, 0, 34, &be_const_str_Auto_X2Dconfiguration);
-be_define_const_str(_X26lt_X3BNone_X26gt_X3B, "<None>", 2602165498u, 0, 12, &be_const_str_remove_rule);
-be_define_const_str(_X28_X29, "()", 685372826u, 0, 2, &be_const_str_closure);
-be_define_const_str(_X2B, "+", 772578730u, 0, 1, &be_const_str_json_append);
-be_define_const_str(_X2C, ",", 688690635u, 0, 1, &be_const_str_begin_multicast);
-be_define_const_str(_X2D_X2D_X3A_X2D_X2D, "--:--", 1370615441u, 0, 5, &be_const_str__X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E);
-be_define_const_str(_X2E, ".", 722245873u, 0, 1, NULL);
+be_define_const_str(, "", 2166136261u, 0, 0, &be_const_str_target_search);
+be_define_const_str(_X0A, "\n", 252472541u, 0, 1, &be_const_str__X2D_X2D_X3A_X2D_X2D);
+be_define_const_str(_X20, " ", 621580159u, 0, 1, &be_const_str__drivers);
+be_define_const_str(_X21_X3D, "!=", 2428715011u, 0, 2, NULL);
+be_define_const_str(_X21_X3D_X3D, "!==", 559817114u, 0, 3, &be_const_str_COLOR_WHITE);
+be_define_const_str(_X23, "#", 638357778u, 0, 1, &be_const_str_gamma);
+be_define_const_str(_X23autoexec_X2Ebat, "#autoexec.bat", 3382890497u, 0, 13, &be_const_str_f);
+be_define_const_str(_X23autoexec_X2Ebe, "#autoexec.be", 1181757091u, 0, 12, &be_const_str__available);
+be_define_const_str(_X23display_X2Eini, "#display.ini", 182218220u, 0, 12, &be_const_str_public_key);
+be_define_const_str(_X23init_X2Ebat, "#init.bat", 3297595077u, 0, 9, &be_const_str_get_object_from_ptr);
+be_define_const_str(_X23preinit_X2Ebe, "#preinit.be", 687035716u, 0, 11, NULL);
+be_define_const_str(_X2502d_X25s_X2502d, "%02d%s%02d", 1587999717u, 0, 10, NULL);
+be_define_const_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, "%04d-%02d-%02dT%02d:%02d:%02d", 3425528601u, 0, 29, &be_const_str_content_flush);
+be_define_const_str(_X25s_X2Eautoconf, "%s.autoconf", 3560383524u, 0, 11, &be_const_str_introspect);
+be_define_const_str(_X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, "<Error: apply new or remove>", 2855507949u, 0, 34, &be_const_str_pixel_count);
+be_define_const_str(_X26lt_X3BNone_X26gt_X3B, "<None>", 2602165498u, 0, 12, NULL);
+be_define_const_str(_X28_X29, "()", 685372826u, 0, 2, &be_const_str_counters);
+be_define_const_str(_X2B, "+", 772578730u, 0, 1, &be_const_str_AudioFileSource);
+be_define_const_str(_X2C, ",", 688690635u, 0, 1, &be_const_str_json_fdump_any);
+be_define_const_str(_X2D_X2D_X3A_X2D_X2D, "--:--", 1370615441u, 0, 5, &be_const_str_can_show);
+be_define_const_str(_X2E, ".", 722245873u, 0, 1, &be_const_str_read13);
be_define_const_str(_X2E_X2E, "..", 2748622605u, 0, 2, NULL);
-be_define_const_str(_X2Eautoconf, ".autoconf", 2524679088u, 0, 9, &be_const_str_CFG_X3A_X20return_code_X3D_X25i);
-be_define_const_str(_X2Ebe, ".be", 1325797348u, 0, 3, &be_const_str_RES_OK);
-be_define_const_str(_X2Ebec, ".bec", 3985273221u, 0, 4, &be_const_str_keys);
-be_define_const_str(_X2Elen, ".len", 850842136u, 0, 4, &be_const_str_send_multicast);
-be_define_const_str(_X2Ep, ".p", 1171526419u, 0, 2, &be_const_str_content_stop);
-be_define_const_str(_X2Ep1, ".p1", 249175686u, 0, 3, NULL);
-be_define_const_str(_X2Ep2, ".p2", 232398067u, 0, 3, &be_const_str_GET);
-be_define_const_str(_X2Esize, ".size", 1965188224u, 0, 5, &be_const_str__X3D);
-be_define_const_str(_X2Etapp, ".tapp", 1363391594u, 0, 5, &be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E);
-be_define_const_str(_X2Ew, ".w", 1255414514u, 0, 2, &be_const_str_event_send);
-be_define_const_str(_X2F, "/", 705468254u, 0, 1, &be_const_str_setitem);
-be_define_const_str(_X2F_X2Eautoconf, "/.autoconf", 2212074393u, 0, 10, &be_const_str_BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20);
-be_define_const_str(_X2F_X3Frst_X3D, "/?rst=", 580074707u, 0, 6, &be_const_str_cb_event_closure);
-be_define_const_str(_X2Fac, "/ac", 3904651978u, 0, 3, &be_const_str__anonymous_);
-be_define_const_str(_X3A, ":", 1057798253u, 0, 1, &be_const_str_BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29);
-be_define_const_str(_X3C, "<", 957132539u, 0, 1, &be_const_str_readline);
-be_define_const_str(_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "
", 3546571739u, 0, 11, &be_const_str_autorun);
-be_define_const_str(_X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "", 1863865923u, 0, 16, &be_const_str_add_rule);
-be_define_const_str(_X3C_X3D, "<=", 2499223986u, 0, 2, &be_const_str_asstring);
-be_define_const_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, "", 3147934216u, 0, 82, &be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20);
-be_define_const_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, "", 1205771629u, 0, 72, NULL);
-be_define_const_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, "", 2052843416u, 0, 25, &be_const_str_find_op);
-be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "", 452285201u, 0, 120, &be_const_str_CFG_X3A_X20loading_X20);
-be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, "", 3546571739u, 0, 11, &be_const_str_keys);
+be_define_const_str(_X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "", 1863865923u, 0, 16, &be_const_str__global_def);
+be_define_const_str(_X3C_X3D, "<=", 2499223986u, 0, 2, &be_const_str_OPTION_A);
+be_define_const_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, "", 3147934216u, 0, 82, &be_const_str_draw_line);
+be_define_const_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, "", 1205771629u, 0, 72, &be_const_str_POST);
+be_define_const_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, "", 2052843416u, 0, 25, &be_const_str_register_button_encoder);
+be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "", 452285201u, 0, 120, &be_const_str_due);
+be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, "