@@ -239,7 +239,7 @@ def get_path(name: str, p: str) -> str:
239239 if args .board == 'win' :
240240 sdl2_include , _ = get_sdl2 ()
241241 cpp_args .append (f'-I"{ sdl2_include } "' )
242-
242+
243243elif sys .platform .startswith ('darwin' ):
244244 cpp_args = ['-std=c11' ]
245245 cpp_path = 'clang'
@@ -583,8 +583,8 @@ def is_struct(type):
583583gen = c_generator .CGenerator ()
584584
585585ast = pycparser .parse_file (
586- args .input [0 ],
587- use_cpp = True ,
586+ args .input [0 ],
587+ use_cpp = True ,
588588 cpp_path = cpp_path ,
589589 cpp_args = cpp_args
590590)
@@ -711,7 +711,7 @@ def my_excepthook(exc_type, exc_value, tb):
711711# # check if it's found in `structs_without_typedef`. It actually has the typedef. Replace type with it.
712712# if typedef.type.name in structs_without_typedef:
713713# typedef.type = structs_without_typedef[struct_name]
714- #
714+ #
715715# 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))
716716structs .update (structs_without_typedef ) # This is for struct without typedef
717717explicit_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):
11611161# Emit Header
11621162#
11631163
1164+ if 'src/core/lv_global.h' not in args .input :
1165+ args .input .append ('src/core/lv_global.h' )
1166+
11641167print ("""
11651168/*
11661169 * Auto-Generated file, DO NOT EDIT!
@@ -1236,7 +1239,7 @@ def register_int_ptr_type(convertor, *types):
12361239#define GENMPY_UNUSED
12371240#endif // __GNUC__
12381241#endif // GENMPY_UNUSED
1239-
1242+
12401243// Custom function mp object
12411244
12421245typedef 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):
13981401
13991402static void mp_lv_delete_cb(lv_event_t * e)
14001403{
1401- LV_OBJ_T *lv_obj = e->current_target ;
1402- if (lv_obj ){
1403- mp_lv_obj_t *self = lv_obj->user_data ;
1404+ lv_obj_t *obj = (lv_obj_t *)lv_event_get_current_target(e) ;
1405+ if (obj ){
1406+ mp_lv_obj_t *self = lv_obj_get_user_data(obj) ;
14041407 if (self) {
14051408 self->lv_obj = NULL;
14061409 }
@@ -1410,7 +1413,7 @@ def register_int_ptr_type(convertor, *types):
14101413static inline mp_obj_t lv_to_mp(LV_OBJ_T *lv_obj)
14111414{
14121415 if (lv_obj == NULL) return mp_const_none;
1413- mp_lv_obj_t *self = (mp_lv_obj_t*)lv_obj->user_data ;
1416+ mp_lv_obj_t *self = (mp_lv_obj_t*)lv_obj_get_user_data( lv_obj) ;
14141417 if (!self)
14151418 {
14161419 // Create the MP object
@@ -1421,7 +1424,7 @@ def register_int_ptr_type(convertor, *types):
14211424 };
14221425
14231426 // Register the Python object in user_data
1424- lv_obj->user_data = self;
1427+ lv_obj_set_user_data( lv_obj, self) ;
14251428
14261429 // Register a "Delete" event callback
14271430 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):
36033606
36043607 import stub_gen
36053608
3606- stub_gen .run (args .metadata )
3609+ stub_gen .run (args .metadata , '' )
36073610
36083611stdout .close ()
36093612
0 commit comments