EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *bx, *tb, *bt, *menu; Elm_Object_Item *tb_it; win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC); elm_win_title_set(win, "Toolbar Example"); evas_object_smart_callback_add(win, "delete,request", _on_done, NULL); bg = elm_bg_add(win); elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(bg); bx = elm_box_add(win); elm_win_resize_object_add(win, bx); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(bx); bt = elm_button_add(win); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_object_text_set(bt, "Button"); evas_object_show(bt); tb = elm_toolbar_add(win); evas_object_size_hint_weight_set(tb, 0.0, 0.0); evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0); evas_object_show(tb); elm_toolbar_item_append(tb, "document-print", "Print", NULL, NULL); elm_toolbar_item_append(tb, "folder-new", "Folder", NULL, NULL); elm_toolbar_item_append(tb, "clock", "Clock", NULL, NULL); elm_toolbar_item_append(tb, "refresh", "Update", NULL, NULL); elm_toolbar_menu_parent_set(tb, win); tb_it = elm_toolbar_item_append(tb, "mail-send", "Send Mail", NULL, NULL); elm_toolbar_item_menu_set(tb_it, EINA_TRUE); menu = elm_toolbar_item_menu_get(tb_it); elm_menu_item_add(menu, NULL, "emptytrash", "Empty Trash", NULL, NULL); elm_menu_item_add(menu, NULL, "trashcan_full", "Full Trash", NULL, NULL); elm_toolbar_item_priority_set(tb_it, 10); elm_box_pack_end(bx, tb); elm_box_pack_end(bx, bt); evas_object_resize(win, 230, 200); evas_object_show(win); elm_run(); elm_shutdown(); return 0; }
void create_main_win(void) { Evas_Object *win, *bg, *bx, *sc, *tb, *ic; Elm_Object_Item *tbi; win = elm_win_add(NULL, "main", ELM_WIN_BASIC); elm_win_title_set(win, "Messages"); evas_object_smart_callback_add(win, "delete,request", on_win_del_req, NULL); window = win; bg = elm_bg_add(win); evas_object_size_hint_weight_set(bg, 1.0, 1.0); elm_win_resize_object_add(win, bg); evas_object_show(bg); bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); evas_object_size_hint_align_set(bx, -1.0, -1.0); elm_win_resize_object_add(win, bx); box = bx; tb = elm_toolbar_add(win); evas_object_size_hint_weight_set(tb, 1.0, 0.0); evas_object_size_hint_align_set(tb, -1.0, -1.0); ic = elm_icon_add(win); elm_icon_standard_set(ic, "edit"); elm_toolbar_item_append(tb, ic, "Write", on_write, NULL); evas_object_show(ic); ic = elm_icon_add(win); elm_icon_standard_set(ic, "clock"); tbi = elm_toolbar_item_append(tb, ic, "Recent", on_recent, NULL); evas_object_show(ic); ic = elm_icon_add(win); elm_icon_standard_set(ic, "chat"); elm_toolbar_item_append(tb, ic, "Chats", on_chats, NULL); evas_object_show(ic); ic = elm_icon_add(win); elm_icon_standard_set(ic, "delete"); elm_toolbar_item_append(tb, ic, "Trash", on_trash, NULL); evas_object_show(ic); elm_box_pack_end(bx, tb); evas_object_show(tb); elm_toolbar_item_selected_set(tbi, EINA_TRUE); evas_object_show(bx); evas_object_resize(win, 240, 280); evas_object_show(win); }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win = NULL; Evas_Object *toolbar = NULL; Evas_Object *box = NULL; Evas_Object *bg = NULL; win = elm_win_add(NULL, "Main Window", ELM_WIN_BASIC); elm_win_title_set(win, "Sample toolbar item application!"); elm_win_autodel_set(win, EINA_TRUE); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); bg = elm_bg_add(win); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bg); evas_object_show(bg); box = elm_box_add(win); evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, box); evas_object_show(box); toolbar = elm_toolbar_add(win); elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_SCROLL); evas_object_size_hint_weight_set(toolbar, 0.0, 0.0); evas_object_size_hint_align_set(toolbar, EVAS_HINT_FILL, 0.0); evas_object_show(toolbar); elm_toolbar_item_append(toolbar, NULL, "Item 1", NULL, NULL); elm_toolbar_item_append(toolbar, NULL, "Item 2", NULL, NULL); evas_object_smart_callback_add(win, "focus,in", _register_cb, toolbar); register_request_listener(EVENT_SET_FOCUS, set_focus, toolbar); register_request_listener(EVENT_UNSET_FOCUS, unset_focus, toolbar); register_request_listener(EVENT_SET_FOCUSABLE, set_focusable, toolbar); register_request_listener(EVENT_UNSET_FOCUSABLE, unset_focusable, toolbar); register_request_listener(EVENT_ADD_CHILDREN, add_children, toolbar); register_request_listener(EVENT_RM_CHILDREN, rm_children, toolbar); register_request_listener(EVENT_HIDE, hide, toolbar); register_request_listener(EVENT_SHOW, show, toolbar); register_request_listener(ACTION_CLICK, register_action_click, toolbar); evas_object_resize(win, 240, 60); evas_object_show(box); elm_box_pack_end(box, toolbar); evas_object_show(win); evas_object_show(toolbar); elm_run(); request_shutdown(); elm_shutdown(); return 0; }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bx, *tb, *bt, *menu; Elm_Object_Item *tb_it; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); win = elm_win_util_standard_add("toolbar", "Toolbar Example"); elm_win_autodel_set(win, EINA_TRUE); bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bx); evas_object_show(bx); bt = elm_button_add(win); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_object_text_set(bt, "Button"); evas_object_show(bt); tb = elm_toolbar_add(win); evas_object_size_hint_weight_set(tb, 0.0, 0.0); evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0); evas_object_show(tb); elm_toolbar_item_append(tb, "document-print", "Print", NULL, NULL); elm_toolbar_item_append(tb, "folder-new", "Folder", NULL, NULL); elm_toolbar_item_append(tb, "clock", "Clock", NULL, NULL); elm_toolbar_item_append(tb, "refresh", "Update", NULL, NULL); elm_toolbar_menu_parent_set(tb, win); tb_it = elm_toolbar_item_append(tb, "mail-send", "Send Mail", NULL, NULL); elm_toolbar_item_menu_set(tb_it, EINA_TRUE); menu = elm_toolbar_item_menu_get(tb_it); elm_menu_item_add(menu, NULL, "emptytrash", "Empty Trash", NULL, NULL); elm_menu_item_add(menu, NULL, "trashcan_full", "Full Trash", NULL, NULL); elm_toolbar_item_priority_set(tb_it, 10); elm_box_pack_end(bx, tb); elm_box_pack_end(bx, bt); evas_object_resize(win, 230, 200); evas_object_show(win); elm_run(); return 0; }
static Evas_Object* create_text_only_scrollable_tabbar(Evas_Object *parent) { Evas_Object *obj; Elm_Object_Item *item[8]; /* create toolbar */ obj = elm_toolbar_add(parent); elm_object_style_set(obj, "navigationbar"); elm_toolbar_shrink_mode_set(obj, ELM_TOOLBAR_SHRINK_SCROLL); elm_toolbar_transverse_expanded_set(obj, EINA_TRUE); elm_toolbar_align_set(obj, 0.0); elm_toolbar_homogeneous_set(obj, EINA_FALSE); item[0] = elm_toolbar_item_append(obj, NULL, "Main", toolbar_it_cb, parent); item[1] = elm_toolbar_item_append(obj, NULL, "Playlist", toolbar_it_cb, parent); item[2] = elm_toolbar_item_append(obj, NULL, "Artists list", toolbar_it_cb, parent); elm_object_item_disabled_set(item[2], EINA_TRUE); item[3] = elm_toolbar_item_append(obj, NULL, "Songs", toolbar_it_cb, parent); item[4] = elm_toolbar_item_append(obj, NULL, "Dialer for call", toolbar_it_cb, parent); item[5] = elm_toolbar_item_append(obj, NULL, "Playlist", toolbar_it_cb, parent); item[6] = elm_toolbar_item_append(obj, NULL, "Songs", toolbar_it_cb, parent); item[7] = elm_toolbar_item_append(obj, NULL, "Dialer for call", toolbar_it_cb, parent); return obj; }
Tabpanel_Item * tabpanel_item_add(Tabpanel *tab, const char *label, Evas_Object *content, TabLanelSelectCB select_cb, void *data) { Tabpanel_Item *item = calloc(1, sizeof(Tabpanel_Item)); tab->items = eina_list_append(tab->items, item); item->tab = tab; item->item_tb = elm_toolbar_item_append(tab->tabs, NULL, label, _tb_select_cb, item); item->content = content; item->del = EINA_FALSE; if (content) elm_pager_content_push(tab->panels, content); item->data = data; item->select_cb = select_cb; elm_toolbar_item_selected_set(item->item_tb, EINA_TRUE); if (tab->from_edje && eina_list_count(tab->items) > 1) edje_object_signal_emit( tab->parent, "toolbar,show", ""); return item; }
Tab_Data * tab_add(App_Data *ad) { Tab_Data *td; td = calloc(1, sizeof(Tab_Data)); if (!td) return NULL; td->web = elm_web_add(ad->win); elm_web_window_create_hook_set(td->web, _web_create_window_cb, ad); elm_web_inwin_mode_set(td->web, EINA_TRUE); evas_object_size_hint_weight_set(td->web, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(td->web, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_naviframe_item_simple_push(ad->naviframe, td->web); td->app = ad; td->tab = elm_toolbar_item_append(td->app->tabs, NULL, "New tab", _tab_clicked_cb, td); elm_object_item_del_cb_set(td->tab, _tb_item_del_cb); evas_object_data_set(td->web, "tab_data", td); evas_object_smart_callback_add(td->web, "title,changed", _title_changed_cb, td); evas_object_smart_callback_add(td->web, "uri,changed", _uri_changed_cb, td); evas_object_event_callback_add(td->web, EVAS_CALLBACK_FREE, _web_free_cb, td); elm_toolbar_item_selected_set(td->tab, EINA_TRUE); return td; }
static void _tab_view_fill(tab_view_data *data) { Elm_Object_Item *notification_item = NULL; RETM_IF(!data, "data is NULL"); notification_item = elm_toolbar_item_append(data->tab, NULL, "INTERFACE", _tab_view_select_INTERFACE_cb, data); elm_toolbar_item_append(data->tab, NULL, "DEVICE", _tab_view_select_DEVICE_cb, data); elm_toolbar_item_append(data->tab, NULL, "COMMUNICATION", _tab_view_select_COMMUNICATION_cb, data); elm_toolbar_select_mode_set(data->tab, ELM_OBJECT_SELECT_MODE_ALWAYS); elm_toolbar_item_selected_set(notification_item, EINA_TRUE); }
static Evas_Object* create_text_only_2_items_tabbar(Evas_Object *parent) { Evas_Object *toolbar; /* create toolbar */ toolbar = elm_toolbar_add(parent); elm_object_style_set(toolbar, "navigationbar"); elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_SCROLL); elm_toolbar_transverse_expanded_set(toolbar, EINA_TRUE); elm_toolbar_align_set(toolbar, 0.0); elm_toolbar_homogeneous_set(toolbar, EINA_FALSE); elm_toolbar_item_append(toolbar, NULL, "Main", toolbar_it_cb, parent); elm_toolbar_item_append(toolbar, NULL, "Playlist", toolbar_it_cb, parent); return toolbar; }
int quick_settings_view_init() { g_debug("Initializing the quick-settings screen"); Evas_Object *win; int ret; ret = ui_utils_view_init(VIEW_PTR(view), ELM_WIN_BASIC, D_("Quick-settings"), NULL, NULL, NULL); if (ret) { g_critical("Failed to init quick-settings view"); return ret; } win = ui_utils_view_window_get(VIEW_PTR(view)); ui_utils_view_delete_callback_set(VIEW_PTR(view), _delete_cb); ui_utils_view_layout_set(VIEW_PTR(view), phoneui_theme, "phoneui/settings/quick-settings"); view.pager = elm_naviframe_add(win); ui_utils_view_swallow(VIEW_PTR(view), "pager", view.pager); _init_network_page(); _init_profiles_power_page(); evas_object_show(view.pager); view.toolbar = elm_toolbar_add(win); ui_utils_view_swallow(VIEW_PTR(view), "toolbar", view.toolbar); elm_toolbar_homogeneous_set(view.toolbar, EINA_TRUE); elm_toolbar_shrink_mode_set(view.toolbar, ELM_TOOLBAR_SHRINK_NONE); elm_toolbar_align_set(view.toolbar, 0.0); elm_toolbar_icon_size_set(view.toolbar, 16); evas_object_size_hint_weight_set(view.toolbar, 0.0, 0.0); evas_object_size_hint_align_set(view.toolbar, EVAS_HINT_FILL, 0.0); Elm_Object_Item *tbitem = elm_toolbar_item_append(view.toolbar, "icon/profile", D_("Profile/Power"), _toolbar_clicked, view.layout1); elm_toolbar_item_append(view.toolbar, "icon/network", D_("Network"), _toolbar_clicked, view.layout2); evas_object_show(view.toolbar); elm_toolbar_item_selected_set(tbitem, EINA_TRUE); return 0; }
static Evas_Object* create_toolbar(view_sys *p_sys) { /* Create and set the toolbar */ Evas_Object *tabbar = elm_toolbar_add(p_sys->nf_toolbar); /* Set the toolbar options */ elm_toolbar_shrink_mode_set(tabbar, ELM_TOOLBAR_SHRINK_EXPAND); elm_toolbar_homogeneous_set(tabbar, EINA_FALSE); elm_toolbar_transverse_expanded_set(tabbar, EINA_FALSE); elm_toolbar_select_mode_set(tabbar, ELM_OBJECT_SELECT_MODE_DEFAULT); evas_object_size_hint_weight_set(tabbar, EVAS_HINT_FILL, 0.0); evas_object_size_hint_align_set(tabbar, EVAS_HINT_FILL, EVAS_HINT_FILL); /* Append new entry in the toolbar with the Icon & Label wanted */ elm_toolbar_item_append(tabbar, NULL, "About", tabbar_item_cb, p_sys); elm_toolbar_item_append(tabbar, NULL, "License", tabbar_item_cb, p_sys); return tabbar; }
//--// public routines Evas_Object * snippets_add(Evas_Object *win) { Evas_Object *tb; // add toolbar to main win tb = elm_toolbar_add(win); elm_toolbar_menu_parent_set(tb, win); // FIXME: fill the toolbar elm_toolbar_item_append(tb, "default", "To Fill", NULL, NULL); return tb; }
Evas_Object *tabpanel_create() { Evas_Object *vbox,*tb; vbox = elm_box_add(win); evas_object_size_hint_weight_set(vbox, 1.0, 1.0); evas_object_size_hint_align_set(vbox, -1.0, -1.0); evas_object_show(vbox); // tb = elm_toolbar_add(win); evas_object_size_hint_weight_set(tb, 0.0, 0.0); evas_object_size_hint_align_set(tb, -1.0, 0.0); evas_object_show(tb); elm_box_pack_end(vbox, tb); // // _pager = elm_pager_add(win); evas_object_size_hint_weight_set(_pager, 1.0, 1.0); evas_object_size_hint_align_set(_pager, -1.0, -1.0); elm_box_pack_end(vbox, _pager); evas_object_show(_pager); Evas_Object *presentation = presentation_create(); Evas_Object *slides_grid = slides_grid_create(); elm_pager_content_push(_pager, presentation); elm_pager_content_push(_pager, slides_grid); // Elm_Object_Item *item = elm_toolbar_item_append(tb, NULL, D_("Presentation"), _tb_presentation, presentation); elm_toolbar_item_append(tb, NULL, D_("Slides list"), _tb_slidelist, slides_grid); elm_toolbar_item_selected_set(item, EINA_TRUE); return vbox; }
/* public functions */ EM_INTERN Eina_Bool em_gui_init(void) { Evas_Object *o, *oo; /* allocate our object */ gui = EM_OBJECT_ALLOC(Em_Gui, EM_GUI_TYPE, _em_gui_cb_free); if (!gui) return EINA_FALSE; /* create window */ gui->w_win = elm_win_add(NULL, "emote", ELM_WIN_BASIC); elm_win_title_set(gui->w_win, "Emote"); elm_win_keyboard_mode_set(gui->w_win, ELM_WIN_KEYBOARD_ALPHA); evas_object_smart_callback_add(gui->w_win, "delete,request", _em_gui_cb_win_del, NULL); /* create background */ o = elm_bg_add(gui->w_win); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(gui->w_win, o); evas_object_show(o); o = elm_box_add(gui->w_win); elm_box_homogeneous_set(o, EINA_FALSE); elm_win_resize_object_add(gui->w_win, o); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_box_align_set(o, 0.5, 0.5); evas_object_show(o); /* create main toolbar */ gui->w_tb = elm_toolbar_add(gui->w_win); elm_toolbar_icon_size_set(gui->w_tb, (8 * elm_config_scale_get())); elm_toolbar_align_set(gui->w_tb, 1.0); elm_toolbar_shrink_mode_set(gui->w_tb, ELM_TOOLBAR_SHRINK_SCROLL); elm_toolbar_item_append(gui->w_tb, "preferences-system", _("Settings"), _em_gui_cb_settings, NULL); elm_toolbar_item_append(gui->w_tb, "application-exit", _("Quit"), _em_gui_cb_quit, NULL); evas_object_size_hint_weight_set(gui->w_tb, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(gui->w_tb, EVAS_HINT_FILL, 0.0); evas_object_show(gui->w_tb); elm_box_pack_start(o, gui->w_tb); /* create packing box */ gui->w_box = elm_panes_add(gui->w_win); elm_panes_fixed_set(gui->w_box, EINA_FALSE); elm_panes_horizontal_set(gui->w_box, EINA_FALSE); elm_panes_content_left_size_set(gui->w_box, 0.20); evas_object_size_hint_weight_set(gui->w_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(gui->w_box, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(o, gui->w_box); evas_object_show(gui->w_box); gui->w_chansel_itc = elm_genlist_item_class_new(); gui->w_chansel_itc->item_style = "default"; gui->w_chansel_itc->func.text_get = _em_gui_chansel_cb_label_get; gui->w_chansel_itc->func.content_get = NULL; gui->w_chansel_itc->func.state_get = NULL; gui->w_chansel_itc->func.del = NULL; /* create channel selector w/ frame */ gui->w_chansel = elm_genlist_add(gui->w_win); elm_genlist_mode_set(gui->w_chansel, ELM_LIST_SCROLL); evas_object_size_hint_min_set(gui->w_chansel, 200, MIN_WIN_HEIGHT); evas_object_size_hint_weight_set(gui->w_chansel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(gui->w_chansel); o = elm_frame_add(gui->w_win); elm_object_part_text_set(o, "default", "Channels"); oo = elm_frame_add(gui->w_win); elm_object_style_set(oo, "pad_small"); elm_object_part_content_set(o, "default", oo); elm_object_part_content_set(oo, "default", gui->w_chansel); elm_object_part_content_set(gui->w_box, "left", o); evas_object_show(oo); evas_object_show(o); /* set min size of window and show it */ evas_object_show(gui->w_win); evas_object_resize(gui->w_win, MIN_WIN_WIDTH, MIN_WIN_HEIGHT); gui->servers = eina_hash_string_small_new(_em_gui_server_del); return EINA_TRUE; }
void add_children(void *data) { Evas_Object* obj = (Evas_Object*) data; elm_toolbar_item_append(obj, NULL, "Item 3", NULL, NULL); }
void Browser_Settings_Website_Setting::_show_details_list(website_setting_item *item_info) { BROWSER_LOGD("[%s]", __func__); if(!item_info) return; m_details_genlist = elm_genlist_add(m_navi_bar); if (!m_details_genlist) { BROWSER_LOGE("elm_genlist_add failed"); return; } evas_object_show(m_details_genlist); m_1_text_1_icon_item_class.item_style = "1text.1icon"; m_1_text_1_icon_item_class.func.text_get = __details_genlist_label_get; m_1_text_1_icon_item_class.func.content_get = __details_genlist_icon_get; m_1_text_1_icon_item_class.func.state_get = NULL; m_1_text_1_icon_item_class.func.del = NULL; if (item_info->geolocation) { m_location_item_callback_data.type = BR_MENU_LOCATION; m_location_item_callback_data.cp = this; m_location_item_callback_data.user_data = item_info; m_location_item_callback_data.it = elm_genlist_item_append(m_details_genlist, &m_1_text_1_icon_item_class, &m_location_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE, __details_item_selected_cb, &m_location_item_callback_data); } if (item_info->storage) { m_web_storage_item_callback_data.type = BR_MENU_WEB_STORAGE; m_web_storage_item_callback_data.cp = this; m_web_storage_item_callback_data.user_data = item_info; m_web_storage_item_callback_data.it = elm_genlist_item_append(m_details_genlist, &m_1_text_1_icon_item_class, &m_web_storage_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE, __details_item_selected_cb, &m_web_storage_item_callback_data); } m_back_button_details = elm_button_add(m_details_genlist); if (!m_back_button_details) { BROWSER_LOGE("elm_button_add failed"); return; } elm_object_style_set(m_back_button_details, "browser/bookmark_controlbar_back"); evas_object_show(m_back_button_details); evas_object_smart_callback_add(m_back_button_details, "clicked", __back_button_clicked_cb, this); Elm_Object_Item *navi_it = elm_naviframe_item_push(m_navi_bar, item_info->url.c_str(), m_back_button_details, NULL, m_details_genlist, "browser_titlebar"); m_details_bottom_control_bar = elm_toolbar_add(m_navi_bar); if (!m_details_bottom_control_bar) { BROWSER_LOGE("elm_toolbar_add failed"); return; } elm_object_style_set(m_details_bottom_control_bar, "browser/default"); elm_toolbar_shrink_mode_set(m_details_bottom_control_bar, ELM_TOOLBAR_SHRINK_EXPAND); m_delete_all_details_conbar_item = elm_toolbar_item_append(m_details_bottom_control_bar, NULL, BR_STRING_DELETE_ALL, __delete_all_details_list_conbar_item_clicked_cb, this); if (elm_genlist_items_count(m_details_genlist) == 0) { elm_object_item_disabled_set(m_delete_all_details_conbar_item, EINA_TRUE); } Elm_Object_Item *empty_item = elm_toolbar_item_append(m_details_bottom_control_bar, NULL, NULL, NULL, NULL); elm_object_item_disabled_set(empty_item, EINA_TRUE); empty_item = elm_toolbar_item_append(m_details_bottom_control_bar, NULL, NULL, NULL, NULL); elm_object_item_disabled_set(empty_item, EINA_TRUE); evas_object_show(m_details_bottom_control_bar); elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_CONTROLBAR, m_details_bottom_control_bar); }
Evas_Object* viewer_manager_create(Evas_Object* _parent) { __COMMON_FUNC_ENTER__; if (manager_object != NULL || _parent == NULL) { __COMMON_FUNC_EXIT__; return NULL; } manager_object = (viewer_manager_object*) g_malloc0(sizeof(viewer_manager_object)); memset(manager_object, 0, sizeof(viewer_manager_object)); manager_object->list = NULL; manager_object->item_hidden_btn = NULL; manager_object->item_sep_above_hidden_button = NULL; manager_object->item_sep_below_hidden_button = NULL; manager_object->item_header = NULL; /* Add Full Layout */ Evas_Object* layout = elm_layout_add(_parent); elm_layout_theme_set(layout, "layout", "application", "default"); evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(_parent, layout); edje_object_signal_emit(elm_layout_edje_get(layout), "elm,state,show,content", "elm"); edje_object_signal_emit(elm_layout_edje_get(layout), "elm,bg,show,group_list", "elm"); edje_object_signal_emit(elm_layout_edje_get(layout), "elm,state,show,indicator", "elm"); /* Add Naviframe */ manager_object->nav = elm_naviframe_add(layout); elm_object_part_content_set(layout, "elm.swallow.content", manager_object->nav); /* Add back button on Navigationbar */ Evas_Object* button_back = elm_button_add(manager_object->nav); /* Add MainView Layout */ Evas_Object* view_content = elm_layout_add(manager_object->nav); elm_layout_theme_set(view_content, "standard", "window", "integration"); edje_object_signal_emit(elm_layout_edje_get(view_content), "elm,state,show,content", "elm"); edje_object_signal_emit(elm_layout_edje_get(view_content), "elm,bg,show,group_list", "elm"); /* Add Conformant */ Evas_Object *conform = elm_conformant_add(manager_object->nav); elm_object_style_set(conform, "internal_layout"); elm_object_part_content_set(view_content, "elm.swallow.content", conform); evas_object_show(conform); /* Add Genlist */ manager_object->list = viewer_list_create(manager_object->nav); assertm_if(NULL == manager_object->list, "manager_object->list is NULL!!"); viewer_manager_header_create(manager_object->list); viewer_manager_bottom_create(manager_object->list); viewer_manager_hidden_button_create(manager_object->list); elm_object_content_set(conform, manager_object->list); if (ug_app_state->ug_type == UG_VIEW_SETUP_WIZARD) { Elm_Object_Item* navi_it = elm_naviframe_item_push(manager_object->nav, sc(PACKAGE, I18N_TYPE_Wi_Fi), NULL, NULL, view_content, NULL); evas_object_data_set(manager_object->nav, SCREEN_TYPE_ID_KEY, (void *)VIEW_MANAGER_VIEW_TYPE_MAIN); evas_object_smart_callback_add(manager_object->nav, "transition,finished", _hide_finished_cb, navi_it); Evas_Object *toolbar = elm_toolbar_add(manager_object->nav); elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND); if(ug_app_state->lbutton_setup_wizard_prev_icon != NULL && ug_app_state->lbutton_setup_wizard != NULL) { manager_object->prev_button = (Evas_Object *)elm_toolbar_item_append(toolbar, ug_app_state->lbutton_setup_wizard_prev_icon, ug_app_state->lbutton_setup_wizard, _lbutton_click_cb, NULL); elm_object_item_disabled_set(elm_toolbar_item_append(toolbar, NULL, "", NULL, NULL), EINA_TRUE); } if(ug_app_state->rbutton_setup_wizard_scan_icon != NULL) { manager_object->scan_button = (Evas_Object *)elm_toolbar_item_append(toolbar, ug_app_state->rbutton_setup_wizard_scan_icon, sc(PACKAGE, I18N_TYPE_Scan), _refresh_sk_cb, NULL); elm_object_item_disabled_set(elm_toolbar_item_append(toolbar, NULL, "", NULL, NULL), EINA_TRUE); } if(ug_app_state->rbutton_setup_wizard_skip_icon != NULL && ug_app_state->rbutton_setup_wizard_skip != NULL) { manager_object->next_button = (Evas_Object *)elm_toolbar_item_append(toolbar, ug_app_state->rbutton_setup_wizard_skip_icon, ug_app_state->rbutton_setup_wizard_skip, _rbutton_click_cb, NULL); } elm_object_item_part_content_set(navi_it, "controlbar", toolbar); } else { Elm_Object_Item* navi_it = elm_naviframe_item_push(manager_object->nav, sc(PACKAGE, I18N_TYPE_Wi_Fi), button_back, NULL, view_content, NULL); evas_object_data_set(manager_object->nav, SCREEN_TYPE_ID_KEY, (void *)VIEW_MANAGER_VIEW_TYPE_MAIN); evas_object_smart_callback_add(manager_object->nav, "transition,finished", _hide_finished_cb, navi_it); Evas_Object *toolbar = elm_toolbar_add(manager_object->nav); elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND); manager_object->scan_button = (Evas_Object *)elm_toolbar_item_append(toolbar, NULL, sc(PACKAGE, I18N_TYPE_Scan), _refresh_sk_cb, NULL); elm_object_item_disabled_set(elm_toolbar_item_append(toolbar, NULL, "", NULL, NULL), EINA_TRUE); elm_object_item_part_content_set(navi_it, "controlbar", toolbar); elm_object_style_set(button_back, "naviframe/back_btn/default"); evas_object_smart_callback_add(button_back, "clicked", _back_sk_cb, NULL); } evas_object_show(layout); __COMMON_FUNC_EXIT__; return layout; }
int phone_log_view_init() { g_debug("Initializing the phonelog screen"); Evas_Object *win; int ret; //char buf[PATH_MAX]; ret = ui_utils_view_init(VIEW_PTR(view), ELM_WIN_BASIC, D_("Phonelog"), NULL, _hide_cb, NULL); if (ret) { g_critical("Failed to init phonelog view"); return ret; } win = ui_utils_view_window_get(VIEW_PTR(view)); ui_utils_view_delete_callback_set(VIEW_PTR(view), _delete_cb); ui_utils_view_layout_set(VIEW_PTR(view), phoneui_theme, "phoneui/phonelog/phonelog"); elm_theme_extension_add(NULL, phoneui_theme); view.pager = elm_naviframe_add(win); ui_utils_view_swallow(VIEW_PTR(view), "pager", view.pager); evas_object_show(view.pager); view.list_in = _add_genlist(win); elm_naviframe_item_simple_push(view.pager, view.list_in); view.list_out = _add_genlist(win); elm_naviframe_item_simple_push(view.pager, view.list_out); view.list_all = _add_genlist(win); elm_naviframe_item_simple_push(view.pager, view.list_all); view.list_missed = _add_genlist(win); elm_naviframe_item_simple_push(view.pager, view.list_missed); itc.item_style = "phonelog"; itc.func.text_get = gl_text_get; itc.func.content_get = gl_content_get; itc.func.state_get = gl_state_get; itc.func.del = gl_del; view.toolbar = elm_toolbar_add(win); ui_utils_view_swallow(VIEW_PTR(view), "toolbar", view.toolbar); elm_toolbar_homogeneous_set(view.toolbar, 1); elm_toolbar_shrink_mode_set(view.toolbar, ELM_TOOLBAR_SHRINK_NONE); elm_toolbar_align_set(view.toolbar, 0.0); elm_toolbar_icon_size_set(view.toolbar, 16); evas_object_size_hint_weight_set(view.toolbar, 0.0, 0.0); evas_object_size_hint_align_set(view.toolbar, EVAS_HINT_FILL, 0.0); elm_toolbar_item_append(view.toolbar, "icon/phonelog-incoming", D_("received"), _toolbar_changed, view.list_in); elm_toolbar_item_append(view.toolbar, "icon/phonelog-outgoing", D_("outgoing"), _toolbar_changed, view.list_out); view.toolbar_missed = elm_toolbar_item_append(view.toolbar, "icon/phonelog-missed", D_("missed"), _toolbar_changed, view.list_missed); elm_toolbar_item_append(view.toolbar, "icon/phonelog-all", D_("all"), _toolbar_changed, view.list_all); evas_object_show(view.toolbar); elm_toolbar_item_selected_set(view.toolbar_missed, EINA_TRUE); view.calls = g_ptr_array_new(); view.count = 25; // FIXME: make the limit configurable !!! */ phoneui_utils_calls_get(&view.count,_get_callback, NULL); phoneui_info_register_call_changes(_call_changed_handler, NULL); phoneui_info_register_contact_changes(_contact_changed_handler, NULL); return 0; }
/* public functions */ EM_INTERN Eina_Bool em_gui_init(void) { Evas_Object *o; /* allocate our object */ gui = EM_OBJECT_ALLOC(Em_Gui, EM_GUI_TYPE, _em_gui_cb_free); if (!gui) return EINA_FALSE; // Set finger size to 4 to avoid huge widgets // elm_finger_size_set(4); /* create window */ gui->w_win = elm_win_add(NULL, "emote", ELM_WIN_BASIC); elm_win_title_set(gui->w_win, "Emote"); elm_win_keyboard_mode_set(gui->w_win, ELM_WIN_KEYBOARD_ALPHA); evas_object_smart_callback_add(gui->w_win, "delete-request", _em_gui_cb_win_del, NULL); /* create background */ o = elm_bg_add(gui->w_win); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); // evas_object_size_hint_min_set(o, MIN_WIN_WIDTH, MIN_WIN_HEIGHT); elm_win_resize_object_add(gui->w_win, o); evas_object_show(o); /* create packing box */ gui->w_box = elm_box_add(gui->w_win); elm_win_resize_object_add(gui->w_win, gui->w_box); evas_object_size_hint_weight_set(gui->w_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(gui->w_box); /* create main toolbar */ gui->w_tb = elm_toolbar_add(gui->w_win); elm_toolbar_icon_size_set(gui->w_tb, (16 * elm_scale_get())); elm_toolbar_align_set(gui->w_tb, 0.0); elm_toolbar_mode_shrink_set(gui->w_tb, ELM_TOOLBAR_SHRINK_SCROLL); evas_object_size_hint_weight_set(gui->w_tb, 0.0, 0.0); evas_object_size_hint_align_set(gui->w_tb, EVAS_HINT_FILL, 0.0); elm_toolbar_item_append(gui->w_tb, "preferences-system", _("Settings"), _em_gui_cb_settings, NULL); elm_toolbar_item_append(gui->w_tb, "application-exit", _("Quit"), _em_gui_cb_quit, NULL); evas_object_show(gui->w_tb); elm_box_pack_start(gui->w_box, gui->w_tb); /* create channel selector */ gui->w_chansel = elm_toolbar_add(gui->w_win); elm_toolbar_homogeneous_set(gui->w_chansel, EINA_FALSE); elm_toolbar_align_set(gui->w_chansel, 0.0); elm_toolbar_mode_shrink_set(gui->w_chansel, ELM_TOOLBAR_SHRINK_SCROLL); evas_object_size_hint_weight_set(gui->w_chansel, 0.0, 0.0); evas_object_size_hint_align_set(gui->w_chansel, EVAS_HINT_FILL, 0.0); evas_object_show(gui->w_chansel); elm_box_pack_end(gui->w_box, gui->w_chansel); /* set min size of window and show it */ // evas_object_size_hint_min_set(gui->w_win, MIN_WIN_WIDTH, MIN_WIN_HEIGHT); evas_object_resize(gui->w_win, MIN_WIN_WIDTH, MIN_WIN_HEIGHT); evas_object_show(gui->w_win); gui->servers = eina_hash_string_small_new(_em_gui_server_del); return EINA_TRUE; }