static void _eco_match_add(void *data, void *data2) { Eco_Option *opt; e_widget_ilist_append(o_matches, NULL, default_match, _eco_match_click_cb, NULL, NULL); opt = eco_config_option_list_add(cfg_screen, str_matches); opt->stringValue = strdup(default_match); opt = eco_config_option_list_add(cfg_screen, str_effects); opt->intValue = 11; opt = eco_config_option_list_add(cfg_screen, str_durations); opt->intValue = 300; e_widget_slider_value_int_set(o_duration, opt->intValue); opt = eco_config_option_list_add(cfg_screen, str_randoms); /* opt = eco_config_option_list_add(cfg_screen, str_options); */ e_widget_disabled_set(o_duration, 0); e_widget_ilist_selected_set(o_matches, e_widget_ilist_count(o_matches)); }
static void _eco_match_click_cb(void *data) { int sel = e_widget_ilist_selected_get(o_matches); Eco_Option *value = eco_config_option_list_nth(cfg_screen, "opacity_values", sel); if (value) { e_widget_slider_value_int_set(o_opacity, value->intValue); e_widget_disabled_set(o_opacity, 0); } }
static void _eco_match_add(void *data, void *data2) { Eco_Option *match, *value; e_widget_ilist_append(o_matches, NULL, "class=XTerm", _eco_match_click_cb, NULL, NULL); match = eco_config_option_list_add(cfg_screen, "opacity_matches"); match->stringValue = eina_stringshare_add("class=XTerm"); value = eco_config_option_list_add(cfg_screen, "opacity_values"); value->intValue = 100; e_widget_slider_value_int_set(o_opacity, value->intValue); e_widget_disabled_set(o_opacity, 0); e_widget_ilist_selected_set(o_matches, e_widget_ilist_count(o_matches)); }
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; }
/* Page creation functions */ static void eco_config_animation_page(void *data) { int val = 0; int max = 6; selected = -1; ECO_PAGE_BEGIN("animation"); ECO_PAGE_TABLE(_("Window Match")); ECO_CREATE_LIST_MATCH(0, str_matches, 0, 0); /* to remember previously selected item */ if (e_widget_ilist_count(o_matches) > 0) selected = 0; ECO_PAGE_TABLE_END; ECO_PAGE_TABLE(_("Animation duration")); o = e_widget_label_add(cfdata->evas, _("Duration")); e_widget_frametable_object_append(ta, o, 0, 0, 1, 1, 1, 0, 0, 0); o_duration = e_widget_slider_add(cfdata->evas, 1, 0, "%1.0f ms", 50, 2000, 1.0, 0, NULL, &duration, 0); e_widget_disabled_set(o_duration, 1); \ e_widget_frametable_object_append(ta, o_duration, 1, 0, 1, 1, 1, 0, 1, 0); opt = eco_config_option_list_nth(cfg_screen, str_durations, 0); if (opt) { e_widget_slider_value_int_set(o_duration, opt->intValue); e_widget_disabled_set(o_duration, 0); } ECO_PAGE_TABLE_END; ECO_PAGE_TABLE( _("Animation for selected match")); opt = eco_config_option_list_nth(cfg_screen, str_effects, 0); if (opt) effect = opt->intValue; group = e_widget_radio_group_new(&effect); for (i = 0; i < effect_cnt; i++) { o_effect[i] = e_widget_radio_add(cfdata->evas, effect_names[i], i, group); e_widget_frametable_object_append(ta, o_effect[i], (i/max), (i%max), 1, 1, 1, 0, 1, 0); if (effect == i) e_widget_radio_toggle_set(o_effect[i], 1); } ECO_PAGE_TABLE_END; ECO_PAGE_TABLE( _("Animation random pool")); opt = eco_config_option_get(cfg_screen, str_randoms); for (i = 0; i < effect_cnt; i++) random_effect[i] = 0; for (l = opt->listValue; l; l = l->next) { item = l->data; random_effect[item->intValue] = 1; } for (i = 0; i < effect_cnt; i++) { o = e_widget_check_add(cfdata->evas, effect_names[i], &random_effect[i]); e_widget_frametable_object_append(ta, o, (i/max), (i%max), 1, 1, 1, 0, 1, 0); } ECO_PAGE_TABLE_END; ECO_PAGE_END; }
/* * Load the data for the XPlanet tab. * Currently there's only one config allowed, but this will * be increased in future. */ static void _populate_xplanet_page(E_Config_Dialog_Data *cfdata, int config_index) { Xplanet_Config *xplanet_config; char text_value[256]; xplanet_config = eina_list_nth(eplanet_conf->xplanet_configs, config_index); if (xplanet_config) { cfdata->local_xplanet.body = xplanet_config->body; cfdata->local_xplanet.origin = xplanet_config->origin; cfdata->local_xplanet.source_type = xplanet_config->source_type; cfdata->local_xplanet.projection = xplanet_config->projection; cfdata->local_xplanet.viewpos_type = xplanet_config->viewpos_type; cfdata->local_xplanet.viewpos_lat = xplanet_config->viewpos_lat; cfdata->local_xplanet.viewpos_lon = xplanet_config->viewpos_lon; cfdata->local_xplanet.use_localtime = xplanet_config->use_localtime; cfdata->local_xplanet.localtime = xplanet_config->localtime; cfdata->local_xplanet.viewpos_file = xplanet_config->viewpos_file; cfdata->local_xplanet.show_label = xplanet_config->show_label; cfdata->local_xplanet.label_text = xplanet_config->label_text; cfdata->local_xplanet.label_time = xplanet_config->label_time; cfdata->local_xplanet.label_pos = xplanet_config->label_pos; cfdata->local_xplanet.label_pos_other = xplanet_config->label_pos_other; cfdata->local_xplanet.use_config = xplanet_config->use_config; cfdata->local_xplanet.config_name = xplanet_config->config_name; cfdata->local_xplanet.extra_options = xplanet_config->extra_options; if (cfdata->local_xplanet.localtime > 23) cfdata->local_xplanet.localtime = 12; _fill_planet_ilist(cfdata->gui.o_body_ilist, cfdata->local_xplanet.body, _cb_target, cfdata, &(cfdata->body_item)); if (cfdata->local_xplanet.source_type == SOURCE_ORIGIN) { _fill_planet_ilist(cfdata->gui.o_source_ilist, cfdata->local_xplanet.origin, _cb_source, cfdata, &(cfdata->source_item)); e_widget_radio_toggle_set(cfdata->gui.o_origin_toggle, 1); e_widget_radio_toggle_set(cfdata->gui.o_projection_toggle, 0); } else { _fill_projection_ilist(cfdata->gui.o_source_ilist, cfdata->local_xplanet.projection, cfdata, &(cfdata->source_item)); e_widget_radio_toggle_set(cfdata->gui.o_origin_toggle, 0); e_widget_radio_toggle_set(cfdata->gui.o_projection_toggle, 1); } e_widget_radio_toggle_set(cfdata->gui.o_viewpos_latlon, (cfdata->local_xplanet.viewpos_type == VIEWPOS_LATLON)); e_widget_radio_toggle_set(cfdata->gui.o_viewpos_random, (cfdata->local_xplanet.viewpos_type == VIEWPOS_RANDOM)); e_widget_radio_toggle_set(cfdata->gui.o_viewpos_file, (cfdata->local_xplanet.viewpos_type == VIEWPOS_FILE)); sprintf(text_value, "%1g", cfdata->local_xplanet.viewpos_lat); e_widget_entry_text_set(cfdata->gui.o_viewpos_lat, text_value); sprintf(text_value, "%1g", cfdata->local_xplanet.viewpos_lon); e_widget_entry_text_set(cfdata->gui.o_viewpos_lon, text_value); sprintf(text_value, "%s", cfdata->local_xplanet.viewpos_file); e_widget_entry_text_set(cfdata->gui.o_viewpos_file_val, text_value); e_widget_check_checked_set(cfdata->gui.o_use_localtime, cfdata->local_xplanet.use_localtime); e_widget_slider_value_int_set(cfdata->gui.o_localtime, cfdata->local_xplanet.localtime); cfdata->gui.show_label = cfdata->local_xplanet.show_label; e_widget_check_checked_set(cfdata->gui.o_show_label, cfdata->gui.show_label); if (cfdata->local_xplanet.label_text) sprintf(text_value, "%s", cfdata->local_xplanet.label_text); else sprintf(text_value, "%s", ""); e_widget_entry_text_set(cfdata->gui.o_label_text, text_value); e_widget_radio_toggle_set(cfdata->gui.o_label_time_local_toggle, (cfdata->local_xplanet.label_time == LABEL_TIME_LOCAL)); e_widget_radio_toggle_set(cfdata->gui.o_label_time_gmt_toggle, (cfdata->local_xplanet.label_time == LABEL_TIME_GMT)); e_widget_radio_toggle_set(cfdata->gui.o_label_pos_tl_toggle, (cfdata->local_xplanet.label_pos == LABEL_POS_TL)); e_widget_radio_toggle_set(cfdata->gui.o_label_pos_tr_toggle, (cfdata->local_xplanet.label_pos == LABEL_POS_TR)); e_widget_radio_toggle_set(cfdata->gui.o_label_pos_bl_toggle, (cfdata->local_xplanet.label_pos == LABEL_POS_BL)); e_widget_radio_toggle_set(cfdata->gui.o_label_pos_br_toggle, (cfdata->local_xplanet.label_pos == LABEL_POS_BR)); e_widget_radio_toggle_set(cfdata->gui.o_label_pos_other_toggle, (cfdata->local_xplanet.label_pos == LABEL_POS_OTHER)); if (cfdata->local_xplanet.label_pos_other) sprintf(text_value, "%s", cfdata->local_xplanet.label_pos_other); else sprintf(text_value, "%s", ""); e_widget_entry_text_set(cfdata->gui.o_label_pos_other_text, text_value); e_widget_check_checked_set(cfdata->gui.o_config_check, cfdata->local_xplanet.use_config); if (cfdata->local_xplanet.config_name) sprintf(text_value, "%s", cfdata->local_xplanet.config_name); else sprintf(text_value, "%s", ""); e_widget_entry_text_set(cfdata->gui.o_config_name, text_value); if (cfdata->local_xplanet.extra_options) sprintf(text_value, "%s", cfdata->local_xplanet.extra_options); else sprintf(text_value, "%s", ""); e_widget_entry_text_set(cfdata->gui.o_extra_options, text_value); _cb_source_type(cfdata, NULL, NULL); _cb_show_label(cfdata, NULL, NULL); _cb_label_pos(cfdata, NULL, NULL); _cb_set_localtime(cfdata, NULL, NULL); } }