static void win_back_key_cb(void *data, Evas_Object *obj, void *event_info) { interface *intf = data; /* Hide the sidebar first */ Evas_Object *sidebar = sidebar_get_widget(intf->sidebar); if (!elm_object_disabled_get(sidebar) && !elm_panel_hidden_get(sidebar)) { elm_panel_hidden_set(sidebar, EINA_TRUE); } /* Hide the audio_player then */ else if (audio_player_handle_back_key(intf->p_mini_player) == true) { //FIXME return; } /* Finally pop out the stack */ else { /* Get the top of the NaviFrame Stack */ Elm_Object_Item *it = elm_naviframe_top_item_get(intf->nf_content); interface_view *view = (interface_view *)elm_object_item_data_get(it); if (view) { if (view->pf_event != NULL && view->pf_event(view->p_view_sys, INTERFACE_VIEW_EVENT_BACK) == true) { /* View has accepted the event */ return; } } intf_pop_view(intf); } }
void edi_mainview_item_prev() { Eina_List *item; Elm_Object_Item *current; Edi_Mainview_Item *it, *first, *prev = NULL; current = elm_naviframe_top_item_get(nf); first = (Edi_Mainview_Item *)eina_list_nth(_edi_mainview_items, 0); EINA_LIST_FOREACH(_edi_mainview_items, item, it) { if (first->view == current) { prev = eina_list_nth(_edi_mainview_items, eina_list_count(_edi_mainview_items)-1); edi_mainview_item_select(prev); } if (it && it->view == current) { if (prev) edi_mainview_item_select(prev); return; } prev = it; } }
static void _hide_finished_cb(void *data, Evas_Object *obj, void *event_info) { view_manager_view_type_t top_view_id = (view_manager_view_type_t)evas_object_data_get(obj, SCREEN_TYPE_ID_KEY); if (data == elm_naviframe_top_item_get(obj)) { /* We are now in main view */ evas_object_data_set(obj, SCREEN_TYPE_ID_KEY, (void *)VIEW_MANAGER_VIEW_TYPE_MAIN); top_view_id = VIEW_MANAGER_VIEW_TYPE_MAIN; } INFO_LOG(UG_NAME_NORMAL, "top view id = %d", top_view_id); switch(top_view_id) { case VIEW_MANAGER_VIEW_TYPE_MAIN: /* Lets enable the scan updates */ wlan_manager_enable_scan_result_update(); break; case VIEW_MANAGER_VIEW_TYPE_DETAIL: case VIEW_MANAGER_VIEW_TYPE_EAP: default: /* Lets disable the scan updates so that the UI is not refreshed un-necessarily */ wlan_manager_disable_scan_result_update(); break; } }
void edi_mainview_item_next() { Eina_List *item; Elm_Object_Item *current; Edi_Mainview_Item *it, *last, *next; Eina_Bool open_next = EINA_FALSE; current = elm_naviframe_top_item_get(nf); last = eina_list_nth(_edi_mainview_items, eina_list_count(_edi_mainview_items)-1); EINA_LIST_FOREACH(_edi_mainview_items, item, it) { if (last->view == current) { next = eina_list_nth(_edi_mainview_items, 0); edi_mainview_item_select(next); } if (it && open_next) { edi_mainview_item_select(it); return; } if (it && it->view == current) open_next = EINA_TRUE; } }
/** * @brief Get state set of accessible object * * @param obj object instance * * @returns referred AtkStateSet object */ static AtkStateSet * eail_naviframe_page_ref_state_set(AtkObject *obj) { EailNaviframePage *page; AtkStateSet *state_set; Evas_Object *widget; g_return_val_if_fail(EAIL_IS_NAVIFRAME_PAGE(obj), NULL); page = EAIL_NAVIFRAME_PAGE(obj); if (!page->naviframe) return NULL; widget = elm_object_part_content_get(page->naviframe, "default"); state_set = atk_state_set_new(); /* only item-page on top is visible*/ if (elm_naviframe_top_item_get(page->naviframe) == page->page) { atk_state_set_add_state(state_set, ATK_STATE_SHOWING); atk_state_set_add_state(state_set, ATK_STATE_VISIBLE); } if (!elm_object_disabled_get(widget)) atk_state_set_add_state(state_set, ATK_STATE_ENABLED); return state_set; }
void ActivityAudioListView::browserButtonRoot(void *data, Evas_Object *_edje, std::string emission, std::string source) { if (!player_current) return; EmitSignal("browser,loading,stop", "calaos"); while (elm_naviframe_top_item_get(pager_browser) != it_browser_root) elm_naviframe_item_pop(pager_browser); }
void Browser_Settings_Website_Setting::__back_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) { BROWSER_LOGD("[%s]", __func__); if (elm_naviframe_bottom_item_get(m_navi_bar) != elm_naviframe_top_item_get(m_navi_bar)) elm_naviframe_item_pop(m_navi_bar); }
PREFIX value ml_elm_naviframe_top_item_get(value v_obj) { Elm_Object_Item* it = elm_naviframe_top_item_get((Evas_Object*) v_obj); if(it == NULL) return Val_int(0); value v = caml_alloc(1, 0); Store_field(v, 0, (value) it); return v; }
static void win_back_cb(void *data, Evas_Object *obj, void *event_info) { appdata_s *ad = (appdata_s *)data; dlog_print(DLOG_INFO, LOG_TAG, "Top Item %p - %p\n", ad->nf_it, elm_naviframe_top_item_get(ad->nf)); if(ad->nf_it == elm_naviframe_top_item_get(ad->nf)){ dlog_print(DLOG_INFO, LOG_TAG, "Exiting The App"); ui_app_exit(); } else{ elm_naviframe_item_pop_to(ad->nf_it); evas_object_del(ad->slider); evas_object_del(ad->slider_layout); evas_object_show(ad->rotary_selector); eext_rotary_object_event_activated_set(ad->rotary_selector, EINA_TRUE); } }
static void _delete_confirm_cb(int res, void *data) { struct MessageNewViewData *view = data; if (res == DIALOG_YES) { _deinit_message_new_view(view); } else if (((Evas_Object *)elm_naviframe_top_item_get(view->pager)) == view->layout_content) { elm_object_focus_set(view->content_entry, EINA_TRUE); } }
void intf_propagate_event(interface *intf, interface_view_event event) { Elm_Object_Item *it = elm_naviframe_top_item_get(intf->nf_content); interface_view *view = (interface_view *)elm_object_item_data_get(it); if (view && view->pf_event != NULL) { view->pf_event(view->p_view_sys, event); } }
void sp_view_mgr_set_title_label(Sp_View_Manager *view_mgr, const char *title) { MP_CHECK(view_mgr); Evas_Object *navi = sp_view_mgr_get_naviframe(view_mgr); MP_CHECK(navi); Elm_Object_Item *navi_item = elm_naviframe_top_item_get(navi); if (navi_item) elm_object_item_text_set(navi_item, title); }
void Add_To_Most_Visited_Sites_View::__cancel_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) { BROWSER_LOGD("[%s]", __func__); if (!data) return; Add_To_Most_Visited_Sites_View *add_to_most_visited_sites_view = NULL; add_to_most_visited_sites_view = (Add_To_Most_Visited_Sites_View *)data; if (elm_naviframe_bottom_item_get(m_navi_bar) != elm_naviframe_top_item_get(m_navi_bar)) elm_naviframe_item_pop(m_navi_bar); }
void sp_view_mgr_set_title_visible(Sp_View_Manager *view_mgr, bool flag) { MP_CHECK(view_mgr); Evas_Object *navi = sp_view_mgr_get_naviframe(view_mgr); MP_CHECK(navi); Elm_Object_Item *navi_item = elm_naviframe_top_item_get(navi); if (navi_item) elm_naviframe_item_title_visible_set(navi_item, flag); }
static void scrollable_style_cb(void *data, Evas_Object *obj, void *event_info) { Evas_Object *tabbar; Elm_Object_Item *nf_it; Evas_Object *nf = data; nf_it = elm_naviframe_top_item_get(nf); elm_naviframe_item_style_set(nf_it, "tabbar"); tabbar = create_text_only_scrollable_tabbar(nf); elm_object_item_part_content_set(nf_it, "tabbar", tabbar); elm_object_item_part_text_set(nf_it, NULL, "Multiple Items with Title"); }
static void right_panel_button_clicked_cb(void *data, Evas_Object * obj, void *event_info) { interface *intf = data; /* */ Elm_Object_Item *it = elm_naviframe_top_item_get(intf->nf_content); /* We probably have an interface_view at the top */ //FIXME videoplayer interface_view *view = (interface_view *)elm_object_item_data_get(it); if(view) { if(view->pf_event != NULL && view->pf_event(view->p_view_sys, INTERFACE_VIEW_EVENT_MENU) == true ) { /* View has accepted the event */ return; } } }
Edi_Mainview_Item * edi_mainview_item_current_get() { Eina_List *item; Elm_Object_Item *current; Edi_Mainview_Item *it; current = elm_naviframe_top_item_get(nf); EINA_LIST_FOREACH(_edi_mainview_items, item, it) { if (it && it->view == current) { return it; } } return NULL; }
void sp_view_mgr_set_back_button(Sp_View_Manager *view_mgr, Evas_Smart_Cb cb, void *data) { MP_CHECK(view_mgr); Evas_Object *navi = view_mgr->navi; MP_CHECK(navi); Elm_Object_Item *navi_item = elm_naviframe_top_item_get(navi); MP_CHECK(navi_item); Evas_Object *button = NULL; if(cb) { button = mp_widget_create_button(navi, "naviframe/back_btn/default", NULL, NULL, cb, data); elm_object_item_part_content_set(navi_item, ELM_NAVIFRAME_ITEM_PREV_BTN, button); } else { elm_object_item_part_content_set(navi_item, ELM_NAVIFRAME_ITEM_PREV_BTN, NULL); } }
/** * @brief click action callback * * @param action an AtkAction * @param data user data * @return TRUE on success, FALSE otherwise */ static gboolean eail_naviframe_action_click(AtkAction *action, void *data) { EailNaviframe *naviframe; Evas_Object *widget, *target; Elm_Object_Item *it; g_return_val_if_fail(EAIL_IS_NAVIFRAME(action), FALSE); naviframe = EAIL_NAVIFRAME(action); widget = eail_widget_get_widget(EAIL_WIDGET(naviframe)); it = elm_naviframe_top_item_get(widget); if (!elm_naviframe_item_title_visible_get(it)) return FALSE; target = elm_object_item_widget_get(it); if (!target) return FALSE; evas_object_smart_callback_call(target, "title,clicked", it); return TRUE; }
Eina_Bool Add_To_Most_Visited_Sites_View::_save_button_clicked(void) { BROWSER_LOGD("[%s]", __func__); Evas_Object *entry = br_elm_editfield_entry_get(m_url_edit_field); char* url = _trim(elm_entry_markup_to_utf8(elm_entry_entry_get(entry))); if (!url || !strlen(url)) { show_msg_popup(BR_STRING_EMPTY); return EINA_FALSE; } std::string full_url = std::string(url); if (_has_url_sheme(url)) { char *token = strstr(url, BROWSER_URL_SCHEME_CHECK); if (token && strlen(token) == 3) { /* If input url has only sheme such as 'http://', 'https://' */ show_msg_popup(BR_STRING_EMPTY); return EINA_FALSE; } } else full_url = std::string(BROWSER_HTTP_SCHEME) + std::string(url); if (m_most_visited_sites->m_selected_item->url && strlen(m_most_visited_sites->m_selected_item->url)) { if (!strcmp(full_url.c_str(), m_most_visited_sites->m_selected_item->url)) { /* If the url is not changed in case of modify speed dial item. */ if (elm_naviframe_bottom_item_get(m_navi_bar) != elm_naviframe_top_item_get(m_navi_bar)) elm_naviframe_item_pop(m_navi_bar); return EINA_FALSE; } } std::string history_id; history_id = m_most_visited_sites->m_most_visited_sites_db->get_history_id_by_url(full_url.c_str()); char *screen_shot_path = NULL; if (history_id.empty()) screen_shot_path = strdup("default_noscreenshot"); else screen_shot_path = strdup(history_id.c_str()); if (!screen_shot_path) { BROWSER_LOGE("strdup failed"); return EINA_FALSE; } int index = 0; Elm_Object_Item *it = elm_gengrid_first_item_get(m_most_visited_sites->m_gengrid); do { if (it == m_most_visited_sites->m_selected_item->item) break; index++; } while (it = elm_gengrid_item_next_get(it)); if (!m_most_visited_sites->m_most_visited_sites_db->save_most_visited_sites_item(index, full_url.c_str(), full_url.c_str(), screen_shot_path)) { BROWSER_LOGE("save_most_visited_sites_item failed"); return EINA_FALSE; } free(screen_shot_path); if (!m_most_visited_sites->_reload_items()) { BROWSER_LOGE("m_most_visited_sites->_reload_items failed"); return EINA_FALSE; } return EINA_TRUE; }
static void intf_pop_view(interface *intf) { if (naviframe_count(intf->nf_content) == 1) { playback_service *p_ps = application_get_playback_service(intf->p_app); if (playback_service_is_playing(p_ps)) { /* Lower the window (but keep the mainloop running) */ elm_win_lower(intf->win); playback_service_set_auto_exit(p_ps, true); } else { ui_app_exit(); } return; } /* Get the top of the NaviFrame Stack */ Elm_Object_Item *it = elm_naviframe_top_item_get(intf->nf_content); interface_view *view = (interface_view *)elm_object_item_data_get(it); if (view) { if(view->pf_stop != NULL) { view->pf_stop(view->p_view_sys); } } // NOTE: When pop() is called a naviframe will free the content of the item // unless elm_naviframe_content_preserve_on_pop_set is set but this // function seems broken or underspecified (at least in Tizen 2.3 SDK). // To workaround this issue there's two options: // // * Don't recycle view and instantiate a new one instead // * Remove the view from the item before calling pop() // // The second option has one drawback though, once unset the part // will be flying and needs to be hidden until it's reattached. evas_object_hide(elm_object_part_content_unset(intf->nf_content, "elm.swallow.content")); /* Pop the top view */ elm_naviframe_item_pop(intf->nf_content); elm_win_indicator_opacity_set(intf->win, ELM_WIN_INDICATOR_OPAQUE); Evas_Object *sidebar_toggle_btn = create_button(intf->nf_content, "naviframe/drawers"); evas_object_smart_callback_add(sidebar_toggle_btn, "clicked", left_panel_button_clicked_cb, intf); elm_object_part_content_set(intf->nf_content, "title_left_btn", sidebar_toggle_btn); view = (interface_view *)elm_object_item_data_get(elm_naviframe_top_item_get(intf->nf_content)); if (view) { intf->current_view = view->i_type; sidebar_set_selected_view(intf->sidebar, intf->current_view); if (view->pf_has_menu && view->pf_has_menu(view->p_view_sys) == true) { Evas_Object *popup_toggle_btn = create_button(intf->nf_content, "naviframe/custom_more"); evas_object_smart_callback_add(popup_toggle_btn, "clicked", right_panel_button_clicked_cb, intf); elm_object_part_content_set(intf->nf_content, "title_right_btn", popup_toggle_btn); evas_object_show(popup_toggle_btn); } evas_object_show(view->view); } else { LOGE("Cannot get view metadata"); } }