Skip to content

Commit

Permalink
chore: update some code and docs to use v9 API (lvgl#5876)
Browse files Browse the repository at this point in the history
Co-authored-by: Neo Xu <neo.xu1990@gmail.com>
  • Loading branch information
zylalx1 and XuNeo authored Apr 10, 2024
1 parent 0143320 commit 47ec278
Show file tree
Hide file tree
Showing 54 changed files with 115 additions and 117 deletions.
8 changes: 4 additions & 4 deletions .devcontainer/__main.c__
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
}

/**********************
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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;
Expand Down
20 changes: 10 additions & 10 deletions demos/benchmark/lv_demo_benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand All @@ -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);

Expand All @@ -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;

Expand All @@ -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);

Expand All @@ -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;

Expand All @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion demos/music/assets/img_lv_demo_music_cover_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion demos/music/assets/img_lv_demo_music_cover_1_large.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion demos/music/assets/img_lv_demo_music_cover_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion demos/music/assets/img_lv_demo_music_cover_2_large.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion demos/music/assets/img_lv_demo_music_cover_3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion demos/music/assets/img_lv_demo_music_cover_3_large.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion demos/render/assets/img_render_lvgl_logo_argb8888.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion demos/render/assets/img_render_lvgl_logo_rgb565.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion demos/render/assets/img_render_lvgl_logo_rgb888.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion demos/render/assets/img_render_lvgl_logo_xrgb8888.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions demos/render/lv_demo_render.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions demos/stress/lv_demo_stress.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion demos/vector_graphic/lv_demo_vector_graphic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion demos/widgets/lv_demo_widgets.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
22 changes: 11 additions & 11 deletions docs/README_jp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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*/
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
Loading

0 comments on commit 47ec278

Please sign in to comment.