LVGL allow access to `lv.LAYOUT_GRID` and `lv.LAYOUT_FLEX` (#17948)

This commit is contained in:
s-hadinger 2023-02-14 19:41:26 +01:00 committed by GitHub
parent b9281e5186
commit fcec5a5b7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 2 deletions

View File

@ -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) - TM1638 button and led support are handled as virtual switches and relays (#11031)
### Changed ### Changed
- LVGL allow access to `lv.LAYOUT_GRID` and `lv.LAYOUT_FLEX`
### Fixed ### Fixed
- ESP8266 Fix TLS SNI which would prevent AWS IoT connection (#17936) - ESP8266 Fix TLS SNI which would prevent AWS IoT connection (#17936)

View File

@ -8,15 +8,19 @@
#include "lvgl.h" #include "lvgl.h"
#include "be_mapping.h" #include "be_mapping.h"
#include "be_ctypes.h"
#include "lv_berry.h" #include "lv_berry.h"
#include "lv_theme_haspmota.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_member(bvm *vm); // resolve virtual members
extern int lv0_load_font(bvm *vm); extern int lv0_load_font(bvm *vm);
extern lv_ts_calibration_t * lv_get_ts_calibration(void); extern lv_ts_calibration_t * lv_get_ts_calibration(void);
static int lv_get_hor_res(void) { static int lv_get_hor_res(void) {
return lv_disp_get_hor_res(lv_disp_get_default()); 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_NONE", be_cconst_int(LV_LAYER_TYPE_NONE) },
{ "LAYER_TYPE_SIMPLE", be_cconst_int(LV_LAYER_TYPE_SIMPLE) }, { "LAYER_TYPE_SIMPLE", be_cconst_int(LV_LAYER_TYPE_SIMPLE) },
{ "LAYER_TYPE_TRANSFORM", be_cconst_int(LV_LAYER_TYPE_TRANSFORM) }, { "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) }, { "LED_DRAW_PART_RECTANGLE", be_cconst_int(LV_LED_DRAW_PART_RECTANGLE) },
{ "LOG_LEVEL_ERROR", be_cconst_int(LV_LOG_LEVEL_ERROR) }, { "LOG_LEVEL_ERROR", be_cconst_int(LV_LOG_LEVEL_ERROR) },
{ "LOG_LEVEL_INFO", be_cconst_int(LV_LOG_LEVEL_INFO) }, { "LOG_LEVEL_INFO", be_cconst_int(LV_LOG_LEVEL_INFO) },

View File

@ -12,6 +12,8 @@ anim_path_ease_out=&lv_anim_path_ease_out
anim_path_linear=&lv_anim_path_linear anim_path_linear=&lv_anim_path_linear
anim_path_overshoot=&lv_anim_path_overshoot anim_path_overshoot=&lv_anim_path_overshoot
anim_path_step=&lv_anim_path_step anim_path_step=&lv_anim_path_step
LV_LAYOUT_GRID=>be_LV_LAYOUT_GRID
LV_LAYOUT_FLEX=>be_LV_LAYOUT_FLEX
// ====================================================================== // ======================================================================
// Colors // Colors

View File

@ -49,6 +49,8 @@ be_local_closure(lv_extra__anonymous_, /* name */
/*******************************************************************/ /*******************************************************************/
extern const bclass be_class_lv_coord_arr;
/******************************************************************** /********************************************************************
** Solidified function: init ** Solidified function: init
********************************************************************/ ********************************************************************/
@ -217,6 +219,8 @@ be_local_class(lv_coord_arr,
be_str_weak(lv_coord_arr) be_str_weak(lv_coord_arr)
); );
extern const bclass be_class_lv_point_arr;
/******************************************************************** /********************************************************************
** Solidified function: init ** Solidified function: init
********************************************************************/ ********************************************************************/
@ -319,6 +323,8 @@ be_local_class(lv_point_arr,
be_str_weak(lv_point_arr) be_str_weak(lv_point_arr)
); );
extern const bclass be_class_lv_style_prop_arr;
/******************************************************************** /********************************************************************
** Solidified function: init ** Solidified function: init
********************************************************************/ ********************************************************************/

View File

@ -4,6 +4,8 @@
\********************************************************************/ \********************************************************************/
#include "be_constobj.h" #include "be_constobj.h"
extern const bclass be_class_LVGL_glob;
/******************************************************************** /********************************************************************
** Solidified function: get_object_from_ptr ** Solidified function: get_object_from_ptr
********************************************************************/ ********************************************************************/

View File

@ -718,15 +718,19 @@ print("""/********************************************************************
#include "lvgl.h" #include "lvgl.h"
#include "be_mapping.h" #include "be_mapping.h"
#include "be_ctypes.h"
#include "lv_berry.h" #include "lv_berry.h"
#include "lv_theme_haspmota.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_member(bvm *vm); // resolve virtual members
extern int lv0_load_font(bvm *vm); extern int lv0_load_font(bvm *vm);
extern lv_ts_calibration_t * lv_get_ts_calibration(void); extern lv_ts_calibration_t * lv_get_ts_calibration(void);
static int lv_get_hor_res(void) { static int lv_get_hor_res(void) {
return lv_disp_get_hor_res(lv_disp_get_default()); 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_string"
if v[0] == '&': v_prefix = "&"; v_macro = "be_cconst_ptr" 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_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}) }},") print(f" {{ \"{v_prefix}{k}\", {v_macro}({v}) }},")
else: else:
print(f" {{ \"{k}\", be_cconst_int(LV_{k}) }},") print(f" {{ \"{k}\", be_cconst_int(LV_{k}) }},")

View File

@ -213,6 +213,8 @@ anim_path_ease_out=&lv_anim_path_ease_out
anim_path_linear=&lv_anim_path_linear anim_path_linear=&lv_anim_path_linear
anim_path_overshoot=&lv_anim_path_overshoot anim_path_overshoot=&lv_anim_path_overshoot
anim_path_step=&lv_anim_path_step anim_path_step=&lv_anim_path_step
LV_LAYOUT_GRID=>be_LV_LAYOUT_GRID
LV_LAYOUT_FLEX=>be_LV_LAYOUT_FLEX
// ====================================================================== // ======================================================================
// Colors // Colors