annotate audacious/about.c @ 510:d9f6ab166d58 trunk

[svn] custom label/images for about.c buttons
author giacomo
date Thu, 26 Jan 2006 10:31:35 -0800
parents 55ec56ecbfad
children 9da0f92ce2ef
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1 /* XMMS - Cross-platform multimedia player
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2 * Copyright (C) 1998-2003 Peter Alm, Mikael Alm, Olle Hallnas,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3 * Thomas Nilsson and 4Front Technologies
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4 * Copyright (C) 2000-2003 Haavard Kvaalen
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
7 * it under the terms of the GNU General Public Licensse as published by
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
9 * (at your option) any later version.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
10 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
14 * GNU General Public License for more details.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
15 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
19 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
20
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
21 #ifdef HAVE_CONFIG_H
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
22 # include "config.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
23 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
24
471
a4ec7dfe5672 [svn] Rename about.c to credits.c
nenolod
parents: 399
diff changeset
25 #include "credits.h"
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
26
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
27 #include <glib.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
28 #include <glib/gi18n.h>
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
29 #include <gdk/gdk.h>
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
30 #include <gdk/gdkx.h>
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
31 #include <gdk/gdkkeysyms.h>
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
32 #include <gtk/gtk.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
33
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
34 static GtkWidget *about_window = NULL;
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
35 static GdkPixbuf *about_pixbuf = NULL;
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
36 static GdkPixmap *mask_pixmap_window1 = NULL,
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
37 *mask_pixmap_window2 = NULL;
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
38 static GdkBitmap *mask_bitmap_window1 = NULL,
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
39 *mask_bitmap_window2 = NULL;
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
40
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
41 static gboolean
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
42 on_about_window_expose(GtkWidget *widget, GdkEventExpose *expose, gpointer data)
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
43 {
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
44 g_return_val_if_fail(GTK_IS_WIDGET (widget), FALSE);
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
45
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
46 gdk_window_set_back_pixmap(GDK_WINDOW(widget->window), mask_pixmap_window2, 0);
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
47 gdk_window_clear(GDK_WINDOW(widget->window));
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
48
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
49 return FALSE;
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
50 }
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
51
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
52 static gboolean
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
53 on_about_window_key_press (GtkWidget *widget, GdkEventKey *event, gpointer data)
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
54 {
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
55 g_return_val_if_fail(GTK_IS_WIDGET (widget), FALSE);
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
56
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
57 if (event->keyval == GDK_Escape)
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
58 {
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
59 gtk_widget_hide(widget);
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
60 }
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
61
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
62 return FALSE;
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
63 }
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
64
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
65 static gboolean
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
66 on_close_button_clicked (GtkWidget *widget, gpointer data)
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
67 {
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
68 g_return_val_if_fail(GTK_IS_WIDGET (widget), FALSE);
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
69
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
70 gtk_widget_hide(about_window);
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
71
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
72 return FALSE;
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
73 }
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
74
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
75 static gboolean
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
76 on_credits_button_clicked (GtkWidget *widget, gpointer data)
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
77 {
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
78 g_return_val_if_fail(GTK_IS_WIDGET (widget), FALSE);
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
79
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
80 show_credits_window();
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
81
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
82 return FALSE;
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
83 }
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
84
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86 show_about_window(void)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87 {
502
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
88 GtkWidget *about_fixedbox;
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
89 GtkWidget *close_button;
510
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
90 GtkWidget *credits_button , *credits_button_hbox, *credits_button_image, *credits_button_label;
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
91 gchar *filename = DATA_DIR G_DIR_SEPARATOR_S "images" G_DIR_SEPARATOR_S "about-logo.png";
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
92
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
93 if (about_window != NULL)
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
94 {
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
95 gtk_window_present(GTK_WINDOW(about_window));
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
96 return;
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
97 }
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
98
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
99 about_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
100 gtk_window_set_type_hint(GTK_WINDOW(about_window),
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
101 GDK_WINDOW_TYPE_HINT_DIALOG);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
102
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
103 g_signal_connect(about_window, "destroy",
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
104 G_CALLBACK(gtk_widget_destroyed), &about_window);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
105
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
106 gtk_widget_realize(about_window);
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
107
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
108 about_pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
109
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
110 gtk_widget_set_size_request(GTK_WIDGET (about_window),
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
111 gdk_pixbuf_get_width (about_pixbuf),
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
112 gdk_pixbuf_get_height (about_pixbuf));
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
113
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
114 gtk_widget_set_app_paintable(about_window, TRUE);
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
115 gtk_window_set_title(GTK_WINDOW(about_window), _("About Audacious"));
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
116 gtk_window_set_position(GTK_WINDOW(about_window), GTK_WIN_POS_CENTER);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
117 gtk_window_set_resizable(GTK_WINDOW(about_window), FALSE);
505
55ec56ecbfad [svn] Make *sure* it's borderless.
nenolod
parents: 504
diff changeset
118 gtk_window_set_decorated(GTK_WINDOW(about_window), FALSE);
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
119
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
120 gdk_pixbuf_render_pixmap_and_mask(about_pixbuf,
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
121 &mask_pixmap_window1,
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
122 &mask_bitmap_window1,
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
123 0);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
124
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
125 gdk_pixbuf_render_pixmap_and_mask(about_pixbuf,
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
126 &mask_pixmap_window2,
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
127 &mask_bitmap_window2,
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
128 128);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
129
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
130 gtk_widget_add_events(about_window, GDK_ALL_EVENTS_MASK);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
131
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
132 g_signal_connect(about_window, "expose-event",
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
133 G_CALLBACK(on_about_window_expose), &about_window);
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
134
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
135 g_signal_connect(about_window, "key-press-event",
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
136 G_CALLBACK(on_about_window_key_press), &about_window);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
137
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
138 #if 0
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
139 GdkPixmap *beep_logo_pmap = NULL, *beep_logo_mask = NULL;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
140 GtkWidget *about_vbox;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
141 GtkWidget *about_credits_logo_box, *about_credits_logo_frame;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
142 GtkWidget *about_credits_logo;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
143 GtkWidget *about_notebook;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
144 GtkWidget *list;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
145 GtkWidget *bbox, *close_btn;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
146 GtkWidget *label;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
147 gchar *text;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
148
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
149 if (about_window)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
150 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
151
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
152 gtk_container_set_border_width(GTK_CONTAINER(about_window), 10);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
153
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
154
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
155 about_vbox = gtk_vbox_new(FALSE, 5);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
156 gtk_container_add(GTK_CONTAINER(about_window), about_vbox);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
157
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
158 if (!beep_logo_pmap)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
159 beep_logo_pmap =
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
160 gdk_pixmap_create_from_xpm_d(about_window->window,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
161 &beep_logo_mask, NULL, audacious_logo_xpm);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
162
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
163 about_credits_logo_box = gtk_hbox_new(TRUE, 0);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
164 gtk_box_pack_start(GTK_BOX(about_vbox), about_credits_logo_box,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
165 FALSE, FALSE, 0);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
166
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
167 about_credits_logo_frame = gtk_frame_new(NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
168 gtk_frame_set_shadow_type(GTK_FRAME(about_credits_logo_frame),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
169 GTK_SHADOW_ETCHED_OUT);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
170 gtk_box_pack_start(GTK_BOX(about_credits_logo_box),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
171 about_credits_logo_frame, FALSE, FALSE, 0);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
172
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
173 about_credits_logo = gtk_pixmap_new(beep_logo_pmap, beep_logo_mask);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
174 gtk_container_add(GTK_CONTAINER(about_credits_logo_frame),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
175 about_credits_logo);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
176
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
177 label = gtk_label_new(NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
178 text = g_strdup_printf(_(bmp_brief), VERSION);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
179 gtk_label_set_markup(GTK_LABEL(label), text);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
180 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
181 g_free(text);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
182
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
183 gtk_box_pack_start(GTK_BOX(about_vbox), label, FALSE, FALSE, 0);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
184
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
185 about_notebook = gtk_notebook_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
186 gtk_box_pack_start(GTK_BOX(about_vbox), about_notebook, TRUE, TRUE, 0);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
187
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
188 list = generate_credit_list(credit_text, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
189 gtk_notebook_append_page(GTK_NOTEBOOK(about_notebook), list,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
190 gtk_label_new(_("Credits")));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
191
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
192 list = generate_credit_list(translators, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
193 gtk_notebook_append_page(GTK_NOTEBOOK(about_notebook), list,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
194 gtk_label_new(_("Translators")));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
195
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
196 bbox = gtk_hbutton_box_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
197 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
198 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
199 gtk_box_pack_start(GTK_BOX(about_vbox), bbox, FALSE, FALSE, 0);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
200
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
201 close_btn = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
202 g_signal_connect_swapped(close_btn, "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
203 G_CALLBACK(gtk_widget_destroy), about_window);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
204 GTK_WIDGET_SET_FLAGS(close_btn, GTK_CAN_DEFAULT);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
205 gtk_box_pack_start(GTK_BOX(bbox), close_btn, TRUE, TRUE, 0);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
206 gtk_widget_grab_default(close_btn);
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
207 #endif
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
208
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
209 gtk_widget_shape_combine_mask(GTK_WIDGET(about_window), mask_bitmap_window2, 0, 0);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
210
502
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
211 /* GtkFixed hasn't got its GdkWindow, this means that it can be used to
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
212 display widgets while the logo below will be displayed anyway;
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
213 however I don't like the fixed position cause the button sizes may (will)
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
214 vary depending on the gtk style used, so it's not possible to center
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
215 them unless I force a fixed width and heigth (and this may bring to cutted
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
216 text if someone, i.e., uses a big font for gtk widgets);
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
217 other types of container most likely have their GdkWindow, this simply
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
218 means that the logo must be drawn on the container widget, instead of the
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
219 window; otherwise, it won't be displayed correctly */
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
220 about_fixedbox = gtk_fixed_new();
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
221 gtk_container_add( GTK_CONTAINER(about_window) , about_fixedbox );
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
222
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
223 close_button = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
224
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
225 g_signal_connect(close_button, "clicked",
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
226 G_CALLBACK(on_close_button_clicked), NULL);
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
227
502
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
228 gtk_fixed_put( GTK_FIXED(about_fixedbox) , close_button , 390 , 220 );
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
229
510
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
230 credits_button = gtk_button_new();
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
231 credits_button_hbox = gtk_hbox_new( FALSE , 0 );
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
232 credits_button_image = gtk_image_new_from_stock( GTK_STOCK_DIALOG_INFO , GTK_ICON_SIZE_BUTTON );
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
233 credits_button_label = gtk_label_new( "Credits" );
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
234 gtk_box_pack_start( GTK_BOX(credits_button_hbox) , credits_button_image ,
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
235 TRUE , TRUE , 0 );
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
236 gtk_box_pack_start( GTK_BOX(credits_button_hbox) , credits_button_label ,
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
237 TRUE , TRUE , 5 );
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
238 gtk_container_add( GTK_CONTAINER(credits_button) , credits_button_hbox );
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
239
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
240 g_signal_connect(credits_button, "clicked",
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
241 G_CALLBACK(on_credits_button_clicked), NULL);
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
242
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
243 gtk_fixed_put( GTK_FIXED(about_fixedbox) , credits_button , 60 , 220 );
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
244
502
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
245 gtk_widget_show_all(about_window);
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
246 gtk_window_present(GTK_WINDOW(about_window));
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
247 }