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

Run code formatter

This commit is contained in:
Gabor Kiss-Vamosi 2020-07-21 13:29:36 +02:00
parent ecfef570ea
commit 960bca7807
14 changed files with 166 additions and 154 deletions

View File

@ -23,9 +23,9 @@
**********************/
#if LV_USE_ANIMATION
static void scr_load_anim_start(lv_anim_t * a);
static void opa_scale_anim(lv_obj_t * obj, lv_anim_value_t v);
static void scr_anim_ready(lv_anim_t * a);
static void scr_load_anim_start(lv_anim_t * a);
static void opa_scale_anim(lv_obj_t * obj, lv_anim_value_t v);
static void scr_anim_ready(lv_anim_t * a);
#endif
/**********************

View File

@ -35,7 +35,7 @@ typedef enum {
LV_SCR_LOAD_ANIM_MOVE_TOP,
LV_SCR_LOAD_ANIM_MOVE_BOTTOM,
LV_SCR_LOAD_ANIM_FADE_ON,
}lv_scr_load_anim_t;
} lv_scr_load_anim_t;
/**********************
* GLOBAL PROTOTYPES

View File

@ -85,8 +85,10 @@ static void refresh_children_position(lv_obj_t * obj, lv_coord_t x_diff, lv_coor
static void report_style_mod_core(void * style_p, lv_obj_t * obj);
static void refresh_children_style(lv_obj_t * obj);
static void base_dir_refr_children(lv_obj_t * obj);
static void obj_align_core(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, bool x_set, bool y_set, lv_coord_t x_ofs, lv_coord_t y_ofs);
static void obj_align_origo_core(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, bool x_set, bool y_set, lv_coord_t x_ofs, lv_coord_t y_ofs);
static void obj_align_core(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, bool x_set, bool y_set,
lv_coord_t x_ofs, lv_coord_t y_ofs);
static void obj_align_origo_core(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, bool x_set, bool y_set,
lv_coord_t x_ofs, lv_coord_t y_ofs);
#if LV_USE_ANIMATION
static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop, uint8_t part, lv_state_t prev_state,
lv_state_t new_state);
@ -3818,7 +3820,8 @@ static void base_dir_refr_children(lv_obj_t * obj)
}
}
static void obj_align_core(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, bool x_set, bool y_set, lv_coord_t x_ofs, lv_coord_t y_ofs)
static void obj_align_core(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, bool x_set, bool y_set,
lv_coord_t x_ofs, lv_coord_t y_ofs)
{
lv_point_t new_pos;
_lv_area_align(&base->coords, &obj->coords, align, &new_pos);
@ -3837,7 +3840,8 @@ static void obj_align_core(lv_obj_t * obj, const lv_obj_t * base, lv_align_t ali
else if(y_set) lv_obj_set_y(obj, new_pos.y);
}
static void obj_align_origo_core(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, bool x_set, bool y_set, lv_coord_t x_ofs, lv_coord_t y_ofs)
static void obj_align_origo_core(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, bool x_set, bool y_set,
lv_coord_t x_ofs, lv_coord_t y_ofs)
{
lv_coord_t new_x = lv_obj_get_x(obj);
lv_coord_t new_y = lv_obj_get_y(obj);

View File

@ -517,10 +517,12 @@ static void lv_refr_area_part(const lv_area_t * area_p)
lv_area_t a;
lv_area_set(&a, 0, 0, header.w - 1, header.h - 1);
lv_draw_img(&a, &start_mask, disp_refr->bg_img, &dsc);
} else {
}
else {
LV_LOG_WARN("Can't draw the background image")
}
} else {
}
else {
lv_draw_rect_dsc_t dsc;
lv_draw_rect_dsc_init(&dsc);
dsc.bg_color = disp_refr->bg_color;

View File

@ -115,7 +115,8 @@ const uint8_t * lv_font_get_bitmap_fmt_txt(const lv_font_t * font, uint32_t unic
}
bool prefilter = fdsc->bitmap_format == LV_FONT_FMT_TXT_COMPRESSED ? true : false;
decompress(&fdsc->glyph_bitmap[gdsc->bitmap_index], decompr_buf, gdsc->box_w, gdsc->box_h, (uint8_t)fdsc->bpp, prefilter);
decompress(&fdsc->glyph_bitmap[gdsc->bitmap_index], decompr_buf, gdsc->box_w, gdsc->box_h, (uint8_t)fdsc->bpp,
prefilter);
return decompr_buf;
}
@ -349,7 +350,7 @@ static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord
uint8_t * line_buf2 = NULL;
if(prefilter) {
line_buf2= _lv_mem_buf_get(w);
line_buf2 = _lv_mem_buf_get(w);
}
decompress_line(line_buf1, w);
@ -371,7 +372,8 @@ static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord
bits_write(out, wrp, line_buf1[x], bpp);
wrp += wr_size;
}
} else {
}
else {
decompress_line(line_buf1, w);
for(x = 0; x < w; x++) {

View File

@ -150,7 +150,7 @@ typedef struct {
typedef enum {
LV_FONT_FMT_TXT_PLAIN = 0,
LV_FONT_FMT_TXT_COMPRESSED = 1,
LV_FONT_FMT_TXT_COMPRESSED_NO_PREFILTER= 1,
LV_FONT_FMT_TXT_COMPRESSED_NO_PREFILTER = 1,
} lv_font_fmt_txt_bitmap_format_t;

View File

@ -151,7 +151,8 @@ typedef struct _disp_t {
struct _lv_obj_t * top_layer; /**< @see lv_disp_get_layer_top */
struct _lv_obj_t * sys_layer; /**< @see lv_disp_get_layer_sys */
uint8_t del_prev :1; /**< 1: Automatically delete the previous screen when the screen load animation is ready */
uint8_t del_prev :
1; /**< 1: Automatically delete the previous screen when the screen load animation is ready */
lv_color_t bg_color; /**< Default display color when screens are transparent*/
const void * bg_img; /**< An image source to display as wallpaper*/

View File

@ -191,7 +191,7 @@ static void apply_theme(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
}
/*apply_xcb is deprecated, use apply_cb instead*/
if (th->apply_xcb) {
if(th->apply_xcb) {
th->apply_xcb(obj, name);
}
else if(th->apply_cb) {

View File

@ -1070,11 +1070,11 @@ static uint8_t get_day_of_week(uint32_t year, uint32_t month, uint32_t day)
uint32_t a = month < 3 ? 1 : 0;
uint32_t b = year - a;
#if LV_CALENDAR_WEEK_STARTS_MONDAY
#if LV_CALENDAR_WEEK_STARTS_MONDAY
uint32_t day_of_week = (day + (31 * (month - 2 + 12 * a) / 12) + b + (b / 4) - (b / 100) + (b / 400) - 1) % 7;
#else
#else
uint32_t day_of_week = (day + (31 * (month - 2 + 12 * a) / 12) + b + (b / 4) - (b / 100) + (b / 400)) % 7;
#endif
#endif
return day_of_week;
}

View File

@ -311,7 +311,7 @@ void lv_chart_set_point_count(lv_obj_t * chart, uint16_t point_cnt)
if(point_cnt < 1) point_cnt = 1;
_LV_LL_READ_BACK(ext->series_ll, ser) {
if( !ser->ext_buf_assigned ) {
if(!ser->ext_buf_assigned) {
if(ser->start_point != 0) {
lv_coord_t * new_points = lv_mem_alloc(sizeof(lv_coord_t) * point_cnt);
LV_ASSERT_MEM(new_points);
@ -563,7 +563,7 @@ void lv_chart_set_x_start_point(lv_obj_t * chart, lv_chart_series_t * ser, uint1
if(chart == NULL || ser == NULL) return;
lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
if(ext == NULL) return;
if( id >= ext->point_cnt ) return;
if(id >= ext->point_cnt) return;
ser->start_point = id;
}
@ -582,7 +582,7 @@ void lv_chart_set_ext_array(lv_obj_t * chart, lv_chart_series_t * ser, lv_coord_
if(chart == NULL || ser == NULL) return;
lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
if( !ser->ext_buf_assigned && ser->points ) lv_mem_free(ser->points);
if(!ser->ext_buf_assigned && ser->points) lv_mem_free(ser->points);
ser->ext_buf_assigned = true;
ser->points = array;
ext->point_cnt = point_cnt;
@ -603,7 +603,7 @@ void lv_chart_set_point_id(lv_obj_t * chart, lv_chart_series_t * ser, lv_coord_t
if(chart == NULL || ser == NULL) return;
lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
if(ext == NULL) return;
if( id >= ext->point_cnt ) return;
if(id >= ext->point_cnt) return;
ser->points[id] = value;
}
@ -623,7 +623,7 @@ void lv_chart_set_series_axis(lv_obj_t * chart, lv_chart_series_t * ser, lv_char
return;
}
if( ser->y_axis == axis) return;
if(ser->y_axis == axis) return;
ser->y_axis = axis;
lv_chart_refresh(chart);
@ -684,7 +684,7 @@ lv_coord_t lv_chart_get_point_id(lv_obj_t * chart, lv_chart_series_t * ser, uint
LV_ASSERT_NULL(ser);
lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
if( id >= ext->point_cnt ) id = 0;
if(id >= ext->point_cnt) id = 0;
return(ser->points[id]);
}
@ -783,8 +783,8 @@ static lv_res_t lv_chart_signal(lv_obj_t * chart, lv_signal_t sign, void * param
if(sign == LV_SIGNAL_CLEANUP) {
lv_chart_series_t * ser;
while( ext->series_ll.head != NULL ) {
ser =_lv_ll_get_head(&ext->series_ll);
while(ext->series_ll.head != NULL) {
ser = _lv_ll_get_head(&ext->series_ll);
if(!ser->ext_buf_assigned) lv_mem_free(ser->points);

View File

@ -288,7 +288,7 @@ void lv_chart_set_x_start_point(lv_obj_t * chart, lv_chart_series_t * ser, uint1
* @param ser pointer to a data series on 'chart'
* @param array external array of points for chart
*/
void lv_chart_set_ext_array(lv_obj_t * chart, lv_chart_series_t * ser, lv_coord_t array[], uint16_t point_cnt );
void lv_chart_set_ext_array(lv_obj_t * chart, lv_chart_series_t * ser, lv_coord_t array[], uint16_t point_cnt);
/**
* Set an individual point value in the chart series directly based on index

View File

@ -474,12 +474,15 @@ static lv_design_res_t lv_roller_design(lv_obj_t * roller, const lv_area_t * cli
/*Get the size of the "selected text"*/
lv_point_t res_p;
_lv_txt_get_size(&res_p, lv_label_get_text(label), label_dsc.font, label_dsc.letter_space, label_dsc.line_space, lv_obj_get_width(roller), LV_TXT_FLAG_EXPAND);
_lv_txt_get_size(&res_p, lv_label_get_text(label), label_dsc.font, label_dsc.letter_space, label_dsc.line_space,
lv_obj_get_width(roller), LV_TXT_FLAG_EXPAND);
/*Move the selected label proportionally with the background label*/
lv_coord_t roller_h = lv_obj_get_height(roller);
int32_t label_y_prop = label->coords.y1 - (roller_h / 2 + roller->coords.y1); /*label offset from the middle line of the roller*/
label_y_prop = (label_y_prop << 14) / lv_obj_get_height(label); /*Proportional position from the middle line (upscaled)*/
int32_t label_y_prop = label->coords.y1 - (roller_h / 2 +
roller->coords.y1); /*label offset from the middle line of the roller*/
label_y_prop = (label_y_prop << 14) / lv_obj_get_height(
label); /*Proportional position from the middle line (upscaled)*/
/*Apply a correction with different line heights*/
const lv_font_t * normal_label_font = lv_obj_get_style_text_font(roller, LV_ROLLER_PART_BG);