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

chore: update some code and docs to use v9 API (#5876)

Co-authored-by: Neo Xu <neo.xu1990@gmail.com>
This commit is contained in:
zylalx1 2024-04-10 15:17:44 +08:00 committed by GitHub
parent 0143320f1f
commit 47ec2784d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
54 changed files with 115 additions and 117 deletions

View File

@ -40,7 +40,7 @@ static void memory_monitor(lv_timer_t * param);
/**********************
* STATIC VARIABLES
**********************/
static lv_disp_t * disp1;
static lv_display_t * disp1;
int monitor_hor_res, monitor_ver_res;
@ -77,9 +77,9 @@ int main(int argc, char ** argv)
void do_loop(void *arg)
{
/* Periodically call the lv_task handler.
/* Periodically call the lv_timer handler.
* It could be done in a timer interrupt or an OS task too.*/
lv_task_handler();
lv_timer_handler();
}
/**********************
@ -92,7 +92,7 @@ void do_loop(void *arg)
*/
static void hal_init(void)
{
lv_disp_t * disp = lv_sdl_window_create(monitor_hor_res, monitor_ver_res);
lv_display_t * disp = lv_sdl_window_create(monitor_hor_res, monitor_ver_res);
lv_group_t * g = lv_group_create();
lv_group_set_default(g);

View File

@ -71,9 +71,9 @@ For example:
#include "demos/lv_demos.h"
...
static lv_disp_t* hal_init(void)
static lv_display_t* hal_init(void)
{
lv_disp_t* disp = NULL;
lv_display_t* disp = NULL;
...
/* TODO: init display and indev */
@ -86,7 +86,7 @@ int main(int argc, char ** argv)
{
lv_init();
lv_disp_t* disp = hal_init();
lv_display_t* disp = hal_init();
if (disp == NULL) {
LV_LOG_ERROR("lv_demos initialization failure!");
return 1;

View File

@ -77,9 +77,9 @@ static void empty_screen_cb(void)
static void moving_wallpaper_cb(void)
{
lv_obj_set_style_pad_all(lv_screen_active(), 0, 0);
LV_IMG_DECLARE(img_benchmark_cogwheel_rgb);
LV_IMAGE_DECLARE(img_benchmark_cogwheel_rgb);
lv_obj_t * img = lv_img_create(lv_screen_active());
lv_obj_t * img = lv_image_create(lv_screen_active());
lv_obj_set_size(img, lv_pct(150), lv_pct(150));
lv_image_set_src(img, &img_benchmark_cogwheel_rgb);
lv_image_set_inner_align(img, LV_IMAGE_ALIGN_TILE);
@ -120,7 +120,7 @@ static void multiple_rgb_images_cb(void)
lv_obj_set_flex_align(lv_screen_active(), LV_FLEX_ALIGN_SPACE_EVENLY, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
lv_obj_set_style_pad_row(lv_screen_active(), 20, 0);
LV_IMG_DECLARE(img_benchmark_cogwheel_rgb);
LV_IMAGE_DECLARE(img_benchmark_cogwheel_rgb);
int32_t hor_cnt = ((int32_t)lv_display_get_horizontal_resolution(NULL) - 16) / 116;
int32_t ver_cnt = ((int32_t)lv_display_get_vertical_resolution(NULL) - 116) / 116;
@ -131,7 +131,7 @@ static void multiple_rgb_images_cb(void)
for(y = 0; y < ver_cnt; y++) {
int32_t x;
for(x = 0; x < hor_cnt; x++) {
lv_obj_t * obj = lv_img_create(lv_screen_active());
lv_obj_t * obj = lv_image_create(lv_screen_active());
lv_image_set_src(obj, &img_benchmark_cogwheel_rgb);
if(x == 0) lv_obj_add_flag(obj, LV_OBJ_FLAG_FLEX_IN_NEW_TRACK);
@ -146,7 +146,7 @@ static void multiple_argb_images_cb(void)
lv_obj_set_flex_align(lv_screen_active(), LV_FLEX_ALIGN_SPACE_EVENLY, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
lv_obj_set_style_pad_row(lv_screen_active(), 20, 0);
LV_IMG_DECLARE(img_benchmark_cogwheel_argb);
LV_IMAGE_DECLARE(img_benchmark_cogwheel_argb);
int32_t hor_cnt = ((int32_t)lv_display_get_horizontal_resolution(NULL) - 16) / 116;
int32_t ver_cnt = ((int32_t)lv_display_get_vertical_resolution(NULL) - 116) / 116;
@ -157,7 +157,7 @@ static void multiple_argb_images_cb(void)
for(y = 0; y < ver_cnt; y++) {
int32_t x;
for(x = 0; x < hor_cnt; x++) {
lv_obj_t * obj = lv_img_create(lv_screen_active());
lv_obj_t * obj = lv_image_create(lv_screen_active());
lv_image_set_src(obj, &img_benchmark_cogwheel_argb);
if(x == 0) lv_obj_add_flag(obj, LV_OBJ_FLAG_FLEX_IN_NEW_TRACK);
@ -172,7 +172,7 @@ static void rotated_argb_image_cb(void)
lv_obj_set_flex_align(lv_screen_active(), LV_FLEX_ALIGN_SPACE_EVENLY, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
lv_obj_set_style_pad_row(lv_screen_active(), 20, 0);
LV_IMG_DECLARE(img_benchmark_cogwheel_argb);
LV_IMAGE_DECLARE(img_benchmark_cogwheel_argb);
int32_t hor_cnt = ((int32_t)lv_display_get_horizontal_resolution(NULL) - 16) / 116;
int32_t ver_cnt = ((int32_t)lv_display_get_vertical_resolution(NULL) - 116) / 116;
@ -183,7 +183,7 @@ static void rotated_argb_image_cb(void)
for(y = 0; y < ver_cnt; y++) {
int32_t x;
for(x = 0; x < hor_cnt; x++) {
lv_obj_t * obj = lv_img_create(lv_screen_active());
lv_obj_t * obj = lv_image_create(lv_screen_active());
lv_image_set_src(obj, &img_benchmark_cogwheel_argb);
if(x == 0) lv_obj_add_flag(obj, LV_OBJ_FLAG_FLEX_IN_NEW_TRACK);
@ -241,7 +241,7 @@ static void multiple_arcs_cb(void)
lv_obj_set_flex_flow(lv_screen_active(), LV_FLEX_FLOW_ROW_WRAP);
lv_obj_set_flex_align(lv_screen_active(), LV_FLEX_ALIGN_SPACE_EVENLY, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
LV_IMG_DECLARE(img_benchmark_cogwheel_argb);
LV_IMAGE_DECLARE(img_benchmark_cogwheel_argb);
int32_t hor_cnt = (lv_display_get_horizontal_resolution(NULL) - 16) / lv_dpx(160);
int32_t ver_cnt = (lv_display_get_vertical_resolution(NULL) - 16) / lv_dpx(160);
@ -761,7 +761,7 @@ static lv_obj_t * card_create(void)
lv_obj_set_size(panel, 270, 120);
lv_obj_set_style_pad_all(panel, 8, 0);
LV_IMG_DECLARE(img_transform_avatar_15);
LV_IMAGE_DECLARE(img_transform_avatar_15);
lv_obj_t * child = lv_image_create(panel);
lv_obj_align(child, LV_ALIGN_LEFT_MID, 0, 0);
lv_image_set_src(child, &img_transform_avatar_15);

View File

@ -184,7 +184,7 @@ const LV_ATTRIBUTE_MEM_ALIGN uint8_t img_lv_demo_music_cover_1_map[] = {
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
};
lv_img_dsc_t img_lv_demo_music_cover_1 = {
const lv_image_dsc_t img_lv_demo_music_cover_1 = {
.header.w = 176,
.header.h = 175,
.header.cf = LV_COLOR_FORMAT_ARGB8888,

View File

@ -445,7 +445,7 @@ img_lv_demo_music_cover_1_map[] = {
};
const lv_img_dsc_t img_lv_demo_music_cover_1 = {
const lv_image_dsc_t img_lv_demo_music_cover_1 = {
.header.w = 428,
.header.h = 428,
.header.cf = LV_COLOR_FORMAT_ARGB8888,

View File

@ -185,7 +185,7 @@ const LV_ATTRIBUTE_MEM_ALIGN uint8_t img_lv_demo_music_cover_2_map[] = {
};
lv_img_dsc_t img_lv_demo_music_cover_2 = {
const lv_image_dsc_t img_lv_demo_music_cover_2 = {
.header.w = 176,
.header.h = 175,
.header.cf = LV_COLOR_FORMAT_ARGB8888,

View File

@ -445,7 +445,7 @@ img_lv_demo_music_cover_2_map[] = {
};
const lv_img_dsc_t img_lv_demo_music_cover_2 = {
const lv_image_dsc_t img_lv_demo_music_cover_2 = {
.header.w = 428,
.header.h = 428,
.header.cf = LV_COLOR_FORMAT_ARGB8888,

View File

@ -185,7 +185,7 @@ const LV_ATTRIBUTE_MEM_ALIGN uint8_t img_lv_demo_music_cover_3_map[] = {
};
lv_img_dsc_t img_lv_demo_music_cover_3 = {
const lv_image_dsc_t img_lv_demo_music_cover_3 = {
.header.w = 176,
.header.h = 175,
.header.cf = LV_COLOR_FORMAT_ARGB8888,

View File

@ -444,7 +444,7 @@ img_lv_demo_music_cover_3_map[] = {
};
const lv_img_dsc_t img_lv_demo_music_cover_3 = {
const lv_image_dsc_t img_lv_demo_music_cover_3 = {
.header.w = 428,
.header.h = 428,
.header.cf = LV_COLOR_FORMAT_ARGB8888,

View File

@ -55,7 +55,7 @@ img_render_lvgl_logo_argb8888_map[] = {
0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0xd7, 0x33, 0x01, 0x00, 0xd7, 0x33, 0x00, 0x00, 0xd7, 0x33, 0x00, 0x00, 0xd7, 0x33, 0x00, 0x00, 0xd7, 0x33, 0x00, 0x00, 0xd7, 0x33, 0x00, 0x00, 0xd7, 0x33, 0x00, 0x00, 0xd9, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd7, 0x33, 0x00, 0x00, 0xd6, 0x33, 0x00, 0x01, 0xd7, 0x33, 0x01, 0x00, 0xd7, 0x33, 0x00, 0x00, 0xd6, 0x33, 0x00, 0x00, 0xd7, 0x33, 0x00, 0x00, 0xd7, 0x33, 0x00, 0x00, 0xd9, 0x28, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x22, 0x1c, 0x1c, 0x25, 0x23, 0x1e, 0x1e, 0x33, 0x22, 0x1e, 0x1e, 0x33, 0x23, 0x1e, 0x1e, 0x33, 0x23, 0x1e, 0x1e, 0x33, 0x23, 0x1e, 0x1e, 0x33, 0x20, 0x20, 0x20, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
const lv_img_dsc_t img_render_lvgl_logo_argb8888 = {
const lv_image_dsc_t img_render_lvgl_logo_argb8888 = {
.header.cf = LV_COLOR_FORMAT_ARGB8888,
.header.w = 30,
.header.h = 30,

View File

@ -56,7 +56,7 @@ img_render_lvgl_logo_rgb565_map[] = {
0xff, 0xff, 0x5d, 0xff, 0x5d, 0xff, 0x5d, 0xff, 0x5d, 0xff, 0x5d, 0xff, 0x5d, 0xff, 0x5d, 0xff, 0x7e, 0xff, 0xff, 0xff, 0xff, 0xff, 0x5d, 0xff, 0x5d, 0xff, 0x5d, 0xff, 0x5d, 0xff, 0x5d, 0xff, 0x5d, 0xff, 0x5d, 0xff, 0x7e, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9e, 0xf7, 0x5d, 0xef, 0x5d, 0xef, 0x5d, 0xef, 0x5d, 0xef, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
const lv_img_dsc_t img_render_lvgl_logo_rgb565 = {
const lv_image_dsc_t img_render_lvgl_logo_rgb565 = {
.header.cf = LV_COLOR_FORMAT_RGB565,
.header.w = 30,
.header.h = 30,

View File

@ -195,7 +195,7 @@ img_render_lvgl_logo_rgb888_map[] = {
0xe7, 0xe6, 0xe6, 0xfb, 0xfa, 0xfa, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe,
};
const lv_img_dsc_t img_render_lvgl_logo_rgb888 = {
const lv_image_dsc_t img_render_lvgl_logo_rgb888 = {
.header.cf = LV_COLOR_FORMAT_RGB888,
.header.w = 30,
.header.h = 30,

View File

@ -55,7 +55,7 @@ img_render_lvgl_logo_xrgb8888_map[] = {
0xff, 0xff, 0xff, 0xff, 0xe7, 0xe7, 0xf8, 0xff, 0xe6, 0xe7, 0xf8, 0xff, 0xe7, 0xe7, 0xf8, 0xff, 0xe7, 0xe7, 0xf8, 0xff, 0xe7, 0xe7, 0xf8, 0xff, 0xe7, 0xe7, 0xf8, 0xff, 0xe7, 0xe6, 0xf8, 0xff, 0xed, 0xed, 0xf9, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xe7, 0xf8, 0xff, 0xe7, 0xe7, 0xf8, 0xff, 0xe7, 0xe7, 0xf8, 0xff, 0xe7, 0xe7, 0xf8, 0xff, 0xe7, 0xe7, 0xf8, 0xff, 0xe7, 0xe7, 0xf8, 0xff, 0xe7, 0xe7, 0xf8, 0xff, 0xed, 0xed, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xee, 0xee, 0xef, 0xff, 0xe8, 0xe7, 0xe7, 0xff, 0xe8, 0xe7, 0xe7, 0xff, 0xe8, 0xe7, 0xe7, 0xff, 0xe8, 0xe7, 0xe7, 0xff, 0xe8, 0xe7, 0xe7, 0xff, 0xfc, 0xfb, 0xfb, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
const lv_img_dsc_t img_render_lvgl_logo_xrgb8888 = {
const lv_image_dsc_t img_render_lvgl_logo_xrgb8888 = {
.header.cf = LV_COLOR_FORMAT_XRGB8888,
.header.w = 30,
.header.h = 30,

View File

@ -331,10 +331,10 @@ static lv_obj_t * image_obj_create(lv_obj_t * parent, int32_t col, int32_t row,
static void image_core_cb(lv_obj_t * parent, bool recolor)
{
LV_IMG_DECLARE(img_render_lvgl_logo_xrgb8888);
LV_IMG_DECLARE(img_render_lvgl_logo_rgb888);
LV_IMG_DECLARE(img_render_lvgl_logo_rgb565);
LV_IMG_DECLARE(img_render_lvgl_logo_argb8888);
LV_IMAGE_DECLARE(img_render_lvgl_logo_xrgb8888);
LV_IMAGE_DECLARE(img_render_lvgl_logo_rgb888);
LV_IMAGE_DECLARE(img_render_lvgl_logo_rgb565);
LV_IMAGE_DECLARE(img_render_lvgl_logo_argb8888);
const void * srcs[] = {
&img_render_lvgl_logo_argb8888,
&img_render_lvgl_logo_xrgb8888,

View File

@ -146,7 +146,7 @@ static void obj_test_task_cb(lv_timer_t * tmr)
obj = lv_button_create(main_page);
lv_obj_set_size(obj, 100, 70);
lv_obj_set_style_bg_image_src(obj, LV_SYMBOL_DUMMY"Text from\nstyle", 0);
lv_obj_delete_async(obj); /*Delete on next call of `lv_task_handler` (so not now)*/
lv_obj_delete_async(obj); /*Delete on next call of `lv_timer_handler` (so not now)*/
break;
case 5:
@ -299,7 +299,7 @@ static void obj_test_task_cb(lv_timer_t * tmr)
obj = lv_table_create(main_page);
lv_table_set_cell_value(obj, 0, 0, "0,0");
lv_table_set_cell_value_fmt(obj, 3, 0, "%d,%d", 5, 0);
lv_table_set_row_cnt(obj, 5);
lv_table_set_row_count(obj, 5);
lv_table_set_cell_value_fmt(obj, 1, 0, "%s", "1,0");
lv_table_set_cell_value(obj, 1, 3, "1,3");
break;

View File

@ -266,7 +266,7 @@ void lv_demo_vector_graphic(void)
lv_draw_buf_t * draw_buf = lv_draw_buf_create(WIDTH, HEIGHT, LV_COLOR_FORMAT_ARGB8888, LV_STRIDE_AUTO);
lv_draw_buf_clear(draw_buf, NULL);
lv_obj_t * canvas = lv_canvas_create(lv_scr_act());
lv_obj_t * canvas = lv_canvas_create(lv_screen_active());
lv_canvas_set_draw_buf(canvas, draw_buf);
lv_obj_add_event_cb(canvas, delete_event_cb, LV_EVENT_DELETE, NULL);

View File

@ -841,7 +841,7 @@ static void analytics_create(lv_obj_t * parent)
lv_scale_section_set_style(section, LV_PART_INDICATOR, &scale3_section3_indicator_style);
lv_scale_section_set_style(section, LV_PART_ITEMS, &scale3_section3_tick_style);
LV_IMG_DECLARE(img_demo_widgets_needle);
LV_IMAGE_DECLARE(img_demo_widgets_needle);
lv_obj_t * needle = lv_image_create(scale3);
lv_image_set_src(needle, &img_demo_widgets_needle);
lv_image_set_pivot(needle, 3, 4);

View File

@ -190,7 +190,7 @@ C code
.. code:: c
lv_obj_t * btn = lv_btn_create(lv_scr_act());                   /*Add a button to the current screen*/
lv_obj_t * btn = lv_button_create(lv_screen_active());                   /*Add a button to the current screen*/
lv_obj_center(btn);                                     /*Set its position*/
lv_obj_set_size(btn, 100, 50);                                  /*Set its size*/
lv_obj_add_event(btn, btn_event_cb, LV_EVENT_CLICKED, NULL); /*Assign a callback to the button*/
@ -267,25 +267,25 @@ C code
.. code:: c
lv_obj_set_flex_flow(lv_scr_act(), LV_FLEX_FLOW_COLUMN);
lv_obj_set_flex_align(lv_scr_act(), LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER);
lv_obj_set_flex_flow(lv_screen_active(), LV_FLEX_FLOW_COLUMN);
lv_obj_set_flex_align(lv_screen_active(), LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER);
lv_obj_t * cb;
cb = lv_checkbox_create(lv_scr_act());
cb = lv_checkbox_create(lv_screen_active());
lv_checkbox_set_text(cb, "Apple");
lv_obj_add_event(cb, event_handler, LV_EVENT_ALL, NULL);
cb = lv_checkbox_create(lv_scr_act());
cb = lv_checkbox_create(lv_screen_active());
lv_checkbox_set_text(cb, "Banana");
lv_obj_add_state(cb, LV_STATE_CHECKED);
lv_obj_add_event(cb, event_handler, LV_EVENT_ALL, NULL);
cb = lv_checkbox_create(lv_scr_act());
cb = lv_checkbox_create(lv_screen_active());
lv_checkbox_set_text(cb, "Lemon");
lv_obj_add_state(cb, LV_STATE_DISABLED);
lv_obj_add_event(cb, event_handler, LV_EVENT_ALL, NULL);
cb = lv_checkbox_create(lv_scr_act());
cb = lv_checkbox_create(lv_screen_active());
lv_obj_add_state(cb, LV_STATE_CHECKED | LV_STATE_DISABLED);
lv_checkbox_set_text(cb, "Melon\nand a new line");
lv_obj_add_event(cb, event_handler, LV_EVENT_ALL, NULL);
@ -372,7 +372,7 @@ C code
.. code:: c
lv_obj_t * slider = lv_slider_create(lv_scr_act());
lv_obj_t * slider = lv_slider_create(lv_screen_active());
lv_slider_set_value(slider, 70, LV_ANIM_OFF);
lv_obj_set_size(slider, 300, 20);
lv_obj_center(slider);
@ -486,20 +486,20 @@ C code
.. code:: c
lv_obj_t * ltr_label = lv_label_create(lv_scr_act());
lv_obj_t * ltr_label = lv_label_create(lv_screen_active());
lv_label_set_text(ltr_label, "In modern terminology, a microcontroller is similar to a system on a chip (SoC).");
lv_obj_set_style_text_font(ltr_label, &lv_font_montserrat_16, 0);
lv_obj_set_width(ltr_label, 310);
lv_obj_align(ltr_label, LV_ALIGN_TOP_LEFT, 5, 5);
lv_obj_t * rtl_label = lv_label_create(lv_scr_act());
lv_obj_t * rtl_label = lv_label_create(lv_screen_active());
lv_label_set_text(rtl_label,"מעבד, או בשמו המלא יחידת עיבוד מרכזית (באנגלית: CPU - Central Processing Unit).");
lv_obj_set_style_base_dir(rtl_label, LV_BASE_DIR_RTL, 0);
lv_obj_set_style_text_font(rtl_label, &lv_font_dejavu_16_persian_hebrew, 0);
lv_obj_set_width(rtl_label, 310);
lv_obj_align(rtl_label, LV_ALIGN_LEFT_MID, 5, 0);
lv_obj_t * cz_label = lv_label_create(lv_scr_act());
lv_obj_t * cz_label = lv_label_create(lv_screen_active());
lv_label_set_text(cz_label,
"嵌入式系统Embedded System\n是一种嵌入机械或电气系统内部、具有专一功能和实时计算性能的计算机系统。");
lv_obj_set_style_text_font(cz_label, &lv_font_simsun_16_cjk, 0);

View File

@ -239,7 +239,7 @@ Código C
.. code:: c
lv_obj_t * btn = lv_btn_create(lv_scr_act()); /* Adiciona o botão a tela atual */
lv_obj_t * btn = lv_button_create(lv_screen_active()); /* Adiciona o botão a tela atual */
lv_obj_center(btn); /* Define a posição do botão */
lv_obj_set_size(btn, 100, 50); /* Define o tamanho do botão */
lv_obj_add_event(btn, btn_event_cb, LV_EVENT_CLICKED, NULL); /* Atribui um retorno de chamada (callback) ao botão */
@ -316,25 +316,25 @@ Código em C
.. code:: c
lv_obj_set_flex_flow(lv_scr_act(), LV_FLEX_FLOW_COLUMN);
lv_obj_set_flex_align(lv_scr_act(), LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER);
lv_obj_set_flex_flow(lv_screen_active(), LV_FLEX_FLOW_COLUMN);
lv_obj_set_flex_align(lv_screen_active(), LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER);
lv_obj_t * cb;
cb = lv_checkbox_create(lv_scr_act());
cb = lv_checkbox_create(lv_screen_active());
lv_checkbox_set_text(cb, "Maça");
lv_obj_add_event(cb, event_handler, LV_EVENT_ALL, NULL);
cb = lv_checkbox_create(lv_scr_act());
cb = lv_checkbox_create(lv_screen_active());
lv_checkbox_set_text(cb, "Banana");
lv_obj_add_state(cb, LV_STATE_CHECKED);
lv_obj_add_event(cb, event_handler, LV_EVENT_ALL, NULL);
cb = lv_checkbox_create(lv_scr_act());
cb = lv_checkbox_create(lv_screen_active());
lv_checkbox_set_text(cb, "Limão");
lv_obj_add_state(cb, LV_STATE_DISABLED);
lv_obj_add_event(cb, event_handler, LV_EVENT_ALL, NULL);
cb = lv_checkbox_create(lv_scr_act());
cb = lv_checkbox_create(lv_screen_active());
lv_obj_add_state(cb, LV_STATE_CHECKED | LV_STATE_DISABLED);
lv_checkbox_set_text(cb, "Melão\ne uma nova linha");
lv_obj_add_event(cb, event_handler, LV_EVENT_ALL, NULL);
@ -421,7 +421,7 @@ Código C
.. code:: c
lv_obj_t * slider = lv_slider_create(lv_scr_act());
lv_obj_t * slider = lv_slider_create(lv_screen_active());
lv_slider_set_value(slider, 70, LV_ANIM_OFF);
lv_obj_set_size(slider, 300, 20);
lv_obj_center(slider);
@ -535,20 +535,20 @@ Código C
.. code:: c
lv_obj_t * ltr_label = lv_label_create(lv_scr_act());
lv_obj_t * ltr_label = lv_label_create(lv_screen_active());
lv_label_set_text(ltr_label, "In modern terminology, a microcontroller is similar to a system on a chip (SoC).");
lv_obj_set_style_text_font(ltr_label, &lv_font_montserrat_16, 0);
lv_obj_set_width(ltr_label, 310);
lv_obj_align(ltr_label, LV_ALIGN_TOP_LEFT, 5, 5);
lv_obj_t * rtl_label = lv_label_create(lv_scr_act());
lv_obj_t * rtl_label = lv_label_create(lv_screen_active());
lv_label_set_text(rtl_label,"מעבד, או בשמו המלא יחידת עיבוד מרכזית (באנגלית: CPU - Central Processing Unit).");
lv_obj_set_style_base_dir(rtl_label, LV_BASE_DIR_RTL, 0);
lv_obj_set_style_text_font(rtl_label, &lv_font_dejavu_16_persian_hebrew, 0);
lv_obj_set_width(rtl_label, 310);
lv_obj_align(rtl_label, LV_ALIGN_LEFT_MID, 5, 0);
lv_obj_t * cz_label = lv_label_create(lv_scr_act());
lv_obj_t * cz_label = lv_label_create(lv_screen_active());
lv_label_set_text(cz_label,
"嵌入式系统Embedded System\n是一种嵌入机械或电气系统内部、具有专一功能和实时计算性能的计算机系统。");
lv_obj_set_style_text_font(cz_label, &lv_font_simsun_16_cjk, 0);

View File

@ -77,8 +77,8 @@ Usage
{
...
/* Periodically call the lv_task handler */
lv_task_handler();
/* Periodically call the lv_timer handler */
lv_timer_handler();
}
}
@ -107,7 +107,7 @@ Usage
lv_display_add_event_cb(disp, on_close_cb, LV_EVENT_DELETE, disp);
/* initialize X11 input drivers (for keyboard, mouse & mousewheel) */
LV_IMG_DECLARE(my_mouse_cursor_icon);
LV_IMAGE_DECLARE(my_mouse_cursor_icon);
lv_x11_inputs_create(disp, &my_mouse_cursor_icon);
#if !LV_X11_DIRECT_EXIT
@ -121,7 +121,7 @@ Usage
{
...
/* Periodically call the lv_task handler */
lv_task_handler();
/* Periodically call the lv_timer handler */
lv_timer_handler();
}
}

View File

@ -159,7 +159,7 @@ adjusted with :cpp:expr:`lv_obj_set_style_bg_color(obj, color)`;
The display background image is a path to a file or a pointer to an
:cpp:struct:`lv_image_dsc_t` variable (converted image data) to be used as
wallpaper. It can be set with :cpp:expr:`lv_obj_set_style_bg_img_src(obj, &my_img)`;
wallpaper. It can be set with :cpp:expr:`lv_obj_set_style_bg_image_src(obj, &my_img)`;
If a background image is configured the background won't be filled with
``bg_color``.

View File

@ -28,7 +28,7 @@ Pointer input devices (like a mouse) can have a cursor.
...
lv_indev_t * mouse_indev = lv_indev_create();
...
LV_IMG_DECLARE(mouse_cursor_icon); /*Declare the image source.*/
LV_IMAGE_DECLARE(mouse_cursor_icon); /*Declare the image source.*/
lv_obj_t * cursor_obj = lv_image_create(lv_screen_active()); /*Create an image object for the cursor */
lv_image_set_src(cursor_obj, &mouse_cursor_icon); /*Set the image source*/
lv_indev_set_cursor(mouse_indev, cursor_obj); /*Connect the image object to the driver*/

View File

@ -154,7 +154,7 @@ the object and all of its children.
void lv_obj_delete(lv_obj_t * obj);
:cpp:func:`lv_obj_del` will delete the object immediately. If for any reason you
:cpp:func:`lv_obj_delete` will delete the object immediately. If for any reason you
can't delete the object immediately you can use
:cpp:expr:`lv_obj_delete_async(obj)` which will perform the deletion on the next
call of :cpp:func:`lv_timer_handler`. This is useful e.g. if you want to

View File

@ -134,7 +134,7 @@ You will obtain a processed text file named `trace.systrace`, which roughly cont
# tracer: nop
#
LVGL-1 [0] 2892.002993: tracing_mark_write: B|1|lv_timer_handler
LVGL-1 [0] 2892.002993: tracing_mark_write: B|1|_lv_disp_refr_timer
LVGL-1 [0] 2892.002993: tracing_mark_write: B|1|_lv_display_refr_timer
LVGL-1 [0] 2892.003459: tracing_mark_write: B|1|refr_invalid_areas
LVGL-1 [0] 2892.003461: tracing_mark_write: B|1|lv_draw_rect
LVGL-1 [0] 2892.003550: tracing_mark_write: E|1|lv_draw_rect

View File

@ -219,8 +219,8 @@ To get a property's value from a style:
.. code:: c
lv_style_value_t v;
lv_res_t res = lv_style_get_prop(&style, LV_STYLE_BG_COLOR, &v);
if(res == LV_RES_OK) { /*Found*/
lv_result_t res = lv_style_get_prop(&style, LV_STYLE_BG_COLOR, &v);
if(res == LV_RESULT_OK) { /*Found*/
do_something(v.color);
}

View File

@ -31,7 +31,7 @@ Here is some pseudocode to illustrate the concept:
while(1) {
uint32_t time_till_next;
mutex_lock(&lvgl_mutex);
time_till_next = lv_task_handler();
time_till_next = lv_timer_handler();
mutex_unlock(&lvgl_mutex);
thread_sleep(time_till_next); /* sleep for a while */
}

View File

@ -10,7 +10,7 @@ main ``while(1)`` should look like this:
while(1) {
/*Normal operation (no sleep) in < 1 sec inactivity*/
if(lv_display_get_inactive_time(NULL) < 1000) {
lv_task_handler();
lv_timer_handler();
}
/*Sleep after 1 sec inactivity*/
else {
@ -27,7 +27,7 @@ function to signal a wake-up (press, touch or click etc.) has happened:
lv_tick_inc(LV_DEF_REFR_PERIOD); /*Force task execution on wake-up*/
timer_start(); /*Restart the timer where lv_tick_inc() is called*/
lv_task_handler(); /*Call `lv_task_handler()` manually to process the wake-up event*/
lv_timer_handler(); /*Call `lv_timer_handler()` manually to process the wake-up event*/
In addition to :cpp:func:`lv_display_get_inactive_time` you can check
:cpp:func:`lv_anim_count_running` to see if all animations have finished.

View File

@ -89,8 +89,8 @@ Events
- :cpp:enumerator:`LV_EVENT_VALUE_CHANGED` Sent if a date is clicked.
:cpp:expr:`lv_calendar_get_pressed_date(calendar, &date)` set ``date`` to the
date currently being pressed. Returns :cpp:enumerator:`LV_RES_OK` if there is a
valid pressed date, else :cpp:enumerator:`LV_RES_INVALID`.
date currently being pressed. Returns :cpp:enumerator:`LV_RESULT_OK` if there is a
valid pressed date, else :cpp:enumerator:`LV_RESULT_INVALID`.
Learn more about :ref:`events`.

View File

@ -65,7 +65,7 @@ static void lvgl_thread_entry(void *parameter)
/* handle the tasks of LVGL */
while(1)
{
lv_task_handler();
lv_timer_handler();
rt_thread_mdelay(PKG_LVGL_DISP_REFR_PERIOD);
}
}

View File

@ -47,7 +47,7 @@ void my_disp_flush( lv_display_t *disp, const lv_area_t *area, uint8_t * px_map)
*/
/*Call it to tell LVGL you are ready*/
lv_disp_flush_ready(disp);
lv_display_flush_ready(disp);
}
/*Read the touchpad*/
@ -112,7 +112,7 @@ void setup()
/* Create a simple label
* ---------------------
lv_obj_t *label = lv_label_create( lv_scr_act() );
lv_obj_t *label = lv_label_create( lv_screen_active() );
lv_label_set_text( label, "Hello Arduino, I'm LVGL!" );
lv_obj_align( label, LV_ALIGN_CENTER, 0, 0 );
@ -129,7 +129,7 @@ void setup()
lv_demo_widgets();
*/
lv_obj_t *label = lv_label_create( lv_scr_act() );
lv_obj_t *label = lv_label_create( lv_screen_active() );
lv_label_set_text( label, "Hello Arduino, I'm LVGL!" );
lv_obj_align( label, LV_ALIGN_CENTER, 0, 0 );
@ -138,6 +138,6 @@ void setup()
void loop()
{
lv_task_handler(); /* let the GUI do its work */
lv_timer_handler(); /* let the GUI do its work */
delay(5); /* let this time pass */
}

View File

@ -33,7 +33,7 @@ void lv_example_observer_5(void)
lv_subject_add_observer(&fw_update_status_subject, fw_upload_manager_observer_cb, NULL);
/*Create start FW update button*/
lv_obj_t * btn = lv_btn_create(lv_screen_active());
lv_obj_t * btn = lv_button_create(lv_screen_active());
lv_obj_add_event_cb(btn, fw_update_btn_clicked_event_cb, LV_EVENT_CLICKED, NULL);
lv_obj_center(btn);
lv_obj_t * label = lv_label_create(btn);

View File

@ -175,7 +175,7 @@ static lv_obj_t * my_button_create(lv_obj_t * parent, const char * text, lv_even
lv_subject_add_observer_with_target(&theme_subject, my_button_style_observer_cb, &styles, NULL);
}
lv_obj_t * btn = lv_btn_create(parent);
lv_obj_t * btn = lv_button_create(parent);
lv_obj_remove_style_all(btn);
lv_obj_add_style(btn, &styles.style_main, 0);
lv_obj_add_style(btn, &styles.style_pressed, LV_STATE_PRESSED);

View File

@ -186,10 +186,10 @@ static void touchpad_read(lv_indev_t * indev_drv, lv_indev_data_t * data)
/*Save the pressed coordinates and the state*/
if(touchpad_is_pressed()) {
touchpad_get_xy(&last_x, &last_y);
data->state = LV_INDEV_STATE_PR;
data->state = LV_INDEV_STATE_PRESSED;
}
else {
data->state = LV_INDEV_STATE_REL;
data->state = LV_INDEV_STATE_RELEASED;
}
/*Set the last pressed coordinates*/
@ -232,10 +232,10 @@ static void mouse_read(lv_indev_t * indev_drv, lv_indev_data_t * data)
/*Get whether the mouse button is pressed or released*/
if(mouse_is_pressed()) {
data->state = LV_INDEV_STATE_PR;
data->state = LV_INDEV_STATE_PRESSED;
}
else {
data->state = LV_INDEV_STATE_REL;
data->state = LV_INDEV_STATE_RELEASED;
}
}
@ -277,7 +277,7 @@ static void keypad_read(lv_indev_t * indev_drv, lv_indev_data_t * data)
/*Get whether the a key is pressed and save the pressed key*/
uint32_t act_key = keypad_get_key();
if(act_key != 0) {
data->state = LV_INDEV_STATE_PR;
data->state = LV_INDEV_STATE_PRESSED;
/*Translate the keys to LVGL control characters according to your key definitions*/
switch(act_key) {
@ -301,7 +301,7 @@ static void keypad_read(lv_indev_t * indev_drv, lv_indev_data_t * data)
last_key = act_key;
}
else {
data->state = LV_INDEV_STATE_REL;
data->state = LV_INDEV_STATE_RELEASED;
}
data->key = last_key;
@ -339,7 +339,7 @@ static void encoder_handler(void)
/*Your code comes here*/
encoder_diff += 0;
encoder_state = LV_INDEV_STATE_REL;
encoder_state = LV_INDEV_STATE_RELEASED;
}
/*------------------
@ -362,11 +362,11 @@ static void button_read(lv_indev_t * indev_drv, lv_indev_data_t * data)
int8_t btn_act = button_get_pressed_id();
if(btn_act >= 0) {
data->state = LV_INDEV_STATE_PR;
data->state = LV_INDEV_STATE_PRESSED;
last_btn = btn_act;
}
else {
data->state = LV_INDEV_STATE_REL;
data->state = LV_INDEV_STATE_RELEASED;
}
/*Save the last pressed button's ID*/

View File

@ -81,7 +81,7 @@ void lv_example_scale_3(void)
lv_scale_set_rotation(scale_img, 135);
/* image must point to the right. E.g. -O------>*/
needle_img = lv_img_create(scale_img);
needle_img = lv_image_create(scale_img);
lv_image_set_src(needle_img, &img_hand);
lv_obj_align(needle_img, LV_ALIGN_CENTER, 47, -2);
lv_image_set_pivot(needle_img, 3, 4);

View File

@ -142,10 +142,8 @@ static void _draw_vglite_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t
break;
case LV_FONT_GLYPH_FORMAT_IMAGE: {
#if LV_USE_IMGFONT
lv_draw_img_dsc_t img_dsc;
lv_draw_img_dsc_init(&img_dsc);
img_dsc.angle = 0;
img_dsc.zoom = LV_ZOOM_NONE;
lv_draw_image_dsc_t img_dsc;
lv_draw_image_dsc_init(&img_dsc);
img_dsc.opa = glyph_draw_dsc->opa;
img_dsc.src = glyph_draw_dsc->glyph_data;
lv_draw_vglite_img(draw_unit, &img_dsc, glyph_draw_dsc->letter_coords);

View File

@ -144,7 +144,7 @@ int lv_nuttx_fbdev_set_file(lv_display_t * disp, const char * file)
}
lv_display_set_draw_buffers(disp, &dsc->buf1, double_buffer ? &dsc->buf2 : NULL);
lv_display_set_render_mode(disp, LV_DISP_RENDER_MODE_DIRECT);
lv_display_set_render_mode(disp, LV_DISPLAY_RENDER_MODE_DIRECT);
lv_display_set_resolution(disp, dsc->vinfo.xres, dsc->vinfo.yres);
lv_timer_set_cb(disp->refr_timer, display_refr_timer_cb);

View File

@ -241,7 +241,7 @@ static int lv_nuttx_uv_fb_init(lv_nuttx_uv_t * uv_info, lv_nuttx_uv_ctx_t * uv_c
/* Remove default refr timer. */
lv_timer_del(disp->refr_timer);
lv_timer_delete(disp->refr_timer);
disp->refr_timer = NULL;
fb_ctx->fb_poll.data = uv_ctx;

View File

@ -60,7 +60,7 @@ void lv_x11_inputs_create(lv_display_t * disp, lv_image_dsc_t const * mouse_img)
* @endcode
* or with mouse cursor icon:
* @code
* lv_img_dsc_t mouse_symbol = {.....};
* lv_image_dsc_t mouse_symbol = {.....};
* lv_display_t* disp = lv_x11_window_create("My Window Title", window_width, window_width);
* lv_x11_inputs_create(disp, &mouse_symbol);
* @endcode

View File

@ -121,7 +121,7 @@ static void x11_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t *
.y2 = 0
};
/* build display update area until lv_disp_flush_is_last */
/* build display update area until lv_display_flush_is_last */
xd->flush_area.x1 = MIN(xd->flush_area.x1, area->x1);
xd->flush_area.x2 = MAX(xd->flush_area.x2, area->x2);
xd->flush_area.y1 = MIN(xd->flush_area.y1, area->y1);

View File

@ -54,7 +54,7 @@ typedef struct {
uint32_t btn_id; /**< For LV_INDEV_TYPE_BUTTON the currently pressed button*/
int16_t enc_diff; /**< For LV_INDEV_TYPE_ENCODER number of steps since the previous read*/
lv_indev_state_t state; /**< LV_INDEV_STATE_REL or LV_INDEV_STATE_PR*/
lv_indev_state_t state; /**< LV_INDEV_STATE_RELEASED or LV_INDEV_STATE_PRESSED*/
bool continue_reading; /**< If set to true, the read callback is invoked again, unless the device is in event-driven mode*/
} lv_indev_data_t;

View File

@ -176,7 +176,7 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
dsc->decoded = decoded;
if(dsc->args.no_cache) return LV_RES_OK;
if(dsc->args.no_cache) return LV_RESULT_OK;
/*If the image cache is disabled, just return the decoded image*/
if(!lv_image_cache_is_enabled()) return LV_RESULT_OK;

View File

@ -149,7 +149,7 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
dsc->decoded = decoded;
if(dsc->args.no_cache) return LV_RES_OK;
if(dsc->args.no_cache) return LV_RESULT_OK;
/*If the image cache is disabled, just return the decoded image*/
if(!lv_image_cache_is_enabled()) return LV_RESULT_OK;

View File

@ -201,7 +201,7 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
dsc->decoded = decoded;
if(dsc->args.no_cache) return LV_RES_OK;
if(dsc->args.no_cache) return LV_RESULT_OK;
/*If the image cache is disabled, just return the decoded image*/
if(!lv_image_cache_is_enabled()) return LV_RESULT_OK;

View File

@ -53,7 +53,7 @@ void * _lv_utils_bsearch(const void * key, const void * base, uint32_t n, uint32
* Save a draw buf to a file
* @param draw_buf pointer to a draw buffer
* @param path path to the file to save
* @return LV_RES_OK: success; LV_RES_INV: error
* @return LV_RESULT_OK: success; LV_RESULT_INVALID: error
*/
lv_result_t lv_draw_buf_save_to_file(const lv_draw_buf_t * draw_buf, const char * path);

View File

@ -255,7 +255,7 @@ static void canvas_draw(const char * name, void (*draw_cb)(lv_layer_t *))
#endif
lv_image_cache_drop(draw_buf);
lv_draw_buf_destroy(draw_buf);
lv_obj_del(canvas);
lv_obj_delete(canvas);
}
void test_transform(void)

View File

@ -22,7 +22,7 @@ static void create_images(void)
lv_obj_t * label;
/* PNG array */
LV_IMG_DECLARE(test_img_lvgl_logo_png);
LV_IMAGE_DECLARE(test_img_lvgl_logo_png);
img = lv_image_create(lv_screen_active());
lv_image_set_src(img, &test_img_lvgl_logo_png);
lv_obj_align(img, LV_ALIGN_CENTER, -100, -20);

View File

@ -39,7 +39,7 @@ void test_tiny_ttf_rendering_test(void)
TEST_ASSERT_EQUAL_SCREENSHOT("libs/tiny_ttf_1.png");
lv_obj_del(label);
lv_obj_delete(label);
lv_tiny_ttf_destroy(font);
#else
TEST_PASS();
@ -71,7 +71,7 @@ void test_tiny_ttf_kerning(void)
TEST_ASSERT_EQUAL_SCREENSHOT("libs/tiny_ttf_2.png");
lv_obj_del(cont);
lv_obj_delete(cont);
lv_tiny_ttf_destroy(font_normal);
lv_tiny_ttf_destroy(font_none);
#else

View File

@ -21,7 +21,7 @@ static void create_images(void)
lv_obj_t * img;
lv_obj_t * label;
LV_IMG_DECLARE(test_img_lvgl_logo_jpg);
LV_IMAGE_DECLARE(test_img_lvgl_logo_jpg);
img = lv_image_create(lv_screen_active());
lv_image_set_src(img, &test_img_lvgl_logo_jpg);
lv_obj_align(img, LV_ALIGN_CENTER, -100, -20);

View File

@ -23,7 +23,7 @@ void tearDown(void)
void test_anim_timeline_progress_1(void)
{
lv_obj_t * obj = lv_obj_create(lv_scr_act());
lv_obj_t * obj = lv_obj_create(lv_screen_active());
lv_obj_set_size(obj, 100, 100);
lv_obj_set_pos(obj, 30, 40);
@ -83,7 +83,7 @@ void test_anim_timeline_progress_1(void)
void test_anim_timeline_progress_2(void)
{
lv_obj_t * obj = lv_obj_create(lv_scr_act());
lv_obj_t * obj = lv_obj_create(lv_screen_active());
lv_obj_set_size(obj, 100, 100);
lv_anim_t a1;
lv_anim_init(&a1);
@ -147,7 +147,7 @@ void test_anim_timeline_progress_2(void)
void test_anim_timeline_start(void)
{
lv_obj_t * obj = lv_obj_create(lv_scr_act());
lv_obj_t * obj = lv_obj_create(lv_screen_active());
lv_obj_set_size(obj, 100, 100);
lv_obj_set_pos(obj, 70, 70);
@ -238,7 +238,7 @@ void test_anim_timeline_start(void)
void test_anim_timeline_reverse(void)
{
lv_obj_t * obj = lv_obj_create(lv_scr_act());
lv_obj_t * obj = lv_obj_create(lv_screen_active());
lv_obj_set_size(obj, 100, 100);
lv_obj_set_pos(obj, 70, 70);

View File

@ -178,7 +178,7 @@ static void create_ui(void)
lv_canvas_fill_bg(canvas, c2, LV_OPA_COVER);
draw_to_canvas(canvas);
LV_IMG_DECLARE(test_img_lvgl_logo_jpg);
LV_IMAGE_DECLARE(test_img_lvgl_logo_jpg);
lv_obj_t * img;
img = lv_image_create(scr);
lv_image_set_src(img, &test_img_lvgl_logo_jpg);

View File

@ -7,7 +7,7 @@ void test_screen_load_no_crash(void)
{
/*Delete active screen and load new screen should not crash*/
lv_obj_t * screen = lv_screen_active();
lv_obj_del(screen);
lv_obj_delete(screen);
screen = lv_obj_create(NULL);
lv_screen_load(screen);

View File

@ -571,7 +571,7 @@ void test_label_rtl_dot_long_mode(void)
const char * message =
"מעבד, או בשמו המלא יחידת עיבוד מרכזית (באנגלית: CPU - Central Processing Unit).";
lv_obj_t * screen = lv_obj_create(lv_scr_act());
lv_obj_t * screen = lv_obj_create(lv_screen_active());
lv_obj_remove_style_all(screen);
lv_obj_set_size(screen, 800, 480);
lv_obj_center(screen);

View File

@ -89,7 +89,7 @@ void test_obj_property_set_get_should_match(void)
prop.id = LV_PROPERTY_IMAGE_OFFSET_X;
prop.num = 0x1234;
TEST_ASSERT_TRUE(lv_obj_set_property(img, &prop) == LV_RESULT_OK);
TEST_ASSERT_EQUAL_UINT16(0x1234, lv_img_get_offset_x(img));
TEST_ASSERT_EQUAL_UINT16(0x1234, lv_image_get_offset_x(img));
TEST_ASSERT_EQUAL_UINT16(0x1234, lv_obj_get_property(img, LV_PROPERTY_IMAGE_OFFSET_X).num);
#endif
}

View File

@ -23,7 +23,7 @@ void test_spinner_spinning(void)
{
for(int i = 0; i < 10; ++i) {
lv_tick_inc(50);
lv_task_handler();
lv_timer_handler();
char filename[32];
lv_snprintf(filename, sizeof(filename), "widgets/spinner_%02d.png", i);