make user data and callback name more consistent (Fixes #1036)

This commit is contained in:
Gabor Kiss-Vamosi
2019-04-23 14:56:40 +02:00
parent abd081da30
commit 514e2baaca
16 changed files with 63 additions and 61 deletions

View File

@@ -291,11 +291,11 @@ lv_res_t lv_group_send_data(lv_group_t * group, uint32_t c)
/**
* Set a function for a group which will modify the object's style if it is in focus
* @param group pointer to a group
* @param style_mod_func the style modifier function pointer
* @param style_mod_cb the style modifier function pointer
*/
void lv_group_set_style_mod_cb(lv_group_t * group, lv_group_style_mod_func_t style_mod_func)
void lv_group_set_style_mod_cb(lv_group_t * group, lv_group_style_mod_cb_t style_mod_cb)
{
group->style_mod = style_mod_func;
group->style_mod_cb = style_mod_cb;
if(group->obj_focus != NULL) lv_obj_invalidate(*group->obj_focus);
}
@@ -304,9 +304,9 @@ void lv_group_set_style_mod_cb(lv_group_t * group, lv_group_style_mod_func_t sty
* @param group pointer to a group
* @param style_mod_func the style modifier function pointer
*/
void lv_group_set_style_mod_edit_cb(lv_group_t * group, lv_group_style_mod_func_t style_mod_func)
void lv_group_set_style_mod_edit_cb(lv_group_t * group, lv_group_style_mod_cb_t style_mod_edit_cb)
{
group->style_mod_edit = style_mod_func;
group->style_mod_edit_cb = style_mod_edit_cb;
if(group->obj_focus != NULL) lv_obj_invalidate(*group->obj_focus);
}
@@ -381,9 +381,9 @@ lv_style_t * lv_group_mod_style(lv_group_t * group, const lv_style_t * style)
lv_style_copy(&group->style_tmp, style);
if(group->editing) {
if(group->style_mod_edit) group->style_mod_edit(group, &group->style_tmp);
if(group->style_mod_edit_cb) group->style_mod_edit_cb(group, &group->style_tmp);
} else {
if(group->style_mod) group->style_mod(group, &group->style_tmp);
if(group->style_mod_cb) group->style_mod_cb(group, &group->style_tmp);
}
return &group->style_tmp;
}
@@ -418,10 +418,10 @@ lv_group_user_data_t * lv_group_get_user_data(lv_group_t * group)
* @param group pointer to a group
* @return pointer to the style modifier function
*/
lv_group_style_mod_func_t lv_group_get_style_mod_cb(const lv_group_t * group)
lv_group_style_mod_cb_t lv_group_get_style_mod_cb(const lv_group_t * group)
{
if(!group) return false;
return group->style_mod;
return group->style_mod_cb;
}
/**
@@ -429,10 +429,10 @@ lv_group_style_mod_func_t lv_group_get_style_mod_cb(const lv_group_t * group)
* @param group pointer to a group
* @return pointer to the style modifier function
*/
lv_group_style_mod_func_t lv_group_get_style_mod_edit_cb(const lv_group_t * group)
lv_group_style_mod_cb_t lv_group_get_style_mod_edit_cb(const lv_group_t * group)
{
if(!group) return false;
return group->style_mod_edit;
return group->style_mod_edit_cb;
}
/**
@@ -582,11 +582,11 @@ static void style_mod_edit_def(lv_group_t * group, lv_style_t * style)
static void refresh_theme(lv_group_t * g, lv_theme_t * th)
{
g->style_mod = style_mod_def;
g->style_mod_edit = style_mod_edit_def;
g->style_mod_cb = style_mod_def;
g->style_mod_edit_cb = style_mod_edit_def;
if(th) {
if(th->group.style_mod) g->style_mod = th->group.style_mod;
if(th->group.style_mod_edit) g->style_mod_edit = th->group.style_mod_edit;
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;
}
}

View File

@@ -45,7 +45,7 @@ extern "C" {
**********************/
struct _lv_group_t;
typedef void (*lv_group_style_mod_func_t)(struct _lv_group_t *, lv_style_t *);
typedef void (*lv_group_style_mod_cb_t)(struct _lv_group_t *, lv_style_t *);
typedef void (*lv_group_focus_cb_t)(struct _lv_group_t *);
typedef struct _lv_group_t
@@ -53,8 +53,8 @@ typedef struct _lv_group_t
lv_ll_t obj_ll; /*Linked list to store the objects in the group */
lv_obj_t ** obj_focus; /*The object in focus*/
lv_group_style_mod_func_t style_mod; /*A function to modifies the style of the focused object*/
lv_group_style_mod_func_t style_mod_edit; /*A function which modifies the style of the edited object*/
lv_group_style_mod_cb_t style_mod_cb; /*A function to modifies the style of the focused object*/
lv_group_style_mod_cb_t style_mod_edit_cb; /*A function which modifies the style of the edited object*/
lv_group_focus_cb_t focus_cb; /*A function to call when a new object is focused (optional)*/
lv_style_t style_tmp; /*Stores the modified style of the focused object */
#if LV_USE_USER_DATA_SINGLE
@@ -151,16 +151,16 @@ lv_res_t lv_group_send_data(lv_group_t * group, uint32_t c);
/**
* Set a function for a group which will modify the object's style if it is in focus
* @param group pointer to a group
* @param style_mod_func the style modifier function pointer
* @param style_mod_cb the style modifier function pointer
*/
void lv_group_set_style_mod_cb(lv_group_t * group, lv_group_style_mod_func_t style_mod_func);
void lv_group_set_style_mod_cb(lv_group_t * group, lv_group_style_mod_cb_t style_mod_cb);
/**
* Set a function for a group which will modify the object's style if it is in focus in edit mode
* @param group pointer to a group
* @param style_mod_func the style modifier function pointer
* @param style_mod_edit_cb the style modifier function pointer
*/
void lv_group_set_style_mod_edit_cb(lv_group_t * group, lv_group_style_mod_func_t style_mod_func);
void lv_group_set_style_mod_edit_cb(lv_group_t * group, lv_group_style_mod_cb_t style_mod_edit_cb);
/**
* Set a function for a group which will be called when a new object is focused
@@ -228,14 +228,14 @@ lv_group_user_data_t * lv_group_get_user_data(lv_group_t * group);
* @param group pointer to a group
* @return pointer to the style modifier function
*/
lv_group_style_mod_func_t lv_group_get_style_mod_cb(const lv_group_t * group);
lv_group_style_mod_cb_t lv_group_get_style_mod_cb(const lv_group_t * group);
/**
* Get a the style modifier function of a group in edit mode
* @param group pointer to a group
* @return pointer to the style modifier function
*/
lv_group_style_mod_func_t lv_group_get_style_mod_edit_cb(const lv_group_t * group);
lv_group_style_mod_cb_t lv_group_get_style_mod_edit_cb(const lv_group_t * group);
/**
* Get the focus callback function of a group

View File

@@ -1259,11 +1259,11 @@ void lv_obj_clear_protect(lv_obj_t * obj, uint8_t prot)
* Set a an event handler function for an object.
* Used by the user to react on event which happens with the object.
* @param obj pointer to an object
* @param cb the new event function
* @param event_cb the new event function
*/
void lv_obj_set_event_cb(lv_obj_t * obj, lv_event_cb_t cb)
void lv_obj_set_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb)
{
obj->event_cb = cb;
obj->event_cb = event_cb;
}
/**
@@ -1322,9 +1322,9 @@ const void * lv_event_get_data(void)
* @param obj pointer to an object
* @param cb the new signal function
*/
void lv_obj_set_signal_cb(lv_obj_t * obj, lv_signal_cb_t cb)
void lv_obj_set_signal_cb(lv_obj_t * obj, lv_signal_cb_t signal_cb)
{
obj->signal_cb = cb;
obj->signal_cb = signal_cb;
}
/**
@@ -1340,11 +1340,11 @@ void lv_signal_send(lv_obj_t * obj, lv_signal_t signal, void * param)
/**
* Set a new design function for an object
* @param obj pointer to an object
* @param cb the new design function
* @param design_cb the new design function
*/
void lv_obj_set_design_cb(lv_obj_t * obj, lv_design_cb_t cb)
void lv_obj_set_design_cb(lv_obj_t * obj, lv_design_cb_t design_cb)
{
obj->design_cb = cb;
obj->design_cb = design_cb;
}
/*----------------

View File

@@ -552,9 +552,9 @@ void lv_obj_clear_protect(lv_obj_t * obj, uint8_t prot);
* Set a an event handler function for an object.
* Used by the user to react on event which happens with the object.
* @param obj pointer to an object
* @param cb the new event function
* @param event_cb the new event function
*/
void lv_obj_set_event_cb(lv_obj_t * obj, lv_event_cb_t cb);
void lv_obj_set_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb);
/**
* Send an event to the object
@@ -575,9 +575,9 @@ const void * lv_event_get_data(void);
* Set the a signal function of an object. Used internally by the library.
* Always call the previous signal function in the new.
* @param obj pointer to an object
* @param cb the new signal function
* @param signal_cb the new signal function
*/
void lv_obj_set_signal_cb(lv_obj_t * obj, lv_signal_cb_t cb);
void lv_obj_set_signal_cb(lv_obj_t * obj, lv_signal_cb_t signal_cb);
/**
* Send an event to the object
@@ -589,9 +589,9 @@ void lv_signal_send(lv_obj_t * obj, lv_signal_t signal, void * param);
/**
* Set a new design function for an object
* @param obj pointer to an object
* @param cb the new design function
* @param design_cb the new design function
*/
void lv_obj_set_design_cb(lv_obj_t * obj, lv_design_cb_t cb);
void lv_obj_set_design_cb(lv_obj_t * obj, lv_design_cb_t design_cb);
/*----------------
* Other set

View File

@@ -105,6 +105,8 @@ typedef struct _disp_drv_t
#if LV_USE_USER_DATA_MULTI
lv_disp_drv_user_data_t flush_user_data;
lv_disp_drv_user_data_t mem_blend_user_data;
lv_disp_drv_user_data_t mem_fill_user_data;
lv_disp_drv_user_data_t rounder_user_data;
lv_disp_drv_user_data_t set_px_user_data;
lv_disp_drv_user_data_t monitor_user_data;

View File

@@ -165,10 +165,10 @@ LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void)
* @param task a function which is the task itself
* @param period call period in ms unit
* @param prio priority of the task (LV_TASK_PRIO_OFF means the task is stopped)
* @param param free parameter
* @param user_data free parameter
* @return pointer to the new task
*/
lv_task_t * lv_task_create(void (*task)(void *), uint32_t period, lv_task_prio_t prio, void * param)
lv_task_t * lv_task_create(void (*task)(void *), uint32_t period, lv_task_prio_t prio, void * user_data)
{
lv_task_t * new_lv_task = NULL;
lv_task_t * tmp;
@@ -200,7 +200,7 @@ lv_task_t * lv_task_create(void (*task)(void *), uint32_t period, lv_task_prio_t
new_lv_task->period = period;
new_lv_task->task = task;
new_lv_task->prio = prio;
new_lv_task->param = param;
new_lv_task->param = user_data;
new_lv_task->once = 0;
new_lv_task->last_run = lv_tick_get();

View File

@@ -80,11 +80,11 @@ LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void);
* @param task a function which is the task itself
* @param period call period in ms unit
* @param prio priority of the task (LV_TASK_PRIO_OFF means the task is stopped)
* @param param free parameter
* @param user_data free parameter
* @return pointer to the new task
*/
lv_task_t * lv_task_create(void (*task)(void *), uint32_t period, lv_task_prio_t prio,
void * param);
void * user_data);
/**
* Delete a lv_task

View File

@@ -328,8 +328,8 @@ typedef struct
#if LV_USE_GROUP
struct
{
lv_group_style_mod_func_t style_mod;
lv_group_style_mod_func_t style_mod_edit;
lv_group_style_mod_cb_t style_mod_cb;
lv_group_style_mod_cb_t style_mod_edit_cb;
} group;
#endif
} lv_theme_t;

View File

@@ -929,8 +929,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 = style_mod;
theme.group.style_mod_edit = style_mod_edit;
theme.group.style_mod_cb = style_mod;
theme.group.style_mod_edit_cb = style_mod_edit;
#endif
return &theme;

View File

@@ -450,8 +450,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 = style_mod;
theme.group.style_mod_edit = style_mod_edit;
theme.group.style_mod_cb = style_mod;
theme.group.style_mod_edit_cb = style_mod_edit;
#endif
return &theme;

View File

@@ -908,8 +908,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 = style_mod;
theme.group.style_mod_edit = style_mod_edit;
theme.group.style_mod_cb = style_mod;
theme.group.style_mod_edit_cb = style_mod_edit;
#endif
return &theme;

View File

@@ -497,8 +497,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 = style_mod;
theme.group.style_mod_edit = style_mod_edit;
theme.group.style_mod_cb = style_mod;
theme.group.style_mod_edit_cb = style_mod_edit;
#endif
return &theme;

View File

@@ -901,8 +901,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 = style_mod;
theme.group.style_mod_edit = style_mod_edit;
theme.group.style_mod_cb = style_mod;
theme.group.style_mod_edit_cb = style_mod_edit;
#endif
return &theme;

View File

@@ -818,8 +818,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 = style_mod;
theme.group.style_mod_edit = style_mod_edit;
theme.group.style_mod_cb = style_mod;
theme.group.style_mod_edit_cb = 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 = style_mod;
theme.group.style_mod_edit = style_mod_edit;
theme.group.style_mod_cb = style_mod;
theme.group.style_mod_edit_cb = style_mod_edit;
#endif
return &theme;

View File

@@ -874,8 +874,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 = style_mod;
theme.group.style_mod_edit = style_mod_edit;
theme.group.style_mod_cb = style_mod;
theme.group.style_mod_edit_cb = style_mod_edit;
#endif
return &theme;