/** * @brief Implementation AtkObject->ref_child callback * * ATK doc says:\n * Gets a reference to the specified accessible child of the object. The * accessible children are 0-based so the first accessible child is at index 0, * the second at index 1 and so on. * * @param obj an AtkObject * @param i index of a child * * @returns an AtkObject representing the specified accessible child of the * accessible. */ static AtkObject * eail_popup_ref_child(AtkObject *obj, gint i) { Eina_List *items = NULL; AtkObject *atk_obj = NULL; items = _eail_popup_get_items(obj); if (eina_list_count(items) > i) atk_obj = eail_factory_get_accessible(eina_list_nth(items, i)); if (atk_obj) g_object_ref(atk_obj); return atk_obj; }
/** * @brief Refreshes history of realized pages * * @param self an EailNaviframe object * @param list list of realized pages */ static void _refresh_cached_pages(EailNaviframe *self, const Eina_List *list) { int list_count = eina_list_count(list); eina_list_free(self->cached_pages); for (int i = 0; i < list_count; i++) { AtkObject *child = eail_naviframe_page_new(ATK_OBJECT(self), i); atk_object_initialize(child, eina_list_nth(list, i)); g_object_ref(child); self->cached_pages = eina_list_append(self->cached_pages, child); } }
EAPI Evas_Object * elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type) { Evas_Object *win; Evas_Object * (* _elm_win_add) (Evas_Object *, const char *, Elm_Win_Type) = dlsym(RTLD_NEXT, "elm_win_add"); win = _elm_win_add(parent, name, type); evas_list = eina_list_append(evas_list, evas_object_evas_get(win)); #ifdef DEBUG_TSUITE printf("Appended EVAS=<%p> list size=<%d>\n", evas_object_evas_get(win), eina_list_count(evas_list)); #endif return win; }
static void set_api_state(api_data *api) { Evas_Object *icon; const Eina_List *items = elm_box_children_get(api->box); if (!eina_list_count(items)) return; /* use elm_box_children_get() to get list of children */ switch(api->state) { /* Put all api-changes under switch */ case HOVERSEL_HORIZ: /* Make first hover horiz (0) */ elm_hoversel_horizontal_set(eina_list_nth(items, 0), EINA_TRUE); elm_hoversel_hover_begin(eina_list_nth(items, 0)); break; case HOVERSEL_END: /* Make first hover horiz (1) */ elm_hoversel_hover_begin(eina_list_nth(items, 1)); elm_hoversel_hover_end(eina_list_nth(items, 1)); break; case HOVERSEL_LABAL_SET: /* set second hover label (2) */ elm_object_text_set(eina_list_nth(items, 1), "Label from API"); break; case HOVERSEL_ICON_UNSET: /* 3 */ elm_object_text_set(eina_list_nth(items, 5), "Label only"); icon = elm_object_part_content_unset(eina_list_nth(items, 5), "icon"); evas_object_del(icon); break; case HOVERSEL_CLEAR_OPEN: /* 4 */ elm_hoversel_hover_begin(eina_list_nth(items, 1)); elm_hoversel_clear(eina_list_nth(items, 1)); break; case HOVERSEL_CLEAR: /* 5 */ elm_hoversel_clear(eina_list_nth(items, 0)); break; case API_STATE_LAST: break; default: return; } }
static void _item_refresh_mode_feed(News_Item *ni, int important_only, int unread_only, int changed_order, int changed_content, int changed_state) { Evas_Object *box; Evas_Object *obj; if (!eina_list_count(ni->config->feed_refs)) return; box = ni->view.box; NEWS_ITEM_FEEDS_FOREACH_BEG_LIST(ni->config->feed_refs); { obj = _feed->obj; if (important_only && (!_feed->important)) continue; if (unread_only && (!_feed->doc || !_feed->doc->unread_count)) continue; DITEM(("refresh : feed %s", _feed->name)); if (!_feed->obj || changed_content || changed_state) { news_feed_obj_refresh(_feed, changed_content, changed_state); obj = _feed->obj; } if (!_feed->obj || changed_order) { /* insert in the box */ e_box_pack_end(box, obj); e_box_pack_options_set(obj, 1, 1, /* fill */ 1, 1, /* expand */ 0, 0, /* align */ 0, 0, -1, -1 ); evas_object_show(obj); } _feed->obj = obj; } NEWS_ITEM_FEEDS_FOREACH_END(); }
bool EwkPopupMenu::setSelectedIndex(unsigned selectedIndex) { if (!m_popupMenuListener) return false; if (selectedIndex >= eina_list_count(m_popupMenuItems)) return false; if (m_selectedIndex == selectedIndex) return true; m_selectedIndex = selectedIndex; WKPopupMenuListenerSetSelection(m_popupMenuListener.get(), selectedIndex); return true; }
static void _cpuclock_status_free(Cpu_Status *s) { Eina_List *l; if (eina_list_count(s->frequencies)) eina_list_free(s->frequencies); if (s->governors) { for (l = s->governors; l; l = l->next) E_FREE(l->data); eina_list_free(s->governors); } E_FREE(s->cur_governor); if (s->orig_governor) eina_stringshare_del(s->orig_governor); E_FREE(s); }
void news_config_item_del(News_Config_Item *nic) { eina_stringshare_del(nic->id); while(eina_list_count(nic->feed_refs)) { News_Feed_Ref *fr; fr = eina_list_data_get(nic->feed_refs); eina_stringshare_del(fr->name); nic->feed_refs = eina_list_remove(nic->feed_refs, fr); } news->config->items = eina_list_remove(news->config->items, nic); free(nic); }
static void set_api_state(api_data *api) { const Eina_List *items = elm_box_children_get(api->box); Evas_Object *ck = eina_list_nth(items, 0); if (!eina_list_count(items)) return; /* use elm_box_children_get() to get list of children */ switch(api->state) { /* Put all api-changes under switch */ case CLOCK_HIDE_SEC: elm_clock_show_seconds_set(ck, EINA_FALSE); break; case CLOCK_SHOW_AM_PM: elm_clock_show_am_pm_set(ck, EINA_TRUE); break; case CLOCK_SHOW_SEC: elm_clock_show_seconds_set(ck, EINA_TRUE); break; case CLOCK_EDIT_MIN: elm_clock_edit_set(ck, ELM_CLOCK_EDIT_MIN_DECIMAL | ELM_CLOCK_EDIT_MIN_UNIT); break; case CLOCK_EDIT_HOUR: elm_clock_edit_set(ck, ELM_CLOCK_EDIT_DEFAULT); elm_clock_edit_set(ck, ELM_CLOCK_EDIT_HOUR_DECIMAL | ELM_CLOCK_EDIT_HOUR_UNIT); break; case CLOCK_EDIT_ALL: elm_clock_edit_set(ck, ELM_CLOCK_EDIT_ALL); break; case CLOCK_EDIT_ALL_ARMY: elm_clock_show_am_pm_set(ck, EINA_FALSE); break; case API_STATE_LAST: break; default: return; } }
/** * @brief Implementation AtkObject->ref_child callback * * ATK doc says:\n * Gets a reference to the specified accessible child of the object. The * accessible children are 0-based so the first accessible child is at index 0, * the second at index 1 and so on. * * @param obj an AtkObject * @param i index of a child * * @returns an AtkObject representing the specified accessible child of the * accessible. */ static AtkObject * eail_index_ref_child(AtkObject *obj, gint i) { const Eina_List *items; AtkObject *child = NULL; items = eail_index_get_index_items(obj); if (eina_list_count(items) > i) { child = eail_item_new(obj, ATK_ROLE_LIST_ITEM); atk_object_initialize(child, eina_list_nth(items, i)); g_object_ref(child); } return child; }
static Eina_Bool _systray_xembed_visible_check(Instance_Xembed *xembed) { if (eina_list_count(xembed->icons) == 0) { evas_object_hide(xembed->ec->frame); e_pixmap_dirty(xembed->ec->pixmap); } else { _xembed_win_resize(xembed); _systray_xembed_restack(xembed); evas_object_show(xembed->ec->frame); } xembed->visibility_timer = NULL; return EINA_FALSE; }
void cserve2_slaves_shutdown(void) { Slave_Proc *s; cserve2_on_child_dead_set(NULL); if (!slaves) return; DBG("Shutting down slaves subsystem with %d slaves alive!", eina_list_count(slaves)); EINA_LIST_FREE(slaves, s) { kill(s->pid, SIGKILL); _slave_free(s); }
void enna_volumes_remove_emit(Enna_Volume *v) { Eina_List *l; Enna_Volumes_Listener *vl; if (!v) return; enna_log(ENNA_MSG_EVENT, "volumes","Remove: %s volume listeners: %d", v->label, eina_list_count(enna_volumes_listeners)); EINA_LIST_FOREACH(enna_volumes_listeners, l, vl) { if (!vl->remove) continue; vl->remove(vl->data, v); } _volumes = eina_list_remove(_volumes, v); }
static int evas_gl_common_shader_precompile_all(Evas_GL_Shared *shared) { Eina_List *li = evas_gl_common_shader_precompile_list(shared); Evas_GL_Program *p; int total, cnt = 0; void *data; total = eina_list_count(li); EINA_LIST_FREE(li, data) { p = evas_gl_common_shader_generate_and_compile(shared, I(data)); if (p) { p->delete_me = 1; cnt++; } }
/** * @brief Get reference to elm_gengrid child as AtkObject * * @param obj EailGengrid instance * @param i child index * * @returns reference to AtkObject */ static AtkObject * eail_gengrid_ref_child(AtkObject *obj, gint i) { g_return_val_if_fail(EAIL_IS_GENGRID(obj), NULL); AtkObject *child = NULL; Eina_List *list = eail_gengrid_items_get(EAIL_GENGRID(obj)); if (eina_list_count(list) > i) { child = eail_factory_get_item_atk_obj (eina_list_nth(list, i), ATK_ROLE_LIST_ITEM, obj); g_object_ref(child); } return child; }
/** * @brief Implementation AtkObject->ref_child callback * * ATK doc says:\n * Gets a reference to the specified accessible child of the object. The * accessible children are 0-based so the first accessible child is at index 0, * the second at index 1 and so on. * * @returns an AtkObject representing the specified accessible child of the * accessible. */ static AtkObject * eail_genlist_ref_child(AtkObject *obj, gint i) { Eina_List *items; AtkObject *child = NULL; items = eail_genlist_get_items(EAIL_GENLIST(obj)); if (eina_list_count(items) > i) { child = eail_item_new(obj, ATK_ROLE_LIST_ITEM); atk_object_initialize(child, eina_list_nth(items, i)); g_object_ref(child); } eina_list_free(items); return child; }
/** * @brief Get reference to elm_gengrid child as AtkObject * * @param obj EailGengrid instance * @param i child index * * @returns reference to AtkObject */ static AtkObject * eail_gengrid_ref_child(AtkObject *obj, gint i) { g_return_val_if_fail(EAIL_IS_GENGRID(obj), NULL); AtkObject *child = NULL; Eina_List *list = eail_gengrid_items_get(EAIL_GENGRID(obj)); if (eina_list_count(list) > i) { child = eail_item_new(obj, ATK_ROLE_TABLE_CELL); atk_object_initialize(child, eina_list_nth(list, i)); g_object_ref(child); } return child; }
/** * @brief Implementation AtkObject->get_n_children callback * * ATK doc says:\n * Gets the number of accessible children of the accessible. * * @param obj an AtkObject * * @returns an integer representing the number of accessible children of * the accessible */ static gint eail_naviframe_n_children_get(AtkObject *obj) { EailNaviframe *naviframe; Evas_Object *widget; Eina_List *list; int list_count; g_return_val_if_fail(EAIL_IS_NAVIFRAME(obj), -1); naviframe = EAIL_NAVIFRAME(obj); widget = eail_widget_get_widget(EAIL_WIDGET(naviframe)); list = elm_naviframe_items_get(widget); list_count = eina_list_count(list); eina_list_free(list); return list_count; }
/** * @brief Gets reference to i-th obj child * * The caller must unreference it when it is no longer needed * * @param obj an AtkObject * @param i child index * @return child reference */ static AtkObject * eail_multibuttonentry_ref_child(AtkObject *obj, gint i) { const Eina_List *items; AtkObject *child = NULL; items = eail_multibuttonentry_get_items(EAIL_MULTIBUTTONENTRY(obj)); if (eina_list_count(items) > i) { child = eail_factory_get_item_atk_obj (eina_list_nth(items, i), ATK_ROLE_LABEL, obj); g_object_ref(child); } else ERR("Tried to ref child with index %d out of bounds!", i); return child; }
void enna_volumes_add_emit(Enna_Volume *v) { Eina_List *l, *l_prev; Enna_Volumes_Listener *vl; if (!v) return; enna_log(ENNA_MSG_EVENT, "volumes", "Add: %s volume listeners: %d", v->label, eina_list_count(enna_volumes_listeners)); EINA_LIST_FOREACH_SAFE(enna_volumes_listeners, l, l_prev, vl) { if (!vl->add) continue; vl->add(vl->data, v); } _volumes = eina_list_append(_volumes, v); }
Eina_List * etui_img_cbt_entries_get(Etui_Img_Cbt *tar) { Etui_Img_Cbt_Entry *e; Eina_List *list = NULL; if (!tar) return NULL; e = _etui_img_cbt_entry_first_get(tar); do { list = eina_list_append(list, e); e = _etui_img_cbt_entry_next_get(tar); } while (e); list = eina_list_sort(list, eina_list_count(list), _etui_img_cbt_sort_cb); return list; }
int main(int argc, char **argv) { (void)argc; (void)argv; Eina_List *list = NULL, *r_list; Eina_List *l; Eina_Iterator *itr; void *list_data; eina_init(); list = eina_list_append(list, "caprica"); list = eina_list_append(list, "sagitarius"); list = eina_list_append(list, "aerilon"); list = eina_list_append(list, "gemenon"); list = eina_list_promote_list(list, eina_list_nth_list(list, 2)); list = eina_list_demote_list(list, eina_list_nth_list(list, 2)); list = eina_list_remove(list, "sagitarius"); l = eina_list_data_find_list(list, "aerilon"); eina_list_data_set(l, "aquarius"); printf("size: %d\n", eina_list_count(list)); r_list = eina_list_reverse_clone(list); itr = eina_list_iterator_new(r_list); EINA_ITERATOR_FOREACH(itr, list_data) printf("%s\n", (char*)list_data); eina_iterator_free(itr); eina_list_free(list); eina_list_free(r_list); eina_shutdown(); return 0; }
void alarm_alarm_del(Alarm *al) { if (al->name) eina_stringshare_del(al->name); if (al->state == ALARM_STATE_RINGING) alarm_alarm_ring_stop(al, 0); if (al->config_dialog) e_object_del(E_OBJECT(al->config_dialog)); if (al->description) eina_stringshare_del(al->description); if (al->program) eina_stringshare_del(al->program); if (al->snooze.dia) e_object_del(E_OBJECT(al->snooze.dia)); if (al->snooze.etimer) ecore_timer_del(al->snooze.etimer); alarm_config->alarms = eina_list_remove(alarm_config->alarms, al); free(al); /* refresh things */ if (alarm_config->config_dialog) { E_Config_Dialog_Data *mcda; mcda = alarm_config->config_dialog->cfdata; alarm_config_refresh_alarms_ilist(mcda); } if (alarm_config->alarms_details) alarm_edje_refresh_details(); if ( !eina_list_count(alarm_config->alarms) && alarm_config->alarms_ring_etimer ) { ecore_timer_del(alarm_config->alarms_ring_etimer); alarm_config->alarms_ring_etimer = NULL; } }
EINTERN void e_xinerama_fake_screen_del(int num) { Eina_List *l; E_Screen *scr, *lscr; int n = 0, x = 0; /* this assumes X number of identical horizontal screens */ EINA_SAFETY_ON_NULL_RETURN(fake_screens); l = eina_list_nth_list(fake_screens, num); EINA_SAFETY_ON_NULL_RETURN(l); scr = eina_list_data_get(l); free(scr); fake_screens = eina_list_remove_list(fake_screens, l); EINA_LIST_FOREACH(fake_screens, l, lscr) { lscr->screen = n++; lscr->x = x; lscr->w = e_comp->w / eina_list_count(fake_screens); x = lscr->x + lscr->w; }
static void _device_calibration_set(Ecore_Drm_Evdev *edev) { const char *sysname; float cal[6]; const char *device; Eina_List *devices; const char *vals; enum libinput_config_status status; if ((!libinput_device_config_calibration_has_matrix(edev->device)) || (libinput_device_config_calibration_get_default_matrix(edev->device, cal) != 0)) return; sysname = libinput_device_get_sysname(edev->device); devices = eeze_udev_find_by_subsystem_sysname("input", sysname); if (eina_list_count(devices) < 1) return; EINA_LIST_FREE(devices, device) { vals = eeze_udev_syspath_get_property(device, "WL_CALIBRATION"); if ((!vals) || (sscanf(vals, "%f %f %f %f %f %f", &cal[0], &cal[1], &cal[2], &cal[3], &cal[4], &cal[5]) != 6)) goto cont; cal[2] /= edev->output->current_mode->width; cal[5] /= edev->output->current_mode->height; status = libinput_device_config_calibration_set_matrix(edev->device, cal); if (status != LIBINPUT_CONFIG_STATUS_SUCCESS) ERR("Failed to apply calibration"); cont: eina_stringshare_del(device); continue; }
static Eina_Bool _elixir_eet_release(const Elixir_Loader_File *file) { Elixir_Eet_Filename *lookup; Eina_List *last; /* LRU must never be bigger than 8 file. */ if (eina_list_count(lru) > 8) { last = eina_list_last(lru); lookup = eina_list_data_get(last); eina_hash_del(cache, lookup->filename, lookup); lru = eina_list_remove_list(lru, last); } file->file->reference--; lookup = eina_hash_find(cache, file->file->filename); if (lookup == file->file) lru = eina_list_prepend(lru, file->file); else if (file->file->reference < 0) { eet_close(file->file->eet); free(file->file->filename); free(file->file); } if (stack && eina_array_count_get(stack) > 0) eina_array_pop(stack); if (file->free_content) free(file->content); if (file->free_compiled) free(file->compiled); free(file->section); free((void*) file); return EINA_TRUE; }
Eina_List* EWK2UnitTestBase::waitUntilSpellingLanguagesLoaded(unsigned expectedLanguageCount, double timeoutValue) { // Keep waiting until all languages has been loaded or leave afqter timeout. // Languages are being loaded in the timer, we have to wait for them. Eina_List* loadedLanguages = nullptr; void* actual = nullptr; CallbackDataExpectedValue<bool> data(true, timeoutValue); while ((eina_list_count(loadedLanguages) != expectedLanguageCount) && !data.isDone()) { if (loadedLanguages) { // List has to be freed before acquiring new one. actual = nullptr; EINA_LIST_FREE(loadedLanguages, actual) eina_stringshare_del(static_cast<const char*>(actual)); } loadedLanguages = ewk_text_checker_spell_checking_languages_get(); ecore_main_loop_iterate(); } return loadedLanguages; }
void tabpanel_item_del(Tabpanel_Item *item) { if (!item->signal) { elm_pager_content_pop(item->tab->panels); evas_object_del(item->content); } if (item->tab->items) tabpanel_item_select( eina_list_data_get( item->tab->items)); elm_toolbar_item_del(item->item_tb); if (item->tab->from_edje && eina_list_count(item->tab->items) <= 2) edje_object_signal_emit( item->tab->parent, "toolbar,hide", ""); item->tab->items = eina_list_remove(item->tab->items, item); free(item); }
EAPI int e_modapi_shutdown(E_Module *m) { e_gadcon_provider_unregister((const E_Gadcon_Client_Class *)&_gadcon_class); if (alarm_config->alarms) { while (eina_list_count(alarm_config->alarms)) { Alarm *al; al = eina_list_data_get(alarm_config->alarms); alarm_alarm_del(al); } eina_list_free(alarm_config->alarms); } if (alarm_config->alarms_ring_etimer) ecore_timer_del(alarm_config->alarms_ring_etimer); if (alarm_config->alarms_program_default) eina_stringshare_del(alarm_config->alarms_program_default); if (alarm_config->theme) free(alarm_config->theme); if (alarm_config->config_dialog) e_object_del(E_OBJECT(alarm_config->config_dialog)); if (alarm_config->config_dialog_alarm_new) e_object_del(E_OBJECT(alarm_config->config_dialog_alarm_new)); if (alarm_config->menu) { e_menu_post_deactivate_callback_set(alarm_config->menu , NULL, NULL); e_object_del(E_OBJECT(alarm_config->menu)); } E_FREE(alarm_config); E_CONFIG_DD_FREE(_alarms_edd); E_CONFIG_DD_FREE(_conf_edd); return 1; }
EAPI int efreet_desktop_type_add(const char *type, Efreet_Desktop_Type_Parse_Cb parse_func, Efreet_Desktop_Type_Save_Cb save_func, Efreet_Desktop_Type_Free_Cb free_func) { int id; Efreet_Desktop_Type_Info *info; info = NEW(Efreet_Desktop_Type_Info, 1); if (!info) return 0; id = eina_list_count(efreet_desktop_types); info->id = id; info->type = eina_stringshare_add(type); info->parse_func = parse_func; info->save_func = save_func; info->free_func = free_func; efreet_desktop_types = eina_list_append(efreet_desktop_types, info); return id; }