diff --git a/porting/lv_port_disp_template.c b/porting/lv_port_disp_template.c index 1f4502720..ebd044e68 100644 --- a/porting/lv_port_disp_template.c +++ b/porting/lv_port_disp_template.c @@ -160,7 +160,7 @@ static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_colo /* If your MCU has hardware accelerator (GPU) then you can use it to blend to memories using opacity * It can be used only in buffered mode (LV_VDB_SIZE != 0 in lv_conf.h)*/ -static void mem_blend(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa) +static void mem_blend(lv_disp_drv_t * disp_drv, lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa) { /*It's an example code which should be done by your GPU*/ @@ -172,7 +172,8 @@ static void mem_blend(lv_color_t * dest, const lv_color_t * src, uint32_t length /* If your MCU has hardware accelerator (GPU) then you can use it to fill a memory with a color * It can be used only in buffered mode (LV_VDB_SIZE != 0 in lv_conf.h)*/ -static void mem_fill(lv_color_t * dest, uint32_t length, lv_color_t color) +static void mem_fill(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, const lv_area_t * dest_area, + const lv_area_t * fill_area, lv_color_t color); { /*It's an example code which should be done by your GPU*/ diff --git a/src/lv_core/lv_group.c b/src/lv_core/lv_group.c index e945d5375..5b173b149 100644 --- a/src/lv_core/lv_group.c +++ b/src/lv_core/lv_group.c @@ -618,8 +618,8 @@ static void refresh_theme(lv_group_t * g, lv_theme_t * th) g->style_mod_cb = style_mod_def; g->style_mod_edit_cb = style_mod_edit_def; if(th) { - if(th->group.style_mod_cb) g->style_mod_cb = th->group.style_mod_cb; - if(th->group.style_mod_edit_cb) g->style_mod_edit_cb = th->group.style_mod_edit_cb; + if(th->group.style_mod_xcb) g->style_mod_cb = th->group.style_mod_xcb; + if(th->group.style_mod_edit_xcb) g->style_mod_edit_cb = th->group.style_mod_edit_xcb; } } diff --git a/src/lv_core/lv_obj.c b/src/lv_core/lv_obj.c index abc68354b..ec5b9a370 100644 --- a/src/lv_core/lv_obj.c +++ b/src/lv_core/lv_obj.c @@ -1323,13 +1323,15 @@ lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, const void * data) /** * Call an event function with an object, event, and data. - * @param event_cb an event callback function. If `NULL` `LV_RES_OK` will return without any actions. + * @param event_xcb an event callback function. If `NULL` `LV_RES_OK` will return without any actions. + * (the 'x' in the argument name indicates that its not a fully generic function because it not follows + * the `func_name(object, callback, ...)` convention) * @param obj pointer to an object to associate with the event (can be `NULL` to simply call the `event_cb`) * @param event an event * @param data pointer to a custom data * @return LV_RES_OK: `obj` was not deleted in the event; LV_RES_INV: `obj` was deleted in the event */ -lv_res_t lv_event_send_func(lv_event_cb_t event_cb, lv_obj_t * obj, lv_event_t event, const void * data) +lv_res_t lv_event_send_func(lv_event_cb_t event_xcb, lv_obj_t * obj, lv_event_t event, const void * data) { /* Build a simple linked list from the objects used in the events * It's important to know if an this object was deleted by a nested event @@ -1354,7 +1356,7 @@ lv_res_t lv_event_send_func(lv_event_cb_t event_cb, lv_obj_t * obj, lv_event_t e } /*Call the event callback itself*/ - if(event_cb) event_cb(obj, event); + if(event_xcb) event_xcb(obj, event); /*Restore the event data*/ event_act_data = event_act_data_save; diff --git a/src/lv_core/lv_style.c b/src/lv_core/lv_style.c index 160032144..24d4d2ffc 100644 --- a/src/lv_core/lv_style.c +++ b/src/lv_core/lv_style.c @@ -281,7 +281,7 @@ void lv_style_anim_init(lv_anim_t * a) lv_anim_init(a); a->start = 0; a->end = STYLE_MIX_MAX; - a->exec_cb = (lv_anim_exec_cb_t)style_animator; + a->exec_cb = (lv_anim_exec_xcb_t)style_animator; a->path_cb = lv_anim_path_linear; a->ready_cb = style_animation_common_end_cb; diff --git a/src/lv_misc/lv_anim.c b/src/lv_misc/lv_anim.c index 6961a4927..88ee70057 100644 --- a/src/lv_misc/lv_anim.c +++ b/src/lv_misc/lv_anim.c @@ -111,7 +111,7 @@ void lv_anim_create(lv_anim_t * a) * or NULL to delete all the animations of 'var' * @return true: at least 1 animation is deleted, false: no animation is deleted */ -bool lv_anim_del(void * var, lv_anim_exec_cb_t exec_cb) +bool lv_anim_del(void * var, lv_anim_exec_xcb_t exec_cb) { lv_anim_t * a; lv_anim_t * a_next; diff --git a/src/lv_misc/lv_anim.h b/src/lv_misc/lv_anim.h index bba9d25b4..dae12fd37 100644 --- a/src/lv_misc/lv_anim.h +++ b/src/lv_misc/lv_anim.h @@ -41,8 +41,10 @@ typedef int16_t lv_anim_value_t; /* Generic prototype of "animator" functions. * First parameter is the variable to animate. * Second parameter is the value to set. - * Compatible with `lv_xxx_set_yyy(obj, value)` functions*/ -typedef void (*lv_anim_exec_cb_t)(void *, lv_anim_value_t); + * Compatible with `lv_xxx_set_yyy(obj, value)` functions + * The `x` in `_xcb_t` means its not a fully generic prototype because + * it doesn't receive `lv_anim_t *` as its first argument*/ +typedef void (*lv_anim_exec_xcb_t)(void *, lv_anim_value_t); /* Same as `lv_anim_exec_cb_t` but receives `lv_anim_t *` as the first parameter. * It's more consistent but less convenient. Might be used by binding generator functions.*/ @@ -58,7 +60,7 @@ typedef void (*lv_anim_ready_cb_t)(struct _lv_anim_t *); typedef struct _lv_anim_t { void * var; /*Variable to animate*/ - lv_anim_exec_cb_t exec_cb; /*Function to execute to animate*/ + lv_anim_exec_xcb_t exec_cb; /*Function to execute to animate*/ lv_anim_path_cb_t path_cb; /*An array with the steps of animations*/ lv_anim_ready_cb_t ready_cb; /*Call it when the animation is ready*/ int32_t start; /*Start value*/ @@ -114,7 +116,7 @@ void lv_anim_init(lv_anim_t * a); * LittelvGL's built-in functions can be used. * E.g. lv_obj_set_x */ -static inline void lv_anim_set_exec_cb(lv_anim_t * a, void * var, lv_anim_exec_cb_t exec_cb) +static inline void lv_anim_set_exec_cb(lv_anim_t * a, void * var, lv_anim_exec_xcb_t exec_cb) { a->var = var; a->exec_cb = exec_cb; @@ -155,7 +157,7 @@ static inline void lv_anim_set_values(lv_anim_t * a, lv_anim_value_t start, lv_a static inline void lv_anim_set_custom_exec_cb(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb) { a->var = a; - a->exec_cb = (lv_anim_exec_cb_t)exec_cb; + a->exec_cb = (lv_anim_exec_xcb_t)exec_cb; } /** @@ -262,7 +264,7 @@ void lv_anim_create(lv_anim_t * a); * or NULL to ignore it and delete all the animations of 'var * @return true: at least 1 animation is deleted, false: no animation is deleted */ -bool lv_anim_del(void * var, lv_anim_exec_cb_t exec_cb); +bool lv_anim_del(void * var, lv_anim_exec_xcb_t exec_cb); /** * Delete an aniamation by getting the animated variable from `a`. @@ -277,7 +279,7 @@ bool lv_anim_del(void * var, lv_anim_exec_cb_t exec_cb); */ static inline bool lv_anim_custom_del(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb) { - return lv_anim_del(a->var, (lv_anim_exec_cb_t)exec_cb); + return lv_anim_del(a->var, (lv_anim_exec_xcb_t)exec_cb); } /** diff --git a/src/lv_objx/lv_bar.c b/src/lv_objx/lv_bar.c index 9e4a74f20..853a6383d 100644 --- a/src/lv_objx/lv_bar.c +++ b/src/lv_objx/lv_bar.c @@ -162,7 +162,7 @@ void lv_bar_set_value(lv_obj_t * bar, int16_t value, lv_anim_enable_t anim) a.var = bar; a.start = LV_BAR_ANIM_STATE_START; a.end = LV_BAR_ANIM_STATE_END; - a.exec_cb = (lv_anim_exec_cb_t)lv_bar_anim; + a.exec_cb = (lv_anim_exec_xcb_t)lv_bar_anim; a.path_cb = lv_anim_path_linear; a.ready_cb = lv_bar_anim_ready; a.act_time = 0; diff --git a/src/lv_objx/lv_btn.c b/src/lv_objx/lv_btn.c index 6cdbe3b90..c13fe21bd 100644 --- a/src/lv_objx/lv_btn.c +++ b/src/lv_objx/lv_btn.c @@ -506,7 +506,7 @@ static lv_res_t lv_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * param) #if LV_USE_ANIMATION && LV_BTN_INK_EFFECT /*Forget the old inked button*/ if(ink_obj != NULL && ink_obj != btn) { - lv_anim_del(ink_obj, (lv_anim_exec_cb_t)lv_btn_ink_effect_anim); + lv_anim_del(ink_obj, (lv_anim_exec_xcb_t)lv_btn_ink_effect_anim); lv_obj_invalidate(ink_obj); ink_obj = NULL; } @@ -521,7 +521,7 @@ static lv_res_t lv_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * param) a.var = btn; a.start = 0; a.end = LV_BTN_INK_VALUE_MAX; - a.exec_cb = (lv_anim_exec_cb_t)lv_btn_ink_effect_anim; + a.exec_cb = (lv_anim_exec_xcb_t)lv_btn_ink_effect_anim; a.path_cb = lv_anim_path_linear; a.ready_cb = lv_btn_ink_effect_anim_ready; a.act_time = 0; @@ -590,7 +590,7 @@ static lv_res_t lv_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * param) a.var = ink_obj; a.start = LV_BTN_INK_VALUE_MAX; a.end = 0; - a.exec_cb = (lv_anim_exec_cb_t)lv_btn_ink_effect_anim; + a.exec_cb = (lv_anim_exec_xcb_t)lv_btn_ink_effect_anim; a.path_cb = lv_anim_path_linear; a.ready_cb = lv_btn_ink_effect_anim_ready; a.act_time = 0; @@ -613,7 +613,7 @@ static lv_res_t lv_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * param) } else if(sign == LV_SIGNAL_CLEANUP) { #if LV_USE_ANIMATION && LV_BTN_INK_EFFECT if(btn == ink_obj) { - lv_anim_del(ink_obj, (lv_anim_exec_cb_t)lv_btn_ink_effect_anim); + lv_anim_del(ink_obj, (lv_anim_exec_xcb_t)lv_btn_ink_effect_anim); ink_obj = NULL; } #endif @@ -663,7 +663,7 @@ static void lv_btn_ink_effect_anim_ready(lv_anim_t * a) new_a.var = ink_obj; new_a.start = LV_BTN_INK_VALUE_MAX; new_a.end = 0; - new_a.exec_cb = (lv_anim_exec_cb_t)lv_btn_ink_effect_anim; + new_a.exec_cb = (lv_anim_exec_xcb_t)lv_btn_ink_effect_anim; new_a.path_cb = lv_anim_path_linear; new_a.ready_cb = lv_btn_ink_effect_anim_ready; new_a.act_time = -ext->ink_wait_time; diff --git a/src/lv_objx/lv_ddlist.c b/src/lv_objx/lv_ddlist.c index eb7c1577c..4ac1d7827 100644 --- a/src/lv_objx/lv_ddlist.c +++ b/src/lv_objx/lv_ddlist.c @@ -863,7 +863,7 @@ static void lv_ddlist_refr_size(lv_obj_t * ddlist, lv_anim_enable_t anim) lv_ddlist_pos_current_option(ddlist); if(ext->opened) lv_page_set_sb_mode(ddlist, LV_SB_MODE_UNHIDE); #if LV_USE_ANIMATION - lv_anim_del(ddlist, (lv_anim_exec_cb_t)lv_ddlist_adjust_height); /*If an animation is in progress then + lv_anim_del(ddlist, (lv_anim_exec_xcb_t)lv_ddlist_adjust_height); /*If an animation is in progress then it will overwrite this changes*/ /*Force animation complete to fix highlight selection*/ @@ -875,7 +875,7 @@ static void lv_ddlist_refr_size(lv_obj_t * ddlist, lv_anim_enable_t anim) a.var = ddlist; a.start = lv_obj_get_height(ddlist); a.end = new_height; - a.exec_cb = (lv_anim_exec_cb_t)lv_ddlist_adjust_height; + a.exec_cb = (lv_anim_exec_xcb_t)lv_ddlist_adjust_height; a.path_cb = lv_anim_path_linear; a.ready_cb = lv_ddlist_anim_ready_cb; a.act_time = 0; diff --git a/src/lv_objx/lv_label.c b/src/lv_objx/lv_label.c index 018bfd78b..8bd32e10e 100644 --- a/src/lv_objx/lv_label.c +++ b/src/lv_objx/lv_label.c @@ -265,10 +265,10 @@ void lv_label_set_long_mode(lv_obj_t * label, lv_label_long_mode_t long_mode) #if LV_USE_ANIMATION /*Delete the old animation (if exists)*/ - lv_anim_del(label, (lv_anim_exec_cb_t)lv_obj_set_x); - lv_anim_del(label, (lv_anim_exec_cb_t)lv_obj_set_y); - lv_anim_del(label, (lv_anim_exec_cb_t)lv_label_set_offset_x); - lv_anim_del(label, (lv_anim_exec_cb_t)lv_label_set_offset_y); + lv_anim_del(label, (lv_anim_exec_xcb_t)lv_obj_set_x); + lv_anim_del(label, (lv_anim_exec_xcb_t)lv_obj_set_y); + lv_anim_del(label, (lv_anim_exec_xcb_t)lv_label_set_offset_x); + lv_anim_del(label, (lv_anim_exec_xcb_t)lv_label_set_offset_y); #endif ext->offset.x = 0; ext->offset.y = 0; @@ -980,25 +980,25 @@ static void lv_label_refr_text(lv_obj_t * label) bool hor_anim = false; if(size.x > lv_obj_get_width(label)) { anim.end = lv_obj_get_width(label) - size.x; - anim.exec_cb = (lv_anim_exec_cb_t)lv_label_set_offset_x; + anim.exec_cb = (lv_anim_exec_xcb_t)lv_label_set_offset_x; anim.time = lv_anim_speed_to_time(ext->anim_speed, anim.start, anim.end); lv_anim_create(&anim); hor_anim = true; } else { /*Delete the offset animation if not required*/ - lv_anim_del(label, (lv_anim_exec_cb_t)lv_label_set_offset_x); + lv_anim_del(label, (lv_anim_exec_xcb_t)lv_label_set_offset_x); ext->offset.x = 0; } if(size.y > lv_obj_get_height(label) && hor_anim == false) { anim.end = lv_obj_get_height(label) - size.y - (lv_font_get_line_height(font)); - anim.exec_cb = (lv_anim_exec_cb_t)lv_label_set_offset_y; + anim.exec_cb = (lv_anim_exec_xcb_t)lv_label_set_offset_y; anim.time = lv_anim_speed_to_time(ext->anim_speed, anim.start, anim.end); lv_anim_create(&anim); } else { /*Delete the offset animation if not required*/ - lv_anim_del(label, (lv_anim_exec_cb_t)lv_label_set_offset_y); + lv_anim_del(label, (lv_anim_exec_xcb_t)lv_label_set_offset_y); ext->offset.y = 0; } #endif @@ -1022,24 +1022,24 @@ static void lv_label_refr_text(lv_obj_t * label) bool hor_anim = false; if(size.x > lv_obj_get_width(label)) { anim.end = -size.x - lv_font_get_glyph_width(font, ' ', ' ') * LV_LABEL_WAIT_CHAR_COUNT; - anim.exec_cb = (lv_anim_exec_cb_t)lv_label_set_offset_x; + anim.exec_cb = (lv_anim_exec_xcb_t)lv_label_set_offset_x; anim.time = lv_anim_speed_to_time(ext->anim_speed, anim.start, anim.end); lv_anim_create(&anim); hor_anim = true; } else { /*Delete the offset animation if not required*/ - lv_anim_del(label, (lv_anim_exec_cb_t)lv_label_set_offset_x); + lv_anim_del(label, (lv_anim_exec_xcb_t)lv_label_set_offset_x); ext->offset.x = 0; } if(size.y > lv_obj_get_height(label) && hor_anim == false) { anim.end = -size.y - (lv_font_get_line_height(font)); - anim.exec_cb = (lv_anim_exec_cb_t)lv_label_set_offset_y; + anim.exec_cb = (lv_anim_exec_xcb_t)lv_label_set_offset_y; anim.time = lv_anim_speed_to_time(ext->anim_speed, anim.start, anim.end); lv_anim_create(&anim); } else { /*Delete the offset animation if not required*/ - lv_anim_del(label, (lv_anim_exec_cb_t)lv_label_set_offset_y); + lv_anim_del(label, (lv_anim_exec_xcb_t)lv_label_set_offset_y); ext->offset.y = 0; } #endif diff --git a/src/lv_objx/lv_list.c b/src/lv_objx/lv_list.c index 0f67ee0ca..cf4fb87d9 100644 --- a/src/lv_objx/lv_list.c +++ b/src/lv_objx/lv_list.c @@ -627,7 +627,7 @@ void lv_list_up(const lv_obj_t * list) a.var = scrl; a.start = lv_obj_get_y(scrl); a.end = new_y; - a.exec_cb = (lv_anim_exec_cb_t)lv_obj_set_y; + a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_y; a.path_cb = lv_anim_path_linear; a.ready_cb = NULL; a.act_time = 0; @@ -669,7 +669,7 @@ void lv_list_down(const lv_obj_t * list) a.var = scrl; a.start = lv_obj_get_y(scrl); a.end = new_y; - a.exec_cb = (lv_anim_exec_cb_t)lv_obj_set_y; + a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_y; a.path_cb = lv_anim_path_linear; a.ready_cb = NULL; a.act_time = 0; diff --git a/src/lv_objx/lv_mbox.c b/src/lv_objx/lv_mbox.c index c59dfc44e..099a4b767 100644 --- a/src/lv_objx/lv_mbox.c +++ b/src/lv_objx/lv_mbox.c @@ -210,7 +210,7 @@ void lv_mbox_start_auto_close(lv_obj_t * mbox, uint16_t delay) a.var = mbox; a.start = lv_obj_get_height(mbox); a.end = 0; - a.exec_cb = (lv_anim_exec_cb_t)lv_obj_set_height; + a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_height; a.path_cb = lv_anim_path_linear; a.ready_cb = NULL; a.act_time = -delay; @@ -222,7 +222,7 @@ void lv_mbox_start_auto_close(lv_obj_t * mbox, uint16_t delay) lv_anim_create(&a); a.start = lv_obj_get_width(mbox); - a.exec_cb = (lv_anim_exec_cb_t)lv_obj_set_width; + a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_width; a.ready_cb = lv_mbox_close_ready_cb; lv_anim_create(&a); @@ -234,7 +234,7 @@ void lv_mbox_start_auto_close(lv_obj_t * mbox, uint16_t delay) a.var = mbox; a.start = 0; a.end = 1; - a.exec_cb = (lv_anim_exec_cb_t)NULL; + a.exec_cb = (lv_anim_exec_xcb_t)NULL; a.path_cb = lv_anim_path_linear; a.ready_cb = lv_mbox_close_ready_cb; a.act_time = -delay; diff --git a/src/lv_objx/lv_page.c b/src/lv_objx/lv_page.c index 17d3e9633..eb2210f1b 100644 --- a/src/lv_objx/lv_page.c +++ b/src/lv_objx/lv_page.c @@ -445,10 +445,10 @@ void lv_page_focus(lv_obj_t * page, const lv_obj_t * obj, uint16_t anim_time) #if LV_USE_ANIMATION /* Be sure there is no position changing animation in progress * because it can overide the current changes*/ - lv_anim_del(page, (lv_anim_exec_cb_t)lv_obj_set_x); - lv_anim_del(page, (lv_anim_exec_cb_t)lv_obj_set_y); - lv_anim_del(ext->scrl, (lv_anim_exec_cb_t)lv_obj_set_x); - lv_anim_del(ext->scrl, (lv_anim_exec_cb_t)lv_obj_set_y); + lv_anim_del(page, (lv_anim_exec_xcb_t)lv_obj_set_x); + lv_anim_del(page, (lv_anim_exec_xcb_t)lv_obj_set_y); + lv_anim_del(ext->scrl, (lv_anim_exec_xcb_t)lv_obj_set_x); + lv_anim_del(ext->scrl, (lv_anim_exec_xcb_t)lv_obj_set_y); #else anim_time = 0; #endif @@ -517,12 +517,12 @@ void lv_page_focus(lv_obj_t * page, const lv_obj_t * obj, uint16_t anim_time) a.repeat = 0; a.var = ext->scrl; a.path_cb = lv_anim_path_linear; - a.exec_cb = (lv_anim_exec_cb_t)lv_obj_set_y; + a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_y; lv_anim_create(&a); a.start = lv_obj_get_x(ext->scrl); a.end = scrlable_x; - a.exec_cb = (lv_anim_exec_cb_t)lv_obj_set_x; + a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_x; lv_anim_create(&a); #endif } @@ -542,7 +542,7 @@ void lv_page_scroll_hor(lv_obj_t * page, lv_coord_t dist) a.var = scrl; a.start = lv_obj_get_x(scrl); a.end = a.start + dist; - a.exec_cb = (lv_anim_exec_cb_t)lv_obj_set_x; + a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_x; a.path_cb = lv_anim_path_linear; a.ready_cb = NULL; a.act_time = 0; @@ -571,7 +571,7 @@ void lv_page_scroll_ver(lv_obj_t * page, lv_coord_t dist) a.var = scrl; a.start = lv_obj_get_y(scrl); a.end = a.start + dist; - a.exec_cb = (lv_anim_exec_cb_t)lv_obj_set_y; + a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_y; a.path_cb = lv_anim_path_linear; a.ready_cb = NULL; a.act_time = 0; @@ -600,7 +600,7 @@ void lv_page_start_edge_flash(lv_obj_t * page) a.var = page; a.start = 0; a.end = LV_PAGE_END_FLASH_SIZE; - a.exec_cb = (lv_anim_exec_cb_t)edge_flash_anim; + a.exec_cb = (lv_anim_exec_xcb_t)edge_flash_anim; a.path_cb = lv_anim_path_linear; a.ready_cb = edge_flash_anim_end; a.act_time = 0; diff --git a/src/lv_objx/lv_preload.c b/src/lv_objx/lv_preload.c index f63430405..74aa0fbf8 100644 --- a/src/lv_objx/lv_preload.c +++ b/src/lv_objx/lv_preload.c @@ -187,7 +187,7 @@ void lv_preload_set_anim_type(lv_obj_t * preload, lv_preload_type_t type) a.start = 0; a.end = 360; } - a.exec_cb = (lv_anim_exec_cb_t)lv_preload_spinner_anim; + a.exec_cb = (lv_anim_exec_xcb_t)lv_preload_spinner_anim; a.path_cb = lv_anim_path_ease_in_out; a.ready_cb = NULL; a.act_time = 0; @@ -208,7 +208,7 @@ void lv_preload_set_anim_type(lv_obj_t * preload, lv_preload_type_t type) b.start = ext->arc_length; b.end = 360 - ext->arc_length; } - b.exec_cb = (lv_anim_exec_cb_t)lv_preload_set_arc_length; + b.exec_cb = (lv_anim_exec_xcb_t)lv_preload_set_arc_length; b.path_cb = lv_anim_path_ease_in_out; b.ready_cb = NULL; b.act_time = 0; @@ -233,7 +233,7 @@ void lv_preload_set_anim_type(lv_obj_t * preload, lv_preload_type_t type) a.start = 0; a.end = 360; } - a.exec_cb = (lv_anim_exec_cb_t)lv_preload_spinner_anim; + a.exec_cb = (lv_anim_exec_xcb_t)lv_preload_spinner_anim; a.path_cb = lv_anim_path_ease_in_out; a.ready_cb = NULL; a.act_time = 0; diff --git a/src/lv_objx/lv_roller.c b/src/lv_objx/lv_roller.c index a2377ef68..a144a1a28 100644 --- a/src/lv_objx/lv_roller.c +++ b/src/lv_objx/lv_roller.c @@ -408,7 +408,7 @@ static lv_res_t lv_roller_signal(lv_obj_t * roller, lv_signal_t sign, void * par refr_height(roller); #if LV_USE_ANIMATION - lv_anim_del(lv_page_get_scrl(roller), (lv_anim_exec_cb_t)lv_obj_set_y); + lv_anim_del(lv_page_get_scrl(roller), (lv_anim_exec_xcb_t)lv_obj_set_y); #endif lv_ddlist_set_selected(roller, ext->ddlist.sel_opt_id); refr_position(roller, false); @@ -529,7 +529,7 @@ static lv_res_t lv_roller_scrl_signal(lv_obj_t * roller_scrl, lv_signal_t sign, } } else if(sign == LV_SIGNAL_PRESSED) { #if LV_USE_ANIMATION - lv_anim_del(roller_scrl, (lv_anim_exec_cb_t)lv_obj_set_y); + lv_anim_del(roller_scrl, (lv_anim_exec_xcb_t)lv_obj_set_y); #endif } @@ -629,7 +629,7 @@ static void refr_position(lv_obj_t * roller, lv_anim_enable_t anim) a.var = roller_scrl; a.start = lv_obj_get_y(roller_scrl); a.end = new_y; - a.exec_cb = (lv_anim_exec_cb_t)lv_obj_set_y; + a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_y; a.path_cb = lv_anim_path_linear; a.ready_cb = scroll_anim_ready_cb; a.act_time = 0; @@ -662,7 +662,7 @@ static void refr_height(lv_obj_t * roller) lv_obj_set_height(lv_page_get_scrl(roller), lv_obj_get_height(ext->ddlist.label) + lv_obj_get_height(roller)); lv_obj_align(ext->ddlist.label, NULL, obj_align, 0, 0); #if LV_USE_ANIMATION - lv_anim_del(lv_page_get_scrl(roller), (lv_anim_exec_cb_t)lv_obj_set_y); + lv_anim_del(lv_page_get_scrl(roller), (lv_anim_exec_xcb_t)lv_obj_set_y); #endif lv_ddlist_set_selected(roller, ext->ddlist.sel_opt_id); } diff --git a/src/lv_objx/lv_ta.c b/src/lv_objx/lv_ta.c index 7f6f112df..d529c9420 100644 --- a/src/lv_objx/lv_ta.c +++ b/src/lv_objx/lv_ta.c @@ -172,7 +172,7 @@ lv_obj_t * lv_ta_create(lv_obj_t * par, const lv_obj_t * copy) /*Create a cursor blinker animation*/ lv_anim_t a; a.var = new_ta; - a.exec_cb = (lv_anim_exec_cb_t)cursor_blink_anim; + a.exec_cb = (lv_anim_exec_xcb_t)cursor_blink_anim; a.time = ext->cursor.blink_time; a.act_time = 0; a.ready_cb = NULL; @@ -256,7 +256,7 @@ void lv_ta_add_char(lv_obj_t * ta, uint32_t c) /*Auto hide characters*/ lv_anim_t a; a.var = ta; - a.exec_cb = (lv_anim_exec_cb_t)pwd_char_hider_anim; + a.exec_cb = (lv_anim_exec_xcb_t)pwd_char_hider_anim; a.time = ext->pwd_show_time; a.act_time = 0; a.ready_cb = pwd_char_hider_anim_ready; @@ -337,7 +337,7 @@ void lv_ta_add_text(lv_obj_t * ta, const char * txt) /*Auto hide characters*/ lv_anim_t a; a.var = ta; - a.exec_cb = (lv_anim_exec_cb_t)pwd_char_hider_anim; + a.exec_cb = (lv_anim_exec_xcb_t)pwd_char_hider_anim; a.time = ext->pwd_show_time; a.act_time = 0; a.ready_cb = pwd_char_hider_anim_ready; @@ -477,7 +477,7 @@ void lv_ta_set_text(lv_obj_t * ta, const char * txt) /*Auto hide characters*/ lv_anim_t a; a.var = ta; - a.exec_cb = (lv_anim_exec_cb_t)pwd_char_hider_anim; + a.exec_cb = (lv_anim_exec_xcb_t)pwd_char_hider_anim; a.time = ext->pwd_show_time; a.act_time = 0; a.ready_cb = pwd_char_hider_anim_ready; @@ -584,7 +584,7 @@ void lv_ta_set_cursor_pos(lv_obj_t * ta, int16_t pos) /*Reset cursor blink animation*/ lv_anim_t a; a.var = ta; - a.exec_cb = (lv_anim_exec_cb_t)cursor_blink_anim; + a.exec_cb = (lv_anim_exec_xcb_t)cursor_blink_anim; a.time = ext->cursor.blink_time; a.act_time = 0; a.ready_cb = NULL; @@ -849,7 +849,7 @@ void lv_ta_set_cursor_blink_time(lv_obj_t * ta, uint16_t time) /*Reset cursor blink animation*/ lv_anim_t a; a.var = ta; - a.exec_cb = (lv_anim_exec_cb_t)cursor_blink_anim; + a.exec_cb = (lv_anim_exec_xcb_t)cursor_blink_anim; a.time = ext->cursor.blink_time; a.act_time = 0; a.ready_cb = NULL; diff --git a/src/lv_objx/lv_tabview.c b/src/lv_objx/lv_tabview.c index 81cc8d004..7653e1dfd 100644 --- a/src/lv_objx/lv_tabview.c +++ b/src/lv_objx/lv_tabview.c @@ -371,7 +371,7 @@ void lv_tabview_set_tab_act(lv_obj_t * tabview, uint16_t id, lv_anim_enable_t an a.var = ext->content; a.start = lv_obj_get_x(ext->content); a.end = cont_x; - a.exec_cb = (lv_anim_exec_cb_t)lv_obj_set_x; + a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_x; a.path_cb = lv_anim_path_linear; a.ready_cb = NULL; a.act_time = 0; @@ -419,13 +419,13 @@ void lv_tabview_set_tab_act(lv_obj_t * tabview, uint16_t id, lv_anim_enable_t an case LV_TABVIEW_BTNS_POS_BOTTOM: a.start = lv_obj_get_x(ext->indic); a.end = indic_pos; - a.exec_cb = (lv_anim_exec_cb_t)lv_obj_set_x; + a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_x; break; case LV_TABVIEW_BTNS_POS_LEFT: case LV_TABVIEW_BTNS_POS_RIGHT: a.start = lv_obj_get_y(ext->indic); a.end = indic_pos; - a.exec_cb = (lv_anim_exec_cb_t)lv_obj_set_y; + a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_y; break; } diff --git a/src/lv_objx/lv_tileview.c b/src/lv_objx/lv_tileview.c index e091493d0..8b35f0a78 100644 --- a/src/lv_objx/lv_tileview.c +++ b/src/lv_objx/lv_tileview.c @@ -214,7 +214,7 @@ void lv_tileview_set_tile_act(lv_obj_t * tileview, lv_coord_t x, lv_coord_t y, l lv_anim_t a; a.var = scrl; - a.exec_cb = (lv_anim_exec_cb_t)lv_obj_set_x; + a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_x; a.path_cb = lv_anim_path_linear; a.ready_cb = NULL; a.act_time = 0; @@ -233,7 +233,7 @@ void lv_tileview_set_tile_act(lv_obj_t * tileview, lv_coord_t x, lv_coord_t y, l if(y_coord != y_act) { a.start = y_act; a.end = y_coord; - a.exec_cb = (lv_anim_exec_cb_t)lv_obj_set_y; + a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_y; lv_anim_create(&a); } #endif diff --git a/src/lv_themes/lv_theme.h b/src/lv_themes/lv_theme.h index 2ce92d0d8..7c0c66697 100644 --- a/src/lv_themes/lv_theme.h +++ b/src/lv_themes/lv_theme.h @@ -328,8 +328,10 @@ typedef struct #if LV_USE_GROUP struct { - lv_group_style_mod_cb_t style_mod_cb; - lv_group_style_mod_cb_t style_mod_edit_cb; + /* The `x` in the names inidicates that inconsistence becasue + * the group related function are stored in the theme.*/ + lv_group_style_mod_cb_t style_mod_xcb; + lv_group_style_mod_cb_t style_mod_edit_xcb; } group; #endif } lv_theme_t; diff --git a/src/lv_themes/lv_theme_alien.c b/src/lv_themes/lv_theme_alien.c index 43747038f..28c1b29a5 100644 --- a/src/lv_themes/lv_theme_alien.c +++ b/src/lv_themes/lv_theme_alien.c @@ -928,8 +928,8 @@ lv_theme_t * lv_theme_alien_init(uint16_t hue, lv_font_t * font) win_init(); #if LV_USE_GROUP - theme.group.style_mod_cb = style_mod; - theme.group.style_mod_edit_cb = style_mod_edit; + theme.group.style_mod_xcb = style_mod; + theme.group.style_mod_edit_xcb = style_mod_edit; #endif return &theme; diff --git a/src/lv_themes/lv_theme_default.c b/src/lv_themes/lv_theme_default.c index 0d33fdb0d..36b7665ef 100644 --- a/src/lv_themes/lv_theme_default.c +++ b/src/lv_themes/lv_theme_default.c @@ -448,8 +448,8 @@ lv_theme_t * lv_theme_default_init(uint16_t hue, lv_font_t * font) win_init(); #if LV_USE_GROUP - theme.group.style_mod_cb = style_mod; - theme.group.style_mod_edit_cb = style_mod_edit; + theme.group.style_mod_xcb = style_mod; + theme.group.style_mod_edit_xcb = style_mod_edit; #endif return &theme; diff --git a/src/lv_themes/lv_theme_material.c b/src/lv_themes/lv_theme_material.c index 2437de779..e2c12fe1e 100644 --- a/src/lv_themes/lv_theme_material.c +++ b/src/lv_themes/lv_theme_material.c @@ -902,8 +902,8 @@ lv_theme_t * lv_theme_material_init(uint16_t hue, lv_font_t * font) win_init(); #if LV_USE_GROUP - theme.group.style_mod_cb = style_mod; - theme.group.style_mod_edit_cb = style_mod_edit; + theme.group.style_mod_xcb = style_mod; + theme.group.style_mod_edit_xcb = style_mod_edit; #endif return &theme; diff --git a/src/lv_themes/lv_theme_mono.c b/src/lv_themes/lv_theme_mono.c index f6b0c2a73..3b58c92c2 100644 --- a/src/lv_themes/lv_theme_mono.c +++ b/src/lv_themes/lv_theme_mono.c @@ -495,8 +495,8 @@ lv_theme_t * lv_theme_mono_init(uint16_t hue, lv_font_t * font) win_init(); #if LV_USE_GROUP - theme.group.style_mod_cb = style_mod; - theme.group.style_mod_edit_cb = style_mod_edit; + theme.group.style_mod_xcb = style_mod; + theme.group.style_mod_edit_xcb = style_mod_edit; #endif return &theme; diff --git a/src/lv_themes/lv_theme_nemo.c b/src/lv_themes/lv_theme_nemo.c index 2fd2df939..e30b0e6a4 100644 --- a/src/lv_themes/lv_theme_nemo.c +++ b/src/lv_themes/lv_theme_nemo.c @@ -900,8 +900,8 @@ lv_theme_t * lv_theme_nemo_init(uint16_t hue, lv_font_t * font) win_init(); #if LV_USE_GROUP - theme.group.style_mod_cb = style_mod; - theme.group.style_mod_edit_cb = style_mod_edit; + theme.group.style_mod_xcb = style_mod; + theme.group.style_mod_edit_xcb = style_mod_edit; #endif return &theme; diff --git a/src/lv_themes/lv_theme_night.c b/src/lv_themes/lv_theme_night.c index 79a17f645..73aaf39b0 100644 --- a/src/lv_themes/lv_theme_night.c +++ b/src/lv_themes/lv_theme_night.c @@ -816,8 +816,8 @@ lv_theme_t * lv_theme_night_init(uint16_t hue, lv_font_t * font) win_init(); #if LV_USE_GROUP - theme.group.style_mod_cb = style_mod; - theme.group.style_mod_edit_cb = style_mod_edit; + theme.group.style_mod_xcb = style_mod; + theme.group.style_mod_edit_xcb = style_mod_edit; #endif return &theme; diff --git a/src/lv_themes/lv_theme_templ.c b/src/lv_themes/lv_theme_templ.c index 8479f202a..6dd4eef7e 100644 --- a/src/lv_themes/lv_theme_templ.c +++ b/src/lv_themes/lv_theme_templ.c @@ -450,8 +450,8 @@ lv_theme_t * lv_theme_templ_init(uint16_t hue, lv_font_t * font) win_init(); #if LV_USE_GROUP - theme.group.style_mod_cb = style_mod; - theme.group.style_mod_edit_cb = style_mod_edit; + theme.group.style_mod_xcb = style_mod; + theme.group.style_mod_edit_xcb = style_mod_edit; #endif return &theme; diff --git a/src/lv_themes/lv_theme_zen.c b/src/lv_themes/lv_theme_zen.c index 5d02c2260..a87f63fdf 100644 --- a/src/lv_themes/lv_theme_zen.c +++ b/src/lv_themes/lv_theme_zen.c @@ -872,8 +872,8 @@ lv_theme_t * lv_theme_zen_init(uint16_t hue, lv_font_t * font) win_init(); #if LV_USE_GROUP - theme.group.style_mod_cb = style_mod; - theme.group.style_mod_edit_cb = style_mod_edit; + theme.group.style_mod_xcb = style_mod; + theme.group.style_mod_edit_xcb = style_mod_edit; #endif return &theme;