From e153ccd1c1180e3db5e439330eac8464e19cc45e Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 26 Mar 2021 06:16:57 -0500 Subject: [PATCH] fix(style_api_gen.py): change lv_color_filter_cb_t to lv_color_filter_dsc_t (#2162) and update the generated style header files --- scripts/style_api_gen.py | 6 ++---- src/core/lv_obj_style_gen.h | 2 +- src/misc/lv_style_gen.h | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/style_api_gen.py b/scripts/style_api_gen.py index 20f593aee..2a00199fd 100755 --- a/scripts/style_api_gen.py +++ b/scripts/style_api_gen.py @@ -10,7 +10,7 @@ props = [ {'name': 'TRANSFORM_ZOOM', 'style_type': 'num', 'var_type': 'lv_coord_t' }, {'name': 'TRANSFORM_ANGLE', 'style_type': 'num', 'var_type': 'lv_coord_t' }, {'name': 'OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' }, -{'name': 'COLOR_FILTER_CB', 'style_type': 'func', 'var_type': 'lv_color_filter_cb_t' }, +{'name': 'COLOR_FILTER_DSC', 'style_type': 'ptr', 'var_type': 'const lv_color_filter_dsc_t *' }, {'name': 'COLOR_FILTER_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' }, {'name': 'ANIM_TIME', 'style_type': 'num', 'var_type': 'uint32_t' }, {'name': 'TRANSITION', 'style_type': 'ptr', 'var_type': 'const lv_style_transition_dsc_t *' }, @@ -104,9 +104,7 @@ def obj_style_get(p): def get_func_cast(style): func_cast = "" - if style == 'func': - func_cast = "(void (*)(void))" - elif style == 'num': + if style == 'num': func_cast = "(int32_t)" return func_cast diff --git a/src/core/lv_obj_style_gen.h b/src/core/lv_obj_style_gen.h index 43bd87d86..a4b0be81d 100644 --- a/src/core/lv_obj_style_gen.h +++ b/src/core/lv_obj_style_gen.h @@ -550,7 +550,7 @@ static inline void lv_obj_set_style_opa(struct _lv_obj_t * obj, uint32_t part, u static inline void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, uint32_t part, uint32_t state, const lv_color_filter_dsc_t * value) { lv_style_value_t v = { - .ptr = (void *)value + .ptr = value }; lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_COLOR_FILTER_DSC, v); } diff --git a/src/misc/lv_style_gen.h b/src/misc/lv_style_gen.h index 5dcc73576..8963e275a 100644 --- a/src/misc/lv_style_gen.h +++ b/src/misc/lv_style_gen.h @@ -57,7 +57,7 @@ static inline void lv_style_set_opa(lv_style_t * style, lv_opa_t value) static inline void lv_style_set_color_filter_dsc(lv_style_t * style, const lv_color_filter_dsc_t * value) { lv_style_value_t v = { - .ptr = (void *)value + .ptr = value }; lv_style_set_prop(style, LV_STYLE_COLOR_FILTER_DSC, v); }