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

Spelling, docs fixing, and cosmetic code fixing (#1944)

* Spelling and docs fixes

* Fix #endif comments

* Fix function declarations (fix param names and remove duplicate)
This commit is contained in:
nazar01 2020-12-02 13:25:15 +03:00 committed by GitHub
parent 2aad9aaebd
commit 568c2ee688
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 110 additions and 111 deletions

View File

@ -856,7 +856,7 @@ menu "LVGL configuration"
bool "Support bidirectional texts"
help
Allows mixing Left-to-Right and Right-to-Left texts.
The direction will be processed according to the Unicode Bidirectioanl Algorithm:
The direction will be processed according to the Unicode Bidirectional Algorithm:
https://www.w3.org/International/articles/inline-bidi-markup/uba-basics
choice

View File

@ -325,9 +325,9 @@ static lv_fs_res_t fs_free (lv_fs_drv_t * drv, uint32_t * total_p, uint32_t * fr
}
/**
* Initialize a 'fs_read_dir_t' variable for directory reading
* Initialize a 'lv_fs_dir_t' variable for directory reading
* @param drv pointer to a driver where this function belongs
* @param rddir_p pointer to a 'fs_read_dir_t' variable
* @param rddir_p pointer to a 'lv_fs_dir_t' variable
* @param path path to a directory
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
*/
@ -344,7 +344,7 @@ static lv_fs_res_t fs_dir_open (lv_fs_drv_t * drv, void * rddir_p, const char *p
* Read the next filename form a directory.
* The name of the directories will begin with '/'
* @param drv pointer to a driver where this function belongs
* @param rddir_p pointer to an initialized 'fs_read_dir_t' variable
* @param rddir_p pointer to an initialized 'lv_fs_dir_t' variable
* @param fn pointer to a buffer to store the filename
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
*/
@ -360,7 +360,7 @@ static lv_fs_res_t fs_dir_read (lv_fs_drv_t * drv, void * rddir_p, char *fn)
/**
* Close the directory reading
* @param drv pointer to a driver where this function belongs
* @param rddir_p pointer to an initialized 'fs_read_dir_t' variable
* @param rddir_p pointer to an initialized 'lv_fs_dir_t' variable
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
*/
static lv_fs_res_t fs_dir_close (lv_fs_drv_t * drv, void * rddir_p)

View File

@ -82,7 +82,7 @@ typedef int16_t lv_coord_t;
/* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
# define LV_MEM_SIZE (32U * 1024U)
/* Complier prefix for a big array declaration */
/* Compiler prefix for a big array declaration */
# define LV_MEM_ATTR
/* Set an address for the memory pool instead of allocating it as an array.
@ -127,7 +127,7 @@ typedef int16_t lv_coord_t;
#define LV_INDEV_DEF_DRAG_THROW 10
/* Long press time in milliseconds.
* Time to send `LV_EVENT_LONG_PRESSSED`) */
* Time to send `LV_EVENT_LONG_PRESSED`) */
#define LV_INDEV_DEF_LONG_PRESS_TIME 400
/* Repeated trigger period in long press [ms]
@ -514,7 +514,7 @@ typedef void * lv_font_user_data_t;
/* Support bidirectional texts.
* Allows mixing Left-to-Right and Right-to-Left texts.
* The direction will be processed according to the Unicode Bidirectioanl Algorithm:
* The direction will be processed according to the Unicode Bidirectional Algorithm:
* https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
#define LV_USE_BIDI 0
#if LV_USE_BIDI

View File

@ -225,4 +225,4 @@ static inline lv_coord_t lv_dpx(lv_coord_t n)
} /* extern "C" */
#endif
#endif /*LV_TEMPL_H*/
#endif /*LV_DISP_H*/

View File

@ -541,7 +541,7 @@ static void indev_keypad_proc(lv_indev_t * i, lv_indev_data_t * data)
lv_group_focus_prev(g);
if(indev_reset_check(&i->proc)) return;
}
/*Just send other keys again to the object (e.g. 'A' or `LV_GORUP_KEY_RIGHT)*/
/*Just send other keys again to the object (e.g. 'A' or `LV_GROUP_KEY_RIGHT)*/
else {
lv_group_send_data(g, data->key);
if(indev_reset_check(&i->proc)) return;
@ -834,7 +834,7 @@ static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data)
}
/**
* Process the pressed state of LV_INDEV_TYPE_POINER input devices
* Process the pressed state of LV_INDEV_TYPE_POINTER input devices
* @param indev pointer to an input device 'proc'
* @return LV_RES_OK: no indev reset required; LV_RES_INV: indev reset is required
*/
@ -1004,7 +1004,7 @@ static void indev_proc_press(lv_indev_proc_t * proc)
}
/**
* Process the released state of LV_INDEV_TYPE_POINER input devices
* Process the released state of LV_INDEV_TYPE_POINTER input devices
* @param proc pointer to an input device 'proc'
*/
static void indev_proc_release(lv_indev_proc_t * proc)

View File

@ -105,7 +105,7 @@ typedef struct {
lv_color_t scale_grad_color;
lv_color_t scale_end_color;
lv_opa_t opa_scale;
uint32_t clip_corder : 1;
uint32_t clip_corner : 1;
uint32_t border_post : 1;
} style_snapshot_t;
@ -590,7 +590,7 @@ bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area)
{
if(lv_obj_get_hidden(obj)) return false;
/*Invalidate the object only if it belongs to the curent or previous'*/
/*Invalidate the object only if it belongs to the current or previous'*/
lv_obj_t * obj_scr = lv_obj_get_screen(obj);
lv_disp_t * disp = lv_obj_get_disp(obj_scr);
if(obj_scr == lv_disp_get_scr_act(disp) ||
@ -1476,7 +1476,7 @@ void lv_obj_report_style_mod(lv_style_t * style)
}
/**
* Enable/disable the use of style cahche for an object
* Enable/disable the use of style cache for an object
* @param obj pointer to an object
* @param dis true: disable; false: enable (re-enable)
*/
@ -4309,7 +4309,7 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop,
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);
bool cahche_ori = style_list->ignore_cache;
bool cache_ori = style_list->ignore_cache;
/*Get the previous and current values*/
if((prop & 0xF) < LV_STYLE_ID_COLOR) { /*Int*/
@ -4320,7 +4320,7 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop,
obj->state = new_state;
lv_style_int_t int2 = _lv_obj_get_style_int(obj, part, prop);
style_list->skip_trans = 0;
style_list->ignore_cache = cahche_ori;
style_list->ignore_cache = cache_ori;
if(int1 == int2) return NULL;
obj->state = prev_state;
@ -4351,7 +4351,7 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop,
obj->state = new_state;
lv_color_t c2 = _lv_obj_get_style_color(obj, part, prop);
style_list->skip_trans = 0;
style_list->ignore_cache = cahche_ori;
style_list->ignore_cache = cache_ori;
if(c1.full == c2.full) return NULL;
obj->state = prev_state;
@ -4373,7 +4373,7 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop,
obj->state = new_state;
lv_opa_t o2 = _lv_obj_get_style_opa(obj, part, prop);
style_list->skip_trans = 0;
style_list->ignore_cache = cahche_ori;
style_list->ignore_cache = cache_ori;
if(o1 == o2) return NULL;
@ -4396,7 +4396,7 @@ static lv_style_trans_t * trans_create(lv_obj_t * obj, lv_style_property_t prop,
obj->state = new_state;
const void * p2 = _lv_obj_get_style_ptr(obj, part, prop);
style_list->skip_trans = 0;
style_list->ignore_cache = cahche_ori;
style_list->ignore_cache = cache_ori;
if(memcmp(&p1, &p2, sizeof(const void *)) == 0) return NULL;
obj->state = prev_state;
@ -4819,7 +4819,7 @@ static void style_snapshot(lv_obj_t * obj, uint8_t part, style_snapshot_t * shot
shot->scale_grad_color = lv_obj_get_style_scale_grad_color(obj, part);
shot->scale_end_color = lv_obj_get_style_scale_end_color(obj, part);
shot->opa_scale = lv_obj_get_style_opa_scale(obj, part);
shot->clip_corder = lv_obj_get_style_clip_corner(obj, part);
shot->clip_corner = lv_obj_get_style_clip_corner(obj, part);
shot->border_post = lv_obj_get_style_border_post(obj, part);
_lv_obj_disable_style_caching(obj, false);

View File

@ -44,7 +44,7 @@ static inline size_t get_prop_size(uint8_t prop_id);
static inline size_t get_next_prop_index(uint8_t prop_id, size_t id);
/**********************
* GLOABAL VARIABLES
* GLOBAL VARIABLES
**********************/
/**********************
@ -340,7 +340,7 @@ uint16_t _lv_style_get_mem_size(const lv_style_t * style)
size_t i = 0;
uint8_t prop_id;
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSEING_PROP) {
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSING_PROP) {
i = get_next_prop_index(prop_id, i);
}
@ -378,7 +378,7 @@ void _lv_style_set_int(lv_style_t * style, lv_style_property_t prop, lv_style_in
/*Add new property if not exists yet*/
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(lv_style_int_t));
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
uint8_t end_mark_size = sizeof(end_mark);
uint16_t size = _lv_style_get_mem_size(style);
@ -424,7 +424,7 @@ void _lv_style_set_color(lv_style_t * style, lv_style_property_t prop, lv_color_
/*Add new property if not exists yet*/
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(lv_color_t));
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
uint8_t end_mark_size = sizeof(end_mark);
uint16_t size = _lv_style_get_mem_size(style);
@ -471,7 +471,7 @@ void _lv_style_set_opa(lv_style_t * style, lv_style_property_t prop, lv_opa_t op
/*Add new property if not exists yet*/
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(lv_opa_t));
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
uint8_t end_mark_size = sizeof(end_mark);
uint16_t size = _lv_style_get_mem_size(style);
@ -518,7 +518,7 @@ void _lv_style_set_ptr(lv_style_t * style, lv_style_property_t prop, const void
/*Add new property if not exists yet*/
uint8_t new_prop_size = (sizeof(lv_style_property_t) + sizeof(const void *));
lv_style_property_t end_mark = _LV_STYLE_CLOSEING_PROP;
lv_style_property_t end_mark = _LV_STYLE_CLOSING_PROP;
uint8_t end_mark_size = sizeof(end_mark);
uint16_t size = _lv_style_get_mem_size(style);
@ -1069,7 +1069,7 @@ LV_ATTRIBUTE_FAST_MEM static inline int32_t get_property_index(const lv_style_t
size_t i = 0;
uint8_t prop_id;
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSEING_PROP) {
while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSING_PROP) {
if(prop_id == id_to_find) {
lv_style_attr_t attr_i;
attr_i = get_style_prop_attr(style, i);

View File

@ -39,7 +39,7 @@ LV_EXPORT_CONST_INT(LV_RADIUS_CIRCLE);
#define LV_STYLE_ATTR_NONE 0
#define LV_STYLE_ATTR_INHERIT (1 << 7)
#define _LV_STYLE_CLOSEING_PROP 0xFF
#define _LV_STYLE_CLOSING_PROP 0xFF
#define LV_STYLE_TRANS_NUM_MAX 6

View File

@ -42,7 +42,7 @@ static void draw_quarter_0(quarter_draw_dsc_t * q);
static void draw_quarter_1(quarter_draw_dsc_t * q);
static void draw_quarter_2(quarter_draw_dsc_t * q);
static void draw_quarter_3(quarter_draw_dsc_t * q);
static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t tickness, lv_area_t * res_area);
static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness, lv_area_t * res_area);
/**********************
@ -386,13 +386,13 @@ static void draw_quarter_3(quarter_draw_dsc_t * q)
}
static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t tickness, lv_area_t * res_area)
static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness, lv_area_t * res_area)
{
const uint8_t ps = 8;
const uint8_t pa = 127;
int32_t thick_half = tickness / 2;
uint8_t thick_corr = (tickness & 0x01) ? 0 : 1;
int32_t thick_half = thickness / 2;
uint8_t thick_corr = (thickness & 0x01) ? 0 : 1;
int32_t cir_x;
int32_t cir_y;

View File

@ -93,4 +93,4 @@ bool lv_img_cf_has_alpha(lv_img_cf_t cf);
} /* extern "C" */
#endif
#endif /*LV_TEMPL_H*/
#endif /*LV_DRAW_IMG_H*/

View File

@ -17,7 +17,7 @@
/*********************
* DEFINES
*********************/
#define SHADOW_UPSACALE_SHIFT 6
#define SHADOW_UPSCALE_SHIFT 6
#define SHADOW_ENHANCE 1
#define SPLIT_LIMIT 50
@ -1029,10 +1029,10 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord
}
else {
int32_t i;
sh_ups_tmp_buf[0] = (mask_line[0] << SHADOW_UPSACALE_SHIFT) / sw;
sh_ups_tmp_buf[0] = (mask_line[0] << SHADOW_UPSCALE_SHIFT) / sw;
for(i = 1; i < size; i++) {
if(mask_line[i] == mask_line[i - 1]) sh_ups_tmp_buf[i] = sh_ups_tmp_buf[i - 1];
else sh_ups_tmp_buf[i] = (mask_line[i] << SHADOW_UPSACALE_SHIFT) / sw;
else sh_ups_tmp_buf[i] = (mask_line[i] << SHADOW_UPSCALE_SHIFT) / sw;
}
}
@ -1044,7 +1044,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord
int32_t i;
lv_opa_t * res_buf = (lv_opa_t *)sh_buf;
for(i = 0; i < size * size; i++) {
res_buf[i] = (sh_buf[i] >> SHADOW_UPSACALE_SHIFT);
res_buf[i] = (sh_buf[i] >> SHADOW_UPSCALE_SHIFT);
}
return;
}
@ -1062,10 +1062,10 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord
sw += sw_ori & 1;
if(sw > 1) {
uint32_t i;
sh_buf[0] = (sh_buf[0] << SHADOW_UPSACALE_SHIFT) / sw;
sh_buf[0] = (sh_buf[0] << SHADOW_UPSCALE_SHIFT) / sw;
for(i = 1; i < (uint32_t) size * size; i++) {
if(sh_buf[i] == sh_buf[i - 1]) sh_buf[i] = sh_buf[i - 1];
else sh_buf[i] = (sh_buf[i] << SHADOW_UPSACALE_SHIFT) / sw;
else sh_buf[i] = (sh_buf[i] << SHADOW_UPSCALE_SHIFT) / sw;
}
shadow_blur_corner(size, sw, sh_buf);
@ -1125,7 +1125,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t
sh_ups_tmp_buf = &sh_ups_buf[x];
int32_t v = sh_ups_tmp_buf[0] * sw;
for(y = 0; y < size ; y++, sh_ups_tmp_buf += size) {
sh_ups_blur_buf[y] = v < 0 ? 0 : (v >> SHADOW_UPSACALE_SHIFT);
sh_ups_blur_buf[y] = v < 0 ? 0 : (v >> SHADOW_UPSCALE_SHIFT);
/*Forget the top pixel*/
uint32_t top_val;

View File

@ -423,14 +423,14 @@ void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc)
dsc->tmp.pivot_y_256 = dsc->cfg.pivot_y * 256;
int32_t angle_low = dsc->cfg.angle / 10;
int32_t angle_hight = angle_low + 1;
int32_t angle_high = 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 s2 = _lv_trigo_sin(-angle_high);
int32_t c1 = _lv_trigo_sin(-angle_low + 90);
int32_t c2 = _lv_trigo_sin(-angle_hight + 90);
int32_t c2 = _lv_trigo_sin(-angle_high + 90);
dsc->tmp.sinma = (s1 * (10 - angle_rem) + s2 * angle_rem) / 10;
dsc->tmp.cosma = (c1 * (10 - angle_rem) + c2 * angle_rem) / 10;
@ -500,14 +500,14 @@ void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t
}
int32_t angle_low = angle / 10;
int32_t angle_hight = angle_low + 1;
int32_t angle_high = 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 s2 = _lv_trigo_sin(angle_high);
int32_t c1 = _lv_trigo_sin(angle_low + 90);
int32_t c2 = _lv_trigo_sin(angle_hight + 90);
int32_t c2 = _lv_trigo_sin(angle_high + 90);
int32_t sinma = (s1 * (10 - angle_rem) + s2 * angle_rem) / 10;
int32_t cosma = (c1 * (10 - angle_rem) + c2 * angle_rem) / 10;

View File

@ -3,8 +3,8 @@
*
*/
#ifndef LV_IMG_DEOCER_H
#define LV_IMG_DEOCER_H
#ifndef LV_IMG_DECODER_H
#define LV_IMG_DECODER_H
#ifdef __cplusplus
extern "C" {
@ -267,4 +267,4 @@ void lv_img_decoder_built_in_close(lv_img_decoder_t * decoder, lv_img_decoder_ds
} /* extern "C" */
#endif
#endif /*LV_TEMPL_H*/
#endif /*LV_IMG_DECODER_H*/

View File

@ -67,7 +67,7 @@ extern "C" {
#endif
#ifndef LV_GPU_NXP_VG_LITE_LOG_ERRORS
/** Enable logging of VG-Lite erors (\see LV_LOG_ERROR) */
/** Enable logging of VG-Lite errors (\see LV_LOG_ERROR) */
#define LV_GPU_NXP_VG_LITE_LOG_ERRORS 1
#endif

View File

@ -150,9 +150,9 @@ bool _lv_indev_read(lv_indev_t * indev, lv_indev_data_t * data)
}
if(indev->driver.read_cb) {
LV_LOG_TRACE("idnev read started");
LV_LOG_TRACE("indev read started");
cont = indev->driver.read_cb(&indev->driver, data);
LV_LOG_TRACE("idnev read finished");
LV_LOG_TRACE("indev read finished");
}
else {
LV_LOG_WARN("indev function registered");

View File

@ -59,4 +59,4 @@ lv_res_t lv_async_call(lv_async_cb_t async_xcb, void * user_data);
} /* extern "C" */
#endif
#endif /*LV_TEMPL_H*/
#endif /*LV_ASYNC_H*/

View File

@ -1,5 +1,5 @@
/**
* @file lv_bifi.h
* @file lv_bidi.h
*
*/

View File

@ -348,8 +348,8 @@ lv_fs_res_t lv_fs_rename(const char * oldname, const char * newname)
}
/**
* Initialize a 'fs_read_dir_t' variable for directory reading
* @param rddir_p pointer to a 'fs_read_dir_t' variable
* Initialize a 'lv_fs_dir_t' variable for directory reading
* @param rddir_p pointer to a 'lv_fs_dir_t' variable
* @param path path to a directory
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
*/
@ -387,7 +387,7 @@ lv_fs_res_t lv_fs_dir_open(lv_fs_dir_t * rddir_p, const char * path)
/**
* Read the next filename form a directory.
* The name of the directories will begin with '/'
* @param rddir_p pointer to an initialized 'fs_read_dir_t' variable
* @param rddir_p pointer to an initialized 'lv_fs_dir_t' variable
* @param fn pointer to a buffer to store the filename
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
*/
@ -409,7 +409,7 @@ lv_fs_res_t lv_fs_dir_read(lv_fs_dir_t * rddir_p, char * fn)
/**
* Close the directory reading
* @param rddir_p pointer to an initialized 'fs_read_dir_t' variable
* @param rddir_p pointer to an initialized 'lv_fs_dir_t' variable
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
*/
lv_fs_res_t lv_fs_dir_close(lv_fs_dir_t * rddir_p)

View File

@ -221,7 +221,7 @@ lv_fs_res_t lv_fs_rename(const char * oldname, const char * newname);
/**
* Initialize a 'fs_dir_t' variable for directory reading
* @param rddir_p pointer to a 'fs_read_dir_t' variable
* @param rddir_p pointer to a 'lv_fs_dir_t' variable
* @param path path to a directory
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
*/
@ -230,7 +230,7 @@ lv_fs_res_t lv_fs_dir_open(lv_fs_dir_t * rddir_p, const char * path);
/**
* Read the next filename form a directory.
* The name of the directories will begin with '/'
* @param rddir_p pointer to an initialized 'fs_rdir_t' variable
* @param rddir_p pointer to an initialized 'fs_dir_t' variable
* @param fn pointer to a buffer to store the filename
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
*/

View File

@ -391,7 +391,7 @@ lv_coord_t _lv_txt_get_width(const char * txt, uint32_t length, const lv_font_t
/**
* Check next character in a string and decide if the character is part of the command or not
* @param state pointer to a txt_cmd_state_t variable which stores the current state of command
* processing (Initied. to TXT_CMD_STATE_WAIT )
* processing (Inited to TXT_CMD_STATE_WAIT )
* @param c the current character
* @return true: the character is part of a command and should not be written,
* false: the character should be written
@ -525,7 +525,7 @@ char * _lv_txt_set_text_vfmt(const char * fmt, va_list ap)
#if LV_TXT_ENC == LV_TXT_ENC_UTF8
/*******************************
* UTF-8 ENCODER/DECOER
* UTF-8 ENCODER/DECODER
******************************/
/**

View File

@ -136,7 +136,7 @@ void _lv_txt_cut(char * txt, uint32_t pos, uint32_t len);
char * _lv_txt_set_text_vfmt(const char * fmt, va_list ap);
/***************************************************************
* GLOBAL FUNCTION POINTERS FOR CAHRACTER ENCODING INTERFACE
* GLOBAL FUNCTION POINTERS FOR CHARACTER ENCODING INTERFACE
***************************************************************/
/**

View File

@ -337,7 +337,7 @@ static void clear_styles(lv_obj_t * obj, lv_theme_style_t name)
#if LV_USE_TABVIEW
case LV_THEME_TABVIEW:
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG);
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG_SCRLLABLE);
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG_SCROLLABLE);
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_TAB_BG);
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_INDIC);
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_TAB_BTN);

View File

@ -618,7 +618,7 @@ void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG);
_lv_style_list_add_style(list, &styles->bg);
list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG_SCRLLABLE);
list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG_SCROLLABLE);
_lv_style_list_add_style(list, &styles->bg);
_lv_style_list_add_style(list, &styles->color);

View File

@ -157,7 +157,7 @@ lv_chart_series_t * lv_chart_add_series(lv_obj_t * chart, lv_color_t color);
* Add a cursor with a given color
* @param chart pointer to chart object
* @param color color of the cursor
* @param dir direction of the cursor. `LV_CHART_CURSOR_RIGHT/LEFT/TOP/DOWN`. OR-ed vaéues are possible
* @param dir direction of the cursor. `LV_CHART_CURSOR_RIGHT/LEFT/TOP/DOWN`. OR-ed values are possible
* @return pointer to the created cursor
*/
lv_chart_cursor_t * lv_chart_add_cursor(lv_obj_t * chart, lv_color_t color, lv_cursor_direction_t dir);

View File

@ -33,7 +33,7 @@ enum {
LV_LAYOUT_CENTER, /**< Center objects */
/**
* COULMN:
* COLUMN:
* - Place the object below each other
* - Keep `pad_top` space on the top
* - Keep `pad_inner` space between the objects

View File

@ -45,7 +45,7 @@ typedef struct {
* STATIC PROTOTYPES
**********************/
static lv_design_res_t lv_dropdown_design(lv_obj_t * ddlist, const lv_area_t * clip_area, lv_design_mode_t mode);
static lv_design_res_t lv_dropdown_page_design(lv_obj_t * ddlist, const lv_area_t * clip_area, lv_design_mode_t mode);
static lv_design_res_t lv_dropdown_page_design(lv_obj_t * page, const lv_area_t * clip_area, lv_design_mode_t mode);
static lv_res_t lv_dropdown_signal(lv_obj_t * ddlist, lv_signal_t sign, void * param);
static lv_res_t lv_dropdown_page_signal(lv_obj_t * page, lv_signal_t sign, void * param);
static lv_res_t lv_dropdown_page_scrl_signal(lv_obj_t * scrl, lv_signal_t sign, void * param);

View File

@ -681,16 +681,16 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area
if(zoomed_src_w <= 0) return LV_DESIGN_RES_OK;
lv_coord_t zoomed_src_h = (int32_t)((int32_t)ext->h * zoom_final) >> 8;
if(zoomed_src_h <= 0) return LV_DESIGN_RES_OK;
lv_area_t zommed_coords;
lv_obj_get_coords(img, &zommed_coords);
lv_area_t zoomed_coords;
lv_obj_get_coords(img, &zoomed_coords);
zommed_coords.x1 += (int32_t)((int32_t)ext->offset.x * zoom_final) >> 8;
zommed_coords.y1 += (int32_t)((int32_t)ext->offset.y * zoom_final) >> 8;
zommed_coords.x2 = zommed_coords.x1 + ((int32_t)((int32_t)(obj_w - 1) * zoom_final) >> 8);
zommed_coords.y2 = zommed_coords.y1 + ((int32_t)((int32_t)(obj_h - 1) * zoom_final) >> 8);
zoomed_coords.x1 += (int32_t)((int32_t)ext->offset.x * zoom_final) >> 8;
zoomed_coords.y1 += (int32_t)((int32_t)ext->offset.y * zoom_final) >> 8;
zoomed_coords.x2 = zoomed_coords.x1 + ((int32_t)((int32_t)(obj_w - 1) * zoom_final) >> 8);
zoomed_coords.y2 = zoomed_coords.y1 + ((int32_t)((int32_t)(obj_h - 1) * zoom_final) >> 8);
if(zommed_coords.x1 > img->coords.x1) zommed_coords.x1 -= ext->w;
if(zommed_coords.y1 > img->coords.y1) zommed_coords.y1 -= ext->h;
if(zoomed_coords.x1 > img->coords.x1) zoomed_coords.x1 -= ext->w;
if(zoomed_coords.y1 > img->coords.y1) zoomed_coords.y1 -= ext->h;
lv_area_t clip_real;
_lv_img_buf_get_transformed_area(&clip_real, lv_obj_get_width(img), lv_obj_get_height(img), angle_final, zoom_final,
@ -703,13 +703,13 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area
if(_lv_area_intersect(&clip_real, &clip_real, clip_area) == false) return LV_DESIGN_RES_OK;
lv_area_t coords_tmp;
coords_tmp.y1 = zommed_coords.y1;
coords_tmp.y2 = zommed_coords.y1 + ext->h - 1;
coords_tmp.y1 = zoomed_coords.y1;
coords_tmp.y2 = zoomed_coords.y1 + ext->h - 1;
for(; coords_tmp.y1 < zommed_coords.y2; coords_tmp.y1 += zoomed_src_h, coords_tmp.y2 += zoomed_src_h) {
coords_tmp.x1 = zommed_coords.x1;
coords_tmp.x2 = zommed_coords.x1 + ext->w - 1;
for(; coords_tmp.x1 < zommed_coords.x2; coords_tmp.x1 += zoomed_src_w, coords_tmp.x2 += zoomed_src_w) {
for(; coords_tmp.y1 < zoomed_coords.y2; coords_tmp.y1 += zoomed_src_h, coords_tmp.y2 += zoomed_src_h) {
coords_tmp.x1 = zoomed_coords.x1;
coords_tmp.x2 = zoomed_coords.x1 + ext->w - 1;
for(; coords_tmp.x1 < zoomed_coords.x2; coords_tmp.x1 += zoomed_src_w, coords_tmp.x2 += zoomed_src_w) {
lv_draw_img(&coords_tmp, &clip_real, ext->src, &img_dsc);
}
}

View File

@ -532,7 +532,7 @@ static void refr_img(lv_obj_t * imgbtn)
}
/**
* If `src` is not defined for the current state try to get a state which is related to the curent but has `src`.
* If `src` is not defined for the current state try to get a state which is related to the current but has `src`.
* E.g. if the PRESSED src is not set but the RELEASED does, use the RELEASED.
* @param imgbtn pointer to an image button
* @param state the state to convert

View File

@ -370,11 +370,11 @@ void lv_label_set_recolor(lv_obj_t * label, bool en)
ext->recolor = en == false ? 0 : 1;
lv_label_refr_text(label); /*Refresh the text because the potential color codes in text needs to
be hided or revealed*/
be hidden or revealed*/
}
/**
* Set the label's animation speed in LV_LABEL_LONG_SROLL/SCROLL_CIRC modes
* Set the label's animation speed in LV_LABEL_LONG_SROLL/SROLL_CIRC modes
* @param label pointer to a label object
* @param anim_speed speed of animation in px/sec unit
*/
@ -1286,7 +1286,7 @@ static lv_design_res_t lv_label_design(lv_obj_t * label, const lv_area_t * clip_
label_draw_dsc.flag = flag;
lv_obj_init_draw_label_dsc(label, LV_LABEL_PART_MAIN, &label_draw_dsc);
/* In SCROLL and SCROLL_CIRC mode the CENTER and RIGHT are pointless so remove them.
/* In SROLL and SROLL_CIRC mode the CENTER and RIGHT are pointless so remove them.
* (In addition they will result misalignment is this case)*/
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)) {

View File

@ -167,7 +167,7 @@ void lv_label_set_align(lv_obj_t * label, lv_label_align_t align);
void lv_label_set_recolor(lv_obj_t * label, bool en);
/**
* Set the label's animation speed in LV_LABEL_LONG_SROLL/SCROLL_CIRC modes
* Set the label's animation speed in LV_LABEL_LONG_SROLL/SROLL_CIRC modes
* @param label pointer to a label object
* @param anim_speed speed of animation in px/sec unit
*/

View File

@ -294,7 +294,7 @@ void lv_list_down(const lv_obj_t * list);
/**
* Focus on a list button. It ensures that the button will be visible on the list.
* @param btn pointer to a list button to focus
* @param anim LV_ANOM_ON: scroll with animation, LV_ANIM_OFF: without animation
* @param anim LV_ANIM_ON: scroll with animation, LV_ANIM_OFF: without animation
*/
void lv_list_focus(const lv_obj_t * btn, lv_anim_enable_t anim);

View File

@ -99,7 +99,7 @@ void lv_roller_set_align(lv_obj_t * roller, lv_label_align_t align);
* Set the selected option
* @param roller pointer to a roller object
* @param sel_opt id of the selected option (0 ... number of option - 1);
* @param anim LV_ANOM_ON: set with animation; LV_ANIM_OFF set immediately
* @param anim LV_ANIM_ON: set with animation; LV_ANIM_OFF set immediately
*/
void lv_roller_set_selected(lv_obj_t * roller, uint16_t sel_opt, lv_anim_enable_t anim);

View File

@ -37,7 +37,6 @@
static lv_res_t lv_switch_signal(lv_obj_t * sw, lv_signal_t sign, void * param);
static lv_design_res_t lv_switch_design(lv_obj_t * sw, const lv_area_t * clip_area, lv_design_mode_t mode);
static lv_style_list_t * lv_switch_get_style(lv_obj_t * sw, uint8_t part);
static lv_style_list_t * lv_switch_get_style(lv_obj_t * sw, uint8_t part);
/**********************
* STATIC VARIABLES
@ -117,7 +116,7 @@ lv_obj_t * lv_switch_create(lv_obj_t * par, const lv_obj_t * copy)
/**
* Turn ON the switch
* @param sw pointer to a switch object
* @param anim LV_ANOM_ON: set the value with an animation; LV_ANIM_OFF: change the value immediately
* @param anim LV_ANIM_ON: set the value with an animation; LV_ANIM_OFF: change the value immediately
*/
void lv_switch_on(lv_obj_t * sw, lv_anim_enable_t anim)
{

View File

@ -165,8 +165,8 @@ lv_obj_t * lv_tabview_create(lv_obj_t * par, const lv_obj_t * copy)
ext->tab_name_ptr[0] = "";
lv_btnmatrix_set_map(ext->btns, ext->tab_name_ptr);
lv_style_list_copy(lv_obj_get_style_list(tabview, LV_TABVIEW_PART_BG_SCRLLABLE), lv_obj_get_style_list(copy,
LV_TABVIEW_PART_BG_SCRLLABLE));
lv_style_list_copy(lv_obj_get_style_list(tabview, LV_TABVIEW_PART_BG_SCROLLABLE), lv_obj_get_style_list(copy,
LV_TABVIEW_PART_BG_SCROLLABLE));
lv_style_list_copy(lv_obj_get_style_list(tabview, LV_TABVIEW_PART_TAB_BG), lv_obj_get_style_list(copy,
LV_TABVIEW_PART_TAB_BG));
lv_style_list_copy(lv_obj_get_style_list(tabview, LV_TABVIEW_PART_TAB_BTN), lv_obj_get_style_list(copy,
@ -615,7 +615,7 @@ static lv_res_t lv_tabview_signal(lv_obj_t * tabview, lv_signal_t sign, void * p
if(info->part == LV_TABVIEW_PART_TAB_BG) info->result = lv_obj_get_state(ext->btns, LV_BTNMATRIX_PART_BG);
else if(info->part == LV_TABVIEW_PART_TAB_BTN) info->result = lv_obj_get_state(ext->btns, LV_BTNMATRIX_PART_BTN);
else if(info->part == LV_TABVIEW_PART_INDIC) info->result = lv_obj_get_state(ext->indic, LV_OBJ_PART_MAIN);
else if(info->part == LV_TABVIEW_PART_BG_SCRLLABLE) info->result = lv_obj_get_state(ext->content,
else if(info->part == LV_TABVIEW_PART_BG_SCROLLABLE) info->result = lv_obj_get_state(ext->content,
LV_PAGE_PART_SCROLLABLE);
return LV_RES_OK;
}
@ -791,7 +791,7 @@ static lv_style_list_t * lv_tabview_get_style(lv_obj_t * tabview, uint8_t part)
case LV_TABVIEW_PART_BG:
style_dsc_p = &tabview->style_list;
break;
case LV_TABVIEW_PART_BG_SCRLLABLE:
case LV_TABVIEW_PART_BG_SCROLLABLE:
style_dsc_p = lv_obj_get_style_list(ext->content, LV_PAGE_PART_SCROLLABLE);
break;
case LV_TABVIEW_PART_TAB_BG:
@ -985,8 +985,8 @@ static void refr_content_size(lv_obj_t * tabview)
lv_obj_set_size(ext->content, cont_w, cont_h);
/*Refresh the size of the tab pages too. `ext->content` has a layout to align the pages*/
lv_style_int_t bg_top = lv_obj_get_style_pad_top(tabview, LV_TABVIEW_PART_BG_SCRLLABLE);
lv_style_int_t bg_bottom = lv_obj_get_style_pad_bottom(tabview, LV_TABVIEW_PART_BG_SCRLLABLE);
lv_style_int_t bg_top = lv_obj_get_style_pad_top(tabview, LV_TABVIEW_PART_BG_SCROLLABLE);
lv_style_int_t bg_bottom = lv_obj_get_style_pad_bottom(tabview, LV_TABVIEW_PART_BG_SCROLLABLE);
cont_h -= bg_top + bg_bottom;
lv_obj_t * content_scrl = lv_page_get_scrollable(ext->content);
lv_obj_t * pages = lv_obj_get_child(content_scrl, NULL);

View File

@ -69,7 +69,7 @@ enum {
LV_TABVIEW_PART_BG = LV_OBJ_PART_MAIN,
_LV_TABVIEW_PART_VIRTUAL_LAST = _LV_OBJ_PART_VIRTUAL_LAST,
LV_TABVIEW_PART_BG_SCRLLABLE = _LV_OBJ_PART_REAL_LAST,
LV_TABVIEW_PART_BG_SCROLLABLE = _LV_OBJ_PART_REAL_LAST,
LV_TABVIEW_PART_TAB_BG,
LV_TABVIEW_PART_TAB_BTN,
LV_TABVIEW_PART_INDIC,

View File

@ -110,7 +110,7 @@ lv_obj_t * lv_textarea_create(lv_obj_t * par, const lv_obj_t * copy)
ext->pwd_mode = 0;
ext->pwd_tmp = NULL;
ext->pwd_show_time = LV_TEXTAREA_DEF_PWD_SHOW_TIME;
ext->accapted_chars = NULL;
ext->accepted_chars = NULL;
ext->max_length = 0;
ext->cursor.state = 1;
ext->cursor.hidden = 0;
@ -161,7 +161,7 @@ lv_obj_t * lv_textarea_create(lv_obj_t * par, const lv_obj_t * copy)
lv_textarea_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
ext->label = lv_label_create(ta, copy_ext->label);
ext->pwd_mode = copy_ext->pwd_mode;
ext->accapted_chars = copy_ext->accapted_chars;
ext->accepted_chars = copy_ext->accepted_chars;
ext->max_length = copy_ext->max_length;
ext->cursor.pos = copy_ext->cursor.pos;
ext->cursor.valid_x = copy_ext->cursor.valid_x;
@ -828,7 +828,7 @@ void lv_textarea_set_accepted_chars(lv_obj_t * ta, const char * list)
lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta);
ext->accapted_chars = list;
ext->accepted_chars = list;
}
/**
@ -1070,7 +1070,7 @@ const char * lv_textarea_get_accepted_chars(lv_obj_t * ta)
lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta);
return ext->accapted_chars;
return ext->accepted_chars;
}
/**
@ -1685,7 +1685,7 @@ static bool char_is_accepted(lv_obj_t * ta, uint32_t c)
lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta);
/*If no restriction accept it*/
if(ext->accapted_chars == NULL && ext->max_length == 0) return true;
if(ext->accepted_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) {
@ -1693,11 +1693,11 @@ static bool char_is_accepted(lv_obj_t * ta, uint32_t c)
}
/*Accepted character?*/
if(ext->accapted_chars) {
if(ext->accepted_chars) {
uint32_t i = 0;
while(ext->accapted_chars[i] != '\0') {
uint32_t a = _lv_txt_encoded_next(ext->accapted_chars, &i);
while(ext->accepted_chars[i] != '\0') {
uint32_t a = _lv_txt_encoded_next(ext->accepted_chars, &i);
if(a == c) return true; /*Accepted*/
}

View File

@ -49,7 +49,7 @@ typedef struct {
char * placeholder_txt; /*Place holder label. only visible if text is an empty string*/
lv_style_list_t style_placeholder;
char * pwd_tmp; /*Used to store the original text in password mode*/
const char * accapted_chars; /*Only these characters will be accepted. NULL: accept all*/
const char * accepted_chars; /*Only these characters will be accepted. NULL: accept all*/
uint32_t max_length; /*The max. number of characters. 0: no limit*/
uint16_t pwd_show_time; /*Time to show characters in password mode before change them to '*' */
struct {

View File

@ -47,7 +47,7 @@ static lv_design_res_t lv_win_header_design(lv_obj_t * header, const lv_area_t *
static lv_style_list_t * lv_win_get_style(lv_obj_t * win, uint8_t part);
static void lv_win_realign(lv_obj_t * win);
static lv_obj_t * lv_win_btn_create(lv_obj_t * par, const void * img_src);
static void lv_win_btn_set_alignment(lv_obj_t * par, const lv_win_btn_align_t alignment);
static void lv_win_btn_set_alignment(lv_obj_t * win_btn, const lv_win_btn_align_t alignment);
static lv_win_btn_align_t lv_win_btn_get_alignment(const lv_obj_t * par);
/**********************
@ -232,7 +232,7 @@ lv_obj_t * lv_win_add_btn_left(lv_obj_t * win, const void * img_src)
/**
* Can be assigned to a window control button to close the window
* @param btn pointer to the control button on the widows header
* @param evet the event type
* @param event the event type
*/
void lv_win_close_event_cb(lv_obj_t * btn, lv_event_t event)
{

View File

@ -114,7 +114,7 @@ lv_obj_t * lv_win_add_btn_left(lv_obj_t * win, const void * img_src);
/**
* Can be assigned to a window control button to close the window
* @param btn pointer to the control button on the widows header
* @param evet the event type
* @param event the event type
*/
void lv_win_close_event_cb(lv_obj_t * btn, lv_event_t event);