rename bool '..._en' function paramter names to be more consistent

This commit is contained in:
Gabor Kiss-Vamosi
2018-12-22 19:45:55 +01:00
parent 8c74a23ec1
commit bfba1c477f
15 changed files with 57 additions and 57 deletions

View File

@@ -237,12 +237,12 @@ void lv_ddlist_set_fix_height(lv_obj_t * ddlist, lv_coord_t h)
/**
* Enable or disable the horizontal fit to the content
* @param ddlist pointer to a drop down list
* @param fit en true: enable auto fit; false: disable auto fit
* @param en true: enable auto fit; false: disable auto fit
*/
void lv_ddlist_set_hor_fit(lv_obj_t * ddlist, bool fit_en)
void lv_ddlist_set_hor_fit(lv_obj_t * ddlist, bool en)
{
lv_cont_set_fit(ddlist, fit_en, lv_cont_get_ver_fit(ddlist));
lv_page_set_scrl_fit(ddlist, fit_en, lv_page_get_scrl_fit_ver(ddlist));
lv_cont_set_fit(ddlist, en, lv_cont_get_ver_fit(ddlist));
lv_page_set_scrl_fit(ddlist, en, lv_page_get_scrl_fit_ver(ddlist));
lv_ddlist_refr_size(ddlist, false);
}

View File

@@ -120,9 +120,9 @@ void lv_ddlist_set_fix_height(lv_obj_t * ddlist, lv_coord_t h);
/**
* Enable or disable the horizontal fit to the content
* @param ddlist pointer to a drop down list
* @param fit en true: enable auto fit; false: disable auto fit
* @param en true: enable auto fit; false: disable auto fit
*/
void lv_ddlist_set_hor_fit(lv_obj_t * ddlist, bool fit_en);
void lv_ddlist_set_hor_fit(lv_obj_t * ddlist, bool en);
/**
* Set the scroll bar mode of a drop down list

View File

@@ -206,13 +206,13 @@ void lv_img_set_src(lv_obj_t * img, const void * src_img)
* Enable the auto size feature.
* If enabled the object size will be same as the picture size.
* @param img pointer to an image
* @param autosize_en true: auto size enable, false: auto size disable
* @param en true: auto size enable, false: auto size disable
*/
void lv_img_set_auto_size(lv_obj_t * img, bool autosize_en)
void lv_img_set_auto_size(lv_obj_t * img, bool en)
{
lv_img_ext_t * ext = lv_obj_get_ext_attr(img);
ext->auto_size = (autosize_en == false ? 0 : 1);
ext->auto_size = (en == false ? 0 : 1);
}

View File

@@ -87,7 +87,7 @@ static inline void lv_img_set_file(lv_obj_t * img, const char * fn)
* Enable the auto size feature.
* If enabled the object size will be same as the picture size.
* @param img pointer to an image
* @param autosize_en true: auto size enable, false: auto size disable
* @param en true: auto size enable, false: auto size disable
*/
void lv_img_set_auto_size(lv_obj_t * img, bool autosize_en);

View File

@@ -283,14 +283,14 @@ void lv_label_set_align(lv_obj_t * label, lv_label_align_t align)
/**
* Enable the recoloring by in-line commands
* @param label pointer to a label object
* @param recolor_en true: enable recoloring, false: disable
* @param en true: enable recoloring, false: disable
*/
void lv_label_set_recolor(lv_obj_t * label, bool recolor_en)
void lv_label_set_recolor(lv_obj_t * label, bool en)
{
lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
if(ext->recolor == recolor_en) return;
if(ext->recolor == en) return;
ext->recolor = recolor_en == false ? 0 : 1;
ext->recolor = en == false ? 0 : 1;
lv_label_refr_text(label); /*Refresh the text because the potential colo codes in text needs to be hided or revealed*/
}
@@ -298,14 +298,14 @@ void lv_label_set_recolor(lv_obj_t * label, bool recolor_en)
/**
* Set the label to draw (or not draw) background specified in its style's body
* @param label pointer to a label object
* @param body_en true: draw body; false: don't draw body
* @param en true: draw body; false: don't draw body
*/
void lv_label_set_body_draw(lv_obj_t * label, bool body_en)
void lv_label_set_body_draw(lv_obj_t * label, bool en)
{
lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
if(ext->body_draw == body_en) return;
if(ext->body_draw == en) return;
ext->body_draw = body_en == false ? 0 : 1;
ext->body_draw = en == false ? 0 : 1;
lv_obj_refresh_ext_size(label);

View File

@@ -137,16 +137,16 @@ void lv_label_set_align(lv_obj_t *label, lv_label_align_t align);
/**
* Enable the recoloring by in-line commands
* @param label pointer to a label object
* @param recolor_en true: enable recoloring, false: disable
* @param en true: enable recoloring, false: disable
*/
void lv_label_set_recolor(lv_obj_t * label, bool recolor_en);
void lv_label_set_recolor(lv_obj_t * label, bool en);
/**
* Set the label to draw (or not draw) background specified in its style's body
* @param label pointer to a label object
* @param body_en true: draw body; false: don't draw body
* @param en true: draw body; false: don't draw body
*/
void lv_label_set_body_draw(lv_obj_t *label, bool body_en);
void lv_label_set_body_draw(lv_obj_t *label, bool en);
/**
* Set the label's animation speed in LV_LABEL_LONG_ROLL and SCROLL modes

View File

@@ -132,17 +132,17 @@ void lv_line_set_points(lv_obj_t * line, const lv_point_t * point_a, uint16_t po
* Enable (or disable) the auto-size option. The size of the object will fit to its points.
* (set width to x max and height to y max)
* @param line pointer to a line object
* @param autosize_en true: auto size is enabled, false: auto size is disabled
* @param en true: auto size is enabled, false: auto size is disabled
*/
void lv_line_set_auto_size(lv_obj_t * line, bool autosize_en)
void lv_line_set_auto_size(lv_obj_t * line, bool en)
{
lv_line_ext_t * ext = lv_obj_get_ext_attr(line);
if(ext->auto_size == autosize_en) return;
if(ext->auto_size == en) return;
ext->auto_size = autosize_en == false ? 0 : 1;
ext->auto_size = en == false ? 0 : 1;
/*Refresh the object*/
if(autosize_en) lv_line_set_points(line, ext->point_array, ext->point_num);
if(en) lv_line_set_points(line, ext->point_array, ext->point_num);
}
/**
@@ -150,14 +150,14 @@ void lv_line_set_auto_size(lv_obj_t * line, bool autosize_en)
* If enabled then y will be subtracted from the height of the object,
* therefore the y=0 coordinate will be on the bottom.
* @param line pointer to a line object
* @param yinv_en true: enable the y inversion, false:disable the y inversion
* @param en true: enable the y inversion, false:disable the y inversion
*/
void lv_line_set_y_invert(lv_obj_t * line, bool yinv_en)
void lv_line_set_y_invert(lv_obj_t * line, bool en)
{
lv_line_ext_t * ext = lv_obj_get_ext_attr(line);
if(ext->y_inv == yinv_en) return;
if(ext->y_inv == en) return;
ext->y_inv = yinv_en == false ? 0 : 1;
ext->y_inv = en == false ? 0 : 1;
lv_obj_invalidate(line);
}

View File

@@ -70,18 +70,18 @@ void lv_line_set_points(lv_obj_t * line, const lv_point_t * point_a, uint16_t po
* Enable (or disable) the auto-size option. The size of the object will fit to its points.
* (set width to x max and height to y max)
* @param line pointer to a line object
* @param autosize_en true: auto size is enabled, false: auto size is disabled
* @param en true: auto size is enabled, false: auto size is disabled
*/
void lv_line_set_auto_size(lv_obj_t * line, bool autosize_en);
void lv_line_set_auto_size(lv_obj_t * line, bool en);
/**
* Enable (or disable) the y coordinate inversion.
* If enabled then y will be subtracted from the height of the object,
* therefore the y=0 coordinate will be on the bottom.
* @param line pointer to a line object
* @param yinv_en true: enable the y inversion, false:disable the y inversion
* @param en true: enable the y inversion, false:disable the y inversion
*/
void lv_line_set_y_invert(lv_obj_t * line, bool yinv_en);
void lv_line_set_y_invert(lv_obj_t * line, bool en);
#define lv_line_set_y_inv lv_line_set_y_invert /*The name was inconsistent. In v.6.0 only `lv_line_set_y_invert`will work */

View File

@@ -110,11 +110,11 @@ void lv_roller_set_visible_row_count(lv_obj_t *roller, uint8_t row_cnt);
/**
* Enable or disable the horizontal fit to the content
* @param roller pointer to a roller
* @param fit en true: enable auto fit; false: disable auto fit
* @param en true: enable auto fit; false: disable auto fit
*/
static inline void lv_roller_set_hor_fit(lv_obj_t * roller, bool fit_en)
static inline void lv_roller_set_hor_fit(lv_obj_t * roller, bool en)
{
lv_ddlist_set_hor_fit(roller, fit_en);
lv_ddlist_set_hor_fit(roller, en);
}
/**

View File

@@ -503,15 +503,15 @@ void lv_ta_set_cursor_type(lv_obj_t * ta, lv_cursor_type_t cur_type)
/**
* Enable/Disable password mode
* @param ta pointer to a text area object
* @param pwd_en true: enable, false: disable
* @param en true: enable, false: disable
*/
void lv_ta_set_pwd_mode(lv_obj_t * ta, bool pwd_en)
void lv_ta_set_pwd_mode(lv_obj_t * ta, bool en)
{
lv_ta_ext_t * ext = lv_obj_get_ext_attr(ta);
if(ext->pwd_mode == pwd_en) return;
if(ext->pwd_mode == en) return;
/*Pwd mode is now enabled*/
if(ext->pwd_mode == 0 && pwd_en != false) {
if(ext->pwd_mode == 0 && en != false) {
char * txt = lv_label_get_text(ext->label);
uint16_t len = strlen(txt);
ext->pwd_tmp = lv_mem_alloc(len + 1);
@@ -529,13 +529,13 @@ void lv_ta_set_pwd_mode(lv_obj_t * ta, bool pwd_en)
lv_label_set_text(ext->label, NULL);
}
/*Pwd mode is now disabled*/
else if(ext->pwd_mode == 1 && pwd_en == false) {
else if(ext->pwd_mode == 1 && en == false) {
lv_label_set_text(ext->label, ext->pwd_tmp);
lv_mem_free(ext->pwd_tmp);
ext->pwd_tmp = NULL;
}
ext->pwd_mode = pwd_en == false ? 0 : 1;
ext->pwd_mode = en == false ? 0 : 1;
}
/**

View File

@@ -150,9 +150,9 @@ void lv_ta_set_cursor_type(lv_obj_t * ta, lv_cursor_type_t cur_type);
/**
* Enable/Disable password mode
* @param ta pointer to a text area object
* @param pwd_en true: enable, false: disable
* @param en true: enable, false: disable
*/
void lv_ta_set_pwd_mode(lv_obj_t * ta, bool pwd_en);
void lv_ta_set_pwd_mode(lv_obj_t * ta, bool en);
/**
* Configure the text area to one line or back to normal

View File

@@ -425,13 +425,13 @@ void lv_tabview_set_btns_pos(lv_obj_t * tabview, lv_tabview_btns_pos_t btns_pos)
/**
* Set whether tab buttons are hidden
* @param tabview pointer to a tab view object
* @param hidden whether tab buttons are hidden
* @param en whether tab buttons are hidden
*/
void lv_tabview_set_btns_hidden(lv_obj_t *tabview, bool hidden)
void lv_tabview_set_btns_hidden(lv_obj_t *tabview, bool en)
{
lv_tabview_ext_t * ext = lv_obj_get_ext_attr(tabview);
ext->btns_hide = hidden;
ext->btns_hide = en;
tabview_realign(tabview);
}

View File

@@ -168,9 +168,9 @@ void lv_tabview_set_btns_pos(lv_obj_t *tabview, lv_tabview_btns_pos_t btns_pos);
/**
* Set whether tab buttons are hidden
* @param tabview pointer to a tab view object
* @param hidden whether tab buttons are hidden
* @param en whether tab buttons are hidden
*/
void lv_tabview_set_btns_hidden(lv_obj_t *tabview, bool hidden);
void lv_tabview_set_btns_hidden(lv_obj_t *tabview, bool en);
/*=====================
* Getter functions

View File

@@ -302,14 +302,14 @@ void lv_win_set_style(lv_obj_t * win, lv_win_style_t type, lv_style_t * style)
/**
* Set drag status of a window. If set to 'true' window can be dragged like on a PC.
* @param win pointer to a window object
* @param drag_en whether dragging is enabled
* @param en whether dragging is enabled
*/
void lv_win_set_drag(lv_obj_t *win, bool drag_en)
void lv_win_set_drag(lv_obj_t *win, bool en)
{
lv_win_ext_t * ext = lv_obj_get_ext_attr(win);
lv_obj_t * win_header = ext->header;
lv_obj_set_drag_parent(win_header, drag_en);
lv_obj_set_drag(win, drag_en);
lv_obj_set_drag_parent(win_header, en);
lv_obj_set_drag(win, en);
}
/*=====================

View File

@@ -160,9 +160,9 @@ void lv_win_set_style(lv_obj_t *win, lv_win_style_t type, lv_style_t *style);
/**
* Set drag status of a window. If set to 'true' window can be dragged like on a PC.
* @param win pointer to a window object
* @param drag_en whether dragging is enabled
* @param en whether dragging is enabled
*/
void lv_win_set_drag(lv_obj_t *win, bool drag_en);
void lv_win_set_drag(lv_obj_t *win, bool en);
/*=====================
* Getter functions