diff --git a/src/core/lv_event.h b/src/core/lv_event.h index 800c31350..f07aa2845 100644 --- a/src/core/lv_event.h +++ b/src/core/lv_event.h @@ -89,7 +89,11 @@ typedef struct _lv_event_t { void * param; struct _lv_event_t * prev; uint8_t deleted :1; -}lv_event_t; +}_lv_event_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_event_t lv_event_t; + /** * @brief Event callback. diff --git a/src/core/lv_group.h b/src/core/lv_group.h index 137216d0c..c1a29f72a 100644 --- a/src/core/lv_group.h +++ b/src/core/lv_group.h @@ -71,7 +71,10 @@ typedef struct _lv_group_t { deletion.*/ uint8_t wrap : 1; /**< 1: Focus next/prev can wrap at end of list. 0: Focus next/prev stops at end of list.*/ -} lv_group_t; +} _lv_group_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_group_t lv_group_t; typedef enum { LV_GROUP_REFOCUS_POLICY_NEXT = 0, diff --git a/src/core/lv_obj.h b/src/core/lv_obj.h index 44b27bcca..d75bd7593 100644 --- a/src/core/lv_obj.h +++ b/src/core/lv_obj.h @@ -171,8 +171,10 @@ typedef struct _lv_obj_t { uint16_t style_cnt :6; uint16_t h_layout :1; uint16_t w_layout :1; -}lv_obj_t; +}_lv_obj_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_obj_t lv_obj_t; /********************** * GLOBAL PROTOTYPES **********************/ diff --git a/src/draw/lv_draw_mask.h b/src/draw/lv_draw_mask.h index c5eaba1de..fe69f9149 100644 --- a/src/draw/lv_draw_mask.h +++ b/src/draw/lv_draw_mask.h @@ -130,7 +130,10 @@ typedef struct { /*Invert the mask. The default is: Keep the left part. *It is used to select left/right/top/bottom*/ uint8_t inv: 1; -} lv_draw_mask_line_param_t; +} _lv_draw_mask_line_param_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_draw_mask_line_param_t lv_draw_mask_line_param_t; typedef struct { /*The first element must be the common descriptor*/ @@ -145,7 +148,10 @@ typedef struct { lv_draw_mask_line_param_t start_line; lv_draw_mask_line_param_t end_line; uint16_t delta_deg; -} lv_draw_mask_angle_param_t; +} _lv_draw_mask_angle_param_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_draw_mask_angle_param_t lv_draw_mask_angle_param_t; typedef struct { /*The first element must be the common descriptor*/ @@ -160,7 +166,10 @@ typedef struct { int32_t y_prev; lv_sqrt_res_t y_prev_x; -} lv_draw_mask_radius_param_t; +} _lv_draw_mask_radius_param_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_draw_mask_radius_param_t lv_draw_mask_radius_param_t; typedef struct { /*The first element must be the common descriptor*/ @@ -174,7 +183,10 @@ typedef struct { lv_opa_t opa_bottom; } cfg; -} lv_draw_mask_fade_param_t; +} _lv_draw_mask_fade_param_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_draw_mask_fade_param_t lv_draw_mask_fade_param_t; typedef struct _lv_draw_mask_map_param_t { /*The first element must be the common descriptor*/ @@ -184,8 +196,10 @@ typedef struct _lv_draw_mask_map_param_t { lv_area_t coords; const lv_opa_t * map; } cfg; -} lv_draw_mask_map_param_t; +} _lv_draw_mask_map_param_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_draw_mask_map_param_t lv_draw_mask_map_param_t; /********************** * GLOBAL PROTOTYPES diff --git a/src/draw/lv_img_buf.h b/src/draw/lv_img_buf.h index ea5f9e4a0..8298923e9 100644 --- a/src/draw/lv_img_buf.h +++ b/src/draw/lv_img_buf.h @@ -180,6 +180,9 @@ typedef struct { } tmp; } _lv_img_transform_dsc_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_img_transform_dsc_t lv_img_transform_dsc_t; + /********************** * GLOBAL PROTOTYPES **********************/ diff --git a/src/extra/widgets/animimg/lv_animimg.h b/src/extra/widgets/animimg/lv_animimg.h index ede6bfac3..cb1923f2c 100644 --- a/src/extra/widgets/animimg/lv_animimg.h +++ b/src/extra/widgets/animimg/lv_animimg.h @@ -33,7 +33,10 @@ typedef struct { /*picture sequence */ lv_img_dsc_t **dsc; int8_t pic_count; -} lv_animimg_t; +} _lv_animimg_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_animimg_t lv_animimg_t; /*Image parts*/ diff --git a/src/extra/widgets/calendar/lv_calendar.h b/src/extra/widgets/calendar/lv_calendar.h index 1fe0c4654..b62cc2908 100644 --- a/src/extra/widgets/calendar/lv_calendar.h +++ b/src/extra/widgets/calendar/lv_calendar.h @@ -44,7 +44,10 @@ typedef struct { uint16_t highlighted_dates_num; /*Number of elements in `highlighted_days`*/ const char * map[8 * 7]; char nums [7 * 6][4]; -} lv_calendar_t; +} _lv_calendar_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_calendar_t lv_calendar_t; extern const lv_obj_class_t lv_calendar_class; diff --git a/src/extra/widgets/chart/lv_chart.h b/src/extra/widgets/chart/lv_chart.h index 304c22f8c..bc769b7ea 100644 --- a/src/extra/widgets/chart/lv_chart.h +++ b/src/extra/widgets/chart/lv_chart.h @@ -69,7 +69,10 @@ typedef struct { uint8_t hidden : 1; uint8_t ext_buf_assigned : 1; lv_chart_axis_t y_axis : 2; -} lv_chart_series_t; +} _lv_chart_series_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_chart_series_t lv_chart_series_t; typedef struct { lv_point_t pos; @@ -78,7 +81,10 @@ typedef struct { lv_chart_series_t * ser; lv_dir_t dir; uint8_t pos_set:1; /*1: pos is set; 0: point_id is set*/ -} lv_chart_cursor_t; +} _lv_chart_cursor_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_chart_cursor_t lv_chart_cursor_t; typedef struct { lv_coord_t major_len; @@ -87,7 +93,10 @@ typedef struct { uint32_t minor_cnt :15; uint32_t major_cnt :15; uint32_t label_en :1; -}lv_chart_tick_dsc_t; +}_lv_chart_tick_dsc_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_chart_tick_dsc_t lv_chart_tick_dsc_t; typedef struct { lv_obj_t obj; @@ -104,7 +113,10 @@ typedef struct { uint16_t zoom_y; lv_chart_type_t type :2; /**< Line or column chart*/ lv_chart_update_mode_t update_mode : 1; -}lv_chart_t; +}_lv_chart_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_chart_t lv_chart_t; extern const lv_obj_class_t lv_chart_class; diff --git a/src/extra/widgets/colorwheel/lv_colorwheel.h b/src/extra/widgets/colorwheel/lv_colorwheel.h index b257af93d..ad1bbb078 100644 --- a/src/extra/widgets/colorwheel/lv_colorwheel.h +++ b/src/extra/widgets/colorwheel/lv_colorwheel.h @@ -46,7 +46,10 @@ typedef struct { lv_point_t last_press_point; lv_colorwheel_mode_t mode : 2; uint8_t mode_fixed : 1; -} lv_colorwheel_t; +} _lv_colorwheel_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_colorwheel_t lv_colorwheel_t; extern const lv_obj_class_t lv_colorwheel_class; diff --git a/src/extra/widgets/imgbtn/lv_imgbtn.h b/src/extra/widgets/imgbtn/lv_imgbtn.h index 20eee9ce2..8a30c1821 100644 --- a/src/extra/widgets/imgbtn/lv_imgbtn.h +++ b/src/extra/widgets/imgbtn/lv_imgbtn.h @@ -40,7 +40,10 @@ typedef struct { const void * img_src_left[_LV_IMGBTN_STATE_NUM]; /*Store left side images to each state*/ const void * img_src_right[_LV_IMGBTN_STATE_NUM]; /*Store right side images to each state*/ lv_img_cf_t act_cf; /*Color format of the currently active image*/ -} lv_imgbtn_t; +} _lv_imgbtn_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_imgbtn_t lv_imgbtn_t; extern const lv_obj_class_t lv_imgbtn_class; diff --git a/src/extra/widgets/keyboard/lv_keyboard.h b/src/extra/widgets/keyboard/lv_keyboard.h index 2aa2f3d11..ba42c3e27 100644 --- a/src/extra/widgets/keyboard/lv_keyboard.h +++ b/src/extra/widgets/keyboard/lv_keyboard.h @@ -49,7 +49,10 @@ typedef struct { lv_btnmatrix_t btnm; lv_obj_t * ta; /*Pointer to the assigned text area*/ lv_keyboard_mode_t mode; /*Key map type*/ -} lv_keyboard_t; +} _lv_keyboard_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_keyboard_t lv_keyboard_t; extern const lv_obj_class_t lv_keyboard_class; diff --git a/src/extra/widgets/led/lv_led.h b/src/extra/widgets/led/lv_led.h index 7c9b350cb..e6d94b7b1 100644 --- a/src/extra/widgets/led/lv_led.h +++ b/src/extra/widgets/led/lv_led.h @@ -31,7 +31,10 @@ typedef struct { lv_obj_t obj; lv_color_t color; uint8_t bright; /**< Current brightness of the LED (0..255)*/ -} lv_led_t; +} _lv_led_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_led_t lv_led_t; extern const lv_obj_class_t lv_led_class; diff --git a/src/extra/widgets/meter/lv_meter.h b/src/extra/widgets/meter/lv_meter.h index 62cc1e72b..d91a6e2bf 100644 --- a/src/extra/widgets/meter/lv_meter.h +++ b/src/extra/widgets/meter/lv_meter.h @@ -44,7 +44,10 @@ typedef struct { int16_t r_mod; uint16_t angle_range; int16_t rotation; -}lv_meter_scale_t; +}_lv_meter_scale_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_meter_scale_t lv_meter_scale_t; typedef enum { LV_METER_INDICATOR_TYPE_NEEDLE_IMG, @@ -82,7 +85,10 @@ typedef struct { uint8_t local_grad :1; }scale_lines; } type_data; -}lv_meter_indicator_t; +}_lv_meter_indicator_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_meter_indicator_t lv_meter_indicator_t; /*Data of line meter*/ @@ -90,7 +96,11 @@ typedef struct { lv_obj_t obj; lv_ll_t scale_ll; lv_ll_t indicator_ll; -} lv_meter_t; +} _lv_meter_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_meter_t lv_meter_t; + extern const lv_obj_class_t lv_meter_class; diff --git a/src/extra/widgets/span/lv_span.h b/src/extra/widgets/span/lv_span.h index 1670b3b58..2c0304003 100644 --- a/src/extra/widgets/span/lv_span.h +++ b/src/extra/widgets/span/lv_span.h @@ -44,7 +44,10 @@ typedef struct { char * txt; lv_style_t style; uint8_t static_flag : 1; -} lv_span_t; +} _lv_span_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_span_t lv_span_t; /** Data of label*/ typedef struct { @@ -54,7 +57,10 @@ typedef struct { uint8_t mode : 2; uint8_t align : 2; uint8_t overflow : 1; -} lv_spangroup_t; +} _lv_spangroup_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_spangroup_t lv_spangroup_t; extern const lv_obj_class_t lv_spangroup_class; diff --git a/src/extra/widgets/spinbox/lv_spinbox.h b/src/extra/widgets/spinbox/lv_spinbox.h index 92000a042..59f35dd14 100644 --- a/src/extra/widgets/spinbox/lv_spinbox.h +++ b/src/extra/widgets/spinbox/lv_spinbox.h @@ -42,7 +42,10 @@ typedef struct { uint16_t digit_count : 4; uint16_t dec_point_pos : 4; /*if 0, there is no separator and the number is an integer*/ uint16_t rollover : 1; // Set to true for rollover functionality -} lv_spinbox_t; +} _lv_spinbox_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_spinbox_t lv_spinbox_t; extern const lv_obj_class_t lv_spinbox_class; diff --git a/src/extra/widgets/tabview/lv_tabview.h b/src/extra/widgets/tabview/lv_tabview.h index 4cfc4971b..811bc4b60 100644 --- a/src/extra/widgets/tabview/lv_tabview.h +++ b/src/extra/widgets/tabview/lv_tabview.h @@ -32,7 +32,10 @@ typedef struct uint16_t tab_cnt; uint16_t tab_cur; lv_dir_t tab_pos; -}lv_tabview_t; +}_lv_tabview_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_tabview_t lv_tabview_t; extern const lv_obj_class_t lv_tabview_class; diff --git a/src/extra/widgets/tileview/lv_tileview.h b/src/extra/widgets/tileview/lv_tileview.h index 79f1acd46..d1c73e956 100644 --- a/src/extra/widgets/tileview/lv_tileview.h +++ b/src/extra/widgets/tileview/lv_tileview.h @@ -27,12 +27,18 @@ extern "C" { typedef struct { lv_obj_t obj; lv_obj_t * tile_act; -}lv_tileview_t; +}_lv_tileview_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_tileview_t lv_tileview_t; typedef struct { lv_obj_t obj; lv_dir_t dir; -}lv_tileview_tile_t; +}_lv_tileview_tile_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_tileview_tile_t lv_tileview_tile_t; extern const lv_obj_class_t lv_tileview_class; extern const lv_obj_class_t lv_tileview_tile_class; diff --git a/src/extra/widgets/win/lv_win.h b/src/extra/widgets/win/lv_win.h index 524596339..1bde470bc 100644 --- a/src/extra/widgets/win/lv_win.h +++ b/src/extra/widgets/win/lv_win.h @@ -24,7 +24,10 @@ extern "C" { **********************/ typedef struct { lv_obj_t obj; -}lv_win_t; +}_lv_win_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_win_t lv_win_t; extern const lv_obj_class_t lv_win_class; diff --git a/src/font/lv_font_fmt_txt.h b/src/font/lv_font_fmt_txt.h index 5a650494b..99750779f 100644 --- a/src/font/lv_font_fmt_txt.h +++ b/src/font/lv_font_fmt_txt.h @@ -43,7 +43,10 @@ typedef struct { int16_t ofs_x; /**< x offset of the bounding box*/ int16_t ofs_y; /**< y offset of the bounding box. Measured from the top of the line*/ #endif -} lv_font_fmt_txt_glyph_dsc_t; +} _lv_font_fmt_txt_glyph_dsc_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_font_fmt_txt_glyph_dsc_t lv_font_fmt_txt_glyph_dsc_t; /** Format of font character map.*/ enum { @@ -110,7 +113,10 @@ typedef struct { /** Type of this character map*/ lv_font_fmt_txt_cmap_type_t type; -} lv_font_fmt_txt_cmap_t; +} _lv_font_fmt_txt_cmap_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_font_fmt_txt_cmap_t lv_font_fmt_txt_cmap_t; /** A simple mapping of kern values from pairs*/ typedef struct { @@ -125,7 +131,10 @@ typedef struct { const int8_t * values; uint32_t pair_cnt : 30; uint32_t glyph_ids_size : 2; /*0: `glyph_ids` is stored as `uint8_t`; 1: as `uint16_t`*/ -} lv_font_fmt_txt_kern_pair_t; +} _lv_font_fmt_txt_kern_pair_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_font_fmt_txt_kern_pair_t lv_font_fmt_txt_kern_pair_t; /** More complex but more optimal class based kern value storage*/ typedef struct { @@ -142,7 +151,10 @@ typedef struct { const uint8_t * right_class_mapping; /*Map the glyph_ids to classes: index -> glyph_id -> class_id*/ uint8_t left_class_cnt; uint8_t right_class_cnt; -} lv_font_fmt_txt_kern_classes_t; +} _lv_font_fmt_txt_kern_classes_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_font_fmt_txt_kern_classes_t lv_font_fmt_txt_kern_classes_t; /** Bitmap formats*/ typedef enum { @@ -154,7 +166,10 @@ typedef enum { typedef struct { uint32_t last_letter; uint32_t last_glyph_id; -}lv_font_fmt_txt_glyph_cache_t; +}_lv_font_fmt_txt_glyph_cache_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_font_fmt_txt_glyph_cache_t lv_font_fmt_txt_glyph_cache_t; /*Describe store additional data for fonts*/ typedef struct { @@ -195,7 +210,10 @@ typedef struct { /*Cache the last letter and is glyph id*/ lv_font_fmt_txt_glyph_cache_t * cache; -} lv_font_fmt_txt_dsc_t; +} _lv_font_fmt_txt_dsc_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_font_fmt_txt_dsc_t lv_font_fmt_txt_dsc_t; /********************** * GLOBAL PROTOTYPES diff --git a/src/hal/lv_hal_disp.h b/src/hal/lv_hal_disp.h index 1e3214f53..d5cbf532f 100644 --- a/src/hal/lv_hal_disp.h +++ b/src/hal/lv_hal_disp.h @@ -60,8 +60,10 @@ typedef struct _lv_disp_draw_buf_t{ volatile int flushing_last; volatile uint32_t last_area : 1; /*1: the last area is being rendered*/ volatile uint32_t last_part : 1; /*1: the last part of the current area is being rendered*/ -} lv_disp_draw_buf_t; +} _lv_disp_draw_buf_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_disp_draw_buf_t lv_disp_draw_buf_t; typedef enum { LV_DISP_ROT_NONE = 0, @@ -174,7 +176,10 @@ typedef struct _lv_disp_t { /*Miscellaneous data*/ uint32_t last_activity_time; /**< Last time when there was activity on this display*/ -} lv_disp_t; +} _lv_disp_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_disp_t lv_disp_t; /********************** * GLOBAL PROTOTYPES diff --git a/src/hal/lv_hal_indev.h b/src/hal/lv_hal_indev.h index 5cdfe243f..a0d0adad0 100644 --- a/src/hal/lv_hal_indev.h +++ b/src/hal/lv_hal_indev.h @@ -179,7 +179,10 @@ typedef struct _lv_indev_t { struct _lv_group_t * group; /**< Keypad destination group*/ const lv_point_t * btn_points; /**< Array points assigned to the button ()screen will be pressed here by the buttons*/ -} lv_indev_t; +} _lv_indev_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_indev_t lv_indev_t; /********************** * GLOBAL PROTOTYPES diff --git a/src/misc/lv_anim.h b/src/misc/lv_anim.h index 2b6215f79..0a8f588a9 100644 --- a/src/misc/lv_anim.h +++ b/src/misc/lv_anim.h @@ -89,8 +89,11 @@ typedef struct _lv_anim_t { uint8_t run_round : 1; /**< Indicates the animation has run in this round*/ uint8_t start_cb_called : 1; /**< Indicates that the `start_cb` was already called*/ uint32_t time_orig; -} lv_anim_t; +} _lv_anim_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_anim_t lv_anim_t; /********************** * GLOBAL PROTOTYPES **********************/ diff --git a/src/misc/lv_ll.h b/src/misc/lv_ll.h index f5ce966a6..20f8e9fc9 100644 --- a/src/misc/lv_ll.h +++ b/src/misc/lv_ll.h @@ -33,7 +33,10 @@ typedef struct { uint32_t n_size; lv_ll_node_t * head; lv_ll_node_t * tail; -} lv_ll_t; +} _lv_ll_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_ll_t lv_ll_t; /********************** * GLOBAL PROTOTYPES diff --git a/src/misc/lv_mem.h b/src/misc/lv_mem.h index bf419f8de..7ea1caf1b 100644 --- a/src/misc/lv_mem.h +++ b/src/misc/lv_mem.h @@ -54,7 +54,10 @@ typedef struct { void * p; uint16_t size; uint8_t used : 1; -} lv_mem_buf_t; +} _lv_mem_buf_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_mem_buf_t lv_mem_buf_t; typedef lv_mem_buf_t lv_mem_buf_arr_t[LV_MEM_BUF_MAX_NUM]; diff --git a/src/misc/lv_style.h b/src/misc/lv_style.h index 033a52501..d457c8f4f 100644 --- a/src/misc/lv_style.h +++ b/src/misc/lv_style.h @@ -242,7 +242,10 @@ typedef struct _lv_style_transiton_t { lv_anim_path_cb_t path_xcb; /**< A path for the animation.*/ uint32_t time; /**< Duration of the transition in [ms]*/ uint32_t delay; /**< Delay before the transition in [ms]*/ -}lv_style_transition_dsc_t; +}_lv_style_transition_dsc_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_style_transition_dsc_t lv_style_transition_dsc_t; /** * Descriptor of a constant style property. @@ -273,7 +276,10 @@ typedef struct { uint16_t is_const :1; uint8_t has_group; uint8_t prop_cnt; -} lv_style_t; +} _lv_style_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_style_t lv_style_t; /********************** * GLOBAL PROTOTYPES diff --git a/src/misc/lv_timer.h b/src/misc/lv_timer.h index 015543734..98595a3d1 100644 --- a/src/misc/lv_timer.h +++ b/src/misc/lv_timer.h @@ -49,7 +49,10 @@ typedef struct _lv_timer_t { void * user_data; /**< Custom user data*/ int32_t repeat_count; /**< 1: One time; -1 : infinity; n>0: residual times*/ uint32_t paused :1; -} lv_timer_t; +} _lv_timer_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_timer_t lv_timer_t; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/lv_arc.h b/src/widgets/lv_arc.h index 6fbc9b761..27913a793 100644 --- a/src/widgets/lv_arc.h +++ b/src/widgets/lv_arc.h @@ -50,7 +50,10 @@ typedef struct { uint16_t chg_rate; /*Drag angle rate of change of the arc (degrees/sec)*/ uint32_t last_tick; /*Last dragging event timestamp of the arc*/ int16_t last_angle; /*Last dragging angle of the arc*/ -}lv_arc_t; +}_lv_arc_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_arc_t lv_arc_t; extern const lv_obj_class_t lv_arc_class; diff --git a/src/widgets/lv_bar.c b/src/widgets/lv_bar.c index 4a0fbdf03..793be15ce 100644 --- a/src/widgets/lv_bar.c +++ b/src/widgets/lv_bar.c @@ -49,8 +49,8 @@ static void lv_bar_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); static void lv_bar_event(const lv_obj_class_t * class_p, lv_event_t * e); static void draw_indic(lv_event_t * e); static void lv_bar_set_value_with_anim(lv_obj_t * obj, int32_t new_value, int32_t * value_ptr, - lv_bar_anim_t * anim_info, lv_anim_enable_t en); -static void lv_bar_init_anim(lv_obj_t * bar, lv_bar_anim_t * bar_anim); + _lv_bar_anim_t * anim_info, lv_anim_enable_t en); +static void lv_bar_init_anim(lv_obj_t * bar, _lv_bar_anim_t * bar_anim); static void lv_bar_anim(void * bar, int32_t value); static void lv_bar_anim_ready(lv_anim_t * a); @@ -530,14 +530,14 @@ static void lv_bar_event(const lv_obj_class_t * class_p, lv_event_t * e) static void lv_bar_anim(void * var, int32_t value) { - lv_bar_anim_t * bar_anim = var; + _lv_bar_anim_t * bar_anim = var; bar_anim->anim_state = value; lv_obj_invalidate(bar_anim->bar); } static void lv_bar_anim_ready(lv_anim_t * a) { - lv_bar_anim_t * var = a->var; + _lv_bar_anim_t * var = a->var; lv_obj_t * obj = (lv_obj_t *)var->bar; lv_bar_t * bar = (lv_bar_t *)obj; @@ -550,7 +550,7 @@ static void lv_bar_anim_ready(lv_anim_t * a) } static void lv_bar_set_value_with_anim(lv_obj_t * obj, int32_t new_value, int32_t * value_ptr, - lv_bar_anim_t * anim_info, lv_anim_enable_t en) + _lv_bar_anim_t * anim_info, lv_anim_enable_t en) { if(en == LV_ANIM_OFF) { *value_ptr = new_value; @@ -582,7 +582,7 @@ static void lv_bar_set_value_with_anim(lv_obj_t * obj, int32_t new_value, int32_ } } -static void lv_bar_init_anim(lv_obj_t * obj, lv_bar_anim_t * bar_anim) +static void lv_bar_init_anim(lv_obj_t * obj, _lv_bar_anim_t * bar_anim) { bar_anim->bar = obj; bar_anim->anim_start = 0; diff --git a/src/widgets/lv_bar.h b/src/widgets/lv_bar.h index b5cc5d610..fc5fc8ac2 100644 --- a/src/widgets/lv_bar.h +++ b/src/widgets/lv_bar.h @@ -42,7 +42,7 @@ typedef struct { int32_t anim_start; int32_t anim_end; int32_t anim_state; -} lv_bar_anim_t; +} _lv_bar_anim_t; typedef struct { lv_obj_t obj; @@ -51,10 +51,13 @@ typedef struct { int32_t max_value; /**< Maximum value of the bar*/ int32_t start_value; /**< Start value of the bar*/ lv_area_t indic_area; /**< Save the indicator area. Might be used by derived types*/ - lv_bar_anim_t cur_value_anim; - lv_bar_anim_t start_value_anim; + _lv_bar_anim_t cur_value_anim; + _lv_bar_anim_t start_value_anim; lv_bar_mode_t mode : 2; /**< Type of bar*/ -}lv_bar_t; +}_lv_bar_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_bar_t lv_bar_t; extern const lv_obj_class_t lv_bar_class; diff --git a/src/widgets/lv_btn.h b/src/widgets/lv_btn.h index 8a5af5102..6c2dc9e27 100644 --- a/src/widgets/lv_btn.h +++ b/src/widgets/lv_btn.h @@ -28,7 +28,10 @@ extern "C" { typedef struct { lv_obj_t obj; -}lv_btn_t; +}_lv_btn_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_btn_t lv_btn_t; extern const lv_obj_class_t lv_btn_class; diff --git a/src/widgets/lv_btnmatrix.h b/src/widgets/lv_btnmatrix.h index 8561d3a64..b556154b6 100644 --- a/src/widgets/lv_btnmatrix.h +++ b/src/widgets/lv_btnmatrix.h @@ -58,7 +58,10 @@ typedef struct { uint16_t btn_cnt; /*Number of button in 'map_p'(Handled by the library)*/ uint16_t btn_id_sel; /*Index of the active button (being pressed/released etc) or LV_BTNMATRIX_BTN_NONE*/ uint8_t one_check : 1; /*Single button toggled at once*/ -} lv_btnmatrix_t; +} _lv_btnmatrix_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_btnmatrix_t lv_btnmatrix_t; extern const lv_obj_class_t lv_btnmatrix_class; diff --git a/src/widgets/lv_canvas.h b/src/widgets/lv_canvas.h index d8c3148ea..a2e27d022 100644 --- a/src/widgets/lv_canvas.h +++ b/src/widgets/lv_canvas.h @@ -32,7 +32,10 @@ extern "C" { typedef struct { lv_img_t img; lv_img_dsc_t dsc; -} lv_canvas_t; +} _lv_canvas_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_canvas_t lv_canvas_t; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/lv_checkbox.h b/src/widgets/lv_checkbox.h index a1027a021..36f750bbd 100644 --- a/src/widgets/lv_checkbox.h +++ b/src/widgets/lv_checkbox.h @@ -30,7 +30,10 @@ typedef struct { lv_obj_t obj; char * txt; uint32_t static_txt :1; -}lv_checkbox_t; +}_lv_checkbox_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_checkbox_t lv_checkbox_t; extern const lv_obj_class_t lv_checkbox_class; diff --git a/src/widgets/lv_dropdown.h b/src/widgets/lv_dropdown.h index 9cf81a047..143602f4a 100644 --- a/src/widgets/lv_dropdown.h +++ b/src/widgets/lv_dropdown.h @@ -48,12 +48,18 @@ typedef struct { lv_dir_t dir :4; /**< Direction in which the list should open*/ uint8_t static_txt :1; /**< 1: Only a pointer is saved in `options`*/ uint8_t selected_highlight:1; /**< 1: Make the selected option highlighted in the list*/ -}lv_dropdown_t; +}_lv_dropdown_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_dropdown_t lv_dropdown_t; typedef struct { lv_obj_t obj; lv_obj_t * dropdown; -}lv_dropdown_list_t; +}_lv_dropdown_list_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_dropdown_list_t lv_dropdown_list_t; extern const lv_obj_class_t lv_dropdown_class; extern const lv_obj_class_t lv_dropdownlist_class; diff --git a/src/widgets/lv_img.h b/src/widgets/lv_img.h index f731eae91..0a7e2ee4e 100644 --- a/src/widgets/lv_img.h +++ b/src/widgets/lv_img.h @@ -41,7 +41,10 @@ typedef struct { uint8_t src_type : 2; /*See: lv_img_src_t*/ uint8_t cf : 5; /*Color format from `lv_img_color_format_t`*/ uint8_t antialias : 1; /*Apply anti-aliasing in transformations (rotate, zoom)*/ -} lv_img_t; +} _lv_img_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_img_t lv_img_t; extern const lv_obj_class_t lv_img_class; diff --git a/src/widgets/lv_label.h b/src/widgets/lv_label.h index 2bbfc86f3..bf486833c 100644 --- a/src/widgets/lv_label.h +++ b/src/widgets/lv_label.h @@ -73,7 +73,10 @@ typedef struct { uint8_t recolor : 1; /*Enable in-line letter re-coloring*/ uint8_t expand : 1; /*Ignore real width (used by the library with LV_LABEL_LONG_SROLL)*/ uint8_t dot_tmp_alloc : 1; /*1: dot_tmp has been allocated;.0: dot_tmp directly holds up to 4 bytes of characters*/ -}lv_label_t; +}_lv_label_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_label_t lv_label_t; extern const lv_obj_class_t lv_label_class; diff --git a/src/widgets/lv_line.h b/src/widgets/lv_line.h index 4ba05e88f..967ce2c66 100644 --- a/src/widgets/lv_line.h +++ b/src/widgets/lv_line.h @@ -33,7 +33,10 @@ typedef struct { const lv_point_t * point_array; /**< Pointer to an array with the points of the line*/ uint16_t point_num; /**< Number of points in 'point_array'*/ uint8_t y_inv : 1; /**< 1: y == 0 will be on the bottom*/ -} lv_line_t; +} _lv_line_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_line_t lv_line_t; extern const lv_obj_class_t lv_line_class; diff --git a/src/widgets/lv_roller.h b/src/widgets/lv_roller.h index 24202734b..c005582d0 100644 --- a/src/widgets/lv_roller.h +++ b/src/widgets/lv_roller.h @@ -43,7 +43,11 @@ typedef struct { uint16_t sel_opt_id_ori; /**< Store the original index on focus*/ lv_roller_mode_t mode : 1; uint32_t moved : 1; -}lv_roller_t; +}_lv_roller_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_roller_t lv_roller_t; + extern const lv_obj_class_t lv_roller_class; diff --git a/src/widgets/lv_slider.h b/src/widgets/lv_slider.h index 2cf44d4c1..32ab5d71c 100644 --- a/src/widgets/lv_slider.h +++ b/src/widgets/lv_slider.h @@ -47,7 +47,10 @@ typedef struct { int32_t * value_to_set; /*Which bar value to set*/ uint8_t dragging : 1; /*1: the slider is being dragged*/ uint8_t left_knob_focus : 1; /*1: with encoder now the right knob can be adjusted*/ -}lv_slider_t; +}_lv_slider_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_slider_t lv_slider_t; extern const lv_obj_class_t lv_slider_class; diff --git a/src/widgets/lv_switch.h b/src/widgets/lv_switch.h index caf7460bc..31b82a887 100644 --- a/src/widgets/lv_switch.h +++ b/src/widgets/lv_switch.h @@ -34,8 +34,10 @@ extern "C" { typedef struct { lv_obj_t obj; -}lv_switch_t; +}_lv_switch_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_switch_t lv_switch_t; extern const lv_obj_class_t lv_switch_class; diff --git a/src/widgets/lv_table.h b/src/widgets/lv_table.h index cd87e19b7..d3eab049b 100644 --- a/src/widgets/lv_table.h +++ b/src/widgets/lv_table.h @@ -56,7 +56,10 @@ typedef struct { lv_coord_t * col_w; uint16_t col_act; uint16_t row_act; -} lv_table_t; +} _lv_table_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_table_t lv_table_t; extern const lv_obj_class_t lv_table_class; diff --git a/src/widgets/lv_textarea.h b/src/widgets/lv_textarea.h index 0964416d4..479112934 100644 --- a/src/widgets/lv_textarea.h +++ b/src/widgets/lv_textarea.h @@ -63,7 +63,10 @@ typedef struct { #endif uint8_t pwd_mode : 1; /*Replace characters with '*'*/ uint8_t one_line : 1; /*One line mode (ignore line breaks)*/ -} lv_textarea_t; +} _lv_textarea_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef _lv_textarea_t lv_textarea_t; extern const lv_obj_class_t lv_textarea_class;