From 73327b9141ddb8e5360cb7ba2e9e6fcf722e0d16 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Sat, 22 May 2021 14:33:01 +0200 Subject: [PATCH] revert parts of making some struct static for Microbinding compatibility (d73e4201) --- src/core/lv_event.c | 11 ----------- src/core/lv_event.h | 11 +++++++++-- src/core/lv_group.c | 20 -------------------- src/core/lv_group.h | 24 ++++++++++++++++++++++-- src/draw/lv_img_decoder.c | 10 ---------- src/draw/lv_img_decoder.h | 16 ++++++++++++++-- 6 files changed, 45 insertions(+), 47 deletions(-) diff --git a/src/core/lv_event.c b/src/core/lv_event.c index ff5bd6133..71f396fe0 100644 --- a/src/core/lv_event.c +++ b/src/core/lv_event.c @@ -17,17 +17,6 @@ /********************** * TYPEDEFS **********************/ - -typedef struct _lv_event_t { - struct _lv_obj_t * target; - struct _lv_obj_t * current_target; - lv_event_code_t code; - void * user_data; - void * param; - struct _lv_event_t * prev; - uint8_t deleted :1; -}lv_event_t; - typedef struct _lv_event_dsc_t{ lv_event_cb_t cb; void * user_data; diff --git a/src/core/lv_event.h b/src/core/lv_event.h index d5c5af1a6..800c31350 100644 --- a/src/core/lv_event.h +++ b/src/core/lv_event.h @@ -81,8 +81,15 @@ typedef enum { _LV_EVENT_LAST /** Number of default events*/ }lv_event_code_t; -struct _lv_event_t; -typedef struct _lv_event_t lv_event_t; +typedef struct _lv_event_t { + struct _lv_obj_t * target; + struct _lv_obj_t * current_target; + lv_event_code_t code; + void * user_data; + void * param; + struct _lv_event_t * prev; + uint8_t deleted :1; +}lv_event_t; /** * @brief Event callback. diff --git a/src/core/lv_group.c b/src/core/lv_group.c index c017514b1..2692b684c 100644 --- a/src/core/lv_group.c +++ b/src/core/lv_group.c @@ -20,26 +20,6 @@ /********************** * TYPEDEFS **********************/ -/** - * Groups can be used to logically hold objects so that they can be individually focused. - * They are NOT for laying out objects on a screen (try `lv_cont` for that). - */ -typedef struct _lv_group_t { - lv_ll_t obj_ll; /**< Linked list to store the objects in the group*/ - struct _lv_obj_t ** obj_focus; /**< The object in focus*/ - - lv_group_focus_cb_t focus_cb; /**< A function to call when a new object is focused (optional)*/ -#if LV_USE_USER_DATA - void * user_data; -#endif - - uint8_t frozen : 1; /**< 1: can't focus to new object*/ - uint8_t editing : 1; /**< 1: Edit mode, 0: Navigate mode*/ - uint8_t refocus_policy : 1; /**< 1: Focus prev if focused on deletion. 0: Focus next if focused on - 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; /********************** * STATIC PROTOTYPES diff --git a/src/core/lv_group.h b/src/core/lv_group.h index cc0cb4533..84f490db3 100644 --- a/src/core/lv_group.h +++ b/src/core/lv_group.h @@ -45,13 +45,33 @@ typedef uint8_t lv_key_t; /********************** * TYPEDEFS **********************/ -struct _lv_group_t; -typedef struct _lv_group_t lv_group_t; struct _lv_obj_t; typedef void (*lv_group_focus_cb_t)(struct _lv_group_t *); + +/** + * Groups can be used to logically hold objects so that they can be individually focused. + * They are NOT for laying out objects on a screen (try `lv_cont` for that). + */ +typedef struct _lv_group_t { + lv_ll_t obj_ll; /**< Linked list to store the objects in the group*/ + struct _lv_obj_t ** obj_focus; /**< The object in focus*/ + + lv_group_focus_cb_t focus_cb; /**< A function to call when a new object is focused (optional)*/ +#if LV_USE_USER_DATA + void * user_data; +#endif + + uint8_t frozen : 1; /**< 1: can't focus to new object*/ + uint8_t editing : 1; /**< 1: Edit mode, 0: Navigate mode*/ + uint8_t refocus_policy : 1; /**< 1: Focus prev if focused on deletion. 0: Focus next if focused on + 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; + typedef enum { LV_GROUP_REFOCUS_POLICY_NEXT = 0, LV_GROUP_REFOCUS_POLICY_PREV = 1 diff --git a/src/draw/lv_img_decoder.c b/src/draw/lv_img_decoder.c index 0bf13831a..cb42c8fe6 100644 --- a/src/draw/lv_img_decoder.c +++ b/src/draw/lv_img_decoder.c @@ -21,16 +21,6 @@ /********************** * TYPEDEFS **********************/ -typedef struct _lv_img_decoder { - lv_img_decoder_info_f_t info_cb; - lv_img_decoder_open_f_t open_cb; - lv_img_decoder_read_line_f_t read_line_cb; - lv_img_decoder_close_f_t close_cb; - -#if LV_USE_USER_DATA - void * user_data; -#endif -} lv_img_decoder_t; typedef struct { lv_fs_file_t f; diff --git a/src/draw/lv_img_decoder.h b/src/draw/lv_img_decoder.h index 01e28342f..116773451 100644 --- a/src/draw/lv_img_decoder.h +++ b/src/draw/lv_img_decoder.h @@ -42,9 +42,8 @@ typedef uint8_t lv_img_src_t; /*Decoder function definitions*/ -struct _lv_img_decoder; -typedef struct _lv_img_decoder lv_img_decoder_t; struct _lv_img_decoder_dsc; +struct _lv_img_decoder; /** * Get info from an image and store in the `header` @@ -84,6 +83,19 @@ typedef lv_res_t (*lv_img_decoder_read_line_f_t)(struct _lv_img_decoder * decode */ typedef void (*lv_img_decoder_close_f_t)(struct _lv_img_decoder * decoder, struct _lv_img_decoder_dsc * dsc); + +typedef struct _lv_img_decoder { + lv_img_decoder_info_f_t info_cb; + lv_img_decoder_open_f_t open_cb; + lv_img_decoder_read_line_f_t read_line_cb; + lv_img_decoder_close_f_t close_cb; + +#if LV_USE_USER_DATA + void * user_data; +#endif +} lv_img_decoder_t; + + /**Describe an image decoding session. Stores data about the decoding*/ typedef struct _lv_img_decoder_dsc { /**The decoder which was able to open the image source*/