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 `__ - fix(indev): do not send keys to objects in disabled state `b0a46c4 `__ -- 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 `__ - fix(draw): create intermediate layer for blend modes too @@ -1084,7 +1084,7 @@ Fixes `2944 `__ - fix(rlottie): fix variable name `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 `__ - fix(obj): old parent's scroll is not updated in lv_obj_set_parent() `2965 `__ @@ -1623,7 +1623,7 @@ New Features - feat(event) add LV_SCREEN\_(UN)LOAD_START `7bae9e3 `__ -- feat(obj) add lv_obj_del_delayed() +- feat(obj) add lv_obj_delete_delayed() `c6a2e15 `__ - feat(docs) add view on GitHub link @@ -1811,7 +1811,7 @@ Fixes and lv_tick_inc() `2675 `__ -- fix(anim_timeline) avoid calling lv_anim_del(NULL, NULL) +- fix(anim_timeline) avoid calling lv_anim_delete(NULL, NULL) `2628 `__ - fix(kconfig) sync Kconfig with the latest lv_conf_template.h @@ -2245,7 +2245,7 @@ Fixes `e41c507 `__ - fix(disp) be sure the pending scr load animation is finished in - lv_scr_load_anim + lv_screen_load_anim `eb6ae52 `__ - fix(color) fox color premult precision with 16-bit color depth @@ -2999,7 +2999,7 @@ Others - Fix typo in commands to build rlottie `2723 `__ -- del(.gitmodules): delete .gitmodules +- delete(.gitmodules): delete .gitmodules `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__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_(obj, )`` 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