Mercurial > audlegacy-plugins
diff src/sid/xs_about.c @ 735:6c3c7b841382 trunk
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
author | nenolod |
---|---|
date | Tue, 27 Feb 2007 01:40:23 -0800 |
parents | 3da1b8942b8b |
children | e566e18e9e3d |
line wrap: on
line diff
--- a/src/sid/xs_about.c Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_about.c Tue Feb 27 01:40:23 2007 -0800 @@ -4,7 +4,7 @@ Aboutbox dialog Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> - (C) Copyright 1999-2005 Tecnic Software productions (TNSP) + (C) Copyright 1999-2007 Tecnic Software productions (TNSP) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,9 +16,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "xmms-sid.h" #include <gtk/gtk.h> @@ -28,6 +28,29 @@ static GtkWidget *xs_aboutwin = NULL; +#ifdef HAVE_THEMETUNE +#include <xmms/xmmsctrl.h> + +/* (Included only if themetune support is enabled) + * Stop playing, add XMMS-SID themetune to playlist + * and start playing it. + */ +gint xs_about_theme(void) +{ + const gint iSession = 0; /* Assume session 0 */ + gint iPos; + + /* Stop current song, add theme to playlist, play. */ + xmms_remote_stop(iSession); + iPos = xmms_remote_get_playlist_length(iSession); + xmms_remote_playlist_add_url_string(iSession, THEMETUNE_FILE); + xmms_remote_set_playlist_pos(iSession, iPos); + xmms_remote_play(iSession); + return 0; +} +#endif + + gint xs_about_ok(void) { gtk_widget_destroy(xs_aboutwin); @@ -57,44 +80,53 @@ } /* No, create one ... */ - xs_aboutwin = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_type_hint (GTK_WINDOW(xs_aboutwin), GDK_WINDOW_TYPE_HINT_DIALOG); + xs_aboutwin = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_type_hint(GTK_WINDOW(xs_aboutwin), GDK_WINDOW_TYPE_HINT_DIALOG); gtk_widget_set_name(xs_aboutwin, "xs_aboutwin"); - g_object_set_data(G_OBJECT(xs_aboutwin), "xs_aboutwin", xs_aboutwin); - gtk_window_set_title(GTK_WINDOW(xs_aboutwin), "About " PACKAGE_STRING); + gtk_object_set_data(GTK_OBJECT(xs_aboutwin), "xs_aboutwin", xs_aboutwin); + gtk_window_set_title(GTK_WINDOW(xs_aboutwin), "About " XS_PACKAGE_STRING); gtk_window_set_default_size(GTK_WINDOW(xs_aboutwin), 300, -1); about_vbox1 = gtk_vbox_new(FALSE, 0); gtk_widget_set_name(about_vbox1, "about_vbox1"); gtk_widget_ref(about_vbox1); - g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_vbox1", about_vbox1, + gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_vbox1", about_vbox1, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(about_vbox1); gtk_container_add(GTK_CONTAINER(xs_aboutwin), about_vbox1); +#ifdef HAVE_THEMETUNE + about_frame = gtk_button_new(); +#else about_frame = gtk_frame_new(NULL); +#endif gtk_widget_set_name(about_frame, "about_frame"); gtk_widget_ref(about_frame); - g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_frame", about_frame, + gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_frame", about_frame, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(about_frame); gtk_box_pack_start(GTK_BOX(about_vbox1), about_frame, FALSE, FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(about_frame), 4); +#ifdef HAVE_THEMETUNE + gtk_signal_connect(GTK_OBJECT(about_frame), "clicked", GTK_SIGNAL_FUNC(xs_about_theme), NULL); +#else gtk_frame_set_shadow_type(GTK_FRAME(about_frame), GTK_SHADOW_OUT); +#endif /* Create the Gdk data for logo pixmap */ gtk_widget_realize(xs_aboutwin); - about_logo_pixmap = gdk_pixmap_create_from_xpm_d(xs_aboutwin->window, - &about_logo_mask, NULL, (gchar **) xmms_sid_logo_xpm); + about_logo_pixmap = gdk_pixmap_create_from_xpm_d( + xs_aboutwin->window, &about_logo_mask, + NULL, (gchar **) xmms_sid_logo_xpm); about_logo = gtk_pixmap_new(about_logo_pixmap, about_logo_mask); /* Create logo widget */ gtk_widget_set_name(about_logo, "about_logo"); gtk_widget_ref(about_logo); - g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_logo", about_logo, - (GtkDestroyNotify) gtk_widget_unref); + gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_logo", about_logo, + (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(about_logo); gtk_container_add(GTK_CONTAINER(about_frame), about_logo); gtk_misc_set_padding(GTK_MISC(about_logo), 0, 6); @@ -102,37 +134,47 @@ about_scrwin = gtk_scrolled_window_new(NULL, NULL); gtk_widget_set_name(about_scrwin, "about_scrwin"); gtk_widget_ref(about_scrwin); - g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_scrwin", about_scrwin, - (GtkDestroyNotify) gtk_widget_unref); + gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_scrwin", about_scrwin, + (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(about_scrwin); gtk_box_pack_start(GTK_BOX(about_vbox1), about_scrwin, TRUE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(about_scrwin), 8); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(about_scrwin), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(about_scrwin), + GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); about_text = gtk_text_view_new(); gtk_widget_set_name(about_text, "about_text"); gtk_widget_ref(about_text); - g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_text", about_text, - (GtkDestroyNotify) gtk_widget_unref); + gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_text", about_text, + (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(about_text); gtk_container_add(GTK_CONTAINER(about_scrwin), about_text); gtk_widget_set_usize(about_text, -2, 100); - gtk_text_buffer_set_text( GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(about_text))), + gtk_text_buffer_set_text( + GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(about_text))), "\n" - "(C) Copyright 1999-2005\n" + "(C) Copyright 1999-2007\n" "\tTecnic Software productions (TNSP)\n" - "\n" "Programming and design\n" "\tMatti 'ccr' H\303\244m\303\244l\303\244inen\n" "\n" + "\n" + "Programming and design\n" + "\tMatti 'ccr' Hämäläinen\n" "\n" #ifdef HAVE_SIDPLAY1 - "libSIDPlay1 created by\n" "\tMichael Schwendt\n" "\n" + "libSIDPlay1 created by\n" + "\tMichael Schwendt\n" "\n" #endif #ifdef HAVE_SIDPLAY2 "libSIDPlay2 and reSID created by\n" - "\tSimon White, Dag Lem,\n" "\tMichael Schwendt and rest.\n" "\n" + "\tSimon White, Dag Lem,\n" + "\tMichael Schwendt and rest.\n" "\n" #endif - "BMP-SID and Audacious port written by\n" - "\tGiacomo Lozito from develia.org\n" - "\n" +#ifdef HAVE_THEMETUNE + "\"Kummatti City\", theme of XMMS-SID 0.8\n" + "\tby Ari 'Agemixer' Yliaho\n" + "\t(C) Copyright 1998 Scallop\n" + "\t(Refer to README for license)\n" "\n" +#endif "Original XMMS-SID (v0.4) by\n" "\tWillem Monsuwe\n" "\n" + "Greetings fly out to ...\n" "\tEveryone at #Linux.Fi, #Fireball,\n" "\t#TNSP and #c-64 of IRCNet, #xmms\n" @@ -141,17 +183,20 @@ "\tDekadence, PWP, Byterapers,\n" "\tmfx, Unique, Fairlight, iSO,\n" "\tWrath Designs, Padua, Extend,\n" - "\tPHn, Creators, Cosine, tAAt,\n" "\tViruz, Crest and Skalaria.\n" "\n" + "\tPHn, Creators, Cosine, tAAt,\n" + "\tViruz, Crest and Skalaria.\n" "\n" + "Special thanks\n" "\tGerfried 'Alfie' Fuchs\n" - "\tAndreas 'mrsid' Varga\n" "\tAll the betatesters.\n" "\tAll the users!\n", - -1); + "\tAndreas 'mrsid' Varga\n" + "\tAll the betatesters.\n" + "\tAll the users!\n", -1); alignment6 = gtk_alignment_new(0.5, 0.5, 0.18, 1); gtk_widget_set_name(alignment6, "alignment6"); gtk_widget_ref(alignment6); - g_object_set_data_full(G_OBJECT(xs_aboutwin), "alignment6", alignment6, - (GtkDestroyNotify) gtk_widget_unref); + gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "alignment6", alignment6, + (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(alignment6); gtk_box_pack_start(GTK_BOX(about_vbox1), alignment6, FALSE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(alignment6), 8); @@ -159,13 +204,14 @@ about_close = gtk_button_new_with_label("Close"); gtk_widget_set_name(about_close, "about_close"); gtk_widget_ref(about_close); - g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_close", about_close, - (GtkDestroyNotify) gtk_widget_unref); + gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_close", about_close, + (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(about_close); gtk_container_add(GTK_CONTAINER(alignment6), about_close); GTK_WIDGET_SET_FLAGS(about_close, GTK_CAN_DEFAULT); - gtk_signal_connect(GTK_OBJECT(about_close), "clicked", GTK_SIGNAL_FUNC(xs_about_ok), NULL); + gtk_signal_connect(GTK_OBJECT(about_close), "clicked", + GTK_SIGNAL_FUNC(xs_about_ok), NULL); gtk_widget_show(xs_aboutwin); }