chore(format): run code-format.sh (#2822)

* fix(format): run code-format.sh

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

* fix(astyle): add the 3rd party source file to exclude list

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2021-11-22 06:32:48 -06:00
committed by GitHub
parent 77287ca7d9
commit 3a0069adf8
49 changed files with 598 additions and 543 deletions

View File

@@ -84,5 +84,5 @@ print("\nGenerating 16 px unscii")
os.system("lv_font_conv --no-compress --no-prefilter --bpp 1 --size 16 --font unscii-8.ttf -r 0x20-0x7F --format lvgl -o lv_font_unscii_16.c --force-fast-kern-format")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_*.c')
os.system('astyle --options=../code-format.cfg "lv_font_*.c"')
os.system('astyle --ignore-exclude-errors --options=../code-format.cfg "lv_font_*.c"')
os.system('mv lv_font_*.c ../../src/font/')

View File

@@ -23,3 +23,12 @@
--suffix=none
--preserve-date
--formatted
--exclude=../src/extra/libs/gif/gifdec.c
--exclude=../src/extra/libs/gif/gifdec.h
--exclude=../src/extra/libs/png/lodepng.c
--exclude=../src/extra/libs/png/lodepng.h
--exclude=../src/extra/libs/qrcode/qrcodegen.c
--exclude=../src/extra/libs/qrcode/qrcodegen.h
--exclude=../src/extra/libs/sjpg/tjpgd.c
--exclude=../src/extra/libs/sjpg/tjpgd.h
--exclude=../src/extra/libs/sjpg/tjpgdcnf.h

View File

@@ -429,8 +429,7 @@ static lv_res_t event_send_core(lv_event_t * e)
event_dsc = lv_obj_get_event_dsc(e->current_target, i);
}
if(res == LV_RES_OK && e->current_target->parent && event_is_bubbled(e))
{
if(res == LV_RES_OK && e->current_target->parent && event_is_bubbled(e)) {
e->current_target = e->current_target->parent;
res = event_send_core(e);
if(res != LV_RES_OK) return LV_RES_INV;

View File

@@ -994,8 +994,7 @@ static void indev_click_focus(_lv_indev_proc_t * proc)
{
/*Handle click focus*/
if(lv_obj_has_flag(indev_obj_act, LV_OBJ_FLAG_CLICK_FOCUSABLE) == false ||
proc->types.pointer.last_pressed == indev_obj_act)
{
proc->types.pointer.last_pressed == indev_obj_act) {
return;
}

View File

@@ -972,7 +972,8 @@ static lv_coord_t calc_content_width(lv_obj_t * obj)
child_res = LV_MAX(child_res, lv_area_get_width(&child->coords));
}
}
} else {
}
else {
child_res = LV_MAX(child_res, obj->coords.x2 - child->coords.x1 + 1);
}
}
@@ -1003,7 +1004,8 @@ static lv_coord_t calc_content_width(lv_obj_t * obj)
child_res = LV_MAX(child_res, lv_area_get_width(&child->coords));
}
}
} else {
}
else {
child_res = LV_MAX(child_res, child->coords.x2 - obj->coords.x1 + 1);
}
}
@@ -1054,7 +1056,8 @@ static lv_coord_t calc_content_height(lv_obj_t * obj)
}
break;
}
} else {
}
else {
child_res = LV_MAX(child_res, child->coords.y2 - obj->coords.y1 + 1);
}
}
@@ -1062,7 +1065,8 @@ static lv_coord_t calc_content_height(lv_obj_t * obj)
if(child_res != LV_COORD_MIN) {
child_res += pad_bottom;
return LV_MAX(child_res, self_h);
} else {
}
else {
return self_h;
}

View File

@@ -648,7 +648,8 @@ void lv_obj_set_style_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selec
lv_obj_set_local_style_prop(obj, LV_STYLE_OPA, v, selector);
}
void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector)
void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value,
lv_style_selector_t selector)
{
lv_style_value_t v = {
.ptr = value
@@ -680,7 +681,8 @@ void lv_obj_set_style_anim_speed(struct _lv_obj_t * obj, uint32_t value, lv_styl
lv_obj_set_local_style_prop(obj, LV_STYLE_ANIM_SPEED, v, selector);
}
void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector)
void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value,
lv_style_selector_t selector)
{
lv_style_value_t v = {
.ptr = value

View File

@@ -484,7 +484,8 @@ static inline lv_opa_t lv_obj_get_style_opa(const struct _lv_obj_t * obj, uint32
return (lv_opa_t)v.num;
}
static inline const lv_color_filter_dsc_t * lv_obj_get_style_color_filter_dsc(const struct _lv_obj_t * obj, uint32_t part)
static inline const lv_color_filter_dsc_t * lv_obj_get_style_color_filter_dsc(const struct _lv_obj_t * obj,
uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_COLOR_FILTER_DSC);
return (const lv_color_filter_dsc_t *)v.ptr;
@@ -613,11 +614,13 @@ void lv_obj_set_style_text_align(struct _lv_obj_t * obj, lv_text_align_t value,
void lv_obj_set_style_radius(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_clip_corner(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector);
void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value,
lv_style_selector_t selector);
void lv_obj_set_style_color_filter_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_anim_time(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector);
void lv_obj_set_style_anim_speed(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector);
void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector);
void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value,
lv_style_selector_t selector);
void lv_obj_set_style_blend_mode(struct _lv_obj_t * obj, lv_blend_mode_t value, lv_style_selector_t selector);
void lv_obj_set_style_layout(struct _lv_obj_t * obj, uint16_t value, lv_style_selector_t selector);
void lv_obj_set_style_base_dir(struct _lv_obj_t * obj, lv_base_dir_t value, lv_style_selector_t selector);

View File

@@ -536,7 +536,8 @@ static void lv_refr_area_part(const lv_area_t * area_p)
if(top_act_scr == NULL && top_prev_scr == NULL) {
if(disp_refr->bg_fn) {
disp_refr->bg_fn(&start_mask);
} else if(disp_refr->bg_img) {
}
else if(disp_refr->bg_img) {
lv_draw_img_dsc_t dsc;
lv_draw_img_dsc_init(&dsc);
dsc.opa = disp_refr->bg_opa;

View File

@@ -165,7 +165,8 @@ static FT_Error font_face_requester(FTC_FaceID face_id,
FT_Error error;
if(info->mem) {
error = FT_New_Memory_Face(library, info->mem, info->size, 0, aface);
} else {
}
else {
error = FT_New_Face(library, info->name, 0, aface);
}
if(error) {
@@ -425,7 +426,8 @@ static bool lv_ft_font_init_nocache(lv_ft_info_t * info)
FT_Error error;
if(info->mem) {
error = FT_New_Memory_Face(library, info->mem, (FT_Long) info->mem_size, 0, &face);
} else {
}
else {
error = FT_New_Face(library, info->name, 0, &face);
}
if(error) {

View File

@@ -110,7 +110,8 @@ static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode)
FRESULT res = f_open(f, path, flags);
if(res == FR_OK) {
return f;
} else {
}
else {
lv_mem_free(f);
return NULL;
}

View File

@@ -143,7 +143,7 @@ static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_
{
LV_UNUSED(drv);
*br = read((lv_uintptr_t)file_p, buf, btr);
return (int32_t)*br < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK;
return (int32_t)(*br) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK;
}
/**
@@ -159,7 +159,7 @@ static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf,
{
LV_UNUSED(drv);
*bw = write((lv_uintptr_t)file_p, buf, btw);
return (int32_t)*bw < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK;
return (int32_t)(*bw) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK;
}
/**
@@ -232,10 +232,12 @@ static void * fs_dir_open(lv_fs_drv_t * drv, const char * path)
do {
if(strcmp(fdata.cFileName, ".") == 0 || strcmp(fdata.cFileName, "..") == 0) {
continue;
} else {
}
else {
if(fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
sprintf(next_fn, "/%s", fdata.cFileName);
} else {
}
else {
sprintf(next_fn, "%s", fdata.cFileName);
}
break;
@@ -265,7 +267,8 @@ static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn)
if(entry) {
if(entry->d_type == DT_DIR) sprintf(fn, "/%s", entry->d_name);
else strcpy(fn, entry->d_name);
} else {
}
else {
strcpy(fn, "");
}
} while(strcmp(fn, "/.") == 0 || strcmp(fn, "/..") == 0);
@@ -279,10 +282,12 @@ static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn)
do {
if(strcmp(fdata.cFileName, ".") == 0 || strcmp(fdata.cFileName, "..") == 0) {
continue;
} else {
}
else {
if(fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
sprintf(next_fn, "/%s", fdata.cFileName);
} else {
}
else {
sprintf(next_fn, "%s", fdata.cFileName);
}
break;

View File

@@ -141,7 +141,7 @@ static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_
{
LV_UNUSED(drv);
*br = fread(buf, 1, btr, file_p);
return (int32_t)*br < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK;
return (int32_t)(*br) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK;
}
/**
@@ -157,7 +157,7 @@ static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf,
{
LV_UNUSED(drv);
*bw = fwrite(buf, 1, btw, file_p);
return (int32_t)*bw < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK;
return (int32_t)(*bw) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK;
}
/**
@@ -229,10 +229,12 @@ static void * fs_dir_open(lv_fs_drv_t * drv, const char * path)
do {
if(strcmp(fdata.cFileName, ".") == 0 || strcmp(fdata.cFileName, "..") == 0) {
continue;
} else {
}
else {
if(fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
sprintf(next_fn, "/%s", fdata.cFileName);
} else {
}
else {
sprintf(next_fn, "%s", fdata.cFileName);
}
break;
@@ -262,7 +264,8 @@ static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn)
if(entry) {
if(entry->d_type == DT_DIR) sprintf(fn, "/%s", entry->d_name);
else strcpy(fn, entry->d_name);
} else {
}
else {
strcpy(fn, "");
}
} while(strcmp(fn, "/.") == 0 || strcmp(fn, "/..") == 0);
@@ -276,10 +279,12 @@ static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn)
do {
if(strcmp(fdata.cFileName, ".") == 0 || strcmp(fdata.cFileName, "..") == 0) {
continue;
} else {
}
else {
if(fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
sprintf(next_fn, "/%s", fdata.cFileName);
} else {
}
else {
sprintf(next_fn, "%s", fdata.cFileName);
}
break;

View File

@@ -139,7 +139,8 @@ static void next_frame_task_cb(lv_timer_t * t)
if(gifobj->gif->loop_count == 1) {
lv_res_t res = lv_event_send(obj, LV_EVENT_READY, NULL);
if(res != LV_FS_RES_OK) return;
} else {
}
else {
if(gifobj->gif->loop_count > 1) gifobj->gif->loop_count--;
gd_rewind(gifobj->gif);
}

View File

@@ -144,7 +144,8 @@ lv_res_t lv_qrcode_update(lv_obj_t * qrcode, const void * data, uint32_t data_le
if(aligned == false) {
c.full = a ? 0 : 1;
lv_canvas_set_px_color(qrcode, x, y, c);
} else {
}
else {
if(!a) b |= (1 << (7 - p));
p++;
if(p == 8) {

View File

@@ -108,8 +108,7 @@ static void lv_rlottie_constructor(const lv_obj_class_t * class_p, lv_obj_t * ob
size_t allocaled_buf_size = (create_width * create_height * LV_COLOR_DEPTH / 8);
rlottie->allocated_buf = lv_mem_alloc(allocaled_buf_size);
if (rlottie->allocated_buf != NULL)
{
if(rlottie->allocated_buf != NULL) {
rlottie->allocated_buffer_size = allocaled_buf_size;
memset(rlottie->allocated_buf, 0, allocaled_buf_size);
}

View File

@@ -46,7 +46,8 @@ extern const lv_obj_class_t lv_rlottie_class;
lv_obj_t * lv_rlottie_create_from_file(lv_obj_t * parent, lv_coord_t width, lv_coord_t height, const char * path);
lv_obj_t* lv_rlottie_create_from_raw(lv_obj_t* parent, lv_coord_t width, lv_coord_t height, const char* rlottie_desc);
lv_obj_t * lv_rlottie_create_from_raw(lv_obj_t * parent, lv_coord_t width, lv_coord_t height,
const char * rlottie_desc);
/**********************
* MACROS

View File

@@ -107,7 +107,8 @@ typedef struct {
**********************/
static lv_res_t decoder_info(lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header);
static lv_res_t decoder_open(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc);
static lv_res_t decoder_read_line( lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc, lv_coord_t x,lv_coord_t y, lv_coord_t len, uint8_t * buf );
static lv_res_t decoder_read_line(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_coord_t y,
lv_coord_t len, uint8_t * buf);
static void decoder_close(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc);
static size_t input_func(JDEC * jd, uint8_t * buff, size_t ndata);
static int is_jpg(const uint8_t * raw_data);
@@ -173,7 +174,8 @@ static lv_res_t decoder_info( lv_img_decoder_t * decoder, const void * src, lv_i
return ret;
} else if( is_jpg( raw_sjpeg_data ) == true ) {
}
else if(is_jpg(raw_sjpeg_data) == true) {
header->always_zero = 0;
header->cf = LV_IMG_CF_RAW;
@@ -193,7 +195,8 @@ static lv_res_t decoder_info( lv_img_decoder_t * decoder, const void * src, lv_i
header->w = jd_tmp.width;
header->h = jd_tmp.height;
} else {
}
else {
ret = LV_RES_INV;
goto end;
}
@@ -241,7 +244,8 @@ static lv_res_t decoder_info( lv_img_decoder_t * decoder, const void * src, lv_i
return LV_RES_OK;
}
} else if(!strcmp(&fn[strlen(fn) - 4], ".jpg")) {
}
else if(!strcmp(&fn[strlen(fn) - 4], ".jpg")) {
lv_fs_file_t file;
lv_fs_res_t res = lv_fs_open(&file, fn, LV_FS_MODE_RD);
if(res != LV_FS_RES_OK) return 78;
@@ -319,7 +323,8 @@ static size_t input_func ( JDEC* jd, uint8_t* buff, size_t ndata )
uint32_t rn = 0;
lv_fs_read(lv_file_p, buff, (uint32_t)ndata, &rn);
return rn;
} else {
}
else {
uint32_t pos;
lv_fs_tell(lv_file_p, &pos);
lv_fs_seek(lv_file_p, (uint32_t)(ndata + pos), LV_FS_SEEK_SET);
@@ -480,7 +485,8 @@ static lv_res_t decoder_open( lv_img_decoder_t * decoder, lv_img_decoder_dsc_t *
sjpeg->io.lv_file.file_d = NULL;
dsc->img_data = NULL;
return lv_ret;
} else {
}
else {
lv_ret = LV_RES_INV;
goto end;
}
@@ -687,7 +693,8 @@ static lv_res_t decoder_open( lv_img_decoder_t * decoder, lv_img_decoder_dsc_t *
dsc->img_data = NULL;
return LV_RES_OK;
} else {
}
else {
if(dsc->user_data) lv_mem_free(dsc->user_data);
lv_fs_close(&lv_file);
return LV_RES_INV;
@@ -710,7 +717,8 @@ static lv_res_t decoder_open( lv_img_decoder_t * decoder, lv_img_decoder_dsc_t *
* @return LV_RES_OK: ok; LV_RES_INV: failed
*/
static lv_res_t decoder_read_line( lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_coord_t len, uint8_t * buf )
static lv_res_t decoder_read_line(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_coord_t y,
lv_coord_t len, uint8_t * buf)
{
LV_UNUSED(decoder);
if(dsc->src_type == LV_IMG_SRC_VARIABLE) {
@@ -726,7 +734,8 @@ static lv_res_t decoder_read_line( lv_img_decoder_t * decoder, lv_img_decoder_ds
/*This is the last frame. */
const uint32_t frame_offset = (uint32_t)(sjpeg->io.raw_sjpg_data - sjpeg->sjpeg_data);
sjpeg->io.raw_sjpg_data_size = sjpeg->sjpeg_data_size - frame_offset;
} else {
}
else {
sjpeg->io.raw_sjpg_data_size =
(uint32_t)(sjpeg->frame_base_array[sjpeg_req_frame_index + 1] - sjpeg->io.raw_sjpg_data);
}
@@ -739,7 +748,8 @@ static lv_res_t decoder_read_line( lv_img_decoder_t * decoder, lv_img_decoder_ds
}
int offset = 0;
uint8_t *cache = (uint8_t *)sjpeg->frame_cache + x*3 + ( y % sjpeg->sjpeg_single_frame_height ) * sjpeg->sjpeg_x_res*3;
uint8_t * cache = (uint8_t *)sjpeg->frame_cache + x * 3 + (y % sjpeg->sjpeg_single_frame_height) * sjpeg->sjpeg_x_res *
3;
#if LV_COLOR_DEPTH == 32
for(int i = 0; i < len; i++) {
@@ -803,7 +813,8 @@ static lv_res_t decoder_read_line( lv_img_decoder_t * decoder, lv_img_decoder_ds
}
int offset = 0;
uint8_t *cache = (uint8_t *)sjpeg->frame_cache + x*3 + ( y % sjpeg->sjpeg_single_frame_height ) * sjpeg->sjpeg_x_res*3;
uint8_t * cache = (uint8_t *)sjpeg->frame_cache + x * 3 + (y % sjpeg->sjpeg_single_frame_height) * sjpeg->sjpeg_x_res *
3;
#if LV_COLOR_DEPTH == 32
for(int i = 0; i < len; i++) {

View File

@@ -388,7 +388,8 @@ static void highlight_update(lv_obj_t * obj)
for(i = 0; i < calendar->highlighted_dates_num; i++) {
if(calendar->highlighted_dates[i].year == calendar->showed_date.year &&
calendar->highlighted_dates[i].month == calendar->showed_date.month) {
lv_btnmatrix_set_btn_ctrl(calendar->btnm, calendar->highlighted_dates[i].day - 1 + day_first + 7, LV_CALENDAR_CTRL_HIGHLIGHT);
lv_btnmatrix_set_btn_ctrl(calendar->btnm, calendar->highlighted_dates[i].day - 1 + day_first + 7,
LV_CALENDAR_CTRL_HIGHLIGHT);
}
}
}

View File

@@ -97,7 +97,8 @@ void lv_imgbtn_set_state(lv_obj_t * obj, lv_imgbtn_state_t state)
lv_state_t obj_state = LV_STATE_DEFAULT;
if(state == LV_IMGBTN_STATE_PRESSED || state == LV_IMGBTN_STATE_CHECKED_PRESSED) obj_state |= LV_STATE_PRESSED;
if(state == LV_IMGBTN_STATE_DISABLED || state == LV_IMGBTN_STATE_CHECKED_DISABLED) obj_state |= LV_STATE_DISABLED;
if(state == LV_IMGBTN_STATE_CHECKED_DISABLED || state == LV_IMGBTN_STATE_CHECKED_PRESSED || state == LV_IMGBTN_STATE_CHECKED_RELEASED) {
if(state == LV_IMGBTN_STATE_CHECKED_DISABLED || state == LV_IMGBTN_STATE_CHECKED_PRESSED ||
state == LV_IMGBTN_STATE_CHECKED_RELEASED) {
obj_state |= LV_STATE_CHECKED;
}

View File

@@ -409,7 +409,8 @@ static void lv_keyboard_update_ctrl_map(lv_obj_t * obj)
if(keyboard->popovers) {
/*Apply the current control map (already includes LV_BTNMATRIX_CTRL_POPOVER flags)*/
lv_btnmatrix_set_ctrl_map(obj, kb_ctrl[keyboard->mode]);
} else {
}
else {
/*Make a copy of the current control map*/
lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;
lv_btnmatrix_ctrl_t * ctrl_map = lv_mem_alloc(btnm->btn_cnt * sizeof(lv_btnmatrix_ctrl_t));

View File

@@ -36,7 +36,8 @@ extern "C" {
struct _lv_font_t;
/** Describes the properties of a glyph.*/
typedef struct {
const struct _lv_font_t *resolved_font; /**< Pointer to a font where the gylph was actually found after handling fallbacks*/
const struct _lv_font_t *
resolved_font; /**< Pointer to a font where the gylph was actually found after handling fallbacks*/
uint16_t adv_w; /**< The glyph needs this space. Draw the next glyph after this width.*/
uint16_t box_w; /**< Width of the glyph's bounding box*/
uint16_t box_h; /**< Height of the glyph's bounding box*/

View File

@@ -157,7 +157,8 @@ lv_disp_t * lv_disp_drv_register(lv_disp_drv_t * driver)
if(lv_theme_default_is_inited() == false) {
disp->theme = lv_theme_default_init(disp, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED),
LV_THEME_DEFAULT_DARK, LV_FONT_DEFAULT);
} else {
}
else {
disp->theme = lv_theme_default_get();
}
#endif

View File

@@ -80,9 +80,12 @@ typedef struct _lv_disp_drv_t {
lv_coord_t hor_res; /**< Horizontal resolution.*/
lv_coord_t ver_res; /**< Vertical resolution.*/
lv_coord_t physical_hor_res; /**< Horizontal resolution of the full / physical display. Set to -1 for fullscreen mode.*/
lv_coord_t physical_ver_res; /**< Vertical resolution of the full / physical display. Set to -1 for fullscreen mode.*/
lv_coord_t offset_x; /**< Horizontal offset from the full / physical display. Set to 0 for fullscreen mode.*/
lv_coord_t
physical_hor_res; /**< Horizontal resolution of the full / physical display. Set to -1 for fullscreen mode.*/
lv_coord_t
physical_ver_res; /**< Vertical resolution of the full / physical display. Set to -1 for fullscreen mode.*/
lv_coord_t
offset_x; /**< Horizontal offset from the full / physical display. Set to 0 for fullscreen mode.*/
lv_coord_t offset_y; /**< Vertical offset from the full / physical display. Set to 0 for fullscreen mode.*/
/** Pointer to a buffer initialized with `lv_disp_draw_buf_init()`.

View File

@@ -384,7 +384,8 @@ static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e)
if(lv_obj_has_flag(obj, LV_OBJ_FLAG_ADV_HITTEST)) {
r -= indic_width;
} else {
}
else {
r -= LV_MAX(r / 4, indic_width);
}
if(r < 1) r = 1;

View File

@@ -403,7 +403,8 @@ static void lv_btnmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e)
if(has_popovers_in_top_row(obj)) {
/*reserve one row worth of extra space to account for popovers in the top row*/
*s = btnm->row_cnt > 0 ? lv_obj_get_content_height(obj) / btnm->row_cnt : 0;
} else {
}
else {
*s = 0;
}
}
@@ -828,7 +829,8 @@ static void allocate_btn_areas_and_controls(const lv_obj_t * obj, const char **
while(map[i] && map[i][0] != '\0') {
if(strcmp(map[i], "\n") != 0) { /*Do not count line breaks*/
btn_cnt++;
} else {
}
else {
btnm->row_cnt++;
}
i++;

View File

@@ -852,7 +852,8 @@ static void draw_main(lv_event_t * e)
if(label->long_mode == LV_LABEL_LONG_SCROLL || label->long_mode == LV_LABEL_LONG_SCROLL_CIRCULAR) {
lv_draw_label(&txt_coords, &txt_clip, &label_draw_dsc, label->text, hint);
} else {
}
else {
lv_draw_label(&txt_coords, clip_area, &label_draw_dsc, label->text, hint);
}