Mercurial > audlegacy-plugins
comparison 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 |
comparison
equal
deleted
inserted
replaced
734:ff62f5530a36 | 735:6c3c7b841382 |
---|---|
2 xmms-sid - SIDPlay input plugin for X MultiMedia System (XMMS) | 2 xmms-sid - SIDPlay input plugin for X MultiMedia System (XMMS) |
3 | 3 |
4 Aboutbox dialog | 4 Aboutbox dialog |
5 | 5 |
6 Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> | 6 Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> |
7 (C) Copyright 1999-2005 Tecnic Software productions (TNSP) | 7 (C) Copyright 1999-2007 Tecnic Software productions (TNSP) |
8 | 8 |
9 This program is free software; you can redistribute it and/or modify | 9 This program is free software; you can redistribute it and/or modify |
10 it under the terms of the GNU General Public License as published by | 10 it under the terms of the GNU General Public License as published by |
11 the Free Software Foundation; either version 2 of the License, or | 11 the Free Software Foundation; either version 2 of the License, or |
12 (at your option) any later version. | 12 (at your option) any later version. |
14 This program is distributed in the hope that it will be useful, | 14 This program is distributed in the hope that it will be useful, |
15 but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 GNU General Public License for more details. | 17 GNU General Public License for more details. |
18 | 18 |
19 You should have received a copy of the GNU General Public License | 19 You should have received a copy of the GNU General Public License along |
20 along with this program; if not, write to the Free Software | 20 with this program; if not, write to the Free Software Foundation, Inc., |
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
22 */ | 22 */ |
23 #include "xmms-sid.h" | 23 #include "xmms-sid.h" |
24 #include <gtk/gtk.h> | 24 #include <gtk/gtk.h> |
25 #include "xmms-sid-logo.xpm" | 25 #include "xmms-sid-logo.xpm" |
26 | 26 |
27 | 27 |
28 static GtkWidget *xs_aboutwin = NULL; | 28 static GtkWidget *xs_aboutwin = NULL; |
29 | |
30 | |
31 #ifdef HAVE_THEMETUNE | |
32 #include <xmms/xmmsctrl.h> | |
33 | |
34 /* (Included only if themetune support is enabled) | |
35 * Stop playing, add XMMS-SID themetune to playlist | |
36 * and start playing it. | |
37 */ | |
38 gint xs_about_theme(void) | |
39 { | |
40 const gint iSession = 0; /* Assume session 0 */ | |
41 gint iPos; | |
42 | |
43 /* Stop current song, add theme to playlist, play. */ | |
44 xmms_remote_stop(iSession); | |
45 iPos = xmms_remote_get_playlist_length(iSession); | |
46 xmms_remote_playlist_add_url_string(iSession, THEMETUNE_FILE); | |
47 xmms_remote_set_playlist_pos(iSession, iPos); | |
48 xmms_remote_play(iSession); | |
49 return 0; | |
50 } | |
51 #endif | |
29 | 52 |
30 | 53 |
31 gint xs_about_ok(void) | 54 gint xs_about_ok(void) |
32 { | 55 { |
33 gtk_widget_destroy(xs_aboutwin); | 56 gtk_widget_destroy(xs_aboutwin); |
55 gdk_window_raise(xs_aboutwin->window); | 78 gdk_window_raise(xs_aboutwin->window); |
56 return; | 79 return; |
57 } | 80 } |
58 | 81 |
59 /* No, create one ... */ | 82 /* No, create one ... */ |
60 xs_aboutwin = gtk_window_new (GTK_WINDOW_TOPLEVEL); | 83 xs_aboutwin = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
61 gtk_window_set_type_hint (GTK_WINDOW(xs_aboutwin), GDK_WINDOW_TYPE_HINT_DIALOG); | 84 gtk_window_set_type_hint(GTK_WINDOW(xs_aboutwin), GDK_WINDOW_TYPE_HINT_DIALOG); |
62 gtk_widget_set_name(xs_aboutwin, "xs_aboutwin"); | 85 gtk_widget_set_name(xs_aboutwin, "xs_aboutwin"); |
63 g_object_set_data(G_OBJECT(xs_aboutwin), "xs_aboutwin", xs_aboutwin); | 86 gtk_object_set_data(GTK_OBJECT(xs_aboutwin), "xs_aboutwin", xs_aboutwin); |
64 gtk_window_set_title(GTK_WINDOW(xs_aboutwin), "About " PACKAGE_STRING); | 87 gtk_window_set_title(GTK_WINDOW(xs_aboutwin), "About " XS_PACKAGE_STRING); |
65 gtk_window_set_default_size(GTK_WINDOW(xs_aboutwin), 300, -1); | 88 gtk_window_set_default_size(GTK_WINDOW(xs_aboutwin), 300, -1); |
66 | 89 |
67 about_vbox1 = gtk_vbox_new(FALSE, 0); | 90 about_vbox1 = gtk_vbox_new(FALSE, 0); |
68 gtk_widget_set_name(about_vbox1, "about_vbox1"); | 91 gtk_widget_set_name(about_vbox1, "about_vbox1"); |
69 gtk_widget_ref(about_vbox1); | 92 gtk_widget_ref(about_vbox1); |
70 g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_vbox1", about_vbox1, | 93 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_vbox1", about_vbox1, |
71 (GtkDestroyNotify) gtk_widget_unref); | 94 (GtkDestroyNotify) gtk_widget_unref); |
72 gtk_widget_show(about_vbox1); | 95 gtk_widget_show(about_vbox1); |
73 gtk_container_add(GTK_CONTAINER(xs_aboutwin), about_vbox1); | 96 gtk_container_add(GTK_CONTAINER(xs_aboutwin), about_vbox1); |
74 | 97 |
98 #ifdef HAVE_THEMETUNE | |
99 about_frame = gtk_button_new(); | |
100 #else | |
75 about_frame = gtk_frame_new(NULL); | 101 about_frame = gtk_frame_new(NULL); |
102 #endif | |
76 gtk_widget_set_name(about_frame, "about_frame"); | 103 gtk_widget_set_name(about_frame, "about_frame"); |
77 gtk_widget_ref(about_frame); | 104 gtk_widget_ref(about_frame); |
78 g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_frame", about_frame, | 105 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_frame", about_frame, |
79 (GtkDestroyNotify) gtk_widget_unref); | 106 (GtkDestroyNotify) gtk_widget_unref); |
80 gtk_widget_show(about_frame); | 107 gtk_widget_show(about_frame); |
81 gtk_box_pack_start(GTK_BOX(about_vbox1), about_frame, FALSE, FALSE, 0); | 108 gtk_box_pack_start(GTK_BOX(about_vbox1), about_frame, FALSE, FALSE, 0); |
82 gtk_container_set_border_width(GTK_CONTAINER(about_frame), 4); | 109 gtk_container_set_border_width(GTK_CONTAINER(about_frame), 4); |
83 | 110 |
111 #ifdef HAVE_THEMETUNE | |
112 gtk_signal_connect(GTK_OBJECT(about_frame), "clicked", GTK_SIGNAL_FUNC(xs_about_theme), NULL); | |
113 #else | |
84 gtk_frame_set_shadow_type(GTK_FRAME(about_frame), GTK_SHADOW_OUT); | 114 gtk_frame_set_shadow_type(GTK_FRAME(about_frame), GTK_SHADOW_OUT); |
115 #endif | |
85 | 116 |
86 /* Create the Gdk data for logo pixmap */ | 117 /* Create the Gdk data for logo pixmap */ |
87 gtk_widget_realize(xs_aboutwin); | 118 gtk_widget_realize(xs_aboutwin); |
88 about_logo_pixmap = gdk_pixmap_create_from_xpm_d(xs_aboutwin->window, | 119 about_logo_pixmap = gdk_pixmap_create_from_xpm_d( |
89 &about_logo_mask, NULL, (gchar **) xmms_sid_logo_xpm); | 120 xs_aboutwin->window, &about_logo_mask, |
121 NULL, (gchar **) xmms_sid_logo_xpm); | |
90 | 122 |
91 about_logo = gtk_pixmap_new(about_logo_pixmap, about_logo_mask); | 123 about_logo = gtk_pixmap_new(about_logo_pixmap, about_logo_mask); |
92 | 124 |
93 /* Create logo widget */ | 125 /* Create logo widget */ |
94 gtk_widget_set_name(about_logo, "about_logo"); | 126 gtk_widget_set_name(about_logo, "about_logo"); |
95 gtk_widget_ref(about_logo); | 127 gtk_widget_ref(about_logo); |
96 g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_logo", about_logo, | 128 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_logo", about_logo, |
97 (GtkDestroyNotify) gtk_widget_unref); | 129 (GtkDestroyNotify) gtk_widget_unref); |
98 gtk_widget_show(about_logo); | 130 gtk_widget_show(about_logo); |
99 gtk_container_add(GTK_CONTAINER(about_frame), about_logo); | 131 gtk_container_add(GTK_CONTAINER(about_frame), about_logo); |
100 gtk_misc_set_padding(GTK_MISC(about_logo), 0, 6); | 132 gtk_misc_set_padding(GTK_MISC(about_logo), 0, 6); |
101 | 133 |
102 about_scrwin = gtk_scrolled_window_new(NULL, NULL); | 134 about_scrwin = gtk_scrolled_window_new(NULL, NULL); |
103 gtk_widget_set_name(about_scrwin, "about_scrwin"); | 135 gtk_widget_set_name(about_scrwin, "about_scrwin"); |
104 gtk_widget_ref(about_scrwin); | 136 gtk_widget_ref(about_scrwin); |
105 g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_scrwin", about_scrwin, | 137 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_scrwin", about_scrwin, |
106 (GtkDestroyNotify) gtk_widget_unref); | 138 (GtkDestroyNotify) gtk_widget_unref); |
107 gtk_widget_show(about_scrwin); | 139 gtk_widget_show(about_scrwin); |
108 gtk_box_pack_start(GTK_BOX(about_vbox1), about_scrwin, TRUE, TRUE, 0); | 140 gtk_box_pack_start(GTK_BOX(about_vbox1), about_scrwin, TRUE, TRUE, 0); |
109 gtk_container_set_border_width(GTK_CONTAINER(about_scrwin), 8); | 141 gtk_container_set_border_width(GTK_CONTAINER(about_scrwin), 8); |
110 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(about_scrwin), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | 142 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(about_scrwin), |
143 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
111 | 144 |
112 about_text = gtk_text_view_new(); | 145 about_text = gtk_text_view_new(); |
113 gtk_widget_set_name(about_text, "about_text"); | 146 gtk_widget_set_name(about_text, "about_text"); |
114 gtk_widget_ref(about_text); | 147 gtk_widget_ref(about_text); |
115 g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_text", about_text, | 148 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_text", about_text, |
116 (GtkDestroyNotify) gtk_widget_unref); | 149 (GtkDestroyNotify) gtk_widget_unref); |
117 gtk_widget_show(about_text); | 150 gtk_widget_show(about_text); |
118 gtk_container_add(GTK_CONTAINER(about_scrwin), about_text); | 151 gtk_container_add(GTK_CONTAINER(about_scrwin), about_text); |
119 gtk_widget_set_usize(about_text, -2, 100); | 152 gtk_widget_set_usize(about_text, -2, 100); |
120 gtk_text_buffer_set_text( GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(about_text))), | 153 gtk_text_buffer_set_text( |
154 GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(about_text))), | |
121 "\n" | 155 "\n" |
122 "(C) Copyright 1999-2005\n" | 156 "(C) Copyright 1999-2007\n" |
123 "\tTecnic Software productions (TNSP)\n" | 157 "\tTecnic Software productions (TNSP)\n" |
124 "\n" "Programming and design\n" "\tMatti 'ccr' H\303\244m\303\244l\303\244inen\n" "\n" | 158 "\n" |
159 "Programming and design\n" | |
160 "\tMatti 'ccr' Hämäläinen\n" "\n" | |
125 #ifdef HAVE_SIDPLAY1 | 161 #ifdef HAVE_SIDPLAY1 |
126 "libSIDPlay1 created by\n" "\tMichael Schwendt\n" "\n" | 162 "libSIDPlay1 created by\n" |
163 "\tMichael Schwendt\n" "\n" | |
127 #endif | 164 #endif |
128 #ifdef HAVE_SIDPLAY2 | 165 #ifdef HAVE_SIDPLAY2 |
129 "libSIDPlay2 and reSID created by\n" | 166 "libSIDPlay2 and reSID created by\n" |
130 "\tSimon White, Dag Lem,\n" "\tMichael Schwendt and rest.\n" "\n" | 167 "\tSimon White, Dag Lem,\n" |
131 #endif | 168 "\tMichael Schwendt and rest.\n" "\n" |
132 "BMP-SID and Audacious port written by\n" | 169 #endif |
133 "\tGiacomo Lozito from develia.org\n" | 170 #ifdef HAVE_THEMETUNE |
134 "\n" | 171 "\"Kummatti City\", theme of XMMS-SID 0.8\n" |
172 "\tby Ari 'Agemixer' Yliaho\n" | |
173 "\t(C) Copyright 1998 Scallop\n" | |
174 "\t(Refer to README for license)\n" "\n" | |
175 #endif | |
135 "Original XMMS-SID (v0.4) by\n" "\tWillem Monsuwe\n" "\n" | 176 "Original XMMS-SID (v0.4) by\n" "\tWillem Monsuwe\n" "\n" |
177 | |
136 "Greetings fly out to ...\n" | 178 "Greetings fly out to ...\n" |
137 "\tEveryone at #Linux.Fi, #Fireball,\n" | 179 "\tEveryone at #Linux.Fi, #Fireball,\n" |
138 "\t#TNSP and #c-64 of IRCNet, #xmms\n" | 180 "\t#TNSP and #c-64 of IRCNet, #xmms\n" |
139 "\tof Freenode.net.\n" | 181 "\tof Freenode.net.\n" |
140 "\n" | 182 "\n" |
141 "\tDekadence, PWP, Byterapers,\n" | 183 "\tDekadence, PWP, Byterapers,\n" |
142 "\tmfx, Unique, Fairlight, iSO,\n" | 184 "\tmfx, Unique, Fairlight, iSO,\n" |
143 "\tWrath Designs, Padua, Extend,\n" | 185 "\tWrath Designs, Padua, Extend,\n" |
144 "\tPHn, Creators, Cosine, tAAt,\n" "\tViruz, Crest and Skalaria.\n" "\n" | 186 "\tPHn, Creators, Cosine, tAAt,\n" |
187 "\tViruz, Crest and Skalaria.\n" "\n" | |
188 | |
145 "Special thanks\n" | 189 "Special thanks\n" |
146 "\tGerfried 'Alfie' Fuchs\n" | 190 "\tGerfried 'Alfie' Fuchs\n" |
147 "\tAndreas 'mrsid' Varga\n" "\tAll the betatesters.\n" "\tAll the users!\n", | 191 "\tAndreas 'mrsid' Varga\n" |
148 -1); | 192 "\tAll the betatesters.\n" |
193 "\tAll the users!\n", -1); | |
149 | 194 |
150 alignment6 = gtk_alignment_new(0.5, 0.5, 0.18, 1); | 195 alignment6 = gtk_alignment_new(0.5, 0.5, 0.18, 1); |
151 gtk_widget_set_name(alignment6, "alignment6"); | 196 gtk_widget_set_name(alignment6, "alignment6"); |
152 gtk_widget_ref(alignment6); | 197 gtk_widget_ref(alignment6); |
153 g_object_set_data_full(G_OBJECT(xs_aboutwin), "alignment6", alignment6, | 198 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "alignment6", alignment6, |
154 (GtkDestroyNotify) gtk_widget_unref); | 199 (GtkDestroyNotify) gtk_widget_unref); |
155 gtk_widget_show(alignment6); | 200 gtk_widget_show(alignment6); |
156 gtk_box_pack_start(GTK_BOX(about_vbox1), alignment6, FALSE, TRUE, 0); | 201 gtk_box_pack_start(GTK_BOX(about_vbox1), alignment6, FALSE, TRUE, 0); |
157 gtk_container_set_border_width(GTK_CONTAINER(alignment6), 8); | 202 gtk_container_set_border_width(GTK_CONTAINER(alignment6), 8); |
158 | 203 |
159 about_close = gtk_button_new_with_label("Close"); | 204 about_close = gtk_button_new_with_label("Close"); |
160 gtk_widget_set_name(about_close, "about_close"); | 205 gtk_widget_set_name(about_close, "about_close"); |
161 gtk_widget_ref(about_close); | 206 gtk_widget_ref(about_close); |
162 g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_close", about_close, | 207 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_close", about_close, |
163 (GtkDestroyNotify) gtk_widget_unref); | 208 (GtkDestroyNotify) gtk_widget_unref); |
164 gtk_widget_show(about_close); | 209 gtk_widget_show(about_close); |
165 gtk_container_add(GTK_CONTAINER(alignment6), about_close); | 210 gtk_container_add(GTK_CONTAINER(alignment6), about_close); |
166 GTK_WIDGET_SET_FLAGS(about_close, GTK_CAN_DEFAULT); | 211 GTK_WIDGET_SET_FLAGS(about_close, GTK_CAN_DEFAULT); |
167 | 212 |
168 gtk_signal_connect(GTK_OBJECT(about_close), "clicked", GTK_SIGNAL_FUNC(xs_about_ok), NULL); | 213 gtk_signal_connect(GTK_OBJECT(about_close), "clicked", |
214 GTK_SIGNAL_FUNC(xs_about_ok), NULL); | |
169 | 215 |
170 gtk_widget_show(xs_aboutwin); | 216 gtk_widget_show(xs_aboutwin); |
171 } | 217 } |