-
Notifications
You must be signed in to change notification settings - Fork 90
Updated LVGL defs from 8.x to LVGL 9.x #509
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -239,7 +239,7 @@ def get_path(name: str, p: str) -> str: | |
| if args.board == 'win': | ||
| sdl2_include, _ = get_sdl2() | ||
| cpp_args.append(f'-I"{sdl2_include}"') | ||
|
|
||
| elif sys.platform.startswith('darwin'): | ||
| cpp_args = ['-std=c11'] | ||
| cpp_path = 'clang' | ||
|
|
@@ -583,8 +583,8 @@ def is_struct(type): | |
| gen = c_generator.CGenerator() | ||
|
|
||
| ast = pycparser.parse_file( | ||
| args.input[0], | ||
| use_cpp=True, | ||
| args.input[0], | ||
| use_cpp=True, | ||
| cpp_path=cpp_path, | ||
| cpp_args=cpp_args | ||
| ) | ||
|
|
@@ -711,7 +711,7 @@ def my_excepthook(exc_type, exc_value, tb): | |
| # # check if it's found in `structs_without_typedef`. It actually has the typedef. Replace type with it. | ||
| # if typedef.type.name in structs_without_typedef: | ||
| # typedef.type = structs_without_typedef[struct_name] | ||
| # | ||
| # | ||
| # structs = collections.OrderedDict((typedef.declname, typedef.type) for typedef in struct_typedefs if typedef.declname and typedef.type.decls) # and not lv_base_obj_pattern.match(typedef.declname)) | ||
| structs.update(structs_without_typedef) # This is for struct without typedef | ||
| explicit_structs = collections.OrderedDict((typedef.type.name, typedef.declname) for typedef in struct_typedefs if typedef.type.name) # and not lv_base_obj_pattern.match(typedef.type.name)) | ||
|
|
@@ -1161,6 +1161,9 @@ def register_int_ptr_type(convertor, *types): | |
| # Emit Header | ||
| # | ||
|
|
||
| if 'src/core/lv_global.h' not in args.input: | ||
| args.input.append('src/core/lv_global.h') | ||
|
|
||
| print (""" | ||
| /* | ||
| * Auto-Generated file, DO NOT EDIT! | ||
|
|
@@ -1236,7 +1239,7 @@ def register_int_ptr_type(convertor, *types): | |
| #define GENMPY_UNUSED | ||
| #endif // __GNUC__ | ||
| #endif // GENMPY_UNUSED | ||
|
|
||
| // Custom function mp object | ||
|
|
||
| typedef mp_obj_t (*mp_fun_ptr_var_t)(size_t n, const mp_obj_t *, void *ptr); | ||
|
|
@@ -1398,9 +1401,9 @@ def register_int_ptr_type(convertor, *types): | |
|
|
||
| static void mp_lv_delete_cb(lv_event_t * e) | ||
| { | ||
| LV_OBJ_T *lv_obj = e->current_target; | ||
| if (lv_obj){ | ||
| mp_lv_obj_t *self = lv_obj->user_data; | ||
| lv_obj_t *obj = (lv_obj_t *)lv_event_get_current_target(e); | ||
| if (obj){ | ||
| mp_lv_obj_t *self = lv_obj_get_user_data(obj); | ||
| if (self) { | ||
| self->lv_obj = NULL; | ||
| } | ||
|
|
@@ -1410,7 +1413,7 @@ def register_int_ptr_type(convertor, *types): | |
| static inline mp_obj_t lv_to_mp(LV_OBJ_T *lv_obj) | ||
| { | ||
| if (lv_obj == NULL) return mp_const_none; | ||
| mp_lv_obj_t *self = (mp_lv_obj_t*)lv_obj->user_data; | ||
| mp_lv_obj_t *self = (mp_lv_obj_t*)lv_obj_get_user_data(lv_obj); | ||
| if (!self) | ||
| { | ||
| // Create the MP object | ||
|
|
@@ -1421,7 +1424,7 @@ def register_int_ptr_type(convertor, *types): | |
| }; | ||
|
|
||
| // Register the Python object in user_data | ||
| lv_obj->user_data = self; | ||
| lv_obj_set_user_data(lv_obj, self); | ||
|
|
||
| // Register a "Delete" event callback | ||
| lv_obj_add_event_cb(lv_obj, mp_lv_delete_cb, LV_EVENT_DELETE, NULL); | ||
|
|
@@ -3603,7 +3606,7 @@ def _iter_metadata(d, indent=0): | |
|
|
||
| import stub_gen | ||
|
|
||
| stub_gen.run(args.metadata) | ||
| stub_gen.run(args.metadata, '') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inside Is this still a work in progress?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes the stub generator is not finished. It has many issues that need to be hammered out. |
||
|
|
||
| stdout.close() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that this macro is used at the top of the files (lvgl + python):
I was wondering if it’s still necessary.