static void _eco_match_edit(void *data, void *data2) { int sel = e_widget_ilist_selected_get(o_matches); const char *val = e_widget_ilist_nth_label_get(o_matches, sel); eco_match_dialog(val, _eco_match_dialog_ok_cb); }
EAPI const char * e_widget_config_list_nth_get(Evas_Object *obj, int n) { E_Widget_Data *wd; wd = e_widget_data_get(obj); return e_widget_ilist_nth_label_get(wd->gui.list, n); }
/* Apply Function */ static void _apply(E_Config_Dialog_Data *cfdata) { Eco_Option *opt, *item; int val, sel, i; Eina_List *l = NULL; const char *match; sel = e_widget_ilist_selected_get(o_matches); /* set effect */ opt = eco_config_option_list_nth(cfg_screen, str_effects, sel); if (opt) opt->intValue = effect; /* update match */ match = e_widget_ilist_nth_label_get(o_matches, sel); opt = eco_config_option_list_nth(cfg_screen, str_matches, sel); if (opt && match) { eco_string_free(opt->stringValue); opt->stringValue = eina_stringshare_add(match); } /* update duration */ opt = eco_config_option_list_nth(cfg_screen, str_durations, sel); if (opt) opt->intValue = duration; /* update random effect list */ opt = eco_config_option_get(cfg_screen, str_randoms); EINA_LIST_FREE(opt->listValue, item) free(item); for (i = 0; i < effect_cnt; i++) { if (random_effect[i]) { item = calloc (1, sizeof(Eco_Option)); item->intValue = i; l = eina_list_append(l, item); } } opt->listValue = l; eco_config_group_apply("animation"); }
static void _eco_match_click_cb(void *data) { Eco_Option *opt; int sel; const char *match; /* remember changes to the last selected item */ opt = eco_config_option_list_nth(cfg_screen, str_effects, selected); if (opt) opt->intValue = effect; opt = eco_config_option_list_nth(cfg_screen, str_durations, selected); if (opt) opt->intValue = duration; opt = eco_config_option_list_nth(cfg_screen, str_matches, selected); match = e_widget_ilist_nth_label_get(o_matches, selected); if (opt && match) { eco_string_free(opt->stringValue); opt->stringValue = eina_stringshare_add(match); } /* set stored values for selected match */ sel = e_widget_ilist_selected_get(o_matches); opt = eco_config_option_list_nth(cfg_screen, str_durations, sel); if (opt) { e_widget_slider_value_int_set(o_duration, opt->intValue); e_widget_disabled_set(o_duration, 0); } opt = eco_config_option_list_nth(cfg_screen, str_effects, sel); if (opt) { e_widget_radio_toggle_set(o_effect[opt->intValue], 1); } selected = sel; }