From c4f8e5f8becbf4982f039678537fe0c4c66095a5 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 10 Apr 2019 06:21:54 +0200 Subject: [PATCH] run clang format --- src/lv_core/lv_indev.c | 21 ++++++++++----------- src/lv_core/lv_obj.c | 3 +-- src/lv_core/lv_obj.h | 16 ++++++++-------- src/lv_hal/lv_hal_disp.h | 5 ++--- src/lv_objx/lv_cb.c | 3 +-- src/lv_objx/lv_kb.h | 1 - src/lv_objx/lv_tabview.c | 6 ++++-- src/lv_objx/lv_win.c | 6 ++++-- 8 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/lv_core/lv_indev.c b/src/lv_core/lv_indev.c index a52ce1613..fb08f99b9 100644 --- a/src/lv_core/lv_indev.c +++ b/src/lv_core/lv_indev.c @@ -408,14 +408,13 @@ static void indev_keypad_proc(lv_indev_t * i, lv_indev_data_t * data) focused->signal_cb(focused, LV_SIGNAL_PRESSED, NULL); if(i->proc.reset_query) return; /*The object might be deleted*/ lv_event_send(focused, LV_EVENT_PRESSED, NULL); - if(i->proc.reset_query) return; /*The object might be deleted*/ - } - else if(data->key == LV_KEY_ESC) { + if(i->proc.reset_query) return; /*The object might be deleted*/ + } else if(data->key == LV_KEY_ESC) { /*Send the ESC as a normal KEY*/ lv_group_send_data(g, LV_KEY_ESC); lv_event_send(focused, LV_EVENT_CANCEL, NULL); - if(i->proc.reset_query) return; /*The object might be deleted*/ + if(i->proc.reset_query) return; /*The object might be deleted*/ } /*Move the focus on NEXT*/ else if(data->key == LV_KEY_NEXT) { @@ -1069,11 +1068,12 @@ static void indev_drag(lv_indev_proc_t * state) lv_coord_t prev_par_h = lv_obj_get_height(lv_obj_get_parent(drag_obj)); /*Get the coordinates of the object and modify them*/ - lv_coord_t act_x = lv_obj_get_x(drag_obj); - lv_coord_t act_y = lv_obj_get_y(drag_obj); + lv_coord_t act_x = lv_obj_get_x(drag_obj); + lv_coord_t act_y = lv_obj_get_y(drag_obj); if(allowed_dirs == LV_DRAG_DIR_ALL) - lv_obj_set_pos(drag_obj, act_x + state->types.pointer.vect.x, act_y + state->types.pointer.vect.y); + lv_obj_set_pos(drag_obj, act_x + state->types.pointer.vect.x, + act_y + state->types.pointer.vect.y); else if(allowed_dirs & LV_DRAG_DIR_HOR) lv_obj_set_x(drag_obj, act_x + state->types.pointer.vect.x); else if(allowed_dirs & LV_DRAG_DIR_VER) @@ -1101,7 +1101,6 @@ static void indev_drag(lv_indev_proc_t * state) new_inv_buf_size - inv_buf_size); } } - } } } @@ -1149,11 +1148,11 @@ static void indev_drag_throw(lv_indev_proc_t * proc) lv_coord_t act_y = lv_obj_get_y(drag_obj) + proc->types.pointer.drag_throw_vect.y; if(allowed_dirs == LV_DRAG_DIR_ALL) - lv_obj_set_pos(drag_obj, act_x, act_y); + lv_obj_set_pos(drag_obj, act_x, act_y); else if(allowed_dirs & LV_DRAG_DIR_HOR) - lv_obj_set_x(drag_obj, act_x); + lv_obj_set_x(drag_obj, act_x); else if(allowed_dirs & LV_DRAG_DIR_VER) - lv_obj_set_y(drag_obj, act_y); + lv_obj_set_y(drag_obj, act_y); lv_area_t coord_new; lv_obj_get_coords(drag_obj, &coord_new); diff --git a/src/lv_core/lv_obj.c b/src/lv_core/lv_obj.c index 06353ac72..917ce95fd 100644 --- a/src/lv_core/lv_obj.c +++ b/src/lv_core/lv_obj.c @@ -1107,8 +1107,7 @@ void lv_obj_set_drag_dir(lv_obj_t * obj, lv_drag_dir_t drag_dir) { obj->drag_dir = drag_dir; - if(obj->drag_dir != 0) - lv_obj_set_drag(obj, true); /*Drag direction requires drag*/ + if(obj->drag_dir != 0) lv_obj_set_drag(obj, true); /*Drag direction requires drag*/ } /** diff --git a/src/lv_core/lv_obj.h b/src/lv_core/lv_obj.h index 10925e5c3..d50393038 100644 --- a/src/lv_core/lv_obj.h +++ b/src/lv_core/lv_obj.h @@ -170,9 +170,9 @@ typedef struct #endif enum { - LV_DRAG_DIR_HOR = 0x1, - LV_DRAG_DIR_VER = 0x2, - LV_DRAG_DIR_ALL = 0x3, /* Should be the bitwise OR of the above */ + LV_DRAG_DIR_HOR = 0x1, + LV_DRAG_DIR_VER = 0x2, + LV_DRAG_DIR_ALL = 0x3, /* Should be the bitwise OR of the above */ }; typedef uint8_t lv_drag_dir_t; @@ -195,12 +195,12 @@ typedef struct _lv_obj_t void * group_p; /*Pointer to the group of the object*/ #endif /*Attributes and states*/ - uint8_t click : 1; /*1: Can be pressed by an input device*/ - uint8_t drag : 1; /*1: Enable the dragging*/ + uint8_t click : 1; /*1: Can be pressed by an input device*/ + uint8_t drag : 1; /*1: Enable the dragging*/ lv_drag_dir_t drag_dir : 2; /* Which directions the object can be dragged in */ - uint8_t drag_throw : 1; /*1: Enable throwing with drag*/ - uint8_t drag_parent : 1; /*1: Parent will be dragged instead*/ - uint8_t hidden : 1; /*1: Object is hidden*/ + uint8_t drag_throw : 1; /*1: Enable throwing with drag*/ + uint8_t drag_parent : 1; /*1: Parent will be dragged instead*/ + uint8_t hidden : 1; /*1: Object is hidden*/ uint8_t top : 1; /*1: If the object or its children is clicked it goes to the foreground*/ uint8_t opa_scale_en : 1; /*1: opa_scale is set*/ uint8_t parent_event : 1; /*1: Send the object's events to the parent too. */ diff --git a/src/lv_hal/lv_hal_disp.h b/src/lv_hal/lv_hal_disp.h index 5ffde953c..46263aefb 100644 --- a/src/lv_hal/lv_hal_disp.h +++ b/src/lv_hal/lv_hal_disp.h @@ -90,13 +90,13 @@ typedef struct _disp_drv_t * number of flushed pixels */ void (*monitor_cb)(struct _disp_drv_t * disp_drv, uint32_t time, uint32_t px); - #if LV_USE_GPU /*OPTIONAL: Blend two memories using opacity (GPU only)*/ void (*mem_blend_cb)(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa); /*OPTIONAL: Fill a memory with a color (GPU only)*/ - void (*mem_fill_cb)(lv_color_t * dest_buf, const lv_area_t * dest_area, const lv_area_t * fill_area, lv_color_t color); + void (*mem_fill_cb)(lv_color_t * dest_buf, const lv_area_t * dest_area, + const lv_area_t * fill_area, lv_color_t color); #endif #if LV_USE_USER_DATA_SINGLE @@ -110,7 +110,6 @@ typedef struct _disp_drv_t lv_disp_drv_user_data_t monitor_user_data; #endif - } lv_disp_drv_t; struct _lv_obj_t; diff --git a/src/lv_objx/lv_cb.c b/src/lv_objx/lv_cb.c index dba03b4a8..6b8c16fc1 100644 --- a/src/lv_objx/lv_cb.c +++ b/src/lv_objx/lv_cb.c @@ -322,8 +322,7 @@ static lv_res_t lv_cb_signal(lv_obj_t * cb, lv_signal_t sign, void * param) lv_btn_set_state(ext->bullet, lv_btn_get_state(cb)); } else if(sign == LV_SIGNAL_CONTROL) { char c = *((char *)param); - if(c == LV_KEY_RIGHT || c == LV_KEY_DOWN || c == LV_KEY_LEFT || - c == LV_KEY_UP) { + if(c == LV_KEY_RIGHT || c == LV_KEY_DOWN || c == LV_KEY_LEFT || c == LV_KEY_UP) { lv_btn_set_state(ext->bullet, lv_btn_get_state(cb)); } } else if(sign == LV_SIGNAL_GET_TYPE) { diff --git a/src/lv_objx/lv_kb.h b/src/lv_objx/lv_kb.h index ac811da11..af1b7649f 100644 --- a/src/lv_objx/lv_kb.h +++ b/src/lv_objx/lv_kb.h @@ -169,7 +169,6 @@ bool lv_kb_get_cursor_manage(const lv_obj_t * kb); */ static inline const char ** lv_btnm_get_map_array(const lv_obj_t * btnm); - /** * Get a style of a keyboard * @param kb pointer to a keyboard object diff --git a/src/lv_objx/lv_tabview.c b/src/lv_objx/lv_tabview.c index aafcae551..6b35807e3 100644 --- a/src/lv_objx/lv_tabview.c +++ b/src/lv_objx/lv_tabview.c @@ -108,8 +108,10 @@ lv_obj_t * lv_tabview_create(lv_obj_t * par, const lv_obj_t * copy) ext->tab_cnt = 0; /* Set a size which fits into the parent. - * Don't use `par` directly because if the tabview is created on a page it is moved to the scrollable so the parent has changed */ - lv_obj_set_size(new_tabview, lv_obj_get_width_fit(lv_obj_get_parent(new_tabview)), lv_obj_get_height_fit(lv_obj_get_parent(new_tabview))); + * Don't use `par` directly because if the tabview is created on a page it is moved to the + * scrollable so the parent has changed */ + lv_obj_set_size(new_tabview, lv_obj_get_width_fit(lv_obj_get_parent(new_tabview)), + lv_obj_get_height_fit(lv_obj_get_parent(new_tabview))); ext->btns = lv_btnm_create(new_tabview, NULL); lv_obj_set_height(ext->btns, 3 * LV_DPI / 4); diff --git a/src/lv_objx/lv_win.c b/src/lv_objx/lv_win.c index a26bc3d82..64a324435 100644 --- a/src/lv_objx/lv_win.c +++ b/src/lv_objx/lv_win.c @@ -72,8 +72,10 @@ lv_obj_t * lv_win_create(lv_obj_t * par, const lv_obj_t * copy) /*Init the new window object*/ if(copy == NULL) { /* Set a size which fits into the parent. - * Don't use `par` directly because if the window is created on a page it is moved to the scrollable so the parent has changed */ - lv_obj_set_size(new_win, lv_obj_get_width_fit(lv_obj_get_parent(new_win)), lv_obj_get_height_fit(lv_obj_get_parent(new_win))); + * Don't use `par` directly because if the window is created on a page it is moved to the + * scrollable so the parent has changed */ + lv_obj_set_size(new_win, lv_obj_get_width_fit(lv_obj_get_parent(new_win)), + lv_obj_get_height_fit(lv_obj_get_parent(new_win))); lv_obj_set_pos(new_win, 0, 0); lv_obj_set_style(new_win, &lv_style_pretty);