1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

run formatter

This commit is contained in:
Gabor Kiss-Vamosi 2020-03-24 10:13:52 +01:00
parent a8b49faf6b
commit bb0c5a968c
30 changed files with 438 additions and 400 deletions

View File

@ -24,3 +24,11 @@
--preserve-date
--formatted
--exclude=lv_conf_internal.h
--exclude=../src/lv_font/lv_font_roboto_12.c
--exclude=../src/lv_font/lv_font_roboto_12_subpx.c
--exclude=../src/lv_font/lv_font_roboto_16.c
--exclude=../src/lv_font/lv_font_roboto_22.c
--exclude=../src/lv_font/lv_font_roboto_28.c
--exclude=../src/lv_font/lv_font_roboto_28_compressed.c
--exclude=../src/lv_font/lv_font_unscii_8.c

View File

@ -1292,7 +1292,8 @@ void lv_obj_refresh_style(lv_obj_t * obj, lv_style_property_t prop)
if(prop == LV_STYLE_PROP_ALL || (prop & LV_STYLE_INHERIT_MASK))
/*Send style change signals*/
refresh_children_style(obj);
} else {
}
else {
lv_obj_invalidate(obj);
}
}

View File

@ -584,7 +584,8 @@ void _lv_obj_set_style_local_ptr(lv_obj_t * obj, uint8_t type, lv_style_property
* For example: `lv_obj_style_get_trasition_path()`
* @note for performance reasons it's not checked if the property really has pointer type
*/
static inline void _lv_obj_set_style_local_func_ptr(lv_obj_t * obj, uint8_t type, lv_style_property_t prop, lv_style_prop_cb_t value)
static inline void _lv_obj_set_style_local_func_ptr(lv_obj_t * obj, uint8_t type, lv_style_property_t prop,
lv_style_prop_cb_t value)
{
lv_style_fptr_dptr_t fd;
fd.fptr = value;
@ -603,7 +604,8 @@ static inline void _lv_obj_set_style_local_func_ptr(lv_obj_t * obj, uint8_t type
* For example: `lv_obj_style_get_text_font()`
* @note for performance reasons it's not checked if the property really has pointer type
*/
static inline void _lv_obj_set_style_local_data_ptr(lv_obj_t * obj, uint8_t type, lv_style_property_t prop, const void * value)
static inline void _lv_obj_set_style_local_data_ptr(lv_obj_t * obj, uint8_t type, lv_style_property_t prop,
const void * value)
{
lv_style_fptr_dptr_t fd;
fd.fptr = NULL;
@ -1089,7 +1091,8 @@ lv_style_fptr_dptr_t _lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, l
* For example: `lv_obj_style_get_trasition_path()`
* @note for performance reasons it's not checked if the property really has pointer type
*/
static inline lv_style_prop_cb_t _lv_obj_get_style_func_ptr(const lv_obj_t * obj, uint8_t part, lv_style_property_t prop)
static inline lv_style_prop_cb_t _lv_obj_get_style_func_ptr(const lv_obj_t * obj, uint8_t part,
lv_style_property_t prop)
{
lv_style_fptr_dptr_t fd;
fd = _lv_obj_get_style_ptr(obj, part, prop);

View File

@ -217,7 +217,8 @@ _LV_OBJ_STYLE_SET_GET_DECLARE(TRANSITION_PROP_6, transition_prop_6, lv_style_int
#if LV_USE_ANIMATION
_LV_OBJ_STYLE_SET_GET_DECLARE(TRANSITION_PATH, transition_path, lv_anim_path_cb_t, _func_ptr, func_ptr)
#else
_LV_OBJ_STYLE_SET_GET_DECLARE(TRANSITION_PATH, transition_path,lv_style_prop_cb_t, _func_ptr, func_ptr) /*For compatibility*/
_LV_OBJ_STYLE_SET_GET_DECLARE(TRANSITION_PATH, transition_path, lv_style_prop_cb_t, _func_ptr,
func_ptr) /*For compatibility*/
#endif
_LV_OBJ_STYLE_SET_GET_DECLARE(SCALE_WIDTH, scale_width, lv_style_int_t, _int, scalar)
_LV_OBJ_STYLE_SET_GET_DECLARE(SCALE_BORDER_WIDTH, scale_border_width, lv_style_int_t, _int, scalar)

View File

@ -587,7 +587,8 @@ void lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t pro
* @param value the value to set
* @note for performance reasons it's not checked if the property really has pointer type
*/
static inline void lv_style_list_set_local_func_ptr(lv_style_list_t * list, lv_style_property_t prop, lv_style_prop_cb_t value)
static inline void lv_style_list_set_local_func_ptr(lv_style_list_t * list, lv_style_property_t prop,
lv_style_prop_cb_t value)
{
lv_style_fptr_dptr_t fd;
fd.dptr = NULL;
@ -603,7 +604,8 @@ static inline void lv_style_list_set_local_func_ptr(lv_style_list_t * list, lv_s
* @param value the value to set
* @note for performance reasons it's not checked if the property really has pointer type
*/
static inline void lv_style_list_set_local_data_ptr(lv_style_list_t * list, lv_style_property_t prop, const void * value)
static inline void lv_style_list_set_local_data_ptr(lv_style_list_t * list, lv_style_property_t prop,
const void * value)
{
lv_style_fptr_dptr_t fd;
fd.fptr = NULL;

View File

@ -393,7 +393,8 @@ static void fill_normal(const lv_area_t * disp_area, lv_color_t * disp_buf, con
disp_buf_tmp[x + 1] = color;
disp_buf_tmp[x + 2] = color;
disp_buf_tmp[x + 3] = color;
} else {
}
else {
mask_tmp_x = (const lv_opa_t *)mask32;
#if LV_COLOR_SCREEN_TRANSP
FILL_NORMAL_MASK_PX_SCR_TRANSP(x, color)
@ -431,7 +432,8 @@ static void fill_normal(const lv_area_t * disp_area, lv_color_t * disp_buf, con
const lv_opa_t * mask_tmp_x = &mask_tmp[draw_area->x1];
for(x = draw_area->x1; x <= draw_area->x2; x++) {
if(*mask_tmp_x) {
if(*mask_tmp_x != last_mask) opa_tmp = *mask_tmp_x == LV_OPA_COVER ? opa : (uint32_t)((uint32_t)(*mask_tmp_x) * opa) >> 8;
if(*mask_tmp_x != last_mask) opa_tmp = *mask_tmp_x == LV_OPA_COVER ? opa : (uint32_t)((uint32_t)(
*mask_tmp_x) * opa) >> 8;
if(*mask_tmp_x != last_mask || last_dest_color.full != disp_buf_tmp[x].full) {
#if LV_COLOR_SCREEN_TRANSP
if(disp->driver.screen_transp) {

View File

@ -486,8 +486,7 @@ static void lv_draw_map(const lv_area_t * map_area, const lv_area_t * clip_area,
for(x = 0; x < draw_area_w; x++, map_px += px_size_byte, px_i++) {
if(transform == false)
{
if(transform == false) {
if(alpha_byte) {
lv_opa_t px_opa = map_px[LV_IMG_PX_SIZE_ALPHA_BYTE - 1];
mask_buf[px_i] = px_opa;

View File

@ -52,7 +52,8 @@ static const uint8_t bpp2_opa_table[4] = {0, 85, 170, 255}; /*Opacity mapping w
static const uint8_t bpp4_opa_table[16] = {0, 17, 34, 51, /*Opacity mapping with bpp = 4*/
68, 85, 102, 119,
136, 153, 170, 187,
204, 221, 238, 255};
204, 221, 238, 255
};
static const uint8_t bpp8_opa_table[256] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
@ -68,7 +69,8 @@ static const uint8_t bpp8_opa_table[256] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255};
240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
};
/*clang-format on*/
/**********************

View File

@ -381,12 +381,23 @@ static inline uint8_t get_bits(const uint8_t * in, uint32_t bit_pos, uint8_t len
{
uint8_t bit_mask;
switch(len) {
case 1: bit_mask = 0x1; break;
case 2: bit_mask = 0x3; break;
case 3: bit_mask = 0x7; break;
case 4: bit_mask = 0xF; break;
case 8: bit_mask = 0xFF; break;
default: bit_mask = (uint16_t)((uint16_t) 1 << len) - 1;
case 1:
bit_mask = 0x1;
break;
case 2:
bit_mask = 0x3;
break;
case 3:
bit_mask = 0x7;
break;
case 4:
bit_mask = 0xF;
break;
case 8:
bit_mask = 0xFF;
break;
default:
bit_mask = (uint16_t)((uint16_t) 1 << len) - 1;
}
uint32_t byte_pos = bit_pos >> 3;

View File

@ -760,7 +760,8 @@ static void tabview_init(void)
lv_style_init(&tabview_btns_bg);
lv_style_set_bg_opa(&tabview_btns_bg, LV_STATE_DEFAULT, LV_OPA_COVER);
lv_style_set_bg_color(&tabview_btns_bg, LV_STATE_DEFAULT, COLOR_BG);
lv_style_set_border_color(&tabview_btns_bg, LV_STATE_DEFAULT, IS_LIGHT ? lv_color_hex(0xe4eaf0) : lv_color_hex(0x3b3e42));
lv_style_set_border_color(&tabview_btns_bg, LV_STATE_DEFAULT,
IS_LIGHT ? lv_color_hex(0xe4eaf0) : lv_color_hex(0x3b3e42));
lv_style_set_border_width(&tabview_btns_bg, LV_STATE_DEFAULT, LV_DPI / 30 > 0 ? LV_DPI / 30 : 1);
lv_style_set_border_side(&tabview_btns_bg, LV_STATE_DEFAULT, LV_BORDER_SIDE_BOTTOM);
lv_style_set_text_color(&tabview_btns_bg, LV_STATE_DEFAULT, COLOR_SCR_TEXT);

View File

@ -382,7 +382,8 @@ static lv_design_res_t lv_arc_design(lv_obj_t * arc, const lv_area_t * clip_area
lv_coord_t right_bg = lv_obj_get_style_pad_right(arc, LV_ARC_PART_BG);
lv_coord_t top_bg = lv_obj_get_style_pad_top(arc, LV_ARC_PART_BG);
lv_coord_t bottom_bg = lv_obj_get_style_pad_bottom(arc, LV_ARC_PART_BG);
lv_coord_t r = (LV_MATH_MIN(lv_obj_get_width(arc) - left_bg - right_bg, lv_obj_get_height(arc) - top_bg - bottom_bg)) / 2;
lv_coord_t r = (LV_MATH_MIN(lv_obj_get_width(arc) - left_bg - right_bg,
lv_obj_get_height(arc) - top_bg - bottom_bg)) / 2;
lv_coord_t x = arc->coords.x1 + r + left_bg;
lv_coord_t y = arc->coords.y1 + r + top_bg;

View File

@ -485,7 +485,8 @@ static void draw_indic(lv_obj_t * bar, const lv_area_t * clip_area)
lv_coord_t anim_cur_value_end_x =
(int32_t)((int32_t)anim_length * (ext->cur_value_anim.anim_end - ext->min_value)) / range;
anim_cur_value_x = anim_cur_value_start_x + (((anim_cur_value_end_x - anim_cur_value_start_x) * ext->cur_value_anim.anim_state) /
anim_cur_value_x = anim_cur_value_start_x + (((anim_cur_value_end_x - anim_cur_value_start_x) *
ext->cur_value_anim.anim_state) /
LV_BAR_ANIM_STATE_END);
}
else

View File

@ -233,7 +233,8 @@ void lv_btnmatrix_set_map(lv_obj_t * btnm, const char * map[])
/* Set the button's area.
* If inner padding is zero then use the prev. button x2 as x1 to avoid rounding
* errors*/
if(btn_i != 0 && inner == 0 && ((act_x == left && base_dir != LV_BIDI_DIR_RTL) || (act_x + act_unit_w == max_w - right && base_dir == LV_BIDI_DIR_RTL))) {
if(btn_i != 0 && inner == 0 && ((act_x == left && base_dir != LV_BIDI_DIR_RTL) ||
(act_x + act_unit_w == max_w - right && base_dir == LV_BIDI_DIR_RTL))) {
lv_area_set(&ext->button_areas[btn_i], ext->button_areas[btn_i - 1].x2, act_y, act_x + act_unit_w,
act_y + btn_h);
}

View File

@ -293,7 +293,8 @@ static lv_design_res_t lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * cli
lv_obj_init_draw_img_dsc(imgbtn, LV_IMGBTN_PART_MAIN, &img_dsc);
lv_draw_img(&imgbtn->coords, clip_area, src, &img_dsc);
}
} else {
}
else {
#if LV_IMGBTN_TILED
const void * src = ext->img_src_left[state];
if(lv_img_src_get_type(src) == LV_IMG_SRC_SYMBOL) {

View File

@ -986,7 +986,8 @@ static lv_res_t lv_page_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, voi
#if LV_USE_GROUP
if(lv_obj_get_group(page)) {
lv_group_focus_obj(page);
} else
}
else
#endif
{
res = lv_signal_send(page, LV_SIGNAL_FOCUS, NULL);

View File

@ -273,10 +273,12 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par
lv_coord_t dist_left, dist_right;
if(hor) {
if((base_dir != LV_BIDI_DIR_RTL && p.x > ext->right_knob_area.x2) || (base_dir == LV_BIDI_DIR_RTL && p.x < ext->right_knob_area.x1)) {
if((base_dir != LV_BIDI_DIR_RTL && p.x > ext->right_knob_area.x2) || (base_dir == LV_BIDI_DIR_RTL &&
p.x < ext->right_knob_area.x1)) {
ext->value_to_set = &ext->bar.cur_value;
}
else if((base_dir != LV_BIDI_DIR_RTL && p.x < ext->left_knob_area.x1) || (base_dir == LV_BIDI_DIR_RTL && p.x > ext->left_knob_area.x2)) {
else if((base_dir != LV_BIDI_DIR_RTL && p.x < ext->left_knob_area.x1) || (base_dir == LV_BIDI_DIR_RTL &&
p.x > ext->left_knob_area.x2)) {
ext->value_to_set = &ext->bar.start_value;
}
else {

View File

@ -219,7 +219,8 @@ static lv_design_res_t lv_switch_design(lv_obj_t * sw, const lv_area_t * clip_ar
if(base_dir != LV_BIDI_DIR_RTL) {
knob_area.x1 = ext->bar.indic_area.x2 - ((act_indic_w * knob_size) / max_indic_w);
knob_area.x2 = knob_area.x1 + knob_size;
} else {
}
else {
knob_area.x2 = ext->bar.indic_area.x1 + ((act_indic_w * knob_size) / max_indic_w);
knob_area.x1 = knob_area.x2 - knob_size;
}