-
Notifications
You must be signed in to change notification settings - Fork 89
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
Draft
carylhubin
wants to merge
1
commit into
lvgl-micropython:main
Choose a base branch
from
carylhubin:lvgl_api_gen_mpy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+19
−16
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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? |
||
|
|
||
| stdout.close() | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.