/* ordering alphabetically */ static int _cmp_func(const void *data1, const void *data2) { const char *img_path1, *img_path2; const Elm_Object_Item *slide_it1 = data1; const Elm_Object_Item *slide_it2 = data2; img_path1 = elm_object_item_data_get(slide_it1); img_path2 = elm_object_item_data_get(slide_it2); return strcasecmp(img_path1, img_path2); }
Elm_Object_Item *viewer_manager_move_item_to_top(Elm_Object_Item *item) { __COMMON_FUNC_ENTER__; if (!item) { return NULL; } ug_genlist_data_t *gdata = elm_object_item_data_get(item); if (!gdata) { return NULL; } wifi_device_info_t *old_wifi_device = gdata->device_info; if (!old_wifi_device) { return NULL; } wifi_device_info_t *wifi_device = (wifi_device_info_t*)g_malloc0(sizeof(wifi_device_info_t)); wifi_device->profile_name = g_strdup(old_wifi_device->profile_name); wifi_device->ssid = g_strdup(old_wifi_device->ssid); wifi_device->ap_image_path = g_strdup(old_wifi_device->ap_image_path); wifi_device->ap_status_txt = g_strdup(old_wifi_device->ap_status_txt); wifi_device->rssi = old_wifi_device->rssi; wifi_device->security_mode = old_wifi_device->security_mode; wifi_device->wps_mode = old_wifi_device->wps_mode; viewer_list_item_del(item); item = viewer_list_item_insert_after(manager_object->list, wifi_device, NULL, viewer_manager_genlist_normal_callback, wifi_device); __COMMON_FUNC_EXIT__; return item; }
int viewer_manager_item_radio_mode_set(void* object, Elm_Object_Item* item, VIEWER_ITEM_RADIO_MODES mode) { __COMMON_FUNC_ENTER__; assertm_if(NULL == manager_object, "manager_object is NULL!!"); assertm_if(NULL == item, "item is NULL!!"); if (NULL == item) { INFO_LOG(COMMON_NAME_ERR, "item is NULL"); return FALSE; } ug_genlist_data_t* gdata = (ug_genlist_data_t *) elm_object_item_data_get(item); if (NULL == gdata || NULL == gdata->device_info) { INFO_LOG(COMMON_NAME_ERR, "gdata or device_info is NULL"); return FALSE; } if (gdata->radio_mode == mode) { INFO_LOG(UG_NAME_NORMAL, "[%s] is already in requested state", gdata->device_info->ssid); return FALSE; } INFO_LOG(UG_NAME_NORMAL, "[%s] AP Item State Transition from [%d] --> [%d]", gdata->device_info->ssid, gdata->radio_mode, mode); gdata->radio_mode = mode; if (gdata->device_info->ap_status_txt) { g_free(gdata->device_info->ap_status_txt); gdata->device_info->ap_status_txt = viewer_manager_get_device_status_txt(gdata->device_info, mode); } elm_genlist_item_update(item); __COMMON_FUNC_EXIT__; return TRUE; }
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); }
static void gl_index_changed(void *data, Evas_Object * obj, void *event_info) { (void) data; (void) obj; elm_genlist_item_bring_in(elm_object_item_data_get(event_info), ELM_GENLIST_ITEM_SCROLLTO_TOP); }
GenlistItemBase * GenlistItemBase::getPreviousItem() { Elm_Object_Item *it = elm_genlist_item_prev_get(item); if (!it) return NULL; GenlistItemBase *prev = reinterpret_cast<GenlistItemBase *>(elm_object_item_data_get(it)); return prev; }
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; }
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); } }
static void _index_changed(void *data, Evas_Object *obj, void *event_info) { Elm_Object_Item *item = elm_object_item_data_get(event_info); elm_gengrid_item_bring_in(item, ELM_GENGRID_ITEM_SCROLLTO_IN); }
EINA_LIST_FOREACH(its, l, it) { if (app->location == elm_object_item_data_get(it)) { elm_naviframe_item_promote(it); break; } }
static void _item_activate(Elm_Object_Item *item) { List_Item *li; li = (List_Item*)elm_object_item_data_get(item); if (li->func_activated) li->func_activated(li->data); }
static void _it_sel_cb(void *data, Evas_Object *obj, void *event) { App_Inwin_Data *aid = data; Elm_Object_Item *gg_it = event; aid->emo = elm_object_item_data_get(gg_it); elm_naviframe_item_simple_promote(aid->naviframe, aid->settings); }
void set_create_priority(void *data, Evas_Object *obj, void *event_info) { Details *det = data; evas_object_hide(det->hover); //change priority value of selected task _Task *tsk = (_Task *)elm_object_item_data_get(det->item); tsk->pr = atoi(det->data); //update button label elm_object_text_set(det->button, det->data); WRITE = 1; }
static void _gl_unhighlighted(void *data, Evas_Object *obj, void *event_info) { Elm_Object_Item *item = (Elm_Object_Item *)event_info; if (item) { devpkr_gl_data_t *gdata = (devpkr_gl_data_t *)elm_object_item_data_get(item); if (gdata) { gdata->highlighted = FALSE; elm_genlist_item_fields_update(item, "elm.icon.1", ELM_GENLIST_ITEM_FIELD_CONTENT); } } }
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); } }
static gint __viewer_list_compare_ssid (gconstpointer a, gconstpointer b) { Elm_Object_Item *item = (Elm_Object_Item *)a; if (item) { ug_genlist_data_t* gdata = elm_object_item_data_get(item); if (gdata && gdata->device_info) { return g_strcmp0((const char *)b, (const char *)gdata->device_info->ssid); } } return -1; }
void save_button_clicked(void *data, Evas_Object *obj, void *event_info) { char te_data[255], *task_entry; //get task no Elm_Object_Item *item = (Elm_Object_Item *)elm_genlist_selected_item_get(list); if (item) { _Task *tsk = (_Task *)elm_object_item_data_get(item); //get data from entry sprintf(te_data, "%s", (const char *)elm_entry_entry_get(tk)); task_entry = strtok(te_data, "<"); sprintf(tsk->text, "%s", task_entry); //save data to database update_record(tsk->no); elm_genlist_item_update(task_list[tsk->no]); } else { //add a new record with this data time_t curtime; struct tm *loctime; char dt[6], te_data[255], *task_entry; int i = total_tasks; total_tasks ++; //get the time curtime = time (NULL); loctime = localtime (&curtime); strftime(dt, 6, "%d-%m", loctime); Task[i].no = i; Task[i].cb = 0; if (dummy_pr) Task[i].pr = dummy_pr; else Task[i].pr = 1; //get entry data sprintf(te_data, "%s", (const char *)elm_entry_entry_get(tk)); task_entry = strtok(te_data, "<"); if (strcmp(task_entry, "") !=0) strcpy(Task[i].text, task_entry); else strcpy(Task[i].text, "Task"); //set current date if (strcmp(dummy_date, "") != 0) strcpy(Task[i].date, dummy_date); else strcpy(Task[i].date, dt); if(strcmp(sel_category, " All Tasks ")==0) strcpy(Task[i].cat, "Personal"); else strcpy(Task[i].cat, sel_category); task_list[i] = elm_genlist_item_append(list, &itc1, &Task[i], NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); last_rec = -1; //insert record insert_record(i); elm_genlist_item_selected_set(task_list[i], 1); } }
void del_cat_button_clicked(void *data, Evas_Object *obj, void *event_info) { Evas_Object *li = data; Elm_Object_Item *item = (Elm_Object_Item *)elm_genlist_selected_item_get(li); char *_cat = (char *)elm_object_item_data_get(item); //delete category from db del_category(_cat); //remove item from list elm_object_item_del(item); create_cat_hover (); if(strcmp(sel_category, _cat) == 0) select_category (" All Tasks ", NULL, NULL); }
/* item selection callback */ static void _grid_sel(void *data, Evas_Object *obj, void *event_info) { unsigned int x, y; Example_Item *it = elm_object_item_data_get(event_info); elm_gengrid_item_pos_get(event_info, &x, &y); fprintf(stdout, "Item [%p], with data [%p], path %s, at position (%d, %d)," " has been selected\n", event_info, data, it->path, x, y); }
void note_done(void *data, Evas_Object *obj, void *event_info) { char tystr[255]; //Evas_Object *en = data; Elm_Object_Item *item = (Elm_Object_Item *)elm_genlist_selected_item_get(list); _Task *tsk = (_Task *)elm_object_item_data_get(item); sprintf(tystr, "%s", elm_entry_entry_get(data)); if (strcmp(tystr, "<br>") == 0) strcpy(tystr, ""); strcpy(tsk->note, tystr); save_note(tystr, tsk->no); elm_genlist_item_update(item); cat_win_del (note_win, NULL, NULL); }
void Browser_Settings_Website_Setting::__item_selected_cb(void *data, Evas_Object *obj, void *event_info) { BROWSER_LOGD("[%s]", __func__); if (!data) return; Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)data; Elm_Object_Item *it = (Elm_Object_Item *)event_info; website_setting->m_current_website_item_data = NULL; website_setting->m_current_website_item_data = (website_setting_item *)elm_object_item_data_get(it); website_setting->_show_details_list(website_setting->m_current_website_item_data); elm_genlist_item_selected_set(it, EINA_FALSE); }
void task_select(void *data, Evas_Object *obj, void *event_info) { char tystr[2]; char te_data[255], *task_entry; Elm_Object_Item *item; _Task *tsk=NULL; //for entries, get entry data and check agianst previous task text, date //if changed - write if (last_rec != -1) { //cater for initial null data sprintf(te_data, "%s", (const char *)elm_entry_entry_get(tk)); task_entry = strtok(te_data, "<"); tsk = (_Task *)elm_object_item_data_get(task_list[last_rec]); if (strcmp(task_entry, tsk->text) != 0) { sprintf(tsk->text, "%s", task_entry); WRITE = 1; } } if (WRITE == 1) { elm_genlist_item_update(task_list[last_rec]); update_record(tsk->no); WRITE = 0; } Evas_Object *li = data; item = (Elm_Object_Item *)elm_genlist_selected_item_get(li); tsk = (_Task *)elm_object_item_data_get(item); last_rec = tsk->no; elm_object_text_set(cat_bt, tsk->cat); sprintf(tystr, "%d", tsk->pr); elm_object_text_set(pr_bt, tystr); elm_object_text_set(date_bt, tsk->date); elm_entry_entry_set(tk, tsk->text); if (strcmp(tsk->text, "Task") == 0) elm_entry_select_all(tk); }
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; }
static void _on_index_mouse_up_cb(void *data, Evas *e, Evas_Object *o, void *event_info) { page_data *pd = (page_data *)data; /* Keep the last index item active and move to the page of the currently selected index item */ if (!pd->last_it) return; elm_index_item_selected_set(pd->last_it, EINA_TRUE); if (!pd->new_it) return; int idx = (int) elm_object_item_data_get(pd->new_it); if (idx == pd->cur_page) return; elm_scroller_page_bring_in(pd->scroller, idx, 0); }
void set_category(void *data, Evas_Object *obj, void *event_info) { Elm_Object_Item *item; //change category value of selected task char *category = data; item = (Elm_Object_Item *)elm_genlist_selected_item_get(list); evas_object_hide(hs); if (!item) return; _Task *tsk = (_Task *)elm_object_item_data_get(item); if (strcmp(tsk->cat, category) == 0) return; strcpy(tsk->cat, category); elm_object_text_set(cat_bt, category); WRITE = 1; if (strcmp(sel_category, " All Tasks ") !=0 && strcmp(sel_category, category) != 0) elm_object_item_del(item); }
void set_date(void *data, Evas_Object *obj, void *event_info) { char *dt = (char *)data; //set the date elm_object_text_set(date_bt, dt); evas_object_hide(date_hs); Elm_Object_Item *item = (Elm_Object_Item *)elm_genlist_selected_item_get(list); if (!item) { strcpy(dummy_date, dt); return; } _Task *tsk = (_Task *)elm_object_item_data_get(item); if (strcmp(tsk->date, dt) == 0) return; strcpy(tsk->date, dt); WRITE = 1; }
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; } } }
/* 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; }
Elm_Object_Item* viewer_list_item_at_index(int index) { __COMMON_FUNC_ENTER__; int size = viewer_list_item_size_get(); assertm_if(0 > size, "query error! (i == zero base)"); Elm_Object_Item *gli = NULL; gli = (Elm_Object_Item*) g_slist_nth_data(container, index+1); assertm_if(NULL == gli, "NULL!!"); if (gli) { ug_genlist_data_t* gdata = NULL; gdata = elm_object_item_data_get(gli); assertm_if(NULL == gdata, "NULL!!"); if (!gdata) gli = NULL; } __COMMON_FUNC_EXIT__; return gli; }