⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 options.c

📁 Aqualung is an advanced music player primarily targeted for the GNU/Linux operating system, but als
💻 C
📖 第 1 页 / 共 5 页
字号:
	if (rva_is_enabled_shadow) {		fg_color.red = 0;		fg_color.green = 0;		fg_color.blue = 65535;	} else {		fg_color.red = 0;		fg_color.green = 0;		fg_color.blue = 30000;	}	gdk_gc_set_rgb_fg_color(gc, &fg_color);	gdk_draw_line(rva_pixmap, gc, xoffs, yoffs + 24 * dh, xoffs + 24 * dw, yoffs);	if (rva_is_enabled_shadow) {		fg_color.red = 65535;		fg_color.green = 0;		fg_color.blue = 0;	} else {		fg_color.red = 30000;		fg_color.green = 0;		fg_color.blue = 0;	}	gdk_gc_set_rgb_fg_color(gc, &fg_color);	volx = -24.0f;	voly = volx + (volx - rva_refvol_shadow) * (rva_steepness_shadow - 1.0f);	px1 = xoffs;	py1 = yoffs - (voly * dh);	volx = 0.0f;	voly = volx + (volx - rva_refvol_shadow) * (rva_steepness_shadow - 1.0f);	px2 = xoffs + 24*dw;	py2 = yoffs - (voly * dh);	gdk_draw_line(rva_pixmap, gc, px1, py1, px2, py2);	gdk_draw_drawable(rva_drawing_area->window,			rva_drawing_area->style->fg_gc[GTK_WIDGET_STATE(rva_drawing_area)],			rva_pixmap,			0, 0, 0, 0,			width, height);	g_object_unref(gc);}voidrefvol_changed(GtkWidget * widget, gpointer * data) {	rva_refvol_shadow = gtk_adjustment_get_value(GTK_ADJUSTMENT(widget));	draw_rva_diagram();}voidsteepness_changed(GtkWidget * widget, gpointer * data) {	rva_steepness_shadow = gtk_adjustment_get_value(GTK_ADJUSTMENT(widget));	draw_rva_diagram();}static gintrva_configure_event(GtkWidget * widget, GdkEventConfigure * event) {	if (rva_pixmap)		g_object_unref(rva_pixmap);	rva_pixmap = gdk_pixmap_new(widget->window,				    widget->allocation.width,				    widget->allocation.height,				    -1);	gdk_draw_rectangle(rva_pixmap,			   widget->style->black_gc,			   TRUE,			   0, 0,			   widget->allocation.width,			   widget->allocation.height);	draw_rva_diagram();	return TRUE;}static gintrva_expose_event(GtkWidget * widget, GdkEventExpose * event) {	gdk_draw_drawable(widget->window,			widget->style->fg_gc[GTK_WIDGET_STATE (widget)],			rva_pixmap,			event->area.x, event->area.y,			event->area.x, event->area.y,			event->area.width, event->area.height);	return FALSE;}voidchanged_threshold(GtkWidget * widget, gpointer * data) {	rva_use_linear_thresh_shadow =	        gtk_combo_box_get_active(GTK_COMBO_BOX(combo_threshold));}voidlinthresh_changed(GtkWidget * widget, gpointer * data) {	rva_avg_linear_thresh_shadow = gtk_adjustment_get_value(GTK_ADJUSTMENT(widget));}voidstdthresh_changed(GtkWidget * widget, gpointer * data) {	rva_avg_stddev_thresh_shadow = gtk_adjustment_get_value(GTK_ADJUSTMENT(widget)) / 100.0f;}voidshow_restart_info(void) {	GtkWidget * info_dialog;	GtkWidget * list;	GtkWidget * viewport;	GtkCellRenderer * renderer;	GtkTreeViewColumn * column;        info_dialog = gtk_message_dialog_new(GTK_WINDOW (options_window),					     GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,					     GTK_MESSAGE_INFO,					     GTK_BUTTONS_OK,					     _("You will need to restart Aqualung for the following changes to take effect:"));        list = gtk_tree_view_new_with_model(GTK_TREE_MODEL(restart_list_store));	renderer = gtk_cell_renderer_text_new();	column = gtk_tree_view_column_new_with_attributes("",							  renderer,							  "text", 0,							  NULL);	gtk_tree_view_append_column(GTK_TREE_VIEW(list), column);	gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(list), FALSE);	viewport = gtk_viewport_new(NULL, NULL);	gtk_container_add(GTK_CONTAINER(viewport), list);	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(info_dialog)->vbox), viewport, FALSE, FALSE, 6);	gtk_widget_show_all(info_dialog);        aqualung_dialog_run(GTK_DIALOG(info_dialog));        gtk_widget_destroy(info_dialog);}voidplaylist_font_select(GtkWidget *widget) {	gchar *s;	GtkWidget *font_selector;	gint response;	font_selector = gtk_font_selection_dialog_new ("Select a font...");	gtk_window_set_modal(GTK_WINDOW(font_selector), TRUE);	gtk_window_set_transient_for(GTK_WINDOW(font_selector), GTK_WINDOW(options_window));	gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG(font_selector), options.playlist_font);	gtk_widget_show (font_selector);	response = aqualung_dialog_run (GTK_DIALOG (font_selector));	if (response == GTK_RESPONSE_OK) {		s = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(font_selector));		strncpy(options.playlist_font, s, MAX_FONTNAME_LEN);		gtk_entry_set_text(GTK_ENTRY(entry_pl_font), s);		g_free (s);	}        appearance_changed = 1;	gtk_widget_destroy (font_selector);}voidbrowser_font_select(GtkWidget *widget) {	gchar *s;	GtkWidget *font_selector;	gint response;	font_selector = gtk_font_selection_dialog_new ("Select a font...");	gtk_window_set_modal(GTK_WINDOW(font_selector), TRUE);	gtk_window_set_transient_for(GTK_WINDOW(font_selector), GTK_WINDOW(options_window));	gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG(font_selector), options.browser_font);	gtk_widget_show (font_selector);	response = aqualung_dialog_run (GTK_DIALOG (font_selector));	if (response == GTK_RESPONSE_OK) {		s = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(font_selector));		strncpy(options.browser_font, s, MAX_FONTNAME_LEN);		gtk_entry_set_text(GTK_ENTRY(entry_ms_font), s);		g_free (s);	}        appearance_changed = 1;	gtk_widget_destroy (font_selector);}voidbigtimer_font_select(GtkWidget *widget) {	gchar *s;	GtkWidget *font_selector;	gint response;	font_selector = gtk_font_selection_dialog_new ("Select a font...");	gtk_window_set_modal(GTK_WINDOW(font_selector), TRUE);	gtk_window_set_transient_for(GTK_WINDOW(font_selector), GTK_WINDOW(options_window));	gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG(font_selector), options.bigtimer_font);	gtk_widget_show (font_selector);	response = aqualung_dialog_run (GTK_DIALOG (font_selector));	if (response == GTK_RESPONSE_OK) {		s = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(font_selector));		strncpy(options.bigtimer_font, s, MAX_FONTNAME_LEN);		gtk_entry_set_text(GTK_ENTRY(entry_bt_font), s);		g_free (s);	}        appearance_changed = 1;	gtk_widget_destroy (font_selector);}voidsmalltimer_font_select(GtkWidget *widget) {	gchar *s;	GtkWidget *font_selector;	gint response;	font_selector = gtk_font_selection_dialog_new ("Select a font...");	gtk_window_set_modal(GTK_WINDOW(font_selector), TRUE);	gtk_window_set_transient_for(GTK_WINDOW(font_selector), GTK_WINDOW(options_window));	gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG(font_selector), options.smalltimer_font);	gtk_widget_show (font_selector);	response = aqualung_dialog_run (GTK_DIALOG (font_selector));	if (response == GTK_RESPONSE_OK) {		s = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(font_selector));		strncpy(options.smalltimer_font, s, MAX_FONTNAME_LEN);		gtk_entry_set_text(GTK_ENTRY(entry_st_font), s);		g_free (s);	}        appearance_changed = 1;	gtk_widget_destroy (font_selector);}voidsongtitle_font_select(GtkWidget *widget) {	gchar *s;	GtkWidget *font_selector;	gint response;	font_selector = gtk_font_selection_dialog_new ("Select a font...");	gtk_window_set_modal(GTK_WINDOW(font_selector), TRUE);	gtk_window_set_transient_for(GTK_WINDOW(font_selector), GTK_WINDOW(options_window));	gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG(font_selector), options.songtitle_font);	gtk_widget_show (font_selector);	response = aqualung_dialog_run (GTK_DIALOG (font_selector));	if (response == GTK_RESPONSE_OK) {		s = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(font_selector));		strncpy(options.songtitle_font, s, MAX_FONTNAME_LEN);		gtk_entry_set_text(GTK_ENTRY(entry_songt_font), s);		g_free (s);	}        appearance_changed = 1;	gtk_widget_destroy (font_selector);}voidsonginfo_font_select(GtkWidget *widget) {	gchar *s;	GtkWidget *font_selector;	gint response;	font_selector = gtk_font_selection_dialog_new ("Select a font...");	gtk_window_set_modal(GTK_WINDOW(font_selector), TRUE);	gtk_window_set_transient_for(GTK_WINDOW(font_selector), GTK_WINDOW(options_window));	gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG(font_selector), options.songinfo_font);	gtk_widget_show (font_selector);	response = aqualung_dialog_run (GTK_DIALOG (font_selector));	if (response == GTK_RESPONSE_OK) {		s = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(font_selector));		strncpy(options.songinfo_font, s, MAX_FONTNAME_LEN);		gtk_entry_set_text(GTK_ENTRY(entry_si_font), s);		g_free (s);	}        appearance_changed = 1;	gtk_widget_destroy (font_selector);}voidstatusbar_font_select(GtkWidget *widget) {	gchar *s;	GtkWidget *font_selector;	gint response;	font_selector = gtk_font_selection_dialog_new ("Select a font...");	gtk_window_set_modal(GTK_WINDOW(font_selector), TRUE);	gtk_window_set_transient_for(GTK_WINDOW(font_selector), GTK_WINDOW(options_window));	gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG(font_selector), options.statusbar_font);	gtk_widget_show (font_selector);	response = aqualung_dialog_run (GTK_DIALOG (font_selector));	if (response == GTK_RESPONSE_OK) {		s = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(font_selector));		strncpy(options.statusbar_font, s, MAX_FONTNAME_LEN);		gtk_entry_set_text(GTK_ENTRY(entry_sb_font), s);		g_free (s);	}        appearance_changed = 1;	gtk_widget_destroy (font_selector);}voidrestart_active(GtkToggleButton * togglebutton, gpointer data) {	GtkTreeIter iter;	char * text;	int i = 0;        restart_flag = 1;        while (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(restart_list_store), &iter, NULL, i++)) {                gtk_tree_model_get(GTK_TREE_MODEL(restart_list_store), &iter, 0, &text, -1);                if (!strcmp(text, (char *)data)) {                        gtk_list_store_remove(restart_list_store, &iter);                        if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(restart_list_store), &iter)) {                                restart_flag = 0;                        }                        return;                }        }	gtk_list_store_append(restart_list_store, &iter);	gtk_list_store_set(restart_list_store, &iter, 0, (char *)data, -1);}voidset_sensitive_part(void) {	GtkWidget *sensitive_table[] = {		entry_ms_font, entry_pl_font, entry_bt_font, entry_st_font,		entry_songt_font, entry_si_font, entry_sb_font, button_ms_font,		button_pl_font, button_bt_font, button_st_font, button_songt_font,		button_si_font, button_sb_font, color_picker	};	gboolean state;        gint items, n;                if (options.override_skin_settings) {		state = TRUE;	} else {		state = FALSE;	}        items = sizeof(sensitive_table) / sizeof(GtkWidget*);        for (n = 0; n < items; n++) {                gtk_widget_set_sensitive(sensitive_table[n], state);        }}voidcb_toggle_override_skin(GtkToggleButton *togglebutton, gpointer user_data) {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -