Elm_Object_Item * contact_list_item_add(struct ContactListData *list_data, GHashTable *entry, int sortin) { GHashTable *other; Elm_Object_Item *glit; if (sortin) { /* find the correct position to insert the new one */ glit = elm_genlist_first_item_get(list_data->list); while (glit) { other = (GHashTable *)elm_object_item_data_get(glit); if (phoneui_utils_contact_compare(entry, other) < 0) break; glit = elm_genlist_item_next_get(glit); } if (glit) { return elm_genlist_item_insert_before(list_data->list, &itc, g_hash_table_ref(entry), NULL, glit, ELM_GENLIST_ITEM_NONE, NULL, NULL); } } return elm_genlist_item_append(list_data->list, &itc, g_hash_table_ref(entry) /*item data */ , NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); }
GenlistItemBase * GenlistItemBase::getNextItem() { Elm_Object_Item *it = elm_genlist_item_next_get(item); if (!it) return NULL; GenlistItemBase *next = reinterpret_cast<GenlistItemBase *>(elm_object_item_data_get(it)); return next; }
void Add_To_Most_Visited_Sites_View::__history_item_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; Elm_Object_Item *seleted_item = elm_genlist_selected_item_get(obj); Elm_Object_Item *index_item = elm_genlist_first_item_get(obj); int index = 0; /* calculate the index of the selected item */ while (index_item != seleted_item) { /* Do not count date label item */ if (elm_genlist_item_select_mode_get(index_item) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) index++; index_item = elm_genlist_item_next_get(index_item); } Evas_Object *entry = br_elm_editfield_entry_get(add_to_most_visited_sites_view->m_url_edit_field); char *mark_up = elm_entry_utf8_to_markup(add_to_most_visited_sites_view->m_history_list[index]->url.c_str()); if (mark_up) { elm_entry_entry_set(entry, mark_up); free(mark_up); } }
void view_main_update_group_title(gboolean is_bg_scan) { Evas_Object *box = NULL; Evas_Object *main_list = NULL; if (list != NULL) { if (!is_bg_scan) { Elm_Object_Item *it = elm_genlist_first_item_get(list); while (it) { elm_object_item_disabled_set(it, EINA_TRUE); it = elm_genlist_item_next_get(it); } } elm_genlist_item_update(grouptitle); } else { box = elm_object_content_get(devpkr_app_state->popup); main_list = _create_genlist(box); view_main_add_group_title(); elm_box_pack_start(box, main_list); evas_object_show(main_list); evas_object_show(box); wifi_devpkr_redraw(); evas_object_show(devpkr_app_state->popup); } return; }
Elm_Object_Item* viewer_list_item_next_get(const Elm_Object_Item* current) { assertm_if(NULL == current, "NULL!!"); Elm_Object_Item* ret=NULL; ret = elm_genlist_item_next_get(current); assertm_if(NULL == ret, "NULL!!"); return ret; }
static void _next_cb(void *data, Evas_Object *o, void *event_info) { Evas_Object *list = data; Elm_Object_Item *glit = elm_genlist_selected_item_get(list); if (glit) glit = elm_genlist_item_next_get(glit); if (!glit) glit = elm_genlist_first_item_get(list); elm_genlist_item_selected_set(glit, EINA_TRUE); elm_genlist_item_show(glit, ELM_GENLIST_ITEM_SCROLLTO_IN); }
/** * @brief Prepares Eina_List filled with Elm_Object_Item* objects * representing items in the list * * @return filled list with list items. Call eina_list_free on that list when * results processing has been finished */ static Eina_List * eail_genlist_get_items(EailGenlist *genlist) { Eina_List *items = NULL; Elm_Object_Item *item; Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(genlist)); item = elm_genlist_first_item_get(widget); while (item) { items = eina_list_append(items, item); item = elm_genlist_item_next_get(item); } return items; }
void view_main_item_state_set(wifi_ap_h ap, ITEM_CONNECTION_MODES state) { __COMMON_FUNC_ENTER__; char *item_ssid = NULL; wifi_security_type_e sec_type; wlan_security_mode_type_t item_sec_mode; Elm_Object_Item* it = NULL; it = elm_genlist_first_item_get(list); if (!it || !ap || (WIFI_ERROR_NONE != wifi_ap_get_essid(ap, &item_ssid)) || (WIFI_ERROR_NONE != wifi_ap_get_security_type(ap, &sec_type))) { ERROR_LOG(SP_NAME_NORMAL, "Invalid params"); if(item_ssid != NULL) { g_free(item_ssid); item_ssid = NULL; } __COMMON_FUNC_EXIT__; return; } item_sec_mode = common_utils_get_sec_mode(sec_type); SECURE_INFO_LOG(SP_NAME_NORMAL, "item state set for AP[%s] with sec mode[%d]", item_ssid, item_sec_mode); while (it) { devpkr_gl_data_t *gdata = (devpkr_gl_data_t *)elm_object_item_data_get(it); if (gdata != NULL) { SECURE_INFO_LOG(SP_NAME_NORMAL, "gdata AP[%s] with sec mode[%d]", gdata->dev_info->ssid, gdata->dev_info->security_mode); } if (gdata && gdata->dev_info->security_mode == item_sec_mode && !g_strcmp0(gdata->dev_info->ssid, item_ssid)) { if (gdata->connection_mode != state) { gdata->connection_mode = state; INFO_LOG(SP_NAME_NORMAL, "State transition from [%d] --> [%d]", view_main_state_get(), state); view_main_state_set(state); elm_genlist_item_update(it); } break; } it = elm_genlist_item_next_get(it); } g_free(item_ssid); __COMMON_FUNC_EXIT__; return; }
/* Unused function */ Elm_Object_Item *__view_main_get_item_in_mode(ITEM_CONNECTION_MODES mode) { Elm_Object_Item* it = NULL; it = elm_genlist_first_item_get(list); __COMMON_FUNC_ENTER__; while (it) { devpkr_gl_data_t *gdata = (devpkr_gl_data_t *)elm_object_item_data_get(it); if (gdata && gdata->connection_mode == mode) { SECURE_INFO_LOG( SP_NAME_NORMAL, "Found Item [%s] in mode[%d]", gdata->dev_info->ssid, mode); __COMMON_FUNC_EXIT__; return it; } it = elm_genlist_item_next_get(it); } __COMMON_FUNC_EXIT__; return NULL; }
Elm_Object_Item *view_main_item_get_for_ap(wifi_ap_h ap) { __COMMON_FUNC_ENTER__; if (!ap || !list) { __COMMON_FUNC_EXIT__; return NULL; } char *essid = NULL; wifi_security_type_e type = WIFI_SECURITY_TYPE_NONE; if (WIFI_ERROR_NONE != wifi_ap_get_essid(ap, &essid)) { __COMMON_FUNC_EXIT__; return NULL; } if (WIFI_ERROR_NONE != wifi_ap_get_security_type(ap, &type)) { g_free(essid); __COMMON_FUNC_EXIT__; return NULL; } Elm_Object_Item *it = elm_genlist_first_item_get(list); wlan_security_mode_type_t sec_mode = common_utils_get_sec_mode(type); while (it) { devpkr_gl_data_t* gdata = elm_object_item_data_get(it); wifi_device_info_t *device_info = NULL; if (gdata && (device_info = gdata->dev_info)) { if (!g_strcmp0(device_info->ssid, essid) && device_info->security_mode == sec_mode) { break; } } it = elm_genlist_item_next_get(it); } g_free(essid); __COMMON_FUNC_EXIT__; return it; }
void contact_list_fill_index(struct ContactListData *list_data) { static const int index_button_height = 25; /*FIXME: get actual size*/ int limit = 1; Evas_Object *win; Elm_Object_Item *glit, *current_index_item = NULL; GHashTable *entry; char *idx, *current_index = NULL; char *name; int init_index_count, index_count; Eina_Bool new_index; int height; win = ui_utils_view_window_get(list_data->view); if (list_data->index) { evas_object_del(list_data->index); } list_data->index = elm_index_add(win); elm_win_resize_object_add(win, list_data->index); evas_object_size_hint_weight_set(list_data->index, 1.0, 0.0); evas_object_smart_callback_add(list_data->index, "delay,changed", gl_index_changed, NULL); evas_object_smart_callback_add(list_data->index, "selected", gl_index_selected, NULL); evas_object_geometry_get(list_data->index, NULL, NULL, NULL, &height); limit = height / index_button_height; init_index_count = list_data->count / (limit - 1); /* The number of indexes excluding the first */ index_count = 0; /* Add the first as well */ glit = elm_genlist_first_item_get(list_data->list); while (glit) { entry = (GHashTable *)elm_object_item_data_get(glit); name = phoneui_utils_contact_display_name_get(entry); idx = _new_get_index(name); if (idx) { if (!current_index || strcmp(idx, current_index)) { if (current_index) { free(current_index); } current_index = idx; current_index_item = glit; new_index = TRUE; } else { new_index = FALSE; free(idx); } if (index_count < 1 && new_index) { g_debug("Adding index %s", current_index); elm_index_item_append(list_data->index, current_index, NULL, current_index_item); index_count = init_index_count; } index_count--; } glit = elm_genlist_item_next_get(glit); } if (list_data->layout) { elm_object_part_content_set(list_data->layout, "contacts_index", list_data->index); } evas_object_show(list_data->index); }