improve callback conventions

This commit is contained in:
Gabor Kiss-Vamosi
2019-06-12 23:10:54 +02:00
parent ed69452c45
commit bceb46b813
27 changed files with 93 additions and 86 deletions

View File

@@ -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*/

View File

@@ -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;
}
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);
}
/**

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;