1
|
1 /*
|
|
2 xmms-sid - SIDPlay input plugin for X MultiMedia System (XMMS)
|
|
3
|
|
4 Aboutbox dialog
|
|
5
|
|
6 Written by Matti "ccr" Hamalainen <mhamalai@ratol.fi>
|
|
7 (Created with Glade, the Gtk+ interface builder, but edited
|
|
8 by hand afterwards to make it work here)
|
|
9
|
|
10 This program is free software; you can redistribute it and/or modify
|
|
11 it under the terms of the GNU General Public License as published by
|
|
12 the Free Software Foundation; either version 2 of the License, or
|
|
13 (at your option) any later version.
|
|
14
|
|
15 This program is distributed in the hope that it will be useful,
|
|
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
18 GNU General Public License for more details.
|
|
19
|
|
20 You should have received a copy of the GNU General Public License
|
|
21 along with this program; if not, write to the Free Software
|
|
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
23 */
|
|
24
|
|
25 #include "xmms-sid.h"
|
|
26 #include <gtk/gtk.h>
|
|
27 #include "xmms-sid-logo.xpm"
|
|
28
|
|
29
|
|
30 static GtkWidget *xs_aboutwin = NULL;
|
|
31
|
|
32 int xs_aboutwin_ok(void)
|
|
33 {
|
|
34 gtk_widget_destroy(xs_aboutwin);
|
|
35 return 0;
|
|
36 }
|
|
37
|
|
38
|
|
39 /*
|
|
40 * Execute the aboutbox
|
|
41 */
|
|
42 void xs_aboutbox(void)
|
|
43 {
|
|
44 GtkWidget *vbox1, *hbox1, *frame1, *pixmapwid;
|
|
45 GtkWidget *label1, *hbuttonbox1, *about_ok;
|
|
46 GdkPixmap *pixmap;
|
|
47 GdkBitmap *pixmask;
|
|
48 GtkStyle *style;
|
|
49
|
|
50 /* Check if there already is an open about window */
|
|
51 if (xs_aboutwin != NULL) {
|
|
52 gdk_window_raise(xs_aboutwin->window);
|
|
53 return;
|
|
54 }
|
|
55
|
|
56 /* No, create one ... */
|
|
57 xs_aboutwin = gtk_dialog_new();
|
|
58 gtk_object_set_data(GTK_OBJECT(xs_aboutwin), "xs_aboutwin", xs_aboutwin);
|
|
59 gtk_window_set_title(GTK_WINDOW(xs_aboutwin), "About xmms-sid SIDPlay plugin");
|
|
60 gtk_window_set_policy(GTK_WINDOW(xs_aboutwin), FALSE, FALSE, FALSE);
|
|
61 gtk_window_set_position(GTK_WINDOW(xs_aboutwin), GTK_WIN_POS_MOUSE);
|
|
62 gtk_signal_connect(GTK_OBJECT(xs_aboutwin), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &xs_aboutwin);
|
|
63 gtk_container_border_width(GTK_CONTAINER(xs_aboutwin), 10);
|
|
64
|
|
65 vbox1 = GTK_DIALOG(xs_aboutwin)->vbox;
|
|
66 gtk_object_set_data(GTK_OBJECT(xs_aboutwin), "vbox1", vbox1);
|
|
67 gtk_widget_show(vbox1);
|
|
68 /* gtk_container_add(GTK_CONTAINER(xs_aboutwin), vbox1);
|
|
69 */
|
|
70 hbox1 = gtk_hbox_new(FALSE, 0);
|
|
71 gtk_object_set_data(GTK_OBJECT(xs_aboutwin), "hbox1", hbox1);
|
|
72 gtk_widget_show (hbox1);
|
|
73 gtk_box_pack_start(GTK_BOX(vbox1), hbox1, TRUE, TRUE, 0);
|
|
74
|
|
75 frame1 = gtk_frame_new (NULL);
|
|
76 gtk_object_set_data (GTK_OBJECT (xs_aboutwin), "frame1", frame1);
|
|
77 gtk_widget_show (frame1);
|
|
78 gtk_box_pack_start (GTK_BOX (hbox1), frame1, TRUE, TRUE, 0);
|
|
79 gtk_container_set_border_width (GTK_CONTAINER (frame1), 4);
|
|
80
|
|
81 gtk_widget_realize (xs_aboutwin);
|
|
82
|
|
83 /* The pixmap */
|
|
84 style = gtk_widget_get_style (xs_aboutwin);
|
|
85 pixmap = gdk_pixmap_create_from_xpm_d(xs_aboutwin->window, &pixmask,
|
|
86 &style->bg[GTK_STATE_NORMAL],
|
|
87 (gchar **) xmms_sid_logo_xpm);
|
|
88
|
|
89 pixmapwid = gtk_pixmap_new(pixmap, pixmask);
|
|
90 gtk_widget_show (pixmapwid);
|
|
91 gtk_container_add (GTK_CONTAINER (frame1), pixmapwid);
|
|
92 gtk_misc_set_padding (GTK_MISC (pixmapwid), 4, 4);
|
|
93
|
|
94 label1 = gtk_label_new (
|
|
95 "XMMS-SID SIDPlay plugin v" VERSION "\n"
|
|
96 "for X MultiMedia System\n"
|
|
97 "by Willem Monsuwe and\n"
|
|
98 "Matti \"ccr\" H\344m\344l\344inen\n\n"
|
|
99 "libSIDPlay by Michael Schwendt");
|
|
100
|
|
101 gtk_object_set_data (GTK_OBJECT (xs_aboutwin), "label1", label1);
|
|
102 gtk_widget_show (label1);
|
|
103 gtk_box_pack_start (GTK_BOX (hbox1), label1, FALSE, FALSE, 0);
|
|
104 gtk_misc_set_padding (GTK_MISC (label1), 8, 0);
|
|
105
|
|
106 hbuttonbox1 = gtk_hbutton_box_new ();
|
|
107 gtk_object_set_data (GTK_OBJECT (xs_aboutwin), "hbuttonbox1", hbuttonbox1);
|
|
108 gtk_widget_show (hbuttonbox1);
|
|
109 gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, TRUE, TRUE, 0);
|
|
110
|
|
111 /* OK-button */
|
|
112 about_ok = gtk_button_new_with_label("OK");
|
|
113
|
|
114 gtk_signal_connect (GTK_OBJECT (about_ok), "clicked",
|
|
115 GTK_SIGNAL_FUNC(xs_aboutwin_ok),
|
|
116 NULL);
|
|
117
|
|
118 gtk_object_set_data (GTK_OBJECT (xs_aboutwin), "about_ok", about_ok);
|
|
119 gtk_widget_show (about_ok);
|
|
120 gtk_container_add (GTK_CONTAINER (hbuttonbox1), about_ok);
|
|
121 GTK_WIDGET_SET_FLAGS (about_ok, GTK_CAN_DEFAULT);
|
|
122
|
|
123 gtk_widget_show(xs_aboutwin);
|
|
124 }
|
|
125
|