269
|
1 /*
|
|
2 xmms-sid - SIDPlay input plugin for X MultiMedia System (XMMS)
|
|
3
|
|
4 Aboutbox dialog
|
|
5
|
|
6 Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org>
|
|
7 (C) Copyright 1999-2005 Tecnic Software productions (TNSP)
|
|
8
|
|
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
|
|
11 the Free Software Foundation; either version 2 of the License, or
|
|
12 (at your option) any later version.
|
|
13
|
|
14 This program is distributed in the hope that it will be useful,
|
|
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17 GNU General Public License for more details.
|
|
18
|
|
19 You should have received a copy of the GNU General Public License
|
|
20 along with this program; if not, write to the Free Software
|
|
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
22 */
|
|
23 #include "xmms-sid.h"
|
|
24 #include <gtk/gtk.h>
|
|
25 #include "xmms-sid-logo.xpm"
|
|
26
|
|
27
|
|
28 static GtkWidget *xs_aboutwin = NULL;
|
|
29
|
|
30
|
|
31 gint xs_about_ok(void)
|
|
32 {
|
|
33 gtk_widget_destroy(xs_aboutwin);
|
|
34 xs_aboutwin = NULL;
|
|
35 return 0;
|
|
36 }
|
|
37
|
|
38
|
|
39 /*
|
|
40 * Execute the about dialog
|
|
41 */
|
|
42 void xs_about(void)
|
|
43 {
|
|
44 GtkWidget *about_vbox1;
|
|
45 GtkWidget *about_frame;
|
|
46 GtkWidget *about_logo;
|
|
47 GdkPixmap *about_logo_pixmap = NULL, *about_logo_mask = NULL;
|
|
48 GtkWidget *about_scrwin;
|
|
49 GtkWidget *about_text;
|
|
50 GtkWidget *alignment6;
|
|
51 GtkWidget *about_close;
|
|
52
|
|
53 /* Check if there already is an open about window */
|
|
54 if (xs_aboutwin != NULL) {
|
|
55 gdk_window_raise(xs_aboutwin->window);
|
|
56 return;
|
|
57 }
|
|
58
|
|
59 /* No, create one ... */
|
|
60 xs_aboutwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
|
61 gtk_window_set_type_hint (GTK_WINDOW(xs_aboutwin), GDK_WINDOW_TYPE_HINT_DIALOG);
|
|
62 gtk_widget_set_name(xs_aboutwin, "xs_aboutwin");
|
|
63 gtk_object_set_data(GTK_OBJECT(xs_aboutwin), "xs_aboutwin", xs_aboutwin);
|
|
64 gtk_window_set_title(GTK_WINDOW(xs_aboutwin), "About " PACKAGE_STRING);
|
|
65 gtk_window_set_default_size(GTK_WINDOW(xs_aboutwin), 300, -1);
|
|
66
|
|
67 about_vbox1 = gtk_vbox_new(FALSE, 0);
|
|
68 gtk_widget_set_name(about_vbox1, "about_vbox1");
|
|
69 gtk_widget_ref(about_vbox1);
|
|
70 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_vbox1", about_vbox1,
|
|
71 (GtkDestroyNotify) gtk_widget_unref);
|
|
72 gtk_widget_show(about_vbox1);
|
|
73 gtk_container_add(GTK_CONTAINER(xs_aboutwin), about_vbox1);
|
|
74
|
|
75 about_frame = gtk_frame_new(NULL);
|
|
76 gtk_widget_set_name(about_frame, "about_frame");
|
|
77 gtk_widget_ref(about_frame);
|
|
78 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_frame", about_frame,
|
|
79 (GtkDestroyNotify) gtk_widget_unref);
|
|
80 gtk_widget_show(about_frame);
|
|
81 gtk_box_pack_start(GTK_BOX(about_vbox1), about_frame, FALSE, FALSE, 0);
|
|
82 gtk_container_set_border_width(GTK_CONTAINER(about_frame), 4);
|
|
83
|
|
84 gtk_frame_set_shadow_type(GTK_FRAME(about_frame), GTK_SHADOW_OUT);
|
|
85
|
|
86 /* Create the Gdk data for logo pixmap */
|
|
87 gtk_widget_realize(xs_aboutwin);
|
|
88 about_logo_pixmap = gdk_pixmap_create_from_xpm_d(xs_aboutwin->window,
|
|
89 &about_logo_mask, NULL, (gchar **) xmms_sid_logo_xpm);
|
|
90
|
|
91 about_logo = gtk_pixmap_new(about_logo_pixmap, about_logo_mask);
|
|
92
|
|
93 /* Create logo widget */
|
|
94 gtk_widget_set_name(about_logo, "about_logo");
|
|
95 gtk_widget_ref(about_logo);
|
|
96 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_logo", about_logo,
|
|
97 (GtkDestroyNotify) gtk_widget_unref);
|
|
98 gtk_widget_show(about_logo);
|
|
99 gtk_container_add(GTK_CONTAINER(about_frame), about_logo);
|
|
100 gtk_misc_set_padding(GTK_MISC(about_logo), 0, 6);
|
|
101
|
|
102 about_scrwin = gtk_scrolled_window_new(NULL, NULL);
|
|
103 gtk_widget_set_name(about_scrwin, "about_scrwin");
|
|
104 gtk_widget_ref(about_scrwin);
|
|
105 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_scrwin", about_scrwin,
|
|
106 (GtkDestroyNotify) gtk_widget_unref);
|
|
107 gtk_widget_show(about_scrwin);
|
|
108 gtk_box_pack_start(GTK_BOX(about_vbox1), about_scrwin, TRUE, TRUE, 0);
|
|
109 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);
|
|
111
|
|
112 about_text = gtk_text_view_new();
|
|
113 gtk_widget_set_name(about_text, "about_text");
|
|
114 gtk_widget_ref(about_text);
|
|
115 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_text", about_text,
|
|
116 (GtkDestroyNotify) gtk_widget_unref);
|
|
117 gtk_widget_show(about_text);
|
|
118 gtk_container_add(GTK_CONTAINER(about_scrwin), about_text);
|
|
119 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))), g_locale_to_utf8(
|
|
121 "\n"
|
|
122 "(C) Copyright 1999-2005\n"
|
|
123 "\tTecnic Software productions (TNSP)\n"
|
|
124 "\n" "Programming and design\n" "\tMatti 'ccr' Hämäläinen\n" "\n"
|
|
125 #ifdef HAVE_SIDPLAY1
|
|
126 "libSIDPlay1 created by\n" "\tMichael Schwendt\n" "\n"
|
|
127 #endif
|
|
128 #ifdef HAVE_SIDPLAY2
|
|
129 "libSIDPlay2 and reSID created by\n"
|
|
130 "\tSimon White, Dag Lem,\n" "\tMichael Schwendt and rest.\n" "\n"
|
|
131 #endif
|
|
132 "BMP-SID and Audacious port written by\n"
|
|
133 "\tGiacomo Lozito from develia.org\n"
|
|
134 "\n"
|
|
135 "Original XMMS-SID (v0.4) by\n" "\tWillem Monsuwe\n" "\n"
|
|
136 "Greetings fly out to ...\n"
|
|
137 "\tEveryone at #Linux.Fi, #Fireball,\n"
|
|
138 "\t#TNSP and #c-64 of IRCNet, #xmms\n"
|
|
139 "\tof Freenode.net.\n"
|
|
140 "\n"
|
|
141 "\tDekadence, PWP, Byterapers,\n"
|
|
142 "\tmfx, Unique, Fairlight, iSO,\n"
|
|
143 "\tWrath Designs, Padua, Extend,\n"
|
|
144 "\tPHn, Creators, Cosine, tAAt,\n" "\tViruz, Crest and Skalaria.\n" "\n"
|
|
145 "Special thanks\n"
|
|
146 "\tGerfried 'Alfie' Fuchs\n"
|
|
147 "\tAndreas 'mrsid' Varga\n" "\tAll the betatesters.\n" "\tAll the users!\n",
|
|
148 -1, NULL, NULL, NULL), -1);
|
|
149
|
|
150 alignment6 = gtk_alignment_new(0.5, 0.5, 0.18, 1);
|
|
151 gtk_widget_set_name(alignment6, "alignment6");
|
|
152 gtk_widget_ref(alignment6);
|
|
153 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "alignment6", alignment6,
|
|
154 (GtkDestroyNotify) gtk_widget_unref);
|
|
155 gtk_widget_show(alignment6);
|
|
156 gtk_box_pack_start(GTK_BOX(about_vbox1), alignment6, FALSE, TRUE, 0);
|
|
157 gtk_container_set_border_width(GTK_CONTAINER(alignment6), 8);
|
|
158
|
|
159 about_close = gtk_button_new_with_label("Close");
|
|
160 gtk_widget_set_name(about_close, "about_close");
|
|
161 gtk_widget_ref(about_close);
|
|
162 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_close", about_close,
|
|
163 (GtkDestroyNotify) gtk_widget_unref);
|
|
164 gtk_widget_show(about_close);
|
|
165 gtk_container_add(GTK_CONTAINER(alignment6), about_close);
|
|
166 GTK_WIDGET_SET_FLAGS(about_close, GTK_CAN_DEFAULT);
|
|
167
|
|
168 gtk_signal_connect(GTK_OBJECT(about_close), "clicked", GTK_SIGNAL_FUNC(xs_about_ok), NULL);
|
|
169
|
|
170 gtk_widget_show(xs_aboutwin);
|
|
171 }
|