run code formatter

This commit is contained in:
Gabor Kiss-Vamosi
2020-05-18 16:57:23 +02:00
parent 5c7e9bb932
commit ee6c5e3399
39 changed files with 155 additions and 136 deletions

View File

@@ -1,7 +1,7 @@
<h1 align="center"> LVGL - Little and Versatile Graphics Library</h1> <h1 align="center"> LVGL - Little and Versatile Graphics Library</h1>
<p align="center"> <p align="center">
<a href="https://github.com/littlevgl/lvgl/blob/master/LICENCE.txt"><img src="https://img.shields.io/badge/licence-MIT-blue.svg"></a> <a href="https://github.com/littlevgl/lvgl/blob/master/LICENCE.txt"><img src="https://img.shields.io/badge/licence-MIT-blue.svg"></a>
<a href="https://github.com/littlevgl/lvgl/releases/tag/v6.1.2"><img src="https://img.shields.io/badge/version-6.1.2-blue.svg"></a> <a href="https://github.com/littlevgl/lvgl/releases/tag/v7.0.0"><img src="https://img.shields.io/badge/version-6.1.2-blue.svg"></a>
</p> </p>
<p align="center"> <p align="center">

View File

@@ -1,12 +1,12 @@
{ {
"name": "lvgl", "name": "lvgl",
"version": "v6.1.2", "version": "v7.0.0",
"keywords": "graphics, gui, embedded, littlevgl", "keywords": "graphics, gui, embedded, littlevgl",
"description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.", "description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.",
"repository": "repository":
{ {
"type": "git", "type": "git",
"url": "https://github.com/littlevgl/lvgl.git" "url": "https://github.com/lvgl/lvgl.git"
}, },
"build": { "build": {
"includeDir": "." "includeDir": "."

View File

@@ -186,4 +186,3 @@ docs_build()
docs_commit_push(ver_str) docs_commit_push(ver_str)
clean_up() clean_up()

View File

@@ -736,7 +736,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data)
static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data) static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data)
{ {
/* Die gracefully if i->btn_points is NULL */ /* Die gracefully if i->btn_points is NULL */
if (i->btn_points == NULL) { if(i->btn_points == NULL) {
LV_LOG_WARN("indev_button_proc: btn_points was NULL"); LV_LOG_WARN("indev_button_proc: btn_points was NULL");
return; return;
} }

View File

@@ -275,7 +275,7 @@ bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc);
*/ */
static inline bool _lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_t x, lv_coord_t y) static inline bool _lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_t x, lv_coord_t y)
{ {
const uint8_t * src_u8 = (const uint8_t*)dsc->cfg.src; const uint8_t * src_u8 = (const uint8_t *)dsc->cfg.src;
/*Get the target point relative coordinates to the pivot*/ /*Get the target point relative coordinates to the pivot*/
int32_t xt = x - dsc->cfg.pivot_x; int32_t xt = x - dsc->cfg.pivot_x;
@@ -293,7 +293,8 @@ static inline bool _lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_
yt *= dsc->tmp.zoom_inv; yt *= dsc->tmp.zoom_inv;
xs = xt + dsc->tmp.pivot_x_256; xs = xt + dsc->tmp.pivot_x_256;
ys = yt + dsc->tmp.pivot_y_256; ys = yt + dsc->tmp.pivot_y_256;
} else { }
else {
xt *= dsc->tmp.zoom_inv; xt *= dsc->tmp.zoom_inv;
yt *= dsc->tmp.zoom_inv; yt *= dsc->tmp.zoom_inv;
xs = ((dsc->tmp.cosma * xt - dsc->tmp.sinma * yt) >> (LV_TRIGO_SHIFT)) + dsc->tmp.pivot_x_256; xs = ((dsc->tmp.cosma * xt - dsc->tmp.sinma * yt) >> (LV_TRIGO_SHIFT)) + dsc->tmp.pivot_x_256;

View File

@@ -95,10 +95,18 @@ const uint8_t * lv_font_get_bitmap_fmt_txt(const lv_font_t * font, uint32_t unic
uint32_t buf_size = gsize; uint32_t buf_size = gsize;
/*Compute memory size needed to hold decompressed glyph, rounding up*/ /*Compute memory size needed to hold decompressed glyph, rounding up*/
switch(fdsc->bpp) { switch(fdsc->bpp) {
case 1: buf_size = (gsize + 7) >> 3; break; case 1:
case 2: buf_size = (gsize + 3) >> 2; break; buf_size = (gsize + 7) >> 3;
case 3: buf_size = (gsize + 1) >> 1; break; break;
case 4: buf_size = (gsize + 1) >> 1; break; case 2:
buf_size = (gsize + 3) >> 2;
break;
case 3:
buf_size = (gsize + 1) >> 1;
break;
case 4:
buf_size = (gsize + 1) >> 1;
break;
} }
if(_lv_mem_get_size(decompr_buf) < buf_size) { if(_lv_mem_get_size(decompr_buf) < buf_size) {

View File

@@ -222,9 +222,8 @@ uint16_t _lv_atan2(int x, int y)
int64_t _lv_pow(int64_t base, int8_t exp) int64_t _lv_pow(int64_t base, int8_t exp)
{ {
int64_t result = 1; int64_t result = 1;
while (exp) while(exp) {
{ if(exp & 1)
if (exp & 1)
result *= base; result *= base;
exp >>= 1; exp >>= 1;
base *= base; base *= base;

View File

@@ -91,7 +91,8 @@ static uint8_t mem_buf1_32[MEM_BUF_SMALL_SIZE];
static uint8_t mem_buf2_32[MEM_BUF_SMALL_SIZE]; static uint8_t mem_buf2_32[MEM_BUF_SMALL_SIZE];
static lv_mem_buf_t mem_buf_small[] = {{.p = mem_buf1_32, .size = MEM_BUF_SMALL_SIZE, .used = 0}, static lv_mem_buf_t mem_buf_small[] = {{.p = mem_buf1_32, .size = MEM_BUF_SMALL_SIZE, .used = 0},
{.p = mem_buf2_32, .size = MEM_BUF_SMALL_SIZE, .used = 0}}; {.p = mem_buf2_32, .size = MEM_BUF_SMALL_SIZE, .used = 0}
};
/********************** /**********************
* MACROS * MACROS

View File

@@ -119,7 +119,8 @@ void _lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t
} }
/*Calculate the the longest line*/ /*Calculate the the longest line*/
lv_coord_t act_line_length = _lv_txt_get_width(&text[line_start], new_line_start - line_start, font, letter_space, flag); lv_coord_t act_line_length = _lv_txt_get_width(&text[line_start], new_line_start - line_start, font, letter_space,
flag);
size_res->x = LV_MATH_MAX(act_line_length, size_res->x); size_res->x = LV_MATH_MAX(act_line_length, size_res->x);
line_start = new_line_start; line_start = new_line_start;

View File

@@ -302,7 +302,8 @@ static void basic_init(void)
style_init_reset(&pad_inner); style_init_reset(&pad_inner);
lv_style_set_pad_inner(&pad_inner, LV_STATE_DEFAULT, lv_disp_get_size_category(NULL) <= LV_DISP_MEDIUM_LIMIT ? LV_DPX(20) : LV_DPX(40)); lv_style_set_pad_inner(&pad_inner, LV_STATE_DEFAULT,
lv_disp_get_size_category(NULL) <= LV_DISP_MEDIUM_LIMIT ? LV_DPX(20) : LV_DPX(40));
style_init_reset(&pad_small); style_init_reset(&pad_small);
lv_style_int_t pad_small_value = lv_disp_get_size_category(NULL) <= LV_DISP_MEDIUM_LIMIT ? LV_DPX(10) : LV_DPX(20); lv_style_int_t pad_small_value = lv_disp_get_size_category(NULL) <= LV_DISP_MEDIUM_LIMIT ? LV_DPX(10) : LV_DPX(20);

View File

@@ -589,7 +589,8 @@ void lv_dropdown_open(lv_obj_t * ddlist)
lv_obj_add_protect(lv_page_get_scrllable(ext->page), LV_PROTECT_CLICK_FOCUS); lv_obj_add_protect(lv_page_get_scrllable(ext->page), LV_PROTECT_CLICK_FOCUS);
if(ancestor_page_signal == NULL) ancestor_page_signal = lv_obj_get_signal_cb(ext->page); if(ancestor_page_signal == NULL) ancestor_page_signal = lv_obj_get_signal_cb(ext->page);
if(ancestor_page_scrl_signal == NULL) ancestor_page_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrllable(ext->page)); if(ancestor_page_scrl_signal == NULL) ancestor_page_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrllable(
ext->page));
if(ancestor_page_design == NULL) ancestor_page_design = lv_obj_get_design_cb(ext->page); if(ancestor_page_design == NULL) ancestor_page_design = lv_obj_get_design_cb(ext->page);
lv_dropdown_page_ext_t * page_ext = lv_obj_allocate_ext_attr(ext->page, sizeof(lv_dropdown_page_ext_t)); lv_dropdown_page_ext_t * page_ext = lv_obj_allocate_ext_attr(ext->page, sizeof(lv_dropdown_page_ext_t));

View File

@@ -609,7 +609,8 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area
angle_final += ext->angle; angle_final += ext->angle;
lv_area_t bg_coords; lv_area_t bg_coords;
_lv_img_buf_get_transformed_area(&bg_coords, lv_area_get_width(&img_coords), lv_area_get_height(&img_coords), angle_final, zoom_final, &ext->pivot); _lv_img_buf_get_transformed_area(&bg_coords, lv_area_get_width(&img_coords), lv_area_get_height(&img_coords),
angle_final, zoom_final, &ext->pivot);
bg_coords.x1 += img_coords.x1; bg_coords.x1 += img_coords.x1;
bg_coords.y1 += img_coords.y1; bg_coords.y1 += img_coords.y1;
bg_coords.x2 += img_coords.x1; bg_coords.x2 += img_coords.x1;
@@ -648,7 +649,7 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area
if(img_dsc.zoom == 0) return LV_DESIGN_RES_OK; if(img_dsc.zoom == 0) return LV_DESIGN_RES_OK;
img_dsc.angle =angle_final; img_dsc.angle = angle_final;
img_dsc.pivot.x = ext->pivot.x; img_dsc.pivot.x = ext->pivot.x;
img_dsc.pivot.y = ext->pivot.y; img_dsc.pivot.y = ext->pivot.y;

View File

@@ -758,7 +758,8 @@ static lv_res_t lv_page_signal(lv_obj_t * page, lv_signal_t sign, void * param)
} }
else if(sign == LV_SIGNAL_GET_STATE_DSC) { else if(sign == LV_SIGNAL_GET_STATE_DSC) {
lv_get_state_info_t * info = param; lv_get_state_info_t * info = param;
if(info->part == LV_PAGE_PART_SCROLLABLE) info->result = lv_obj_get_state(lv_page_get_scrllable(page), LV_CONT_PART_MAIN); if(info->part == LV_PAGE_PART_SCROLLABLE) info->result = lv_obj_get_state(lv_page_get_scrllable(page),
LV_CONT_PART_MAIN);
else info->result = lv_obj_get_state(page, info->part); else info->result = lv_obj_get_state(page, info->part);
return LV_RES_OK; return LV_RES_OK;
} }
@@ -1244,7 +1245,8 @@ static void scrlbar_refresh(lv_obj_t * page)
lv_area_set_width(&ext->scrlbar.hor_area, obj_w - 2 * sb_hor_pad); lv_area_set_width(&ext->scrlbar.hor_area, obj_w - 2 * sb_hor_pad);
_lv_area_set_pos(&ext->scrlbar.hor_area, sb_hor_pad, _lv_area_set_pos(&ext->scrlbar.hor_area, sb_hor_pad,
obj_h - sb_width - sb_bottom); obj_h - sb_width - sb_bottom);
if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.hor_draw = 0; if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO ||
ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.hor_draw = 0;
} }
/*Smaller horizontal scrollbar*/ /*Smaller horizontal scrollbar*/
else { else {
@@ -1259,7 +1261,8 @@ static void scrlbar_refresh(lv_obj_t * page)
(scrl_w + bg_left + bg_right - obj_w), (scrl_w + bg_left + bg_right - obj_w),
obj_h - sb_width - sb_bottom); obj_h - sb_width - sb_bottom);
if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.hor_draw = 1; if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO ||
ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.hor_draw = 1;
} }
/*Full sized vertical scroll bar*/ /*Full sized vertical scroll bar*/
@@ -1267,7 +1270,8 @@ static void scrlbar_refresh(lv_obj_t * page)
lv_area_set_height(&ext->scrlbar.ver_area, obj_h - 2 * sb_ver_pad); lv_area_set_height(&ext->scrlbar.ver_area, obj_h - 2 * sb_ver_pad);
_lv_area_set_pos(&ext->scrlbar.ver_area, _lv_area_set_pos(&ext->scrlbar.ver_area,
obj_w - sb_width - sb_right, sb_ver_pad); obj_w - sb_width - sb_right, sb_ver_pad);
if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.ver_draw = 0; if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO ||
ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.ver_draw = 0;
} }
/*Smaller vertical scroll bar*/ /*Smaller vertical scroll bar*/
else { else {
@@ -1282,7 +1286,8 @@ static void scrlbar_refresh(lv_obj_t * page)
(obj_h - size_tmp - 2 * sb_ver_pad)) / (obj_h - size_tmp - 2 * sb_ver_pad)) /
(scrl_h + bg_top + bg_bottom - obj_h)); (scrl_h + bg_top + bg_bottom - obj_h));
if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.ver_draw = 1; if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO ||
ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.ver_draw = 1;
} }
/*Invalidate the new scrollbar areas*/ /*Invalidate the new scrollbar areas*/

View File

@@ -170,7 +170,8 @@ void lv_page_set_edge_flash(lv_obj_t * page, bool en);
* @param top bottom fit policy from `lv_fit_t` * @param top bottom fit policy from `lv_fit_t`
* @param bottom bottom fit policy from `lv_fit_t` * @param bottom bottom fit policy from `lv_fit_t`
*/ */
static inline void lv_page_set_scrllable_fit4(lv_obj_t * page, lv_fit_t left, lv_fit_t right, lv_fit_t top, lv_fit_t bottom) static inline void lv_page_set_scrllable_fit4(lv_obj_t * page, lv_fit_t left, lv_fit_t right, lv_fit_t top,
lv_fit_t bottom)
{ {
lv_cont_set_fit4(lv_page_get_scrllable(page), left, right, top, bottom); lv_cont_set_fit4(lv_page_get_scrllable(page), left, right, top, bottom);
} }

View File

@@ -333,7 +333,8 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par
lv_coord_t indic_w = w - bg_left - bg_right; lv_coord_t indic_w = w - bg_left - bg_right;
if(base_dir == LV_BIDI_DIR_RTL) { if(base_dir == LV_BIDI_DIR_RTL) {
new_value = (slider->coords.x2 - bg_right) - p.x; /*Make the point relative to the indicator*/ new_value = (slider->coords.x2 - bg_right) - p.x; /*Make the point relative to the indicator*/
} else { }
else {
new_value = p.x - (slider->coords.x1 + bg_left); /*Make the point relative to the indicator*/ new_value = p.x - (slider->coords.x1 + bg_left); /*Make the point relative to the indicator*/
} }
new_value = (new_value * range) / indic_w; new_value = (new_value * range) / indic_w;

View File

@@ -173,8 +173,7 @@ void lv_spinbox_set_digit_format(lv_obj_t * spinbox, uint8_t digit_count, uint8_
if(separator_position >= digit_count) separator_position = 0; if(separator_position >= digit_count) separator_position = 0;
if(separator_position > LV_SPINBOX_MAX_DIGIT_COUNT) separator_position = LV_SPINBOX_MAX_DIGIT_COUNT; if(separator_position > LV_SPINBOX_MAX_DIGIT_COUNT) separator_position = LV_SPINBOX_MAX_DIGIT_COUNT;
if(digit_count < LV_SPINBOX_MAX_DIGIT_COUNT) if(digit_count < LV_SPINBOX_MAX_DIGIT_COUNT) {
{
uint64_t max_val = _lv_pow(10, digit_count); uint64_t max_val = _lv_pow(10, digit_count);
if(ext->range_max > max_val - 1) ext->range_max = max_val - 1; if(ext->range_max > max_val - 1) ext->range_max = max_val - 1;
if(ext->range_min < - max_val + 1) ext->range_min = - max_val + 1; if(ext->range_min < - max_val + 1) ext->range_min = - max_val + 1;

View File

@@ -599,7 +599,8 @@ static lv_res_t lv_tabview_signal(lv_obj_t * tabview, lv_signal_t sign, void * p
if(info->part == LV_TABVIEW_PART_TAB_BG) info->result = lv_obj_get_state(ext->btns, LV_BTNMATRIX_PART_BG); if(info->part == LV_TABVIEW_PART_TAB_BG) info->result = lv_obj_get_state(ext->btns, LV_BTNMATRIX_PART_BG);
else if(info->part == LV_TABVIEW_PART_TAB_BTN) info->result = lv_obj_get_state(ext->btns, LV_BTNMATRIX_PART_BTN); else if(info->part == LV_TABVIEW_PART_TAB_BTN) info->result = lv_obj_get_state(ext->btns, LV_BTNMATRIX_PART_BTN);
else if(info->part == LV_TABVIEW_PART_INDIC) info->result = lv_obj_get_state(ext->indic, LV_OBJ_PART_MAIN); else if(info->part == LV_TABVIEW_PART_INDIC) info->result = lv_obj_get_state(ext->indic, LV_OBJ_PART_MAIN);
else if(info->part == LV_TABVIEW_PART_BG_SCRLLABLE) info->result = lv_obj_get_state(ext->content, LV_PAGE_PART_SCROLLABLE); else if(info->part == LV_TABVIEW_PART_BG_SCRLLABLE) info->result = lv_obj_get_state(ext->content,
LV_PAGE_PART_SCROLLABLE);
return LV_RES_OK; return LV_RES_OK;
} }