diff --git a/.devcontainer/__main.c__ b/.devcontainer/__main.c__ index ea253ca10ea4..d4218c4748ac 100644 --- a/.devcontainer/__main.c__ +++ b/.devcontainer/__main.c__ @@ -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); diff --git a/demos/README.md b/demos/README.md index 1cb7634f4544..01747173ea24 100644 --- a/demos/README.md +++ b/demos/README.md @@ -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; diff --git a/demos/benchmark/lv_demo_benchmark.c b/demos/benchmark/lv_demo_benchmark.c index f28cbe20a068..024ffb67fc35 100644 --- a/demos/benchmark/lv_demo_benchmark.c +++ b/demos/benchmark/lv_demo_benchmark.c @@ -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); diff --git a/demos/music/assets/img_lv_demo_music_cover_1.c b/demos/music/assets/img_lv_demo_music_cover_1.c index 8155fb5083a8..8edf379b92e6 100644 --- a/demos/music/assets/img_lv_demo_music_cover_1.c +++ b/demos/music/assets/img_lv_demo_music_cover_1.c @@ -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, diff --git a/demos/music/assets/img_lv_demo_music_cover_1_large.c b/demos/music/assets/img_lv_demo_music_cover_1_large.c index c57c562f71d2..045d904dbd9e 100644 --- a/demos/music/assets/img_lv_demo_music_cover_1_large.c +++ b/demos/music/assets/img_lv_demo_music_cover_1_large.c @@ -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, diff --git a/demos/music/assets/img_lv_demo_music_cover_2.c b/demos/music/assets/img_lv_demo_music_cover_2.c index 615cac5e619d..d0af29bc44d7 100644 --- a/demos/music/assets/img_lv_demo_music_cover_2.c +++ b/demos/music/assets/img_lv_demo_music_cover_2.c @@ -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, diff --git a/demos/music/assets/img_lv_demo_music_cover_2_large.c b/demos/music/assets/img_lv_demo_music_cover_2_large.c index 810959e8fdf3..6f777c50ccb3 100644 --- a/demos/music/assets/img_lv_demo_music_cover_2_large.c +++ b/demos/music/assets/img_lv_demo_music_cover_2_large.c @@ -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, diff --git a/demos/music/assets/img_lv_demo_music_cover_3.c b/demos/music/assets/img_lv_demo_music_cover_3.c index bb46bba25a6a..fd4e01989a63 100644 --- a/demos/music/assets/img_lv_demo_music_cover_3.c +++ b/demos/music/assets/img_lv_demo_music_cover_3.c @@ -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, diff --git a/demos/music/assets/img_lv_demo_music_cover_3_large.c b/demos/music/assets/img_lv_demo_music_cover_3_large.c index cef92b841b94..69475bb69435 100644 --- a/demos/music/assets/img_lv_demo_music_cover_3_large.c +++ b/demos/music/assets/img_lv_demo_music_cover_3_large.c @@ -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, diff --git a/demos/render/assets/img_render_lvgl_logo_argb8888.c b/demos/render/assets/img_render_lvgl_logo_argb8888.c index a723a4d9eeb4..80b5d6ead1a1 100644 --- a/demos/render/assets/img_render_lvgl_logo_argb8888.c +++ b/demos/render/assets/img_render_lvgl_logo_argb8888.c @@ -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, diff --git a/demos/render/assets/img_render_lvgl_logo_rgb565.c b/demos/render/assets/img_render_lvgl_logo_rgb565.c index f5a0c1f09309..872c078c0b44 100644 --- a/demos/render/assets/img_render_lvgl_logo_rgb565.c +++ b/demos/render/assets/img_render_lvgl_logo_rgb565.c @@ -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, diff --git a/demos/render/assets/img_render_lvgl_logo_rgb888.c b/demos/render/assets/img_render_lvgl_logo_rgb888.c index 6e233171f060..8e9b78b1956a 100644 --- a/demos/render/assets/img_render_lvgl_logo_rgb888.c +++ b/demos/render/assets/img_render_lvgl_logo_rgb888.c @@ -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, diff --git a/demos/render/assets/img_render_lvgl_logo_xrgb8888.c b/demos/render/assets/img_render_lvgl_logo_xrgb8888.c index 941a1c66bfda..1e711f910858 100644 --- a/demos/render/assets/img_render_lvgl_logo_xrgb8888.c +++ b/demos/render/assets/img_render_lvgl_logo_xrgb8888.c @@ -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, diff --git a/demos/render/lv_demo_render.c b/demos/render/lv_demo_render.c index 0c0f618360c3..033de7a3ff15 100644 --- a/demos/render/lv_demo_render.c +++ b/demos/render/lv_demo_render.c @@ -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, diff --git a/demos/stress/lv_demo_stress.c b/demos/stress/lv_demo_stress.c index 1ca3f2250587..65728519cd7f 100644 --- a/demos/stress/lv_demo_stress.c +++ b/demos/stress/lv_demo_stress.c @@ -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; diff --git a/demos/vector_graphic/lv_demo_vector_graphic.c b/demos/vector_graphic/lv_demo_vector_graphic.c index 2ae1e4794abf..b74a623a1921 100644 --- a/demos/vector_graphic/lv_demo_vector_graphic.c +++ b/demos/vector_graphic/lv_demo_vector_graphic.c @@ -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); diff --git a/demos/widgets/lv_demo_widgets.c b/demos/widgets/lv_demo_widgets.c index 18e6d7978e30..e1b376fe35a2 100644 --- a/demos/widgets/lv_demo_widgets.c +++ b/demos/widgets/lv_demo_widgets.c @@ -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); diff --git a/docs/README_jp.rst b/docs/README_jp.rst index 89d812d8eca6..8734d5cf9ef8 100644 --- a/docs/README_jp.rst +++ b/docs/README_jp.rst @@ -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); diff --git a/docs/README_pt_BR.rst b/docs/README_pt_BR.rst index 05755a263000..19a9cc3d14be 100644 --- a/docs/README_pt_BR.rst +++ b/docs/README_pt_BR.rst @@ -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); diff --git a/docs/integration/driver/X11.rst b/docs/integration/driver/X11.rst index 7e201b4cf847..246dfdee17b3 100644 --- a/docs/integration/driver/X11.rst +++ b/docs/integration/driver/X11.rst @@ -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(); } } diff --git a/docs/overview/display.rst b/docs/overview/display.rst index 2b4d6d0ce2af..e7470da111a1 100644 --- a/docs/overview/display.rst +++ b/docs/overview/display.rst @@ -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``. diff --git a/docs/overview/indev.rst b/docs/overview/indev.rst index d3e73eaf215c..61e3afad4928 100644 --- a/docs/overview/indev.rst +++ b/docs/overview/indev.rst @@ -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*/ diff --git a/docs/overview/obj.rst b/docs/overview/obj.rst index ce77082e6393..ef4726be116a 100644 --- a/docs/overview/obj.rst +++ b/docs/overview/obj.rst @@ -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 diff --git a/docs/overview/profiler.rst b/docs/overview/profiler.rst index f67bb1ceacc4..e993d9203a0b 100644 --- a/docs/overview/profiler.rst +++ b/docs/overview/profiler.rst @@ -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 diff --git a/docs/overview/style.rst b/docs/overview/style.rst index cecfee8a6326..f15099eb5417 100644 --- a/docs/overview/style.rst +++ b/docs/overview/style.rst @@ -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); } diff --git a/docs/porting/os.rst b/docs/porting/os.rst index ad7ff3fe99ab..81249bd567cd 100644 --- a/docs/porting/os.rst +++ b/docs/porting/os.rst @@ -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 */ } diff --git a/docs/porting/sleep.rst b/docs/porting/sleep.rst index 3e5ee51b446a..0f168c7afa74 100644 --- a/docs/porting/sleep.rst +++ b/docs/porting/sleep.rst @@ -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. diff --git a/docs/widgets/calendar.rst b/docs/widgets/calendar.rst index c0e1020e1a97..6666fcb66d62 100644 --- a/docs/widgets/calendar.rst +++ b/docs/widgets/calendar.rst @@ -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`. diff --git a/env_support/rt-thread/lv_rt_thread_port.c b/env_support/rt-thread/lv_rt_thread_port.c index 4e49344ab41a..dad548363ed2 100644 --- a/env_support/rt-thread/lv_rt_thread_port.c +++ b/env_support/rt-thread/lv_rt_thread_port.c @@ -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); } } diff --git a/examples/arduino/LVGL_Arduino/LVGL_Arduino.ino b/examples/arduino/LVGL_Arduino/LVGL_Arduino.ino index 94ec0c85442c..c8c32f915765 100644 --- a/examples/arduino/LVGL_Arduino/LVGL_Arduino.ino +++ b/examples/arduino/LVGL_Arduino/LVGL_Arduino.ino @@ -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 */ } diff --git a/examples/others/observer/lv_example_observer_5.c b/examples/others/observer/lv_example_observer_5.c index 1ec8dabb393c..19cf0230c7b9 100644 --- a/examples/others/observer/lv_example_observer_5.c +++ b/examples/others/observer/lv_example_observer_5.c @@ -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); diff --git a/examples/others/observer/lv_example_observer_6.c b/examples/others/observer/lv_example_observer_6.c index 6a297b92c0ed..f6926aad4771 100644 --- a/examples/others/observer/lv_example_observer_6.c +++ b/examples/others/observer/lv_example_observer_6.c @@ -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); diff --git a/examples/porting/lv_port_indev_template.c b/examples/porting/lv_port_indev_template.c index d5e776323d59..29d56295867b 100644 --- a/examples/porting/lv_port_indev_template.c +++ b/examples/porting/lv_port_indev_template.c @@ -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*/ diff --git a/examples/widgets/scale/lv_example_scale_3.c b/examples/widgets/scale/lv_example_scale_3.c index b89479e38fbc..25d038daa86e 100644 --- a/examples/widgets/scale/lv_example_scale_3.c +++ b/examples/widgets/scale/lv_example_scale_3.c @@ -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); diff --git a/src/draw/nxp/vglite/lv_draw_vglite_label.c b/src/draw/nxp/vglite/lv_draw_vglite_label.c index 9c9dbe4a936d..858ab3b26f25 100644 --- a/src/draw/nxp/vglite/lv_draw_vglite_label.c +++ b/src/draw/nxp/vglite/lv_draw_vglite_label.c @@ -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); diff --git a/src/drivers/nuttx/lv_nuttx_fbdev.c b/src/drivers/nuttx/lv_nuttx_fbdev.c index d4cd7f7378bd..cdc8d373509d 100644 --- a/src/drivers/nuttx/lv_nuttx_fbdev.c +++ b/src/drivers/nuttx/lv_nuttx_fbdev.c @@ -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); diff --git a/src/drivers/nuttx/lv_nuttx_libuv.c b/src/drivers/nuttx/lv_nuttx_libuv.c index f623ae0629b7..7d56bf54f760 100644 --- a/src/drivers/nuttx/lv_nuttx_libuv.c +++ b/src/drivers/nuttx/lv_nuttx_libuv.c @@ -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; diff --git a/src/drivers/x11/lv_x11.h b/src/drivers/x11/lv_x11.h index a7f62676855a..61e13256e1e8 100644 --- a/src/drivers/x11/lv_x11.h +++ b/src/drivers/x11/lv_x11.h @@ -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 diff --git a/src/drivers/x11/lv_x11_display.c b/src/drivers/x11/lv_x11_display.c index 1321b82b34f3..70282261e016 100644 --- a/src/drivers/x11/lv_x11_display.c +++ b/src/drivers/x11/lv_x11_display.c @@ -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); diff --git a/src/indev/lv_indev.h b/src/indev/lv_indev.h index ea5794f2e444..6a9d83cc2d48 100644 --- a/src/indev/lv_indev.h +++ b/src/indev/lv_indev.h @@ -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; diff --git a/src/libs/libjpeg_turbo/lv_libjpeg_turbo.c b/src/libs/libjpeg_turbo/lv_libjpeg_turbo.c index baa5f0cdf733..3c04d92e0cc8 100644 --- a/src/libs/libjpeg_turbo/lv_libjpeg_turbo.c +++ b/src/libs/libjpeg_turbo/lv_libjpeg_turbo.c @@ -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; diff --git a/src/libs/libpng/lv_libpng.c b/src/libs/libpng/lv_libpng.c index 0a98c35a9c5d..e7885a47b501 100644 --- a/src/libs/libpng/lv_libpng.c +++ b/src/libs/libpng/lv_libpng.c @@ -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; diff --git a/src/libs/lodepng/lv_lodepng.c b/src/libs/lodepng/lv_lodepng.c index b68d45ad2164..af1d24312215 100644 --- a/src/libs/lodepng/lv_lodepng.c +++ b/src/libs/lodepng/lv_lodepng.c @@ -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; diff --git a/src/misc/lv_utils.h b/src/misc/lv_utils.h index 7b28ae17af78..4e95bf449635 100644 --- a/src/misc/lv_utils.h +++ b/src/misc/lv_utils.h @@ -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); diff --git a/tests/src/test_cases/draw/test_draw_vector.c b/tests/src/test_cases/draw/test_draw_vector.c index 6c3bf1f3e988..60c0580065a6 100644 --- a/tests/src/test_cases/draw/test_draw_vector.c +++ b/tests/src/test_cases/draw/test_draw_vector.c @@ -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) diff --git a/tests/src/test_cases/libs/test_lodepng.c b/tests/src/test_cases/libs/test_lodepng.c index 72b20312af98..487e39c903a7 100644 --- a/tests/src/test_cases/libs/test_lodepng.c +++ b/tests/src/test_cases/libs/test_lodepng.c @@ -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); diff --git a/tests/src/test_cases/libs/test_tiny_ttf.c b/tests/src/test_cases/libs/test_tiny_ttf.c index b725081d38ac..b26715f8f70f 100644 --- a/tests/src/test_cases/libs/test_tiny_ttf.c +++ b/tests/src/test_cases/libs/test_tiny_ttf.c @@ -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 diff --git a/tests/src/test_cases/libs/test_tjpgd.c b/tests/src/test_cases/libs/test_tjpgd.c index 48198e3dbe5c..5d6f8a0a32b2 100644 --- a/tests/src/test_cases/libs/test_tjpgd.c +++ b/tests/src/test_cases/libs/test_tjpgd.c @@ -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); diff --git a/tests/src/test_cases/test_anim_timeline.c b/tests/src/test_cases/test_anim_timeline.c index f6684f2593fa..50edd4e36bbe 100644 --- a/tests/src/test_cases/test_anim_timeline.c +++ b/tests/src/test_cases/test_anim_timeline.c @@ -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); diff --git a/tests/src/test_cases/test_bindings.c b/tests/src/test_cases/test_bindings.c index f6848d1527b0..364e8ad958ce 100644 --- a/tests/src/test_cases/test_bindings.c +++ b/tests/src/test_cases/test_bindings.c @@ -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); diff --git a/tests/src/test_cases/test_screen_load.c b/tests/src/test_cases/test_screen_load.c index 092f286694c3..3eeff53a3494 100644 --- a/tests/src/test_cases/test_screen_load.c +++ b/tests/src/test_cases/test_screen_load.c @@ -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); diff --git a/tests/src/test_cases/widgets/test_label.c b/tests/src/test_cases/widgets/test_label.c index 216e7405e043..c778b03086f9 100644 --- a/tests/src/test_cases/widgets/test_label.c +++ b/tests/src/test_cases/widgets/test_label.c @@ -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); diff --git a/tests/src/test_cases/widgets/test_obj_property.c b/tests/src/test_cases/widgets/test_obj_property.c index dca9ac47ec96..960f605ca059 100644 --- a/tests/src/test_cases/widgets/test_obj_property.c +++ b/tests/src/test_cases/widgets/test_obj_property.c @@ -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 } diff --git a/tests/src/test_cases/widgets/test_spinner.c b/tests/src/test_cases/widgets/test_spinner.c index 0f3b599cc339..27270cbc8261 100644 --- a/tests/src/test_cases/widgets/test_spinner.c +++ b/tests/src/test_cases/widgets/test_spinner.c @@ -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);