diff --git a/lvgl.h b/lvgl.h index 61becb4577..9413dc5d75 100644 --- a/lvgl.h +++ b/lvgl.h @@ -27,7 +27,6 @@ extern "C" { #include "src/lv_core/lv_refr.h" #include "src/lv_core/lv_disp.h" -#include "src/lv_core/lv_debug.h" #include "src/lv_themes/lv_theme.h" diff --git a/src/lv_core/lv_debug.c b/src/lv_core/lv_debug.c index 5eb7e72019..571b2f367e 100644 --- a/src/lv_core/lv_debug.c +++ b/src/lv_core/lv_debug.c @@ -75,7 +75,7 @@ bool lv_debug_check_obj_valid(const lv_obj_t * obj) lv_disp_t * disp = lv_disp_get_next(NULL); while(disp) { lv_obj_t * scr; - LV_LL_READ(disp->scr_ll, scr) { + _LV_LL_READ(disp->scr_ll, scr) { if(scr == obj) return true; bool found = obj_valid_child(scr, obj); @@ -160,7 +160,7 @@ void lv_debug_log_error(const char * msg, uint64_t value) char * bufp = buf; /*Add the function name*/ - lv_memcpy(bufp, msg, msg_len); + _lv_memcpy(bufp, msg, msg_len); bufp += msg_len; /*Add value in hey*/ @@ -200,7 +200,7 @@ static bool obj_valid_child(const lv_obj_t * parent, const lv_obj_t * obj_to_fin { /*Check all children of `parent`*/ lv_obj_t * child; - LV_LL_READ(parent->child_ll, child) { + _LV_LL_READ(parent->child_ll, child) { if(child == obj_to_find) return true; /*Check the children*/ diff --git a/src/lv_core/lv_disp.c b/src/lv_core/lv_disp.c index 125707113d..37206b35a4 100644 --- a/src/lv_core/lv_disp.c +++ b/src/lv_core/lv_disp.c @@ -112,24 +112,7 @@ void lv_disp_assign_screen(lv_disp_t * disp, lv_obj_t * scr) if(old_disp == disp) return; - lv_ll_chg_list(&old_disp->scr_ll, &disp->scr_ll, scr, true); -} - -/** - * Get a pointer to the screen refresher task to - * modify its parameters with `lv_task_...` functions. - * @param disp pointer to a display - * @return pointer to the display refresher task. (NULL on error) - */ -lv_task_t * lv_disp_get_refr_task(lv_disp_t * disp) -{ - if(!disp) disp = lv_disp_get_default(); - if(!disp) { - LV_LOG_WARN("lv_disp_get_refr_task: no display registered"); - return NULL; - } - - return disp->refr_task; + _lv_ll_chg_list(&old_disp->scr_ll, &disp->scr_ll, scr, true); } /** @@ -174,6 +157,24 @@ void lv_disp_trig_activity(lv_disp_t * disp) disp->last_activity_time = lv_tick_get(); } + +/** + * Get a pointer to the screen refresher task to + * modify its parameters with `lv_task_...` functions. + * @param disp pointer to a display + * @return pointer to the display refresher task. (NULL on error) + */ +lv_task_t * _lv_disp_get_refr_task(lv_disp_t * disp) +{ + if(!disp) disp = lv_disp_get_default(); + if(!disp) { + LV_LOG_WARN("lv_disp_get_refr_task: no display registered"); + return NULL; + } + + return disp->refr_task; +} + /********************** * STATIC FUNCTIONS **********************/ diff --git a/src/lv_core/lv_disp.h b/src/lv_core/lv_disp.h index 91c34d4bcd..906f802961 100644 --- a/src/lv_core/lv_disp.h +++ b/src/lv_core/lv_disp.h @@ -64,14 +64,6 @@ lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp); */ void lv_disp_assign_screen(lv_disp_t * disp, lv_obj_t * scr); -/** - * Get a pointer to the screen refresher task to - * modify its parameters with `lv_task_...` functions. - * @param disp pointer to a display - * @return pointer to the display refresher task. (NULL on error) - */ -lv_task_t * lv_disp_get_refr_task(lv_disp_t * disp); - /** * Get elapsed time since last user activity on a display (e.g. click) * @param disp pointer to an display (NULL to get the overall smallest inactivity) @@ -85,6 +77,14 @@ uint32_t lv_disp_get_inactive_time(const lv_disp_t * disp); */ void lv_disp_trig_activity(lv_disp_t * disp); +/** + * Get a pointer to the screen refresher task to + * modify its parameters with `lv_task_...` functions. + * @param disp pointer to a display + * @return pointer to the display refresher task. (NULL on error) + */ +lv_task_t * _lv_disp_get_refr_task(lv_disp_t * disp); + /*------------------------------------------------ * To improve backward compatibility * Recommended only if you have one display diff --git a/src/lv_core/lv_group.c b/src/lv_core/lv_group.c index 8f1a01f466..0d43d3aa03 100644 --- a/src/lv_core/lv_group.c +++ b/src/lv_core/lv_group.c @@ -48,9 +48,9 @@ static void obj_to_foreground(lv_obj_t * obj); /** * Init. the group module */ -void lv_group_init(void) +void _lv_group_init(void) { - lv_ll_init(&LV_GC_ROOT(_lv_group_ll), sizeof(lv_group_t)); + _lv_ll_init(&LV_GC_ROOT(_lv_group_ll), sizeof(lv_group_t)); } /** @@ -59,10 +59,10 @@ void lv_group_init(void) */ lv_group_t * lv_group_create(void) { - lv_group_t * group = lv_ll_ins_head(&LV_GC_ROOT(_lv_group_ll)); + lv_group_t * group = _lv_ll_ins_head(&LV_GC_ROOT(_lv_group_ll)); LV_ASSERT_MEM(group); if(group == NULL) return NULL; - lv_ll_init(&group->obj_ll, sizeof(lv_obj_t *)); + _lv_ll_init(&group->obj_ll, sizeof(lv_obj_t *)); group->obj_focus = NULL; group->frozen = 0; @@ -73,7 +73,7 @@ lv_group_t * lv_group_create(void) group->wrap = 1; #if LV_USE_USER_DATA - lv_memset_00(&group->user_data, sizeof(lv_group_user_data_t)); + _lv_memset_00(&group->user_data, sizeof(lv_group_user_data_t)); #endif return group; @@ -93,12 +93,12 @@ void lv_group_del(lv_group_t * group) /*Remove the objects from the group*/ lv_obj_t ** obj; - LV_LL_READ(group->obj_ll, obj) { + _LV_LL_READ(group->obj_ll, obj) { (*obj)->group_p = NULL; } - lv_ll_clear(&(group->obj_ll)); - lv_ll_remove(&LV_GC_ROOT(_lv_group_ll), group); + _lv_ll_clear(&(group->obj_ll)); + _lv_ll_remove(&LV_GC_ROOT(_lv_group_ll), group); lv_mem_free(group); } @@ -112,7 +112,7 @@ void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj) if(group == NULL) return; /*Do not add the object twice*/ lv_obj_t ** obj_i; - LV_LL_READ(group->obj_ll, obj_i) { + _LV_LL_READ(group->obj_ll, obj_i) { if((*obj_i) == obj) { LV_LOG_INFO("lv_group_add_obj: the object is already added to this group"); return; @@ -129,14 +129,14 @@ void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj) } obj->group_p = group; - lv_obj_t ** next = lv_ll_ins_tail(&group->obj_ll); + lv_obj_t ** next = _lv_ll_ins_tail(&group->obj_ll); LV_ASSERT_MEM(next); if(next == NULL) return; *next = obj; /* If the head and the tail is equal then there is only one object in the linked list. * In this case automatically activate it*/ - if(lv_ll_get_head(&group->obj_ll) == next) { + if(_lv_ll_get_head(&group->obj_ll) == next) { lv_group_refocus(group); } } @@ -156,7 +156,7 @@ void lv_group_remove_obj(lv_obj_t * obj) if(g->frozen) g->frozen = 0; /*If this is the only object in the group then focus to nothing.*/ - if(lv_ll_get_head(&g->obj_ll) == g->obj_focus && lv_ll_get_tail(&g->obj_ll) == g->obj_focus) { + if(_lv_ll_get_head(&g->obj_ll) == g->obj_focus && _lv_ll_get_tail(&g->obj_ll) == g->obj_focus) { (*g->obj_focus)->signal_cb(*g->obj_focus, LV_SIGNAL_DEFOCUS, NULL); } /*If there more objects in the group then focus to the next/prev object*/ @@ -174,9 +174,9 @@ void lv_group_remove_obj(lv_obj_t * obj) /*Search the object and remove it from its group */ lv_obj_t ** i; - LV_LL_READ(g->obj_ll, i) { + _LV_LL_READ(g->obj_ll, i) { if(*i == obj) { - lv_ll_remove(&g->obj_ll, i); + _lv_ll_remove(&g->obj_ll, i); lv_mem_free(i); obj->group_p = NULL; break; @@ -199,11 +199,11 @@ void lv_group_remove_all_objs(lv_group_t * group) /*Remove the objects from the group*/ lv_obj_t ** obj; - LV_LL_READ(group->obj_ll, obj) { + _LV_LL_READ(group->obj_ll, obj) { (*obj)->group_p = NULL; } - lv_ll_clear(&(group->obj_ll)); + _lv_ll_clear(&(group->obj_ll)); } /** @@ -224,7 +224,7 @@ void lv_group_focus_obj(lv_obj_t * obj) lv_group_set_editing(g, false); lv_obj_t ** i; - LV_LL_READ(g->obj_ll, i) { + _LV_LL_READ(g->obj_ll, i) { if(*i == obj) { if(g->obj_focus != NULL) { (*g->obj_focus)->signal_cb(*g->obj_focus, LV_SIGNAL_DEFOCUS, NULL); @@ -256,7 +256,7 @@ void lv_group_focus_obj(lv_obj_t * obj) */ void lv_group_focus_next(lv_group_t * group) { - focus_next_core(group, lv_ll_get_head, lv_ll_get_next); + focus_next_core(group, _lv_ll_get_head, _lv_ll_get_next); } /** @@ -265,7 +265,7 @@ void lv_group_focus_next(lv_group_t * group) */ void lv_group_focus_prev(lv_group_t * group) { - focus_next_core(group, lv_ll_get_tail, lv_ll_get_prev); + focus_next_core(group, _lv_ll_get_tail, _lv_ll_get_prev); } /** diff --git a/src/lv_core/lv_group.h b/src/lv_core/lv_group.h index 3b1ed4f4a5..ef165ee388 100644 --- a/src/lv_core/lv_group.h +++ b/src/lv_core/lv_group.h @@ -81,7 +81,7 @@ typedef uint8_t lv_group_refocus_policy_t; * Init. the group module * @remarks Internal function, do not call directly. */ -void lv_group_init(void); +void _lv_group_init(void); /** * Create a new object group diff --git a/src/lv_core/lv_indev.c b/src/lv_core/lv_indev.c index 035100aaff..4ac2657e6f 100644 --- a/src/lv_core/lv_indev.c +++ b/src/lv_core/lv_indev.c @@ -63,7 +63,7 @@ static lv_obj_t * indev_obj_act = NULL; /** * Initialize the display input device subsystem */ -void lv_indev_init(void) +void _lv_indev_init(void) { lv_indev_reset(NULL, NULL); /*Reset all input devices*/ } @@ -72,7 +72,7 @@ void lv_indev_init(void) * Called periodically to read the input devices * @param param pointer to and input device to read */ -void lv_indev_read_task(lv_task_t * task) +void _lv_indev_read_task(lv_task_t * task) { LV_LOG_TRACE("indev read task started"); @@ -90,7 +90,7 @@ void lv_indev_read_task(lv_task_t * task) bool more_to_read; do { /*Read the data*/ - more_to_read = lv_indev_read(indev_act, &data); + more_to_read = _lv_indev_read(indev_act, &data); /*The active object might deleted even in the read function*/ indev_proc_reset_query_handler(indev_act); @@ -364,6 +364,15 @@ void lv_indev_wait_release(lv_indev_t * indev) indev->proc.wait_until_release = 1; } +/** + * Gets a pointer to the currently active object in the currently processed input device. + * @return pointer to currently active object or NULL if no active object + */ +lv_obj_t * lv_indev_get_obj_act(void) +{ + return indev_obj_act; +} + /** * Get a pointer to the indev read task to * modify its parameters with `lv_task_...` functions. @@ -380,15 +389,6 @@ lv_task_t * lv_indev_get_read_task(lv_disp_t * indev) return indev->refr_task; } -/** - * Gets a pointer to the currently active object in the currently processed input device. - * @return pointer to currently active object or NULL if no active object - */ -lv_obj_t * lv_indev_get_obj_act(void) -{ - return indev_obj_act; -} - /********************** * STATIC FUNCTIONS **********************/ @@ -658,7 +658,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) /*On enter long press toggle edit mode.*/ if(editable) { /*Don't leave edit mode if there is only one object (nowhere to navigate)*/ - if(lv_ll_is_empty(&g->obj_ll) == false) { + if(_lv_ll_is_empty(&g->obj_ll) == false) { lv_group_set_editing(g, lv_group_get_editing(g) ? false : true); /*Toggle edit mode on long press*/ } } @@ -695,7 +695,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) /*An object is being edited and the button is released. */ else if(g->editing) { /*Ignore long pressed enter release because it comes from mode switch*/ - if(!i->proc.long_pr_sent || lv_ll_is_empty(&g->obj_ll)) { + if(!i->proc.long_pr_sent || _lv_ll_is_empty(&g->obj_ll)) { indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_RELEASED, NULL); if(indev_reset_check(&i->proc)) return; @@ -1060,7 +1060,7 @@ lv_obj_t * lv_indev_search_obj(lv_obj_t * obj, lv_point_t * point) if(lv_obj_hittest(obj, point)) { lv_obj_t * i; - LV_LL_READ(obj->child_ll, i) { + _LV_LL_READ(obj->child_ll, i) { found_p = lv_indev_search_obj(i, point); /*If a child was found then break*/ @@ -1305,7 +1305,7 @@ static void indev_drag(lv_indev_proc_t * proc) lv_coord_t act_par_h = lv_obj_get_height(lv_obj_get_parent(drag_obj)); if(act_par_w == prev_par_w && act_par_h == prev_par_h) { uint16_t new_inv_buf_size = lv_disp_get_inv_buf_size(indev_act->driver.disp); - lv_disp_pop_from_inv_buf(indev_act->driver.disp, new_inv_buf_size - inv_buf_size); + _lv_disp_pop_from_inv_buf(indev_act->driver.disp, new_inv_buf_size - inv_buf_size); } } diff --git a/src/lv_core/lv_indev.h b/src/lv_core/lv_indev.h index aaa4c24e70..1e5fe5de54 100644 --- a/src/lv_core/lv_indev.h +++ b/src/lv_core/lv_indev.h @@ -32,13 +32,13 @@ extern "C" { /** * Initialize the display input device subsystem */ -void lv_indev_init(void); +void _lv_indev_init(void); /** * Called periodically to read the input devices * @param task pointer to the task itself */ -void lv_indev_read_task(lv_task_t * task); +void _lv_indev_read_task(lv_task_t * task); /** * Get the currently processed input device. Can be used in action functions too. @@ -149,13 +149,6 @@ lv_res_t lv_indev_finish_drag(lv_indev_t * indev); */ void lv_indev_wait_release(lv_indev_t * indev); -/** - * Get a pointer to the indev read task to - * modify its parameters with `lv_task_...` functions. - * @param indev pointer to an inout device - * @return pointer to the indev read refresher task. (NULL on error) - */ -lv_task_t * lv_indev_get_read_task(lv_disp_t * indev); /** * Gets a pointer to the currently active object in indev proc functions. @@ -172,6 +165,14 @@ lv_obj_t * lv_indev_get_obj_act(void); */ lv_obj_t * lv_indev_search_obj(lv_obj_t * obj, lv_point_t * point); +/** + * Get a pointer to the indev read task to + * modify its parameters with `lv_task_...` functions. + * @param indev pointer to an inout device + * @return pointer to the indev read refresher task. (NULL on error) + */ +lv_task_t * lv_indev_get_read_task(lv_disp_t * indev); + /********************** * MACROS **********************/ diff --git a/src/lv_core/lv_obj.c b/src/lv_core/lv_obj.c index 2f546b6581..4b7d9175c8 100644 --- a/src/lv_core/lv_obj.c +++ b/src/lv_core/lv_obj.c @@ -124,22 +124,22 @@ void lv_init(void) LV_LOG_TRACE("lv_init started"); /*Initialize the lv_misc modules*/ - lv_mem_init(); - lv_task_core_init(); + _lv_mem_init(); + _lv_task_core_init(); #if LV_USE_FILESYSTEM - lv_fs_init(); + _lv_fs_init(); #endif #if LV_USE_ANIMATION - lv_anim_core_init(); + _lv_anim_core_init(); #endif #if LV_USE_GROUP - lv_group_init(); + _lv_group_init(); #endif - lv_ll_init(&LV_GC_ROOT(_lv_obj_style_trans_ll), sizeof(lv_style_trans_t)); + _lv_ll_init(&LV_GC_ROOT(_lv_obj_style_trans_ll), sizeof(lv_style_trans_t)); lv_theme_t * th = LV_THEME_DEFAULT_INIT(LV_THEME_DEFAULT_COLOR_PRIMARY, LV_THEME_DEFAULT_COLOR_SECONDARY, LV_THEME_DEFAULT_FLAG, @@ -147,15 +147,15 @@ void lv_init(void) lv_theme_set_act(th); /*Initialize the screen refresh system*/ - lv_refr_init(); + _lv_refr_init(); - lv_ll_init(&LV_GC_ROOT(_lv_disp_ll), sizeof(lv_disp_t)); - lv_ll_init(&LV_GC_ROOT(_lv_indev_ll), sizeof(lv_indev_t)); + _lv_ll_init(&LV_GC_ROOT(_lv_disp_ll), sizeof(lv_disp_t)); + _lv_ll_init(&LV_GC_ROOT(_lv_indev_ll), sizeof(lv_indev_t)); /*Init the input device handling*/ - lv_indev_init(); + _lv_indev_init(); - lv_img_decoder_init(); + _lv_img_decoder_init(); lv_img_cache_set_size(LV_IMG_CACHE_DEF_SIZE); lv_initialized = true; @@ -170,12 +170,12 @@ void lv_init(void) */ void lv_deinit(void) { - lv_gc_clear_roots(); + _lv_gc_clear_roots(); #if LV_USE_LOG lv_log_register_print_cb(NULL); #endif lv_disp_set_default(NULL); - lv_mem_deinit(); + _lv_mem_deinit(); lv_initialized = false; #if LV_USE_LOG lv_log_register_print_cb(NULL); @@ -208,11 +208,11 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy) return NULL; } - new_obj = lv_ll_ins_head(&disp->scr_ll); + new_obj = _lv_ll_ins_head(&disp->scr_ll); LV_ASSERT_MEM(new_obj); if(new_obj == NULL) return NULL; - lv_memset_00(new_obj, sizeof(lv_obj_t)); + _lv_memset_00(new_obj, sizeof(lv_obj_t)); #if LV_USE_BIDI new_obj->base_dir = LV_BIDI_BASE_DIR_DEF; @@ -236,11 +236,11 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy) LV_LOG_TRACE("Object create started"); LV_ASSERT_OBJ(parent, LV_OBJX_NAME); - new_obj = lv_ll_ins_head(&parent->child_ll); + new_obj = _lv_ll_ins_head(&parent->child_ll); LV_ASSERT_MEM(new_obj); if(new_obj == NULL) return NULL; - lv_memset_00(new_obj, sizeof(lv_obj_t)); + _lv_memset_00(new_obj, sizeof(lv_obj_t)); new_obj->parent = parent; @@ -268,13 +268,13 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy) } - lv_ll_init(&(new_obj->child_ll), sizeof(lv_obj_t)); + _lv_ll_init(&(new_obj->child_ll), sizeof(lv_obj_t)); new_obj->ext_draw_pad = 0; #if LV_USE_EXT_CLICK_AREA == LV_EXT_CLICK_AREA_FULL - lv_memset_00(&new_obj->ext_click_pad, sizeof(new_obj->ext_click_pad)); + _lv_memset_00(&new_obj->ext_click_pad, sizeof(new_obj->ext_click_pad)); #elif LV_USE_EXT_CLICK_AREA == LV_EXT_CLICK_AREA_TINY new_obj->ext_click_pad_hor = 0; new_obj->ext_click_pad_ver = 0; @@ -291,7 +291,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy) /*Init. user date*/ #if LV_USE_USER_DATA - lv_memset_00(&new_obj->user_data, sizeof(lv_obj_user_data_t)); + _lv_memset_00(&new_obj->user_data, sizeof(lv_obj_user_data_t)); #endif @@ -337,7 +337,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy) /*Set user data*/ #if LV_USE_USER_DATA - lv_memcpy(&new_obj->user_data, ©->user_data, sizeof(lv_obj_user_data_t)); + _lv_memcpy(&new_obj->user_data, ©->user_data, sizeof(lv_obj_user_data_t)); #endif /*Copy realign*/ @@ -499,20 +499,20 @@ void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area) bool is_common; lv_area_t area_trunc; - is_common = lv_area_intersect(&area_trunc, area, &obj_coords); + is_common = _lv_area_intersect(&area_trunc, area, &obj_coords); if(is_common == false) return; /*The area is not on the object*/ /*Truncate recursively to the parents*/ lv_obj_t * par = lv_obj_get_parent(obj); while(par != NULL) { - is_common = lv_area_intersect(&area_trunc, &area_trunc, &par->coords); + is_common = _lv_area_intersect(&area_trunc, &area_trunc, &par->coords); if(is_common == false) break; /*If no common parts with parent break;*/ if(lv_obj_get_hidden(par)) return; /*If the parent is hidden then the child is hidden and won't be drawn*/ par = lv_obj_get_parent(par); } - if(is_common) lv_inv_area(disp, &area_trunc); + if(is_common) _lv_inv_area(disp, &area_trunc); } } @@ -579,7 +579,7 @@ void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent) old_pos.x = old_par->coords.x2 - obj->coords.x2; } - lv_ll_chg_list(&obj->parent->child_ll, &parent->child_ll, obj, true); + _lv_ll_chg_list(&obj->parent->child_ll, &parent->child_ll, obj, true); obj->parent = parent; @@ -612,11 +612,11 @@ void lv_obj_move_foreground(lv_obj_t * obj) lv_obj_t * parent = lv_obj_get_parent(obj); /*Do nothing of already in the foreground*/ - if(lv_ll_get_head(&parent->child_ll) == obj) return; + if(_lv_ll_get_head(&parent->child_ll) == obj) return; lv_obj_invalidate(parent); - lv_ll_chg_list(&parent->child_ll, &parent->child_ll, obj, true); + _lv_ll_chg_list(&parent->child_ll, &parent->child_ll, obj, true); /*Notify the new parent about the child*/ parent->signal_cb(parent, LV_SIGNAL_CHILD_CHG, obj); @@ -635,11 +635,11 @@ void lv_obj_move_background(lv_obj_t * obj) lv_obj_t * parent = lv_obj_get_parent(obj); /*Do nothing of already in the background*/ - if(lv_ll_get_tail(&parent->child_ll) == obj) return; + if(_lv_ll_get_tail(&parent->child_ll) == obj) return; lv_obj_invalidate(parent); - lv_ll_chg_list(&parent->child_ll, &parent->child_ll, obj, false); + _lv_ll_chg_list(&parent->child_ll, &parent->child_ll, obj, false); /*Notify the new parent about the child*/ parent->signal_cb(parent, LV_SIGNAL_CHILD_CHG, obj); @@ -772,7 +772,7 @@ void lv_obj_set_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h) /*Tell the children the parent's size has changed*/ lv_obj_t * i; - LV_LL_READ(obj->child_ll, i) { + _LV_LL_READ(obj->child_ll, i) { i->signal_cb(i, LV_SIGNAL_PARENT_SIZE_CHG, &ori); } @@ -881,7 +881,7 @@ void lv_obj_align(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_co LV_ASSERT_OBJ(base, LV_OBJX_NAME); lv_point_t new_pos; - lv_area_align(&base->coords, &obj->coords, align, &new_pos); + _lv_area_align(&base->coords, &obj->coords, align, &new_pos); /*Bring together the coordination system of base and obj*/ lv_obj_t * par = lv_obj_get_parent(obj); @@ -1148,7 +1148,7 @@ void lv_obj_add_style(lv_obj_t * obj, uint8_t part, lv_style_t * style) return; } - lv_style_list_add_style(style_dsc, style); + _lv_style_list_add_style(style_dsc, style); #if LV_USE_ANIMATION trans_del(obj, part, 0xFF, NULL); #endif @@ -1171,7 +1171,7 @@ void lv_obj_clean_style_list(lv_obj_t * obj, uint8_t part) return; } - lv_style_list_reset(style_dsc); + _lv_style_list_reset(style_dsc); #if LV_USE_ANIMATION trans_del(obj, part, 0xFF, NULL); #endif @@ -1207,7 +1207,7 @@ void lv_obj_reset_style_list(lv_obj_t * obj, uint8_t part) void _lv_obj_set_style_local_int(lv_obj_t * obj, uint8_t part, lv_style_property_t prop, lv_style_int_t value) { lv_style_list_t * style_dsc = lv_obj_get_style_list(obj, part); - lv_style_list_set_local_int(style_dsc, prop, value); + _lv_style_list_set_local_int(style_dsc, prop, value); #if LV_USE_ANIMATION trans_del(obj, part, prop, NULL); #endif @@ -1229,7 +1229,7 @@ void _lv_obj_set_style_local_int(lv_obj_t * obj, uint8_t part, lv_style_property void _lv_obj_set_style_local_color(lv_obj_t * obj, uint8_t part, lv_style_property_t prop, lv_color_t color) { lv_style_list_t * style_dsc = lv_obj_get_style_list(obj, part); - lv_style_list_set_local_color(style_dsc, prop, color); + _lv_style_list_set_local_color(style_dsc, prop, color); #if LV_USE_ANIMATION trans_del(obj, part, prop, NULL); #endif @@ -1251,7 +1251,7 @@ void _lv_obj_set_style_local_color(lv_obj_t * obj, uint8_t part, lv_style_proper void _lv_obj_set_style_local_opa(lv_obj_t * obj, uint8_t part, lv_style_property_t prop, lv_opa_t opa) { lv_style_list_t * style_dsc = lv_obj_get_style_list(obj, part); - lv_style_list_set_local_opa(style_dsc, prop, opa); + _lv_style_list_set_local_opa(style_dsc, prop, opa); #if LV_USE_ANIMATION trans_del(obj, part, prop, NULL); #endif @@ -1273,7 +1273,7 @@ void _lv_obj_set_style_local_opa(lv_obj_t * obj, uint8_t part, lv_style_property void _lv_obj_set_style_local_ptr(lv_obj_t * obj, uint8_t part, lv_style_property_t prop, const void * value) { lv_style_list_t * style_dsc = lv_obj_get_style_list(obj, part); - lv_style_list_set_local_ptr(style_dsc, prop, value); + _lv_style_list_set_local_ptr(style_dsc, prop, value); #if LV_USE_ANIMATION trans_del(obj, part, prop, NULL); #endif @@ -1291,7 +1291,7 @@ void _lv_obj_set_style_local_ptr(lv_obj_t * obj, uint8_t part, lv_style_property * For example: `lv_obj_style_remove_border_opa()` * @return true: the property was found and removed; false: teh property was not found */ -bool _lv_obj_remove_style_local_prop(lv_obj_t * obj, uint8_t part, lv_style_property_t prop) +bool lv_obj_remove_style_local_prop(lv_obj_t * obj, uint8_t part, lv_style_property_t prop) { LV_ASSERT_OBJ(obj, LV_OBJX_NAME); lv_style_t * style = lv_obj_get_local_style(obj, part); @@ -1388,7 +1388,7 @@ void lv_obj_report_style_mod(lv_style_t * style) while(d) { lv_obj_t * i; - LV_LL_READ(d->scr_ll, i) { + _LV_LL_READ(d->scr_ll, i) { report_style_mod_core(style, i); } d = lv_disp_get_next(d); @@ -1617,7 +1617,7 @@ void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state) uint8_t i; for(i = 0; i < LV_STYLE_TRANS_NUM_MAX; i++) { if(props[i] != 0) { - lv_style_list_add_trans_style(style_list); + _lv_style_list_add_trans_style(style_list); lv_style_trans_t * tr = trans_create(obj, props[i], part, prev_state, new_state); @@ -1694,7 +1694,7 @@ void lv_obj_finish_transitions(lv_obj_t * obj, uint8_t part) { /*Animate all related transition to the end value*/ lv_style_trans_t * tr; - LV_LL_READ_BACK(LV_GC_ROOT(_lv_obj_style_trans_ll), tr) { + _LV_LL_READ_BACK(LV_GC_ROOT(_lv_obj_style_trans_ll), tr) { if(tr->obj == obj && (part == tr->part || part == LV_OBJ_PART_ALL)) { trans_anim_cb(tr, 255); } @@ -1926,9 +1926,9 @@ lv_disp_t * lv_obj_get_disp(const lv_obj_t * obj) scr = lv_obj_get_screen(obj); /*get the screen of `obj`*/ lv_disp_t * d; - LV_LL_READ(LV_GC_ROOT(_lv_disp_ll), d) { + _LV_LL_READ(LV_GC_ROOT(_lv_disp_ll), d) { lv_obj_t * s; - LV_LL_READ(d->scr_ll, s) { + _LV_LL_READ(d->scr_ll, s) { if(s == scr) return d; } } @@ -1967,10 +1967,10 @@ lv_obj_t * lv_obj_get_child(const lv_obj_t * obj, const lv_obj_t * child) lv_obj_t * result = NULL; if(child == NULL) { - result = lv_ll_get_head(&obj->child_ll); + result = _lv_ll_get_head(&obj->child_ll); } else { - result = lv_ll_get_next(&obj->child_ll, child); + result = _lv_ll_get_next(&obj->child_ll, child); } return result; @@ -1990,10 +1990,10 @@ lv_obj_t * lv_obj_get_child_back(const lv_obj_t * obj, const lv_obj_t * child) lv_obj_t * result = NULL; if(child == NULL) { - result = lv_ll_get_tail(&obj->child_ll); + result = _lv_ll_get_tail(&obj->child_ll); } else { - result = lv_ll_get_prev(&obj->child_ll, child); + result = _lv_ll_get_prev(&obj->child_ll, child); } return result; @@ -2011,7 +2011,7 @@ uint16_t lv_obj_count_children(const lv_obj_t * obj) lv_obj_t * i; uint16_t cnt = 0; - LV_LL_READ(obj->child_ll, i) cnt++; + _LV_LL_READ(obj->child_ll, i) cnt++; return cnt; } @@ -2027,7 +2027,7 @@ uint16_t lv_obj_count_children_recursive(const lv_obj_t * obj) lv_obj_t * i; uint16_t cnt = 0; - LV_LL_READ(obj->child_ll, i) { + _LV_LL_READ(obj->child_ll, i) { cnt++; /*Count the child*/ cnt += lv_obj_count_children_recursive(i); /*recursively count children's children*/ } @@ -2391,7 +2391,7 @@ lv_style_int_t _lv_obj_get_style_int(const lv_obj_t * obj, uint8_t part, lv_styl lv_state_t state = lv_obj_get_state(parent, part); prop = (uint16_t)prop_ori + ((uint16_t)state << LV_STYLE_STATE_POS); - res = lv_style_list_get_int(dsc, prop, &value_act); + res = _lv_style_list_get_int(dsc, prop, &value_act); if(res == LV_RES_OK) return value_act; if(attr.bits.inherit == 0) break; @@ -2454,7 +2454,7 @@ lv_color_t _lv_obj_get_style_color(const lv_obj_t * obj, uint8_t part, lv_style_ lv_state_t state = lv_obj_get_state(parent, part); prop = (uint16_t)prop_ori + ((uint16_t)state << LV_STYLE_STATE_POS); - res = lv_style_list_get_color(dsc, prop, &value_act); + res = _lv_style_list_get_color(dsc, prop, &value_act); if(res == LV_RES_OK) return value_act; if(attr.bits.inherit == 0) break; @@ -2510,7 +2510,7 @@ lv_opa_t _lv_obj_get_style_opa(const lv_obj_t * obj, uint8_t part, lv_style_prop lv_state_t state = lv_obj_get_state(parent, part); prop = (uint16_t)prop_ori + ((uint16_t)state << LV_STYLE_STATE_POS); - res = lv_style_list_get_opa(dsc, prop, &value_act); + res = _lv_style_list_get_opa(dsc, prop, &value_act); if(res == LV_RES_OK) return value_act; if(attr.bits.inherit == 0) break; @@ -2567,7 +2567,7 @@ const void * _lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, lv_style_ lv_state_t state = lv_obj_get_state(parent, part); prop = (uint16_t)prop_ori + ((uint16_t)state << LV_STYLE_STATE_POS); - res = lv_style_list_get_ptr(dsc, prop, &value_act); + res = _lv_style_list_get_ptr(dsc, prop, &value_act); if(res == LV_RES_OK) return value_act; if(attr.bits.inherit == 0) break; @@ -2861,8 +2861,8 @@ void lv_obj_get_type(const lv_obj_t * obj, lv_obj_type_t * buf) lv_obj_type_t tmp; - lv_memset_00(buf, sizeof(lv_obj_type_t)); - lv_memset_00(&tmp, sizeof(lv_obj_type_t)); + _lv_memset_00(buf, sizeof(lv_obj_type_t)); + _lv_memset_00(&tmp, sizeof(lv_obj_type_t)); obj->signal_cb((lv_obj_t *)obj, LV_SIGNAL_GET_TYPE, &tmp); @@ -2913,7 +2913,7 @@ void lv_obj_set_user_data(lv_obj_t * obj, lv_obj_user_data_t data) { LV_ASSERT_OBJ(obj, LV_OBJX_NAME); - lv_memcpy(&obj->user_data, &data, sizeof(lv_obj_user_data_t)); + _lv_memcpy(&obj->user_data, &data, sizeof(lv_obj_user_data_t)); } #endif @@ -2974,7 +2974,7 @@ bool lv_obj_is_point_on_coords(lv_obj_t * obj, const lv_point_t * point) ext_area.y1 = obj->coords.y1 - obj->ext_click_pad_ver; ext_area.y2 = obj->coords.y2 + obj->ext_click_pad_ver; - if(!lv_area_is_point_on(&ext_area, point, 0)) { + if(!_lv_area_is_point_on(&ext_area, point, 0)) { #elif LV_USE_EXT_CLICK_AREA == LV_EXT_CLICK_AREA_FULL lv_area_t ext_area; ext_area.x1 = obj->coords.x1 - obj->ext_click_pad.x1; @@ -2982,9 +2982,9 @@ bool lv_obj_is_point_on_coords(lv_obj_t * obj, const lv_point_t * point) ext_area.y1 = obj->coords.y1 - obj->ext_click_pad.y1; ext_area.y2 = obj->coords.y2 + obj->ext_click_pad.y2; - if(!lv_area_is_point_on(&ext_area, point, 0)) { + if(!_lv_area_is_point_on(&ext_area, point, 0)) { #else - if(!lv_area_is_point_on(&obj->coords, point, 0)) { + if(!_lv_area_is_point_on(&obj->coords, point, 0)) { #endif return false; } @@ -3287,7 +3287,7 @@ lv_coord_t lv_obj_get_draw_rect_ext_pad_size(lv_obj_t * obj, uint8_t part) const lv_font_t * font = lv_obj_get_style_value_font(obj, part); lv_point_t txt_size; - lv_txt_get_size(&txt_size, value_str, font, letter_space, line_space, LV_COORD_MAX, LV_TXT_FLAG_NONE); + _lv_txt_get_size(&txt_size, value_str, font, letter_space, line_space, LV_COORD_MAX, LV_TXT_FLAG_NONE); lv_area_t value_area; value_area.x1 = 0; @@ -3299,7 +3299,7 @@ lv_coord_t lv_obj_get_draw_rect_ext_pad_size(lv_obj_t * obj, uint8_t part) lv_style_int_t xofs = lv_obj_get_style_value_ofs_x(obj, part); lv_style_int_t yofs = lv_obj_get_style_value_ofs_y(obj, part); lv_point_t p_align; - lv_area_align(&obj->coords, &value_area, align, &p_align); + _lv_area_align(&obj->coords, &value_area, align, &p_align); value_area.x1 += p_align.x + xofs; value_area.y1 += p_align.y + yofs; @@ -3417,10 +3417,10 @@ static void obj_del_core(lv_obj_t * obj) /*Recursively delete the children*/ lv_obj_t * i; lv_obj_t * i_next; - i = lv_ll_get_head(&(obj->child_ll)); + i = _lv_ll_get_head(&(obj->child_ll)); while(i != NULL) { /*Get the next object before delete this*/ - i_next = lv_ll_get_next(&(obj->child_ll), i); + i_next = _lv_ll_get_next(&(obj->child_ll), i); /*Call the recursive del to the child too*/ obj_del_core(i); @@ -3457,10 +3457,10 @@ static void obj_del_core(lv_obj_t * obj) lv_obj_t * par = lv_obj_get_parent(obj); if(par == NULL) { /*It is a screen*/ lv_disp_t * d = lv_obj_get_disp(obj); - lv_ll_remove(&d->scr_ll, obj); + _lv_ll_remove(&d->scr_ll, obj); } else { - lv_ll_remove(&(par->child_ll), obj); + _lv_ll_remove(&(par->child_ll), obj); } /*Delete the base objects*/ @@ -3493,7 +3493,7 @@ static lv_design_res_t lv_obj_design(lv_obj_t * obj, const lv_area_t * clip_area coords.y1 -= h; coords.y2 += h; - if(lv_area_is_in(clip_area, &coords, r) == false) return LV_DESIGN_RES_NOT_COVER; + if(_lv_area_is_in(clip_area, &coords, r) == false) return LV_DESIGN_RES_NOT_COVER; if(lv_obj_get_style_bg_opa(obj, LV_OBJ_PART_MAIN) < LV_OPA_MAX) return LV_DESIGN_RES_NOT_COVER; @@ -3526,7 +3526,7 @@ static lv_design_res_t lv_obj_design(lv_obj_t * obj, const lv_area_t * clip_area lv_draw_rect(&coords, clip_area, &draw_dsc); if(lv_obj_get_style_clip_corner(obj, LV_OBJ_PART_MAIN)) { - lv_draw_mask_radius_param_t * mp = lv_mem_buf_get(sizeof(lv_draw_mask_radius_param_t)); + lv_draw_mask_radius_param_t * mp = _lv_mem_buf_get(sizeof(lv_draw_mask_radius_param_t)); lv_coord_t r = lv_obj_get_style_radius(obj, LV_OBJ_PART_MAIN); @@ -3538,7 +3538,7 @@ static lv_design_res_t lv_obj_design(lv_obj_t * obj, const lv_area_t * clip_area else if(mode == LV_DESIGN_DRAW_POST) { if(lv_obj_get_style_clip_corner(obj, LV_OBJ_PART_MAIN)) { lv_draw_mask_radius_param_t * param = lv_draw_mask_remove_custom(obj + 8); - lv_mem_buf_release(param); + _lv_mem_buf_release(param); } /*If the border is drawn later disable loading other properties*/ @@ -3640,7 +3640,7 @@ static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param) static void refresh_children_position(lv_obj_t * obj, lv_coord_t x_diff, lv_coord_t y_diff) { lv_obj_t * i; - LV_LL_READ(obj->child_ll, i) { + _LV_LL_READ(obj->child_ll, i) { i->coords.x1 += x_diff; i->coords.y1 += y_diff; i->coords.x2 += x_diff; @@ -3730,7 +3730,7 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop, { lv_style_trans_t * tr; lv_style_list_t * style_list = lv_obj_get_style_list(obj, part); - lv_style_t * style_trans = lv_style_list_get_transition_style(style_list); + lv_style_t * style_trans = _lv_style_list_get_transition_style(style_list); /*Get the previous and current values*/ if((prop & 0xF) < LV_STYLE_ID_COLOR) { /*Int*/ @@ -3756,7 +3756,7 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop, } } - tr = lv_ll_ins_head(&LV_GC_ROOT(_lv_obj_style_trans_ll)); + tr = _lv_ll_ins_head(&LV_GC_ROOT(_lv_obj_style_trans_ll)); LV_ASSERT_MEM(tr); if(tr == NULL) return NULL; tr->start_value._int = int1; @@ -3776,7 +3776,7 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop, obj->state = new_state; _lv_style_set_color(style_trans, prop, c1); /*Be sure `trans_style` has a valid value */ - tr = lv_ll_ins_head(&LV_GC_ROOT(_lv_obj_style_trans_ll)); + tr = _lv_ll_ins_head(&LV_GC_ROOT(_lv_obj_style_trans_ll)); LV_ASSERT_MEM(tr); if(tr == NULL) return NULL; tr->start_value._color = c1; @@ -3797,7 +3797,7 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop, obj->state = new_state; _lv_style_set_opa(style_trans, prop, o1); /*Be sure `trans_style` has a valid value */ - tr = lv_ll_ins_head(&LV_GC_ROOT(_lv_obj_style_trans_ll)); + tr = _lv_ll_ins_head(&LV_GC_ROOT(_lv_obj_style_trans_ll)); LV_ASSERT_MEM(tr); if(tr == NULL) return NULL; tr->start_value._opa = o1; @@ -3817,7 +3817,7 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop, obj->state = new_state; _lv_style_set_ptr(style_trans, prop, p1); /*Be sure `trans_style` has a valid value */ - tr = lv_ll_ins_head(&LV_GC_ROOT(_lv_obj_style_trans_ll)); + tr = _lv_ll_ins_head(&LV_GC_ROOT(_lv_obj_style_trans_ll)); LV_ASSERT_MEM(tr); if(tr == NULL) return NULL; tr->start_value._ptr = p1; @@ -3840,22 +3840,22 @@ static void trans_del(lv_obj_t * obj, uint8_t part, lv_style_property_t prop, lv { lv_style_trans_t * tr; lv_style_trans_t * tr_prev; - tr = lv_ll_get_tail(&LV_GC_ROOT(_lv_obj_style_trans_ll)); + tr = _lv_ll_get_tail(&LV_GC_ROOT(_lv_obj_style_trans_ll)); while(tr != NULL) { if(tr == tr_limit) break; /*'tr' might be deleted, so get the next object while 'tr' is valid*/ - tr_prev = lv_ll_get_prev(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr); + tr_prev = _lv_ll_get_prev(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr); if(tr->obj == obj && (part == tr->part || part == 0xFF) && (prop == tr->prop || prop == 0xFF)) { /* Remove the transitioned property from trans. style * to allow changing it by normal styles*/ lv_style_list_t * list = lv_obj_get_style_list(tr->obj, tr->part); - lv_style_t * style_trans = lv_style_list_get_transition_style(list); + lv_style_t * style_trans = _lv_style_list_get_transition_style(list); lv_style_remove_prop(style_trans, tr->prop); lv_anim_del(tr, NULL); - lv_ll_remove(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr); + _lv_ll_remove(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr); lv_mem_free(tr); } tr = tr_prev; @@ -3865,7 +3865,7 @@ static void trans_del(lv_obj_t * obj, uint8_t part, lv_style_property_t prop, lv static void trans_anim_cb(lv_style_trans_t * tr, lv_anim_value_t v) { lv_style_list_t * list = lv_obj_get_style_list(tr->obj, tr->part); - lv_style_t * style = lv_style_list_get_transition_style(list); + lv_style_t * style = _lv_style_list_get_transition_style(list); if((tr->prop & 0xF) < LV_STYLE_ID_COLOR) { /*Value*/ lv_style_int_t x; @@ -3937,7 +3937,7 @@ static void trans_anim_ready_cb(lv_anim_t * a) bool running = false; lv_style_trans_t * tr_i; - LV_LL_READ(LV_GC_ROOT(_lv_obj_style_trans_ll), tr_i) { + _LV_LL_READ(LV_GC_ROOT(_lv_obj_style_trans_ll), tr_i) { if(tr_i != tr && tr_i->obj == tr->obj && tr_i->part == tr->part && tr_i->prop == tr->prop) { running = true; } @@ -3945,11 +3945,11 @@ static void trans_anim_ready_cb(lv_anim_t * a) if(!running) { lv_style_list_t * list = lv_obj_get_style_list(tr->obj, tr->part); - lv_style_t * style_trans = lv_style_list_get_transition_style(list); + lv_style_t * style_trans = _lv_style_list_get_transition_style(list); lv_style_remove_prop(style_trans, tr->prop); } - lv_ll_remove(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr); + _lv_ll_remove(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr); lv_mem_free(tr); } diff --git a/src/lv_core/lv_obj.h b/src/lv_core/lv_obj.h index c2b862025b..a9e1dc9b52 100644 --- a/src/lv_core/lv_obj.h +++ b/src/lv_core/lv_obj.h @@ -611,7 +611,7 @@ void _lv_obj_set_style_local_ptr(lv_obj_t * obj, uint8_t type, lv_style_property * For example: `lv_obj_style_remove_border_opa()` * @return true: the property was found and removed; false: teh property was not found */ -bool _lv_obj_remove_style_local_prop(lv_obj_t * obj, uint8_t part, lv_style_property_t prop); +bool lv_obj_remove_style_local_prop(lv_obj_t * obj, uint8_t part, lv_style_property_t prop); /*----------------- * Attribute set diff --git a/src/lv_core/lv_obj_style_dec.h b/src/lv_core/lv_obj_style_dec.h index b4121b0d3c..de1b57bee2 100644 --- a/src/lv_core/lv_obj_style_dec.h +++ b/src/lv_core/lv_obj_style_dec.h @@ -95,20 +95,8 @@ extern "C" { } #define _LV_OBJ_STYLE_SET_GET_DECLARE(prop_name, func_name, value_type, style_type, scalar) \ - _OBJ_GET_STYLE_##scalar(prop_name, func_name, value_type, style_type) \ + _OBJ_GET_STYLE_##scalar(prop_name, func_name, value_type, style_type) \ _OBJ_SET_STYLE_LOCAL_##scalar(prop_name, func_name, value_type, style_type) \ - static inline void lv_obj_get_style_local_##func_name (lv_obj_t * obj, uint8_t part, lv_state_t state, void * res) \ - { \ - _lv_style_get##style_type (lv_obj_get_local_style(obj, part), LV_STYLE_##prop_name | (state << LV_STYLE_STATE_POS), res); \ - } \ - static inline void lv_obj_remove_style_local_##func_name (lv_obj_t * obj, uint8_t part, lv_state_t state) \ - { \ - _lv_obj_remove_style_local_prop(obj, part, LV_STYLE_##prop_name | (state << LV_STYLE_STATE_POS)); \ - } \ - static inline int16_t lv_style_get_##func_name (lv_style_t * style, lv_state_t state, void * res) \ - { \ - return _lv_style_get##style_type (style, LV_STYLE_##prop_name | (state << LV_STYLE_STATE_POS), res); \ - } \ _OBJ_SET_STYLE_##scalar(prop_name, func_name, value_type, style_type) _LV_OBJ_STYLE_SET_GET_DECLARE(RADIUS, radius, lv_style_int_t, _int, scalar) diff --git a/src/lv_core/lv_refr.c b/src/lv_core/lv_refr.c index 1474fe4a95..8eeba40ee5 100644 --- a/src/lv_core/lv_refr.c +++ b/src/lv_core/lv_refr.c @@ -65,7 +65,7 @@ static lv_disp_t * disp_refr; /*Display being refreshed*/ /** * Initialize the screen refresh subsystem */ -void lv_refr_init(void) +void _lv_refr_init(void) { /*Nothing to do*/ } @@ -84,13 +84,13 @@ void lv_refr_now(lv_disp_t * disp) #endif if(disp) { - lv_disp_refr_task(disp->refr_task); + _lv_disp_refr_task(disp->refr_task); } else { lv_disp_t * d; d = lv_disp_get_next(NULL); while(d) { - lv_disp_refr_task(d->refr_task); + _lv_disp_refr_task(d->refr_task); d = lv_disp_get_next(d); } } @@ -102,7 +102,7 @@ void lv_refr_now(lv_disp_t * disp) * @param disp pointer to display where the area should be invalidated (NULL can be used if there is * only one display) */ -void lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p) +void _lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p) { if(!disp) disp = lv_disp_get_default(); if(!disp) return; @@ -122,7 +122,7 @@ void lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p) lv_area_t com_area; bool suc; - suc = lv_area_intersect(&com_area, area_p, &scr_area); + suc = _lv_area_intersect(&com_area, area_p, &scr_area); /*The area is truncated to the screen*/ if(suc != false) { @@ -131,7 +131,7 @@ void lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p) /*Save only if this area is not in one of the saved areas*/ uint16_t i; for(i = 0; i < disp->inv_p; i++) { - if(lv_area_is_in(&com_area, &disp->inv_areas[i], 0) != false) return; + if(_lv_area_is_in(&com_area, &disp->inv_areas[i], 0) != false) return; } /*Save the area*/ @@ -151,7 +151,7 @@ void lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p) * Get the display which is being refreshed * @return the display being refreshed */ -lv_disp_t * lv_refr_get_disp_refreshing(void) +lv_disp_t * _lv_refr_get_disp_refreshing(void) { return disp_refr; } @@ -162,7 +162,7 @@ lv_disp_t * lv_refr_get_disp_refreshing(void) * It can be used to trick the drawing functions about there is an active display. * @param the display being refreshed */ -void lv_refr_set_disp_refreshing(lv_disp_t * disp) +void _lv_refr_set_disp_refreshing(lv_disp_t * disp) { disp_refr = disp; } @@ -171,7 +171,7 @@ void lv_refr_set_disp_refreshing(lv_disp_t * disp) * Called periodically to handle the refreshing * @param task pointer to the task itself */ -void lv_disp_refr_task(lv_task_t * task) +void _lv_disp_refr_task(lv_task_t * task) { LV_LOG_TRACE("lv_refr_task: started"); @@ -226,7 +226,7 @@ void lv_disp_refr_task(lv_task_t * task) uint32_t line_length = lv_area_get_width(&disp_refr->inv_areas[a]) * sizeof(lv_color_t); for(y = disp_refr->inv_areas[a].y1; y <= disp_refr->inv_areas[a].y2; y++) { - lv_memcpy(buf_act + start_offs, buf_ina + start_offs, line_length); + _lv_memcpy(buf_act + start_offs, buf_ina + start_offs, line_length); start_offs += hres * sizeof(lv_color_t); } } @@ -234,8 +234,8 @@ void lv_disp_refr_task(lv_task_t * task) } /*End of true double buffer handling*/ /*Clean up*/ - lv_memset_00(disp_refr->inv_areas, sizeof(disp_refr->inv_areas)); - lv_memset_00(disp_refr->inv_area_joined, sizeof(disp_refr->inv_area_joined)); + _lv_memset_00(disp_refr->inv_areas, sizeof(disp_refr->inv_areas)); + _lv_memset_00(disp_refr->inv_area_joined, sizeof(disp_refr->inv_area_joined)); disp_refr->inv_p = 0; elaps = lv_tick_elaps(start); @@ -245,8 +245,8 @@ void lv_disp_refr_task(lv_task_t * task) } } - lv_mem_buf_free_all(); - lv_font_clean_up_fmt_txt(); + _lv_mem_buf_free_all(); + _lv_font_clean_up_fmt_txt(); #if LV_USE_PERF_MONITOR && LV_USE_LABEL static lv_obj_t * perf_label = NULL; @@ -308,11 +308,11 @@ static void lv_refr_join_area(void) } /*Check if the areas are on each other*/ - if(lv_area_is_on(&disp_refr->inv_areas[join_in], &disp_refr->inv_areas[join_from]) == false) { + if(_lv_area_is_on(&disp_refr->inv_areas[join_in], &disp_refr->inv_areas[join_from]) == false) { continue; } - lv_area_join(&joined_area, &disp_refr->inv_areas[join_in], &disp_refr->inv_areas[join_from]); + _lv_area_join(&joined_area, &disp_refr->inv_areas[join_in], &disp_refr->inv_areas[join_from]); /*Join two area only if the joined area size is smaller*/ if(lv_area_get_size(&joined_area) < (lv_area_get_size(&disp_refr->inv_areas[join_in]) + @@ -470,7 +470,7 @@ static void lv_refr_area_part(const lv_area_t * area_p) /*Get the new mask from the original area and the act. VDB It will be a part of 'area_p'*/ lv_area_t start_mask; - lv_area_intersect(&start_mask, area_p, &vdb->area); + _lv_area_intersect(&start_mask, area_p, &vdb->area); /*Get the most top object which is not covered by others*/ top_p = lv_refr_get_top_obj(&start_mask, lv_disp_get_scr_act(disp_refr)); @@ -500,13 +500,13 @@ static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj) lv_obj_t * found_p = NULL; /*If this object is fully cover the draw area check the children too */ - if(lv_area_is_in(area_p, &obj->coords, 0) && obj->hidden == 0) { + if(_lv_area_is_in(area_p, &obj->coords, 0) && obj->hidden == 0) { lv_design_res_t design_res = obj->design_cb ? obj->design_cb(obj, area_p, LV_DESIGN_COVER_CHK) : LV_DESIGN_RES_NOT_COVER; if(design_res == LV_DESIGN_RES_MASKED) return NULL; lv_obj_t * i; - LV_LL_READ(obj->child_ll, i) { + _LV_LL_READ(obj->child_ll, i) { found_p = lv_refr_get_top_obj(area_p, i); /*If a children is ok then break*/ @@ -551,12 +551,12 @@ static void lv_refr_obj_and_children(lv_obj_t * top_p, const lv_area_t * mask_p) /*Do until not reach the screen*/ while(par != NULL) { /*object before border_p has to be redrawn*/ - lv_obj_t * i = lv_ll_get_prev(&(par->child_ll), border_p); + lv_obj_t * i = _lv_ll_get_prev(&(par->child_ll), border_p); while(i != NULL) { /*Refresh the objects*/ lv_refr_obj(i, mask_p); - i = lv_ll_get_prev(&(par->child_ll), i); + i = _lv_ll_get_prev(&(par->child_ll), i); } /*Call the post draw design function of the parents of the to object*/ @@ -592,7 +592,7 @@ static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_p) obj_area.y1 -= ext_size; obj_area.x2 += ext_size; obj_area.y2 += ext_size; - union_ok = lv_area_intersect(&obj_ext_mask, mask_ori_p, &obj_area); + union_ok = _lv_area_intersect(&obj_ext_mask, mask_ori_p, &obj_area); /*Draw the parent and its children only if they ore on 'mask_parent'*/ if(union_ok != false) { @@ -619,12 +619,12 @@ static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_p) #endif /*Create a new 'obj_mask' without 'ext_size' because the children can't be visible there*/ lv_obj_get_coords(obj, &obj_area); - union_ok = lv_area_intersect(&obj_mask, mask_ori_p, &obj_area); + union_ok = _lv_area_intersect(&obj_mask, mask_ori_p, &obj_area); if(union_ok != false) { lv_area_t mask_child; /*Mask from obj and its child*/ lv_obj_t * child_p; lv_area_t child_area; - LV_LL_READ_BACK(obj->child_ll, child_p) { + _LV_LL_READ_BACK(obj->child_ll, child_p) { lv_obj_get_coords(child_p, &child_area); ext_size = child_p->ext_draw_pad; child_area.x1 -= ext_size; @@ -633,7 +633,7 @@ static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_p) child_area.y2 += ext_size; /* Get the union (common parts) of original mask (from obj) * and its child */ - union_ok = lv_area_intersect(&mask_child, &obj_mask, &child_area); + union_ok = _lv_area_intersect(&mask_child, &obj_mask, &child_area); /*If the parent and the child has common area then refresh the child */ if(union_ok) { @@ -669,7 +669,7 @@ static void lv_refr_vdb_flush(void) else vdb->flushing_last = 0; /*Flush the rendered content to the display*/ - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); if(disp->driver.flush_cb) disp->driver.flush_cb(&disp->driver, &vdb->area, vdb->buf_act); if(vdb->buf1 && vdb->buf2) { diff --git a/src/lv_core/lv_refr.h b/src/lv_core/lv_refr.h index 35f2791c89..1b6062fff7 100644 --- a/src/lv_core/lv_refr.h +++ b/src/lv_core/lv_refr.h @@ -45,7 +45,7 @@ extern "C" { /** * Initialize the screen refresh subsystem */ -void lv_refr_init(void); +void _lv_refr_init(void); /** * Redraw the invalidated areas now. @@ -62,13 +62,13 @@ void lv_refr_now(lv_disp_t * disp); * @param disp pointer to display where the area should be invalidated (NULL can be used if there is * only one display) */ -void lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p); +void _lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p); /** * Get the display which is being refreshed * @return the display being refreshed */ -lv_disp_t * lv_refr_get_disp_refreshing(void); +lv_disp_t * _lv_refr_get_disp_refreshing(void); /** * Set the display which is being refreshed. @@ -76,13 +76,13 @@ lv_disp_t * lv_refr_get_disp_refreshing(void); * It can be used to trick the drawing functions about there is an active display. * @param the display being refreshed */ -void lv_refr_set_disp_refreshing(lv_disp_t * disp); +void _lv_refr_set_disp_refreshing(lv_disp_t * disp); /** * Called periodically to handle the refreshing * @param task pointer to the task itself */ -void lv_disp_refr_task(lv_task_t * task); +void _lv_disp_refr_task(lv_task_t * task); /********************** * STATIC FUNCTIONS diff --git a/src/lv_core/lv_style.c b/src/lv_core/lv_style.c index 57202df69b..1b6b0595e3 100644 --- a/src/lv_core/lv_style.c +++ b/src/lv_core/lv_style.c @@ -60,7 +60,7 @@ static lv_style_t * get_alloc_local_style(lv_style_list_t * list); */ void lv_style_init(lv_style_t * style) { - lv_memset_00(style, sizeof(lv_style_t)); + _lv_memset_00(style, sizeof(lv_style_t)); #if LV_USE_ASSERT_STYLE style->sentinel = LV_DEBUG_STYLE_SENTINEL_VALUE; #endif @@ -80,9 +80,9 @@ void lv_style_copy(lv_style_t * style_dest, const lv_style_t * style_src) if(style_src->map == NULL) return; - uint16_t size = lv_style_get_mem_size(style_src); + uint16_t size = _lv_style_get_mem_size(style_src); style_dest->map = lv_mem_alloc(size); - lv_memcpy(style_dest->map, style_src->map, size); + _lv_memcpy(style_dest->map, style_src->map, size); } /** @@ -107,7 +107,7 @@ bool lv_style_remove_prop(lv_style_t * style, lv_style_property_t prop) attr_goal.full = (prop >> 8) & 0xFFU; if(attr_found.bits.state == attr_goal.bits.state) { - uint32_t map_size = lv_style_get_mem_size(style); + uint32_t map_size = _lv_style_get_mem_size(style); uint8_t prop_size = sizeof(lv_style_property_t); if((prop & 0xF) < LV_STYLE_ID_COLOR) prop_size += sizeof(lv_style_int_t); else if((prop & 0xF) < LV_STYLE_ID_OPA) prop_size += sizeof(lv_color_t); @@ -135,7 +135,7 @@ bool lv_style_remove_prop(lv_style_t * style, lv_style_property_t prop) */ void lv_style_list_init(lv_style_list_t * list) { - lv_memset_00(list, sizeof(lv_style_list_t)); + _lv_memset_00(list, sizeof(lv_style_list_t)); #if LV_USE_ASSERT_STYLE list->sentinel = LV_DEBUG_STYLE_LIST_SENTINEL_VALUE; #endif @@ -151,7 +151,7 @@ void lv_style_list_copy(lv_style_list_t * list_dest, const lv_style_list_t * lis LV_ASSERT_STYLE_LIST(list_dest); LV_ASSERT_STYLE_LIST(list_src); - lv_style_list_reset(list_dest); + _lv_style_list_reset(list_dest); if(list_src->style_list == NULL) return; @@ -159,24 +159,24 @@ void lv_style_list_copy(lv_style_list_t * list_dest, const lv_style_list_t * lis if(list_src->has_local == 0) { if(list_src->has_trans) { list_dest->style_list = lv_mem_alloc((list_src->style_cnt - 1) * sizeof(lv_style_t *)); - lv_memcpy(list_dest->style_list, list_src->style_list + 1, (list_src->style_cnt - 1) * sizeof(lv_style_t *)); + _lv_memcpy(list_dest->style_list, list_src->style_list + 1, (list_src->style_cnt - 1) * sizeof(lv_style_t *)); list_dest->style_cnt = list_src->style_cnt - 1; } else { list_dest->style_list = lv_mem_alloc(list_src->style_cnt * sizeof(lv_style_t *)); - lv_memcpy(list_dest->style_list, list_src->style_list, list_src->style_cnt * sizeof(lv_style_t *)); + _lv_memcpy(list_dest->style_list, list_src->style_list, list_src->style_cnt * sizeof(lv_style_t *)); list_dest->style_cnt = list_src->style_cnt; } } else { if(list_src->has_trans) { list_dest->style_list = lv_mem_alloc((list_src->style_cnt - 2) * sizeof(lv_style_t *)); - lv_memcpy(list_dest->style_list, list_src->style_list + 2, (list_src->style_cnt - 2) * sizeof(lv_style_t *)); + _lv_memcpy(list_dest->style_list, list_src->style_list + 2, (list_src->style_cnt - 2) * sizeof(lv_style_t *)); list_dest->style_cnt = list_src->style_cnt - 2; } else { list_dest->style_list = lv_mem_alloc((list_src->style_cnt - 1) * sizeof(lv_style_t *)); - lv_memcpy(list_dest->style_list, list_src->style_list + 1, (list_src->style_cnt - 1) * sizeof(lv_style_t *)); + _lv_memcpy(list_dest->style_list, list_src->style_list + 1, (list_src->style_cnt - 1) * sizeof(lv_style_t *)); list_dest->style_cnt = list_src->style_cnt - 1; } @@ -192,7 +192,7 @@ void lv_style_list_copy(lv_style_list_t * list_dest, const lv_style_list_t * lis * @param list pointer to a style list * @param style pointer to a style to add */ -void lv_style_list_add_style(lv_style_list_t * list, lv_style_t * style) +void _lv_style_list_add_style(lv_style_list_t * list, lv_style_t * style) { LV_ASSERT_STYLE_LIST(list); LV_ASSERT_STYLE(style); @@ -200,7 +200,7 @@ void lv_style_list_add_style(lv_style_list_t * list, lv_style_t * style) if(list == NULL) return; /*Remove the style first if already exists*/ - lv_style_list_remove_style(list, style); + _lv_style_list_remove_style(list, style); lv_style_t ** new_classes; if(list->style_cnt == 0) new_classes = lv_mem_alloc(sizeof(lv_style_t *)); @@ -230,7 +230,7 @@ void lv_style_list_add_style(lv_style_list_t * list, lv_style_t * style) * @param style_list pointer to a style list * @param style pointer to a style to remove */ -void lv_style_list_remove_style(lv_style_list_t * list, lv_style_t * style) +void _lv_style_list_remove_style(lv_style_list_t * list, lv_style_t * style) { LV_ASSERT_STYLE_LIST(list); LV_ASSERT_STYLE(style); @@ -279,7 +279,7 @@ void lv_style_list_remove_style(lv_style_list_t * list, lv_style_t * style) * Leave `ignore_trans` flag as it is. * @param list pointer to a style list. */ -void lv_style_list_reset(lv_style_list_t * list) +void _lv_style_list_reset(lv_style_list_t * list) { LV_ASSERT_STYLE_LIST(list); @@ -294,7 +294,7 @@ void lv_style_list_reset(lv_style_list_t * list) } if(list->has_trans) { - lv_style_t * trans = lv_style_list_get_transition_style(list); + lv_style_t * trans = _lv_style_list_get_transition_style(list); if(trans) { lv_style_reset(trans); lv_mem_free(trans); @@ -329,7 +329,7 @@ void lv_style_reset(lv_style_t * style) * @param style pointer to a style * @return size of the properties in bytes */ -uint16_t lv_style_get_mem_size(const lv_style_t * style) +uint16_t _lv_style_get_mem_size(const lv_style_t * style) { LV_ASSERT_STYLE(style); @@ -373,7 +373,7 @@ void _lv_style_set_int(lv_style_t * style, lv_style_property_t prop, lv_style_in attr_goal.full = (prop >> 8) & 0xFFU; if(attr_found.bits.state == attr_goal.bits.state) { - lv_memcpy_small(style->map + id + sizeof(lv_style_property_t), &value, sizeof(lv_style_int_t)); + _lv_memcpy_small(style->map + id + sizeof(lv_style_property_t), &value, sizeof(lv_style_int_t)); return; } } @@ -383,16 +383,16 @@ void _lv_style_set_int(lv_style_t * style, lv_style_property_t prop, lv_style_in lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP; uint8_t end_mark_size = sizeof(end_mark); - uint16_t size = lv_style_get_mem_size(style); + uint16_t size = _lv_style_get_mem_size(style); if(size == 0) size += end_mark_size; size += sizeof(lv_style_property_t) + sizeof(lv_style_int_t); style->map = lv_mem_realloc(style->map, size); LV_ASSERT_MEM(style->map); if(style == NULL) return; - lv_memcpy_small(style->map + size - new_prop_size - end_mark_size, &prop, sizeof(lv_style_property_t)); - lv_memcpy_small(style->map + size - sizeof(lv_style_int_t) - end_mark_size, &value, sizeof(lv_style_int_t)); - lv_memcpy_small(style->map + size - end_mark_size, &end_mark, sizeof(end_mark)); + _lv_memcpy_small(style->map + size - new_prop_size - end_mark_size, &prop, sizeof(lv_style_property_t)); + _lv_memcpy_small(style->map + size - sizeof(lv_style_int_t) - end_mark_size, &value, sizeof(lv_style_int_t)); + _lv_memcpy_small(style->map + size - end_mark_size, &end_mark, sizeof(end_mark)); } /** @@ -419,7 +419,7 @@ void _lv_style_set_color(lv_style_t * style, lv_style_property_t prop, lv_color_ attr_goal.full = (prop >> 8) & 0xFFU; if(attr_found.bits.state == attr_goal.bits.state) { - lv_memcpy_small(style->map + id + sizeof(lv_style_property_t), &color, sizeof(lv_color_t)); + _lv_memcpy_small(style->map + id + sizeof(lv_style_property_t), &color, sizeof(lv_color_t)); return; } } @@ -429,7 +429,7 @@ void _lv_style_set_color(lv_style_t * style, lv_style_property_t prop, lv_color_ lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP; uint8_t end_mark_size = sizeof(end_mark); - uint16_t size = lv_style_get_mem_size(style); + uint16_t size = _lv_style_get_mem_size(style); if(size == 0) size += end_mark_size; size += sizeof(lv_style_property_t) + sizeof(lv_color_t); @@ -437,9 +437,9 @@ void _lv_style_set_color(lv_style_t * style, lv_style_property_t prop, lv_color_ LV_ASSERT_MEM(style->map); if(style == NULL) return; - lv_memcpy_small(style->map + size - new_prop_size - end_mark_size, &prop, sizeof(lv_style_property_t)); - lv_memcpy_small(style->map + size - sizeof(lv_color_t) - end_mark_size, &color, sizeof(lv_color_t)); - lv_memcpy_small(style->map + size - end_mark_size, &end_mark, sizeof(end_mark)); + _lv_memcpy_small(style->map + size - new_prop_size - end_mark_size, &prop, sizeof(lv_style_property_t)); + _lv_memcpy_small(style->map + size - sizeof(lv_color_t) - end_mark_size, &color, sizeof(lv_color_t)); + _lv_memcpy_small(style->map + size - end_mark_size, &end_mark, sizeof(end_mark)); } /** @@ -466,7 +466,7 @@ void _lv_style_set_opa(lv_style_t * style, lv_style_property_t prop, lv_opa_t op attr_goal.full = (prop >> 8) & 0xFFU; if(attr_found.bits.state == attr_goal.bits.state) { - lv_memcpy_small(style->map + id + sizeof(lv_style_property_t), &opa, sizeof(lv_opa_t)); + _lv_memcpy_small(style->map + id + sizeof(lv_style_property_t), &opa, sizeof(lv_opa_t)); return; } } @@ -476,7 +476,7 @@ void _lv_style_set_opa(lv_style_t * style, lv_style_property_t prop, lv_opa_t op lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP; uint8_t end_mark_size = sizeof(end_mark); - uint16_t size = lv_style_get_mem_size(style); + uint16_t size = _lv_style_get_mem_size(style); if(size == 0) size += end_mark_size; size += sizeof(lv_style_property_t) + sizeof(lv_opa_t); @@ -484,9 +484,9 @@ void _lv_style_set_opa(lv_style_t * style, lv_style_property_t prop, lv_opa_t op LV_ASSERT_MEM(style->map); if(style == NULL) return; - lv_memcpy_small(style->map + size - new_prop_size - end_mark_size, &prop, sizeof(lv_style_property_t)); - lv_memcpy_small(style->map + size - sizeof(lv_opa_t) - end_mark_size, &opa, sizeof(lv_opa_t)); - lv_memcpy_small(style->map + size - end_mark_size, &end_mark, sizeof(end_mark)); + _lv_memcpy_small(style->map + size - new_prop_size - end_mark_size, &prop, sizeof(lv_style_property_t)); + _lv_memcpy_small(style->map + size - sizeof(lv_opa_t) - end_mark_size, &opa, sizeof(lv_opa_t)); + _lv_memcpy_small(style->map + size - end_mark_size, &end_mark, sizeof(end_mark)); } /** @@ -513,7 +513,7 @@ void _lv_style_set_ptr(lv_style_t * style, lv_style_property_t prop, const void attr_goal.full = (prop >> 8) & 0xFFU; if(attr_found.bits.state == attr_goal.bits.state) { - lv_memcpy_small(style->map + id + sizeof(lv_style_property_t), &p, sizeof(const void *)); + _lv_memcpy_small(style->map + id + sizeof(lv_style_property_t), &p, sizeof(const void *)); return; } } @@ -523,7 +523,7 @@ void _lv_style_set_ptr(lv_style_t * style, lv_style_property_t prop, const void lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP; uint8_t end_mark_size = sizeof(end_mark); - uint16_t size = lv_style_get_mem_size(style); + uint16_t size = _lv_style_get_mem_size(style); if(size == 0) size += end_mark_size; size += sizeof(lv_style_property_t) + sizeof(const void *); @@ -531,9 +531,9 @@ void _lv_style_set_ptr(lv_style_t * style, lv_style_property_t prop, const void LV_ASSERT_MEM(style->map); if(style == NULL) return; - lv_memcpy_small(style->map + size - new_prop_size - end_mark_size, &prop, sizeof(lv_style_property_t)); - lv_memcpy_small(style->map + size - sizeof(const void *) - end_mark_size, &p, sizeof(const void *)); - lv_memcpy_small(style->map + size - end_mark_size, &end_mark, sizeof(end_mark)); + _lv_memcpy_small(style->map + size - new_prop_size - end_mark_size, &prop, sizeof(lv_style_property_t)); + _lv_memcpy_small(style->map + size - sizeof(const void *) - end_mark_size, &p, sizeof(const void *)); + _lv_memcpy_small(style->map + size - end_mark_size, &end_mark, sizeof(end_mark)); } /** @@ -559,7 +559,7 @@ int16_t _lv_style_get_int(const lv_style_t * style, lv_style_property_t prop, vo return -1; } else { - lv_memcpy_small(res, &style->map[id + sizeof(lv_style_property_t)], sizeof(lv_style_int_t)); + _lv_memcpy_small(res, &style->map[id + sizeof(lv_style_property_t)], sizeof(lv_style_int_t)); lv_style_attr_t attr_act; attr_act.full = style->map[id + 1]; @@ -596,7 +596,7 @@ int16_t _lv_style_get_opa(const lv_style_t * style, lv_style_property_t prop, vo return -1; } else { - lv_memcpy_small(res, &style->map[id + sizeof(lv_style_property_t)], sizeof(lv_opa_t)); + _lv_memcpy_small(res, &style->map[id + sizeof(lv_style_property_t)], sizeof(lv_opa_t)); lv_style_attr_t attr_act; attr_act.full = style->map[id + 1]; @@ -630,7 +630,7 @@ int16_t _lv_style_get_color(const lv_style_t * style, lv_style_property_t prop, return -1; } else { - lv_memcpy_small(res, &style->map[id + sizeof(lv_style_property_t)], sizeof(lv_color_t)); + _lv_memcpy_small(res, &style->map[id + sizeof(lv_style_property_t)], sizeof(lv_color_t)); lv_style_attr_t attr_act; attr_act.full = style->map[id + 1]; @@ -665,7 +665,7 @@ int16_t _lv_style_get_ptr(const lv_style_t * style, lv_style_property_t prop, vo return -1; } else { - lv_memcpy_small(res, &style->map[id + sizeof(lv_style_property_t)], sizeof(const void *)); + _lv_memcpy_small(res, &style->map[id + sizeof(lv_style_property_t)], sizeof(const void *)); lv_style_attr_t attr_act; attr_act.full = style->map[id + 1]; @@ -695,7 +695,7 @@ lv_style_t * lv_style_list_get_local_style(lv_style_list_t * list) * @param list pointer to a style list where the local property should be set * @return pointer to the transition style if exists else `NULL`. */ -lv_style_t * lv_style_list_get_transition_style(lv_style_list_t * list) +lv_style_t * _lv_style_list_get_transition_style(lv_style_list_t * list) { LV_ASSERT_STYLE_LIST(list); @@ -708,10 +708,10 @@ lv_style_t * lv_style_list_get_transition_style(lv_style_list_t * list) * @param list pointer to a style list * @return the transition style of a style list */ -lv_style_t * lv_style_list_add_trans_style(lv_style_list_t * list) +lv_style_t * _lv_style_list_add_trans_style(lv_style_list_t * list) { LV_ASSERT_STYLE_LIST(list); - if(list->has_trans) return lv_style_list_get_transition_style(list); + if(list->has_trans) return _lv_style_list_get_transition_style(list); lv_style_t * trans_style = lv_mem_alloc(sizeof(lv_style_t)); LV_ASSERT_MEM(trans_style); @@ -722,7 +722,7 @@ lv_style_t * lv_style_list_add_trans_style(lv_style_list_t * list) lv_style_init(trans_style); - lv_style_list_add_style(list, trans_style); + _lv_style_list_add_style(list, trans_style); list->has_trans = 1; /*If the list has local style trans was added after it. But trans should be the first so swap them*/ @@ -743,7 +743,7 @@ lv_style_t * lv_style_list_add_trans_style(lv_style_list_t * list) * @param value the value to set * @note for performance reasons it's not checked if the property really has integer type */ -void lv_style_list_set_local_int(lv_style_list_t * list, lv_style_property_t prop, lv_style_int_t value) +void _lv_style_list_set_local_int(lv_style_list_t * list, lv_style_property_t prop, lv_style_int_t value) { LV_ASSERT_STYLE_LIST(list); @@ -759,7 +759,7 @@ void lv_style_list_set_local_int(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 opacity type */ -void lv_style_list_set_local_opa(lv_style_list_t * list, lv_style_property_t prop, lv_opa_t value) +void _lv_style_list_set_local_opa(lv_style_list_t * list, lv_style_property_t prop, lv_opa_t value) { LV_ASSERT_STYLE_LIST(list); @@ -775,7 +775,7 @@ void lv_style_list_set_local_opa(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 color type */ -void lv_style_list_set_local_color(lv_style_list_t * list, lv_style_property_t prop, lv_color_t value) +void _lv_style_list_set_local_color(lv_style_list_t * list, lv_style_property_t prop, lv_color_t value) { LV_ASSERT_STYLE_LIST(list); @@ -791,7 +791,7 @@ void lv_style_list_set_local_color(lv_style_list_t * list, lv_style_property_t p * @param value the value to set * @note for performance reasons it's not checked if the property really has pointer type */ -void lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t prop, const void * value) +void _lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t prop, const void * value) { LV_ASSERT_STYLE_LIST(list); @@ -812,7 +812,7 @@ void lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t pro * LV_RES_INV: there was NO matching property in the list * @note for performance reasons it's not checked if the property really has integer type */ -lv_res_t lv_style_list_get_int(lv_style_list_t * list, lv_style_property_t prop, lv_style_int_t * res) +lv_res_t _lv_style_list_get_int(lv_style_list_t * list, lv_style_property_t prop, lv_style_int_t * res) { LV_ASSERT_STYLE_LIST(list); @@ -864,7 +864,7 @@ lv_res_t lv_style_list_get_int(lv_style_list_t * list, lv_style_property_t prop, * LV_RES_INV: there was NO matching property in the list * @note for performance reasons it's not checked if the property really has color type */ -lv_res_t lv_style_list_get_color(lv_style_list_t * list, lv_style_property_t prop, lv_color_t * res) +lv_res_t _lv_style_list_get_color(lv_style_list_t * list, lv_style_property_t prop, lv_color_t * res) { LV_ASSERT_STYLE_LIST(list); @@ -914,7 +914,7 @@ lv_res_t lv_style_list_get_color(lv_style_list_t * list, lv_style_property_t pro * LV_RES_INV: there was NO matching property in the list * @note for performance reasons it's not checked if the property really has opacity type */ -lv_res_t lv_style_list_get_opa(lv_style_list_t * list, lv_style_property_t prop, lv_opa_t * res) +lv_res_t _lv_style_list_get_opa(lv_style_list_t * list, lv_style_property_t prop, lv_opa_t * res) { LV_ASSERT_STYLE_LIST(list); @@ -964,7 +964,7 @@ lv_res_t lv_style_list_get_opa(lv_style_list_t * list, lv_style_property_t prop, * LV_RES_INV: there was NO matching property in the list * @note for performance reasons it's not checked if the property really has pointer type */ -lv_res_t lv_style_list_get_ptr(lv_style_list_t * list, lv_style_property_t prop, const void ** res) +lv_res_t _lv_style_list_get_ptr(lv_style_list_t * list, lv_style_property_t prop, const void ** res) { LV_ASSERT_STYLE_LIST(list); @@ -1082,7 +1082,7 @@ static lv_style_t * get_alloc_local_style(lv_style_list_t * list) lv_style_init(local_style); /*Add the local style to the furst place*/ - lv_style_list_add_style(list, local_style); + _lv_style_list_add_style(list, local_style); list->has_local = 1; return local_style; diff --git a/src/lv_core/lv_style.h b/src/lv_core/lv_style.h index 2ed70bb051..af818ec171 100644 --- a/src/lv_core/lv_style.h +++ b/src/lv_core/lv_style.h @@ -267,21 +267,21 @@ void lv_style_list_copy(lv_style_list_t * list_dest, const lv_style_list_t * lis * @param list pointer to a style list * @param style pointer to a style to add */ -void lv_style_list_add_style(lv_style_list_t * list, lv_style_t * style); +void _lv_style_list_add_style(lv_style_list_t * list, lv_style_t * style); /** * Remove a style from a style list * @param style_list pointer to a style list * @param style pointer to a style to remove */ -void lv_style_list_remove_style(lv_style_list_t * list, lv_style_t * style); +void _lv_style_list_remove_style(lv_style_list_t * list, lv_style_t * style); /** * Remove all styles added from style list, clear the local style, transition style and free all allocated memories. * Leave `ignore_trans` flag as it is. * @param list pointer to a style list. */ -void lv_style_list_reset(lv_style_list_t * style_list); +void _lv_style_list_reset(lv_style_list_t * style_list); static inline lv_style_t * lv_style_list_get_style(lv_style_list_t * list, uint8_t id) { @@ -301,7 +301,7 @@ void lv_style_reset(lv_style_t * style); * @param style pointer to a style * @return size of the properties in bytes */ -uint16_t lv_style_get_mem_size(const lv_style_t * style); +uint16_t _lv_style_get_mem_size(const lv_style_t * style); /** * Copy a style to an other @@ -367,8 +367,6 @@ void _lv_style_set_opa(lv_style_t * style, lv_style_property_t prop, lv_opa_t op */ void _lv_style_set_ptr(lv_style_t * style, lv_style_property_t prop, const void * p); - - /** * Get an integer typed property from a style. * @param style pointer to a style from where the property should be get @@ -441,14 +439,14 @@ lv_style_t * lv_style_list_get_local_style(lv_style_list_t * list); * @param list pointer to a style list where the local property should be set * @return pointer to the transition style if exists else `NULL`. */ -lv_style_t * lv_style_list_get_transition_style(lv_style_list_t * list); +lv_style_t * _lv_style_list_get_transition_style(lv_style_list_t * list); /** * Allocate the transition style in a style list. If already exists simply return it. * @param list pointer to a style list * @return the transition style of a style list */ -lv_style_t * lv_style_list_add_trans_style(lv_style_list_t * list); +lv_style_t * _lv_style_list_add_trans_style(lv_style_list_t * list); /** * Set a local integer typed property in a style list. @@ -458,7 +456,7 @@ lv_style_t * lv_style_list_add_trans_style(lv_style_list_t * list); * @param value the value to set * @note for performance reasons it's not checked if the property really has integer type */ -void lv_style_list_set_local_int(lv_style_list_t * list, lv_style_property_t prop, lv_style_int_t value); +void _lv_style_list_set_local_int(lv_style_list_t * list, lv_style_property_t prop, lv_style_int_t value); /** * Set a local color typed property in a style list. @@ -468,7 +466,7 @@ void lv_style_list_set_local_int(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 color type */ -void lv_style_list_set_local_color(lv_style_list_t * list, lv_style_property_t prop, lv_color_t value); +void _lv_style_list_set_local_color(lv_style_list_t * list, lv_style_property_t prop, lv_color_t value); /** * Set a local opacity typed property in a style list. @@ -478,7 +476,7 @@ void lv_style_list_set_local_color(lv_style_list_t * list, lv_style_property_t p * @param value the value to set * @note for performance reasons it's not checked if the property really has opacity type */ -void lv_style_list_set_local_opa(lv_style_list_t * list, lv_style_property_t prop, lv_opa_t value); +void _lv_style_list_set_local_opa(lv_style_list_t * list, lv_style_property_t prop, lv_opa_t value); /** * Set a local pointer typed property in a style list. @@ -488,7 +486,7 @@ void lv_style_list_set_local_opa(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 */ -void lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t prop, const void * value); +void _lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t prop, const void * value); /** * Get an integer typed property from a style list. @@ -501,7 +499,7 @@ void lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t pro * LV_RES_INV: there was NO matching property in the list * @note for performance reasons it's not checked if the property really has integer type */ -lv_res_t lv_style_list_get_int(lv_style_list_t * list, lv_style_property_t prop, lv_style_int_t * res); +lv_res_t _lv_style_list_get_int(lv_style_list_t * list, lv_style_property_t prop, lv_style_int_t * res); /** * Get a color typed property from a style list. @@ -514,7 +512,7 @@ lv_res_t lv_style_list_get_int(lv_style_list_t * list, lv_style_property_t prop, * LV_RES_INV: there was NO matching property in the list * @note for performance reasons it's not checked if the property really has color type */ -lv_res_t lv_style_list_get_color(lv_style_list_t * list, lv_style_property_t prop, lv_color_t * res); +lv_res_t _lv_style_list_get_color(lv_style_list_t * list, lv_style_property_t prop, lv_color_t * res); /** @@ -528,7 +526,7 @@ lv_res_t lv_style_list_get_color(lv_style_list_t * list, lv_style_property_t pro * LV_RES_INV: there was NO matching property in the list * @note for performance reasons it's not checked if the property really has opacity type */ -lv_res_t lv_style_list_get_opa(lv_style_list_t * list, lv_style_property_t prop, lv_opa_t * res); +lv_res_t _lv_style_list_get_opa(lv_style_list_t * list, lv_style_property_t prop, lv_opa_t * res); /** * Get a pointer typed property from a style list. @@ -541,7 +539,7 @@ lv_res_t lv_style_list_get_opa(lv_style_list_t * list, lv_style_property_t prop, * LV_RES_INV: there was NO matching property in the list * @note for performance reasons it's not checked if the property really has pointer type */ -lv_res_t lv_style_list_get_ptr(lv_style_list_t * list, lv_style_property_t prop, const void ** res); +lv_res_t _lv_style_list_get_ptr(lv_style_list_t * list, lv_style_property_t prop, const void ** res); /************************* diff --git a/src/lv_draw/lv_draw_arc.c b/src/lv_draw/lv_draw_arc.c index 3b78865112..27f6f1667b 100644 --- a/src/lv_draw/lv_draw_arc.c +++ b/src/lv_draw/lv_draw_arc.c @@ -177,13 +177,13 @@ static void draw_quarter_0(quarter_draw_dsc_t * q) if(q->start_quarter == 0 && q->end_quarter == 0 && q->start_angle < q->end_angle) { /*Small arc here*/ - quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); - quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->end_angle) * q->radius) >> LV_TRIGO_SHIFT); - quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->end_angle) * q->radius) >> LV_TRIGO_SHIFT); + quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } else if(q->start_quarter == 0 || q->end_quarter == 0) { @@ -192,20 +192,20 @@ static void draw_quarter_0(quarter_draw_dsc_t * q) quarter_area.x1 = q->center_x; quarter_area.y2 = q->center_y + q->radius; - quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } if(q->end_quarter == 0) { quarter_area.x2 = q->center_x + q->radius; quarter_area.y1 = q->center_y; - quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->end_angle) * q->radius) >> LV_TRIGO_SHIFT); - quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->end_angle) * q->radius) >> LV_TRIGO_SHIFT); + quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } } @@ -219,7 +219,7 @@ static void draw_quarter_0(quarter_draw_dsc_t * q) quarter_area.x2 = q->center_x + q->radius; quarter_area.y2 = q->center_y + q->radius; - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } } @@ -230,13 +230,13 @@ static void draw_quarter_1(quarter_draw_dsc_t * q) if(q->start_quarter == 1 && q->end_quarter == 1 && q->start_angle < q->end_angle) { /*Small arc here*/ - quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT); - quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } else if(q->start_quarter == 1 || q->end_quarter == 1) { @@ -245,20 +245,20 @@ static void draw_quarter_1(quarter_draw_dsc_t * q) quarter_area.x1 = q->center_x - q->radius; quarter_area.y1 = q->center_y; - quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT); - quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } if(q->end_quarter == 1) { quarter_area.x2 = q->center_x - 1; quarter_area.y2 = q->center_y + q->radius; - quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } } @@ -272,7 +272,7 @@ static void draw_quarter_1(quarter_draw_dsc_t * q) quarter_area.x2 = q->center_x - 1; quarter_area.y2 = q->center_y + q->radius; - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } } @@ -283,13 +283,13 @@ static void draw_quarter_2(quarter_draw_dsc_t * q) if(q->start_quarter == 2 && q->end_quarter == 2 && q->start_angle < q->end_angle) { /*Small arc here*/ - quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); - quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->end_angle) * q->radius) >> LV_TRIGO_SHIFT); - quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->end_angle) * q->radius) >> LV_TRIGO_SHIFT); + quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } else if(q->start_quarter == 2 || q->end_quarter == 2) { @@ -298,20 +298,20 @@ static void draw_quarter_2(quarter_draw_dsc_t * q) quarter_area.x2 = q->center_x - 1; quarter_area.y1 = q->center_y - q->radius; - quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); - quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } if(q->end_quarter == 2) { quarter_area.x1 = q->center_x - q->radius; quarter_area.y2 = q->center_y - 1; - quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->end_angle) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->end_angle) * (q->radius)) >> LV_TRIGO_SHIFT); - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } } @@ -325,7 +325,7 @@ static void draw_quarter_2(quarter_draw_dsc_t * q) quarter_area.x2 = q->center_x - 1; quarter_area.y2 = q->center_y - 1; - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } } @@ -337,13 +337,13 @@ static void draw_quarter_3(quarter_draw_dsc_t * q) if(q->start_quarter == 3 && q->end_quarter == 3 && q->start_angle < q->end_angle) { /*Small arc here*/ - quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT); - quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); - quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } else if(q->start_quarter == 3 || q->end_quarter == 3) { @@ -352,20 +352,20 @@ static void draw_quarter_3(quarter_draw_dsc_t * q) quarter_area.x2 = q->center_x + q->radius; quarter_area.y2 = q->center_y - 1; - quarter_area.x1 = q->center_x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - quarter_area.y1 = q->center_y + ((lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.x1 = q->center_x + ((_lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.y1 = q->center_y + ((_lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT); - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } if(q->end_quarter == 3) { quarter_area.x1 = q->center_x; quarter_area.y1 = q->center_y - q->radius; - quarter_area.x2 = q->center_x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); - quarter_area.y2 = q->center_y + ((lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.x2 = q->center_x + ((_lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.y2 = q->center_y + ((_lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } } @@ -379,7 +379,7 @@ static void draw_quarter_3(quarter_draw_dsc_t * q) quarter_area.x2 = q->center_x + q->radius; quarter_area.y2 = q->center_y - 1; - bool ok = lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, q->clip_area); if(ok) lv_draw_rect(q->draw_area, &quarter_area, q->draw_dsc); } } @@ -405,8 +405,8 @@ static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t tickness, int32_t cir_x; int32_t cir_y; - cir_x = ((radius - rx_corr - thick_half) * lv_trigo_sin(90 - angle)) >> (LV_TRIGO_SHIFT - ps); - cir_y = ((radius - ry_corr - thick_half) * lv_trigo_sin(angle)) >> (LV_TRIGO_SHIFT - ps); + cir_x = ((radius - rx_corr - thick_half) * _lv_trigo_sin(90 - angle)) >> (LV_TRIGO_SHIFT - ps); + cir_y = ((radius - ry_corr - thick_half) * _lv_trigo_sin(angle)) >> (LV_TRIGO_SHIFT - ps); /* Actually the center of the pixel need to be calculated so apply 1/2 px offset*/ if(cir_x > 0) { diff --git a/src/lv_draw/lv_draw_blend.c b/src/lv_draw/lv_draw_blend.c index 8cefb84c5a..1d21dc43ea 100644 --- a/src/lv_draw/lv_draw_blend.c +++ b/src/lv_draw/lv_draw_blend.c @@ -117,7 +117,7 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co * @param opa overall opacity in 0x00..0xff range * @param mode blend mode from `lv_blend_mode_t` */ -LV_ATTRIBUTE_FAST_MEM void lv_blend_fill(const lv_area_t * clip_area, const lv_area_t * fill_area, +LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_area_t * fill_area, lv_color_t color, lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode) { @@ -125,7 +125,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_blend_fill(const lv_area_t * clip_area, const lv_a if(opa < LV_OPA_MIN) return; if(mask_res == LV_DRAW_MASK_RES_TRANSP) return; - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_buf_t * vdb = lv_disp_get_buf(disp); const lv_area_t * disp_area = &vdb->area; lv_color_t * disp_buf = vdb->buf_act; @@ -135,7 +135,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_blend_fill(const lv_area_t * clip_area, const lv_a * It is always the same or inside `fill_area` */ lv_area_t draw_area; bool is_common; - is_common = lv_area_intersect(&draw_area, clip_area, fill_area); + is_common = _lv_area_intersect(&draw_area, clip_area, fill_area); if(!is_common) return; /* Now `draw_area` has absolute coordinates. @@ -181,7 +181,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_blend_fill(const lv_area_t * clip_area, const lv_a * @param opa overall opacity in 0x00..0xff range * @param mode blend mode from `lv_blend_mode_t` */ -LV_ATTRIBUTE_FAST_MEM void lv_blend_map(const lv_area_t * clip_area, const lv_area_t * map_area, +LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_area_t * map_area, const lv_color_t * map_buf, lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode) @@ -194,10 +194,10 @@ LV_ATTRIBUTE_FAST_MEM void lv_blend_map(const lv_area_t * clip_area, const lv_ar * It is always the same or inside `fill_area` */ lv_area_t draw_area; bool is_common; - is_common = lv_area_intersect(&draw_area, clip_area, map_area); + is_common = _lv_area_intersect(&draw_area, clip_area, map_area); if(!is_common) return; - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_buf_t * vdb = lv_disp_get_buf(disp); const lv_area_t * disp_area = &vdb->area; lv_color_t * disp_buf = vdb->buf_act; @@ -241,7 +241,7 @@ static void fill_set_px(const lv_area_t * disp_area, lv_color_t * disp_buf, con const lv_opa_t * mask, lv_draw_mask_res_t mask_res) { - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); /*Get the width of the `disp_area` it will be used to go to the next line*/ int32_t disp_w = lv_area_get_width(disp_area); @@ -295,7 +295,7 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co { #if LV_USE_GPU || LV_COLOR_SCREEN_TRANSP - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); #endif /*Get the width of the `disp_area` it will be used to go to the next line*/ @@ -587,7 +587,7 @@ static void map_set_px(const lv_area_t * disp_area, lv_color_t * disp_buf, cons const lv_opa_t * mask, lv_draw_mask_res_t mask_res) { - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); /*Get the width of the `disp_area` it will be used to go to the next line*/ int32_t disp_w = lv_area_get_width(disp_area); @@ -667,7 +667,7 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col map_buf_first += (draw_area->x1 - (map_area->x1 - disp_area->x1)); #if LV_COLOR_SCREEN_TRANSP || LV_USE_GPU - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); #endif int32_t x; @@ -696,7 +696,7 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col /*Software rendering*/ for(y = 0; y < draw_area_h; y++) { - lv_memcpy(disp_buf_first, map_buf_first, draw_area_w * sizeof(lv_color_t)); + _lv_memcpy(disp_buf_first, map_buf_first, draw_area_w * sizeof(lv_color_t)); disp_buf_first += disp_w; map_buf_first += map_w; } diff --git a/src/lv_draw/lv_draw_blend.h b/src/lv_draw/lv_draw_blend.h index 731b5d924e..b0cd86f1e2 100644 --- a/src/lv_draw/lv_draw_blend.h +++ b/src/lv_draw/lv_draw_blend.h @@ -36,11 +36,11 @@ typedef uint8_t lv_blend_mode_t; * GLOBAL PROTOTYPES **********************/ -LV_ATTRIBUTE_FAST_MEM void lv_blend_fill(const lv_area_t * clip_area, const lv_area_t * fill_area, lv_color_t color, +LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_area_t * fill_area, lv_color_t color, lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode); -LV_ATTRIBUTE_FAST_MEM void lv_blend_map(const lv_area_t * clip_area, const lv_area_t * map_area, +LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_area_t * map_area, const lv_color_t * map_buf, lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode); diff --git a/src/lv_draw/lv_draw_img.c b/src/lv_draw/lv_draw_img.c index 5eb09329ff..a761449eaf 100644 --- a/src/lv_draw/lv_draw_img.c +++ b/src/lv_draw/lv_draw_img.c @@ -52,7 +52,7 @@ static void show_error(const lv_area_t * coords, const lv_area_t * clip_area, co void lv_draw_img_dsc_init(lv_draw_img_dsc_t * dsc) { - lv_memset_00(dsc, sizeof(lv_draw_img_dsc_t)); + _lv_memset_00(dsc, sizeof(lv_draw_img_dsc_t)); dsc->recolor = LV_COLOR_BLACK; dsc->opa = LV_OPA_COVER; dsc->zoom = LV_IMG_ZOOM_NONE; @@ -236,7 +236,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords, { if(draw_dsc->opa <= LV_OPA_MIN) return LV_RES_OK; - lv_img_cache_entry_t * cdsc = lv_img_cache_open(src, draw_dsc->recolor); + lv_img_cache_entry_t * cdsc = _lv_img_cache_open(src, draw_dsc->recolor); if(cdsc == NULL) return LV_RES_INV; @@ -257,7 +257,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords, int32_t w = lv_area_get_width(coords); int32_t h = lv_area_get_height(coords); - lv_img_buf_get_transformed_area(&map_area_rot, w, h, draw_dsc->angle, draw_dsc->zoom, &draw_dsc->pivot); + _lv_img_buf_get_transformed_area(&map_area_rot, w, h, draw_dsc->angle, draw_dsc->zoom, &draw_dsc->pivot); map_area_rot.x1 += coords->x1; map_area_rot.y1 += coords->y1; @@ -267,7 +267,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords, lv_area_t mask_com; /*Common area of mask and coords*/ bool union_ok; - union_ok = lv_area_intersect(&mask_com, clip_area, &map_area_rot); + union_ok = _lv_area_intersect(&mask_com, clip_area, &map_area_rot); if(union_ok == false) { return LV_RES_OK; /*Out of mask. There is nothing to draw so the image is drawn successfully.*/ @@ -279,7 +279,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords, else { lv_area_t mask_com; /*Common area of mask and coords*/ bool union_ok; - union_ok = lv_area_intersect(&mask_com, clip_area, coords); + union_ok = _lv_area_intersect(&mask_com, clip_area, coords); if(union_ok == false) { return LV_RES_OK; /*Out of mask. There is nothing to draw so the image is drawn successfully.*/ @@ -287,7 +287,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords, int32_t width = lv_area_get_width(&mask_com); - uint8_t * buf = lv_mem_buf_get(lv_area_get_width(&mask_com) * + uint8_t * buf = _lv_mem_buf_get(lv_area_get_width(&mask_com) * LV_IMG_PX_SIZE_ALPHA_BYTE); /*+1 because of the possible alpha byte*/ lv_area_t line; @@ -299,14 +299,14 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords, lv_res_t read_res; for(row = mask_com.y1; row <= mask_com.y2; row++) { lv_area_t mask_line; - union_ok = lv_area_intersect(&mask_line, clip_area, &line); + union_ok = _lv_area_intersect(&mask_line, clip_area, &line); if(union_ok == false) continue; read_res = lv_img_decoder_read_line(&cdsc->dec_dsc, x, y, width, buf); if(read_res != LV_RES_OK) { lv_img_decoder_close(&cdsc->dec_dsc); LV_LOG_WARN("Image draw can't read the line"); - lv_mem_buf_release(buf); + _lv_mem_buf_release(buf); return LV_RES_INV; } @@ -316,7 +316,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords, line.y2++; y++; } - lv_mem_buf_release(buf); + _lv_mem_buf_release(buf); } return LV_RES_OK; @@ -344,7 +344,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const lv_area_t draw_area; lv_area_copy(&draw_area, clip_area); - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_buf_t * vdb = lv_disp_get_buf(disp); const lv_area_t * disp_area = &vdb->area; @@ -360,7 +360,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const /*The simplest case just copy the pixels into the VDB*/ if(other_mask_cnt == 0 && draw_dsc->angle == 0 && draw_dsc->zoom == LV_IMG_ZOOM_NONE && chroma_key == false && alpha_byte == false && draw_dsc->recolor_opa == LV_OPA_TRANSP) { - lv_blend_map(clip_area, map_area, (lv_color_t *)map_p, NULL, LV_DRAW_MASK_RES_FULL_COVER, draw_dsc->opa, + _lv_blend_map(clip_area, map_area, (lv_color_t *)map_p, NULL, LV_DRAW_MASK_RES_FULL_COVER, draw_dsc->opa, draw_dsc->blend_mode); } /*In the other cases every pixel need to be checked one-by-one*/ @@ -370,8 +370,8 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const /*Build the image and a mask line-by-line*/ uint32_t mask_buf_size = lv_area_get_size(&draw_area) > LV_HOR_RES_MAX ? LV_HOR_RES_MAX : lv_area_get_size(&draw_area); - lv_color_t * map2 = lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t)); - lv_opa_t * mask_buf = lv_mem_buf_get(mask_buf_size); + lv_color_t * map2 = _lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t)); + lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size); /*Go to the first displayed pixel of the map*/ int32_t map_w = lv_area_get_width(map_area); @@ -438,7 +438,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const blend_area.y2 ++; } else { - lv_blend_map(clip_area, &blend_area, map2, mask_buf, LV_DRAW_MASK_RES_CHANGED, draw_dsc->opa, draw_dsc->blend_mode); + _lv_blend_map(clip_area, &blend_area, map2, mask_buf, LV_DRAW_MASK_RES_CHANGED, draw_dsc->opa, draw_dsc->blend_mode); blend_area.y1 = blend_area.y2 + 1; blend_area.y2 = blend_area.y1; @@ -449,18 +449,18 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const /*Flush the last part*/ if(blend_area.y1 != blend_area.y2) { blend_area.y2--; - lv_blend_map(clip_area, &blend_area, map2, mask_buf, LV_DRAW_MASK_RES_CHANGED, draw_dsc->opa, draw_dsc->blend_mode); + _lv_blend_map(clip_area, &blend_area, map2, mask_buf, LV_DRAW_MASK_RES_CHANGED, draw_dsc->opa, draw_dsc->blend_mode); } - lv_mem_buf_release(mask_buf); - lv_mem_buf_release(map2); + _lv_mem_buf_release(mask_buf); + _lv_mem_buf_release(map2); } /*Most complicated case: transform or other mask or chroma keyed*/ else { #if LV_USE_IMG_TRANSFORM lv_img_transform_dsc_t trans_dsc; - lv_memset_00(&trans_dsc, sizeof(lv_img_transform_dsc_t)); + _lv_memset_00(&trans_dsc, sizeof(lv_img_transform_dsc_t)); if(transform) { lv_img_cf_t cf = LV_IMG_CF_TRUE_COLOR; if(alpha_byte) cf = LV_IMG_CF_TRUE_COLOR_ALPHA; @@ -477,7 +477,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const trans_dsc.cfg.color = draw_dsc->recolor; trans_dsc.cfg.antialias = draw_dsc->antialias; - lv_img_buf_transform_init(&trans_dsc); + _lv_img_buf_transform_init(&trans_dsc); } #endif uint16_t recolor_premult[3] = {0}; @@ -493,7 +493,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const /*Prepare the `mask_buf`if there are other masks*/ if(other_mask_cnt) { - lv_memset_ff(mask_buf, mask_buf_size); + _lv_memset_ff(mask_buf, mask_buf_size); } int32_t x; @@ -516,7 +516,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const /*Transform*/ bool ret; - ret = lv_img_buf_transform(&trans_dsc, rot_x + x, rot_y + y); + ret = _lv_img_buf_transform(&trans_dsc, rot_x + x, rot_y + y); if(ret == false) { mask_buf[px_i] = LV_OPA_TRANSP; continue; @@ -570,7 +570,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const mask_res_sub = lv_draw_mask_apply(mask_buf + px_i_start, draw_area.x1 + vdb->area.x1, y + draw_area.y1 + vdb->area.y1, lv_area_get_width(&draw_area)); if(mask_res_sub == LV_DRAW_MASK_RES_TRANSP) { - lv_memset_00(mask_buf + px_i_start, lv_area_get_width(&draw_area)); + _lv_memset_00(mask_buf + px_i_start, lv_area_get_width(&draw_area)); mask_res = LV_DRAW_MASK_RES_CHANGED; } else if(mask_res_sub == LV_DRAW_MASK_RES_CHANGED) { @@ -583,7 +583,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const blend_area.y2 ++; } else { - lv_blend_map(clip_area, &blend_area, map2, mask_buf, mask_res, draw_dsc->opa, draw_dsc->blend_mode); + _lv_blend_map(clip_area, &blend_area, map2, mask_buf, mask_res, draw_dsc->opa, draw_dsc->blend_mode); blend_area.y1 = blend_area.y2 + 1; blend_area.y2 = blend_area.y1; @@ -594,19 +594,19 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const /*Prepare the `mask_buf`if there are other masks*/ if(other_mask_cnt) { - lv_memset_ff(mask_buf, mask_buf_size); + _lv_memset_ff(mask_buf, mask_buf_size); } } } /*Flush the last part*/ if(blend_area.y1 != blend_area.y2) { blend_area.y2--; - lv_blend_map(clip_area, &blend_area, map2, mask_buf, mask_res, draw_dsc->opa, draw_dsc->blend_mode); + _lv_blend_map(clip_area, &blend_area, map2, mask_buf, mask_res, draw_dsc->opa, draw_dsc->blend_mode); } } - lv_mem_buf_release(mask_buf); - lv_mem_buf_release(map2); + _lv_mem_buf_release(mask_buf); + _lv_mem_buf_release(map2); } } diff --git a/src/lv_draw/lv_draw_label.c b/src/lv_draw/lv_draw_label.c index 7948b945c7..6f115ced0c 100644 --- a/src/lv_draw/lv_draw_label.c +++ b/src/lv_draw/lv_draw_label.c @@ -92,7 +92,7 @@ const uint8_t _lv_bpp8_opa_table[256] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1 LV_ATTRIBUTE_FAST_MEM void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc) { - lv_memset_00(dsc, sizeof(lv_draw_label_dsc_t)); + _lv_memset_00(dsc, sizeof(lv_draw_label_dsc_t)); dsc->opa = LV_OPA_COVER; dsc->color = LV_COLOR_BLACK; dsc->font = LV_THEME_DEFAULT_FONT_NORMAL; @@ -121,7 +121,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area if(txt[0] == '\0') return; lv_area_t clipped_area; - bool clip_ok = lv_area_intersect(&clipped_area, coords, mask); + bool clip_ok = _lv_area_intersect(&clipped_area, coords, mask); if(!clip_ok) return; @@ -132,7 +132,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area else { /*If EXAPND is enabled then not limit the text's width to the object's width*/ lv_point_t p; - lv_txt_get_size(&p, txt, dsc->font, dsc->letter_space, dsc->line_space, LV_COORD_MAX, + _lv_txt_get_size(&p, txt, dsc->font, dsc->letter_space, dsc->line_space, LV_COORD_MAX, dsc->flag); w = p.x; } @@ -170,13 +170,13 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area pos.y += hint->y; } - uint32_t line_end = line_start + lv_txt_get_next_line(&txt[line_start], font, dsc->letter_space, w, dsc->flag); + uint32_t line_end = line_start + _lv_txt_get_next_line(&txt[line_start], font, dsc->letter_space, w, dsc->flag); /*Go the first visible line*/ while(pos.y + line_height_font < mask->y1) { /*Go to next line*/ line_start = line_end; - line_end += lv_txt_get_next_line(&txt[line_start], font, dsc->letter_space, w, dsc->flag); + line_end += _lv_txt_get_next_line(&txt[line_start], font, dsc->letter_space, w, dsc->flag); pos.y += line_height; /*Save at the threshold coordinate*/ @@ -191,14 +191,14 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area /*Align to middle*/ if(dsc->flag & LV_TXT_FLAG_CENTER) { - line_width = lv_txt_get_width(&txt[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag); + line_width = _lv_txt_get_width(&txt[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag); pos.x += (lv_area_get_width(coords) - line_width) / 2; } /*Align to the right*/ else if(dsc->flag & LV_TXT_FLAG_RIGHT) { - line_width = lv_txt_get_width(&txt[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag); + line_width = _lv_txt_get_width(&txt[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag); pos.x += lv_area_get_width(coords) - line_width; } @@ -241,8 +241,8 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area cmd_state = CMD_STATE_WAIT; i = 0; #if LV_USE_BIDI - char * bidi_txt = lv_mem_buf_get(line_end - line_start + 1); - lv_bidi_process_paragraph(txt + line_start, bidi_txt, line_end - line_start, dsc->bidi_dir, NULL, 0); + char * bidi_txt = _lv_mem_buf_get(line_end - line_start + 1); + _lv_bidi_process_paragraph(txt + line_start, bidi_txt, line_end - line_start, dsc->bidi_dir, NULL, 0); #else const char * bidi_txt = txt + line_start; #endif @@ -251,16 +251,16 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area uint16_t logical_char_pos = 0; if(sel_start != 0xFFFF && sel_end != 0xFFFF) { #if LV_USE_BIDI - logical_char_pos = lv_txt_encoded_get_char_id(txt, line_start); - uint16_t t = lv_txt_encoded_get_char_id(bidi_txt, i); - logical_char_pos += lv_bidi_get_logical_pos(bidi_txt, NULL, line_end - line_start, dsc->bidi_dir, t, NULL); + logical_char_pos = _lv_txt_encoded_get_char_id(txt, line_start); + uint16_t t = _lv_txt_encoded_get_char_id(bidi_txt, i); + logical_char_pos += _lv_bidi_get_logical_pos(bidi_txt, NULL, line_end - line_start, dsc->bidi_dir, t, NULL); #else - logical_char_pos = lv_txt_encoded_get_char_id(txt, line_start + i); + logical_char_pos = _lv_txt_encoded_get_char_id(txt, line_start + i); #endif } - uint32_t letter = lv_txt_encoded_next(bidi_txt, &i); - uint32_t letter_next = lv_txt_encoded_next(&bidi_txt[i], NULL); + uint32_t letter = _lv_txt_encoded_next(bidi_txt, &i); + uint32_t letter_next = _lv_txt_encoded_next(&bidi_txt[i], NULL); /*Handle the re-color command*/ if((dsc->flag & LV_TXT_FLAG_RECOLOR) != 0) { @@ -285,7 +285,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area /*Get the parameter*/ if(i - par_start == LABEL_RECOLOR_PAR_LENGTH + 1) { char buf[LABEL_RECOLOR_PAR_LENGTH + 1]; - lv_memcpy_small(buf, &bidi_txt[par_start], LABEL_RECOLOR_PAR_LENGTH); + _lv_memcpy_small(buf, &bidi_txt[par_start], LABEL_RECOLOR_PAR_LENGTH); buf[LABEL_RECOLOR_PAR_LENGTH] = '\0'; int r, g, b; r = (hex_char_to_num(buf[0]) << 4) + hex_char_to_num(buf[1]); @@ -347,18 +347,18 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area } #if LV_USE_BIDI - lv_mem_buf_release(bidi_txt); + _lv_mem_buf_release(bidi_txt); bidi_txt = NULL; #endif /*Go to next line*/ line_start = line_end; - line_end += lv_txt_get_next_line(&txt[line_start], font, dsc->letter_space, w, dsc->flag); + line_end += _lv_txt_get_next_line(&txt[line_start], font, dsc->letter_space, w, dsc->flag); pos.x = coords->x1; /*Align to middle*/ if(dsc->flag & LV_TXT_FLAG_CENTER) { line_width = - lv_txt_get_width(&txt[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag); + _lv_txt_get_width(&txt[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag); pos.x += (lv_area_get_width(coords) - line_width) / 2; @@ -366,7 +366,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area /*Align to the right*/ else if(dsc->flag & LV_TXT_FLAG_RIGHT) { line_width = - lv_txt_get_width(&txt[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag); + _lv_txt_get_width(&txt[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag); pos.x += lv_area_get_width(coords) - line_width; } @@ -519,7 +519,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_ col_bit = bit_ofs & 0x7; /* "& 0x7" equals to "% 8" just faster */ uint32_t mask_buf_size = box_w * box_h > LV_HOR_RES_MAX ? LV_HOR_RES_MAX : box_w * box_h; - lv_opa_t * mask_buf = lv_mem_buf_get(mask_buf_size); + lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size); int32_t mask_p = 0; lv_area_t fill_area; @@ -568,7 +568,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_ lv_draw_mask_res_t mask_res = lv_draw_mask_apply(mask_buf + mask_p_start, fill_area.x1, fill_area.y2, lv_area_get_width(&fill_area)); if(mask_res == LV_DRAW_MASK_RES_TRANSP) { - lv_memset_00(mask_buf + mask_p_start, lv_area_get_width(&fill_area)); + _lv_memset_00(mask_buf + mask_p_start, lv_area_get_width(&fill_area)); } } @@ -576,7 +576,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_ fill_area.y2 ++; } else { - lv_blend_fill(clip_area, &fill_area, + _lv_blend_fill(clip_area, &fill_area, color, mask_buf, LV_DRAW_MASK_RES_CHANGED, LV_OPA_COVER, blend_mode); @@ -593,13 +593,13 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_ /*Flush the last part*/ if(fill_area.y1 != fill_area.y2) { fill_area.y2--; - lv_blend_fill(clip_area, &fill_area, + _lv_blend_fill(clip_area, &fill_area, color, mask_buf, LV_DRAW_MASK_RES_CHANGED, LV_OPA_COVER, blend_mode); mask_p = 0; } - lv_mem_buf_release(mask_buf); + _lv_mem_buf_release(mask_buf); } static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_dsc_t * g, const lv_area_t * clip_area, @@ -656,12 +656,12 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_ col_bit = bit_ofs & 0x7; /* "& 0x7" equals to "% 8" just faster */ int32_t mask_buf_size = box_w * box_h > LV_HOR_RES_MAX ? LV_HOR_RES_MAX : g->box_w * g->box_h; - lv_opa_t * mask_buf = lv_mem_buf_get(mask_buf_size); + lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size); int32_t mask_p = 0; - lv_color_t * color_buf = lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t)); + lv_color_t * color_buf = _lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t)); - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_buf_t * vdb = lv_disp_get_buf(disp); int32_t vdb_width = lv_area_get_width(&vdb->area); @@ -772,7 +772,7 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_ lv_draw_mask_res_t mask_res = lv_draw_mask_apply(mask_buf + mask_p_start, map_area.x1, map_area.y2, lv_area_get_width(&map_area)); if(mask_res == LV_DRAW_MASK_RES_TRANSP) { - lv_memset_00(mask_buf + mask_p_start, lv_area_get_width(&map_area)); + _lv_memset_00(mask_buf + mask_p_start, lv_area_get_width(&map_area)); } } @@ -780,7 +780,7 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_ map_area.y2 ++; } else { - lv_blend_map(clip_area, &map_area, color_buf, mask_buf, LV_DRAW_MASK_RES_CHANGED, opa, blend_mode); + _lv_blend_map(clip_area, &map_area, color_buf, mask_buf, LV_DRAW_MASK_RES_CHANGED, opa, blend_mode); map_area.y1 = map_area.y2 + 1; map_area.y2 = map_area.y1; @@ -799,11 +799,11 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_ /*Flush the last part*/ if(map_area.y1 != map_area.y2) { map_area.y2--; - lv_blend_map(clip_area, &map_area, color_buf, mask_buf, LV_DRAW_MASK_RES_CHANGED, opa, blend_mode); + _lv_blend_map(clip_area, &map_area, color_buf, mask_buf, LV_DRAW_MASK_RES_CHANGED, opa, blend_mode); } - lv_mem_buf_release(mask_buf); - lv_mem_buf_release(color_buf); + _lv_mem_buf_release(mask_buf); + _lv_mem_buf_release(color_buf); } diff --git a/src/lv_draw/lv_draw_line.c b/src/lv_draw/lv_draw_line.c index ec7dd2b9dd..e8b7c0477c 100644 --- a/src/lv_draw/lv_draw_line.c +++ b/src/lv_draw/lv_draw_line.c @@ -48,7 +48,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc) { - lv_memset_00(dsc, sizeof(lv_draw_line_dsc_t)); + _lv_memset_00(dsc, sizeof(lv_draw_line_dsc_t)); dsc->width = 1; dsc->opa = LV_OPA_COVER; dsc->color = LV_COLOR_BLACK; @@ -77,7 +77,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_line(const lv_point_t * point1, const lv_poin clip_line.y2 = LV_MATH_MAX(point1->y, point2->y) + dsc->width / 2; bool is_common; - is_common = lv_area_intersect(&clip_line, &clip_line, clip); + is_common = _lv_area_intersect(&clip_line, &clip_line, clip); if(!is_common) return; if(point1->y == point2->y) draw_line_hor(point1, point2, &clip_line, dsc); @@ -124,7 +124,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const { lv_opa_t opa = dsc->opa; - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_buf_t * vdb = lv_disp_get_buf(disp); const lv_area_t * disp_area = &vdb->area; @@ -147,7 +147,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const /*If there is no mask then simply draw a rectangle*/ if(simple_mode) { - lv_blend_fill(clip, &draw_area, + _lv_blend_fill(clip, &draw_area, dsc->color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->blend_mode); } @@ -156,7 +156,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const /* Get clipped fill area which is the real draw area. * It is always the same or inside `fill_area` */ bool is_common; - is_common = lv_area_intersect(&draw_area, clip, &draw_area); + is_common = _lv_area_intersect(&draw_area, clip, &draw_area); if(!is_common) return; /* Now `draw_area` has absolute coordinates. @@ -179,10 +179,10 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const dash_start = (vdb->area.x1 + draw_area.x1) % (dsc->dash_gap + dsc->dash_width); } - lv_opa_t * mask_buf = lv_mem_buf_get(draw_area_w); + lv_opa_t * mask_buf = _lv_mem_buf_get(draw_area_w); int32_t h; for(h = draw_area.y1; h <= draw_area.y2; h++) { - lv_memset_ff(mask_buf, draw_area_w); + _lv_memset_ff(mask_buf, draw_area_w); lv_draw_mask_res_t mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w); if(dashed) { @@ -207,14 +207,14 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const } } - lv_blend_fill(clip, &fill_area, + _lv_blend_fill(clip, &fill_area, dsc->color, mask_buf, mask_res, dsc->opa, dsc->blend_mode); fill_area.y1++; fill_area.y2++; } - lv_mem_buf_release(mask_buf); + _lv_mem_buf_release(mask_buf); } } @@ -225,7 +225,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const { lv_opa_t opa = dsc->opa; - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_buf_t * vdb = lv_disp_get_buf(disp); const lv_area_t * disp_area = &vdb->area; @@ -248,7 +248,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const /*If there is no mask then simply draw a rectangle*/ if(simple_mode) { - lv_blend_fill(clip, &draw_area, + _lv_blend_fill(clip, &draw_area, dsc->color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->blend_mode); } @@ -257,7 +257,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const /* Get clipped fill area which is the real draw area. * It is always the same or inside `fill_area` */ bool is_common; - is_common = lv_area_intersect(&draw_area, clip, &draw_area); + is_common = _lv_area_intersect(&draw_area, clip, &draw_area); if(!is_common) return; /* Now `draw_area` has absolute coordinates. @@ -275,7 +275,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const fill_area.y1 = draw_area.y1 + disp_area->y1; fill_area.y2 = fill_area.y1; - lv_opa_t * mask_buf = lv_mem_buf_get(draw_area_w); + lv_opa_t * mask_buf = _lv_mem_buf_get(draw_area_w); lv_style_int_t dash_start = 0; if(dashed) { @@ -286,7 +286,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const int32_t h; for(h = draw_area.y1; h <= draw_area.y2; h++) { - lv_memset_ff(mask_buf, draw_area_w); + _lv_memset_ff(mask_buf, draw_area_w); lv_draw_mask_res_t mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w); if(dashed) { @@ -302,14 +302,14 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const dash_cnt ++; } - lv_blend_fill(clip, &fill_area, + _lv_blend_fill(clip, &fill_area, dsc->color, mask_buf, mask_res, dsc->opa, LV_BLEND_MODE_NORMAL); fill_area.y1++; fill_area.y2++; } - lv_mem_buf_release(mask_buf); + _lv_mem_buf_release(mask_buf); } } @@ -364,7 +364,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons /* Get the union of `coords` and `clip`*/ /* `clip` is already truncated to the `vdb` size * in 'lv_refr_area' function */ - bool is_common = lv_area_intersect(&draw_area, &draw_area, clip); + bool is_common = _lv_area_intersect(&draw_area, &draw_area, clip); if(is_common == false) return; lv_draw_mask_line_param_t mask_left_param; @@ -407,7 +407,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons mask_bottom_id = lv_draw_mask_add(&mask_bottom_param, NULL); } - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_buf_t * vdb = lv_disp_get_buf(disp); const lv_area_t * disp_area = &vdb->area; @@ -426,7 +426,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons /*Draw the background line by line*/ int32_t h; size_t mask_buf_size = LV_MATH_MIN(lv_area_get_size(&draw_area), LV_HOR_RES_MAX); - lv_opa_t * mask_buf = lv_mem_buf_get(mask_buf_size); + lv_opa_t * mask_buf = _lv_mem_buf_get(mask_buf_size); lv_area_t fill_area; fill_area.x1 = draw_area.x1 + disp_area->x1; @@ -438,13 +438,13 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons uint32_t mask_p = 0; - lv_memset_ff(mask_buf, mask_buf_size); + _lv_memset_ff(mask_buf, mask_buf_size); /*Fill the first row with 'color'*/ for(h = draw_area.y1 + disp_area->y1; h <= draw_area.y2 + disp_area->y1; h++) { lv_draw_mask_res_t mask_res = lv_draw_mask_apply(&mask_buf[mask_p], x, h, draw_area_w); if(mask_res == LV_DRAW_MASK_RES_TRANSP) { - lv_memset_00(&mask_buf[mask_p], draw_area_w); + _lv_memset_00(&mask_buf[mask_p], draw_area_w); } mask_p += draw_area_w; @@ -452,27 +452,27 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons fill_area.y2 ++; } else { - lv_blend_fill(&fill_area, clip, + _lv_blend_fill(&fill_area, clip, dsc->color, mask_buf, LV_DRAW_MASK_RES_CHANGED, dsc->opa, dsc->blend_mode); fill_area.y1 = fill_area.y2 + 1; fill_area.y2 = fill_area.y1; mask_p = 0; - lv_memset_ff(mask_buf, mask_buf_size); + _lv_memset_ff(mask_buf, mask_buf_size); } } /*Flush the last part*/ if(fill_area.y1 != fill_area.y2) { fill_area.y2--; - lv_blend_fill(&fill_area, clip, + _lv_blend_fill(&fill_area, clip, dsc->color, mask_buf, LV_DRAW_MASK_RES_CHANGED, dsc->opa, dsc->blend_mode); } - lv_mem_buf_release(mask_buf); + _lv_mem_buf_release(mask_buf); lv_draw_mask_remove_id(mask_left_id); lv_draw_mask_remove_id(mask_right_id); diff --git a/src/lv_draw/lv_draw_mask.c b/src/lv_draw/lv_draw_mask.c index 750fe6e38a..e96accc947 100644 --- a/src/lv_draw/lv_draw_mask.c +++ b/src/lv_draw/lv_draw_mask.c @@ -194,7 +194,7 @@ LV_ATTRIBUTE_FAST_MEM uint8_t lv_draw_mask_get_cnt(void) void lv_draw_mask_line_points_init(lv_draw_mask_line_param_t * param, lv_coord_t p1x, lv_coord_t p1y, lv_coord_t p2x, lv_coord_t p2y, lv_draw_mask_line_side_t side) { - lv_memset_00(param, sizeof(lv_draw_mask_line_param_t)); + _lv_memset_00(param, sizeof(lv_draw_mask_line_param_t)); if(p1y > p2y) { lv_coord_t t; @@ -293,8 +293,8 @@ void lv_draw_mask_line_angle_init(lv_draw_mask_line_param_t * param, lv_coord_t int32_t p2x; int32_t p2y; - p2x = (lv_trigo_sin(angle + 90) >> 5) + p1x; - p2y = (lv_trigo_sin(angle) >> 5) + py; + p2x = (_lv_trigo_sin(angle + 90) >> 5) + p1x; + p2y = (_lv_trigo_sin(angle) >> 5) + py; lv_draw_mask_line_points_init(param, p1x, py, p2x, p2y, side); } @@ -465,7 +465,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mas else { int32_t k = - abs_x; if(k < 0) return LV_DRAW_MASK_RES_TRANSP; - if(k >= 0 && k < len) lv_memset_00(&mask_buf[k], len - k); + if(k >= 0 && k < len) _lv_memset_00(&mask_buf[k], len - k); return LV_DRAW_MASK_RES_CHANGED; } } @@ -475,7 +475,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mas int32_t k = - abs_x; if(k < 0) k = 0; if(k >= len) return LV_DRAW_MASK_RES_TRANSP; - else if(k >= 0 && k < len) lv_memset_00(&mask_buf[0], k); + else if(k >= 0 && k < len) _lv_memset_00(&mask_buf[0], k); return LV_DRAW_MASK_RES_CHANGED; } } @@ -594,7 +594,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_b return LV_DRAW_MASK_RES_TRANSP; } if(k >= 0) { - lv_memset_00(&mask_buf[0], k); + _lv_memset_00(&mask_buf[0], k); } } else { @@ -603,7 +603,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_b return LV_DRAW_MASK_RES_TRANSP; } if(k <= len) { - lv_memset_00(&mask_buf[k], len - k); + _lv_memset_00(&mask_buf[k], len - k); } } @@ -673,13 +673,13 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_ if(k >= len) { return LV_DRAW_MASK_RES_TRANSP; } - if(k >= 0) lv_memset_00(&mask_buf[0], k); + if(k >= 0) _lv_memset_00(&mask_buf[0], k); } else { if(k > len) k = len; if(k == 0) return LV_DRAW_MASK_RES_TRANSP; - else if(k > 0) lv_memset_00(&mask_buf[k], len - k); + else if(k > 0) _lv_memset_00(&mask_buf[k], len - k); } } @@ -708,12 +708,12 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_ k = xsi - abs_x - 1; if(k > len) k = len; - else if(k > 0) lv_memset_00(&mask_buf[0], k); + else if(k > 0) _lv_memset_00(&mask_buf[0], k); } else { if(k > len) return LV_DRAW_MASK_RES_FULL_COVER; - if(k >= 0) lv_memset_00(&mask_buf[k], len - k); + if(k >= 0) _lv_memset_00(&mask_buf[k], len - k); } } @@ -738,13 +738,13 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_ if(p->inv) { k = xsi - abs_x; if(k > len) return LV_DRAW_MASK_RES_TRANSP; - if(k >= 0) lv_memset_00(&mask_buf[0], k); + if(k >= 0) _lv_memset_00(&mask_buf[0], k); } else { if(k > len) k = len; if(k == 0) return LV_DRAW_MASK_RES_TRANSP; - else if(k > 0) lv_memset_00(&mask_buf[k], len - k); + else if(k > 0) _lv_memset_00(&mask_buf[k], len - k); } } } @@ -794,7 +794,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma if(tmp > 0) { res1 = lv_draw_mask_line(&mask_buf[0], abs_x, abs_y, tmp, &p->start_line); if(res1 == LV_DRAW_MASK_RES_TRANSP) { - lv_memset_00(&mask_buf[0], tmp); + _lv_memset_00(&mask_buf[0], tmp); } } @@ -802,7 +802,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma if(tmp < 0) tmp = 0; res2 = lv_draw_mask_line(&mask_buf[tmp], abs_x + tmp, abs_y, len - tmp, &p->end_line); if(res2 == LV_DRAW_MASK_RES_TRANSP) { - lv_memset_00(&mask_buf[tmp], len - tmp); + _lv_memset_00(&mask_buf[tmp], len - tmp); } if(res1 == res2) return res1; else return LV_DRAW_MASK_RES_CHANGED; @@ -836,7 +836,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma if(tmp > 0) { res1 = lv_draw_mask_line(&mask_buf[0], abs_x, abs_y, tmp, (lv_draw_mask_line_param_t *)&p->end_line); if(res1 == LV_DRAW_MASK_RES_TRANSP) { - lv_memset_00(&mask_buf[0], tmp); + _lv_memset_00(&mask_buf[0], tmp); } } @@ -844,7 +844,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma if(tmp < 0) tmp = 0; res2 = lv_draw_mask_line(&mask_buf[tmp], abs_x + tmp, abs_y, len - tmp, (lv_draw_mask_line_param_t *)&p->start_line); if(res2 == LV_DRAW_MASK_RES_TRANSP) { - lv_memset_00(&mask_buf[tmp], len - tmp); + _lv_memset_00(&mask_buf[tmp], len - tmp); } if(res1 == res2) return res1; else return LV_DRAW_MASK_RES_CHANGED; @@ -920,13 +920,13 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m int32_t last = rect.x1 - abs_x; if(last > len) return LV_DRAW_MASK_RES_TRANSP; if(last >= 0) { - lv_memset_00(&mask_buf[0], last); + _lv_memset_00(&mask_buf[0], last); } int32_t first = rect.x2 - abs_x + 1; if(first <= 0) return LV_DRAW_MASK_RES_TRANSP; else if(first < len) { - lv_memset_00(&mask_buf[first], len - first); + _lv_memset_00(&mask_buf[first], len - first); } if(last == 0 && first == len) return LV_DRAW_MASK_RES_FULL_COVER; else return LV_DRAW_MASK_RES_CHANGED; @@ -938,7 +938,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m int32_t last = rect.x2 - abs_x - first + 1; if(first + last > len) last = len - first; if(last >= 0) { - lv_memset_00(&mask_buf[first], last); + _lv_memset_00(&mask_buf[first], last); } } } @@ -976,9 +976,9 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m x0.i = p->y_prev_x.i; } else { - lv_sqrt(r2 - (y * y), &x0, sqrt_mask); + _lv_sqrt(r2 - (y * y), &x0, sqrt_mask); } - lv_sqrt(r2 - ((y - 1) * (y - 1)), &x1, sqrt_mask); + _lv_sqrt(r2 - ((y - 1) * (y - 1)), &x1, sqrt_mask); p->y_prev = y - 1; p->y_prev_x.f = x1.f; p->y_prev_x.i = x1.i; @@ -994,10 +994,10 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m x1.i = p->y_prev_x.i; } else { - lv_sqrt(r2 - ((y - 1) * (y - 1)), &x1, sqrt_mask); + _lv_sqrt(r2 - ((y - 1) * (y - 1)), &x1, sqrt_mask); } - lv_sqrt(r2 - (y * y), &x0, sqrt_mask); + _lv_sqrt(r2 - (y * y), &x0, sqrt_mask); p->y_prev = y; p->y_prev_x.f = x0.f; p->y_prev_x.i = x0.i; @@ -1036,13 +1036,13 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m return LV_DRAW_MASK_RES_TRANSP; } if(kl >= 0) { - lv_memset_00(&mask_buf[0], kl); + _lv_memset_00(&mask_buf[0], kl); } if(kr < 0) { return LV_DRAW_MASK_RES_TRANSP; } if(kr <= len) { - lv_memset_00(&mask_buf[kr], len - kr); + _lv_memset_00(&mask_buf[kr], len - kr); } } else { @@ -1053,7 +1053,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m int32_t len_tmp = kr - first; if(len_tmp + first > len) len_tmp = len - first; if(first < len && len_tmp >= 0) { - lv_memset_00(&mask_buf[first], len_tmp); + _lv_memset_00(&mask_buf[first], len_tmp); } } } @@ -1070,7 +1070,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m int32_t len_tmp = kr - first; if(len_tmp + first > len) len_tmp = len - first; if(first < len && len_tmp >= 0) { - lv_memset_00(&mask_buf[first], len_tmp); + _lv_memset_00(&mask_buf[first], len_tmp); } } @@ -1079,7 +1079,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m lv_sqrt_res_t y_prev; lv_sqrt_res_t y_next; - lv_sqrt(r2 - (x0.i * x0.i), &y_prev, sqrt_mask); + _lv_sqrt(r2 - (x0.i * x0.i), &y_prev, sqrt_mask); if(y_prev.f == 0) { y_prev.i--; @@ -1088,7 +1088,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m /*The first y intersection is special as it might be in the previous line*/ if(y_prev.i >= y) { - lv_sqrt(r2 - (i * i), &y_next, sqrt_mask); + _lv_sqrt(r2 - (i * i), &y_next, sqrt_mask); m = 255 - (((255 - x0.f) * (255 - y_next.f)) >> 9); if(outer) m = 255 - m; @@ -1131,12 +1131,12 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m if(kl > len) { return LV_DRAW_MASK_RES_TRANSP; } - if(kl >= 0) lv_memset_00(&mask_buf[0], kl); + if(kl >= 0) _lv_memset_00(&mask_buf[0], kl); if(kr < 0) { return LV_DRAW_MASK_RES_TRANSP; } - if(kr < len) lv_memset_00(&mask_buf[kr], len - kr); + if(kr < len) _lv_memset_00(&mask_buf[kr], len - kr); } } } diff --git a/src/lv_draw/lv_draw_rect.c b/src/lv_draw/lv_draw_rect.c index 06edd3e720..e40860bb9f 100644 --- a/src/lv_draw/lv_draw_rect.c +++ b/src/lv_draw/lv_draw_rect.c @@ -9,7 +9,6 @@ #include "lv_draw_rect.h" #include "lv_draw_blend.h" #include "lv_draw_mask.h" -#include "../lv_misc/lv_circ.h" #include "../lv_misc/lv_math.h" #include "../lv_core/lv_refr.h" #include "../lv_core/lv_debug.h" @@ -62,7 +61,7 @@ static void draw_value(const lv_area_t * coords, const lv_area_t * clip, lv_draw LV_ATTRIBUTE_FAST_MEM void lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc) { - lv_memset_00(dsc, sizeof(lv_draw_rect_dsc_t)); + _lv_memset_00(dsc, sizeof(lv_draw_rect_dsc_t)); dsc->bg_color = LV_COLOR_WHITE; dsc->bg_grad_color = LV_COLOR_BLACK; dsc->border_color = LV_COLOR_BLACK; @@ -159,14 +158,14 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are if(opa > LV_OPA_MAX) opa = LV_OPA_COVER; - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_buf_t * vdb = lv_disp_get_buf(disp); /* Get clipped fill area which is the real draw area. * It is always the same or inside `fill_area` */ lv_area_t draw_area; bool is_common; - is_common = lv_area_intersect(&draw_area, &coords_bg, clip); + is_common = _lv_area_intersect(&draw_area, &coords_bg, clip); if(is_common == false) return; const lv_area_t * disp_area = &vdb->area; @@ -181,7 +180,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are int32_t draw_area_w = lv_area_get_width(&draw_area); /*Create a mask if there is a radius*/ - lv_opa_t * mask_buf = lv_mem_buf_get(draw_area_w); + lv_opa_t * mask_buf = _lv_mem_buf_get(draw_area_w); uint16_t other_mask_cnt = lv_draw_mask_get_cnt(); bool simple_mode = true; @@ -200,7 +199,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are /*Most simple case: just a plain rectangle*/ if(simple_mode && rout == 0 && (dsc->bg_grad_dir == LV_GRAD_DIR_NONE)) { - lv_blend_fill(clip, &coords_bg, + _lv_blend_fill(clip, &coords_bg, dsc->bg_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode); } @@ -221,7 +220,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are lv_color_t * grad_map = NULL; /*In case of horizontal gradient pre-compute a line with a gradient*/ if(dsc->bg_grad_dir == LV_GRAD_DIR_HOR && dsc->bg_color.full != dsc->bg_grad_color.full) { - grad_map = lv_mem_buf_get(coords_w * sizeof(lv_color_t)); + grad_map = _lv_mem_buf_get(coords_w * sizeof(lv_color_t)); int32_t i; for(i = 0; i < coords_w; i++) { @@ -245,13 +244,13 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are y < coords_bg.y2 - rout - 1) { mask_res = LV_DRAW_MASK_RES_FULL_COVER; if(simple_mode == false) { - lv_memset_ff(mask_buf, draw_area_w); + _lv_memset_ff(mask_buf, draw_area_w); mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w); } } /*In corner areas apply the mask anyway*/ else { - lv_memset_ff(mask_buf, draw_area_w); + _lv_memset_ff(mask_buf, draw_area_w); mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w); } @@ -273,14 +272,14 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are fill_area2.y1 = fill_area.y1; fill_area2.y2 = fill_area.y2; - lv_blend_fill(clip, &fill_area2, + _lv_blend_fill(clip, &fill_area2, grad_color, mask_buf, mask_res, opa, dsc->bg_blend_mode); /*Center part*/ if(dsc->bg_grad_dir == LV_GRAD_DIR_VER) { fill_area2.x1 = coords_bg.x1 + rout; fill_area2.x2 = coords_bg.x2 - rout; - lv_blend_fill(clip, &fill_area2, + _lv_blend_fill(clip, &fill_area2, grad_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode); } @@ -290,21 +289,21 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are int32_t mask_ofs = (coords_bg.x2 - rout + 1) - (vdb->area.x1 + draw_area.x1); if(mask_ofs < 0) mask_ofs = 0; - lv_blend_fill(clip, &fill_area2, + _lv_blend_fill(clip, &fill_area2, grad_color, mask_buf + mask_ofs, mask_res, opa, dsc->bg_blend_mode); } else { if(dsc->bg_grad_dir == LV_GRAD_DIR_HOR) { - lv_blend_map(clip, &fill_area, grad_map, mask_buf, mask_res, opa, dsc->bg_blend_mode); + _lv_blend_map(clip, &fill_area, grad_map, mask_buf, mask_res, opa, dsc->bg_blend_mode); } else if(dsc->bg_grad_dir == LV_GRAD_DIR_VER) { - lv_blend_fill(clip, &fill_area, + _lv_blend_fill(clip, &fill_area, grad_color, mask_buf, mask_res, opa, dsc->bg_blend_mode); } else if(other_mask_cnt != 0 || !split) { - lv_blend_fill(clip, &fill_area, + _lv_blend_fill(clip, &fill_area, grad_color, mask_buf, mask_res, opa, dsc->bg_blend_mode); } } @@ -319,7 +318,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are fill_area.y1 = coords_bg.y1; fill_area.y2 = coords_bg.y1 + rout; - lv_blend_fill(clip, &fill_area, + _lv_blend_fill(clip, &fill_area, dsc->bg_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode); fill_area.y1 = coords_bg.y2 - rout; @@ -327,7 +326,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are fill_area.y2 = coords_bg.y2; - lv_blend_fill(clip, &fill_area, + _lv_blend_fill(clip, &fill_area, dsc->bg_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode); fill_area.x1 = coords_bg.x1; @@ -335,17 +334,17 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are fill_area.y1 = coords_bg.y1 + rout + 1; fill_area.y2 = coords_bg.y2 - rout - 1; - lv_blend_fill(clip, &fill_area, + _lv_blend_fill(clip, &fill_area, dsc->bg_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode); } - if(grad_map) lv_mem_buf_release(grad_map); + if(grad_map) _lv_mem_buf_release(grad_map); } lv_draw_mask_remove_id(mask_rout_id); - lv_mem_buf_release(mask_buf); + _lv_mem_buf_release(mask_buf); } @@ -360,14 +359,14 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv if(opa > LV_OPA_MAX) opa = LV_OPA_COVER; - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_buf_t * vdb = lv_disp_get_buf(disp); /* Get clipped fill area which is the real draw area. * It is always the same or inside `fill_area` */ lv_area_t draw_area; bool is_common; - is_common = lv_area_intersect(&draw_area, coords, clip); + is_common = _lv_area_intersect(&draw_area, coords, clip); if(is_common == false) return; const lv_area_t * disp_area = &vdb->area; @@ -382,7 +381,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv int32_t draw_area_w = lv_area_get_width(&draw_area); /*Create a mask if there is a radius*/ - lv_opa_t * mask_buf = lv_mem_buf_get(draw_area_w); + lv_opa_t * mask_buf = _lv_mem_buf_get(draw_area_w); uint8_t other_mask_cnt = lv_draw_mask_get_cnt(); bool simple_mode = true; @@ -442,7 +441,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv fill_area.y1 = disp_area->y1 + draw_area.y1; fill_area.y2 = fill_area.y1; for(h = draw_area.y1; h <= upper_corner_end; h++) { - lv_memset_ff(mask_buf, draw_area_w); + _lv_memset_ff(mask_buf, draw_area_w); mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w); lv_area_t fill_area2; @@ -452,14 +451,14 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv fill_area2.x1 = coords->x1; fill_area2.x2 = coords->x1 + rout - 1; - lv_blend_fill(clip, &fill_area2, color, mask_buf, mask_res, opa, blend_mode); + _lv_blend_fill(clip, &fill_area2, color, mask_buf, mask_res, opa, blend_mode); /*Draw the top horizontal line*/ if(fill_area2.y2 < coords->y1 + dsc->border_width) { fill_area2.x1 = coords->x1 + rout; fill_area2.x2 = coords->x2 - rout; - lv_blend_fill(clip, &fill_area2, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); + _lv_blend_fill(clip, &fill_area2, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); } fill_area2.x1 = coords->x2 - rout + 1; @@ -467,7 +466,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv int32_t mask_ofs = (coords->x2 - rout + 1) - (vdb->area.x1 + draw_area.x1); if(mask_ofs < 0) mask_ofs = 0; - lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode); + _lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode); fill_area.y1++; fill_area.y2++; @@ -480,7 +479,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv fill_area.y1 = disp_area->y1 + lower_corner_end; fill_area.y2 = fill_area.y1; for(h = lower_corner_end; h <= draw_area.y2; h++) { - lv_memset_ff(mask_buf, draw_area_w); + _lv_memset_ff(mask_buf, draw_area_w); mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w); lv_area_t fill_area2; @@ -489,21 +488,21 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv fill_area2.y1 = fill_area.y1; fill_area2.y2 = fill_area.y2; - lv_blend_fill(clip, &fill_area2, color, mask_buf, mask_res, opa, blend_mode); + _lv_blend_fill(clip, &fill_area2, color, mask_buf, mask_res, opa, blend_mode); /*Draw the bottom horizontal line*/ if(fill_area2.y2 > coords->y2 - dsc->border_width) { fill_area2.x1 = coords->x1 + rout; fill_area2.x2 = coords->x2 - rout; - lv_blend_fill(clip, &fill_area2, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); + _lv_blend_fill(clip, &fill_area2, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); } fill_area2.x1 = coords->x2 - rout + 1; fill_area2.x2 = coords->x2; int32_t mask_ofs = (coords->x2 - rout + 1) - (vdb->area.x1 + draw_area.x1); if(mask_ofs < 0) mask_ofs = 0; - lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode); + _lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode); fill_area.y1++; @@ -516,13 +515,13 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv fill_area.x1 = coords->x1; fill_area.x2 = coords->x1 + dsc->border_width - 1; - lv_blend_fill(clip, &fill_area, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); + _lv_blend_fill(clip, &fill_area, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); /*Draw the right vertical border*/ fill_area.x1 = coords->x2 - dsc->border_width + 1; fill_area.x2 = coords->x2; - lv_blend_fill(clip, &fill_area, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); + _lv_blend_fill(clip, &fill_area, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); } /*Process line by line if there is other mask too*/ else { @@ -549,9 +548,9 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv if(normal || (top_only && fill_area.y1 <= coords->y1 + corner_size) || (bottom_only && fill_area.y1 >= coords->y2 - corner_size)) { - lv_memset_ff(mask_buf, draw_area_w); + _lv_memset_ff(mask_buf, draw_area_w); mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w); - lv_blend_fill(clip, &fill_area, color, mask_buf, mask_res, opa, blend_mode); + _lv_blend_fill(clip, &fill_area, color, mask_buf, mask_res, opa, blend_mode); } fill_area.y1++; fill_area.y2++; @@ -560,7 +559,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv } lv_draw_mask_remove_id(mask_rin_id); lv_draw_mask_remove_id(mask_rout_id); - lv_mem_buf_release(mask_buf); + _lv_mem_buf_release(mask_buf); } LV_ATTRIBUTE_FAST_MEM static inline lv_color_t grad_get(lv_draw_rect_dsc_t * dsc, lv_coord_t s, lv_coord_t i) @@ -609,14 +608,14 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv if(opa > LV_OPA_MAX) opa = LV_OPA_COVER; - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_buf_t * vdb = lv_disp_get_buf(disp); /* Get clipped fill area which is the real draw area. * It is always the same or inside `fill_area` */ lv_area_t draw_area; bool is_common; - is_common = lv_area_intersect(&draw_area, &sh_area, clip); + is_common = _lv_area_intersect(&draw_area, &sh_area, clip); if(is_common == false) return; const lv_area_t * disp_area = &vdb->area; @@ -654,7 +653,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv if(sh_cache_size == corner_size && sh_cache_r == r_sh) { /*Use the cache if available*/ sh_buf = lv_mem_buf_get(corner_size * corner_size); - lv_memcpy(sh_buf, sh_cache, corner_size * corner_size); + _lv_memcpy(sh_buf, sh_cache, corner_size * corner_size); } else { /*A larger buffer is required for calculation */ @@ -663,13 +662,13 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv /*Cache the corner if it fits into the cache size*/ if(corner_size * corner_size < sizeof(sh_cache)) { - lv_memcpy(sh_cache, sh_buf, corner_size * corner_size); + _lv_memcpy(sh_cache, sh_buf, corner_size * corner_size); sh_cache_size = corner_size; sh_cache_r = r_sh; } } #else - sh_buf = lv_mem_buf_get(corner_size * corner_size * sizeof(uint16_t)); + sh_buf = _lv_mem_buf_get(corner_size * corner_size * sizeof(uint16_t)); shadow_draw_corner_buf(&sh_rect_area, (uint16_t *)sh_buf, dsc->shadow_width, r_sh); #endif @@ -683,7 +682,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv /*Create a mask*/ lv_draw_mask_res_t mask_res; - lv_opa_t * mask_buf = lv_mem_buf_get(lv_area_get_width(&sh_area)); + lv_opa_t * mask_buf = _lv_mem_buf_get(lv_area_get_width(&sh_area)); lv_draw_mask_radius_param_t mask_rout_param; lv_draw_mask_radius_init(&mask_rout_param, &bg_coords, r_bg, true); @@ -701,7 +700,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv a.y2 = a.y1 + corner_size - 1; lv_area_t ca; - bool has_com = lv_area_intersect(&ca, &a, clip); + bool has_com = _lv_area_intersect(&ca, &a, clip); if(has_com) { /*Avoid overlap in the middle with large radius*/ if(ca.y2 > h_half) ca.y2 = h_half; @@ -718,11 +717,11 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv fa.y2 = fa.y1; for(y = 0; y < h; y++) { - lv_memcpy(mask_buf, sh_buf_tmp, w); + _lv_memcpy(mask_buf, sh_buf_tmp, w); mask_res = lv_draw_mask_apply(mask_buf, fa.x1, fa.y1, w); if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask_res = LV_DRAW_MASK_RES_CHANGED; - lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, + _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, mask_res, opa, dsc->shadow_blend_mode); fa.y1++; fa.y2++; @@ -737,7 +736,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv a.y1 = sh_area.y2 - corner_size + 1; a.y2 = sh_area.y2; - has_com = lv_area_intersect(&ca, &a, clip); + has_com = _lv_area_intersect(&ca, &a, clip); if(has_com) { /*Avoid overlap in the middle with large radius*/ if(ca.y1 <= h_half) ca.y1 = h_half + 1; @@ -755,11 +754,11 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv fa.y1 = fa.y2; /*Fill from bottom to top*/ for(y = 0; y < h; y++) { - lv_memcpy(mask_buf, sh_buf_tmp, w); + _lv_memcpy(mask_buf, sh_buf_tmp, w); mask_res = lv_draw_mask_apply(mask_buf, fa.x1, fa.y1, w); if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask_res = LV_DRAW_MASK_RES_CHANGED; - lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, + _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, mask_res, opa, dsc->shadow_blend_mode); fa.y1--; fa.y2--; @@ -774,7 +773,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv a.y1 = sh_area.y1 + corner_size; a.y2 = sh_area.y2 - corner_size; - has_com = lv_area_intersect(&ca, &a, clip); + has_com = _lv_area_intersect(&ca, &a, clip); if(has_com) { if(simple_mode) ca.x1 = LV_MATH_MAX(ca.x1, coords->x2); /*Draw horizontal lines*/ @@ -791,7 +790,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv fa.y2 = fa.y1; mask_res = LV_DRAW_MASK_RES_FULL_COVER; for(y = 0; y < h; y++) { - lv_memcpy(mask_buf, sh_buf_tmp, w); + _lv_memcpy(mask_buf, sh_buf_tmp, w); if(simple_mode) { mask_res = LV_DRAW_MASK_RES_CHANGED; @@ -801,7 +800,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask_res = LV_DRAW_MASK_RES_CHANGED; } - lv_blend_fill(clip, &fa, + _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, mask_res, dsc->shadow_opa, dsc->shadow_blend_mode); fa.y1++; fa.y2++; @@ -827,7 +826,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv a.y1 = sh_area.y1; a.y2 = a.y1 + corner_size - 1; - has_com = lv_area_intersect(&ca, &a, clip); + has_com = _lv_area_intersect(&ca, &a, clip); if(has_com) { /*Avoid overlap in the middle with large radius*/ if(ca.y2 > h_half) ca.y2 = h_half; @@ -844,11 +843,11 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv fa.y2 = fa.y1; for(y = 0; y < h; y++) { - lv_memcpy(mask_buf, sh_buf_tmp, w); + _lv_memcpy(mask_buf, sh_buf_tmp, w); mask_res = lv_draw_mask_apply(mask_buf, fa.x1, fa.y1, w); if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask_res = LV_DRAW_MASK_RES_CHANGED; - lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, + _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, mask_res, opa, dsc->shadow_blend_mode); fa.y1++; fa.y2++; @@ -863,7 +862,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv a.y1 = sh_area.y2 - corner_size + 1; a.y2 = sh_area.y2; - has_com = lv_area_intersect(&ca, &a, clip); + has_com = _lv_area_intersect(&ca, &a, clip); if(has_com) { /*Avoid overlap in the middle with large radius*/ if(ca.y1 <= h_half) ca.y1 = h_half + 1; @@ -880,11 +879,11 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv fa.y1 = fa.y2; /*Fill from bottom to top*/ for(y = 0; y < h; y++) { - lv_memcpy(mask_buf, sh_buf_tmp, w); + _lv_memcpy(mask_buf, sh_buf_tmp, w); mask_res = lv_draw_mask_apply(mask_buf, fa.x1, fa.y1, w); if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask_res = LV_DRAW_MASK_RES_CHANGED; - lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, + _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, mask_res, opa, dsc->shadow_blend_mode); fa.y1--; fa.y2--; @@ -899,7 +898,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv a.y1 = sh_area.y1 + corner_size; a.y2 = sh_area.y2 - corner_size; - has_com = lv_area_intersect(&ca, &a, clip); + has_com = _lv_area_intersect(&ca, &a, clip); if(has_com) { if(simple_mode) ca.x2 = LV_MATH_MIN(coords->x1, ca.x2); @@ -915,7 +914,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv lv_area_copy(&fa, &ca); fa.y2 = fa.y1; for(y = 0; y < h; y++) { - lv_memcpy(mask_buf, sh_buf_tmp, w); + _lv_memcpy(mask_buf, sh_buf_tmp, w); if(simple_mode) { mask_res = LV_DRAW_MASK_RES_CHANGED; } @@ -924,7 +923,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask_res = LV_DRAW_MASK_RES_CHANGED; } - lv_blend_fill(clip, &fa, + _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, mask_res, dsc->shadow_opa, dsc->shadow_blend_mode); fa.y1++; fa.y2++; @@ -938,7 +937,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv a.y1 = sh_area.y1; a.y2 = sh_area.y1 + corner_size - 1; - has_com = lv_area_intersect(&ca, &a, clip); + has_com = _lv_area_intersect(&ca, &a, clip); if(has_com) { if(simple_mode) ca.y2 = LV_MATH_MIN(ca.y2, coords->y1); /*Draw horizontal lines*/ @@ -955,7 +954,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv lv_opa_t opa_tmp = sh_buf_tmp[0]; if(opa_tmp != LV_OPA_COVER || opa != LV_OPA_COVER) opa_tmp = (opa * opa_tmp) >> 8; - lv_memset(mask_buf, opa_tmp, w); + _lv_memset(mask_buf, opa_tmp, w); if(simple_mode) { mask_res = LV_DRAW_MASK_RES_CHANGED; @@ -965,7 +964,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask_res = LV_DRAW_MASK_RES_CHANGED; } - lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, + _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, mask_res, LV_OPA_COVER, dsc->shadow_blend_mode); fa.y1++; fa.y2++; @@ -980,7 +979,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv a.y1 = sh_area.y2 - corner_size + 1; a.y2 = sh_area.y2; - has_com = lv_area_intersect(&ca, &a, clip); + has_com = _lv_area_intersect(&ca, &a, clip); if(has_com) { if(simple_mode) ca.y1 = LV_MATH_MAX(ca.y1, coords->y2); /*Draw horizontal lines*/ @@ -996,7 +995,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv lv_opa_t opa_tmp = sh_buf_tmp[0]; if(opa_tmp != LV_OPA_COVER || opa != LV_OPA_COVER) opa_tmp = (opa * opa_tmp) >> 8; - lv_memset(mask_buf, opa_tmp, w); + _lv_memset(mask_buf, opa_tmp, w); if(simple_mode) { mask_res = LV_DRAW_MASK_RES_CHANGED; } @@ -1005,7 +1004,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask_res = LV_DRAW_MASK_RES_CHANGED; } - lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, + _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, mask_res, LV_OPA_COVER, dsc->shadow_blend_mode); fa.y1--; fa.y2--; @@ -1019,7 +1018,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv a.y1 = sh_area.y1 + corner_size; a.y2 = sh_area.y2 - corner_size; - has_com = lv_area_intersect(&ca, &a, clip); + has_com = _lv_area_intersect(&ca, &a, clip); if(has_com && simple_mode == false) { /*Draw horizontal lines*/ lv_coord_t w = lv_area_get_width(&ca); @@ -1029,11 +1028,11 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv lv_area_copy(&fa, &ca); fa.y2 = fa.y1; for(y = 0; y < h; y++) { - lv_memset(mask_buf, dsc->shadow_opa, w); + _lv_memset(mask_buf, dsc->shadow_opa, w); mask_res = lv_draw_mask_apply(mask_buf, fa.x1, fa.y1, w); if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask_res = LV_DRAW_MASK_RES_CHANGED; - lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, + _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, mask_res, LV_OPA_COVER, dsc->shadow_blend_mode); fa.y1++; fa.y2++; @@ -1041,8 +1040,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv } lv_draw_mask_remove_id(mask_rout_id); - lv_mem_buf_release(mask_buf); - lv_mem_buf_release(sh_buf); + _lv_mem_buf_release(mask_buf); + _lv_mem_buf_release(sh_buf); } /** @@ -1076,13 +1075,13 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord #endif int32_t y; - lv_opa_t * mask_line = lv_mem_buf_get(size); + lv_opa_t * mask_line = _lv_mem_buf_get(size); uint16_t * sh_ups_tmp_buf = (uint16_t *)sh_buf; for(y = 0; y < size; y++) { - lv_memset_ff(mask_line, size); + _lv_memset_ff(mask_line, size); lv_draw_mask_res_t mask_res = mask_param.dsc.cb(mask_line, 0, y, size, &mask_param); if(mask_res == LV_DRAW_MASK_RES_TRANSP) { - lv_memset_00(sh_ups_tmp_buf, size * sizeof(sh_ups_tmp_buf[0])); + _lv_memset_00(sh_ups_tmp_buf, size * sizeof(sh_ups_tmp_buf[0])); } else { int32_t i; @@ -1095,7 +1094,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord sh_ups_tmp_buf += size; } - lv_mem_buf_release(mask_line); + _lv_mem_buf_release(mask_line); if(sw == 1) { uint32_t i; @@ -1143,7 +1142,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t if((sw & 1) == 0) s_left--; /*Horizontal blur*/ - uint16_t * sh_ups_blur_buf = lv_mem_buf_get(size * sizeof(uint16_t)); + uint16_t * sh_ups_blur_buf = _lv_mem_buf_get(size * sizeof(uint16_t)); int32_t x; int32_t y; @@ -1166,7 +1165,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t else left_val = sh_ups_tmp_buf[x - s_left - 1]; v += left_val; } - lv_memcpy(sh_ups_tmp_buf, sh_ups_blur_buf, size * sizeof(uint16_t)); + _lv_memcpy(sh_ups_tmp_buf, sh_ups_blur_buf, size * sizeof(uint16_t)); sh_ups_tmp_buf += size; } @@ -1204,7 +1203,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t } } - lv_mem_buf_release(sh_ups_blur_buf); + _lv_mem_buf_release(sh_ups_blur_buf); } #endif @@ -1253,14 +1252,14 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_dr short_side = LV_MATH_MIN(coords_out_w, coords_out_h); if(rout > short_side >> 1) rout = short_side >> 1; - lv_disp_t * disp = lv_refr_get_disp_refreshing(); + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_buf_t * vdb = lv_disp_get_buf(disp); /* Get clipped fill area which is the real draw area. * It is always the same or inside `fill_area` */ lv_area_t draw_area; bool is_common; - is_common = lv_area_intersect(&draw_area, &area_outer, clip); + is_common = _lv_area_intersect(&draw_area, &area_outer, clip); if(is_common == false) return; const lv_area_t * disp_area = &vdb->area; @@ -1283,7 +1282,7 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_dr lv_draw_mask_radius_init(&mask_rout_param, &area_outer, rout, false); int16_t mask_rout_id = lv_draw_mask_add(&mask_rout_param, NULL); - lv_opa_t * mask_buf = lv_mem_buf_get(draw_area_w); + lv_opa_t * mask_buf = _lv_mem_buf_get(draw_area_w); int32_t corner_size = LV_MATH_MAX(rout, dsc->outline_width - 1); @@ -1304,7 +1303,7 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_dr fill_area.y1 = disp_area->y1 + draw_area.y1; fill_area.y2 = fill_area.y1; for(h = draw_area.y1; h <= upper_corner_end; h++) { - lv_memset_ff(mask_buf, draw_area_w); + _lv_memset_ff(mask_buf, draw_area_w); mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w); lv_area_t fill_area2; @@ -1314,14 +1313,14 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_dr fill_area2.x1 = area_outer.x1; fill_area2.x2 = area_outer.x1 + rout - 1; - lv_blend_fill(clip, &fill_area2, color, mask_buf, mask_res, opa, blend_mode); + _lv_blend_fill(clip, &fill_area2, color, mask_buf, mask_res, opa, blend_mode); /*Draw the top horizontal line*/ if(fill_area2.y2 < area_outer.y1 + dsc->outline_width) { fill_area2.x1 = area_outer.x1 + rout; fill_area2.x2 = area_outer.x2 - rout; - lv_blend_fill(clip, &fill_area2, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); + _lv_blend_fill(clip, &fill_area2, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); } fill_area2.x1 = area_outer.x2 - rout + 1; @@ -1329,7 +1328,7 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_dr int32_t mask_ofs = (area_outer.x2 - rout + 1) - (vdb->area.x1 + draw_area.x1); if(mask_ofs < 0) mask_ofs = 0; - lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode); + _lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode); fill_area.y1++; fill_area.y2++; @@ -1341,7 +1340,7 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_dr fill_area.y1 = disp_area->y1 + lower_corner_end; fill_area.y2 = fill_area.y1; for(h = lower_corner_end; h <= draw_area.y2; h++) { - lv_memset_ff(mask_buf, draw_area_w); + _lv_memset_ff(mask_buf, draw_area_w); mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w); lv_area_t fill_area2; @@ -1350,21 +1349,21 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_dr fill_area2.y1 = fill_area.y1; fill_area2.y2 = fill_area.y2; - lv_blend_fill(clip, &fill_area2, color, mask_buf, mask_res, opa, blend_mode); + _lv_blend_fill(clip, &fill_area2, color, mask_buf, mask_res, opa, blend_mode); /*Draw the bottom horizontal line*/ if(fill_area2.y2 > area_outer.y2 - dsc->outline_width) { fill_area2.x1 = area_outer.x1 + rout; fill_area2.x2 = area_outer.x2 - rout; - lv_blend_fill(clip, &fill_area2, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); + _lv_blend_fill(clip, &fill_area2, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); } fill_area2.x1 = area_outer.x2 - rout + 1; fill_area2.x2 = area_outer.x2; int32_t mask_ofs = (area_outer.x2 - rout + 1) - (vdb->area.x1 + draw_area.x1); if(mask_ofs < 0) mask_ofs = 0; - lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode); + _lv_blend_fill(clip, &fill_area2, color, mask_buf + mask_ofs, mask_res, opa, blend_mode); fill_area.y1++; @@ -1377,13 +1376,13 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_dr fill_area.x1 = area_outer.x1; fill_area.x2 = area_outer.x1 + dsc->outline_width - 1; - lv_blend_fill(clip, &fill_area, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); + _lv_blend_fill(clip, &fill_area, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); /*Draw the right vertical border*/ fill_area.x1 = area_outer.x2 - dsc->outline_width + 1; fill_area.x2 = area_outer.x2; - lv_blend_fill(clip, &fill_area, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); + _lv_blend_fill(clip, &fill_area, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, blend_mode); } /*Process line by line if there is other mask too*/ else { @@ -1393,10 +1392,10 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_dr fill_area.y2 = fill_area.y1; for(h = draw_area.y1; h <= draw_area.y2; h++) { - lv_memset_ff(mask_buf, draw_area_w); + _lv_memset_ff(mask_buf, draw_area_w); mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w); - lv_blend_fill(clip, &fill_area, color, mask_buf, mask_res, opa, blend_mode); + _lv_blend_fill(clip, &fill_area, color, mask_buf, mask_res, opa, blend_mode); fill_area.y1++; fill_area.y2++; @@ -1404,7 +1403,7 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_dr } lv_draw_mask_remove_id(mask_rin_id); lv_draw_mask_remove_id(mask_rout_id); - lv_mem_buf_release(mask_buf); + _lv_mem_buf_release(mask_buf); } static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc) @@ -1441,7 +1440,7 @@ static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, lv_dr label_dsc.font = dsc->pattern_font; label_dsc.opa = dsc->pattern_opa; lv_point_t s; - lv_txt_get_size(&s, dsc->pattern_image, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, + _lv_txt_get_size(&s, dsc->pattern_image, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, LV_TXT_FLAG_NONE); img_w = s.x; img_h = s.y; @@ -1495,7 +1494,7 @@ static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, lv_dr } int16_t radius_mask_id = LV_MASK_ID_INV; - if(lv_area_is_in(&coords_tmp, coords, dsc->radius) == false) { + if(_lv_area_is_in(&coords_tmp, coords, dsc->radius) == false) { lv_draw_mask_radius_param_t radius_mask_param; lv_draw_mask_radius_init(&radius_mask_param, coords, dsc->radius, false); radius_mask_id = lv_draw_mask_add(&radius_mask_param, NULL); @@ -1515,7 +1514,7 @@ static void draw_value(const lv_area_t * coords, const lv_area_t * clip, lv_draw if(dsc->value_opa <= LV_OPA_MIN) return; lv_point_t s; - lv_txt_get_size(&s, dsc->value_str, dsc->value_font, dsc->value_letter_space, dsc->value_line_space, LV_COORD_MAX, + _lv_txt_get_size(&s, dsc->value_str, dsc->value_font, dsc->value_letter_space, dsc->value_line_space, LV_COORD_MAX, LV_TXT_FLAG_NONE); lv_area_t value_area; @@ -1525,7 +1524,7 @@ static void draw_value(const lv_area_t * coords, const lv_area_t * clip, lv_draw value_area.y2 = s.y - 1; lv_point_t p_align; - lv_area_align(coords, &value_area, dsc->value_align, &p_align); + _lv_area_align(coords, &value_area, dsc->value_align, &p_align); value_area.x1 += p_align.x + dsc->value_ofs_x; value_area.y1 += p_align.y + dsc->value_ofs_y; diff --git a/src/lv_draw/lv_draw_triangle.c b/src/lv_draw/lv_draw_triangle.c index e52bc39138..72a4a7fe2e 100644 --- a/src/lv_draw/lv_draw_triangle.c +++ b/src/lv_draw/lv_draw_triangle.c @@ -71,7 +71,7 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are bool is_common; lv_area_t poly_mask; - is_common = lv_area_intersect(&poly_mask, &poly_coords, clip_area); + is_common = _lv_area_intersect(&poly_mask, &poly_coords, clip_area); if(!is_common) return; /*Find the lowest point*/ @@ -85,7 +85,7 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are } } - lv_draw_mask_line_param_t * mp = lv_mem_buf_get(sizeof(lv_draw_mask_line_param_t) * point_cnt); + lv_draw_mask_line_param_t * mp = _lv_mem_buf_get(sizeof(lv_draw_mask_line_param_t) * point_cnt); lv_draw_mask_line_param_t * mp_next = mp; int32_t i_prev_left = y_min_i; @@ -156,7 +156,7 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are lv_draw_mask_remove_custom(mp); - lv_mem_buf_release(mp); + _lv_mem_buf_release(mp); } diff --git a/src/lv_draw/lv_img_buf.c b/src/lv_draw/lv_img_buf.c index 3ae690e4be..2ed66556e8 100644 --- a/src/lv_draw/lv_img_buf.c +++ b/src/lv_draw/lv_img_buf.c @@ -58,7 +58,7 @@ lv_color_t lv_img_buf_get_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t dsc->header.cf == LV_IMG_CF_TRUE_COLOR_ALPHA) { uint8_t px_size = lv_img_cf_get_px_size(dsc->header.cf) >> 3; uint32_t px = dsc->header.w * y * px_size + x * px_size; - lv_memcpy_small(&p_color, &buf_u8[px], sizeof(lv_color_t)); + _lv_memcpy_small(&p_color, &buf_u8[px], sizeof(lv_color_t)); #if LV_COLOR_SIZE == 32 p_color.ch.alpha = 0xFF; /*Only the color should be get so use a deafult alpha value*/ #endif @@ -245,12 +245,12 @@ void lv_img_buf_set_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_ if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR || dsc->header.cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) { uint8_t px_size = lv_img_cf_get_px_size(dsc->header.cf) >> 3; uint32_t px = dsc->header.w * y * px_size + x * px_size; - lv_memcpy_small(&buf_u8[px], &c, px_size); + _lv_memcpy_small(&buf_u8[px], &c, px_size); } else if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR_ALPHA) { uint8_t px_size = lv_img_cf_get_px_size(dsc->header.cf) >> 3; uint32_t px = dsc->header.w * y * px_size + x * px_size; - lv_memcpy_small(&buf_u8[px], &c, px_size - 1); /*-1 to not overwrite the alpha value*/ + _lv_memcpy_small(&buf_u8[px], &c, px_size - 1); /*-1 to not overwrite the alpha value*/ } else if(dsc->header.cf == LV_IMG_CF_INDEXED_1BIT) { buf_u8 += sizeof(lv_color32_t) * 2; /*Skip the palette*/ @@ -318,7 +318,7 @@ void lv_img_buf_set_palette(lv_img_dsc_t * dsc, uint8_t id, lv_color_t c) lv_color32_t c32; c32.full = lv_color_to32(c); uint8_t * buf = (uint8_t *)dsc->data; - lv_memcpy_small(&buf[id * sizeof(c32)], &c32, sizeof(c32)); + _lv_memcpy_small(&buf[id * sizeof(c32)], &c32, sizeof(c32)); } /** @@ -335,7 +335,7 @@ lv_img_dsc_t * lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf) if(dsc == NULL) return NULL; - lv_memset_00(dsc, sizeof(lv_img_dsc_t)); + _lv_memset_00(dsc, sizeof(lv_img_dsc_t)); /* Get image data size */ dsc->data_size = lv_img_buf_get_img_size(w, h, cf); @@ -350,7 +350,7 @@ lv_img_dsc_t * lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf) lv_mem_free(dsc); return NULL; } - lv_memset_00((uint8_t *)dsc->data, dsc->data_size); + _lv_memset_00((uint8_t *)dsc->data, dsc->data_size); /* Fill in header */ dsc->header.always_zero = 0; @@ -417,7 +417,7 @@ uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf) * Initialize a descriptor to tranform an image * @param dsc pointer to an `lv_img_transform_dsc_t` variable whose `cfg` field is initialized */ -void lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc) +void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc) { dsc->tmp.pivot_x_256 = dsc->cfg.pivot_x * 256; dsc->tmp.pivot_y_256 = dsc->cfg.pivot_y * 256; @@ -426,11 +426,11 @@ void lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc) int32_t angle_hight = angle_low + 1; int32_t angle_rem = dsc->cfg.angle - (angle_low * 10); - int32_t s1 = lv_trigo_sin(-angle_low); - int32_t s2 = lv_trigo_sin(-angle_hight); + int32_t s1 = _lv_trigo_sin(-angle_low); + int32_t s2 = _lv_trigo_sin(-angle_hight); - int32_t c1 = lv_trigo_sin(-angle_low + 90); - int32_t c2 = lv_trigo_sin(-angle_hight + 90); + int32_t c1 = _lv_trigo_sin(-angle_low + 90); + int32_t c2 = _lv_trigo_sin(-angle_hight + 90); dsc->tmp.sinma = (s1 * (10 - angle_rem) + s2 * angle_rem) / 10; dsc->tmp.cosma = (c1 * (10 - angle_rem) + c2 * angle_rem) / 10; @@ -467,7 +467,7 @@ void lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc) * @param zoom zoom, (256 no zoom) * @param pivot x,y pivot coordinates of rotation */ -void lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom, +void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom, lv_point_t * pivot) { #if LV_USE_IMG_TRANSFORM @@ -475,11 +475,11 @@ void lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h int32_t angle_hight = angle_low + 1; int32_t angle_rem = angle - (angle_low * 10); - int32_t s1 = lv_trigo_sin(angle_low); - int32_t s2 = lv_trigo_sin(angle_hight); + int32_t s1 = _lv_trigo_sin(angle_low); + int32_t s2 = _lv_trigo_sin(angle_hight); - int32_t c1 = lv_trigo_sin(angle_low + 90); - int32_t c2 = lv_trigo_sin(angle_hight + 90); + int32_t c1 = _lv_trigo_sin(angle_low + 90); + int32_t c2 = _lv_trigo_sin(angle_hight + 90); int32_t sinma = (s1 * (10 - angle_rem) + s2 * angle_rem) / 10; int32_t cosma = (c1 * (10 - angle_rem) + c2 * angle_rem) / 10; @@ -591,9 +591,9 @@ bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc) lv_opa_t a11 = 0; if(dsc->tmp.native_color) { - lv_memcpy_small(&c01, &src_u8[dsc->tmp.pxi + dsc->tmp.px_size * xn], sizeof(lv_color_t)); - lv_memcpy_small(&c10, &src_u8[dsc->tmp.pxi + dsc->cfg.src_w * dsc->tmp.px_size * yn], sizeof(lv_color_t)); - lv_memcpy_small(&c11, &src_u8[dsc->tmp.pxi + dsc->cfg.src_w * dsc->tmp.px_size * yn + dsc->tmp.px_size * xn], + _lv_memcpy_small(&c01, &src_u8[dsc->tmp.pxi + dsc->tmp.px_size * xn], sizeof(lv_color_t)); + _lv_memcpy_small(&c10, &src_u8[dsc->tmp.pxi + dsc->cfg.src_w * dsc->tmp.px_size * yn], sizeof(lv_color_t)); + _lv_memcpy_small(&c11, &src_u8[dsc->tmp.pxi + dsc->cfg.src_w * dsc->tmp.px_size * yn + dsc->tmp.px_size * xn], sizeof(lv_color_t)); if(dsc->tmp.has_alpha) { a10 = src_u8[dsc->tmp.pxi + dsc->tmp.px_size * xn + dsc->tmp.px_size - 1]; diff --git a/src/lv_draw/lv_img_buf.h b/src/lv_draw/lv_img_buf.h index dc71ec719c..4de04895db 100644 --- a/src/lv_draw/lv_img_buf.h +++ b/src/lv_draw/lv_img_buf.h @@ -30,7 +30,6 @@ extern "C" { #define LV_IMG_PX_SIZE_ALPHA_BYTE 4 #endif - #define LV_IMG_BUF_SIZE_TRUE_COLOR(w, h) ((LV_COLOR_SIZE / 8) * w * h) #define LV_IMG_BUF_SIZE_TRUE_COLOR_CHROMA_KEYED(w, h) ((LV_COLOR_SIZE / 8) * w * h) #define LV_IMG_BUF_SIZE_TRUE_COLOR_ALPHA(w, h) (LV_IMG_PX_SIZE_ALPHA_BYTE * w * h) @@ -257,7 +256,7 @@ uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf); * Initialize a descriptor to rotate an image * @param dsc pointer to an `lv_img_transform_dsc_t` variable whose `cfg` field is initialized */ -void lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc); +void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc); /** * Continue transformation by taking the neighbors into account @@ -274,7 +273,7 @@ bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc); * @return true: there is valid pixel on these x/y coordinates; false: the rotated pixel was out of the image * @note the result is written back to `dsc->res_color` and `dsc->res_opa` */ -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 = dsc->cfg.src; @@ -318,12 +317,12 @@ static inline bool lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_t px_size = LV_COLOR_SIZE >> 3; pxi = dsc->cfg.src_w * ys_int * px_size + xs_int * px_size; - lv_memcpy_small(&dsc->res.color, &src_u8[pxi], px_size); + _lv_memcpy_small(&dsc->res.color, &src_u8[pxi], px_size); } else { px_size = LV_IMG_PX_SIZE_ALPHA_BYTE; pxi = dsc->cfg.src_w * ys_int * px_size + xs_int * px_size; - lv_memcpy_small(&dsc->res.color, &src_u8[pxi], px_size - 1); + _lv_memcpy_small(&dsc->res.color, &src_u8[pxi], px_size - 1); dsc->res.opa = src_u8[pxi + px_size - 1]; } } @@ -363,7 +362,7 @@ static inline bool lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_t * @param zoom zoom, (256 no zoom) * @param pivot x,y pivot coordinates of rotation */ -void lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom, +void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom, lv_point_t * pivot); /********************** diff --git a/src/lv_draw/lv_img_cache.c b/src/lv_draw/lv_img_cache.c index ff1dff9f8e..4f77c4df01 100644 --- a/src/lv_draw/lv_img_cache.c +++ b/src/lv_draw/lv_img_cache.c @@ -62,7 +62,7 @@ static uint16_t entry_cnt; * @param style style of the image * @return pointer to the cache entry or NULL if can open the image */ -lv_img_cache_entry_t * lv_img_cache_open(const void * src, lv_color_t color) +lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color) { if(entry_cnt == 0) { LV_LOG_WARN("lv_img_cache_open: the cache size is 0"); @@ -130,8 +130,8 @@ lv_img_cache_entry_t * lv_img_cache_open(const void * src, lv_color_t color) if(open_res == LV_RES_INV) { LV_LOG_WARN("Image draw cannot open the image resource"); lv_img_decoder_close(&cached_src->dec_dsc); - lv_memset_00(&cached_src->dec_dsc, sizeof(lv_img_decoder_dsc_t)); - lv_memset_00(cached_src, sizeof(lv_img_cache_entry_t)); + _lv_memset_00(&cached_src->dec_dsc, sizeof(lv_img_decoder_dsc_t)); + _lv_memset_00(cached_src, sizeof(lv_img_cache_entry_t)); cached_src->life = INT32_MIN; /*Make the empty entry very "weak" to force its use */ return NULL; } @@ -175,8 +175,8 @@ void lv_img_cache_set_size(uint16_t new_entry_cnt) /*Clean the cache*/ uint16_t i; for(i = 0; i < entry_cnt; i++) { - lv_memset_00(&LV_GC_ROOT(_lv_img_cache_array)[i].dec_dsc, sizeof(lv_img_decoder_dsc_t)); - lv_memset_00(&LV_GC_ROOT(_lv_img_cache_array)[i], sizeof(lv_img_cache_entry_t)); + _lv_memset_00(&LV_GC_ROOT(_lv_img_cache_array)[i].dec_dsc, sizeof(lv_img_decoder_dsc_t)); + _lv_memset_00(&LV_GC_ROOT(_lv_img_cache_array)[i], sizeof(lv_img_cache_entry_t)); } } @@ -197,8 +197,8 @@ void lv_img_cache_invalidate_src(const void * src) lv_img_decoder_close(&cache[i].dec_dsc); } - lv_memset_00(&cache[i].dec_dsc, sizeof(lv_img_decoder_dsc_t)); - lv_memset_00(&cache[i], sizeof(lv_img_cache_entry_t)); + _lv_memset_00(&cache[i].dec_dsc, sizeof(lv_img_decoder_dsc_t)); + _lv_memset_00(&cache[i], sizeof(lv_img_cache_entry_t)); } } } diff --git a/src/lv_draw/lv_img_cache.h b/src/lv_draw/lv_img_cache.h index 3508bd3010..641785f8cf 100644 --- a/src/lv_draw/lv_img_cache.h +++ b/src/lv_draw/lv_img_cache.h @@ -49,7 +49,7 @@ typedef struct { * @param style style of the image * @return pointer to the cache entry or NULL if can open the image */ -lv_img_cache_entry_t * lv_img_cache_open(const void * src, lv_color_t color); +lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color); /** * Set the number of images to be cached. diff --git a/src/lv_draw/lv_img_decoder.c b/src/lv_draw/lv_img_decoder.c index 45633001c6..a5b38449d6 100644 --- a/src/lv_draw/lv_img_decoder.c +++ b/src/lv_draw/lv_img_decoder.c @@ -59,9 +59,9 @@ static lv_res_t lv_img_decoder_built_in_line_indexed(lv_img_decoder_dsc_t * dsc, /** * Initialize the image decoder module * */ -void lv_img_decoder_init(void) +void _lv_img_decoder_init(void) { - lv_ll_init(&LV_GC_ROOT(_lv_img_defoder_ll), sizeof(lv_img_decoder_t)); + _lv_ll_init(&LV_GC_ROOT(_lv_img_defoder_ll), sizeof(lv_img_decoder_t)); lv_img_decoder_t * decoder; @@ -92,7 +92,7 @@ lv_res_t lv_img_decoder_get_info(const char * src, lv_img_header_t * header) lv_res_t res = LV_RES_INV; lv_img_decoder_t * d; - LV_LL_READ(LV_GC_ROOT(_lv_img_defoder_ll), d) { + _LV_LL_READ(LV_GC_ROOT(_lv_img_defoder_ll), d) { res = LV_RES_INV; if(d->info_cb) { res = d->info_cb(d, src, header); @@ -133,7 +133,7 @@ lv_res_t lv_img_decoder_open(lv_img_decoder_dsc_t * dsc, const void * src, lv_co lv_res_t res = LV_RES_INV; lv_img_decoder_t * d; - LV_LL_READ(LV_GC_ROOT(_lv_img_defoder_ll), d) { + _LV_LL_READ(LV_GC_ROOT(_lv_img_defoder_ll), d) { /*Info an Open callbacks are required*/ if(d->info_cb == NULL || d->open_cb == NULL) continue; @@ -151,7 +151,7 @@ lv_res_t lv_img_decoder_open(lv_img_decoder_dsc_t * dsc, const void * src, lv_co } if(res == LV_RES_INV) { - lv_memset_00(dsc, sizeof(lv_img_decoder_dsc_t)); + _lv_memset_00(dsc, sizeof(lv_img_decoder_dsc_t)); } return res; @@ -197,11 +197,11 @@ void lv_img_decoder_close(lv_img_decoder_dsc_t * dsc) lv_img_decoder_t * lv_img_decoder_create(void) { lv_img_decoder_t * decoder; - decoder = lv_ll_ins_head(&LV_GC_ROOT(_lv_img_defoder_ll)); + decoder = _lv_ll_ins_head(&LV_GC_ROOT(_lv_img_defoder_ll)); LV_ASSERT_MEM(decoder); if(decoder == NULL) return NULL; - lv_memset_00(decoder, sizeof(lv_img_decoder_t)); + _lv_memset_00(decoder, sizeof(lv_img_decoder_t)); return decoder; } @@ -212,7 +212,7 @@ lv_img_decoder_t * lv_img_decoder_create(void) */ void lv_img_decoder_delete(lv_img_decoder_t * decoder) { - lv_ll_remove(&LV_GC_ROOT(_lv_img_defoder_ll), decoder); + _lv_ll_remove(&LV_GC_ROOT(_lv_img_defoder_ll), decoder); lv_mem_free(decoder); } @@ -341,7 +341,7 @@ lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder LV_LOG_ERROR("img_decoder_built_in_open: out of memory"); return LV_RES_INV; } - lv_memset_00(dsc->user_data, sizeof(lv_img_decoder_built_in_data_t)); + _lv_memset_00(dsc->user_data, sizeof(lv_img_decoder_built_in_data_t)); } lv_img_decoder_built_in_data_t * user_data = dsc->user_data; @@ -353,7 +353,7 @@ lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder return LV_RES_INV; } - lv_memcpy_small(user_data->f, &f, sizeof(f)); + _lv_memcpy_small(user_data->f, &f, sizeof(f)); #else LV_LOG_WARN("Image built-in decoder cannot read file because LV_USE_FILESYSTEM = 0"); @@ -399,7 +399,7 @@ lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder lv_img_decoder_built_in_close(decoder, dsc); return LV_RES_INV; } - lv_memset_00(dsc->user_data, sizeof(lv_img_decoder_built_in_data_t)); + _lv_memset_00(dsc->user_data, sizeof(lv_img_decoder_built_in_data_t)); } lv_img_decoder_built_in_data_t * user_data = dsc->user_data; @@ -639,7 +639,7 @@ static lv_res_t lv_img_decoder_built_in_line_alpha(lv_img_decoder_dsc_t * dsc, l #if LV_USE_FILESYSTEM lv_img_decoder_built_in_data_t * user_data = dsc->user_data; - uint8_t * fs_buf = lv_mem_buf_get(w); + uint8_t * fs_buf = _lv_mem_buf_get(w); #endif const uint8_t * data_tmp = NULL; @@ -673,7 +673,7 @@ static lv_res_t lv_img_decoder_built_in_line_alpha(lv_img_decoder_dsc_t * dsc, l } } #if LV_USE_FILESYSTEM - lv_mem_buf_release(fs_buf); + _lv_mem_buf_release(fs_buf); #endif return LV_RES_OK; @@ -727,7 +727,7 @@ static lv_res_t lv_img_decoder_built_in_line_indexed(lv_img_decoder_dsc_t * dsc, lv_img_decoder_built_in_data_t * user_data = dsc->user_data; #if LV_USE_FILESYSTEM - uint8_t * fs_buf = lv_mem_buf_get(w); + uint8_t * fs_buf = _lv_mem_buf_get(w); #endif const uint8_t * data_tmp = NULL; if(dsc->src_type == LV_IMG_SRC_VARIABLE) { @@ -771,7 +771,7 @@ static lv_res_t lv_img_decoder_built_in_line_indexed(lv_img_decoder_dsc_t * dsc, } } #if LV_USE_FILESYSTEM - lv_mem_buf_release(fs_buf); + _lv_mem_buf_release(fs_buf); #endif return LV_RES_OK; #else diff --git a/src/lv_draw/lv_img_decoder.h b/src/lv_draw/lv_img_decoder.h index 5b35f4dd50..980816425e 100644 --- a/src/lv_draw/lv_img_decoder.h +++ b/src/lv_draw/lv_img_decoder.h @@ -135,7 +135,7 @@ typedef struct _lv_img_decoder_dsc { /** * Initialize the image decoder module */ -void lv_img_decoder_init(void); +void _lv_img_decoder_init(void); /** * Get information about an image. @@ -221,8 +221,6 @@ void lv_img_decoder_set_read_line_cb(lv_img_decoder_t * decoder, lv_img_decoder_ */ void lv_img_decoder_set_close_cb(lv_img_decoder_t * decoder, lv_img_decoder_close_f_t close_cb); - - /** * Get info about a built-in image * @param decoder the decoder where this function belongs diff --git a/src/lv_font/lv_font_fmt_txt.c b/src/lv_font/lv_font_fmt_txt.c index bef7d8327d..4b1fed0693 100644 --- a/src/lv_font/lv_font_fmt_txt.c +++ b/src/lv_font/lv_font_fmt_txt.c @@ -101,7 +101,7 @@ const uint8_t * lv_font_get_bitmap_fmt_txt(const lv_font_t * font, uint32_t unic 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) { decompr_buf = lv_mem_realloc(decompr_buf, buf_size); LV_ASSERT_MEM(decompr_buf); if(decompr_buf == NULL) return NULL; @@ -169,7 +169,7 @@ bool lv_font_get_glyph_dsc_fmt_txt(const lv_font_t * font, lv_font_glyph_dsc_t * /** * Free the allocated memories. */ -void lv_font_clean_up_fmt_txt(void) +void _lv_font_clean_up_fmt_txt(void) { if(decompr_buf) { lv_mem_free(decompr_buf); @@ -206,7 +206,7 @@ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter) glyph_id = fdsc->cmaps[i].glyph_id_start + gid_ofs_8[rcp]; } else if(fdsc->cmaps[i].type == LV_FONT_FMT_TXT_CMAP_SPARSE_TINY) { - uint8_t * p = lv_utils_bsearch(&rcp, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length, + uint8_t * p = _lv_utils_bsearch(&rcp, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length, sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare); if(p) { @@ -216,7 +216,7 @@ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter) } } else if(fdsc->cmaps[i].type == LV_FONT_FMT_TXT_CMAP_SPARSE_FULL) { - uint8_t * p = lv_utils_bsearch(&rcp, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length, + uint8_t * p = _lv_utils_bsearch(&rcp, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length, sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare); if(p) { @@ -253,7 +253,7 @@ static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t * The pairs are ordered left_id first, then right_id secondly. */ const uint8_t * g_ids = kdsc->glyph_ids; uint16_t g_id_both = (gid_right << 8) + gid_left; /*Create one number from the ids*/ - uint8_t * kid_p = lv_utils_bsearch(&g_id_both, g_ids, kdsc->pair_cnt, 2, kern_pair_8_compare); + uint8_t * kid_p = _lv_utils_bsearch(&g_id_both, g_ids, kdsc->pair_cnt, 2, kern_pair_8_compare); /*If the `g_id_both` were found get its index from the pointer*/ if(kid_p) { @@ -267,7 +267,7 @@ static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t * The pairs are ordered left_id first, then right_id secondly. */ const uint16_t * g_ids = kdsc->glyph_ids; lv_uintptr_t g_id_both = (uint32_t)((uint32_t)gid_right << 8) + gid_left; /*Create one number from the ids*/ - uint8_t * kid_p = lv_utils_bsearch(&g_id_both, g_ids, kdsc->pair_cnt, 4, kern_pair_16_compare); + uint8_t * kid_p = _lv_utils_bsearch(&g_id_both, g_ids, kdsc->pair_cnt, 4, kern_pair_16_compare); /*If the `g_id_both` were found get its index from the pointer*/ if(kid_p) { @@ -333,8 +333,8 @@ static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord rle_init(in, bpp); - uint8_t * line_buf1 = lv_mem_buf_get(w); - uint8_t * line_buf2 = lv_mem_buf_get(w); + uint8_t * line_buf1 = _lv_mem_buf_get(w); + uint8_t * line_buf2 = _lv_mem_buf_get(w); decompress_line(line_buf1, w); @@ -356,8 +356,8 @@ static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord } } - lv_mem_buf_release(line_buf1); - lv_mem_buf_release(line_buf2); + _lv_mem_buf_release(line_buf1); + _lv_mem_buf_release(line_buf2); } /** diff --git a/src/lv_font/lv_font_fmt_txt.h b/src/lv_font/lv_font_fmt_txt.h index edd69626a0..72e8ecd3c8 100644 --- a/src/lv_font/lv_font_fmt_txt.h +++ b/src/lv_font/lv_font_fmt_txt.h @@ -221,7 +221,7 @@ bool lv_font_get_glyph_dsc_fmt_txt(const lv_font_t * font, lv_font_glyph_dsc_t * /** * Free the allocated memories. */ -void lv_font_clean_up_fmt_txt(void); +void _lv_font_clean_up_fmt_txt(void); /********************** * MACROS diff --git a/src/lv_hal/lv_hal_disp.c b/src/lv_hal/lv_hal_disp.c index c2cc1cfc61..655741106e 100644 --- a/src/lv_hal/lv_hal_disp.c +++ b/src/lv_hal/lv_hal_disp.c @@ -56,7 +56,7 @@ static lv_disp_t * disp_def; */ void lv_disp_drv_init(lv_disp_drv_t * driver) { - lv_memset_00(driver, sizeof(lv_disp_drv_t)); + _lv_memset_00(driver, sizeof(lv_disp_drv_t)); driver->flush_cb = NULL; driver->hor_res = LV_HOR_RES_MAX; @@ -103,7 +103,7 @@ void lv_disp_drv_init(lv_disp_drv_t * driver) */ void lv_disp_buf_init(lv_disp_buf_t * disp_buf, void * buf1, void * buf2, uint32_t size_in_px_cnt) { - lv_memset_00(disp_buf, sizeof(lv_disp_buf_t)); + _lv_memset_00(disp_buf, sizeof(lv_disp_buf_t)); disp_buf->buf1 = buf1; disp_buf->buf2 = buf2; @@ -119,16 +119,16 @@ void lv_disp_buf_init(lv_disp_buf_t * disp_buf, void * buf1, void * buf2, uint32 */ lv_disp_t * lv_disp_drv_register(lv_disp_drv_t * driver) { - lv_disp_t * disp = lv_ll_ins_head(&LV_GC_ROOT(_lv_disp_ll)); + lv_disp_t * disp = _lv_ll_ins_head(&LV_GC_ROOT(_lv_disp_ll)); if(!disp) { LV_ASSERT_MEM(disp); return NULL; } - lv_memset_00(disp, sizeof(lv_disp_t)); - lv_memcpy(&disp->driver, driver, sizeof(lv_disp_drv_t)); + _lv_memset_00(disp, sizeof(lv_disp_t)); + _lv_memcpy(&disp->driver, driver, sizeof(lv_disp_drv_t)); - lv_ll_init(&disp->scr_ll, sizeof(lv_obj_t)); + _lv_ll_init(&disp->scr_ll, sizeof(lv_obj_t)); disp->last_activity_time = 0; if(disp_def == NULL) disp_def = disp; @@ -137,7 +137,7 @@ lv_disp_t * lv_disp_drv_register(lv_disp_drv_t * driver) disp_def = disp; /*Temporarily change the default screen to create the default screens on the new display*/ /*Create a refresh task*/ - disp->refr_task = lv_task_create(lv_disp_refr_task, LV_DISP_DEF_REFR_PERIOD, LV_REFR_TASK_PRIO, disp); + disp->refr_task = lv_task_create(_lv_disp_refr_task, LV_DISP_DEF_REFR_PERIOD, LV_REFR_TASK_PRIO, disp); LV_ASSERT_MEM(disp->refr_task); if(disp->refr_task == NULL) return NULL; @@ -171,7 +171,7 @@ void lv_disp_drv_update(lv_disp_t * disp, lv_disp_drv_t * new_drv) memcpy(&disp->driver, new_drv, sizeof(lv_disp_drv_t)); lv_obj_t * scr; - LV_LL_READ(disp->scr_ll, scr) { + _LV_LL_READ(disp->scr_ll, scr) { lv_obj_set_size(scr, lv_disp_get_hor_res(disp), lv_disp_get_ver_res(disp)); } } @@ -195,10 +195,10 @@ void lv_disp_remove(lv_disp_t * disp) indev = lv_indev_get_next(indev); } - lv_ll_remove(&LV_GC_ROOT(_lv_disp_ll), disp); + _lv_ll_remove(&LV_GC_ROOT(_lv_disp_ll), disp); lv_mem_free(disp); - if(was_default) lv_disp_set_default(lv_ll_get_head(&LV_GC_ROOT(_lv_disp_ll))); + if(was_default) lv_disp_set_default(_lv_ll_get_head(&LV_GC_ROOT(_lv_disp_ll))); } /** @@ -305,7 +305,7 @@ LV_ATTRIBUTE_FLUSH_READY void lv_disp_flush_ready(lv_disp_drv_t * disp_drv) /*If the screen is transparent initialize it when the flushing is ready*/ #if LV_COLOR_SCREEN_TRANSP if(disp_drv->screen_transp) { - lv_memset_00(disp_drv->buffer->buf_act, disp_drv->buffer->size * sizeof(lv_color32_t)); + _lv_memset_00(disp_drv->buffer->buf_act, disp_drv->buffer->size * sizeof(lv_color32_t)); } #endif @@ -333,9 +333,9 @@ LV_ATTRIBUTE_FLUSH_READY bool lv_disp_flush_is_last(lv_disp_drv_t * disp_drv) lv_disp_t * lv_disp_get_next(lv_disp_t * disp) { if(disp == NULL) - return lv_ll_get_head(&LV_GC_ROOT(_lv_disp_ll)); + return _lv_ll_get_head(&LV_GC_ROOT(_lv_disp_ll)); else - return lv_ll_get_next(&LV_GC_ROOT(_lv_disp_ll), disp); + return _lv_ll_get_next(&LV_GC_ROOT(_lv_disp_ll), disp); } /** @@ -361,7 +361,7 @@ uint16_t lv_disp_get_inv_buf_size(lv_disp_t * disp) * Pop (delete) the last 'num' invalidated areas from the buffer * @param num number of areas to delete */ -void lv_disp_pop_from_inv_buf(lv_disp_t * disp, uint16_t num) +void _lv_disp_pop_from_inv_buf(lv_disp_t * disp, uint16_t num) { if(disp->inv_p < num) diff --git a/src/lv_hal/lv_hal_disp.h b/src/lv_hal/lv_hal_disp.h index 84673501f8..06040634ca 100644 --- a/src/lv_hal/lv_hal_disp.h +++ b/src/lv_hal/lv_hal_disp.h @@ -306,7 +306,7 @@ uint16_t lv_disp_get_inv_buf_size(lv_disp_t * disp); * Pop (delete) the last 'num' invalidated areas from the buffer * @param num number of areas to delete */ -void lv_disp_pop_from_inv_buf(lv_disp_t * disp, uint16_t num); +void _lv_disp_pop_from_inv_buf(lv_disp_t * disp, uint16_t num); /** * Check the driver configuration if it's double buffered (both `buf1` and `buf2` are set) diff --git a/src/lv_hal/lv_hal_indev.c b/src/lv_hal/lv_hal_indev.c index 8b2159d250..0dd328a5ce 100644 --- a/src/lv_hal/lv_hal_indev.c +++ b/src/lv_hal/lv_hal_indev.c @@ -51,7 +51,7 @@ */ void lv_indev_drv_init(lv_indev_drv_t * driver) { - lv_memset_00(driver, sizeof(lv_indev_drv_t)); + _lv_memset_00(driver, sizeof(lv_indev_drv_t)); driver->type = LV_INDEV_TYPE_NONE; driver->drag_limit = LV_INDEV_DEF_DRAG_LIMIT; @@ -78,21 +78,21 @@ lv_indev_t * lv_indev_drv_register(lv_indev_drv_t * driver) return NULL; } - lv_indev_t * indev = lv_ll_ins_head(&LV_GC_ROOT(_lv_indev_ll)); + lv_indev_t * indev = _lv_ll_ins_head(&LV_GC_ROOT(_lv_indev_ll)); if(!indev) { LV_ASSERT_MEM(indev); return NULL; } - lv_memset_00(indev, sizeof(lv_indev_t)); - lv_memcpy(&indev->driver, driver, sizeof(lv_indev_drv_t)); + _lv_memset_00(indev, sizeof(lv_indev_t)); + _lv_memcpy(&indev->driver, driver, sizeof(lv_indev_drv_t)); indev->proc.reset_query = 1; indev->cursor = NULL; indev->group = NULL; indev->btn_points = NULL; - indev->driver.read_task = lv_task_create(lv_indev_read_task, LV_INDEV_DEF_READ_PERIOD, LV_TASK_PRIO_HIGH, indev); + indev->driver.read_task = lv_task_create(_lv_indev_read_task, LV_INDEV_DEF_READ_PERIOD, LV_TASK_PRIO_HIGH, indev); return indev; } @@ -116,9 +116,9 @@ void lv_indev_drv_update(lv_indev_t * indev, lv_indev_drv_t * new_drv) lv_indev_t * lv_indev_get_next(lv_indev_t * indev) { if(indev == NULL) - return lv_ll_get_head(&LV_GC_ROOT(_lv_indev_ll)); + return _lv_ll_get_head(&LV_GC_ROOT(_lv_indev_ll)); else - return lv_ll_get_next(&LV_GC_ROOT(_lv_indev_ll), indev); + return _lv_ll_get_next(&LV_GC_ROOT(_lv_indev_ll), indev); } /** @@ -127,11 +127,11 @@ lv_indev_t * lv_indev_get_next(lv_indev_t * indev) * @param data input device will write its data here * @return false: no more data; true: there more data to read (buffered) */ -bool lv_indev_read(lv_indev_t * indev, lv_indev_data_t * data) +bool _lv_indev_read(lv_indev_t * indev, lv_indev_data_t * data) { bool cont = false; - lv_memset_00(data, sizeof(lv_indev_data_t)); + _lv_memset_00(data, sizeof(lv_indev_data_t)); /* For touchpad sometimes users don't the last pressed coordinate on release. * So be sure a coordinates are initialized to the last point */ diff --git a/src/lv_hal/lv_hal_indev.h b/src/lv_hal/lv_hal_indev.h index bd41d9a6b3..909f78bb1a 100644 --- a/src/lv_hal/lv_hal_indev.h +++ b/src/lv_hal/lv_hal_indev.h @@ -220,7 +220,7 @@ lv_indev_t * lv_indev_get_next(lv_indev_t * indev); * @param data input device will write its data here * @return false: no more data; true: there more data to read (buffered) */ -bool lv_indev_read(lv_indev_t * indev, lv_indev_data_t * data); +bool _lv_indev_read(lv_indev_t * indev, lv_indev_data_t * data); /********************** * MACROS diff --git a/src/lv_misc/lv_anim.c b/src/lv_misc/lv_anim.c index 28bc22d870..b0c3af81e1 100644 --- a/src/lv_misc/lv_anim.c +++ b/src/lv_misc/lv_anim.c @@ -58,9 +58,9 @@ const lv_anim_path_t lv_anim_path_def = {.cb = lv_anim_path_linear}; /** * Init. the animation module */ -void lv_anim_core_init(void) +void _lv_anim_core_init(void) { - lv_ll_init(&LV_GC_ROOT(_lv_anim_ll), sizeof(lv_anim_t)); + _lv_ll_init(&LV_GC_ROOT(_lv_anim_ll), sizeof(lv_anim_t)); last_task_run = lv_tick_get(); _lv_anim_task = lv_task_create(anim_task, LV_DISP_DEF_REFR_PERIOD, LV_ANIM_TASK_PRIO, NULL); anim_mark_list_change(); /*Turn off the animation task*/ @@ -78,11 +78,11 @@ void lv_anim_core_init(void) */ void lv_anim_init(lv_anim_t * a) { - lv_memset_00(a, sizeof(lv_anim_t)); + _lv_memset_00(a, sizeof(lv_anim_t)); a->time = 500; a->start = 0; a->end = 100; - lv_memcpy_small(&a->path, &lv_anim_path_def, sizeof(lv_anim_path_cb_t)); + _lv_memcpy_small(&a->path, &lv_anim_path_def, sizeof(lv_anim_path_cb_t)); a->repeat_cnt = 1; a->early_apply = 1; } @@ -97,18 +97,18 @@ void lv_anim_start(lv_anim_t * a) if(a->exec_cb != NULL) lv_anim_del(a->var, a->exec_cb); /*fp == NULL would delete all animations of var*/ /*If the list is empty the anim task was suspended and it's last run measure is invalid*/ - if(lv_ll_is_empty(&LV_GC_ROOT(_lv_anim_ll))) { + if(_lv_ll_is_empty(&LV_GC_ROOT(_lv_anim_ll))) { last_task_run = lv_tick_get() - 1; } /*Add the new animation to the animation linked list*/ - lv_anim_t * new_anim = lv_ll_ins_head(&LV_GC_ROOT(_lv_anim_ll)); + lv_anim_t * new_anim = _lv_ll_ins_head(&LV_GC_ROOT(_lv_anim_ll)); LV_ASSERT_MEM(new_anim); if(new_anim == NULL) return; /*Initialize the animation descriptor*/ a->time_orig = a->time; - lv_memcpy(new_anim, a, sizeof(lv_anim_t)); + _lv_memcpy(new_anim, a, sizeof(lv_anim_t)); /*Set the start value*/ if(new_anim->early_apply) { @@ -134,13 +134,13 @@ bool lv_anim_del(void * var, lv_anim_exec_xcb_t exec_cb) lv_anim_t * a; lv_anim_t * a_next; bool del = false; - a = lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll)); + a = _lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll)); while(a != NULL) { /*'a' might be deleted, so get the next object while 'a' is valid*/ - a_next = lv_ll_get_next(&LV_GC_ROOT(_lv_anim_ll), a); + a_next = _lv_ll_get_next(&LV_GC_ROOT(_lv_anim_ll), a); if(a->var == var && (a->exec_cb == exec_cb || exec_cb == NULL)) { - lv_ll_remove(&LV_GC_ROOT(_lv_anim_ll), a); + _lv_ll_remove(&LV_GC_ROOT(_lv_anim_ll), a); lv_mem_free(a); anim_mark_list_change(); /*Read by `anim_task`. It need to know if a delete occurred in the linked list*/ @@ -163,7 +163,7 @@ bool lv_anim_del(void * var, lv_anim_exec_xcb_t exec_cb) lv_anim_t * lv_anim_get(void * var, lv_anim_exec_xcb_t exec_cb) { lv_anim_t * a; - LV_LL_READ(LV_GC_ROOT(_lv_anim_ll), a) { + _LV_LL_READ(LV_GC_ROOT(_lv_anim_ll), a) { if(a->var == var && a->exec_cb == exec_cb) { return a; } @@ -180,7 +180,7 @@ uint16_t lv_anim_count_running(void) { uint16_t cnt = 0; lv_anim_t * a; - LV_LL_READ(LV_GC_ROOT(_lv_anim_ll), a) cnt++; + _LV_LL_READ(LV_GC_ROOT(_lv_anim_ll), a) cnt++; return cnt; } @@ -257,7 +257,7 @@ lv_anim_value_t lv_anim_path_ease_in(const lv_anim_path_t * path, const lv_anim_ else t = (uint32_t)((uint32_t)a->act_time * 1024) / a->time; - int32_t step = lv_bezier3(t, 0, 1, 1, 1024); + int32_t step = _lv_bezier3(t, 0, 1, 1, 1024); int32_t new_value; new_value = (int32_t)step * (a->end - a->start); @@ -282,7 +282,7 @@ lv_anim_value_t lv_anim_path_ease_out(const lv_anim_path_t * path, const lv_anim else t = (uint32_t)((uint32_t)a->act_time * 1024) / a->time; - int32_t step = lv_bezier3(t, 0, 1023, 1023, 1024); + int32_t step = _lv_bezier3(t, 0, 1023, 1023, 1024); int32_t new_value; new_value = (int32_t)step * (a->end - a->start); @@ -307,7 +307,7 @@ lv_anim_value_t lv_anim_path_ease_in_out(const lv_anim_path_t * path, const lv_a else t = (uint32_t)((uint32_t)a->act_time * 1024) / a->time; - int32_t step = lv_bezier3(t, 0, 100, 924, 1024); + int32_t step = _lv_bezier3(t, 0, 100, 924, 1024); int32_t new_value; new_value = (int32_t)step * (a->end - a->start); @@ -332,7 +332,7 @@ lv_anim_value_t lv_anim_path_overshoot(const lv_anim_path_t * path, const lv_ani else t = (uint32_t)((uint32_t)a->act_time * 1024) / a->time; - int32_t step = lv_bezier3(t, 0, 1000, 2000, 1024); + int32_t step = _lv_bezier3(t, 0, 1000, 2000, 1024); int32_t new_value; new_value = (int32_t)step * (a->end - a->start); @@ -394,7 +394,7 @@ lv_anim_value_t lv_anim_path_bounce(const lv_anim_path_t * path, const lv_anim_t if(t > 1024) t = 1024; - int32_t step = lv_bezier3(t, 1024, 1024, 800, 0); + int32_t step = _lv_bezier3(t, 1024, 1024, 800, 0); int32_t new_value; new_value = (int32_t)step * diff; @@ -431,13 +431,13 @@ static void anim_task(lv_task_t * param) (void)param; lv_anim_t * a; - LV_LL_READ(LV_GC_ROOT(_lv_anim_ll), a) { + _LV_LL_READ(LV_GC_ROOT(_lv_anim_ll), a) { a->has_run = 0; } uint32_t elaps = lv_tick_elaps(last_task_run); - a = lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll)); + a = _lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll)); while(a != NULL) { /*It can be set by `lv_anim_del()` typically in `end_cb`. If set then an animation delete @@ -475,9 +475,9 @@ static void anim_task(lv_task_t * param) /* If the linked list changed due to anim. delete then it's not safe to continue * the reading of the list from here -> start from the head*/ if(anim_list_changed) - a = lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll)); + a = _lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll)); else - a = lv_ll_get_next(&LV_GC_ROOT(_lv_anim_ll), a); + a = _lv_ll_get_next(&LV_GC_ROOT(_lv_anim_ll), a); } last_task_run = lv_tick_get(); @@ -504,8 +504,8 @@ static bool anim_ready_handler(lv_anim_t * a) /*Create copy from the animation and delete the animation from the list. * This way the `ready_cb` will see the animations like it's animation is ready deleted*/ lv_anim_t a_tmp; - lv_memcpy(&a_tmp, a, sizeof(lv_anim_t)); - lv_ll_remove(&LV_GC_ROOT(_lv_anim_ll), a); + _lv_memcpy(&a_tmp, a, sizeof(lv_anim_t)); + _lv_ll_remove(&LV_GC_ROOT(_lv_anim_ll), a); lv_mem_free(a); /*Flag that the list has changed */ anim_mark_list_change(); @@ -538,7 +538,7 @@ static bool anim_ready_handler(lv_anim_t * a) static void anim_mark_list_change(void) { anim_list_changed = true; - if(lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll)) == NULL) + if(_lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll)) == NULL) lv_task_set_prio(_lv_anim_task, LV_TASK_PRIO_OFF); else lv_task_set_prio(_lv_anim_task, LV_ANIM_TASK_PRIO); diff --git a/src/lv_misc/lv_anim.h b/src/lv_misc/lv_anim.h index a689053e85..ea61f97fe4 100644 --- a/src/lv_misc/lv_anim.h +++ b/src/lv_misc/lv_anim.h @@ -108,7 +108,7 @@ typedef struct _lv_anim_t { /** * Init. the animation module */ -void lv_anim_core_init(void); +void _lv_anim_core_init(void); /** * Initialize an animation variable. @@ -198,7 +198,7 @@ static inline void lv_anim_set_custom_exec_cb(lv_anim_t * a, lv_anim_custom_exec */ static inline void lv_anim_set_path(lv_anim_t * a, const lv_anim_path_t * path) { - lv_memcpy_small(&a->path, path, sizeof(lv_anim_path_t)); + _lv_memcpy_small(&a->path, path, sizeof(lv_anim_path_t)); } @@ -274,7 +274,7 @@ void lv_anim_start(lv_anim_t * a); */ static inline void lv_anim_path_init(lv_anim_path_t * path) { - lv_memset_00(path, sizeof(lv_anim_path_t)); + _lv_memset_00(path, sizeof(lv_anim_path_t)); } /** diff --git a/src/lv_misc/lv_area.c b/src/lv_misc/lv_area.c index 04db991c90..8f0045583b 100644 --- a/src/lv_misc/lv_area.c +++ b/src/lv_misc/lv_area.c @@ -79,7 +79,7 @@ void lv_area_set_height(lv_area_t * area_p, lv_coord_t h) * @param x the new x coordinate of the area * @param y the new y coordinate of the area */ -void lv_area_set_pos(lv_area_t * area_p, lv_coord_t x, lv_coord_t y) +void _lv_area_set_pos(lv_area_t * area_p, lv_coord_t x, lv_coord_t y) { lv_coord_t w = lv_area_get_width(area_p); lv_coord_t h = lv_area_get_height(area_p); @@ -110,7 +110,7 @@ uint32_t lv_area_get_size(const lv_area_t * area_p) * @param a2_p pointer to the second area * @return false: the two area has NO common parts, res_p is invalid */ -bool lv_area_intersect(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p) +bool _lv_area_intersect(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p) { /* Get the smaller area from 'a1_p' and 'a2_p' */ res_p->x1 = LV_MATH_MAX(a1_p->x1, a2_p->x1); @@ -132,7 +132,7 @@ bool lv_area_intersect(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_ * @param a1_p pointer to the first area * @param a2_p pointer to the second area */ -void lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * a2_p) +void _lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * a2_p) { a_res_p->x1 = LV_MATH_MIN(a1_p->x1, a2_p->x1); a_res_p->y1 = LV_MATH_MIN(a1_p->y1, a2_p->y1); @@ -147,7 +147,7 @@ void lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * * @param radius radius of area (e.g. for rounded rectangle) * @return false:the point is out of the area */ -bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, lv_coord_t radius) +bool _lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, lv_coord_t radius) { /*First check the basic area*/ bool is_on_rect = false; @@ -174,7 +174,7 @@ bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, lv_coord corner_area.x2 = a_p->x1 + radius; corner_area.y1 = a_p->y1; corner_area.y2 = a_p->y1 + radius; - if(lv_area_is_point_on(&corner_area, p_p, 0)) { + if(_lv_area_is_point_on(&corner_area, p_p, 0)) { corner_area.x2 += radius; corner_area.y2 += radius; return lv_point_within_circle(&corner_area, p_p); @@ -182,7 +182,7 @@ bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, lv_coord /*Bottom left*/ corner_area.y1 = a_p->y2 - radius; corner_area.y2 = a_p->y2; - if(lv_area_is_point_on(&corner_area, p_p, 0)) { + if(_lv_area_is_point_on(&corner_area, p_p, 0)) { corner_area.x2 += radius; corner_area.y1 -= radius; return lv_point_within_circle(&corner_area, p_p); @@ -190,7 +190,7 @@ bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, lv_coord /*Bottom right*/ corner_area.x1 = a_p->x2 - radius; corner_area.x2 = a_p->x2; - if(lv_area_is_point_on(&corner_area, p_p, 0)) { + if(_lv_area_is_point_on(&corner_area, p_p, 0)) { corner_area.x1 -= radius; corner_area.y1 -= radius; return lv_point_within_circle(&corner_area, p_p); @@ -198,7 +198,7 @@ bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, lv_coord /*Top right*/ corner_area.y1 = a_p->y1; corner_area.y2 = a_p->y1 + radius; - if(lv_area_is_point_on(&corner_area, p_p, 0)) { + if(_lv_area_is_point_on(&corner_area, p_p, 0)) { corner_area.x1 -= radius; corner_area.y2 += radius; return lv_point_within_circle(&corner_area, p_p); @@ -213,7 +213,7 @@ bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, lv_coord * @param a2_p pointer to an other area * @return false: a1_p and a2_p has no common parts */ -bool lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p) +bool _lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p) { if((a1_p->x1 <= a2_p->x2) && (a1_p->x2 >= a2_p->x1) && (a1_p->y1 <= a2_p->y2) && (a1_p->y2 >= a2_p->y1)) { return true; @@ -230,7 +230,7 @@ bool lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p) * @param radius radius of `aholder_p` (e.g. for rounded rectangle) * @return true: `ain_p` is fully inside `aholder_p` */ -bool lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p, lv_coord_t radius) +bool _lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p, lv_coord_t radius) { bool is_in = false; @@ -246,36 +246,23 @@ bool lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p, lv_coor p.x = ain_p->x1; p.y = ain_p->y1; - if(lv_area_is_point_on(aholder_p, &p, radius) == false) return false; + if(_lv_area_is_point_on(aholder_p, &p, radius) == false) return false; p.x = ain_p->x2; p.y = ain_p->y1; - if(lv_area_is_point_on(aholder_p, &p, radius) == false) return false; + if(_lv_area_is_point_on(aholder_p, &p, radius) == false) return false; p.x = ain_p->x1; p.y = ain_p->y2; - if(lv_area_is_point_on(aholder_p, &p, radius) == false) return false; + if(_lv_area_is_point_on(aholder_p, &p, radius) == false) return false; p.x = ain_p->x2; p.y = ain_p->y2; - if(lv_area_is_point_on(aholder_p, &p, radius) == false) return false; + if(_lv_area_is_point_on(aholder_p, &p, radius) == false) return false; return true; } -/** - * Increment or decrement an area's size by a single amount - * @param a_p pointer to an area to grow - * @param amount amount to increment the area, or negative to decrement - */ -void lv_area_increment(lv_area_t * a_p, const lv_coord_t amount) -{ - a_p->x1 -= amount; - a_p->y1 -= amount; - a_p->x2 += amount; - a_p->y2 += amount; -} - /** * Align an area to an other * @param base an are where the other will be aligned @@ -283,7 +270,7 @@ void lv_area_increment(lv_area_t * a_p, const lv_coord_t amount) * @param align `LV_ALIGN_...` * @param res x/y coordinates where `to_align` align area should be placed */ -void lv_area_align(const lv_area_t * base, const lv_area_t * to_align, lv_align_t align, lv_point_t * res) +void _lv_area_align(const lv_area_t * base, const lv_area_t * to_align, lv_align_t align, lv_point_t * res) { switch(align) { diff --git a/src/lv_misc/lv_area.h b/src/lv_misc/lv_area.h index 17f7b03747..879a9c03ae 100644 --- a/src/lv_misc/lv_area.h +++ b/src/lv_misc/lv_area.h @@ -99,7 +99,7 @@ void lv_area_set(lv_area_t * area_p, lv_coord_t x1, lv_coord_t y1, lv_coord_t x2 */ inline static void lv_area_copy(lv_area_t * dest, const lv_area_t * src) { - lv_memcpy_small(dest, src, sizeof(lv_area_t)); + _lv_memcpy_small(dest, src, sizeof(lv_area_t)); } /** @@ -142,7 +142,7 @@ void lv_area_set_height(lv_area_t * area_p, lv_coord_t h); * @param x the new x coordinate of the area * @param y the new y coordinate of the area */ -void lv_area_set_pos(lv_area_t * area_p, lv_coord_t x, lv_coord_t y); +void _lv_area_set_pos(lv_area_t * area_p, lv_coord_t x, lv_coord_t y); /** * Return with area of an area (x * y) @@ -158,7 +158,7 @@ uint32_t lv_area_get_size(const lv_area_t * area_p); * @param a2_p pointer to the second area * @return false: the two area has NO common parts, res_p is invalid */ -bool lv_area_intersect(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p); +bool _lv_area_intersect(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p); /** * Join two areas into a third which involves the other two @@ -166,7 +166,7 @@ bool lv_area_intersect(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_ * @param a1_p pointer to the first area * @param a2_p pointer to the second area */ -void lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * a2_p); +void _lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * a2_p); /** * Check if a point is on an area @@ -175,7 +175,7 @@ void lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * * @param radius radius of area (e.g. for rounded rectangle) * @return false:the point is out of the area */ -bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, lv_coord_t radius); +bool _lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, lv_coord_t radius); /** * Check if two area has common parts @@ -183,7 +183,7 @@ bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, lv_coord * @param a2_p pointer to an other area * @return false: a1_p and a2_p has no common parts */ -bool lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p); +bool _lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p); /** * Check if an area is fully on an other @@ -192,14 +192,8 @@ bool lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p); * @param radius radius of `aholder_p` (e.g. for rounded rectangle) * @return true: `ain_p` is fully inside `aholder_p` */ -bool lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p, lv_coord_t radius); +bool _lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p, lv_coord_t radius); -/** - * Increment or decrement an area's size by a single amount - * @param a_p pointer to an area to grow - * @param amount amount to increment the area, or negative to decrement - */ -void lv_area_increment(lv_area_t * a_p, const lv_coord_t amount); /** * Align an area to an other @@ -208,7 +202,8 @@ void lv_area_increment(lv_area_t * a_p, const lv_coord_t amount); * @param align `LV_ALIGN_...` * @param res x/y coordinates where `to_align` align area should be placed */ -void lv_area_align(const lv_area_t * base, const lv_area_t * to_align, lv_align_t align, lv_point_t * res); +void _lv_area_align(const lv_area_t * base, const lv_area_t * to_align, lv_align_t align, lv_point_t * res); + /********************** * MACROS **********************/ diff --git a/src/lv_misc/lv_bidi.c b/src/lv_misc/lv_bidi.c index 0cbbaad31e..f4eba4c063 100644 --- a/src/lv_misc/lv_bidi.c +++ b/src/lv_misc/lv_bidi.c @@ -74,9 +74,9 @@ static uint8_t br_stack_p; * @param str_out store the result here. Has the be `strlen(str_in)` length * @param base_dir `LV_BIDI_DIR_LTR` or `LV_BIDI_DIR_RTL` */ -void lv_bidi_process(const char * str_in, char * str_out, lv_bidi_dir_t base_dir) +void _lv_bidi_process(const char * str_in, char * str_out, lv_bidi_dir_t base_dir) { - if(base_dir == LV_BIDI_DIR_AUTO) base_dir = lv_bidi_detect_base_dir(str_in); + if(base_dir == LV_BIDI_DIR_AUTO) base_dir = _lv_bidi_detect_base_dir(str_in); uint32_t par_start = 0; uint32_t par_len; @@ -88,7 +88,7 @@ void lv_bidi_process(const char * str_in, char * str_out, lv_bidi_dir_t base_dir while(str_in[par_start] != '\0') { par_len = lv_bidi_get_next_paragraph(&str_in[par_start]); - lv_bidi_process_paragraph(&str_in[par_start], &str_out[par_start], par_len, base_dir, NULL, 0); + _lv_bidi_process_paragraph(&str_in[par_start], &str_out[par_start], par_len, base_dir, NULL, 0); par_start += par_len; while(str_in[par_start] == '\n' || str_in[par_start] == '\r') { @@ -105,12 +105,12 @@ void lv_bidi_process(const char * str_in, char * str_out, lv_bidi_dir_t base_dir * @param txt the text to process * @return `LV_BIDI_DIR_LTR` or `LV_BIDI_DIR_RTL` */ -lv_bidi_dir_t lv_bidi_detect_base_dir(const char * txt) +lv_bidi_dir_t _lv_bidi_detect_base_dir(const char * txt) { uint32_t i = 0; uint32_t letter; while(txt[i] != '\0') { - letter = lv_txt_encoded_next(txt, &i); + letter = _lv_txt_encoded_next(txt, &i); lv_bidi_dir_t dir; dir = lv_bidi_get_letter_dir(letter); @@ -134,28 +134,28 @@ lv_bidi_dir_t lv_bidi_detect_base_dir(const char * txt) * @param is_rtl tell the the char at `viasual_pos` is RTL or LTR context * @return the logical character position */ -uint16_t lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_t len, lv_bidi_dir_t base_dir, +uint16_t _lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_t len, lv_bidi_dir_t base_dir, uint32_t visual_pos, bool * is_rtl) { uint32_t pos_conv_len = get_txt_len(str_in, len); - char * buf = lv_mem_buf_get(len + 1); + char * buf = _lv_mem_buf_get(len + 1); if(buf == NULL) return (uint16_t) -1; - uint16_t * pos_conv_buf = lv_mem_buf_get(pos_conv_len * sizeof(uint16_t)); + uint16_t * pos_conv_buf = _lv_mem_buf_get(pos_conv_len * sizeof(uint16_t)); if(pos_conv_buf == NULL) { - lv_mem_buf_release(buf); + _lv_mem_buf_release(buf); return (uint16_t) -1; } if(bidi_txt) *bidi_txt = buf; - lv_bidi_process_paragraph(str_in, bidi_txt ? *bidi_txt : NULL, len, base_dir, pos_conv_buf, pos_conv_len); + _lv_bidi_process_paragraph(str_in, bidi_txt ? *bidi_txt : NULL, len, base_dir, pos_conv_buf, pos_conv_len); if(is_rtl) *is_rtl = IS_RTL_POS(pos_conv_buf[visual_pos]); - if(bidi_txt == NULL) lv_mem_buf_release(buf); + if(bidi_txt == NULL) _lv_mem_buf_release(buf); uint16_t res = GET_POS(pos_conv_buf[visual_pos]); - lv_mem_buf_release(pos_conv_buf); + _lv_mem_buf_release(pos_conv_buf); return res; } @@ -171,35 +171,35 @@ uint16_t lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_t * @param is_rtl tell the the char at `logical_pos` is RTL or LTR context * @return the visual character position */ -uint16_t lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t len, lv_bidi_dir_t base_dir, +uint16_t _lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t len, lv_bidi_dir_t base_dir, uint32_t logical_pos, bool * is_rtl) { uint32_t pos_conv_len = get_txt_len(str_in, len); - char * buf = lv_mem_buf_get(len + 1); + char * buf = _lv_mem_buf_get(len + 1); if(buf == NULL) return (uint16_t) -1; - uint16_t * pos_conv_buf = lv_mem_buf_get(pos_conv_len * sizeof(uint16_t)); + uint16_t * pos_conv_buf = _lv_mem_buf_get(pos_conv_len * sizeof(uint16_t)); if(pos_conv_buf == NULL) { - lv_mem_buf_release(buf); + _lv_mem_buf_release(buf); return (uint16_t) -1; } if(bidi_txt) *bidi_txt = buf; - lv_bidi_process_paragraph(str_in, bidi_txt ? *bidi_txt : NULL, len, base_dir, pos_conv_buf, pos_conv_len); + _lv_bidi_process_paragraph(str_in, bidi_txt ? *bidi_txt : NULL, len, base_dir, pos_conv_buf, pos_conv_len); for(uint16_t i = 0; i < pos_conv_len; i++) { if(GET_POS(pos_conv_buf[i]) == logical_pos) { if(is_rtl) *is_rtl = IS_RTL_POS(pos_conv_buf[i]); - lv_mem_buf_release(pos_conv_buf); + _lv_mem_buf_release(pos_conv_buf); - if(bidi_txt == NULL) lv_mem_buf_release(buf); + if(bidi_txt == NULL) _lv_mem_buf_release(buf); return i; } } - lv_mem_buf_release(pos_conv_buf); - if(bidi_txt == NULL) lv_mem_buf_release(buf); + _lv_mem_buf_release(pos_conv_buf); + if(bidi_txt == NULL) _lv_mem_buf_release(buf); return (uint16_t) -1; } @@ -213,7 +213,7 @@ uint16_t lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t * Can be `NULL` is unused * @param pos_conv_len length of `pos_conv_out` in element count */ -void lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len, lv_bidi_dir_t base_dir, +void _lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len, lv_bidi_dir_t base_dir, uint16_t * pos_conv_out, uint16_t pos_conv_len) { uint32_t run_len = 0; @@ -224,7 +224,7 @@ void lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len uint16_t pos_conv_rd = 0; uint16_t pos_conv_wr; - if(base_dir == LV_BIDI_DIR_AUTO) base_dir = lv_bidi_detect_base_dir(str_in); + if(base_dir == LV_BIDI_DIR_AUTO) base_dir = _lv_bidi_detect_base_dir(str_in); if(base_dir == LV_BIDI_DIR_RTL) { wr = len; pos_conv_wr = pos_conv_len; @@ -243,7 +243,7 @@ void lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len /*Process neutral chars in the beginning*/ while(rd < len) { - uint32_t letter = lv_txt_encoded_next(str_in, &rd); + uint32_t letter = _lv_txt_encoded_next(str_in, &rd); pos_conv_rd++; dir = lv_bidi_get_letter_dir(letter); if(dir == LV_BIDI_DIR_NEUTRAL) dir = bracket_process(str_in, rd, len, letter, base_dir); @@ -251,14 +251,14 @@ void lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len } if(rd && str_in[rd] != '\0') { - lv_txt_encoded_prev(str_in, &rd); + _lv_txt_encoded_prev(str_in, &rd); pos_conv_rd--; } if(rd) { if(base_dir == LV_BIDI_DIR_LTR) { if(str_out) { - lv_memcpy(&str_out[wr], str_in, rd); + _lv_memcpy(&str_out[wr], str_in, rd); wr += rd; } if(pos_conv_out) { @@ -281,7 +281,7 @@ void lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len if(base_dir == LV_BIDI_DIR_LTR) { if(run_dir == LV_BIDI_DIR_LTR) { - if(str_out) lv_memcpy(&str_out[wr], &str_in[rd], run_len); + if(str_out) _lv_memcpy(&str_out[wr], &str_in[rd], run_len); if(pos_conv_out) fill_pos_conv(&pos_conv_out[pos_conv_wr], pos_conv_run_len, pos_conv_rd); } else rtl_reverse(str_out ? &str_out[wr] : NULL, &str_in[rd], run_len, pos_conv_out ? &pos_conv_out[pos_conv_wr] : NULL, @@ -293,7 +293,7 @@ void lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len wr -= run_len; pos_conv_wr -= pos_conv_run_len; if(run_dir == LV_BIDI_DIR_LTR) { - if(str_out) lv_memcpy(&str_out[wr], &str_in[rd], run_len); + if(str_out) _lv_memcpy(&str_out[wr], &str_in[rd], run_len); if(pos_conv_out) fill_pos_conv(&pos_conv_out[pos_conv_wr], pos_conv_run_len, pos_conv_rd); } else rtl_reverse(str_out ? &str_out[wr] : NULL, &str_in[rd], run_len, pos_conv_out ? &pos_conv_out[pos_conv_wr] : NULL, @@ -318,10 +318,10 @@ static uint32_t lv_bidi_get_next_paragraph(const char * txt) { uint32_t i = 0; - lv_txt_encoded_next(txt, &i); + _lv_txt_encoded_next(txt, &i); while(txt[i] != '\0' && txt[i] != '\n' && txt[i] != '\r') { - lv_txt_encoded_next(txt, &i); + _lv_txt_encoded_next(txt, &i); } return i; @@ -351,7 +351,7 @@ static bool lv_bidi_letter_is_weak(uint32_t letter) static const char weaks[] = "0123456789"; do { - uint32_t x = lv_txt_encoded_next(weaks, &i); + uint32_t x = _lv_txt_encoded_next(weaks, &i); if(letter == x) { return true; } @@ -399,7 +399,7 @@ static uint32_t get_txt_len(const char * txt, uint32_t max_len) uint32_t i = 0; while(i < max_len && txt[i] != '\0') { - lv_txt_encoded_next(txt, &i); + _lv_txt_encoded_next(txt, &i); len++; } @@ -423,13 +423,13 @@ static lv_bidi_dir_t get_next_run(const char * txt, lv_bidi_dir_t base_dir, uint uint16_t pos_conv_i = 0; - letter = lv_txt_encoded_next(txt, NULL); + letter = _lv_txt_encoded_next(txt, NULL); lv_bidi_dir_t dir = lv_bidi_get_letter_dir(letter); if(dir == LV_BIDI_DIR_NEUTRAL) dir = bracket_process(txt, 0, max_len, letter, base_dir); /*Find the first strong char. Skip the neutrals*/ while(dir == LV_BIDI_DIR_NEUTRAL || dir == LV_BIDI_DIR_WEAK) { - letter = lv_txt_encoded_next(txt, &i); + letter = _lv_txt_encoded_next(txt, &i); pos_conv_i++; dir = lv_bidi_get_letter_dir(letter); if(dir == LV_BIDI_DIR_NEUTRAL) dir = bracket_process(txt, i, max_len, letter, base_dir); @@ -451,7 +451,7 @@ static lv_bidi_dir_t get_next_run(const char * txt, lv_bidi_dir_t base_dir, uint /*Find the next char which has different direction*/ lv_bidi_dir_t next_dir = base_dir; while(i_prev < max_len && txt[i] != '\0' && txt[i] != '\n' && txt[i] != '\r') { - letter = lv_txt_encoded_next(txt, &i); + letter = _lv_txt_encoded_next(txt, &i); pos_conv_i++; next_dir = lv_bidi_get_letter_dir(letter); if(next_dir == LV_BIDI_DIR_NEUTRAL) next_dir = bracket_process(txt, i, max_len, letter, base_dir); @@ -506,7 +506,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t * uint16_t pos_conv_wr = 0; while(i) { - uint32_t letter = lv_txt_encoded_prev(src, &i); + uint32_t letter = _lv_txt_encoded_prev(src, &i); uint16_t pos_conv_letter = --pos_conv_i; /*Keep weak letters (numbers) as LTR*/ @@ -516,7 +516,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t * uint16_t pos_conv_last_weak = pos_conv_i; uint16_t pos_conv_first_weak = pos_conv_i; while(i) { - letter = lv_txt_encoded_prev(src, &i); + letter = _lv_txt_encoded_prev(src, &i); pos_conv_letter = --pos_conv_i; /*No need to call `char_change_to_pair` because there not such chars here*/ @@ -524,7 +524,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t * /*Finish on non-weak char */ /*but treat number and currency related chars as weak*/ if(lv_bidi_letter_is_weak(letter) == false && letter != '.' && letter != ',' && letter != '$' && letter != '%') { - lv_txt_encoded_next(src, &i); /*Rewind one letter*/ + _lv_txt_encoded_next(src, &i); /*Rewind one letter*/ pos_conv_i++; first_weak = i; pos_conv_first_weak = pos_conv_i; @@ -536,7 +536,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t * pos_conv_first_weak = 0; } - if(dest) lv_memcpy(&dest[wr], &src[first_weak], last_weak - first_weak + 1); + if(dest) _lv_memcpy(&dest[wr], &src[first_weak], last_weak - first_weak + 1); if(pos_conv_out) fill_pos_conv(&pos_conv_out[pos_conv_wr], pos_conv_last_weak - pos_conv_first_weak + 1, pos_conv_rd_base + pos_conv_first_weak); wr += last_weak - first_weak + 1; @@ -545,7 +545,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t * /*Simply store in reversed order*/ else { - uint32_t letter_size = lv_txt_encoded_size((const char *)&src[i]); + uint32_t letter_size = _lv_txt_encoded_size((const char *)&src[i]); /*Swap arithmetical symbols*/ if(letter_size == 1) { uint32_t new_letter = letter = char_change_to_pair(letter); @@ -556,7 +556,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t * } /*Just store the letter*/ else { - if(dest) lv_memcpy(&dest[wr], &src[i], letter_size); + if(dest) _lv_memcpy(&dest[wr], &src[i], letter_size); if(pos_conv_out) pos_conv_out[pos_conv_wr] = SET_RTL_POS(pos_conv_rd_base + pos_conv_i, true); wr += letter_size; pos_conv_wr++; @@ -593,7 +593,7 @@ static lv_bidi_dir_t bracket_process(const char * txt, uint32_t next_pos, uint32 * If a char with base dir. direction is found then the brackets will have `base_dir` direction*/ uint32_t txt_i = next_pos; while(txt_i < len) { - uint32_t letter_next = lv_txt_encoded_next(txt, &txt_i); + uint32_t letter_next = _lv_txt_encoded_next(txt, &txt_i); if(letter_next == bracket_right[i]) { /*Closing bracket found*/ break; @@ -615,9 +615,9 @@ static lv_bidi_dir_t bracket_process(const char * txt, uint32_t next_pos, uint32 /*If there were no matching strong chars in the brackets then check the previous chars*/ txt_i = next_pos; - if(txt_i) lv_txt_encoded_prev(txt, &txt_i); + if(txt_i) _lv_txt_encoded_prev(txt, &txt_i); while(txt_i > 0) { - uint32_t letter_next = lv_txt_encoded_prev(txt, &txt_i); + uint32_t letter_next = _lv_txt_encoded_prev(txt, &txt_i); lv_bidi_dir_t letter_dir = lv_bidi_get_letter_dir(letter_next); if(letter_dir == LV_BIDI_DIR_LTR || letter_dir == LV_BIDI_DIR_RTL) { bracket_dir = letter_dir; diff --git a/src/lv_misc/lv_bidi.h b/src/lv_misc/lv_bidi.h index 9f79ea6124..07cc694416 100644 --- a/src/lv_misc/lv_bidi.h +++ b/src/lv_misc/lv_bidi.h @@ -54,14 +54,14 @@ typedef uint8_t lv_bidi_dir_t; * @param str_out store the result here. Has the be `strlen(str_in)` length * @param base_dir `LV_BIDI_DIR_LTR` or `LV_BIDI_DIR_RTL` */ -void lv_bidi_process(const char * str_in, char * str_out, lv_bidi_dir_t base_dir); +void _lv_bidi_process(const char * str_in, char * str_out, lv_bidi_dir_t base_dir); /** * Auto-detect the direction of a text based on the first strong character * @param txt the text to process * @return `LV_BIDI_DIR_LTR` or `LV_BIDI_DIR_RTL` */ -lv_bidi_dir_t lv_bidi_detect_base_dir(const char * txt); +lv_bidi_dir_t _lv_bidi_detect_base_dir(const char * txt); /** * Get the logical position of a character in a line @@ -75,7 +75,7 @@ lv_bidi_dir_t lv_bidi_detect_base_dir(const char * txt); * @param is_rtl tell the the char at `viasual_pos` is RTL or LTR context * @return the logical character position */ -uint16_t lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_t len, lv_bidi_dir_t base_dir, +uint16_t _lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_t len, lv_bidi_dir_t base_dir, uint32_t visual_pos, bool * is_rtl); /** @@ -90,7 +90,7 @@ uint16_t lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_t * @param is_rtl tell the the char at `logical_pos` is RTL or LTR context * @return the visual character position */ -uint16_t lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t len, lv_bidi_dir_t base_dir, +uint16_t _lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t len, lv_bidi_dir_t base_dir, uint32_t logical_pos, bool * is_rtl); /** @@ -103,7 +103,7 @@ uint16_t lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t * Can be `NULL` is unused * @param pos_conv_len length of `pos_conv_out` in element count */ -void lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len, lv_bidi_dir_t base_dir, +void _lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len, lv_bidi_dir_t base_dir, uint16_t * pos_conv_out, uint16_t pos_conv_len); /********************** diff --git a/src/lv_misc/lv_circ.c b/src/lv_misc/lv_circ.c deleted file mode 100644 index 4132a98e64..0000000000 --- a/src/lv_misc/lv_circ.c +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @file lv_circ.c - * Circle drawing algorithm (with Bresenham) - * Only a 1/8 circle is calculated. Use CIRC_OCT1_X, CIRC_OCT1_Y macros to get - * the other octets. - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_circ.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -/** - * Initialize the circle drawing - * @param c pointer to a point. The coordinates will be calculated here - * @param tmp point to a variable. It will store temporary data - * @param radius radius of the circle - */ -void lv_circ_init(lv_point_t * c, lv_coord_t * tmp, lv_coord_t radius) -{ - c->x = radius; - c->y = 0; - *tmp = 1 - radius; -} - -/** - * Test the circle drawing is ready or not - * @param c same as in circ_init - * @return true if the circle is not ready yet - */ -bool lv_circ_cont(lv_point_t * c) -{ - return c->y <= c->x ? true : false; -} - -/** - * Get the next point from the circle - * @param c same as in circ_init. The next point stored here. - * @param tmp same as in circ_init. - */ -void lv_circ_next(lv_point_t * c, lv_coord_t * tmp) -{ - c->y++; - - if(*tmp <= 0) { - (*tmp) += 2 * c->y + 1; /*Change in decision criterion for y -> y+1*/ - } - else { - c->x--; - (*tmp) += 2 * (c->y - c->x) + 1; /*Change for y -> y+1, x -> x-1*/ - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ diff --git a/src/lv_misc/lv_circ.h b/src/lv_misc/lv_circ.h deleted file mode 100644 index 405a4b6c3a..0000000000 --- a/src/lv_misc/lv_circ.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file lv_circ.h - * - */ - -#ifndef LV_CIRC_H -#define LV_CIRC_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include -#include "lv_area.h" - -/********************* - * DEFINES - *********************/ -#define LV_CIRC_OCT1_X(p) (p.x) -#define LV_CIRC_OCT1_Y(p) (p.y) -#define LV_CIRC_OCT2_X(p) (p.y) -#define LV_CIRC_OCT2_Y(p) (p.x) -#define LV_CIRC_OCT3_X(p) (-p.y) -#define LV_CIRC_OCT3_Y(p) (p.x) -#define LV_CIRC_OCT4_X(p) (-p.x) -#define LV_CIRC_OCT4_Y(p) (p.y) -#define LV_CIRC_OCT5_X(p) (-p.x) -#define LV_CIRC_OCT5_Y(p) (-p.y) -#define LV_CIRC_OCT6_X(p) (-p.y) -#define LV_CIRC_OCT6_Y(p) (-p.x) -#define LV_CIRC_OCT7_X(p) (p.y) -#define LV_CIRC_OCT7_Y(p) (-p.x) -#define LV_CIRC_OCT8_X(p) (p.x) -#define LV_CIRC_OCT8_Y(p) (-p.y) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize the circle drawing - * @param c pointer to a point. The coordinates will be calculated here - * @param tmp point to a variable. It will store temporary data - * @param radius radius of the circle - */ -void lv_circ_init(lv_point_t * c, lv_coord_t * tmp, lv_coord_t radius); - -/** - * Test the circle drawing is ready or not - * @param c same as in circ_init - * @return true if the circle is not ready yet - */ -bool lv_circ_cont(lv_point_t * c); - -/** - * Get the next point from the circle - * @param c same as in circ_init. The next point stored here. - * @param tmp same as in circ_init. - */ -void lv_circ_next(lv_point_t * c, lv_coord_t * tmp); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/lv_misc/lv_fs.c b/src/lv_misc/lv_fs.c index 5070d5d7ba..4f25af799c 100644 --- a/src/lv_misc/lv_fs.c +++ b/src/lv_misc/lv_fs.c @@ -54,9 +54,9 @@ static const char * lv_fs_get_real_path(const char * path); /** * Initialize the File system interface */ -void lv_fs_init(void) +void _lv_fs_init(void) { - lv_ll_init(&LV_GC_ROOT(_lv_drv_ll), sizeof(lv_fs_drv_t)); + _lv_ll_init(&LV_GC_ROOT(_lv_drv_ll), sizeof(lv_fs_drv_t)); } /** @@ -475,7 +475,7 @@ lv_fs_res_t lv_fs_free_space(char letter, uint32_t * total_p, uint32_t * free_p) */ void lv_fs_drv_init(lv_fs_drv_t * drv) { - lv_memset_00(drv, sizeof(lv_fs_drv_t)); + _lv_memset_00(drv, sizeof(lv_fs_drv_t)); } /** @@ -487,11 +487,11 @@ void lv_fs_drv_register(lv_fs_drv_t * drv_p) { /*Save the new driver*/ lv_fs_drv_t * new_drv; - new_drv = lv_ll_ins_head(&LV_GC_ROOT(_lv_drv_ll)); + new_drv = _lv_ll_ins_head(&LV_GC_ROOT(_lv_drv_ll)); LV_ASSERT_MEM(new_drv); if(new_drv == NULL) return; - lv_memcpy(new_drv, drv_p, sizeof(lv_fs_drv_t)); + _lv_memcpy(new_drv, drv_p, sizeof(lv_fs_drv_t)); } /** @@ -503,7 +503,7 @@ lv_fs_drv_t * lv_fs_get_drv(char letter) { lv_fs_drv_t * drv; - LV_LL_READ(LV_GC_ROOT(_lv_drv_ll), drv) { + _LV_LL_READ(LV_GC_ROOT(_lv_drv_ll), drv) { if(drv->letter == letter) { return drv; } @@ -521,7 +521,7 @@ char * lv_fs_get_letters(char * buf) lv_fs_drv_t * drv; uint8_t i = 0; - LV_LL_READ(LV_GC_ROOT(_lv_drv_ll), drv) { + _LV_LL_READ(LV_GC_ROOT(_lv_drv_ll), drv) { buf[i] = drv->letter; i++; } diff --git a/src/lv_misc/lv_fs.h b/src/lv_misc/lv_fs.h index daa7e59c7d..dc80d9fc14 100644 --- a/src/lv_misc/lv_fs.h +++ b/src/lv_misc/lv_fs.h @@ -104,7 +104,7 @@ typedef struct { /** * Initialize the File system interface */ -void lv_fs_init(void); +void _lv_fs_init(void); /** * Initialize a file system driver with default values. diff --git a/src/lv_misc/lv_gc.c b/src/lv_misc/lv_gc.c index 2ce1fa0508..a9b3558615 100644 --- a/src/lv_misc/lv_gc.c +++ b/src/lv_misc/lv_gc.c @@ -42,9 +42,9 @@ * GLOBAL FUNCTIONS **********************/ -void lv_gc_clear_roots(void) +void _lv_gc_clear_roots(void) { -#define LV_CLEAR_ROOT(root_type, root_name) lv_memset_00(&LV_GC_ROOT(root_name), sizeof(LV_GC_ROOT(root_name))); +#define LV_CLEAR_ROOT(root_type, root_name) _lv_memset_00(&LV_GC_ROOT(root_name), sizeof(LV_GC_ROOT(root_name))); LV_ITERATE_ROOTS(LV_CLEAR_ROOT) } diff --git a/src/lv_misc/lv_gc.h b/src/lv_misc/lv_gc.h index f25fd8e61e..936795faf4 100644 --- a/src/lv_misc/lv_gc.h +++ b/src/lv_misc/lv_gc.h @@ -60,7 +60,7 @@ LV_ITERATE_ROOTS(LV_EXTERN_ROOT) * GLOBAL PROTOTYPES **********************/ -void lv_gc_clear_roots(void); +void _lv_gc_clear_roots(void); /********************** * MACROS diff --git a/src/lv_misc/lv_ll.c b/src/lv_misc/lv_ll.c index c48fb67d89..f2ec563c89 100644 --- a/src/lv_misc/lv_ll.c +++ b/src/lv_misc/lv_ll.c @@ -47,7 +47,7 @@ static void node_set_next(lv_ll_t * ll_p, lv_ll_node_t * act, lv_ll_node_t * nex * @param ll_dsc pointer to ll_dsc variable * @param node_size the size of 1 node in bytes */ -void lv_ll_init(lv_ll_t * ll_p, uint32_t node_size) +void _lv_ll_init(lv_ll_t * ll_p, uint32_t node_size) { ll_p->head = NULL; ll_p->tail = NULL; @@ -73,7 +73,7 @@ void lv_ll_init(lv_ll_t * ll_p, uint32_t node_size) * @param ll_p pointer to linked list * @return pointer to the new head */ -void * lv_ll_ins_head(lv_ll_t * ll_p) +void * _lv_ll_ins_head(lv_ll_t * ll_p) { lv_ll_node_t * n_new; @@ -102,14 +102,14 @@ void * lv_ll_ins_head(lv_ll_t * ll_p) * @param n_act pointer a node * @return pointer to the new head */ -void * lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act) +void * _lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act) { lv_ll_node_t * n_new; if(NULL == ll_p || NULL == n_act) return NULL; - if(lv_ll_get_head(ll_p) == n_act) { - n_new = lv_ll_ins_head(ll_p); + if(_lv_ll_get_head(ll_p) == n_act) { + n_new = _lv_ll_ins_head(ll_p); if(n_new == NULL) return NULL; } else { @@ -117,7 +117,7 @@ void * lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act) if(n_new == NULL) return NULL; lv_ll_node_t * n_prev; - n_prev = lv_ll_get_prev(ll_p, n_act); + n_prev = _lv_ll_get_prev(ll_p, n_act); node_set_next(ll_p, n_prev, n_new); node_set_prev(ll_p, n_new, n_prev); node_set_prev(ll_p, n_act, n_new); @@ -132,7 +132,7 @@ void * lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act) * @param ll_p pointer to linked list * @return pointer to the new tail */ -void * lv_ll_ins_tail(lv_ll_t * ll_p) +void * _lv_ll_ins_tail(lv_ll_t * ll_p) { lv_ll_node_t * n_new; @@ -160,11 +160,11 @@ void * lv_ll_ins_tail(lv_ll_t * ll_p) * @param ll_p pointer to the linked list of 'node_p' * @param node_p pointer to node in 'll_p' linked list */ -void lv_ll_remove(lv_ll_t * ll_p, void * node_p) +void _lv_ll_remove(lv_ll_t * ll_p, void * node_p) { - if(lv_ll_get_head(ll_p) == node_p) { + if(_lv_ll_get_head(ll_p) == node_p) { /*The new head will be the node after 'n_act'*/ - ll_p->head = lv_ll_get_next(ll_p, node_p); + ll_p->head = _lv_ll_get_next(ll_p, node_p); if(ll_p->head == NULL) { ll_p->tail = NULL; } @@ -172,9 +172,9 @@ void lv_ll_remove(lv_ll_t * ll_p, void * node_p) node_set_prev(ll_p, ll_p->head, NULL); } } - else if(lv_ll_get_tail(ll_p) == node_p) { + else if(_lv_ll_get_tail(ll_p) == node_p) { /*The new tail will be the node before 'n_act'*/ - ll_p->tail = lv_ll_get_prev(ll_p, node_p); + ll_p->tail = _lv_ll_get_prev(ll_p, node_p); if(ll_p->tail == NULL) { ll_p->head = NULL; } @@ -183,8 +183,8 @@ void lv_ll_remove(lv_ll_t * ll_p, void * node_p) } } else { - lv_ll_node_t * n_prev = lv_ll_get_prev(ll_p, node_p); - lv_ll_node_t * n_next = lv_ll_get_next(ll_p, node_p); + lv_ll_node_t * n_prev = _lv_ll_get_prev(ll_p, node_p); + lv_ll_node_t * n_next = _lv_ll_get_next(ll_p, node_p); node_set_next(ll_p, n_prev, n_next); node_set_prev(ll_p, n_next, n_prev); @@ -195,18 +195,18 @@ void lv_ll_remove(lv_ll_t * ll_p, void * node_p) * Remove and free all elements from a linked list. The list remain valid but become empty. * @param ll_p pointer to linked list */ -void lv_ll_clear(lv_ll_t * ll_p) +void _lv_ll_clear(lv_ll_t * ll_p) { void * i; void * i_next; - i = lv_ll_get_head(ll_p); + i = _lv_ll_get_head(ll_p); i_next = NULL; while(i != NULL) { - i_next = lv_ll_get_next(ll_p, i); + i_next = _lv_ll_get_next(ll_p, i); - lv_ll_remove(ll_p, i); + _lv_ll_remove(ll_p, i); lv_mem_free(i); i = i_next; @@ -221,9 +221,9 @@ void lv_ll_clear(lv_ll_t * ll_p) * @param head true: be the head in the new list * false be the head in the new list */ -void lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool head) +void _lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool head) { - lv_ll_remove(ll_ori_p, node); + _lv_ll_remove(ll_ori_p, node); if(head) { /*Set node as head*/ @@ -260,7 +260,7 @@ void lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool he * @param ll_p pointer to linked list * @return pointer to the head of 'll_p' */ -void * lv_ll_get_head(const lv_ll_t * ll_p) +void * _lv_ll_get_head(const lv_ll_t * ll_p) { void * head = NULL; @@ -276,7 +276,7 @@ void * lv_ll_get_head(const lv_ll_t * ll_p) * @param ll_p pointer to linked list * @return pointer to the head of 'll_p' */ -void * lv_ll_get_tail(const lv_ll_t * ll_p) +void * _lv_ll_get_tail(const lv_ll_t * ll_p) { void * tail = NULL; @@ -293,13 +293,13 @@ void * lv_ll_get_tail(const lv_ll_t * ll_p) * @param n_act pointer a node * @return pointer to the next node */ -void * lv_ll_get_next(const lv_ll_t * ll_p, const void * n_act) +void * _lv_ll_get_next(const lv_ll_t * ll_p, const void * n_act) { void * next = NULL; if(ll_p != NULL) { const lv_ll_node_t * n_act_d = n_act; - lv_memcpy_small(&next, n_act_d + LL_NEXT_P_OFFSET(ll_p), sizeof(void *)); + _lv_memcpy_small(&next, n_act_d + LL_NEXT_P_OFFSET(ll_p), sizeof(void *)); } return next; @@ -311,13 +311,13 @@ void * lv_ll_get_next(const lv_ll_t * ll_p, const void * n_act) * @param n_act pointer a node * @return pointer to the previous node */ -void * lv_ll_get_prev(const lv_ll_t * ll_p, const void * n_act) +void * _lv_ll_get_prev(const lv_ll_t * ll_p, const void * n_act) { void * prev = NULL; if(ll_p != NULL) { const lv_ll_node_t * n_act_d = n_act; - lv_memcpy_small(&prev, n_act_d + LL_PREV_P_OFFSET(ll_p), sizeof(void *)); + _lv_memcpy_small(&prev, n_act_d + LL_PREV_P_OFFSET(ll_p), sizeof(void *)); } return prev; @@ -328,12 +328,12 @@ void * lv_ll_get_prev(const lv_ll_t * ll_p, const void * n_act) * @param ll_p pointer to linked list * @return length of the linked list */ -uint32_t lv_ll_get_len(const lv_ll_t * ll_p) +uint32_t _lv_ll_get_len(const lv_ll_t * ll_p) { uint32_t len = 0; void * node; - for(node = lv_ll_get_head(ll_p); node != NULL; node = lv_ll_get_next(ll_p, node)) { + for(node = _lv_ll_get_head(ll_p); node != NULL; node = _lv_ll_get_next(ll_p, node)) { len++; } @@ -346,20 +346,20 @@ uint32_t lv_ll_get_len(const lv_ll_t * ll_p) * @param n_act pointer to node to move * @param n_after pointer to a node which should be after `n_act` */ -void lv_ll_move_before(lv_ll_t * ll_p, void * n_act, void * n_after) +void _lv_ll_move_before(lv_ll_t * ll_p, void * n_act, void * n_after) { if(n_act == n_after) return; /*Can't move before itself*/ void * n_before; if(n_after != NULL) - n_before = lv_ll_get_prev(ll_p, n_after); + n_before = _lv_ll_get_prev(ll_p, n_after); else - n_before = lv_ll_get_tail(ll_p); /*if `n_after` is NULL `n_act` should be the new tail*/ + n_before = _lv_ll_get_tail(ll_p); /*if `n_after` is NULL `n_act` should be the new tail*/ if(n_act == n_before) return; /*Already before `n_after`*/ /*It's much easier to remove from the list and add again*/ - lv_ll_remove(ll_p, n_act); + _lv_ll_remove(ll_p, n_act); /*Add again by setting the prev. and next nodes*/ node_set_next(ll_p, n_before, n_act); @@ -379,7 +379,7 @@ void lv_ll_move_before(lv_ll_t * ll_p, void * n_act, void * n_after) * @param ll_p pointer to a linked list * @return true: the linked list is empty; false: not empty */ -bool lv_ll_is_empty(lv_ll_t * ll_p) +bool _lv_ll_is_empty(lv_ll_t * ll_p) { if(ll_p == NULL) return true; @@ -404,9 +404,9 @@ static void node_set_prev(lv_ll_t * ll_p, lv_ll_node_t * act, lv_ll_node_t * pre uint32_t node_p_size = sizeof(lv_ll_node_t *); if(prev) - lv_memcpy_small(act + LL_PREV_P_OFFSET(ll_p), &prev, node_p_size); + _lv_memcpy_small(act + LL_PREV_P_OFFSET(ll_p), &prev, node_p_size); else - lv_memset_00(act + LL_PREV_P_OFFSET(ll_p), node_p_size); + _lv_memset_00(act + LL_PREV_P_OFFSET(ll_p), node_p_size); } /** @@ -421,7 +421,7 @@ static void node_set_next(lv_ll_t * ll_p, lv_ll_node_t * act, lv_ll_node_t * nex uint32_t node_p_size = sizeof(lv_ll_node_t *); if(next) - lv_memcpy_small(act + LL_NEXT_P_OFFSET(ll_p), &next, node_p_size); + _lv_memcpy_small(act + LL_NEXT_P_OFFSET(ll_p), &next, node_p_size); else - lv_memset_00(act + LL_NEXT_P_OFFSET(ll_p), node_p_size); + _lv_memset_00(act + LL_NEXT_P_OFFSET(ll_p), node_p_size); } diff --git a/src/lv_misc/lv_ll.h b/src/lv_misc/lv_ll.h index 1d03b6ab8b..570908cf7f 100644 --- a/src/lv_misc/lv_ll.h +++ b/src/lv_misc/lv_ll.h @@ -45,14 +45,14 @@ typedef struct { * @param ll_dsc pointer to ll_dsc variable * @param node_size the size of 1 node in bytes */ -void lv_ll_init(lv_ll_t * ll_p, uint32_t node_size); +void _lv_ll_init(lv_ll_t * ll_p, uint32_t node_size); /** * Add a new head to a linked list * @param ll_p pointer to linked list * @return pointer to the new head */ -void * lv_ll_ins_head(lv_ll_t * ll_p); +void * _lv_ll_ins_head(lv_ll_t * ll_p); /** * Insert a new node in front of the n_act node @@ -60,14 +60,14 @@ void * lv_ll_ins_head(lv_ll_t * ll_p); * @param n_act pointer a node * @return pointer to the new head */ -void * lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act); +void * _lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act); /** * Add a new tail to a linked list * @param ll_p pointer to linked list * @return pointer to the new tail */ -void * lv_ll_ins_tail(lv_ll_t * ll_p); +void * _lv_ll_ins_tail(lv_ll_t * ll_p); /** * Remove the node 'node_p' from 'll_p' linked list. @@ -75,13 +75,13 @@ void * lv_ll_ins_tail(lv_ll_t * ll_p); * @param ll_p pointer to the linked list of 'node_p' * @param node_p pointer to node in 'll_p' linked list */ -void lv_ll_remove(lv_ll_t * ll_p, void * node_p); +void _lv_ll_remove(lv_ll_t * ll_p, void * node_p); /** * Remove and free all elements from a linked list. The list remain valid but become empty. * @param ll_p pointer to linked list */ -void lv_ll_clear(lv_ll_t * ll_p); +void _lv_ll_clear(lv_ll_t * ll_p); /** * Move a node to a new linked list @@ -91,21 +91,21 @@ void lv_ll_clear(lv_ll_t * ll_p); * @param head true: be the head in the new list * false be the head in the new list */ -void lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool head); +void _lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool head); /** * Return with head node of the linked list * @param ll_p pointer to linked list * @return pointer to the head of 'll_p' */ -void * lv_ll_get_head(const lv_ll_t * ll_p); +void * _lv_ll_get_head(const lv_ll_t * ll_p); /** * Return with tail node of the linked list * @param ll_p pointer to linked list * @return pointer to the head of 'll_p' */ -void * lv_ll_get_tail(const lv_ll_t * ll_p); +void * _lv_ll_get_tail(const lv_ll_t * ll_p); /** * Return with the pointer of the next node after 'n_act' @@ -113,7 +113,7 @@ void * lv_ll_get_tail(const lv_ll_t * ll_p); * @param n_act pointer a node * @return pointer to the next node */ -void * lv_ll_get_next(const lv_ll_t * ll_p, const void * n_act); +void * _lv_ll_get_next(const lv_ll_t * ll_p, const void * n_act); /** * Return with the pointer of the previous node after 'n_act' @@ -121,14 +121,14 @@ void * lv_ll_get_next(const lv_ll_t * ll_p, const void * n_act); * @param n_act pointer a node * @return pointer to the previous node */ -void * lv_ll_get_prev(const lv_ll_t * ll_p, const void * n_act); +void * _lv_ll_get_prev(const lv_ll_t * ll_p, const void * n_act); /** * Return the length of the linked list. * @param ll_p pointer to linked list * @return length of the linked list */ -uint32_t lv_ll_get_len(const lv_ll_t * ll_p); +uint32_t _lv_ll_get_len(const lv_ll_t * ll_p); /** * TODO @@ -144,21 +144,22 @@ void lv_ll_swap(lv_ll_t * ll_p, void * n1_p, void * n2_p); * @param n_act pointer to node to move * @param n_after pointer to a node which should be after `n_act` */ -void lv_ll_move_before(lv_ll_t * ll_p, void * n_act, void * n_after); +void _lv_ll_move_before(lv_ll_t * ll_p, void * n_act, void * n_after); /** * Check if a linked list is empty * @param ll_p pointer to a linked list * @return true: the linked list is empty; false: not empty */ -bool lv_ll_is_empty(lv_ll_t * ll_p); +bool _lv_ll_is_empty(lv_ll_t * ll_p); + /********************** * MACROS **********************/ -#define LV_LL_READ(list, i) for(i = lv_ll_get_head(&list); i != NULL; i = lv_ll_get_next(&list, i)) +#define _LV_LL_READ(list, i) for(i = _lv_ll_get_head(&list); i != NULL; i = _lv_ll_get_next(&list, i)) -#define LV_LL_READ_BACK(list, i) for(i = lv_ll_get_tail(&list); i != NULL; i = lv_ll_get_prev(&list, i)) +#define _LV_LL_READ_BACK(list, i) for(i = _lv_ll_get_tail(&list); i != NULL; i = _lv_ll_get_prev(&list, i)) #ifdef __cplusplus } /* extern "C" */ diff --git a/src/lv_misc/lv_log.c b/src/lv_misc/lv_log.c index c8dbf07283..a642513e5f 100644 --- a/src/lv_misc/lv_log.c +++ b/src/lv_misc/lv_log.c @@ -63,7 +63,7 @@ void lv_log_register_print_cb(lv_log_print_g_cb_t print_cb) * @param format printf-like format string * @param ... parameters for `format` */ -void lv_log_add(lv_log_level_t level, const char * file, int line, const char * func, const char * format, ...) +void _lv_log_add(lv_log_level_t level, const char * file, int line, const char * func, const char * format, ...) { if(level >= _LV_LOG_LEVEL_NUM) return; /*Invalid level*/ diff --git a/src/lv_misc/lv_log.h b/src/lv_misc/lv_log.h index 9423848122..ed1f04209e 100644 --- a/src/lv_misc/lv_log.h +++ b/src/lv_misc/lv_log.h @@ -70,14 +70,14 @@ void lv_log_register_print_cb(lv_log_print_g_cb_t print_cb); * @param format printf-like format string * @param ... parameters for `format` */ -void lv_log_add(lv_log_level_t level, const char * file, int line, const char * func, const char * format, ...); +void _lv_log_add(lv_log_level_t level, const char * file, int line, const char * func, const char * format, ...); /********************** * MACROS **********************/ #if LV_LOG_LEVEL <= LV_LOG_LEVEL_TRACE -#define LV_LOG_TRACE(...) lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, __func__, __VA_ARGS__); +#define LV_LOG_TRACE(...) _lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, __func__, __VA_ARGS__); #else #define LV_LOG_TRACE(...) \ { \ @@ -86,7 +86,7 @@ void lv_log_add(lv_log_level_t level, const char * file, int line, const char * #endif #if LV_LOG_LEVEL <= LV_LOG_LEVEL_INFO -#define LV_LOG_INFO(...) lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__); +#define LV_LOG_INFO(...) _lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__); #else #define LV_LOG_INFO(...) \ { \ @@ -95,7 +95,7 @@ void lv_log_add(lv_log_level_t level, const char * file, int line, const char * #endif #if LV_LOG_LEVEL <= LV_LOG_LEVEL_WARN -#define LV_LOG_WARN(...) lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, __func__, __VA_ARGS__); +#define LV_LOG_WARN(...) _lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, __func__, __VA_ARGS__); #else #define LV_LOG_WARN(...) \ { \ @@ -104,7 +104,7 @@ void lv_log_add(lv_log_level_t level, const char * file, int line, const char * #endif #if LV_LOG_LEVEL <= LV_LOG_LEVEL_ERROR -#define LV_LOG_ERROR(...) lv_log_add(LV_LOG_LEVEL_ERROR, __FILE__, __LINE__, __func__, __VA_ARGS__); +#define LV_LOG_ERROR(...) _lv_log_add(LV_LOG_LEVEL_ERROR, __FILE__, __LINE__, __func__, __VA_ARGS__); #else #define LV_LOG_ERROR(...) \ { \ @@ -113,7 +113,7 @@ void lv_log_add(lv_log_level_t level, const char * file, int line, const char * #endif #if LV_LOG_LEVEL <= LV_LOG_LEVEL_USER -#define LV_LOG_USER(...) lv_log_add(LV_LOG_LEVEL_USER, __FILE__, __LINE__, __func__, __VA_ARGS__); +#define LV_LOG_USER(...) _lv_log_add(LV_LOG_LEVEL_USER, __FILE__, __LINE__, __func__, __VA_ARGS__); #else #define LV_LOG_USER(...) \ { \ @@ -124,7 +124,7 @@ void lv_log_add(lv_log_level_t level, const char * file, int line, const char * #else /*LV_USE_LOG*/ /*Do nothing if `LV_USE_LOG 0`*/ -#define lv_log_add(level, file, line, ...) \ +#define _lv_log_add(level, file, line, ...) \ { \ ; \ } diff --git a/src/lv_misc/lv_math.c b/src/lv_misc/lv_math.c index ecc75e29b3..36a1531a80 100644 --- a/src/lv_misc/lv_math.c +++ b/src/lv_misc/lv_math.c @@ -50,7 +50,7 @@ static const int16_t sin0_90_table[] = { * @param angle * @return sinus of 'angle'. sin(-90) = -32767, sin(90) = 32767 */ -LV_ATTRIBUTE_FAST_MEM int16_t lv_trigo_sin(int16_t angle) +LV_ATTRIBUTE_FAST_MEM int16_t _lv_trigo_sin(int16_t angle) { int16_t ret = 0; angle = angle % 360; @@ -85,7 +85,7 @@ LV_ATTRIBUTE_FAST_MEM int16_t lv_trigo_sin(int16_t angle) * @param u3 end values in range of [0..LV_BEZIER_VAL_MAX] * @return the value calculated from the given parameters in range of [0..LV_BEZIER_VAL_MAX] */ -int32_t lv_bezier3(uint32_t t, int32_t u0, int32_t u1, int32_t u2, int32_t u3) +int32_t _lv_bezier3(uint32_t t, int32_t u0, int32_t u1, int32_t u2, int32_t u3) { uint32_t t_rem = 1024 - t; uint32_t t_rem2 = (t_rem * t_rem) >> 10; @@ -111,7 +111,7 @@ int32_t lv_bezier3(uint32_t t, int32_t u0, int32_t u1, int32_t u2, int32_t u3) * If root < 256: mask = 0x800 * Else: mask = 0x8000 */ -LV_ATTRIBUTE_FAST_MEM void lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t mask) +LV_ATTRIBUTE_FAST_MEM void _lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t mask) { x = x << 8; /*To get 4 bit precision. (sqrt(256) = 16 = 4 bit)*/ @@ -135,7 +135,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t mask) * @param y * @return the angle in degree calculated from the given parameters in range of [0..360] */ -uint16_t lv_atan2(int x, int y) +uint16_t _lv_atan2(int x, int y) { // Fast XY vector to integer degree algorithm - Jan 2011 www.RomanBlack.com // Converts any XY values including 0 to a degree value that should be @@ -219,7 +219,7 @@ uint16_t lv_atan2(int x, int y) * @param power * @return base raised to the power exponent */ -int64_t lv_pow(int64_t base, int8_t exp) +int64_t _lv_pow(int64_t base, int8_t exp) { int64_t result = 1; while (exp) diff --git a/src/lv_misc/lv_math.h b/src/lv_misc/lv_math.h index 2acfba64cf..7911e032e7 100644 --- a/src/lv_misc/lv_math.h +++ b/src/lv_misc/lv_math.h @@ -63,7 +63,7 @@ typedef struct { * @param angle * @return sinus of 'angle'. sin(-90) = -32767, sin(90) = 32767 */ -LV_ATTRIBUTE_FAST_MEM int16_t lv_trigo_sin(int16_t angle); +LV_ATTRIBUTE_FAST_MEM int16_t _lv_trigo_sin(int16_t angle); /** * Calculate a value of a Cubic Bezier function. @@ -74,15 +74,15 @@ LV_ATTRIBUTE_FAST_MEM int16_t lv_trigo_sin(int16_t angle); * @param u3 end values in range of [0..LV_BEZIER_VAL_MAX] * @return the value calculated from the given parameters in range of [0..LV_BEZIER_VAL_MAX] */ -int32_t lv_bezier3(uint32_t t, int32_t u0, int32_t u1, int32_t u2, int32_t u3); +int32_t _lv_bezier3(uint32_t t, int32_t u0, int32_t u1, int32_t u2, int32_t u3); -/* +/** * Calculate the atan2 of a vector. * @param x * @param y * @return the angle in degree calculated from the given parameters in range of [0..360] */ -uint16_t lv_atan2(int x, int y); +uint16_t _lv_atan2(int x, int y); /** * Get the square root of a number @@ -94,7 +94,7 @@ uint16_t lv_atan2(int x, int y); * If root < 256: mask = 0x800 * Else: mask = 0x8000 */ -LV_ATTRIBUTE_FAST_MEM void lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t mask); +LV_ATTRIBUTE_FAST_MEM void _lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t mask); /** * Calculate the integer exponents. @@ -102,7 +102,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t mask) * @param power * @return base raised to the power exponent */ -int64_t lv_pow(int64_t base, int8_t exp); +int64_t _lv_pow(int64_t base, int8_t exp); /********************** * MACROS diff --git a/src/lv_misc/lv_mem.c b/src/lv_misc/lv_mem.c index a2fbe06f0f..d1b2d59657 100644 --- a/src/lv_misc/lv_mem.c +++ b/src/lv_misc/lv_mem.c @@ -109,7 +109,7 @@ static lv_mem_buf_t mem_buf_small[] = {{.p = mem_buf1_32, .size = MEM_BUF_SMALL_ /** * Initiaiize the dyn_mem module (work memory and other variables) */ -void lv_mem_init(void) +void _lv_mem_init(void) { #if LV_MEM_CUSTOM == 0 @@ -132,10 +132,10 @@ void lv_mem_init(void) * Clean up the memory buffer which frees all the allocated memories. * @note It work only if `LV_MEM_CUSTOM == 0` */ -void lv_mem_deinit(void) +void _lv_mem_deinit(void) { #if LV_MEM_CUSTOM == 0 - lv_memset_00(work_mem, (LV_MEM_SIZE / sizeof(MEM_UNIT)) * sizeof(MEM_UNIT)); + _lv_memset_00(work_mem, (LV_MEM_SIZE / sizeof(MEM_UNIT)) * sizeof(MEM_UNIT)); lv_mem_ent_t * full = (lv_mem_ent_t *)work_mem; full->header.s.used = 0; /*The total mem size id reduced by the first header and the close patterns */ @@ -202,7 +202,7 @@ void * lv_mem_alloc(size_t size) #endif /* LV_MEM_CUSTOM */ #if LV_MEM_ADD_JUNK - if(alloc != NULL) lv_memset(alloc, 0xaa, size); + if(alloc != NULL) _lv_memset(alloc, 0xaa, size); #endif if(alloc == NULL) LV_LOG_WARN("Couldn't allocate memory"); @@ -220,7 +220,7 @@ void lv_mem_free(const void * data) if(data == NULL) return; #if LV_MEM_ADD_JUNK - lv_memset((void *)data, 0xbb, lv_mem_get_size(data)); + _lv_memset((void *)data, 0xbb, _lv_mem_get_size(data)); #endif #if LV_ENABLE_GC == 0 @@ -300,7 +300,7 @@ void * lv_mem_realloc(void * data_p, size_t new_size) } } - uint32_t old_size = lv_mem_get_size(data_p); + uint32_t old_size = _lv_mem_get_size(data_p); if(old_size == new_size) return data_p; /*Also avoid reallocating the same memory*/ #if LV_MEM_CUSTOM == 0 @@ -322,7 +322,7 @@ void * lv_mem_realloc(void * data_p, size_t new_size) if(data_p != NULL) { /*Copy the old data to the new. Use the smaller size*/ if(old_size != 0) { - lv_memcpy(new_p, data_p, LV_MATH_MIN(new_size, old_size)); + _lv_memcpy(new_p, data_p, LV_MATH_MIN(new_size, old_size)); lv_mem_free(data_p); } } @@ -413,7 +413,7 @@ lv_res_t lv_mem_test(void) void lv_mem_monitor(lv_mem_monitor_t * mon_p) { /*Init the data*/ - lv_memset(mon_p, 0, sizeof(lv_mem_monitor_t)); + _lv_memset(mon_p, 0, sizeof(lv_mem_monitor_t)); #if LV_MEM_CUSTOM == 0 lv_mem_ent_t * e; e = NULL; @@ -454,7 +454,7 @@ void lv_mem_monitor(lv_mem_monitor_t * mon_p) #if LV_ENABLE_GC == 0 -uint32_t lv_mem_get_size(const void * data) +uint32_t _lv_mem_get_size(const void * data) { if(data == NULL) return 0; if(data == &zero_mem) return 0; @@ -466,7 +466,7 @@ uint32_t lv_mem_get_size(const void * data) #else /* LV_ENABLE_GC */ -uint32_t lv_mem_get_size(const void * data) +uint32_t _lv_mem_get_size(const void * data) { return LV_MEM_CUSTOM_GET_SIZE(data); } @@ -477,7 +477,7 @@ uint32_t lv_mem_get_size(const void * data) * Get a temporal buffer with the given size. * @param size the required size */ -void * lv_mem_buf_get(uint32_t size) +void * _lv_mem_buf_get(uint32_t size) { if(size == 0) return NULL; @@ -539,7 +539,7 @@ void * lv_mem_buf_get(uint32_t size) * Release a memory buffer * @param p buffer to release */ -void lv_mem_buf_release(void * p) +void _lv_mem_buf_release(void * p) { uint8_t i; @@ -564,7 +564,7 @@ void lv_mem_buf_release(void * p) /** * Free all memory buffers */ -void lv_mem_buf_free_all(void) +void _lv_mem_buf_free_all(void) { uint8_t i; for(i = 0; i < sizeof(mem_buf_small) / sizeof(mem_buf_small[0]); i++) { @@ -587,7 +587,7 @@ void lv_mem_buf_free_all(void) * @param src pointer to the source buffer * @param len number of byte to copy */ -LV_ATTRIBUTE_FAST_MEM void * lv_memcpy(void * dst, const void * src, size_t len) +LV_ATTRIBUTE_FAST_MEM void * _lv_memcpy(void * dst, const void * src, size_t len) { uint8_t * d8 = dst; const uint8_t * s8 = src; @@ -652,7 +652,7 @@ LV_ATTRIBUTE_FAST_MEM void * lv_memcpy(void * dst, const void * src, size_t len) * @param v value to set [0..255] * @param len number of byte to set */ -LV_ATTRIBUTE_FAST_MEM void lv_memset(void * dst, uint8_t v, size_t len) +LV_ATTRIBUTE_FAST_MEM void _lv_memset(void * dst, uint8_t v, size_t len) { uint8_t * d8 = (uint8_t *) dst; @@ -706,7 +706,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_memset(void * dst, uint8_t v, size_t len) * @param dst pointer to the destination buffer * @param len number of byte to set */ -LV_ATTRIBUTE_FAST_MEM void lv_memset_00(void * dst, size_t len) +LV_ATTRIBUTE_FAST_MEM void _lv_memset_00(void * dst, size_t len) { uint8_t * d8 = (uint8_t *) dst; uintptr_t d_align = (lv_uintptr_t) d8 & ALIGN_MASK; @@ -756,7 +756,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_memset_00(void * dst, size_t len) * @param dst pointer to the destination buffer * @param len number of byte to set */ -LV_ATTRIBUTE_FAST_MEM void lv_memset_ff(void * dst, size_t len) +LV_ATTRIBUTE_FAST_MEM void _lv_memset_ff(void * dst, size_t len) { uint8_t * d8 = (uint8_t *) dst; uintptr_t d_align = (lv_uintptr_t) d8 & ALIGN_MASK; diff --git a/src/lv_misc/lv_mem.h b/src/lv_misc/lv_mem.h index 9ca1fdc7af..56f1424759 100644 --- a/src/lv_misc/lv_mem.h +++ b/src/lv_misc/lv_mem.h @@ -61,13 +61,13 @@ extern lv_mem_buf_arr_t _lv_mem_buf; /** * Initiaize the dyn_mem module (work memory and other variables) */ -void lv_mem_init(void); +void _lv_mem_init(void); /** * Clean up the memory buffer which frees all the allocated memories. * @note It work only if `LV_MEM_CUSTOM == 0` */ -void lv_mem_deinit(void); +void _lv_mem_deinit(void); /** * Allocate a memory dynamically @@ -114,24 +114,24 @@ void lv_mem_monitor(lv_mem_monitor_t * mon_p); * @param data pointer to an allocated memory * @return the size of data memory in bytes */ -uint32_t lv_mem_get_size(const void * data); +uint32_t _lv_mem_get_size(const void * data); /** * Get a temporal buffer with the given size. * @param size the required size */ -void * lv_mem_buf_get(uint32_t size); +void * _lv_mem_buf_get(uint32_t size); /** * Release a memory buffer * @param p buffer to release */ -void lv_mem_buf_release(void * p); +void _lv_mem_buf_release(void * p); /** * Free all memory buffers */ -void lv_mem_buf_free_all(void); +void _lv_mem_buf_free_all(void); /** * Same as `memcpy` but optimized for 4 byte operation. @@ -139,7 +139,7 @@ void lv_mem_buf_free_all(void); * @param src pointer to the source buffer * @param len number of byte to copy */ -LV_ATTRIBUTE_FAST_MEM void * lv_memcpy(void * dst, const void * src, size_t len); +LV_ATTRIBUTE_FAST_MEM void * _lv_memcpy(void * dst, const void * src, size_t len); /** * Same as `memcpy` but optimized to copy only a few bytes. @@ -147,7 +147,7 @@ LV_ATTRIBUTE_FAST_MEM void * lv_memcpy(void * dst, const void * src, size_t len) * @param src pointer to the source buffer * @param len number of byte to copy */ -LV_ATTRIBUTE_FAST_MEM static inline void * lv_memcpy_small(void * dst, const void * src, size_t len) +LV_ATTRIBUTE_FAST_MEM static inline void * _lv_memcpy_small(void * dst, const void * src, size_t len) { uint8_t * d8 = (uint8_t *)dst; const uint8_t * s8 = (const uint8_t *)src; @@ -169,7 +169,7 @@ LV_ATTRIBUTE_FAST_MEM static inline void * lv_memcpy_small(void * dst, const voi * @param v value to set [0..255] * @param len number of byte to set */ -LV_ATTRIBUTE_FAST_MEM void lv_memset(void * dst, uint8_t v, size_t len); +LV_ATTRIBUTE_FAST_MEM void _lv_memset(void * dst, uint8_t v, size_t len); /** * Same as `memset(dst, 0x00, len)` but optimized for 4 byte operation. @@ -177,7 +177,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_memset(void * dst, uint8_t v, size_t len); * @param dst pointer to the destination buffer * @param len number of byte to set */ -LV_ATTRIBUTE_FAST_MEM void lv_memset_00(void * dst, size_t len); +LV_ATTRIBUTE_FAST_MEM void _lv_memset_00(void * dst, size_t len); /** * Same as `memset(dst, 0xFF, len)` but optimized for 4 byte operation. @@ -185,7 +185,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_memset_00(void * dst, size_t len); * @param dst pointer to the destination buffer * @param len number of byte to set */ -LV_ATTRIBUTE_FAST_MEM void lv_memset_ff(void * dst, size_t len); +LV_ATTRIBUTE_FAST_MEM void _lv_memset_ff(void * dst, size_t len); /********************** * MACROS diff --git a/src/lv_misc/lv_misc.mk b/src/lv_misc/lv_misc.mk index 81260e5f59..2b38ccbc17 100644 --- a/src/lv_misc/lv_misc.mk +++ b/src/lv_misc/lv_misc.mk @@ -1,4 +1,3 @@ -CSRCS += lv_circ.c CSRCS += lv_area.c CSRCS += lv_task.c CSRCS += lv_fs.c diff --git a/src/lv_misc/lv_task.c b/src/lv_misc/lv_task.c index 93b9882083..087010327f 100644 --- a/src/lv_misc/lv_task.c +++ b/src/lv_misc/lv_task.c @@ -54,9 +54,9 @@ static bool task_created; /** * Init the lv_task module */ -void lv_task_core_init(void) +void _lv_task_core_init(void) { - lv_ll_init(&LV_GC_ROOT(_lv_task_ll), sizeof(lv_task_t)); + _lv_ll_init(&LV_GC_ROOT(_lv_task_ll), sizeof(lv_task_t)); task_list_changed = false; /*Initially enable the lv_task handling*/ @@ -100,11 +100,11 @@ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) end_flag = true; task_deleted = false; task_created = false; - LV_GC_ROOT(_lv_task_act) = lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll)); + LV_GC_ROOT(_lv_task_act) = _lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll)); while(LV_GC_ROOT(_lv_task_act)) { /* The task might be deleted if it runs only once ('once = 1') * So get next element until the current is surely valid*/ - next = lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), LV_GC_ROOT(_lv_task_act)); + next = _lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), LV_GC_ROOT(_lv_task_act)); /*We reach priority of the turned off task. There is nothing more to do.*/ if(((lv_task_t *)LV_GC_ROOT(_lv_task_act))->prio == LV_TASK_PRIO_OFF) { @@ -176,7 +176,7 @@ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) } time_till_next = LV_NO_TASK_READY; - next = lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll)); + next = _lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll)); while(next) { if(next->prio != LV_TASK_PRIO_OFF) { uint32_t delay = lv_task_time_remaining(next); @@ -184,7 +184,7 @@ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) time_till_next = delay; } - next = lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), next); /*Find the next task*/ + next = _lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), next); /*Find the next task*/ } already_running = false; /*Release the mutex*/ @@ -203,11 +203,11 @@ lv_task_t * lv_task_create_basic(void) lv_task_t * tmp; /*Create task lists in order of priority from high to low*/ - tmp = lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll)); + tmp = _lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll)); /*It's the first task*/ if(NULL == tmp) { - new_task = lv_ll_ins_head(&LV_GC_ROOT(_lv_task_ll)); + new_task = _lv_ll_ins_head(&LV_GC_ROOT(_lv_task_ll)); LV_ASSERT_MEM(new_task); if(new_task == NULL) return NULL; } @@ -215,17 +215,17 @@ lv_task_t * lv_task_create_basic(void) else { do { if(tmp->prio <= DEF_PRIO) { - new_task = lv_ll_ins_prev(&LV_GC_ROOT(_lv_task_ll), tmp); + new_task = _lv_ll_ins_prev(&LV_GC_ROOT(_lv_task_ll), tmp); LV_ASSERT_MEM(new_task); if(new_task == NULL) return NULL; break; } - tmp = lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), tmp); + tmp = _lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), tmp); } while(tmp != NULL); /*Only too high priority tasks were found. Add the task to the end*/ if(tmp == NULL) { - new_task = lv_ll_ins_tail(&LV_GC_ROOT(_lv_task_ll)); + new_task = _lv_ll_ins_tail(&LV_GC_ROOT(_lv_task_ll)); LV_ASSERT_MEM(new_task); if(new_task == NULL) return NULL; } @@ -286,7 +286,7 @@ void lv_task_set_cb(lv_task_t * task, lv_task_cb_t task_cb) */ void lv_task_del(lv_task_t * task) { - lv_ll_remove(&LV_GC_ROOT(_lv_task_ll), task); + _lv_ll_remove(&LV_GC_ROOT(_lv_task_ll), task); task_list_changed = true; lv_mem_free(task); @@ -305,16 +305,16 @@ void lv_task_set_prio(lv_task_t * task, lv_task_prio_t prio) /*Find the tasks with new priority*/ lv_task_t * i; - LV_LL_READ(LV_GC_ROOT(_lv_task_ll), i) { + _LV_LL_READ(LV_GC_ROOT(_lv_task_ll), i) { if(i->prio <= prio) { - if(i != task) lv_ll_move_before(&LV_GC_ROOT(_lv_task_ll), task, i); + if(i != task) _lv_ll_move_before(&LV_GC_ROOT(_lv_task_ll), task, i); break; } } /*There was no such a low priority so far then add the node to the tail*/ if(i == NULL) { - lv_ll_move_before(&LV_GC_ROOT(_lv_task_ll), task, NULL); + _lv_ll_move_before(&LV_GC_ROOT(_lv_task_ll), task, NULL); } task_list_changed = true; diff --git a/src/lv_misc/lv_task.h b/src/lv_misc/lv_task.h index a1860fc6c0..b94c10524e 100644 --- a/src/lv_misc/lv_task.h +++ b/src/lv_misc/lv_task.h @@ -75,7 +75,7 @@ typedef struct _lv_task_t { /** * Init the lv_task module */ -void lv_task_core_init(void); +void _lv_task_core_init(void); //! @cond Doxygen_Suppress diff --git a/src/lv_misc/lv_templ.c b/src/lv_misc/lv_templ.c index c5bb68c0b9..45683915ed 100644 --- a/src/lv_misc/lv_templ.c +++ b/src/lv_misc/lv_templ.c @@ -17,7 +17,7 @@ /* This typedef exists purely to keep -Wpedantic happy when the file is empty. */ /* It can be removed. */ -typedef int keep_pedantic_happy; +typedef int _keep_pedantic_happy; /********************** * STATIC PROTOTYPES diff --git a/src/lv_misc/lv_txt.c b/src/lv_misc/lv_txt.c index a72e2002eb..bdf19eb87e 100644 --- a/src/lv_misc/lv_txt.c +++ b/src/lv_misc/lv_txt.c @@ -51,23 +51,23 @@ static inline bool is_break_char(uint32_t letter); * GLOBAL VARIABLES **********************/ #if LV_TXT_ENC == LV_TXT_ENC_UTF8 - uint8_t (*lv_txt_encoded_size)(const char *) = lv_txt_utf8_size; - uint32_t (*lv_txt_unicode_to_encoded)(uint32_t) = lv_txt_unicode_to_utf8; - uint32_t (*lv_txt_encoded_conv_wc)(uint32_t) = lv_txt_utf8_conv_wc; - uint32_t (*lv_txt_encoded_next)(const char *, uint32_t *) = lv_txt_utf8_next; - uint32_t (*lv_txt_encoded_prev)(const char *, uint32_t *) = lv_txt_utf8_prev; - uint32_t (*lv_txt_encoded_get_byte_id)(const char *, uint32_t) = lv_txt_utf8_get_byte_id; - uint32_t (*lv_txt_encoded_get_char_id)(const char *, uint32_t) = lv_txt_utf8_get_char_id; - uint32_t (*lv_txt_get_encoded_length)(const char *) = lv_txt_utf8_get_length; + uint8_t (*_lv_txt_encoded_size)(const char *) = lv_txt_utf8_size; + uint32_t (*_lv_txt_unicode_to_encoded)(uint32_t) = lv_txt_unicode_to_utf8; + uint32_t (*_lv_txt_encoded_conv_wc)(uint32_t) = lv_txt_utf8_conv_wc; + uint32_t (*_lv_txt_encoded_next)(const char *, uint32_t *) = lv_txt_utf8_next; + uint32_t (*_lv_txt_encoded_prev)(const char *, uint32_t *) = lv_txt_utf8_prev; + uint32_t (*_lv_txt_encoded_get_byte_id)(const char *, uint32_t) = lv_txt_utf8_get_byte_id; + uint32_t (*_lv_txt_encoded_get_char_id)(const char *, uint32_t) = lv_txt_utf8_get_char_id; + uint32_t (*_lv_txt_get_encoded_length)(const char *) = lv_txt_utf8_get_length; #elif LV_TXT_ENC == LV_TXT_ENC_ASCII - uint8_t (*lv_txt_encoded_size)(const char *) = lv_txt_iso8859_1_size; - uint32_t (*lv_txt_unicode_to_encoded)(uint32_t) = lv_txt_unicode_to_iso8859_1; - uint32_t (*lv_txt_encoded_conv_wc)(uint32_t) = lv_txt_iso8859_1_conv_wc; - uint32_t (*lv_txt_encoded_next)(const char *, uint32_t *) = lv_txt_iso8859_1_next; - uint32_t (*lv_txt_encoded_prev)(const char *, uint32_t *) = lv_txt_iso8859_1_prev; - uint32_t (*lv_txt_encoded_get_byte_id)(const char *, uint32_t) = lv_txt_iso8859_1_get_byte_id; - uint32_t (*lv_txt_encoded_get_char_id)(const char *, uint32_t) = lv_txt_iso8859_1_get_char_id; - uint32_t (*lv_txt_get_encoded_length)(const char *) = lv_txt_iso8859_1_get_length; + uint8_t (*_lv_txt_encoded_size)(const char *) = lv_txt_iso8859_1_size; + uint32_t (*_lv_txt_unicode_to_encoded)(uint32_t) = lv_txt_unicode_to_iso8859_1; + uint32_t (*_lv_txt_encoded_conv_wc)(uint32_t) = lv_txt_iso8859_1_conv_wc; + uint32_t (*_lv_txt_encoded_next)(const char *, uint32_t *) = lv_txt_iso8859_1_next; + uint32_t (*_lv_txt_encoded_prev)(const char *, uint32_t *) = lv_txt_iso8859_1_prev; + uint32_t (*_lv_txt_encoded_get_byte_id)(const char *, uint32_t) = lv_txt_iso8859_1_get_byte_id; + uint32_t (*_lv_txt_encoded_get_char_id)(const char *, uint32_t) = lv_txt_iso8859_1_get_char_id; + uint32_t (*_lv_txt_get_encoded_length)(const char *) = lv_txt_iso8859_1_get_length; #endif @@ -90,7 +90,7 @@ static inline bool is_break_char(uint32_t letter); * @param max_width max with of the text (break the lines to fit this size) Set CORD_MAX to avoid * line breaks */ -void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, lv_coord_t letter_space, +void _lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, lv_coord_t letter_space, lv_coord_t line_space, lv_coord_t max_width, lv_txt_flag_t flag) { size_res->x = 0; @@ -107,7 +107,7 @@ void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * /*Calc. the height and longest line*/ while(text[line_start] != '\0') { - new_line_start += lv_txt_get_next_line(&text[line_start], font, letter_space, max_width, flag); + new_line_start += _lv_txt_get_next_line(&text[line_start], font, letter_space, max_width, flag); if((unsigned long)size_res->y + (unsigned long)letter_height + (unsigned long)line_space > LV_MAX_OF(lv_coord_t)) { LV_LOG_WARN("lv_txt_get_size: integer overflow while calculating text height"); @@ -119,7 +119,7 @@ void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * } /*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); line_start = new_line_start; @@ -186,17 +186,17 @@ static uint16_t lv_txt_get_next_word(const char * txt, const lv_font_t * font, uint32_t break_index = NO_BREAK_FOUND; /* only used for "long" words */ uint32_t break_letter_count = 0; /* Number of characters up to the long word break point */ - letter = lv_txt_encoded_next(txt, &i_next); + letter = _lv_txt_encoded_next(txt, &i_next); i_next_next = i_next; /* Obtain the full word, regardless if it fits or not in max_width */ while(txt[i] != '\0') { - letter_next = lv_txt_encoded_next(txt, &i_next_next); + letter_next = _lv_txt_encoded_next(txt, &i_next_next); word_len++; /*Handle the recolor command*/ if((flag & LV_TXT_FLAG_RECOLOR) != 0) { - if(lv_txt_is_cmd(cmd_state, letter) != false) { + if(_lv_txt_is_cmd(cmd_state, letter) != false) { i = i_next; i_next = i_next_next; letter = letter_next; @@ -263,7 +263,7 @@ static uint16_t lv_txt_get_next_word(const char * txt, const lv_font_t * font, int32_t n_move = LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN - (word_len - break_letter_count); /* Move pointer "i" backwards */ for(; n_move > 0; n_move--) { - lv_txt_encoded_prev(txt, &i); + _lv_txt_encoded_prev(txt, &i); // TODO: it would be appropriate to update the returned word width here // However, in current usage, this doesn't impact anything. } @@ -289,7 +289,7 @@ static uint16_t lv_txt_get_next_word(const char * txt, const lv_font_t * font, * @param flags settings for the text from 'txt_flag_type' enum * @return the index of the first char of the new line (in byte index not letter index. With UTF-8 they are different) */ -uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font, +uint16_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font, lv_coord_t letter_space, lv_coord_t max_width, lv_txt_flag_t flag) { if(txt == NULL) return 0; @@ -316,7 +316,7 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font, max_width -= word_w; if(advance == 0) { - if(i == 0) lv_txt_encoded_next(txt, &i); // prevent inf loops + if(i == 0) _lv_txt_encoded_next(txt, &i); // prevent inf loops break; } @@ -333,7 +333,7 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font, /* Always step at least one to avoid infinite loops */ if(i == 0) { - lv_txt_encoded_next(txt, &i); + _lv_txt_encoded_next(txt, &i); } return i; @@ -349,7 +349,7 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font, * @param flags settings for the text from 'txt_flag_t' enum * @return length of a char_num long text */ -lv_coord_t lv_txt_get_width(const char * txt, uint16_t length, const lv_font_t * font, lv_coord_t letter_space, +lv_coord_t _lv_txt_get_width(const char * txt, uint16_t length, const lv_font_t * font, lv_coord_t letter_space, lv_txt_flag_t flag) { if(txt == NULL) return 0; @@ -361,10 +361,10 @@ lv_coord_t lv_txt_get_width(const char * txt, uint16_t length, const lv_font_t * if(length != 0) { while(i < length) { - uint32_t letter = lv_txt_encoded_next(txt, &i); - uint32_t letter_next = lv_txt_encoded_next(&txt[i], NULL); + uint32_t letter = _lv_txt_encoded_next(txt, &i); + uint32_t letter_next = _lv_txt_encoded_next(&txt[i], NULL); if((flag & LV_TXT_FLAG_RECOLOR) != 0) { - if(lv_txt_is_cmd(&cmd_state, letter) != false) { + if(_lv_txt_is_cmd(&cmd_state, letter) != false) { continue; } } @@ -393,7 +393,7 @@ lv_coord_t lv_txt_get_width(const char * txt, uint16_t length, const lv_font_t * * @return true: the character is part of a command and should not be written, * false: the character should be written */ -bool lv_txt_is_cmd(lv_txt_cmd_state_t * state, uint32_t c) +bool _lv_txt_is_cmd(lv_txt_cmd_state_t * state, uint32_t c) { bool ret = false; @@ -431,12 +431,12 @@ bool lv_txt_is_cmd(lv_txt_cmd_state_t * state, uint32_t c) * UTF-8) 0: before the original text, 1: after the first char etc. * @param ins_txt text to insert */ -void lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt) +void _lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt) { size_t old_len = strlen(txt_buf); size_t ins_len = strlen(ins_txt); size_t new_len = ins_len + old_len; - pos = lv_txt_encoded_get_byte_id(txt_buf, pos); /*Convert to byte index instead of letter index*/ + pos = _lv_txt_encoded_get_byte_id(txt_buf, pos); /*Convert to byte index instead of letter index*/ /*Copy the second part into the end to make place to text to insert*/ size_t i; @@ -445,7 +445,7 @@ void lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt) } /* Copy the text into the new space*/ - lv_memcpy_small(txt_buf + pos, ins_txt, ins_len); + _lv_memcpy_small(txt_buf + pos, ins_txt, ins_len); } /** @@ -455,13 +455,13 @@ void lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt) * char etc.) * @param len number of characters to delete */ -void lv_txt_cut(char * txt, uint32_t pos, uint32_t len) +void _lv_txt_cut(char * txt, uint32_t pos, uint32_t len) { size_t old_len = strlen(txt); - pos = lv_txt_encoded_get_byte_id(txt, pos); /*Convert to byte index instead of letter index*/ - len = lv_txt_encoded_get_byte_id(&txt[pos], len); + pos = _lv_txt_encoded_get_byte_id(txt, pos); /*Convert to byte index instead of letter index*/ + len = _lv_txt_encoded_get_byte_id(&txt[pos], len); /*Copy the second part into the end to make place to text to insert*/ uint32_t i; @@ -537,7 +537,7 @@ static uint32_t lv_txt_utf8_conv_wc(uint32_t c) if((c & 0x80) != 0) { uint32_t swapped; uint8_t c8[4]; - lv_memcpy_small(c8, &c, 4); + _lv_memcpy_small(c8, &c, 4); swapped = (c8[0] << 24) + (c8[1] << 16) + (c8[2] << 8) + (c8[3]); uint8_t i; for(i = 0; i < 4; i++) { @@ -642,7 +642,7 @@ static uint32_t lv_txt_utf8_prev(const char * txt, uint32_t * i) do { if(cnt >= 4) return 0; /*No UTF-8 char found before the initial*/ - c_size = lv_txt_encoded_size(&txt[*i]); + c_size = _lv_txt_encoded_size(&txt[*i]); if(c_size == 0) { if(*i != 0) (*i)--; @@ -653,7 +653,7 @@ static uint32_t lv_txt_utf8_prev(const char * txt, uint32_t * i) } while(c_size == 0); uint32_t i_tmp = *i; - uint32_t letter = lv_txt_encoded_next(txt, &i_tmp); /*Character found, get it*/ + uint32_t letter = _lv_txt_encoded_next(txt, &i_tmp); /*Character found, get it*/ return letter; } @@ -670,7 +670,7 @@ static uint32_t lv_txt_utf8_get_byte_id(const char * txt, uint32_t utf8_id) uint32_t i; uint32_t byte_cnt = 0; for(i = 0; i < utf8_id; i++) { - uint8_t c_size = lv_txt_encoded_size(&txt[byte_cnt]); + uint8_t c_size = _lv_txt_encoded_size(&txt[byte_cnt]); byte_cnt += c_size > 0 ? c_size : 1; } @@ -690,7 +690,7 @@ static uint32_t lv_txt_utf8_get_char_id(const char * txt, uint32_t byte_id) uint32_t char_cnt = 0; while(i < byte_id) { - lv_txt_encoded_next(txt, &i); /*'i' points to the next letter so use the prev. value*/ + _lv_txt_encoded_next(txt, &i); /*'i' points to the next letter so use the prev. value*/ char_cnt++; } @@ -709,7 +709,7 @@ static uint32_t lv_txt_utf8_get_length(const char * txt) uint32_t i = 0; while(txt[i] != '\0') { - lv_txt_encoded_next(txt, &i); + _lv_txt_encoded_next(txt, &i); len++; } diff --git a/src/lv_misc/lv_txt.h b/src/lv_misc/lv_txt.h index ecc579d930..a53d95216f 100644 --- a/src/lv_misc/lv_txt.h +++ b/src/lv_misc/lv_txt.h @@ -70,7 +70,7 @@ typedef uint8_t lv_txt_cmd_state_t; * @param max_width max with of the text (break the lines to fit this size) Set CORD_MAX to avoid * line breaks */ -void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, lv_coord_t letter_space, +void _lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, lv_coord_t letter_space, lv_coord_t line_space, lv_coord_t max_width, lv_txt_flag_t flag); /** @@ -84,7 +84,7 @@ void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * * @return the index of the first char of the new line (in byte index not letter index. With UTF-8 * they are different) */ -uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font, lv_coord_t letter_space, lv_coord_t max_width, +uint16_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font, lv_coord_t letter_space, lv_coord_t max_width, lv_txt_flag_t flag); /** @@ -97,7 +97,7 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font, lv_coord * @param flags settings for the text from 'txt_flag_t' enum * @return length of a char_num long text */ -lv_coord_t lv_txt_get_width(const char * txt, uint16_t length, const lv_font_t * font, lv_coord_t letter_space, +lv_coord_t _lv_txt_get_width(const char * txt, uint16_t length, const lv_font_t * font, lv_coord_t letter_space, lv_txt_flag_t flag); /** @@ -108,7 +108,7 @@ lv_coord_t lv_txt_get_width(const char * txt, uint16_t length, const lv_font_t * * @return true: the character is part of a command and should not be written, * false: the character should be written */ -bool lv_txt_is_cmd(lv_txt_cmd_state_t * state, uint32_t c); +bool _lv_txt_is_cmd(lv_txt_cmd_state_t * state, uint32_t c); /** * Insert a string into an other @@ -116,7 +116,7 @@ bool lv_txt_is_cmd(lv_txt_cmd_state_t * state, uint32_t c); * @param pos position to insert (0: before the original text, 1: after the first char etc.) * @param ins_txt text to insert */ -void lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt); +void _lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt); /** * Delete a part of a string @@ -125,7 +125,7 @@ void lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt); * char etc.) * @param len number of characters to delete */ -void lv_txt_cut(char * txt, uint32_t pos, uint32_t len); +void _lv_txt_cut(char * txt, uint32_t pos, uint32_t len); /*************************************************************** * GLOBAL FUNCTION POINTERS FOR CAHRACTER ENCODING INTERFACE @@ -136,21 +136,21 @@ void lv_txt_cut(char * txt, uint32_t pos, uint32_t len); * @param str pointer to a character in a string * @return length of the encoded character (1,2,3 ...). O in invalid */ -extern uint8_t (*lv_txt_encoded_size)(const char *); +extern uint8_t (*_lv_txt_encoded_size)(const char *); /** * Convert an Unicode letter to encoded * @param letter_uni an Unicode letter * @return Encoded character in Little Endian to be compatible with C chars (e.g. 'Á', 'Ü') */ -extern uint32_t (*lv_txt_unicode_to_encoded)(uint32_t); +extern uint32_t (*_lv_txt_unicode_to_encoded)(uint32_t); /** * Convert a wide character, e.g. 'Á' little endian to be compatible with the encoded format. * @param c a wide character * @return `c` in the encoded format */ -extern uint32_t (*lv_txt_encoded_conv_wc)(uint32_t c); +extern uint32_t (*_lv_txt_encoded_conv_wc)(uint32_t c); /** * Decode the next encoded character from a string. @@ -160,7 +160,7 @@ extern uint32_t (*lv_txt_encoded_conv_wc)(uint32_t c); * NULL to use txt[0] as index * @return the decoded Unicode character or 0 on invalid data code */ -extern uint32_t (*lv_txt_encoded_next)(const char *, uint32_t *); +extern uint32_t (*_lv_txt_encoded_next)(const char *, uint32_t *); /** * Get the previous encoded character form a string. @@ -169,7 +169,7 @@ extern uint32_t (*lv_txt_encoded_next)(const char *, uint32_t *); * encoded char in 'txt'. * @return the decoded Unicode character or 0 on invalid data */ -extern uint32_t (*lv_txt_encoded_prev)(const char *, uint32_t *); +extern uint32_t (*_lv_txt_encoded_prev)(const char *, uint32_t *); /** * Convert a letter index (in an the encoded text) to byte index. @@ -178,7 +178,7 @@ extern uint32_t (*lv_txt_encoded_prev)(const char *, uint32_t *); * @param enc_id letter index * @return byte index of the 'enc_id'th letter */ -extern uint32_t (*lv_txt_encoded_get_byte_id)(const char *, uint32_t); +extern uint32_t (*_lv_txt_encoded_get_byte_id)(const char *, uint32_t); /** * Convert a byte index (in an encoded text) to character index. @@ -187,7 +187,7 @@ extern uint32_t (*lv_txt_encoded_get_byte_id)(const char *, uint32_t); * @param byte_id byte index * @return character index of the letter at 'byte_id'th position */ -extern uint32_t (*lv_txt_encoded_get_char_id)(const char *, uint32_t); +extern uint32_t (*_lv_txt_encoded_get_char_id)(const char *, uint32_t); /** * Get the number of characters (and NOT bytes) in a string. @@ -195,7 +195,7 @@ extern uint32_t (*lv_txt_encoded_get_char_id)(const char *, uint32_t); * @param txt a '\0' terminated char string * @return number of characters */ -extern uint32_t (*lv_txt_get_encoded_length)(const char *); +extern uint32_t (*_lv_txt_get_encoded_length)(const char *); /********************** * MACROS diff --git a/src/lv_misc/lv_txt_ap.c b/src/lv_misc/lv_txt_ap.c index f380281551..176b0d721d 100644 --- a/src/lv_misc/lv_txt_ap.c +++ b/src/lv_misc/lv_txt_ap.c @@ -92,7 +92,7 @@ const ap_chars_map_t ap_chars_map[] = { /********************** * GLOBAL FUNCTIONS **********************/ -uint32_t lv_txt_ap_calc_bytes_cnt(const char * txt) +uint32_t _lv_txt_ap_calc_bytes_cnt(const char * txt) { uint32_t txt_length = 0; uint32_t chars_cnt = 0; @@ -100,12 +100,12 @@ uint32_t lv_txt_ap_calc_bytes_cnt(const char * txt) uint32_t i, j; uint32_t ch_enc; - txt_length = lv_txt_get_encoded_length(txt); + txt_length = _lv_txt_get_encoded_length(txt); i = 0; j = 0; while(i < txt_length) { - ch_enc = lv_txt_encoded_next(txt, &j); + ch_enc = _lv_txt_encoded_next(txt, &j); current_ap_idx = lv_ap_get_char_index(ch_enc); if(current_ap_idx != LV_UNDEF_ARABIC_PERSIAN_CHARS) @@ -125,21 +125,21 @@ uint32_t lv_txt_ap_calc_bytes_cnt(const char * txt) } -void lv_txt_ap_proc(const char * txt, char * txt_out) +void _lv_txt_ap_proc(const char * txt, char * txt_out) { uint32_t txt_length = 0; uint32_t index_current, idx_next, idx_previous, i, j; uint32_t * ch_enc; char * txt_out_temp; - txt_length = lv_txt_get_encoded_length(txt); + txt_length = _lv_txt_get_encoded_length(txt); ch_enc = (uint32_t *)lv_mem_alloc(sizeof(uint32_t) * (txt_length + 1)); i = 0; j = 0; while(j < txt_length) - ch_enc[j++] = lv_txt_encoded_next(txt, &i); + ch_enc[j++] = _lv_txt_encoded_next(txt, &i); ch_enc[j] = 0; diff --git a/src/lv_misc/lv_txt_ap.h b/src/lv_misc/lv_txt_ap.h index 18f7469557..d574201342 100644 --- a/src/lv_misc/lv_txt_ap.h +++ b/src/lv_misc/lv_txt_ap.h @@ -44,8 +44,8 @@ typedef struct { /********************** * GLOBAL PROTOTYPES **********************/ -uint32_t lv_txt_ap_calc_bytes_cnt(const char * txt); -void lv_txt_ap_proc(const char * txt, char * txt_out); +uint32_t _lv_txt_ap_calc_bytes_cnt(const char * txt); +void _lv_txt_ap_proc(const char * txt, char * txt_out); /********************** * MACROS diff --git a/src/lv_misc/lv_utils.c b/src/lv_misc/lv_utils.c index 127703aa22..ff617d038e 100644 --- a/src/lv_misc/lv_utils.c +++ b/src/lv_misc/lv_utils.c @@ -28,7 +28,6 @@ /********************** * STATIC VARIABLES **********************/ -static char decimal_separator[2] = "."; /********************** * MACROS @@ -44,7 +43,7 @@ static char decimal_separator[2] = "."; * @param buf pointer to a `char` buffer. The result will be stored here (max 10 elements) * @return same as `buf` (just for convenience) */ -char * lv_utils_num_to_str(int32_t num, char * buf) +char * _lv_utils_num_to_str(int32_t num, char * buf) { if(num == 0) { buf[0] = '0'; @@ -75,31 +74,6 @@ char * lv_utils_num_to_str(int32_t num, char * buf) return buf; } -/** - * Convert a fixed point number to string - * @param num a number - * @param decimals number of digits after decimal point - * @param buf pointer to a `char` buffer - * @param bufsize length of buffer - * @return same as `buf` (just for convenience) - */ -char * lv_utils_num_to_str_fixed(int32_t num, int32_t decimals, char * buf, size_t bufsize) -{ - lv_snprintf(buf, bufsize, "%0*d", decimals + 1, num); - if(decimals > 0) - lv_txt_ins(buf, strlen(buf) - decimals, decimal_separator); - return buf; -} - -/** - * Set the decimal separator character used by lv_utils_num_to_str_fixed - * @param separator the decimal separator char - */ -void lv_utils_set_decimal_separator(char separator) -{ - decimal_separator[0] = separator; -} - /** Searches base[0] to base[n - 1] for an item that matches *key. * * @note The function cmp must return negative if its first @@ -117,7 +91,7 @@ void lv_utils_set_decimal_separator(char separator) * * @return a pointer to a matching item, or NULL if none exists. */ -void * lv_utils_bsearch(const void * key, const void * base, uint32_t n, uint32_t size, +void * _lv_utils_bsearch(const void * key, const void * base, uint32_t n, uint32_t size, int32_t (*cmp)(const void * pRef, const void * pElement)) { const char * middle; diff --git a/src/lv_misc/lv_utils.h b/src/lv_misc/lv_utils.h index e2a61d6eee..1016cef85c 100644 --- a/src/lv_misc/lv_utils.h +++ b/src/lv_misc/lv_utils.h @@ -33,23 +33,7 @@ extern "C" { * @param buf pointer to a `char` buffer. The result will be stored here (max 10 elements) * @return same as `buf` (just for convenience) */ -char * lv_utils_num_to_str(int32_t num, char * buf); - -/** - * Convert a fixed point number to string - * @param num a number - * @param decimals number of digits after decimal point - * @param buf pointer to a `char` buffer - * @param bufsize length of buffer - * @return same as `buf` (just for convenience) - */ -char * lv_utils_num_to_str_fixed(int32_t num, int32_t decimals, char * buf, size_t bufsize); - -/** - * Set the decimal separator character used by lv_utils_num_to_str_fixed - * @param separator the decimal separator char - */ -void lv_utils_set_decimal_separator(char separator); +char * _lv_utils_num_to_str(int32_t num, char * buf); /** Searches base[0] to base[n - 1] for an item that matches *key. * @@ -68,7 +52,7 @@ void lv_utils_set_decimal_separator(char separator); * * @return a pointer to a matching item, or NULL if none exists. */ -void * lv_utils_bsearch(const void * key, const void * base, uint32_t n, uint32_t size, +void * _lv_utils_bsearch(const void * key, const void * base, uint32_t n, uint32_t size, int32_t (*cmp)(const void * pRef, const void * pElement)); /********************** diff --git a/src/lv_themes/lv_theme_material.c b/src/lv_themes/lv_theme_material.c index 2dcbdb2bfa..a8b377e3d8 100644 --- a/src/lv_themes/lv_theme_material.c +++ b/src/lv_themes/lv_theme_material.c @@ -912,18 +912,18 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_SCR: lv_obj_clean_style_list(obj, LV_OBJ_PART_MAIN); list = lv_obj_get_style_list(obj, LV_OBJ_PART_MAIN); - lv_style_list_add_style(list, &scr); + _lv_style_list_add_style(list, &scr); break; case LV_THEME_OBJ: lv_obj_clean_style_list(obj, LV_OBJ_PART_MAIN); list = lv_obj_get_style_list(obj, LV_OBJ_PART_MAIN); - lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &bg); break; #if LV_USE_CONT case LV_THEME_CONT: lv_obj_clean_style_list(obj, LV_OBJ_PART_MAIN); list = lv_obj_get_style_list(obj, LV_CONT_PART_MAIN); - lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &bg); break; #endif @@ -931,7 +931,7 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_BTN: lv_obj_clean_style_list(obj, LV_BTN_PART_MAIN); list = lv_obj_get_style_list(obj, LV_BTN_PART_MAIN); - lv_style_list_add_style(list, &btn); + _lv_style_list_add_style(list, &btn); break; #endif @@ -939,13 +939,13 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_BTNMATRIX: lv_obj_clean_style_list(obj, LV_BTNMATRIX_PART_BG); list = lv_obj_get_style_list(obj, LV_BTNMATRIX_PART_BG); - lv_style_list_add_style(list, &bg); - lv_style_list_add_style(list, &pad_small); + _lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &pad_small); lv_obj_clean_style_list(obj, LV_BTNMATRIX_PART_BTN); list = lv_obj_get_style_list(obj, LV_BTNMATRIX_PART_BTN); - lv_style_list_add_style(list, &bg); - lv_style_list_add_style(list, &bg_click); + _lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &bg_click); break; #endif @@ -953,13 +953,13 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_KEYBOARD: lv_obj_clean_style_list(obj, LV_KEYBOARD_PART_BG); list = lv_obj_get_style_list(obj, LV_KEYBOARD_PART_BG); - lv_style_list_add_style(list, &scr); - lv_style_list_add_style(list, &kb_bg); + _lv_style_list_add_style(list, &scr); + _lv_style_list_add_style(list, &kb_bg); lv_obj_clean_style_list(obj, LV_KEYBOARD_PART_BTN); list = lv_obj_get_style_list(obj, LV_KEYBOARD_PART_BTN); - lv_style_list_add_style(list, &bg); - lv_style_list_add_style(list, &bg_click); + _lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &bg_click); break; #endif @@ -967,11 +967,11 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_BAR: lv_obj_clean_style_list(obj, LV_BAR_PART_BG); list = lv_obj_get_style_list(obj, LV_BAR_PART_BG); - lv_style_list_add_style(list, &bar_bg); + _lv_style_list_add_style(list, &bar_bg); lv_obj_clean_style_list(obj, LV_BAR_PART_INDIC); list = lv_obj_get_style_list(obj, LV_BAR_PART_INDIC); - lv_style_list_add_style(list, &bar_indic); + _lv_style_list_add_style(list, &bar_indic); break; #endif @@ -979,15 +979,15 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_SWITCH: lv_obj_clean_style_list(obj, LV_SWITCH_PART_BG); list = lv_obj_get_style_list(obj, LV_SWITCH_PART_BG); - lv_style_list_add_style(list, &bar_bg); + _lv_style_list_add_style(list, &bar_bg); lv_obj_clean_style_list(obj, LV_SWITCH_PART_INDIC); list = lv_obj_get_style_list(obj, LV_SWITCH_PART_INDIC); - lv_style_list_add_style(list, &bar_indic); + _lv_style_list_add_style(list, &bar_indic); lv_obj_clean_style_list(obj, LV_SWITCH_PART_KNOB); list = lv_obj_get_style_list(obj, LV_SWITCH_PART_KNOB); - lv_style_list_add_style(list, &sw_knob); + _lv_style_list_add_style(list, &sw_knob); break; #endif @@ -1025,12 +1025,12 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_ARC: lv_obj_clean_style_list(obj, LV_ARC_PART_BG); list = lv_obj_get_style_list(obj, LV_ARC_PART_BG); - lv_style_list_add_style(list, &bg); - lv_style_list_add_style(list, &arc_bg); + _lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &arc_bg); lv_obj_clean_style_list(obj, LV_ARC_PART_INDIC); list = lv_obj_get_style_list(obj, LV_ARC_PART_INDIC); - lv_style_list_add_style(list, &arc_indic); + _lv_style_list_add_style(list, &arc_indic); break; #endif @@ -1038,11 +1038,11 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_SPINNER: lv_obj_clean_style_list(obj, LV_SPINNER_PART_BG); list = lv_obj_get_style_list(obj, LV_SPINNER_PART_BG); - lv_style_list_add_style(list, &arc_bg); + _lv_style_list_add_style(list, &arc_bg); lv_obj_clean_style_list(obj, LV_SPINNER_PART_INDIC); list = lv_obj_get_style_list(obj, LV_SPINNER_PART_INDIC); - lv_style_list_add_style(list, &arc_indic); + _lv_style_list_add_style(list, &arc_indic); break; #endif @@ -1050,16 +1050,16 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_SLIDER: lv_obj_clean_style_list(obj, LV_SLIDER_PART_BG); list = lv_obj_get_style_list(obj, LV_SLIDER_PART_BG); - lv_style_list_add_style(list, &bar_bg); - lv_style_list_add_style(list, &slider_bg); + _lv_style_list_add_style(list, &bar_bg); + _lv_style_list_add_style(list, &slider_bg); lv_obj_clean_style_list(obj, LV_SLIDER_PART_INDIC); list = lv_obj_get_style_list(obj, LV_SLIDER_PART_INDIC); - lv_style_list_add_style(list, &bar_indic); + _lv_style_list_add_style(list, &bar_indic); lv_obj_clean_style_list(obj, LV_SLIDER_PART_KNOB); list = lv_obj_get_style_list(obj, LV_SLIDER_PART_KNOB); - lv_style_list_add_style(list, &slider_knob); + _lv_style_list_add_style(list, &slider_knob); break; #endif @@ -1067,12 +1067,12 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_CHECKBOX: lv_obj_clean_style_list(obj, LV_CHECKBOX_PART_BG); list = lv_obj_get_style_list(obj, LV_CHECKBOX_PART_BG); - lv_style_list_add_style(list, &cb_bg); + _lv_style_list_add_style(list, &cb_bg); lv_obj_clean_style_list(obj, LV_CHECKBOX_PART_BULLET); list = lv_obj_get_style_list(obj, LV_CHECKBOX_PART_BULLET); - lv_style_list_add_style(list, &btn); - lv_style_list_add_style(list, &cb_bullet); + _lv_style_list_add_style(list, &btn); + _lv_style_list_add_style(list, &cb_bullet); break; #endif @@ -1080,18 +1080,18 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_MSGBOX: lv_obj_clean_style_list(obj, LV_MSGBOX_PART_BG); list = lv_obj_get_style_list(obj, LV_MSGBOX_PART_BG); - lv_style_list_add_style(list, &bg); - lv_style_list_add_style(list, &mbox_bg); + _lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &mbox_bg); break; case LV_THEME_MSGBOX_BTNS: lv_obj_clean_style_list(obj, LV_MSGBOX_PART_BTN_BG); list = lv_obj_get_style_list(obj, LV_MSGBOX_PART_BTN_BG); - lv_style_list_add_style(list, &pad_small); + _lv_style_list_add_style(list, &pad_small); lv_obj_clean_style_list(obj, LV_MSGBOX_PART_BTN); list = lv_obj_get_style_list(obj, LV_MSGBOX_PART_BTN); - lv_style_list_add_style(list, &btn); + _lv_style_list_add_style(list, &btn); break; #endif @@ -1099,27 +1099,27 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_LED: lv_obj_clean_style_list(obj, LV_LED_PART_MAIN); list = lv_obj_get_style_list(obj, LV_LED_PART_MAIN); - lv_style_list_add_style(list, &led); + _lv_style_list_add_style(list, &led); break; #endif #if LV_USE_PAGE case LV_THEME_PAGE: lv_obj_clean_style_list(obj, LV_PAGE_PART_BG); list = lv_obj_get_style_list(obj, LV_PAGE_PART_BG); - lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &bg); lv_obj_clean_style_list(obj, LV_PAGE_PART_SCROLLABLE); list = lv_obj_get_style_list(obj, LV_PAGE_PART_SCROLLABLE); - lv_style_list_add_style(list, &pad_inner); + _lv_style_list_add_style(list, &pad_inner); lv_obj_clean_style_list(obj, LV_PAGE_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_PAGE_PART_SCROLLBAR); - lv_style_list_add_style(list, &sb); + _lv_style_list_add_style(list, &sb); #if LV_USE_ANIMATION lv_obj_clean_style_list(obj, LV_PAGE_PART_EDGE_FLASH); list = lv_obj_get_style_list(obj, LV_PAGE_PART_EDGE_FLASH); - lv_style_list_add_style(list, &edge_flash); + _lv_style_list_add_style(list, &edge_flash); #endif break; #endif @@ -1127,21 +1127,21 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_TABVIEW: lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG); - lv_style_list_add_style(list, &scr); + _lv_style_list_add_style(list, &scr); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG_SCRLLABLE); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_TAB_BG); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_TAB_BG); - lv_style_list_add_style(list, &tabview_btns_bg); + _lv_style_list_add_style(list, &tabview_btns_bg); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_INDIC); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_INDIC); - lv_style_list_add_style(list, &tabview_indic); + _lv_style_list_add_style(list, &tabview_indic); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_TAB_BTN); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_TAB_BTN); - lv_style_list_add_style(list, &tabview_btns); + _lv_style_list_add_style(list, &tabview_btns); break; case LV_THEME_TABVIEW_PAGE: @@ -1149,7 +1149,7 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) lv_obj_clean_style_list(obj, LV_PAGE_PART_SCROLLABLE); list = lv_obj_get_style_list(obj, LV_PAGE_PART_SCROLLABLE); - lv_style_list_add_style(list, &tabview_page_scrl); + _lv_style_list_add_style(list, &tabview_page_scrl); break; #endif @@ -1158,16 +1158,16 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_TILEVIEW: lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_BG); list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_BG); - lv_style_list_add_style(list, &scr); + _lv_style_list_add_style(list, &scr); lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_SCROLLBAR); - lv_style_list_add_style(list, &sb); + _lv_style_list_add_style(list, &sb); #if LV_USE_ANIMATION lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_EDGE_FLASH); list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_EDGE_FLASH); - lv_style_list_add_style(list, &edge_flash); + _lv_style_list_add_style(list, &edge_flash); #endif break; #endif @@ -1177,12 +1177,12 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_ROLLER: lv_obj_clean_style_list(obj, LV_ROLLER_PART_BG); list = lv_obj_get_style_list(obj, LV_ROLLER_PART_BG); - lv_style_list_add_style(list, &bg); - lv_style_list_add_style(list, &roller_bg); + _lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &roller_bg); lv_obj_clean_style_list(obj, LV_ROLLER_PART_SELECTED); list = lv_obj_get_style_list(obj, LV_ROLLER_PART_SELECTED); - lv_style_list_add_style(list, &roller_sel); + _lv_style_list_add_style(list, &roller_sel); break; #endif @@ -1198,20 +1198,20 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_LIST: lv_obj_clean_style_list(obj, LV_LIST_PART_BG); list = lv_obj_get_style_list(obj, LV_LIST_PART_BG); - lv_style_list_add_style(list, &bg); - lv_style_list_add_style(list, &list_bg); + _lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &list_bg); lv_obj_clean_style_list(obj, LV_LIST_PART_SCROLLABLE); lv_obj_clean_style_list(obj, LV_LIST_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_LIST_PART_SCROLLBAR); - lv_style_list_add_style(list, &sb); + _lv_style_list_add_style(list, &sb); break; case LV_THEME_LIST_BTN: lv_obj_clean_style_list(obj, LV_BTN_PART_MAIN); list = lv_obj_get_style_list(obj, LV_BTN_PART_MAIN); - lv_style_list_add_style(list, &list_btn); + _lv_style_list_add_style(list, &list_btn); break; #endif @@ -1219,22 +1219,22 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_DROPDOWN: lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_MAIN); list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_MAIN); - lv_style_list_add_style(list, &bg); - lv_style_list_add_style(list, &bg_click); - lv_style_list_add_style(list, &pad_small); + _lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &bg_click); + _lv_style_list_add_style(list, &pad_small); lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_LIST); list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_LIST); - lv_style_list_add_style(list, &bg); - lv_style_list_add_style(list, &ddlist_page); + _lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &ddlist_page); lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_SCROLLBAR); - lv_style_list_add_style(list, &sb); + _lv_style_list_add_style(list, &sb); lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_SELECTED); list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_SELECTED); - lv_style_list_add_style(list, &ddlist_sel); + _lv_style_list_add_style(list, &ddlist_sel); break; #endif @@ -1242,41 +1242,41 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_CHART: lv_obj_clean_style_list(obj, LV_CHART_PART_BG); list = lv_obj_get_style_list(obj, LV_CHART_PART_BG); - lv_style_list_add_style(list, &bg); - lv_style_list_add_style(list, &chart_bg); - lv_style_list_add_style(list, &pad_small); + _lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &chart_bg); + _lv_style_list_add_style(list, &pad_small); lv_obj_clean_style_list(obj, LV_CHART_PART_SERIES_BG); list = lv_obj_get_style_list(obj, LV_CHART_PART_SERIES_BG); - lv_style_list_add_style(list, &pad_small); - lv_style_list_add_style(list, &chart_series_bg); + _lv_style_list_add_style(list, &pad_small); + _lv_style_list_add_style(list, &chart_series_bg); lv_obj_clean_style_list(obj, LV_CHART_PART_SERIES); list = lv_obj_get_style_list(obj, LV_CHART_PART_SERIES); - lv_style_list_add_style(list, &chart_series); + _lv_style_list_add_style(list, &chart_series); break; #endif #if LV_USE_TABLE case LV_THEME_TABLE: lv_obj_clean_style_list(obj, LV_TABLE_PART_BG); list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG); - lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &bg); lv_obj_clean_style_list(obj, LV_TABLE_PART_CELL1); list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL1); - lv_style_list_add_style(list, &table_cell); + _lv_style_list_add_style(list, &table_cell); lv_obj_clean_style_list(obj, LV_TABLE_PART_CELL2); list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL2); - lv_style_list_add_style(list, &table_cell); + _lv_style_list_add_style(list, &table_cell); lv_obj_clean_style_list(obj, LV_TABLE_PART_CELL3); list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL3); - lv_style_list_add_style(list, &table_cell); + _lv_style_list_add_style(list, &table_cell); lv_obj_clean_style_list(obj, LV_TABLE_PART_CELL4); list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL4); - lv_style_list_add_style(list, &table_cell); + _lv_style_list_add_style(list, &table_cell); break; #endif @@ -1284,25 +1284,25 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_WIN: lv_obj_clean_style_list(obj, LV_WIN_PART_BG); list = lv_obj_get_style_list(obj, LV_WIN_PART_BG); - lv_style_list_add_style(list, &scr); + _lv_style_list_add_style(list, &scr); lv_obj_clean_style_list(obj, LV_WIN_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_WIN_PART_SCROLLBAR); - lv_style_list_add_style(list, &sb); + _lv_style_list_add_style(list, &sb); lv_obj_clean_style_list(obj, LV_WIN_PART_CONTENT_SCROLLABLE); list = lv_obj_get_style_list(obj, LV_WIN_PART_CONTENT_SCROLLABLE); - lv_style_list_add_style(list, &tabview_page_scrl); + _lv_style_list_add_style(list, &tabview_page_scrl); lv_obj_clean_style_list(obj, LV_WIN_PART_HEADER); list = lv_obj_get_style_list(obj, LV_WIN_PART_HEADER); - lv_style_list_add_style(list, &tabview_btns_bg); + _lv_style_list_add_style(list, &tabview_btns_bg); break; case LV_THEME_WIN_BTN: lv_obj_clean_style_list(obj, LV_BTN_PART_MAIN); list = lv_obj_get_style_list(obj, LV_BTN_PART_MAIN); - lv_style_list_add_style(list, &tabview_btns); + _lv_style_list_add_style(list, &tabview_btns); break; #endif @@ -1310,20 +1310,20 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_TEXTAREA: lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_BG); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_BG); - lv_style_list_add_style(list, &bg); - lv_style_list_add_style(list, &pad_small); + _lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &pad_small); lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_PLACEHOLDER); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_PLACEHOLDER); - lv_style_list_add_style(list, &ta_placeholder); + _lv_style_list_add_style(list, &ta_placeholder); lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_CURSOR); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_CURSOR); - lv_style_list_add_style(list, &ta_cursor); + _lv_style_list_add_style(list, &ta_cursor); lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_SCROLLBAR); - lv_style_list_add_style(list, &sb); + _lv_style_list_add_style(list, &sb); break; #endif @@ -1333,19 +1333,19 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_SPINBOX: lv_obj_clean_style_list(obj, LV_SPINBOX_PART_BG); list = lv_obj_get_style_list(obj, LV_SPINBOX_PART_BG); - lv_style_list_add_style(list, &bg); - lv_style_list_add_style(list, &pad_small); + _lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &pad_small); lv_obj_clean_style_list(obj, LV_SPINBOX_PART_CURSOR); list = lv_obj_get_style_list(obj, LV_SPINBOX_PART_CURSOR); - lv_style_list_add_style(list, &spinbox_cursor); + _lv_style_list_add_style(list, &spinbox_cursor); break; case LV_THEME_SPINBOX_BTN: lv_obj_clean_style_list(obj, LV_BTN_PART_MAIN); list = lv_obj_get_style_list(obj, LV_BTN_PART_MAIN); - lv_style_list_add_style(list, &bg); - lv_style_list_add_style(list, &bg_click); + _lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &bg_click); break; #endif @@ -1353,30 +1353,30 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_CALENDAR: lv_obj_clean_style_list(obj, LV_CALENDAR_PART_BG); list = lv_obj_get_style_list(obj, LV_CALENDAR_PART_BG); - lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &bg); lv_obj_clean_style_list(obj, LV_CALENDAR_PART_DATE); list = lv_obj_get_style_list(obj, LV_CALENDAR_PART_DATE); - lv_style_list_add_style(list, &calendar_date_nums); + _lv_style_list_add_style(list, &calendar_date_nums); lv_obj_clean_style_list(obj, LV_CALENDAR_PART_HEADER); list = lv_obj_get_style_list(obj, LV_CALENDAR_PART_HEADER); - lv_style_list_add_style(list, &calendar_header); + _lv_style_list_add_style(list, &calendar_header); lv_obj_clean_style_list(obj, LV_CALENDAR_PART_DAY_NAMES); list = lv_obj_get_style_list(obj, LV_CALENDAR_PART_DAY_NAMES); - lv_style_list_add_style(list, &calendar_daynames); + _lv_style_list_add_style(list, &calendar_daynames); break; #endif #if LV_USE_CPICKER case LV_THEME_CPICKER: lv_obj_clean_style_list(obj, LV_CPICKER_PART_MAIN); list = lv_obj_get_style_list(obj, LV_CPICKER_PART_MAIN); - lv_style_list_add_style(list, &cpicker_bg); + _lv_style_list_add_style(list, &cpicker_bg); lv_obj_clean_style_list(obj, LV_CPICKER_PART_KNOB); list = lv_obj_get_style_list(obj, LV_CPICKER_PART_KNOB); - lv_style_list_add_style(list, &cpicker_indic); + _lv_style_list_add_style(list, &cpicker_indic); break; #endif @@ -1384,24 +1384,24 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_LINEMETER: lv_obj_clean_style_list(obj, LV_LINEMETER_PART_MAIN); list = lv_obj_get_style_list(obj, LV_LINEMETER_PART_MAIN); - lv_style_list_add_style(list, &bg); - lv_style_list_add_style(list, &lmeter); + _lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &lmeter); break; #endif #if LV_USE_GAUGE case LV_THEME_GAUGE: lv_obj_clean_style_list(obj, LV_GAUGE_PART_MAIN); list = lv_obj_get_style_list(obj, LV_GAUGE_PART_MAIN); - lv_style_list_add_style(list, &bg); - lv_style_list_add_style(list, &gauge_main); + _lv_style_list_add_style(list, &bg); + _lv_style_list_add_style(list, &gauge_main); lv_obj_clean_style_list(obj, LV_GAUGE_PART_MAJOR); list = lv_obj_get_style_list(obj, LV_GAUGE_PART_MAJOR); - lv_style_list_add_style(list, &gauge_strong); + _lv_style_list_add_style(list, &gauge_strong); lv_obj_clean_style_list(obj, LV_GAUGE_PART_NEEDLE); list = lv_obj_get_style_list(obj, LV_GAUGE_PART_NEEDLE); - lv_style_list_add_style(list, &gauge_needle); + _lv_style_list_add_style(list, &gauge_needle); break; #endif default: diff --git a/src/lv_themes/lv_theme_mono.c b/src/lv_themes/lv_theme_mono.c index cccbd5df41..449ccac149 100644 --- a/src/lv_themes/lv_theme_mono.c +++ b/src/lv_themes/lv_theme_mono.c @@ -548,18 +548,18 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_SCR: lv_obj_clean_style_list(obj, LV_OBJ_PART_MAIN); list = lv_obj_get_style_list(obj, LV_OBJ_PART_MAIN); - lv_style_list_add_style(list, &style_scr); + _lv_style_list_add_style(list, &style_scr); break; case LV_THEME_OBJ: lv_obj_clean_style_list(obj, LV_OBJ_PART_MAIN); list = lv_obj_get_style_list(obj, LV_OBJ_PART_MAIN); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; #if LV_USE_CONT case LV_THEME_CONT: lv_obj_clean_style_list(obj, LV_OBJ_PART_MAIN); list = lv_obj_get_style_list(obj, LV_CONT_PART_MAIN); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; #endif @@ -567,8 +567,8 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_BTN: lv_obj_clean_style_list(obj, LV_BTN_PART_MAIN); list = lv_obj_get_style_list(obj, LV_BTN_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; #endif @@ -576,12 +576,12 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_BTNMATRIX: lv_obj_clean_style_list(obj, LV_BTNMATRIX_PART_BG); list = lv_obj_get_style_list(obj, LV_BTNMATRIX_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_BTNMATRIX_PART_BTN); list = lv_obj_get_style_list(obj, LV_BTNMATRIX_PART_BTN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; #endif @@ -589,13 +589,13 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_KEYBOARD: lv_obj_clean_style_list(obj, LV_KEYBOARD_PART_BG); list = lv_obj_get_style_list(obj, LV_KEYBOARD_PART_BG); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_pad_small); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_pad_small); lv_obj_clean_style_list(obj, LV_KEYBOARD_PART_BTN); list = lv_obj_get_style_list(obj, LV_KEYBOARD_PART_BTN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; #endif @@ -603,15 +603,15 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_BAR: lv_obj_clean_style_list(obj, LV_BAR_PART_BG); list = lv_obj_get_style_list(obj, LV_BAR_PART_BG); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_pad_none); - lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_pad_none); + _lv_style_list_add_style(list, &style_round); lv_obj_clean_style_list(obj, LV_BAR_PART_INDIC); list = lv_obj_get_style_list(obj, LV_BAR_PART_INDIC); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_fg_color); - lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_fg_color); + _lv_style_list_add_style(list, &style_round); break; #endif @@ -619,20 +619,20 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_SWITCH: lv_obj_clean_style_list(obj, LV_SWITCH_PART_BG); list = lv_obj_get_style_list(obj, LV_SWITCH_PART_BG); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_pad_none); - lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_pad_none); + _lv_style_list_add_style(list, &style_round); lv_obj_clean_style_list(obj, LV_SWITCH_PART_INDIC); list = lv_obj_get_style_list(obj, LV_SWITCH_PART_INDIC); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_fg_color); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_fg_color); lv_obj_clean_style_list(obj, LV_SWITCH_PART_KNOB); list = lv_obj_get_style_list(obj, LV_SWITCH_PART_KNOB); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_pad_none); - lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_pad_none); + _lv_style_list_add_style(list, &style_round); break; #endif @@ -675,11 +675,11 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_ARC: lv_obj_clean_style_list(obj, LV_ARC_PART_BG); list = lv_obj_get_style_list(obj, LV_ARC_PART_BG); - lv_style_list_add_style(list, &style_arc_bg); + _lv_style_list_add_style(list, &style_arc_bg); lv_obj_clean_style_list(obj, LV_ARC_PART_INDIC); list = lv_obj_get_style_list(obj, LV_ARC_PART_INDIC); - lv_style_list_add_style(list, &style_arc_indic); + _lv_style_list_add_style(list, &style_arc_indic); break; #endif @@ -687,14 +687,14 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_SPINNER: lv_obj_clean_style_list(obj, LV_SPINNER_PART_BG); list = lv_obj_get_style_list(obj, LV_SPINNER_PART_BG); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_tick_line); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_tick_line); lv_obj_clean_style_list(obj, LV_SPINNER_PART_INDIC); list = lv_obj_get_style_list(obj, LV_SPINNER_PART_INDIC); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_fg_color); - lv_style_list_add_style(list, &style_tick_line); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_fg_color); + _lv_style_list_add_style(list, &style_tick_line); break; #endif @@ -702,19 +702,19 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_SLIDER: lv_obj_clean_style_list(obj, LV_SLIDER_PART_BG); list = lv_obj_get_style_list(obj, LV_SLIDER_PART_BG); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_pad_none); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_pad_none); lv_obj_clean_style_list(obj, LV_SLIDER_PART_INDIC); list = lv_obj_get_style_list(obj, LV_SLIDER_PART_INDIC); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_fg_color); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_fg_color); lv_obj_clean_style_list(obj, LV_SLIDER_PART_KNOB); list = lv_obj_get_style_list(obj, LV_SLIDER_PART_KNOB); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_round); - lv_style_list_add_style(list, &style_pad_small); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_pad_small); break; #endif @@ -722,12 +722,12 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_CHECKBOX: lv_obj_clean_style_list(obj, LV_CHECKBOX_PART_BG); list = lv_obj_get_style_list(obj, LV_CHECKBOX_PART_BG); - lv_style_list_add_style(list, &style_pad_small); + _lv_style_list_add_style(list, &style_pad_small); lv_obj_clean_style_list(obj, LV_CHECKBOX_PART_BULLET); list = lv_obj_get_style_list(obj, LV_CHECKBOX_PART_BULLET); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; #endif @@ -735,18 +735,18 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_MSGBOX: lv_obj_clean_style_list(obj, LV_MSGBOX_PART_BG); list = lv_obj_get_style_list(obj, LV_MSGBOX_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; case LV_THEME_MSGBOX_BTNS: lv_obj_clean_style_list(obj, LV_MSGBOX_PART_BTN_BG); list = lv_obj_get_style_list(obj, LV_MSGBOX_PART_BTN_BG); - lv_style_list_add_style(list, &style_pad_inner); + _lv_style_list_add_style(list, &style_pad_inner); lv_obj_clean_style_list(obj, LV_MSGBOX_PART_BTN); list = lv_obj_get_style_list(obj, LV_MSGBOX_PART_BTN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; #endif @@ -754,45 +754,45 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_LED: lv_obj_clean_style_list(obj, LV_LED_PART_MAIN); list = lv_obj_get_style_list(obj, LV_LED_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_round); break; #endif #if LV_USE_PAGE case LV_THEME_PAGE: lv_obj_clean_style_list(obj, LV_PAGE_PART_BG); list = lv_obj_get_style_list(obj, LV_PAGE_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_PAGE_PART_SCROLLABLE); list = lv_obj_get_style_list(obj, LV_PAGE_PART_SCROLLABLE); - lv_style_list_add_style(list, &style_pad_inner); + _lv_style_list_add_style(list, &style_pad_inner); lv_obj_clean_style_list(obj, LV_PAGE_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_PAGE_PART_SCROLLBAR); - lv_style_list_add_style(list, &style_sb); + _lv_style_list_add_style(list, &style_sb); break; #endif #if LV_USE_TABVIEW case LV_THEME_TABVIEW: lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG); - lv_style_list_add_style(list, &style_scr); + _lv_style_list_add_style(list, &style_scr); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG_SCRLLABLE); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_TAB_BG); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_TAB_BG); - lv_style_list_add_style(list, &style_tab_bg); - lv_style_list_add_style(list, &style_pad_small); + _lv_style_list_add_style(list, &style_tab_bg); + _lv_style_list_add_style(list, &style_pad_small); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_INDIC); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_INDIC); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_TAB_BTN); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_TAB_BTN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; case LV_THEME_TABVIEW_PAGE: @@ -800,7 +800,7 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) lv_obj_clean_style_list(obj, LV_PAGE_PART_SCROLLABLE); list = lv_obj_get_style_list(obj, LV_PAGE_PART_SCROLLABLE); - lv_style_list_add_style(list, &style_pad_normal); + _lv_style_list_add_style(list, &style_pad_normal); break; #endif @@ -809,15 +809,15 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_TILEVIEW: lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_BG); list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_SCROLLBAR); - lv_style_list_add_style(list, &style_sb); + _lv_style_list_add_style(list, &style_sb); lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_EDGE_FLASH); list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_EDGE_FLASH); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; #endif @@ -826,14 +826,14 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_ROLLER: lv_obj_clean_style_list(obj, LV_ROLLER_PART_BG); list = lv_obj_get_style_list(obj, LV_ROLLER_PART_BG); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_big_line_space); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_big_line_space); lv_obj_clean_style_list(obj, LV_ROLLER_PART_SELECTED); list = lv_obj_get_style_list(obj, LV_ROLLER_PART_SELECTED); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_fg_color); - lv_style_list_add_style(list, &style_no_radius); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_fg_color); + _lv_style_list_add_style(list, &style_no_radius); break; #endif @@ -849,23 +849,23 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_LIST: lv_obj_clean_style_list(obj, LV_LIST_PART_BG); list = lv_obj_get_style_list(obj, LV_LIST_PART_BG); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_pad_none); - lv_style_list_add_style(list, &style_clip_corner); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_pad_none); + _lv_style_list_add_style(list, &style_clip_corner); lv_obj_clean_style_list(obj, LV_LIST_PART_SCROLLABLE); lv_obj_clean_style_list(obj, LV_LIST_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_LIST_PART_SCROLLBAR); - lv_style_list_add_style(list, &style_sb); + _lv_style_list_add_style(list, &style_sb); break; case LV_THEME_LIST_BTN: lv_obj_clean_style_list(obj, LV_BTN_PART_MAIN); list = lv_obj_get_style_list(obj, LV_BTN_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); - lv_style_list_add_style(list, &style_list_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_list_btn); break; #endif @@ -874,23 +874,23 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_DROPDOWN: lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_MAIN); list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_LIST); list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_LIST); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_big_line_space); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_big_line_space); lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_SCROLLBAR); - lv_style_list_add_style(list, &style_sb); + _lv_style_list_add_style(list, &style_sb); lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_SELECTED); list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_SELECTED); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_fg_color); - lv_style_list_add_style(list, &style_no_radius); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_fg_color); + _lv_style_list_add_style(list, &style_no_radius); break; #endif @@ -898,43 +898,43 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_CHART: lv_obj_clean_style_list(obj, LV_CHART_PART_BG); list = lv_obj_get_style_list(obj, LV_CHART_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_CHART_PART_SERIES_BG); list = lv_obj_get_style_list(obj, LV_CHART_PART_SERIES_BG); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_border_none); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_border_none); lv_obj_clean_style_list(obj, LV_CHART_PART_SERIES); list = lv_obj_get_style_list(obj, LV_CHART_PART_SERIES); - lv_style_list_add_style(list, &style_chart_series); + _lv_style_list_add_style(list, &style_chart_series); break; #endif #if LV_USE_TABLE case LV_THEME_TABLE: lv_obj_clean_style_list(obj, LV_TABLE_PART_BG); list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_TABLE_PART_CELL1); list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL1); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_no_radius); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_no_radius); lv_obj_clean_style_list(obj, LV_TABLE_PART_CELL2); list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL2); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_no_radius); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_no_radius); lv_obj_clean_style_list(obj, LV_TABLE_PART_CELL3); list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL3); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_no_radius); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_no_radius); lv_obj_clean_style_list(obj, LV_TABLE_PART_CELL4); list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL4); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_no_radius); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_no_radius); break; #endif @@ -942,26 +942,26 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_WIN: lv_obj_clean_style_list(obj, LV_WIN_PART_BG); list = lv_obj_get_style_list(obj, LV_WIN_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_WIN_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_WIN_PART_SCROLLBAR); - lv_style_list_add_style(list, &style_sb); + _lv_style_list_add_style(list, &style_sb); lv_obj_clean_style_list(obj, LV_WIN_PART_CONTENT_SCROLLABLE); list = lv_obj_get_style_list(obj, LV_WIN_PART_CONTENT_SCROLLABLE); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_WIN_PART_HEADER); list = lv_obj_get_style_list(obj, LV_WIN_PART_HEADER); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; case LV_THEME_WIN_BTN: lv_obj_clean_style_list(obj, LV_BTN_PART_MAIN); list = lv_obj_get_style_list(obj, LV_BTN_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; #endif @@ -969,17 +969,17 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_TEXTAREA: lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_BG); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_PLACEHOLDER); lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_CURSOR); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_CURSOR); - lv_style_list_add_style(list, &style_ta_cursor); + _lv_style_list_add_style(list, &style_ta_cursor); lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_SCROLLBAR); - lv_style_list_add_style(list, &style_sb); + _lv_style_list_add_style(list, &style_sb); break; #endif @@ -988,21 +988,21 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_SPINBOX: lv_obj_clean_style_list(obj, LV_SPINBOX_PART_BG); list = lv_obj_get_style_list(obj, LV_SPINBOX_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_SPINBOX_PART_CURSOR); list = lv_obj_get_style_list(obj, LV_SPINBOX_PART_CURSOR); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_fg_color); - lv_style_list_add_style(list, &style_pad_none); - lv_style_list_add_style(list, &style_no_radius); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_fg_color); + _lv_style_list_add_style(list, &style_pad_none); + _lv_style_list_add_style(list, &style_no_radius); break; case LV_THEME_SPINBOX_BTN: lv_obj_clean_style_list(obj, LV_BTN_PART_MAIN); list = lv_obj_get_style_list(obj, LV_BTN_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; #endif @@ -1010,37 +1010,37 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_CALENDAR: lv_obj_clean_style_list(obj, LV_CALENDAR_PART_BG); list = lv_obj_get_style_list(obj, LV_CALENDAR_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_CALENDAR_PART_DATE); list = lv_obj_get_style_list(obj, LV_CALENDAR_PART_DATE); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); - lv_style_list_add_style(list, &style_pad_small); - lv_style_list_add_style(list, &style_border_none); - lv_style_list_add_style(list, &style_calendar_date); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_pad_small); + _lv_style_list_add_style(list, &style_border_none); + _lv_style_list_add_style(list, &style_calendar_date); lv_obj_clean_style_list(obj, LV_CALENDAR_PART_HEADER); list = lv_obj_get_style_list(obj, LV_CALENDAR_PART_HEADER); - lv_style_list_add_style(list, &style_pad_normal); - lv_style_list_add_style(list, &style_border_none); + _lv_style_list_add_style(list, &style_pad_normal); + _lv_style_list_add_style(list, &style_border_none); lv_obj_clean_style_list(obj, LV_CALENDAR_PART_DAY_NAMES); list = lv_obj_get_style_list(obj, LV_CALENDAR_PART_DAY_NAMES); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_pad_small); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_pad_small); break; #endif #if LV_USE_CPICKER case LV_THEME_CPICKER: lv_obj_clean_style_list(obj, LV_CPICKER_PART_MAIN); list = lv_obj_get_style_list(obj, LV_CPICKER_PART_MAIN); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_CPICKER_PART_KNOB); list = lv_obj_get_style_list(obj, LV_CPICKER_PART_KNOB); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_round); break; #endif @@ -1048,25 +1048,25 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_LINEMETER: lv_obj_clean_style_list(obj, LV_LINEMETER_PART_MAIN); list = lv_obj_get_style_list(obj, LV_LINEMETER_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_round); - lv_style_list_add_style(list, &style_linemeter); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_linemeter); break; #endif #if LV_USE_GAUGE case LV_THEME_GAUGE: lv_obj_clean_style_list(obj, LV_GAUGE_PART_MAIN); list = lv_obj_get_style_list(obj, LV_GAUGE_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_round); lv_obj_clean_style_list(obj, LV_GAUGE_PART_MAJOR); list = lv_obj_get_style_list(obj, LV_GAUGE_PART_MAJOR); - lv_style_list_add_style(list, &style_gauge_major); + _lv_style_list_add_style(list, &style_gauge_major); lv_obj_clean_style_list(obj, LV_GAUGE_PART_NEEDLE); list = lv_obj_get_style_list(obj, LV_GAUGE_PART_NEEDLE); - lv_style_list_add_style(list, &style_gauge_needle); + _lv_style_list_add_style(list, &style_gauge_needle); break; #endif default: diff --git a/src/lv_themes/lv_theme_template.c b/src/lv_themes/lv_theme_template.c index 1593e20417..17d785c989 100644 --- a/src/lv_themes/lv_theme_template.c +++ b/src/lv_themes/lv_theme_template.c @@ -391,19 +391,19 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_SCR: lv_obj_clean_style_list(obj, LV_OBJ_PART_MAIN); list = lv_obj_get_style_list(obj, LV_OBJ_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_tight); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_tight); break; case LV_THEME_OBJ: lv_obj_clean_style_list(obj, LV_OBJ_PART_MAIN); list = lv_obj_get_style_list(obj, LV_OBJ_PART_MAIN); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; #if LV_USE_CONT case LV_THEME_CONT: lv_obj_clean_style_list(obj, LV_OBJ_PART_MAIN); list = lv_obj_get_style_list(obj, LV_CONT_PART_MAIN); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; #endif @@ -411,8 +411,8 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_BTN: lv_obj_clean_style_list(obj, LV_BTN_PART_MAIN); list = lv_obj_get_style_list(obj, LV_BTN_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; #endif @@ -420,12 +420,12 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_BTNMATRIX: lv_obj_clean_style_list(obj, LV_BTNMATRIX_PART_BG); list = lv_obj_get_style_list(obj, LV_BTNMATRIX_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_BTNMATRIX_PART_BTN); list = lv_obj_get_style_list(obj, LV_BTNMATRIX_PART_BTN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; #endif @@ -433,12 +433,12 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_KEYBOARD: lv_obj_clean_style_list(obj, LV_KEYBOARD_PART_BG); list = lv_obj_get_style_list(obj, LV_KEYBOARD_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_KEYBOARD_PART_BTN); list = lv_obj_get_style_list(obj, LV_KEYBOARD_PART_BTN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; #endif @@ -446,13 +446,13 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_BAR: lv_obj_clean_style_list(obj, LV_BAR_PART_BG); list = lv_obj_get_style_list(obj, LV_BAR_PART_BG); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_tight); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_tight); lv_obj_clean_style_list(obj, LV_BAR_PART_INDIC); list = lv_obj_get_style_list(obj, LV_BAR_PART_INDIC); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_color); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_color); break; #endif @@ -460,20 +460,20 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_SWITCH: lv_obj_clean_style_list(obj, LV_SWITCH_PART_BG); list = lv_obj_get_style_list(obj, LV_SWITCH_PART_BG); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_tight); - lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_tight); + _lv_style_list_add_style(list, &style_round); lv_obj_clean_style_list(obj, LV_SWITCH_PART_INDIC); list = lv_obj_get_style_list(obj, LV_SWITCH_PART_INDIC); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_color); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_color); lv_obj_clean_style_list(obj, LV_SWITCH_PART_KNOB); list = lv_obj_get_style_list(obj, LV_SWITCH_PART_KNOB); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_tight); - lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_tight); + _lv_style_list_add_style(list, &style_round); break; #endif @@ -516,15 +516,15 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_ARC: lv_obj_clean_style_list(obj, LV_ARC_PART_BG); list = lv_obj_get_style_list(obj, LV_ARC_PART_BG); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_tick_line); - lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_tick_line); + _lv_style_list_add_style(list, &style_round); lv_obj_clean_style_list(obj, LV_ARC_PART_INDIC); list = lv_obj_get_style_list(obj, LV_ARC_PART_INDIC); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_color); - lv_style_list_add_style(list, &style_tick_line); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_color); + _lv_style_list_add_style(list, &style_tick_line); break; #endif @@ -532,14 +532,14 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_SPINNER: lv_obj_clean_style_list(obj, LV_SPINNER_PART_BG); list = lv_obj_get_style_list(obj, LV_SPINNER_PART_BG); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_tick_line); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_tick_line); lv_obj_clean_style_list(obj, LV_SPINNER_PART_INDIC); list = lv_obj_get_style_list(obj, LV_SPINNER_PART_INDIC); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_color); - lv_style_list_add_style(list, &style_tick_line); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_color); + _lv_style_list_add_style(list, &style_tick_line); break; #endif @@ -547,17 +547,17 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_SLIDER: lv_obj_clean_style_list(obj, LV_SLIDER_PART_BG); list = lv_obj_get_style_list(obj, LV_SLIDER_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_SLIDER_PART_INDIC); list = lv_obj_get_style_list(obj, LV_SLIDER_PART_INDIC); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_color); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_color); lv_obj_clean_style_list(obj, LV_SLIDER_PART_KNOB); list = lv_obj_get_style_list(obj, LV_SLIDER_PART_KNOB); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_round); break; #endif @@ -568,8 +568,8 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) lv_obj_clean_style_list(obj, LV_CHECKBOX_PART_BULLET); list = lv_obj_get_style_list(obj, LV_CHECKBOX_PART_BULLET); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; #endif @@ -577,18 +577,18 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_MSGBOX: lv_obj_clean_style_list(obj, LV_MSGBOX_PART_BG); list = lv_obj_get_style_list(obj, LV_MSGBOX_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; case LV_THEME_MSGBOX_BTNS: lv_obj_clean_style_list(obj, LV_MSGBOX_PART_BTN_BG); list = lv_obj_get_style_list(obj, LV_MSGBOX_PART_BTN_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_MSGBOX_PART_BTN); list = lv_obj_get_style_list(obj, LV_MSGBOX_PART_BTN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; #endif @@ -596,62 +596,62 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_LED: lv_obj_clean_style_list(obj, LV_LED_PART_MAIN); list = lv_obj_get_style_list(obj, LV_LED_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_color); - lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_color); + _lv_style_list_add_style(list, &style_round); break; #endif #if LV_USE_PAGE case LV_THEME_PAGE: lv_obj_clean_style_list(obj, LV_PAGE_PART_BG); list = lv_obj_get_style_list(obj, LV_PAGE_PART_BG); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_gray); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_gray); lv_obj_clean_style_list(obj, LV_PAGE_PART_SCROLLABLE); list = lv_obj_get_style_list(obj, LV_PAGE_PART_SCROLLABLE); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_PAGE_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_PAGE_PART_SCROLLBAR); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; #endif #if LV_USE_TABVIEW case LV_THEME_TABVIEW: lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG_SCRLLABLE); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG_SCRLLABLE); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_color); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_color); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_TAB_BG); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_TAB_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_INDIC); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_INDIC); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_color); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_color); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_TAB_BTN); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_TAB_BTN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; case LV_THEME_TABVIEW_PAGE: lv_obj_clean_style_list(obj, LV_PAGE_PART_BG); list = lv_obj_get_style_list(obj, LV_PAGE_PART_BG); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_gray); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_gray); lv_obj_clean_style_list(obj, LV_PAGE_PART_SCROLLABLE); list = lv_obj_get_style_list(obj, LV_PAGE_PART_SCROLLABLE); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; #endif @@ -660,15 +660,15 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_TILEVIEW: lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_BG); list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_SCROLLBAR); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_EDGE_FLASH); list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_EDGE_FLASH); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; #endif @@ -677,12 +677,12 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_ROLLER: lv_obj_clean_style_list(obj, LV_ROLLER_PART_BG); list = lv_obj_get_style_list(obj, LV_ROLLER_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_ROLLER_PART_SELECTED); list = lv_obj_get_style_list(obj, LV_ROLLER_PART_SELECTED); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_color); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_color); break; #endif @@ -698,21 +698,21 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_LIST: lv_obj_clean_style_list(obj, LV_LIST_PART_BG); list = lv_obj_get_style_list(obj, LV_LIST_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_LIST_PART_SCROLLABLE); list = lv_obj_get_style_list(obj, LV_LIST_PART_SCROLLABLE); lv_obj_clean_style_list(obj, LV_LIST_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_LIST_PART_SCROLLBAR); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; case LV_THEME_LIST_BTN: lv_obj_clean_style_list(obj, LV_BTN_PART_MAIN); list = lv_obj_get_style_list(obj, LV_BTN_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; #endif @@ -720,21 +720,21 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_DROPDOWN: lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_MAIN); list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_LIST); list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_LIST); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_SCROLLBAR); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_SELECTED); list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_SELECTED); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_color); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_color); break; #endif @@ -742,39 +742,39 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_CHART: lv_obj_clean_style_list(obj, LV_CHART_PART_BG); list = lv_obj_get_style_list(obj, LV_CHART_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_CHART_PART_SERIES_BG); list = lv_obj_get_style_list(obj, LV_CHART_PART_SERIES_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_CHART_PART_SERIES); list = lv_obj_get_style_list(obj, LV_CHART_PART_SERIES); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_tight); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_tight); break; #endif #if LV_USE_TABLE case LV_THEME_TABLE: lv_obj_clean_style_list(obj, LV_TABLE_PART_BG); list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_TABLE_PART_CELL1); list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL1); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_TABLE_PART_CELL2); list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL2); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_TABLE_PART_CELL3); list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL3); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_TABLE_PART_CELL4); list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL4); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; #endif @@ -782,26 +782,26 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_WIN: lv_obj_clean_style_list(obj, LV_WIN_PART_BG); list = lv_obj_get_style_list(obj, LV_WIN_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_WIN_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_WIN_PART_SCROLLBAR); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_WIN_PART_CONTENT_SCROLLABLE); list = lv_obj_get_style_list(obj, LV_WIN_PART_CONTENT_SCROLLABLE); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_WIN_PART_HEADER); list = lv_obj_get_style_list(obj, LV_WIN_PART_HEADER); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; case LV_THEME_WIN_BTN: lv_obj_clean_style_list(obj, LV_BTN_PART_MAIN); list = lv_obj_get_style_list(obj, LV_BTN_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; #endif @@ -809,20 +809,20 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_TEXTAREA: lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_BG); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_PLACEHOLDER); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_PLACEHOLDER); - lv_style_list_add_style(list, &style_gray); + _lv_style_list_add_style(list, &style_gray); lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_CURSOR); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_CURSOR); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_tight); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_tight); lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_SCROLLBAR); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_SCROLLBAR); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; #endif @@ -831,18 +831,18 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_SPINBOX: lv_obj_clean_style_list(obj, LV_SPINBOX_PART_BG); list = lv_obj_get_style_list(obj, LV_SPINBOX_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_SPINBOX_PART_CURSOR); list = lv_obj_get_style_list(obj, LV_SPINBOX_PART_CURSOR); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; case LV_THEME_SPINBOX_BTN: lv_obj_clean_style_list(obj, LV_BTN_PART_MAIN); list = lv_obj_get_style_list(obj, LV_BTN_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); break; #endif @@ -850,34 +850,34 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_CALENDAR: lv_obj_clean_style_list(obj, LV_CALENDAR_PART_BG); list = lv_obj_get_style_list(obj, LV_CALENDAR_PART_BG); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_CALENDAR_PART_DATE); list = lv_obj_get_style_list(obj, LV_CALENDAR_PART_DATE); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_btn); - lv_style_list_add_style(list, &style_tight); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_btn); + _lv_style_list_add_style(list, &style_tight); lv_obj_clean_style_list(obj, LV_CALENDAR_PART_HEADER); list = lv_obj_get_style_list(obj, LV_CALENDAR_PART_HEADER); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_CALENDAR_PART_DAY_NAMES); list = lv_obj_get_style_list(obj, LV_CALENDAR_PART_DAY_NAMES); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_tight); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_tight); break; #endif #if LV_USE_CPICKER case LV_THEME_CPICKER: lv_obj_clean_style_list(obj, LV_CPICKER_PART_MAIN); list = lv_obj_get_style_list(obj, LV_CPICKER_PART_MAIN); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); lv_obj_clean_style_list(obj, LV_CPICKER_PART_KNOB); list = lv_obj_get_style_list(obj, LV_CPICKER_PART_KNOB); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_round); break; #endif @@ -885,24 +885,24 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name) case LV_THEME_LINEMETER: lv_obj_clean_style_list(obj, LV_LINEMETER_PART_MAIN); list = lv_obj_get_style_list(obj, LV_LINEMETER_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_round); break; #endif #if LV_USE_GAUGE case LV_THEME_GAUGE: lv_obj_clean_style_list(obj, LV_GAUGE_PART_MAIN); list = lv_obj_get_style_list(obj, LV_GAUGE_PART_MAIN); - lv_style_list_add_style(list, &style_bg); - lv_style_list_add_style(list, &style_round); + _lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_round); lv_obj_clean_style_list(obj, LV_GAUGE_PART_MAJOR); list = lv_obj_get_style_list(obj, LV_GAUGE_PART_MAJOR); - lv_style_list_add_style(list, &style_tick_line); + _lv_style_list_add_style(list, &style_tick_line); lv_obj_clean_style_list(obj, LV_GAUGE_PART_NEEDLE); list = lv_obj_get_style_list(obj, LV_GAUGE_PART_NEEDLE); - lv_style_list_add_style(list, &style_bg); + _lv_style_list_add_style(list, &style_bg); break; #endif default: diff --git a/src/lv_widgets/lv_arc.c b/src/lv_widgets/lv_arc.c index c10b0f5d3c..5905a701cf 100644 --- a/src/lv_widgets/lv_arc.c +++ b/src/lv_widgets/lv_arc.c @@ -542,74 +542,74 @@ static void inv_arc_area(lv_obj_t * arc, uint16_t start_angle, uint16_t end_angl if(start_quarter == end_quarter && start_angle <= end_angle) { if(start_quarter == 0) { - inv_area.y1 = y + ((lv_trigo_sin(start_angle) * rin) >> LV_TRIGO_SHIFT) - extra_area; - inv_area.x2 = x + ((lv_trigo_sin(start_angle + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; + inv_area.y1 = y + ((_lv_trigo_sin(start_angle) * rin) >> LV_TRIGO_SHIFT) - extra_area; + inv_area.x2 = x + ((_lv_trigo_sin(start_angle + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; - inv_area.y2 = y + ((lv_trigo_sin(end_angle) * rout) >> LV_TRIGO_SHIFT) + extra_area; - inv_area.x1 = x + ((lv_trigo_sin(end_angle + 90) * rin) >> LV_TRIGO_SHIFT) - extra_area; + inv_area.y2 = y + ((_lv_trigo_sin(end_angle) * rout) >> LV_TRIGO_SHIFT) + extra_area; + inv_area.x1 = x + ((_lv_trigo_sin(end_angle + 90) * rin) >> LV_TRIGO_SHIFT) - extra_area; lv_obj_invalidate_area(arc, &inv_area); } else if(start_quarter == 1) { - inv_area.y2 = y + ((lv_trigo_sin(start_angle) * rout) >> LV_TRIGO_SHIFT) + extra_area; - inv_area.x2 = x + ((lv_trigo_sin(start_angle + 90) * rin) >> LV_TRIGO_SHIFT) + extra_area; + inv_area.y2 = y + ((_lv_trigo_sin(start_angle) * rout) >> LV_TRIGO_SHIFT) + extra_area; + inv_area.x2 = x + ((_lv_trigo_sin(start_angle + 90) * rin) >> LV_TRIGO_SHIFT) + extra_area; - inv_area.y1 = y + ((lv_trigo_sin(end_angle) * rin) >> LV_TRIGO_SHIFT) - extra_area; - inv_area.x1 = x + ((lv_trigo_sin(end_angle + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; + inv_area.y1 = y + ((_lv_trigo_sin(end_angle) * rin) >> LV_TRIGO_SHIFT) - extra_area; + inv_area.x1 = x + ((_lv_trigo_sin(end_angle + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; lv_obj_invalidate_area(arc, &inv_area); } else if(start_quarter == 2) { - inv_area.x1 = x + ((lv_trigo_sin(start_angle + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; - inv_area.y2 = y + ((lv_trigo_sin(start_angle) * rin) >> LV_TRIGO_SHIFT) + extra_area; + inv_area.x1 = x + ((_lv_trigo_sin(start_angle + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; + inv_area.y2 = y + ((_lv_trigo_sin(start_angle) * rin) >> LV_TRIGO_SHIFT) + extra_area; - inv_area.y1 = y + ((lv_trigo_sin(end_angle) * rout) >> LV_TRIGO_SHIFT) - extra_area; - inv_area.x2 = x + ((lv_trigo_sin(end_angle + 90) * rin) >> LV_TRIGO_SHIFT) + extra_area; + inv_area.y1 = y + ((_lv_trigo_sin(end_angle) * rout) >> LV_TRIGO_SHIFT) - extra_area; + inv_area.x2 = x + ((_lv_trigo_sin(end_angle + 90) * rin) >> LV_TRIGO_SHIFT) + extra_area; lv_obj_invalidate_area(arc, &inv_area); } else if(start_quarter == 3) { /*Small arc here*/ - inv_area.x1 = x + ((lv_trigo_sin(start_angle + 90) * rin) >> LV_TRIGO_SHIFT) - extra_area; - inv_area.y1 = y + ((lv_trigo_sin(start_angle) * rout) >> LV_TRIGO_SHIFT) - extra_area; + inv_area.x1 = x + ((_lv_trigo_sin(start_angle + 90) * rin) >> LV_TRIGO_SHIFT) - extra_area; + inv_area.y1 = y + ((_lv_trigo_sin(start_angle) * rout) >> LV_TRIGO_SHIFT) - extra_area; - inv_area.x2 = x + ((lv_trigo_sin(end_angle + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; - inv_area.y2 = y + ((lv_trigo_sin(end_angle) * rin) >> LV_TRIGO_SHIFT) + extra_area; + inv_area.x2 = x + ((_lv_trigo_sin(end_angle + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; + inv_area.y2 = y + ((_lv_trigo_sin(end_angle) * rin) >> LV_TRIGO_SHIFT) + extra_area; lv_obj_invalidate_area(arc, &inv_area); } } else if(start_quarter == 0 && end_quarter == 1) { - inv_area.x1 = x + ((lv_trigo_sin(end_angle + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; - inv_area.y1 = y + ((LV_MATH_MIN(lv_trigo_sin(end_angle), - lv_trigo_sin(start_angle)) * rin) >> LV_TRIGO_SHIFT) - extra_area; - inv_area.x2 = x + ((lv_trigo_sin(start_angle + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; + inv_area.x1 = x + ((_lv_trigo_sin(end_angle + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; + inv_area.y1 = y + ((LV_MATH_MIN(_lv_trigo_sin(end_angle), + _lv_trigo_sin(start_angle)) * rin) >> LV_TRIGO_SHIFT) - extra_area; + inv_area.x2 = x + ((_lv_trigo_sin(start_angle + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; inv_area.y2 = y + rout + extra_area; lv_obj_invalidate_area(arc, &inv_area); } else if(start_quarter == 1 && end_quarter == 2) { inv_area.x1 = x - rout - extra_area; - inv_area.y1 = y + ((lv_trigo_sin(end_angle) * rout) >> LV_TRIGO_SHIFT) - extra_area; - inv_area.x2 = x + ((LV_MATH_MAX(lv_trigo_sin(start_angle + 90), - lv_trigo_sin(end_angle + 90)) * rin) >> LV_TRIGO_SHIFT) + extra_area; - inv_area.y2 = y + ((lv_trigo_sin(start_angle) * rout) >> LV_TRIGO_SHIFT) + extra_area; + inv_area.y1 = y + ((_lv_trigo_sin(end_angle) * rout) >> LV_TRIGO_SHIFT) - extra_area; + inv_area.x2 = x + ((LV_MATH_MAX(_lv_trigo_sin(start_angle + 90), + _lv_trigo_sin(end_angle + 90)) * rin) >> LV_TRIGO_SHIFT) + extra_area; + inv_area.y2 = y + ((_lv_trigo_sin(start_angle) * rout) >> LV_TRIGO_SHIFT) + extra_area; lv_obj_invalidate_area(arc, &inv_area); } else if(start_quarter == 2 && end_quarter == 3) { - inv_area.x1 = x + ((lv_trigo_sin(start_angle + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; + inv_area.x1 = x + ((_lv_trigo_sin(start_angle + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; inv_area.y1 = y - rout - extra_area; - inv_area.x2 = x + ((lv_trigo_sin(end_angle + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; - inv_area.y2 = y + (LV_MATH_MAX(lv_trigo_sin(end_angle) * rin, - lv_trigo_sin(start_angle) * rin) >> LV_TRIGO_SHIFT) + extra_area; + inv_area.x2 = x + ((_lv_trigo_sin(end_angle + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; + inv_area.y2 = y + (LV_MATH_MAX(_lv_trigo_sin(end_angle) * rin, + _lv_trigo_sin(start_angle) * rin) >> LV_TRIGO_SHIFT) + extra_area; lv_obj_invalidate_area(arc, &inv_area); } else if(start_quarter == 3 && end_quarter == 0) { - inv_area.x1 = x + ((LV_MATH_MIN(lv_trigo_sin(end_angle + 90), - lv_trigo_sin(start_angle + 90)) * rin) >> LV_TRIGO_SHIFT) - extra_area; - inv_area.y1 = y + ((lv_trigo_sin(start_angle) * rout) >> LV_TRIGO_SHIFT) - extra_area; + inv_area.x1 = x + ((LV_MATH_MIN(_lv_trigo_sin(end_angle + 90), + _lv_trigo_sin(start_angle + 90)) * rin) >> LV_TRIGO_SHIFT) - extra_area; + inv_area.y1 = y + ((_lv_trigo_sin(start_angle) * rout) >> LV_TRIGO_SHIFT) - extra_area; inv_area.x2 = x + rout + extra_area; - inv_area.y2 = y + ((lv_trigo_sin(end_angle) * rout) >> LV_TRIGO_SHIFT) + extra_area; + inv_area.y2 = y + ((_lv_trigo_sin(end_angle) * rout) >> LV_TRIGO_SHIFT) + extra_area; lv_obj_invalidate_area(arc, &inv_area); } diff --git a/src/lv_widgets/lv_btnmatrix.c b/src/lv_widgets/lv_btnmatrix.c index 883391b223..38f04cb01c 100644 --- a/src/lv_widgets/lv_btnmatrix.c +++ b/src/lv_widgets/lv_btnmatrix.c @@ -275,7 +275,7 @@ void lv_btnmatrix_set_ctrl_map(lv_obj_t * btnm, const lv_btnmatrix_ctrl_t ctrl_m LV_ASSERT_OBJ(btnm, LV_OBJX_NAME); lv_btnmatrix_ext_t * ext = lv_obj_get_ext_attr(btnm); - lv_memcpy(ext->ctrl_bits, ctrl_map, sizeof(lv_btnmatrix_ctrl_t) * ext->btn_cnt); + _lv_memcpy(ext->ctrl_bits, ctrl_map, sizeof(lv_btnmatrix_ctrl_t) * ext->btn_cnt); lv_btnmatrix_set_map(btnm, ext->map_p); } @@ -739,7 +739,7 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl lv_style_int_t line_space = draw_label_dsc_act->line_space; const char * txt = ext->map_p[txt_i]; lv_point_t txt_size; - lv_txt_get_size(&txt_size, txt, font, letter_space, + _lv_txt_get_size(&txt_size, txt, font, letter_space, line_space, lv_area_get_width(&area_btnm), txt_flag); area_tmp.x1 += (btn_w - txt_size.x) / 2; @@ -1081,7 +1081,7 @@ static void allocate_btn_areas_and_controls(const lv_obj_t * btnm, const char ** LV_ASSERT_MEM(ext->ctrl_bits); if(ext->button_areas == NULL || ext->ctrl_bits == NULL) btn_cnt = 0; - lv_memset_00(ext->ctrl_bits, sizeof(lv_btnmatrix_ctrl_t) * btn_cnt); + _lv_memset_00(ext->ctrl_bits, sizeof(lv_btnmatrix_ctrl_t) * btn_cnt); ext->btn_cnt = btn_cnt; } @@ -1166,7 +1166,7 @@ static uint16_t get_button_from_point(lv_obj_t * btnm, lv_point_t * p) if(btn_area.y2 >= h - pbottom - 2) btn_area.y2 = btnm_cords.y2; /*-2 for rounding error*/ else btn_area.y2 += btnm_cords.y1 + pinner; - if(lv_area_is_point_on(&btn_area, p, 0) != false) { + if(_lv_area_is_point_on(&btn_area, p, 0) != false) { break; } } diff --git a/src/lv_widgets/lv_calendar.c b/src/lv_widgets/lv_calendar.c index 20a07791d9..062145ff11 100644 --- a/src/lv_widgets/lv_calendar.c +++ b/src/lv_widgets/lv_calendar.c @@ -445,7 +445,7 @@ static lv_res_t lv_calendar_signal(lv_obj_t * calendar, lv_signal_t sign, void * lv_indev_get_point(indev, &p); /*If the header is pressed mark an arrow as pressed*/ - if(lv_area_is_point_on(&header_area, &p, 0)) { + if(_lv_area_is_point_on(&header_area, &p, 0)) { if(p.x < header_area.x1 + lv_area_get_width(&header_area) / 2) { if(ext->btn_pressing != -1) lv_obj_invalidate(calendar); ext->btn_pressing = -1; @@ -598,7 +598,7 @@ static bool calculate_touched_day(lv_obj_t * calendar, const lv_point_t * touche days_area.y1 = calendar->coords.y1 + get_header_height(calendar) + get_day_names_height(calendar) + top; days_area.y2 -= bottom; - if(lv_area_is_point_on(&days_area, touched_point, 0)) { + if(_lv_area_is_point_on(&days_area, touched_point, 0)) { lv_coord_t w = (days_area.x2 - days_area.x1 + 1) / 7; lv_coord_t h = (days_area.y2 - days_area.y1 + 1) / 6; uint8_t x_pos = 0; @@ -693,7 +693,7 @@ static void draw_header(lv_obj_t * calendar, const lv_area_t * mask) /*Add the year + month name*/ char txt_buf[64]; - lv_utils_num_to_str(ext->showed_date.year, txt_buf); + _lv_utils_num_to_str(ext->showed_date.year, txt_buf); txt_buf[4] = ' '; txt_buf[5] = '\0'; strcpy(&txt_buf[5], get_month_name(calendar, ext->showed_date.month)); @@ -724,7 +724,7 @@ static void draw_header(lv_obj_t * calendar, const lv_area_t * mask) if(ext->btn_pressing > 0) calendar->state |= LV_STATE_PRESSED; else calendar->state &= ~(LV_STATE_PRESSED); - header_area.x1 = header_area.x2 - header_right - lv_txt_get_width(LV_SYMBOL_RIGHT, (uint16_t)strlen(LV_SYMBOL_RIGHT), + header_area.x1 = header_area.x2 - header_right - _lv_txt_get_width(LV_SYMBOL_RIGHT, (uint16_t)strlen(LV_SYMBOL_RIGHT), font, 0, LV_TXT_FLAG_NONE); lv_draw_label_dsc_init(&label_dsc); @@ -912,7 +912,7 @@ static void draw_dates(lv_obj_t * calendar, const lv_area_t * clip_area) lv_draw_rect(&box_area, clip_area, &rect_dsc); /*Write the day's number*/ - lv_utils_num_to_str(day_cnt, buf); + _lv_utils_num_to_str(day_cnt, buf); lv_draw_label(&label_area, clip_area, &label_dsc, buf, NULL); /*Go to the next day*/ diff --git a/src/lv_widgets/lv_canvas.c b/src/lv_widgets/lv_canvas.c index 5cf5dad8ab..68cd7d2f59 100644 --- a/src/lv_widgets/lv_canvas.c +++ b/src/lv_widgets/lv_canvas.c @@ -253,7 +253,7 @@ void lv_canvas_copy_buf(lv_obj_t * canvas, const void * to_copy, lv_coord_t x, l uint8_t * to_copy8 = (uint8_t *)to_copy; lv_coord_t i; for(i = 0; i < h; i++) { - lv_memcpy((void *)&ext->dsc.data[px], to_copy8, w * px_size); + _lv_memcpy((void *)&ext->dsc.data[px], to_copy8, w * px_size); px += ext->dsc.header.w * px_size; to_copy8 += w * px_size; } @@ -303,12 +303,12 @@ void lv_canvas_transform(lv_obj_t * canvas, lv_img_dsc_t * img, int16_t angle, u dsc.cfg.pivot_y = pivot_y; dsc.cfg.color = color; dsc.cfg.antialias = antialias; - lv_img_buf_transform_init(&dsc); + _lv_img_buf_transform_init(&dsc); for(y = -offset_y; y < dest_height - offset_y; y++) { for(x = -offset_x; x < dest_width - offset_x; x++) { - ret = lv_img_buf_transform(&dsc, x, y); + ret = _lv_img_buf_transform(&dsc, x, y); if(ret == false) continue; @@ -408,7 +408,7 @@ void lv_canvas_blur_hor(lv_obj_t * canvas, const lv_area_t * area, uint16_t r) bool has_alpha = lv_img_cf_has_alpha(ext->dsc.header.cf); lv_coord_t line_w = lv_img_buf_get_img_size(ext->dsc.header.w, 1, ext->dsc.header.cf); - uint8_t * line_buf = lv_mem_buf_get(line_w); + uint8_t * line_buf = _lv_mem_buf_get(line_w); lv_img_dsc_t line_img; line_img.data = line_buf; @@ -429,7 +429,7 @@ void lv_canvas_blur_hor(lv_obj_t * canvas, const lv_area_t * area, uint16_t r) lv_color_t c; lv_opa_t opa = LV_OPA_TRANSP; - lv_memcpy(line_buf, &ext->dsc.data[y * line_w], line_w); + _lv_memcpy(line_buf, &ext->dsc.data[y * line_w], line_w); for(x = a.x1 - r_back; x <= a.x1 + r_front; x++) { @@ -501,7 +501,7 @@ void lv_canvas_blur_hor(lv_obj_t * canvas, const lv_area_t * area, uint16_t r) } lv_obj_invalidate(canvas); - lv_mem_buf_release(line_buf); + _lv_mem_buf_release(line_buf); } @@ -543,7 +543,7 @@ void lv_canvas_blur_ver(lv_obj_t * canvas, const lv_area_t * area, uint16_t r) bool has_alpha = lv_img_cf_has_alpha(ext->dsc.header.cf); lv_coord_t col_w = lv_img_buf_get_img_size(1, ext->dsc.header.h, ext->dsc.header.cf); - uint8_t * col_buf = lv_mem_buf_get(col_w); + uint8_t * col_buf = _lv_mem_buf_get(col_w); lv_img_dsc_t line_img; line_img.data = col_buf; @@ -641,7 +641,7 @@ void lv_canvas_blur_ver(lv_obj_t * canvas, const lv_area_t * area, uint16_t r) lv_obj_invalidate(canvas); - lv_mem_buf_release(col_buf); + _lv_mem_buf_release(col_buf); } /** @@ -658,11 +658,11 @@ void lv_canvas_fill_bg(lv_obj_t * canvas, lv_color_t color, lv_opa_t opa) if(dsc->header.cf == LV_IMG_CF_INDEXED_1BIT) { uint32_t row_byte_cnt = (dsc->header.w + 7) >> 3; /*+8 skip the palette*/ - lv_memset((uint8_t *)dsc->data + 8, color.full ? 0xff : 0x00, row_byte_cnt * dsc->header.h); + _lv_memset((uint8_t *)dsc->data + 8, color.full ? 0xff : 0x00, row_byte_cnt * dsc->header.h); } else if(dsc->header.cf == LV_IMG_CF_ALPHA_1BIT) { uint32_t row_byte_cnt = (dsc->header.w + 7) >> 3; - lv_memset((uint8_t *)dsc->data, opa > LV_OPA_50 ? 0xff : 0x00, row_byte_cnt * dsc->header.h); + _lv_memset((uint8_t *)dsc->data, opa > LV_OPA_50 ? 0xff : 0x00, row_byte_cnt * dsc->header.h); } else { uint32_t x; @@ -714,7 +714,7 @@ void lv_canvas_draw_rect(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord coords.y2 = y + h - 1; lv_disp_t disp; - lv_memset_00(&disp, sizeof(lv_disp_t)); + _lv_memset_00(&disp, sizeof(lv_disp_t)); lv_disp_buf_t disp_buf; lv_disp_buf_init(&disp_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h); @@ -738,12 +738,12 @@ void lv_canvas_draw_rect(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord } #endif - lv_disp_t * refr_ori = lv_refr_get_disp_refreshing(); - lv_refr_set_disp_refreshing(&disp); + lv_disp_t * refr_ori = _lv_refr_get_disp_refreshing(); + _lv_refr_set_disp_refreshing(&disp); lv_draw_rect(&coords, &mask, rect_dsc); - lv_refr_set_disp_refreshing(refr_ori); + _lv_refr_set_disp_refreshing(refr_ori); lv_obj_invalidate(canvas); } @@ -786,7 +786,7 @@ void lv_canvas_draw_text(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord coords.y2 = dsc->header.h - 1; lv_disp_t disp; - lv_memset_00(&disp, sizeof(lv_disp_t)); + _lv_memset_00(&disp, sizeof(lv_disp_t)); lv_disp_buf_t disp_buf; lv_disp_buf_init(&disp_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h); @@ -800,8 +800,8 @@ void lv_canvas_draw_text(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord set_set_px_cb(&disp.driver, dsc->header.cf); - lv_disp_t * refr_ori = lv_refr_get_disp_refreshing(); - lv_refr_set_disp_refreshing(&disp); + lv_disp_t * refr_ori = _lv_refr_get_disp_refreshing(); + _lv_refr_set_disp_refreshing(&disp); lv_txt_flag_t flag; switch(align) { @@ -823,7 +823,7 @@ void lv_canvas_draw_text(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord lv_draw_label(&coords, &mask, label_draw_dsc, txt, NULL); - lv_refr_set_disp_refreshing(refr_ori); + _lv_refr_set_disp_refreshing(refr_ori); lv_obj_invalidate(canvas); } @@ -868,7 +868,7 @@ void lv_canvas_draw_img(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, const voi coords.y2 = y + header.h - 1; lv_disp_t disp; - lv_memset_00(&disp, sizeof(lv_disp_t)); + _lv_memset_00(&disp, sizeof(lv_disp_t)); lv_disp_buf_t disp_buf; lv_disp_buf_init(&disp_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h); @@ -882,12 +882,12 @@ void lv_canvas_draw_img(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, const voi set_set_px_cb(&disp.driver, dsc->header.cf); - lv_disp_t * refr_ori = lv_refr_get_disp_refreshing(); - lv_refr_set_disp_refreshing(&disp); + lv_disp_t * refr_ori = _lv_refr_get_disp_refreshing(); + _lv_refr_set_disp_refreshing(&disp); lv_draw_img(&coords, &mask, src, img_draw_dsc); - lv_refr_set_disp_refreshing(refr_ori); + _lv_refr_set_disp_refreshing(refr_ori); lv_obj_invalidate(canvas); } @@ -919,7 +919,7 @@ void lv_canvas_draw_line(lv_obj_t * canvas, const lv_point_t points[], uint32_t mask.y2 = dsc->header.h - 1; lv_disp_t disp; - lv_memset_00(&disp, sizeof(lv_disp_t)); + _lv_memset_00(&disp, sizeof(lv_disp_t)); lv_disp_buf_t disp_buf; lv_disp_buf_init(&disp_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h); @@ -942,15 +942,15 @@ void lv_canvas_draw_line(lv_obj_t * canvas, const lv_point_t points[], uint32_t } #endif - lv_disp_t * refr_ori = lv_refr_get_disp_refreshing(); - lv_refr_set_disp_refreshing(&disp); + lv_disp_t * refr_ori = _lv_refr_get_disp_refreshing(); + _lv_refr_set_disp_refreshing(&disp); uint32_t i; for(i = 0; i < point_cnt - 1; i++) { lv_draw_line(&points[i], &points[i + 1], &mask, line_draw_dsc); } - lv_refr_set_disp_refreshing(refr_ori); + _lv_refr_set_disp_refreshing(refr_ori); lv_obj_invalidate(canvas); } @@ -983,7 +983,7 @@ void lv_canvas_draw_polygon(lv_obj_t * canvas, const lv_point_t points[], uint32 mask.y2 = dsc->header.h - 1; lv_disp_t disp; - lv_memset_00(&disp, sizeof(lv_disp_t)); + _lv_memset_00(&disp, sizeof(lv_disp_t)); lv_disp_buf_t disp_buf; lv_disp_buf_init(&disp_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h); @@ -1006,12 +1006,12 @@ void lv_canvas_draw_polygon(lv_obj_t * canvas, const lv_point_t points[], uint32 } #endif - lv_disp_t * refr_ori = lv_refr_get_disp_refreshing(); - lv_refr_set_disp_refreshing(&disp); + lv_disp_t * refr_ori = _lv_refr_get_disp_refreshing(); + _lv_refr_set_disp_refreshing(&disp); // lv_draw_polygon(points, point_cnt, &mask, poly_draw_dsc); - lv_refr_set_disp_refreshing(refr_ori); + _lv_refr_set_disp_refreshing(refr_ori); lv_obj_invalidate(canvas); } @@ -1047,7 +1047,7 @@ void lv_canvas_draw_arc(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord_ mask.y2 = dsc->header.h - 1; lv_disp_t disp; - lv_memset_00(&disp, sizeof(lv_disp_t)); + _lv_memset_00(&disp, sizeof(lv_disp_t)); lv_disp_buf_t disp_buf; lv_disp_buf_init(&disp_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h); @@ -1070,12 +1070,12 @@ void lv_canvas_draw_arc(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord_ } #endif - lv_disp_t * refr_ori = lv_refr_get_disp_refreshing(); - lv_refr_set_disp_refreshing(&disp); + lv_disp_t * refr_ori = _lv_refr_get_disp_refreshing(); + _lv_refr_set_disp_refreshing(&disp); lv_draw_arc(x, y, r, start_angle, end_angle, &mask, arc_draw_dsc); - lv_refr_set_disp_refreshing(refr_ori); + _lv_refr_set_disp_refreshing(refr_ori); lv_obj_invalidate(canvas); } diff --git a/src/lv_widgets/lv_chart.c b/src/lv_widgets/lv_chart.c index 773e6eca93..9c60e06974 100644 --- a/src/lv_widgets/lv_chart.c +++ b/src/lv_widgets/lv_chart.c @@ -99,7 +99,7 @@ lv_obj_t * lv_chart_create(lv_obj_t * par, const lv_obj_t * copy) return NULL; } - lv_ll_init(&ext->series_ll, sizeof(lv_chart_series_t)); + _lv_ll_init(&ext->series_ll, sizeof(lv_chart_series_t)); ext->ymin = LV_CHART_YMIN_DEF; ext->ymax = LV_CHART_YMAX_DEF; @@ -108,9 +108,9 @@ lv_obj_t * lv_chart_create(lv_obj_t * par, const lv_obj_t * copy) ext->point_cnt = LV_CHART_PNUM_DEF; ext->type = LV_CHART_TYPE_LINE; ext->update_mode = LV_CHART_UPDATE_MODE_SHIFT; - lv_memset_00(&ext->x_axis, sizeof(ext->x_axis)); - lv_memset_00(&ext->y_axis, sizeof(ext->y_axis)); - lv_memset_00(&ext->secondary_y_axis, sizeof(ext->secondary_y_axis)); + _lv_memset_00(&ext->x_axis, sizeof(ext->x_axis)); + _lv_memset_00(&ext->y_axis, sizeof(ext->y_axis)); + _lv_memset_00(&ext->secondary_y_axis, sizeof(ext->secondary_y_axis)); ext->x_axis.major_tick_len = LV_CHART_TICK_LENGTH_AUTO; ext->x_axis.minor_tick_len = LV_CHART_TICK_LENGTH_AUTO; ext->y_axis.major_tick_len = LV_CHART_TICK_LENGTH_AUTO; @@ -147,9 +147,9 @@ lv_obj_t * lv_chart_create(lv_obj_t * par, const lv_obj_t * copy) ext->hdiv_cnt = ext_copy->hdiv_cnt; ext->vdiv_cnt = ext_copy->vdiv_cnt; ext->point_cnt = ext_copy->point_cnt; - lv_memcpy(&ext->x_axis, &ext_copy->x_axis, sizeof(lv_chart_axis_cfg_t)); - lv_memcpy(&ext->y_axis, &ext_copy->y_axis, sizeof(lv_chart_axis_cfg_t)); - lv_memcpy(&ext->secondary_y_axis, &ext_copy->secondary_y_axis, sizeof(lv_chart_axis_cfg_t)); + _lv_memcpy(&ext->x_axis, &ext_copy->x_axis, sizeof(lv_chart_axis_cfg_t)); + _lv_memcpy(&ext->y_axis, &ext_copy->y_axis, sizeof(lv_chart_axis_cfg_t)); + _lv_memcpy(&ext->secondary_y_axis, &ext_copy->secondary_y_axis, sizeof(lv_chart_axis_cfg_t)); /*Refresh the style with new signal function*/ lv_obj_refresh_style(chart, LV_STYLE_PROP_ALL); @@ -175,7 +175,7 @@ lv_chart_series_t * lv_chart_add_series(lv_obj_t * chart, lv_color_t color) LV_ASSERT_OBJ(chart, LV_OBJX_NAME); lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart); - lv_chart_series_t * ser = lv_ll_ins_head(&ext->series_ll); + lv_chart_series_t * ser = _lv_ll_ins_head(&ext->series_ll); LV_ASSERT_MEM(ser); if(ser == NULL) return NULL; @@ -185,7 +185,7 @@ lv_chart_series_t * lv_chart_add_series(lv_obj_t * chart, lv_color_t color) ser->points = lv_mem_alloc(sizeof(lv_coord_t) * ext->point_cnt); LV_ASSERT_MEM(ser->points); if(ser->points == NULL) { - lv_ll_remove(&ext->series_ll, ser); + _lv_ll_remove(&ext->series_ll, ser); lv_mem_free(ser); return NULL; } @@ -302,7 +302,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) { + _LV_LL_READ_BACK(ext->series_ll, ser) { if(ser->start_point != 0) { lv_coord_t * new_points = lv_mem_alloc(sizeof(lv_coord_t) * point_cnt); LV_ASSERT_MEM(new_points); @@ -651,10 +651,10 @@ static lv_res_t lv_chart_signal(lv_obj_t * chart, lv_signal_t sign, void * param if(sign == LV_SIGNAL_CLEANUP) { lv_coord_t ** datal; - LV_LL_READ(ext->series_ll, datal) { + _LV_LL_READ(ext->series_ll, datal) { lv_mem_free(*datal); } - lv_ll_clear(&ext->series_ll); + _lv_ll_clear(&ext->series_ll); lv_obj_clean_style_list(chart, LV_CHART_PART_SERIES); lv_obj_clean_style_list(chart, LV_CHART_PART_SERIES_BG); @@ -773,7 +773,7 @@ static void draw_series_bg(lv_obj_t * chart, const lv_area_t * series_area, cons static void draw_series_line(lv_obj_t * chart, const lv_area_t * series_area, const lv_area_t * clip_area) { lv_area_t com_area; - if(lv_area_intersect(&com_area, series_area, clip_area) == false) return; + if(_lv_area_intersect(&com_area, series_area, clip_area) == false) return; lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart); @@ -787,7 +787,7 @@ static void draw_series_line(lv_obj_t * chart, const lv_area_t * series_area, co lv_chart_series_t * ser; lv_area_t series_mask; - bool mask_ret = lv_area_intersect(&series_mask, series_area, clip_area); + bool mask_ret = _lv_area_intersect(&series_mask, series_area, clip_area); if(mask_ret == false) return; lv_draw_line_dsc_t line_dsc; @@ -823,7 +823,7 @@ static void draw_series_line(lv_obj_t * chart, const lv_area_t * series_area, co if(point_radius > line_dsc.width / 2) line_dsc.raw_end = 1; /*Go through all data lines*/ - LV_LL_READ_BACK(ext->series_ll, ser) { + _LV_LL_READ_BACK(ext->series_ll, ser) { line_dsc.color = ser->color; point_dsc.bg_color = ser->color; area_dsc.bg_color = ser->color; @@ -926,7 +926,7 @@ static void draw_series_line(lv_obj_t * chart, const lv_area_t * series_area, co static void draw_series_column(lv_obj_t * chart, const lv_area_t * series_area, const lv_area_t * clip_area) { lv_area_t com_area; - if(lv_area_intersect(&com_area, series_area, clip_area) == false) return; + if(_lv_area_intersect(&com_area, series_area, clip_area) == false) return; lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart); @@ -936,7 +936,7 @@ static void draw_series_column(lv_obj_t * chart, const lv_area_t * series_area, lv_coord_t h = lv_area_get_height(series_area); int32_t y_tmp; lv_chart_series_t * ser; - lv_coord_t col_w = w / ((lv_ll_get_len(&ext->series_ll) + 1) * ext->point_cnt); /* Suppose + 1 series as separator*/ + lv_coord_t col_w = w / ((_lv_ll_get_len(&ext->series_ll) + 1) * ext->point_cnt); /* Suppose + 1 series as separator*/ lv_coord_t x_ofs = col_w / 2; /*Shift with a half col.*/ lv_style_int_t col_space = lv_obj_get_style_pad_inner(chart, LV_CHART_PART_SERIES); @@ -950,7 +950,7 @@ static void draw_series_column(lv_obj_t * chart, const lv_area_t * series_area, col_a.y2 = series_area->y2 + col_dsc.radius; lv_area_t series_mask; - bool mask_ret = lv_area_intersect(&series_mask, series_area, clip_area); + bool mask_ret = _lv_area_intersect(&series_mask, series_area, clip_area); if(mask_ret == false) return; /*Go through all points*/ @@ -959,7 +959,7 @@ static void draw_series_column(lv_obj_t * chart, const lv_area_t * series_area, x_act += series_area->x1 + x_ofs; /*Draw the current point of all data line*/ - LV_LL_READ_BACK(ext->series_ll, ser) { + _LV_LL_READ_BACK(ext->series_ll, ser) { lv_coord_t start_point = ext->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->start_point : 0; col_a.x1 = x_act; @@ -1215,7 +1215,7 @@ static void draw_y_ticks(lv_obj_t * chart, const lv_area_t * series_area, const /* reserve appropriate area */ lv_point_t size; - lv_txt_get_size(&size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, + _lv_txt_get_size(&size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, LV_TXT_FLAG_CENTER); /* set the area at some distance of the major tick len left of the tick */ @@ -1269,7 +1269,7 @@ static void draw_x_ticks(lv_obj_t * chart, const lv_area_t * series_area, const /* The columns don't start at the most right position * so change the width and offset accordingly. */ if(ext->type == LV_CHART_TYPE_COLUMN) { - uint32_t ser_num = lv_ll_get_len(&ext->series_ll); + uint32_t ser_num = _lv_ll_get_len(&ext->series_ll); lv_coord_t col_w = w / ((ser_num + 1) * ext->point_cnt); /* Suppose + 1 series as separator*/ x_ofs += col_w / 2 + (col_w * (ser_num) / 2); w -= col_w * ser_num + col_w; @@ -1327,7 +1327,7 @@ static void draw_x_ticks(lv_obj_t * chart, const lv_area_t * series_area, const /* reserve appropriate area */ lv_point_t size; - lv_txt_get_size(&size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, + _lv_txt_get_size(&size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, LV_TXT_FLAG_CENTER); /* set the area at some distance of the major tick len under of the tick */ @@ -1395,7 +1395,7 @@ static void invalidate_columns(lv_obj_t * chart, uint16_t i) lv_area_t col_a; lv_coord_t w = lv_area_get_width(&series_area); - lv_coord_t col_w = w / ((lv_ll_get_len(&ext->series_ll) + 1) * ext->point_cnt); /* Suppose + 1 series as separator*/ + lv_coord_t col_w = w / ((_lv_ll_get_len(&ext->series_ll) + 1) * ext->point_cnt); /* Suppose + 1 series as separator*/ lv_coord_t x_ofs = col_w / 2; /*Shift with a half col.*/ lv_coord_t x_act; @@ -1406,7 +1406,7 @@ static void invalidate_columns(lv_obj_t * chart, uint16_t i) col_a.x1 = x_act; col_a.x2 = col_a.x1 + col_w; - lv_inv_area(lv_obj_get_disp(chart), &col_a); + _lv_inv_area(lv_obj_get_disp(chart), &col_a); } static void get_series_area(lv_obj_t * chart, lv_area_t * series_area) diff --git a/src/lv_widgets/lv_cont.c b/src/lv_widgets/lv_cont.c index ca1ef68e5c..a774e722cc 100644 --- a/src/lv_widgets/lv_cont.c +++ b/src/lv_widgets/lv_cont.c @@ -376,7 +376,7 @@ static void lv_cont_layout_col(lv_obj_t * cont) lv_obj_add_protect(cont, LV_PROTECT_CHILD_CHG); /* Align the children */ lv_coord_t last_cord = top; - LV_LL_READ_BACK(cont->child_ll, child) { + _LV_LL_READ_BACK(cont->child_ll, child) { if(lv_obj_get_hidden(child) != false || lv_obj_is_protected(child, LV_PROTECT_POS) != false) continue; lv_style_int_t mtop = lv_obj_get_style_margin_top(child, LV_OBJ_PART_MAIN); lv_style_int_t mbottom = lv_obj_get_style_margin_bottom(child, LV_OBJ_PART_MAIN); @@ -432,7 +432,7 @@ static void lv_cont_layout_row(lv_obj_t * cont) lv_coord_t inner = lv_obj_get_style_pad_inner(cont, LV_CONT_PART_MAIN); - LV_LL_READ_BACK(cont->child_ll, child) { + _LV_LL_READ_BACK(cont->child_ll, child) { if(lv_obj_get_hidden(child) != false || lv_obj_is_protected(child, LV_PROTECT_POS) != false) continue; if(base_dir == LV_BIDI_DIR_RTL) lv_obj_align(child, cont, align, -last_cord, vpad_corr); @@ -455,7 +455,7 @@ static void lv_cont_layout_center(lv_obj_t * cont) lv_coord_t h_tot = 0; lv_coord_t inner = lv_obj_get_style_pad_inner(cont, LV_CONT_PART_MAIN); - LV_LL_READ(cont->child_ll, child) { + _LV_LL_READ(cont->child_ll, child) { if(lv_obj_get_hidden(child) != false || lv_obj_is_protected(child, LV_PROTECT_POS) != false) continue; h_tot += lv_obj_get_height(child) + inner; obj_num++; @@ -471,7 +471,7 @@ static void lv_cont_layout_center(lv_obj_t * cont) /* Align the children */ lv_coord_t last_cord = -(h_tot / 2); - LV_LL_READ_BACK(cont->child_ll, child) { + _LV_LL_READ_BACK(cont->child_ll, child) { if(lv_obj_get_hidden(child) != false || lv_obj_is_protected(child, LV_PROTECT_POS) != false) continue; lv_obj_align(child, cont, LV_ALIGN_CENTER, 0, last_cord + lv_obj_get_height(child) / 2); @@ -498,7 +498,7 @@ static void lv_cont_layout_pretty(lv_obj_t * cont) /* Disable child change action because the children will be moved a lot * an unnecessary child change signals could be sent*/ - child_rs = lv_ll_get_tail(&cont->child_ll); /*Set the row starter child*/ + child_rs = _lv_ll_get_tail(&cont->child_ll); /*Set the row starter child*/ if(child_rs == NULL) return; /*Return if no child*/ lv_obj_add_protect(cont, LV_PROTECT_CHILD_CHG); @@ -523,7 +523,7 @@ static void lv_cont_layout_pretty(lv_obj_t * cont) /*Step back one child because the last already not fit, so the previous is the * closer*/ if(child_rc != NULL && obj_num != 0) { - child_rc = lv_ll_get_next(&cont->child_ll, child_rc); + child_rc = _lv_ll_get_next(&cont->child_ll, child_rc); } break; } @@ -537,7 +537,7 @@ static void lv_cont_layout_pretty(lv_obj_t * cont) if(lv_obj_is_protected(child_rc, LV_PROTECT_FOLLOW)) break; /*If can not be followed by an other object then break here*/ } - child_rc = lv_ll_get_prev(&cont->child_ll, child_rc); /*Load the next object*/ + child_rc = _lv_ll_get_prev(&cont->child_ll, child_rc); /*Load the next object*/ if(obj_num == 0) child_rs = child_rc; /*If the first object was hidden (or too long) then set the next as first */ @@ -563,7 +563,7 @@ static void lv_cont_layout_pretty(lv_obj_t * cont) /*If there are two object in the row then align them proportionally*/ else if(obj_num == 2 && 0) { lv_obj_t * obj1 = child_rs; - lv_obj_t * obj2 = lv_ll_get_prev(&cont->child_ll, child_rs); + lv_obj_t * obj2 = _lv_ll_get_prev(&cont->child_ll, child_rs); w_row = lv_obj_get_width(obj1) + lv_obj_get_width(obj2); lv_coord_t pad = (w_obj - w_row) / 3; @@ -630,13 +630,13 @@ static void lv_cont_layout_pretty(lv_obj_t * cont) act_x += lv_obj_get_width(child_tmp) + new_pinner + mleft + mright; } if(child_tmp == child_rc) break; - child_tmp = lv_ll_get_prev(&cont->child_ll, child_tmp); + child_tmp = _lv_ll_get_prev(&cont->child_ll, child_tmp); } } if(child_rc == NULL) break; act_y += pinner + h_row; /*y increment*/ - child_rs = lv_ll_get_prev(&cont->child_ll, child_rc); /*Go to the next object*/ + child_rs = _lv_ll_get_prev(&cont->child_ll, child_rc); /*Go to the next object*/ child_rc = child_rs; } lv_obj_clear_protect(cont, LV_PROTECT_CHILD_CHG); @@ -661,7 +661,7 @@ static void lv_cont_layout_grid(lv_obj_t * cont) lv_coord_t act_x = left; lv_coord_t act_y = lv_obj_get_style_pad_top(cont, LV_CONT_PART_MAIN); lv_obj_t * child; - LV_LL_READ_BACK(cont->child_ll, child) { + _LV_LL_READ_BACK(cont->child_ll, child) { if(lv_obj_get_hidden(child) != false || lv_obj_is_protected(child, LV_PROTECT_POS) != false) continue; lv_coord_t obj_w = lv_obj_get_width(child); if(act_x + inner + obj_w > w_fit) { @@ -706,7 +706,7 @@ static void lv_cont_refr_autofit(lv_obj_t * cont) lv_obj_get_coords(cont, &ori); lv_obj_get_coords(cont, &tight_area); - bool has_children = lv_ll_is_empty(&cont->child_ll) ? false : true; + bool has_children = _lv_ll_is_empty(&cont->child_ll) ? false : true; if(has_children) { tight_area.x1 = LV_COORD_MAX; @@ -714,7 +714,7 @@ static void lv_cont_refr_autofit(lv_obj_t * cont) tight_area.x2 = LV_COORD_MIN; tight_area.y2 = LV_COORD_MIN; - LV_LL_READ(cont->child_ll, child_i) { + _LV_LL_READ(cont->child_ll, child_i) { if(lv_obj_get_hidden(child_i) != false) continue; if(ext->fit_left != LV_FIT_PARENT) { @@ -822,7 +822,7 @@ static void lv_cont_refr_autofit(lv_obj_t * cont) } /*Tell the children the parent's size has changed*/ - LV_LL_READ(cont->child_ll, child_i) { + _LV_LL_READ(cont->child_ll, child_i) { child_i->signal_cb(child_i, LV_SIGNAL_PARENT_SIZE_CHG, &ori); } } diff --git a/src/lv_widgets/lv_cpicker.c b/src/lv_widgets/lv_cpicker.c index 58f9b071b7..427832a282 100644 --- a/src/lv_widgets/lv_cpicker.c +++ b/src/lv_widgets/lv_cpicker.c @@ -491,10 +491,10 @@ static void draw_disc_grad(lv_obj_t * cpicker, const lv_area_t * mask) line_dsc.color = angle_to_mode_color(cpicker, i); lv_point_t p[2]; - p[0].x = cx + (r * lv_trigo_sin(i) >> LV_TRIGO_SHIFT); - p[0].y = cy + (r * lv_trigo_sin(i + 90) >> LV_TRIGO_SHIFT); - p[1].x = cx + ((r - cir_w_extra) * lv_trigo_sin(i) >> LV_TRIGO_SHIFT); - p[1].y = cy + ((r - cir_w_extra) * lv_trigo_sin(i + 90) >> LV_TRIGO_SHIFT); + p[0].x = cx + (r * _lv_trigo_sin(i) >> LV_TRIGO_SHIFT); + p[0].y = cy + (r * _lv_trigo_sin(i + 90) >> LV_TRIGO_SHIFT); + p[1].x = cx + ((r - cir_w_extra) * _lv_trigo_sin(i) >> LV_TRIGO_SHIFT); + p[1].y = cy + ((r - cir_w_extra) * _lv_trigo_sin(i + 90) >> LV_TRIGO_SHIFT); lv_draw_line(&p[0], &p[1], mask, &line_dsc); } @@ -825,7 +825,7 @@ static lv_res_t lv_cpicker_signal(lv_obj_t * cpicker, lv_signal_t sign, void * p /*Set the angle only if pressed on the ring*/ if(!on_ring) return res; - angle = lv_atan2(p.x, p.y) % 360; + angle = _lv_atan2(p.x, p.y) % 360; } lv_color_hsv_t hsv_cur; @@ -896,7 +896,7 @@ static bool lv_cpicker_hit(lv_obj_t * cpicker, const lv_point_t * p) /*Valid clicks can be only in the circle*/ - if(lv_area_is_point_on(&cpicker->coords, p, LV_RADIUS_CIRCLE)) return true; + if(_lv_area_is_point_on(&cpicker->coords, p, LV_RADIUS_CIRCLE)) return true; else return false; } @@ -937,8 +937,8 @@ static void refr_knob_pos(lv_obj_t * cpicker) lv_style_int_t scale_w = lv_obj_get_style_scale_width(cpicker, LV_CPICKER_PART_MAIN); lv_coord_t r = (w - scale_w) / 2; uint16_t angle = get_angle(cpicker); - ext->knob.pos.x = (((int32_t)r * lv_trigo_sin(angle)) >> LV_TRIGO_SHIFT); - ext->knob.pos.y = (((int32_t)r * lv_trigo_sin(angle + 90)) >> LV_TRIGO_SHIFT); + ext->knob.pos.x = (((int32_t)r * _lv_trigo_sin(angle)) >> LV_TRIGO_SHIFT); + ext->knob.pos.y = (((int32_t)r * _lv_trigo_sin(angle + 90)) >> LV_TRIGO_SHIFT); ext->knob.pos.x = ext->knob.pos.x + w / 2; ext->knob.pos.y = ext->knob.pos.y + h / 2; } diff --git a/src/lv_widgets/lv_dropdown.c b/src/lv_widgets/lv_dropdown.c index 4c0f2be54b..f9a63cd4b3 100644 --- a/src/lv_widgets/lv_dropdown.c +++ b/src/lv_widgets/lv_dropdown.c @@ -315,17 +315,17 @@ void lv_dropdown_add_option(lv_obj_t * ddlist, const char * option, uint16_t pos /*Add delimiter to existing options*/ if((insert_pos > 0) && (pos >= ext->option_cnt)) - lv_txt_ins(ext->options, lv_txt_encoded_get_char_id(ext->options, insert_pos++), "\n"); + _lv_txt_ins(ext->options, _lv_txt_encoded_get_char_id(ext->options, insert_pos++), "\n"); /*Insert the new option, adding \n if necessary*/ - char * ins_buf = lv_mem_buf_get(ins_len + 2); /* + 2 for terminating NULL and possible \n */ + char * ins_buf = _lv_mem_buf_get(ins_len + 2); /* + 2 for terminating NULL and possible \n */ LV_ASSERT_MEM(ins_buf); if(ins_buf == NULL) return; strcpy(ins_buf, option); if(pos < ext->option_cnt) strcat(ins_buf, "\n"); - lv_txt_ins(ext->options, lv_txt_encoded_get_char_id(ext->options, insert_pos), ins_buf); - lv_mem_buf_release(ins_buf); + _lv_txt_ins(ext->options, _lv_txt_encoded_get_char_id(ext->options, insert_pos), ins_buf); + _lv_mem_buf_release(ins_buf); ext->option_cnt++; @@ -729,7 +729,7 @@ static lv_design_res_t lv_dropdown_design(lv_obj_t * ddlist, const lv_area_t * c const char * opt_txt = ext->text; if(ext->show_selected) { - char * buf = lv_mem_buf_get(128); + char * buf = _lv_mem_buf_get(128); lv_dropdown_get_selected_str(ddlist, buf, 128); opt_txt = buf; } @@ -738,7 +738,7 @@ static lv_design_res_t lv_dropdown_design(lv_obj_t * ddlist, const lv_area_t * c txt = ext->dir != LV_DROPDOWN_DIR_LEFT ? opt_txt : ext->symbol; if(txt) { - lv_txt_get_size(&txt_size, txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, + _lv_txt_get_size(&txt_size, txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, label_dsc.flag); txt_area.y1 = ddlist->coords.y1 + top; @@ -758,7 +758,7 @@ static lv_design_res_t lv_dropdown_design(lv_obj_t * ddlist, const lv_area_t * c txt = ext->dir != LV_DROPDOWN_DIR_LEFT ? ext->symbol : opt_txt; if(txt) { - lv_txt_get_size(&txt_size, txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, + _lv_txt_get_size(&txt_size, txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, label_dsc.flag); txt_area.y1 = ddlist->coords.y1 + top; txt_area.y2 = txt_area.y1 + txt_size.y; @@ -777,7 +777,7 @@ static lv_design_res_t lv_dropdown_design(lv_obj_t * ddlist, const lv_area_t * c } if(ext->show_selected) { - lv_mem_buf_release((char *)opt_txt); + _lv_mem_buf_release((char *)opt_txt); } } @@ -818,7 +818,7 @@ static lv_design_res_t lv_dropdown_page_design(lv_obj_t * page, const lv_area_t * the selected option can be drawn on only the background*/ lv_area_t clip_area_core; bool has_common; - has_common = lv_area_intersect(&clip_area_core, clip_area, &ext->page->coords); + has_common = _lv_area_intersect(&clip_area_core, clip_area, &ext->page->coords); if(has_common) { if(ext->pr_opt_id != LV_DROPDOWN_PR_NONE) { draw_box(ddlist, &clip_area_core, ext->pr_opt_id, LV_STATE_PRESSED); @@ -846,7 +846,7 @@ static lv_design_res_t lv_dropdown_page_design(lv_obj_t * page, const lv_area_t * the selected option can be drawn on only the background*/ lv_area_t clip_area_core; bool has_common; - has_common = lv_area_intersect(&clip_area_core, clip_area, &ext->page->coords); + has_common = _lv_area_intersect(&clip_area_core, clip_area, &ext->page->coords); if(has_common) { if(ext->pr_opt_id != LV_DROPDOWN_PR_NONE) { draw_box_label(ddlist, &clip_area_core, ext->pr_opt_id, LV_STATE_PRESSED); @@ -903,9 +903,9 @@ static lv_res_t lv_dropdown_signal(lv_obj_t * ddlist, lv_signal_t sign, void * p /*`lv_obj_clean_style_list` is not required because these styles are only copied to the page * so they can have transitions or other object related things. */ - lv_style_list_reset(&ext->style_page); - lv_style_list_reset(&ext->style_scrlbar); - lv_style_list_reset(&ext->style_selected); + _lv_style_list_reset(&ext->style_page); + _lv_style_list_reset(&ext->style_scrlbar); + _lv_style_list_reset(&ext->style_selected); } else if(sign == LV_SIGNAL_FOCUS) { @@ -1191,7 +1191,7 @@ static void draw_box_label(lv_obj_t * ddlist, const lv_area_t * clip_area, uint1 area_sel.x2 = page->coords.x2; lv_area_t mask_sel; bool area_ok; - area_ok = lv_area_intersect(&mask_sel, clip_area, &area_sel); + area_ok = _lv_area_intersect(&mask_sel, clip_area, &area_sel); if(area_ok) { lv_draw_label(&label->coords, &mask_sel, &label_dsc, lv_label_get_text(label), NULL); } @@ -1276,7 +1276,7 @@ static uint16_t get_id_on_point(lv_obj_t * ddlist, lv_coord_t x, lv_coord_t y) uint32_t letter_cnt = 0; for(letter_cnt = 0; letter_cnt < letter_i; letter_cnt++) { - uint32_t letter = lv_txt_encoded_next(txt, &i); + uint32_t letter = _lv_txt_encoded_next(txt, &i); /*Count the lines to reach the clicked letter. But ignore the last '\n' because it * still belongs to the clicked line*/ if(letter == '\n' && i_prev != letter_i) opt++; diff --git a/src/lv_widgets/lv_gauge.c b/src/lv_widgets/lv_gauge.c index 2cb2b62fca..23faddd5e4 100644 --- a/src/lv_widgets/lv_gauge.c +++ b/src/lv_widgets/lv_gauge.c @@ -226,8 +226,8 @@ void lv_gauge_set_value(lv_obj_t * gauge, uint8_t needle_id, int32_t value) /*Calculate the end point of a needle*/ int16_t needle_angle = (old_value - min) * angle / (max - min) + angle_ofs; - p_end.y = (lv_trigo_sin(needle_angle) * r) / LV_TRIGO_SIN_MAX + y_ofs; - p_end.x = (lv_trigo_sin(needle_angle + 90) * r) / LV_TRIGO_SIN_MAX + x_ofs; + p_end.y = (_lv_trigo_sin(needle_angle) * r) / LV_TRIGO_SIN_MAX + y_ofs; + p_end.x = (_lv_trigo_sin(needle_angle + 90) * r) / LV_TRIGO_SIN_MAX + x_ofs; lv_area_t a; a.x1 = LV_MATH_MIN(p_mid.x, p_end.x) - needle_w; @@ -237,8 +237,8 @@ void lv_gauge_set_value(lv_obj_t * gauge, uint8_t needle_id, int32_t value) lv_obj_invalidate_area(gauge, &a); needle_angle = (value - min) * angle / (max - min) + angle_ofs; - p_end.y = (lv_trigo_sin(needle_angle) * r) / LV_TRIGO_SIN_MAX + y_ofs; - p_end.x = (lv_trigo_sin(needle_angle + 90) * r) / LV_TRIGO_SIN_MAX + x_ofs; + p_end.y = (_lv_trigo_sin(needle_angle) * r) / LV_TRIGO_SIN_MAX + y_ofs; + p_end.x = (_lv_trigo_sin(needle_angle + 90) * r) / LV_TRIGO_SIN_MAX + x_ofs; a.x1 = LV_MATH_MIN(p_mid.x, p_end.x); a.y1 = LV_MATH_MIN(p_mid.y, p_end.y); @@ -532,23 +532,23 @@ static void lv_gauge_draw_labels(lv_obj_t * gauge, const lv_area_t * mask) /*Calculate the position a scale label*/ int16_t angle = (i * scale_angle) / (label_num - 1) + angle_ofs; - lv_coord_t y = (int32_t)((int32_t)lv_trigo_sin(angle) * r) / LV_TRIGO_SIN_MAX; + lv_coord_t y = (int32_t)((int32_t)_lv_trigo_sin(angle) * r) / LV_TRIGO_SIN_MAX; y += y_ofs; - lv_coord_t x = (int32_t)((int32_t)lv_trigo_sin(angle + 90) * r) / LV_TRIGO_SIN_MAX; + lv_coord_t x = (int32_t)((int32_t)_lv_trigo_sin(angle + 90) * r) / LV_TRIGO_SIN_MAX; x += x_ofs; int32_t scale_act = (int32_t)((int32_t)(max - min) * i) / (label_num - 1); scale_act += min; char scale_txt[16]; if(ext->format_cb == NULL) - lv_utils_num_to_str(scale_act, scale_txt); + _lv_utils_num_to_str(scale_act, scale_txt); else ext->format_cb(gauge, scale_txt, sizeof(scale_txt), scale_act); lv_area_t label_cord; lv_point_t label_size; - lv_txt_get_size(&label_size, scale_txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, + _lv_txt_get_size(&label_size, scale_txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, LV_TXT_FLAG_NONE); /*Draw the label*/ @@ -607,8 +607,8 @@ static void lv_gauge_draw_needle(lv_obj_t * gauge, const lv_area_t * clip_area) /*Draw line*/ if(ext->needle_img == NULL) { - p_end.y = (lv_trigo_sin(needle_angle) * r) / LV_TRIGO_SIN_MAX + y_ofs; - p_end.x = (lv_trigo_sin(needle_angle + 90) * r) / LV_TRIGO_SIN_MAX + x_ofs; + p_end.y = (_lv_trigo_sin(needle_angle) * r) / LV_TRIGO_SIN_MAX + y_ofs; + p_end.x = (_lv_trigo_sin(needle_angle + 90) * r) / LV_TRIGO_SIN_MAX + x_ofs; /*Draw the needle with the corresponding color*/ if(ext->needle_colors != NULL) line_dsc.color = ext->needle_colors[i]; diff --git a/src/lv_widgets/lv_img.c b/src/lv_widgets/lv_img.c index bc14a26099..24a1bbfdfb 100644 --- a/src/lv_widgets/lv_img.c +++ b/src/lv_widgets/lv_img.c @@ -211,7 +211,7 @@ void lv_img_set_src(lv_obj_t * img, const void * src_img) lv_style_int_t letter_space = lv_obj_get_style_text_letter_space(img, LV_IMG_PART_MAIN); lv_style_int_t line_space = lv_obj_get_style_text_line_space(img, LV_IMG_PART_MAIN); lv_point_t size; - lv_txt_get_size(&size, src_img, font, letter_space, line_space, + _lv_txt_get_size(&size, src_img, font, letter_space, line_space, LV_COORD_MAX, LV_TXT_FLAG_NONE); header.w = size.x; header.h = size.y; @@ -304,7 +304,7 @@ void lv_img_set_pivot(lv_obj_t * img, lv_coord_t pivot_x, lv_coord_t pivot_y) transf_angle += ext->angle; lv_area_t a; - lv_img_buf_get_transformed_area(&a, ext->w, ext->h, transf_angle, transf_zoom, &ext->pivot); + _lv_img_buf_get_transformed_area(&a, ext->w, ext->h, transf_angle, transf_zoom, &ext->pivot); a.x1 += img->coords.x1; a.y1 += img->coords.y1; a.x2 += img->coords.x1; @@ -315,7 +315,7 @@ void lv_img_set_pivot(lv_obj_t * img, lv_coord_t pivot_x, lv_coord_t pivot_y) ext->pivot.y = pivot_y; lv_obj_refresh_ext_draw_pad(img); - lv_img_buf_get_transformed_area(&a, ext->w, ext->h, transf_angle, transf_zoom, &ext->pivot); + _lv_img_buf_get_transformed_area(&a, ext->w, ext->h, transf_angle, transf_zoom, &ext->pivot); a.x1 += img->coords.x1; a.y1 += img->coords.y1; a.x2 += img->coords.x1; @@ -343,7 +343,7 @@ void lv_img_set_angle(lv_obj_t * img, int16_t angle) transf_angle += ext->angle; lv_area_t a; - lv_img_buf_get_transformed_area(&a, ext->w, ext->h, transf_angle, transf_zoom, &ext->pivot); + _lv_img_buf_get_transformed_area(&a, ext->w, ext->h, transf_angle, transf_zoom, &ext->pivot); a.x1 += img->coords.x1; a.y1 += img->coords.y1; a.x2 += img->coords.x1; @@ -353,7 +353,7 @@ void lv_img_set_angle(lv_obj_t * img, int16_t angle) ext->angle = angle; lv_obj_refresh_ext_draw_pad(img); - lv_img_buf_get_transformed_area(&a, ext->w, ext->h, transf_angle, transf_zoom, &ext->pivot); + _lv_img_buf_get_transformed_area(&a, ext->w, ext->h, transf_angle, transf_zoom, &ext->pivot); a.x1 += img->coords.x1; a.y1 += img->coords.y1; a.x2 += img->coords.x1; @@ -385,7 +385,7 @@ void lv_img_set_zoom(lv_obj_t * img, uint16_t zoom) transf_angle += ext->angle; lv_area_t a; - lv_img_buf_get_transformed_area(&a, ext->w, ext->h, transf_angle, transf_zoom, &ext->pivot); + _lv_img_buf_get_transformed_area(&a, ext->w, ext->h, transf_angle, transf_zoom, &ext->pivot); a.x1 += img->coords.x1; a.y1 += img->coords.y1; a.x2 += img->coords.x1; @@ -395,7 +395,7 @@ void lv_img_set_zoom(lv_obj_t * img, uint16_t zoom) ext->zoom = zoom; lv_obj_refresh_ext_draw_pad(img); - lv_img_buf_get_transformed_area(&a, ext->w, ext->h, transf_angle, transf_zoom, &ext->pivot); + _lv_img_buf_get_transformed_area(&a, ext->w, ext->h, transf_angle, transf_zoom, &ext->pivot); a.x1 += img->coords.x1; a.y1 += img->coords.y1; a.x2 += img->coords.x1; @@ -575,7 +575,7 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area ext->angle != 0) return LV_DESIGN_RES_NOT_COVER; if((ext->cf == LV_IMG_CF_TRUE_COLOR || ext->cf == LV_IMG_CF_RAW) && ext->angle == 0 && ext->zoom == LV_IMG_ZOOM_NONE) { - cover = lv_area_is_in(clip_area, &img->coords, 0) ? LV_DESIGN_RES_COVER : LV_DESIGN_RES_NOT_COVER; + cover = _lv_area_is_in(clip_area, &img->coords, 0) ? LV_DESIGN_RES_COVER : LV_DESIGN_RES_NOT_COVER; } if(lv_obj_get_style_image_opa(img, LV_IMG_PART_MAIN) < LV_OPA_MAX) return LV_DESIGN_RES_NOT_COVER; @@ -607,7 +607,7 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area angle_final += ext->angle; 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.y1 += img_coords.y1; bg_coords.x2 += img_coords.x1; @@ -620,7 +620,7 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area lv_draw_rect(&bg_coords, clip_area, &bg_dsc); if(lv_obj_get_style_clip_corner(img, LV_OBJ_PART_MAIN)) { - lv_draw_mask_radius_param_t * mp = lv_mem_buf_get(sizeof(lv_draw_mask_radius_param_t)); + lv_draw_mask_radius_param_t * mp = _lv_mem_buf_get(sizeof(lv_draw_mask_radius_param_t)); lv_coord_t r = lv_obj_get_style_radius(img, LV_OBJ_PART_MAIN); @@ -682,7 +682,7 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area else if(mode == LV_DESIGN_DRAW_POST) { if(lv_obj_get_style_clip_corner(img, LV_OBJ_PART_MAIN)) { lv_draw_mask_radius_param_t * param = lv_draw_mask_remove_custom(img + 8); - lv_mem_buf_release(param); + _lv_mem_buf_release(param); } lv_draw_rect_dsc_t draw_dsc; @@ -750,7 +750,7 @@ static lv_res_t lv_img_signal(lv_obj_t * img, lv_signal_t sign, void * param) /*If the image has angle provide enough room for the rotated corners */ if(transf_angle || transf_zoom != LV_IMG_ZOOM_NONE) { lv_area_t a; - lv_img_buf_get_transformed_area(&a, ext->w, ext->h, transf_angle, transf_zoom, &ext->pivot); + _lv_img_buf_get_transformed_area(&a, ext->w, ext->h, transf_angle, transf_zoom, &ext->pivot); lv_coord_t pad_ori = img->ext_draw_pad; img->ext_draw_pad = LV_MATH_MAX(img->ext_draw_pad, pad_ori - a.x1); img->ext_draw_pad = LV_MATH_MAX(img->ext_draw_pad, pad_ori - a.y1); @@ -788,7 +788,7 @@ static lv_res_t lv_img_signal(lv_obj_t * img, lv_signal_t sign, void * param) coords.x2 -= width_offset; coords.y1 += height_offset; coords.y2 -= height_offset; - info->result = lv_area_is_point_on(&coords, info->point, 0); + info->result = _lv_area_is_point_on(&coords, info->point, 0); } else info->result = lv_obj_is_point_on_coords(img, info->point); diff --git a/src/lv_widgets/lv_imgbtn.c b/src/lv_widgets/lv_imgbtn.c index f86fd72b94..bd5cbf552e 100644 --- a/src/lv_widgets/lv_imgbtn.c +++ b/src/lv_widgets/lv_imgbtn.c @@ -73,10 +73,10 @@ lv_obj_t * lv_imgbtn_create(lv_obj_t * par, const lv_obj_t * copy) if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(imgbtn); /*Initialize the allocated 'ext' */ - lv_memset_00((void *)ext->img_src_mid, sizeof(ext->img_src_mid)); + _lv_memset_00((void *)ext->img_src_mid, sizeof(ext->img_src_mid)); #if LV_IMGBTN_TILED - lv_memset_00(ext->img_src_left, sizeof(ext->img_src_left)); - lv_memset_00(ext->img_src_right, sizeof(ext->img_src_right)); + _lv_memset_00(ext->img_src_left, sizeof(ext->img_src_left)); + _lv_memset_00(ext->img_src_right, sizeof(ext->img_src_right)); #endif ext->tiled = 0; @@ -93,10 +93,10 @@ lv_obj_t * lv_imgbtn_create(lv_obj_t * par, const lv_obj_t * copy) /*Copy an existing image button*/ else { lv_imgbtn_ext_t * copy_ext = lv_obj_get_ext_attr(copy); - lv_memcpy((void *)ext->img_src_mid, copy_ext->img_src_mid, sizeof(ext->img_src_mid)); + _lv_memcpy((void *)ext->img_src_mid, copy_ext->img_src_mid, sizeof(ext->img_src_mid)); #if LV_IMGBTN_TILED - lv_memcpy((void *)ext->img_src_left, copy_ext->img_src_left, sizeof(ext->img_src_left)); - lv_memcpy((void *)ext->img_src_right, copy_ext->img_src_right, sizeof(ext->img_src_right)); + _lv_memcpy((void *)ext->img_src_left, copy_ext->img_src_left, sizeof(ext->img_src_left)); + _lv_memcpy((void *)ext->img_src_right, copy_ext->img_src_right, sizeof(ext->img_src_right)); #endif ext->tiled = copy_ext->tiled; /*Refresh the style with new signal function*/ @@ -266,7 +266,7 @@ static lv_design_res_t lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * cli lv_imgbtn_ext_t * ext = lv_obj_get_ext_attr(imgbtn); lv_design_res_t cover = LV_DESIGN_RES_NOT_COVER; if(ext->act_cf == LV_IMG_CF_TRUE_COLOR || ext->act_cf == LV_IMG_CF_RAW) { - cover = lv_area_is_in(clip_area, &imgbtn->coords, 0) ? LV_DESIGN_RES_COVER : LV_DESIGN_RES_NOT_COVER; + cover = _lv_area_is_in(clip_area, &imgbtn->coords, 0) ? LV_DESIGN_RES_COVER : LV_DESIGN_RES_NOT_COVER; } return cover; @@ -420,7 +420,7 @@ static void refr_img(lv_obj_t * imgbtn) if(lv_img_src_get_type(src) == LV_IMG_SRC_SYMBOL) { const lv_font_t * font = lv_obj_get_style_text_font(imgbtn, LV_IMGBTN_PART_MAIN); header.h = lv_font_get_line_height(font); - header.w = lv_txt_get_width(src, (uint16_t)strlen(src), font, 0, LV_TXT_FLAG_NONE); + header.w = _lv_txt_get_width(src, (uint16_t)strlen(src), font, 0, LV_TXT_FLAG_NONE); header.always_zero = 0; header.cf = LV_IMG_CF_ALPHA_1BIT; } diff --git a/src/lv_widgets/lv_label.c b/src/lv_widgets/lv_label.c index 9a3f10a403..28f2e0d748 100644 --- a/src/lv_widgets/lv_label.c +++ b/src/lv_widgets/lv_label.c @@ -145,10 +145,10 @@ lv_obj_t * lv_label_create(lv_obj_t * par, const lv_obj_t * copy) /*In DOT mode save the text byte-to-byte because a '\0' can be in the middle*/ if(copy_ext->long_mode == LV_LABEL_LONG_DOT) { - ext->text = lv_mem_realloc(ext->text, lv_mem_get_size(copy_ext->text)); + ext->text = lv_mem_realloc(ext->text, _lv_mem_get_size(copy_ext->text)); LV_ASSERT_MEM(ext->text); if(ext->text == NULL) return NULL; - lv_memcpy(ext->text, copy_ext->text, lv_mem_get_size(copy_ext->text)); + _lv_memcpy(ext->text, copy_ext->text, _lv_mem_get_size(copy_ext->text)); } if(copy_ext->dot_tmp_alloc && copy_ext->dot.tmp_ptr) { @@ -156,7 +156,7 @@ lv_obj_t * lv_label_create(lv_obj_t * par, const lv_obj_t * copy) lv_label_set_dot_tmp(new_label, ext->dot.tmp_ptr, len); } else { - lv_memcpy(ext->dot.tmp, copy_ext->dot.tmp, sizeof(ext->dot.tmp)); + _lv_memcpy(ext->dot.tmp, copy_ext->dot.tmp, sizeof(ext->dot.tmp)); } ext->dot_tmp_alloc = copy_ext->dot_tmp_alloc; ext->dot_end = copy_ext->dot_end; @@ -199,13 +199,13 @@ void lv_label_set_text(lv_obj_t * label, const char * text) /*If set its own text then reallocate it (maybe its size changed)*/ #if LV_USE_ARABIC_PERSIAN_CHARS /*Get the size of the text and process it*/ - size_t len = lv_txt_ap_calc_bytes_cnt(text); + size_t len = _lv_txt_ap_calc_bytes_cnt(text); ext->text = lv_mem_realloc(ext->text, len); LV_ASSERT_MEM(ext->text); if(ext->text == NULL) return; - lv_txt_ap_proc(ext->text, ext->text); + _lv_txt_ap_proc(ext->text, ext->text); #else ext->text = lv_mem_realloc(ext->text, strlen(ext->text) + 1); #endif @@ -222,13 +222,13 @@ void lv_label_set_text(lv_obj_t * label, const char * text) #if LV_USE_ARABIC_PERSIAN_CHARS /*Get the size of the text and process it*/ - size_t len = lv_txt_ap_calc_bytes_cnt(text); + size_t len = _lv_txt_ap_calc_bytes_cnt(text); ext->text = lv_mem_alloc(len); LV_ASSERT_MEM(ext->text); if(ext->text == NULL) return; - lv_txt_ap_proc(text, ext->text); + _lv_txt_ap_proc(text, ext->text); #else /*Get the size of the text*/ size_t len = strlen(text) + 1; @@ -283,7 +283,7 @@ void lv_label_set_text_fmt(lv_obj_t * label, const char * fmt, ...) #if LV_USE_ARABIC_PERSIAN_CHARS /*Put together the text according to the format string*/ - char * raw_txt = lv_mem_buf_get(len + 1); + char * raw_txt = _lv_mem_buf_get(len + 1); LV_ASSERT_MEM(raw_txt); if(raw_txt == NULL) { va_end(ap2); @@ -293,16 +293,16 @@ void lv_label_set_text_fmt(lv_obj_t * label, const char * fmt, ...) lv_vsnprintf(raw_txt, len + 1, fmt, ap2); /*Get the size of the Arabic text and process it*/ - size_t len_ap = lv_txt_ap_calc_bytes_cnt(raw_txt); + size_t len_ap = _lv_txt_ap_calc_bytes_cnt(raw_txt); ext->text = lv_mem_alloc(len_ap + 1); LV_ASSERT_MEM(ext->text); if(ext->text == NULL) { va_end(ap2); return; } - lv_txt_ap_proc(raw_txt, ext->text); + _lv_txt_ap_proc(raw_txt, ext->text); - lv_mem_buf_release(raw_txt); + _lv_mem_buf_release(raw_txt); #else ext->text = lv_mem_alloc(len + 1); LV_ASSERT_MEM(ext->text); @@ -517,7 +517,7 @@ lv_label_align_t lv_label_get_align(const lv_obj_t * label) if(align == LV_LABEL_ALIGN_AUTO) { #if LV_USE_BIDI lv_bidi_dir_t base_dir = lv_obj_get_base_dir(label); - if(base_dir == LV_BIDI_DIR_AUTO) base_dir = lv_bidi_detect_base_dir(ext->text); + if(base_dir == LV_BIDI_DIR_AUTO) base_dir = _lv_bidi_detect_base_dir(ext->text); if(base_dir == LV_BIDI_DIR_LTR) align = LV_LABEL_ALIGN_LEFT; else if(base_dir == LV_BIDI_DIR_RTL) align = LV_LABEL_ALIGN_RIGHT; @@ -595,11 +595,11 @@ void lv_label_get_letter_pos(const lv_obj_t * label, uint16_t char_id, lv_point_ if(align == LV_LABEL_ALIGN_CENTER) flag |= LV_TXT_FLAG_CENTER; if(align == LV_LABEL_ALIGN_RIGHT) flag |= LV_TXT_FLAG_RIGHT; - uint16_t byte_id = lv_txt_encoded_get_byte_id(txt, char_id); + uint16_t byte_id = _lv_txt_encoded_get_byte_id(txt, char_id); /*Search the line of the index letter */; while(txt[new_line_start] != '\0') { - new_line_start += lv_txt_get_next_line(&txt[line_start], font, letter_space, max_w, flag); + new_line_start += _lv_txt_get_next_line(&txt[line_start], font, letter_space, max_w, flag); if(byte_id < new_line_start || txt[new_line_start] == '\0') break; /*The line of 'index' letter begins at 'line_start'*/ @@ -625,15 +625,15 @@ void lv_label_get_letter_pos(const lv_obj_t * label, uint16_t char_id, lv_point_ bidi_txt = &txt[line_start]; } else { - uint16_t line_char_id = lv_txt_encoded_get_char_id(&txt[line_start], byte_id - line_start); + uint16_t line_char_id = _lv_txt_encoded_get_char_id(&txt[line_start], byte_id - line_start); bool is_rtl; - uint16_t visual_char_pos = lv_bidi_get_visual_pos(&txt[line_start], &mutable_bidi_txt, new_line_start - line_start, + uint16_t visual_char_pos = _lv_bidi_get_visual_pos(&txt[line_start], &mutable_bidi_txt, new_line_start - line_start, lv_obj_get_base_dir(label), line_char_id, &is_rtl); bidi_txt = mutable_bidi_txt; if(is_rtl) visual_char_pos++; - visual_byte_pos = lv_txt_encoded_get_byte_id(bidi_txt, visual_char_pos); + visual_byte_pos = _lv_txt_encoded_get_byte_id(bidi_txt, visual_char_pos); } #else bidi_txt = &txt[line_start]; @@ -642,18 +642,18 @@ void lv_label_get_letter_pos(const lv_obj_t * label, uint16_t char_id, lv_point_ /*Calculate the x coordinate*/ - lv_coord_t x = lv_txt_get_width(bidi_txt, visual_byte_pos, font, letter_space, flag); + lv_coord_t x = _lv_txt_get_width(bidi_txt, visual_byte_pos, font, letter_space, flag); if(char_id != line_start) x += letter_space; if(align == LV_LABEL_ALIGN_CENTER) { lv_coord_t line_w; - line_w = lv_txt_get_width(bidi_txt, new_line_start - line_start, font, letter_space, flag); + line_w = _lv_txt_get_width(bidi_txt, new_line_start - line_start, font, letter_space, flag); x += lv_area_get_width(&txt_coords) / 2 - line_w / 2; } else if(align == LV_LABEL_ALIGN_RIGHT) { lv_coord_t line_w; - line_w = lv_txt_get_width(bidi_txt, new_line_start - line_start, font, letter_space, flag); + line_w = _lv_txt_get_width(bidi_txt, new_line_start - line_start, font, letter_space, flag); x += lv_area_get_width(&txt_coords) - line_w; } @@ -661,7 +661,7 @@ void lv_label_get_letter_pos(const lv_obj_t * label, uint16_t char_id, lv_point_ pos->y = y; #if LV_USE_BIDI - if(mutable_bidi_txt) lv_mem_buf_release(mutable_bidi_txt); + if(mutable_bidi_txt) _lv_mem_buf_release(mutable_bidi_txt); #endif } @@ -703,14 +703,14 @@ uint16_t lv_label_get_letter_on(const lv_obj_t * label, lv_point_t * pos) /*Search the line of the index letter */; while(txt[line_start] != '\0') { - new_line_start += lv_txt_get_next_line(&txt[line_start], font, letter_space, max_w, flag); + new_line_start += _lv_txt_get_next_line(&txt[line_start], font, letter_space, max_w, flag); if(pos->y <= y + letter_height) { /*The line is found (stored in 'line_start')*/ /* Include the NULL terminator in the last line */ uint32_t tmp = new_line_start; uint32_t letter; - letter = lv_txt_encoded_prev(txt, &tmp); + letter = _lv_txt_encoded_prev(txt, &tmp); if(letter != '\n' && txt[new_line_start] == '\0') new_line_start++; break; } @@ -720,10 +720,10 @@ uint16_t lv_label_get_letter_on(const lv_obj_t * label, lv_point_t * pos) } #if LV_USE_BIDI - bidi_txt = lv_mem_buf_get(new_line_start - line_start + 1); + bidi_txt = _lv_mem_buf_get(new_line_start - line_start + 1); uint16_t txt_len = new_line_start - line_start; if(new_line_start > 0 && txt[new_line_start - 1] == '\0' && txt_len > 0) txt_len--; - lv_bidi_process_paragraph(txt + line_start, bidi_txt, txt_len, lv_obj_get_base_dir(label), NULL, 0); + _lv_bidi_process_paragraph(txt + line_start, bidi_txt, txt_len, lv_obj_get_base_dir(label), NULL, 0); #else bidi_txt = (char *)txt + line_start; #endif @@ -732,12 +732,12 @@ uint16_t lv_label_get_letter_on(const lv_obj_t * label, lv_point_t * pos) lv_coord_t x = 0; if(align == LV_LABEL_ALIGN_CENTER) { lv_coord_t line_w; - line_w = lv_txt_get_width(bidi_txt, new_line_start - line_start, font, letter_space, flag); + line_w = _lv_txt_get_width(bidi_txt, new_line_start - line_start, font, letter_space, flag); x += lv_area_get_width(&txt_coords) / 2 - line_w / 2; } else if(align == LV_LABEL_ALIGN_RIGHT) { lv_coord_t line_w; - line_w = lv_txt_get_width(bidi_txt, new_line_start - line_start, font, letter_space, flag); + line_w = _lv_txt_get_width(bidi_txt, new_line_start - line_start, font, letter_space, flag); x += lv_area_get_width(&txt_coords) - line_w; } @@ -749,14 +749,14 @@ uint16_t lv_label_get_letter_on(const lv_obj_t * label, lv_point_t * pos) if(new_line_start > 0) { while(i + line_start < new_line_start) { /* Get the current letter.*/ - uint32_t letter = lv_txt_encoded_next(bidi_txt, &i); + uint32_t letter = _lv_txt_encoded_next(bidi_txt, &i); /*Get the next letter too for kerning*/ - uint32_t letter_next = lv_txt_encoded_next(&bidi_txt[i], NULL); + uint32_t letter_next = _lv_txt_encoded_next(&bidi_txt[i], NULL); /*Handle the recolor command*/ if((flag & LV_TXT_FLAG_RECOLOR) != 0) { - if(lv_txt_is_cmd(&cmd_state, bidi_txt[i]) != false) { + if(_lv_txt_is_cmd(&cmd_state, bidi_txt[i]) != false) { continue; /*Skip the letter is it is part of a command*/ } } @@ -776,15 +776,15 @@ uint16_t lv_label_get_letter_on(const lv_obj_t * label, lv_point_t * pos) #if LV_USE_BIDI /*Handle Bidi*/ bool is_rtl; - logical_pos = lv_bidi_get_logical_pos(&txt[line_start], NULL, txt_len, lv_obj_get_base_dir(label), - lv_txt_encoded_get_char_id(bidi_txt, i), &is_rtl); + logical_pos = _lv_bidi_get_logical_pos(&txt[line_start], NULL, txt_len, lv_obj_get_base_dir(label), + _lv_txt_encoded_get_char_id(bidi_txt, i), &is_rtl); if(is_rtl) logical_pos++; - lv_mem_buf_release(bidi_txt); + _lv_mem_buf_release(bidi_txt); #else - logical_pos = lv_txt_encoded_get_char_id(bidi_txt, i); + logical_pos = _lv_txt_encoded_get_char_id(bidi_txt, i); #endif - return logical_pos + lv_txt_encoded_get_char_id(txt, line_start); + return logical_pos + _lv_txt_encoded_get_char_id(txt, line_start); } /** @@ -857,7 +857,7 @@ bool lv_label_is_char_under_pos(const lv_obj_t * label, lv_point_t * pos) /*Search the line of the index letter */; while(txt[line_start] != '\0') { - new_line_start += lv_txt_get_next_line(&txt[line_start], font, letter_space, max_w, flag); + new_line_start += _lv_txt_get_next_line(&txt[line_start], font, letter_space, max_w, flag); if(pos->y <= y + letter_height) break; /*The line is found (stored in 'line_start')*/ y += letter_height + line_space; @@ -870,12 +870,12 @@ bool lv_label_is_char_under_pos(const lv_obj_t * label, lv_point_t * pos) lv_coord_t last_x = 0; if(align == LV_LABEL_ALIGN_CENTER) { lv_coord_t line_w; - line_w = lv_txt_get_width(&txt[line_start], new_line_start - line_start, font, letter_space, flag); + line_w = _lv_txt_get_width(&txt[line_start], new_line_start - line_start, font, letter_space, flag); x += lv_area_get_width(&txt_coords) / 2 - line_w / 2; } else if(align == LV_LABEL_ALIGN_RIGHT) { lv_coord_t line_w; - line_w = lv_txt_get_width(&txt[line_start], new_line_start - line_start, font, letter_space, flag); + line_w = _lv_txt_get_width(&txt[line_start], new_line_start - line_start, font, letter_space, flag); x += lv_area_get_width(&txt_coords) - line_w; } @@ -890,14 +890,14 @@ bool lv_label_is_char_under_pos(const lv_obj_t * label, lv_point_t * pos) while(i <= new_line_start - 1) { /* Get the current letter * Be careful 'i' already points to the next character */ - letter = lv_txt_encoded_next(txt, &i); + letter = _lv_txt_encoded_next(txt, &i); /*Get the next letter for kerning*/ - letter_next = lv_txt_encoded_next(&txt[i], NULL); + letter_next = _lv_txt_encoded_next(&txt[i], NULL); /*Handle the recolor command*/ if((flag & LV_TXT_FLAG_RECOLOR) != 0) { - if(lv_txt_is_cmd(&cmd_state, txt[i]) != false) { + if(_lv_txt_is_cmd(&cmd_state, txt[i]) != false) { continue; /*Skip the letter is it is part of a command*/ } } @@ -961,20 +961,20 @@ void lv_label_ins_text(lv_obj_t * label, uint32_t pos, const char * txt) if(ext->text == NULL) return; if(pos == LV_LABEL_POS_LAST) { - pos = lv_txt_get_encoded_length(ext->text); + pos = _lv_txt_get_encoded_length(ext->text); } #if LV_USE_BIDI - char * bidi_buf = lv_mem_buf_get(ins_len + 1); + char * bidi_buf = _lv_mem_buf_get(ins_len + 1); LV_ASSERT_MEM(bidi_buf); if(bidi_buf == NULL) return; - lv_bidi_process(txt, bidi_buf, lv_obj_get_base_dir(label)); - lv_txt_ins(ext->text, pos, bidi_buf); + _lv_bidi_process(txt, bidi_buf, lv_obj_get_base_dir(label)); + _lv_txt_ins(ext->text, pos, bidi_buf); - lv_mem_buf_release(bidi_buf); + _lv_mem_buf_release(bidi_buf); #else - lv_txt_ins(ext->text, pos, txt); + _lv_txt_ins(ext->text, pos, txt); #endif lv_label_refr_text(label); } @@ -999,7 +999,7 @@ void lv_label_cut_text(lv_obj_t * label, uint32_t pos, uint32_t cnt) char * label_txt = lv_label_get_text(label); /*Delete the characters*/ - lv_txt_cut(label_txt, pos, cnt); + _lv_txt_cut(label_txt, pos, cnt); /*Refresh the label*/ lv_label_refr_text(label); @@ -1046,7 +1046,7 @@ static lv_design_res_t lv_label_design(lv_obj_t * label, const lv_area_t * clip_ get_txt_coords(label, &txt_coords); lv_area_t txt_clip; - bool is_common = lv_area_intersect(&txt_clip, clip_area, &txt_coords); + bool is_common = _lv_area_intersect(&txt_clip, clip_area, &txt_coords); if(!is_common) return LV_DESIGN_RES_OK; lv_label_align_t align = lv_label_get_align(label); @@ -1073,7 +1073,7 @@ static lv_design_res_t lv_label_design(lv_obj_t * label, const lv_area_t * clip_ if((ext->long_mode == LV_LABEL_LONG_SROLL || ext->long_mode == LV_LABEL_LONG_SROLL_CIRC) && (ext->align == LV_LABEL_ALIGN_CENTER || ext->align == LV_LABEL_ALIGN_RIGHT)) { lv_point_t size; - lv_txt_get_size(&size, ext->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space, + _lv_txt_get_size(&size, ext->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space, LV_COORD_MAX, flag); if(size.x > lv_area_get_width(&txt_coords)) { label_draw_dsc.flag &= ~LV_TXT_FLAG_RIGHT; @@ -1094,7 +1094,7 @@ static lv_design_res_t lv_label_design(lv_obj_t * label, const lv_area_t * clip_ if(ext->long_mode == LV_LABEL_LONG_SROLL_CIRC) { lv_point_t size; - lv_txt_get_size(&size, ext->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space, + _lv_txt_get_size(&size, ext->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space, LV_COORD_MAX, flag); /*Draw the text again next to the original to make an circular effect */ @@ -1205,7 +1205,7 @@ static void lv_label_refr_text(lv_obj_t * label) if(ext->recolor != 0) flag |= LV_TXT_FLAG_RECOLOR; if(ext->expand != 0) flag |= LV_TXT_FLAG_EXPAND; if(ext->long_mode == LV_LABEL_LONG_EXPAND) flag |= LV_TXT_FLAG_FIT; - lv_txt_get_size(&size, ext->text, font, letter_space, line_space, max_w, flag); + _lv_txt_get_size(&size, ext->text, font, letter_space, line_space, max_w, flag); /*Set the full size in expand mode*/ if(ext->long_mode == LV_LABEL_LONG_EXPAND) { @@ -1351,7 +1351,7 @@ static void lv_label_refr_text(lv_obj_t * label) if(size.y <= lv_area_get_height(&txt_coords)) { /*No dots are required, the text is short enough*/ ext->dot_end = LV_LABEL_DOT_END_INV; } - else if(lv_txt_get_encoded_length(ext->text) <= LV_LABEL_DOT_NUM) { /*Don't turn to dots all the characters*/ + else if(_lv_txt_get_encoded_length(ext->text) <= LV_LABEL_DOT_NUM) { /*Don't turn to dots all the characters*/ ext->dot_end = LV_LABEL_DOT_END_INV; } else { @@ -1368,9 +1368,9 @@ static void lv_label_refr_text(lv_obj_t * label) /*Be sure there is space for the dots*/ size_t txt_len = strlen(ext->text); - uint32_t byte_id = lv_txt_encoded_get_byte_id(ext->text, letter_id); + uint32_t byte_id = _lv_txt_encoded_get_byte_id(ext->text, letter_id); while(byte_id + LV_LABEL_DOT_NUM > txt_len) { - byte_id -= lv_txt_encoded_size(&ext->text[byte_id]); + byte_id -= _lv_txt_encoded_size(&ext->text[byte_id]); letter_id--; } @@ -1379,8 +1379,8 @@ static void lv_label_refr_text(lv_obj_t * label) uint32_t i; uint8_t len = 0; for(i = 0; i <= LV_LABEL_DOT_NUM; i++) { - len += lv_txt_encoded_size(&ext->text[byte_id]); - lv_txt_encoded_next(ext->text, &byte_id); + len += _lv_txt_encoded_size(&ext->text[byte_id]); + _lv_txt_encoded_next(ext->text, &byte_id); } if(lv_label_set_dot_tmp(label, &ext->text[byte_id_ori], len)) { @@ -1411,7 +1411,7 @@ static void lv_label_revert_dots(lv_obj_t * label) if(ext->long_mode != LV_LABEL_LONG_DOT) return; if(ext->dot_end == LV_LABEL_DOT_END_INV) return; uint32_t letter_i = ext->dot_end - LV_LABEL_DOT_NUM; - uint32_t byte_i = lv_txt_encoded_get_byte_id(ext->text, letter_i); + uint32_t byte_i = _lv_txt_encoded_get_byte_id(ext->text, letter_i); /*Restore the characters*/ uint8_t i = 0; @@ -1461,14 +1461,14 @@ static bool lv_label_set_dot_tmp(lv_obj_t * label, char * data, uint16_t len) LV_LOG_ERROR("Failed to allocate memory for dot_tmp_ptr"); return false; } - lv_memcpy(ext->dot.tmp_ptr, data, len); + _lv_memcpy(ext->dot.tmp_ptr, data, len); ext->dot.tmp_ptr[len] = '\0'; ext->dot_tmp_alloc = true; } else { /* Characters can be directly stored in object */ ext->dot_tmp_alloc = false; - lv_memcpy(ext->dot.tmp, data, len); + _lv_memcpy(ext->dot.tmp, data, len); } return true; } diff --git a/src/lv_widgets/lv_linemeter.c b/src/lv_widgets/lv_linemeter.c index 9b71beb93a..592d1febe9 100644 --- a/src/lv_widgets/lv_linemeter.c +++ b/src/lv_widgets/lv_linemeter.c @@ -154,24 +154,24 @@ void lv_linemeter_set_value(lv_obj_t * lmeter, int32_t value) int32_t angle_old = (level_old * ext->scale_angle) / (ext->line_cnt - 1); /*Use smaller clip area only around the visible line*/ - int32_t y_in_old = (int32_t)((int32_t)lv_trigo_sin(angle_old + angle_ofs) * r_in) >> LV_TRIGO_SHIFT; - int32_t x_in_old = (int32_t)((int32_t)lv_trigo_sin(angle_old + 90 + angle_ofs) * r_in) >> LV_TRIGO_SHIFT; + int32_t y_in_old = (int32_t)((int32_t)_lv_trigo_sin(angle_old + angle_ofs) * r_in) >> LV_TRIGO_SHIFT; + int32_t x_in_old = (int32_t)((int32_t)_lv_trigo_sin(angle_old + 90 + angle_ofs) * r_in) >> LV_TRIGO_SHIFT; - int32_t y_out_old = (int32_t)((int32_t)lv_trigo_sin(angle_old + angle_ofs) * r_out) >> LV_TRIGO_SHIFT; - int32_t x_out_old = (int32_t)((int32_t)lv_trigo_sin(angle_old + 90 + angle_ofs) * r_out) >> LV_TRIGO_SHIFT; + int32_t y_out_old = (int32_t)((int32_t)_lv_trigo_sin(angle_old + angle_ofs) * r_out) >> LV_TRIGO_SHIFT; + int32_t x_out_old = (int32_t)((int32_t)_lv_trigo_sin(angle_old + 90 + angle_ofs) * r_out) >> LV_TRIGO_SHIFT; int32_t angle_new = (level_new * ext->scale_angle) / (ext->line_cnt - 1); /*Use smaller clip area only around the visible line*/ - int32_t y_in_new = (int32_t)((int32_t)lv_trigo_sin(angle_new + angle_ofs) * r_in) >> LV_TRIGO_SHIFT; - int32_t x_in_new = (int32_t)((int32_t)lv_trigo_sin(angle_new + 90 + angle_ofs) * r_in) >> LV_TRIGO_SHIFT; + int32_t y_in_new = (int32_t)((int32_t)_lv_trigo_sin(angle_new + angle_ofs) * r_in) >> LV_TRIGO_SHIFT; + int32_t x_in_new = (int32_t)((int32_t)_lv_trigo_sin(angle_new + 90 + angle_ofs) * r_in) >> LV_TRIGO_SHIFT; - int32_t y_out_new = (int32_t)((int32_t)lv_trigo_sin(angle_new + angle_ofs) * r_out) >> LV_TRIGO_SHIFT; - int32_t x_out_new = (int32_t)((int32_t)lv_trigo_sin(angle_new + 90 + angle_ofs) * r_out) >> LV_TRIGO_SHIFT; + int32_t y_out_new = (int32_t)((int32_t)_lv_trigo_sin(angle_new + angle_ofs) * r_out) >> LV_TRIGO_SHIFT; + int32_t x_out_new = (int32_t)((int32_t)_lv_trigo_sin(angle_new + 90 + angle_ofs) * r_out) >> LV_TRIGO_SHIFT; lv_area_t a; if(x_out_old < 0 && x_out_new < 0) { @@ -447,12 +447,12 @@ void lv_linemeter_draw_scale(lv_obj_t * lmeter, const lv_area_t * clip_area, uin int32_t angle_rem = angle_upscale & 0xFF; /*Interpolate sine and cos*/ - int32_t sin_low = lv_trigo_sin(angle_low + angle_ofs); - int32_t sin_high = lv_trigo_sin(angle_high + angle_ofs); + int32_t sin_low = _lv_trigo_sin(angle_low + angle_ofs); + int32_t sin_high = _lv_trigo_sin(angle_high + angle_ofs); int32_t sin_mid = (sin_low * (256 - angle_rem) + sin_high * angle_rem) >> 8; - int32_t cos_low = lv_trigo_sin(angle_low + 90 + angle_ofs); - int32_t cos_high = lv_trigo_sin(angle_high + 90 + angle_ofs); + int32_t cos_low = _lv_trigo_sin(angle_low + 90 + angle_ofs); + int32_t cos_high = _lv_trigo_sin(angle_high + 90 + angle_ofs); int32_t cos_mid = (cos_low * (256 - angle_rem) + cos_high * angle_rem) >> 8; /*Use the interpolated values to get x and y coordinates*/ @@ -490,14 +490,14 @@ void lv_linemeter_draw_scale(lv_obj_t * lmeter, const lv_area_t * clip_area, uin #endif /*Use smaller clip area only around the visible line*/ - int32_t y_in = (int32_t)((int32_t)lv_trigo_sin(angle_normal + angle_ofs) * r_in) >> LV_TRIGO_SHIFT; - int32_t x_in = (int32_t)((int32_t)lv_trigo_sin(angle_normal + 90 + angle_ofs) * r_in) >> LV_TRIGO_SHIFT; + int32_t y_in = (int32_t)((int32_t)_lv_trigo_sin(angle_normal + angle_ofs) * r_in) >> LV_TRIGO_SHIFT; + int32_t x_in = (int32_t)((int32_t)_lv_trigo_sin(angle_normal + 90 + angle_ofs) * r_in) >> LV_TRIGO_SHIFT; x_in += x_ofs; y_in += y_ofs; - int32_t y_out = (int32_t)((int32_t)lv_trigo_sin(angle_normal + angle_ofs) * r_out) >> LV_TRIGO_SHIFT; - int32_t x_out = (int32_t)((int32_t)lv_trigo_sin(angle_normal + 90 + angle_ofs) * r_out) >> LV_TRIGO_SHIFT; + int32_t y_out = (int32_t)((int32_t)_lv_trigo_sin(angle_normal + angle_ofs) * r_out) >> LV_TRIGO_SHIFT; + int32_t x_out = (int32_t)((int32_t)_lv_trigo_sin(angle_normal + 90 + angle_ofs) * r_out) >> LV_TRIGO_SHIFT; x_out += x_ofs; y_out += y_ofs; @@ -508,7 +508,7 @@ void lv_linemeter_draw_scale(lv_obj_t * lmeter, const lv_area_t * clip_area, uin clip_sub.y1 = LV_MATH_MIN(y_in, y_out) - line_dsc.width; clip_sub.y2 = LV_MATH_MAX(y_in, y_out) + line_dsc.width; - if(lv_area_intersect(&clip_sub, &clip_sub, clip_area) == false) continue; + if(_lv_area_intersect(&clip_sub, &clip_sub, clip_area) == false) continue; lv_point_t p1; lv_point_t p2; diff --git a/src/lv_widgets/lv_objmask.c b/src/lv_widgets/lv_objmask.c index bd877dd74f..d354e374c4 100644 --- a/src/lv_widgets/lv_objmask.c +++ b/src/lv_widgets/lv_objmask.c @@ -70,7 +70,7 @@ lv_obj_t * lv_objmask_create(lv_obj_t * par, const lv_obj_t * copy) if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(objmask); /*Initialize the allocated 'ext' */ - lv_ll_init(&ext->mask_ll, sizeof(lv_objmask_mask_t)); + _lv_ll_init(&ext->mask_ll, sizeof(lv_objmask_mask_t)); /*The signal and design functions are not copied so set them here*/ lv_obj_set_signal_cb(objmask, lv_objmask_signal); @@ -114,14 +114,14 @@ lv_objmask_mask_t * lv_objmask_add_mask(lv_obj_t * objmask, void * param) lv_draw_mask_common_dsc_t * dsc = param; uint16_t param_size = get_param_size(dsc->type); - lv_objmask_mask_t * m = lv_ll_ins_head(&ext->mask_ll); + lv_objmask_mask_t * m = _lv_ll_ins_head(&ext->mask_ll); LV_ASSERT_MEM(m); if(m == NULL) return NULL; m->param = lv_mem_alloc(param_size); LV_ASSERT_MEM(m->param); if(m->param == NULL) return NULL; - lv_memcpy(m->param, param, param_size); + _lv_memcpy(m->param, param, param_size); lv_obj_invalidate(objmask); @@ -161,16 +161,16 @@ void lv_objmask_remove_mask(lv_obj_t * objmask, lv_objmask_mask_t * mask) /*Remove all masks*/ if(mask == NULL) { lv_objmask_mask_t * m; - LV_LL_READ(ext->mask_ll, m) { + _LV_LL_READ(ext->mask_ll, m) { lv_mem_free(m->param); } - lv_ll_clear(&ext->mask_ll); + _lv_ll_clear(&ext->mask_ll); } /*Remove only the specified mask*/ else { lv_mem_free(mask->param); - lv_ll_remove(&ext->mask_ll, mask); + _lv_ll_remove(&ext->mask_ll, mask); } lv_obj_invalidate(objmask); @@ -211,7 +211,7 @@ static lv_design_res_t lv_objmask_design(lv_obj_t * objmask, const lv_area_t * c /*Return false if the object is not covers the mask_p area*/ if(mode == LV_DESIGN_COVER_CHK) { lv_objmask_ext_t * ext = lv_obj_get_ext_attr(objmask); - if(lv_ll_get_len(&ext->mask_ll) > 0) return LV_DESIGN_RES_MASKED; + if(_lv_ll_get_len(&ext->mask_ll) > 0) return LV_DESIGN_RES_MASKED; else return ancestor_design(objmask, clip_area, mode); } /*Draw the object*/ @@ -225,12 +225,12 @@ static lv_design_res_t lv_objmask_design(lv_obj_t * objmask, const lv_area_t * c lv_objmask_mask_t * m; - LV_LL_READ(ext->mask_ll, m) { + _LV_LL_READ(ext->mask_ll, m) { lv_draw_mask_common_dsc_t * dsc = m->param; if(dsc->type == LV_DRAW_MASK_TYPE_LINE) { lv_draw_mask_line_param_t * p_ori = m->param; - lv_draw_mask_line_param_t * p_new = lv_mem_buf_get(sizeof(lv_draw_mask_line_param_t)); + lv_draw_mask_line_param_t * p_new = _lv_mem_buf_get(sizeof(lv_draw_mask_line_param_t)); lv_draw_mask_line_points_init(p_new, p_ori->cfg.p1.x + xofs, p_ori->cfg.p1.y + yofs, p_ori->cfg.p2.x + xofs, p_ori->cfg.p2.y + yofs, @@ -239,7 +239,7 @@ static lv_design_res_t lv_objmask_design(lv_obj_t * objmask, const lv_area_t * c } else if(dsc->type == LV_DRAW_MASK_TYPE_ANGLE) { lv_draw_mask_angle_param_t * p_ori = m->param; - lv_draw_mask_angle_param_t * p_new = lv_mem_buf_get(sizeof(lv_draw_mask_angle_param_t)); + lv_draw_mask_angle_param_t * p_new = _lv_mem_buf_get(sizeof(lv_draw_mask_angle_param_t)); lv_draw_mask_angle_init(p_new, p_ori->cfg.vertex_p.x + xofs, p_ori->cfg.vertex_p.y + yofs, p_ori->cfg.start_angle, p_ori->cfg.end_angle); @@ -247,7 +247,7 @@ static lv_design_res_t lv_objmask_design(lv_obj_t * objmask, const lv_area_t * c } else if(dsc->type == LV_DRAW_MASK_TYPE_RADIUS) { lv_draw_mask_radius_param_t * p_ori = m->param; - lv_draw_mask_radius_param_t * p_new = lv_mem_buf_get(sizeof(lv_draw_mask_radius_param_t)); + lv_draw_mask_radius_param_t * p_new = _lv_mem_buf_get(sizeof(lv_draw_mask_radius_param_t)); lv_area_t rect; rect.x1 = p_ori->cfg.rect.x1 + xofs; @@ -260,7 +260,7 @@ static lv_design_res_t lv_objmask_design(lv_obj_t * objmask, const lv_area_t * c } else if(dsc->type == LV_DRAW_MASK_TYPE_FADE) { lv_draw_mask_fade_param_t * p_ori = m->param; - lv_draw_mask_fade_param_t * p_new = lv_mem_buf_get(sizeof(lv_draw_mask_fade_param_t)); + lv_draw_mask_fade_param_t * p_new = _lv_mem_buf_get(sizeof(lv_draw_mask_fade_param_t)); lv_area_t rect; rect.x1 = p_ori->cfg.coords.x1 + xofs; @@ -274,7 +274,7 @@ static lv_design_res_t lv_objmask_design(lv_obj_t * objmask, const lv_area_t * c } else if(dsc->type == LV_DRAW_MASK_TYPE_MAP) { lv_draw_mask_map_param_t * p_ori = m->param; - lv_draw_mask_map_param_t * p_new = lv_mem_buf_get(sizeof(lv_draw_mask_map_param_t)); + lv_draw_mask_map_param_t * p_new = _lv_mem_buf_get(sizeof(lv_draw_mask_map_param_t)); lv_area_t rect; rect.x1 = p_ori->cfg.coords.x1 + xofs; @@ -296,10 +296,10 @@ static lv_design_res_t lv_objmask_design(lv_obj_t * objmask, const lv_area_t * c lv_objmask_mask_t * m; - LV_LL_READ(ext->mask_ll, m) { + _LV_LL_READ(ext->mask_ll, m) { void * param; param = lv_draw_mask_remove_custom(m->param); - lv_mem_buf_release(param); + _lv_mem_buf_release(param); } } @@ -326,14 +326,14 @@ static lv_res_t lv_objmask_signal(lv_obj_t * objmask, lv_signal_t sign, void * p if(sign == LV_SIGNAL_CLEANUP) { lv_objmask_ext_t * ext = lv_obj_get_ext_attr(objmask); lv_objmask_mask_t * i; - LV_LL_READ(ext->mask_ll, i) { + _LV_LL_READ(ext->mask_ll, i) { if(i->param) { lv_mem_free(i->param); i->param = NULL; } } - lv_ll_clear(&ext->mask_ll); + _lv_ll_clear(&ext->mask_ll); } return res; diff --git a/src/lv_widgets/lv_page.c b/src/lv_widgets/lv_page.c index 3cdaa01b46..311757a0f8 100644 --- a/src/lv_widgets/lv_page.c +++ b/src/lv_widgets/lv_page.c @@ -701,8 +701,8 @@ static lv_design_res_t lv_page_design(lv_obj_t * page, const lv_area_t * clip_ar sb_ver_area.x2 += page->coords.x1; sb_ver_area.y2 += page->coords.y1; - if((ext->scrlbar.hor_draw && lv_area_is_on(&sb_hor_area, clip_area)) || - (ext->scrlbar.ver_draw && lv_area_is_on(&sb_ver_area, clip_area))) { + if((ext->scrlbar.hor_draw && _lv_area_is_on(&sb_hor_area, clip_area)) || + (ext->scrlbar.ver_draw && _lv_area_is_on(&sb_ver_area, clip_area))) { /*Draw the scrollbars*/ lv_draw_rect_dsc_t rect_dsc; lv_draw_rect_dsc_init(&rect_dsc); @@ -1242,7 +1242,7 @@ static void scrlbar_refresh(lv_obj_t * page) /*Full sized horizontal scrollbar*/ if(scrl_w <= obj_w - bg_left - bg_right) { 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); if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.hor_draw = 0; } @@ -1253,7 +1253,7 @@ static void scrlbar_refresh(lv_obj_t * page) if(size_tmp < LV_PAGE_SB_MIN_SIZE) size_tmp = LV_PAGE_SB_MIN_SIZE; lv_area_set_width(&ext->scrlbar.hor_area, size_tmp); - lv_area_set_pos(&ext->scrlbar.hor_area, + _lv_area_set_pos(&ext->scrlbar.hor_area, sb_hor_pad + (-(lv_obj_get_x(scrl) - bg_left) * (obj_w - size_tmp - 2 * sb_hor_pad)) / (scrl_w + bg_left + bg_right - obj_w), @@ -1265,7 +1265,7 @@ static void scrlbar_refresh(lv_obj_t * page) /*Full sized vertical scroll bar*/ if(scrl_h <= obj_h - bg_top - bg_bottom) { 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); if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.ver_draw = 0; } @@ -1276,7 +1276,7 @@ static void scrlbar_refresh(lv_obj_t * page) if(size_tmp < LV_PAGE_SB_MIN_SIZE) size_tmp = LV_PAGE_SB_MIN_SIZE; lv_area_set_height(&ext->scrlbar.ver_area, size_tmp); - 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 + (-(lv_obj_get_y(scrl) - bg_left) * (obj_h - size_tmp - 2 * sb_ver_pad)) / diff --git a/src/lv_widgets/lv_roller.c b/src/lv_widgets/lv_roller.c index e2fe13d450..b5f9f85706 100644 --- a/src/lv_widgets/lv_roller.c +++ b/src/lv_widgets/lv_roller.c @@ -169,7 +169,7 @@ void lv_roller_set_options(lv_obj_t * roller, const char * options, lv_roller_mo ext->mode = LV_ROLLER_MODE_INIFINITE; size_t opt_len = strlen(options) + 1; /*+1 to add '\n' after option lists*/ - char * opt_extra = lv_mem_buf_get(opt_len * LV_ROLLER_INF_PAGES); + char * opt_extra = _lv_mem_buf_get(opt_len * LV_ROLLER_INF_PAGES); uint8_t i; for(i = 0; i < LV_ROLLER_INF_PAGES; i++) { strcpy(&opt_extra[opt_len * i], options); @@ -177,7 +177,7 @@ void lv_roller_set_options(lv_obj_t * roller, const char * options, lv_roller_mo } opt_extra[opt_len * LV_ROLLER_INF_PAGES - 1] = '\0'; lv_label_set_text(label, opt_extra); - lv_mem_buf_release(opt_extra); + _lv_mem_buf_release(opt_extra); ext->sel_opt_id = ((LV_ROLLER_INF_PAGES / 2) + 1) * ext->option_cnt; @@ -442,7 +442,7 @@ static lv_design_res_t lv_roller_design(lv_obj_t * roller, const lv_area_t * cli rect_area.x2 = roller->coords.x2; lv_area_t mask_sel; bool area_ok; - area_ok = lv_area_intersect(&mask_sel, clip_area, &rect_area); + area_ok = _lv_area_intersect(&mask_sel, clip_area, &rect_area); if(area_ok) { lv_obj_t * label = get_label(roller); lv_label_align_t label_align = lv_roller_get_align(roller); @@ -692,7 +692,7 @@ static void draw_bg(lv_obj_t * roller, const lv_area_t * clip_area) half_mask.y1 -= roller->ext_draw_pad; half_mask.y2 = roller->coords.y1 + h / 2; - union_ok = lv_area_intersect(&half_mask, &half_mask, clip_area); + union_ok = _lv_area_intersect(&half_mask, &half_mask, clip_area); bg_dsc.bg_main_color_stop = bg_dsc.bg_main_color_stop / 2; bg_dsc.bg_grad_color_stop = 128 - (255 - bg_dsc.bg_grad_color_stop) / 2; if(union_ok) { @@ -705,7 +705,7 @@ static void draw_bg(lv_obj_t * roller, const lv_area_t * clip_area) half_mask.y1 = roller->coords.y1 + h / 2; half_mask.y2 += roller->ext_draw_pad; - union_ok = lv_area_intersect(&half_mask, &half_mask, clip_area); + union_ok = _lv_area_intersect(&half_mask, &half_mask, clip_area); if(union_ok) { lv_color_t c = bg_dsc.bg_color; bg_dsc.bg_color = bg_dsc.bg_grad_color; @@ -818,7 +818,7 @@ static lv_res_t release_handler(lv_obj_t * roller) uint32_t letter_cnt = 0; for(letter_cnt = 0; letter_cnt < letter_i; letter_cnt++) { - uint32_t letter = lv_txt_encoded_next(txt, &i); + uint32_t letter = _lv_txt_encoded_next(txt, &i); /*Count he lines to reach the clicked letter. But ignore the last '\n' because it * still belongs to the clicked line*/ if(letter == '\n' && i_prev != letter_i) new_opt++; diff --git a/src/lv_widgets/lv_spinbox.c b/src/lv_widgets/lv_spinbox.c index 9a8cfb8206..48e553c004 100644 --- a/src/lv_widgets/lv_spinbox.c +++ b/src/lv_widgets/lv_spinbox.c @@ -175,7 +175,7 @@ void lv_spinbox_set_digit_format(lv_obj_t * spinbox, uint8_t digit_count, uint8_ 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_min < - max_val + 1) ext->range_min = - max_val + 1; } @@ -525,7 +525,7 @@ static void lv_spinbox_updatevalue(lv_obj_t * spinbox) lv_spinbox_ext_t * ext = lv_obj_get_ext_attr(spinbox); char buf[LV_SPINBOX_MAX_DIGIT_COUNT + 8]; - lv_memset_00(buf, sizeof(buf)); + _lv_memset_00(buf, sizeof(buf)); char * buf_p = buf; uint8_t cur_shift_left = 0; @@ -548,7 +548,7 @@ static void lv_spinbox_updatevalue(lv_obj_t * spinbox) char digits[64]; /*Convert the numbers to string (the sign is already handled so always covert positive number)*/ - lv_utils_num_to_str(ext->value < 0 ? -ext->value : ext->value, digits); + _lv_utils_num_to_str(ext->value < 0 ? -ext->value : ext->value, digits); /*Add leading zeros*/ int lz_cnt = ext->digit_count - (int)strlen(digits); diff --git a/src/lv_widgets/lv_table.c b/src/lv_widgets/lv_table.c index 2e0ecd3619..d2a2f621b6 100644 --- a/src/lv_widgets/lv_table.c +++ b/src/lv_widgets/lv_table.c @@ -160,7 +160,7 @@ void lv_table_set_cell_value(lv_obj_t * table, uint16_t row, uint16_t col, const else if(base_dir == LV_BIDI_DIR_RTL) format.s.align = LV_LABEL_ALIGN_RIGHT; else if(base_dir == LV_BIDI_DIR_AUTO) #if LV_USE_BIDI - format.s.align = lv_bidi_detect_base_dir(txt); + format.s.align = _lv_bidi_detect_base_dir(txt); #else format.s.align = LV_LABEL_ALIGN_LEFT; #endif @@ -201,7 +201,7 @@ void lv_table_set_row_cnt(lv_obj_t * table, uint16_t row_cnt) if(old_row_cnt < row_cnt) { uint16_t old_cell_cnt = old_row_cnt * ext->col_cnt; uint32_t new_cell_cnt = ext->col_cnt * ext->row_cnt; - lv_memset_00(&ext->cell_data[old_cell_cnt], (new_cell_cnt - old_cell_cnt) * sizeof(ext->cell_data[0])); + _lv_memset_00(&ext->cell_data[old_cell_cnt], (new_cell_cnt - old_cell_cnt) * sizeof(ext->cell_data[0])); } ext->row_h = lv_mem_realloc(ext->row_h, ext->row_cnt * sizeof(ext->row_h[0])); @@ -243,7 +243,7 @@ void lv_table_set_col_cnt(lv_obj_t * table, uint16_t col_cnt) if(old_col_cnt < col_cnt) { uint16_t old_cell_cnt = old_col_cnt * ext->row_cnt; uint32_t new_cell_cnt = ext->col_cnt * ext->row_cnt; - lv_memset_00(&ext->cell_data[old_cell_cnt], (new_cell_cnt - old_cell_cnt) * sizeof(ext->cell_data[0])); + _lv_memset_00(&ext->cell_data[old_cell_cnt], (new_cell_cnt - old_cell_cnt) * sizeof(ext->cell_data[0])); } } @@ -817,7 +817,7 @@ static lv_design_res_t lv_table_design(lv_obj_t * table, const lv_area_t * clip_ txt_flags = LV_TXT_FLAG_EXPAND; } - lv_txt_get_size(&txt_size, ext->cell_data[cell] + 1, label_dsc[cell_type].font, + _lv_txt_get_size(&txt_size, ext->cell_data[cell] + 1, label_dsc[cell_type].font, label_dsc[cell_type].letter_space, label_dsc[cell_type].line_space, lv_area_get_width(&txt_area), txt_flags); @@ -843,7 +843,7 @@ static lv_design_res_t lv_table_design(lv_obj_t * table, const lv_area_t * clip_ lv_area_t label_mask; bool label_mask_ok; - label_mask_ok = lv_area_intersect(&label_mask, clip_area, &cell_area); + label_mask_ok = _lv_area_intersect(&label_mask, clip_area, &cell_area); if(label_mask_ok) { lv_draw_label(&txt_area, &label_mask, &label_dsc[cell_type], ext->cell_data[cell] + 1, NULL); } @@ -856,7 +856,7 @@ static lv_design_res_t lv_table_design(lv_obj_t * table, const lv_area_t * clip_ for(i = 1; ext->cell_data[cell][i] != '\0'; i++) { if(ext->cell_data[cell][i] == '\n') { ext->cell_data[cell][i] = '\0'; - lv_txt_get_size(&txt_size, ext->cell_data[cell] + 1, label_dsc[cell_type].font, + _lv_txt_get_size(&txt_size, ext->cell_data[cell] + 1, label_dsc[cell_type].font, label_dsc[cell_type].letter_space, label_dsc[cell_type].line_space, lv_area_get_width(&txt_area), txt_flags); @@ -1060,7 +1060,7 @@ static lv_coord_t get_row_height(lv_obj_t * table, uint16_t row_id, const lv_fon else { txt_w -= cell_left[cell_type] + cell_right[cell_type]; - lv_txt_get_size(&txt_size, ext->cell_data[cell] + 1, font[cell_type], + _lv_txt_get_size(&txt_size, ext->cell_data[cell] + 1, font[cell_type], letter_space[cell_type], line_space[cell_type], txt_w, LV_TXT_FLAG_NONE); h_max = LV_MATH_MAX(txt_size.y + cell_top[cell_type] + cell_bottom[cell_type], h_max); diff --git a/src/lv_widgets/lv_textarea.c b/src/lv_widgets/lv_textarea.c index 805e030318..5be9ff5d95 100644 --- a/src/lv_widgets/lv_textarea.c +++ b/src/lv_widgets/lv_textarea.c @@ -176,12 +176,12 @@ lv_obj_t * lv_textarea_create(lv_obj_t * par, const lv_obj_t * copy) } if(copy_ext->pwd_tmp) { - uint16_t len = lv_mem_get_size(copy_ext->pwd_tmp); + uint16_t len = _lv_mem_get_size(copy_ext->pwd_tmp); ext->pwd_tmp = lv_mem_alloc(len); LV_ASSERT_MEM(ext->pwd_tmp); if(ext->pwd_tmp == NULL) return NULL; - lv_memcpy(ext->pwd_tmp, copy_ext->pwd_tmp, len); + _lv_memcpy(ext->pwd_tmp, copy_ext->pwd_tmp, len); } if(copy_ext->one_line) lv_textarea_set_one_line(ta, true); @@ -252,7 +252,7 @@ void lv_textarea_add_char(lv_obj_t * ta, uint32_t c) return; } - uint32_t c_uni = lv_txt_encoded_next((const char *)&c, NULL); + uint32_t c_uni = _lv_txt_encoded_next((const char *)&c, NULL); if(char_is_accepted(ta, c_uni) == false) { LV_LOG_INFO("Character is no accepted by the text area (too long text or not in the " @@ -281,7 +281,7 @@ void lv_textarea_add_char(lv_obj_t * ta, uint32_t c) LV_ASSERT_MEM(ext->pwd_tmp); if(ext->pwd_tmp == NULL) return; - lv_txt_ins(ext->pwd_tmp, ext->cursor.pos, (const char *)letter_buf); + _lv_txt_ins(ext->pwd_tmp, ext->cursor.pos, (const char *)letter_buf); #if LV_USE_ANIMATION /*Auto hide characters*/ @@ -343,8 +343,8 @@ void lv_textarea_add_text(lv_obj_t * ta, const char * txt) if(lv_textarea_get_accepted_chars(ta) || lv_textarea_get_max_length(ta)) { uint32_t i = 0; while(txt[i] != '\0') { - uint32_t c = lv_txt_encoded_next(txt, &i); - lv_textarea_add_char(ta, lv_txt_unicode_to_encoded(c)); + uint32_t c = _lv_txt_encoded_next(txt, &i); + lv_textarea_add_char(ta, _lv_txt_unicode_to_encoded(c)); } return; } @@ -368,7 +368,7 @@ void lv_textarea_add_text(lv_obj_t * ta, const char * txt) LV_ASSERT_MEM(ext->pwd_tmp); if(ext->pwd_tmp == NULL) return; - lv_txt_ins(ext->pwd_tmp, ext->cursor.pos, txt); + _lv_txt_ins(ext->pwd_tmp, ext->cursor.pos, txt); #if LV_USE_ANIMATION /*Auto hide characters*/ @@ -390,7 +390,7 @@ void lv_textarea_add_text(lv_obj_t * ta, const char * txt) } /*Move the cursor after the new text*/ - lv_textarea_set_cursor_pos(ta, lv_textarea_get_cursor_pos(ta) + lv_txt_get_encoded_length(txt)); + lv_textarea_set_cursor_pos(ta, lv_textarea_get_cursor_pos(ta) + _lv_txt_get_encoded_length(txt)); /*Revert the original edge flash state*/ lv_textarea_set_edge_flash(ta, edge_flash_en); @@ -427,7 +427,7 @@ void lv_textarea_del_char(lv_obj_t * ta) char * label_txt = lv_label_get_text(ext->label); /*Delete a character*/ - lv_txt_cut(label_txt, ext->cursor.pos - 1, 1); + _lv_txt_cut(label_txt, ext->cursor.pos - 1, 1); /*Refresh the label*/ lv_label_set_text(ext->label, label_txt); lv_textarea_clear_selection(ta); @@ -446,8 +446,8 @@ void lv_textarea_del_char(lv_obj_t * ta) } if(ext->pwd_mode != 0) { - uint32_t byte_pos = lv_txt_encoded_get_byte_id(ext->pwd_tmp, ext->cursor.pos - 1); - lv_txt_cut(ext->pwd_tmp, ext->cursor.pos - 1, lv_txt_encoded_size(&label_txt[byte_pos])); + uint32_t byte_pos = _lv_txt_encoded_get_byte_id(ext->pwd_tmp, ext->cursor.pos - 1); + _lv_txt_cut(ext->pwd_tmp, ext->cursor.pos - 1, _lv_txt_encoded_size(&label_txt[byte_pos])); ext->pwd_tmp = lv_mem_realloc(ext->pwd_tmp, strlen(ext->pwd_tmp) + 1); LV_ASSERT_MEM(ext->pwd_tmp); @@ -502,8 +502,8 @@ void lv_textarea_set_text(lv_obj_t * ta, const char * txt) } uint32_t i = 0; while(txt[i] != '\0') { - uint32_t c = lv_txt_encoded_next(txt, &i); - lv_textarea_add_char(ta, lv_txt_unicode_to_encoded(c)); + uint32_t c = _lv_txt_encoded_next(txt, &i); + lv_textarea_add_char(ta, _lv_txt_unicode_to_encoded(c)); } } else { @@ -608,7 +608,7 @@ void lv_textarea_set_cursor_pos(lv_obj_t * ta, int16_t pos) lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); if(ext->cursor.pos == pos) return; - uint16_t len = lv_txt_get_encoded_length(lv_label_get_text(ext->label)); + uint16_t len = _lv_txt_get_encoded_length(lv_label_get_text(ext->label)); if(pos < 0) pos = len + pos; @@ -1374,7 +1374,7 @@ static lv_design_res_t lv_textarea_scrollable_design(lv_obj_t * scrl, const lv_a lv_draw_rect(&cur_area, clip_area, &cur_dsc); char letter_buf[8] = {0}; - lv_memcpy(letter_buf, &txt[ext->cursor.txt_byte_pos], lv_txt_encoded_size(&txt[ext->cursor.txt_byte_pos])); + _lv_memcpy(letter_buf, &txt[ext->cursor.txt_byte_pos], _lv_txt_encoded_size(&txt[ext->cursor.txt_byte_pos])); if(cur_dsc.bg_opa == LV_OPA_COVER) { lv_style_int_t left = lv_obj_get_style_pad_left(ta, LV_TEXTAREA_PART_CURSOR); @@ -1644,7 +1644,7 @@ static void pwd_char_hider(lv_obj_t * ta) lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); if(ext->pwd_mode != 0) { char * txt = lv_label_get_text(ext->label); - int16_t enc_len = lv_txt_get_encoded_length(txt); + int16_t enc_len = _lv_txt_get_encoded_length(txt); if(enc_len == 0) return; /*If the textarea's font has "bullet" character use it else fallback to "*"*/ @@ -1657,16 +1657,16 @@ static void pwd_char_hider(lv_obj_t * ta) else bullet = "*"; size_t bullet_len = strlen(bullet); - char * txt_tmp = lv_mem_buf_get(enc_len * bullet_len + 1); + char * txt_tmp = _lv_mem_buf_get(enc_len * bullet_len + 1); uint16_t i; for(i = 0; i < enc_len; i++) { - lv_memcpy(&txt_tmp[i * bullet_len], bullet, bullet_len); + _lv_memcpy(&txt_tmp[i * bullet_len], bullet, bullet_len); } txt_tmp[i * bullet_len] = '\0'; lv_label_set_text(ext->label, txt_tmp); - lv_mem_buf_release(txt_tmp); + _lv_mem_buf_release(txt_tmp); } } @@ -1684,7 +1684,7 @@ static bool char_is_accepted(lv_obj_t * ta, uint32_t c) if(ext->accapted_chars == NULL && ext->max_length == 0) return true; /*Too many characters?*/ - if(ext->max_length > 0 && lv_txt_get_encoded_length(lv_textarea_get_text(ta)) >= ext->max_length) { + if(ext->max_length > 0 && _lv_txt_get_encoded_length(lv_textarea_get_text(ta)) >= ext->max_length) { return false; } @@ -1693,7 +1693,7 @@ static bool char_is_accepted(lv_obj_t * ta, uint32_t c) uint32_t i = 0; while(ext->accapted_chars[i] != '\0') { - uint32_t a = lv_txt_encoded_next(ext->accapted_chars, &i); + uint32_t a = _lv_txt_encoded_next(ext->accapted_chars, &i); if(a == c) return true; /*Accepted*/ } @@ -1716,9 +1716,9 @@ static void refr_cursor_area(lv_obj_t * ta) const char * txt = lv_label_get_text(ext->label); uint32_t byte_pos; - byte_pos = lv_txt_encoded_get_byte_id(txt, cur_pos); + byte_pos = _lv_txt_encoded_get_byte_id(txt, cur_pos); - uint32_t letter = lv_txt_encoded_next(&txt[byte_pos], NULL); + uint32_t letter = _lv_txt_encoded_next(&txt[byte_pos], NULL); lv_coord_t letter_h = lv_font_get_line_height(font); @@ -1742,8 +1742,8 @@ static void refr_cursor_area(lv_obj_t * ta) letter_pos.y += letter_h + line_space; if(letter != '\0') { - byte_pos += lv_txt_encoded_size(&txt[byte_pos]); - letter = lv_txt_encoded_next(&txt[byte_pos], NULL); + byte_pos += _lv_txt_encoded_size(&txt[byte_pos]); + letter = _lv_txt_encoded_next(&txt[byte_pos], NULL); } if(letter == '\0' || letter == '\n' || letter == '\r') { diff --git a/src/lv_widgets/lv_win.c b/src/lv_widgets/lv_win.c index a52cf9345a..2e24df54ed 100644 --- a/src/lv_widgets/lv_win.c +++ b/src/lv_widgets/lv_win.c @@ -511,7 +511,7 @@ static lv_design_res_t lv_win_header_design(lv_obj_t * header, const lv_area_t * lv_point_t txt_size; - lv_txt_get_size(&txt_size, ext->title_txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, + _lv_txt_get_size(&txt_size, ext->title_txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, label_dsc.flag); txt_area.x1 = header->coords.x1 + left; diff --git a/tests/lv_test_core/lv_test_style.c b/tests/lv_test_core/lv_test_style.c index ec886fc18e..0d1f3a5ede 100644 --- a/tests/lv_test_core/lv_test_style.c +++ b/tests/lv_test_core/lv_test_style.c @@ -79,16 +79,16 @@ static void empty_style(void) lv_test_print("Get a properties from an empty style"); - found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); + found = _lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'int' property"); - found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa); + found = _lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa); lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'opa' property"); - found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr); + found = _lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr); lv_test_assert_int_eq(LV_RES_INV, found, "Get a 'ptr' property"); - found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); + found = _lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); lv_test_assert_int_eq(LV_RES_INV, found, "Get a 'color' property"); } @@ -104,7 +104,7 @@ static void add_remove_read_prop(void) lv_style_t style; lv_style_init(&style); - lv_style_list_add_style(&style_list, &style); + _lv_style_list_add_style(&style_list, &style); lv_res_t found; lv_style_int_t value; @@ -114,16 +114,16 @@ static void add_remove_read_prop(void) lv_test_print("Add an empty style and read properties"); - found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); + found = _lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); lv_test_assert_int_eq(LV_RES_INV, found, "Get a non existing 'int' property"); - found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa); + found = _lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa); lv_test_assert_int_eq(LV_RES_INV, found, "Get a non existing 'opa' property"); - found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr); + found = _lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr); lv_test_assert_int_eq(LV_RES_INV, found, "Get a non existing 'ptr' property"); - found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); + found = _lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); lv_test_assert_int_eq(LV_RES_INV, found, "Get a non existing 'color' property"); lv_test_print("Set properties and read back the values"); @@ -132,38 +132,38 @@ static void add_remove_read_prop(void) _lv_style_set_ptr(&style, LV_STYLE_TEXT_FONT, LV_THEME_DEFAULT_FONT_NORMAL); _lv_style_set_color(&style, LV_STYLE_BG_COLOR, LV_COLOR_RED); - found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); + found = _lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); lv_test_assert_int_eq(LV_RES_OK, found, "Get an existing 'int' property"); lv_test_assert_int_eq(5, value, "Get the value of an 'int' property"); - found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa); + found = _lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa); lv_test_assert_int_eq(LV_RES_OK, found, "Get an existing 'opa' property"); lv_test_assert_int_eq(LV_OPA_50, opa, "Get the value of an 'opa' property"); - found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr); + found = _lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr); lv_test_assert_int_eq(LV_RES_OK, found, "Get an existing 'ptr' property"); lv_test_assert_ptr_eq(LV_THEME_DEFAULT_FONT_NORMAL, ptr, "Get the value of a 'ptr' property"); - found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); + found = _lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); lv_test_assert_int_eq(LV_RES_OK, found, "Get an existing 'color' property"); lv_test_assert_color_eq(LV_COLOR_RED, color, "Get the value of a 'color' property"); lv_test_print("Reset the the style"); lv_style_reset(&style); - found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); + found = _lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'int' property from a reseted style"); - found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa); + found = _lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa); lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'opa' property from a reseted style"); - found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr); + found = _lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr); lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'ptr' property from a reseted style"); - found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); + found = _lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'color' property from a reseted style"); /*Clean-up*/ - lv_style_list_reset(&style_list); + _lv_style_list_reset(&style_list); } @@ -178,11 +178,11 @@ static void cascade(void) lv_style_t style_first; lv_style_init(&style_first); - lv_style_list_add_style(&style_list, &style_first); + _lv_style_list_add_style(&style_list, &style_first); lv_style_t style_second; lv_style_init(&style_second); - lv_style_list_add_style(&style_list, &style_second); + _lv_style_list_add_style(&style_list, &style_second); lv_res_t found; lv_style_int_t value; @@ -197,19 +197,19 @@ static void cascade(void) _lv_style_set_ptr(&style_first, LV_STYLE_TEXT_FONT, LV_THEME_DEFAULT_FONT_NORMAL); _lv_style_set_color(&style_first, LV_STYLE_BG_COLOR, LV_COLOR_RED); - found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); + found = _lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property"); lv_test_assert_int_eq(5, value, "Get the value of an 'int' property"); - found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa); + found = _lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa); lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'opa' property"); lv_test_assert_int_eq(LV_OPA_50, opa, "Get the value of an 'opa' property"); - found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr); + found = _lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr); lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'ptr' property"); lv_test_assert_ptr_eq(LV_THEME_DEFAULT_FONT_NORMAL, ptr, "Get the value of a 'ptr' property"); - found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); + found = _lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'color' property"); lv_test_assert_color_eq(LV_COLOR_RED, color, "Get the value of a 'color' property"); @@ -220,48 +220,48 @@ static void cascade(void) _lv_style_set_ptr(&style_second, LV_STYLE_TEXT_FONT, LV_THEME_DEFAULT_FONT_NORMAL + 1); _lv_style_set_color(&style_second, LV_STYLE_BG_COLOR, LV_COLOR_BLUE); - found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); + found = _lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); lv_test_assert_int_eq(LV_RES_OK, found, "Get an overwritten 'int' property"); lv_test_assert_int_eq(10, value, "Get the value of an overwritten 'int' property"); - found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa); + found = _lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa); lv_test_assert_int_eq(LV_RES_OK, found, "Get an overwritten 'opa' property"); lv_test_assert_int_eq(LV_OPA_60, opa, "Get the value of an overwritten 'opa' property"); - found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr); + found = _lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr); lv_test_assert_int_eq(LV_RES_OK, found, "Get an overwritten 'ptr' property"); lv_test_assert_ptr_eq(LV_THEME_DEFAULT_FONT_NORMAL + 1, ptr, "Get the value of an overwritten 'ptr' property"); - found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); + found = _lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); lv_test_assert_int_eq(LV_RES_OK, found, "Get an overwritten 'color' property"); lv_test_assert_color_eq(LV_COLOR_BLUE, color, "Get the value of an overwritten 'color' property"); lv_test_print("Overwrite the properties with the local style"); - lv_style_list_set_local_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, 20); - lv_style_list_set_local_opa(&style_list, LV_STYLE_BG_OPA, LV_OPA_70); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT, LV_THEME_DEFAULT_FONT_NORMAL + 2); - lv_style_list_set_local_color(&style_list, LV_STYLE_BG_COLOR, LV_COLOR_LIME); + _lv_style_list_set_local_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, 20); + _lv_style_list_set_local_opa(&style_list, LV_STYLE_BG_OPA, LV_OPA_70); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT, LV_THEME_DEFAULT_FONT_NORMAL + 2); + _lv_style_list_set_local_color(&style_list, LV_STYLE_BG_COLOR, LV_COLOR_LIME); - found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); + found = _lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); lv_test_assert_int_eq(LV_RES_OK, found, "Get a local 'int' property"); lv_test_assert_int_eq(20, value, "Get the value of a local 'int' property"); - found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa); + found = _lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa); lv_test_assert_int_eq(LV_RES_OK, found, "Get a local 'opa' property"); lv_test_assert_int_eq(LV_OPA_70, opa, "Get the value of a local 'opa' property"); - found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr); + found = _lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr); lv_test_assert_int_eq(LV_RES_OK, found, "Get a local 'ptr' property"); lv_test_assert_ptr_eq(LV_THEME_DEFAULT_FONT_NORMAL + 2, ptr, "Get the value of a local'ptr' property"); - found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); + found = _lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); lv_test_assert_int_eq(LV_RES_OK, found, "Get a local 'color' property"); lv_test_assert_color_eq(LV_COLOR_LIME, color, "Get the value of a local'color' property"); /*Clean-up*/ - lv_style_list_reset(&style_list); + _lv_style_list_reset(&style_list); } static void copy(void) @@ -290,24 +290,24 @@ static void copy(void) lv_test_print("Copy a style list"); lv_style_list_t list_src; lv_style_list_init(&list_src); - lv_style_list_add_style(&list_src, &style_src); - lv_style_list_set_local_int(&list_src, LV_STYLE_LINE_DASH_WIDTH, 20); + _lv_style_list_add_style(&list_src, &style_src); + _lv_style_list_set_local_int(&list_src, LV_STYLE_LINE_DASH_WIDTH, 20); lv_style_list_t list_dest; lv_style_list_init(&list_dest); lv_style_list_copy(&list_dest, &list_src); lv_res_t found; - found = lv_style_list_get_int(&list_dest, LV_STYLE_TEXT_LINE_SPACE, &value); + found = _lv_style_list_get_int(&list_dest, LV_STYLE_TEXT_LINE_SPACE, &value); lv_test_assert_int_eq(LV_RES_OK, found, "Get a copied property from a list"); lv_test_assert_int_eq(5, value, "Get the value of a copied property from a list"); - found = lv_style_list_get_int(&list_dest, LV_STYLE_LINE_DASH_WIDTH, &value); + found = _lv_style_list_get_int(&list_dest, LV_STYLE_LINE_DASH_WIDTH, &value); lv_test_assert_int_eq(LV_RES_OK, found, "Get a copied local property from a list"); lv_test_assert_int_eq(20, value, "Get the value of a copied local property from a list"); /*Clean up*/ - lv_style_list_reset(&list_dest); - lv_style_list_reset(&list_src); + _lv_style_list_reset(&list_dest); + _lv_style_list_reset(&list_src); lv_style_reset(&style_dest); lv_style_reset(&style_src); @@ -324,11 +324,11 @@ static void states(void) lv_style_t style_first; lv_style_init(&style_first); - lv_style_list_add_style(&style_list, &style_first); + _lv_style_list_add_style(&style_list, &style_first); lv_style_t style_second; lv_style_init(&style_second); - lv_style_list_add_style(&style_list, &style_second); + _lv_style_list_add_style(&style_list, &style_second); lv_test_print("Test state precedence in 1 style"); _lv_style_set_int(&style_first, LV_STYLE_TEXT_LINE_SPACE, 5); @@ -338,23 +338,23 @@ static void states(void) lv_res_t found; lv_style_int_t value; - found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); + found = _lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value); lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in normal state"); lv_test_assert_int_eq(5, value, "Get the value of an 'int' property in normal state"); - found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | (LV_STATE_CHECKED) << LV_STYLE_STATE_POS, &value); + found = _lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | (LV_STATE_CHECKED) << LV_STYLE_STATE_POS, &value); lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in checked state"); lv_test_assert_int_eq(6, value, "Get the value of an 'int' in checked state"); - found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, &value); + found = _lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, &value); lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in pressed state"); lv_test_assert_int_eq(7, value, "Get the value of an 'int' in pressed state"); - found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | (LV_STATE_HOVERED) << LV_STYLE_STATE_POS, &value); + found = _lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | (LV_STATE_HOVERED) << LV_STYLE_STATE_POS, &value); lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in hover (unspecified) state"); lv_test_assert_int_eq(5, value, "Get the value of an 'int' in hover (unspecified) state"); - found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | (LV_STATE_CHECKED | LV_STATE_PRESSED | LV_STATE_HOVERED) << LV_STYLE_STATE_POS, &value); + found = _lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | (LV_STATE_CHECKED | LV_STATE_PRESSED | LV_STATE_HOVERED) << LV_STYLE_STATE_POS, &value); lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in checked pressed hovered state"); lv_test_assert_int_eq(7, value, "Get the value of an 'int' in checked pressed hovered state"); @@ -364,19 +364,19 @@ static void states(void) lv_opa_t opa; - found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA , &opa); + found = _lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA , &opa); lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'opa' property in normal state"); lv_test_assert_int_eq(LV_OPA_50, opa, "Get the value of an 'int' in normal state"); - found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA | (LV_STATE_CHECKED) << LV_STYLE_STATE_POS, &opa); + found = _lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA | (LV_STATE_CHECKED) << LV_STYLE_STATE_POS, &opa); lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'opa' property in checked (unspecified) state"); lv_test_assert_int_eq(LV_OPA_50, opa, "Get the value of an 'int' in checked (unspecified) state"); - found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA | (LV_STATE_CHECKED | LV_STATE_PRESSED) << LV_STYLE_STATE_POS, &opa); + found = _lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA | (LV_STATE_CHECKED | LV_STATE_PRESSED) << LV_STYLE_STATE_POS, &opa); lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'opa' property in checked pressed state"); lv_test_assert_int_eq(LV_OPA_60, opa, "Get the value of an 'int' in checked pressed state"); - found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA | (LV_STATE_CHECKED | LV_STATE_PRESSED | LV_STATE_HOVERED) << LV_STYLE_STATE_POS, &opa); + found = _lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA | (LV_STATE_CHECKED | LV_STATE_PRESSED | LV_STATE_HOVERED) << LV_STYLE_STATE_POS, &opa); lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'opa' property in checked pressed hovered state"); lv_test_assert_int_eq(LV_OPA_60, opa, "Get the value of an 'int' in checked pressed hovered state"); @@ -389,32 +389,32 @@ static void states(void) lv_color_t color; - found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); + found = _lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color); lv_test_assert_int_eq(LV_RES_OK, found, "Get a 'color' property in normal state"); lv_test_assert_color_eq(LV_COLOR_YELLOW, color, "Get the value of a 'color' property in normal state"); - found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | (LV_STATE_HOVERED) << LV_STYLE_STATE_POS, &color); + found = _lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | (LV_STATE_HOVERED) << LV_STYLE_STATE_POS, &color); lv_test_assert_int_eq(LV_RES_OK, found, "Get a 'color' property in hovered state"); lv_test_assert_color_eq(LV_COLOR_RED, color, "Get the value of a 'color' in hovered state"); - found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | (LV_STATE_CHECKED) << LV_STYLE_STATE_POS, &color); + found = _lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | (LV_STATE_CHECKED) << LV_STYLE_STATE_POS, &color); lv_test_assert_int_eq(LV_RES_OK, found, "Get a 'color' property in checked state"); lv_test_assert_color_eq(LV_COLOR_LIME, color, "Get the value of a 'color' in checked state"); - found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | (LV_STATE_HOVERED | LV_STATE_PRESSED) << LV_STYLE_STATE_POS, &color); + found = _lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | (LV_STATE_HOVERED | LV_STATE_PRESSED) << LV_STYLE_STATE_POS, &color); lv_test_assert_int_eq(LV_RES_OK, found, "Get a 'color' property in hover pressed state"); lv_test_assert_color_eq(LV_COLOR_BLUE, color, "Get the value of a 'color' in hover pressed state"); - found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | (LV_STATE_EDITED) << LV_STYLE_STATE_POS, &color); + found = _lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | (LV_STATE_EDITED) << LV_STYLE_STATE_POS, &color); lv_test_assert_int_eq(LV_RES_OK, found, "Get a 'color' property in edit (unspecified) state"); lv_test_assert_color_eq(LV_COLOR_YELLOW, color, "Get the value of a 'color' in edit (unspecified) state"); - found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | (LV_STATE_CHECKED | LV_STATE_EDITED) << LV_STYLE_STATE_POS, &color); + found = _lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | (LV_STATE_CHECKED | LV_STATE_EDITED) << LV_STYLE_STATE_POS, &color); lv_test_assert_int_eq(LV_RES_OK, found, "Get a 'color' property in checked edit state"); lv_test_assert_color_eq(LV_COLOR_LIME, color, "Get the value of a 'color' in checked edit state"); /*Clean-up*/ - lv_style_list_reset(&style_list); + _lv_style_list_reset(&style_list); } @@ -470,22 +470,22 @@ static void mem_leak(void) lv_test_print("Use local style"); lv_mem_monitor(&mon_start); for(i = 0; i < 100; i++) { - lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, LV_THEME_DEFAULT_FONT_NORMAL); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, LV_THEME_DEFAULT_FONT_NORMAL); - lv_style_list_reset(&style_list); + _lv_style_list_reset(&style_list); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, NULL); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, NULL); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); - lv_style_list_reset(&style_list); + _lv_style_list_reset(&style_list); } - lv_style_list_reset(&style_list); + _lv_style_list_reset(&style_list); lv_test_assert_int_eq(LV_RES_OK, lv_mem_test(), "Memory integrity check"); lv_mem_defrag(); lv_mem_monitor(&mon_end); @@ -499,16 +499,16 @@ static void mem_leak(void) _lv_style_set_color(&style2, LV_STYLE_LINE_COLOR, LV_COLOR_RED); _lv_style_set_color(&style3, LV_STYLE_LINE_COLOR, LV_COLOR_RED); - lv_style_list_add_style(&style_list, &style1); - lv_style_list_remove_style(&style_list, &style1); + _lv_style_list_add_style(&style_list, &style1); + _lv_style_list_remove_style(&style_list, &style1); - lv_style_list_add_style(&style_list, &style2); - lv_style_list_add_style(&style_list, &style3); + _lv_style_list_add_style(&style_list, &style2); + _lv_style_list_add_style(&style_list, &style3); - lv_style_list_remove_style(&style_list, &style2); - lv_style_list_add_style(&style_list, &style1); + _lv_style_list_remove_style(&style_list, &style2); + _lv_style_list_add_style(&style_list, &style1); - lv_style_list_reset(&style_list); + _lv_style_list_reset(&style_list); lv_style_reset(&style1); lv_style_reset(&style2); lv_style_reset(&style3); @@ -526,21 +526,21 @@ static void mem_leak(void) _lv_style_set_color(&style2, LV_STYLE_LINE_COLOR, LV_COLOR_RED); _lv_style_set_color(&style3, LV_STYLE_LINE_COLOR, LV_COLOR_RED); - if(i % 2 == 0) lv_style_list_set_local_color(&style_list, LV_STYLE_LINE_COLOR, LV_COLOR_RED); + if(i % 2 == 0) _lv_style_list_set_local_color(&style_list, LV_STYLE_LINE_COLOR, LV_COLOR_RED); - lv_style_list_add_style(&style_list, &style1); - lv_style_list_remove_style(&style_list, &style1); + _lv_style_list_add_style(&style_list, &style1); + _lv_style_list_remove_style(&style_list, &style1); - lv_style_list_add_style(&style_list, &style2); - lv_style_list_add_style(&style_list, &style3); + _lv_style_list_add_style(&style_list, &style2); + _lv_style_list_add_style(&style_list, &style3); - lv_style_list_remove_style(&style_list, &style2); - lv_style_list_add_style(&style_list, &style1); + _lv_style_list_remove_style(&style_list, &style2); + _lv_style_list_add_style(&style_list, &style1); - if(i % 2 != 0) lv_style_list_set_local_color(&style_list, LV_STYLE_LINE_COLOR, LV_COLOR_RED); + if(i % 2 != 0) _lv_style_list_set_local_color(&style_list, LV_STYLE_LINE_COLOR, LV_COLOR_RED); - lv_style_list_reset(&style_list); + _lv_style_list_reset(&style_list); lv_style_reset(&style1); lv_style_reset(&style2); lv_style_reset(&style3); @@ -559,7 +559,7 @@ static void mem_leak(void) for(i = 0; i < 100; i++) { if(i % 2 == 0) { - lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_CLOSE); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_CLOSE); } _lv_style_set_color(&style1, LV_STYLE_LINE_COLOR, LV_COLOR_RED); @@ -567,14 +567,14 @@ static void mem_leak(void) _lv_style_set_color(&style1, LV_STYLE_LINE_COLOR, LV_COLOR_BLUE); _lv_style_set_color(&style1, LV_STYLE_LINE_COLOR | (LV_STATE_EDITED | LV_STATE_FOCUSED) << LV_STYLE_STATE_POS, LV_COLOR_GREEN); - lv_style_list_add_style(&style_list, &style1); + _lv_style_list_add_style(&style_list, &style1); if(i % 4 == 0) { - lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_CLOSE); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_CLOSE); } - lv_style_list_remove_style(&style_list, &style1); + _lv_style_list_remove_style(&style_list, &style1); _lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_10); _lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_20); @@ -583,17 +583,17 @@ static void mem_leak(void) _lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_50); _lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_60); - lv_style_list_add_style(&style_list, &style2); + _lv_style_list_add_style(&style_list, &style2); if(i % 8 == 0) { - lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_CLOSE); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_CLOSE); } - lv_style_list_add_style(&style_list, &style2); - lv_style_list_add_style(&style_list, &style2); - lv_style_list_add_style(&style_list, &style2); - lv_style_list_add_style(&style_list, &style2); - lv_style_list_remove_style(&style_list, &style2); + _lv_style_list_add_style(&style_list, &style2); + _lv_style_list_add_style(&style_list, &style2); + _lv_style_list_add_style(&style_list, &style2); + _lv_style_list_add_style(&style_list, &style2); + _lv_style_list_remove_style(&style_list, &style2); _lv_style_set_int(&style3, LV_STYLE_PAD_LEFT, 10); _lv_style_set_int(&style3, LV_STYLE_PAD_RIGHT, 20); @@ -604,27 +604,27 @@ static void mem_leak(void) _lv_style_set_int(&style3, LV_STYLE_PAD_LEFT, 12); _lv_style_set_int(&style3, LV_STYLE_PAD_RIGHT, 23); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, LV_THEME_DEFAULT_FONT_NORMAL); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, NULL); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); - lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, LV_THEME_DEFAULT_FONT_NORMAL); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, NULL); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); + _lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK); - lv_style_list_add_style(&style_list, &style3); - lv_style_list_add_style(&style_list, &style2); - lv_style_list_add_style(&style_list, &style1); + _lv_style_list_add_style(&style_list, &style3); + _lv_style_list_add_style(&style_list, &style2); + _lv_style_list_add_style(&style_list, &style1); - lv_style_list_reset(&style_list); + _lv_style_list_reset(&style_list); lv_style_reset(&style1); lv_style_reset(&style2); lv_style_reset(&style3); } - lv_style_list_reset(&style_list); + _lv_style_list_reset(&style_list); lv_style_reset(&style1); lv_style_reset(&style2); lv_style_reset(&style3);