Lines Matching refs:obj

31 static void lv_menu_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj);
32 static void lv_menu_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj);
33 static void lv_menu_page_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj);
34 static void lv_menu_page_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj);
35 static void lv_menu_cont_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj);
36 static void lv_menu_section_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj);
91 static void lv_menu_refr(lv_obj_t * obj);
92 static void lv_menu_refr_sidebar_header_mode(lv_obj_t * obj);
93 static void lv_menu_refr_main_header_mode(lv_obj_t * obj);
109 bool lv_menu_item_back_btn_is_root(lv_obj_t * menu, lv_obj_t * obj);
110 void lv_menu_clear_history(lv_obj_t * obj);
115 lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); in lv_menu_create() local
116 lv_obj_class_init_obj(obj); in lv_menu_create()
117 return obj; in lv_menu_create()
123 lv_obj_t * obj = lv_obj_class_create_obj(&lv_menu_page_class, parent); in lv_menu_page_create() local
124 lv_obj_class_init_obj(obj); in lv_menu_page_create()
126 lv_menu_page_t * page = (lv_menu_page_t *)obj; in lv_menu_page_create()
137 return obj; in lv_menu_page_create()
143 lv_obj_t * obj = lv_obj_class_create_obj(&lv_menu_cont_class, parent); in lv_menu_cont_create() local
144 lv_obj_class_init_obj(obj); in lv_menu_cont_create()
145 return obj; in lv_menu_cont_create()
151 lv_obj_t * obj = lv_obj_class_create_obj(&lv_menu_section_class, parent); in lv_menu_section_create() local
152 lv_obj_class_init_obj(obj); in lv_menu_section_create()
153 return obj; in lv_menu_section_create()
159 lv_obj_t * obj = lv_obj_class_create_obj(&lv_menu_separator_class, parent); in lv_menu_separator_create() local
160 lv_obj_class_init_obj(obj); in lv_menu_separator_create()
161 return obj; in lv_menu_separator_create()
164 void lv_menu_refr(lv_obj_t * obj) in lv_menu_refr() argument
166 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_menu_refr()
168 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_refr()
185 lv_menu_set_page(obj, page); in lv_menu_refr()
192 void lv_menu_set_page(lv_obj_t * obj, lv_obj_t * page) in lv_menu_set_page() argument
194 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_menu_set_page()
196 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_set_page()
221 lv_menu_clear_history(obj); in lv_menu_set_page()
274 lv_menu_refr_main_header_mode(obj); in lv_menu_set_page()
277 void lv_menu_set_sidebar_page(lv_obj_t * obj, lv_obj_t * page) in lv_menu_set_sidebar_page() argument
279 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_menu_set_sidebar_page()
281 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_set_sidebar_page()
288 lv_obj_t * sidebar_cont = lv_obj_class_create_obj(&lv_menu_sidebar_cont_class, obj); in lv_menu_set_sidebar_page()
324 lv_menu_refr_sidebar_header_mode(obj); in lv_menu_set_sidebar_page()
337 lv_menu_refr(obj); in lv_menu_set_sidebar_page()
340 void lv_menu_set_mode_header(lv_obj_t * obj, lv_menu_mode_header_t mode_header) in lv_menu_set_mode_header() argument
342 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_menu_set_mode_header()
344 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_set_mode_header()
348 lv_menu_refr_main_header_mode(obj); in lv_menu_set_mode_header()
349 if(menu->sidebar_generated) lv_menu_refr_sidebar_header_mode(obj); in lv_menu_set_mode_header()
353 void lv_menu_set_mode_root_back_btn(lv_obj_t * obj, lv_menu_mode_root_back_btn_t mode_root_back_btn) in lv_menu_set_mode_root_back_btn() argument
355 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_menu_set_mode_root_back_btn()
357 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_set_mode_root_back_btn()
361 lv_menu_refr(obj); in lv_menu_set_mode_root_back_btn()
365 void lv_menu_set_load_page_event(lv_obj_t * menu, lv_obj_t * obj, lv_obj_t * page) in lv_menu_set_load_page_event() argument
369 lv_obj_add_flag(obj, LV_OBJ_FLAG_CLICKABLE); in lv_menu_set_load_page_event()
370 lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE); in lv_menu_set_load_page_event()
371 lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); in lv_menu_set_load_page_event()
374 if(lv_obj_remove_event_cb(obj, lv_menu_load_page_event_cb)) { in lv_menu_set_load_page_event()
375 lv_event_send(obj, LV_EVENT_DELETE, NULL); in lv_menu_set_load_page_event()
376 lv_obj_remove_event_cb(obj, lv_menu_obj_del_event_cb); in lv_menu_set_load_page_event()
383 lv_obj_add_event_cb(obj, lv_menu_load_page_event_cb, LV_EVENT_CLICKED, event_data); in lv_menu_set_load_page_event()
384 lv_obj_add_event_cb(obj, lv_menu_obj_del_event_cb, LV_EVENT_DELETE, event_data); in lv_menu_set_load_page_event()
390 lv_obj_t * lv_menu_get_cur_main_page(lv_obj_t * obj) in lv_menu_get_cur_main_page() argument
392 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_menu_get_cur_main_page()
394 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_get_cur_main_page()
398 lv_obj_t * lv_menu_get_cur_sidebar_page(lv_obj_t * obj) in lv_menu_get_cur_sidebar_page() argument
400 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_menu_get_cur_sidebar_page()
402 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_get_cur_sidebar_page()
406 lv_obj_t * lv_menu_get_main_header(lv_obj_t * obj) in lv_menu_get_main_header() argument
408 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_menu_get_main_header()
410 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_get_main_header()
414 lv_obj_t * lv_menu_get_main_header_back_btn(lv_obj_t * obj) in lv_menu_get_main_header_back_btn() argument
416 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_menu_get_main_header_back_btn()
418 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_get_main_header_back_btn()
422 lv_obj_t * lv_menu_get_sidebar_header(lv_obj_t * obj) in lv_menu_get_sidebar_header() argument
424 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_menu_get_sidebar_header()
426 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_get_sidebar_header()
430 lv_obj_t * lv_menu_get_sidebar_header_back_btn(lv_obj_t * obj) in lv_menu_get_sidebar_header_back_btn() argument
432 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_menu_get_sidebar_header_back_btn()
434 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_get_sidebar_header_back_btn()
438 bool lv_menu_back_btn_is_root(lv_obj_t * menu, lv_obj_t * obj) in lv_menu_back_btn_is_root() argument
442 if(obj == ((lv_menu_t *)menu)->sidebar_header_back_btn) { in lv_menu_back_btn_is_root()
446 if(obj == ((lv_menu_t *)menu)->main_header_back_btn && ((lv_menu_t *)menu)->prev_depth <= 1) { in lv_menu_back_btn_is_root()
453 void lv_menu_clear_history(lv_obj_t * obj) in lv_menu_clear_history() argument
455 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_menu_clear_history()
457 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_clear_history()
469 static void lv_menu_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) in lv_menu_constructor() argument
474 lv_obj_set_layout(obj, LV_LAYOUT_FLEX); in lv_menu_constructor()
475 lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW); in lv_menu_constructor()
477 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_constructor()
487 menu->storage = lv_obj_create(obj); in lv_menu_constructor()
496 lv_obj_t * main_cont = lv_obj_class_create_obj(&lv_menu_main_cont_class, obj); in lv_menu_constructor()
531 lv_obj_add_event_cb(obj, lv_menu_value_changed_event_cb, LV_EVENT_VALUE_CHANGED, menu); in lv_menu_constructor()
536 static void lv_menu_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) in lv_menu_destructor() argument
541 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_destructor()
549 static void lv_menu_page_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) in lv_menu_page_constructor() argument
553 lv_menu_t * menu = (lv_menu_t *)lv_obj_get_parent(obj); in lv_menu_page_constructor()
555 lv_obj_set_parent(obj, ((lv_menu_t *)menu)->storage); in lv_menu_page_constructor()
556 lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN); in lv_menu_page_constructor()
557 lv_obj_set_flex_align(obj, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); in lv_menu_page_constructor()
558 lv_obj_add_flag(obj, LV_OBJ_FLAG_EVENT_BUBBLE); in lv_menu_page_constructor()
561 static void lv_menu_page_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) in lv_menu_page_destructor() argument
565 lv_menu_page_t * page = (lv_menu_page_t *)obj; in lv_menu_page_destructor()
573 static void lv_menu_cont_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) in lv_menu_cont_constructor() argument
576 lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW); in lv_menu_cont_constructor()
577 lv_obj_set_flex_align(obj, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); in lv_menu_cont_constructor()
578 lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); in lv_menu_cont_constructor()
581 static void lv_menu_section_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) in lv_menu_section_constructor() argument
584 lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN); in lv_menu_section_constructor()
585 lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); in lv_menu_section_constructor()
588 static void lv_menu_refr_sidebar_header_mode(lv_obj_t * obj) in lv_menu_refr_sidebar_header_mode() argument
590 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_menu_refr_sidebar_header_mode()
592 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_refr_sidebar_header_mode()
623 static void lv_menu_refr_main_header_mode(lv_obj_t * obj) in lv_menu_refr_main_header_mode() argument
625 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_menu_refr_main_header_mode()
627 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_refr_main_header_mode()
661 lv_obj_t * obj = lv_event_get_target(e); in lv_menu_load_page_event_cb() local
669 lv_obj_t * parent = obj; in lv_menu_load_page_event_cb()
682 if(menu->selected_tab != obj && menu->selected_tab != NULL) { in lv_menu_load_page_event_cb()
688 menu->selected_tab = obj; in lv_menu_load_page_event_cb()
711 lv_obj_t * obj = lv_event_get_target(e); in lv_menu_back_event_cb() local
714 if(!(obj == menu->main_header_back_btn || obj == menu->sidebar_header_back_btn)) return; in lv_menu_back_event_cb()
718 if(lv_menu_back_btn_is_root((lv_obj_t *)menu, obj)) return; in lv_menu_back_event_cb()
738 lv_menu_set_page(&(menu->obj), prev_hist->page); in lv_menu_back_event_cb()
747 lv_obj_t * obj = lv_event_get_user_data(e); in lv_menu_value_changed_event_cb() local
748 lv_menu_t * menu = (lv_menu_t *)obj; in lv_menu_value_changed_event_cb()
750 lv_menu_page_t * main_page = (lv_menu_page_t *)lv_menu_get_cur_main_page(obj); in lv_menu_value_changed_event_cb()
761 lv_menu_page_t * sidebar_page = (lv_menu_page_t *)lv_menu_get_cur_sidebar_page(obj); in lv_menu_value_changed_event_cb()