diff options
author | Gabor Kiss-Vamosi <kisvegabor@gmail.com> | 2023-10-12 20:37:27 +0200 |
---|---|---|
committer | Gabor Kiss-Vamosi <kisvegabor@gmail.com> | 2023-10-12 21:12:16 +0200 |
commit | 9ec5417dd305c8a6c8afa21c2e1310342b3ad5c3 (patch) | |
tree | f3ecd8966130bbaa573ad589bc43413a35147e05 | |
parent | 0ff2d1c2e435e4fc401f6639e5ffc1c6596d2c01 (diff) | |
download | lvgl-9ec5417dd305c8a6c8afa21c2e1310342b3ad5c3.tar.gz lvgl-9ec5417dd305c8a6c8afa21c2e1310342b3ad5c3.zip |
refactor: scr -> screen, act->active, del->delete, remove in obj_clear_flag/state
468 files changed, 1330 insertions, 1288 deletions
diff --git a/demos/benchmark/lv_demo_benchmark.c b/demos/benchmark/lv_demo_benchmark.c index c440ec9a4..9e7ec74a1 100644 --- a/demos/benchmark/lv_demo_benchmark.c +++ b/demos/benchmark/lv_demo_benchmark.c @@ -749,7 +749,7 @@ static void benchmark_init(void) lv_timer_set_period(anim_timer, 2); } - lv_obj_t * scr = lv_scr_act(); + lv_obj_t * scr = lv_screen_active(); lv_obj_remove_style_all(scr); lv_obj_set_style_bg_opa(scr, LV_OPA_COVER, 0); lv_obj_set_style_bg_color(scr, lv_palette_lighten(LV_PALETTE_GREY, 4), 0); @@ -859,7 +859,7 @@ static void next_scene_timer_cb(lv_timer_t * timer) lv_result_t res = load_next_scene(); if(res == LV_RESULT_INVALID) { - lv_timer_del(timer); + lv_timer_delete(timer); generate_report(); } } @@ -882,7 +882,7 @@ static void single_scene_finsih_timer_cb(lv_timer_t * timer) benchmark_event_remove(); show_scene_report(); lv_obj_clean(scene_bg); - lv_obj_invalidate(lv_scr_act()); + lv_obj_invalidate(lv_screen_active()); } static void dummy_flush_cb(lv_display_t * drv, const lv_area_t * area, uint8_t * pxmap) @@ -987,19 +987,19 @@ static void generate_report(void) uint32_t opa_speed_pct = (fps_opa_unweighted * 100) / fps_normal_unweighted; - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); scene_bg = NULL; - lv_obj_set_flex_flow(lv_scr_act(), LV_FLEX_FLOW_COLUMN); + lv_obj_set_flex_flow(lv_screen_active(), LV_FLEX_FLOW_COLUMN); - title = lv_label_create(lv_scr_act()); + title = lv_label_create(lv_screen_active()); lv_label_set_text_fmt(title, "Weighted FPS: %"LV_PRIu32, fps_weighted); - subtitle = lv_label_create(lv_scr_act()); + subtitle = lv_label_create(lv_screen_active()); lv_label_set_text_fmt(subtitle, "Opa. speed: %"LV_PRIu32"%%", opa_speed_pct); - lv_coord_t w = lv_obj_get_content_width(lv_scr_act()); - lv_obj_t * table = lv_table_create(lv_scr_act()); + lv_coord_t w = lv_obj_get_content_width(lv_screen_active()); + lv_obj_t * table = lv_table_create(lv_screen_active()); // lv_obj_clean_style_list(table, LV_PART_MAIN); lv_table_set_col_cnt(table, 2); diff --git a/demos/flex_layout/lv_demo_flex_layout_ctrl_pad.c b/demos/flex_layout/lv_demo_flex_layout_ctrl_pad.c index 678b15975..edf88dae9 100644 --- a/demos/flex_layout/lv_demo_flex_layout_ctrl_pad.c +++ b/demos/flex_layout/lv_demo_flex_layout_ctrl_pad.c @@ -85,7 +85,7 @@ static void ctrl_pad_btn_remove_event_handler(lv_event_t * e) lv_obj_clean(ui->root); } else { - lv_obj_del(ui->obj_cur); + lv_obj_delete(ui->obj_cur); ui->obj_cur = NULL; } } @@ -114,7 +114,7 @@ void ctrl_pad_obj_update(lv_obj_t * obj, view_t * ui) lv_obj_add_state(checkbox, LV_STATE_CHECKED); } else { - lv_obj_clear_state(checkbox, LV_STATE_CHECKED); + lv_obj_remove_state(checkbox, LV_STATE_CHECKED); } } @@ -144,7 +144,8 @@ static void ctrl_pad_checkbox_event_handler(lv_event_t * e) view_t * ui = lv_event_get_user_data(e); if(ui->obj_cur) { bool checked = lv_obj_has_state(lv_event_get_target(e), LV_STATE_CHECKED); - checked ? lv_obj_add_flag(ui->obj_cur, LV_OBJ_FLAG_SCROLLABLE) : lv_obj_clear_flag(ui->obj_cur, LV_OBJ_FLAG_SCROLLABLE); + checked ? lv_obj_add_flag(ui->obj_cur, LV_OBJ_FLAG_SCROLLABLE) : lv_obj_remove_flag(ui->obj_cur, + LV_OBJ_FLAG_SCROLLABLE); } } diff --git a/demos/flex_layout/lv_demo_flex_layout_main.c b/demos/flex_layout/lv_demo_flex_layout_main.c index a9a0dc750..e1e10d40c 100644 --- a/demos/flex_layout/lv_demo_flex_layout_main.c +++ b/demos/flex_layout/lv_demo_flex_layout_main.c @@ -40,7 +40,7 @@ static view_t view; void lv_demo_flex_layout(void) { - view_create(lv_scr_act(), &view); + view_create(lv_screen_active(), &view); ctrl_pad_attach(&view); } diff --git a/demos/flex_layout/lv_demo_flex_layout_view.c b/demos/flex_layout/lv_demo_flex_layout_view.c index ffd941e17..c7cc4513f 100644 --- a/demos/flex_layout/lv_demo_flex_layout_view.c +++ b/demos/flex_layout/lv_demo_flex_layout_view.c @@ -69,7 +69,7 @@ void view_create(lv_obj_t * par, view_t * ui) lv_obj_set_style_shadow_color(obj, lv_color_hex3(0xaaa), 0); lv_obj_set_style_shadow_width(obj, 20, 0); lv_obj_set_style_shadow_ofs_y(obj, 2, 0); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN); lv_obj_set_flex_align( obj, diff --git a/demos/flex_layout/lv_demo_flex_layout_view_child_node.c b/demos/flex_layout/lv_demo_flex_layout_view_child_node.c index 7f94f4053..451905a87 100644 --- a/demos/flex_layout/lv_demo_flex_layout_view_child_node.c +++ b/demos/flex_layout/lv_demo_flex_layout_view_child_node.c @@ -69,7 +69,7 @@ static void obj_child_node_event_handler(lv_event_t * e) lv_obj_t * obj = lv_event_get_target(e); if(ui->obj_cur) { - lv_obj_clear_state(ui->obj_cur, LV_STATE_CHECKED); + lv_obj_remove_state(ui->obj_cur, LV_STATE_CHECKED); } lv_obj_add_state(obj, LV_STATE_CHECKED); diff --git a/demos/keypad_encoder/lv_demo_keypad_encoder.c b/demos/keypad_encoder/lv_demo_keypad_encoder.c index c16e4679d..436cc6983 100644 --- a/demos/keypad_encoder/lv_demo_keypad_encoder.c +++ b/demos/keypad_encoder/lv_demo_keypad_encoder.c @@ -66,7 +66,7 @@ void lv_demo_keypad_encoder(void) } } - tv = lv_tabview_create(lv_scr_act(), LV_DIR_TOP, LV_DPI_DEF / 3); + tv = lv_tabview_create(lv_screen_active(), LV_DIR_TOP, LV_DPI_DEF / 3); t1 = lv_tabview_add_tab(tv, "Selectors"); t2 = lv_tabview_add_tab(tv, "Text input"); @@ -153,7 +153,7 @@ static void text_input_create(lv_obj_t * parent) lv_textarea_set_one_line(ta2, true); lv_textarea_set_placeholder_text(ta2, "Type something"); - lv_obj_t * kb = lv_keyboard_create(lv_scr_act()); + lv_obj_t * kb = lv_keyboard_create(lv_screen_active()); lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN); lv_obj_add_event(ta1, ta_event_cb, LV_EVENT_ALL, kb); @@ -205,7 +205,7 @@ static void ta_event_cb(lv_event_t * e) if(code == LV_EVENT_CLICKED && indev_type == LV_INDEV_TYPE_ENCODER) { lv_keyboard_set_textarea(kb, ta); - lv_obj_clear_flag(kb, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(kb, LV_OBJ_FLAG_HIDDEN); lv_group_focus_obj(kb); lv_group_set_editing(lv_obj_get_group(kb), kb); lv_obj_set_height(tv, LV_VER_RES / 2); diff --git a/demos/keypad_encoder/lv_demo_keypad_encoder.py b/demos/keypad_encoder/lv_demo_keypad_encoder.py index e4b045b4c..16571c5d7 100644 --- a/demos/keypad_encoder/lv_demo_keypad_encoder.py +++ b/demos/keypad_encoder/lv_demo_keypad_encoder.py @@ -17,7 +17,7 @@ class KeyboardEncoder: cur_drv = cur_drv.get_next() - self.tv = lv.tabview(lv.scr_act(), lv.DIR.TOP, lv.DPI_DEF // 3) + self.tv = lv.tabview(lv.screen_active(), lv.DIR.TOP, lv.DPI_DEF // 3) self.t1 = self.tv.add_tab("Selectors") self.t2 = self.tv.add_tab("Text input") @@ -93,7 +93,7 @@ class KeyboardEncoder: ta2.set_one_line(True) ta2.set_placeholder_text("Type something") - self.kb = lv.keyboard(lv.scr_act()) + self.kb = lv.keyboard(lv.screen_active()) self.kb.add_flag(lv.obj.FLAG.HIDDEN) ta1.add_event(self.ta_event_cb, lv.EVENT.ALL, None) @@ -141,7 +141,7 @@ class KeyboardEncoder: if code == lv.EVENT.CLICKED and indev_type == lv.INDEV_TYPE.ENCODER: self.kb.set_textarea(ta) - self.kb.clear_flag(lv.obj.FLAG.HIDDEN) + self.kb.remove_flag(lv.obj.FLAG.HIDDEN) self.kb.group_focus_obj() self.kb.get_group().set_editing() self.tv.set_height(lv.pct(50)) diff --git a/demos/multilang/lv_demo_multilang.c b/demos/multilang/lv_demo_multilang.c index 4271df69e..156aedd06 100644 --- a/demos/multilang/lv_demo_multilang.c +++ b/demos/multilang/lv_demo_multilang.c @@ -158,11 +158,11 @@ void lv_demo_multilang(void) emoji_font = lv_imgfont_create(20, get_imgfont_path, NULL); font_multilang_small.fallback = emoji_font; - lv_obj_set_flex_flow(lv_scr_act(), LV_FLEX_FLOW_COLUMN); - lv_obj_set_style_pad_row(lv_scr_act(), 0, 0); - lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0xececec), 0); - lv_obj_set_style_bg_grad_color(lv_scr_act(), lv_color_hex(0xf9f9f9), 0); - lv_obj_set_style_bg_grad_dir(lv_scr_act(), LV_GRAD_DIR_HOR, 0); + lv_obj_set_flex_flow(lv_screen_active(), LV_FLEX_FLOW_COLUMN); + lv_obj_set_style_pad_row(lv_screen_active(), 0, 0); + lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0xececec), 0); + lv_obj_set_style_bg_grad_color(lv_screen_active(), lv_color_hex(0xf9f9f9), 0); + lv_obj_set_style_bg_grad_dir(lv_screen_active(), LV_GRAD_DIR_HOR, 0); static const lv_coord_t grid_cols[] = {LV_GRID_CONTENT, 4, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; static const lv_coord_t grid_rows[] = {LV_GRID_CONTENT, -10, LV_GRID_FR(1), LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST}; @@ -224,7 +224,7 @@ void lv_demo_multilang(void) uint32_t i; for(i = 0; card_info[i].image; i++) { - card_create(lv_scr_act(), &card_info[i]); + card_create(lv_screen_active(), &card_info[i]); } lv_timer_create(inactive_timer_cb, 1000, NULL); @@ -239,12 +239,12 @@ static void inactive_timer_cb(lv_timer_t * t) LV_UNUSED(t); static bool scrolled = false; - lv_obj_t * cont = lv_obj_get_child(lv_scr_act(), 0); + lv_obj_t * cont = lv_obj_get_child(lv_screen_active(), 0); if(cont == NULL) return; if(scrolled) { lv_obj_scroll_by(cont, -100, 0, LV_ANIM_ON); - lv_obj_clear_flag(lv_layer_top(), LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(lv_layer_top(), LV_OBJ_FLAG_CLICKABLE); scrolled = false; return; } @@ -275,14 +275,14 @@ static void scroll_event_cb(lv_event_t * e) if(scroll_x < w / 2) { lv_obj_set_scroll_snap_x(cont, LV_SCROLL_SNAP_NONE); - lv_obj_clear_flag(cont, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(cont, LV_OBJ_FLAG_CLICKABLE); lv_indev_wait_release(indev); lv_obj_scroll_to_view(lv_obj_get_child(cont, 0), LV_ANIM_ON); lv_anim_t a; lv_anim_init(&a); lv_anim_set_exec_cb(&a, shrink_anim_cb); - lv_anim_set_ready_cb(&a, lv_obj_del_anim_ready_cb); + lv_anim_set_ready_cb(&a, lv_obj_delete_anim_ready_cb); lv_anim_set_values(&a, 255, 0); lv_anim_set_time(&a, 400); lv_anim_set_var(&a, cont); @@ -296,14 +296,14 @@ static void card_create(lv_obj_t * parent, card_info_t * info) lv_obj_add_style(cont, &style_card_cont, 0); lv_obj_set_scroll_snap_x(cont, LV_SCROLL_SNAP_CENTER); lv_obj_add_event(cont, scroll_event_cb, LV_EVENT_RELEASED, NULL); - lv_obj_clear_flag(cont, LV_OBJ_FLAG_SCROLL_ELASTIC); + lv_obj_remove_flag(cont, LV_OBJ_FLAG_SCROLL_ELASTIC); lv_obj_set_scrollbar_mode(cont, LV_SCROLLBAR_MODE_OFF); lv_obj_t * remove = lv_obj_create(cont); lv_obj_add_style(remove, &style_hide, 0); - lv_obj_clear_flag(remove, LV_OBJ_FLAG_SNAPPABLE); + lv_obj_remove_flag(remove, LV_OBJ_FLAG_SNAPPABLE); lv_obj_add_flag(remove, LV_OBJ_FLAG_FLOATING); - lv_obj_clear_flag(remove, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(remove, LV_OBJ_FLAG_CLICKABLE); lv_obj_t * hide_label = lv_label_create(remove); lv_label_set_text(hide_label, "Hide"); @@ -314,7 +314,7 @@ static void card_create(lv_obj_t * parent, card_info_t * info) lv_obj_t * card = lv_obj_create(cont); lv_obj_add_style(card, &style_card, 0); - lv_obj_clear_flag(card, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE | LV_OBJ_FLAG_SCROLL_CHAIN_HOR); + lv_obj_remove_flag(card, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE | LV_OBJ_FLAG_SCROLL_CHAIN_HOR); lv_obj_t * avatar = lv_image_create(card); lv_image_set_src(avatar, info->image); @@ -333,7 +333,7 @@ static void card_create(lv_obj_t * parent, card_info_t * info) lv_obj_set_style_text_line_space(description, -3, 0); lv_obj_t * btn = lv_button_create(card); - lv_obj_clear_flag(card, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); + lv_obj_remove_flag(card, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); lv_obj_set_grid_cell(btn, LV_GRID_ALIGN_START, 2, 1, LV_GRID_ALIGN_CENTER, 3, 1); lv_obj_add_style(btn, &style_btn, 0); diff --git a/demos/music/lv_demo_music.c b/demos/music/lv_demo_music.c index 5d3ccc703..92a1b57a4 100644 --- a/demos/music/lv_demo_music.c +++ b/demos/music/lv_demo_music.c @@ -113,10 +113,10 @@ static const uint32_t time_list[] = { void lv_demo_music(void) { - lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x343247), 0); + lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0x343247), 0); - list = _lv_demo_music_list_create(lv_scr_act()); - ctrl = _lv_demo_music_main_create(lv_scr_act()); + list = _lv_demo_music_list_create(lv_screen_active()); + ctrl = _lv_demo_music_main_create(lv_screen_active()); #if LV_DEMO_MUSIC_AUTO_PLAY lv_timer_create(auto_step_cb, 1000, NULL); @@ -241,7 +241,7 @@ static void auto_step_cb(lv_timer_t * t) break; } case 41: - lv_scr_load(lv_obj_create(NULL)); + lv_screen_load(lv_obj_create(NULL)); _lv_demo_music_pause(); break; } diff --git a/demos/music/lv_demo_music_list.c b/demos/music/lv_demo_music_list.c index a12430516..e933ea2a4 100644 --- a/demos/music/lv_demo_music_list.c +++ b/demos/music/lv_demo_music_list.c @@ -160,7 +160,7 @@ void _lv_demo_music_list_button_check(uint32_t track_id, bool state) lv_obj_scroll_to_view(btn, LV_ANIM_ON); } else { - lv_obj_clear_state(btn, LV_STATE_CHECKED); + lv_obj_remove_state(btn, LV_STATE_CHECKED); lv_image_set_src(icon, &img_lv_demo_music_btn_list_play); } } diff --git a/demos/music/lv_demo_music_main.c b/demos/music/lv_demo_music_main.c index b52c78188..fa2bea537 100644 --- a/demos/music/lv_demo_music_main.c +++ b/demos/music/lv_demo_music_main.c @@ -288,11 +288,11 @@ lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent) /* Create an intro from a logo + label */ LV_IMAGE_DECLARE(img_lv_demo_music_logo); - lv_obj_t * logo = lv_image_create(lv_scr_act()); + lv_obj_t * logo = lv_image_create(lv_screen_active()); lv_image_set_src(logo, &img_lv_demo_music_logo); lv_obj_move_foreground(logo); - lv_obj_t * title = lv_label_create(lv_scr_act()); + lv_obj_t * title = lv_label_create(lv_screen_active()); lv_label_set_text(title, "LVGL Demo\nMusic player"); lv_obj_set_style_text_align(title, LV_TEXT_ALIGN_CENTER, 0); lv_obj_set_style_text_font(title, font_large, 0); @@ -306,7 +306,7 @@ lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent) lv_anim_set_time(&a, 400); lv_anim_set_delay(&a, INTRO_TIME + 800); lv_anim_set_values(&a, LV_SCALE_NONE, 10); - lv_anim_set_ready_cb(&a, lv_obj_del_anim_ready_cb); + lv_anim_set_ready_cb(&a, lv_obj_delete_anim_ready_cb); lv_anim_start(&a); lv_obj_update_layout(main_cont); @@ -371,11 +371,11 @@ void _lv_demo_music_pause(void) playing = false; spectrum_i_pause = spectrum_i; spectrum_i = 0; - lv_anim_del(spectrum_obj, spectrum_anim_cb); + lv_anim_delete(spectrum_obj, spectrum_anim_cb); lv_obj_invalidate(spectrum_obj); lv_image_set_zoom(album_image_obj, LV_SCALE_NONE); if(sec_counter_timer) lv_timer_pause(sec_counter_timer); - lv_obj_clear_state(play_obj, LV_STATE_CHECKED); + lv_obj_remove_state(play_obj, LV_STATE_CHECKED); } /********************** @@ -386,8 +386,8 @@ static lv_obj_t * create_cont(lv_obj_t * parent) { /*A transparent container in which the player section will be scrolled*/ main_cont = lv_obj_create(parent); - lv_obj_clear_flag(main_cont, LV_OBJ_FLAG_CLICKABLE); - lv_obj_clear_flag(main_cont, LV_OBJ_FLAG_SCROLL_ELASTIC); + lv_obj_remove_flag(main_cont, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(main_cont, LV_OBJ_FLAG_SCROLL_ELASTIC); lv_obj_remove_style_all(main_cont); /*Make it transparent*/ lv_obj_set_size(main_cont, lv_pct(100), lv_pct(100)); lv_obj_set_scroll_snap_y(main_cont, LV_SCROLL_SNAP_CENTER); /*Snap the children to the center*/ @@ -400,7 +400,7 @@ static lv_obj_t * create_cont(lv_obj_t * parent) #else lv_obj_set_size(player, LV_HOR_RES, LV_VER_RES + LV_DEMO_MUSIC_HANDLE_SIZE * 2); #endif - lv_obj_clear_flag(player, LV_OBJ_FLAG_SNAPPABLE); + lv_obj_remove_flag(player, LV_OBJ_FLAG_SNAPPABLE); lv_obj_set_style_bg_color(player, lv_color_hex(0xffffff), 0); lv_obj_set_style_border_width(player, 0, 0); @@ -411,16 +411,16 @@ static lv_obj_t * create_cont(lv_obj_t * parent) * It is used only to snap it to center.*/ lv_obj_t * placeholder1 = lv_obj_create(main_cont); lv_obj_remove_style_all(placeholder1); - lv_obj_clear_flag(placeholder1, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(placeholder1, LV_OBJ_FLAG_CLICKABLE); lv_obj_t * placeholder2 = lv_obj_create(main_cont); lv_obj_remove_style_all(placeholder2); - lv_obj_clear_flag(placeholder2, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(placeholder2, LV_OBJ_FLAG_CLICKABLE); #if LV_DEMO_MUSIC_SQUARE || LV_DEMO_MUSIC_ROUND lv_obj_t * placeholder3 = lv_obj_create(main_cont); lv_obj_remove_style_all(placeholder3); - lv_obj_clear_flag(placeholder3, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(placeholder3, LV_OBJ_FLAG_CLICKABLE); lv_obj_set_size(placeholder1, lv_pct(100), LV_VER_RES); lv_obj_set_y(placeholder1, 0); @@ -545,7 +545,7 @@ static lv_obj_t * create_spectrum_obj(lv_obj_t * parent) #else lv_obj_set_height(obj, 250); #endif - lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE); lv_obj_add_event(obj, spectrum_draw_event_cb, LV_EVENT_ALL, NULL); lv_obj_refresh_ext_draw_size(obj); album_image_obj = album_image_create(obj); @@ -714,7 +714,7 @@ static void track_load(uint32_t id) } #endif lv_anim_set_exec_cb(&a, _obj_set_x_anim_cb); - lv_anim_set_ready_cb(&a, lv_obj_del_anim_ready_cb); + lv_anim_set_ready_cb(&a, lv_obj_delete_anim_ready_cb); lv_anim_start(&a); lv_anim_set_path_cb(&a, lv_anim_path_linear); @@ -766,7 +766,7 @@ static void del_counter_timer_cb(lv_event_t * e) { lv_event_code_t code = lv_event_get_code(e); if(code == LV_EVENT_DELETE && sec_counter_timer) { - lv_timer_del(sec_counter_timer); + lv_timer_delete(sec_counter_timer); sec_counter_timer = NULL; } } @@ -891,9 +891,9 @@ static void spectrum_draw_event_cb(lv_event_t * e) } } else if(code == LV_EVENT_DELETE) { - lv_anim_del(NULL, start_anim_cb); - lv_anim_del(NULL, spectrum_anim_cb); - if(start_anim && stop_start_anim_timer) lv_timer_del(stop_start_anim_timer); + lv_anim_delete(NULL, start_anim_cb); + lv_anim_delete(NULL, spectrum_anim_cb); + if(start_anim && stop_start_anim_timer) lv_timer_delete(stop_start_anim_timer); } } @@ -963,7 +963,7 @@ static lv_obj_t * album_image_create(lv_obj_t * parent) lv_image_set_antialias(img, false); lv_obj_align(img, LV_ALIGN_CENTER, 0, 0); lv_obj_add_event(img, album_gesture_event_cb, LV_EVENT_GESTURE, NULL); - lv_obj_clear_flag(img, LV_OBJ_FLAG_GESTURE_BUBBLE); + lv_obj_remove_flag(img, LV_OBJ_FLAG_GESTURE_BUBBLE); lv_obj_add_flag(img, LV_OBJ_FLAG_CLICKABLE); return img; diff --git a/demos/scroll/lv_demo_scroll.c b/demos/scroll/lv_demo_scroll.c index c4f13cce0..706754a0d 100644 --- a/demos/scroll/lv_demo_scroll.c +++ b/demos/scroll/lv_demo_scroll.c @@ -37,7 +37,7 @@ static lv_obj_t * list; **********************/ void lv_demo_scroll(void) { - lv_obj_t * panel = lv_obj_create(lv_scr_act()); + lv_obj_t * panel = lv_obj_create(lv_screen_active()); lv_obj_set_style_shadow_width(panel, 16, 0); lv_obj_set_style_shadow_ofs_y(panel, 8, 0); lv_obj_set_style_shadow_ofs_x(panel, 4, 0); @@ -94,8 +94,8 @@ static lv_obj_t * switch_create(lv_obj_t * parent, const char * title, lv_obj_fl lv_obj_add_flag(list, flag); } else { - lv_obj_clear_state(sw, LV_STATE_CHECKED); - lv_obj_clear_flag(list, flag); + lv_obj_remove_state(sw, LV_STATE_CHECKED); + lv_obj_remove_flag(list, flag); } return cont; @@ -107,7 +107,7 @@ static void generic_swicth_event_cb(lv_event_t * e) lv_obj_flag_t flag = (lv_obj_flag_t)((lv_uintptr_t)lv_event_get_user_data(e)); if(lv_obj_has_state(sw, LV_STATE_CHECKED)) lv_obj_add_flag(list, flag); - else lv_obj_clear_flag(list, flag); + else lv_obj_remove_flag(list, flag); } #endif diff --git a/demos/stress/lv_demo_stress.c b/demos/stress/lv_demo_stress.c index 8a1aa6d02..b54756cbf 100644 --- a/demos/stress/lv_demo_stress.c +++ b/demos/stress/lv_demo_stress.c @@ -20,8 +20,8 @@ /********************** * STATIC PROTOTYPES **********************/ -static void auto_del(lv_obj_t * obj, uint32_t delay); -static void msgbox_del(lv_timer_t * tmr); +static void auto_delete(lv_obj_t * obj, uint32_t delay); +static void msgbox_delete(lv_timer_t * tmr); static void set_y_anim(void * obj, int32_t v); static void set_width_anim(void * obj, int32_t v); static void arc_set_end_angle_anim(void * obj, int32_t v); @@ -84,7 +84,7 @@ static void obj_test_task_cb(lv_timer_t * tmr) break; case 0: /* Holder for all object types */ - main_page = lv_obj_create(lv_scr_act()); + main_page = lv_obj_create(lv_screen_active()); lv_obj_set_size(main_page, LV_HOR_RES / 2, LV_VER_RES); lv_obj_set_flex_flow(main_page, LV_FLEX_FLOW_COLUMN); @@ -96,7 +96,7 @@ static void obj_test_task_cb(lv_timer_t * tmr) break; case 1: { - obj = lv_tabview_create(lv_scr_act(), LV_DIR_TOP, 50); + obj = lv_tabview_create(lv_screen_active(), LV_DIR_TOP, 50); lv_obj_set_size(obj, LV_HOR_RES / 2, LV_VER_RES / 2); lv_obj_align(obj, LV_ALIGN_BOTTOM_RIGHT, 0, 0); lv_obj_t * t = lv_tabview_add_tab(obj, "First"); @@ -108,7 +108,7 @@ static void obj_test_task_cb(lv_timer_t * tmr) t = lv_tabview_add_tab(obj, LV_SYMBOL_CLOSE); lv_tabview_set_act(obj, 1, LV_ANIM_ON); - auto_del(obj, LV_DEMO_STRESS_TIME_STEP * 5 + 30); + auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 5 + 30); } break; @@ -130,14 +130,14 @@ static void obj_test_task_cb(lv_timer_t * tmr) lv_anim_start(&a); /*Delete the object a few sec later*/ - auto_del(obj, LV_DEMO_STRESS_TIME_STEP * 10); + auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 10); obj = lv_label_create(obj); lv_label_set_text_fmt(obj, "Formatted:\n%d %s", 12, "Volt"); break; case 3: - ta = lv_textarea_create(lv_scr_act()); + ta = lv_textarea_create(lv_screen_active()); lv_obj_align_to(ta, main_page, LV_ALIGN_OUT_RIGHT_TOP, 10, 10); lv_obj_set_size(ta, LV_HOR_RES / 3, LV_VER_RES / 4); lv_textarea_set_placeholder_text(ta, "The placeholder"); @@ -147,7 +147,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_del_async(obj); /*Delete on next call of `lv_task_handler` (so not now)*/ + lv_obj_delete_async(obj); /*Delete on next call of `lv_task_handler` (so not now)*/ break; case 5: @@ -163,29 +163,29 @@ static void obj_test_task_cb(lv_timer_t * tmr) lv_bar_set_value(obj, 1800, LV_ANIM_ON); lv_bar_set_start_value(obj, -500, LV_ANIM_ON); - auto_del(obj, LV_DEMO_STRESS_TIME_STEP * 2 + 70); + auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 2 + 70); obj = lv_slider_create(main_page); lv_obj_set_style_anim_time(obj, LV_DEMO_STRESS_TIME_STEP * 8, 0); lv_slider_set_value(obj, 5000, LV_ANIM_ON); /*Animate to out of range value*/ - auto_del(obj, LV_DEMO_STRESS_TIME_STEP * 5 + 22); + auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 5 + 22); obj = lv_switch_create(main_page); obj = lv_switch_create(main_page); lv_obj_add_state(obj, LV_STATE_CHECKED); - auto_del(obj, 730); + auto_delete(obj, 730); break; case 8: - obj = lv_win_create(lv_scr_act()); + obj = lv_win_create(lv_screen_active()); lv_obj_set_size(obj, LV_HOR_RES / 2, LV_VER_RES / 2); lv_obj_align(obj, LV_ALIGN_BOTTOM_RIGHT, 0, 0); lv_win_add_title(obj, "Window title"); lv_win_add_button(obj, LV_SYMBOL_CLOSE, 40); lv_win_add_button(obj, LV_SYMBOL_DOWN, 40); - auto_del(obj, LV_DEMO_STRESS_TIME_STEP * 3 + 5); + auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 3 + 5); obj = lv_calendar_create(lv_win_get_content(obj)); break; @@ -194,7 +194,7 @@ static void obj_test_task_cb(lv_timer_t * tmr) "Here area some dummy sentences to be sure the text area will be really scrollable."); break; case 10: - obj = lv_keyboard_create(lv_scr_act()); + obj = lv_keyboard_create(lv_screen_active()); lv_keyboard_set_mode(obj, LV_KEYBOARD_MODE_TEXT_UPPER); lv_anim_init(&a); lv_anim_set_var(&a, obj); @@ -203,7 +203,7 @@ static void obj_test_task_cb(lv_timer_t * tmr) lv_anim_set_exec_cb(&a, set_y_anim); lv_anim_start(&a); - auto_del(obj, LV_DEMO_STRESS_TIME_STEP * 2 + 18); + auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 2 + 18); break; case 11: @@ -211,14 +211,14 @@ static void obj_test_task_cb(lv_timer_t * tmr) lv_dropdown_set_options(obj, "Zero\nOne\nTwo\nThree\nFour\nFive\nSix\nSeven\nEight"); lv_dropdown_open(obj); lv_dropdown_set_selected(obj, 2); - auto_del(obj, LV_DEMO_STRESS_TIME_STEP * 3 + 11); + auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 3 + 11); break; case 12: obj = lv_roller_create(main_page); lv_roller_set_options(obj, "Zero\nOne\nTwo\nThree\nFour\nFive\nSix\nSeven\nEight", LV_ROLLER_MODE_INFINITE); lv_roller_set_selected(obj, 2, LV_ANIM_ON); - auto_del(obj, LV_DEMO_STRESS_TIME_STEP * 20 + 22); + auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 20 + 22); break; case 13: @@ -237,13 +237,13 @@ static void obj_test_task_cb(lv_timer_t * tmr) lv_scale_set_mode(obj, LV_SCALE_MODE_ROUND_INNER); lv_obj_scroll_to_view(obj, LV_ANIM_ON); - auto_del(obj, LV_DEMO_STRESS_TIME_STEP * 6 + 30); + auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 6 + 30); break; case 14: obj = lv_msgbox_create(NULL, "Title", "Some text on the message box with average length", mbox_buttons, true); - lv_timer_t * msgbox_tmr = lv_timer_create(msgbox_del, LV_DEMO_STRESS_TIME_STEP * 5 + 30, obj); + lv_timer_t * msgbox_tmr = lv_timer_create(msgbox_delete, LV_DEMO_STRESS_TIME_STEP * 5 + 30, obj); lv_timer_set_repeat_count(msgbox_tmr, 1); lv_obj_align(obj, LV_ALIGN_RIGHT_MID, -10, 0); break; @@ -253,9 +253,9 @@ static void obj_test_task_cb(lv_timer_t * tmr) break; case 16: { - lv_obj_t * tv = lv_tileview_create(lv_scr_act()); + lv_obj_t * tv = lv_tileview_create(lv_screen_active()); lv_obj_set_size(tv, 200, 200); - auto_del(tv, LV_DEMO_STRESS_TIME_STEP * 4 + 5); + auto_delete(tv, LV_DEMO_STRESS_TIME_STEP * 4 + 5); obj = lv_tileview_add_tile(tv, 0, 0, LV_DIR_ALL); obj = lv_label_create(obj); @@ -278,18 +278,18 @@ static void obj_test_task_cb(lv_timer_t * tmr) { lv_obj_t * b; b = lv_list_add_button(obj, LV_SYMBOL_OK, "1. Some very long text to scroll"); - auto_del(b, 10); + auto_delete(b, 10); lv_list_add_button(obj, LV_SYMBOL_OK, "2. Some very long text to scroll"); lv_list_add_button(obj, LV_SYMBOL_OK, "3. Some very long text to scroll"); b = lv_list_add_button(obj, LV_SYMBOL_OK, "4. Some very long text to scroll"); - auto_del(b, LV_DEMO_STRESS_TIME_STEP); + auto_delete(b, LV_DEMO_STRESS_TIME_STEP); b = lv_list_add_button(obj, LV_SYMBOL_OK, "5. Some very long text to scroll"); - auto_del(b, LV_DEMO_STRESS_TIME_STEP + 90); + auto_delete(b, LV_DEMO_STRESS_TIME_STEP + 90); b = lv_list_add_button(obj, LV_SYMBOL_OK, "6. Some very long text to scroll"); - auto_del(b, LV_DEMO_STRESS_TIME_STEP + 10); + auto_delete(b, LV_DEMO_STRESS_TIME_STEP + 10); lv_obj_scroll_to_view(lv_obj_get_child(obj, -1), LV_ANIM_ON); } - auto_del(obj, LV_DEMO_STRESS_TIME_STEP * 5 + 15); + auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 5 + 15); obj = lv_table_create(main_page); lv_table_set_cell_value(obj, 0, 0, "0,0"); @@ -347,7 +347,7 @@ static void obj_test_task_cb(lv_timer_t * tmr) lv_spinbox_set_step(obj, 1); lv_spinbox_increment(obj); lv_spinbox_increment(obj); - auto_del(obj, LV_DEMO_STRESS_TIME_STEP * 2 + 15); + auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 2 + 15); lv_obj_scroll_by(main_page, 0, 20, LV_ANIM_ON); @@ -368,7 +368,7 @@ static void obj_test_task_cb(lv_timer_t * tmr) lv_chart_set_next_value(obj, s1, 48); lv_chart_set_next_value(obj, s1, 72); - auto_del(obj, LV_DEMO_STRESS_TIME_STEP * 3); + auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 3); } lv_obj_scroll_by(main_page, 0, 20, LV_ANIM_ON); @@ -377,14 +377,14 @@ static void obj_test_task_cb(lv_timer_t * tmr) case 24: obj = lv_checkbox_create(main_page); lv_checkbox_set_text(obj, "An option to select"); - auto_del(obj, LV_DEMO_STRESS_TIME_STEP * 2 + 20); + auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 2 + 20); obj = lv_checkbox_create(main_page); lv_obj_add_state(obj, LV_STATE_CHECKED); obj = lv_checkbox_create(main_page); lv_obj_add_state(obj, LV_STATE_CHECKED | LV_STATE_DISABLED); - auto_del(obj, LV_DEMO_STRESS_TIME_STEP * 1 + 60); + auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 1 + 60); lv_obj_scroll_by(main_page, 0, 20, LV_ANIM_ON); @@ -395,7 +395,7 @@ static void obj_test_task_cb(lv_timer_t * tmr) { uint16_t i; for(i = 0; i < 64; i++) { - lv_textarea_del_char_forward(ta); + lv_textarea_delete_char_forward(ta); } } break; @@ -405,11 +405,11 @@ static void obj_test_task_cb(lv_timer_t * tmr) break; case 29: lv_obj_clean(main_page); - lv_obj_del(ta); + lv_obj_delete(ta); ta = NULL; break; case 31: - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); main_page = NULL; g_state = -2; break; @@ -420,19 +420,19 @@ static void obj_test_task_cb(lv_timer_t * tmr) g_state++; } -static void auto_del(lv_obj_t * obj, uint32_t delay) +static void auto_delete(lv_obj_t * obj, uint32_t delay) { lv_anim_t a; lv_anim_init(&a); lv_anim_set_var(&a, obj); lv_anim_set_time(&a, 0); lv_anim_set_delay(&a, delay); - lv_anim_set_ready_cb(&a, lv_obj_del_anim_ready_cb); + lv_anim_set_ready_cb(&a, lv_obj_delete_anim_ready_cb); lv_anim_start(&a); } -static void msgbox_del(lv_timer_t * tmr) +static void msgbox_delete(lv_timer_t * tmr) { lv_msgbox_close(tmr->user_data); } diff --git a/demos/transform/lv_demo_transform.c b/demos/transform/lv_demo_transform.c index 9ea6baa7b..156995259 100644 --- a/demos/transform/lv_demo_transform.c +++ b/demos/transform/lv_demo_transform.c @@ -88,7 +88,7 @@ void lv_demo_transform(void) lv_obj_center(card_to_transform); lv_coord_t disp_w = lv_display_get_horizontal_resolution(NULL); - lv_obj_t * arc = lv_arc_create(lv_scr_act()); + lv_obj_t * arc = lv_arc_create(lv_screen_active()); lv_obj_set_size(arc, disp_w - 20, disp_w - 20); lv_arc_set_range(arc, 0, 270); lv_arc_set_value(arc, 225); @@ -96,7 +96,7 @@ void lv_demo_transform(void) lv_obj_add_flag(arc, LV_OBJ_FLAG_ADV_HITTEST); lv_obj_center(arc); - lv_obj_t * slider = lv_slider_create(lv_scr_act()); + lv_obj_t * slider = lv_slider_create(lv_screen_active()); lv_obj_set_width(slider, lv_pct(70)); lv_obj_align(slider, LV_ALIGN_BOTTOM_MID, 0, -20); lv_obj_add_event(slider, slider_event_cb, LV_EVENT_VALUE_CHANGED, NULL); @@ -110,9 +110,9 @@ void lv_demo_transform(void) static lv_obj_t * card_create(void) { - lv_obj_t * card = lv_obj_create(lv_scr_act()); + lv_obj_t * card = lv_obj_create(lv_screen_active()); lv_obj_add_style(card, &style_card, 0); - lv_obj_clear_flag(card, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE | LV_OBJ_FLAG_SCROLL_CHAIN_HOR); + lv_obj_remove_flag(card, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE | LV_OBJ_FLAG_SCROLL_CHAIN_HOR); lv_obj_t * avatar = lv_image_create(card); lv_image_set_src(avatar, &img_transform_avatar_15); @@ -125,7 +125,7 @@ static lv_obj_t * card_create(void) lv_obj_set_style_text_font(name, &lv_font_montserrat_18, 0); lv_obj_t * btn = lv_button_create(card); - lv_obj_clear_flag(card, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); + lv_obj_remove_flag(card, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); lv_obj_set_grid_cell(btn, LV_GRID_ALIGN_START, 2, 1, LV_GRID_ALIGN_CENTER, 3, 1); lv_obj_add_style(btn, &style_btn, 0); diff --git a/demos/widgets/lv_demo_widgets.c b/demos/widgets/lv_demo_widgets.c index d2004d03b..2417c0232 100644 --- a/demos/widgets/lv_demo_widgets.c +++ b/demos/widgets/lv_demo_widgets.c @@ -162,9 +162,9 @@ void lv_demo_widgets(void) lv_style_set_border_width(&style_bullet, 0); lv_style_set_radius(&style_bullet, LV_RADIUS_CIRCLE); - tv = lv_tabview_create(lv_scr_act(), LV_DIR_TOP, tab_h); + tv = lv_tabview_create(lv_screen_active(), LV_DIR_TOP, tab_h); - lv_obj_set_style_text_font(lv_scr_act(), font_normal, 0); + lv_obj_set_style_text_font(lv_screen_active(), font_normal, 0); if(disp_size == DISP_LARGE) { lv_obj_t * tab_buttons = lv_tabview_get_tab_buttons(tv); @@ -247,7 +247,7 @@ static void profile_create(lv_obj_t * parent) lv_obj_center(label); /*Create a keyboard*/ - lv_obj_t * kb = lv_keyboard_create(lv_scr_act()); + lv_obj_t * kb = lv_keyboard_create(lv_screen_active()); lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN); /*Create the second panel*/ @@ -657,7 +657,7 @@ static void analytics_create(lv_obj_t * parent) lv_obj_set_style_arc_opa(arc, 0, 0); lv_obj_set_style_arc_width(arc, 15, LV_PART_INDICATOR); lv_obj_set_style_arc_color(arc, lv_palette_main(LV_PALETTE_BLUE), LV_PART_INDICATOR); - lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(arc, LV_OBJ_FLAG_CLICKABLE); lv_anim_set_exec_cb(&a, scale1_indic1_anim_cb); lv_anim_set_var(&a, arc); @@ -672,7 +672,7 @@ static void analytics_create(lv_obj_t * parent) lv_obj_set_style_arc_opa(arc, 0, 0); lv_obj_set_style_arc_width(arc, 15, LV_PART_INDICATOR); lv_obj_set_style_arc_color(arc, lv_palette_main(LV_PALETTE_RED), LV_PART_INDICATOR); - lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(arc, LV_OBJ_FLAG_CLICKABLE); lv_obj_center(arc); lv_anim_set_exec_cb(&a, scale1_indic1_anim_cb); @@ -688,7 +688,7 @@ static void analytics_create(lv_obj_t * parent) lv_obj_set_style_arc_opa(arc, 0, 0); lv_obj_set_style_arc_width(arc, 15, LV_PART_INDICATOR); lv_obj_set_style_arc_color(arc, lv_palette_main(LV_PALETTE_GREEN), LV_PART_INDICATOR); - lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(arc, LV_OBJ_FLAG_CLICKABLE); lv_obj_center(arc); lv_anim_set_exec_cb(&a, scale1_indic1_anim_cb); @@ -710,7 +710,7 @@ static void analytics_create(lv_obj_t * parent) lv_obj_set_style_arc_width(arc, 10, LV_PART_INDICATOR); lv_obj_set_style_arc_rounded(arc, false, LV_PART_INDICATOR); lv_obj_set_style_arc_color(arc, lv_palette_main(LV_PALETTE_BLUE), LV_PART_INDICATOR); - lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(arc, LV_OBJ_FLAG_CLICKABLE); lv_obj_center(arc); arc = lv_arc_create(scale2); @@ -721,7 +721,7 @@ static void analytics_create(lv_obj_t * parent) lv_obj_set_style_arc_width(arc, 20, LV_PART_INDICATOR); lv_obj_set_style_arc_rounded(arc, false, LV_PART_INDICATOR); lv_obj_set_style_arc_color(arc, lv_palette_main(LV_PALETTE_RED), LV_PART_INDICATOR); - lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(arc, LV_OBJ_FLAG_CLICKABLE); lv_obj_center(arc); arc = lv_arc_create(scale2); @@ -731,7 +731,7 @@ static void analytics_create(lv_obj_t * parent) lv_obj_set_style_arc_width(arc, 30, LV_PART_INDICATOR); lv_obj_set_style_arc_rounded(arc, false, LV_PART_INDICATOR); lv_obj_set_style_arc_color(arc, lv_palette_main(LV_PALETTE_GREEN), LV_PART_INDICATOR); - lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(arc, LV_OBJ_FLAG_CLICKABLE); lv_obj_center(arc); lv_timer_t * scale2_timer = lv_timer_create(scale2_timer_cb, 100, scale2); @@ -999,7 +999,7 @@ static void color_changer_create(lv_obj_t * parent) lv_obj_set_style_opa(c, LV_OPA_TRANSP, 0); lv_obj_set_size(c, 20, 20); lv_obj_add_event(c, color_event_cb, LV_EVENT_ALL, &palette[i]); - lv_obj_clear_flag(c, LV_OBJ_FLAG_SCROLL_ON_FOCUS); + lv_obj_remove_flag(c, LV_OBJ_FLAG_SCROLL_ON_FOCUS); } lv_obj_t * btn = lv_button_create(parent); @@ -1216,7 +1216,7 @@ static void ta_event_cb(lv_event_t * e) lv_obj_set_style_max_height(kb, LV_HOR_RES * 2 / 3, 0); lv_obj_update_layout(tv); /*Be sure the sizes are recalculated*/ lv_obj_set_height(tv, LV_VER_RES - lv_obj_get_height(kb)); - lv_obj_clear_flag(kb, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(kb, LV_OBJ_FLAG_HIDDEN); lv_obj_scroll_to_view_recursive(ta, LV_ANIM_OFF); lv_indev_wait_release(lv_event_get_param(e)); } @@ -1272,9 +1272,9 @@ static void calendar_event_cb(lv_event_t * e) lv_snprintf(buf, sizeof(buf), "%02d.%02d.%d", d.day, d.month, d.year); lv_textarea_set_text(ta, buf); - lv_obj_del(calendar); + lv_obj_delete(calendar); calendar = NULL; - lv_obj_clear_flag(lv_layer_top(), LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(lv_layer_top(), LV_OBJ_FLAG_CLICKABLE); lv_obj_set_style_bg_opa(lv_layer_top(), LV_OPA_TRANSP, 0); } } @@ -1494,7 +1494,7 @@ static void scale2_event_cb(lv_event_t * e) lv_event_code_t code = lv_event_get_code(e); if(code == LV_EVENT_DELETE) { lv_timer_t * scale2_timer = lv_event_get_user_data(e); - if(scale2_timer) lv_timer_del(scale2_timer); + if(scale2_timer) lv_timer_delete(scale2_timer); } } diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst index 513f5fead..6df73a998 100644 --- a/docs/CHANGELOG.rst +++ b/docs/CHANGELOG.rst @@ -675,7 +675,7 @@ Fixes `25ce6e3 <https://github.com/lvgl/lvgl/commit/25ce6e3ae9e144e2df5dad34475dda3542015f6a>`__ - fix(indev): do not send keys to objects in disabled state `b0a46c4 <https://github.com/lvgl/lvgl/commit/b0a46c4837c922cb1303ef768da3209e7efa45ae>`__ -- fix(disp): make lv_scr_load work better with lv_scr_load_anim and +- fix(disp): make lv_screen_load work better with lv_screen_load_anim and auto_del = true `52287fd <https://github.com/lvgl/lvgl/commit/52287fd64ad59c35794d1f4486b777f4eb686abc>`__ - fix(draw): create intermediate layer for blend modes too @@ -1084,7 +1084,7 @@ Fixes `2944 <https://github.com/littlevgl/lvgl/pull/2944>`__ - fix(rlottie): fix variable name `2971 <https://github.com/littlevgl/lvgl/pull/2971>`__ -- fix(group): in lv_group_del() remove group from indev (lvgl#2963) +- fix(group): in lv_group_delete() remove group from indev (lvgl#2963) `2964 <https://github.com/littlevgl/lvgl/pull/2964>`__ - fix(obj): old parent's scroll is not updated in lv_obj_set_parent() `2965 <https://github.com/littlevgl/lvgl/pull/2965>`__ @@ -1623,7 +1623,7 @@ New Features - feat(event) add LV_SCREEN\_(UN)LOAD_START `7bae9e3 <https://github.com/lvgl/lvgl/commit/7bae9e3ddde9d6bdc06ae437f20a789cd330a556>`__ -- feat(obj) add lv_obj_del_delayed() +- feat(obj) add lv_obj_delete_delayed() `c6a2e15 <https://github.com/lvgl/lvgl/commit/c6a2e15ec23c8e96f71bafa8e43ef67fc4a73d0a>`__ - feat(docs) add view on GitHub link @@ -1811,7 +1811,7 @@ Fixes and lv_tick_inc() `2675 <https://github.com/lvgl/lvgl/pull/2675>`__ -- fix(anim_timeline) avoid calling lv_anim_del(NULL, NULL) +- fix(anim_timeline) avoid calling lv_anim_delete(NULL, NULL) `2628 <https://github.com/lvgl/lvgl/pull/2628>`__ - fix(kconfig) sync Kconfig with the latest lv_conf_template.h @@ -2245,7 +2245,7 @@ Fixes `e41c507 <https://github.com/lvgl/lvgl/commit/e41c50780495c7d6ac6a2b0edf12fc98c9d85a6b>`__ - fix(disp) be sure the pending scr load animation is finished in - lv_scr_load_anim + lv_screen_load_anim `eb6ae52 <https://github.com/lvgl/lvgl/commit/eb6ae526432453e4b9dbc7a760cd65d164050548>`__ - fix(color) fox color premult precision with 16-bit color depth @@ -2999,7 +2999,7 @@ Others - Fix typo in commands to build rlottie `2723 <https://github.com/lvgl/lvgl/pull/2723>`__ -- del(.gitmodules): delete .gitmodules +- delete(.gitmodules): delete .gitmodules `2718 <https://github.com/lvgl/lvgl/pull/2718>`__ - lv_obj_draw_part_dsc_t.text_length added @@ -3542,7 +3542,7 @@ v7.8.1 (15.12.2020) Bugfixes ~~~~~~~~ -- fix(lv_scr_load_anim) fix when multiple screens are loaded at the +- fix(lv_screen_load_anim) fix when multiple screens are loaded at the same time with delay - fix(page) fix LV_SCROLLBAR_MODE_DRAG @@ -3822,7 +3822,7 @@ v7.2.0 (21.07.2020) New features ~~~~~~~~~~~~ -- Add screen transitions with lv_scr_load_anim() +- Add screen transitions with lv_screen_load_anim() - Add display background color, wallpaper and opacity. Shown when the screen is transparent. Can be used with lv_disp_set_bg_opa/color/image(). diff --git a/docs/get-started/bindings/micropython.rst b/docs/get-started/bindings/micropython.rst index fdbd21b01..9c392e6b8 100644 --- a/docs/get-started/bindings/micropython.rst +++ b/docs/get-started/bindings/micropython.rst @@ -88,7 +88,7 @@ A simple example btn.align(lv.ALIGN.CENTER, 0, 0) label = lv.label(btn) label.set_text('Hello World!') - lv.scr_load(scr) + lv.screen_load(scr) How can I use it? diff --git a/docs/get-started/bindings/pikascript.rst b/docs/get-started/bindings/pikascript.rst index 3824612e1..26c73b751 100644 --- a/docs/get-started/bindings/pikascript.rst +++ b/docs/get-started/bindings/pikascript.rst @@ -59,7 +59,7 @@ LV_ARC import PikaStdLib mem = PikaStdLib.MemChecker() # Create an Arc - arc = lv.arc(lv.scr_act()) + arc = lv.arc(lv.screen_active()) arc.set_end_angle(200) arc.set_size(150, 150) arc.center() @@ -75,7 +75,7 @@ LV_BAR import pika_lvgl as lv import PikaStdLib mem = PikaStdLib.MemChecker() - bar1 = lv.bar(lv.scr_act()) + bar1 = lv.bar(lv.screen_active()) bar1.set_size(200, 20) bar1.center() bar1.set_value(70, lv.ANIM.OFF) @@ -97,9 +97,9 @@ LV_BTN def event_cb_2(evt): print('in evt2') print('mem used now: %0.2f kB' % (mem.getNow())) - btn1 = lv.btn(lv.scr_act()) + btn1 = lv.btn(lv.screen_active()) btn1.align(lv.ALIGN.TOP_MID, 0, 10) - btn2 = lv.btn(lv.scr_act()) + btn2 = lv.btn(lv.screen_active()) btn2.align(lv.ALIGN.TOP_MID, 0, 50) btn1.add_event(event_cb_1, lv.EVENT.CLICKED, 0) btn2.add_event(event_cb_2, lv.EVENT.CLICKED, 0) @@ -115,18 +115,18 @@ LV_CHECKBOX import pika_lvgl as lv import PikaStdLib mem = PikaStdLib.MemChecker() - cb = lv.checkbox(lv.scr_act()) + cb = lv.checkbox(lv.screen_active()) cb.set_text("Apple") cb.align(lv.ALIGN.TOP_LEFT, 0 ,0) - cb = lv.checkbox(lv.scr_act()) + cb = lv.checkbox(lv.screen_active()) cb.set_text("Banana") cb.add_state(lv.STATE.CHECKED) cb.align(lv.ALIGN.TOP_LEFT, 0 ,30) - cb = lv.checkbox(lv.scr_act()) + cb = lv.checkbox(lv.screen_active()) cb.set_text("Lemon") cb.add_state(lv.STATE.DISABLED) cb.align(lv.ALIGN.TOP_LEFT, 0 ,60) - cb = lv.checkbox(lv.scr_act()) + cb = lv.checkbox(lv.screen_active()) cb.add_state(lv.STATE.CHECKED | lv.STATE.DISABLED) cb.set_text("Melon") cb.align(lv.ALIGN.TOP_LEFT, 0 ,90) diff --git a/docs/get-started/os/zephyr.rst b/docs/get-started/os/zephyr.rst index 40fca6620..fef6ed7a3 100644 --- a/docs/get-started/os/zephyr.rst +++ b/docs/get-started/os/zephyr.rst @@ -74,7 +74,7 @@ Leveraging Zephyr Features Shell ~~~~~ -Zephyr includes a powerful shell implementation that can be enabled with the Kconfig symbols +Zephyr includes a powerful shell implementation that can be enabled with the Kconfig symbols :code:`CONFIG_SHELL` and :code:`CONFIG_LV_Z_SHELL` (the demos from above have it enabled by default). The shell offers enabling/disabling of LVGL monkeys: @@ -130,7 +130,7 @@ Example with the encoder device to assign a :code:`lv_group_t`: lv_obj_t *arc; lv_group_t *arc_group; - arc = lv_arc_create(lv_scr_act()); + arc = lv_arc_create(lv_screen_active()); lv_obj_align(arc, LV_ALIGN_CENTER, 0, 0); lv_obj_set_size(arc, 150, 150); diff --git a/docs/get-started/platforms/stm32.rst b/docs/get-started/platforms/stm32.rst index 8f8625017..bcedf7d58 100644 --- a/docs/get-started/platforms/stm32.rst +++ b/docs/get-started/platforms/stm32.rst @@ -59,11 +59,11 @@ the *main.c* file. \* Create some frame buffer(s) as global variables: .. code:: c // Change the active screen's background color - lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x003a57), LV_PART_MAIN); - lv_obj_set_style_text_color(lv_scr_act(), lv_color_hex(0xffffff), LV_PART_MAIN); + lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0x003a57), LV_PART_MAIN); + lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0xffffff), LV_PART_MAIN); /*Create a spinner*/ - lv_obj_t * spinner = lv_spinner_create(lv_scr_act(), 1000, 60); + lv_obj_t * spinner = lv_spinner_create(lv_screen_active(), 1000, 60); lv_obj_set_size(spinner, 64, 64); lv_obj_align(spinner, LV_ALIGN_BOTTOM_MID, 0, 0); @@ -87,7 +87,7 @@ the *main.c* file. \* Create some frame buffer(s) as global variables: void SysTick_Handler(void) { /* USER CODE BEGIN SysTick_IRQn 0 */ - + HAL_SYSTICK_IRQHandler(); lv_tick_inc(1); #ifdef USE_RTOS_SYSTICK @@ -183,11 +183,11 @@ variables: .. code:: c // Change the active screen's background color - lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x003a57), LV_PART_MAIN); - lv_obj_set_style_text_color(lv_scr_act(), lv_color_hex(0xffffff), LV_PART_MAIN); - + lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0x003a57), LV_PART_MAIN); + lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0xffffff), LV_PART_MAIN); + /*Create a spinner*/ - lv_obj_t * spinner = lv_spinner_create(lv_scr_act(), 1000, 60); + lv_obj_t * spinner = lv_spinner_create(lv_screen_active(), 1000, 60); lv_obj_set_size(spinner, 64, 64); lv_obj_align(spinner, LV_ALIGN_BOTTOM_MID, 0, 0); diff --git a/docs/get-started/platforms/tasmota-berry.rst b/docs/get-started/platforms/tasmota-berry.rst index d2589f738..1072b232c 100644 --- a/docs/get-started/platforms/tasmota-berry.rst +++ b/docs/get-started/platforms/tasmota-berry.rst @@ -85,7 +85,7 @@ A simple example .. code:: python lv.start() # start LVGL - scr = lv.scr_act() # get default screen + scr = lv.screen_active() # get default screen btn = lv.btn(scr) # create button btn.center() label = lv.label(btn) # create a label in the button diff --git a/docs/get-started/quick-overview.rst b/docs/get-started/quick-overview.rst index b4d29b0c0..8f80b2103 100644 --- a/docs/get-started/quick-overview.rst +++ b/docs/get-started/quick-overview.rst @@ -16,8 +16,8 @@ Instead of porting LVGL to embedded hardware straight away, it's highly recommended to get started in a simulator first. LVGL is ported to many IDEs to be sure you will find your favorite one. -Go to the :ref:`simulator` section to get ready-to-use projects that can be run -on your PC. This way you can save the time of porting for now and get some +Go to the :ref:`simulator` section to get ready-to-use projects that can be run +on your PC. This way you can save the time of porting for now and get some experience with LVGL immediately. Add LVGL into your project @@ -126,8 +126,8 @@ other words, the parts of the children outside the parent are clipped. A Screen is the "root" parent. You can have any number of screens. -To get the current screen call :cpp:func:`lv_scr_act`, and to load a screen -use :cpp:expr:`lv_scr_load(scr1)`. +To get the current screen call :cpp:func:`lv_screen_active`, and to load a screen +use :cpp:expr:`lv_screen_load(scr1)`. You can create a new object with ``lv_<type>_create(parent)``. It will return an :cpp:type:`lv_obj_t` ``*`` variable that can be used as a reference to the @@ -137,7 +137,7 @@ For example: .. code:: c - lv_obj_t * slider1 = lv_slider_create(lv_scr_act()); + lv_obj_t * slider1 = lv_slider_create(lv_screen_active()); To set some basic attributes ``lv_obj_set_<parameter_name>(obj, <value>)`` functions can be used. For example: @@ -239,7 +239,7 @@ To manually add or remove states use: .. code:: c lv_obj_add_state(obj, LV_STATE_...); - lv_obj_clear_state(obj, LV_STATE_...); + lv_obj_remove_state(obj, LV_STATE_...); Styles ~~~~~~ @@ -342,9 +342,9 @@ Learn more about :ref:`micropython`. # Create a Button and a Label scr = lv.obj() btn = lv.btn(scr) - btn.align(lv.scr_act(), lv.ALIGN.CENTER, 0, 0) + btn.align(lv.screen_active(), lv.ALIGN.CENTER, 0, 0) label = lv.label(btn) label.set_text("Button") # Load the screen - lv.scr_load(scr) + lv.screen_load(scr) diff --git a/docs/libs/freetype.rst b/docs/libs/freetype.rst index 1dd28b6cf..fcd5fe113 100644 --- a/docs/libs/freetype.rst +++ b/docs/libs/freetype.rst @@ -12,11 +12,11 @@ First, Download FreeType from `here <https://sourceforge.net/projects/freetype/f There are two ways to use FreeType: ### For UNIX For UNIX systems, it is recommended to use the way of compiling and installing libraries. - -Enter the FreeType source code directory. +Enter the FreeType source code directory. -- ``make`` +- ``make`` - ``sudo make install`` -- Add include path: ``/usr/include/freetype2`` (for GCC: ``-I/usr/include/freetype2 -L/usr/local/lib``) +- Add include path: ``/usr/include/freetype2`` (for GCC: ``-I/usr/include/freetype2 -L/usr/local/lib``) - Link library: ``freetype`` (for GCC: ``-L/usr/local/lib -lfreetype``) For Embedded Devices @@ -58,11 +58,11 @@ Usage Enable :c:macro:`LV_USE_FREETYPE` in ``lv_conf.h``. -Cache configuration: +Cache configuration: - :c:macro:`LV_FREETYPE_CACHE_SIZE` Maximum memory(Bytes) used to cache font bitmap, outline, character maps, etc. - :Note: This value does not include the memory used by ``FT_Face`` and ``FT_Size`` objects -- :c:macro:`LV_FREETYPE_CACHE_FT_FACES`: Maximum open number of ``FT_Face`` objects. + :Note: This value does not include the memory used by ``FT_Face`` and ``FT_Size`` objects +- :c:macro:`LV_FREETYPE_CACHE_FT_FACES`: Maximum open number of ``FT_Face`` objects. - :c:macro:`LV_FREETYPE_CACHE_FT_SIZES`: Maximum open number of ``FT_Size`` objects. When you are sure that all the used font sizes will not be greater than @@ -78,7 +78,7 @@ interface, you can enable :c:macro:`LV_FREETYPE_USE_LVGL_PORT` in ``lv_conf.h``, convenient for unified management. The font style supports *Italic* and **Bold** fonts processed by -software, and can be set with reference to the following values: +software, and can be set with reference to the following values: - :c:enumerator:`LV_FREETYPE_FONT_STYLE_NORMAL`: Default style. - :c:enumerator:`LV_FREETYPE_FONT_STYLE_ITALIC`: Italic style. @@ -88,7 +88,7 @@ They can be combined.eg: :c:expr:`LV_FREETYPE_FONT_STYLE_BOLD | LV_FREETYPE_FONT_STYLE_ITALIC`. Use the :c:expr:`lv_freetype_font_create()` function to create a font. To -delete a font, use :c:expr:`lv_freetype_font_del()`. For more detailed usage, +delete a font, use :c:expr:`lv_freetype_font_delete()`. For more detailed usage, please refer to example code. Example diff --git a/docs/others/file_explorer.rst b/docs/others/file_explorer.rst index ef4739e50..33a392a36 100644 --- a/docs/others/file_explorer.rst +++ b/docs/others/file_explorer.rst @@ -56,7 +56,7 @@ Usage Enable :c:macro:`LV_USE_FILE_EXPLORER` in ``lv_conf.h``. -First use :c:expr:`lv_file_explorer_create(lv_scr_act())` to create a file +First use :c:expr:`lv_file_explorer_create(lv_screen_active())` to create a file explorer, The default size is the screen size. After that, you can customize the style like widget. @@ -80,7 +80,7 @@ customize the style like widget. 在 ``lv_conf.h`` 中打开 :c:macro:`LV_USE_FILE_EXPLORER`\ 。 -首先,使用 :c:expr:`lv_file_explorer_create(lv_scr_act())` +首先,使用 :c:expr:`lv_file_explorer_create(lv_screen_active())` 函数创建一个文件浏览器,默认大小为屏幕大小,之后可以像组件那样自定义样式。 .. raw:: html diff --git a/docs/others/ime_pinyin.rst b/docs/others/ime_pinyin.rst index 9564590ec..cd492d2a3 100644 --- a/docs/others/ime_pinyin.rst +++ b/docs/others/ime_pinyin.rst @@ -48,7 +48,7 @@ Usage Enable :c:macro:`LV_USE_IME_PINYIN` in ``lv_conf.h``. -First use :c:expr:`lv_ime_pinyin_create(lv_scr_act())` to create a Pinyin +First use :c:expr:`lv_ime_pinyin_create(lv_screen_active())` to create a Pinyin input method plug-in, then use :c:expr:`lv_ime_pinyin_set_keyboard(pinyin_ime, kb)` to add the ``keyboard`` you created to the Pinyin input method plug-in. You can use @@ -85,7 +85,7 @@ the keyboard and dictionary at any time. 在 ``lv_conf.h`` 中打开 :c:macro:`LV_USE_IME_PINYIN`\ 。 -首先,使用 :c:expr:`lv_ime_pinyin_create(lv_scr_act())` +首先,使用 :c:expr:`lv_ime_pinyin_create(lv_screen_active())` 函数创建一个拼音输入法插件, 然后使用 :c:expr:`lv_ime_pinyin_set_keyboard(pinyin_ime, kb)` 函数将您创建的键盘组件添加到插件中。 @@ -248,7 +248,7 @@ only need to call this function to set up and use your dictionary: .. code:: c - lv_obj_t * pinyin_ime = lv_100ask_pinyin_ime_create(lv_scr_act()); + lv_obj_t * pinyin_ime = lv_100ask_pinyin_ime_create(lv_screen_active()); lv_100ask_pinyin_ime_set_dict(pinyin_ime, your_pinyin_dict); Modes diff --git a/docs/others/monkey.rst b/docs/others/monkey.rst index 4f29cdd80..af79575c3 100644 --- a/docs/others/monkey.rst +++ b/docs/others/monkey.rst @@ -18,7 +18,7 @@ random operations at random times within this range. Call If you want to pause the monkey, call :c:expr:`lv_monkey_set_enable(monkey, false)`. To delete the monkey, call -:c:expr:`lv_monkey_del(monkey)`. +:c:expr:`lv_monkey_delete(monkey)`. Note that ``input_range`` has different meanings in different ``type``: diff --git a/docs/overview/anim.rst b/docs/overview/anim.rst index f7098e582..44c4a37fa 100644 --- a/docs/overview/anim.rst +++ b/docs/overview/anim.rst @@ -123,7 +123,7 @@ pixels so *20* means *20 px/sec* speed. Delete animations ***************** -You can delete an animation with :cpp:expr:`lv_anim_del(var, func)` if you +You can delete an animation with :cpp:expr:`lv_anim_delete(var, func)` if you provide the animated variable and its animator function. Timeline @@ -159,7 +159,7 @@ duration of the entire animation timeline. Call :cpp:expr:`lv_anim_timeline_get_reverse(at)` function to get whether to reverse the animation timeline. -Call :cpp:expr:`lv_anim_timeline_del(at)` function to delete the animation +Call :cpp:expr:`lv_anim_timeline_delete(at)` function to delete the animation timeline. .. image:: /misc/anim-timeline.png diff --git a/docs/overview/coord.rst b/docs/overview/coord.rst index 901a7f508..ec13d33f5 100644 --- a/docs/overview/coord.rst +++ b/docs/overview/coord.rst @@ -11,11 +11,11 @@ implementation of CSS but a comparable subset is implemented (sometimes with minor adjustments). In short this means: - Explicitly set coordinates are stored in styles -(size, position, layouts, etc.) +(size, position, layouts, etc.) - support min-width, max-width, min-height, max-height -- have pixel, percentage, and "content" units -- x=0; y=0 coordinate means the top-left corner of the parent plus the left/top padding plus border width +- have pixel, percentage, and "content" units +- x=0; y=0 coordinate means the top-left corner of the parent plus the left/top padding plus border width - width/height means the full size, the "content area" is smaller with padding and border width - a subset of flexbox and grid layouts are supported @@ -290,7 +290,7 @@ Here are some examples to set an object's size using a style: lv_style_init(&style); lv_style_set_width(&style, 100); - lv_obj_t * btn = lv_btn_create(lv_scr_act()); + lv_obj_t * btn = lv_btn_create(lv_screen_active()); lv_obj_add_style(btn, &style, LV_PART_MAIN); As you will see below there are some other great features of size and @@ -453,7 +453,7 @@ behave with layouts: - :cpp:enumerator:`LV_OBJ_FLAG_IGNORE_LAYOUT` The object is simply ignored by the layouts. Its coordinates can be set as usual. - :cpp:enumerator:`LV_OBJ_FLAG_FLOATING` Same as :cpp:enumerator:`LV_OBJ_FLAG_IGNORE_LAYOUT` but the object with :cpp:enumerator:`LV_OBJ_FLAG_FLOATING` will be ignored in :c:macro:`LV_SIZE_CONTENT` calculations. -These flags can be added/removed with :cpp:expr:`lv_obj_add_flag(obj, FLAG)` and :cpp:expr:`lv_obj_clear_flag(obj, FLAG)` +These flags can be added/removed with :cpp:expr:`lv_obj_add_flag(obj, FLAG)` and :cpp:expr:`lv_obj_remove_flag(obj, FLAG)` Adding new layouts ------------------ @@ -472,7 +472,7 @@ LVGL can be freely extended by a custom layout like this: void my_layout_update(lv_obj_t * obj, void * user_data) { - /*Will be called automatically if it's required to reposition/resize the children of "obj" */ + /*Will be called automatically if it's required to reposition/resize the children of "obj" */ } Custom style properties can be added which can be retrieved and used in diff --git a/docs/overview/disp.rst b/docs/overview/disp.rst index 49a525d1f..d7aa44c56 100644 --- a/docs/overview/disp.rst +++ b/docs/overview/disp.rst @@ -34,7 +34,7 @@ Therefore, the whole concept of multi-display handling is completely hidden if you register only one display. By default, the last created (and only) display is used. -:cpp:func:`lv_scr_act`, :cpp:func:`lv_scr_load`, :cpp:func:`lv_layer_top`, +:cpp:func:`lv_screen_active`, :cpp:func:`lv_screen_load`, :cpp:func:`lv_layer_top`, :cpp:func:`lv_layer_sys`, :c:macro:`LV_HOR_RES` and :c:macro:`LV_VER_RES` are always applied on the most recently created (default) display. If you pass ``NULL`` as ``disp`` parameter to display related functions the default display will @@ -84,14 +84,14 @@ To create a screen, use ``lv_obj_t * scr = lv_<type>_create(NULL, copy)``. ``copy`` can be an existing screen copied into the new screen. -To load a screen, use :cpp:expr:`lv_scr_load(scr)`. To get the active screen, -use :cpp:expr:`lv_scr_act()`. These functions work on the default display. If +To load a screen, use :cpp:expr:`lv_screen_load(scr)`. To get the active screen, +use :cpp:expr:`lv_screen_active()`. These functions work on the default display. If you want to specify which display to work on, use -:cpp:expr:`lv_disp_get_scr_act(disp)` and :cpp:expr:`lv_disp_load_scr(disp, scr)`. A +:cpp:expr:`lv_disp_get_screen_act(disp)` and :cpp:expr:`lv_disp_load_scr(disp, scr)`. A screen can be loaded with animations too. Read more `here <object.html#load-screens>`__. -Screens can be deleted with :cpp:expr:`lv_obj_del(scr)`, but ensure that you do +Screens can be deleted with :cpp:expr:`lv_obj_delete(scr)`, but ensure that you do not delete the currently loaded screen. Transparent screens @@ -114,9 +114,9 @@ In summary, to enable transparent screens and displays for OSD menu-like UIs: - Set the screen's ``bg_opa`` to transparent: - :cpp:expr:`lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_TRANSP, 0)` + :cpp:expr:`lv_obj_set_style_bg_opa(lv_screen_active(), LV_OPA_TRANSP, 0)` - Set the bottom layer's ``bg_opa`` to transparent: - :cpp:expr:`lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_TRANSP, 0)` + :cpp:expr:`lv_obj_set_style_bg_opa(lv_screen_active(), LV_OPA_TRANSP, 0)` - Set the screen's bg_opa to 0: :cpp:expr:`lv_obj_set_style_bg_opa(lv_layer_bottom(), LV_OPA_TRANSP, 0)` - Set a color format with alpha channel. E.g. diff --git a/docs/overview/event.rst b/docs/overview/event.rst index 8cf2653a0..0bd06618a 100644 --- a/docs/overview/event.rst +++ b/docs/overview/event.rst @@ -5,11 +5,11 @@ Events ====== Events are triggered in LVGL when something happens which might be -interesting to the user, e.g. when an object: +interesting to the user, e.g. when an object: -- is clicked +- is clicked - is scrolled -- has its value changed +- has its value changed - is redrawn, etc. Add events to the object @@ -20,7 +20,7 @@ In practice, it looks like this: .. code:: c - lv_obj_t * btn = lv_btn_create(lv_scr_act()); + lv_obj_t * btn = lv_btn_create(lv_screen_active()); lv_obj_add_event(btn, my_event_cb, LV_EVENT_CLICKED, NULL); /*Assign an event callback*/ ... @@ -132,7 +132,7 @@ Other events - :cpp:enumerator:`LV_EVENT_STYLE_CHANGED`: Object's style has changed - :cpp:enumerator:`LV_EVENT_BASE_DIR_CHANGED`: The base dir has changed - :cpp:enumerator:`LV_EVENT_GET_SELF_SIZE`: Get the internal size of a widget -- :cpp:enumerator:`LV_EVENT_SCREEN_UNLOAD_START`: A screen unload started, fired immediately when lv_scr_load/lv_scr_load_anim is called +- :cpp:enumerator:`LV_EVENT_SCREEN_UNLOAD_START`: A screen unload started, fired immediately when lv_screen_load/lv_screen_load_anim is called - :cpp:enumerator:`LV_EVENT_SCREEN_LOAD_START`: A screen load started, fired when the screen change delay is expired - :cpp:enumerator:`LV_EVENT_SCREEN_LOADED`: A screen was loaded, called when all animations are finished - :cpp:enumerator:`LV_EVENT_SCREEN_UNLOADED`: A screen was unloaded, called when all animations are finished @@ -174,18 +174,18 @@ Refresh event ------------- :cpp:enumerator:`LV_EVENT_REFRESH` is a special event because it's designed to let the -user notify an object to refresh itself. Some examples: +user notify an object to refresh itself. Some examples: -- notify a label to refresh its text according to one or more variables (e.g. current time) -- refresh a label when the language changes -- enable a button if some conditions are met (e.g. the correct PIN is entered) +- notify a label to refresh its text according to one or more variables (e.g. current time) +- refresh a label when the language changes +- enable a button if some conditions are met (e.g. the correct PIN is entered) - add/remove styles to/from an object if a limit is exceeded, etc Fields of lv_event_t ******************** :cpp:type:`lv_event_t` is the only parameter passed to the event callback and it -contains all data about the event. The following values can be gotten from it: +contains all data about the event. The following values can be gotten from it: - :cpp:expr:`lv_event_get_code(e)`: get the event code - :cpp:expr:`lv_event_get_current_target(e)`: get the object to which an event was sent. I.e. the object whose event handler is being called. diff --git a/docs/overview/font.rst b/docs/overview/font.rst index 6f9f5b8eb..fa83a5e37 100644 --- a/docs/overview/font.rst +++ b/docs/overview/font.rst @@ -33,7 +33,7 @@ To test it try .. code:: c - lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL); + lv_obj_t * label1 = lv_label_create(lv_screen_active(), NULL); lv_label_set_text(label1, LV_SYMBOL_OK); If all works well, a ✓ character should be displayed. @@ -135,20 +135,20 @@ The default base direction for screens can be set by base direction from their parent. To set an object's base direction use :cpp:expr:`lv_obj_set_base_dir(obj, base_dir)`. -The possible base directions are: +The possible base directions are: - :cpp:enumerator:`LV_BASE_DIR_LTR`: Left to Right base direction - :cpp:enumerator:`LV_BASE_DIR_RTL`: Right to Left base direction - :cpp:enumerator:`LV_BASE_DIR_AUTO`: Auto detect base direction -This list summarizes the effect of RTL base direction on objects: +This list summarizes the effect of RTL base direction on objects: -- Create objects by default on the right -- ``lv_tabview``: Displays tabs from right to left -- ``lv_checkbox``: Shows the box on the right -- ``lv_btnmatrix``: Shows buttons from right to left -- ``lv_list``: Shows icons on the right -- ``lv_dropdown``: Aligns options to the right +- Create objects by default on the right +- ``lv_tabview``: Displays tabs from right to left +- ``lv_checkbox``: Shows the box on the right +- ``lv_btnmatrix``: Shows buttons from right to left +- ``lv_list``: Shows icons on the right +- ``lv_dropdown``: Aligns options to the right - The texts in ``lv_table``, ``lv_btnmatrix``, ``lv_keyboard``, ``lv_tabview``, ``lv_dropdown``, ``lv_roller`` are "BiDi processed" to be displayed correctly Arabic and Persian support @@ -162,9 +162,9 @@ should also be taken into account. LVGL supports these rules if :c:macro:`LV_USE_ARABIC_PERSIAN_CHARS` is enabled. -However, there are some limitations: +However, there are some limitations: -- Only displaying text is supported (e.g. on labels), text inputs (e.g. text area) don't support this feature. +- Only displaying text is supported (e.g. on labels), text inputs (e.g. text area) don't support this feature. - Static text (i.e. const) is not processed. E.g. texts set by :cpp:func:`lv_label_set_text` will be "Arabic processed" but :cpp:func:`lv_label_set_text_static` won't. - Text get functions (e.g. :cpp:func:`lv_label_get_text`) will return the processed text. @@ -179,9 +179,9 @@ letter anti-aliasing. Learn more `here <https://en.wikipedia.org/wiki/Subpixel_rendering>`__. For subpixel rendering, the fonts need to be generated with special -settings: +settings: -- In the online converter tick the ``Subpixel`` box +- In the online converter tick the ``Subpixel`` box - In the command line tool use ``--lcd`` flag. Note that the generated font needs about three times more memory. Subpixel rendering works only if the color channels of the pixels have a @@ -194,18 +194,18 @@ however this can be swapped by setting :c:macro:`LV_SUBPX_BGR` ``1`` in Compressed fonts ---------------- -The bitmaps of fonts can be compressed by +The bitmaps of fonts can be compressed by -- ticking the ``Compressed`` check box in the online converter +- ticking the ``Compressed`` check box in the online converter - not passing the ``--no-compress`` flag to the offline converter (compression is applied by default) Compression is more effective with larger fonts and higher bpp. However, it's about 30% slower to render compressed fonts. Therefore, it's recommended to compress only the largest fonts of a user interface, -because +because -- they need the most memory -- they can be compressed better +- they need the most memory +- they can be compressed better - and probably they are used less frequently then the medium-sized fonts, so the performance cost is smaller. .. _add_font: @@ -213,13 +213,13 @@ because Add a new font ************** -There are several ways to add a new font to your project: +There are several ways to add a new font to your project: -1. The simplest method is to use the `Online font converter <https://lvgl.io/tools/fontconverter>`__. +1. The simplest method is to use the `Online font converter <https://lvgl.io/tools/fontconverter>`__. Just set the parameters, click the *Convert* button, copy the font to your project and use it. **Be sure to carefully read the steps provided on that site - or you will get an error while converting.** -2. Use the `Offline font converter <https://github.com/lvgl/lv_font_conv>`__. + or you will get an error while converting.** +2. Use the `Offline font converter <https://github.com/lvgl/lv_font_conv>`__. (Requires Node.js to be installed) 3. If you want to create something like the built-in fonts (Montserrat font and symbols) but in a different size and/or @@ -237,10 +237,10 @@ Add new symbols The built-in symbols are created from the `FontAwesome <https://fontawesome.com/>`__ font. -1. Search for a symbol on https://fontawesome.com. For example the +1. Search for a symbol on https://fontawesome.com. For example the `USB symbol <https://fontawesome.com/icons/usb?style=brands>`__. Copy its Unicode ID which is ``0xf287`` in this case. -2. Open the `Online font converter <https://lvgl.io/tools/fontconverter>`__. +2. Open the `Online font converter <https://lvgl.io/tools/fontconverter>`__. Add `FontAwesome.woff <https://lvgl.io/assets/others/FontAwesome5-Solid+Brands+Regular.woff>`__. 3. Set the parameters such as Name, Size, BPP. You'll use this name to declare and use the font in your code. @@ -251,9 +251,9 @@ The built-in symbols are created from the `FontAwesome <https://fontawesome.com/ 6. Declare the font using ``extern lv_font_t my_font_name;`` or simply use :cpp:expr:`LV_FONT_DECLARE(my_font_name)`. -**Using the symbol** +**Using the symbol** -1. Convert the Unicode value to UTF8, for example on +1. Convert the Unicode value to UTF8, for example on `this site <http://www.ltg.ed.ac.uk/~richard/utf-8.cgi?input=f287&mode=hex>`__. For ``0xf287`` the *Hex UTF-8 bytes* are ``EF 8A 87``. 2. Create a ``define`` string from the UTF8 values: ``#define MY_USB_SYMBOL "\xEF\x8A\x87"`` diff --git a/docs/overview/img.rst b/docs/overview/img.rst index 725f64f84..deaaa255c 100644 --- a/docs/overview/img.rst +++ b/docs/overview/img.rst @@ -8,7 +8,7 @@ some metadata. Store images ************ -You can store images in two places +You can store images in two places - as a variable in internal memory (RAM or ROM) - as a file @@ -21,12 +21,12 @@ Images stored internally in a variable are composed mainly of an - **header**: - - *cf*: Color format. See `below <#color-format>`__ - - *w*: width in pixels (<= 2048) - - *h*: height in pixels (<= 2048) - - *always zero*: 3 bits which need to be always zero - - *reserved*: reserved for future use -- **data**: pointer to an array where the image itself is stored + - *cf*: Color format. See `below <#color-format>`__ + - *w*: width in pixels (<= 2048) + - *h*: height in pixels (<= 2048) + - *always zero*: 3 bits which need to be always zero + - *reserved*: reserved for future use +- **data**: pointer to an array where the image itself is stored - **data_size**: length of ``data`` in bytes These are usually stored within a project as C files. They are linked @@ -51,7 +51,7 @@ easier to replace without needing to rebuild the main program. Color formats ************* -Various built-in color formats are supported: +Various built-in color formats are supported: - :cpp:enumerator:`LV_COLOR_FORMAT_NATIVE`: Simply stores the RGB colors (in whatever color depth LVGL is configured for). - :cpp:enumerator:`LV_COLOR_FORMAT_NATIVE_WITH_ALPHA`: Like :cpp:enumerator:`LV_COLOR_FORMAT_NATIVE` but it also adds an alpha (transparency) byte for every pixel. @@ -79,8 +79,8 @@ The bytes of :cpp:enumerator:`LV_COLOR_FORMAT_NATIVE` images are stored in the f - **Byte 2**: Alpha byte (only with :cpp:enumerator:`LV_COLOR_FORMAT_NATIVE_WITH_ALPHA`) You can store images in a *Raw* format to indicate that it's not encoded -with one of the built-in color formats and an external `Image decoder <#image-decoder>`__ -needs to be used to decode the image. +with one of the built-in color formats and an external `Image decoder <#image-decoder>`__ +needs to be used to decode the image. - :cpp:enumerator:`LV_COLOR_FORMAT_RAW`: Indicates a basic raw image (e.g. a PNG or JPG image). - :cpp:enumerator:`LV_COLOR_FORMAT_RAW_ALPHA`: Indicates that an image has alpha and an alpha byte is added for every pixel. @@ -116,11 +116,11 @@ that matches :c:macro:`LV_COLOR_DEPTH` in *lv_conf.h* will actually be linked into the resulting executable. In the case of binary files, you need to specify the color format you -want: +want: -- RGB332 for 8-bit color depth -- RGB565 for 16-bit color depth -- RGB565 Swap for 16-bit color depth (two bytes are swapped) +- RGB332 for 8-bit color depth +- RGB565 for 16-bit color depth +- RGB565 Swap for 16-bit color depth (two bytes are swapped) - RGB888 for 32-bit color depth Manually create an image @@ -153,7 +153,7 @@ The simplest way to use an image in LVGL is to display it with an .. code:: c - lv_obj_t * icon = lv_image_create(lv_scr_act(), NULL); + lv_obj_t * icon = lv_image_create(lv_screen_active(), NULL); /*From variable*/ lv_image_set_src(icon, &my_icon_dsc); @@ -176,12 +176,12 @@ formats like PNG or JPG. To handle non-built-in image formats, you need to use external libraries and attach them to LVGL via the *Image decoder* interface. -An image decoder consists of 4 callbacks: +An image decoder consists of 4 callbacks: -- **info** get some basic info about the image (width, height and color format). -- **open** open an image: - - store a decoded image - - set it to ``NULL`` to indicate the image can be read line-by-line. +- **info** get some basic info about the image (width, height and color format). +- **open** open an image: + - store a decoded image + - set it to ``NULL`` to indicate the image can be read line-by-line. - **get_area** if *open* didn't fully open an image this function should give back part of image as decoded data. - **close** close an opened image, free the allocated resources. @@ -205,14 +205,14 @@ Custom image formats -------------------- The easiest way to create a custom image is to use the online image -converter and select ``Raw`` or ``Raw with alpha`` format. +converter and select ``Raw`` or ``Raw with alpha`` format. It will just take every byte of the binary file you uploaded and write it as an image "bitmap". You then need to attach an image decoder that will parse that bitmap and generate the real, renderable bitmap. -``header.cf`` will be :cpp:enumerator:`LV_COLOR_FORMAT_RAW`, :cpp:enumerator:`LV_COLOR_FORMAT_RAW_ALPHA` -accordingly. You should choose the correct format according to your needs: +``header.cf`` will be :cpp:enumerator:`LV_COLOR_FORMAT_RAW`, :cpp:enumerator:`LV_COLOR_FORMAT_RAW_ALPHA` +accordingly. You should choose the correct format according to your needs: a fully opaque image, using an alpha channel. After decoding, the *raw* formats are considered *True color* by the @@ -374,11 +374,11 @@ Cache size ---------- The size of cache (in bytes) can be defined with -:c:macro:`LV_CACHE_DEF_SIZE` in *lv_conf.h*. The default value is 0, so +:c:macro:`LV_CACHE_DEF_SIZE` in *lv_conf.h*. The default value is 0, so no image is cached. The size of cache can be changed at run-time with -:cpp:expr:`lv_cache_set_max_size(size_t size)`, +:cpp:expr:`lv_cache_set_max_size(size_t size)`, and get with :cpp:expr:`lv_cache_get_max_size()`. Value of images @@ -399,9 +399,9 @@ the *weight* value in the cache entry in it unchanged to let LVGL control it.) Every cache entry has a *"life"* value. Every time an image is opened -through the cache, the *life* value of all entries is increased by their -*weight* values to make them older. -When a cached image is used, its *usage_count* value is increased +through the cache, the *life* value of all entries is increased by their +*weight* values to make them older. +When a cached image is used, its *usage_count* value is increased to make it more alive. If there is no more space in the cache, the entry with *usage_count == 0* diff --git a/docs/overview/indev.rst b/docs/overview/indev.rst index d0f1737f1..715a1cd5e 100644 --- a/docs/overview/indev.rst +++ b/docs/overview/indev.rst @@ -25,12 +25,12 @@ 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_obj_t * cursor_obj = lv_image_create(lv_scr_act()); /*Create an image object for the cursor */ + 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*/ Note that the cursor object should have -:cpp:expr:`lv_obj_clear_flag(cursor_obj, LV_OBJ_FLAG_CLICKABLE)`. For images, +:cpp:expr:`lv_obj_remove_flag(cursor_obj, LV_OBJ_FLAG_CLICKABLE)`. For images, *clicking* is disabled by default. Gestures @@ -68,7 +68,7 @@ event. For example: lv_obj_add_event(screen1, my_event, LV_EVENT_GESTURE, NULL); To prevent passing the gesture event to the parent from an object use -:cpp:expr:`lv_obj_clear_flag(obj, LV_OBJ_FLAG_GESTURE_BUBBLE)`. +:cpp:expr:`lv_obj_remove_flag(obj, LV_OBJ_FLAG_GESTURE_BUBBLE)`. Note that, gestures are not triggered if an object is being scrolled. @@ -109,7 +109,7 @@ To associate a group with an input device use Keys ^^^^ -There are some predefined keys which have special meaning: +There are some predefined keys which have special meaning: - :cpp:enumerator:`LV_KEY_NEXT`: Focus on the next object - :cpp:enumerator:`LV_KEY_PREV`: Focus on the previous object @@ -134,7 +134,7 @@ The most important special keys In your ``read_cb`` function - :cpp:enumerator:`LV_KEY_LEFT` - :cpp:enumerator:`LV_KEY_RIGHT` -You should translate some of your keys to these special keys to support navigation +You should translate some of your keys to these special keys to support navigation in a group and interact with selected objects. Usually, it's enough to use only :cpp:enumerator:`LV_KEY_LEFT` and :cpp:enumerator:`LV_KEY_RIGHT` because most diff --git a/docs/overview/layer.rst b/docs/overview/layer.rst index c28d68c09..cabb37cd5 100644 --- a/docs/overview/layer.rst +++ b/docs/overview/layer.rst @@ -18,7 +18,7 @@ its children. /*Create a screen*/ lv_obj_t * scr = lv_obj_create(NULL, NULL); - lv_scr_load(scr); /*Load the screen*/ + lv_screen_load(scr); /*Load the screen*/ /*Create 2 buttons*/ lv_obj_t * btn1 = lv_btn_create(scr, NULL); /*Create a button on the screen*/ @@ -36,7 +36,7 @@ its children. lv_label_set_text(label2, "Button 2"); /*Set the text of the label*/ /*Delete the second label*/ - lv_obj_del(label2); + lv_obj_delete(label2); Change order ************ @@ -60,7 +60,7 @@ Top and sys layers LVGL uses two special layers named ``layer_top`` and ``layer_sys``. Both are visible and common on all screens of a display. **They are not, however, shared among multiple physical displays.** The ``layer_top`` is -always on top of the default screen (:cpp:func:`lv_scr_act`), and +always on top of the default screen (:cpp:func:`lv_screen_active`), and ``layer_sys`` is on top of ``layer_top``. The ``layer_top`` can be used by the user to create some content visible diff --git a/docs/overview/obj.rst b/docs/overview/obj.rst index c65dd0751..0ed72b6ea 100644 --- a/docs/overview/obj.rst +++ b/docs/overview/obj.rst @@ -83,7 +83,7 @@ it. Therefore, all positions are relative to the parent. .. code:: c - lv_obj_t * parent = lv_obj_create(lv_scr_act()); /*Create a parent object on the current screen*/ + lv_obj_t * parent = lv_obj_create(lv_screen_active()); /*Create a parent object on the current screen*/ lv_obj_set_size(parent, 100, 80); /*Set the size of the parent*/ lv_obj_t * obj1 = lv_obj_create(parent); /*Create an object on the previously created parent object*/ @@ -146,11 +146,11 @@ the object and all of its children. .. code:: c - void lv_obj_del(lv_obj_t * obj); + void lv_obj_delete(lv_obj_t * obj); :cpp:func:`lv_obj_del` will delete the object immediately. If for any reason you can't delete the object immediately you can use -:cpp:expr:`lv_obj_del_async(obj)` which will perform the deletion on the next +: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 delete the parent of an object in the child's :cpp:enumerator:`LV_EVENT_DELETE` handler. @@ -158,7 +158,7 @@ handler. You can remove all the children of an object (but not the object itself) using :cpp:expr:`lv_obj_clean(obj)`. -You can use :cpp:expr:`lv_obj_del_delayed(obj, 1000)` to delete an object after +You can use :cpp:expr:`lv_obj_delete_delayed(obj, 1000)` to delete an object after some time. The delay is expressed in milliseconds. Screens @@ -183,12 +183,12 @@ Get the active screen There is always an active screen on each display. By default, the library creates and loads a "Base object" as a screen for each display. -To get the currently active screen use the :cpp:func:`lv_scr_act` function. +To get the currently active screen use the :cpp:func:`lv_screen_active` function. Load screens ------------ -To load a new screen, use :cpp:expr:`lv_scr_load(scr1)`. +To load a new screen, use :cpp:expr:`lv_screen_load(scr1)`. Layers ------ @@ -215,7 +215,7 @@ Load screen with animation ^^^^^^^^^^^^^^^^^^^^^^^^^^ A new screen can be loaded with animation by using -:cpp:expr:`lv_scr_load_anim(scr, transition_type, time, delay, auto_del)`. The +:cpp:expr:`lv_screen_load_anim(scr, transition_type, time, delay, auto_del)`. The following transition types exist: - :cpp:enumerator:`LV_SCR_LOAD_ANIM_NONE`: Switch immediately after ``delay`` milliseconds @@ -227,7 +227,7 @@ following transition types exist: Setting ``auto_del`` to ``true`` will automatically delete the old screen when the animation is finished. -The new screen will become active (returned by :cpp:func:`lv_scr_act`) when +The new screen will become active (returned by :cpp:func:`lv_screen_active`) when the animation starts after ``delay`` time. All inputs are disabled during the screen animation. @@ -239,7 +239,7 @@ Screens are created on the currently selected *default display*. The :cpp:func:`lv_disp_drv_register`. You can also explicitly select a new default display using :cpp:expr:`lv_disp_set_default(disp)`. -:cpp:func:`lv_scr_act`, :cpp:func:`lv_scr_load` and :cpp:func:`lv_scr_load_anim` operate +:cpp:func:`lv_screen_active`, :cpp:func:`lv_screen_load` and :cpp:func:`lv_screen_load_anim` operate on the default display. Visit `Multi-display support </overview/display>`__ to learn more. @@ -291,7 +291,7 @@ The states are usually automatically changed by the library as the user interacts with an object (presses, releases, focuses, etc.). However, the states can be changed manually too. To set or clear given state (but leave the other states untouched) use -``lv_obj_add/clear_state(obj, LV_STATE_...)`` In both cases OR-ed state +``lv_obj_add/remove_state(obj, LV_STATE_...)`` In both cases OR-ed state values can be used as well. E.g. :cpp:expr:`lv_obj_add_state(obj, part, LV_STATE_PRESSED | LV_PRESSED_CHECKED)`. diff --git a/docs/overview/scroll.rst b/docs/overview/scroll.rst index 72d833e30..d3460ba48 100644 --- a/docs/overview/scroll.rst +++ b/docs/overview/scroll.rst @@ -98,7 +98,7 @@ Scrollable ---------- It's possible to make an object non-scrollable with -:cpp:expr:`lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE)`. +:cpp:expr:`lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE)`. Non-scrollable objects can still propagate the scrolling (chain) to their parents. diff --git a/docs/overview/style.rst b/docs/overview/style.rst index c6637d2e2..f37be6d9b 100644 --- a/docs/overview/style.rst +++ b/docs/overview/style.rst @@ -336,7 +336,7 @@ notified. There are 3 options to do this: 1. If you know that the changed properties can be applied by a simple redraw (e.g. color or opacity changes) just call :cpp:expr:`lv_obj_invalidate(obj)` - or :cpp:expr:`lv_obj_invalidate(lv_scr_act())`. + or :cpp:expr:`lv_obj_invalidate(lv_screen_active())`. 2. If more complex style properties were changed or added, and you know which object(s) are affected by that style call :cpp:expr:`lv_obj_refresh_style(obj, part, property)`. To refresh all parts and properties use :cpp:expr:`lv_obj_refresh_style(obj, LV_PART_ANY, LV_STYLE_PROP_ANY)`. diff --git a/docs/overview/timer.rst b/docs/overview/timer.rst index 066b0a8b8..a8f029476 100644 --- a/docs/overview/timer.rst +++ b/docs/overview/timer.rst @@ -35,7 +35,7 @@ For example: /*Do something with LVGL*/ if(something_happened) { something_happened = false; - lv_btn_create(lv_scr_act(), NULL); + lv_btn_create(lv_screen_active(), NULL); } } @@ -102,7 +102,7 @@ For example: /*Free some resources related to `scr`*/ /*Finally delete the screen*/ - lv_obj_del(scr); + lv_obj_delete(scr); } ... @@ -110,12 +110,12 @@ For example: /*Do something with the object on the current screen*/ /*Delete screen on next call of `lv_timer_handler`, not right now.*/ - lv_async_call(my_screen_clean_up, lv_scr_act()); + lv_async_call(my_screen_clean_up, lv_screen_active()); /*The screen is still valid so you can do other things with it*/ If you just want to delete an object and don't need to clean anything up -in ``my_screen_cleanup`` you could just use :cpp:func:`lv_obj_del_async` which +in ``my_screen_cleanup`` you could just use :cpp:func:`lv_obj_delete_async` which will delete the object on the next call to :cpp:func:`lv_timer_handler`. API diff --git a/docs/porting/disp.rst b/docs/porting/disp.rst index 2f9b8a4ed..8f74d9a06 100644 --- a/docs/porting/disp.rst +++ b/docs/porting/disp.rst @@ -229,7 +229,7 @@ You can do this in the following way: .. code:: c /*Delete the original display refresh timer*/ - lv_timer_del(disp->refr_timer); + lv_timer_delete(disp->refr_timer); disp->refr_timer = NULL; diff --git a/docs/porting/indev.rst b/docs/porting/indev.rst index ecd0568f9..c428cb6a7 100644 --- a/docs/porting/indev.rst +++ b/docs/porting/indev.rst @@ -245,7 +245,7 @@ You can do this in the following way: .. code:: c /*Delete the original input device read timer*/ - lv_timer_del(indev->read_timer); + lv_timer_delete(indev->read_timer); indev->read_timer = NULL; diff --git a/docs/porting/os.rst b/docs/porting/os.rst index 45015ff37..c9c2d1741 100644 --- a/docs/porting/os.rst +++ b/docs/porting/os.rst @@ -41,7 +41,7 @@ Here is some pseudocode to illustrate the concept: { /* You must always hold the mutex while using LVGL APIs */ mutex_lock(&lvgl_mutex); - lv_obj_t *img = lv_image_create(lv_scr_act()); + lv_obj_t *img = lv_image_create(lv_screen_active()); mutex_unlock(&lvgl_mutex); while(1) { diff --git a/docs/widgets/arc.rst b/docs/widgets/arc.rst index 4977e730f..689e332ce 100644 --- a/docs/widgets/arc.rst +++ b/docs/widgets/arc.rst @@ -96,7 +96,7 @@ the object non-clickable: .. code:: c lv_obj_remove_style(arc, NULL, LV_PART_KNOB); - lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(arc, LV_OBJ_FLAG_CLICKABLE); Advanced hit test ----------------- diff --git a/docs/widgets/checkbox.rst b/docs/widgets/checkbox.rst index ff10d6202..720e01f2f 100644 --- a/docs/widgets/checkbox.rst +++ b/docs/widgets/checkbox.rst @@ -43,7 +43,7 @@ common state add/clear function: .. code:: c lv_obj_add_state(cb, LV_STATE_CHECKED); /*Make the checkbox checked*/ - lv_obj_clear_state(cb, LV_STATE_CHECKED); /*MAke the checkbox unchecked*/ + lv_obj_remove_state(cb, LV_STATE_CHECKED); /*MAke the checkbox unchecked*/ lv_obj_add_state(cb, LV_STATE_CHECKED | LV_STATE_DISABLED); /*Make the checkbox checked and disabled*/ To get whether the checkbox is checked or not use: diff --git a/docs/widgets/imgbtn.rst b/docs/widgets/imgbtn.rst index e37ea45fb..3e0b92ee3 100644 --- a/docs/widgets/imgbtn.rst +++ b/docs/widgets/imgbtn.rst @@ -46,7 +46,7 @@ they will be used in pressed state instead of the released images. States ------ -Instead of the regular ``lv_obj_add/clear_state()`` functions the +Instead of the regular ``lv_obj_add/remove_state()`` functions the :cpp:expr:`lv_imgbtn_set_state(imgbtn, LV_IMGBTN_STATE_...)` functions should be used to manually set a state. diff --git a/docs/widgets/obj.rst b/docs/widgets/obj.rst index b79143288..515e24ccb 100644 --- a/docs/widgets/obj.rst +++ b/docs/widgets/obj.rst @@ -115,7 +115,7 @@ representing a layout that covers the entire display. When you have created a screen like ``lv_obj_t * screen = lv_obj_create(NULL)``, you can make it active with -:cpp:expr:`lv_scr_load(screen)`. The :cpp:func:`lv_scr_act` function gives you a +:cpp:expr:`lv_screen_load(screen)`. The :cpp:func:`lv_screen_active` function gives you a pointer to the active screen. If you have multiple displays, it's important to know that the screen @@ -154,7 +154,7 @@ Flags ----- There are some attributes which can be enabled/disabled by -``lv_obj_add/clear_flag(obj, LV_OBJ_FLAG_...)``: +``lv_obj_add/remove_flag(obj, LV_OBJ_FLAG_...)``: - :cpp:enumerator:`LV_OBJ_FLAG_HIDDEN` Make the object hidden. (Like it wasn't there at all) - :cpp:enumerator:`LV_OBJ_FLAG_CLICKABLE` Make the object clickable by input devices @@ -194,7 +194,7 @@ Some examples: lv_obj_add_flag(obj, LV_OBJ_FLAG_HIDDEN); /*Make an object non-clickable*/ - lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE); Groups ------ diff --git a/docs/widgets/switch.rst b/docs/widgets/switch.rst index 022ce7bfd..a04ceb70d 100644 --- a/docs/widgets/switch.rst +++ b/docs/widgets/switch.rst @@ -34,7 +34,7 @@ To get the current state of the switch (with ``true`` being on), use :cpp:expr:`lv_obj_has_state(obj, LV_STATE_CHECKED)`. Call :cpp:expr:`lv_obj_add_state(obj, LV_STATE_CHECKED)` to turn it on, or -:cpp:expr:`lv_obj_clear_state(obj, LV_STATE_CHECKED)` to turn it off. +:cpp:expr:`lv_obj_remove_state(obj, LV_STATE_CHECKED)` to turn it off. Events ****** diff --git a/docs/widgets/textarea.rst b/docs/widgets/textarea.rst index d022cc448..beb76cef9 100644 --- a/docs/widgets/textarea.rst +++ b/docs/widgets/textarea.rst @@ -61,8 +61,8 @@ Delete character ---------------- To delete a character from the left of the current cursor position use -:cpp:expr:`lv_textarea_del_char(textarea)`. To delete from the right use -:cpp:expr:`lv_textarea_del_char_forward(textarea)` +:cpp:expr:`lv_textarea_delete_char(textarea)`. To delete from the right use +:cpp:expr:`lv_textarea_delete_char_forward(textarea)` Move the cursor --------------- diff --git a/env_support/pikascript/pika_lv_timer_t.c b/env_support/pikascript/pika_lv_timer_t.c index c97b9b20d..f27de4543 100644 --- a/env_support/pikascript/pika_lv_timer_t.c +++ b/env_support/pikascript/pika_lv_timer_t.c @@ -37,8 +37,8 @@ void pika_lvgl_lv_timer_t_set_cb(PikaObj* self, Arg* cb) { } -void pika_lvgl_lv_timer_t__del(PikaObj* self) { +void pika_lvgl_lv_timer_t__delete(PikaObj* self) { lv_timer_t* lv_timer = obj_getPtr(self, "lv_timer"); - lv_timer_del(lv_timer); + lv_timer_delete(lv_timer); } #endif diff --git a/env_support/pikascript/pika_lvgl.c b/env_support/pikascript/pika_lvgl.c index 1d42b0dc8..fee0870b0 100644 --- a/env_support/pikascript/pika_lvgl.c +++ b/env_support/pikascript/pika_lvgl.c @@ -145,9 +145,9 @@ void pika_lvgl_PALETTE___init__(PikaObj* self) { obj_setInt(self, "NONE", LV_PALETTE_NONE); } -PikaObj* pika_lvgl_scr_act(PikaObj* self) { +PikaObj* pika_lvgl_screen_act(PikaObj* self) { PikaObj* new_obj = newNormalObj(New_TinyObj); - lv_obj_t* lv_obj = lv_scr_act(); + lv_obj_t* lv_obj = lv_screen_active(); obj_setPtr(new_obj, "lv_obj", lv_obj); return new_obj; } diff --git a/examples/anim/lv_example_anim_1.c b/examples/anim/lv_example_anim_1.c index 4c63c63f4..a3ba285a2 100644 --- a/examples/anim/lv_example_anim_1.c +++ b/examples/anim/lv_example_anim_1.c @@ -39,12 +39,12 @@ static void sw_event_cb(lv_event_t * e) */ void lv_example_anim_1(void) { - 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 animations!"); lv_obj_set_pos(label, 100, 10); - lv_obj_t * sw = lv_switch_create(lv_scr_act()); + lv_obj_t * sw = lv_switch_create(lv_screen_active()); lv_obj_center(sw); lv_obj_add_state(sw, LV_STATE_CHECKED); lv_obj_add_event(sw, sw_event_cb, LV_EVENT_VALUE_CHANGED, label); diff --git a/examples/anim/lv_example_anim_1.py b/examples/anim/lv_example_anim_1.py index 8c41e18e7..0cf6232eb 100644 --- a/examples/anim/lv_example_anim_1.py +++ b/examples/anim/lv_example_anim_1.py @@ -27,12 +27,12 @@ def sw_event_cb(e,label): # Start animation on an event # -label = lv.label(lv.scr_act()) +label = lv.label(lv.screen_active()) label.set_text("Hello animations!") label.set_pos(100, 10) -sw = lv.switch(lv.scr_act()) +sw = lv.switch(lv.screen_active()) sw.center() sw.add_state(lv.STATE.CHECKED) sw.add_event(lambda e: sw_event_cb(e,label), lv.EVENT.VALUE_CHANGED, None) diff --git a/examples/anim/lv_example_anim_2.c b/examples/anim/lv_example_anim_2.c index d030ed603..2f76ad935 100644 --- a/examples/anim/lv_example_anim_2.c +++ b/examples/anim/lv_example_anim_2.c @@ -18,7 +18,7 @@ static void anim_size_cb(void * var, int32_t v) void lv_example_anim_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_style_bg_color(obj, lv_palette_main(LV_PALETTE_RED), 0); lv_obj_set_style_radius(obj, LV_RADIUS_CIRCLE, 0); diff --git a/examples/anim/lv_example_anim_2.py b/examples/anim/lv_example_anim_2.py index 1a06663d2..713917c83 100644 --- a/examples/anim/lv_example_anim_2.py +++ b/examples/anim/lv_example_anim_2.py @@ -8,7 +8,7 @@ def anim_size_cb(obj, v): # # Create a playback animation # -obj = lv.obj(lv.scr_act()) +obj = lv.obj(lv.screen_active()) obj.set_style_bg_color(lv.palette_main(lv.PALETTE.RED), 0) obj.set_style_radius(lv.RADIUS_CIRCLE, 0) diff --git a/examples/anim/lv_example_anim_3.c b/examples/anim/lv_example_anim_3.c index 32b835ae6..969d97ae7 100644 --- a/examples/anim/lv_example_anim_3.c +++ b/examples/anim/lv_example_anim_3.c @@ -40,7 +40,7 @@ void lv_example_anim_3(void) static lv_coord_t row_dsc[] = {30, 10, 10, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; /*Create a container with grid*/ - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_style_pad_all(cont, 2, LV_PART_MAIN); lv_obj_set_style_pad_column(cont, 10, LV_PART_MAIN); lv_obj_set_style_pad_row(cont, 10, LV_PART_MAIN); @@ -122,7 +122,7 @@ static void page_obj_init(lv_obj_t * par) ginfo.anim_obj = lv_obj_create(par); lv_obj_set_size(ginfo.anim_obj, 30, 30); lv_obj_set_align(ginfo.anim_obj, LV_ALIGN_TOP_LEFT); - lv_obj_clear_flag(ginfo.anim_obj, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_remove_flag(ginfo.anim_obj, LV_OBJ_FLAG_SCROLLABLE); lv_obj_set_style_bg_color(ginfo.anim_obj, lv_palette_main(LV_PALETTE_RED), LV_PART_MAIN); lv_obj_set_grid_cell(ginfo.anim_obj, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_START, 0, 1); diff --git a/examples/anim/lv_example_anim_3.py b/examples/anim/lv_example_anim_3.py index 8f91c839c..81a833f7b 100644 --- a/examples/anim/lv_example_anim_3.py +++ b/examples/anim/lv_example_anim_3.py @@ -19,7 +19,7 @@ class LvExampleAnim_3(): self.p1 = 0 self.p2 = 0 - self.cont = lv.obj(lv.scr_act()) + self.cont = lv.obj(lv.screen_active()) self.cont.set_style_pad_all(2, lv.PART.MAIN) self.cont.set_style_pad_column(10, lv.PART.MAIN) self.cont.set_style_pad_row(10, lv.PART.MAIN) @@ -42,7 +42,7 @@ class LvExampleAnim_3(): self.anim_obj = lv.obj(par) self.anim_obj.set_size(30, 30) self.anim_obj.set_align(lv.ALIGN.TOP_LEFT) - self.anim_obj.clear_flag(lv.obj.FLAG.SCROLLABLE) + self.anim_obj.remove_flag(lv.obj.FLAG.SCROLLABLE) self.anim_obj.set_style_bg_color(lv.palette_main(lv.PALETTE.RED), lv.PART.MAIN) self.anim_obj.set_grid_cell(lv.GRID_ALIGN.START, 0, 1,lv.GRID_ALIGN.START, 0, 1) diff --git a/examples/anim/lv_example_anim_timeline_1.c b/examples/anim/lv_example_anim_timeline_1.c index e07d4f790..58071202d 100644 --- a/examples/anim/lv_example_anim_timeline_1.c +++ b/examples/anim/lv_example_anim_timeline_1.c @@ -102,11 +102,11 @@ static void btn_start_event_handler(lv_event_t * e) lv_anim_timeline_start(anim_timeline); } -static void btn_del_event_handler(lv_event_t * e) +static void btn_delete_event_handler(lv_event_t * e) { LV_UNUSED(e); if(anim_timeline) { - lv_anim_timeline_del(anim_timeline); + lv_anim_timeline_delete(anim_timeline); anim_timeline = NULL; } } @@ -136,7 +136,7 @@ static void slider_prg_event_handler(lv_event_t * e) */ void lv_example_anim_timeline_1(void) { - lv_obj_t * par = lv_scr_act(); + lv_obj_t * par = lv_screen_active(); lv_obj_set_flex_flow(par, LV_FLEX_FLOW_ROW); lv_obj_set_flex_align(par, LV_FLEX_ALIGN_SPACE_AROUND, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); @@ -153,7 +153,7 @@ void lv_example_anim_timeline_1(void) /* create btn_del */ lv_obj_t * btn_del = lv_button_create(par); - lv_obj_add_event(btn_del, btn_del_event_handler, LV_EVENT_CLICKED, NULL); + lv_obj_add_event(btn_del, btn_delete_event_handler, LV_EVENT_CLICKED, NULL); lv_obj_add_flag(btn_del, LV_OBJ_FLAG_IGNORE_LAYOUT); lv_obj_align(btn_del, LV_ALIGN_TOP_MID, 0, 20); diff --git a/examples/anim/lv_example_anim_timeline_1.py b/examples/anim/lv_example_anim_timeline_1.py index 7f9bc0b14..ee544c74b 100644 --- a/examples/anim/lv_example_anim_timeline_1.py +++ b/examples/anim/lv_example_anim_timeline_1.py @@ -7,7 +7,7 @@ class LV_ExampleAnimTimeline_1(object): # Create an animation timeline # - self.par = lv.scr_act() + self.par = lv.screen_active() self.par.set_flex_flow(lv.FLEX_FLOW.ROW) self.par.set_flex_align(lv.FLEX_ALIGN.SPACE_AROUND, lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.CENTER) @@ -22,7 +22,7 @@ class LV_ExampleAnimTimeline_1(object): self.label_run.center() self.button_del = lv.button(self.par) - self.button_del.add_event(self.button_del_event_handler, lv.EVENT.CLICKED, None) + self.button_del.add_event(self.button_delete_event_handler, lv.EVENT.CLICKED, None) self.button_del.add_flag(lv.obj.FLAG.IGNORE_LAYOUT) self.button_del.align(lv.ALIGN.TOP_MID, 50, 20) @@ -134,9 +134,9 @@ class LV_ExampleAnimTimeline_1(object): self.anim_timeline.set_reverse(reverse) self.anim_timeline.start() - def button_del_event_handler(self,e): + def button_delete_event_handler(self,e): if self.anim_timeline: - self.anim_timeline._del() + self.anim_timeline._delete() self.anim_timeline = None diff --git a/examples/event/lv_example_event_1.c b/examples/event/lv_example_event_1.c index c88c1cfde..eb0f8eb3a 100644 --- a/examples/event/lv_example_event_1.c +++ b/examples/event/lv_example_event_1.c @@ -17,7 +17,7 @@ static void event_cb(lv_event_t * e) */ void lv_example_event_1(void) { - lv_obj_t * btn = lv_button_create(lv_scr_act()); + lv_obj_t * btn = lv_button_create(lv_screen_active()); lv_obj_set_size(btn, 100, 50); lv_obj_center(btn); lv_obj_add_event(btn, event_cb, LV_EVENT_CLICKED, NULL); diff --git a/examples/event/lv_example_event_1.py b/examples/event/lv_example_event_1.py index 39c3376ed..c14c4ceb8 100644 --- a/examples/event/lv_example_event_1.py +++ b/examples/event/lv_example_event_1.py @@ -5,7 +5,7 @@ class Event_1(): # Add click event to a button # - button = lv.button(lv.scr_act()) + button = lv.button(lv.screen_active()) button.set_size(100, 50) button.center() button.add_event(self.event_cb, lv.EVENT.CLICKED, None) diff --git a/examples/event/lv_example_event_2.c b/examples/event/lv_example_event_2.c index a64831aea..c883e2a2f 100644 --- a/examples/event/lv_example_event_2.c +++ b/examples/event/lv_example_event_2.c @@ -29,7 +29,7 @@ static void event_cb(lv_event_t * e) */ void lv_example_event_2(void) { - lv_obj_t * btn = lv_button_create(lv_scr_act()); + lv_obj_t * btn = lv_button_create(lv_screen_active()); lv_obj_set_size(btn, 100, 50); lv_obj_center(btn); @@ -37,7 +37,7 @@ void lv_example_event_2(void) lv_label_set_text(btn_label, "Click me!"); lv_obj_center(btn_label); - lv_obj_t * info_label = lv_label_create(lv_scr_act()); + lv_obj_t * info_label = lv_label_create(lv_screen_active()); lv_label_set_text(info_label, "The last button event:\nNone"); lv_obj_add_event(btn, event_cb, LV_EVENT_ALL, info_label); diff --git a/examples/event/lv_example_event_2.py b/examples/event/lv_example_event_2.py index 43f3d326f..e0a419da2 100644 --- a/examples/event/lv_example_event_2.py +++ b/examples/event/lv_example_event_2.py @@ -8,7 +8,7 @@ def event_cb(e,label): label.set_text("The last button event:\nLV_EVENT_LONG_PRESSED") elif code == lv.EVENT.LONG_PRESSED_REPEAT: label.set_text("The last button event:\nLV_EVENT_LONG_PRESSED_REPEAT") -button = lv.button(lv.scr_act()) +button = lv.button(lv.screen_active()) button.set_size(100, 50) button.center() @@ -16,7 +16,7 @@ button_label = lv.label(button) button_label.set_text("Click me!") button_label.center() -info_label = lv.label(lv.scr_act()) +info_label = lv.label(lv.screen_active()) info_label.set_text("The last button event:\nNone") button.add_event(lambda e: event_cb(e,info_label), lv.EVENT.ALL, None) diff --git a/examples/event/lv_example_event_3.c b/examples/event/lv_example_event_3.c index 48bd2c7dc..783bb74fb 100644 --- a/examples/event/lv_example_event_3.c +++ b/examples/event/lv_example_event_3.c @@ -22,7 +22,7 @@ static void event_cb(lv_event_t * e) void lv_example_event_3(void) { - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont, 290, 200); lv_obj_center(cont); lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW_WRAP); diff --git a/examples/event/lv_example_event_3.py b/examples/event/lv_example_event_3.py index 132e2d49e..14b8f2fb3 100644 --- a/examples/event/lv_example_event_3.py +++ b/examples/event/lv_example_event_3.py @@ -17,7 +17,7 @@ def event_cb(e): # Demonstrate event bubbling # -cont = lv.obj(lv.scr_act()) +cont = lv.obj(lv.screen_active()) cont.set_size(290, 200) cont.center() cont.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP) diff --git a/examples/event/lv_example_event_4.c b/examples/event/lv_example_event_4.c index ac4670aab..3262441eb 100644 --- a/examples/event/lv_example_event_4.c +++ b/examples/event/lv_example_event_4.c @@ -47,7 +47,7 @@ static void event_cb(lv_event_t * e) */ void lv_example_event_4(void) { - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont, 200, 200); lv_obj_center(cont); lv_obj_add_event(cont, event_cb, LV_EVENT_DRAW_TASK_ADDED, NULL); diff --git a/examples/event/lv_example_event_4.py b/examples/event/lv_example_event_4.py index 48399039c..0a052bd6e 100644 --- a/examples/event/lv_example_event_4.py +++ b/examples/event/lv_example_event_4.py @@ -6,7 +6,7 @@ class LV_Example_Event_4: # self.size = 0 self.size_dec = False - self.cont = lv.obj(lv.scr_act()) + self.cont = lv.obj(lv.screen_active()) self.cont.set_size(200, 200) self.cont.center() self.cont.add_event(self.event_cb, lv.EVENT.DRAW_TASK_ADDED, None) diff --git a/examples/get_started/lv_example_get_started_1.c b/examples/get_started/lv_example_get_started_1.c index 553520d3f..541f797b4 100644 --- a/examples/get_started/lv_example_get_started_1.c +++ b/examples/get_started/lv_example_get_started_1.c @@ -7,12 +7,12 @@ void lv_example_get_started_1(void) { /*Change the active screen's background color*/ - lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x003a57), LV_PART_MAIN); + lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0x003a57), LV_PART_MAIN); /*Create a white label, set its text and align it to the center*/ - 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 world"); - lv_obj_set_style_text_color(lv_scr_act(), lv_color_hex(0xffffff), LV_PART_MAIN); + lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0xffffff), LV_PART_MAIN); lv_obj_align(label, LV_ALIGN_CENTER, 0, 0); } diff --git a/examples/get_started/lv_example_get_started_1.py b/examples/get_started/lv_example_get_started_1.py index 1ede71014..728eb2424 100644 --- a/examples/get_started/lv_example_get_started_1.py +++ b/examples/get_started/lv_example_get_started_1.py @@ -1,9 +1,9 @@ # Change the active screen's background color -scr = lv.scr_act() +scr = lv.screen_active() scr.set_style_bg_color(lv.color_hex(0x003a57), lv.PART.MAIN) # Create a white label, set its text and align it to the center -label = lv.label(lv.scr_act()) +label = lv.label(lv.screen_active()) label.set_text("Hello world") label.set_style_text_color(lv.color_hex(0xffffff), lv.PART.MAIN) label.align(lv.ALIGN.CENTER, 0, 0) diff --git a/examples/get_started/lv_example_get_started_2.c b/examples/get_started/lv_example_get_started_2.c index 02898e0c5..e92a5ccb9 100644 --- a/examples/get_started/lv_example_get_started_2.c +++ b/examples/get_started/lv_example_get_started_2.c @@ -20,7 +20,7 @@ static void btn_event_cb(lv_event_t * e) */ void lv_example_get_started_2(void) { - lv_obj_t * btn = lv_button_create(lv_scr_act()); /*Add a button the current screen*/ + lv_obj_t * btn = lv_button_create(lv_screen_active()); /*Add a button the current screen*/ lv_obj_set_pos(btn, 10, 10); /*Set its position*/ lv_obj_set_size(btn, 120, 50); /*Set its size*/ lv_obj_add_event(btn, btn_event_cb, LV_EVENT_ALL, NULL); /*Assign a callback to the button*/ diff --git a/examples/get_started/lv_example_get_started_2.py b/examples/get_started/lv_example_get_started_2.py index 9ebf8c87b..7c467dd4e 100644 --- a/examples/get_started/lv_example_get_started_2.py +++ b/examples/get_started/lv_example_get_started_2.py @@ -5,7 +5,7 @@ class CounterBtn(): # Create a button with a label and react on click event. # - button = lv.button(lv.scr_act()) # Add a button the current screen + button = lv.button(lv.screen_active()) # Add a button the current screen button.set_pos(10, 10) # Set its position button.set_size(120, 50) # Set its size button.align(lv.ALIGN.CENTER,0,0) diff --git a/examples/get_started/lv_example_get_started_3.c b/examples/get_started/lv_example_get_started_3.c index dd22570fd..865b4131d 100644 --- a/examples/get_started/lv_example_get_started_3.c +++ b/examples/get_started/lv_example_get_started_3.c @@ -50,7 +50,7 @@ void lv_example_get_started_3(void) style_init(); /*Create a button and use the new styles*/ - lv_obj_t * btn = lv_button_create(lv_scr_act()); + lv_obj_t * btn = lv_button_create(lv_screen_active()); /* Remove the styles coming from the theme * Note that size and position are also stored as style properties * so lv_obj_remove_style_all will remove the set size and position too */ @@ -66,7 +66,7 @@ void lv_example_get_started_3(void) lv_obj_center(label); /*Create another button and use the red style too*/ - lv_obj_t * btn2 = lv_button_create(lv_scr_act()); + lv_obj_t * btn2 = lv_button_create(lv_screen_active()); lv_obj_remove_style_all(btn2); /*Remove the styles coming from the theme*/ lv_obj_set_pos(btn2, 10, 80); lv_obj_set_size(btn2, 120, 50); diff --git a/examples/get_started/lv_example_get_started_3.py b/examples/get_started/lv_example_get_started_3.py index 20c530c55..214ff7e91 100644 --- a/examples/get_started/lv_example_get_started_3.py +++ b/examples/get_started/lv_example_get_started_3.py @@ -32,7 +32,7 @@ style_button_pressed.set_bg_color(lv.palette_main(lv.PALETTE.BLUE)) style_button_pressed.set_bg_grad_color(lv.palette_darken(lv.PALETTE.RED, 3)) # Create a button and use the new styles -button = lv.button(lv.scr_act()) # Add a button the current screen +button = lv.button(lv.screen_active()) # Add a button the current screen # Remove the styles coming from the theme # Note that size and position are also stored as style properties # so lv_obj_remove_style_all will remove the set size and position too @@ -47,12 +47,12 @@ label.set_text("Button") # Set the labels text label.center() # Create a slider in the center of the display -slider = lv.slider(lv.scr_act()) +slider = lv.slider(lv.screen_active()) slider.set_width(200) # Set the width slider.center() # Align to the center of the parent (screen) # Create another button and use the red style too -button2 = lv.button(lv.scr_act()) +button2 = lv.button(lv.screen_active()) button2.remove_style_all() # Remove the styles coming from the theme button2.set_pos(10, 80) # Set its position button2.set_size(120, 50) # Set its size diff --git a/examples/get_started/lv_example_get_started_4.c b/examples/get_started/lv_example_get_started_4.c index 5ca42b7ba..92a2bb9b9 100644 --- a/examples/get_started/lv_example_get_started_4.c +++ b/examples/get_started/lv_example_get_started_4.c @@ -18,13 +18,13 @@ static void slider_event_cb(lv_event_t * e) void lv_example_get_started_4(void) { /*Create a slider in the center of the display*/ - lv_obj_t * slider = lv_slider_create(lv_scr_act()); + lv_obj_t * slider = lv_slider_create(lv_screen_active()); lv_obj_set_width(slider, 200); /*Set the width*/ lv_obj_center(slider); /*Align to the center of the parent (screen)*/ lv_obj_add_event(slider, slider_event_cb, LV_EVENT_VALUE_CHANGED, NULL); /*Assign an event function*/ /*Create a label above the slider*/ - label = lv_label_create(lv_scr_act()); + label = lv_label_create(lv_screen_active()); lv_label_set_text(label, "0"); lv_obj_align_to(label, slider, LV_ALIGN_OUT_TOP_MID, 0, -15); /*Align top of the slider*/ } diff --git a/examples/get_started/lv_example_get_started_4.py b/examples/get_started/lv_example_get_started_4.py index 4294996ea..dfaacd70d 100644 --- a/examples/get_started/lv_example_get_started_4.py +++ b/examples/get_started/lv_example_get_started_4.py @@ -9,13 +9,13 @@ def slider_event_cb(e): # # Create a slider in the center of the display -slider = lv.slider(lv.scr_act()) +slider = lv.slider(lv.screen_active()) slider.set_width(200) # Set the width slider.center() # Align to the center of the parent (screen) slider.add_event(slider_event_cb, lv.EVENT.VALUE_CHANGED, None) # Assign an event function # Create a label above the slider -label = lv.label(lv.scr_act()) +label = lv.label(lv.screen_active()) label.set_text("0") label.align_to(slider, lv.ALIGN.OUT_TOP_MID, 0, -15) # Align below the slider diff --git a/examples/layouts/flex/lv_example_flex_1.c b/examples/layouts/flex/lv_example_flex_1.c index 47a2d430a..b92a9bd2b 100644 --- a/examples/layouts/flex/lv_example_flex_1.c +++ b/examples/layouts/flex/lv_example_flex_1.c @@ -7,13 +7,13 @@ void lv_example_flex_1(void) { /*Create a container with ROW flex direction*/ - lv_obj_t * cont_row = lv_obj_create(lv_scr_act()); + lv_obj_t * cont_row = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont_row, 300, 75); lv_obj_align(cont_row, LV_ALIGN_TOP_MID, 0, 5); lv_obj_set_flex_flow(cont_row, LV_FLEX_FLOW_ROW); /*Create a container with COLUMN flex direction*/ - lv_obj_t * cont_col = lv_obj_create(lv_scr_act()); + lv_obj_t * cont_col = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont_col, 200, 150); lv_obj_align_to(cont_col, cont_row, LV_ALIGN_OUT_BOTTOM_MID, 0, 5); lv_obj_set_flex_flow(cont_col, LV_FLEX_FLOW_COLUMN); diff --git a/examples/layouts/flex/lv_example_flex_1.py b/examples/layouts/flex/lv_example_flex_1.py index 98ac26a06..b95599444 100644 --- a/examples/layouts/flex/lv_example_flex_1.py +++ b/examples/layouts/flex/lv_example_flex_1.py @@ -3,13 +3,13 @@ # # Create a container with ROW flex direction -cont_row = lv.obj(lv.scr_act()) +cont_row = lv.obj(lv.screen_active()) cont_row.set_size(300, 75) cont_row.align(lv.ALIGN.TOP_MID, 0, 5) cont_row.set_flex_flow(lv.FLEX_FLOW.ROW) # Create a container with COLUMN flex direction -cont_col = lv.obj(lv.scr_act()) +cont_col = lv.obj(lv.screen_active()) cont_col.set_size(200, 150) cont_col.align_to(cont_row, lv.ALIGN.OUT_BOTTOM_MID, 0, 5) cont_col.set_flex_flow(lv.FLEX_FLOW.COLUMN) diff --git a/examples/layouts/flex/lv_example_flex_2.c b/examples/layouts/flex/lv_example_flex_2.c index dc60744b0..7c5c3d040 100644 --- a/examples/layouts/flex/lv_example_flex_2.c +++ b/examples/layouts/flex/lv_example_flex_2.c @@ -12,7 +12,7 @@ void lv_example_flex_2(void) lv_style_set_flex_main_place(&style, LV_FLEX_ALIGN_SPACE_EVENLY); lv_style_set_layout(&style, LV_LAYOUT_FLEX); - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont, 300, 220); lv_obj_center(cont); lv_obj_add_style(cont, &style, 0); diff --git a/examples/layouts/flex/lv_example_flex_2.py b/examples/layouts/flex/lv_example_flex_2.py index 9946ccd2d..cb28b0797 100644 --- a/examples/layouts/flex/lv_example_flex_2.py +++ b/examples/layouts/flex/lv_example_flex_2.py @@ -7,7 +7,7 @@ style.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP) style.set_flex_main_place(lv.FLEX_ALIGN.SPACE_EVENLY) style.set_layout(lv.LAYOUT.FLEX) -cont = lv.obj(lv.scr_act()) +cont = lv.obj(lv.screen_active()) cont.set_size(300, 220) cont.center() cont.add_style(style, 0) diff --git a/examples/layouts/flex/lv_example_flex_3.c b/examples/layouts/flex/lv_example_flex_3.c index 65e0f8a31..207e6b9de 100644 --- a/examples/layouts/flex/lv_example_flex_3.c +++ b/examples/layouts/flex/lv_example_flex_3.c @@ -6,7 +6,7 @@ */ void lv_example_flex_3(void) { - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont, 300, 220); lv_obj_center(cont); lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW); diff --git a/examples/layouts/flex/lv_example_flex_3.py b/examples/layouts/flex/lv_example_flex_3.py index fb60ce91f..d24d4535b 100644 --- a/examples/layouts/flex/lv_example_flex_3.py +++ b/examples/layouts/flex/lv_example_flex_3.py @@ -2,7 +2,7 @@ # Demonstrate flex grow. # -cont = lv.obj(lv.scr_act()) +cont = lv.obj(lv.screen_active()) cont.set_size(300, 220) cont.center() cont.set_flex_flow(lv.FLEX_FLOW.ROW) diff --git a/examples/layouts/flex/lv_example_flex_4.c b/examples/layouts/flex/lv_example_flex_4.c index 7aa387f80..bf9a4ba2c 100644 --- a/examples/layouts/flex/lv_example_flex_4.c +++ b/examples/layouts/flex/lv_example_flex_4.c @@ -7,7 +7,7 @@ void lv_example_flex_4(void) { - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont, 300, 220); lv_obj_center(cont); lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_COLUMN_REVERSE); diff --git a/examples/layouts/flex/lv_example_flex_4.py b/examples/layouts/flex/lv_example_flex_4.py index 4958e9381..8bd5f063e 100644 --- a/examples/layouts/flex/lv_example_flex_4.py +++ b/examples/layouts/flex/lv_example_flex_4.py @@ -1,7 +1,7 @@ # # Reverse the order of flex items # -cont = lv.obj(lv.scr_act()) +cont = lv.obj(lv.screen_active()) cont.set_size(300, 220) cont.center() cont.set_flex_flow(lv.FLEX_FLOW.COLUMN_REVERSE) diff --git a/examples/layouts/flex/lv_example_flex_5.c b/examples/layouts/flex/lv_example_flex_5.c index 2b505184a..d812aad21 100644 --- a/examples/layouts/flex/lv_example_flex_5.c +++ b/examples/layouts/flex/lv_example_flex_5.c @@ -16,7 +16,7 @@ static void column_gap_anim(void * obj, int32_t v) */ void lv_example_flex_5(void) { - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont, 300, 220); lv_obj_center(cont); lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW_WRAP); diff --git a/examples/layouts/flex/lv_example_flex_5.py b/examples/layouts/flex/lv_example_flex_5.py index a98ec8f1e..a6404f2bf 100644 --- a/examples/layouts/flex/lv_example_flex_5.py +++ b/examples/layouts/flex/lv_example_flex_5.py @@ -9,7 +9,7 @@ def column_gap_anim(obj, v): # Demonstrate the effect of column and row gap style properties # -cont = lv.obj(lv.scr_act()) +cont = lv.obj(lv.screen_active()) cont.set_size(300, 220) cont.center() cont.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP) diff --git a/examples/layouts/flex/lv_example_flex_6.c b/examples/layouts/flex/lv_example_flex_6.c index a481af07a..0f9b27ccf 100644 --- a/examples/layouts/flex/lv_example_flex_6.c +++ b/examples/layouts/flex/lv_example_flex_6.c @@ -7,7 +7,7 @@ */ void lv_example_flex_6(void) { - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_style_base_dir(cont, LV_BASE_DIR_RTL, 0); lv_obj_set_size(cont, 300, 220); lv_obj_center(cont); diff --git a/examples/layouts/flex/lv_example_flex_6.py b/examples/layouts/flex/lv_example_flex_6.py index 11d0160bd..5ab5f1b59 100644 --- a/examples/layouts/flex/lv_example_flex_6.py +++ b/examples/layouts/flex/lv_example_flex_6.py @@ -3,7 +3,7 @@ # Also demonstrate how horizontal scrolling works with RTL. # -cont = lv.obj(lv.scr_act()) +cont = lv.obj(lv.screen_active()) cont.set_style_base_dir(lv.BASE_DIR.RTL,0) cont.set_size(300, 220) cont.center() diff --git a/examples/layouts/grid/lv_example_grid_1.c b/examples/layouts/grid/lv_example_grid_1.c index 6dac9f3d2..610fe2e80 100644 --- a/examples/layouts/grid/lv_example_grid_1.c +++ b/examples/layouts/grid/lv_example_grid_1.c @@ -10,7 +10,7 @@ void lv_example_grid_1(void) static lv_coord_t row_dsc[] = {50, 50, 50, LV_GRID_TEMPLATE_LAST}; /*Create a container with grid*/ - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_style_grid_column_dsc_array(cont, col_dsc, 0); lv_obj_set_style_grid_row_dsc_array(cont, row_dsc, 0); lv_obj_set_size(cont, 300, 220); diff --git a/examples/layouts/grid/lv_example_grid_1.py b/examples/layouts/grid/lv_example_grid_1.py index 0f75b136a..6f6915a66 100644 --- a/examples/layouts/grid/lv_example_grid_1.py +++ b/examples/layouts/grid/lv_example_grid_1.py @@ -6,7 +6,7 @@ col_dsc = [70, 70, 70, lv.GRID_TEMPLATE_LAST] row_dsc = [50, 50, 50, lv.GRID_TEMPLATE_LAST] # Create a container with grid -cont = lv.obj(lv.scr_act()) +cont = lv.obj(lv.screen_active()) cont.set_style_grid_column_dsc_array(col_dsc, 0) cont.set_style_grid_row_dsc_array(row_dsc, 0) cont.set_size(300, 220) diff --git a/examples/layouts/grid/lv_example_grid_2.c b/examples/layouts/grid/lv_example_grid_2.c index f992c57a5..45702c005 100644 --- a/examples/layouts/grid/lv_example_grid_2.c +++ b/examples/layouts/grid/lv_example_grid_2.c @@ -11,7 +11,7 @@ void lv_example_grid_2(void) static lv_coord_t row_dsc[] = {50, 50, 50, LV_GRID_TEMPLATE_LAST}; /*Create a container with grid*/ - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_grid_dsc_array(cont, col_dsc, row_dsc); lv_obj_set_size(cont, 300, 220); lv_obj_center(cont); diff --git a/examples/layouts/grid/lv_example_grid_2.py b/examples/layouts/grid/lv_example_grid_2.py index 9e705ebd9..8c457a10e 100644 --- a/examples/layouts/grid/lv_example_grid_2.py +++ b/examples/layouts/grid/lv_example_grid_2.py @@ -6,7 +6,7 @@ col_dsc = [70, 70, 70, lv.GRID_TEMPLATE_LAST] row_dsc = [50, 50, 50, lv.GRID_TEMPLATE_LAST] # Create a container with grid -cont = lv.obj(lv.scr_act()) +cont = lv.obj(lv.screen_active()) cont.set_grid_dsc_array(col_dsc, row_dsc) cont.set_size(300, 220) cont.center() diff --git a/examples/layouts/grid/lv_example_grid_3.c b/examples/layouts/grid/lv_example_grid_3.c index 17e4dd907..78280e0f0 100644 --- a/examples/layouts/grid/lv_example_grid_3.c +++ b/examples/layouts/grid/lv_example_grid_3.c @@ -17,7 +17,7 @@ void lv_example_grid_3(void) static lv_coord_t row_dsc[] = {50, LV_GRID_FR(1), 50, LV_GRID_TEMPLATE_LAST}; /*Create a container with grid*/ - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont, 300, 220); lv_obj_center(cont); lv_obj_set_grid_dsc_array(cont, col_dsc, row_dsc); diff --git a/examples/layouts/grid/lv_example_grid_3.py b/examples/layouts/grid/lv_example_grid_3.py index 94f4ea264..6249e92a0 100644 --- a/examples/layouts/grid/lv_example_grid_3.py +++ b/examples/layouts/grid/lv_example_grid_3.py @@ -15,7 +15,7 @@ col_dsc = [60, lv.grid_fr(1), lv.grid_fr(2), lv.GRID_TEMPLATE_LAST] row_dsc = [40, lv.grid_fr(1), 40, lv.GRID_TEMPLATE_LAST] # Create a container with grid -cont = lv.obj(lv.scr_act()) +cont = lv.obj(lv.screen_active()) cont.set_size(300, 220) cont.center() cont.set_grid_dsc_array(col_dsc, row_dsc) diff --git a/examples/layouts/grid/lv_example_grid_4.c b/examples/layouts/grid/lv_example_grid_4.c index 514147791..caf85dea9 100644 --- a/examples/layouts/grid/lv_example_grid_4.c +++ b/examples/layouts/grid/lv_example_grid_4.c @@ -13,7 +13,7 @@ void lv_example_grid_4(void) /*Add space between the columns and move the rows to the bottom (end)*/ /*Create a container with grid*/ - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_grid_align(cont, LV_GRID_ALIGN_SPACE_BETWEEN, LV_GRID_ALIGN_END); lv_obj_set_grid_dsc_array(cont, col_dsc, row_dsc); lv_obj_set_size(cont, 300, 220); diff --git a/examples/layouts/grid/lv_example_grid_4.py b/examples/layouts/grid/lv_example_grid_4.py index 8f8e0240b..8d73dcd11 100644 --- a/examples/layouts/grid/lv_example_grid_4.py +++ b/examples/layouts/grid/lv_example_grid_4.py @@ -9,7 +9,7 @@ row_dsc = [40, 40, 40, lv.GRID_TEMPLATE_LAST] # Add space between the columns and move the rows to the bottom (end) # Create a container with grid -cont = lv.obj(lv.scr_act()) +cont = lv.obj(lv.screen_active()) cont.set_grid_align(lv.GRID_ALIGN.SPACE_BETWEEN, lv.GRID_ALIGN.END) cont.set_grid_dsc_array(col_dsc, row_dsc) cont.set_size(300, 220) diff --git a/examples/layouts/grid/lv_example_grid_5.c b/examples/layouts/grid/lv_example_grid_5.c index af96ff825..ed93fa615 100644 --- a/examples/layouts/grid/lv_example_grid_5.c +++ b/examples/layouts/grid/lv_example_grid_5.c @@ -22,7 +22,7 @@ void lv_example_grid_5(void) static lv_coord_t row_dsc[] = {45, 45, 45, LV_GRID_TEMPLATE_LAST}; /*Create a container with grid*/ - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont, 300, 220); lv_obj_center(cont); lv_obj_set_grid_dsc_array(cont, col_dsc, row_dsc); diff --git a/examples/layouts/grid/lv_example_grid_5.py b/examples/layouts/grid/lv_example_grid_5.py index 07fa786d1..ebe218f2d 100644 --- a/examples/layouts/grid/lv_example_grid_5.py +++ b/examples/layouts/grid/lv_example_grid_5.py @@ -13,7 +13,7 @@ col_dsc = [60, 60, 60, lv.GRID_TEMPLATE_LAST] row_dsc = [40, 40, 40, lv.GRID_TEMPLATE_LAST] # Create a container with grid -cont = lv.obj(lv.scr_act()) +cont = lv.obj(lv.screen_active()) cont.set_size(300, 220) cont.center() cont.set_grid_dsc_array(col_dsc, row_dsc) diff --git a/examples/layouts/grid/lv_example_grid_6.c b/examples/layouts/grid/lv_example_grid_6.c index 1c06c980e..f21673290 100644 --- a/examples/layouts/grid/lv_example_grid_6.c +++ b/examples/layouts/grid/lv_example_grid_6.c @@ -11,7 +11,7 @@ void lv_example_grid_6(void) static lv_coord_t row_dsc[] = {45, 45, 45, LV_GRID_TEMPLATE_LAST}; /*Create a container with grid*/ - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont, 300, 220); lv_obj_center(cont); lv_obj_set_style_base_dir(cont, LV_BASE_DIR_RTL, 0); diff --git a/examples/layouts/grid/lv_example_grid_6.py b/examples/layouts/grid/lv_example_grid_6.py index 682c9d218..ab8777e79 100644 --- a/examples/layouts/grid/lv_example_grid_6.py +++ b/examples/layouts/grid/lv_example_grid_6.py @@ -5,7 +5,7 @@ col_dsc = [60, 60, 60, lv.GRID_TEMPLATE_LAST] row_dsc = [40, 40, 40, lv.GRID_TEMPLATE_LAST] # Create a container with grid -cont = lv.obj(lv.scr_act()) +cont = lv.obj(lv.screen_active()) cont.set_size(300, 220) cont.center() cont.set_style_base_dir(lv.BASE_DIR.RTL,0) diff --git a/examples/libs/barcode/lv_example_barcode_1.c b/examples/libs/barcode/lv_example_barcode_1.c index 7955662da..4d03a6b44 100644 --- a/examples/libs/barcode/lv_example_barcode_1.c +++ b/examples/libs/barcode/lv_example_barcode_1.c @@ -9,7 +9,7 @@ void lv_example_barcode_1(void) lv_color_t bg_color = lv_palette_lighten(LV_PALETTE_LIGHT_BLUE, 5); lv_color_t fg_color = lv_palette_darken(LV_PALETTE_BLUE, 4); - lv_obj_t * barcode = lv_barcode_create(lv_scr_act()); + lv_obj_t * barcode = lv_barcode_create(lv_screen_active()); lv_obj_set_height(barcode, 50); lv_obj_center(barcode); diff --git a/examples/libs/barcode/lv_example_barcode_1.py b/examples/libs/barcode/lv_example_barcode_1.py index e54da2440..6fb151243 100755 --- a/examples/libs/barcode/lv_example_barcode_1.py +++ b/examples/libs/barcode/lv_example_barcode_1.py @@ -5,7 +5,7 @@ import display_driver bg_color = lv.palette_lighten(lv.PALETTE.LIGHT_BLUE, 5) fg_color = lv.palette_darken(lv.PALETTE.BLUE, 4) -barcode = lv.barcode(lv.scr_act()) +barcode = lv.barcode(lv.screen_active()) barcode.set_height(50) barcode.center() diff --git a/examples/libs/bmp/lv_example_bmp_1.c b/examples/libs/bmp/lv_example_bmp_1.c index c49775257..2dc8713ac 100644 --- a/examples/libs/bmp/lv_example_bmp_1.c +++ b/examples/libs/bmp/lv_example_bmp_1.c @@ -6,7 +6,7 @@ */ void lv_example_bmp_1(void) { - lv_obj_t * img = lv_image_create(lv_scr_act()); + lv_obj_t * img = lv_image_create(lv_screen_active()); /* Assuming a File system is attached to letter 'A' * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ lv_image_set_src(img, "A:lvgl/examples/libs/bmp/example_32bit.bmp"); diff --git a/examples/libs/ffmpeg/lv_example_ffmpeg_1.c b/examples/libs/ffmpeg/lv_example_ffmpeg_1.c index 492bf481b..32af664c7 100644 --- a/examples/libs/ffmpeg/lv_example_ffmpeg_1.c +++ b/examples/libs/ffmpeg/lv_example_ffmpeg_1.c @@ -8,7 +8,7 @@ */ void lv_example_ffmpeg_1(void) { - lv_obj_t * img = lv_image_create(lv_scr_act()); + lv_obj_t * img = lv_image_create(lv_screen_active()); lv_image_set_src(img, "./lvgl/examples/libs/ffmpeg/ffmpeg.png"); lv_obj_center(img); } @@ -20,7 +20,7 @@ void lv_example_ffmpeg_1(void) /*TODO *fallback for online examples*/ - 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, "FFmpeg is not installed"); lv_obj_center(label); } diff --git a/examples/libs/ffmpeg/lv_example_ffmpeg_1.py b/examples/libs/ffmpeg/lv_example_ffmpeg_1.py index 1a5933d43..f52ab75ef 100644 --- a/examples/libs/ffmpeg/lv_example_ffmpeg_1.py +++ b/examples/libs/ffmpeg/lv_example_ffmpeg_1.py @@ -7,7 +7,7 @@ try: # # Open an image from a file # - image = lv.image(lv.scr_act()) + image = lv.image(lv.screen_active()) image.set_src("ffmpeg.png") image.center() except Exception as e: @@ -15,7 +15,7 @@ except Exception as e: # TODO # fallback for online examples - label = lv.label(lv.scr_act()) + label = lv.label(lv.screen_active()) label.set_text("FFmpeg is not installed") label.center() diff --git a/examples/libs/ffmpeg/lv_example_ffmpeg_2.c b/examples/libs/ffmpeg/lv_example_ffmpeg_2.c index 3a8de1e22..73784910f 100644 --- a/examples/libs/ffmpeg/lv_example_ffmpeg_2.c +++ b/examples/libs/ffmpeg/lv_example_ffmpeg_2.c @@ -9,7 +9,7 @@ void lv_example_ffmpeg_2(void) { /*birds.mp4 is downloaded from http://www.videezy.com (Free Stock Footage by Videezy!) *https://www.videezy.com/abstract/44864-silhouettes-of-birds-over-the-sunset*/ - lv_obj_t * player = lv_ffmpeg_player_create(lv_scr_act()); + lv_obj_t * player = lv_ffmpeg_player_create(lv_screen_active()); lv_ffmpeg_player_set_src(player, "./lvgl/examples/libs/ffmpeg/birds.mp4"); lv_ffmpeg_player_set_auto_restart(player, true); lv_ffmpeg_player_set_cmd(player, LV_FFMPEG_PLAYER_CMD_START); @@ -23,7 +23,7 @@ void lv_example_ffmpeg_2(void) /*TODO *fallback for online examples*/ - 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, "FFmpeg is not installed"); lv_obj_center(label); } diff --git a/examples/libs/ffmpeg/lv_example_ffmpeg_2.py b/examples/libs/ffmpeg/lv_example_ffmpeg_2.py index 4fbbcde71..ba72491e1 100644 --- a/examples/libs/ffmpeg/lv_example_ffmpeg_2.py +++ b/examples/libs/ffmpeg/lv_example_ffmpeg_2.py @@ -9,7 +9,7 @@ import display_driver # birds.mp4 is downloaded from http://www.videezy.com (Free Stock Footage by Videezy!) # https://www.videezy.com/abstract/44864-silhouettes-of-birds-over-the-sunset -player = lv.ffmpeg_player(lv.scr_act()) +player = lv.ffmpeg_player(lv.screen_active()) player.player_set_src("birds.mp4") player.player_set_auto_restart(True) player.player_set_cmd(lv.ffmpeg_player.PLAYER_CMD.START) diff --git a/examples/libs/freetype/lv_example_freetype_1.c b/examples/libs/freetype/lv_example_freetype_1.c index 9b13aa558..9d52f51cf 100644 --- a/examples/libs/freetype/lv_example_freetype_1.c +++ b/examples/libs/freetype/lv_example_freetype_1.c @@ -30,7 +30,7 @@ void lv_example_freetype_1(void) lv_style_set_text_align(&style, LV_TEXT_ALIGN_CENTER); /*Create a label with the new style*/ - lv_obj_t * label = lv_label_create(lv_scr_act()); + lv_obj_t * label = lv_label_create(lv_screen_active()); lv_obj_add_style(label, &style, 0); lv_label_set_text(label, "Hello world\nI'm a font created with FreeType"); lv_obj_center(label); @@ -42,7 +42,7 @@ void lv_example_freetype_1(void) /*TODO *fallback for online examples*/ - 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, "FreeType is not installed"); lv_obj_center(label); } diff --git a/examples/libs/freetype/lv_example_freetype_1.py b/examples/libs/freetype/lv_example_freetype_1.py index 17e0b8210..43e279f89 100755 --- a/examples/libs/freetype/lv_example_freetype_1.py +++ b/examples/libs/freetype/lv_example_freetype_1.py @@ -12,7 +12,7 @@ style.set_text_font(font) style.set_text_align(lv.TEXT_ALIGN.CENTER) # Create a label with the new style -label = lv.label(lv.scr_act()) +label = lv.label(lv.screen_active()) label.add_style(style, 0) label.set_text("Hello world\nI'm a font created with FreeType") label.center() diff --git a/examples/libs/gif/lv_example_gif_1.c b/examples/libs/gif/lv_example_gif_1.c index e19a029e9..e972e39ae 100644 --- a/examples/libs/gif/lv_example_gif_1.c +++ b/examples/libs/gif/lv_example_gif_1.c @@ -9,11 +9,11 @@ void lv_example_gif_1(void) LV_IMAGE_DECLARE(img_bulb_gif); lv_obj_t * img; - img = lv_gif_create(lv_scr_act()); + img = lv_gif_create(lv_screen_active()); lv_gif_set_src(img, &img_bulb_gif); lv_obj_align(img, LV_ALIGN_LEFT_MID, 20, 0); - img = lv_gif_create(lv_scr_act()); + img = lv_gif_create(lv_screen_active()); /* Assuming a File system is attached to letter 'A' * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ lv_gif_set_src(img, "A:lvgl/examples/libs/gif/bulb.gif"); diff --git a/examples/libs/gif/lv_example_gif_1.py b/examples/libs/gif/lv_example_gif_1.py index 51af14a3c..f11468b1f 100755 --- a/examples/libs/gif/lv_example_gif_1.py +++ b/examples/libs/gif/lv_example_gif_1.py @@ -16,11 +16,11 @@ image_bulb_gif = lv.image_dsc_t( "data": img_bulb_gif_map, } ) -image1 = lv.gif(lv.scr_act()) +image1 = lv.gif(lv.screen_active()) image1.set_src(image_bulb_gif) image1.align(lv.ALIGN.RIGHT_MID, -150, 0) -image2 = lv.gif(lv.scr_act()) +image2 = lv.gif(lv.screen_active()) # The File system is attached to letter 'S' image2.set_src("S:bulb.gif") diff --git a/examples/libs/libjpeg_turbo/lv_example_libjpeg_turbo_1.c b/examples/libs/libjpeg_turbo/lv_example_libjpeg_turbo_1.c index f43b5813f..5cf8837e6 100644 --- a/examples/libs/libjpeg_turbo/lv_example_libjpeg_turbo_1.c +++ b/examples/libs/libjpeg_turbo/lv_example_libjpeg_turbo_1.c @@ -10,7 +10,7 @@ void lv_example_libjpeg_turbo_1(void) { lv_obj_t * wp; - wp = lv_image_create(lv_scr_act()); + wp = lv_image_create(lv_screen_active()); /* Assuming a File system is attached to letter 'A' * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ lv_image_set_src(wp, "A:lvgl/examples/libs/libjpeg_turbo/flower.jpg"); @@ -21,7 +21,7 @@ void lv_example_libjpeg_turbo_1(void) void lv_example_libjpeg_turbo_1(void) { - 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, "LibJPEG-Turbo is not installed"); lv_obj_center(label); } diff --git a/examples/libs/libjpeg_turbo/lv_example_libjpeg_turbo_1.py b/examples/libs/libjpeg_turbo/lv_example_libjpeg_turbo_1.py index a1f24f597..d580e588f 100755 --- a/examples/libs/libjpeg_turbo/lv_example_libjpeg_turbo_1.py +++ b/examples/libs/libjpeg_turbo/lv_example_libjpeg_turbo_1.py @@ -6,7 +6,7 @@ import fs_driver fs_drv = lv.fs_drv_t() fs_driver.fs_register(fs_drv, 'S') -wp = lv.image(lv.scr_act()) +wp = lv.image(lv.screen_active()) # The File system is attached to letter 'S' wp.set_src("S:flower.jpg") diff --git a/examples/libs/libpng/lv_example_libpng_1.c b/examples/libs/libpng/lv_example_libpng_1.c index cd1a3214b..5c907100c 100644 --- a/examples/libs/libpng/lv_example_libpng_1.c +++ b/examples/libs/libpng/lv_example_libpng_1.c @@ -10,7 +10,7 @@ void lv_example_libpng_1(void) { lv_obj_t * img; - img = lv_image_create(lv_scr_act()); + img = lv_image_create(lv_screen_active()); /* Assuming a File system is attached to letter 'A' * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ lv_image_set_src(img, "A:lvgl/examples/libs/libpng/png_demo.png"); @@ -21,7 +21,7 @@ void lv_example_libpng_1(void) void lv_example_libpng_1(void) { - 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, "LibPNG is not installed"); lv_obj_center(label); } diff --git a/examples/libs/libpng/lv_example_libpng_1.py b/examples/libs/libpng/lv_example_libpng_1.py index 8103f2590..61f07cd9b 100755 --- a/examples/libs/libpng/lv_example_libpng_1.py +++ b/examples/libs/libpng/lv_example_libpng_1.py @@ -6,6 +6,6 @@ import fs_driver fs_drv = lv.fs_drv_t() fs_driver.fs_register(fs_drv, 'S') -image = lv.image(lv.scr_act()) +image = lv.image(lv.screen_active()) image.set_src("S:png_demo.png") image.center() diff --git a/examples/libs/lodepng/lv_example_lodepng_1.c b/examples/libs/lodepng/lv_example_lodepng_1.c index baaccbb67..0c48daf0f 100644 --- a/examples/libs/lodepng/lv_example_lodepng_1.c +++ b/examples/libs/lodepng/lv_example_lodepng_1.c @@ -9,11 +9,11 @@ void lv_example_lodepng_1(void) LV_IMAGE_DECLARE(img_wink_png); lv_obj_t * img; - img = lv_image_create(lv_scr_act()); + img = lv_image_create(lv_screen_active()); lv_image_set_src(img, &img_wink_png); lv_obj_align(img, LV_ALIGN_LEFT_MID, 20, 0); - img = lv_image_create(lv_scr_act()); + img = lv_image_create(lv_screen_active()); /* Assuming a File system is attached to letter 'A' * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ lv_image_set_src(img, "A:lvgl/examples/libs/lodepng/wink.png"); diff --git a/examples/libs/lodepng/lv_example_lodepng_1.py b/examples/libs/lodepng/lv_example_lodepng_1.py index 659bda181..0a3e646df 100755 --- a/examples/libs/lodepng/lv_example_lodepng_1.py +++ b/examples/libs/lodepng/lv_example_lodepng_1.py @@ -10,7 +10,7 @@ image_wink_png = lv.image_dsc_t( "data": img_wink_png_map, } ) -image1 = lv.image(lv.scr_act()) +image1 = lv.image(lv.screen_active()) image1.set_src(image_wink_png) image1.align(lv.ALIGN.RIGHT_MID, -250, 0) @@ -27,6 +27,6 @@ wink_argb = lv.image_dsc_t({ 'data': png_data }) -image2 = lv.image(lv.scr_act()) +image2 = lv.image(lv.screen_active()) image2.set_src(wink_argb) image2.align(lv.ALIGN.RIGHT_MID, -150, 0) diff --git a/examples/libs/qrcode/lv_example_qrcode_1.c b/examples/libs/qrcode/lv_example_qrcode_1.c index 6f1f0593f..400db012a 100644 --- a/examples/libs/qrcode/lv_example_qrcode_1.c +++ b/examples/libs/qrcode/lv_example_qrcode_1.c @@ -9,7 +9,7 @@ void lv_example_qrcode_1(void) lv_color_t bg_color = lv_palette_lighten(LV_PALETTE_LIGHT_BLUE, 5); lv_color_t fg_color = lv_palette_darken(LV_PALETTE_BLUE, 4); - lv_obj_t * qr = lv_qrcode_create(lv_scr_act()); + lv_obj_t * qr = lv_qrcode_create(lv_screen_active()); lv_qrcode_set_size(qr, 150); lv_qrcode_set_dark_color(qr, fg_color); lv_qrcode_set_light_color(qr, bg_color); diff --git a/examples/libs/qrcode/lv_example_qrcode_1.py b/examples/libs/qrcode/lv_example_qrcode_1.py index 0d702a85c..6bdb20a8a 100755 --- a/examples/libs/qrcode/lv_example_qrcode_1.py +++ b/examples/libs/qrcode/lv_example_qrcode_1.py @@ -5,7 +5,7 @@ import display_driver bg_color = lv.palette_lighten(lv.PALETTE.LIGHT_BLUE, 5) fg_color = lv.palette_darken(lv.PALETTE.BLUE, 4) -qr = lv.qrcode(lv.scr_act()) +qr = lv.qrcode(lv.screen_active()) qr.set_size(150) qr.set_dark_color(fg_color) qr.set_light_color(bg_color) diff --git a/examples/libs/rlottie/lv_example_rlottie_1.c b/examples/libs/rlottie/lv_example_rlottie_1.c index ae9c2dbcb..71f01398e 100644 --- a/examples/libs/rlottie/lv_example_rlottie_1.c +++ b/examples/libs/rlottie/lv_example_rlottie_1.c @@ -8,7 +8,7 @@ void lv_example_rlottie_1(void) { extern const uint8_t lv_example_rlottie_approve[]; - lv_obj_t * lottie = lv_rlottie_create_from_raw(lv_scr_act(), 100, 100, (const void *)lv_example_rlottie_approve); + lv_obj_t * lottie = lv_rlottie_create_from_raw(lv_screen_active(), 100, 100, (const void *)lv_example_rlottie_approve); lv_obj_center(lottie); } @@ -18,7 +18,7 @@ void lv_example_rlottie_1(void) /*TODO *fallback for online examples*/ - 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, "Rlottie is not installed"); lv_obj_center(label); } diff --git a/examples/libs/rlottie/lv_example_rlottie_1.py b/examples/libs/rlottie/lv_example_rlottie_1.py index d4f26476a..8c3a8b483 100755 --- a/examples/libs/rlottie/lv_example_rlottie_1.py +++ b/examples/libs/rlottie/lv_example_rlottie_1.py @@ -6,6 +6,6 @@ import display_driver # from lv_example_rlottie_approve import lv_example_rlottie_approve -lottie = lv.rlottie_create_from_raw(lv.scr_act(), 100, 100, lv_example_rlottie_approve) +lottie = lv.rlottie_create_from_raw(lv.screen_active(), 100, 100, lv_example_rlottie_approve) lottie.center() diff --git a/examples/libs/rlottie/lv_example_rlottie_2.c b/examples/libs/rlottie/lv_example_rlottie_2.c index 6a6aa28e4..5c610ab5e 100644 --- a/examples/libs/rlottie/lv_example_rlottie_2.c +++ b/examples/libs/rlottie/lv_example_rlottie_2.c @@ -8,7 +8,7 @@ void lv_example_rlottie_2(void) { /*The rlottie library uses STDIO file API, so there is no driver letter for LVGL*/ - lv_obj_t * lottie = lv_rlottie_create_from_file(lv_scr_act(), 100, 100, + lv_obj_t * lottie = lv_rlottie_create_from_file(lv_screen_active(), 100, 100, "lvgl/examples/libs/rlottie/lv_example_rlottie_approve.json"); lv_obj_center(lottie); } @@ -19,7 +19,7 @@ void lv_example_rlottie_2(void) /*TODO *fallback for online examples*/ - 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, "Rlottie is not installed"); lv_obj_center(label); } diff --git a/examples/libs/rlottie/lv_example_rlottie_2.py b/examples/libs/rlottie/lv_example_rlottie_2.py index 2bcecc704..3b29acdb8 100755 --- a/examples/libs/rlottie/lv_example_rlottie_2.py +++ b/examples/libs/rlottie/lv_example_rlottie_2.py @@ -2,5 +2,5 @@ import lvgl as lv import display_driver -lottie = lv.rlottie_create_from_file(lv.scr_act(), 100, 100,"lv_example_rlottie_approve.json") +lottie = lv.rlottie_create_from_file(lv.screen_active(), 100, 100,"lv_example_rlottie_approve.json") lottie.center() diff --git a/examples/libs/tiny_ttf/lv_example_tiny_ttf_1.c b/examples/libs/tiny_ttf/lv_example_tiny_ttf_1.c index 6b5608ade..adbeca2d6 100644 --- a/examples/libs/tiny_ttf/lv_example_tiny_ttf_1.c +++ b/examples/libs/tiny_ttf/lv_example_tiny_ttf_1.c @@ -17,7 +17,7 @@ void lv_example_tiny_ttf_1(void) lv_style_set_text_align(&style, LV_TEXT_ALIGN_CENTER); /*Create a label with the new style*/ - lv_obj_t * label = lv_label_create(lv_scr_act()); + lv_obj_t * label = lv_label_create(lv_screen_active()); lv_obj_add_style(label, &style, 0); lv_label_set_text(label, "Hello world\nI'm a font\ncreated\nwith Tiny TTF"); lv_obj_center(label); diff --git a/examples/libs/tiny_ttf/lv_example_tiny_ttf_1.py b/examples/libs/tiny_ttf/lv_example_tiny_ttf_1.py index 9684ba2f4..ca2c0599f 100644 --- a/examples/libs/tiny_ttf/lv_example_tiny_ttf_1.py +++ b/examples/libs/tiny_ttf/lv_example_tiny_ttf_1.py @@ -1,5 +1,5 @@ from ubuntu_font import ubuntu_font -# +# # Load a font with Tiny_TTF # #Create style with the new font @@ -10,7 +10,7 @@ style.set_text_font(font) style.set_text_align(lv.TEXT_ALIGN.CENTER) # Create a label with the new style -label = lv.label(lv.scr_act()) +label = lv.label(lv.screen_active()) label.add_style(style, 0) label.set_text("Hello world\nI'm a font created with Tiny TTF") label.center() diff --git a/examples/libs/tiny_ttf/lv_example_tiny_ttf_2.c b/examples/libs/tiny_ttf/lv_example_tiny_ttf_2.c index bc0bae496..3133b955e 100644 --- a/examples/libs/tiny_ttf/lv_example_tiny_ttf_2.c +++ b/examples/libs/tiny_ttf/lv_example_tiny_ttf_2.c @@ -14,7 +14,7 @@ void lv_example_tiny_ttf_2(void) lv_style_set_text_align(&style, LV_TEXT_ALIGN_CENTER); /*Create a label with the new style*/ - lv_obj_t * label = lv_label_create(lv_scr_act()); + lv_obj_t * label = lv_label_create(lv_screen_active()); lv_obj_add_style(label, &style, 0); lv_label_set_text(label, "Hello world\nI'm a font\ncreated\nwith Tiny TTF"); lv_obj_center(label); diff --git a/examples/libs/tiny_ttf/lv_example_tiny_ttf_2.py b/examples/libs/tiny_ttf/lv_example_tiny_ttf_2.py index a70a3203b..daa3d0300 100644 --- a/examples/libs/tiny_ttf/lv_example_tiny_ttf_2.py +++ b/examples/libs/tiny_ttf/lv_example_tiny_ttf_2.py @@ -7,7 +7,7 @@ fs_driver.fs_register(fs_drv, 'S') # get the directory in which the script is running try: script_path = __file__[:__file__.rfind('/')] if __file__.find('/') >= 0 else '.' -except NameError: +except NameError: script_path = '' # @@ -21,7 +21,7 @@ style.set_text_font(font) style.set_text_align(lv.TEXT_ALIGN.CENTER) # Create a label with the new style -label = lv.label(lv.scr_act()) +label = lv.label(lv.screen_active()) label.add_style(style, 0) label.set_text("Hello world\nI'm a font created with Tiny TTF") label.center() diff --git a/examples/libs/tiny_ttf/lv_example_tiny_ttf_3.c b/examples/libs/tiny_ttf/lv_example_tiny_ttf_3.c index b38b60027..65378d45b 100644 --- a/examples/libs/tiny_ttf/lv_example_tiny_ttf_3.c +++ b/examples/libs/tiny_ttf/lv_example_tiny_ttf_3.c @@ -22,19 +22,19 @@ void lv_example_tiny_ttf_3(void) lv_style_set_text_font(&style, font); lv_style_set_text_align(&style, LV_TEXT_ALIGN_CENTER); - lv_obj_t * slider = lv_slider_create(lv_scr_act()); + lv_obj_t * slider = lv_slider_create(lv_screen_active()); lv_obj_center(slider); lv_slider_set_range(slider, 5, 50); lv_obj_align(slider, LV_ALIGN_BOTTOM_MID, 0, -50); lv_slider_bind_value(slider, &subject_font); - lv_obj_t * slider_label = lv_label_create(lv_scr_act()); + lv_obj_t * slider_label = lv_label_create(lv_screen_active()); lv_obj_align_to(slider_label, slider, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); lv_label_bind_text(slider_label, &subject_font, "%d"); /*Create a label with the new style*/ - lv_obj_t * label = lv_label_create(lv_scr_act()); + lv_obj_t * label = lv_label_create(lv_screen_active()); lv_obj_add_style(label, &style, 0); lv_obj_set_size(label, LV_SIZE_CONTENT, LV_SIZE_CONTENT); lv_label_set_text(label, "Hello world!"); diff --git a/examples/libs/tjpgd/lv_example_tjpgd_1.c b/examples/libs/tjpgd/lv_example_tjpgd_1.c index 5531e4a80..f5f3dc0a2 100644 --- a/examples/libs/tjpgd/lv_example_tjpgd_1.c +++ b/examples/libs/tjpgd/lv_example_tjpgd_1.c @@ -8,7 +8,7 @@ void lv_example_tjpgd_1(void) { lv_obj_t * wp; - wp = lv_image_create(lv_scr_act()); + wp = lv_image_create(lv_screen_active()); /* Assuming a File system is attached to letter 'A' * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ lv_image_set_src(wp, "A:lvgl/examples/libs/tjpgd/img_lvgl_logo.jpg"); diff --git a/examples/libs/tjpgd/lv_example_tjpgd_1.py b/examples/libs/tjpgd/lv_example_tjpgd_1.py index d16516931..ab454ad0a 100755 --- a/examples/libs/tjpgd/lv_example_tjpgd_1.py +++ b/examples/libs/tjpgd/lv_example_tjpgd_1.py @@ -6,7 +6,7 @@ import fs_driver fs_drv = lv.fs_drv_t() fs_driver.fs_register(fs_drv, 'S') -wp = lv.image(lv.scr_act()) +wp = lv.image(lv.screen_active()) # The File system is attached to letter 'S' wp.set_src("S:img_lvgl_logo.jpg") diff --git a/examples/others/file_explorer/lv_example_file_explorer_1.c b/examples/others/file_explorer/lv_example_file_explorer_1.c index fc98f8bac..8689401d4 100644 --- a/examples/others/file_explorer/lv_example_file_explorer_1.c +++ b/examples/others/file_explorer/lv_example_file_explorer_1.c @@ -31,7 +31,7 @@ static void file_explorer_event_handler(lv_event_t * e) void lv_example_file_explorer_1(void) { - lv_obj_t * file_explorer = lv_file_explorer_create(lv_scr_act()); + lv_obj_t * file_explorer = lv_file_explorer_create(lv_screen_active()); lv_file_explorer_set_sort(file_explorer, LV_EXPLORER_SORT_KIND); #if LV_USE_FS_WIN32 diff --git a/examples/others/file_explorer/lv_example_file_explorer_1.py b/examples/others/file_explorer/lv_example_file_explorer_1.py index fe9fa167a..f859e590a 100644 --- a/examples/others/file_explorer/lv_example_file_explorer_1.py +++ b/examples/others/file_explorer/lv_example_file_explorer_1.py @@ -16,7 +16,7 @@ def file_explorer_event_handler(e) : # print("cur_path: " + str(cur_path), " sel_fn: " + str(sel_fn)) print(str(cur_path) + str(sel_fn)) -file_explorer = lv.file_explorer(lv.scr_act()) +file_explorer = lv.file_explorer(lv.screen_active()) file_explorer.explorer_set_sort(lv.EXPLORER_SORT.KIND) diff --git a/examples/others/file_explorer/lv_example_file_explorer_2.c b/examples/others/file_explorer/lv_example_file_explorer_2.c index 3a9d83370..19a599925 100644 --- a/examples/others/file_explorer/lv_example_file_explorer_2.c +++ b/examples/others/file_explorer/lv_example_file_explorer_2.c @@ -39,7 +39,7 @@ static void btn_event_handler(lv_event_t * e) if(lv_obj_has_state(btn, LV_STATE_CHECKED)) lv_obj_add_flag(file_explorer, LV_OBJ_FLAG_HIDDEN); else - lv_obj_clear_flag(file_explorer, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(file_explorer, LV_OBJ_FLAG_HIDDEN); } } @@ -63,7 +63,7 @@ static void dd_event_handler(lv_event_t * e) void lv_example_file_explorer_2(void) { - lv_obj_t * file_explorer = lv_file_explorer_create(lv_scr_act()); + lv_obj_t * file_explorer = lv_file_explorer_create(lv_screen_active()); #if LV_USE_FS_WIN32 lv_file_explorer_open_dir(file_explorer, "D:"); diff --git a/examples/others/file_explorer/lv_example_file_explorer_2.py b/examples/others/file_explorer/lv_example_file_explorer_2.py index e94e2c1a6..a9a32f2aa 100644 --- a/examples/others/file_explorer/lv_example_file_explorer_2.py +++ b/examples/others/file_explorer/lv_example_file_explorer_2.py @@ -24,7 +24,7 @@ def button_event_handler(e,fe_quick_access_obj): if button.has_state(lv.STATE.CHECKED) : fe_quick_access_obj.add_flag(lv.obj.FLAG.HIDDEN) else : - fe_quick_access_obj.clear_flag(lv.obj.FLAG.HIDDEN) + fe_quick_access_obj.remove_flag(lv.obj.FLAG.HIDDEN) def dd_event_handler(e, file_explorer): @@ -43,7 +43,7 @@ def dd_event_handler(e, file_explorer): # print("set sort to KIND") file_explorer.explorer_set_sort(lv.EXPLORER_SORT.KIND) -file_explorer = lv.file_explorer(lv.scr_act()) +file_explorer = lv.file_explorer(lv.screen_active()) if LV_USE_FS_WIN32 : file_explorer.explorer_open_dir("D:") diff --git a/examples/others/file_explorer/lv_example_file_explorer_3.c b/examples/others/file_explorer/lv_example_file_explorer_3.c index 393b2ea7c..f6c974664 100644 --- a/examples/others/file_explorer/lv_example_file_explorer_3.c +++ b/examples/others/file_explorer/lv_example_file_explorer_3.c @@ -75,7 +75,7 @@ static void file_explorer_event_handler(lv_event_t * e) void lv_example_file_explorer_3(void) { - lv_obj_t * file_explorer = lv_file_explorer_create(lv_scr_act()); + lv_obj_t * file_explorer = lv_file_explorer_create(lv_screen_active()); /*Before custom sort, please set the default sorting to NONE. The default is NONE.*/ lv_file_explorer_set_sort(file_explorer, LV_EXPLORER_SORT_NONE); diff --git a/examples/others/file_explorer/lv_example_file_explorer_3.py b/examples/others/file_explorer/lv_example_file_explorer_3.py index 600c92ac9..b919270f8 100644 --- a/examples/others/file_explorer/lv_example_file_explorer_3.py +++ b/examples/others/file_explorer/lv_example_file_explorer_3.py @@ -57,11 +57,11 @@ def file_explorer_event_handler(e) : # print("sum: ",sum) sort_by_file_kind(tb, 0, (sum - 1)); -file_explorer = lv.file_explorer(lv.scr_act()) +file_explorer = lv.file_explorer(lv.screen_active()) # Before custom sort, please set the default sorting to NONE. The default is NONE. file_explorer.explorer_set_sort(lv.EXPLORER_SORT.NONE) -file_explorer = lv.file_explorer(lv.scr_act()) +file_explorer = lv.file_explorer(lv.screen_active()) if LV_USE_FS_WIN32 : file_explorer.explorer_open_dir("D:") diff --git a/examples/others/fragment/lv_example_fragment_1.c b/examples/others/fragment/lv_example_fragment_1.c index 05cdf501f..92abfbd51 100644 --- a/examples/others/fragment/lv_example_fragment_1.c +++ b/examples/others/fragment/lv_example_fragment_1.c @@ -10,7 +10,7 @@ static void sample_fragment_ctor(lv_fragment_t * self, void * args); static lv_obj_t * sample_fragment_create_obj(lv_fragment_t * self, lv_obj_t * parent); -static void sample_container_del(lv_event_t * e); +static void sample_container_delete(lv_event_t * e); static lv_obj_t * root = NULL; @@ -27,11 +27,11 @@ static const lv_fragment_class_t sample_cls = { void lv_example_fragment_1(void) { - root = lv_obj_create(lv_scr_act()); + root = lv_obj_create(lv_screen_active()); lv_obj_set_size(root, LV_PCT(100), LV_PCT(100)); lv_fragment_manager_t * manager = lv_fragment_manager_create(NULL); /* Clean up the fragment manager before objects in containers got deleted */ - lv_obj_add_event(root, sample_container_del, LV_EVENT_DELETE, manager); + lv_obj_add_event(root, sample_container_delete, LV_EVENT_DELETE, manager); lv_fragment_t * fragment = lv_fragment_create(&sample_cls, "Fragment"); lv_fragment_manager_replace(manager, fragment, &root); @@ -51,10 +51,10 @@ static lv_obj_t * sample_fragment_create_obj(lv_fragment_t * self, lv_obj_t * pa return label; } -static void sample_container_del(lv_event_t * e) +static void sample_container_delete(lv_event_t * e) { lv_fragment_manager_t * manager = (lv_fragment_manager_t *) lv_event_get_user_data(e); - lv_fragment_manager_del(manager); + lv_fragment_manager_delete(manager); } #endif diff --git a/examples/others/fragment/lv_example_fragment_2.c b/examples/others/fragment/lv_example_fragment_2.c index f05913f27..49134d195 100644 --- a/examples/others/fragment/lv_example_fragment_2.c +++ b/examples/others/fragment/lv_example_fragment_2.c @@ -14,7 +14,7 @@ static void sample_push_click(lv_event_t * e); static void sample_pop_click(lv_event_t * e); -static void sample_container_del(lv_event_t * e); +static void sample_container_delete(lv_event_t * e); static void sample_fragment_inc_click(lv_event_t * e); @@ -35,7 +35,7 @@ static lv_obj_t * container = NULL; void lv_example_fragment_2(void) { - lv_obj_t * root = lv_obj_create(lv_scr_act()); + lv_obj_t * root = lv_obj_create(lv_screen_active()); lv_obj_set_size(root, LV_PCT(100), LV_PCT(100)); lv_obj_set_layout(root, LV_LAYOUT_GRID); static const lv_coord_t col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; @@ -57,7 +57,7 @@ void lv_example_fragment_2(void) lv_fragment_manager_t * manager = lv_fragment_manager_create(NULL); /* Clean up the fragment manager before objects in containers got deleted */ - lv_obj_add_event(root, sample_container_del, LV_EVENT_DELETE, manager); + lv_obj_add_event(root, sample_container_delete, LV_EVENT_DELETE, manager); int depth = 0; lv_fragment_t * fragment = lv_fragment_create(&sample_cls, &depth); @@ -111,10 +111,10 @@ static void sample_pop_click(lv_event_t * e) lv_fragment_manager_pop(manager); } -static void sample_container_del(lv_event_t * e) +static void sample_container_delete(lv_event_t * e) { lv_fragment_manager_t * manager = (lv_fragment_manager_t *) lv_event_get_user_data(e); - lv_fragment_manager_del(manager); + lv_fragment_manager_delete(manager); } static void sample_fragment_inc_click(lv_event_t * e) diff --git a/examples/others/gridnav/lv_example_gridnav_1.c b/examples/others/gridnav/lv_example_gridnav_1.c index 3eeb70d93..7ef610726 100644 --- a/examples/others/gridnav/lv_example_gridnav_1.c +++ b/examples/others/gridnav/lv_example_gridnav_1.c @@ -9,7 +9,7 @@ void lv_example_gridnav_1(void) /*It's assumed that the default group is set and *there is a keyboard indev*/ - lv_obj_t * cont1 = lv_obj_create(lv_scr_act()); + lv_obj_t * cont1 = lv_obj_create(lv_screen_active()); lv_gridnav_add(cont1, LV_GRIDNAV_CTRL_NONE); /*Use flex here, but works with grid or manually placed objects as well*/ @@ -37,7 +37,7 @@ void lv_example_gridnav_1(void) /* Create a second container with rollover grid nav mode.*/ - lv_obj_t * cont2 = lv_obj_create(lv_scr_act()); + lv_obj_t * cont2 = lv_obj_create(lv_screen_active()); lv_gridnav_add(cont2, LV_GRIDNAV_CTRL_ROLLOVER); lv_obj_set_style_bg_color(cont2, lv_palette_lighten(LV_PALETTE_BLUE, 5), LV_STATE_FOCUSED); lv_obj_set_size(cont2, lv_pct(50), lv_pct(100)); diff --git a/examples/others/gridnav/lv_example_gridnav_1.py b/examples/others/gridnav/lv_example_gridnav_1.py index 23ed8aaff..fa0e45b7c 100644 --- a/examples/others/gridnav/lv_example_gridnav_1.py +++ b/examples/others/gridnav/lv_example_gridnav_1.py @@ -4,7 +4,7 @@ # It's assumed that the default group is set and # there is a keyboard indev -cont1 = lv.obj(lv.scr_act()) +cont1 = lv.obj(lv.screen_active()) lv.gridnav_add(cont1, lv.GRIDNAV_CTRL.NONE) # Use flex here, but works with grid or manually placed objects as well @@ -30,7 +30,7 @@ for i in range(10): # Create a second container with rollover grid nav mode. -cont2 = lv.obj(lv.scr_act()) +cont2 = lv.obj(lv.screen_active()) lv.gridnav_add(cont2,lv.GRIDNAV_CTRL.ROLLOVER) cont2.set_style_bg_color(lv.palette_lighten(lv.PALETTE.BLUE, 5), lv.STATE.FOCUSED) cont2.set_size(lv.pct(50), lv.pct(100)) diff --git a/examples/others/gridnav/lv_example_gridnav_2.c b/examples/others/gridnav/lv_example_gridnav_2.c index 76caf41b7..0da833ac5 100644 --- a/examples/others/gridnav/lv_example_gridnav_2.c +++ b/examples/others/gridnav/lv_example_gridnav_2.c @@ -9,7 +9,7 @@ void lv_example_gridnav_2(void) /*It's assumed that the default group is set and *there is a keyboard indev*/ - lv_obj_t * list1 = lv_list_create(lv_scr_act()); + lv_obj_t * list1 = lv_list_create(lv_screen_active()); lv_gridnav_add(list1, LV_GRIDNAV_CTRL_NONE); lv_obj_set_size(list1, lv_pct(45), lv_pct(80)); lv_obj_align(list1, LV_ALIGN_LEFT_MID, 5, 0); @@ -26,7 +26,7 @@ void lv_example_gridnav_2(void) lv_group_remove_obj(item); /*Not needed, we use the gridnav instead*/ } - lv_obj_t * list2 = lv_list_create(lv_scr_act()); + lv_obj_t * list2 = lv_list_create(lv_screen_active()); lv_gridnav_add(list2, LV_GRIDNAV_CTRL_ROLLOVER); lv_obj_set_size(list2, lv_pct(45), lv_pct(80)); lv_obj_align(list2, LV_ALIGN_RIGHT_MID, -5, 0); diff --git a/examples/others/gridnav/lv_example_gridnav_2.py b/examples/others/gridnav/lv_example_gridnav_2.py index 5c8dcd9ef..5748cba18 100644 --- a/examples/others/gridnav/lv_example_gridnav_2.py +++ b/examples/others/gridnav/lv_example_gridnav_2.py @@ -4,7 +4,7 @@ # It's assumed that the default group is set and # there is a keyboard indev -list1 = lv.list(lv.scr_act()) +list1 = lv.list(lv.screen_active()) lv.gridnav_add(list1, lv.GRIDNAV_CTRL.NONE) list1.set_size(lv.pct(45), lv.pct(80)) list1.align(lv.ALIGN.LEFT_MID, 5, 0) @@ -17,7 +17,7 @@ for i in range(15): item.set_style_bg_opa(0, 0) lv.group_remove_obj(item) # Not needed, we use the gridnav instead -list2 = lv.list(lv.scr_act()) +list2 = lv.list(lv.screen_active()) lv.gridnav_add(list2, lv.GRIDNAV_CTRL.ROLLOVER) list2.set_size(lv.pct(45), lv.pct(80)) list2.align(lv.ALIGN.RIGHT_MID, -5, 0) diff --git a/examples/others/gridnav/lv_example_gridnav_3.c b/examples/others/gridnav/lv_example_gridnav_3.c index 3b3ecaa66..d60c77860 100644 --- a/examples/others/gridnav/lv_example_gridnav_3.c +++ b/examples/others/gridnav/lv_example_gridnav_3.c @@ -22,7 +22,7 @@ void lv_example_gridnav_3(void) /*It's assumed that the default group is set and *there is a keyboard indev*/ - lv_obj_t * cont_main = lv_obj_create(lv_scr_act()); + lv_obj_t * cont_main = lv_obj_create(lv_screen_active()); lv_gridnav_add(cont_main, LV_GRIDNAV_CTRL_ROLLOVER | LV_GRIDNAV_CTRL_SCROLL_FIRST); /*Only the container needs to be in a group*/ diff --git a/examples/others/gridnav/lv_example_gridnav_3.py b/examples/others/gridnav/lv_example_gridnav_3.py index a58022507..cbd561d82 100644 --- a/examples/others/gridnav/lv_example_gridnav_3.py +++ b/examples/others/gridnav/lv_example_gridnav_3.py @@ -13,7 +13,7 @@ def cont_sub_event_cb(e): # It's assumed that the default group is set and # there is a keyboard indev*/ -cont_main = lv.obj(lv.scr_act()) +cont_main = lv.obj(lv.screen_active()) lv.gridnav_add(cont_main,lv.GRIDNAV_CTRL.ROLLOVER | lv.GRIDNAV_CTRL.SCROLL_FIRST) # Only the container needs to be in a group diff --git a/examples/others/gridnav/lv_example_gridnav_4.c b/examples/others/gridnav/lv_example_gridnav_4.c index c7bd398f0..093b63547 100644 --- a/examples/others/gridnav/lv_example_gridnav_4.c +++ b/examples/others/gridnav/lv_example_gridnav_4.c @@ -17,7 +17,7 @@ void lv_example_gridnav_4(void) /*It's assumed that the default group is set and *there is a keyboard indev*/ - lv_obj_t * list = lv_list_create(lv_scr_act()); + lv_obj_t * list = lv_list_create(lv_screen_active()); lv_gridnav_add(list, LV_GRIDNAV_CTRL_ROLLOVER); lv_obj_align(list, LV_ALIGN_LEFT_MID, 10, 0); lv_group_add_obj(lv_group_get_default(), list); @@ -38,7 +38,7 @@ void lv_example_gridnav_4(void) lv_group_remove_obj(item); /*The default group adds it automatically*/ } - lv_obj_t * btn = lv_button_create(lv_scr_act()); + lv_obj_t * btn = lv_button_create(lv_screen_active()); lv_obj_align(btn, LV_ALIGN_RIGHT_MID, -10, 0); lv_obj_t * label = lv_label_create(btn); lv_label_set_text(label, "Button"); diff --git a/examples/others/gridnav/lv_example_gridnav_4.py b/examples/others/gridnav/lv_example_gridnav_4.py index fbd437b20..7281d8202 100644 --- a/examples/others/gridnav/lv_example_gridnav_4.py +++ b/examples/others/gridnav/lv_example_gridnav_4.py @@ -10,7 +10,7 @@ def event_handler(e): # It's assumed that the default group is set and # there is a keyboard indev -list = lv.list(lv.scr_act()) +list = lv.list(lv.screen_active()) lv.gridnav_add(list, lv.GRIDNAV_CTRL.ROLLOVER) list.align(lv.ALIGN.LEFT_MID, 0, 10) lv.group_get_default().add_obj(list) @@ -29,7 +29,7 @@ for i in range(20): item.add_event(event_handler, lv.EVENT.CLICKED, None) lv.group_remove_obj(item) # The default group adds it automatically -button = lv.button(lv.scr_act()) +button = lv.button(lv.screen_active()) button.align(lv.ALIGN.RIGHT_MID, 0, -10) label = lv.label(button) label.set_text("Button") diff --git a/examples/others/ime/lv_example_ime_pinyin_1.c b/examples/others/ime/lv_example_ime_pinyin_1.c index acaec7016..69b8293d2 100644 --- a/examples/others/ime/lv_example_ime_pinyin_1.c +++ b/examples/others/ime/lv_example_ime_pinyin_1.c @@ -10,30 +10,30 @@ static void ta_event_cb(lv_event_t * e) if(code == LV_EVENT_FOCUSED) { if(lv_indev_get_type(lv_indev_get_act()) != LV_INDEV_TYPE_KEYPAD) { lv_keyboard_set_textarea(kb, ta); - lv_obj_clear_flag(kb, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(kb, LV_OBJ_FLAG_HIDDEN); } } else if(code == LV_EVENT_CANCEL) { lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN); - lv_obj_clear_state(ta, LV_STATE_FOCUSED); + lv_obj_remove_state(ta, LV_STATE_FOCUSED); lv_indev_reset(NULL, ta); /*To forget the last clicked object to make it focusable again*/ } } void lv_example_ime_pinyin_1(void) { - lv_obj_t * pinyin_ime = lv_ime_pinyin_create(lv_scr_act()); + lv_obj_t * pinyin_ime = lv_ime_pinyin_create(lv_screen_active()); lv_obj_set_style_text_font(pinyin_ime, &lv_font_simsun_16_cjk, 0); //lv_ime_pinyin_set_dict(pinyin_ime, your_dict); // Use a custom dictionary. If it is not set, the built-in dictionary will be used. /* ta1 */ - lv_obj_t * ta1 = lv_textarea_create(lv_scr_act()); + lv_obj_t * ta1 = lv_textarea_create(lv_screen_active()); lv_textarea_set_one_line(ta1, true); lv_obj_set_style_text_font(ta1, &lv_font_simsun_16_cjk, 0); lv_obj_align(ta1, LV_ALIGN_TOP_LEFT, 0, 0); /*Create a keyboard and add it to ime_pinyin*/ - lv_obj_t * kb = lv_keyboard_create(lv_scr_act()); + lv_obj_t * kb = lv_keyboard_create(lv_screen_active()); lv_ime_pinyin_set_keyboard(pinyin_ime, kb); lv_keyboard_set_textarea(kb, ta1); @@ -45,7 +45,7 @@ void lv_example_ime_pinyin_1(void) lv_obj_align_to(cand_panel, kb, LV_ALIGN_OUT_TOP_MID, 0, 0); /*Try using ime_pinyin to output the Chinese below in the ta1 above*/ - 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/examples/others/ime/lv_example_ime_pinyin_1.py b/examples/others/ime/lv_example_ime_pinyin_1.py index dda7fabe4..984f51ba9 100644 --- a/examples/others/ime/lv_example_ime_pinyin_1.py +++ b/examples/others/ime/lv_example_ime_pinyin_1.py @@ -7,10 +7,10 @@ def ta_event_cb(e,kb): if code == lv.EVENT.FOCUSED: if lv.indev_get_act() != None and lv.indev_get_act().get_type() != lv.INDEV_TYPE.KEYPAD : kb.set_textarea(ta) - kb.clear_flag(lv.obj.FLAG.HIDDEN) + kb.remove_flag(lv.obj.FLAG.HIDDEN) elif code == lv.EVENT.CANCEL: kb.add_flag(lv.obj.FLAG.HIDDEN) - ta.clear_state(ta, LV_STATE_FOCUSED); + ta.remove_state(ta, LV_STATE_FOCUSED); lv.indev_reset(None, ta) # To forget the last clicked object to make it focusable again fs_drv = lv.fs_drv_t() @@ -19,18 +19,18 @@ font_simsun_16_cjk = lv.font_load("S:../../assets/font/lv_font_simsun_16_cjk.fnt if font_simsun_16_cjk == None: print("Error when loading chinese font") -pinyin_ime = lv.ime_pinyin(lv.scr_act()) +pinyin_ime = lv.ime_pinyin(lv.screen_active()) pinyin_ime.set_style_text_font(font_simsun_16_cjk, 0) # pinyin_ime.pinyin_set_dict(your_dict) # Use a custom dictionary. If it is not set, the built-in dictionary will be used. # ta1 -ta1 = lv.textarea(lv.scr_act()) +ta1 = lv.textarea(lv.screen_active()) ta1.set_one_line(True) ta1.set_style_text_font(font_simsun_16_cjk, 0) ta1.align(lv.ALIGN.TOP_LEFT, 0, 0) # Create a keyboard and add it to ime_pinyin -kb = lv.keyboard(lv.scr_act()) +kb = lv.keyboard(lv.screen_active()) pinyin_ime.pinyin_set_keyboard(kb) kb.set_textarea(ta1) @@ -42,7 +42,7 @@ cand_panel.set_size(lv.pct(100), lv.pct(10)) cand_panel.align_to(kb, lv.ALIGN.OUT_TOP_MID, 0, 0) # Try using ime_pinyin to output the Chinese below in the ta1 above -cz_label = lv.label(lv.scr_act()) +cz_label = lv.label(lv.screen_active()) cz_label.set_text("嵌入式系统(Embedded System),\n是一种嵌入机械或电气系统内部、具有专一功能和实时计算性能的计算机系统。") cz_label.set_style_text_font(font_simsun_16_cjk, 0) cz_label.set_width(310) diff --git a/examples/others/ime/lv_example_ime_pinyin_2.c b/examples/others/ime/lv_example_ime_pinyin_2.c index 705a2c239..aded3d8e3 100644 --- a/examples/others/ime/lv_example_ime_pinyin_2.c +++ b/examples/others/ime/lv_example_ime_pinyin_2.c @@ -10,30 +10,30 @@ static void ta_event_cb(lv_event_t * e) if(code == LV_EVENT_FOCUSED) { if(lv_indev_get_type(lv_indev_get_act()) != LV_INDEV_TYPE_KEYPAD) { lv_keyboard_set_textarea(kb, ta); - lv_obj_clear_flag(kb, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(kb, LV_OBJ_FLAG_HIDDEN); } } else if(code == LV_EVENT_READY) { lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN); - lv_obj_clear_state(ta, LV_STATE_FOCUSED); + lv_obj_remove_state(ta, LV_STATE_FOCUSED); lv_indev_reset(NULL, ta); /*To forget the last clicked object to make it focusable again*/ } } void lv_example_ime_pinyin_2(void) { - lv_obj_t * pinyin_ime = lv_ime_pinyin_create(lv_scr_act()); + lv_obj_t * pinyin_ime = lv_ime_pinyin_create(lv_screen_active()); lv_obj_set_style_text_font(pinyin_ime, &lv_font_simsun_16_cjk, 0); //lv_ime_pinyin_set_dict(pinyin_ime, your_dict); // Use a custom dictionary. If it is not set, the built-in dictionary will be used. /* ta1 */ - lv_obj_t * ta1 = lv_textarea_create(lv_scr_act()); + lv_obj_t * ta1 = lv_textarea_create(lv_screen_active()); lv_textarea_set_one_line(ta1, true); lv_obj_set_style_text_font(ta1, &lv_font_simsun_16_cjk, 0); lv_obj_align(ta1, LV_ALIGN_TOP_LEFT, 0, 0); /*Create a keyboard and add it to ime_pinyin*/ - lv_obj_t * kb = lv_keyboard_create(lv_scr_act()); + lv_obj_t * kb = lv_keyboard_create(lv_screen_active()); lv_keyboard_set_textarea(kb, ta1); lv_ime_pinyin_set_keyboard(pinyin_ime, kb); @@ -47,7 +47,7 @@ void lv_example_ime_pinyin_2(void) lv_obj_align_to(cand_panel, kb, LV_ALIGN_OUT_TOP_MID, 0, 0); /*Try using ime_pinyin to output the Chinese below in the ta1 above*/ - 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/examples/others/ime/lv_example_ime_pinyin_2.py b/examples/others/ime/lv_example_ime_pinyin_2.py index d0b17141d..231c69a23 100644 --- a/examples/others/ime/lv_example_ime_pinyin_2.py +++ b/examples/others/ime/lv_example_ime_pinyin_2.py @@ -7,10 +7,10 @@ def ta_event_cb(e,kb): if code == lv.EVENT.FOCUSED: if lv.indev_get_act() != None and lv.indev_get_act().get_type() != lv.INDEV_TYPE.KEYPAD : kb.set_textarea(ta) - kb.clear_flag(lv.obj.FLAG.HIDDEN) + kb.remove_flag(lv.obj.FLAG.HIDDEN) elif code == lv.EVENT.READY: kb.add_flag(lv.obj.FLAG.HIDDEN) - ta.clear_state(ta, LV_STATE_FOCUSED); + ta.remove_state(ta, LV_STATE_FOCUSED); lv.indev_reset(None, ta) # To forget the last clicked object to make it focusable again fs_drv = lv.fs_drv_t() @@ -19,18 +19,18 @@ font_simsun_16_cjk = lv.font_load("S:../../assets/font/lv_font_simsun_16_cjk.fnt if font_simsun_16_cjk == None: print("Error when loading chinese font") -pinyin_ime = lv.ime_pinyin(lv.scr_act()) +pinyin_ime = lv.ime_pinyin(lv.screen_active()) pinyin_ime.set_style_text_font(font_simsun_16_cjk, 0) # pinyin_ime.pinyin_set_dict(your_dict) # Use a custom dictionary. If it is not set, the built-in dictionary will be used. # ta1 -ta1 = lv.textarea(lv.scr_act()) +ta1 = lv.textarea(lv.screen_active()) ta1.set_one_line(True) ta1.set_style_text_font(font_simsun_16_cjk, 0) ta1.align(lv.ALIGN.TOP_LEFT, 0, 0) # Create a keyboard and add it to ime_pinyin -kb = lv.keyboard(lv.scr_act()) +kb = lv.keyboard(lv.screen_active()) kb.set_textarea(ta1) pinyin_ime.pinyin_set_keyboard(kb) @@ -44,7 +44,7 @@ cand_panel.set_size(lv.pct(100), lv.pct(10)) cand_panel.align_to(kb, lv.ALIGN.OUT_TOP_MID, 0, 0) # Try using ime_pinyin to output the Chinese below in the ta1 above -cz_label = lv.label(lv.scr_act()) +cz_label = lv.label(lv.screen_active()) cz_label.set_text("嵌入式系统(Embedded System),\n是一种嵌入机械或电气系统内部、具有专一功能和实时计算性能的计算机系统。") cz_label.set_style_text_font(font_simsun_16_cjk, 0) cz_label.set_width(310) diff --git a/examples/others/imgfont/lv_example_imgfont_1.c b/examples/others/imgfont/lv_example_imgfont_1.c index cfa4d834c..a944acd58 100644 --- a/examples/others/imgfont/lv_example_imgfont_1.c +++ b/examples/others/imgfont/lv_example_imgfont_1.c @@ -43,7 +43,7 @@ void lv_example_imgfont_1(void) imgfont->fallback = LV_FONT_DEFAULT; - lv_obj_t * label1 = lv_label_create(lv_scr_act()); + lv_obj_t * label1 = lv_label_create(lv_screen_active()); lv_label_set_text(label1, "12\uF600\uF617AB"); lv_obj_set_style_text_font(label1, imgfont, LV_PART_MAIN); lv_obj_center(label1); @@ -52,7 +52,7 @@ void lv_example_imgfont_1(void) void lv_example_imgfont_1(void) { - 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, "imgfont is not installed"); lv_obj_center(label); } diff --git a/examples/others/observer/lv_example_observer_1.c b/examples/others/observer/lv_example_observer_1.c index 042ec43fe..6f587e690 100644 --- a/examples/others/observer/lv_example_observer_1.c +++ b/examples/others/observer/lv_example_observer_1.c @@ -11,12 +11,12 @@ void lv_example_observer_1(void) lv_subject_init_int(&temperature_subject, 28); /*Create a slider in the center of the display*/ - lv_obj_t * slider = lv_slider_create(lv_scr_act()); + lv_obj_t * slider = lv_slider_create(lv_screen_active()); lv_obj_center(slider); lv_slider_bind_value(slider, &temperature_subject); /*Create a label below the slider*/ - lv_obj_t * label = lv_label_create(lv_scr_act()); + lv_obj_t * label = lv_label_create(lv_screen_active()); lv_obj_align(label, LV_ALIGN_CENTER, 0, 30); lv_label_bind_text(label, &temperature_subject, "%d °C"); } diff --git a/examples/others/observer/lv_example_observer_2.c b/examples/others/observer/lv_example_observer_2.c index adb90f4c3..457ae1cab 100644 --- a/examples/others/observer/lv_example_observer_2.c +++ b/examples/others/observer/lv_example_observer_2.c @@ -94,7 +94,7 @@ static void ui_init(void) lv_subject_init_int(&auth_state_subject, LOGGED_OUT); /*Create a slider in the center of the display*/ - lv_obj_t * ta = lv_textarea_create(lv_scr_act()); + lv_obj_t * ta = lv_textarea_create(lv_screen_active()); lv_obj_set_pos(ta, 10, 10); lv_obj_set_width(ta, 200); lv_textarea_set_one_line(ta, true); @@ -103,14 +103,14 @@ static void ui_init(void) lv_obj_add_event(ta, textarea_event_cb, LV_EVENT_READY, NULL); lv_obj_bind_state_if_eq(ta, &auth_state_subject, LV_STATE_DISABLED, LOGGED_IN); - lv_obj_t * kb = lv_keyboard_create(lv_scr_act()); + lv_obj_t * kb = lv_keyboard_create(lv_screen_active()); lv_keyboard_set_textarea(kb, ta); lv_obj_t * btn; lv_obj_t * label; /*Create a log out button which will be active only when logged in*/ - btn = lv_button_create(lv_scr_act()); + btn = lv_button_create(lv_screen_active()); lv_obj_set_pos(btn, 220, 10); lv_obj_add_event(btn, log_out_click_event_cb, LV_EVENT_CLICKED, NULL); lv_obj_bind_state_if_not_eq(btn, &auth_state_subject, LV_STATE_DISABLED, LOGGED_IN); @@ -119,12 +119,12 @@ static void ui_init(void) lv_label_set_text(label, "LOG OUT"); /*Create a label to show info*/ - label = lv_label_create(lv_scr_act()); + label = lv_label_create(lv_screen_active()); lv_obj_set_pos(label, 10, 60); lv_subject_add_observer_obj(&auth_state_subject, info_label_observer_cb, label, NULL); /*Create button which will be active only when logged in*/ - btn = lv_button_create(lv_scr_act()); + btn = lv_button_create(lv_screen_active()); lv_obj_set_pos(btn, 10, 80); lv_obj_add_flag(btn, LV_OBJ_FLAG_CHECKABLE); lv_obj_bind_state_if_not_eq(btn, &auth_state_subject, LV_STATE_DISABLED, LOGGED_IN); diff --git a/examples/others/observer/lv_example_observer_3.c b/examples/others/observer/lv_example_observer_3.c index 08227b055..0babe8335 100644 --- a/examples/others/observer/lv_example_observer_3.c +++ b/examples/others/observer/lv_example_observer_3.c @@ -48,12 +48,12 @@ void lv_example_observer_3(void) lv_subject_init_group(&time_subject, time_group_array_subject, 4); /*Create the UI*/ - lv_obj_t * time_label = lv_label_create(lv_scr_act()); + lv_obj_t * time_label = lv_label_create(lv_screen_active()); lv_obj_set_style_text_font(time_label, &lv_font_montserrat_30, 0); lv_subject_add_observer_obj(&time_subject, time_observer_cb, time_label, NULL); lv_obj_set_pos(time_label, 24, 24); - lv_obj_t * set_btn = lv_button_create(lv_scr_act()); + lv_obj_t * set_btn = lv_button_create(lv_screen_active()); lv_obj_set_pos(set_btn, 180, 24); lv_obj_add_event(set_btn, set_btn_clicked_event_cb, LV_EVENT_CLICKED, NULL); @@ -73,7 +73,7 @@ static void set_btn_clicked_event_cb(lv_event_t * e) lv_obj_t * set_btn = lv_event_get_target(e); lv_obj_add_state(set_btn, LV_STATE_DISABLED); - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont, lv_pct(100), LV_SIZE_CONTENT); lv_obj_align(cont, LV_ALIGN_BOTTOM_MID, 0, 0); @@ -115,8 +115,8 @@ static void close_clicked_event_cb(lv_event_t * e) lv_obj_t * set_btn = lv_event_get_user_data(e); lv_obj_t * close_btn = lv_event_get_target(e); lv_obj_t * cont = lv_obj_get_parent(close_btn); - lv_obj_clear_state(set_btn, LV_STATE_DISABLED); - lv_obj_del(cont); + lv_obj_remove_state(set_btn, LV_STATE_DISABLED); + lv_obj_delete(cont); } /*Watch all related subject to display the current time correctly*/ diff --git a/examples/others/observer/lv_example_observer_4.c b/examples/others/observer/lv_example_observer_4.c index 68abffa97..97fbad9f0 100644 --- a/examples/others/observer/lv_example_observer_4.c +++ b/examples/others/observer/lv_example_observer_4.c @@ -25,7 +25,7 @@ void lv_example_observer_4(void) lv_subject_init_int(&roller_subject[0], 0); lv_subject_init_int(&roller_subject[1], 0); - lv_obj_t * main_cont = lv_obj_create(lv_scr_act()); + lv_obj_t * main_cont = lv_obj_create(lv_screen_active()); lv_obj_remove_style_all(main_cont); lv_obj_set_size(main_cont, lv_pct(100), lv_pct(100)); lv_obj_set_style_pad_all(main_cont, 0, 0); @@ -87,7 +87,7 @@ static void cont_observer_cb(lv_subject_t * subject, lv_observer_t * observer) lv_anim_set_path_cb(&a, lv_anim_path_ease_in_out); lv_anim_set_exec_cb(&a, anim_set_x_cb); lv_anim_set_get_value_cb(&a, anim_get_x_cb); - lv_anim_set_ready_cb(&a, lv_obj_del_anim_ready_cb); + lv_anim_set_ready_cb(&a, lv_obj_delete_anim_ready_cb); uint32_t i; uint32_t delay = 0; @@ -179,7 +179,7 @@ static void btn_observer_cb(lv_subject_t * subject, lv_observer_t * observer) lv_obj_t * btn = lv_observer_get_target(observer); int32_t idx = (int32_t)lv_obj_get_index(btn); - if(idx == prev_v) lv_obj_clear_state(btn, LV_STATE_CHECKED); + if(idx == prev_v) lv_obj_remove_state(btn, LV_STATE_CHECKED); if(idx == cur_v) lv_obj_add_state(btn, LV_STATE_CHECKED); } diff --git a/examples/others/observer/lv_example_observer_5.c b/examples/others/observer/lv_example_observer_5.c index e8a2fddb7..0bc370c6c 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_scr_act()); + lv_obj_t * btn = lv_btn_create(lv_screen_active()); lv_obj_add_event(btn, fw_update_btn_clicked_event_cb, LV_EVENT_CLICKED, NULL); lv_obj_center(btn); lv_obj_t * label = lv_label_create(btn); @@ -43,7 +43,7 @@ void lv_example_observer_5(void) static void fw_update_btn_clicked_event_cb(lv_event_t * e) { LV_UNUSED(e); - lv_obj_t * win = lv_win_create(lv_scr_act()); + lv_obj_t * win = lv_win_create(lv_screen_active()); lv_obj_set_size(win, lv_pct(90), lv_pct(90)); lv_obj_set_height(lv_win_get_header(win), 40); lv_obj_set_style_radius(win, 8, 0); @@ -69,7 +69,7 @@ static void fw_update_close_event_cb(lv_event_t * e) static void restart_btn_click_event_cb(lv_event_t * e) { lv_obj_t * win = lv_event_get_user_data(e); - lv_obj_del(win); + lv_obj_delete(win); lv_subject_set_int(&fw_update_status_subject, FW_UPDATE_STATE_IDLE); } @@ -96,7 +96,7 @@ static void fw_update_win_observer_cb(lv_subject_t * subject, lv_observer_t * ob lv_arc_bind_value(arc, &fw_download_percent_subject); lv_obj_center(arc); lv_obj_set_size(arc, 130, 130); - lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(arc, LV_OBJ_FLAG_CLICKABLE); lv_obj_t * label = lv_label_create(cont); lv_label_bind_text(label, &fw_download_percent_subject, "%d %%"); @@ -116,7 +116,7 @@ static void fw_update_win_observer_cb(lv_subject_t * subject, lv_observer_t * ob lv_label_set_text(label, "Restart"); } else if(status == FW_UPDATE_STATE_CANCEL) { - lv_obj_del(win); + lv_obj_delete(win); } } @@ -125,13 +125,13 @@ static void connect_timer_cb(lv_timer_t * t) if(lv_subject_get_int(&fw_update_status_subject) != FW_UPDATE_STATE_CANCEL) { lv_subject_set_int(&fw_update_status_subject, FW_UPDATE_STATE_CONNECTED); } - lv_timer_del(t); + lv_timer_delete(t); } static void download_timer_cb(lv_timer_t * t) { if(lv_subject_get_int(&fw_update_status_subject) == FW_UPDATE_STATE_CANCEL) { - lv_timer_del(t); + lv_timer_delete(t); return; } @@ -141,7 +141,7 @@ static void download_timer_cb(lv_timer_t * t) } else { lv_subject_set_int(&fw_update_status_subject, FW_UPDATE_STATE_READY); - lv_timer_del(t); + lv_timer_delete(t); } } diff --git a/examples/others/observer/lv_example_observer_6.c b/examples/others/observer/lv_example_observer_6.c index b71e6e788..4f9bee2e2 100644 --- a/examples/others/observer/lv_example_observer_6.c +++ b/examples/others/observer/lv_example_observer_6.c @@ -20,7 +20,7 @@ void lv_example_observer_6(void) { lv_subject_init_int(&theme_subject, THEME_MODE_DARK); - lv_obj_t * panel1 = my_panel_create(lv_scr_act()); + lv_obj_t * panel1 = my_panel_create(lv_screen_active()); lv_obj_set_flex_flow(panel1, LV_FLEX_FLOW_COLUMN); lv_obj_set_flex_align(panel1, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); lv_obj_set_size(panel1, lv_pct(90), lv_pct(90)); diff --git a/examples/others/snapshot/lv_example_snapshot_1.c b/examples/others/snapshot/lv_example_snapshot_1.c index d5843f9d4..a90415edb 100644 --- a/examples/others/snapshot/lv_example_snapshot_1.c +++ b/examples/others/snapshot/lv_example_snapshot_1.c @@ -23,7 +23,7 @@ static void event_cb(lv_event_t * e) void lv_example_snapshot_1(void) { LV_IMAGE_DECLARE(img_star); - lv_obj_t * root = lv_scr_act(); + lv_obj_t * root = lv_screen_active(); lv_obj_set_style_bg_color(root, lv_palette_main(LV_PALETTE_LIGHT_BLUE), 0); /*Create an image object to show snapshot*/ diff --git a/examples/others/snapshot/lv_example_snapshot_1.py b/examples/others/snapshot/lv_example_snapshot_1.py index 23d55f2f9..a6de5c5a9 100644 --- a/examples/others/snapshot/lv_example_snapshot_1.py +++ b/examples/others/snapshot/lv_example_snapshot_1.py @@ -6,7 +6,7 @@ gc.enable() gc.collect() mem_free = gc.mem_free() -label = lv.label(lv.scr_act()) +label = lv.label(lv.screen_active()) label.align(lv.ALIGN.BOTTOM_MID, 0, -10) label.set_text(" memory free:" + str(mem_free/1024) + " kB") @@ -37,7 +37,7 @@ def event_cb(e, snapshot_obj): mem_used = mem_free - gc.mem_free() label.set_text("memory used:" + str(mem_used/1024) + " kB") -root = lv.scr_act() +root = lv.screen_active() root.set_style_bg_color(lv.palette_main(lv.PALETTE.LIGHT_BLUE), 0) # Create an image object to show snapshot diff --git a/examples/porting/lv_port_indev_template.c b/examples/porting/lv_port_indev_template.c index 04f488be4..1bfd11a9c 100644 --- a/examples/porting/lv_port_indev_template.c +++ b/examples/porting/lv_port_indev_template.c @@ -106,7 +106,7 @@ void lv_port_indev_init(void) lv_indev_set_read_cb(indev_mouse, mouse_read); /*Set cursor. For simplicity set a HOME symbol now.*/ - lv_obj_t * mouse_cursor = lv_image_create(lv_scr_act()); + lv_obj_t * mouse_cursor = lv_image_create(lv_screen_active()); lv_image_set_src(mouse_cursor, LV_SYMBOL_HOME); lv_indev_set_cursor(indev_mouse, mouse_cursor); diff --git a/examples/scroll/lv_example_scroll_1.c b/examples/scroll/lv_example_scroll_1.c index 8ce8c3862..18941305a 100644 --- a/examples/scroll/lv_example_scroll_1.c +++ b/examples/scroll/lv_example_scroll_1.c @@ -7,7 +7,7 @@ void lv_example_scroll_1(void) { /*Create an object with the new style*/ - lv_obj_t * panel = lv_obj_create(lv_scr_act()); + lv_obj_t * panel = lv_obj_create(lv_screen_active()); lv_obj_set_size(panel, 200, 200); lv_obj_center(panel); diff --git a/examples/scroll/lv_example_scroll_1.py b/examples/scroll/lv_example_scroll_1.py index 1449cd694..2221a64d4 100644 --- a/examples/scroll/lv_example_scroll_1.py +++ b/examples/scroll/lv_example_scroll_1.py @@ -2,7 +2,7 @@ # Demonstrate how scrolling appears automatically # # Create an object with the new style -panel = lv.obj(lv.scr_act()) +panel = lv.obj(lv.screen_active()) panel.set_size(200, 200) panel.center() diff --git a/examples/scroll/lv_example_scroll_2.c b/examples/scroll/lv_example_scroll_2.c index 2081a22f0..6448ce65a 100644 --- a/examples/scroll/lv_example_scroll_2.c +++ b/examples/scroll/lv_example_scroll_2.c @@ -10,7 +10,7 @@ static void sw_event_cb(lv_event_t * e) lv_obj_t * list = lv_event_get_user_data(e); if(lv_obj_has_state(sw, LV_STATE_CHECKED)) lv_obj_add_flag(list, LV_OBJ_FLAG_SCROLL_ONE); - else lv_obj_clear_flag(list, LV_OBJ_FLAG_SCROLL_ONE); + else lv_obj_remove_flag(list, LV_OBJ_FLAG_SCROLL_ONE); } } @@ -19,7 +19,7 @@ static void sw_event_cb(lv_event_t * e) */ void lv_example_scroll_2(void) { - lv_obj_t * panel = lv_obj_create(lv_scr_act()); + lv_obj_t * panel = lv_obj_create(lv_screen_active()); lv_obj_set_size(panel, 280, 120); lv_obj_set_scroll_snap_x(panel, LV_SCROLL_SNAP_CENTER); lv_obj_set_flex_flow(panel, LV_FLEX_FLOW_ROW); @@ -33,7 +33,7 @@ void lv_example_scroll_2(void) lv_obj_t * label = lv_label_create(btn); if(i == 3) { lv_label_set_text_fmt(label, "Panel %"LV_PRIu32"\nno snap", i); - lv_obj_clear_flag(btn, LV_OBJ_FLAG_SNAPPABLE); + lv_obj_remove_flag(btn, LV_OBJ_FLAG_SNAPPABLE); } else { lv_label_set_text_fmt(label, "Panel %"LV_PRIu32, i); @@ -45,10 +45,10 @@ void lv_example_scroll_2(void) #if LV_USE_SWITCH /*Switch between "One scroll" and "Normal scroll" mode*/ - lv_obj_t * sw = lv_switch_create(lv_scr_act()); + lv_obj_t * sw = lv_switch_create(lv_screen_active()); lv_obj_align(sw, LV_ALIGN_TOP_RIGHT, -20, 10); lv_obj_add_event(sw, sw_event_cb, LV_EVENT_ALL, panel); - 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, "One scroll"); lv_obj_align_to(label, sw, LV_ALIGN_OUT_BOTTOM_MID, 0, 5); #endif diff --git a/examples/scroll/lv_example_scroll_2.py b/examples/scroll/lv_example_scroll_2.py index 8235165aa..97ffe0beb 100644 --- a/examples/scroll/lv_example_scroll_2.py +++ b/examples/scroll/lv_example_scroll_2.py @@ -8,14 +8,14 @@ def sw_event_cb(e,panel): if sw.has_state(lv.STATE.CHECKED): panel.add_flag(lv.obj.FLAG.SCROLL_ONE) else: - panel.clear_flag(lv.obj.FLAG.SCROLL_ONE) + panel.remove_flag(lv.obj.FLAG.SCROLL_ONE) # # Show an example to scroll snap # -panel = lv.obj(lv.scr_act()) +panel = lv.obj(lv.screen_active()) panel.set_size(280, 150) panel.set_scroll_snap_x(lv.SCROLL_SNAP.CENTER) panel.set_flex_flow(lv.FLEX_FLOW.ROW) @@ -28,7 +28,7 @@ for i in range(10): label = lv.label(button) if i == 3: label.set_text("Panel {:d}\nno snap".format(i)) - button.clear_flag(lv.obj.FLAG.SNAPPABLE) + button.remove_flag(lv.obj.FLAG.SNAPPABLE) else: label.set_text("Panel {:d}".format(i)) label.center() @@ -37,10 +37,10 @@ panel.update_snap(lv.ANIM.ON) # Switch between "One scroll" and "Normal scroll" mode -sw = lv.switch(lv.scr_act()) +sw = lv.switch(lv.screen_active()) sw.align(lv.ALIGN.TOP_RIGHT, -20, 10) sw.add_event(lambda evt: sw_event_cb(evt,panel), lv.EVENT.ALL, None) -label = lv.label(lv.scr_act()) +label = lv.label(lv.screen_active()) label.set_text("One scroll") label.align_to(sw, lv.ALIGN.OUT_BOTTOM_MID, 0, 5) diff --git a/examples/scroll/lv_example_scroll_3.c b/examples/scroll/lv_example_scroll_3.c index 51308c8a1..520d384a6 100644 --- a/examples/scroll/lv_example_scroll_3.c +++ b/examples/scroll/lv_example_scroll_3.c @@ -26,7 +26,7 @@ static void float_button_event_cb(lv_event_t * e) */ void lv_example_scroll_3(void) { - lv_obj_t * list = lv_list_create(lv_scr_act()); + lv_obj_t * list = lv_list_create(lv_screen_active()); lv_obj_set_size(list, 280, 220); lv_obj_center(list); diff --git a/examples/scroll/lv_example_scroll_3.py b/examples/scroll/lv_example_scroll_3.py index 0bff286cf..4e9281a15 100644 --- a/examples/scroll/lv_example_scroll_3.py +++ b/examples/scroll/lv_example_scroll_3.py @@ -5,7 +5,7 @@ class ScrollExample_3(): # Create a list with a floating button # - list = lv.list(lv.scr_act()) + list = lv.list(lv.screen_active()) list.set_size(280, 220) list.center() diff --git a/examples/scroll/lv_example_scroll_4.c b/examples/scroll/lv_example_scroll_4.c index 5bbff5c2f..c8944c2f2 100644 --- a/examples/scroll/lv_example_scroll_4.c +++ b/examples/scroll/lv_example_scroll_4.c @@ -7,7 +7,7 @@ */ void lv_example_scroll_4(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, 200, 100); lv_obj_center(obj); diff --git a/examples/scroll/lv_example_scroll_4.py b/examples/scroll/lv_example_scroll_4.py index 9556f60fa..82d543a28 100644 --- a/examples/scroll/lv_example_scroll_4.py +++ b/examples/scroll/lv_example_scroll_4.py @@ -1,7 +1,7 @@ # # Styling the scrollbars # -obj = lv.obj(lv.scr_act()) +obj = lv.obj(lv.screen_active()) obj.set_size(200, 100) obj.center() diff --git a/examples/scroll/lv_example_scroll_5.c b/examples/scroll/lv_example_scroll_5.c index 60e65ffa2..5e2fa2810 100644 --- a/examples/scroll/lv_example_scroll_5.c +++ b/examples/scroll/lv_example_scroll_5.c @@ -7,7 +7,7 @@ */ void lv_example_scroll_5(void) { - lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_t * obj = lv_obj_create(lv_screen_active()); lv_obj_set_style_base_dir(obj, LV_BASE_DIR_RTL, 0); lv_obj_set_size(obj, 200, 100); lv_obj_center(obj); diff --git a/examples/scroll/lv_example_scroll_5.py b/examples/scroll/lv_example_scroll_5.py index 064d4816b..c8d222382 100644 --- a/examples/scroll/lv_example_scroll_5.py +++ b/examples/scroll/lv_example_scroll_5.py @@ -1,7 +1,7 @@ # # Scrolling with Right To Left base direction # -obj = lv.obj(lv.scr_act()) +obj = lv.obj(lv.screen_active()) obj.set_style_base_dir(lv.BASE_DIR.RTL, 0) obj.set_size(200, 100) obj.center() diff --git a/examples/scroll/lv_example_scroll_6.c b/examples/scroll/lv_example_scroll_6.c index 9b6538149..6d5bc2b4e 100644 --- a/examples/scroll/lv_example_scroll_6.c +++ b/examples/scroll/lv_example_scroll_6.c @@ -50,7 +50,7 @@ static void scroll_event_cb(lv_event_t * e) */ void lv_example_scroll_6(void) { - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont, 200, 200); lv_obj_center(cont); lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_COLUMN); diff --git a/examples/scroll/lv_example_scroll_6.py b/examples/scroll/lv_example_scroll_6.py index 0b423958f..7ed481081 100644 --- a/examples/scroll/lv_example_scroll_6.py +++ b/examples/scroll/lv_example_scroll_6.py @@ -42,7 +42,7 @@ def scroll_event_cb(e): # Translate the object as they scroll # -cont = lv.obj(lv.scr_act()) +cont = lv.obj(lv.screen_active()) cont.set_size(200, 200) cont.center() cont.set_flex_flow(lv.FLEX_FLOW.COLUMN) diff --git a/examples/styles/lv_example_style_1.c b/examples/styles/lv_example_style_1.c index 948c5d294..24b92877c 100644 --- a/examples/styles/lv_example_style_1.c +++ b/examples/styles/lv_example_style_1.c @@ -21,7 +21,7 @@ void lv_example_style_1(void) lv_style_set_y(&style, 80); /*Create an object with the new style*/ - lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_t * obj = lv_obj_create(lv_screen_active()); lv_obj_add_style(obj, &style, 0); lv_obj_t * label = lv_label_create(obj); diff --git a/examples/styles/lv_example_style_1.py b/examples/styles/lv_example_style_1.py index a6228d902..eb5bd6bde 100644 --- a/examples/styles/lv_example_style_1.py +++ b/examples/styles/lv_example_style_1.py @@ -16,7 +16,7 @@ style.set_x(lv.pct(50)) style.set_y(80) # Create an object with the new style -obj = lv.obj(lv.scr_act()) +obj = lv.obj(lv.screen_active()) obj.add_style(style, 0) label = lv.label(obj) diff --git a/examples/styles/lv_example_style_10.c b/examples/styles/lv_example_style_10.c index f005af6f0..713eddb85 100644 --- a/examples/styles/lv_example_style_10.c +++ b/examples/styles/lv_example_style_10.c @@ -30,7 +30,7 @@ void lv_example_style_10(void) lv_style_set_transition(&style_pr, &trans_pr); /*Create an object with the new style_pr*/ - lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_t * obj = lv_obj_create(lv_screen_active()); lv_obj_add_style(obj, &style_def, 0); lv_obj_add_style(obj, &style_pr, LV_STATE_PRESSED); diff --git a/examples/styles/lv_example_style_10.py b/examples/styles/lv_example_style_10.py index b71afe872..6c316be2d 100644 --- a/examples/styles/lv_example_style_10.py +++ b/examples/styles/lv_example_style_10.py @@ -28,7 +28,7 @@ style_pr.set_border_color(lv.palette_darken(lv.PALETTE.RED, 3)) style_pr.set_transition(trans_pr) # Create an object with the new style_pr -obj = lv.obj(lv.scr_act()) +obj = lv.obj(lv.screen_active()) obj.add_style(style_def, 0) obj.add_style(style_pr, lv.STATE.PRESSED) diff --git a/examples/styles/lv_example_style_11.c b/examples/styles/lv_example_style_11.c index 2693df850..efe66520c 100644 --- a/examples/styles/lv_example_style_11.c +++ b/examples/styles/lv_example_style_11.c @@ -28,7 +28,7 @@ void lv_example_style_11(void) lv_style_set_text_color(&style_warning, lv_palette_darken(LV_PALETTE_YELLOW, 4)); /*Create an object with the base style only*/ - lv_obj_t * obj_base = lv_obj_create(lv_scr_act()); + lv_obj_t * obj_base = lv_obj_create(lv_screen_active()); lv_obj_add_style(obj_base, &style_base, 0); lv_obj_align(obj_base, LV_ALIGN_LEFT_MID, 20, 0); @@ -37,7 +37,7 @@ void lv_example_style_11(void) lv_obj_center(label); /*Create another object with the base style and earnings style too*/ - lv_obj_t * obj_warning = lv_obj_create(lv_scr_act()); + lv_obj_t * obj_warning = lv_obj_create(lv_screen_active()); lv_obj_add_style(obj_warning, &style_base, 0); lv_obj_add_style(obj_warning, &style_warning, 0); lv_obj_align(obj_warning, LV_ALIGN_RIGHT_MID, -20, 0); diff --git a/examples/styles/lv_example_style_11.py b/examples/styles/lv_example_style_11.py index d9a856c6c..dbdb428ba 100644 --- a/examples/styles/lv_example_style_11.py +++ b/examples/styles/lv_example_style_11.py @@ -24,7 +24,7 @@ style_warning.set_border_color(lv.palette_darken(lv.PALETTE.YELLOW, 3)) style_warning.set_text_color(lv.palette_darken(lv.PALETTE.YELLOW, 4)) # Create an object with the base style only -obj_base = lv.obj(lv.scr_act()) +obj_base = lv.obj(lv.screen_active()) obj_base.add_style(style_base, 0) obj_base.align(lv.ALIGN.LEFT_MID, 20, 0) @@ -33,7 +33,7 @@ label.set_text("Base") label.center() # Create another object with the base style and earnings style too -obj_warning = lv.obj(lv.scr_act()) +obj_warning = lv.obj(lv.screen_active()) obj_warning.add_style(style_base, 0) obj_warning.add_style(style_warning, 0) obj_warning.align(lv.ALIGN.RIGHT_MID, -20, 0) diff --git a/examples/styles/lv_example_style_12.c b/examples/styles/lv_example_style_12.c index 5eb25e866..dc69954b0 100644 --- a/examples/styles/lv_example_style_12.c +++ b/examples/styles/lv_example_style_12.c @@ -12,7 +12,7 @@ void lv_example_style_12(void) lv_style_set_border_color(&style, lv_palette_lighten(LV_PALETTE_GREEN, 3)); lv_style_set_border_width(&style, 3); - lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_t * obj = lv_obj_create(lv_screen_active()); lv_obj_add_style(obj, &style, 0); /*Overwrite the background color locally*/ diff --git a/examples/styles/lv_example_style_12.py b/examples/styles/lv_example_style_12.py index 2557c441a..ccac359d3 100644 --- a/examples/styles/lv_example_style_12.py +++ b/examples/styles/lv_example_style_12.py @@ -8,7 +8,7 @@ style.set_bg_color(lv.palette_main(lv.PALETTE.GREEN)) style.set_border_color(lv.palette_lighten(lv.PALETTE.GREEN, 3)) style.set_border_width(3) -obj = lv.obj(lv.scr_act()) +obj = lv.obj(lv.screen_active()) obj.add_style(style, 0) # Overwrite the background color locally diff --git a/examples/styles/lv_example_style_13.c b/examples/styles/lv_example_style_13.c index ca5ca8573..6a610402a 100644 --- a/examples/styles/lv_example_style_13.c +++ b/examples/styles/lv_example_style_13.c @@ -19,7 +19,7 @@ void lv_example_style_13(void) lv_style_set_shadow_spread(&style_indic_pr, 3); /*Create an object with the new style_pr*/ - lv_obj_t * obj = lv_slider_create(lv_scr_act()); + lv_obj_t * obj = lv_slider_create(lv_screen_active()); lv_obj_add_style(obj, &style_indic, LV_PART_INDICATOR); lv_obj_add_style(obj, &style_indic_pr, LV_PART_INDICATOR | LV_STATE_PRESSED); lv_slider_set_value(obj, 70, LV_ANIM_OFF); diff --git a/examples/styles/lv_example_style_13.py b/examples/styles/lv_example_style_13.py index 7d505cac4..a2c49a7e3 100644 --- a/examples/styles/lv_example_style_13.py +++ b/examples/styles/lv_example_style_13.py @@ -15,7 +15,7 @@ style_indic_pr.set_shadow_width(10) style_indic_pr.set_shadow_spread(3) # Create an object with the new style_pr -obj = lv.slider(lv.scr_act()) +obj = lv.slider(lv.screen_active()) obj.add_style(style_indic, lv.PART.INDICATOR) obj.add_style(style_indic_pr, lv.PART.INDICATOR | lv.STATE.PRESSED) obj.set_value(70, lv.ANIM.OFF) diff --git a/examples/styles/lv_example_style_14.c b/examples/styles/lv_example_style_14.c index d26627c16..e47f5dca7 100644 --- a/examples/styles/lv_example_style_14.c +++ b/examples/styles/lv_example_style_14.c @@ -46,7 +46,7 @@ void lv_example_style_14(void) lv_obj_t * btn; lv_obj_t * label; - btn = lv_button_create(lv_scr_act()); + btn = lv_button_create(lv_screen_active()); lv_obj_align(btn, LV_ALIGN_TOP_MID, 0, 20); label = lv_label_create(btn); @@ -54,7 +54,7 @@ void lv_example_style_14(void) new_theme_init_and_set(); - btn = lv_button_create(lv_scr_act()); + btn = lv_button_create(lv_screen_active()); lv_obj_align(btn, LV_ALIGN_BOTTOM_MID, 0, -20); label = lv_label_create(btn); diff --git a/examples/styles/lv_example_style_14.py b/examples/styles/lv_example_style_14.py index 93a2222b1..dfd89cc28 100644 --- a/examples/styles/lv_example_style_14.py +++ b/examples/styles/lv_example_style_14.py @@ -13,7 +13,7 @@ class NewTheme(lv.theme_t): self.style_button.set_border_width(3) # This theme is based on active theme - th_act = lv.theme_get_from_obj(lv.scr_act()) + th_act = lv.theme_get_from_obj(lv.screen_active()) # This theme will be applied only after base theme is applied self.set_parent(th_act) @@ -25,7 +25,7 @@ class ExampleStyle_14: # Extending the current theme # - button = lv.button(lv.scr_act()) + button = lv.button(lv.screen_active()) button.align(lv.ALIGN.TOP_MID, 0, 20) label = lv.label(button) @@ -33,7 +33,7 @@ class ExampleStyle_14: self.new_theme_init_and_set() - button = lv.button(lv.scr_act()) + button = lv.button(lv.screen_active()) button.align(lv.ALIGN.BOTTOM_MID, 0, -20) label = lv.label(button) diff --git a/examples/styles/lv_example_style_15.c b/examples/styles/lv_example_style_15.c index f2ba8638d..4a3914bc8 100644 --- a/examples/styles/lv_example_style_15.c +++ b/examples/styles/lv_example_style_15.c @@ -12,7 +12,7 @@ void lv_example_style_15(void) lv_obj_t * label; /*Normal button*/ - btn = lv_button_create(lv_scr_act()); + btn = lv_button_create(lv_screen_active()); lv_obj_set_size(btn, 100, 40); lv_obj_align(btn, LV_ALIGN_CENTER, 0, -70); @@ -22,7 +22,7 @@ void lv_example_style_15(void) /*Set opacity *The button and the label is rendered to a layer first and that layer is blended*/ - btn = lv_button_create(lv_scr_act()); + btn = lv_button_create(lv_screen_active()); lv_obj_set_size(btn, 100, 40); lv_obj_set_style_opa(btn, LV_OPA_50, 0); lv_obj_align(btn, LV_ALIGN_CENTER, 0, 0); @@ -33,7 +33,7 @@ void lv_example_style_15(void) /*Set transformations *The button and the label is rendered to a layer first and that layer is transformed*/ - btn = lv_button_create(lv_scr_act()); + btn = lv_button_create(lv_screen_active()); lv_obj_set_size(btn, 100, 40); lv_obj_set_style_transform_rotation(btn, 150, 0); /*15 deg*/ lv_obj_set_style_transform_scale(btn, 256 + 64, 0); /*1.25x*/ diff --git a/examples/styles/lv_example_style_15.py b/examples/styles/lv_example_style_15.py index 59787e508..43db807b4 100644 --- a/examples/styles/lv_example_style_15.py +++ b/examples/styles/lv_example_style_15.py @@ -3,7 +3,7 @@ # # Normal button -button = lv.button(lv.scr_act()) +button = lv.button(lv.screen_active()) button.set_size(100, 40) button.align(lv.ALIGN.CENTER, 0, -70) @@ -13,7 +13,7 @@ label.center() # Set opacity # The button and the label is rendered to a layer first and that layer is blended -button = lv.button(lv.scr_act()) +button = lv.button(lv.screen_active()) button.set_size(100, 40) button.set_style_opa(lv.OPA._50, 0) button.align(lv.ALIGN.CENTER, 0, 0) @@ -24,7 +24,7 @@ label.center() # Set transformations # The button and the label is rendered to a layer first and that layer is transformed -button = lv.button(lv.scr_act()) +button = lv.button(lv.screen_active()) button.set_size(100, 40) button.set_style_transform_rotation(150, 0) # 15 deg button.set_style_transform_scale(256 + 64, 0) # 1.25x diff --git a/examples/styles/lv_example_style_2.c b/examples/styles/lv_example_style_2.c index 125fcb50c..540d681b8 100644 --- a/examples/styles/lv_example_style_2.c +++ b/examples/styles/lv_example_style_2.c @@ -25,7 +25,7 @@ void lv_example_style_2(void) lv_style_set_bg_grad(&style, &grad); /*Create an object with the new style*/ - lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_t * obj = lv_obj_create(lv_screen_active()); lv_obj_add_style(obj, &style, 0); lv_obj_center(obj); } diff --git a/examples/styles/lv_example_style_2.py b/examples/styles/lv_example_style_2.py index a7d215781..5acfc1be4 100644 --- a/examples/styles/lv_example_style_2.py +++ b/examples/styles/lv_example_style_2.py @@ -16,6 +16,6 @@ style.set_bg_main_stop(128) style.set_bg_grad_stop(192) # Create an object with the new style -obj = lv.obj(lv.scr_act()) +obj = lv.obj(lv.screen_active()) obj.add_style(style, 0) obj.center() diff --git a/examples/styles/lv_example_style_3.c b/examples/styles/lv_example_style_3.c index a05bc3c3d..0a1dea82d 100644 --- a/examples/styles/lv_example_style_3.c +++ b/examples/styles/lv_example_style_3.c @@ -21,7 +21,7 @@ void lv_example_style_3(void) lv_style_set_border_side(&style, LV_BORDER_SIDE_BOTTOM | LV_BORDER_SIDE_RIGHT); /*Create an object with the new style*/ - lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_t * obj = lv_obj_create(lv_screen_active()); lv_obj_add_style(obj, &style, 0); lv_obj_center(obj); } diff --git a/examples/styles/lv_example_style_3.py b/examples/styles/lv_example_style_3.py index c9100f4f7..8c3a11910 100644 --- a/examples/styles/lv_example_style_3.py +++ b/examples/styles/lv_example_style_3.py @@ -16,6 +16,6 @@ style.set_border_opa(lv.OPA._50) style.set_border_side(lv.BORDER_SIDE.BOTTOM | lv.BORDER_SIDE.RIGHT) # Create an object with the new style -obj = lv.obj(lv.scr_act()) +obj = lv.obj(lv.screen_active()) obj.add_style(style, 0) obj.center() diff --git a/examples/styles/lv_example_style_4.c b/examples/styles/lv_example_style_4.c index 5f5b8d369..3276a85ca 100644 --- a/examples/styles/lv_example_style_4.c +++ b/examples/styles/lv_example_style_4.c @@ -20,7 +20,7 @@ void lv_example_style_4(void) lv_style_set_outline_pad(&style, 8); /*Create an object with the new style*/ - lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_t * obj = lv_obj_create(lv_screen_active()); lv_obj_add_style(obj, &style, 0); lv_obj_center(obj); } diff --git a/examples/styles/lv_example_style_4.py b/examples/styles/lv_example_style_4.py index 246c6a6c8..961a4ae32 100644 --- a/examples/styles/lv_example_style_4.py +++ b/examples/styles/lv_example_style_4.py @@ -16,6 +16,6 @@ style.set_outline_color(lv.palette_main(lv.PALETTE.BLUE)) style.set_outline_pad(8) # Create an object with the new style -obj = lv.obj(lv.scr_act()) +obj = lv.obj(lv.screen_active()) obj.add_style(style, 0) obj.center() diff --git a/examples/styles/lv_example_style_5.c b/examples/styles/lv_example_style_5.c index 0f80f4ae2..c25a94154 100644 --- a/examples/styles/lv_example_style_5.c +++ b/examples/styles/lv_example_style_5.c @@ -19,7 +19,7 @@ void lv_example_style_5(void) lv_style_set_shadow_color(&style, lv_palette_main(LV_PALETTE_BLUE)); /*Create an object with the new style*/ - lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_t * obj = lv_obj_create(lv_screen_active()); lv_obj_add_style(obj, &style, 0); lv_obj_center(obj); } diff --git a/examples/styles/lv_example_style_5.py b/examples/styles/lv_example_style_5.py index 905f29f5d..188fde0f1 100644 --- a/examples/styles/lv_example_style_5.py +++ b/examples/styles/lv_example_style_5.py @@ -17,6 +17,6 @@ style.set_shadow_ofs_x(10) style.set_shadow_ofs_y(20) # Create an object with the new style -obj = lv.obj(lv.scr_act()) +obj = lv.obj(lv.screen_active()) obj.add_style(style, 0) obj.center() diff --git a/examples/styles/lv_example_style_6.c b/examples/styles/lv_example_style_6.c index 26f6fa65f..afa750ad0 100644 --- a/examples/styles/lv_example_style_6.c +++ b/examples/styles/lv_example_style_6.c @@ -21,7 +21,7 @@ void lv_example_style_6(void) lv_style_set_transform_rotation(&style, 300); /*Create an object with the new style*/ - lv_obj_t * obj = lv_image_create(lv_scr_act()); + lv_obj_t * obj = lv_image_create(lv_screen_active()); lv_obj_add_style(obj, &style, 0); LV_IMAGE_DECLARE(img_cogwheel_argb); diff --git a/examples/styles/lv_example_style_6.py b/examples/styles/lv_example_style_6.py index 8b30e6f01..3f0d94876 100644 --- a/examples/styles/lv_example_style_6.py +++ b/examples/styles/lv_example_style_6.py @@ -29,7 +29,7 @@ style.set_image_recolor_opa(lv.OPA._50) style.set_transform_rotation(300) # Create an object with the new style -obj = lv.image(lv.scr_act()) +obj = lv.image(lv.screen_active()) obj.add_style(style, 0) obj.set_src(image_cogwheel_argb) diff --git a/examples/styles/lv_example_style_7.c b/examples/styles/lv_example_style_7.c index dfd77ea67..ff342c7a9 100644 --- a/examples/styles/lv_example_style_7.c +++ b/examples/styles/lv_example_style_7.c @@ -13,7 +13,7 @@ void lv_example_style_7(void) lv_style_set_arc_width(&style, 4); /*Create an object with the new style*/ - lv_obj_t * obj = lv_arc_create(lv_scr_act()); + lv_obj_t * obj = lv_arc_create(lv_screen_active()); lv_obj_add_style(obj, &style, 0); lv_obj_center(obj); } diff --git a/examples/styles/lv_example_style_7.py b/examples/styles/lv_example_style_7.py index cc49fb56d..b4d63b172 100644 --- a/examples/styles/lv_example_style_7.py +++ b/examples/styles/lv_example_style_7.py @@ -8,6 +8,6 @@ style.set_arc_color(lv.palette_main(lv.PALETTE.RED)) style.set_arc_width(4) # Create an object with the new style -obj = lv.arc(lv.scr_act()) +obj = lv.arc(lv.screen_active()) obj.add_style(style, 0) obj.center() diff --git a/examples/styles/lv_example_style_8.c b/examples/styles/lv_example_style_8.c index d816b02d7..853daf406 100644 --- a/examples/styles/lv_example_style_8.c +++ b/examples/styles/lv_example_style_8.c @@ -22,7 +22,7 @@ void lv_example_style_8(void) lv_style_set_text_decor(&style, LV_TEXT_DECOR_UNDERLINE); /*Create an object with the new style*/ - lv_obj_t * obj = lv_label_create(lv_scr_act()); + lv_obj_t * obj = lv_label_create(lv_screen_active()); lv_obj_add_style(obj, &style, 0); lv_label_set_text(obj, "Text of\n" "a label"); diff --git a/examples/styles/lv_example_style_8.py b/examples/styles/lv_example_style_8.py index 27128989a..080615453 100644 --- a/examples/styles/lv_example_style_8.py +++ b/examples/styles/lv_example_style_8.py @@ -18,7 +18,7 @@ style.set_text_line_space(20) style.set_text_decor(lv.TEXT_DECOR.UNDERLINE) # Create an object with the new style -obj = lv.label(lv.scr_act()) +obj = lv.label(lv.screen_active()) obj.add_style(style, 0) obj.set_text("Text of\n" "a label") diff --git a/examples/styles/lv_example_style_9.c b/examples/styles/lv_example_style_9.c index 00141b4b6..907c5a2e8 100644 --- a/examples/styles/lv_example_style_9.c +++ b/examples/styles/lv_example_style_9.c @@ -14,7 +14,7 @@ void lv_example_style_9(void) lv_style_set_line_rounded(&style, true); /*Create an object with the new style*/ - lv_obj_t * obj = lv_line_create(lv_scr_act()); + lv_obj_t * obj = lv_line_create(lv_screen_active()); lv_obj_add_style(obj, &style, 0); static lv_point_t p[] = {{10, 30}, {30, 50}, {100, 0}}; diff --git a/examples/styles/lv_example_style_9.py b/examples/styles/lv_example_style_9.py index 7f54d3f3a..c8337b6c3 100644 --- a/examples/styles/lv_example_style_9.py +++ b/examples/styles/lv_example_style_9.py @@ -10,7 +10,7 @@ style.set_line_width(6) style.set_line_rounded(True) # Create an object with the new style -obj = lv.line(lv.scr_act()) +obj = lv.line(lv.screen_active()) obj.add_style(style, 0) p = [ {"x":10, "y":30}, {"x":30, "y":50}, diff --git a/examples/widgets/animimg/lv_example_animimg_1.c b/examples/widgets/animimg/lv_example_animimg_1.c index b04a58a1a..ccd8b3942 100644 --- a/examples/widgets/animimg/lv_example_animimg_1.c +++ b/examples/widgets/animimg/lv_example_animimg_1.c @@ -12,7 +12,7 @@ static const lv_image_dsc_t * anim_imgs[3] = { void lv_example_animimg_1(void) { - lv_obj_t * animimg0 = lv_animimg_create(lv_scr_act()); + lv_obj_t * animimg0 = lv_animimg_create(lv_screen_active()); lv_obj_center(animimg0); lv_animimg_set_src(animimg0, (const void **) anim_imgs, 3); lv_animimg_set_duration(animimg0, 1000); diff --git a/examples/widgets/animimg/lv_example_animimg_1.py b/examples/widgets/animimg/lv_example_animimg_1.py index 29156bbae..0cf10d98a 100644 --- a/examples/widgets/animimg/lv_example_animimg_1.py +++ b/examples/widgets/animimg/lv_example_animimg_1.py @@ -36,7 +36,7 @@ anim_images[2] = lv.image_dsc_t({ 'data': anim003_data }) -animimage0 = lv.animimg(lv.scr_act()) +animimage0 = lv.animimg(lv.screen_active()) animimage0.center() animimage0.set_src(anim_images, 3) animimage0.set_duration(1000) diff --git a/examples/widgets/arc/lv_example_arc_1.c b/examples/widgets/arc/lv_example_arc_1.c index 7e59773aa..052eda8e4 100644 --- a/examples/widgets/arc/lv_example_arc_1.c +++ b/examples/widgets/arc/lv_example_arc_1.c @@ -6,10 +6,10 @@ static void value_changed_event_cb(lv_event_t * e); void lv_example_arc_1(void) { - lv_obj_t * label = lv_label_create(lv_scr_act()); + lv_obj_t * label = lv_label_create(lv_screen_active()); /*Create an Arc*/ - lv_obj_t * arc = lv_arc_create(lv_scr_act()); + lv_obj_t * arc = lv_arc_create(lv_screen_active()); lv_obj_set_size(arc, 150, 150); lv_arc_set_rotation(arc, 135); lv_arc_set_bg_angles(arc, 0, 270); diff --git a/examples/widgets/arc/lv_example_arc_1.py b/examples/widgets/arc/lv_example_arc_1.py index c88b3b055..c976d26c4 100644 --- a/examples/widgets/arc/lv_example_arc_1.py +++ b/examples/widgets/arc/lv_example_arc_1.py @@ -7,10 +7,10 @@ def value_changed_event_cb(e,label): # Rotate the label to the current position of the arc arc.rotate_obj_to_angle(label, 25) -label = lv.label(lv.scr_act()) +label = lv.label(lv.screen_active()) # Create an Arc -arc = lv.arc(lv.scr_act()) +arc = lv.arc(lv.screen_active()) arc.set_size(150, 150) arc.set_rotation(135) arc.set_bg_angles(0, 270) diff --git a/examples/widgets/arc/lv_example_arc_2.c b/examples/widgets/arc/lv_example_arc_2.c index 3b94a75e2..ca3b7d44b 100644 --- a/examples/widgets/arc/lv_example_arc_2.c +++ b/examples/widgets/arc/lv_example_arc_2.c @@ -13,11 +13,11 @@ static void set_angle(void * obj, int32_t v) void lv_example_arc_2(void) { /*Create an Arc*/ - lv_obj_t * arc = lv_arc_create(lv_scr_act()); + lv_obj_t * arc = lv_arc_create(lv_screen_active()); lv_arc_set_rotation(arc, 270); lv_arc_set_bg_angles(arc, 0, 360); lv_obj_remove_style(arc, NULL, LV_PART_KNOB); /*Be sure the knob is not displayed*/ - lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); /*To not allow adjusting by click*/ + lv_obj_remove_flag(arc, LV_OBJ_FLAG_CLICKABLE); /*To not allow adjusting by click*/ lv_obj_center(arc); lv_anim_t a; diff --git a/examples/widgets/arc/lv_example_arc_2.py b/examples/widgets/arc/lv_example_arc_2.py index 5d2bd4409..e59731e0d 100644 --- a/examples/widgets/arc/lv_example_arc_2.py +++ b/examples/widgets/arc/lv_example_arc_2.py @@ -5,11 +5,11 @@ def set_angle(obj, v): # Create an arc which acts as a loader. # # Create an Arc -arc = lv.arc(lv.scr_act()) +arc = lv.arc(lv.screen_active()) arc.set_rotation(270) arc.set_bg_angles(0, 360) arc.remove_style(None, lv.PART.KNOB) # Be sure the knob is not displayed -arc.clear_flag(lv.obj.FLAG.CLICKABLE) #To not allow adjusting by click +arc.remove_flag(lv.obj.FLAG.CLICKABLE) #To not allow adjusting by click arc.center() a = lv.anim_t() diff --git a/examples/widgets/bar/lv_example_bar_1.c b/examples/widgets/bar/lv_example_bar_1.c index 3ea98ab9c..59a49bd6a 100644 --- a/examples/widgets/bar/lv_example_bar_1.c +++ b/examples/widgets/bar/lv_example_bar_1.c @@ -3,7 +3,7 @@ void lv_example_bar_1(void) { - lv_obj_t * bar1 = lv_bar_create(lv_scr_act()); + lv_obj_t * bar1 = lv_bar_create(lv_screen_active()); lv_obj_set_size(bar1, 200, 20); lv_obj_center(bar1); lv_bar_set_value(bar1, 70, LV_ANIM_OFF); diff --git a/examples/widgets/bar/lv_example_bar_1.py b/examples/widgets/bar/lv_example_bar_1.py index 874e3d75d..61f78e426 100644 --- a/examples/widgets/bar/lv_example_bar_1.py +++ b/examples/widgets/bar/lv_example_bar_1.py @@ -1,4 +1,4 @@ -bar1 = lv.bar(lv.scr_act()) +bar1 = lv.bar(lv.screen_active()) bar1.set_size(200, 20) bar1.center() bar1.set_value(70, lv.ANIM.OFF) diff --git a/examples/widgets/bar/lv_example_bar_2.c b/examples/widgets/bar/lv_example_bar_2.c index 2688cc2d9..c7401939a 100644 --- a/examples/widgets/bar/lv_example_bar_2.c +++ b/examples/widgets/bar/lv_example_bar_2.c @@ -21,7 +21,7 @@ void lv_example_bar_2(void) lv_style_set_bg_color(&style_indic, lv_palette_main(LV_PALETTE_BLUE)); lv_style_set_radius(&style_indic, 3); - lv_obj_t * bar = lv_bar_create(lv_scr_act()); + lv_obj_t * bar = lv_bar_create(lv_screen_active()); lv_obj_remove_style_all(bar); /*To have a clean start*/ lv_obj_add_style(bar, &style_bg, 0); lv_obj_add_style(bar, &style_indic, LV_PART_INDICATOR); diff --git a/examples/widgets/bar/lv_example_bar_2.py b/examples/widgets/bar/lv_example_bar_2.py index 37dbc0d6c..62338eb9b 100644 --- a/examples/widgets/bar/lv_example_bar_2.py +++ b/examples/widgets/bar/lv_example_bar_2.py @@ -16,7 +16,7 @@ style_indic.set_bg_opa(lv.OPA.COVER) style_indic.set_bg_color(lv.palette_main(lv.PALETTE.BLUE)) style_indic.set_radius(3) -bar = lv.bar(lv.scr_act()) +bar = lv.bar(lv.screen_active()) bar.remove_style_all() # To have a clean start bar.add_style(style_bg, 0) bar.add_style(style_indic, lv.PART.INDICATOR) diff --git a/examples/widgets/bar/lv_example_bar_3.c b/examples/widgets/bar/lv_example_bar_3.c index eaa8487a5..01775302b 100644 --- a/examples/widgets/bar/lv_example_bar_3.c +++ b/examples/widgets/bar/lv_example_bar_3.c @@ -19,7 +19,7 @@ void lv_example_bar_3(void) lv_style_set_bg_grad_color(&style_indic, lv_palette_main(LV_PALETTE_BLUE)); lv_style_set_bg_grad_dir(&style_indic, LV_GRAD_DIR_VER); - lv_obj_t * bar = lv_bar_create(lv_scr_act()); + lv_obj_t * bar = lv_bar_create(lv_screen_active()); lv_obj_add_style(bar, &style_indic, LV_PART_INDICATOR); lv_obj_set_size(bar, 20, 200); lv_obj_center(bar); diff --git a/examples/widgets/bar/lv_example_bar_3.py b/examples/widgets/bar/lv_example_bar_3.py index 8ab4724af..36c00e350 100644 --- a/examples/widgets/bar/lv_example_bar_3.py +++ b/examples/widgets/bar/lv_example_bar_3.py @@ -14,7 +14,7 @@ style_indic.set_bg_color(lv.palette_main(lv.PALETTE.RED)) style_indic.set_bg_grad_color(lv.palette_main(lv.PALETTE.BLUE)) style_indic.set_bg_grad_dir(lv.GRAD_DIR.VER) -bar = lv.bar(lv.scr_act()) +bar = lv.bar(lv.screen_active()) bar.add_style(style_indic, lv.PART.INDICATOR) bar.set_size(20, 200) bar.center() diff --git a/examples/widgets/bar/lv_example_bar_4.c b/examples/widgets/bar/lv_example_bar_4.c index 14af01c6f..2a6f4db67 100644 --- a/examples/widgets/bar/lv_example_bar_4.c +++ b/examples/widgets/bar/lv_example_bar_4.c @@ -14,7 +14,7 @@ void lv_example_bar_4(void) lv_style_set_bg_image_tiled(&style_indic, true); lv_style_set_bg_image_opa(&style_indic, LV_OPA_30); - lv_obj_t * bar = lv_bar_create(lv_scr_act()); + lv_obj_t * bar = lv_bar_create(lv_screen_active()); lv_obj_add_style(bar, &style_indic, LV_PART_INDICATOR); lv_obj_set_size(bar, 260, 20); diff --git a/examples/widgets/bar/lv_example_bar_4.py b/examples/widgets/bar/lv_example_bar_4.py index 2d860f33b..a215898c9 100644 --- a/examples/widgets/bar/lv_example_bar_4.py +++ b/examples/widgets/bar/lv_example_bar_4.py @@ -22,7 +22,7 @@ style_indic.set_bg_image_src(image_skew_strip_dsc) style_indic.set_bg_image_tiled(True) style_indic.set_bg_image_opa(lv.OPA._30) -bar = lv.bar(lv.scr_act()) +bar = lv.bar(lv.screen_active()) bar.add_style(style_indic, lv.PART.INDICATOR) bar.set_size(260, 20) diff --git a/examples/widgets/bar/lv_example_bar_5.c b/examples/widgets/bar/lv_example_bar_5.c index c416380a5..dd3538472 100644 --- a/examples/widgets/bar/lv_example_bar_5.c +++ b/examples/widgets/bar/lv_example_bar_5.c @@ -9,22 +9,22 @@ void lv_example_bar_5(void) lv_obj_t * label; - lv_obj_t * bar_ltr = lv_bar_create(lv_scr_act()); + lv_obj_t * bar_ltr = lv_bar_create(lv_screen_active()); lv_obj_set_size(bar_ltr, 200, 20); lv_bar_set_value(bar_ltr, 70, LV_ANIM_OFF); lv_obj_align(bar_ltr, LV_ALIGN_CENTER, 0, -30); - label = lv_label_create(lv_scr_act()); + label = lv_label_create(lv_screen_active()); lv_label_set_text(label, "Left to Right base direction"); lv_obj_align_to(label, bar_ltr, LV_ALIGN_OUT_TOP_MID, 0, -5); - lv_obj_t * bar_rtl = lv_bar_create(lv_scr_act()); + lv_obj_t * bar_rtl = lv_bar_create(lv_screen_active()); lv_obj_set_style_base_dir(bar_rtl, LV_BASE_DIR_RTL, 0); lv_obj_set_size(bar_rtl, 200, 20); lv_bar_set_value(bar_rtl, 70, LV_ANIM_OFF); lv_obj_align(bar_rtl, LV_ALIGN_CENTER, 0, 30); - label = lv_label_create(lv_scr_act()); + label = lv_label_create(lv_screen_active()); lv_label_set_text(label, "Right to Left base direction"); lv_obj_align_to(label, bar_rtl, LV_ALIGN_OUT_TOP_MID, 0, -5); } diff --git a/examples/widgets/bar/lv_example_bar_5.py b/examples/widgets/bar/lv_example_bar_5.py index 7c81ec8be..747db78fe 100644 --- a/examples/widgets/bar/lv_example_bar_5.py +++ b/examples/widgets/bar/lv_example_bar_5.py @@ -2,21 +2,21 @@ # Bar with LTR and RTL base direction # -bar_ltr = lv.bar(lv.scr_act()) +bar_ltr = lv.bar(lv.screen_active()) bar_ltr.set_size(200, 20) bar_ltr.set_value(70, lv.ANIM.OFF) bar_ltr.align(lv.ALIGN.CENTER, 0, -30) -label = lv.label(lv.scr_act()) +label = lv.label(lv.screen_active()) label.set_text("Left to Right base direction") label.align_to(bar_ltr, lv.ALIGN.OUT_TOP_MID, 0, -5) -bar_rtl = lv.bar(lv.scr_act()) +bar_rtl = lv.bar(lv.screen_active()) bar_rtl.set_style_base_dir(lv.BASE_DIR.RTL,0) bar_rtl.set_size(200, 20) bar_rtl.set_value(70, lv.ANIM.OFF) bar_rtl.align(lv.ALIGN.CENTER, 0, 30) -label = lv.label(lv.scr_act()) +label = lv.label(lv.screen_active()) label.set_text("Right to Left base direction") label.align_to(bar_rtl, lv.ALIGN.OUT_TOP_MID, 0, -5) diff --git a/examples/widgets/bar/lv_example_bar_6.c b/examples/widgets/bar/lv_example_bar_6.c index d2374f660..303f01eda 100644 --- a/examples/widgets/bar/lv_example_bar_6.c +++ b/examples/widgets/bar/lv_example_bar_6.c @@ -51,7 +51,7 @@ static void event_cb(lv_event_t * e) */ void lv_example_bar_6(void) { - lv_obj_t * bar = lv_bar_create(lv_scr_act()); + lv_obj_t * bar = lv_bar_create(lv_screen_active()); lv_obj_set_size(bar, 200, 20); lv_obj_center(bar); lv_obj_add_event(bar, event_cb, LV_EVENT_DRAW_MAIN_END, NULL); diff --git a/examples/widgets/btn/lv_example_btn_1.c b/examples/widgets/btn/lv_example_btn_1.c index 2ce93c18d..23c0fc515 100644 --- a/examples/widgets/btn/lv_example_btn_1.c +++ b/examples/widgets/btn/lv_example_btn_1.c @@ -17,16 +17,16 @@ void lv_example_button_1(void) { lv_obj_t * label; - lv_obj_t * btn1 = lv_button_create(lv_scr_act()); + lv_obj_t * btn1 = lv_button_create(lv_screen_active()); lv_obj_add_event(btn1, event_handler, LV_EVENT_ALL, NULL); lv_obj_align(btn1, LV_ALIGN_CENTER, 0, -40); - lv_obj_clear_flag(btn1, LV_OBJ_FLAG_PRESS_LOCK); + lv_obj_remove_flag(btn1, LV_OBJ_FLAG_PRESS_LOCK); label = lv_label_create(btn1); lv_label_set_text(label, "Button"); lv_obj_center(label); - lv_obj_t * btn2 = lv_button_create(lv_scr_act()); + lv_obj_t * btn2 = lv_button_create(lv_screen_active()); lv_obj_add_event(btn2, event_handler, LV_EVENT_ALL, NULL); lv_obj_align(btn2, LV_ALIGN_CENTER, 0, 40); lv_obj_add_flag(btn2, LV_OBJ_FLAG_CHECKABLE); diff --git a/examples/widgets/btn/lv_example_btn_1.py b/examples/widgets/btn/lv_example_btn_1.py index 7bf373cb9..45f2a82d3 100644 --- a/examples/widgets/btn/lv_example_btn_1.py +++ b/examples/widgets/btn/lv_example_btn_1.py @@ -7,7 +7,7 @@ def event_handler(evt): print("Value changed seen") # create a simple button -button1 = lv.button(lv.scr_act()) +button1 = lv.button(lv.screen_active()) # attach the callback button1.add_event(event_handler,lv.EVENT.ALL, None) @@ -17,7 +17,7 @@ label=lv.label(button1) label.set_text("Button") # create a toggle button -button2 = lv.button(lv.scr_act()) +button2 = lv.button(lv.screen_active()) # attach the callback #button2.add_event(event_handler,lv.EVENT.VALUE_CHANGED,None) diff --git a/examples/widgets/btn/lv_example_btn_2.c b/examples/widgets/btn/lv_example_btn_2.c index c43abaaa2..7a063a350 100644 --- a/examples/widgets/btn/lv_example_btn_2.c +++ b/examples/widgets/btn/lv_example_btn_2.c @@ -51,7 +51,7 @@ void lv_example_button_2(void) lv_style_set_transition(&style_pr, &trans); - lv_obj_t * btn1 = lv_button_create(lv_scr_act()); + lv_obj_t * btn1 = lv_button_create(lv_screen_active()); lv_obj_remove_style_all(btn1); /*Remove the style coming from the theme*/ lv_obj_add_style(btn1, &style, 0); lv_obj_add_style(btn1, &style_pr, LV_STATE_PRESSED); diff --git a/examples/widgets/btn/lv_example_btn_2.py b/examples/widgets/btn/lv_example_btn_2.py index 18372e3fd..bd3d52cc3 100644 --- a/examples/widgets/btn/lv_example_btn_2.py +++ b/examples/widgets/btn/lv_example_btn_2.py @@ -47,7 +47,7 @@ trans.init(props, lv.anim_t.path_linear, 300, 0, None) style_pr.set_transition(trans) -button1 = lv.button(lv.scr_act()) +button1 = lv.button(lv.screen_active()) button1.remove_style_all() # Remove the style coming from the theme button1.add_style(style, 0) button1.add_style(style_pr, lv.STATE.PRESSED) diff --git a/examples/widgets/btn/lv_example_btn_3.c b/examples/widgets/btn/lv_example_btn_3.c index c4b94742c..804fb768b 100644 --- a/examples/widgets/btn/lv_example_btn_3.c +++ b/examples/widgets/btn/lv_example_btn_3.c @@ -34,7 +34,7 @@ void lv_example_button_3(void) lv_style_set_text_letter_space(&style_pr, 10); lv_style_set_transition(&style_pr, &transition_dsc_pr); - lv_obj_t * btn1 = lv_button_create(lv_scr_act()); + lv_obj_t * btn1 = lv_button_create(lv_screen_active()); lv_obj_align(btn1, LV_ALIGN_CENTER, 0, -80); lv_obj_add_style(btn1, &style_pr, LV_STATE_PRESSED); lv_obj_add_style(btn1, &style_def, 0); diff --git a/examples/widgets/btn/lv_example_btn_3.py b/examples/widgets/btn/lv_example_btn_3.py index ad9d1d525..db52a39db 100644 --- a/examples/widgets/btn/lv_example_btn_3.py +++ b/examples/widgets/btn/lv_example_btn_3.py @@ -28,7 +28,7 @@ style_pr.set_transform_height(-10) style_pr.set_text_letter_space(10) style_pr.set_transition(transition_dsc_pr) -button1 = lv.button(lv.scr_act()) +button1 = lv.button(lv.screen_active()) button1.align(lv.ALIGN.CENTER, 0, -80) button1.add_style(style_pr, lv.STATE.PRESSED) button1.add_style(style_def, 0) diff --git a/examples/widgets/btnmatrix/lv_example_btnmatrix_1.c b/examples/widgets/btnmatrix/lv_example_btnmatrix_1.c index 65983eb23..2c0973105 100644 --- a/examples/widgets/btnmatrix/lv_example_btnmatrix_1.c +++ b/examples/widgets/btnmatrix/lv_example_btnmatrix_1.c @@ -21,7 +21,7 @@ static const char * btnm_map[] = {"1", "2", "3", "4", "5", "\n", void lv_example_buttonmatrix_1(void) { - lv_obj_t * btnm1 = lv_buttonmatrix_create(lv_scr_act()); + lv_obj_t * btnm1 = lv_buttonmatrix_create(lv_screen_active()); lv_buttonmatrix_set_map(btnm1, btnm_map); lv_buttonmatrix_set_button_width(btnm1, 10, 2); /*Make "Action1" twice as wide as "Action2"*/ lv_buttonmatrix_set_button_ctrl(btnm1, 10, LV_BUTTONMATRIX_CTRL_CHECKABLE); diff --git a/examples/widgets/btnmatrix/lv_example_btnmatrix_1.py b/examples/widgets/btnmatrix/lv_example_btnmatrix_1.py index 262d64fc3..3461e4e09 100644 --- a/examples/widgets/btnmatrix/lv_example_btnmatrix_1.py +++ b/examples/widgets/btnmatrix/lv_example_btnmatrix_1.py @@ -12,7 +12,7 @@ buttonm_map = ["1", "2", "3", "4", "5", "\n", "6", "7", "8", "9", "0", "\n", "Action1", "Action2", ""] -buttonm1 = lv.buttonmatrix(lv.scr_act()) +buttonm1 = lv.buttonmatrix(lv.screen_active()) buttonm1.set_map(buttonm_map) buttonm1.set_button_width(10, 2) # Make "Action1" twice as wide as "Action2" buttonm1.set_button_ctrl(10, lv.buttonmatrix.CTRL.CHECKABLE) diff --git a/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c b/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c index dbd344e9f..d16510444 100644 --- a/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c +++ b/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c @@ -76,7 +76,7 @@ static void event_cb(lv_event_t * e) */ void lv_example_buttonmatrix_2(void) { - lv_obj_t * btnm = lv_buttonmatrix_create(lv_scr_act()); + lv_obj_t * btnm = lv_buttonmatrix_create(lv_screen_active()); lv_obj_add_event(btnm, event_cb, LV_EVENT_DRAW_TASK_ADDED, NULL); lv_obj_add_flag(btnm, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS); lv_obj_center(btnm); diff --git a/examples/widgets/btnmatrix/lv_example_btnmatrix_3.c b/examples/widgets/btnmatrix/lv_example_btnmatrix_3.c index 9c3ac2a92..526aec00e 100644 --- a/examples/widgets/btnmatrix/lv_example_btnmatrix_3.c +++ b/examples/widgets/btnmatrix/lv_example_btnmatrix_3.c @@ -46,7 +46,7 @@ void lv_example_buttonmatrix_3(void) static const char * map[] = {LV_SYMBOL_LEFT, "1", "2", "3", "4", "5", LV_SYMBOL_RIGHT, ""}; - lv_obj_t * btnm = lv_buttonmatrix_create(lv_scr_act()); + lv_obj_t * btnm = lv_buttonmatrix_create(lv_screen_active()); lv_buttonmatrix_set_map(btnm, map); lv_obj_add_style(btnm, &style_bg, 0); lv_obj_add_style(btnm, &style_btn, LV_PART_ITEMS); diff --git a/examples/widgets/btnmatrix/lv_example_btnmatrix_3.py b/examples/widgets/btnmatrix/lv_example_btnmatrix_3.py index 0bc3fd784..0cf87335b 100644 --- a/examples/widgets/btnmatrix/lv_example_btnmatrix_3.py +++ b/examples/widgets/btnmatrix/lv_example_btnmatrix_3.py @@ -45,7 +45,7 @@ style_button.set_radius(0) map = [lv.SYMBOL.LEFT,"1","2", "3", "4", "5",lv.SYMBOL.RIGHT, ""] -buttonm = lv.buttonmatrix(lv.scr_act()) +buttonm = lv.buttonmatrix(lv.screen_active()) buttonm.set_map(map) buttonm.add_style(style_bg, 0) buttonm.add_style(style_button, lv.PART.ITEMS) diff --git a/examples/widgets/calendar/lv_example_calendar_1.c b/examples/widgets/calendar/lv_example_calendar_1.c index 4431bc03f..341ca803a 100644 --- a/examples/widgets/calendar/lv_example_calendar_1.c +++ b/examples/widgets/calendar/lv_example_calendar_1.c @@ -16,7 +16,7 @@ static void event_handler(lv_event_t * e) void lv_example_calendar_1(void) { - lv_obj_t * calendar = lv_calendar_create(lv_scr_act()); + lv_obj_t * calendar = lv_calendar_create(lv_screen_active()); lv_obj_set_size(calendar, 185, 185); lv_obj_align(calendar, LV_ALIGN_CENTER, 0, 27); lv_obj_add_event(calendar, event_handler, LV_EVENT_ALL, NULL); diff --git a/examples/widgets/calendar/lv_example_calendar_1.py b/examples/widgets/calendar/lv_example_calendar_1.py index 2206a6bf9..e854c2b29 100644 --- a/examples/widgets/calendar/lv_example_calendar_1.py +++ b/examples/widgets/calendar/lv_example_calendar_1.py @@ -10,7 +10,7 @@ def event_handler(e): print("Clicked date: %02d.%02d.%02d"%(date.day, date.month, date.year)) -calendar = lv.calendar(lv.scr_act()) +calendar = lv.calendar(lv.screen_active()) calendar.set_size(200, 200) calendar.align(lv.ALIGN.CENTER, 0, 20) calendar.add_event(event_handler, lv.EVENT.ALL, None) diff --git a/examples/widgets/canvas/lv_example_canvas_1.c b/examples/widgets/canvas/lv_example_canvas_1.c index f1bdd5476..1c1f98d8b 100644 --- a/examples/widgets/canvas/lv_example_canvas_1.c +++ b/examples/widgets/canvas/lv_example_canvas_1.c @@ -30,7 +30,7 @@ void lv_example_canvas_1(void) static uint8_t cbuf[LV_CANVAS_BUF_SIZE_TRUE_COLOR(CANVAS_WIDTH, CANVAS_HEIGHT)]; - lv_obj_t * canvas = lv_canvas_create(lv_scr_act()); + lv_obj_t * canvas = lv_canvas_create(lv_screen_active()); lv_canvas_set_buffer(canvas, cbuf, CANVAS_WIDTH, CANVAS_HEIGHT, LV_COLOR_FORMAT_NATIVE); lv_obj_center(canvas); lv_canvas_fill_bg(canvas, lv_palette_lighten(LV_PALETTE_GREY, 3), LV_OPA_COVER); diff --git a/examples/widgets/canvas/lv_example_canvas_1.py b/examples/widgets/canvas/lv_example_canvas_1.py index ad145c8e2..dae286d19 100644 --- a/examples/widgets/canvas/lv_example_canvas_1.py +++ b/examples/widgets/canvas/lv_example_canvas_1.py @@ -28,7 +28,7 @@ label_dsc.text = "Some text on text canvas" cbuf = bytearray(_CANVAS_WIDTH * _CANVAS_HEIGHT * 4) # cbuf2 = bytearray(_CANVAS_WIDTH * _CANVAS_HEIGHT * 4) -canvas = lv.canvas(lv.scr_act()) +canvas = lv.canvas(lv.screen_active()) canvas.set_buffer(cbuf, _CANVAS_WIDTH, _CANVAS_HEIGHT, lv.COLOR_FORMAT.NATIVE) canvas.center() canvas.fill_bg(lv.palette_lighten(lv.PALETTE.GREY, 3), lv.OPA.COVER) diff --git a/examples/widgets/canvas/lv_example_canvas_2.c b/examples/widgets/canvas/lv_example_canvas_2.c index d2720d3dd..7c546ce32 100644 --- a/examples/widgets/canvas/lv_example_canvas_2.c +++ b/examples/widgets/canvas/lv_example_canvas_2.c @@ -9,13 +9,13 @@ */ void lv_example_canvas_2(void) { - lv_obj_set_style_bg_color(lv_scr_act(), lv_palette_lighten(LV_PALETTE_RED, 5), 0); + lv_obj_set_style_bg_color(lv_screen_active(), lv_palette_lighten(LV_PALETTE_RED, 5), 0); /*Create a buffer for the canvas*/ static uint8_t cbuf[CANVAS_WIDTH * CANVAS_HEIGHT * 4]; /*Create a canvas and initialize its palette*/ - lv_obj_t * canvas = lv_canvas_create(lv_scr_act()); + lv_obj_t * canvas = lv_canvas_create(lv_screen_active()); lv_canvas_set_buffer(canvas, cbuf, CANVAS_WIDTH, CANVAS_HEIGHT, LV_COLOR_FORMAT_ARGB8888); lv_obj_center(canvas); diff --git a/examples/widgets/canvas/lv_example_canvas_3.c b/examples/widgets/canvas/lv_example_canvas_3.c index 4f19e948c..85049e423 100644 --- a/examples/widgets/canvas/lv_example_canvas_3.c +++ b/examples/widgets/canvas/lv_example_canvas_3.c @@ -13,7 +13,7 @@ void lv_example_canvas_3(void) static uint8_t cbuf[LV_CANVAS_BUF_SIZE_TRUE_COLOR(CANVAS_WIDTH, CANVAS_HEIGHT)]; /*Create a canvas and initialize its palette*/ - lv_obj_t * canvas = lv_canvas_create(lv_scr_act()); + lv_obj_t * canvas = lv_canvas_create(lv_screen_active()); lv_canvas_set_buffer(canvas, cbuf, CANVAS_WIDTH, CANVAS_HEIGHT, LV_COLOR_FORMAT_NATIVE); lv_canvas_fill_bg(canvas, lv_color_hex3(0xccc), LV_OPA_COVER); lv_obj_center(canvas); diff --git a/examples/widgets/canvas/lv_example_canvas_3.py b/examples/widgets/canvas/lv_example_canvas_3.py index 6c6889e12..dfd48404c 100644 --- a/examples/widgets/canvas/lv_example_canvas_3.py +++ b/examples/widgets/canvas/lv_example_canvas_3.py @@ -9,7 +9,7 @@ LV_COLOR_SIZE = 32 cbuf = bytearray((LV_COLOR_SIZE // 8) * CANVAS_WIDTH * CANVAS_HEIGHT) # Create a canvas and initialize its palette*/ -canvas = lv.canvas(lv.scr_act()) +canvas = lv.canvas(lv.screen_active()) canvas.set_buffer(cbuf, CANVAS_WIDTH, CANVAS_HEIGHT, lv.COLOR_FORMAT.NATIVE) canvas.fill_bg(lv.color_hex3(0xccc), lv.OPA.COVER) diff --git a/examples/widgets/canvas/lv_example_canvas_4.c b/examples/widgets/canvas/lv_example_canvas_4.c index 27d28d15d..a51b45b6a 100644 --- a/examples/widgets/canvas/lv_example_canvas_4.c +++ b/examples/widgets/canvas/lv_example_canvas_4.c @@ -13,7 +13,7 @@ void lv_example_canvas_4(void) static uint8_t cbuf[LV_CANVAS_BUF_SIZE_TRUE_COLOR(CANVAS_WIDTH, CANVAS_HEIGHT)]; /*Create a canvas and initialize its palette*/ - lv_obj_t * canvas = lv_canvas_create(lv_scr_act()); + lv_obj_t * canvas = lv_canvas_create(lv_screen_active()); lv_canvas_set_buffer(canvas, cbuf, CANVAS_WIDTH, CANVAS_HEIGHT, LV_COLOR_FORMAT_NATIVE); lv_canvas_fill_bg(canvas, lv_color_hex3(0xccc), LV_OPA_COVER); lv_obj_center(canvas); diff --git a/examples/widgets/canvas/lv_example_canvas_4.py b/examples/widgets/canvas/lv_example_canvas_4.py index d2d8637a8..f6382d210 100644 --- a/examples/widgets/canvas/lv_example_canvas_4.py +++ b/examples/widgets/canvas/lv_example_canvas_4.py @@ -13,7 +13,7 @@ LV_COLOR_SIZE = 32 cbuf = bytearray((LV_COLOR_SIZE // 8) * CANVAS_WIDTH * CANVAS_HEIGHT) # Create a canvas and initialize its palette -canvas = lv.canvas(lv.scr_act()) +canvas = lv.canvas(lv.screen_active()) canvas.set_buffer(cbuf, CANVAS_WIDTH, CANVAS_HEIGHT, lv.COLOR_FORMAT.NATIVE) canvas.fill_bg(lv.color_hex3(0xccc), lv.OPA.COVER) canvas.center() diff --git a/examples/widgets/canvas/lv_example_canvas_5.c b/examples/widgets/canvas/lv_example_canvas_5.c index 1f3dd2576..5a32d8c02 100644 --- a/examples/widgets/canvas/lv_example_canvas_5.c +++ b/examples/widgets/canvas/lv_example_canvas_5.c @@ -13,7 +13,7 @@ void lv_example_canvas_5(void) static uint8_t cbuf[LV_CANVAS_BUF_SIZE_TRUE_COLOR(CANVAS_WIDTH, CANVAS_HEIGHT)]; /*Create a canvas and initialize its palette*/ - lv_obj_t * canvas = lv_canvas_create(lv_scr_act()); + lv_obj_t * canvas = lv_canvas_create(lv_screen_active()); lv_canvas_set_buffer(canvas, cbuf, CANVAS_WIDTH, CANVAS_HEIGHT, LV_COLOR_FORMAT_NATIVE); lv_canvas_fill_bg(canvas, lv_color_hex3(0xccc), LV_OPA_COVER); lv_obj_center(canvas); diff --git a/examples/widgets/canvas/lv_example_canvas_5.py b/examples/widgets/canvas/lv_example_canvas_5.py index 7df3ccc36..995b41c97 100644 --- a/examples/widgets/canvas/lv_example_canvas_5.py +++ b/examples/widgets/canvas/lv_example_canvas_5.py @@ -11,7 +11,7 @@ LV_COLOR_SIZE = 32 cbuf = bytearray((LV_COLOR_SIZE // 8) * CANVAS_WIDTH * CANVAS_HEIGHT) # Create a canvas and initialize its palette -canvas = lv.canvas(lv.scr_act()) +canvas = lv.canvas(lv.screen_active()) canvas.set_buffer(cbuf, CANVAS_WIDTH, CANVAS_HEIGHT, lv.COLOR_FORMAT.NATIVE) canvas.fill_bg(lv.color_hex3(0xccc), lv.OPA.COVER) canvas.center() diff --git a/examples/widgets/canvas/lv_example_canvas_6.c b/examples/widgets/canvas/lv_example_canvas_6.c index 9a2eb68c3..34e9ecf48 100644 --- a/examples/widgets/canvas/lv_example_canvas_6.c +++ b/examples/widgets/canvas/lv_example_canvas_6.c @@ -13,7 +13,7 @@ void lv_example_canvas_6(void) static uint8_t cbuf[LV_CANVAS_BUF_SIZE_TRUE_COLOR(CANVAS_WIDTH, CANVAS_HEIGHT)]; /*Create a canvas and initialize its palette*/ - lv_obj_t * canvas = lv_canvas_create(lv_scr_act()); + lv_obj_t * canvas = lv_canvas_create(lv_screen_active()); lv_canvas_set_buffer(canvas, cbuf, CANVAS_WIDTH, CANVAS_HEIGHT, LV_COLOR_FORMAT_NATIVE); lv_canvas_fill_bg(canvas, lv_color_hex3(0xccc), LV_OPA_COVER); lv_obj_center(canvas); diff --git a/examples/widgets/canvas/lv_example_canvas_6.py b/examples/widgets/canvas/lv_example_canvas_6.py index 48d5e43ed..ccb64827e 100644 --- a/examples/widgets/canvas/lv_example_canvas_6.py +++ b/examples/widgets/canvas/lv_example_canvas_6.py @@ -24,7 +24,7 @@ image_star_argb = lv.image_dsc_t({ cbuf = bytearray((LV_COLOR_SIZE // 8) * CANVAS_WIDTH * CANVAS_HEIGHT) # Create a canvas and initialize its palette -canvas = lv.canvas(lv.scr_act()) +canvas = lv.canvas(lv.screen_active()) canvas.set_buffer(cbuf, CANVAS_WIDTH, CANVAS_HEIGHT, lv.COLOR_FORMAT.NATIVE) canvas.fill_bg(lv.color_hex3(0xccc), lv.OPA.COVER) canvas.center() diff --git a/examples/widgets/canvas/lv_example_canvas_7.c b/examples/widgets/canvas/lv_example_canvas_7.c index 843e26d05..457a36bcc 100644 --- a/examples/widgets/canvas/lv_example_canvas_7.c +++ b/examples/widgets/canvas/lv_example_canvas_7.c @@ -13,7 +13,7 @@ void lv_example_canvas_7(void) static uint8_t cbuf[LV_CANVAS_BUF_SIZE_TRUE_COLOR(CANVAS_WIDTH, CANVAS_HEIGHT)]; /*Create a canvas and initialize its palette*/ - lv_obj_t * canvas = lv_canvas_create(lv_scr_act()); + lv_obj_t * canvas = lv_canvas_create(lv_screen_active()); lv_canvas_set_buffer(canvas, cbuf, CANVAS_WIDTH, CANVAS_HEIGHT, LV_COLOR_FORMAT_NATIVE); lv_canvas_fill_bg(canvas, lv_color_hex3(0xccc), LV_OPA_COVER); lv_obj_center(canvas); diff --git a/examples/widgets/canvas/lv_example_canvas_7.py b/examples/widgets/canvas/lv_example_canvas_7.py index c7de69138..a290b1e33 100644 --- a/examples/widgets/canvas/lv_example_canvas_7.py +++ b/examples/widgets/canvas/lv_example_canvas_7.py @@ -11,7 +11,7 @@ LV_COLOR_SIZE = 32 cbuf = bytearray((LV_COLOR_SIZE // 8) * CANVAS_WIDTH * CANVAS_HEIGHT) # Create a canvas and initialize its palette -canvas = lv.canvas(lv.scr_act()) +canvas = lv.canvas(lv.screen_active()) canvas.set_buffer(cbuf, CANVAS_WIDTH, CANVAS_HEIGHT, lv.COLOR_FORMAT.NATIVE) canvas.fill_bg(lv.color_hex3(0xccc), lv.OPA.COVER) canvas.center() diff --git a/examples/widgets/chart/lv_example_chart_1.c b/examples/widgets/chart/lv_example_chart_1.c index a946e1885..f489564f5 100644 --- a/examples/widgets/chart/lv_example_chart_1.c +++ b/examples/widgets/chart/lv_example_chart_1.c @@ -5,7 +5,7 @@ void lv_example_chart_1(void) { /*Create a chart*/ lv_obj_t * chart; - chart = lv_chart_create(lv_scr_act()); + chart = lv_chart_create(lv_screen_active()); lv_obj_set_size(chart, 200, 150); lv_obj_center(chart); lv_chart_set_type(chart, LV_CHART_TYPE_LINE); /*Show lines and points too*/ diff --git a/examples/widgets/chart/lv_example_chart_1.py b/examples/widgets/chart/lv_example_chart_1.py index ec7afc34e..6c048b881 100644 --- a/examples/widgets/chart/lv_example_chart_1.py +++ b/examples/widgets/chart/lv_example_chart_1.py @@ -1,5 +1,5 @@ # Create a chart -chart = lv.chart(lv.scr_act()) +chart = lv.chart(lv.screen_active()) chart.set_size(200, 150) chart.center() chart.set_type(lv.chart.TYPE.LINE) # Show lines and points too diff --git a/examples/widgets/chart/lv_example_chart_2.c b/examples/widgets/chart/lv_example_chart_2.c index 307634eb2..3b1e09725 100644 --- a/examples/widgets/chart/lv_example_chart_2.c +++ b/examples/widgets/chart/lv_example_chart_2.c @@ -104,7 +104,7 @@ static void add_data(lv_timer_t * timer) void lv_example_chart_2(void) { /*Create a chart1*/ - chart1 = lv_chart_create(lv_scr_act()); + chart1 = lv_chart_create(lv_screen_active()); lv_obj_set_size(chart1, 200, 150); lv_obj_center(chart1); lv_chart_set_type(chart1, LV_CHART_TYPE_LINE); /*Show lines and points too*/ diff --git a/examples/widgets/chart/lv_example_chart_3.c b/examples/widgets/chart/lv_example_chart_3.c index fde782900..c595cbcb4 100644 --- a/examples/widgets/chart/lv_example_chart_3.c +++ b/examples/widgets/chart/lv_example_chart_3.c @@ -17,7 +17,7 @@ */ void lv_example_chart_3(void) { - lv_obj_t * main_cont = lv_obj_create(lv_scr_act()); + lv_obj_t * main_cont = lv_obj_create(lv_screen_active()); lv_obj_set_size(main_cont, 200, 150); lv_obj_t * wrapper = lv_obj_create(main_cont); diff --git a/examples/widgets/chart/lv_example_chart_4.c b/examples/widgets/chart/lv_example_chart_4.c index 822a3c881..796e523af 100644 --- a/examples/widgets/chart/lv_example_chart_4.c +++ b/examples/widgets/chart/lv_example_chart_4.c @@ -63,7 +63,7 @@ void lv_example_chart_4(void) { /*Create a chart*/ lv_obj_t * chart; - chart = lv_chart_create(lv_scr_act()); + chart = lv_chart_create(lv_screen_active()); lv_obj_set_size(chart, 200, 150); lv_obj_center(chart); diff --git a/examples/widgets/chart/lv_example_chart_4.py b/examples/widgets/chart/lv_example_chart_4.py index 7bea2fc60..2bd409555 100644 --- a/examples/widgets/chart/lv_example_chart_4.py +++ b/examples/widgets/chart/lv_example_chart_4.py @@ -63,7 +63,7 @@ def event_cb(e): # # Create a chart -chart = lv.chart(lv.scr_act()) +chart = lv.chart(lv.screen_active()) chart.set_size(200, 150) chart.center() diff --git a/examples/widgets/chart/lv_example_chart_5.c b/examples/widgets/chart/lv_example_chart_5.c index dbd62a680..85a03dc36 100644 --- a/examples/widgets/chart/lv_example_chart_5.c +++ b/examples/widgets/chart/lv_example_chart_5.c @@ -68,7 +68,7 @@ static void slider_y_event_cb(lv_event_t * e) void lv_example_chart_5(void) { /*Create a chart*/ - chart = lv_chart_create(lv_scr_act()); + chart = lv_chart_create(lv_screen_active()); lv_obj_set_size(chart, 200, 150); lv_obj_align(chart, LV_ALIGN_CENTER, -30, -30); lv_chart_set_range(chart, LV_CHART_AXIS_PRIMARY_Y, -1000, 1000); @@ -83,13 +83,13 @@ void lv_example_chart_5(void) lv_chart_set_ext_y_array(chart, ser, (lv_coord_t *)ecg_sample); lv_obj_t * slider; - slider = lv_slider_create(lv_scr_act()); + slider = lv_slider_create(lv_screen_active()); lv_slider_set_range(slider, LV_SCALE_NONE, LV_SCALE_NONE * 10); lv_obj_add_event(slider, slider_x_event_cb, LV_EVENT_VALUE_CHANGED, NULL); lv_obj_set_size(slider, 200, 10); lv_obj_align_to(slider, chart, LV_ALIGN_OUT_BOTTOM_MID, 0, 20); - slider = lv_slider_create(lv_scr_act()); + slider = lv_slider_create(lv_screen_active()); lv_slider_set_range(slider, LV_SCALE_NONE, LV_SCALE_NONE * 10); lv_obj_add_event(slider, slider_y_event_cb, LV_EVENT_VALUE_CHANGED, NULL); lv_obj_set_size(slider, 10, 150); diff --git a/examples/widgets/chart/lv_example_chart_6.c b/examples/widgets/chart/lv_example_chart_6.c index e4e6a61a5..c0269f6ab 100644 --- a/examples/widgets/chart/lv_example_chart_6.c +++ b/examples/widgets/chart/lv_example_chart_6.c @@ -21,7 +21,7 @@ static void value_changed_event_cb(lv_event_t * e) */ void lv_example_chart_6(void) { - chart = lv_chart_create(lv_scr_act()); + chart = lv_chart_create(lv_screen_active()); lv_obj_set_size(chart, 200, 150); lv_obj_align(chart, LV_ALIGN_CENTER, 0, -10); @@ -41,7 +41,7 @@ void lv_example_chart_6(void) // lv_chart_set_zoom_x(chart, 500); - 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, "Click on a point"); lv_obj_align_to(label, chart, LV_ALIGN_OUT_TOP_MID, 0, -5); } diff --git a/examples/widgets/chart/lv_example_chart_7.c b/examples/widgets/chart/lv_example_chart_7.c index ed52a45c1..6352857d5 100644 --- a/examples/widgets/chart/lv_example_chart_7.c +++ b/examples/widgets/chart/lv_example_chart_7.c @@ -41,7 +41,7 @@ static void add_data(lv_timer_t * timer) */ void lv_example_chart_7(void) { - lv_obj_t * chart = lv_chart_create(lv_scr_act()); + lv_obj_t * chart = lv_chart_create(lv_screen_active()); lv_obj_set_size(chart, 200, 150); lv_obj_align(chart, LV_ALIGN_CENTER, 0, 0); lv_obj_add_event(chart, draw_event_cb, LV_EVENT_DRAW_TASK_ADDED, NULL); diff --git a/examples/widgets/chart/lv_example_chart_8.c b/examples/widgets/chart/lv_example_chart_8.c index 500d9c44f..b998046c5 100644 --- a/examples/widgets/chart/lv_example_chart_8.c +++ b/examples/widgets/chart/lv_example_chart_8.c @@ -75,7 +75,7 @@ static int32_t round_fixed_point(int32_t n, int8_t shift) void lv_example_chart_8(void) { /*Create a stacked_area_chart.obj*/ - stacked_area_chart.obj = lv_chart_create(lv_scr_act()); + stacked_area_chart.obj = lv_chart_create(lv_screen_active()); lv_obj_set_size(stacked_area_chart.obj, 200, 150); lv_obj_center(stacked_area_chart.obj); lv_chart_set_type(stacked_area_chart.obj, LV_CHART_TYPE_LINE); diff --git a/examples/widgets/chart/lv_example_chart_9.c b/examples/widgets/chart/lv_example_chart_9.c index 84f94f7b4..c307f1f2d 100644 --- a/examples/widgets/chart/lv_example_chart_9.c +++ b/examples/widgets/chart/lv_example_chart_9.c @@ -26,7 +26,7 @@ static void add_data(lv_timer_t * t) void lv_example_chart_9(void) { /*Create a stacked_area_chart.obj*/ - lv_obj_t * chart = lv_chart_create(lv_scr_act()); + lv_obj_t * chart = lv_chart_create(lv_screen_active()); lv_chart_set_update_mode(chart, LV_CHART_UPDATE_MODE_CIRCULAR); lv_obj_set_size(chart, 200, 150); lv_obj_center(chart); diff --git a/examples/widgets/chart/lv_example_chart_9.py b/examples/widgets/chart/lv_example_chart_9.py index 11fdf8fd3..0b347a8a9 100644 --- a/examples/widgets/chart/lv_example_chart_9.py +++ b/examples/widgets/chart/lv_example_chart_9.py @@ -15,7 +15,7 @@ def add_data(t): # # Circular line chart with gap # -chart = lv.chart(lv.scr_act()) +chart = lv.chart(lv.screen_active()) chart.set_update_mode(lv.chart.UPDATE_MODE.CIRCULAR) chart.set_size(200, 150) diff --git a/examples/widgets/checkbox/lv_example_checkbox_1.c b/examples/widgets/checkbox/lv_example_checkbox_1.c index cfce553f6..3d85f2e7b 100644 --- a/examples/widgets/checkbox/lv_example_checkbox_1.c +++ b/examples/widgets/checkbox/lv_example_checkbox_1.c @@ -17,25 +17,25 @@ static void event_handler(lv_event_t * e) void lv_example_checkbox_1(void) { - 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); diff --git a/examples/widgets/checkbox/lv_example_checkbox_1.py b/examples/widgets/checkbox/lv_example_checkbox_1.py index c91cfa8d3..e18a63e52 100644 --- a/examples/widgets/checkbox/lv_example_checkbox_1.py +++ b/examples/widgets/checkbox/lv_example_checkbox_1.py @@ -10,24 +10,24 @@ def event_handler(e): print(txt + ":" + state) -lv.scr_act().set_flex_flow(lv.FLEX_FLOW.COLUMN) -lv.scr_act().set_flex_align(lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.START, lv.FLEX_ALIGN.CENTER) +lv.screen_active().set_flex_flow(lv.FLEX_FLOW.COLUMN) +lv.screen_active().set_flex_align(lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.START, lv.FLEX_ALIGN.CENTER) -cb = lv.checkbox(lv.scr_act()) +cb = lv.checkbox(lv.screen_active()) cb.set_text("Apple") cb.add_event(event_handler, lv.EVENT.ALL, None) -cb = lv.checkbox(lv.scr_act()) +cb = lv.checkbox(lv.screen_active()) cb.set_text("Banana") cb.add_state(lv.STATE.CHECKED) cb.add_event(event_handler, lv.EVENT.ALL, None) -cb = lv.checkbox(lv.scr_act()) +cb = lv.checkbox(lv.screen_active()) cb.set_text("Lemon") cb.add_state(lv.STATE.DISABLED) cb.add_event(event_handler, lv.EVENT.ALL, None) -cb = lv.checkbox(lv.scr_act()) +cb = lv.checkbox(lv.screen_active()) cb.add_state(lv.STATE.CHECKED | lv.STATE.DISABLED) cb.set_text("Melon") cb.add_event(event_handler, lv.EVENT.ALL, None) diff --git a/examples/widgets/checkbox/lv_example_checkbox_2.c b/examples/widgets/checkbox/lv_example_checkbox_2.c index a3dd3c43e..f4f0c8297 100644 --- a/examples/widgets/checkbox/lv_example_checkbox_2.c +++ b/examples/widgets/checkbox/lv_example_checkbox_2.c @@ -16,7 +16,7 @@ static void radio_event_handler(lv_event_t * e) /*Do nothing if the container was clicked*/ if(act_cb == cont) return; - lv_obj_clear_state(old_cb, LV_STATE_CHECKED); /*Uncheck the previous radio button*/ + lv_obj_remove_state(old_cb, LV_STATE_CHECKED); /*Uncheck the previous radio button*/ lv_obj_add_state(act_cb, LV_STATE_CHECKED); /*Uncheck the current radio button*/ *active_id = lv_obj_get_index(act_cb); @@ -54,7 +54,7 @@ void lv_example_checkbox_2(void) uint32_t i; char buf[32]; - lv_obj_t * cont1 = lv_obj_create(lv_scr_act()); + lv_obj_t * cont1 = lv_obj_create(lv_screen_active()); lv_obj_set_flex_flow(cont1, LV_FLEX_FLOW_COLUMN); lv_obj_set_size(cont1, lv_pct(40), lv_pct(80)); lv_obj_add_event(cont1, radio_event_handler, LV_EVENT_CLICKED, &active_index_1); @@ -67,7 +67,7 @@ void lv_example_checkbox_2(void) /*Make the first checkbox checked*/ lv_obj_add_state(lv_obj_get_child(cont1, 0), LV_STATE_CHECKED); - lv_obj_t * cont2 = lv_obj_create(lv_scr_act()); + lv_obj_t * cont2 = lv_obj_create(lv_screen_active()); lv_obj_set_flex_flow(cont2, LV_FLEX_FLOW_COLUMN); lv_obj_set_size(cont2, lv_pct(40), lv_pct(80)); lv_obj_set_x(cont2, lv_pct(50)); diff --git a/examples/widgets/checkbox/lv_example_checkbox_2.py b/examples/widgets/checkbox/lv_example_checkbox_2.py index e146b7e1d..0ada41778 100644 --- a/examples/widgets/checkbox/lv_example_checkbox_2.py +++ b/examples/widgets/checkbox/lv_example_checkbox_2.py @@ -21,7 +21,7 @@ class LV_Example_Checkbox_2: self.style_radio_chk.init() self.style_radio_chk.set_bg_image_src(None) - self.cont1 = lv.obj(lv.scr_act()) + self.cont1 = lv.obj(lv.screen_active()) self.cont1.set_flex_flow(lv.FLEX_FLOW.COLUMN) self.cont1.set_size(lv.pct(40), lv.pct(80)) self.cont1.add_event(self.radio_event_handler, lv.EVENT.CLICKED, None) @@ -34,7 +34,7 @@ class LV_Example_Checkbox_2: #lv_obj_add_state(lv_obj_get_child(self.cont1, 0), LV_STATE_CHECKED); self.cont1.get_child(0).add_state(lv.STATE.CHECKED) - self.cont2 = lv.obj(lv.scr_act()) + self.cont2 = lv.obj(lv.screen_active()) self.cont2.set_flex_flow(lv.FLEX_FLOW.COLUMN) self.cont2.set_size(lv.pct(40), lv.pct(80)) self.cont2.set_x(lv.pct(50)) @@ -61,7 +61,7 @@ class LV_Example_Checkbox_2: if act_cb == cont: return - old_cb.clear_state(lv.STATE.CHECKED) # Uncheck the previous radio button + old_cb.remove_state(lv.STATE.CHECKED) # Uncheck the previous radio button act_cb.add_state(lv.STATE.CHECKED) # Uncheck the current radio button if cont == self.cont1: diff --git a/examples/widgets/dropdown/lv_example_dropdown_1.c b/examples/widgets/dropdown/lv_example_dropdown_1.c index d2f665cea..b3793f401 100644 --- a/examples/widgets/dropdown/lv_example_dropdown_1.c +++ b/examples/widgets/dropdown/lv_example_dropdown_1.c @@ -16,7 +16,7 @@ void lv_example_dropdown_1(void) { /*Create a normal drop down list*/ - lv_obj_t * dd = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd = lv_dropdown_create(lv_screen_active()); lv_dropdown_set_options(dd, "Apple\n" "Banana\n" "Orange\n" diff --git a/examples/widgets/dropdown/lv_example_dropdown_1.py b/examples/widgets/dropdown/lv_example_dropdown_1.py index 16337d038..e3276c3d6 100644 --- a/examples/widgets/dropdown/lv_example_dropdown_1.py +++ b/examples/widgets/dropdown/lv_example_dropdown_1.py @@ -8,7 +8,7 @@ def event_handler(e): print("Option: \"%s\"" % option.strip()) # Create a normal drop down list -dd = lv.dropdown(lv.scr_act()) +dd = lv.dropdown(lv.screen_active()) dd.set_options("\n".join([ "Apple", "Banana", diff --git a/examples/widgets/dropdown/lv_example_dropdown_2.c b/examples/widgets/dropdown/lv_example_dropdown_2.c index 77f15791e..6489d323e 100644 --- a/examples/widgets/dropdown/lv_example_dropdown_2.c +++ b/examples/widgets/dropdown/lv_example_dropdown_2.c @@ -13,23 +13,23 @@ void lv_example_dropdown_2(void) "Melon"; lv_obj_t * dd; - dd = lv_dropdown_create(lv_scr_act()); + dd = lv_dropdown_create(lv_screen_active()); lv_dropdown_set_options_static(dd, opts); lv_obj_align(dd, LV_ALIGN_TOP_MID, 0, 10); - dd = lv_dropdown_create(lv_scr_act()); + dd = lv_dropdown_create(lv_screen_active()); lv_dropdown_set_options_static(dd, opts); lv_dropdown_set_dir(dd, LV_DIR_BOTTOM); lv_dropdown_set_symbol(dd, LV_SYMBOL_UP); lv_obj_align(dd, LV_ALIGN_BOTTOM_MID, 0, -10); - dd = lv_dropdown_create(lv_scr_act()); + dd = lv_dropdown_create(lv_screen_active()); lv_dropdown_set_options_static(dd, opts); lv_dropdown_set_dir(dd, LV_DIR_RIGHT); lv_dropdown_set_symbol(dd, LV_SYMBOL_RIGHT); lv_obj_align(dd, LV_ALIGN_LEFT_MID, 10, 0); - dd = lv_dropdown_create(lv_scr_act()); + dd = lv_dropdown_create(lv_screen_active()); lv_dropdown_set_options_static(dd, opts); lv_dropdown_set_dir(dd, LV_DIR_LEFT); lv_dropdown_set_symbol(dd, LV_SYMBOL_LEFT); diff --git a/examples/widgets/dropdown/lv_example_dropdown_2.py b/examples/widgets/dropdown/lv_example_dropdown_2.py index 492711376..0024c5586 100644 --- a/examples/widgets/dropdown/lv_example_dropdown_2.py +++ b/examples/widgets/dropdown/lv_example_dropdown_2.py @@ -10,22 +10,22 @@ opts = "\n".join([ "Grape", "Raspberry"]) -dd = lv.dropdown(lv.scr_act()) +dd = lv.dropdown(lv.screen_active()) dd.set_options_static(opts) dd.align(lv.ALIGN.TOP_MID, 0, 10) -dd = lv.dropdown(lv.scr_act()) +dd = lv.dropdown(lv.screen_active()) dd.set_options_static(opts) dd.set_dir(lv.DIR.BOTTOM) dd.set_symbol(lv.SYMBOL.UP) dd.align(lv.ALIGN.BOTTOM_MID, 0, -10) -dd = lv.dropdown(lv.scr_act()) +dd = lv.dropdown(lv.screen_active()) dd.set_options_static(opts) dd.set_dir(lv.DIR.RIGHT) dd.set_symbol(lv.SYMBOL.RIGHT) dd.align(lv.ALIGN.LEFT_MID, 10, 0) -dd = lv.dropdown(lv.scr_act()) +dd = lv.dropdown(lv.screen_active()) dd.set_options_static(opts) dd.set_dir(lv.DIR.LEFT) dd.set_symbol(lv.SYMBOL.LEFT) diff --git a/examples/widgets/dropdown/lv_example_dropdown_3.c b/examples/widgets/dropdown/lv_example_dropdown_3.c index 3d19d612b..e4d104887 100644 --- a/examples/widgets/dropdown/lv_example_dropdown_3.c +++ b/examples/widgets/dropdown/lv_example_dropdown_3.c @@ -15,7 +15,7 @@ static void event_cb(lv_event_t * e) void lv_example_dropdown_3(void) { /*Create a drop down list*/ - lv_obj_t * dropdown = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dropdown = lv_dropdown_create(lv_screen_active()); lv_obj_align(dropdown, LV_ALIGN_TOP_LEFT, 10, 10); lv_dropdown_set_options(dropdown, "New project\n" "New file\n" diff --git a/examples/widgets/dropdown/lv_example_dropdown_3.py b/examples/widgets/dropdown/lv_example_dropdown_3.py index 90ef15630..a5b45b250 100644 --- a/examples/widgets/dropdown/lv_example_dropdown_3.py +++ b/examples/widgets/dropdown/lv_example_dropdown_3.py @@ -21,7 +21,7 @@ def event_cb(e): # # Create a drop down list -dropdown = lv.dropdown(lv.scr_act()) +dropdown = lv.dropdown(lv.screen_active()) dropdown.align(lv.ALIGN.TOP_LEFT, 10, 10) dropdown.set_options("\n".join([ "New project", diff --git a/examples/widgets/img/lv_example_img_1.c b/examples/widgets/img/lv_example_img_1.c index 758def21d..ebb51a2f2 100644 --- a/examples/widgets/img/lv_example_img_1.c +++ b/examples/widgets/img/lv_example_img_1.c @@ -5,12 +5,12 @@ void lv_example_image_1(void) { LV_IMAGE_DECLARE(img_cogwheel_argb); - lv_obj_t * img1 = lv_image_create(lv_scr_act()); + lv_obj_t * img1 = lv_image_create(lv_screen_active()); lv_image_set_src(img1, &img_cogwheel_argb); lv_obj_align(img1, LV_ALIGN_CENTER, 0, -20); lv_obj_set_size(img1, 200, 200); - lv_obj_t * img2 = lv_image_create(lv_scr_act()); + lv_obj_t * img2 = lv_image_create(lv_screen_active()); lv_image_set_src(img2, LV_SYMBOL_OK "Accept"); lv_obj_align_to(img2, img1, LV_ALIGN_OUT_BOTTOM_MID, 0, 20); } diff --git a/examples/widgets/img/lv_example_img_1.py b/examples/widgets/img/lv_example_img_1.py index 4897fdf0e..9e064e44f 100644 --- a/examples/widgets/img/lv_example_img_1.py +++ b/examples/widgets/img/lv_example_img_1.py @@ -16,11 +16,11 @@ image_cogwheel_argb = lv.image_dsc_t({ 'data': png_data }) -image1 = lv.image(lv.scr_act()) +image1 = lv.image(lv.screen_active()) image1.set_src(image_cogwheel_argb) image1.align(lv.ALIGN.CENTER, 0, -20) image1.set_size(200, 200) -image2 = lv.image(lv.scr_act()) +image2 = lv.image(lv.screen_active()) image2.set_src(lv.SYMBOL.OK + "Accept") image2.align_to(image1, lv.ALIGN.OUT_BOTTOM_MID, 0, 20) diff --git a/examples/widgets/img/lv_example_img_2.c b/examples/widgets/img/lv_example_img_2.c index 3e60540c4..45077955a 100644 --- a/examples/widgets/img/lv_example_img_2.c +++ b/examples/widgets/img/lv_example_img_2.c @@ -31,7 +31,7 @@ void lv_example_image_2(void) /*Now create the actual image*/ LV_IMAGE_DECLARE(img_cogwheel_argb) - img1 = lv_image_create(lv_scr_act()); + img1 = lv_image_create(lv_screen_active()); lv_image_set_src(img1, &img_cogwheel_argb); lv_obj_align(img1, LV_ALIGN_RIGHT_MID, -20, 0); @@ -52,7 +52,7 @@ static void slider_event_cb(lv_event_t * e) static lv_obj_t * create_slider(lv_color_t color) { - lv_obj_t * slider = lv_slider_create(lv_scr_act()); + lv_obj_t * slider = lv_slider_create(lv_screen_active()); lv_slider_set_range(slider, 0, 255); lv_obj_set_size(slider, 10, 200); lv_obj_set_style_bg_color(slider, color, LV_PART_KNOB); diff --git a/examples/widgets/img/lv_example_img_2.py b/examples/widgets/img/lv_example_img_2.py index 9a8c6d65b..99ebedd97 100644 --- a/examples/widgets/img/lv_example_img_2.py +++ b/examples/widgets/img/lv_example_img_2.py @@ -17,7 +17,7 @@ image_cogwheel_argb = lv.image_dsc_t({ }) def create_slider(color): - slider = lv.slider(lv.scr_act()) + slider = lv.slider(lv.screen_active()) slider.set_range(0, 255) slider.set_size(10, 200) slider.set_style_bg_color(color, lv.PART.KNOB) @@ -52,7 +52,7 @@ blue_slider.align_to(green_slider, lv.ALIGN.OUT_RIGHT_MID, 25, 0) intense_slider.align_to(blue_slider, lv.ALIGN.OUT_RIGHT_MID, 25, 0) # Now create the actual image -image1 = lv.image(lv.scr_act()) +image1 = lv.image(lv.screen_active()) image1.set_src(image_cogwheel_argb) image1.align(lv.ALIGN.RIGHT_MID, -20, 0) diff --git a/examples/widgets/img/lv_example_img_3.c b/examples/widgets/img/lv_example_img_3.c index ba2a0181e..9b3a53842 100644 --- a/examples/widgets/img/lv_example_img_3.c +++ b/examples/widgets/img/lv_example_img_3.c @@ -20,7 +20,7 @@ void lv_example_image_3(void) LV_IMAGE_DECLARE(img_cogwheel_argb); /*Now create the actual image*/ - lv_obj_t * img = lv_image_create(lv_scr_act()); + lv_obj_t * img = lv_image_create(lv_screen_active()); lv_image_set_src(img, &img_cogwheel_argb); lv_obj_align(img, LV_ALIGN_CENTER, 50, 50); lv_image_set_pivot(img, 0, 0); /*Rotate around the top left corner*/ diff --git a/examples/widgets/img/lv_example_img_3.py b/examples/widgets/img/lv_example_img_3.py index 5b17894c0..61602c425 100644 --- a/examples/widgets/img/lv_example_img_3.py +++ b/examples/widgets/img/lv_example_img_3.py @@ -28,7 +28,7 @@ def set_zoom(image, v): # # Now create the actual image -image = lv.image(lv.scr_act()) +image = lv.image(lv.screen_active()) image.set_src(image_cogwheel_argb) image.align(lv.ALIGN.CENTER, 50, 50) image.set_pivot(0, 0) # Rotate around the top left corner diff --git a/examples/widgets/img/lv_example_img_4.c b/examples/widgets/img/lv_example_img_4.c index 5081f8637..c34e031b4 100644 --- a/examples/widgets/img/lv_example_img_4.c +++ b/examples/widgets/img/lv_example_img_4.c @@ -20,7 +20,7 @@ void lv_example_image_4(void) lv_style_set_image_recolor_opa(&style, LV_OPA_COVER); lv_style_set_image_recolor(&style, lv_color_black()); - lv_obj_t * img = lv_image_create(lv_scr_act()); + lv_obj_t * img = lv_image_create(lv_screen_active()); lv_obj_add_style(img, &style, 0); lv_image_set_src(img, &img_skew_strip); lv_obj_set_size(img, 150, 100); diff --git a/examples/widgets/img/lv_example_img_4.py b/examples/widgets/img/lv_example_img_4.py index 477c52786..4b75cf897 100644 --- a/examples/widgets/img/lv_example_img_4.py +++ b/examples/widgets/img/lv_example_img_4.py @@ -27,7 +27,7 @@ style.set_bg_opa(lv.OPA.COVER) style.set_image_recolor_opa(lv.OPA.COVER) style.set_image_recolor(lv.color_black()) -image = lv.image(lv.scr_act()) +image = lv.image(lv.screen_active()) image.add_style(style, 0) image.set_src(image_skew_strip) image.set_size(150, 100) diff --git a/examples/widgets/imgbtn/lv_example_imgbtn_1.c b/examples/widgets/imgbtn/lv_example_imgbtn_1.c index 982a602e7..50f715fe7 100644 --- a/examples/widgets/imgbtn/lv_example_imgbtn_1.c +++ b/examples/widgets/imgbtn/lv_example_imgbtn_1.c @@ -25,7 +25,7 @@ void lv_example_imgbtn_1(void) lv_style_set_transform_width(&style_pr, 20); /*Create an image button*/ - lv_obj_t * imgbtn1 = lv_imgbtn_create(lv_scr_act()); + lv_obj_t * imgbtn1 = lv_imgbtn_create(lv_screen_active()); lv_imgbtn_set_src(imgbtn1, LV_IMGBTN_STATE_RELEASED, &imgbtn_left, &imgbtn_mid, &imgbtn_right); lv_obj_add_style(imgbtn1, &style_def, 0); lv_obj_add_style(imgbtn1, &style_pr, LV_STATE_PRESSED); diff --git a/examples/widgets/imgbtn/lv_example_imgbtn_1.py b/examples/widgets/imgbtn/lv_example_imgbtn_1.py index 8f0de2166..424261f63 100644 --- a/examples/widgets/imgbtn/lv_example_imgbtn_1.py +++ b/examples/widgets/imgbtn/lv_example_imgbtn_1.py @@ -53,7 +53,7 @@ style_pr.set_image_recolor(lv.color_black()) style_pr.set_transform_width(20) # Create an image button -imgbtn1 = lv.imgbtn(lv.scr_act()) +imgbtn1 = lv.imgbtn(lv.screen_active()) imgbtn1.set_src(lv.imgbtn.STATE.RELEASED, imgbtn_left_dsc, imgbtn_mid_dsc, imgbtn_right_dsc) imgbtn1.add_style(style_def, 0) imgbtn1.add_style(style_pr, lv.STATE.PRESSED) diff --git a/examples/widgets/keyboard/lv_example_keyboard_1.c b/examples/widgets/keyboard/lv_example_keyboard_1.c index 6aa7eb062..ca511f580 100644 --- a/examples/widgets/keyboard/lv_example_keyboard_1.c +++ b/examples/widgets/keyboard/lv_example_keyboard_1.c @@ -8,7 +8,7 @@ static void ta_event_cb(lv_event_t * e) lv_obj_t * kb = lv_event_get_user_data(e); if(code == LV_EVENT_FOCUSED) { lv_keyboard_set_textarea(kb, ta); - lv_obj_clear_flag(kb, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(kb, LV_OBJ_FLAG_HIDDEN); } if(code == LV_EVENT_DEFOCUSED) { @@ -20,17 +20,17 @@ static void ta_event_cb(lv_event_t * e) void lv_example_keyboard_1(void) { /*Create a keyboard to use it with an of the text areas*/ - lv_obj_t * kb = lv_keyboard_create(lv_scr_act()); + lv_obj_t * kb = lv_keyboard_create(lv_screen_active()); /*Create a text area. The keyboard will write here*/ lv_obj_t * ta; - ta = lv_textarea_create(lv_scr_act()); + ta = lv_textarea_create(lv_screen_active()); lv_obj_align(ta, LV_ALIGN_TOP_LEFT, 10, 10); lv_obj_add_event(ta, ta_event_cb, LV_EVENT_ALL, kb); lv_textarea_set_placeholder_text(ta, "Hello"); lv_obj_set_size(ta, 140, 80); - ta = lv_textarea_create(lv_scr_act()); + ta = lv_textarea_create(lv_screen_active()); lv_obj_align(ta, LV_ALIGN_TOP_RIGHT, -10, 10); lv_obj_add_event(ta, ta_event_cb, LV_EVENT_ALL, kb); lv_obj_set_size(ta, 140, 80); diff --git a/examples/widgets/keyboard/lv_example_keyboard_1.py b/examples/widgets/keyboard/lv_example_keyboard_1.py index 853b42014..064875143 100644 --- a/examples/widgets/keyboard/lv_example_keyboard_1.py +++ b/examples/widgets/keyboard/lv_example_keyboard_1.py @@ -3,23 +3,23 @@ def ta_event_cb(e,kb): ta = e.get_target_obj() if code == lv.EVENT.FOCUSED: kb.set_textarea(ta) - kb.clear_flag(lv.obj.FLAG.HIDDEN) + kb.remove_flag(lv.obj.FLAG.HIDDEN) if code == lv.EVENT.DEFOCUSED: kb.set_textarea(None) kb.add_flag(lv.obj.FLAG.HIDDEN) # Create a keyboard to use it with one of the text areas -kb = lv.keyboard(lv.scr_act()) +kb = lv.keyboard(lv.screen_active()) # Create a text area. The keyboard will write here -ta = lv.textarea(lv.scr_act()) +ta = lv.textarea(lv.screen_active()) ta.set_width(200) ta.align(lv.ALIGN.TOP_LEFT, 10, 10) ta.add_event(lambda e: ta_event_cb(e,kb), lv.EVENT.ALL, None) ta.set_placeholder_text("Hello") -ta = lv.textarea(lv.scr_act()) +ta = lv.textarea(lv.screen_active()) ta.set_width(200) ta.align(lv.ALIGN.TOP_RIGHT, -10, 10) ta.add_event(lambda e: ta_event_cb(e,kb), lv.EVENT.ALL, None) diff --git a/examples/widgets/keyboard/lv_example_keyboard_2.c b/examples/widgets/keyboard/lv_example_keyboard_2.c index 10f8a72ae..ff2686413 100644 --- a/examples/widgets/keyboard/lv_example_keyboard_2.c +++ b/examples/widgets/keyboard/lv_example_keyboard_2.c @@ -18,14 +18,14 @@ void lv_example_keyboard_2(void) }; /*Create a keyboard and add the new map as USER_1 mode*/ - lv_obj_t * kb = lv_keyboard_create(lv_scr_act()); + lv_obj_t * kb = lv_keyboard_create(lv_screen_active()); lv_keyboard_set_map(kb, LV_KEYBOARD_MODE_USER_1, kb_map, kb_ctrl); lv_keyboard_set_mode(kb, LV_KEYBOARD_MODE_USER_1); /*Create a text area. The keyboard will write here*/ lv_obj_t * ta; - ta = lv_textarea_create(lv_scr_act()); + ta = lv_textarea_create(lv_screen_active()); lv_obj_align(ta, LV_ALIGN_TOP_MID, 0, 10); lv_obj_set_size(ta, lv_pct(90), 80); lv_obj_add_state(ta, LV_STATE_FOCUSED); diff --git a/examples/widgets/keyboard/lv_example_keyboard_2.py b/examples/widgets/keyboard/lv_example_keyboard_2.py index 54858c39b..32365557b 100644 --- a/examples/widgets/keyboard/lv_example_keyboard_2.py +++ b/examples/widgets/keyboard/lv_example_keyboard_2.py @@ -11,13 +11,13 @@ kb_ctrl = [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 2, lv.buttonmatrix.CTRL.HIDDEN | 2, 6, lv.buttonmatrix.CTRL.HIDDEN | 2, 2] # Create a keyboard and add the new map as USER_1 mode -kb = lv.keyboard(lv.scr_act()) +kb = lv.keyboard(lv.screen_active()) kb.set_map(lv.keyboard.MODE.USER_1, kb_map, kb_ctrl) kb.set_mode(lv.keyboard.MODE.USER_1) # Create a text area. The keyboard will write here -ta = lv.textarea(lv.scr_act()) +ta = lv.textarea(lv.screen_active()) ta.align(lv.ALIGN.TOP_MID, 0, 10) ta.set_size(lv.pct(90), 80) ta.add_state(lv.STATE.FOCUSED) diff --git a/examples/widgets/label/lv_example_label_1.c b/examples/widgets/label/lv_example_label_1.c index 886cd4a7b..821abdbf0 100644 --- a/examples/widgets/label/lv_example_label_1.c +++ b/examples/widgets/label/lv_example_label_1.c @@ -6,7 +6,7 @@ */ void lv_example_label_1(void) { - lv_obj_t * label1 = lv_label_create(lv_scr_act()); + lv_obj_t * label1 = lv_label_create(lv_screen_active()); lv_label_set_long_mode(label1, LV_LABEL_LONG_WRAP); /*Break the long lines*/ lv_label_set_recolor(label1, true); /*Enable re-coloring by commands in the text*/ lv_label_set_text(label1, "#0000ff Re-color# #ff00ff words# #ff0000 of a# label, align the lines to the center " @@ -15,7 +15,7 @@ void lv_example_label_1(void) lv_obj_set_style_text_align(label1, LV_TEXT_ALIGN_CENTER, 0); lv_obj_align(label1, LV_ALIGN_CENTER, 0, -40); - lv_obj_t * label2 = lv_label_create(lv_scr_act()); + lv_obj_t * label2 = lv_label_create(lv_screen_active()); lv_label_set_long_mode(label2, LV_LABEL_LONG_SCROLL_CIRCULAR); /*Circular scroll*/ lv_obj_set_width(label2, 150); lv_label_set_text(label2, "It is a circularly scrolling text. "); diff --git a/examples/widgets/label/lv_example_label_1.py b/examples/widgets/label/lv_example_label_1.py index 2cc49825d..254f48bc1 100644 --- a/examples/widgets/label/lv_example_label_1.py +++ b/examples/widgets/label/lv_example_label_1.py @@ -6,7 +6,7 @@ import display_driver # # Show line wrap, re-color, line align and text scrolling. # -label1 = lv.label(lv.scr_act()) +label1 = lv.label(lv.screen_active()) label1.set_long_mode(lv.label.LONG.WRAP) # Break the long lines*/ label1.set_recolor(True) # Enable re-coloring by commands in the text label1.set_text("#0000ff Re-color# #ff00ff words# #ff0000 of a# label, align the lines to the center " @@ -16,7 +16,7 @@ label1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) label1.align(lv.ALIGN.CENTER, 0, -40) -label2 = lv.label(lv.scr_act()) +label2 = lv.label(lv.screen_active()) label2.set_long_mode(lv.label.LONG.SCROLL_CIRCULAR) # Circular scroll label2.set_width(150) label2.set_text("It is a circularly scrolling text. ") diff --git a/examples/widgets/label/lv_example_label_2.c b/examples/widgets/label/lv_example_label_2.c index 0b605cf2a..c85a7b864 100644 --- a/examples/widgets/label/lv_example_label_2.c +++ b/examples/widgets/label/lv_example_label_2.c @@ -13,11 +13,11 @@ void lv_example_label_2(void) lv_style_set_text_color(&style_shadow, lv_color_black()); /*Create a label for the shadow first (it's in the background)*/ - lv_obj_t * shadow_label = lv_label_create(lv_scr_act()); + lv_obj_t * shadow_label = lv_label_create(lv_screen_active()); lv_obj_add_style(shadow_label, &style_shadow, 0); /*Create the main label*/ - lv_obj_t * main_label = lv_label_create(lv_scr_act()); + lv_obj_t * main_label = lv_label_create(lv_screen_active()); lv_label_set_text(main_label, "A simple method to create\n" "shadows on a text.\n" "It even works with\n\n" diff --git a/examples/widgets/label/lv_example_label_2.py b/examples/widgets/label/lv_example_label_2.py index d252f2563..da8924a26 100644 --- a/examples/widgets/label/lv_example_label_2.py +++ b/examples/widgets/label/lv_example_label_2.py @@ -9,11 +9,11 @@ style_shadow.set_text_opa(lv.OPA._30) style_shadow.set_text_color(lv.color_black()) # Create a label for the shadow first (it's in the background) -shadow_label = lv.label(lv.scr_act()) +shadow_label = lv.label(lv.screen_active()) shadow_label.add_style(style_shadow, 0) # Create the main label -main_label = lv.label(lv.scr_act()) +main_label = lv.label(lv.screen_active()) main_label.set_text("A simple method to create\n" "shadows on a text.\n" "It even works with\n\n" diff --git a/examples/widgets/label/lv_example_label_3.c b/examples/widgets/label/lv_example_label_3.c index 680d88fe3..730b41ed3 100644 --- a/examples/widgets/label/lv_example_label_3.c +++ b/examples/widgets/label/lv_example_label_3.c @@ -6,13 +6,13 @@ */ void lv_example_label_3(void) { - 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); @@ -20,7 +20,7 @@ void lv_example_label_3(void) 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/examples/widgets/label/lv_example_label_3.py b/examples/widgets/label/lv_example_label_3.py index 205154100..c43d39c26 100644 --- a/examples/widgets/label/lv_example_label_3.py +++ b/examples/widgets/label/lv_example_label_3.py @@ -3,7 +3,7 @@ import fs_driver # Show mixed LTR, RTL and Chinese label # -ltr_label = lv.label(lv.scr_act()) +ltr_label = lv.label(lv.screen_active()) ltr_label.set_text("In modern terminology, a microcontroller is similar to a system on a chip (SoC).") # ltr_label.set_style_text_font(ltr_label, &lv_font_montserrat_16, 0); @@ -16,7 +16,7 @@ except: fs_drv = lv.fs_drv_t() fs_driver.fs_register(fs_drv, 'S') print("montserrat-16 not enabled in lv_conf.h, dynamically loading the font") - + # get the directory in which the script is running try: script_path = __file__[:__file__.rfind('/')] if __file__.find('/') >= 0 else '.' @@ -26,14 +26,14 @@ except: if script_path != '': try: font_montserrat_16 = lv.font_load("S:" + script_path + "/../../assets/font/montserrat-16.fnt") - ltr_label.set_style_text_font(font_montserrat_16,0) + ltr_label.set_style_text_font(font_montserrat_16,0) except: print("Cannot load font file montserrat-16.fnt") ltr_label.set_width(310) ltr_label.align(lv.ALIGN.TOP_LEFT, 5, 5) -rtl_label = lv.label(lv.scr_act()) +rtl_label = lv.label(lv.screen_active()) rtl_label.set_text("מעבד, או בשמו המלא יחידת עיבוד מרכזית (באנגלית: CPU - Central Processing Unit).") rtl_label.set_style_base_dir(lv.BASE_DIR.RTL, 0) rtl_label.set_style_text_font(lv.font_dejavu_16_persian_hebrew, 0) @@ -42,7 +42,7 @@ rtl_label.align(lv.ALIGN.LEFT_MID, 5, 0) font_simsun_16_cjk = lv.font_load("S:../../assets/font/lv_font_simsun_16_cjk.fnt") -cz_label = lv.label(lv.scr_act()) +cz_label = lv.label(lv.screen_active()) cz_label.set_style_text_font(font_simsun_16_cjk, 0) cz_label.set_text("嵌入式系统(Embedded System),\n是一种嵌入机械或电气系统内部、具有专一功能和实时计算性能的计算机系统。") cz_label.set_width(310) diff --git a/examples/widgets/label/lv_example_label_4.c b/examples/widgets/label/lv_example_label_4.c index c129a4207..31ea94773 100644 --- a/examples/widgets/label/lv_example_label_4.c +++ b/examples/widgets/label/lv_example_label_4.c @@ -36,7 +36,7 @@ void lv_example_label_4(void) static lv_color_t mask_map[MASK_WIDTH * MASK_HEIGHT]; /*Create a "8 bit alpha" canvas and clear it*/ - lv_obj_t * canvas = lv_canvas_create(lv_scr_act()); + lv_obj_t * canvas = lv_canvas_create(lv_screen_active()); lv_canvas_set_buffer(canvas, mask_map, MASK_WIDTH, MASK_HEIGHT, LV_COLOR_FORMAT_NATIVE); lv_canvas_fill_bg(canvas, lv_color_black(), LV_OPA_TRANSP); @@ -49,7 +49,7 @@ void lv_example_label_4(void) lv_canvas_draw_text(canvas, 5, 5, MASK_WIDTH, &label_dsc); /*The mask is reads the canvas is not required anymore*/ - lv_obj_del(canvas); + lv_obj_delete(canvas); /*Convert the mask to A8*/ uint32_t i; @@ -61,7 +61,7 @@ void lv_example_label_4(void) /* Create an object from where the text will be masked out. * Now it's a rectangle with a gradient but it could be an image too*/ - lv_obj_t * grad = lv_obj_create(lv_scr_act()); + lv_obj_t * grad = lv_obj_create(lv_screen_active()); lv_obj_set_size(grad, MASK_WIDTH, MASK_HEIGHT); lv_obj_center(grad); lv_obj_set_style_bg_color(grad, lv_color_hex(0xff0000), 0); diff --git a/examples/widgets/label/lv_example_label_5.c b/examples/widgets/label/lv_example_label_5.c index c190df695..1cf988943 100644 --- a/examples/widgets/label/lv_example_label_5.c +++ b/examples/widgets/label/lv_example_label_5.c @@ -19,7 +19,7 @@ void lv_example_label_5(void) lv_style_init(&label_style); lv_style_set_anim(&label_style, &animation_template); - lv_obj_t * label1 = lv_label_create(lv_scr_act()); + lv_obj_t * label1 = lv_label_create(lv_screen_active()); lv_label_set_long_mode(label1, LV_LABEL_LONG_SCROLL_CIRCULAR); /*Circular scroll*/ lv_obj_set_width(label1, 150); lv_label_set_text(label1, "It is a circularly scrolling text. "); diff --git a/examples/widgets/label/lv_example_label_5.py b/examples/widgets/label/lv_example_label_5.py index 817d53e32..cd7e8e9b1 100644 --- a/examples/widgets/label/lv_example_label_5.py +++ b/examples/widgets/label/lv_example_label_5.py @@ -2,7 +2,7 @@ # Show customizing the circular scrolling animation of a label with `LV_LABEL_LONG_SCROLL_CIRCULAR` long mode. # -label1 = lv.label(lv.scr_act()) +label1 = lv.label(lv.screen_active()) label1.set_long_mode(lv.label.LONG.SCROLL_CIRCULAR) # Circular scroll label1.set_width(150) label1.set_text("It is a circularly scrolling text. ") diff --git a/examples/widgets/led/lv_example_led_1.c b/examples/widgets/led/lv_example_led_1.c index f06f31ef2..2e7ad93ea 100644 --- a/examples/widgets/led/lv_example_led_1.c +++ b/examples/widgets/led/lv_example_led_1.c @@ -7,18 +7,18 @@ void lv_example_led_1(void) { /*Create a LED and switch it OFF*/ - lv_obj_t * led1 = lv_led_create(lv_scr_act()); + lv_obj_t * led1 = lv_led_create(lv_screen_active()); lv_obj_align(led1, LV_ALIGN_CENTER, -80, 0); lv_led_off(led1); /*Copy the previous LED and set a brightness*/ - lv_obj_t * led2 = lv_led_create(lv_scr_act()); + lv_obj_t * led2 = lv_led_create(lv_screen_active()); lv_obj_align(led2, LV_ALIGN_CENTER, 0, 0); lv_led_set_brightness(led2, 150); lv_led_set_color(led2, lv_palette_main(LV_PALETTE_RED)); /*Copy the previous LED and switch it ON*/ - lv_obj_t * led3 = lv_led_create(lv_scr_act()); + lv_obj_t * led3 = lv_led_create(lv_screen_active()); lv_obj_align(led3, LV_ALIGN_CENTER, 80, 0); lv_led_on(led3); } diff --git a/examples/widgets/led/lv_example_led_1.py b/examples/widgets/led/lv_example_led_1.py index 5e1b1267e..e265289a1 100644 --- a/examples/widgets/led/lv_example_led_1.py +++ b/examples/widgets/led/lv_example_led_1.py @@ -3,18 +3,18 @@ # # Create a LED and switch it OFF -led1 = lv.led(lv.scr_act()) +led1 = lv.led(lv.screen_active()) led1.align(lv.ALIGN.CENTER, -80, 0) led1.off() # Copy the previous LED and set a brightness -led2 = lv.led(lv.scr_act()) +led2 = lv.led(lv.screen_active()) led2.align(lv.ALIGN.CENTER, 0, 0) led2.set_brightness(150) led2.set_color(lv.palette_main(lv.PALETTE.RED)) # Copy the previous LED and switch it ON -led3 = lv.led(lv.scr_act()) +led3 = lv.led(lv.screen_active()) led3.align(lv.ALIGN.CENTER, 80, 0) led3.on() diff --git a/examples/widgets/line/lv_example_line_1.c b/examples/widgets/line/lv_example_line_1.c index 9c120a293..d9b2c58b9 100644 --- a/examples/widgets/line/lv_example_line_1.c +++ b/examples/widgets/line/lv_example_line_1.c @@ -15,7 +15,7 @@ void lv_example_line_1(void) /*Create a line and apply the new style*/ lv_obj_t * line1; - line1 = lv_line_create(lv_scr_act()); + line1 = lv_line_create(lv_screen_active()); lv_line_set_points(line1, line_points, 5); /*Set the points*/ lv_obj_add_style(line1, &style_line, 0); lv_obj_center(line1); diff --git a/examples/widgets/line/lv_example_line_1.py b/examples/widgets/line/lv_example_line_1.py index 3a5822ffe..945f8d5c3 100644 --- a/examples/widgets/line/lv_example_line_1.py +++ b/examples/widgets/line/lv_example_line_1.py @@ -13,7 +13,7 @@ style_line.set_line_color(lv.palette_main(lv.PALETTE.BLUE)) style_line.set_line_rounded(True) # Create a line and apply the new style -line1 = lv.line(lv.scr_act()) +line1 = lv.line(lv.screen_active()) line1.set_points(line_points, 5) # Set the points line1.add_style(style_line, 0) line1.center() diff --git a/examples/widgets/list/lv_example_list_1.c b/examples/widgets/list/lv_example_list_1.c index cb6c1cc6d..1d0c406ab 100644 --- a/examples/widgets/list/lv_example_list_1.c +++ b/examples/widgets/list/lv_example_list_1.c @@ -14,7 +14,7 @@ static void event_handler(lv_event_t * e) void lv_example_list_1(void) { /*Create a list*/ - list1 = lv_list_create(lv_scr_act()); + list1 = lv_list_create(lv_screen_active()); lv_obj_set_size(list1, 180, 220); lv_obj_center(list1); diff --git a/examples/widgets/list/lv_example_list_1.py b/examples/widgets/list/lv_example_list_1.py index 11bdee17c..c1826bf30 100644 --- a/examples/widgets/list/lv_example_list_1.py +++ b/examples/widgets/list/lv_example_list_1.py @@ -5,7 +5,7 @@ def event_handler(e): print("Clicked: list1." + list1.get_button_text(obj)) # Create a list -list1 = lv.list(lv.scr_act()) +list1 = lv.list(lv.screen_active()) list1.set_size(180, 220) list1.center() diff --git a/examples/widgets/list/lv_example_list_2.c b/examples/widgets/list/lv_example_list_2.c index 1ab15b834..0b5fa0a57 100644 --- a/examples/widgets/list/lv_example_list_2.c +++ b/examples/widgets/list/lv_example_list_2.c @@ -30,7 +30,7 @@ static void event_handler(lv_event_t * e) lv_obj_add_state(child, LV_STATE_CHECKED); } else { - lv_obj_clear_state(child, LV_STATE_CHECKED); + lv_obj_remove_state(child, LV_STATE_CHECKED); } } } @@ -115,7 +115,7 @@ static void event_handler_swap(lv_event_t * e) void lv_example_list_2(void) { /*Create a list*/ - list1 = lv_list_create(lv_scr_act()); + list1 = lv_list_create(lv_screen_active()); lv_obj_set_size(list1, lv_pct(60), lv_pct(100)); lv_obj_set_style_pad_row(list1, 5, 0); @@ -136,7 +136,7 @@ void lv_example_list_2(void) lv_obj_add_state(currentButton, LV_STATE_CHECKED); /*Create a second list with up and down buttons*/ - list2 = lv_list_create(lv_scr_act()); + list2 = lv_list_create(lv_screen_active()); lv_obj_set_size(list2, lv_pct(40), lv_pct(100)); lv_obj_align(list2, LV_ALIGN_TOP_RIGHT, 0, 0); lv_obj_set_flex_flow(list2, LV_FLEX_FLOW_COLUMN); diff --git a/examples/widgets/list/lv_example_list_2.py b/examples/widgets/list/lv_example_list_2.py index 78013572d..10696e2e0 100644 --- a/examples/widgets/list/lv_example_list_2.py +++ b/examples/widgets/list/lv_example_list_2.py @@ -18,7 +18,7 @@ def event_handler(e): if child == currentButton: child.add_state(lv.STATE.CHECKED) else: - child.clear_state(lv.STATE.CHECKED) + child.remove_state(lv.STATE.CHECKED) def event_handler_top(e): global currentButton @@ -91,7 +91,7 @@ def event_handler_swap(e): currentButton.scroll_to_view(lv.ANIM.ON) #Create a list with buttons that can be sorted -list1 = lv.list(lv.scr_act()) +list1 = lv.list(lv.screen_active()) list1.set_size(lv.pct(60), lv.pct(100)) list1.set_style_pad_row( 5, 0) @@ -107,7 +107,7 @@ currentButton = list1.get_child(0) currentButton.add_state(lv.STATE.CHECKED) #Create a second list with up and down buttons -list2 = lv.list(lv.scr_act()) +list2 = lv.list(lv.screen_active()) list2.set_size(lv.pct(40), lv.pct(100)) list2.align(lv.ALIGN.TOP_RIGHT, 0, 0) list2.set_flex_flow(lv.FLEX_FLOW.COLUMN) diff --git a/examples/widgets/list/test.py b/examples/widgets/list/test.py index f1dd3c179..f69e1012b 100755 --- a/examples/widgets/list/test.py +++ b/examples/widgets/list/test.py @@ -8,7 +8,7 @@ def event_handler(e): print("Clicked: list1." + list1.get_button_text(obj)) # Create a list -list1 = lv.list(lv.scr_act()) +list1 = lv.list(lv.screen_active()) list1.set_size(180, 220) list1.center() diff --git a/examples/widgets/menu/lv_example_menu_1.c b/examples/widgets/menu/lv_example_menu_1.c index f963d6d5b..7edbcae78 100644 --- a/examples/widgets/menu/lv_example_menu_1.c +++ b/examples/widgets/menu/lv_example_menu_1.c @@ -4,7 +4,7 @@ void lv_example_menu_1(void) { /*Create a menu object*/ - lv_obj_t * menu = lv_menu_create(lv_scr_act()); + lv_obj_t * menu = lv_menu_create(lv_screen_active()); lv_obj_set_size(menu, lv_display_get_horizontal_resolution(NULL), lv_display_get_vertical_resolution(NULL)); lv_obj_center(menu); diff --git a/examples/widgets/menu/lv_example_menu_1.py b/examples/widgets/menu/lv_example_menu_1.py index 1f8c81285..f9565806c 100644 --- a/examples/widgets/menu/lv_example_menu_1.py +++ b/examples/widgets/menu/lv_example_menu_1.py @@ -1,5 +1,5 @@ # Create a menu object -menu = lv.menu(lv.scr_act()) +menu = lv.menu(lv.screen_active()) menu.set_size(320, 240) menu.center() diff --git a/examples/widgets/menu/lv_example_menu_2.c b/examples/widgets/menu/lv_example_menu_2.c index 373646b41..94edc286c 100644 --- a/examples/widgets/menu/lv_example_menu_2.c +++ b/examples/widgets/menu/lv_example_menu_2.c @@ -14,7 +14,7 @@ static void back_event_handler(lv_event_t * e) void lv_example_menu_2(void) { - lv_obj_t * menu = lv_menu_create(lv_scr_act()); + lv_obj_t * menu = lv_menu_create(lv_screen_active()); lv_menu_set_mode_root_back_button(menu, LV_MENU_ROOT_BACK_BUTTON_ENABLED); lv_obj_add_event(menu, back_event_handler, LV_EVENT_CLICKED, menu); lv_obj_set_size(menu, lv_display_get_horizontal_resolution(NULL), lv_display_get_vertical_resolution(NULL)); diff --git a/examples/widgets/menu/lv_example_menu_2.py b/examples/widgets/menu/lv_example_menu_2.py index 421916203..ade711db5 100644 --- a/examples/widgets/menu/lv_example_menu_2.py +++ b/examples/widgets/menu/lv_example_menu_2.py @@ -1,11 +1,11 @@ def back_event_handler(e): obj = e.get_target_obj() if menu.back_button_is_root(obj): - mbox1 = lv.msgbox(lv.scr_act(), "Hello", "Root back button click.", None, True) + mbox1 = lv.msgbox(lv.screen_active(), "Hello", "Root back button click.", None, True) mbox1.center() # Create a menu object -menu = lv.menu(lv.scr_act()) +menu = lv.menu(lv.screen_active()) menu.set_mode_root_back_button(lv.menu.ROOT_BACK_BUTTON.ENABLED) menu.add_event(back_event_handler, lv.EVENT.CLICKED, None) menu.set_size(320, 240) diff --git a/examples/widgets/menu/lv_example_menu_3.c b/examples/widgets/menu/lv_example_menu_3.c index fd33057a1..f4210a89e 100644 --- a/examples/widgets/menu/lv_example_menu_3.c +++ b/examples/widgets/menu/lv_example_menu_3.c @@ -4,7 +4,7 @@ void lv_example_menu_3(void) { /*Create a menu object*/ - lv_obj_t * menu = lv_menu_create(lv_scr_act()); + lv_obj_t * menu = lv_menu_create(lv_screen_active()); lv_obj_set_size(menu, lv_display_get_horizontal_resolution(NULL), lv_display_get_vertical_resolution(NULL)); lv_obj_center(menu); diff --git a/examples/widgets/menu/lv_example_menu_3.py b/examples/widgets/menu/lv_example_menu_3.py index bbaf937b0..9fedda782 100644 --- a/examples/widgets/menu/lv_example_menu_3.py +++ b/examples/widgets/menu/lv_example_menu_3.py @@ -1,5 +1,5 @@ # Create a menu object -menu = lv.menu(lv.scr_act()) +menu = lv.menu(lv.screen_active()) menu.set_size(320, 240) menu.center() diff --git a/examples/widgets/menu/lv_example_menu_4.c b/examples/widgets/menu/lv_example_menu_4.c index 3e546dec2..904a243e4 100644 --- a/examples/widgets/menu/lv_example_menu_4.c +++ b/examples/widgets/menu/lv_example_menu_4.c @@ -31,7 +31,7 @@ static void float_button_event_cb(lv_event_t * e) void lv_example_menu_4(void) { /*Create a menu object*/ - menu = lv_menu_create(lv_scr_act()); + menu = lv_menu_create(lv_screen_active()); lv_obj_set_size(menu, lv_display_get_horizontal_resolution(NULL), lv_display_get_vertical_resolution(NULL)); lv_obj_center(menu); @@ -56,7 +56,7 @@ void lv_example_menu_4(void) lv_menu_set_page(menu, main_page); /*Create floating btn*/ - lv_obj_t * float_btn = lv_button_create(lv_scr_act()); + lv_obj_t * float_btn = lv_button_create(lv_screen_active()); lv_obj_set_size(float_btn, 50, 50); lv_obj_add_flag(float_btn, LV_OBJ_FLAG_FLOATING); lv_obj_align(float_btn, LV_ALIGN_BOTTOM_RIGHT, -10, -10); diff --git a/examples/widgets/menu/lv_example_menu_4.py b/examples/widgets/menu/lv_example_menu_4.py index e93aa59a9..ee48427de 100644 --- a/examples/widgets/menu/lv_example_menu_4.py +++ b/examples/widgets/menu/lv_example_menu_4.py @@ -16,7 +16,7 @@ def float_button_event_cb(e): menu.set_load_page_event(cont, sub_page) # Create a menu object -menu = lv.menu(lv.scr_act()) +menu = lv.menu(lv.screen_active()) menu.set_size(320, 240) menu.center() @@ -37,7 +37,7 @@ menu.set_load_page_event(cont, sub_page) menu.set_page(main_page) -float_button = lv.button(lv.scr_act()) +float_button = lv.button(lv.screen_active()) float_button.set_size(50, 50) float_button.add_flag(lv.obj.FLAG.FLOATING) float_button.align(lv.ALIGN.BOTTOM_RIGHT, -10, -10) diff --git a/examples/widgets/menu/lv_example_menu_5.c b/examples/widgets/menu/lv_example_menu_5.c index 722dbf8d5..050df27eb 100644 --- a/examples/widgets/menu/lv_example_menu_5.c +++ b/examples/widgets/menu/lv_example_menu_5.c @@ -19,7 +19,7 @@ static lv_obj_t * create_switch(lv_obj_t * parent, void lv_example_menu_5(void) { - lv_obj_t * menu = lv_menu_create(lv_scr_act()); + lv_obj_t * menu = lv_menu_create(lv_screen_active()); lv_color_t bg_color = lv_obj_get_style_bg_color(menu, 0); if(lv_color_brightness(bg_color) > 127) { diff --git a/examples/widgets/menu/lv_example_menu_5.py b/examples/widgets/menu/lv_example_menu_5.py index c142530db..72ea66d34 100644 --- a/examples/widgets/menu/lv_example_menu_5.py +++ b/examples/widgets/menu/lv_example_menu_5.py @@ -77,7 +77,7 @@ def switch_handler(e,menu): LV_MENU_ITEM_BUILDER_VARIANT_1 = const(0) LV_MENU_ITEM_BUILDER_VARIANT_2 = const(1) -menu = lv.menu(lv.scr_act()) +menu = lv.menu(lv.screen_active()) bg_color = menu.get_style_bg_color(0) if bg_color.brightness() > 127 : diff --git a/examples/widgets/msgbox/lv_example_msgbox_1.py b/examples/widgets/msgbox/lv_example_msgbox_1.py index 49cf053b6..9157ed72e 100644 --- a/examples/widgets/msgbox/lv_example_msgbox_1.py +++ b/examples/widgets/msgbox/lv_example_msgbox_1.py @@ -4,7 +4,7 @@ def event_cb(e): buttons = ["Apply", "Close", ""] -mbox1 = lv.msgbox(lv.scr_act(), "Hello", "This is a message box with two buttons.", buttons, True) +mbox1 = lv.msgbox(lv.screen_active(), "Hello", "This is a message box with two buttons.", buttons, True) mbox1.add_event(event_cb, lv.EVENT.VALUE_CHANGED, None) mbox1.center() diff --git a/examples/widgets/obj/lv_example_obj_1.c b/examples/widgets/obj/lv_example_obj_1.c index 9c5ff7a05..322306e4a 100644 --- a/examples/widgets/obj/lv_example_obj_1.c +++ b/examples/widgets/obj/lv_example_obj_1.c @@ -4,7 +4,7 @@ void lv_example_obj_1(void) { lv_obj_t * obj1; - obj1 = lv_obj_create(lv_scr_act()); + obj1 = lv_obj_create(lv_screen_active()); lv_obj_set_size(obj1, 100, 50); lv_obj_align(obj1, LV_ALIGN_CENTER, -60, -30); @@ -15,7 +15,7 @@ void lv_example_obj_1(void) lv_style_set_shadow_color(&style_shadow, lv_palette_main(LV_PALETTE_BLUE)); lv_obj_t * obj2; - obj2 = lv_obj_create(lv_scr_act()); + obj2 = lv_obj_create(lv_screen_active()); lv_obj_add_style(obj2, &style_shadow, 0); lv_obj_align(obj2, LV_ALIGN_CENTER, 60, 30); } diff --git a/examples/widgets/obj/lv_example_obj_1.py b/examples/widgets/obj/lv_example_obj_1.py index f627e520b..9bceb6b61 100644 --- a/examples/widgets/obj/lv_example_obj_1.py +++ b/examples/widgets/obj/lv_example_obj_1.py @@ -1,4 +1,4 @@ -obj1 = lv.obj(lv.scr_act()) +obj1 = lv.obj(lv.screen_active()) obj1.set_size(100, 50) obj1.align(lv.ALIGN.CENTER, -60, -30) @@ -8,7 +8,7 @@ style_shadow.set_shadow_width(10) style_shadow.set_shadow_spread(5) style_shadow.set_shadow_color(lv.palette_main(lv.PALETTE.BLUE)) -obj2 = lv.obj(lv.scr_act()) +obj2 = lv.obj(lv.screen_active()) obj2.add_style(style_shadow, 0) obj2.align(lv.ALIGN.CENTER, 60, 30) diff --git a/examples/widgets/obj/lv_example_obj_2.c b/examples/widgets/obj/lv_example_obj_2.c index feee623f4..11fc358b0 100644 --- a/examples/widgets/obj/lv_example_obj_2.c +++ b/examples/widgets/obj/lv_example_obj_2.c @@ -23,7 +23,7 @@ static void drag_event_handler(lv_event_t * e) void lv_example_obj_2(void) { lv_obj_t * obj; - obj = lv_obj_create(lv_scr_act()); + obj = lv_obj_create(lv_screen_active()); lv_obj_set_size(obj, 150, 100); lv_obj_add_event(obj, drag_event_handler, LV_EVENT_PRESSING, NULL); diff --git a/examples/widgets/obj/lv_example_obj_2.py b/examples/widgets/obj/lv_example_obj_2.py index d94f14656..17ee9172a 100644 --- a/examples/widgets/obj/lv_example_obj_2.py +++ b/examples/widgets/obj/lv_example_obj_2.py @@ -15,7 +15,7 @@ def drag_event_handler(e): # Make an object draggable. # -obj = lv.obj(lv.scr_act()) +obj = lv.obj(lv.screen_active()) obj.set_size(150, 100) obj.add_event(drag_event_handler, lv.EVENT.PRESSING, None) diff --git a/examples/widgets/roller/lv_example_roller_1.c b/examples/widgets/roller/lv_example_roller_1.c index 94d397056..112c04724 100644 --- a/examples/widgets/roller/lv_example_roller_1.c +++ b/examples/widgets/roller/lv_example_roller_1.c @@ -17,7 +17,7 @@ static void event_handler(lv_event_t * e) */ void lv_example_roller_1(void) { - lv_obj_t * roller1 = lv_roller_create(lv_scr_act()); + lv_obj_t * roller1 = lv_roller_create(lv_screen_active()); lv_roller_set_options(roller1, "January\n" "February\n" diff --git a/examples/widgets/roller/lv_example_roller_1.py b/examples/widgets/roller/lv_example_roller_1.py index 95ef872ff..36e2c9b2b 100644 --- a/examples/widgets/roller/lv_example_roller_1.py +++ b/examples/widgets/roller/lv_example_roller_1.py @@ -10,7 +10,7 @@ def event_handler(e): # An infinite roller with the name of the months # -roller1 = lv.roller(lv.scr_act()) +roller1 = lv.roller(lv.screen_active()) roller1.set_options("\n".join([ "January", "February", diff --git a/examples/widgets/roller/lv_example_roller_2.c b/examples/widgets/roller/lv_example_roller_2.c index 898fa8141..0409494b7 100644 --- a/examples/widgets/roller/lv_example_roller_2.c +++ b/examples/widgets/roller/lv_example_roller_2.c @@ -29,7 +29,7 @@ void lv_example_roller_2(void) lv_obj_t * roller; /*A roller on the left with left aligned text, and custom width*/ - roller = lv_roller_create(lv_scr_act()); + roller = lv_roller_create(lv_screen_active()); lv_roller_set_options(roller, opts, LV_ROLLER_MODE_NORMAL); lv_roller_set_visible_row_count(roller, 2); lv_obj_set_width(roller, 100); @@ -43,7 +43,7 @@ void lv_example_roller_2(void) lv_roller_set_selected(roller, 2, LV_ANIM_OFF); /*A roller on the middle with center aligned text, and auto (default) width*/ - roller = lv_roller_create(lv_scr_act()); + roller = lv_roller_create(lv_screen_active()); lv_roller_set_options(roller, opts, LV_ROLLER_MODE_NORMAL); lv_roller_set_visible_row_count(roller, 3); lv_obj_add_style(roller, &style_sel, LV_PART_SELECTED); @@ -52,7 +52,7 @@ void lv_example_roller_2(void) lv_roller_set_selected(roller, 5, LV_ANIM_OFF); /*A roller on the right with right aligned text, and custom width*/ - roller = lv_roller_create(lv_scr_act()); + roller = lv_roller_create(lv_screen_active()); lv_roller_set_options(roller, opts, LV_ROLLER_MODE_NORMAL); lv_roller_set_visible_row_count(roller, 4); lv_obj_set_width(roller, 80); diff --git a/examples/widgets/roller/lv_example_roller_2.py b/examples/widgets/roller/lv_example_roller_2.py index 0fb668c49..02d202cbd 100644 --- a/examples/widgets/roller/lv_example_roller_2.py +++ b/examples/widgets/roller/lv_example_roller_2.py @@ -15,14 +15,14 @@ def event_handler(e): # A style to make the selected option larger style_sel = lv.style_t() style_sel.init() - + try: style_sel.set_text_font(lv.font_montserrat_22) except: fs_drv = lv.fs_drv_t() fs_driver.fs_register(fs_drv, 'S') print("montserrat-22 not enabled in lv_conf.h, dynamically loading the font") - + # get the directory in which the script is running try: script_path = __file__[:__file__.rfind('/')] if __file__.find('/') >= 0 else '.' @@ -30,12 +30,12 @@ except: print("Could not find script path") script_path = '' if script_path != '': - try: + try: font_montserrat_22 = lv.font_load("S:" + script_path + "/../../assets/font/montserrat-22.fnt") style_sel.set_text_font(font_montserrat_22) except: print("Cannot load font file montserrat-22.fnt") - + style_sel.set_bg_color(lv.color_hex3(0xf88)) style_sel.set_border_width(2) style_sel.set_border_color(lv.color_hex3(0xf00)) @@ -43,7 +43,7 @@ style_sel.set_border_color(lv.color_hex3(0xf00)) opts = "\n".join(["1","2","3","4","5","6","7","8","9","10"]) # A roller on the left with left aligned text, and custom width -roller = lv.roller(lv.scr_act()) +roller = lv.roller(lv.screen_active()) roller.set_options(opts, lv.roller.MODE.NORMAL) roller.set_visible_row_count(2) roller.set_width(100) @@ -56,7 +56,7 @@ roller.add_event(event_handler, lv.EVENT.ALL, None) roller.set_selected(2, lv.ANIM.OFF) # A roller in the middle with center aligned text, and auto (default) width -roller = lv.roller(lv.scr_act()) +roller = lv.roller(lv.screen_active()) roller.set_options(opts, lv.roller.MODE.NORMAL) roller.set_visible_row_count(3) roller.add_style(style_sel, lv.PART.SELECTED) @@ -65,7 +65,7 @@ roller.add_event(event_handler, lv.EVENT.ALL, None) roller.set_selected(5, lv.ANIM.OFF) # A roller on the right with right aligned text, and custom width -roller = lv.roller(lv.scr_act()) +roller = lv.roller(lv.screen_active()) roller.set_options(opts, lv.roller.MODE.NORMAL) roller.set_visible_row_count(4) roller.set_width(80) diff --git a/examples/widgets/roller/lv_example_roller_3.c b/examples/widgets/roller/lv_example_roller_3.c index 7d521f1fb..1dd320899 100644 --- a/examples/widgets/roller/lv_example_roller_3.c +++ b/examples/widgets/roller/lv_example_roller_3.c @@ -64,9 +64,9 @@ void lv_example_roller_3(void) lv_style_set_text_color(&style, lv_color_white()); lv_style_set_border_width(&style, 0); lv_style_set_pad_all(&style, 0); - lv_obj_add_style(lv_scr_act(), &style, 0); + lv_obj_add_style(lv_screen_active(), &style, 0); - lv_obj_t * roller1 = lv_roller_create(lv_scr_act()); + lv_obj_t * roller1 = lv_roller_create(lv_screen_active()); lv_obj_add_style(roller1, &style, 0); lv_obj_set_style_bg_opa(roller1, LV_OPA_TRANSP, LV_PART_SELECTED); diff --git a/examples/widgets/scale/lv_example_scale_1.c b/examples/widgets/scale/lv_example_scale_1.c index a5f377a2f..0a72d671c 100644 --- a/examples/widgets/scale/lv_example_scale_1.c +++ b/examples/widgets/scale/lv_example_scale_1.c @@ -6,7 +6,7 @@ */ void lv_example_scale_1(void) { - lv_obj_t * scale = lv_scale_create(lv_scr_act()); + lv_obj_t * scale = lv_scale_create(lv_screen_active()); lv_obj_set_size(scale, lv_pct(80), 100); lv_scale_set_mode(scale, LV_SCALE_MODE_HORIZONTAL_BOTTOM); lv_obj_center(scale); diff --git a/examples/widgets/scale/lv_example_scale_2.c b/examples/widgets/scale/lv_example_scale_2.c index 9514fdc76..4ffc6b116 100644 --- a/examples/widgets/scale/lv_example_scale_2.c +++ b/examples/widgets/scale/lv_example_scale_2.c @@ -6,7 +6,7 @@ */ void lv_example_scale_2(void) { - lv_obj_t * scale = lv_scale_create(lv_scr_act()); + lv_obj_t * scale = lv_scale_create(lv_screen_active()); lv_obj_set_size(scale, 60, 200); lv_scale_set_label_show(scale, true); lv_scale_set_mode(scale, LV_SCALE_MODE_VERTICAL_RIGHT); diff --git a/examples/widgets/scale/lv_example_scale_3.c b/examples/widgets/scale/lv_example_scale_3.c index f5446d1b1..191443243 100644 --- a/examples/widgets/scale/lv_example_scale_3.c +++ b/examples/widgets/scale/lv_example_scale_3.c @@ -6,7 +6,7 @@ */ void lv_example_scale_3(void) { - lv_obj_t * scale = lv_scale_create(lv_scr_act()); + lv_obj_t * scale = lv_scale_create(lv_screen_active()); lv_obj_set_size(scale, 150, 150); lv_scale_set_mode(scale, LV_SCALE_MODE_ROUND_INNER); lv_obj_set_style_bg_opa(scale, LV_OPA_COVER, 0); diff --git a/examples/widgets/scale/lv_example_scale_4.c b/examples/widgets/scale/lv_example_scale_4.c index 37f24795e..0364d7bdb 100644 --- a/examples/widgets/scale/lv_example_scale_4.c +++ b/examples/widgets/scale/lv_example_scale_4.c @@ -6,7 +6,7 @@ */ void lv_example_scale_4(void) { - lv_obj_t * scale = lv_scale_create(lv_scr_act()); + lv_obj_t * scale = lv_scale_create(lv_screen_active()); lv_obj_set_size(scale, 150, 150); lv_scale_set_label_show(scale, true); lv_scale_set_mode(scale, LV_SCALE_MODE_ROUND_OUTER); diff --git a/examples/widgets/scale/lv_example_scale_5.c b/examples/widgets/scale/lv_example_scale_5.c index bad2058d9..d07a7ff93 100644 --- a/examples/widgets/scale/lv_example_scale_5.c +++ b/examples/widgets/scale/lv_example_scale_5.c @@ -6,7 +6,7 @@ */ void lv_example_scale_5(void) { - lv_obj_t * scale = lv_scale_create(lv_scr_act()); + lv_obj_t * scale = lv_scale_create(lv_screen_active()); lv_obj_set_size(scale, lv_display_get_horizontal_resolution(NULL) / 2, lv_display_get_vertical_resolution(NULL) / 2); lv_scale_set_label_show(scale, true); diff --git a/examples/widgets/slider/lv_example_slider_1.c b/examples/widgets/slider/lv_example_slider_1.c index 7804e1d42..0c8acf6ec 100644 --- a/examples/widgets/slider/lv_example_slider_1.c +++ b/examples/widgets/slider/lv_example_slider_1.c @@ -10,12 +10,12 @@ static lv_obj_t * slider_label; void lv_example_slider_1(void) { /*Create a slider in the center of the display*/ - lv_obj_t * slider = lv_slider_create(lv_scr_act()); + lv_obj_t * slider = lv_slider_create(lv_screen_active()); lv_obj_center(slider); lv_obj_add_event(slider, slider_event_cb, LV_EVENT_VALUE_CHANGED, NULL); /*Create a label below the slider*/ - slider_label = lv_label_create(lv_scr_act()); + slider_label = lv_label_create(lv_screen_active()); lv_label_set_text(slider_label, "0%"); lv_obj_align_to(slider_label, slider, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); diff --git a/examples/widgets/slider/lv_example_slider_1.py b/examples/widgets/slider/lv_example_slider_1.py index c7dc86075..23c58c8a2 100644 --- a/examples/widgets/slider/lv_example_slider_1.py +++ b/examples/widgets/slider/lv_example_slider_1.py @@ -8,12 +8,12 @@ def slider_event_cb(e): slider_label.align_to(slider, lv.ALIGN.OUT_BOTTOM_MID, 0, 10) # Create a slider in the center of the display -slider = lv.slider(lv.scr_act()) +slider = lv.slider(lv.screen_active()) slider.center() slider.add_event(slider_event_cb, lv.EVENT.VALUE_CHANGED, None) # Create a label below the slider -slider_label = lv.label(lv.scr_act()) +slider_label = lv.label(lv.screen_active()) slider_label.set_text("0%") slider_label.align_to(slider, lv.ALIGN.OUT_BOTTOM_MID, 0, 10) diff --git a/examples/widgets/slider/lv_example_slider_2.c b/examples/widgets/slider/lv_example_slider_2.c index 883d61f34..308b481cc 100644 --- a/examples/widgets/slider/lv_example_slider_2.c +++ b/examples/widgets/slider/lv_example_slider_2.c @@ -42,7 +42,7 @@ void lv_example_slider_2(void) lv_style_set_bg_color(&style_pressed_color, lv_palette_darken(LV_PALETTE_CYAN, 2)); /*Create a slider and add the style*/ - lv_obj_t * slider = lv_slider_create(lv_scr_act()); + lv_obj_t * slider = lv_slider_create(lv_screen_active()); lv_obj_remove_style_all(slider); /*Remove the styles coming from the theme*/ lv_obj_add_style(slider, &style_main, LV_PART_MAIN); diff --git a/examples/widgets/slider/lv_example_slider_2.py b/examples/widgets/slider/lv_example_slider_2.py index 60bbc3100..ff97de12a 100644 --- a/examples/widgets/slider/lv_example_slider_2.py +++ b/examples/widgets/slider/lv_example_slider_2.py @@ -35,7 +35,7 @@ style_pressed_color.init() style_pressed_color.set_bg_color(lv.palette_darken(lv.PALETTE.CYAN, 2)) # Create a slider and add the style -slider = lv.slider(lv.scr_act()) +slider = lv.slider(lv.screen_active()) slider.remove_style_all() # Remove the styles coming from the theme slider.add_style(style_main, lv.PART.MAIN) diff --git a/examples/widgets/slider/lv_example_slider_3.c b/examples/widgets/slider/lv_example_slider_3.c index adfa0fb12..9f7251ce0 100644 --- a/examples/widgets/slider/lv_example_slider_3.c +++ b/examples/widgets/slider/lv_example_slider_3.c @@ -11,7 +11,7 @@ void lv_example_slider_3(void) { /*Create a slider in the center of the display*/ lv_obj_t * slider; - slider = lv_slider_create(lv_scr_act()); + slider = lv_slider_create(lv_screen_active()); lv_obj_center(slider); lv_slider_set_mode(slider, LV_SLIDER_MODE_RANGE); diff --git a/examples/widgets/slider/lv_example_slider_3.py b/examples/widgets/slider/lv_example_slider_3.py index 3b59f9196..ec9cad177 100644 --- a/examples/widgets/slider/lv_example_slider_3.py +++ b/examples/widgets/slider/lv_example_slider_3.py @@ -32,7 +32,7 @@ def slider_event_cb(e): # #Create a slider in the center of the display -slider = lv.slider(lv.scr_act()) +slider = lv.slider(lv.screen_active()) slider.center() slider.set_mode(lv.slider.MODE.RANGE) diff --git a/examples/widgets/span/lv_example_span_1.c b/examples/widgets/span/lv_example_span_1.c index e09caed87..884fed6ce 100644 --- a/examples/widgets/span/lv_example_span_1.c +++ b/examples/widgets/span/lv_example_span_1.c @@ -12,7 +12,7 @@ void lv_example_span_1(void) lv_style_set_border_color(&style, lv_palette_main(LV_PALETTE_ORANGE)); lv_style_set_pad_all(&style, 2); - lv_obj_t * spans = lv_spangroup_create(lv_scr_act()); + lv_obj_t * spans = lv_spangroup_create(lv_screen_active()); lv_obj_set_width(spans, 300); lv_obj_set_height(spans, 300); lv_obj_center(spans); diff --git a/examples/widgets/span/lv_example_span_1.py b/examples/widgets/span/lv_example_span_1.py index 18df19a52..d1458c7e2 100644 --- a/examples/widgets/span/lv_example_span_1.py +++ b/examples/widgets/span/lv_example_span_1.py @@ -16,7 +16,7 @@ style.set_border_width(1) style.set_border_color(lv.palette_main(lv.PALETTE.ORANGE)) style.set_pad_all(2) -spans = lv.spangroup(lv.scr_act()) +spans = lv.spangroup(lv.screen_active()) spans.set_width(300) spans.set_height(300) spans.center() @@ -46,7 +46,7 @@ except: fs_drv = lv.fs_drv_t() fs_driver.fs_register(fs_drv, 'S') print("montserrat-24 not enabled in lv_conf.h, dynamically loading the font") - + # get the directory in which the script is running try: script_path = __file__[:__file__.rfind('/')] if __file__.find('/') >= 0 else '.' @@ -56,7 +56,7 @@ except: if script_path != '': try: font_montserrat_24 = lv.font_load("S:" + script_path + "/../../assets/font/montserrat-24.fnt") - span.style.set_text_font(font_montserrat_24) + span.style.set_text_font(font_montserrat_24) except: print("Cannot load font file montserrat-24.fnt") @@ -77,7 +77,7 @@ except: fs_drv = lv.fs_drv_t() fs_driver.fs_register(fs_drv, 'S') print("montserrat-20 not enabled in lv_conf.h, dynamically loading the font") - + # get the directory in which the script is running try: script_path = __file__[:__file__.rfind('/')] if __file__.find('/') >= 0 else '.' @@ -87,7 +87,7 @@ except: if script_path != '': try: font_montserrat_20 = lv.font_load("S:" + script_path + "/../../assets/font/montserrat-20.fnt") - span.style.set_text_font(font_montserrat_20) + span.style.set_text_font(font_montserrat_20) except: print("Cannot load font file montserrat-20.fnt") diff --git a/examples/widgets/spinbox/lv_example_spinbox_1.c b/examples/widgets/spinbox/lv_example_spinbox_1.c index 6f3dd8084..09c03a1b3 100644 --- a/examples/widgets/spinbox/lv_example_spinbox_1.c +++ b/examples/widgets/spinbox/lv_example_spinbox_1.c @@ -23,7 +23,7 @@ static void lv_spinbox_decrement_event_cb(lv_event_t * e) void lv_example_spinbox_1(void) { - spinbox = lv_spinbox_create(lv_scr_act()); + spinbox = lv_spinbox_create(lv_screen_active()); lv_spinbox_set_range(spinbox, -1000, 25000); lv_spinbox_set_digit_format(spinbox, 5, 2); lv_spinbox_step_prev(spinbox); @@ -32,13 +32,13 @@ void lv_example_spinbox_1(void) lv_coord_t h = lv_obj_get_height(spinbox); - lv_obj_t * btn = lv_button_create(lv_scr_act()); + lv_obj_t * btn = lv_button_create(lv_screen_active()); lv_obj_set_size(btn, h, h); lv_obj_align_to(btn, spinbox, LV_ALIGN_OUT_RIGHT_MID, 5, 0); lv_obj_set_style_bg_image_src(btn, LV_SYMBOL_PLUS, 0); lv_obj_add_event(btn, lv_spinbox_increment_event_cb, LV_EVENT_ALL, NULL); - btn = lv_button_create(lv_scr_act()); + btn = lv_button_create(lv_screen_active()); lv_obj_set_size(btn, h, h); lv_obj_align_to(btn, spinbox, LV_ALIGN_OUT_LEFT_MID, -5, 0); lv_obj_set_style_bg_image_src(btn, LV_SYMBOL_MINUS, 0); diff --git a/examples/widgets/spinbox/lv_example_spinbox_1.py b/examples/widgets/spinbox/lv_example_spinbox_1.py index 4f5986b08..bd88c6c1a 100644 --- a/examples/widgets/spinbox/lv_example_spinbox_1.py +++ b/examples/widgets/spinbox/lv_example_spinbox_1.py @@ -8,7 +8,7 @@ def decrement_event_cb(e): if code == lv.EVENT.SHORT_CLICKED or code == lv.EVENT.LONG_PRESSED_REPEAT: spinbox.decrement() -spinbox = lv.spinbox(lv.scr_act()) +spinbox = lv.spinbox(lv.screen_active()) spinbox.set_range(-1000, 25000) spinbox.set_digit_format(5, 2) spinbox.step_prev() @@ -17,13 +17,13 @@ spinbox.center() h = spinbox.get_height() -button = lv.button(lv.scr_act()) +button = lv.button(lv.screen_active()) button.set_size(h, h) button.align_to(spinbox, lv.ALIGN.OUT_RIGHT_MID, 5, 0) button.set_style_bg_image_src(lv.SYMBOL.PLUS, 0) button.add_event(increment_event_cb, lv.EVENT.ALL, None) -button = lv.button(lv.scr_act()) +button = lv.button(lv.screen_active()) button.set_size(h, h) button.align_to(spinbox, lv.ALIGN.OUT_LEFT_MID, -5, 0) button.set_style_bg_image_src(lv.SYMBOL.MINUS, 0) diff --git a/examples/widgets/spinner/lv_example_spinner_1.c b/examples/widgets/spinner/lv_example_spinner_1.c index ef9888dc6..ce978b940 100644 --- a/examples/widgets/spinner/lv_example_spinner_1.c +++ b/examples/widgets/spinner/lv_example_spinner_1.c @@ -4,7 +4,7 @@ void lv_example_spinner_1(void) { /*Create a spinner*/ - lv_obj_t * spinner = lv_spinner_create(lv_scr_act()); + lv_obj_t * spinner = lv_spinner_create(lv_screen_active()); lv_obj_set_size(spinner, 100, 100); lv_obj_center(spinner); lv_spinner_set_anim_params(spinner, 10000, 200); diff --git a/examples/widgets/spinner/lv_example_spinner_1.py b/examples/widgets/spinner/lv_example_spinner_1.py index fd22ce2f1..099669321 100644 --- a/examples/widgets/spinner/lv_example_spinner_1.py +++ b/examples/widgets/spinner/lv_example_spinner_1.py @@ -1,5 +1,5 @@ # Create a spinner -spinner = lv.spinner(lv.scr_act()) +spinner = lv.spinner(lv.screen_active()) spinner.set_size(100, 100) spinner.center() diff --git a/examples/widgets/switch/lv_example_switch_1.c b/examples/widgets/switch/lv_example_switch_1.c index 5a334905d..4363b6af0 100644 --- a/examples/widgets/switch/lv_example_switch_1.c +++ b/examples/widgets/switch/lv_example_switch_1.c @@ -13,24 +13,24 @@ static void event_handler(lv_event_t * e) void lv_example_switch_1(void) { - 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_CENTER, 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_CENTER, LV_FLEX_ALIGN_CENTER); lv_obj_t * sw; - sw = lv_switch_create(lv_scr_act()); + sw = lv_switch_create(lv_screen_active()); lv_obj_add_event(sw, event_handler, LV_EVENT_ALL, NULL); lv_obj_add_flag(sw, LV_OBJ_FLAG_EVENT_BUBBLE); - sw = lv_switch_create(lv_scr_act()); + sw = lv_switch_create(lv_screen_active()); lv_obj_add_state(sw, LV_STATE_CHECKED); lv_obj_add_event(sw, event_handler, LV_EVENT_ALL, NULL); - sw = lv_switch_create(lv_scr_act()); + sw = lv_switch_create(lv_screen_active()); lv_obj_add_state(sw, LV_STATE_DISABLED); lv_obj_add_event(sw, event_handler, LV_EVENT_ALL, NULL); - sw = lv_switch_create(lv_scr_act()); + sw = lv_switch_create(lv_screen_active()); lv_obj_add_state(sw, LV_STATE_CHECKED | LV_STATE_DISABLED); lv_obj_add_event(sw, event_handler, LV_EVENT_ALL, NULL); } diff --git a/examples/widgets/switch/lv_example_switch_1.py b/examples/widgets/switch/lv_example_switch_1.py index 593ee68a0..f9a8a0c2f 100644 --- a/examples/widgets/switch/lv_example_switch_1.py +++ b/examples/widgets/switch/lv_example_switch_1.py @@ -5,22 +5,22 @@ def event_handler(e): print("State: ", "On" if obj.has_state(lv.STATE.CHECKED) else "Off") -lv.scr_act().set_flex_flow(lv.FLEX_FLOW.COLUMN) -lv.scr_act().set_flex_align(lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.CENTER) +lv.screen_active().set_flex_flow(lv.FLEX_FLOW.COLUMN) +lv.screen_active().set_flex_align(lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.CENTER) -sw = lv.switch(lv.scr_act()) +sw = lv.switch(lv.screen_active()) sw.add_event(event_handler, lv.EVENT.ALL, None) sw.add_flag(lv.obj.FLAG.EVENT_BUBBLE) -sw = lv.switch(lv.scr_act()) +sw = lv.switch(lv.screen_active()) sw.add_state(lv.STATE.CHECKED) sw.add_event(event_handler, lv.EVENT.ALL, None) -sw = lv.switch(lv.scr_act()) +sw = lv.switch(lv.screen_active()) sw.add_state(lv.STATE.DISABLED) sw.add_event(event_handler, lv.EVENT.ALL, None) -sw = lv.switch(lv.scr_act()) +sw = lv.switch(lv.screen_active()) sw.add_state(lv.STATE.CHECKED | lv.STATE.DISABLED) sw.add_event(event_handler, lv.EVENT.ALL, None) diff --git a/examples/widgets/table/lv_example_table_1.c b/examples/widgets/table/lv_example_table_1.c index cfabfcba6..36684abd9 100644 --- a/examples/widgets/table/lv_example_table_1.c +++ b/examples/widgets/table/lv_example_table_1.c @@ -44,7 +44,7 @@ static void draw_event_cb(lv_event_t * e) void lv_example_table_1(void) { - lv_obj_t * table = lv_table_create(lv_scr_act()); + lv_obj_t * table = lv_table_create(lv_screen_active()); /*Fill the first column*/ lv_table_set_cell_value(table, 0, 0, "Name"); diff --git a/examples/widgets/table/lv_example_table_2.c b/examples/widgets/table/lv_example_table_2.c index 8972f28ba..2cf939f4a 100644 --- a/examples/widgets/table/lv_example_table_2.c +++ b/examples/widgets/table/lv_example_table_2.c @@ -66,7 +66,7 @@ void lv_example_table_2(void) uint32_t t = lv_tick_get(); - lv_obj_t * table = lv_table_create(lv_scr_act()); + lv_obj_t * table = lv_table_create(lv_screen_active()); /*Set a smaller height to the table. It'll make it scrollable*/ lv_obj_set_size(table, LV_SIZE_CONTENT, 200); @@ -97,7 +97,7 @@ void lv_example_table_2(void) uint32_t elaps = lv_tick_elaps(t); - lv_obj_t * label = lv_label_create(lv_scr_act()); + lv_obj_t * label = lv_label_create(lv_screen_active()); lv_label_set_text_fmt(label, "%"LV_PRIu32" items were created in %"LV_PRIu32" ms\n" "using %"LV_PRIu32" bytes of memory", (uint32_t)ITEM_CNT, elaps, mem_used); diff --git a/examples/widgets/tabview/lv_example_tabview_1.c b/examples/widgets/tabview/lv_example_tabview_1.c index 570a7b821..c37cb520a 100644 --- a/examples/widgets/tabview/lv_example_tabview_1.c +++ b/examples/widgets/tabview/lv_example_tabview_1.c @@ -5,7 +5,7 @@ void lv_example_tabview_1(void) { /*Create a Tab view object*/ lv_obj_t * tabview; - tabview = lv_tabview_create(lv_scr_act(), LV_DIR_TOP, 50); + tabview = lv_tabview_create(lv_screen_active(), LV_DIR_TOP, 50); /*Add 3 tabs (the tabs are page (lv_page) and can be scrolled*/ lv_obj_t * tab1 = lv_tabview_add_tab(tabview, "Tab 1"); diff --git a/examples/widgets/tabview/lv_example_tabview_1.py b/examples/widgets/tabview/lv_example_tabview_1.py index d5e219a7f..f57cf995a 100644 --- a/examples/widgets/tabview/lv_example_tabview_1.py +++ b/examples/widgets/tabview/lv_example_tabview_1.py @@ -1,5 +1,5 @@ # Create a Tab view object -tabview = lv.tabview(lv.scr_act(), lv.DIR.TOP, 50) +tabview = lv.tabview(lv.screen_active(), lv.DIR.TOP, 50) # Add 3 tabs (the tabs are page (lv_page) and can be scrolled tab1 = tabview.add_tab("Tab 1") diff --git a/examples/widgets/tabview/lv_example_tabview_2.c b/examples/widgets/tabview/lv_example_tabview_2.c index 8e1f474fd..b00dff3c4 100644 --- a/examples/widgets/tabview/lv_example_tabview_2.c +++ b/examples/widgets/tabview/lv_example_tabview_2.c @@ -5,7 +5,7 @@ void lv_example_tabview_2(void) { /*Create a Tab view object*/ lv_obj_t * tabview; - tabview = lv_tabview_create(lv_scr_act(), LV_DIR_LEFT, 80); + tabview = lv_tabview_create(lv_screen_active(), LV_DIR_LEFT, 80); lv_obj_set_style_bg_color(tabview, lv_palette_lighten(LV_PALETTE_RED, 2), 0); @@ -41,6 +41,6 @@ void lv_example_tabview_2(void) label = lv_label_create(tab5); lv_label_set_text(label, "Fifth tab"); - lv_obj_clear_flag(lv_tabview_get_content(tabview), LV_OBJ_FLAG_SCROLLABLE); + lv_obj_remove_flag(lv_tabview_get_content(tabview), LV_OBJ_FLAG_SCROLLABLE); } #endif diff --git a/examples/widgets/tabview/lv_example_tabview_2.py b/examples/widgets/tabview/lv_example_tabview_2.py index c6dca3c90..d3a90b6f9 100644 --- a/examples/widgets/tabview/lv_example_tabview_2.py +++ b/examples/widgets/tabview/lv_example_tabview_2.py @@ -1,6 +1,6 @@ # Create a Tab view object -tabview = lv.tabview(lv.scr_act(), lv.DIR.LEFT, 80) +tabview = lv.tabview(lv.screen_active(), lv.DIR.LEFT, 80) tabview.set_style_bg_color(lv.palette_lighten(lv.PALETTE.RED, 2), 0) @@ -36,5 +36,5 @@ label.set_text("Forth tab") label = lv.label(tab5) label.set_text("Fifth tab") -tabview.get_content().clear_flag(lv.obj.FLAG.SCROLLABLE) +tabview.get_content().remove_flag(lv.obj.FLAG.SCROLLABLE) diff --git a/examples/widgets/textarea/lv_example_textarea_1.c b/examples/widgets/textarea/lv_example_textarea_1.c index 6f2112934..544e08616 100644 --- a/examples/widgets/textarea/lv_example_textarea_1.c +++ b/examples/widgets/textarea/lv_example_textarea_1.c @@ -14,7 +14,7 @@ static void btnm_event_handler(lv_event_t * e) lv_obj_t * ta = lv_event_get_user_data(e); const char * txt = lv_buttonmatrix_get_button_text(obj, lv_buttonmatrix_get_selected_button(obj)); - if(strcmp(txt, LV_SYMBOL_BACKSPACE) == 0) lv_textarea_del_char(ta); + if(strcmp(txt, LV_SYMBOL_BACKSPACE) == 0) lv_textarea_delete_char(ta); else if(strcmp(txt, LV_SYMBOL_NEW_LINE) == 0) lv_obj_send_event(ta, LV_EVENT_READY, NULL); else lv_textarea_add_text(ta, txt); @@ -22,7 +22,7 @@ static void btnm_event_handler(lv_event_t * e) void lv_example_textarea_1(void) { - lv_obj_t * ta = lv_textarea_create(lv_scr_act()); + lv_obj_t * ta = lv_textarea_create(lv_screen_active()); lv_textarea_set_one_line(ta, true); lv_obj_align(ta, LV_ALIGN_TOP_MID, 0, 10); lv_obj_add_event(ta, textarea_event_handler, LV_EVENT_READY, ta); @@ -34,11 +34,11 @@ void lv_example_textarea_1(void) LV_SYMBOL_BACKSPACE, "0", LV_SYMBOL_NEW_LINE, "" }; - lv_obj_t * btnm = lv_buttonmatrix_create(lv_scr_act()); + lv_obj_t * btnm = lv_buttonmatrix_create(lv_screen_active()); lv_obj_set_size(btnm, 200, 150); lv_obj_align(btnm, LV_ALIGN_BOTTOM_MID, 0, -10); lv_obj_add_event(btnm, btnm_event_handler, LV_EVENT_VALUE_CHANGED, ta); - lv_obj_clear_flag(btnm, LV_OBJ_FLAG_CLICK_FOCUSABLE); /*To keep the text area focused on button clicks*/ + lv_obj_remove_flag(btnm, LV_OBJ_FLAG_CLICK_FOCUSABLE); /*To keep the text area focused on button clicks*/ lv_buttonmatrix_set_map(btnm, btnm_map); } diff --git a/examples/widgets/textarea/lv_example_textarea_1.py b/examples/widgets/textarea/lv_example_textarea_1.py index f6e67e4ba..c3cc36f78 100644 --- a/examples/widgets/textarea/lv_example_textarea_1.py +++ b/examples/widgets/textarea/lv_example_textarea_1.py @@ -13,7 +13,7 @@ def buttonm_event_handler(e, ta): ta.add_text(txt) -ta = lv.textarea(lv.scr_act()) +ta = lv.textarea(lv.screen_active()) ta.set_one_line(True) ta.align(lv.ALIGN.TOP_MID, 0, 10) ta.add_event(lambda e: textarea_event_handler(e, ta), lv.EVENT.READY, None) @@ -24,9 +24,9 @@ buttonm_map = ["1", "2", "3", "\n", "7", "8", "9", "\n", lv.SYMBOL.BACKSPACE, "0", lv.SYMBOL.NEW_LINE, ""] -buttonm = lv.buttonmatrix(lv.scr_act()) +buttonm = lv.buttonmatrix(lv.screen_active()) buttonm.set_size(200, 150) buttonm.align(lv.ALIGN.BOTTOM_MID, 0, -10) buttonm.add_event(lambda e: buttonm_event_handler(e, ta), lv.EVENT.VALUE_CHANGED, None) -buttonm.clear_flag(lv.obj.FLAG.CLICK_FOCUSABLE) # To keep the text area focused on button clicks +buttonm.remove_flag(lv.obj.FLAG.CLICK_FOCUSABLE) # To keep the text area focused on button clicks buttonm.set_map(buttonm_map) diff --git a/examples/widgets/textarea/lv_example_textarea_2.c b/examples/widgets/textarea/lv_example_textarea_2.c index f1b20eb54..176390553 100644 --- a/examples/widgets/textarea/lv_example_textarea_2.c +++ b/examples/widgets/textarea/lv_example_textarea_2.c @@ -8,7 +8,7 @@ static lv_obj_t * kb; void lv_example_textarea_2(void) { /*Create the password box*/ - lv_obj_t * pwd_ta = lv_textarea_create(lv_scr_act()); + lv_obj_t * pwd_ta = lv_textarea_create(lv_screen_active()); lv_textarea_set_text(pwd_ta, ""); lv_textarea_set_password_mode(pwd_ta, true); lv_textarea_set_one_line(pwd_ta, true); @@ -17,12 +17,12 @@ void lv_example_textarea_2(void) lv_obj_add_event(pwd_ta, ta_event_cb, LV_EVENT_ALL, NULL); /*Create a label and position it above the text box*/ - lv_obj_t * pwd_label = lv_label_create(lv_scr_act()); + lv_obj_t * pwd_label = lv_label_create(lv_screen_active()); lv_label_set_text(pwd_label, "Password:"); lv_obj_align_to(pwd_label, pwd_ta, LV_ALIGN_OUT_TOP_LEFT, 0, 0); /*Create the one-line mode text area*/ - lv_obj_t * text_ta = lv_textarea_create(lv_scr_act()); + lv_obj_t * text_ta = lv_textarea_create(lv_screen_active()); lv_textarea_set_one_line(text_ta, true); lv_textarea_set_password_mode(text_ta, false); lv_obj_set_width(text_ta, lv_pct(40)); @@ -31,12 +31,12 @@ void lv_example_textarea_2(void) /*Create a label and position it above the text box*/ - lv_obj_t * oneline_label = lv_label_create(lv_scr_act()); + lv_obj_t * oneline_label = lv_label_create(lv_screen_active()); lv_label_set_text(oneline_label, "Text:"); lv_obj_align_to(oneline_label, text_ta, LV_ALIGN_OUT_TOP_LEFT, 0, 0); /*Create a keyboard*/ - kb = lv_keyboard_create(lv_scr_act()); + kb = lv_keyboard_create(lv_screen_active()); lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2); lv_keyboard_set_textarea(kb, pwd_ta); /*Focus it on one of the text areas to start*/ diff --git a/examples/widgets/textarea/lv_example_textarea_2.py b/examples/widgets/textarea/lv_example_textarea_2.py index bd86be09a..34eeece9f 100644 --- a/examples/widgets/textarea/lv_example_textarea_2.py +++ b/examples/widgets/textarea/lv_example_textarea_2.py @@ -12,7 +12,7 @@ def ta_event_cb(e): # Create the password box -pwd_ta = lv.textarea(lv.scr_act()) +pwd_ta = lv.textarea(lv.screen_active()) pwd_ta.set_text("") pwd_ta.set_password_mode(True) pwd_ta.set_one_line(True) @@ -21,12 +21,12 @@ pwd_ta.set_pos(5, 20) pwd_ta.add_event(ta_event_cb, lv.EVENT.ALL, None) # Create a label and position it above the text box -pwd_label = lv.label(lv.scr_act()) +pwd_label = lv.label(lv.screen_active()) pwd_label.set_text("Password:") pwd_label.align_to(pwd_ta, lv.ALIGN.OUT_TOP_LEFT, 0, 0) # Create the one-line mode text area -text_ta = lv.textarea(lv.scr_act()) +text_ta = lv.textarea(lv.screen_active()) text_ta.set_width(lv.pct(45)) text_ta.set_one_line(True) text_ta.add_event(ta_event_cb, lv.EVENT.ALL, None) @@ -35,12 +35,12 @@ text_ta.set_password_mode(False) text_ta.align(lv.ALIGN.TOP_RIGHT, -5, 20) # Create a label and position it above the text box -oneline_label = lv.label(lv.scr_act()) +oneline_label = lv.label(lv.screen_active()) oneline_label.set_text("Text:") oneline_label.align_to(text_ta, lv.ALIGN.OUT_TOP_LEFT, 0, 0) # Create a keyboard -kb = lv.keyboard(lv.scr_act()) +kb = lv.keyboard(lv.screen_active()) kb.set_size(lv.pct(100), lv.pct(50)) kb.set_textarea(pwd_ta) # Focus it on one of the text areas to start diff --git a/examples/widgets/textarea/lv_example_textarea_3.c b/examples/widgets/textarea/lv_example_textarea_3.c index a46b1e796..825701d08 100644 --- a/examples/widgets/textarea/lv_example_textarea_3.c +++ b/examples/widgets/textarea/lv_example_textarea_3.c @@ -12,7 +12,7 @@ static lv_obj_t * kb; void lv_example_textarea_3(void) { /*Create the text area*/ - lv_obj_t * ta = lv_textarea_create(lv_scr_act()); + lv_obj_t * ta = lv_textarea_create(lv_screen_active()); lv_obj_add_event(ta, ta_event_cb, LV_EVENT_VALUE_CHANGED, NULL); lv_textarea_set_accepted_chars(ta, "0123456789:"); lv_textarea_set_max_length(ta, 5); @@ -20,7 +20,7 @@ void lv_example_textarea_3(void) lv_textarea_set_text(ta, ""); /*Create a keyboard*/ - kb = lv_keyboard_create(lv_scr_act()); + kb = lv_keyboard_create(lv_screen_active()); lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2); lv_keyboard_set_mode(kb, LV_KEYBOARD_MODE_NUMBER); lv_keyboard_set_textarea(kb, ta); diff --git a/examples/widgets/textarea/lv_example_textarea_3.py b/examples/widgets/textarea/lv_example_textarea_3.py index 247b3243d..e9cffb574 100644 --- a/examples/widgets/textarea/lv_example_textarea_3.py +++ b/examples/widgets/textarea/lv_example_textarea_3.py @@ -30,7 +30,7 @@ def ta_event_cb(e): # # Create the text area -ta = lv.textarea(lv.scr_act()) +ta = lv.textarea(lv.screen_active()) ta.add_event(ta_event_cb, lv.EVENT.VALUE_CHANGED, None) ta.set_accepted_chars("0123456789:") ta.set_max_length(5) @@ -39,7 +39,7 @@ ta.set_text("") ta.add_state(lv.STATE.FOCUSED) # Create a keyboard -kb = lv.keyboard(lv.scr_act()) +kb = lv.keyboard(lv.screen_active()) kb.set_size(lv.pct(100), lv.pct(50)) kb.set_mode(lv.keyboard.MODE.NUMBER) kb.set_textarea(ta) diff --git a/examples/widgets/tileview/lv_example_tileview_1.c b/examples/widgets/tileview/lv_example_tileview_1.c index fe2dce4a5..64e487af0 100644 --- a/examples/widgets/tileview/lv_example_tileview_1.c +++ b/examples/widgets/tileview/lv_example_tileview_1.c @@ -8,7 +8,7 @@ */ void lv_example_tileview_1(void) { - lv_obj_t * tv = lv_tileview_create(lv_scr_act()); + lv_obj_t * tv = lv_tileview_create(lv_screen_active()); /*Tile1: just a label*/ lv_obj_t * tile1 = lv_tileview_add_tile(tv, 0, 0, LV_DIR_BOTTOM); diff --git a/examples/widgets/tileview/lv_example_tileview_1.py b/examples/widgets/tileview/lv_example_tileview_1.py index eea6d32e8..fd62de4c0 100644 --- a/examples/widgets/tileview/lv_example_tileview_1.py +++ b/examples/widgets/tileview/lv_example_tileview_1.py @@ -3,7 +3,7 @@ # Demonstrate scroll chaining with a long list that # scrolls the tile view when it can't be scrolled further. # -tv = lv.tileview(lv.scr_act()) +tv = lv.tileview(lv.screen_active()) # Tile1: just a label tile1 = tv.add_tile(0, 0, lv.DIR.BOTTOM) diff --git a/examples/widgets/win/lv_example_win_1.c b/examples/widgets/win/lv_example_win_1.c index 1f64f8b4a..439155c3b 100644 --- a/examples/widgets/win/lv_example_win_1.c +++ b/examples/widgets/win/lv_example_win_1.c @@ -11,7 +11,7 @@ static void event_handler(lv_event_t * e) void lv_example_win_1(void) { - lv_obj_t * win = lv_win_create(lv_scr_act()); + lv_obj_t * win = lv_win_create(lv_screen_active()); lv_obj_t * btn; btn = lv_win_add_button(win, LV_SYMBOL_LEFT, 40); lv_obj_add_event(btn, event_handler, LV_EVENT_CLICKED, NULL); diff --git a/examples/widgets/win/lv_example_win_1.py b/examples/widgets/win/lv_example_win_1.py index bc3002248..6ec722db3 100644 --- a/examples/widgets/win/lv_example_win_1.py +++ b/examples/widgets/win/lv_example_win_1.py @@ -5,7 +5,7 @@ def event_handler(e): print("Button {:d} clicked".format(obj.get_index())) -win = lv.win(lv.scr_act()) +win = lv.win(lv.screen_active()) button1 = win.add_button(lv.SYMBOL.LEFT, 40) button1.add_event(event_handler, lv.EVENT.ALL, None) win.add_title("A title") diff --git a/src/core/lv_group.c b/src/core/lv_group.c index e2f65595a..1b5e5c93b 100644 --- a/src/core/lv_group.c +++ b/src/core/lv_group.c @@ -67,7 +67,7 @@ lv_group_t * lv_group_create(void) return group; } -void lv_group_del(lv_group_t * group) +void lv_group_delete(lv_group_t * group) { /*Defocus the currently focused object*/ if(group->obj_focus != NULL) { diff --git a/src/core/lv_group.h b/src/core/lv_group.h index 325cfb929..f7404c1ec 100644 --- a/src/core/lv_group.h +++ b/src/core/lv_group.h @@ -107,7 +107,7 @@ lv_group_t * lv_group_create(void); * Delete a group object * @param group pointer to a group */ -void lv_group_del(lv_group_t * group); +void lv_group_delete(lv_group_t * group); /** * Set a default group. New object are added to this group if it's enabled in their class with `add_to_def_group = true` diff --git a/src/core/lv_obj.c b/src/core/lv_obj.c index 50f03a83f..59e94ebff 100644 --- a/src/core/lv_obj.c +++ b/src/core/lv_obj.c @@ -44,7 +44,7 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e); static void draw_scrollbar(lv_obj_t * obj, lv_layer_t * layer); static lv_result_t scrollbar_init_draw_dsc(lv_obj_t * obj, lv_draw_rect_dsc_t * dsc); static bool obj_valid_child(const lv_obj_t * parent, const lv_obj_t * obj_to_find); -static void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state); +static void update_obj_state(lv_obj_t * obj, lv_state_t new_state); /********************** * STATIC VARIABLES @@ -124,7 +124,7 @@ void lv_obj_add_flag(lv_obj_t * obj, lv_obj_flag_t f) } } -void lv_obj_clear_flag(lv_obj_t * obj, lv_obj_flag_t f) +void lv_obj_remove_flag(lv_obj_t * obj, lv_obj_flag_t f) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -152,6 +152,13 @@ void lv_obj_clear_flag(lv_obj_t * obj, lv_obj_flag_t f) } + +void lv_obj_set_flag(lv_obj_t * obj, lv_obj_flag_t f, bool v) +{ + if(v) lv_obj_add_flag(obj, f); + else lv_obj_remove_flag(obj, f); +} + void lv_obj_add_state(lv_obj_t * obj, lv_state_t state) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -163,20 +170,27 @@ void lv_obj_add_state(lv_obj_t * obj, lv_state_t state) lv_indev_reset(NULL, obj); } - lv_obj_set_state(obj, new_state); + update_obj_state(obj, new_state); } } -void lv_obj_clear_state(lv_obj_t * obj, lv_state_t state) +void lv_obj_remove_state(lv_obj_t * obj, lv_state_t state) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_state_t new_state = obj->state & (~state); if(obj->state != new_state) { - lv_obj_set_state(obj, new_state); + update_obj_state(obj, new_state); } } + +void lv_obj_set_state(lv_obj_t * obj, lv_state_t state, bool v) +{ + if(v) lv_obj_add_state(obj, state); + else lv_obj_remove_state(obj, state); +} + /*======================= * Getter functions *======================*/ @@ -327,7 +341,7 @@ static void lv_obj_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_obj_enable_style_refresh(true); /*Remove the animations from this object*/ - lv_anim_del(obj, NULL); + lv_anim_delete(obj, NULL); /*Delete from the group*/ lv_group_t * group = lv_obj_get_group(obj); @@ -522,19 +536,19 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e) lv_obj_add_state(obj, LV_STATE_PRESSED); } else if(code == LV_EVENT_RELEASED) { - lv_obj_clear_state(obj, LV_STATE_PRESSED); + lv_obj_remove_state(obj, LV_STATE_PRESSED); void * param = lv_event_get_param(e); /*Go the checked state if enabled*/ if(lv_indev_get_scroll_obj(param) == NULL && lv_obj_has_flag(obj, LV_OBJ_FLAG_CHECKABLE)) { if(!(lv_obj_get_state(obj) & LV_STATE_CHECKED)) lv_obj_add_state(obj, LV_STATE_CHECKED); - else lv_obj_clear_state(obj, LV_STATE_CHECKED); + else lv_obj_remove_state(obj, LV_STATE_CHECKED); lv_result_t res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); if(res != LV_RESULT_OK) return; } } else if(code == LV_EVENT_PRESS_LOST) { - lv_obj_clear_state(obj, LV_STATE_PRESSED); + lv_obj_remove_state(obj, LV_STATE_PRESSED); } else if(code == LV_EVENT_STYLE_CHANGED) { uint32_t child_cnt = lv_obj_get_child_cnt(obj); @@ -550,7 +564,7 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e) lv_obj_add_state(obj, LV_STATE_CHECKED); } else if(c == LV_KEY_LEFT || c == LV_KEY_DOWN) { - lv_obj_clear_state(obj, LV_STATE_CHECKED); + lv_obj_remove_state(obj, LV_STATE_CHECKED); } /*With Enter LV_EVENT_RELEASED will send VALUE_CHANGE event*/ @@ -611,14 +625,14 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e) } else { lv_obj_add_state(obj, state); - lv_obj_clear_state(obj, LV_STATE_EDITED); + lv_obj_remove_state(obj, LV_STATE_EDITED); } } else if(code == LV_EVENT_SCROLL_BEGIN) { lv_obj_add_state(obj, LV_STATE_SCROLLED); } else if(code == LV_EVENT_SCROLL_END) { - lv_obj_clear_state(obj, LV_STATE_SCROLLED); + lv_obj_remove_state(obj, LV_STATE_SCROLLED); if(lv_obj_get_scrollbar_mode(obj) == LV_SCROLLBAR_MODE_ACTIVE) { lv_area_t hor_area, ver_area; lv_obj_get_scrollbar_area(obj, &hor_area, &ver_area); @@ -627,7 +641,7 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e) } } else if(code == LV_EVENT_DEFOCUSED) { - lv_obj_clear_state(obj, LV_STATE_FOCUSED | LV_STATE_EDITED | LV_STATE_FOCUS_KEY); + lv_obj_remove_state(obj, LV_STATE_FOCUSED | LV_STATE_EDITED | LV_STATE_FOCUS_KEY); } else if(code == LV_EVENT_SIZE_CHANGED) { lv_coord_t align = lv_obj_get_style_align(obj, LV_PART_MAIN); @@ -660,8 +674,8 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e) lv_obj_draw(e); } else if(code == LV_EVENT_INDEV_RESET) { - lv_obj_clear_state(obj, LV_STATE_PRESSED); - lv_obj_clear_state(obj, LV_STATE_SCROLLED); + lv_obj_remove_state(obj, LV_STATE_PRESSED); + lv_obj_remove_state(obj, LV_STATE_SCROLLED); } } @@ -671,7 +685,7 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e) * @param obj pointer to an object * @param state the new state */ -static void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state) +static void update_obj_state(lv_obj_t * obj, lv_state_t new_state) { if(obj->state == new_state) return; diff --git a/src/core/lv_obj.h b/src/core/lv_obj.h index b6d69dd3d..d55178c8c 100644 --- a/src/core/lv_obj.h +++ b/src/core/lv_obj.h @@ -228,8 +228,15 @@ void lv_obj_add_flag(lv_obj_t * obj, lv_obj_flag_t f); * @param obj pointer to an object * @param f OR-ed values from `lv_obj_flag_t` to set. */ -void lv_obj_clear_flag(lv_obj_t * obj, lv_obj_flag_t f); +void lv_obj_remove_flag(lv_obj_t * obj, lv_obj_flag_t f); +/** + * Set add or remove one or more flags. + * @param obj pointer to an object + * @param f OR-ed values from `lv_obj_flag_t` to set. + * @param v true: add the flags; false: remove the flags + */ +void lv_obj_set_flag(lv_obj_t * obj, lv_obj_flag_t f, bool v); /** * Add one or more states to the object. The other state bits will remain unchanged. @@ -245,7 +252,15 @@ void lv_obj_add_state(lv_obj_t * obj, lv_state_t state); * @param obj pointer to an object * @param state the states to add. E.g `LV_STATE_PRESSED | LV_STATE_FOCUSED` */ -void lv_obj_clear_state(lv_obj_t * obj, lv_state_t state); +void lv_obj_remove_state(lv_obj_t * obj, lv_state_t state); + +/** + * Add or remove one or more states to the object. The other state bits will remain unchanged. + * @param obj pointer to an object + * @param state the states to add. E.g `LV_STATE_PRESSED | LV_STATE_FOCUSED` + * @param v true: add the states; false: remove the states + */ +void lv_obj_set_state(lv_obj_t * obj, lv_state_t state, bool v); /** * Set the user_data field of the object diff --git a/src/core/lv_obj_pos.c b/src/core/lv_obj_pos.c index efd6672c7..770159ee2 100644 --- a/src/core/lv_obj_pos.c +++ b/src/core/lv_obj_pos.c @@ -835,8 +835,8 @@ bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area) /*Invalidate the object only if it belongs to the current or previous or one of the layers'*/ lv_obj_t * obj_scr = lv_obj_get_screen(obj); lv_display_t * disp = lv_obj_get_disp(obj_scr); - if(obj_scr != lv_display_get_scr_act(disp) && - obj_scr != lv_display_get_scr_prev(disp) && + if(obj_scr != lv_display_get_screen_act(disp) && + obj_scr != lv_display_get_screen_prev(disp) && obj_scr != lv_display_get_layer_bottom(disp) && obj_scr != lv_display_get_layer_top(disp) && obj_scr != lv_display_get_layer_sys(disp)) { diff --git a/src/core/lv_obj_scroll.c b/src/core/lv_obj_scroll.c index 3a8aee85e..bf46d4b9f 100644 --- a/src/core/lv_obj_scroll.c +++ b/src/core/lv_obj_scroll.c @@ -346,8 +346,8 @@ void lv_obj_scroll_by(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_anim_enab } else { /*Remove pending animations*/ - lv_anim_del(obj, scroll_y_anim); - lv_anim_del(obj, scroll_x_anim); + lv_anim_delete(obj, scroll_y_anim); + lv_anim_delete(obj, scroll_x_anim); lv_result_t res; res = lv_obj_send_event(obj, LV_EVENT_SCROLL_BEGIN, NULL); @@ -369,7 +369,7 @@ void lv_obj_scroll_to(lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_anim_enable void lv_obj_scroll_to_x(lv_obj_t * obj, lv_coord_t x, lv_anim_enable_t anim_en) { - lv_anim_del(obj, scroll_x_anim); + lv_anim_delete(obj, scroll_x_anim); lv_coord_t scroll_x = lv_obj_get_scroll_x(obj); lv_coord_t diff = -x + scroll_x; @@ -379,7 +379,7 @@ void lv_obj_scroll_to_x(lv_obj_t * obj, lv_coord_t x, lv_anim_enable_t anim_en) void lv_obj_scroll_to_y(lv_obj_t * obj, lv_coord_t y, lv_anim_enable_t anim_en) { - lv_anim_del(obj, scroll_y_anim); + lv_anim_delete(obj, scroll_y_anim); lv_coord_t scroll_y = lv_obj_get_scroll_y(obj); lv_coord_t diff = -y + scroll_y; @@ -782,8 +782,8 @@ static void scroll_area_into_view(const lv_area_t * area, lv_obj_t * child, lv_p } /*Remove any pending scroll animations.*/ - bool y_del = lv_anim_del(parent, scroll_y_anim); - bool x_del = lv_anim_del(parent, scroll_x_anim); + bool y_del = lv_anim_delete(parent, scroll_y_anim); + bool x_del = lv_anim_delete(parent, scroll_x_anim); if(y_del || x_del) { lv_result_t res; res = lv_obj_send_event(parent, LV_EVENT_SCROLL_END, NULL); diff --git a/src/core/lv_obj_style.c b/src/core/lv_obj_style.c index b83199db1..e3213db6e 100644 --- a/src/core/lv_obj_style.c +++ b/src/core/lv_obj_style.c @@ -52,7 +52,7 @@ static _lv_obj_style_t * get_trans_style(lv_obj_t * obj, uint32_t part); static lv_style_res_t get_prop_core(const lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, lv_style_value_t * v); static void report_style_change_core(void * style, lv_obj_t * obj); static void refresh_children_style(lv_obj_t * obj); -static bool trans_del(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, trans_t * tr_limit); +static bool trans_delete(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, trans_t * tr_limit); static void trans_anim_cb(void * _tr, int32_t v); static void trans_anim_start_cb(lv_anim_t * a); static void trans_anim_ready_cb(lv_anim_t * a); @@ -83,7 +83,7 @@ void lv_obj_add_style(lv_obj_t * obj, const lv_style_t * style, lv_style_selecto { LV_ASSERT(obj->style_cnt < 63); - trans_del(obj, selector, LV_STYLE_PROP_ANY, NULL); + trans_delete(obj, selector, LV_STYLE_PROP_ANY, NULL); lv_part_t part = lv_obj_style_get_selector_part(selector); @@ -151,7 +151,7 @@ bool lv_obj_replace_style(struct _lv_obj_t * obj, const lv_style_t * old_style, } /*Similar to lv_obj_add_style, delete transition*/ - trans_del(obj, selector, LV_STYLE_PROP_ANY, NULL); + trans_delete(obj, selector, LV_STYLE_PROP_ANY, NULL); bool replaced = false; uint32_t i; @@ -209,7 +209,7 @@ void lv_obj_remove_style(lv_obj_t * obj, const lv_style_t * style, lv_style_sele } if(obj->styles[i].is_trans) { - trans_del(obj, part, LV_STYLE_PROP_ANY, NULL); + trans_delete(obj, part, LV_STYLE_PROP_ANY, NULL); } if(obj->styles[i].is_local || obj->styles[i].is_trans) { @@ -882,7 +882,7 @@ static void refresh_children_style(lv_obj_t * obj) * @param prop a property or 0xFF to remove all properties * @param tr_limit delete transitions only "older" than this. `NULL` if not used */ -static bool trans_del(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, trans_t * tr_limit) +static bool trans_delete(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, trans_t * tr_limit) { trans_t * tr; trans_t * tr_prev; @@ -905,7 +905,7 @@ static bool trans_del(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, tran } /*Free the transition descriptor too*/ - lv_anim_del(tr, NULL); + lv_anim_delete(tr, NULL); _lv_ll_remove(style_trans_ll_p, tr); lv_free(tr); removed = true; @@ -992,7 +992,7 @@ static void trans_anim_start_cb(lv_anim_t * a) tr->prop = LV_STYLE_PROP_INV; /*Delete the related transitions if any*/ - trans_del(tr->obj, part, prop_tmp, tr); + trans_delete(tr->obj, part, prop_tmp, tr); tr->prop = prop_tmp; diff --git a/src/core/lv_obj_tree.c b/src/core/lv_obj_tree.c index 3221c8ed0..64efb0f9e 100644 --- a/src/core/lv_obj_tree.c +++ b/src/core/lv_obj_tree.c @@ -32,8 +32,8 @@ /********************** * STATIC PROTOTYPES **********************/ -static void lv_obj_del_async_cb(void * obj); -static void obj_del_core(lv_obj_t * obj); +static void lv_obj_delete_async_cb(void * obj); +static void obj_delete_core(lv_obj_t * obj); static lv_obj_tree_walk_res_t walk_core(lv_obj_t * obj, lv_obj_tree_walk_cb_t cb, void * user_data); static lv_obj_tree_walk_res_t dump_tree_core(lv_obj_t * obj, lv_coord_t depth); @@ -49,7 +49,7 @@ static lv_obj_tree_walk_res_t dump_tree_core(lv_obj_t * obj, lv_coord_t depth); * GLOBAL FUNCTIONS **********************/ -void lv_obj_del(lv_obj_t * obj) +void lv_obj_delete(lv_obj_t * obj) { if(obj->is_deleting) return; @@ -64,14 +64,14 @@ void lv_obj_del(lv_obj_t * obj) } lv_display_t * disp = NULL; - bool act_scr_del = false; + bool act_screen_del = false; if(par == NULL) { disp = lv_obj_get_disp(obj); if(!disp) return; /*Shouldn't happen*/ - if(disp->act_scr == obj) act_scr_del = true; + if(disp->act_scr == obj) act_screen_del = true; } - obj_del_core(obj); + obj_delete_core(obj); /*Call the ancestor's event handler to the parent to notify it about the child delete*/ if(par && !par->is_deleting) { @@ -83,7 +83,7 @@ void lv_obj_del(lv_obj_t * obj) } /*Handle if the active screen was deleted*/ - if(act_scr_del) { + if(act_screen_del) { LV_LOG_WARN("the active screen was deleted"); disp->act_scr = NULL; } @@ -101,7 +101,7 @@ void lv_obj_clean(lv_obj_t * obj) lv_obj_t * child = lv_obj_get_child(obj, 0); while(child) { - obj_del_core(child); + obj_delete_core(child); child = lv_obj_get_child(obj, 0); } /*Just to remove scroll animations if any*/ @@ -116,7 +116,7 @@ void lv_obj_clean(lv_obj_t * obj) LV_LOG_TRACE("finished (clean %p)", (void *)obj); } -void lv_obj_del_delayed(lv_obj_t * obj, uint32_t delay_ms) +void lv_obj_delete_delayed(lv_obj_t * obj, uint32_t delay_ms) { lv_anim_t a; lv_anim_init(&a); @@ -124,19 +124,19 @@ void lv_obj_del_delayed(lv_obj_t * obj, uint32_t delay_ms) lv_anim_set_exec_cb(&a, NULL); lv_anim_set_time(&a, 1); lv_anim_set_delay(&a, delay_ms); - lv_anim_set_ready_cb(&a, lv_obj_del_anim_ready_cb); + lv_anim_set_ready_cb(&a, lv_obj_delete_anim_ready_cb); lv_anim_start(&a); } -void lv_obj_del_anim_ready_cb(lv_anim_t * a) +void lv_obj_delete_anim_ready_cb(lv_anim_t * a) { - lv_obj_del(a->var); + lv_obj_delete(a->var); } -void lv_obj_del_async(lv_obj_t * obj) +void lv_obj_delete_async(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_async_call(lv_obj_del_async_cb, obj); + lv_async_call(lv_obj_delete_async_cb, obj); } void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent) @@ -390,14 +390,14 @@ void lv_obj_dump_tree(lv_obj_t * start_obj) * STATIC FUNCTIONS **********************/ -static void lv_obj_del_async_cb(void * obj) +static void lv_obj_delete_async_cb(void * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_obj_del(obj); + lv_obj_delete(obj); } -static void obj_del_core(lv_obj_t * obj) +static void obj_delete_core(lv_obj_t * obj) { if(obj->is_deleting) return; @@ -417,7 +417,7 @@ static void obj_del_core(lv_obj_t * obj) /*Recursively delete the children*/ lv_obj_t * child = lv_obj_get_child(obj, 0); while(child) { - obj_del_core(child); + obj_delete_core(child); child = lv_obj_get_child(obj, 0); } @@ -445,7 +445,7 @@ static void obj_del_core(lv_obj_t * obj) /*Delete all pending async del-s*/ lv_result_t async_cancel_res = LV_RESULT_OK; while(async_cancel_res == LV_RESULT_OK) { - async_cancel_res = lv_async_call_cancel(lv_obj_del_async_cb, obj); + async_cancel_res = lv_async_call_cancel(lv_obj_delete_async_cb, obj); } /*All children deleted. Now clean up the object specific data*/ diff --git a/src/core/lv_obj_tree.h b/src/core/lv_obj_tree.h index 6471865e3..c881386d2 100644 --- a/src/core/lv_obj_tree.h +++ b/src/core/lv_obj_tree.h @@ -49,7 +49,7 @@ typedef lv_obj_tree_walk_res_t (*lv_obj_tree_walk_cb_t)(struct _lv_obj_t *, void * Send `LV_EVENT_DELETED` to deleted objects. * @param obj pointer to an object */ -void lv_obj_del(struct _lv_obj_t * obj); +void lv_obj_delete(struct _lv_obj_t * obj); /** * Delete all children of an object. @@ -64,13 +64,13 @@ void lv_obj_clean(struct _lv_obj_t * obj); * @param obj pointer to an object * @param delay_ms time to wait before delete in milliseconds */ -void lv_obj_del_delayed(struct _lv_obj_t * obj, uint32_t delay_ms); +void lv_obj_delete_delayed(struct _lv_obj_t * obj, uint32_t delay_ms); /** * A function to be easily used in animation ready callback to delete an object when the animation is ready * @param a pointer to the animation */ -void lv_obj_del_anim_ready_cb(lv_anim_t * a); +void lv_obj_delete_anim_ready_cb(lv_anim_t * a); /** * Helper function for asynchronously deleting objects. @@ -78,7 +78,7 @@ void lv_obj_del_anim_ready_cb(lv_anim_t * a); * @param obj object to delete * @see lv_async_call */ -void lv_obj_del_async(struct _lv_obj_t * obj); +void lv_obj_delete_async(struct _lv_obj_t * obj); /** * Move the parent of an object. The relative coordinates will be kept. diff --git a/src/core/lv_refr.c b/src/core/lv_refr.c index 82f213c90..f69ad63a9 100644 --- a/src/core/lv_refr.c +++ b/src/core/lv_refr.c @@ -664,7 +664,7 @@ static void refr_area_part(lv_layer_t * layer) lv_obj_t * top_prev_scr = NULL; /*Get the most top object which is not covered by others*/ - top_act_scr = lv_refr_get_top_obj(&layer->clip_area, lv_display_get_scr_act(disp_refr)); + top_act_scr = lv_refr_get_top_obj(&layer->clip_area, lv_display_get_screen_act(disp_refr)); if(disp_refr->prev_scr) { top_prev_scr = lv_refr_get_top_obj(&layer->clip_area, disp_refr->prev_scr); } @@ -753,7 +753,7 @@ static void refr_obj_and_children(lv_layer_t * layer, lv_obj_t * top_obj) /*Normally always will be a top_obj (at least the screen) *but in special cases (e.g. if the screen has alpha) it won't. *In this case use the screen directly*/ - if(top_obj == NULL) top_obj = lv_display_get_scr_act(disp_refr); + if(top_obj == NULL) top_obj = lv_display_get_screen_act(disp_refr); if(top_obj == NULL) return; /*Shouldn't happen*/ /*Refresh the top object and its children*/ diff --git a/src/dev/sdl/lv_sdl_window.c b/src/dev/sdl/lv_sdl_window.c index d0971f3dd..4493707bd 100644 --- a/src/dev/sdl/lv_sdl_window.c +++ b/src/dev/sdl/lv_sdl_window.c @@ -153,7 +153,7 @@ void lv_sdl_quit() { if(inited) { SDL_Quit(); - lv_timer_del(event_handler_timer); + lv_timer_delete(event_handler_timer); inited = false; } } @@ -236,7 +236,7 @@ static void sdl_event_handler(lv_timer_t * t) } if(event.type == SDL_QUIT) { SDL_Quit(); - lv_timer_del(event_handler_timer); + lv_timer_delete(event_handler_timer); inited = false; #if LV_SDL_DIRECT_EXIT exit(0); diff --git a/src/display/lv_display.c b/src/display/lv_display.c index 6ff9b3003..603b81142 100644 --- a/src/display/lv_display.c +++ b/src/display/lv_display.c @@ -39,7 +39,7 @@ static void opa_scale_anim(void * obj, int32_t v); static void set_x_anim(void * obj, int32_t v); static void set_y_anim(void * obj, int32_t v); static void scr_anim_ready(lv_anim_t * a); -static bool is_out_anim(lv_scr_load_anim_t a); +static bool is_out_anim(lv_screen_load_anim_t a); static void disp_event_cb(lv_event_t * e); /********************** @@ -116,8 +116,8 @@ lv_display_t * lv_display_create(lv_coord_t hor_res, lv_coord_t ver_res) lv_obj_remove_style_all(disp->bottom_layer); lv_obj_remove_style_all(disp->top_layer); lv_obj_remove_style_all(disp->sys_layer); - lv_obj_clear_flag(disp->top_layer, LV_OBJ_FLAG_CLICKABLE); - lv_obj_clear_flag(disp->sys_layer, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(disp->top_layer, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(disp->sys_layer, LV_OBJ_FLAG_CLICKABLE); lv_obj_set_scrollbar_mode(disp->bottom_layer, LV_SCROLLBAR_MODE_OFF); lv_obj_set_scrollbar_mode(disp->top_layer, LV_SCROLLBAR_MODE_OFF); @@ -156,26 +156,26 @@ void lv_display_remove(lv_display_t * disp) /* Delete screen and other obj */ if(disp->sys_layer) { - lv_obj_del(disp->sys_layer); + lv_obj_delete(disp->sys_layer); disp->sys_layer = NULL; } if(disp->top_layer) { - lv_obj_del(disp->top_layer); + lv_obj_delete(disp->top_layer); disp->top_layer = NULL; } if(disp->bottom_layer) { - lv_obj_del(disp->bottom_layer); + lv_obj_delete(disp->bottom_layer); disp->bottom_layer = NULL; } while(disp->screen_cnt != 0) { /*Delete the screenst*/ - lv_obj_del(disp->screens[0]); + lv_obj_delete(disp->screens[0]); } _lv_ll_clear(&disp->sync_areas); _lv_ll_remove(disp_ll_p, disp); - if(disp->refr_timer) lv_timer_del(disp->refr_timer); + if(disp->refr_timer) lv_timer_delete(disp->refr_timer); lv_free(disp); if(was_default) lv_display_set_default(_lv_ll_get_head(disp_ll_p)); @@ -448,7 +448,7 @@ bool lv_display_is_double_buffered(lv_display_t * disp) * SCREENS *--------------------*/ -lv_obj_t * lv_display_get_scr_act(lv_display_t * disp) +lv_obj_t * lv_display_get_screen_act(lv_display_t * disp) { if(!disp) disp = lv_display_get_default(); if(!disp) { @@ -459,7 +459,7 @@ lv_obj_t * lv_display_get_scr_act(lv_display_t * disp) return disp->act_scr; } -lv_obj_t * lv_display_get_scr_prev(lv_display_t * disp) +lv_obj_t * lv_display_get_screen_prev(lv_display_t * disp) { if(!disp) disp = lv_display_get_default(); if(!disp) { @@ -472,7 +472,7 @@ lv_obj_t * lv_display_get_scr_prev(lv_display_t * disp) void lv_display_load_scr(lv_obj_t * scr) { - lv_scr_load_anim(scr, LV_SCR_LOAD_ANIM_NONE, 0, 0, false); + lv_screen_load_anim(scr, LV_SCR_LOAD_ANIM_NONE, 0, 0, false); } lv_obj_t * lv_display_get_layer_top(lv_display_t * disp) @@ -508,10 +508,11 @@ lv_obj_t * lv_display_get_layer_bottom(lv_display_t * disp) return disp->bottom_layer; } -void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t time, uint32_t delay, bool auto_del) +void lv_screen_load_anim(lv_obj_t * new_scr, lv_screen_load_anim_t anim_type, uint32_t time, uint32_t delay, + bool auto_del) { lv_display_t * d = lv_obj_get_disp(new_scr); - lv_obj_t * act_scr = lv_scr_act(); + lv_obj_t * act_scr = lv_screen_active(); if(act_scr == new_scr || d->scr_to_load == new_scr) { return; @@ -521,12 +522,12 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t *make target screen loaded immediately. */ if(d->scr_to_load && act_scr != d->scr_to_load) { scr_load_internal(d->scr_to_load); - lv_anim_del(d->scr_to_load, NULL); + lv_anim_delete(d->scr_to_load, NULL); lv_obj_set_pos(d->scr_to_load, 0, 0); lv_obj_remove_local_style_prop(d->scr_to_load, LV_STYLE_OPA, 0); if(d->del_prev) { - lv_obj_del(act_scr); + lv_obj_delete(act_scr); } act_scr = d->scr_to_load; } @@ -534,7 +535,7 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t d->scr_to_load = new_scr; if(d->prev_scr && d->del_prev) { - lv_obj_del(d->prev_scr); + lv_obj_delete(d->prev_scr); d->prev_scr = NULL; } @@ -542,14 +543,14 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t d->del_prev = auto_del; /*Be sure there is no other animation on the screens*/ - lv_anim_del(new_scr, NULL); - lv_anim_del(lv_scr_act(), NULL); + lv_anim_delete(new_scr, NULL); + lv_anim_delete(lv_screen_active(), NULL); /*Be sure both screens are in a normal position*/ lv_obj_set_pos(new_scr, 0, 0); - lv_obj_set_pos(lv_scr_act(), 0, 0); + lv_obj_set_pos(lv_screen_active(), 0, 0); lv_obj_remove_local_style_prop(new_scr, LV_STYLE_OPA, 0); - lv_obj_remove_local_style_prop(lv_scr_act(), LV_STYLE_OPA, 0); + lv_obj_remove_local_style_prop(lv_screen_active(), LV_STYLE_OPA, 0); /*Shortcut for immediate load*/ @@ -557,7 +558,7 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t scr_load_internal(new_scr); d->scr_to_load = NULL; - if(auto_del) lv_obj_del(act_scr); + if(auto_del) lv_obj_delete(act_scr); return; } @@ -905,7 +906,7 @@ static void scr_load_anim_start(lv_anim_t * a) { lv_display_t * d = lv_obj_get_disp(a->var); - d->prev_scr = lv_scr_act(); + d->prev_scr = lv_screen_active(); d->act_scr = a->var; lv_obj_send_event(d->act_scr, LV_EVENT_SCREEN_LOAD_START, NULL); @@ -933,7 +934,7 @@ static void scr_anim_ready(lv_anim_t * a) lv_obj_send_event(d->act_scr, LV_EVENT_SCREEN_LOADED, NULL); lv_obj_send_event(d->prev_scr, LV_EVENT_SCREEN_UNLOADED, NULL); - if(d->prev_scr && d->del_prev) lv_obj_del(d->prev_scr); + if(d->prev_scr && d->del_prev) lv_obj_delete(d->prev_scr); d->prev_scr = NULL; d->draw_prev_over_act = false; d->scr_to_load = NULL; @@ -941,7 +942,7 @@ static void scr_anim_ready(lv_anim_t * a) lv_obj_invalidate(d->act_scr); } -static bool is_out_anim(lv_scr_load_anim_t anim_type) +static bool is_out_anim(lv_screen_load_anim_t anim_type) { return anim_type == LV_SCR_LOAD_ANIM_FADE_OUT || anim_type == LV_SCR_LOAD_ANIM_OUT_LEFT || diff --git a/src/display/lv_display.h b/src/display/lv_display.h index 9472f7b39..fd7a8e4ef 100644 --- a/src/display/lv_display.h +++ b/src/display/lv_display.h @@ -81,7 +81,7 @@ typedef enum { LV_SCR_LOAD_ANIM_OUT_RIGHT, LV_SCR_LOAD_ANIM_OUT_TOP, LV_SCR_LOAD_ANIM_OUT_BOTTOM, -} lv_scr_load_anim_t; +} lv_screen_load_anim_t; typedef void (*lv_display_flush_cb_t)(struct _lv_display_t * disp, const lv_area_t * area, uint8_t * px_map); @@ -312,9 +312,9 @@ bool lv_display_is_double_buffered(lv_display_t * disp); * Return a pointer to the active screen on a display * @param disp pointer to display which active screen should be get. * (NULL to use the default screen) - * @return pointer to the active screen object (loaded by 'lv_scr_load()') + * @return pointer to the active screen object (loaded by 'lv_screen_load()') */ -struct _lv_obj_t * lv_display_get_scr_act(lv_display_t * disp); +struct _lv_obj_t * lv_display_get_screen_act(lv_display_t * disp); /** * Return with a pointer to the previous screen. Only used during screen transitions. @@ -322,7 +322,7 @@ struct _lv_obj_t * lv_display_get_scr_act(lv_display_t * disp); * (NULL to use the default screen) * @return pointer to the previous screen object or NULL if not used now */ -struct _lv_obj_t * lv_display_get_scr_prev(lv_display_t * disp); +struct _lv_obj_t * lv_display_get_screen_prev(lv_display_t * disp); /** * Make a screen active @@ -357,21 +357,21 @@ struct _lv_obj_t * lv_display_get_layer_bottom(lv_display_t * disp); /** * Switch screen with animation * @param scr pointer to the new screen to load - * @param anim_type type of the animation from `lv_scr_load_anim_t`, e.g. `LV_SCR_LOAD_ANIM_MOVE_LEFT` + * @param anim_type type of the animation from `lv_screen_load_anim_t`, e.g. `LV_SCR_LOAD_ANIM_MOVE_LEFT` * @param time time of the animation * @param delay delay before the transition * @param auto_del true: automatically delete the old screen */ -void lv_scr_load_anim(struct _lv_obj_t * scr, lv_scr_load_anim_t anim_type, uint32_t time, uint32_t delay, - bool auto_del); +void lv_screen_load_anim(struct _lv_obj_t * scr, lv_screen_load_anim_t anim_type, uint32_t time, uint32_t delay, + bool auto_del); /** * Get the active screen of the default display * @return pointer to the active screen */ -static inline struct _lv_obj_t * lv_scr_act(void) +static inline struct _lv_obj_t * lv_screen_active(void) { - return lv_display_get_scr_act(lv_display_get_default()); + return lv_display_get_screen_act(lv_display_get_default()); } /** @@ -405,7 +405,7 @@ static inline struct _lv_obj_t * lv_layer_bottom(void) * Load a screen on the default display * @param scr pointer to a screen */ -static inline void lv_scr_load(struct _lv_obj_t * scr) +static inline void lv_screen_load(struct _lv_obj_t * scr) { lv_display_load_scr(scr); } diff --git a/src/display/lv_display_private.h b/src/display/lv_display_private.h index 8ac0c42a5..48821b910 100644 --- a/src/display/lv_display_private.h +++ b/src/display/lv_display_private.h @@ -110,7 +110,7 @@ struct _lv_display_t { struct _lv_obj_t ** screens; /**< Array of screen objects.*/ struct _lv_obj_t * act_scr; /**< Currently active screen on this display*/ struct _lv_obj_t * prev_scr; /**< Previous screen. Used during screen animations*/ - struct _lv_obj_t * scr_to_load; /**< The screen prepared to load in lv_scr_load_anim*/ + struct _lv_obj_t * scr_to_load; /**< The screen prepared to load in lv_screen_load_anim*/ struct _lv_obj_t * bottom_layer; /**< @see lv_display_get_layer_bottom*/ struct _lv_obj_t * top_layer; /**< @see lv_display_get_layer_top*/ struct _lv_obj_t * sys_layer; /**< @see lv_display_get_layer_sys*/ diff --git a/src/draw/lv_draw_mask.c b/src/draw/lv_draw_mask.c index 7154435af..3c97f840d 100644 --- a/src/draw/lv_draw_mask.c +++ b/src/draw/lv_draw_mask.c @@ -60,7 +60,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_mask_rect(struct _lv_layer_t * layer, const l if(base_dsc->obj && lv_obj_has_flag(base_dsc->obj, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS)) { /*Disable sending LV_EVENT_DRAW_TASK_ADDED first to avoid triggering recursive *event calls due draw task adds in the event*/ - lv_obj_clear_flag(base_dsc->obj, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS); + lv_obj_remove_flag(base_dsc->obj, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS); lv_obj_send_event(dsc->base.obj, LV_EVENT_DRAW_TASK_ADDED, t); lv_obj_add_flag(base_dsc->obj, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS); } diff --git a/src/indev/lv_indev.c b/src/indev/lv_indev.c index 2220285ff..8c4bd4597 100644 --- a/src/indev/lv_indev.c +++ b/src/indev/lv_indev.c @@ -123,7 +123,7 @@ void lv_indev_delete(lv_indev_t * indev) { LV_ASSERT_NULL(indev); /*Clean up the read timer first*/ - if(indev->read_timer) lv_timer_del(indev->read_timer); + if(indev->read_timer) lv_timer_delete(indev->read_timer); /*Remove the input device from the list*/ _lv_ll_remove(indev_ll_head, indev); /*Free the memory of the input device*/ @@ -364,7 +364,7 @@ void lv_indev_set_cursor(lv_indev_t * indev, lv_obj_t * cur_obj) indev->cursor = cur_obj; lv_obj_set_parent(indev->cursor, lv_display_get_layer_sys(indev->disp)); lv_obj_set_pos(indev->cursor, indev->pointer.act_point.x, indev->pointer.act_point.y); - lv_obj_clear_flag(indev->cursor, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(indev->cursor, LV_OBJ_FLAG_CLICKABLE); lv_obj_add_flag(indev->cursor, LV_OBJ_FLAG_IGNORE_LAYOUT | LV_OBJ_FLAG_FLOATING); } @@ -801,7 +801,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) if(lv_group_get_obj_count(g) > 1) { LV_LOG_INFO("toggling edit mode"); lv_group_set_editing(g, lv_group_get_editing(g) ? false : true); /*Toggle edit mode on long press*/ - lv_obj_clear_state(indev_obj_act, LV_STATE_PRESSED); /*Remove the pressed state manually*/ + lv_obj_remove_state(indev_obj_act, LV_STATE_PRESSED); /*Remove the pressed state manually*/ } } /*If not editable then just send a long press Call the ancestor's event handler*/ @@ -875,7 +875,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) if(indev_reset_check(i)) return; } else { - lv_obj_clear_state(indev_obj_act, LV_STATE_PRESSED); /*Remove the pressed state manually*/ + lv_obj_remove_state(indev_obj_act, LV_STATE_PRESSED); /*Remove the pressed state manually*/ } } /*If the focused object is editable and now in navigate mode then on enter switch edit @@ -1201,7 +1201,7 @@ static lv_obj_t * pointer_search_obj(lv_display_t * disp, lv_point_t * p) if(indev_obj_act) return indev_obj_act; /* Search the object in the active screen */ - indev_obj_act = lv_indev_search_obj(lv_display_get_scr_act(disp), p); + indev_obj_act = lv_indev_search_obj(lv_display_get_screen_act(disp), p); if(indev_obj_act) return indev_obj_act; indev_obj_act = lv_indev_search_obj(lv_display_get_layer_bottom(disp), p); diff --git a/src/libs/ffmpeg/lv_ffmpeg.c b/src/libs/ffmpeg/lv_ffmpeg.c index 32ff9fb06..163848e7c 100644 --- a/src/libs/ffmpeg/lv_ffmpeg.c +++ b/src/libs/ffmpeg/lv_ffmpeg.c @@ -835,7 +835,7 @@ static void lv_ffmpeg_player_destructor(const lv_obj_class_t * class_p, lv_ffmpeg_player_t * player = (lv_ffmpeg_player_t *)obj; if(player->timer) { - lv_timer_del(player->timer); + lv_timer_delete(player->timer); player->timer = NULL; } diff --git a/src/libs/freetype/lv_freetype.c b/src/libs/freetype/lv_freetype.c index 093cc342e..87fe2ff85 100644 --- a/src/libs/freetype/lv_freetype.c +++ b/src/libs/freetype/lv_freetype.c @@ -227,7 +227,7 @@ lv_font_t * lv_freetype_font_create(const char * pathname, uint16_t size, uint16 return font; } -void lv_freetype_font_del(lv_font_t * font) +void lv_freetype_font_delete(lv_font_t * font) { LV_ASSERT_NULL(font); lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)(font->dsc); diff --git a/src/libs/freetype/lv_freetype.h b/src/libs/freetype/lv_freetype.h index 8ebedbc62..ba129e5ae 100644 --- a/src/libs/freetype/lv_freetype.h +++ b/src/libs/freetype/lv_freetype.h @@ -61,7 +61,7 @@ lv_font_t * lv_freetype_font_create(const char * pathname, uint16_t size, uint16 * Delete a freetype font. * @param font freetype font to be deleted. */ -void lv_freetype_font_del(lv_font_t * font); +void lv_freetype_font_delete(lv_font_t * font); /********************** * MACROS diff --git a/src/libs/gif/lv_gif.c b/src/libs/gif/lv_gif.c index c50415385..ac4192edc 100644 --- a/src/libs/gif/lv_gif.c +++ b/src/libs/gif/lv_gif.c @@ -134,7 +134,7 @@ static void lv_gif_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) if(gifobj->gif) gd_close_gif(gifobj->gif); - lv_timer_del(gifobj->timer); + lv_timer_delete(gifobj->timer); } static void next_frame_task_cb(lv_timer_t * t) diff --git a/src/libs/lodepng/lodepng.h b/src/libs/lodepng/lodepng.h index db112b51f..31cc61fe1 100644 --- a/src/libs/lodepng/lodepng.h +++ b/src/libs/lodepng/lodepng.h @@ -1180,7 +1180,7 @@ The following features are supported by the decoder: *) encoding of PNGs, from any raw image to 24- or 32-bit color, or the same color type as the raw image *) Adam7 interlace and deinterlace for any color type *) loading the image from harddisk or decoding it from a buffer from other sources than harddisk -*) support for alpha channels, including RGBA color model, translucent palettes and color keying +*) support for alpha channels, including RGBA color modelete,translucent palettes and color keying *) zlib decompression (inflate) *) zlib compression (deflate) *) CRC32 and ADLER32 checksums diff --git a/src/libs/rlottie/lv_rlottie.c b/src/libs/rlottie/lv_rlottie.c index 3e0ff28d3..aa51c44f3 100644 --- a/src/libs/rlottie/lv_rlottie.c +++ b/src/libs/rlottie/lv_rlottie.c @@ -170,7 +170,7 @@ static void lv_rlottie_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj } if(rlottie->task) { - lv_timer_del(rlottie->task); + lv_timer_delete(rlottie->task); rlottie->task = NULL; rlottie->play_ctrl = LV_RLOTTIE_CTRL_FORWARD; rlottie->dest_frame = 0; diff --git a/src/lv_api_map.h b/src/lv_api_map.h index a56d4e4ce..c41eda69e 100644 --- a/src/lv_api_map.h +++ b/src/lv_api_map.h @@ -19,7 +19,6 @@ extern "C" { * DEFINES *********************/ - #define LV_DISP_ROTATION_0 LV_DISPLAY_ROTATION_0 #define LV_DISP_ROTATION_90 LV_DISPLAY_ROTATION_90 #define LV_DISP_ROTATION_180 LV_DISPLAY_ROTATION_180 @@ -98,6 +97,12 @@ static inline void lv_obj_move_background(lv_obj_t * obj) #define LV_INDEV_STATE_PR LV_INDEV_STATE_PRESSED #define LV_INDEV_STATE_REL LV_INDEV_STATE_RELEASED +#define lv_obj_del lv_obj_delete +#define lv_obj_del_async lv_obj_delete_async +#define lv_obj_clear_flag lv_obj_remove_flag +#define lv_obj_clear_state lv_obj_remove_state + +#define lv_scr_act lv_screen_active #define lv_disp_create lv_display_create #define lv_disp_remove lv_display_remove #define lv_disp_set_default lv_display_set_default @@ -125,8 +130,8 @@ static inline void lv_obj_move_background(lv_obj_t * obj) #define lv_disp_flush_ready lv_display_flush_ready #define lv_disp_flush_is_last lv_display_flush_is_last #define lv_disp_is_double_buffered lv_display_is_double_buffered -#define lv_disp_get_scr_act lv_display_get_scr_act -#define lv_disp_get_scr_prev lv_display_get_scr_prev +#define lv_disp_get_scr_act lv_display_get_screen_act +#define lv_disp_get_scr_prev lv_display_get_screen_prev #define lv_disp_load_scr lv_display_load_scr #define lv_disp_get_layer_top lv_display_get_layer_top #define lv_disp_get_layer_sys lv_display_get_layer_sys @@ -150,6 +155,12 @@ static inline void lv_obj_move_background(lv_obj_t * obj) #define _lv_disp_get_refr_timer _lv_display_get_refr_timer #define lv_disp_render_mode_t lv_display_render_mode_t +#define lv_timer_del lv_timer_delete + +#define lv_anim_del lv_anim_delete +#define lv_anim_del_all lv_anim_delete_all + +#define lv_group_del lv_group_delete #define lv_txt_get_size lv_text_get_size #define lv_txt_get_width lv_text_get_width diff --git a/src/misc/lv_anim.c b/src/misc/lv_anim.c index 8e67bdf63..7c75fb734 100644 --- a/src/misc/lv_anim.c +++ b/src/misc/lv_anim.c @@ -80,7 +80,7 @@ lv_anim_t * lv_anim_start(const lv_anim_t * a) LV_TRACE_ANIM("begin"); /*Do not let two animations for the same 'var' with the same 'exec_cb'*/ - if(a->exec_cb != NULL) lv_anim_del(a->var, a->exec_cb); /*exec_cb == NULL would delete all animations of var*/ + if(a->exec_cb != NULL) lv_anim_delete(a->var, a->exec_cb); /*exec_cb == NULL would delete all animations of var*/ /*Add the new animation to the animation linked list*/ lv_anim_t * new_anim = _lv_ll_ins_head(anim_ll_p); @@ -133,7 +133,7 @@ uint32_t lv_anim_get_playtime(lv_anim_t * a) return playtime; } -bool lv_anim_del(void * var, lv_anim_exec_xcb_t exec_cb) +bool lv_anim_delete(void * var, lv_anim_exec_xcb_t exec_cb) { lv_anim_t * a; bool del_any = false; @@ -158,7 +158,7 @@ bool lv_anim_del(void * var, lv_anim_exec_xcb_t exec_cb) return del_any; } -void lv_anim_del_all(void) +void lv_anim_delete_all(void) { _lv_ll_clear(anim_ll_p); anim_mark_list_change(); @@ -331,7 +331,7 @@ static void anim_timer(lv_timer_t * param) while(a != NULL) { uint32_t elaps = lv_tick_elaps(a->last_timer_run); a->last_timer_run = lv_tick_get(); - /*It can be set by `lv_anim_del()` typically in `end_cb`. If set then an animation delete + /*It can be set by `lv_anim_delete()` typically in `end_cb`. If set then an animation delete * happened in `anim_ready_handler` which could make this linked list reading corrupt * because the list is changed meanwhile */ diff --git a/src/misc/lv_anim.h b/src/misc/lv_anim.h index 80c86f2b2..6a7745133 100644 --- a/src/misc/lv_anim.h +++ b/src/misc/lv_anim.h @@ -445,12 +445,12 @@ static inline void * lv_anim_get_user_data(lv_anim_t * a) * or NULL to ignore it and delete all the animations of 'var * @return true: at least 1 animation is deleted, false: no animation is deleted */ -bool lv_anim_del(void * var, lv_anim_exec_xcb_t exec_cb); +bool lv_anim_delete(void * var, lv_anim_exec_xcb_t exec_cb); /** * Delete all the animations */ -void lv_anim_del_all(void); +void lv_anim_delete_all(void); /** * Get the animation of a variable and its `exec_cb`. @@ -477,9 +477,9 @@ struct _lv_timer_t * lv_anim_get_timer(void); * or NULL to ignore it and delete all the animations of 'var * @return true: at least 1 animation is deleted, false: no animation is deleted */ -static inline bool lv_anim_custom_del(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb) +static inline bool lv_anim_custom_delete(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb) { - return lv_anim_del(a ? a->var : NULL, (lv_anim_exec_xcb_t)exec_cb); + return lv_anim_delete(a ? a->var : NULL, (lv_anim_exec_xcb_t)exec_cb); } /** diff --git a/src/misc/lv_anim_timeline.c b/src/misc/lv_anim_timeline.c index af871348e..4edaca23d 100644 --- a/src/misc/lv_anim_timeline.c +++ b/src/misc/lv_anim_timeline.c @@ -49,7 +49,7 @@ lv_anim_timeline_t * lv_anim_timeline_create(void) return at; } -void lv_anim_timeline_del(lv_anim_timeline_t * at) +void lv_anim_timeline_delete(lv_anim_timeline_t * at) { LV_ASSERT_NULL(at); @@ -111,7 +111,7 @@ void lv_anim_timeline_stop(lv_anim_timeline_t * at) for(uint32_t i = 0; i < at->anim_dsc_cnt; i++) { lv_anim_t * a = &(at->anim_dsc[i].anim); - lv_anim_del(a->var, a->exec_cb); + lv_anim_delete(a->var, a->exec_cb); } } diff --git a/src/misc/lv_anim_timeline.h b/src/misc/lv_anim_timeline.h index 5339fa8a5..bb26a2f95 100644 --- a/src/misc/lv_anim_timeline.h +++ b/src/misc/lv_anim_timeline.h @@ -50,7 +50,7 @@ lv_anim_timeline_t * lv_anim_timeline_create(void); * Delete animation timeline. * @param at pointer to the animation timeline. */ -void lv_anim_timeline_del(lv_anim_timeline_t * at); +void lv_anim_timeline_delete(lv_anim_timeline_t * at); /** * Add animation to the animation timeline. diff --git a/src/misc/lv_async.c b/src/misc/lv_async.c index 6f6602af0..591d2303f 100644 --- a/src/misc/lv_async.c +++ b/src/misc/lv_async.c @@ -80,7 +80,7 @@ lv_result_t lv_async_call_cancel(lv_async_cb_t async_xcb, void * user_data) /*Match user function callback and user data*/ if(info->cb == async_xcb && info->user_data == user_data) { - lv_timer_del(timer); + lv_timer_delete(timer); lv_free(info); res = LV_RESULT_OK; } @@ -101,7 +101,7 @@ static void lv_async_timer_cb(lv_timer_t * timer) /*Save the info because an lv_async_call_cancel might delete it in the callback*/ lv_async_info_t * info = (lv_async_info_t *)timer->user_data; lv_async_info_t info_save = *info; - lv_timer_del(timer); + lv_timer_delete(timer); lv_free(info); info_save.cb(info_save.user_data); diff --git a/src/misc/lv_lru.c b/src/misc/lv_lru.c index 3d2141161..4c3600434 100644 --- a/src/misc/lv_lru.c +++ b/src/misc/lv_lru.c @@ -101,7 +101,7 @@ lv_lru_t * lv_lru_create(size_t cache_size, size_t average_length, lv_lru_free_c } -void lv_lru_del(lv_lru_t * cache) +void lv_lru_delete(lv_lru_t * cache) { LV_ASSERT_NULL(cache); diff --git a/src/misc/lv_lru.h b/src/misc/lv_lru.h index f8bbd5a97..3a300774f 100644 --- a/src/misc/lv_lru.h +++ b/src/misc/lv_lru.h @@ -70,7 +70,7 @@ typedef struct /// @cond lv_lru_t * lv_lru_create(size_t cache_size, size_t average_length, lv_lru_free_cb_t value_free, lv_lru_free_cb_t key_free); -void lv_lru_del(lv_lru_t * cache); +void lv_lru_delete(lv_lru_t * cache); lv_lru_res_t lv_lru_set(lv_lru_t * cache, const void * key, size_t key_length, void * value, size_t value_length); diff --git a/src/misc/lv_timer.c b/src/misc/lv_timer.c index fac4ea017..32b27b00a 100644 --- a/src/misc/lv_timer.c +++ b/src/misc/lv_timer.c @@ -215,7 +215,7 @@ void lv_timer_set_cb(lv_timer_t * timer, lv_timer_cb_t timer_cb) * Delete a lv_timer * @param timer pointer to timer created by timer */ -void lv_timer_del(lv_timer_t * timer) +void lv_timer_delete(lv_timer_t * timer) { _lv_ll_remove(timer_ll_p, timer); state.timer_deleted = true; @@ -366,7 +366,7 @@ static bool lv_timer_exec(lv_timer_t * timer) if(state.timer_deleted == false) { /*The timer might be deleted by itself as well*/ if(timer->repeat_count == 0) { /*The repeat count is over, delete the timer*/ LV_TRACE_TIMER("deleting timer with %p callback because the repeat count is over", *((void **)&timer->timer_cb)); - lv_timer_del(timer); + lv_timer_delete(timer); } } diff --git a/src/misc/lv_timer.h b/src/misc/lv_timer.h index 07e2bfda6..85dd8b10f 100644 --- a/src/misc/lv_timer.h +++ b/src/misc/lv_timer.h @@ -132,7 +132,7 @@ lv_timer_t * lv_timer_create(lv_timer_cb_t timer_xcb, uint32_t period, void * us * Delete a lv_timer * @param timer pointer to an lv_timer */ -void lv_timer_del(lv_timer_t * timer); +void lv_timer_delete(lv_timer_t * timer); /** * Pause/resume a timer. diff --git a/src/others/file_explorer/lv_file_explorer.c b/src/others/file_explorer/lv_file_explorer.c index 08ef96d9b..09ac6e3b1 100644 --- a/src/others/file_explorer/lv_file_explorer.c +++ b/src/others/file_explorer/lv_file_explorer.c @@ -286,7 +286,7 @@ static void lv_file_explorer_constructor(const lv_obj_class_t * class_p, lv_obj_ /*The area displayed above the file browse list(head)*/ explorer->head_area = lv_obj_create(explorer->browser_area); lv_obj_set_size(explorer->head_area, LV_PCT(100), LV_PCT(14)); - lv_obj_clear_flag(explorer->head_area, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_remove_flag(explorer->head_area, LV_OBJ_FLAG_SCROLLABLE); #if LV_FILE_EXPLORER_QUICK_ACCESS /*Two lists of quick access bar*/ diff --git a/src/others/fragment/lv_fragment.c b/src/others/fragment/lv_fragment.c index e72413a80..c36273778 100644 --- a/src/others/fragment/lv_fragment.c +++ b/src/others/fragment/lv_fragment.c @@ -37,7 +37,7 @@ lv_fragment_t * lv_fragment_create(const lv_fragment_class_t * cls, void * args) return instance; } -void lv_fragment_del(lv_fragment_t * fragment) +void lv_fragment_delete(lv_fragment_t * fragment) { LV_ASSERT_NULL(fragment); if(fragment->managed) { @@ -45,14 +45,14 @@ void lv_fragment_del(lv_fragment_t * fragment) return; } if(fragment->obj) { - lv_fragment_del_obj(fragment); + lv_fragment_delete_obj(fragment); } /* Objects will leak if this function called before objects deleted */ const lv_fragment_class_t * cls = fragment->cls; if(cls->destructor_cb) { cls->destructor_cb(fragment); } - lv_fragment_manager_del(fragment->child_manager); + lv_fragment_manager_delete(fragment->child_manager); lv_free(fragment); } @@ -98,10 +98,10 @@ lv_obj_t * lv_fragment_create_obj(lv_fragment_t * fragment, lv_obj_t * container return obj; } -void lv_fragment_del_obj(lv_fragment_t * fragment) +void lv_fragment_delete_obj(lv_fragment_t * fragment) { LV_ASSERT_NULL(fragment); - lv_fragment_manager_del_obj(fragment->child_manager); + lv_fragment_manager_delete_obj(fragment->child_manager); lv_fragment_managed_states_t * states = fragment->managed; if(states) { if(!states->obj_created) return; @@ -125,7 +125,7 @@ void lv_fragment_del_obj(lv_fragment_t * fragment) if(cls->obj_will_delete_cb) { cls->obj_will_delete_cb(fragment, fragment->obj); } - lv_obj_del(fragment->obj); + lv_obj_delete(fragment->obj); if(cls->obj_deleted_cb) { cls->obj_deleted_cb(fragment, fragment->obj); } @@ -139,7 +139,7 @@ void lv_fragment_recreate_obj(lv_fragment_t * fragment) { LV_ASSERT_NULL(fragment); LV_ASSERT_NULL(fragment->managed); - lv_fragment_del_obj(fragment); + lv_fragment_delete_obj(fragment); lv_fragment_create_obj(fragment, *fragment->managed->container); } diff --git a/src/others/fragment/lv_fragment.h b/src/others/fragment/lv_fragment.h index b0a1dc452..a460c2938 100644 --- a/src/others/fragment/lv_fragment.h +++ b/src/others/fragment/lv_fragment.h @@ -150,7 +150,7 @@ typedef struct _lv_fragment_managed_states_t { */ bool obj_created; /** - * true before `lv_fragment_del_obj` is called. Don't touch any object if this is true + * true before `lv_fragment_delete_obj` is called. Don't touch any object if this is true */ bool destroying_obj; /** @@ -174,7 +174,7 @@ lv_fragment_manager_t * lv_fragment_manager_create(lv_fragment_t * parent); * Destroy fragment manager instance * @param manager Fragment manager instance */ -void lv_fragment_manager_del(lv_fragment_manager_t * manager); +void lv_fragment_manager_delete(lv_fragment_manager_t * manager); /** * Create object of all fragments managed by this manager. @@ -186,7 +186,7 @@ void lv_fragment_manager_create_obj(lv_fragment_manager_t * manager); * Delete object created by all fragments managed by this manager. Instance of fragments will not be deleted. * @param manager Fragment manager instance */ -void lv_fragment_manager_del_obj(lv_fragment_manager_t * manager); +void lv_fragment_manager_delete_obj(lv_fragment_manager_t * manager); /** * Attach fragment to manager, and add to container. @@ -279,7 +279,7 @@ lv_fragment_t * lv_fragment_create(const lv_fragment_class_t * cls, void * args) * Destroy a fragment. * @param fragment Fragment instance. */ -void lv_fragment_del(lv_fragment_t * fragment); +void lv_fragment_delete(lv_fragment_t * fragment); /** * Get associated manager of this fragment @@ -316,7 +316,7 @@ lv_obj_t * lv_fragment_create_obj(lv_fragment_t * fragment, lv_obj_t * container * * @param fragment Fragment instance. */ -void lv_fragment_del_obj(lv_fragment_t * fragment); +void lv_fragment_delete_obj(lv_fragment_t * fragment); /** * Destroy obj in fragment, and recreate them. diff --git a/src/others/fragment/lv_fragment_manager.c b/src/others/fragment/lv_fragment_manager.c index e05efd36b..b2d605ed7 100644 --- a/src/others/fragment/lv_fragment_manager.c +++ b/src/others/fragment/lv_fragment_manager.c @@ -44,9 +44,9 @@ struct _lv_fragment_manager_t { static void item_create_obj(lv_fragment_managed_states_t * item); -static void item_del_obj(lv_fragment_managed_states_t * item); +static void item_delete_obj(lv_fragment_managed_states_t * item); -static void item_del_fragment(lv_fragment_managed_states_t * item); +static void item_delete_fragment(lv_fragment_managed_states_t * item); static lv_fragment_managed_states_t * fragment_attach(lv_fragment_manager_t * manager, lv_fragment_t * fragment, lv_obj_t * const * container); @@ -73,13 +73,13 @@ lv_fragment_manager_t * lv_fragment_manager_create(lv_fragment_t * parent) return instance; } -void lv_fragment_manager_del(lv_fragment_manager_t * manager) +void lv_fragment_manager_delete(lv_fragment_manager_t * manager) { LV_ASSERT_NULL(manager); lv_fragment_managed_states_t * states; _LV_LL_READ_BACK(&manager->attached, states) { - item_del_obj(states); - item_del_fragment(states); + item_delete_obj(states); + item_delete_fragment(states); } _lv_ll_clear(&manager->attached); _lv_ll_clear(&manager->stack); @@ -100,12 +100,12 @@ void lv_fragment_manager_create_obj(lv_fragment_manager_t * manager) } } -void lv_fragment_manager_del_obj(lv_fragment_manager_t * manager) +void lv_fragment_manager_delete_obj(lv_fragment_manager_t * manager) { LV_ASSERT_NULL(manager); lv_fragment_managed_states_t * states = NULL; _LV_LL_READ_BACK(&manager->attached, states) { - item_del_obj(states); + item_delete_obj(states); } } @@ -143,8 +143,8 @@ void lv_fragment_manager_remove(lv_fragment_manager_t * manager, lv_fragment_t * lv_free(item); } } - item_del_obj(states); - item_del_fragment(states); + item_delete_obj(states); + item_delete_fragment(states); _lv_ll_remove(&manager->attached, states); lv_free(states); if(prev && was_top) { @@ -156,7 +156,7 @@ void lv_fragment_manager_push(lv_fragment_manager_t * manager, lv_fragment_t * f { lv_fragment_stack_item_t * top = _lv_ll_get_tail(&manager->stack); if(top != NULL) { - item_del_obj(top->states); + item_delete_obj(top->states); } lv_fragment_managed_states_t * states = fragment_attach(manager, fragment, container); states->in_stack = true; @@ -239,23 +239,23 @@ static void item_create_obj(lv_fragment_managed_states_t * item) lv_fragment_create_obj(item->instance, item->container ? *item->container : NULL); } -static void item_del_obj(lv_fragment_managed_states_t * item) +static void item_delete_obj(lv_fragment_managed_states_t * item) { - lv_fragment_del_obj(item->instance); + lv_fragment_delete_obj(item->instance); } /** * Detach, then destroy fragment * @param item fragment states */ -static void item_del_fragment(lv_fragment_managed_states_t * item) +static void item_delete_fragment(lv_fragment_managed_states_t * item) { lv_fragment_t * instance = item->instance; if(instance->cls->detached_cb) { instance->cls->detached_cb(instance); } instance->managed = NULL; - lv_fragment_del(instance); + lv_fragment_delete(instance); item->instance = NULL; } diff --git a/src/others/gridnav/lv_gridnav.c b/src/others/gridnav/lv_gridnav.c index ed25d3c2c..f0d14245f 100644 --- a/src/others/gridnav/lv_gridnav.c +++ b/src/others/gridnav/lv_gridnav.c @@ -69,7 +69,7 @@ void lv_gridnav_add(lv_obj_t * obj, lv_gridnav_ctrl_t ctrl) dsc->focused_obj = NULL; lv_obj_add_event(obj, gridnav_event_cb, LV_EVENT_ALL, dsc); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_WITH_ARROW); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_WITH_ARROW); } void lv_gridnav_remove(lv_obj_t * obj) @@ -117,7 +117,7 @@ void lv_gridnav_set_focused(lv_obj_t * cont, lv_obj_t * to_focus, lv_anim_enable } if(dsc->focused_obj) { - lv_obj_clear_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); + lv_obj_remove_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); } lv_obj_add_state(to_focus, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); @@ -231,7 +231,7 @@ static void gridnav_event_cb(lv_event_t * e) } if(guess && guess != dsc->focused_obj) { - lv_obj_clear_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); + lv_obj_remove_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); lv_obj_add_state(guess, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); lv_obj_scroll_to_view(guess, LV_ANIM_ON); dsc->focused_obj = guess; @@ -241,13 +241,13 @@ static void gridnav_event_cb(lv_event_t * e) if(dsc->focused_obj == NULL) dsc->focused_obj = find_first_focusable(obj); if(dsc->focused_obj) { lv_obj_add_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); - lv_obj_clear_state(dsc->focused_obj, LV_STATE_PRESSED); /*Be sure the focuses obj is not stuck in pressed state*/ + lv_obj_remove_state(dsc->focused_obj, LV_STATE_PRESSED); /*Be sure the focuses obj is not stuck in pressed state*/ lv_obj_scroll_to_view(dsc->focused_obj, LV_ANIM_OFF); } } else if(code == LV_EVENT_DEFOCUSED) { if(dsc->focused_obj) { - lv_obj_clear_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); + lv_obj_remove_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); } } else if(code == LV_EVENT_CHILD_CREATED) { diff --git a/src/others/ime/lv_ime_pinyin.c b/src/others/ime/lv_ime_pinyin.c index f66fc3900..53f313782 100644 --- a/src/others/ime/lv_ime_pinyin.c +++ b/src/others/ime/lv_ime_pinyin.c @@ -576,7 +576,7 @@ static void lv_ime_pinyin_constructor(const lv_obj_class_t * class_p, lv_obj_t * lv_obj_add_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN); lv_buttonmatrix_set_one_checked(pinyin_ime->cand_panel, true); - lv_obj_clear_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_CLICK_FOCUSABLE); + lv_obj_remove_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_CLICK_FOCUSABLE); /* Set cand_panel style*/ // Default style @@ -622,10 +622,10 @@ static void lv_ime_pinyin_destructor(const lv_obj_class_t * class_p, lv_obj_t * lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; if(lv_obj_is_valid(pinyin_ime->kb)) - lv_obj_del(pinyin_ime->kb); + lv_obj_delete(pinyin_ime->kb); if(lv_obj_is_valid(pinyin_ime->cand_panel)) - lv_obj_del(pinyin_ime->cand_panel); + lv_obj_delete(pinyin_ime->cand_panel); } @@ -660,7 +660,7 @@ static void lv_ime_pinyin_kb_event(lv_event_t * e) pinyin_input_proc(obj); for(int index = 0; index < tmp_button_str_len; index++) { - lv_textarea_del_char(ta); + lv_textarea_delete_char(ta); } pinyin_ime->ta_count = tmp_button_str_len; @@ -712,7 +712,7 @@ static void lv_ime_pinyin_kb_event(lv_event_t * e) } else if(strcmp(txt, "123") == 0) { for(uint16_t i = 0; i < lv_strlen(txt); i++) - lv_textarea_del_char(ta); + lv_textarea_delete_char(ta); pinyin_ime_clear_data(obj); lv_textarea_set_cursor_pos(ta, LV_TEXTAREA_CURSOR_LAST); @@ -794,7 +794,7 @@ static void lv_ime_pinyin_cand_panel_event(lv_event_t * e) const char * txt = lv_buttonmatrix_get_button_text(cand_panel, id); uint16_t index = 0; for(index = 0; index < pinyin_ime->ta_count; index++) - lv_textarea_del_char(ta); + lv_textarea_delete_char(ta); lv_textarea_add_text(ta, txt); @@ -826,7 +826,7 @@ static void pinyin_input_proc(lv_obj_t * obj) } } - lv_obj_clear_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN); } static void pinyin_page_proc(lv_obj_t * obj, uint16_t dir) @@ -1137,7 +1137,7 @@ static void pinyin_k9_fill_cand(lv_obj_t * obj) lv_obj_t * ta = lv_keyboard_get_textarea(pinyin_ime->kb); for(index = 0; index < pinyin_ime->k9_input_str_len; index++) { - lv_textarea_del_char(ta); + lv_textarea_delete_char(ta); } pinyin_ime->k9_input_str_len = lv_strlen(pinyin_ime->input_char); lv_textarea_add_text(ta, pinyin_ime->input_char); diff --git a/src/others/monkey/lv_monkey.c b/src/others/monkey/lv_monkey.c index 317ff1316..90d1742d8 100644 --- a/src/others/monkey/lv_monkey.c +++ b/src/others/monkey/lv_monkey.c @@ -110,11 +110,11 @@ void * lv_monkey_get_user_data(lv_monkey_t * monkey) return monkey->user_data; } -void lv_monkey_del(lv_monkey_t * monkey) +void lv_monkey_delete(lv_monkey_t * monkey) { LV_ASSERT_NULL(monkey); - lv_timer_del(monkey->timer); + lv_timer_delete(monkey->timer); lv_indev_delete(monkey->indev); lv_free(monkey); } diff --git a/src/others/monkey/lv_monkey.h b/src/others/monkey/lv_monkey.h index 3d19573c5..92b024d09 100644 --- a/src/others/monkey/lv_monkey.h +++ b/src/others/monkey/lv_monkey.h @@ -101,7 +101,7 @@ void * lv_monkey_get_user_data(lv_monkey_t * monkey); * Delete monkey * @param monkey pointer to monkey */ -void lv_monkey_del(lv_monkey_t * monkey); +void lv_monkey_delete(lv_monkey_t * monkey); /********************** * MACROS diff --git a/src/others/observer/lv_observer.c b/src/others/observer/lv_observer.c index a0232aa20..b41b4f245 100644 --- a/src/others/observer/lv_observer.c +++ b/src/others/observer/lv_observer.c @@ -536,7 +536,7 @@ static void obj_flag_observer_cb(lv_subject_t * subject, lv_observer_t * observe lv_obj_add_flag(observer->target, p->flag); } else { - lv_obj_clear_flag(observer->target, p->flag); + lv_obj_remove_flag(observer->target, p->flag); } } @@ -551,7 +551,7 @@ static void obj_state_observer_cb(lv_subject_t * subject, lv_observer_t * observ lv_obj_add_state(observer->target, p->flag); } else { - lv_obj_clear_state(observer->target, p->flag); + lv_obj_remove_state(observer->target, p->flag); } } diff --git a/src/widgets/arc/lv_arc.c b/src/widgets/arc/lv_arc.c index ddcea899b..af5dcd145 100644 --- a/src/widgets/arc/lv_arc.c +++ b/src/widgets/arc/lv_arc.c @@ -422,7 +422,7 @@ static void lv_arc_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) arc->last_angle = arc->indic_angle_end; lv_obj_add_flag(obj, LV_OBJ_FLAG_CLICKABLE); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN | LV_OBJ_FLAG_SCROLLABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN | LV_OBJ_FLAG_SCROLLABLE); lv_obj_set_ext_click_area(obj, LV_DPI_DEF / 10); diff --git a/src/widgets/bar/lv_bar.c b/src/widgets/bar/lv_bar.c index 479d83e75..0c987d941 100644 --- a/src/widgets/bar/lv_bar.c +++ b/src/widgets/bar/lv_bar.c @@ -230,8 +230,8 @@ static void lv_bar_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_bar_init_anim(obj, &bar->cur_value_anim); lv_bar_init_anim(obj, &bar->start_value_anim); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_CHECKABLE); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_CHECKABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); lv_bar_set_value(obj, 0, LV_ANIM_OFF); LV_TRACE_OBJ_CREATE("finished"); @@ -242,8 +242,8 @@ static void lv_bar_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) LV_UNUSED(class_p); lv_bar_t * bar = (lv_bar_t *)obj; - lv_anim_del(&bar->cur_value_anim, NULL); - lv_anim_del(&bar->start_value_anim, NULL); + lv_anim_delete(&bar->cur_value_anim, NULL); + lv_anim_delete(&bar->start_value_anim, NULL); } static void draw_indic(lv_event_t * e) @@ -512,13 +512,13 @@ static void lv_bar_set_value_with_anim(lv_obj_t * obj, int32_t new_value, int32_ _lv_bar_anim_t * anim_info, lv_anim_enable_t en) { if(en == LV_ANIM_OFF) { - lv_anim_del(anim_info, NULL); + lv_anim_delete(anim_info, NULL); anim_info->anim_state = LV_BAR_ANIM_STATE_INV; *value_ptr = new_value; lv_obj_invalidate((lv_obj_t *)obj); /*Stop the previous animation if it exists*/ - lv_anim_del(anim_info, NULL); + lv_anim_delete(anim_info, NULL); /*Reset animation state*/ lv_bar_init_anim(obj, anim_info); } @@ -535,7 +535,7 @@ static void lv_bar_set_value_with_anim(lv_obj_t * obj, int32_t new_value, int32_ } *value_ptr = new_value; /*Stop the previous animation if it exists*/ - lv_anim_del(anim_info, NULL); + lv_anim_delete(anim_info, NULL); lv_anim_t a; lv_anim_init(&a); diff --git a/src/widgets/button/lv_button.c b/src/widgets/button/lv_button.c index 1fad49ca5..8798a01f5 100644 --- a/src/widgets/button/lv_button.c +++ b/src/widgets/button/lv_button.c @@ -62,7 +62,7 @@ static void lv_button_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj LV_UNUSED(class_p); LV_TRACE_OBJ_CREATE("begin"); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); LV_TRACE_OBJ_CREATE("finished"); diff --git a/src/widgets/calendar/lv_calendar_header_arrow.c b/src/widgets/calendar/lv_calendar_header_arrow.c index 182817e84..95710f216 100644 --- a/src/widgets/calendar/lv_calendar_header_arrow.c +++ b/src/widgets/calendar/lv_calendar_header_arrow.c @@ -81,7 +81,7 @@ static void my_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_obj_set_width(mo_prev, btn_size); lv_obj_add_event(mo_prev, month_event_cb, LV_EVENT_CLICKED, NULL); - lv_obj_clear_flag(mo_prev, LV_OBJ_FLAG_CLICK_FOCUSABLE); + lv_obj_remove_flag(mo_prev, LV_OBJ_FLAG_CLICK_FOCUSABLE); lv_obj_t * label = lv_label_create(obj); lv_label_set_long_mode(label, LV_LABEL_LONG_SCROLL_CIRCULAR); @@ -93,7 +93,7 @@ static void my_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_obj_set_size(mo_next, btn_size, btn_size); lv_obj_add_event(mo_next, month_event_cb, LV_EVENT_CLICKED, NULL); - lv_obj_clear_flag(mo_next, LV_OBJ_FLAG_CLICK_FOCUSABLE); + lv_obj_remove_flag(mo_next, LV_OBJ_FLAG_CLICK_FOCUSABLE); lv_obj_add_event(obj, value_changed_event_cb, LV_EVENT_VALUE_CHANGED, NULL); /*Refresh the drop downs*/ diff --git a/src/widgets/checkbox/lv_checkbox.c b/src/widgets/checkbox/lv_checkbox.c index f5c1ccf9d..718921656 100644 --- a/src/widgets/checkbox/lv_checkbox.c +++ b/src/widgets/checkbox/lv_checkbox.c @@ -144,7 +144,7 @@ static void lv_checkbox_constructor(const lv_obj_class_t * class_p, lv_obj_t * o lv_obj_add_flag(obj, LV_OBJ_FLAG_CLICKABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_CHECKABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); LV_TRACE_OBJ_CREATE("finished"); } diff --git a/src/widgets/dropdown/lv_dropdown.c b/src/widgets/dropdown/lv_dropdown.c index 6dd59911e..2ecb6b1d3 100644 --- a/src/widgets/dropdown/lv_dropdown.c +++ b/src/widgets/dropdown/lv_dropdown.c @@ -461,7 +461,7 @@ void lv_dropdown_open(lv_obj_t * dropdown_obj) lv_obj_add_state(dropdown_obj, LV_STATE_CHECKED); lv_obj_set_parent(dropdown->list, lv_obj_get_screen(dropdown_obj)); lv_obj_move_to_index(dropdown->list, -1); - lv_obj_clear_flag(dropdown->list, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(dropdown->list, LV_OBJ_FLAG_HIDDEN); /*To allow styling the list*/ lv_obj_send_event(dropdown_obj, LV_EVENT_READY, NULL); @@ -554,7 +554,7 @@ void lv_dropdown_close(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_obj_clear_state(obj, LV_STATE_CHECKED); + lv_obj_remove_state(obj, LV_STATE_CHECKED); lv_dropdown_t * dropdown = (lv_dropdown_t *)obj; dropdown->pr_opt_id = LV_DROPDOWN_PR_NONE; @@ -621,7 +621,7 @@ static void lv_dropdown_destructor(const lv_obj_class_t * class_p, lv_obj_t * ob lv_dropdown_t * dropdown = (lv_dropdown_t *)obj; if(dropdown->list) { - lv_obj_del(dropdown->list); + lv_obj_delete(dropdown->list); dropdown->list = NULL; } @@ -636,8 +636,8 @@ static void lv_dropdownlist_constructor(const lv_obj_class_t * class_p, lv_obj_t LV_UNUSED(class_p); LV_TRACE_OBJ_CREATE("begin"); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICK_FOCUSABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICK_FOCUSABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_IGNORE_LAYOUT); lv_obj_add_flag(obj, LV_OBJ_FLAG_HIDDEN); diff --git a/src/widgets/image/lv_image.c b/src/widgets/image/lv_image.c index 1758b92f9..d24b3203f 100644 --- a/src/widgets/image/lv_image.c +++ b/src/widgets/image/lv_image.c @@ -422,7 +422,7 @@ static void lv_image_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) img->pivot.y = LV_PCT(50); img->obj_size_mode = LV_IMAGE_SIZE_MODE_VIRTUAL; - lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_ADV_HITTEST); LV_TRACE_OBJ_CREATE("finished"); diff --git a/src/widgets/imgbtn/lv_imgbtn.c b/src/widgets/imgbtn/lv_imgbtn.c index df6ae6626..f3f5f04d9 100644 --- a/src/widgets/imgbtn/lv_imgbtn.c +++ b/src/widgets/imgbtn/lv_imgbtn.c @@ -107,7 +107,7 @@ void lv_imgbtn_set_state(lv_obj_t * obj, lv_imgbtn_state_t state) obj_state |= LV_STATE_CHECKED; } - lv_obj_clear_state(obj, LV_STATE_CHECKED | LV_STATE_PRESSED | LV_STATE_DISABLED); + lv_obj_remove_state(obj, LV_STATE_CHECKED | LV_STATE_PRESSED | LV_STATE_DISABLED); lv_obj_add_state(obj, obj_state); refr_image(obj); diff --git a/src/widgets/imgbtn/lv_imgbtn.h b/src/widgets/imgbtn/lv_imgbtn.h index 8c6ebe206..de2847e64 100644 --- a/src/widgets/imgbtn/lv_imgbtn.h +++ b/src/widgets/imgbtn/lv_imgbtn.h @@ -83,7 +83,7 @@ void lv_imgbtn_set_src(lv_obj_t * imgbtn, lv_imgbtn_state_t state, const void * /** - * Use this function instead of `lv_obj_add/clear_state` to set a state manually + * Use this function instead of `lv_obj_add/remove_state` to set a state manually * @param imgbtn pointer to an image button object * @param state the new state */ diff --git a/src/widgets/keyboard/lv_keyboard.c b/src/widgets/keyboard/lv_keyboard.c index f4a7150fd..c4578a8d0 100644 --- a/src/widgets/keyboard/lv_keyboard.c +++ b/src/widgets/keyboard/lv_keyboard.c @@ -210,7 +210,7 @@ void lv_keyboard_set_textarea(lv_obj_t * obj, lv_obj_t * ta) /*Hide the cursor of the old Text area if cursor management is enabled*/ if(keyboard->ta) { - lv_obj_clear_state(obj, LV_STATE_FOCUSED); + lv_obj_remove_state(obj, LV_STATE_FOCUSED); } keyboard->ta = ta; @@ -394,20 +394,20 @@ void lv_keyboard_def_event_cb(lv_event_t * e) lv_textarea_cursor_right(keyboard->ta); } else if(strcmp(txt, LV_SYMBOL_BACKSPACE) == 0) { - lv_textarea_del_char(keyboard->ta); + lv_textarea_delete_char(keyboard->ta); } else if(strcmp(txt, "+/-") == 0) { uint32_t cur = lv_textarea_get_cursor_pos(keyboard->ta); const char * ta_txt = lv_textarea_get_text(keyboard->ta); if(ta_txt[0] == '-') { lv_textarea_set_cursor_pos(keyboard->ta, 1); - lv_textarea_del_char(keyboard->ta); + lv_textarea_delete_char(keyboard->ta); lv_textarea_add_char(keyboard->ta, '+'); lv_textarea_set_cursor_pos(keyboard->ta, cur); } else if(ta_txt[0] == '+') { lv_textarea_set_cursor_pos(keyboard->ta, 1); - lv_textarea_del_char(keyboard->ta); + lv_textarea_delete_char(keyboard->ta); lv_textarea_add_char(keyboard->ta, '-'); lv_textarea_set_cursor_pos(keyboard->ta, cur); } @@ -429,7 +429,7 @@ void lv_keyboard_def_event_cb(lv_event_t * e) static void lv_keyboard_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) { LV_UNUSED(class_p); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICK_FOCUSABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICK_FOCUSABLE); lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; keyboard->ta = NULL; diff --git a/src/widgets/label/lv_label.c b/src/widgets/label/lv_label.c index 20ed16cc1..91c802638 100644 --- a/src/widgets/label/lv_label.c +++ b/src/widgets/label/lv_label.c @@ -186,8 +186,8 @@ void lv_label_set_long_mode(lv_obj_t * obj, lv_label_long_mode_t long_mode) lv_label_t * label = (lv_label_t *)obj; /*Delete the old animation (if exists)*/ - lv_anim_del(obj, set_ofs_x_anim); - lv_anim_del(obj, set_ofs_y_anim); + lv_anim_delete(obj, set_ofs_x_anim); + lv_anim_delete(obj, set_ofs_y_anim); label->offset.x = 0; label->offset.y = 0; @@ -660,7 +660,7 @@ static void lv_label_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) label->dot.tmp_ptr = NULL; label->dot_tmp_alloc = 0; - lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE); lv_label_set_long_mode(obj, LV_LABEL_LONG_WRAP); lv_label_set_text(obj, LV_LABEL_DEFAULT_TEXT); @@ -953,7 +953,7 @@ static void lv_label_refr_text(lv_obj_t * obj) } else { /*Delete the offset animation if not required*/ - lv_anim_del(obj, set_ofs_x_anim); + lv_anim_delete(obj, set_ofs_x_anim); label->offset.x = 0; } @@ -991,7 +991,7 @@ static void lv_label_refr_text(lv_obj_t * obj) } else { /*Delete the offset animation if not required*/ - lv_anim_del(obj, set_ofs_y_anim); + lv_anim_delete(obj, set_ofs_y_anim); label->offset.y = 0; } } @@ -1047,7 +1047,7 @@ static void lv_label_refr_text(lv_obj_t * obj) } else { /*Delete the offset animation if not required*/ - lv_anim_del(obj, set_ofs_x_anim); + lv_anim_delete(obj, set_ofs_x_anim); label->offset.x = 0; } @@ -1072,7 +1072,7 @@ static void lv_label_refr_text(lv_obj_t * obj) } else { /*Delete the offset animation if not required*/ - lv_anim_del(obj, set_ofs_y_anim); + lv_anim_delete(obj, set_ofs_y_anim); label->offset.y = 0; } } diff --git a/src/widgets/line/lv_line.c b/src/widgets/line/lv_line.c index 6ed43c531..bd52cc7c2 100644 --- a/src/widgets/line/lv_line.c +++ b/src/widgets/line/lv_line.c @@ -117,7 +117,7 @@ static void lv_line_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) line->point_array = NULL; line->y_inv = 0; - lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE); LV_TRACE_OBJ_CREATE("finished"); } diff --git a/src/widgets/menu/lv_menu.c b/src/widgets/menu/lv_menu.c index b3cd8e689..171d39712 100644 --- a/src/widgets/menu/lv_menu.c +++ b/src/widgets/menu/lv_menu.c @@ -98,7 +98,7 @@ static void lv_menu_refr(lv_obj_t * obj); static void lv_menu_refr_sidebar_header_mode(lv_obj_t * obj); static void lv_menu_refr_main_header_mode(lv_obj_t * obj); static void lv_menu_load_page_event_cb(lv_event_t * e); -static void lv_menu_obj_del_event_cb(lv_event_t * e); +static void lv_menu_obj_delete_event_cb(lv_event_t * e); static void lv_menu_back_event_cb(lv_event_t * e); static void lv_menu_value_changed_event_cb(lv_event_t * e); /********************** @@ -225,7 +225,7 @@ void lv_menu_set_page(lv_obj_t * obj, lv_obj_t * page) lv_obj_add_state(menu->selected_tab, LV_STATE_CHECKED); } else { - lv_obj_clear_state(menu->selected_tab, LV_STATE_CHECKED); + lv_obj_remove_state(menu->selected_tab, LV_STATE_CHECKED); } } @@ -235,33 +235,33 @@ void lv_menu_set_page(lv_obj_t * obj, lv_obj_t * page) if(menu->sidebar_generated) { if(menu->mode_root_back_btn == LV_MENU_ROOT_BACK_BUTTON_ENABLED) { /* Root back btn is always shown if enabled*/ - lv_obj_clear_flag(menu->sidebar_header_back_btn, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(menu->sidebar_header_back_btn, LV_OBJ_FLAG_HIDDEN); lv_obj_add_flag(menu->sidebar_header_back_btn, LV_OBJ_FLAG_CLICKABLE); } else { lv_obj_add_flag(menu->sidebar_header_back_btn, LV_OBJ_FLAG_HIDDEN); - lv_obj_clear_flag(menu->sidebar_header_back_btn, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(menu->sidebar_header_back_btn, LV_OBJ_FLAG_CLICKABLE); } } if(menu->cur_depth >= 2) { - lv_obj_clear_flag(menu->main_header_back_btn, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(menu->main_header_back_btn, LV_OBJ_FLAG_HIDDEN); lv_obj_add_flag(menu->main_header_back_btn, LV_OBJ_FLAG_CLICKABLE); } else { lv_obj_add_flag(menu->main_header_back_btn, LV_OBJ_FLAG_HIDDEN); - lv_obj_clear_flag(menu->main_header_back_btn, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(menu->main_header_back_btn, LV_OBJ_FLAG_CLICKABLE); } } else { /* With sidebar disabled */ if(menu->cur_depth >= 2 || menu->mode_root_back_btn == LV_MENU_ROOT_BACK_BUTTON_ENABLED) { - lv_obj_clear_flag(menu->main_header_back_btn, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(menu->main_header_back_btn, LV_OBJ_FLAG_HIDDEN); lv_obj_add_flag(menu->main_header_back_btn, LV_OBJ_FLAG_CLICKABLE); } else { lv_obj_add_flag(menu->main_header_back_btn, LV_OBJ_FLAG_HIDDEN); - lv_obj_clear_flag(menu->main_header_back_btn, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(menu->main_header_back_btn, LV_OBJ_FLAG_CLICKABLE); } } @@ -287,7 +287,7 @@ void lv_menu_set_sidebar_page(lv_obj_t * obj, lv_obj_t * page) lv_obj_set_size(sidebar_cont, LV_PCT(30), LV_PCT(100)); lv_obj_set_flex_flow(sidebar_cont, LV_FLEX_FLOW_COLUMN); lv_obj_add_flag(sidebar_cont, LV_OBJ_FLAG_EVENT_BUBBLE); - lv_obj_clear_flag(sidebar_cont, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(sidebar_cont, LV_OBJ_FLAG_CLICKABLE); menu->sidebar = sidebar_cont; lv_obj_t * sidebar_header = lv_obj_class_create_obj(&lv_menu_sidebar_header_cont_class, sidebar_cont); @@ -295,7 +295,7 @@ void lv_menu_set_sidebar_page(lv_obj_t * obj, lv_obj_t * page) lv_obj_set_size(sidebar_header, LV_PCT(100), LV_SIZE_CONTENT); lv_obj_set_flex_flow(sidebar_header, LV_FLEX_FLOW_ROW); lv_obj_set_flex_align(sidebar_header, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); - lv_obj_clear_flag(sidebar_header, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(sidebar_header, LV_OBJ_FLAG_CLICKABLE); lv_obj_add_flag(sidebar_header, LV_OBJ_FLAG_EVENT_BUBBLE); menu->sidebar_header = sidebar_header; @@ -323,7 +323,7 @@ void lv_menu_set_sidebar_page(lv_obj_t * obj, lv_obj_t * page) /* Sidebar should be disabled */ if(menu->sidebar_generated) { lv_obj_set_parent(menu->sidebar_page, menu->storage); - lv_obj_del(menu->sidebar); + lv_obj_delete(menu->sidebar); menu->sidebar_generated = false; } @@ -363,7 +363,7 @@ void lv_menu_set_load_page_event(lv_obj_t * menu, lv_obj_t * obj, lv_obj_t * pag LV_ASSERT_OBJ(menu, MY_CLASS); lv_obj_add_flag(obj, LV_OBJ_FLAG_CLICKABLE); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); /* Remove old event */ @@ -383,7 +383,7 @@ void lv_menu_set_load_page_event(lv_obj_t * menu, lv_obj_t * obj, lv_obj_t * pag event_data->page = page; lv_obj_add_event(obj, lv_menu_load_page_event_cb, LV_EVENT_CLICKED, event_data); - lv_obj_add_event(obj, lv_menu_obj_del_event_cb, LV_EVENT_DELETE, event_data); + lv_obj_add_event(obj, lv_menu_obj_delete_event_cb, LV_EVENT_DELETE, event_data); } void lv_menu_set_page_title(lv_obj_t * page_obj, char const * const title) @@ -549,7 +549,7 @@ static void lv_menu_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_obj_set_flex_grow(main_cont, 1); lv_obj_set_flex_flow(main_cont, LV_FLEX_FLOW_COLUMN); lv_obj_add_flag(main_cont, LV_OBJ_FLAG_EVENT_BUBBLE); - lv_obj_clear_flag(main_cont, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(main_cont, LV_OBJ_FLAG_CLICKABLE); menu->main = main_cont; lv_obj_t * main_header = lv_obj_class_create_obj(&lv_menu_main_header_cont_class, main_cont); @@ -557,7 +557,7 @@ static void lv_menu_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_obj_set_size(main_header, LV_PCT(100), LV_SIZE_CONTENT); lv_obj_set_flex_flow(main_header, LV_FLEX_FLOW_ROW); lv_obj_set_flex_align(main_header, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); - lv_obj_clear_flag(main_header, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(main_header, LV_OBJ_FLAG_CLICKABLE); lv_obj_add_flag(main_header, LV_OBJ_FLAG_EVENT_BUBBLE); menu->main_header = main_header; @@ -626,14 +626,14 @@ static void lv_menu_cont_constructor(const lv_obj_class_t * class_p, lv_obj_t * LV_UNUSED(class_p); lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW); lv_obj_set_flex_align(obj, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE); } static void lv_menu_section_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) { LV_UNUSED(class_p); lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE); } static void lv_menu_refr_sidebar_header_mode(lv_obj_t * obj) @@ -667,7 +667,7 @@ static void lv_menu_refr_sidebar_header_mode(lv_obj_t * obj) lv_obj_add_flag(menu->sidebar_header, LV_OBJ_FLAG_HIDDEN); } else { - lv_obj_clear_flag(menu->sidebar_header, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(menu->sidebar_header, LV_OBJ_FLAG_HIDDEN); } } @@ -703,7 +703,7 @@ static void lv_menu_refr_main_header_mode(lv_obj_t * obj) lv_obj_add_flag(menu->main_header, LV_OBJ_FLAG_HIDDEN); } else { - lv_obj_clear_flag(menu->main_header, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(menu->main_header, LV_OBJ_FLAG_HIDDEN); } } @@ -731,7 +731,7 @@ static void lv_menu_load_page_event_cb(lv_event_t * e) if(sidebar) { /* Clear checked state of previous obj */ if(menu->selected_tab != obj && menu->selected_tab != NULL) { - lv_obj_clear_state(menu->selected_tab, LV_STATE_CHECKED); + lv_obj_remove_state(menu->selected_tab, LV_STATE_CHECKED); } lv_menu_clear_history((lv_obj_t *)menu); @@ -748,7 +748,7 @@ static void lv_menu_load_page_event_cb(lv_event_t * e) } } -static void lv_menu_obj_del_event_cb(lv_event_t * e) +static void lv_menu_obj_delete_event_cb(lv_event_t * e) { lv_menu_load_page_event_data_t * event_data = lv_event_get_user_data(e); lv_free(event_data); @@ -802,7 +802,7 @@ static void lv_menu_value_changed_event_cb(lv_event_t * e) if(main_page != NULL && menu->main_header_title != NULL) { if(main_page->title != NULL) { lv_label_set_text(menu->main_header_title, main_page->title); - lv_obj_clear_flag(menu->main_header_title, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(menu->main_header_title, LV_OBJ_FLAG_HIDDEN); } else { lv_obj_add_flag(menu->main_header_title, LV_OBJ_FLAG_HIDDEN); @@ -813,7 +813,7 @@ static void lv_menu_value_changed_event_cb(lv_event_t * e) if(sidebar_page != NULL && menu->sidebar_header_title != NULL) { if(sidebar_page->title != NULL) { lv_label_set_text(menu->sidebar_header_title, sidebar_page->title); - lv_obj_clear_flag(menu->sidebar_header_title, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(menu->sidebar_header_title, LV_OBJ_FLAG_HIDDEN); } else { lv_obj_add_flag(menu->sidebar_header_title, LV_OBJ_FLAG_HIDDEN); diff --git a/src/widgets/msgbox/lv_msgbox.c b/src/widgets/msgbox/lv_msgbox.c index e8cc068dc..680ebfbfa 100644 --- a/src/widgets/msgbox/lv_msgbox.c +++ b/src/widgets/msgbox/lv_msgbox.c @@ -77,7 +77,7 @@ lv_obj_t * lv_msgbox_create(lv_obj_t * parent, const char * title, const char * parent = lv_obj_class_create_obj(&lv_msgbox_backdrop_class, lv_layer_top()); LV_ASSERT_MALLOC(parent); lv_obj_class_init_obj(parent); - lv_obj_clear_flag(parent, LV_OBJ_FLAG_IGNORE_LAYOUT); + lv_obj_remove_flag(parent, LV_OBJ_FLAG_IGNORE_LAYOUT); lv_obj_set_size(parent, LV_PCT(100), LV_PCT(100)); } @@ -197,14 +197,14 @@ const char * lv_msgbox_get_active_button_text(lv_obj_t * mbox) void lv_msgbox_close(lv_obj_t * mbox) { - if(lv_obj_has_flag(mbox, LV_MSGBOX_FLAG_AUTO_PARENT)) lv_obj_del(lv_obj_get_parent(mbox)); - else lv_obj_del(mbox); + if(lv_obj_has_flag(mbox, LV_MSGBOX_FLAG_AUTO_PARENT)) lv_obj_delete(lv_obj_get_parent(mbox)); + else lv_obj_delete(mbox); } void lv_msgbox_close_async(lv_obj_t * dialog) { - if(lv_obj_has_flag(dialog, LV_MSGBOX_FLAG_AUTO_PARENT)) lv_obj_del_async(lv_obj_get_parent(dialog)); - else lv_obj_del_async(dialog); + if(lv_obj_has_flag(dialog, LV_MSGBOX_FLAG_AUTO_PARENT)) lv_obj_delete_async(lv_obj_get_parent(dialog)); + else lv_obj_delete_async(dialog); } /********************** diff --git a/src/widgets/roller/lv_roller.c b/src/widgets/roller/lv_roller.c index bad72ad10..a0fd60082 100644 --- a/src/widgets/roller/lv_roller.c +++ b/src/widgets/roller/lv_roller.c @@ -313,8 +313,8 @@ static void lv_roller_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj roller->sel_opt_id = 0; roller->sel_opt_id_ori = 0; - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_VER); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_VER); LV_LOG_INFO("begin"); lv_obj_t * label = lv_obj_class_create_obj(&lv_roller_label_class, obj); @@ -355,7 +355,7 @@ static void lv_roller_event(const lv_obj_class_t * class_p, lv_event_t * e) } else if(code == LV_EVENT_PRESSED) { roller->moved = 0; - lv_anim_del(get_label(obj), set_y_anim); + lv_anim_delete(get_label(obj), set_y_anim); } else if(code == LV_EVENT_PRESSING) { lv_indev_t * indev = lv_indev_get_act(); @@ -657,7 +657,7 @@ static void refr_position(lv_obj_t * obj, lv_anim_enable_t anim_en) const lv_coord_t new_y = mid_y1 - sel_y1; if(anim_en == LV_ANIM_OFF || anim_time == 0) { - lv_anim_del(label, set_y_anim); + lv_anim_delete(label, set_y_anim); lv_obj_set_y(label, new_y); } else { diff --git a/src/widgets/slider/lv_slider.c b/src/widgets/slider/lv_slider.c index 2b42fd8e8..d2ac584d9 100644 --- a/src/widgets/slider/lv_slider.c +++ b/src/widgets/slider/lv_slider.c @@ -92,8 +92,8 @@ static void lv_slider_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj slider->dragging = 0U; slider->left_knob_focus = 0U; - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); lv_obj_set_ext_click_area(obj, LV_DPX(8)); } @@ -178,11 +178,11 @@ static void lv_slider_event(const lv_obj_class_t * class_p, lv_event_t * e) else if(code == LV_EVENT_SIZE_CHANGED) { if(is_slider_horizontal(obj)) { lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_VER); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); } else { lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_VER); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_VER); } lv_obj_refresh_ext_draw_size(obj); } @@ -469,9 +469,9 @@ static void update_knob_pos(lv_obj_t * obj, bool check_drag) if(*slider->value_to_set != new_value) { *slider->value_to_set = new_value; if(is_hor) - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_VER); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_VER); else - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); lv_obj_invalidate(obj); lv_result_t res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); diff --git a/src/widgets/span/lv_span.c b/src/widgets/span/lv_span.c index 69b663a85..4fba13abb 100644 --- a/src/widgets/span/lv_span.c +++ b/src/widgets/span/lv_span.c @@ -129,7 +129,7 @@ lv_span_t * lv_spangroup_new_span(lv_obj_t * obj) return span; } -void lv_spangroup_del_span(lv_obj_t * obj, lv_span_t * span) +void lv_spangroup_delete_span(lv_obj_t * obj, lv_span_t * span) { if(obj == NULL || span == NULL) { return; diff --git a/src/widgets/span/lv_span.h b/src/widgets/span/lv_span.h index 2a6d50f36..fbb0e4916 100644 --- a/src/widgets/span/lv_span.h +++ b/src/widgets/span/lv_span.h @@ -101,7 +101,7 @@ lv_span_t * lv_spangroup_new_span(lv_obj_t * obj); * @param obj pointer to a spangroup object. * @param span pointer to a span. */ -void lv_spangroup_del_span(lv_obj_t * obj, lv_span_t * span); +void lv_spangroup_delete_span(lv_obj_t * obj, lv_span_t * span); /*===================== * Setter functions diff --git a/src/widgets/spinner/lv_spinner.c b/src/widgets/spinner/lv_spinner.c index 1313b6718..eaa689e27 100644 --- a/src/widgets/spinner/lv_spinner.c +++ b/src/widgets/spinner/lv_spinner.c @@ -55,7 +55,7 @@ lv_obj_t * lv_spinner_create(lv_obj_t * parent) void lv_spinner_set_anim_params(lv_obj_t * obj, uint32_t t, uint32_t angle) { /*Delete the current animation*/ - lv_anim_del(obj, NULL); + lv_anim_delete(obj, NULL); lv_anim_t a; lv_anim_init(&a); @@ -87,7 +87,7 @@ static void lv_spinner_constructor(const lv_obj_class_t * class_p, lv_obj_t * ob LV_UNUSED(class_p); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE); lv_spinner_set_anim_params(obj, DEF_TIME, DEF_ARC_ANGLE); } diff --git a/src/widgets/switch/lv_switch.c b/src/widgets/switch/lv_switch.c index c6998f55a..b7b690653 100644 --- a/src/widgets/switch/lv_switch.c +++ b/src/widgets/switch/lv_switch.c @@ -91,7 +91,7 @@ static void lv_switch_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj sw->anim_state = LV_SWITCH_ANIM_STATE_INV; - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_CHECKABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); @@ -103,7 +103,7 @@ static void lv_switch_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) LV_UNUSED(class_p); lv_switch_t * sw = (lv_switch_t *)obj; - lv_anim_del(sw, NULL); + lv_anim_delete(sw, NULL); } static void lv_switch_event(const lv_obj_class_t * class_p, lv_event_t * e) @@ -248,7 +248,7 @@ static void lv_switch_trigger_anim(lv_obj_t * obj) uint32_t anim_dur = (anim_dur_full * LV_ABS(anim_start - anim_end)) / LV_SWITCH_ANIM_STATE_END; /*Stop the previous animation if it exists*/ - lv_anim_del(sw, NULL); + lv_anim_delete(sw, NULL); lv_anim_t a; lv_anim_init(&a); diff --git a/src/widgets/tabview/lv_tabview.c b/src/widgets/tabview/lv_tabview.c index 76c068443..1f5c68328 100644 --- a/src/widgets/tabview/lv_tabview.c +++ b/src/widgets/tabview/lv_tabview.c @@ -265,7 +265,7 @@ static void lv_tabview_constructor(const lv_obj_class_t * class_p, lv_obj_t * ob lv_obj_set_scroll_snap_y(cont, LV_SCROLL_SNAP_CENTER); } lv_obj_add_flag(cont, LV_OBJ_FLAG_SCROLL_ONE); - lv_obj_clear_flag(cont, LV_OBJ_FLAG_SCROLL_ON_FOCUS); + lv_obj_remove_flag(cont, LV_OBJ_FLAG_SCROLL_ON_FOCUS); } static void lv_tabview_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) diff --git a/src/widgets/textarea/lv_textarea.c b/src/widgets/textarea/lv_textarea.c index 3b0f64375..9c584b480 100644 --- a/src/widgets/textarea/lv_textarea.c +++ b/src/widgets/textarea/lv_textarea.c @@ -210,7 +210,7 @@ void lv_textarea_add_text(lv_obj_t * obj, const char * txt) lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); } -void lv_textarea_del_char(lv_obj_t * obj) +void lv_textarea_delete_char(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -254,13 +254,13 @@ void lv_textarea_del_char(lv_obj_t * obj) } -void lv_textarea_del_char_forward(lv_obj_t * obj) +void lv_textarea_delete_char_forward(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); uint32_t cp = lv_textarea_get_cursor_pos(obj); lv_textarea_set_cursor_pos(obj, cp + 1); - if(cp != lv_textarea_get_cursor_pos(obj)) lv_textarea_del_char(obj); + if(cp != lv_textarea_get_cursor_pos(obj)) lv_textarea_delete_char(obj); } /*===================== @@ -842,7 +842,7 @@ static void lv_textarea_constructor(const lv_obj_class_t * class_p, lv_obj_t * o lv_label_set_text(ta->label, ""); lv_obj_add_event(ta->label, label_event_cb, LV_EVENT_ALL, NULL); lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_WITH_ARROW); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_WITH_ARROW); lv_textarea_set_cursor_pos(obj, 0); @@ -896,9 +896,9 @@ static void lv_textarea_event(const lv_obj_class_t * class_p, lv_event_t * e) else if(c == LV_KEY_DOWN) lv_textarea_cursor_down(obj); else if(c == LV_KEY_BACKSPACE) - lv_textarea_del_char(obj); + lv_textarea_delete_char(obj); else if(c == LV_KEY_DEL) - lv_textarea_del_char_forward(obj); + lv_textarea_delete_char_forward(obj); else if(c == LV_KEY_HOME) lv_textarea_set_cursor_pos(obj, 0); else if(c == LV_KEY_END) @@ -1043,7 +1043,7 @@ static void start_cursor_blink(lv_obj_t * obj) lv_textarea_t * ta = (lv_textarea_t *)obj; uint32_t blink_time = lv_obj_get_style_anim_time(obj, LV_PART_CURSOR); if(blink_time == 0) { - lv_anim_del(obj, cursor_blink_anim_cb); + lv_anim_delete(obj, cursor_blink_anim_cb); ta->cursor.show = 1; } else { @@ -1196,7 +1196,7 @@ static void update_cursor_position_on_click(lv_event_t * e) ta->sel_start = char_id_at_click; ta->sel_end = LV_LABEL_TEXT_SELECTION_OFF; ta->text_sel_in_prog = 1; - lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN); + lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN); } else if(ta->text_sel_in_prog && code == LV_EVENT_PRESSING) { /*Input device may be moving. Store the end position*/ diff --git a/src/widgets/textarea/lv_textarea.h b/src/widgets/textarea/lv_textarea.h index de480a02f..bb2a11b6e 100644 --- a/src/widgets/textarea/lv_textarea.h +++ b/src/widgets/textarea/lv_textarea.h @@ -103,13 +103,13 @@ void lv_textarea_add_text(lv_obj_t * obj, const char * txt); * Delete a the left character from the current cursor position * @param obj pointer to a text area object */ -void lv_textarea_del_char(lv_obj_t * obj); +void lv_textarea_delete_char(lv_obj_t * obj); /** * Delete the right character from the current cursor position * @param obj pointer to a text area object */ -void lv_textarea_del_char_forward(lv_obj_t * obj); +void lv_textarea_delete_char_forward(lv_obj_t * obj); /*===================== * Setter functions diff --git a/tests/src/test_cases/draw/test_clip_corner.c b/tests/src/test_cases/draw/test_clip_corner.c index 12856955e..846856927 100644 --- a/tests/src/test_cases/draw/test_clip_corner.c +++ b/tests/src/test_cases/draw/test_clip_corner.c @@ -15,7 +15,7 @@ void tearDown(void) static lv_obj_t * create_panel(lv_coord_t radius, bool transform) { - lv_obj_t * parent = lv_obj_create(lv_scr_act()); + lv_obj_t * parent = lv_obj_create(lv_screen_active()); lv_obj_set_style_pad_all(parent, 3, 0); lv_obj_set_style_radius(parent, radius, 0); lv_obj_set_style_clip_corner(parent, true, 0); @@ -38,9 +38,9 @@ static lv_obj_t * create_panel(lv_coord_t radius, bool transform) void test_func_1(void) { - lv_obj_set_flex_flow(lv_scr_act(), LV_FLEX_FLOW_ROW_WRAP); - lv_obj_set_flex_align(lv_scr_act(), LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); - lv_obj_set_style_pad_column(lv_scr_act(), 40, 0); + lv_obj_set_flex_flow(lv_screen_active(), LV_FLEX_FLOW_ROW_WRAP); + lv_obj_set_flex_align(lv_screen_active(), LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); + lv_obj_set_style_pad_column(lv_screen_active(), 40, 0); create_panel(0, false); create_panel(10, false); diff --git a/tests/src/test_cases/draw/test_draw_arc.c b/tests/src/test_cases/draw/test_draw_arc.c index 4dc5cdfe7..e97400f9d 100644 --- a/tests/src/test_cases/draw/test_draw_arc.c +++ b/tests/src/test_cases/draw/test_draw_arc.c @@ -7,8 +7,8 @@ void setUp(void) { /* Function run before every test */ - lv_obj_set_flex_flow(lv_scr_act(), LV_FLEX_FLOW_ROW_WRAP); - lv_obj_set_flex_align(lv_scr_act(), LV_FLEX_ALIGN_SPACE_EVENLY, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); + 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_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); } void tearDown(void) @@ -66,7 +66,7 @@ static void draw_arcs(lv_draw_arc_dsc_t * arc_dsc, const char * fn) { static uint8_t canvas_buf[CANVAS_WIDTH_TO_STRIDE(760, 4) * 440]; - lv_obj_t * canvas = lv_canvas_create(lv_scr_act()); + lv_obj_t * canvas = lv_canvas_create(lv_screen_active()); lv_canvas_set_buffer(canvas, canvas_buf, 760, 440, LV_COLOR_FORMAT_ARGB8888); lv_canvas_fill_bg(canvas, lv_palette_lighten(LV_PALETTE_RED, 2), LV_OPA_50); @@ -100,7 +100,7 @@ static void draw_arcs(lv_draw_arc_dsc_t * arc_dsc, const char * fn) lv_snprintf(fn_buf, sizeof(fn_buf), "draw/arc_%s.png", fn); TEST_ASSERT_EQUAL_SCREENSHOT(fn_buf); - lv_obj_del(canvas); + lv_obj_delete(canvas); } void test_colored_arc(void) diff --git a/tests/src/test_cases/draw/test_draw_blend.c b/tests/src/test_cases/draw/test_draw_blend.c index 05c61b7e5..9bec07d50 100644 --- a/tests/src/test_cases/draw/test_draw_blend.c +++ b/tests/src/test_cases/draw/test_draw_blend.c @@ -7,8 +7,8 @@ void setUp(void) { /* Function run before every test */ - lv_obj_set_flex_flow(lv_scr_act(), LV_FLEX_FLOW_ROW_WRAP); - lv_obj_set_flex_align(lv_scr_act(), LV_FLEX_ALIGN_SPACE_EVENLY, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); + 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_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); } @@ -20,7 +20,7 @@ void tearDown(void) static void canvas_basic_render(uint8_t * canvas_buf, lv_color_format_t render_cf, const char * name_main, const char * name_sub) { - lv_obj_t * canvas = lv_canvas_create(lv_scr_act()); + lv_obj_t * canvas = lv_canvas_create(lv_screen_active()); lv_canvas_set_buffer(canvas, canvas_buf, 180, 180, render_cf); lv_canvas_fill_bg(canvas, lv_palette_lighten(LV_PALETTE_LIGHT_BLUE, 2), LV_OPA_COVER); @@ -85,7 +85,7 @@ static void canvas_basic_render(uint8_t * canvas_buf, lv_color_format_t render_c lv_canvas_finish_layer(canvas, &layer); - lv_obj_del(canvas); + lv_obj_delete(canvas); } @@ -120,13 +120,13 @@ void canvas_blend_test(lv_obj_t * canvas_large, lv_draw_image_dsc_t * img_dsc, static void canvas_draw(const char * name, lv_color_format_t large_render_cf) { - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); static uint8_t canvas_buf[CANVAS_WIDTH_TO_STRIDE(180, 4) * 180 + LV_DRAW_BUF_ALIGN]; static uint8_t canvas2_buf[CANVAS_WIDTH_TO_STRIDE(768, 4) * 390 + LV_DRAW_BUF_ALIGN]; - lv_obj_t * canvas2 = lv_canvas_create(lv_scr_act()); + lv_obj_t * canvas2 = lv_canvas_create(lv_screen_active()); lv_canvas_set_buffer(canvas2, lv_draw_buf_align(canvas2_buf, large_render_cf), 768, 390, large_render_cf); lv_canvas_fill_bg(canvas2, lv_palette_lighten(LV_PALETTE_BLUE_GREY, 2), LV_OPA_COVER); diff --git a/tests/src/test_cases/draw/test_draw_label.c b/tests/src/test_cases/draw/test_draw_label.c index dac2dad8b..a87a27310 100644 --- a/tests/src/test_cases/draw/test_draw_label.c +++ b/tests/src/test_cases/draw/test_draw_label.c @@ -6,21 +6,21 @@ void setUp(void) { /* Function run before every test */ - lv_obj_set_flex_flow(lv_scr_act(), LV_FLEX_FLOW_ROW_WRAP); - lv_obj_set_flex_align(lv_scr_act(), LV_FLEX_ALIGN_SPACE_EVENLY, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); + 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_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); } void tearDown(void) { /* Function run after every test */ - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); } static lv_obj_t * label_create(const lv_font_t * font, lv_style_t * style, const char * text_base) { - lv_obj_t * label = lv_label_create(lv_scr_act()); + lv_obj_t * label = lv_label_create(lv_screen_active()); lv_label_set_text_fmt(label, "%s: the quick brown fox jumps over the lazy dog", text_base); // lv_label_set_text_fmt(label, "l"); lv_obj_set_style_text_font(label, font, 0); @@ -89,7 +89,7 @@ static lv_obj_t * decor_label_create(lv_text_decor_t decor, lv_text_align_t alig lv_color_t sel_bg_color = lv_palette_lighten(LV_PALETTE_RED, 4); lv_color_t sel_color = lv_palette_darken(LV_PALETTE_RED, 4); - 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, "Hi,\nTesting the\nlabels."); lv_obj_set_style_text_decor(label, decor, 0); lv_obj_set_style_text_color(label, color, 0); @@ -131,7 +131,7 @@ void test_label_decor(void) void test_label_placeholder(void) { - 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, "ABCÁÉŐ\naáeéoő"); TEST_ASSERT_EQUAL_SCREENSHOT("draw/label_placeholder.png"); diff --git a/tests/src/test_cases/draw/test_draw_layer.c b/tests/src/test_cases/draw/test_draw_layer.c index 5f5d580d3..92067c3a3 100644 --- a/tests/src/test_cases/draw/test_draw_layer.c +++ b/tests/src/test_cases/draw/test_draw_layer.c @@ -6,14 +6,14 @@ void setUp(void) { /* Function run before every test */ - lv_obj_set_flex_flow(lv_scr_act(), LV_FLEX_FLOW_ROW_WRAP); - lv_obj_set_flex_align(lv_scr_act(), LV_FLEX_ALIGN_SPACE_EVENLY, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); + 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_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); } void tearDown(void) { /* Function run after every test */ - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); } @@ -22,7 +22,7 @@ static const char * lorem_ipsum = static lv_obj_t * create_test_obj(const char * text, bool simple) { - lv_obj_t * obj = lv_button_create(lv_scr_act()); + lv_obj_t * obj = lv_button_create(lv_screen_active()); lv_obj_set_size(obj, 120, 80); if(simple) { diff --git a/tests/src/test_cases/draw/test_draw_line.c b/tests/src/test_cases/draw/test_draw_line.c index d0d3e528d..62a93ff7d 100644 --- a/tests/src/test_cases/draw/test_draw_line.c +++ b/tests/src/test_cases/draw/test_draw_line.c @@ -21,7 +21,7 @@ static void radial_lines_create(lv_style_t * style, uint32_t line_index) uint32_t i; for(i = 0; i < 24; i ++) { - lv_obj_t * line = lv_line_create(lv_scr_act()); + lv_obj_t * line = lv_line_create(lv_screen_active()); if(style) lv_obj_add_style(line, style, 0); p[i][0].x = 140; p[i][0].y = 100; diff --git a/tests/src/test_cases/draw/test_draw_rectangle.c b/tests/src/test_cases/draw/test_draw_rectangle.c index ca6e7975a..08342a789 100644 --- a/tests/src/test_cases/draw/test_draw_rectangle.c +++ b/tests/src/test_cases/draw/test_draw_rectangle.c @@ -6,8 +6,8 @@ void setUp(void) { /* Function run before every test */ - lv_obj_set_flex_flow(lv_scr_act(), LV_FLEX_FLOW_ROW_WRAP); - lv_obj_set_flex_align(lv_scr_act(), LV_FLEX_ALIGN_SPACE_EVENLY, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); + 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_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); } void tearDown(void) @@ -24,13 +24,13 @@ static void create_rects(lv_style_t * style, const char * name, lv_opa_t opa) char buf[64]; - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); uint32_t ri; for(ri = 0; ri < sizeof(r) / sizeof(r[0]); ri++) { uint32_t si; for(si = 0; si < sizeof(w) / sizeof(w[0]); si++) { - lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_t * obj = lv_obj_create(lv_screen_active()); lv_obj_remove_style_all(obj); lv_obj_add_style(obj, style, 0); lv_obj_set_style_radius(obj, r[ri], 0); diff --git a/tests/src/test_cases/draw/test_draw_transform.c b/tests/src/test_cases/draw/test_draw_transform.c index ca4ba8026..241c8bee8 100644 --- a/tests/src/test_cases/draw/test_draw_transform.c +++ b/tests/src/test_cases/draw/test_draw_transform.c @@ -7,8 +7,8 @@ void setUp(void) { - lv_obj_set_flex_flow(lv_scr_act(), LV_FLEX_FLOW_ROW_WRAP); - lv_obj_set_flex_align(lv_scr_act(), LV_FLEX_ALIGN_SPACE_EVENLY, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); + 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_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); } void tearDown(void) @@ -19,7 +19,7 @@ void tearDown(void) static void canvas_basic_render(lv_color_format_t render_cf, uint8_t * canvas_buf) { - lv_obj_t * canvas = lv_canvas_create(lv_scr_act()); + lv_obj_t * canvas = lv_canvas_create(lv_screen_active()); lv_canvas_set_buffer(canvas, canvas_buf, 100, 100, render_cf); lv_canvas_fill_bg(canvas, lv_palette_lighten(LV_PALETTE_RED, 2), LV_OPA_TRANSP); @@ -46,7 +46,7 @@ static void canvas_basic_render(lv_color_format_t render_cf, uint8_t * canvas_bu lv_canvas_finish_layer(canvas, &layer); - lv_obj_del(canvas); + lv_obj_delete(canvas); } static void draw_images(lv_layer_t * layer, lv_draw_image_dsc_t * dsc) @@ -151,7 +151,7 @@ void create_test_screen(lv_color_format_t render_cf, const char * name) { static uint8_t canvas_buf_large[CANVAS_WIDTH_TO_STRIDE(768, 4) * 440 + LV_DRAW_BUF_ALIGN]; - lv_obj_t * canvas = lv_canvas_create(lv_scr_act()); + lv_obj_t * canvas = lv_canvas_create(lv_screen_active()); lv_canvas_set_buffer(canvas, lv_draw_buf_align(canvas_buf_large, LV_COLOR_FORMAT_ARGB8888), 768, 440, LV_COLOR_FORMAT_ARGB8888); @@ -183,7 +183,7 @@ void create_test_screen(lv_color_format_t render_cf, const char * name) lv_snprintf(buf, sizeof(buf), "/draw/transform_%s.png", name); TEST_ASSERT_EQUAL_SCREENSHOT(buf); - lv_obj_del(canvas); + lv_obj_delete(canvas); } void test_draw_transform_rgb565(void) diff --git a/tests/src/test_cases/draw/test_draw_triangle.c b/tests/src/test_cases/draw/test_draw_triangle.c index 8f24b6136..1db4d83b2 100644 --- a/tests/src/test_cases/draw/test_draw_triangle.c +++ b/tests/src/test_cases/draw/test_draw_triangle.c @@ -7,8 +7,8 @@ void setUp(void) { /* Function run before every test */ - lv_obj_set_flex_flow(lv_scr_act(), LV_FLEX_FLOW_ROW_WRAP); - lv_obj_set_flex_align(lv_scr_act(), LV_FLEX_ALIGN_SPACE_EVENLY, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); + 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_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); } void tearDown(void) @@ -59,7 +59,7 @@ void test_draw_triangle(void) static uint8_t canvas_buf[CANVAS_WIDTH_TO_STRIDE(768, 4) * 440 * 4]; - lv_obj_t * canvas = lv_canvas_create(lv_scr_act()); + lv_obj_t * canvas = lv_canvas_create(lv_screen_active()); lv_canvas_set_buffer(canvas, canvas_buf, 768, 440, LV_COLOR_FORMAT_ARGB8888); lv_canvas_fill_bg(canvas, lv_palette_lighten(LV_PALETTE_RED, 2), LV_OPA_50); diff --git a/tests/src/test_cases/draw/test_image_formats.c b/tests/src/test_cases/draw/test_image_formats.c index 46414acd8..89bfe4da8 100644 --- a/tests/src/test_cases/draw/test_image_formats.c +++ b/tests/src/test_cases/draw/test_image_formats.c @@ -6,10 +6,10 @@ void setUp(void) { /* Function run before every test */ - lv_obj_set_flex_flow(lv_scr_act(), LV_FLEX_FLOW_ROW_WRAP); - lv_obj_set_flex_align(lv_scr_act(), LV_FLEX_ALIGN_SPACE_EVENLY, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); + 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_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY); - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); } @@ -21,7 +21,7 @@ void tearDown(void) static void img_create(const char * name, const void * img_src, bool rotate, bool recolor) { - lv_obj_t * cont = lv_obj_create(lv_scr_act()); + lv_obj_t * cont = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont, 120, LV_SIZE_CONTENT); lv_obj_set_style_bg_color(cont, lv_palette_main(LV_PALETTE_LIGHT_BLUE), 0); lv_obj_set_style_pad_all(cont, 5, 0); diff --git a/tests/src/test_cases/libs/test_barcode.c b/tests/src/test_cases/libs/test_barcode.c index 3c04ac952..f52442b4b 100644 --- a/tests/src/test_cases/libs/test_barcode.c +++ b/tests/src/test_cases/libs/test_barcode.c @@ -9,7 +9,7 @@ static lv_obj_t * active_screen = NULL; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); } void tearDown(void) diff --git a/tests/src/test_cases/libs/test_libjpeg_turbo.c b/tests/src/test_cases/libs/test_libjpeg_turbo.c index d6abf3314..6e77542be 100644 --- a/tests/src/test_cases/libs/test_libjpeg_turbo.c +++ b/tests/src/test_cases/libs/test_libjpeg_turbo.c @@ -16,11 +16,11 @@ void tearDown(void) static void create_images(void) { - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); lv_obj_t * img; - img = lv_image_create(lv_scr_act()); + img = lv_image_create(lv_screen_active()); lv_image_set_src(img, "A:src/test_assets/test_img_lvgl_logo.jpg"); lv_obj_center(img); } @@ -39,7 +39,7 @@ void test_jpg_2(void) for(uint32_t i = 0; i < 20; i++) { create_images(); - lv_obj_invalidate(lv_scr_act()); + lv_obj_invalidate(lv_screen_active()); lv_refr_now(NULL); } diff --git a/tests/src/test_cases/libs/test_libpng.c b/tests/src/test_cases/libs/test_libpng.c index a1761604c..e68e95601 100644 --- a/tests/src/test_cases/libs/test_libpng.c +++ b/tests/src/test_cases/libs/test_libpng.c @@ -16,11 +16,11 @@ void tearDown(void) static void create_images(void) { - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); lv_obj_t * img; - img = lv_image_create(lv_scr_act()); + img = lv_image_create(lv_screen_active()); lv_image_set_src(img, "A:src/test_assets/test_img_lvgl_logo.png"); lv_obj_center(img); } @@ -39,7 +39,7 @@ void test_libpng_1(void) for(uint32_t i = 0; i < 20; i++) { create_images(); - lv_obj_invalidate(lv_scr_act()); + lv_obj_invalidate(lv_screen_active()); lv_refr_now(NULL); } diff --git a/tests/src/test_cases/libs/test_lodepng.c b/tests/src/test_cases/libs/test_lodepng.c index 49ef9c519..e3244cfeb 100644 --- a/tests/src/test_cases/libs/test_lodepng.c +++ b/tests/src/test_cases/libs/test_lodepng.c @@ -16,25 +16,25 @@ void tearDown(void) static void create_images(void) { - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); lv_obj_t * img; lv_obj_t * label; LV_IMG_DECLARE(test_img_lvgl_logo_png); - img = lv_image_create(lv_scr_act()); + 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); - label = lv_label_create(lv_scr_act()); + label = lv_label_create(lv_screen_active()); lv_label_set_text(label, "Array"); lv_obj_align(label, LV_ALIGN_CENTER, -100, 20); - img = lv_image_create(lv_scr_act()); + img = lv_image_create(lv_screen_active()); lv_image_set_src(img, "A:src/test_assets/test_img_lvgl_logo.png"); lv_obj_align(img, LV_ALIGN_CENTER, 100, -20); - label = lv_label_create(lv_scr_act()); + label = lv_label_create(lv_screen_active()); lv_label_set_text(label, "File"); lv_obj_align(label, LV_ALIGN_CENTER, 100, 20); } @@ -53,7 +53,7 @@ void test_lodepng_1(void) for(uint32_t i = 0; i < 20; i++) { create_images(); - lv_obj_invalidate(lv_scr_act()); + lv_obj_invalidate(lv_screen_active()); lv_refr_now(NULL); } diff --git a/tests/src/test_cases/libs/test_tiny_ttf.c b/tests/src/test_cases/libs/test_tiny_ttf.c index 51c3ad920..5faeb82dc 100644 --- a/tests/src/test_cases/libs/test_tiny_ttf.c +++ b/tests/src/test_cases/libs/test_tiny_ttf.c @@ -31,7 +31,7 @@ void test_tiny_ttf_rendering_test(void) /*Create a label with the new style*/ - lv_obj_t * label = lv_label_create(lv_scr_act()); + lv_obj_t * label = lv_label_create(lv_screen_active()); lv_obj_add_style(label, &style, 0); lv_label_set_text(label, "Hello world\n" "I'm a font created with Tiny TTF\n" diff --git a/tests/src/test_cases/libs/test_tjpgd.c b/tests/src/test_cases/libs/test_tjpgd.c index bf20e49f2..3943b452a 100644 --- a/tests/src/test_cases/libs/test_tjpgd.c +++ b/tests/src/test_cases/libs/test_tjpgd.c @@ -16,25 +16,25 @@ void tearDown(void) static void create_images(void) { - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); lv_obj_t * img; lv_obj_t * label; LV_IMG_DECLARE(test_img_lvgl_logo_jpg); - img = lv_image_create(lv_scr_act()); + 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); - label = lv_label_create(lv_scr_act()); + label = lv_label_create(lv_screen_active()); lv_label_set_text(label, "Array"); lv_obj_align(label, LV_ALIGN_CENTER, -100, 20); - img = lv_image_create(lv_scr_act()); + img = lv_image_create(lv_screen_active()); lv_image_set_src(img, "A:src/test_assets/test_img_lvgl_logo.jpg"); lv_obj_align(img, LV_ALIGN_CENTER, 100, -20); - label = lv_label_create(lv_scr_act()); + label = lv_label_create(lv_screen_active()); lv_label_set_text(label, "File"); lv_obj_align(label, LV_ALIGN_CENTER, 100, 20); } @@ -53,7 +53,7 @@ void test_tjpgd_1(void) for(uint32_t i = 0; i < 20; i++) { create_images(); - lv_obj_invalidate(lv_scr_act()); + lv_obj_invalidate(lv_screen_active()); lv_refr_now(NULL); } diff --git a/tests/src/test_cases/test_event.c b/tests/src/test_cases/test_event.c index 1c46def34..b2ef5ae0c 100644 --- a/tests/src/test_cases/test_event.c +++ b/tests/src/test_cases/test_event.c @@ -7,7 +7,7 @@ static void event_object_deletion_cb(const lv_obj_class_t * cls, lv_event_t * e) { LV_UNUSED(cls); if(lv_event_get_code(e) == LV_EVENT_VALUE_CHANGED) { - lv_obj_del(lv_event_get_target(e)); + lv_obj_delete(lv_event_get_target(e)); } } @@ -20,7 +20,7 @@ static const lv_obj_class_t event_object_deletion_class = { /* Checks for memory leaks/invalid memory accesses on deleted objects */ void test_event_object_deletion(void) { - lv_obj_t * obj = lv_obj_class_create_obj(&event_object_deletion_class, lv_scr_act()); + lv_obj_t * obj = lv_obj_class_create_obj(&event_object_deletion_class, lv_screen_active()); lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); } diff --git a/tests/src/test_cases/test_font_loader.c b/tests/src/test_cases/test_font_loader.c index c600758a0..7753ff63a 100644 --- a/tests/src/test_cases/test_font_loader.c +++ b/tests/src/test_cases/test_font_loader.c @@ -64,7 +64,7 @@ void setUp(void) void tearDown(void) { /* Function run after every test */ - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); lv_font_free(font_1_bin); lv_font_free(font_2_bin); @@ -78,7 +78,7 @@ static void common(void) compare_fonts(&font_3, font_3_bin); /* create labels for testing */ - lv_obj_t * scr = lv_scr_act(); + lv_obj_t * scr = lv_screen_active(); lv_obj_t * label1 = lv_label_create(scr); lv_obj_t * label2 = lv_label_create(scr); lv_obj_t * label3 = lv_label_create(scr); diff --git a/tests/src/test_cases/test_grid.c b/tests/src/test_cases/test_grid.c index 16954b7e9..4736554ac 100644 --- a/tests/src/test_cases/test_grid.c +++ b/tests/src/test_cases/test_grid.c @@ -6,7 +6,7 @@ void setUp(void) { /* Function run before every test */ - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); } void tearDown(void) @@ -31,7 +31,7 @@ void test_subgrid_row(void) const lv_coord_t col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; const lv_coord_t row_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; - lv_obj_t * cont_main = lv_obj_create(lv_scr_act()); + lv_obj_t * cont_main = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont_main, 700, 300); lv_obj_center(cont_main); lv_obj_set_grid_dsc_array(cont_main, col_dsc, row_dsc); @@ -64,7 +64,7 @@ void test_subgrid_col(void) const lv_coord_t col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; const lv_coord_t row_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; - lv_obj_t * cont_main = lv_obj_create(lv_scr_act()); + lv_obj_t * cont_main = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont_main, 700, 300); lv_obj_center(cont_main); lv_obj_set_grid_dsc_array(cont_main, col_dsc, row_dsc); diff --git a/tests/src/test_cases/test_group.c b/tests/src/test_cases/test_group.c index 3f896a044..bad4f56df 100644 --- a/tests/src/test_cases/test_group.c +++ b/tests/src/test_cases/test_group.c @@ -18,10 +18,10 @@ void test_group_count(void) TEST_ASSERT_EQUAL_UINT32(lv_group_get_count(), 2U); - lv_group_del(group_2); + lv_group_delete(group_2); TEST_ASSERT_EQUAL_UINT32(lv_group_get_count(), 1U); - lv_group_del(group_1); + lv_group_delete(group_1); TEST_ASSERT_EQUAL_UINT32(lv_group_get_count(), 0U); } @@ -34,8 +34,8 @@ void test_group_by_index(void) TEST_ASSERT_EQUAL_PTR(lv_group_by_index(0), group_1); TEST_ASSERT_EQUAL_PTR(lv_group_by_index(1), group_2); - lv_group_del(group_1); - lv_group_del(group_2); + lv_group_delete(group_1); + lv_group_delete(group_2); } #endif diff --git a/tests/src/test_cases/test_margin_align.c b/tests/src/test_cases/test_margin_align.c index 2f790bfbc..77f71dd76 100644 --- a/tests/src/test_cases/test_margin_align.c +++ b/tests/src/test_cases/test_margin_align.c @@ -7,7 +7,7 @@ static lv_obj_t * active_screen = NULL; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); } void tearDown(void) diff --git a/tests/src/test_cases/test_margin_flex.c b/tests/src/test_cases/test_margin_flex.c index ce18915da..aa334e883 100644 --- a/tests/src/test_cases/test_margin_flex.c +++ b/tests/src/test_cases/test_margin_flex.c @@ -7,7 +7,7 @@ static lv_obj_t * active_screen = NULL; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); } void tearDown(void) diff --git a/tests/src/test_cases/test_margin_grid.c b/tests/src/test_cases/test_margin_grid.c index 3a55e070a..01cd4282f 100644 --- a/tests/src/test_cases/test_margin_grid.c +++ b/tests/src/test_cases/test_margin_grid.c @@ -7,7 +7,7 @@ static lv_obj_t * active_screen = NULL; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); } void tearDown(void) diff --git a/tests/src/test_cases/test_obj_flags.c b/tests/src/test_cases/test_obj_flags.c index 08013d0e3..48bb7d18b 100644 --- a/tests/src/test_cases/test_obj_flags.c +++ b/tests/src/test_cases/test_obj_flags.c @@ -12,7 +12,7 @@ void setUp(void) void tearDown(void) { /* Function run after every test */ - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); } static void ext_draw_size_event_cb(lv_event_t * e) @@ -28,7 +28,7 @@ static void btn_clicked_event_cb(lv_event_t * e) void test_obj_flag_overflow_visible_1(void) { - lv_obj_t * obj_main = lv_obj_create(lv_scr_act()); + lv_obj_t * obj_main = lv_obj_create(lv_screen_active()); lv_obj_set_size(obj_main, 400, 300); lv_obj_set_style_bg_color(obj_main, lv_palette_main(LV_PALETTE_RED), 0); lv_obj_add_flag(obj_main, LV_OBJ_FLAG_OVERFLOW_VISIBLE); @@ -43,7 +43,7 @@ void test_obj_flag_overflow_visible_1(void) lv_obj_t * btn_1 = lv_button_create(obj_child_1); lv_obj_set_size(btn_1, 100, 100); lv_obj_align(btn_1, LV_ALIGN_LEFT_MID, -75, 0); - lv_obj_clear_flag(btn_1, LV_OBJ_FLAG_SCROLL_ON_FOCUS); + lv_obj_remove_flag(btn_1, LV_OBJ_FLAG_SCROLL_ON_FOCUS); uint32_t cnt_1; lv_obj_add_event(btn_1, btn_clicked_event_cb, LV_EVENT_CLICKED, &cnt_1); @@ -61,7 +61,7 @@ void test_obj_flag_overflow_visible_1(void) lv_obj_t * btn_2 = lv_button_create(obj_child_2); lv_obj_set_size(btn_2, 100, 100); lv_obj_align(btn_2, LV_ALIGN_RIGHT_MID, 75, 0); - lv_obj_clear_flag(btn_2, LV_OBJ_FLAG_SCROLL_ON_FOCUS); + lv_obj_remove_flag(btn_2, LV_OBJ_FLAG_SCROLL_ON_FOCUS); uint32_t cnt_2; lv_obj_add_event(btn_2, btn_clicked_event_cb, LV_EVENT_CLICKED, &cnt_2); diff --git a/tests/src/test_cases/test_obj_tree.c b/tests/src/test_cases/test_obj_tree.c index 1b0ac45bc..4f7040897 100644 --- a/tests/src/test_cases/test_obj_tree.c +++ b/tests/src/test_cases/test_obj_tree.c @@ -8,30 +8,30 @@ void test_obj_tree_2(void); void test_obj_tree_1(void) { - TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 0); + TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_screen_active()), 0); } void test_obj_tree_2(void) { - lv_obj_create(lv_scr_act()); - lv_obj_t * o2 = lv_obj_create(lv_scr_act()); - lv_obj_create(lv_scr_act()); - TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 3); + lv_obj_create(lv_screen_active()); + lv_obj_t * o2 = lv_obj_create(lv_screen_active()); + lv_obj_create(lv_screen_active()); + TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_screen_active()), 3); - lv_obj_del(o2); - TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 2); + lv_obj_delete(o2); + TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_screen_active()), 2); - lv_obj_clean(lv_scr_act()); - TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 0); + lv_obj_clean(lv_screen_active()); + TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_screen_active()), 0); lv_color_t c1 = lv_color_hex(0x444444); lv_color_t c2 = lv_color_hex3(0x444); TEST_ASSERT_EQUAL_COLOR(c1, c2); - lv_obj_remove_style_all(lv_scr_act()); - lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x112233), 0); - lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_COVER, 0); + lv_obj_remove_style_all(lv_screen_active()); + lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0x112233), 0); + lv_obj_set_style_bg_opa(lv_screen_active(), LV_OPA_COVER, 0); //TEST_ASSERT_EQUAL_SCREENSHOT("scr1.png") } @@ -39,8 +39,8 @@ void test_obj_tree_2(void) void test_obj_tree_3(void) { /* tests lv_obj_swap */ - lv_obj_t * parent1 = lv_obj_create(lv_scr_act()); - lv_obj_t * parent2 = lv_obj_create(lv_scr_act()); + lv_obj_t * parent1 = lv_obj_create(lv_screen_active()); + lv_obj_t * parent2 = lv_obj_create(lv_screen_active()); lv_obj_t * child1 = lv_obj_create(parent1); lv_obj_t * child2 = lv_obj_create(parent2); diff --git a/tests/src/test_cases/test_observer.c b/tests/src/test_cases/test_observer.c index 3a8628cb2..f87834e72 100644 --- a/tests/src/test_cases/test_observer.c +++ b/tests/src/test_cases/test_observer.c @@ -12,7 +12,7 @@ void setUp(void) void tearDown(void) { /* Function run after every test */ - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); } static int32_t prev_v; @@ -213,7 +213,7 @@ void test_observer_group(void) void test_observer_obj_flag(void) { - lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_t * obj = lv_obj_create(lv_screen_active()); /*Can bind only to int*/ static lv_subject_t subject_wrong; @@ -244,7 +244,7 @@ void test_observer_obj_flag(void) void test_observer_obj_state(void) { - lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_t * obj = lv_obj_create(lv_screen_active()); /*Can bind only to int*/ static lv_subject_t subject_wrong; @@ -275,7 +275,7 @@ void test_observer_obj_state(void) void test_observer_button_checked(void) { - lv_obj_t * obj = lv_button_create(lv_scr_act()); + lv_obj_t * obj = lv_button_create(lv_screen_active()); lv_obj_set_size(obj, 100, 100); lv_obj_add_flag(obj, LV_OBJ_FLAG_CHECKABLE); lv_obj_update_layout(obj); @@ -302,7 +302,7 @@ void test_observer_button_checked(void) void test_observer_label_text_normal(void) { - lv_obj_t * obj = lv_label_create(lv_scr_act()); + lv_obj_t * obj = lv_label_create(lv_screen_active()); lv_observer_t * observer; @@ -350,7 +350,7 @@ void test_observer_label_text_normal(void) void test_observer_label_text_formatted(void) { - lv_obj_t * obj = lv_label_create(lv_scr_act()); + lv_obj_t * obj = lv_label_create(lv_screen_active()); lv_observer_t * observer; @@ -406,7 +406,7 @@ void test_observer_label_text_formatted(void) void test_observer_arc_value(void) { - lv_obj_t * obj = lv_arc_create(lv_scr_act()); + lv_obj_t * obj = lv_arc_create(lv_screen_active()); static lv_subject_t subject; lv_subject_init_int(&subject, 30); @@ -430,7 +430,7 @@ void test_observer_arc_value(void) void test_observer_slider_value(void) { - lv_obj_t * obj = lv_slider_create(lv_scr_act()); + lv_obj_t * obj = lv_slider_create(lv_screen_active()); static lv_subject_t subject; lv_subject_init_int(&subject, 30); @@ -457,7 +457,7 @@ void test_observer_slider_value(void) void test_observer_roller_value(void) { - lv_obj_t * obj = lv_roller_create(lv_scr_act()); + lv_obj_t * obj = lv_roller_create(lv_screen_active()); static lv_subject_t subject; lv_subject_init_int(&subject, 1); @@ -477,7 +477,7 @@ void test_observer_roller_value(void) void test_observer_dropdown_value(void) { - lv_obj_t * obj = lv_dropdown_create(lv_scr_act()); + lv_obj_t * obj = lv_dropdown_create(lv_screen_active()); static lv_subject_t subject; lv_subject_init_int(&subject, 1); diff --git a/tests/src/test_cases/test_snapshot.c b/tests/src/test_cases/test_snapshot.c index 75e3174be..764ff6b5a 100644 --- a/tests/src/test_cases/test_snapshot.c +++ b/tests/src/test_cases/test_snapshot.c @@ -21,7 +21,7 @@ void test_snapshot_should_not_leak_memory(void) initial_available_memory = monitor.free_size; for(idx = 0; idx < NUM_SNAPSHOTS; idx++) { - snapshots[idx] = lv_snapshot_take(lv_scr_act(), LV_COLOR_FORMAT_NATIVE_WITH_ALPHA); + snapshots[idx] = lv_snapshot_take(lv_screen_active(), LV_COLOR_FORMAT_NATIVE_WITH_ALPHA); TEST_ASSERT_NOT_NULL(snapshots[idx]); } diff --git a/tests/src/test_cases/test_span.c b/tests/src/test_cases/test_span.c index 4c48b7d09..fc32c2e3d 100644 --- a/tests/src/test_cases/test_span.c +++ b/tests/src/test_cases/test_span.c @@ -13,7 +13,7 @@ void setUp(void) void tearDown(void) { - lv_obj_del(spangroup); + lv_obj_delete(spangroup); if(active_screen) { lv_obj_clean(active_screen); @@ -46,11 +46,11 @@ void test_spangroup_new_span_with_valid_parameter_returns_not_null_object(void) TEST_ASSERT_EQUAL_INT(1, lv_spangroup_get_child_cnt(spangroup)); } -void test_spangroup_del_span_span_is_null(void) +void test_spangroup_delete_span_span_is_null(void) { lv_span_t * span = lv_spangroup_new_span(spangroup); - lv_spangroup_del_span(spangroup, span); + lv_spangroup_delete_span(spangroup, span); TEST_ASSERT_EQUAL_INT(0, lv_spangroup_get_child_cnt(spangroup)); } @@ -213,7 +213,7 @@ void test_spangroup_get_max_line_h(void) void test_spangroup_draw(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); spangroup = lv_spangroup_create(active_screen); lv_spangroup_set_mode(spangroup, LV_SPAN_MODE_BREAK); lv_obj_set_width(spangroup, 100); @@ -263,7 +263,7 @@ void test_spangroup_get_expand_width(void) { const uint32_t experimental_size = 232; const uint32_t constrained_size = 232; - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); spangroup = lv_spangroup_create(active_screen); lv_span_t * span = lv_spangroup_new_span(spangroup); diff --git a/tests/src/test_cases/test_style.c b/tests/src/test_cases/test_style.c index f54c16c20..26c51e657 100644 --- a/tests/src/test_cases/test_style.c +++ b/tests/src/test_cases/test_style.c @@ -12,7 +12,7 @@ static void obj_set_height_helper(void * obj, int32_t height) void test_gradient_vertical_misalignment(void) { /* Tests gradient caching as the height of widget changes.*/ - lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_t * obj = lv_obj_create(lv_screen_active()); lv_obj_set_style_bg_grad_dir(obj, LV_GRAD_DIR_VER, 0); lv_obj_set_style_bg_grad_color(obj, lv_color_hex(0xff0000), 0); lv_obj_set_style_bg_color(obj, lv_color_hex(0x00ff00), 0); @@ -80,7 +80,7 @@ LV_STYLE_CONST_INIT(const_style, const_style_props); void test_const_style(void) { - lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_t * obj = lv_obj_create(lv_screen_active()); lv_obj_add_style(obj, &const_style, LV_PART_MAIN); TEST_ASSERT_EQUAL(51, lv_obj_get_style_width(obj, LV_PART_MAIN)); TEST_ASSERT_EQUAL(50, lv_obj_get_style_height(obj, LV_PART_MAIN)); @@ -99,7 +99,7 @@ void test_style_replacement(void) lv_style_set_bg_color(&style_blue, lv_color_hex(0x0000ff)); /*Create object with style*/ - lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_t * obj = lv_obj_create(lv_screen_active()); lv_obj_add_style(obj, &style_red, LV_PART_MAIN); TEST_ASSERT_EQUAL_COLOR(lv_color_hex(0xff0000), lv_obj_get_style_bg_color(obj, LV_PART_MAIN)); diff --git a/tests/src/test_cases/widgets/test_animimg.c b/tests/src/test_cases/widgets/test_animimg.c index 50c8bdd08..a9169fc81 100644 --- a/tests/src/test_cases/widgets/test_animimg.c +++ b/tests/src/test_cases/widgets/test_animimg.c @@ -28,7 +28,7 @@ void test_animimg_start(void); void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); animimg = lv_animimg_create(active_screen); } diff --git a/tests/src/test_cases/widgets/test_arc.c b/tests/src/test_cases/widgets/test_arc.c index 7fbea8e03..dd6f80f7a 100644 --- a/tests/src/test_cases/widgets/test_arc.c +++ b/tests/src/test_cases/widgets/test_arc.c @@ -23,12 +23,12 @@ static void dummy_event_cb(lv_event_t * e); void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); } void tearDown(void) { - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); } void test_arc_creation_successfull(void) @@ -115,7 +115,7 @@ void test_arc_angles_when_reversed(void) int16_t expected_value = 40; lv_obj_t * arcBlack; - arcBlack = lv_arc_create(lv_scr_act()); + arcBlack = lv_arc_create(lv_screen_active()); lv_arc_set_mode(arcBlack, LV_ARC_MODE_REVERSE); @@ -130,7 +130,7 @@ void test_arc_angles_when_reversed(void) void test_arc_click_area_with_adv_hittest(void) { - arc = lv_arc_create(lv_scr_act()); + arc = lv_arc_create(lv_screen_active()); lv_obj_set_size(arc, 100, 100); lv_obj_set_style_arc_width(arc, 10, 0); lv_obj_add_flag(arc, LV_OBJ_FLAG_ADV_HITTEST); @@ -165,7 +165,7 @@ void test_arc_click_area_with_adv_hittest(void) void test_arc_basic_render(void) { - arc = lv_arc_create(lv_scr_act()); + arc = lv_arc_create(lv_screen_active()); lv_obj_set_size(arc, 100, 100); lv_obj_center(arc); TEST_ASSERT_EQUAL_SCREENSHOT("arc_1.png"); diff --git a/tests/src/test_cases/widgets/test_bar.c b/tests/src/test_cases/widgets/test_bar.c index 423d7b47e..314ac0bde 100644 --- a/tests/src/test_cases/widgets/test_bar.c +++ b/tests/src/test_cases/widgets/test_bar.c @@ -10,7 +10,7 @@ static lv_obj_t * bar = NULL; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); bar = lv_bar_create(active_screen); } @@ -147,7 +147,7 @@ void test_bar_normal(void) lv_color_t bg_color = lv_color_black(); lv_color_t indic_color = lv_color_hex(0x0000FF); - 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_btn.c b/tests/src/test_cases/widgets/test_btn.c index a693b2ba6..8ca454fa4 100644 --- a/tests/src/test_cases/widgets/test_btn.c +++ b/tests/src/test_cases/widgets/test_btn.c @@ -7,7 +7,7 @@ static lv_obj_t * active_screen = NULL; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); } void tearDown(void) diff --git a/tests/src/test_cases/widgets/test_btnmatrix.c b/tests/src/test_cases/widgets/test_btnmatrix.c index 93e0fa74e..84b97beb8 100644 --- a/tests/src/test_cases/widgets/test_btnmatrix.c +++ b/tests/src/test_cases/widgets/test_btnmatrix.c @@ -10,7 +10,7 @@ lv_event_code_t exp_evt_code; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); btnm = lv_buttonmatrix_create(active_screen); TEST_ASSERT_NOT_NULL(btnm); event_triggered = false; diff --git a/tests/src/test_cases/widgets/test_calendar.c b/tests/src/test_cases/widgets/test_calendar.c index f61c5425e..8059ff38e 100644 --- a/tests/src/test_cases/widgets/test_calendar.c +++ b/tests/src/test_cases/widgets/test_calendar.c @@ -27,7 +27,7 @@ static lv_obj_t * calendar = NULL; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); calendar = lv_calendar_create(active_screen); } diff --git a/tests/src/test_cases/widgets/test_chart.c b/tests/src/test_cases/widgets/test_chart.c index 5f6ed9305..94e5824aa 100644 --- a/tests/src/test_cases/widgets/test_chart.c +++ b/tests/src/test_cases/widgets/test_chart.c @@ -10,7 +10,7 @@ static lv_color_t red_color; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); chart = lv_chart_create(active_screen); red_color = lv_palette_main(LV_PALETTE_RED); diff --git a/tests/src/test_cases/widgets/test_checkbox.c b/tests/src/test_cases/widgets/test_checkbox.c index e920243e4..f85acf948 100644 --- a/tests/src/test_cases/widgets/test_checkbox.c +++ b/tests/src/test_cases/widgets/test_checkbox.c @@ -28,7 +28,7 @@ static void event_handler(lv_event_t * e) void test_checkbox_creation_successfull(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); checkbox = lv_checkbox_create(active_screen); TEST_ASSERT_NOT_NULL(checkbox); @@ -36,7 +36,7 @@ void test_checkbox_creation_successfull(void) void test_checkbox_should_call_event_handler_on_click_when_enabled(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); checkbox = lv_checkbox_create(active_screen); lv_obj_add_state(checkbox, LV_STATE_CHECKED); @@ -53,7 +53,7 @@ void test_checkbox_should_have_default_text_when_created(void) { const char * default_text = "Check box"; - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); checkbox = lv_checkbox_create(active_screen); TEST_ASSERT_EQUAL_STRING(default_text, lv_checkbox_get_text(checkbox)); @@ -64,7 +64,7 @@ void test_checkbox_should_return_dinamically_allocated_text(void) { const char * message = "Hello World!"; - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); checkbox = lv_checkbox_create(active_screen); lv_checkbox_set_text(checkbox, message); @@ -81,7 +81,7 @@ void test_checkbox_should_allocate_memory_for_static_text(void) lv_mem_monitor_t m1; lv_mem_monitor(&m1); - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); checkbox = lv_checkbox_create(active_screen); initial_available_memory = m1.free_size; @@ -98,7 +98,7 @@ void test_checkbox_rtl(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_dropdown.c b/tests/src/test_cases/widgets/test_dropdown.c index fbb65e14e..87ccfcdfe 100644 --- a/tests/src/test_cases/widgets/test_dropdown.c +++ b/tests/src/test_cases/widgets/test_dropdown.c @@ -12,38 +12,38 @@ void setUp(void) void tearDown(void) { /* Function run after every test */ - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); } void test_dropdown_create_delete(void) { - lv_dropdown_create(lv_scr_act()); - TEST_ASSERT_EQUAL(2, lv_obj_get_child_cnt(lv_scr_act())); + lv_dropdown_create(lv_screen_active()); + TEST_ASSERT_EQUAL(2, lv_obj_get_child_cnt(lv_screen_active())); - lv_obj_t * dd2 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd2 = lv_dropdown_create(lv_screen_active()); lv_obj_set_pos(dd2, 200, 0); - TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(lv_scr_act())); + TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(lv_screen_active())); TEST_ASSERT_FALSE(lv_dropdown_is_open(dd2)); lv_dropdown_open(dd2); - TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(lv_scr_act())); + TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(lv_screen_active())); TEST_ASSERT_TRUE(lv_dropdown_is_open(dd2)); lv_dropdown_open(dd2); /*Try to open again*/ - TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(lv_scr_act())); + TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(lv_screen_active())); - lv_obj_t * dd3 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd3 = lv_dropdown_create(lv_screen_active()); lv_obj_set_pos(dd3, 400, 0); - TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_scr_act())); + TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_screen_active())); lv_dropdown_open(dd3); - TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_scr_act())); + TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_screen_active())); lv_dropdown_close(dd3); - TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_scr_act())); + TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_screen_active())); lv_dropdown_close(dd3); /*Try to close again*/ - TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_scr_act())); + TEST_ASSERT_EQUAL(6, lv_obj_get_child_cnt(lv_screen_active())); - lv_obj_del(dd2); - TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(lv_scr_act())); + lv_obj_delete(dd2); + TEST_ASSERT_EQUAL(4, lv_obj_get_child_cnt(lv_screen_active())); - lv_obj_clean(lv_scr_act()); - TEST_ASSERT_EQUAL(0, lv_obj_get_child_cnt(lv_scr_act())); + lv_obj_clean(lv_screen_active()); + TEST_ASSERT_EQUAL(0, lv_obj_get_child_cnt(lv_screen_active())); } @@ -53,7 +53,7 @@ void test_dropdown_set_options(void) lv_mem_monitor_t m1; lv_mem_monitor(&m1); - lv_obj_t * dd1 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd1 = lv_dropdown_create(lv_screen_active()); TEST_ASSERT_EQUAL_STRING("Option 1\nOption 2\nOption 3", lv_dropdown_get_options(dd1)); TEST_ASSERT_EQUAL(3, lv_dropdown_get_option_cnt(dd1)); @@ -106,7 +106,7 @@ void test_dropdown_set_options(void) TEST_ASSERT_EQUAL_STRING("", lv_dropdown_get_options(dd1)); TEST_ASSERT_EQUAL(0, lv_dropdown_get_option_cnt(dd1)); - lv_obj_del(dd1); + lv_obj_delete(dd1); lv_mem_monitor_t m2; lv_mem_monitor(&m2); @@ -115,7 +115,7 @@ void test_dropdown_set_options(void) void test_dropdown_select(void) { - lv_obj_t * dd1 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd1 = lv_dropdown_create(lv_screen_active()); lv_dropdown_set_selected(dd1, 2); TEST_ASSERT_EQUAL(2, lv_dropdown_get_selected(dd1)); @@ -136,8 +136,8 @@ void test_dropdown_select(void) void test_dropdown_click(void) { - lv_obj_clean(lv_scr_act()); - lv_obj_t * dd1 = lv_dropdown_create(lv_scr_act()); + lv_obj_clean(lv_screen_active()); + lv_obj_t * dd1 = lv_dropdown_create(lv_screen_active()); lv_obj_update_layout(dd1); TEST_ASSERT_FALSE(lv_dropdown_is_open(dd1)); @@ -160,18 +160,18 @@ static void dd_event(lv_event_t * e) void test_dropdown_keypad(void) { - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); lv_group_t * g = lv_group_create(); lv_indev_set_group(lv_test_keypad_indev, g); - lv_obj_t * dd1 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd1 = lv_dropdown_create(lv_screen_active()); lv_obj_set_pos(dd1, 20, 20); lv_dropdown_set_options(dd1, "1\n2\n3\n4\n5\n6\n7\n8"); lv_group_add_obj(g, dd1); lv_obj_add_event(dd1, dd_event, LV_EVENT_VALUE_CHANGED, NULL); - lv_obj_t * dd2 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd2 = lv_dropdown_create(lv_screen_active()); lv_obj_set_pos(dd2, 300, 20); lv_group_add_obj(g, dd2); @@ -257,24 +257,24 @@ void test_dropdown_keypad(void) TEST_ASSERT_NOT_NULL(lv_dropdown_get_list(dd2)); lv_indev_set_group(lv_test_keypad_indev, NULL); - lv_group_del(g); + lv_group_delete(g); } void test_dropdown_encoder(void) { - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); lv_group_t * g = lv_group_create(); lv_indev_set_group(lv_test_encoder_indev, g); - lv_obj_t * dd1 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd1 = lv_dropdown_create(lv_screen_active()); lv_obj_set_pos(dd1, 20, 20); lv_dropdown_set_options(dd1, "1\n2\n3\n4\n5\n6\n7\n8"); lv_group_add_obj(g, dd1); lv_obj_add_event(dd1, dd_event, LV_EVENT_VALUE_CHANGED, NULL); - lv_obj_t * dd2 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd2 = lv_dropdown_create(lv_screen_active()); lv_obj_set_pos(dd2, 300, 20); lv_group_add_obj(g, dd2); @@ -314,19 +314,19 @@ void test_dropdown_encoder(void) TEST_ASSERT_TRUE(lv_dropdown_is_open(dd2)); lv_indev_set_group(lv_test_encoder_indev, NULL); - lv_group_del(g); + lv_group_delete(g); } void test_dropdown_render_1(void) { - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); - lv_obj_t * dd1 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd1 = lv_dropdown_create(lv_screen_active()); lv_obj_set_pos(dd1, 10, 10); lv_dropdown_set_selected(dd1, 1); - lv_obj_t * dd2 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd2 = lv_dropdown_create(lv_screen_active()); lv_obj_set_pos(dd2, 200, 10); lv_obj_set_width(dd2, 200); lv_dropdown_set_selected(dd2, 2); @@ -335,7 +335,7 @@ void test_dropdown_render_1(void) lv_dropdown_set_selected_highlight(dd2, false); TEST_ASSERT_FALSE(lv_dropdown_get_selected_highlight(dd2)); - lv_obj_t * dd3 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd3 = lv_dropdown_create(lv_screen_active()); lv_obj_set_style_pad_hor(dd3, 5, 0); lv_obj_set_style_pad_ver(dd3, 20, 0); lv_obj_set_pos(dd3, 500, 150); @@ -366,28 +366,28 @@ void test_dropdown_render_1(void) void test_dropdown_render_2(void) { - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); LV_IMAGE_DECLARE(test_image_caret_down); - lv_obj_t * dd1 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd1 = lv_dropdown_create(lv_screen_active()); lv_dropdown_set_text(dd1, "Short"); lv_dropdown_set_options(dd1, "1\n2"); lv_dropdown_set_symbol(dd1, &test_image_caret_down); lv_dropdown_open(dd1); - lv_obj_t * dd2 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd2 = lv_dropdown_create(lv_screen_active()); lv_dropdown_set_text(dd2, "Go Up"); lv_dropdown_set_options(dd2, "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15"); lv_dropdown_set_symbol(dd2, NULL); lv_obj_align(dd2, LV_ALIGN_LEFT_MID, 150, 50); lv_dropdown_open(dd2); - lv_obj_t * dd3 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd3 = lv_dropdown_create(lv_screen_active()); lv_dropdown_set_text(dd3, "Limit Down"); lv_dropdown_set_options(dd3, "1aaaaaaaaaaaaaaaa\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15"); lv_obj_align(dd3, LV_ALIGN_LEFT_MID, 300, -10); lv_dropdown_open(dd3); - lv_obj_t * dd4 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd4 = lv_dropdown_create(lv_screen_active()); lv_dropdown_set_text(dd4, "Limit Top"); lv_dropdown_set_options(dd4, "1aaaaaaaaaaaaaaaa\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15"); lv_obj_align(dd4, LV_ALIGN_LEFT_MID, 450, 10); @@ -395,7 +395,7 @@ void test_dropdown_render_2(void) lv_dropdown_set_symbol(dd4, LV_SYMBOL_UP); lv_dropdown_open(dd4); - lv_obj_t * dd5 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd5 = lv_dropdown_create(lv_screen_active()); lv_dropdown_set_text(dd5, "Go Down"); lv_dropdown_set_options(dd5, "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15"); lv_dropdown_set_dir(dd5, LV_DIR_TOP); @@ -403,7 +403,7 @@ void test_dropdown_render_2(void) lv_obj_align(dd5, LV_ALIGN_LEFT_MID, 650, -200); lv_dropdown_open(dd5); - lv_obj_t * dd6 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd6 = lv_dropdown_create(lv_screen_active()); lv_dropdown_set_text(dd6, "Right"); lv_dropdown_set_options(dd6, "1aaa\n2aa\n3aa"); lv_dropdown_set_dir(dd6, LV_DIR_RIGHT); @@ -412,7 +412,7 @@ void test_dropdown_render_2(void) lv_dropdown_open(dd6); lv_obj_set_style_text_align(lv_dropdown_get_list(dd6), LV_TEXT_ALIGN_RIGHT, 0); - lv_obj_t * dd7 = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd7 = lv_dropdown_create(lv_screen_active()); lv_dropdown_set_text(dd7, "Left"); lv_dropdown_set_options(dd7, "1aaa\n2\n3"); lv_dropdown_set_dir(dd7, LV_DIR_LEFT); @@ -426,25 +426,25 @@ void test_dropdown_render_2(void) /* See #2893 */ void test_dropdown_should_list_on_top(void) { - lv_obj_t * cont1 = lv_obj_create(lv_scr_act()); + lv_obj_t * cont1 = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont1, 200, 100); lv_obj_t * dd = lv_dropdown_create(cont1); - lv_obj_t * cont2 = lv_obj_create(lv_scr_act()); + lv_obj_t * cont2 = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont2, 200, 100); lv_obj_set_pos(cont2, 0, 100); lv_dropdown_open(dd); lv_obj_t * list = lv_dropdown_get_list(dd); - TEST_ASSERT_EQUAL_PTR(lv_scr_act(), lv_obj_get_parent(list)); + TEST_ASSERT_EQUAL_PTR(lv_screen_active(), lv_obj_get_parent(list)); TEST_ASSERT_EQUAL_INT(2, lv_obj_get_index(list)); } /* See #4191 */ void test_dropdown_get_options_should_check_lengths(void) { - lv_obj_t * dd = lv_dropdown_create(lv_scr_act()); + lv_obj_t * dd = lv_dropdown_create(lv_screen_active()); lv_dropdown_set_options(dd, "abc\nab"); TEST_ASSERT_EQUAL_INT(1, lv_dropdown_get_option_index(dd, "ab")); diff --git a/tests/src/test_cases/widgets/test_label.c b/tests/src/test_cases/widgets/test_label.c index 1db3f0414..7be427c20 100644 --- a/tests/src/test_cases/widgets/test_label.c +++ b/tests/src/test_cases/widgets/test_label.c @@ -17,7 +17,7 @@ static lv_obj_t * empty_label; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); label = lv_label_create(active_screen); long_label = lv_label_create(active_screen); long_label_multiline = lv_label_create(active_screen); @@ -30,10 +30,10 @@ void setUp(void) void tearDown(void) { - lv_obj_del(label); - lv_obj_del(long_label); - lv_obj_del(long_label_multiline); - lv_obj_del(empty_label); + lv_obj_delete(label); + lv_obj_delete(long_label); + lv_obj_delete(long_label_multiline); + lv_obj_delete(empty_label); } void test_label_creation(void) diff --git a/tests/src/test_cases/widgets/test_led.c b/tests/src/test_cases/widgets/test_led.c index 9e29b511d..c28897412 100644 --- a/tests/src/test_cases/widgets/test_led.c +++ b/tests/src/test_cases/widgets/test_led.c @@ -7,7 +7,7 @@ static lv_obj_t * active_screen = NULL; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); } void tearDown(void) diff --git a/tests/src/test_cases/widgets/test_line.c b/tests/src/test_cases/widgets/test_line.c index 383add6f5..a3dec9fdc 100644 --- a/tests/src/test_cases/widgets/test_line.c +++ b/tests/src/test_cases/widgets/test_line.c @@ -12,7 +12,7 @@ static const lv_coord_t final_extra_draw_size = 10U; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); line = lv_line_create(active_screen); } diff --git a/tests/src/test_cases/widgets/test_list.c b/tests/src/test_cases/widgets/test_list.c index 8df356df1..c33152e61 100644 --- a/tests/src/test_cases/widgets/test_list.c +++ b/tests/src/test_cases/widgets/test_list.c @@ -7,7 +7,7 @@ static lv_obj_t * list; void setUp(void) { - list = lv_list_create(lv_scr_act()); + list = lv_list_create(lv_screen_active()); } void tearDown(void) @@ -49,7 +49,7 @@ void test_list_get_text_from_label(void) void test_list_snapshot(void) { - lv_obj_t * snapshot_list = lv_list_create(lv_scr_act()); + lv_obj_t * snapshot_list = lv_list_create(lv_screen_active()); lv_list_add_text(snapshot_list, "File"); lv_list_add_button(snapshot_list, LV_SYMBOL_FILE, "New"); diff --git a/tests/src/test_cases/widgets/test_msgbox.c b/tests/src/test_cases/widgets/test_msgbox.c index 536b1642b..64d2c7baa 100644 --- a/tests/src/test_cases/widgets/test_msgbox.c +++ b/tests/src/test_cases/widgets/test_msgbox.c @@ -31,7 +31,7 @@ static const char * buttons_txts[] = {"Apply", "Cancel", NULL}; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); } void tearDown(void) diff --git a/tests/src/test_cases/widgets/test_roller.c b/tests/src/test_cases/widgets/test_roller.c index 3fa6130eb..cfea5ea77 100644 --- a/tests/src/test_cases/widgets/test_roller.c +++ b/tests/src/test_cases/widgets/test_roller.c @@ -20,7 +20,7 @@ static const char * default_infinite_roller_options = "One\nTwo\nThree\nFour\nFi void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); roller = lv_roller_create(active_screen); roller_infinite = lv_roller_create(active_screen); roller_mouse = lv_roller_create(active_screen); diff --git a/tests/src/test_cases/widgets/test_slider.c b/tests/src/test_cases/widgets/test_slider.c index a7f1aec32..48d95fca1 100644 --- a/tests/src/test_cases/widgets/test_slider.c +++ b/tests/src/test_cases/widgets/test_slider.c @@ -13,7 +13,7 @@ static lv_group_t * g = NULL; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); slider = lv_slider_create(active_screen); sliderRangeMode = lv_slider_create(active_screen); sliderNormalMode = lv_slider_create(active_screen); diff --git a/tests/src/test_cases/widgets/test_spinbox.c b/tests/src/test_cases/widgets/test_spinbox.c index c6a84f2eb..3f8e5ba6c 100644 --- a/tests/src/test_cases/widgets/test_spinbox.c +++ b/tests/src/test_cases/widgets/test_spinbox.c @@ -17,7 +17,7 @@ static const uint8_t SPINBOX_DECIMAL_POSITION = 1U; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); spinbox_negative_min_range = lv_spinbox_create(active_screen); spinbox_zero_min_range = lv_spinbox_create(active_screen); spinbox_events = lv_spinbox_create(active_screen); @@ -33,9 +33,9 @@ void tearDown(void) { lv_group_remove_obj(spinbox_events); - lv_obj_del(spinbox_negative_min_range); - lv_obj_del(spinbox_zero_min_range); - lv_obj_del(spinbox_events); + lv_obj_delete(spinbox_negative_min_range); + lv_obj_delete(spinbox_zero_min_range); + lv_obj_delete(spinbox_events); lv_obj_clean(active_screen); } diff --git a/tests/src/test_cases/widgets/test_spinner.c b/tests/src/test_cases/widgets/test_spinner.c index f9a8287eb..2307eb69e 100644 --- a/tests/src/test_cases/widgets/test_spinner.c +++ b/tests/src/test_cases/widgets/test_spinner.c @@ -8,8 +8,8 @@ static lv_obj_t * spinner = NULL; void setUp(void) { - active_screen = lv_scr_act(); - spinner = lv_spinner_create(lv_scr_act()); + active_screen = lv_screen_active(); + spinner = lv_spinner_create(lv_screen_active()); lv_obj_set_size(spinner, 100, 100); lv_obj_center(spinner); } diff --git a/tests/src/test_cases/widgets/test_switch.c b/tests/src/test_cases/widgets/test_switch.c index a55b603ee..26840e3fc 100644 --- a/tests/src/test_cases/widgets/test_switch.c +++ b/tests/src/test_cases/widgets/test_switch.c @@ -15,7 +15,7 @@ lv_obj_t * sw = NULL; void setUp(void) { /* Function run before every test */ - scr = lv_scr_act(); + scr = lv_screen_active(); sw = lv_switch_create(scr); } @@ -62,7 +62,7 @@ void test_switch_should_not_leak_memory_after_deletion(void) } for(idx = 0; idx < SWITCHES_CNT; idx++) { - lv_obj_del(switches[idx]); + lv_obj_delete(switches[idx]); } lv_mem_monitor(&monitor); diff --git a/tests/src/test_cases/widgets/test_table.c b/tests/src/test_cases/widgets/test_table.c index 293df48c5..393d72f41 100644 --- a/tests/src/test_cases/widgets/test_table.c +++ b/tests/src/test_cases/widgets/test_table.c @@ -8,13 +8,13 @@ static lv_obj_t * table = NULL; void setUp(void) { - scr = lv_scr_act(); + scr = lv_screen_active(); table = lv_table_create(scr); } void tearDown(void) { - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_screen_active()); } void test_table_should_return_assigned_cell_value(void) diff --git a/tests/src/test_cases/widgets/test_tabview.c b/tests/src/test_cases/widgets/test_tabview.c index c8a4c75dd..599e1d437 100644 --- a/tests/src/test_cases/widgets/test_tabview.c +++ b/tests/src/test_cases/widgets/test_tabview.c @@ -28,7 +28,7 @@ static lv_obj_t * tabview = NULL; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); } void tearDown(void) diff --git a/tests/src/test_cases/widgets/test_textarea.c b/tests/src/test_cases/widgets/test_textarea.c index 99a14d819..448eb2f40 100644 --- a/tests/src/test_cases/widgets/test_textarea.c +++ b/tests/src/test_cases/widgets/test_textarea.c @@ -10,7 +10,7 @@ static const char * textarea_default_text = ""; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); textarea = lv_textarea_create(active_screen); } diff --git a/tests/src/test_cases/widgets/test_win.c b/tests/src/test_cases/widgets/test_win.c index 252ed2c34..2de33f836 100644 --- a/tests/src/test_cases/widgets/test_win.c +++ b/tests/src/test_cases/widgets/test_win.c @@ -11,7 +11,7 @@ const char * dummy_text = "Hello LVGL!"; void setUp(void) { - active_screen = lv_scr_act(); + active_screen = lv_screen_active(); } void tearDown(void) diff --git a/tests/unity/unity_support.c b/tests/unity/unity_support.c index 5ee0b950d..2cb7222b9 100644 --- a/tests/unity/unity_support.c +++ b/tests/unity/unity_support.c @@ -69,7 +69,7 @@ bool lv_test_assert_image_eq(const char * fn_ref) sprintf(fn_ref_full, "%s%s", REF_IMGS_PATH, fn_ref); - //lv_obj_invalidate(lv_scr_act()); + //lv_obj_invalidate(lv_screen_active()); lv_refr_now(NULL); extern uint8_t * last_flushed_buf; |