From c587fc4d2a669d13de25d9c60c98541d98f7de0b Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 12 Apr 2021 12:42:51 +0200 Subject: [PATCH] fix(obj) move lv_event_dsc_t into lv_obj.c from lv_obj.h It keeps the list of global types shorter --- src/core/lv_obj.c | 5 +++++ src/core/lv_obj.h | 10 +++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/core/lv_obj.c b/src/core/lv_obj.c index 3d67abdf49..1dcce7eba7 100644 --- a/src/core/lv_obj.c +++ b/src/core/lv_obj.c @@ -56,6 +56,11 @@ typedef struct { const lv_anim_path_t * path; }trans_set_t; +typedef struct _lv_event_dsc_t{ + lv_event_cb_t cb; + void * user_data; +}lv_event_dsc_t; + /********************** * STATIC PROTOTYPES **********************/ diff --git a/src/core/lv_obj.h b/src/core/lv_obj.h index d954bdf1ce..59803eae67 100644 --- a/src/core/lv_obj.h +++ b/src/core/lv_obj.h @@ -34,6 +34,7 @@ extern "C" { **********************/ struct _lv_obj_t; +struct _lv_event_dsc_t; /*--------------------- * EVENTS @@ -97,11 +98,6 @@ typedef enum { */ typedef void (*lv_event_cb_t)(struct _lv_obj_t * obj, lv_event_t event); -typedef struct { - lv_event_cb_t cb; - void * user_data; -}lv_event_dsc_t; - /*--------------------- * EVENTS *---------------------*/ @@ -213,7 +209,7 @@ typedef struct { uint32_t child_cnt; /**< Number of children*/ lv_group_t * group_p; - lv_event_dsc_t * event_dsc; /**< Dynamically allocated event callback and user data array*/ + struct _lv_event_dsc_t * event_dsc; /**< Dynamically allocated event callback and user data array*/ lv_point_t scroll; /**< The current X/Y scroll offset*/ uint8_t ext_click_pad; /**< Extra click padding in all direction*/ @@ -444,7 +440,7 @@ bool lv_obj_has_state(const lv_obj_t * obj, lv_state_t state); * @param id the index of the event callback. 0: the firstly added * @return the event descriptor */ -lv_event_dsc_t * lv_obj_get_event_dsc(const lv_obj_t * obj, uint32_t id); +struct _lv_event_dsc_t * lv_obj_get_event_dsc(const lv_obj_t * obj, uint32_t id); /** * Get the group of the object