Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LVGL compilation of lv_menu #22188

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ All notable changes to this project will be documented in this file.
- Autoconf prevent 'init.bat' from stopping on empty lines (#22158)
- Compilation exception when metrics not found (#22170)
- ESP8266 Exception 3 on tasmota-minimal caused by unaligned PROGMEM (#22169)
- LVGL compilation of lv_menu

### Removed

Expand Down
20 changes: 20 additions & 0 deletions lib/libesp32_lvgl/lv_binding_berry/generate/LVGL_API_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,26 @@ set_day_names|comptr||[lv_calendar_set_day_names](https://docs.lvgl.io/9.0/searc
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_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`

Method|Arguments|Return type|LVGL equivalent
:---|:---|:---|:---

### widget `lv.menu_cont`

Method|Arguments|Return type|LVGL equivalent
:---|:---|:---|:---

### widget `lv.menu_section`

Method|Arguments|Return type|LVGL equivalent
:---|:---|:---|:---

### widget `lv.menu_separator`

Method|Arguments|Return type|LVGL equivalent
:---|:---|:---|:---

### widget `lv.menu`

Method|Arguments|Return type|LVGL equivalent
Expand Down
68 changes: 56 additions & 12 deletions lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,30 @@ const be_ntv_func_def_t lv_menu_func[] = {
};
#endif // BE_LV_WIDGET_MENU

/* `lv_menu_page` methods */
#ifdef BE_LV_WIDGET_MENU_PAGE
const be_ntv_func_def_t lv_menu_page_func[] = {
};
#endif // BE_LV_WIDGET_MENU_PAGE

/* `lv_menu_cont` methods */
#ifdef BE_LV_WIDGET_MENU_CONT
const be_ntv_func_def_t lv_menu_cont_func[] = {
};
#endif // BE_LV_WIDGET_MENU_CONT

/* `lv_menu_section` methods */
#ifdef BE_LV_WIDGET_MENU_SECTION
const be_ntv_func_def_t lv_menu_section_func[] = {
};
#endif // BE_LV_WIDGET_MENU_SECTION

/* `lv_menu_separator` methods */
#ifdef BE_LV_WIDGET_MENU_SEPARATOR
const be_ntv_func_def_t lv_menu_separator_func[] = {
};
#endif // BE_LV_WIDGET_MENU_SEPARATOR

/* `lv_msgbox` methods */
#ifdef BE_LV_WIDGET_MSGBOX
const be_ntv_func_def_t lv_msgbox_func[] = {
Expand Down Expand Up @@ -1423,6 +1447,10 @@ extern const bclass be_class_lv_led;
extern const bclass be_class_lv_line;
extern const bclass be_class_lv_list;
extern const bclass be_class_lv_menu;
extern const bclass be_class_lv_menu_cont;
extern const bclass be_class_lv_menu_page;
extern const bclass be_class_lv_menu_section;
extern const bclass be_class_lv_menu_separator;
extern const bclass be_class_lv_msgbox;
extern const bclass be_class_lv_obj;
extern const bclass be_class_lv_qrcode;
Expand Down Expand Up @@ -1507,6 +1535,18 @@ const be_ntv_class_def_t lv_classes[] = {
#ifdef BE_LV_WIDGET_MENU
{ "lv_menu", &be_class_lv_menu, lv_menu_func, sizeof(lv_menu_func) / sizeof(lv_menu_func[0]) },
#endif // BE_LV_WIDGET_MENU
#ifdef BE_LV_WIDGET_MENU_CONT
{ "lv_menu_cont", &be_class_lv_menu_cont, lv_menu_cont_func, sizeof(lv_menu_cont_func) / sizeof(lv_menu_cont_func[0]) },
#endif // BE_LV_WIDGET_MENU_CONT
#ifdef BE_LV_WIDGET_MENU_PAGE
{ "lv_menu_page", &be_class_lv_menu_page, lv_menu_page_func, sizeof(lv_menu_page_func) / sizeof(lv_menu_page_func[0]) },
#endif // BE_LV_WIDGET_MENU_PAGE
#ifdef BE_LV_WIDGET_MENU_SECTION
{ "lv_menu_section", &be_class_lv_menu_section, lv_menu_section_func, sizeof(lv_menu_section_func) / sizeof(lv_menu_section_func[0]) },
#endif // BE_LV_WIDGET_MENU_SECTION
#ifdef BE_LV_WIDGET_MENU_SEPARATOR
{ "lv_menu_separator", &be_class_lv_menu_separator, lv_menu_separator_func, sizeof(lv_menu_separator_func) / sizeof(lv_menu_separator_func[0]) },
#endif // BE_LV_WIDGET_MENU_SEPARATOR
#ifdef BE_LV_WIDGET_MSGBOX
{ "lv_msgbox", &be_class_lv_msgbox, lv_msgbox_func, sizeof(lv_msgbox_func) / sizeof(lv_msgbox_func[0]) },
#endif // BE_LV_WIDGET_MSGBOX
Expand Down Expand Up @@ -1655,21 +1695,25 @@ const size_t lv_classes_size = sizeof(lv_classes) / sizeof(lv_classes[0]);
int be_ntv_lv_list_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_list_create, "+_p", "(lv.obj)"); }
#endif // BE_LV_WIDGET_LIST
/* `lv_menu` methods */
#ifdef BE_LV_WIDGET_MENU
int be_ntv_lv_menu_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_menu_cont_create, "+_p", "(lv.obj)"); }
#endif // BE_LV_WIDGET_MENU
#ifdef BE_LV_WIDGET_MENU
int be_ntv_lv_menu_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_menu_create, "+_p", "(lv.obj)"); }
#endif // BE_LV_WIDGET_MENU
#ifdef BE_LV_WIDGET_MENU
int be_ntv_lv_menu_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_menu_page_create, "+_p", "(lv.obj)c"); }
#endif // BE_LV_WIDGET_MENU
#ifdef BE_LV_WIDGET_MENU
int be_ntv_lv_menu_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_menu_section_create, "+_p", "(lv.obj)"); }
#endif // BE_LV_WIDGET_MENU
#ifdef BE_LV_WIDGET_MENU
int be_ntv_lv_menu_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_menu_separator_create, "+_p", "(lv.obj)"); }
#endif // BE_LV_WIDGET_MENU
/* `lv_menu_page` methods */
#ifdef BE_LV_WIDGET_MENU_PAGE
int be_ntv_lv_menu_page_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_menu_page_create, "+_p", "(lv.obj)c"); }
#endif // BE_LV_WIDGET_MENU_PAGE
/* `lv_menu_cont` methods */
#ifdef BE_LV_WIDGET_MENU_CONT
int be_ntv_lv_menu_cont_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_menu_cont_create, "+_p", "(lv.obj)"); }
#endif // BE_LV_WIDGET_MENU_CONT
/* `lv_menu_section` methods */
#ifdef BE_LV_WIDGET_MENU_SECTION
int be_ntv_lv_menu_section_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_menu_section_create, "+_p", "(lv.obj)"); }
#endif // BE_LV_WIDGET_MENU_SECTION
/* `lv_menu_separator` methods */
#ifdef BE_LV_WIDGET_MENU_SEPARATOR
int be_ntv_lv_menu_separator_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_menu_separator_create, "+_p", "(lv.obj)"); }
#endif // BE_LV_WIDGET_MENU_SEPARATOR
/* `lv_msgbox` methods */
#ifdef BE_LV_WIDGET_MSGBOX
int be_ntv_lv_msgbox_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_msgbox_create, "+_p", "(lv.obj)"); }
Expand Down
52 changes: 52 additions & 0 deletions lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_widgets_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ extern int be_ntv_lv_led_init(bvm *vm);
extern int be_ntv_lv_line_init(bvm *vm);
extern int be_ntv_lv_list_init(bvm *vm);
extern int be_ntv_lv_menu_init(bvm *vm);
extern int be_ntv_lv_menu_page_init(bvm *vm);
extern int be_ntv_lv_menu_cont_init(bvm *vm);
extern int be_ntv_lv_menu_section_init(bvm *vm);
extern int be_ntv_lv_menu_separator_init(bvm *vm);
extern int be_ntv_lv_msgbox_init(bvm *vm);
extern int be_ntv_lv_roller_init(bvm *vm);
extern int be_ntv_lv_scale_init(bvm *vm);
Expand Down Expand Up @@ -100,6 +104,10 @@ extern const bclass be_class_lv_led;
extern const bclass be_class_lv_line;
extern const bclass be_class_lv_list;
extern const bclass be_class_lv_menu;
extern const bclass be_class_lv_menu_cont;
extern const bclass be_class_lv_menu_page;
extern const bclass be_class_lv_menu_section;
extern const bclass be_class_lv_menu_separator;
extern const bclass be_class_lv_msgbox;
extern const bclass be_class_lv_obj;
extern const bclass be_class_lv_qrcode;
Expand Down Expand Up @@ -478,6 +486,50 @@ class be_class_lv_menu (scope: global, name: lv_menu, super: be_class_lv_obj, st
}
@const_object_info_end */

/********************************************************************
** Solidified class: lv_menu_page
********************************************************************/
#include "be_fixed_be_class_lv_menu_page.h"
/* @const_object_info_begin
class be_class_lv_menu_page (scope: global, name: lv_menu_page, super: be_class_lv_obj, strings: weak) {
init, func(be_ntv_lv_menu_page_init)
_class, comptr(&lv_menu_page_class)
}
@const_object_info_end */

/********************************************************************
** Solidified class: lv_menu_cont
********************************************************************/
#include "be_fixed_be_class_lv_menu_cont.h"
/* @const_object_info_begin
class be_class_lv_menu_cont (scope: global, name: lv_menu_cont, super: be_class_lv_obj, strings: weak) {
init, func(be_ntv_lv_menu_cont_init)
_class, comptr(&lv_menu_cont_class)
}
@const_object_info_end */

/********************************************************************
** Solidified class: lv_menu_section
********************************************************************/
#include "be_fixed_be_class_lv_menu_section.h"
/* @const_object_info_begin
class be_class_lv_menu_section (scope: global, name: lv_menu_section, super: be_class_lv_obj, strings: weak) {
init, func(be_ntv_lv_menu_section_init)
_class, comptr(&lv_menu_section_class)
}
@const_object_info_end */

/********************************************************************
** Solidified class: lv_menu_separator
********************************************************************/
#include "be_fixed_be_class_lv_menu_separator.h"
/* @const_object_info_begin
class be_class_lv_menu_separator (scope: global, name: lv_menu_separator, super: be_class_lv_obj, strings: weak) {
init, func(be_ntv_lv_menu_separator_init)
_class, comptr(&lv_menu_separator_class)
}
@const_object_info_end */

/********************************************************************
** Solidified class: lv_msgbox
********************************************************************/
Expand Down
4 changes: 3 additions & 1 deletion lib/libesp32_lvgl/lv_binding_berry/tools/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
lv_widgets_no_class = ['span', 'scale_section'] # widgets that don't have a lv_obj class
# extra widgets
lv_widgets = lv_widgets + [ 'chart', 'imagebutton', 'led', 'msgbox', 'spinbox', 'spinner', 'keyboard', 'tabview', 'tileview' , 'list',
'animimg', 'calendar', 'menu']
'animimg', 'calendar',
'menu_page', 'menu_cont', 'menu_section', 'menu_separator', 'menu_sidebar_cont',
'menu_main_cont', 'menu_sidebar_header', 'menu_main_header_cont', 'menu']

# add qrcode
lv_widgets = lv_widgets + [ 'qrcode' ]
Expand Down
6 changes: 6 additions & 0 deletions tasmota/my_user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,12 @@
#define BE_LV_WIDGET_LED
#define BE_LV_WIDGET_LIST
// #define BE_LV_WIDGET_MENU
#ifdef BE_LV_WIDGET_MENU // if menu is enabled, also enable sub-element classes
#define BE_LV_WIDGET_MENU_CONT
#define BE_LV_WIDGET_MENU_PAGE
#define BE_LV_WIDGET_MENU_SECTION
#define BE_LV_WIDGET_MENU_SEPARATOR
#endif // BE_LV_WIDGET_MENU
#define BE_LV_WIDGET_METER
#define BE_LV_WIDGET_MSGBOX
#define BE_LV_WIDGET_QRCODE
Expand Down