Mercurial > hg > xmms-sid
comparison src/xs_about.c @ 359:b1a858b8cb1a
Re-indentation all (non-generated) code.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 07 Nov 2005 09:50:04 +0000 |
parents | f8d3e910d07c |
children | 52f71f323555 |
comparison
equal
deleted
inserted
replaced
358:4f247b19c9ea | 359:b1a858b8cb1a |
---|---|
35 * Stop playing, add XMMS-SID themetune to playlist | 35 * Stop playing, add XMMS-SID themetune to playlist |
36 * and start playing it. | 36 * and start playing it. |
37 */ | 37 */ |
38 gint xs_about_theme(void) | 38 gint xs_about_theme(void) |
39 { | 39 { |
40 const gint iSession = 0; /* Assume session 0 */ | 40 const gint iSession = 0; /* Assume session 0 */ |
41 gint iPos; | 41 gint iPos; |
42 | 42 |
43 /* Stop current song, add theme to playlist, play. */ | 43 /* Stop current song, add theme to playlist, play. */ |
44 xmms_remote_stop(iSession); | 44 xmms_remote_stop(iSession); |
45 iPos = xmms_remote_get_playlist_length(iSession); | 45 iPos = xmms_remote_get_playlist_length(iSession); |
46 xmms_remote_playlist_add_url_string(iSession, THEMETUNE_FILE); | 46 xmms_remote_playlist_add_url_string(iSession, THEMETUNE_FILE); |
47 xmms_remote_set_playlist_pos(iSession, iPos); | 47 xmms_remote_set_playlist_pos(iSession, iPos); |
48 xmms_remote_play(iSession); | 48 xmms_remote_play(iSession); |
49 return 0; | 49 return 0; |
50 } | 50 } |
51 #endif | 51 #endif |
52 | 52 |
53 | 53 |
54 gint xs_about_ok(void) | 54 gint xs_about_ok(void) |
55 { | 55 { |
56 gtk_widget_destroy(xs_aboutwin); | 56 gtk_widget_destroy(xs_aboutwin); |
57 xs_aboutwin = NULL; | 57 xs_aboutwin = NULL; |
58 return 0; | 58 return 0; |
59 } | 59 } |
60 | 60 |
61 | 61 |
62 /* | 62 /* |
63 * Execute the about dialog | 63 * Execute the about dialog |
64 */ | 64 */ |
65 void xs_about(void) | 65 void xs_about(void) |
66 { | 66 { |
67 GtkWidget *about_vbox1; | 67 GtkWidget *about_vbox1; |
68 GtkWidget *about_frame; | 68 GtkWidget *about_frame; |
69 GtkWidget *about_logo; | 69 GtkWidget *about_logo; |
70 GdkPixmap *about_logo_pixmap = NULL, *about_logo_mask = NULL; | 70 GdkPixmap *about_logo_pixmap = NULL, *about_logo_mask = NULL; |
71 GtkWidget *about_scrwin; | 71 GtkWidget *about_scrwin; |
72 GtkWidget *about_text; | 72 GtkWidget *about_text; |
73 GtkWidget *alignment6; | 73 GtkWidget *alignment6; |
74 GtkWidget *about_close; | 74 GtkWidget *about_close; |
75 | 75 |
76 /* Check if there already is an open about window */ | 76 /* Check if there already is an open about window */ |
77 if (xs_aboutwin != NULL) | 77 if (xs_aboutwin != NULL) { |
78 { | 78 gdk_window_raise(xs_aboutwin->window); |
79 gdk_window_raise(xs_aboutwin->window); | 79 return; |
80 return; | |
81 } | 80 } |
82 | 81 |
83 /* No, create one ... */ | 82 /* No, create one ... */ |
84 xs_aboutwin = gtk_window_new (GTK_WINDOW_DIALOG); | 83 xs_aboutwin = gtk_window_new(GTK_WINDOW_DIALOG); |
85 gtk_widget_set_name (xs_aboutwin, "xs_aboutwin"); | 84 gtk_widget_set_name(xs_aboutwin, "xs_aboutwin"); |
86 gtk_object_set_data (GTK_OBJECT (xs_aboutwin), "xs_aboutwin", xs_aboutwin); | 85 gtk_object_set_data(GTK_OBJECT(xs_aboutwin), "xs_aboutwin", xs_aboutwin); |
87 gtk_window_set_title (GTK_WINDOW (xs_aboutwin), "About " PACKAGE_STRING); | 86 gtk_window_set_title(GTK_WINDOW(xs_aboutwin), "About " PACKAGE_STRING); |
88 gtk_window_set_default_size (GTK_WINDOW (xs_aboutwin), 300, -1); | 87 gtk_window_set_default_size(GTK_WINDOW(xs_aboutwin), 300, -1); |
89 | 88 |
90 about_vbox1 = gtk_vbox_new (FALSE, 0); | 89 about_vbox1 = gtk_vbox_new(FALSE, 0); |
91 gtk_widget_set_name (about_vbox1, "about_vbox1"); | 90 gtk_widget_set_name(about_vbox1, "about_vbox1"); |
92 gtk_widget_ref (about_vbox1); | 91 gtk_widget_ref(about_vbox1); |
93 gtk_object_set_data_full (GTK_OBJECT (xs_aboutwin), "about_vbox1", about_vbox1, | 92 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_vbox1", about_vbox1, |
94 (GtkDestroyNotify) gtk_widget_unref); | 93 (GtkDestroyNotify) gtk_widget_unref); |
95 gtk_widget_show (about_vbox1); | 94 gtk_widget_show(about_vbox1); |
96 gtk_container_add (GTK_CONTAINER (xs_aboutwin), about_vbox1); | 95 gtk_container_add(GTK_CONTAINER(xs_aboutwin), about_vbox1); |
97 | 96 |
98 #ifdef HAVE_THEMETUNE | 97 #ifdef HAVE_THEMETUNE |
99 about_frame = gtk_button_new(); | 98 about_frame = gtk_button_new(); |
100 #else | 99 #else |
101 about_frame = gtk_frame_new (NULL); | 100 about_frame = gtk_frame_new(NULL); |
102 #endif | 101 #endif |
103 gtk_widget_set_name (about_frame, "about_frame"); | 102 gtk_widget_set_name(about_frame, "about_frame"); |
104 gtk_widget_ref (about_frame); | 103 gtk_widget_ref(about_frame); |
105 gtk_object_set_data_full (GTK_OBJECT (xs_aboutwin), "about_frame", about_frame, | 104 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_frame", about_frame, |
106 (GtkDestroyNotify) gtk_widget_unref); | 105 (GtkDestroyNotify) gtk_widget_unref); |
107 gtk_widget_show (about_frame); | 106 gtk_widget_show(about_frame); |
108 gtk_box_pack_start (GTK_BOX (about_vbox1), about_frame, FALSE, FALSE, 0); | 107 gtk_box_pack_start(GTK_BOX(about_vbox1), about_frame, FALSE, FALSE, 0); |
109 gtk_container_set_border_width (GTK_CONTAINER (about_frame), 4); | 108 gtk_container_set_border_width(GTK_CONTAINER(about_frame), 4); |
110 | 109 |
111 #ifdef HAVE_THEMETUNE | 110 #ifdef HAVE_THEMETUNE |
112 gtk_signal_connect (GTK_OBJECT (about_frame), "clicked", GTK_SIGNAL_FUNC (xs_about_theme), NULL); | 111 gtk_signal_connect(GTK_OBJECT(about_frame), "clicked", GTK_SIGNAL_FUNC(xs_about_theme), NULL); |
113 #else | 112 #else |
114 gtk_frame_set_shadow_type (GTK_FRAME (about_frame), GTK_SHADOW_OUT); | 113 gtk_frame_set_shadow_type(GTK_FRAME(about_frame), GTK_SHADOW_OUT); |
115 #endif | 114 #endif |
116 | 115 |
117 /* Create the Gdk data for logo pixmap */ | 116 /* Create the Gdk data for logo pixmap */ |
118 gtk_widget_realize (xs_aboutwin); | 117 gtk_widget_realize(xs_aboutwin); |
119 about_logo_pixmap = gdk_pixmap_create_from_xpm_d( | 118 about_logo_pixmap = gdk_pixmap_create_from_xpm_d(xs_aboutwin->window, |
120 xs_aboutwin->window, | 119 &about_logo_mask, NULL, (gchar **) xmms_sid_logo_xpm); |
121 &about_logo_mask, | 120 |
122 NULL, | 121 about_logo = gtk_pixmap_new(about_logo_pixmap, about_logo_mask); |
123 (gchar **) xmms_sid_logo_xpm); | 122 |
124 | 123 /* Create logo widget */ |
125 about_logo = gtk_pixmap_new(about_logo_pixmap, about_logo_mask); | 124 gtk_widget_set_name(about_logo, "about_logo"); |
126 | 125 gtk_widget_ref(about_logo); |
127 /* Create logo widget */ | 126 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_logo", about_logo, |
128 gtk_widget_set_name (about_logo, "about_logo"); | 127 (GtkDestroyNotify) gtk_widget_unref); |
129 gtk_widget_ref (about_logo); | 128 gtk_widget_show(about_logo); |
130 gtk_object_set_data_full (GTK_OBJECT (xs_aboutwin), "about_logo", about_logo, | 129 gtk_container_add(GTK_CONTAINER(about_frame), about_logo); |
131 (GtkDestroyNotify) gtk_widget_unref); | 130 gtk_misc_set_padding(GTK_MISC(about_logo), 0, 6); |
132 gtk_widget_show (about_logo); | 131 |
133 gtk_container_add (GTK_CONTAINER (about_frame), about_logo); | 132 about_scrwin = gtk_scrolled_window_new(NULL, NULL); |
134 gtk_misc_set_padding (GTK_MISC (about_logo), 0, 6); | 133 gtk_widget_set_name(about_scrwin, "about_scrwin"); |
135 | 134 gtk_widget_ref(about_scrwin); |
136 about_scrwin = gtk_scrolled_window_new (NULL, NULL); | 135 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_scrwin", about_scrwin, |
137 gtk_widget_set_name (about_scrwin, "about_scrwin"); | 136 (GtkDestroyNotify) gtk_widget_unref); |
138 gtk_widget_ref (about_scrwin); | 137 gtk_widget_show(about_scrwin); |
139 gtk_object_set_data_full (GTK_OBJECT (xs_aboutwin), "about_scrwin", about_scrwin, | 138 gtk_box_pack_start(GTK_BOX(about_vbox1), about_scrwin, TRUE, TRUE, 0); |
140 (GtkDestroyNotify) gtk_widget_unref); | 139 gtk_container_set_border_width(GTK_CONTAINER(about_scrwin), 8); |
141 gtk_widget_show (about_scrwin); | 140 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(about_scrwin), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); |
142 gtk_box_pack_start (GTK_BOX (about_vbox1), about_scrwin, TRUE, TRUE, 0); | 141 |
143 gtk_container_set_border_width (GTK_CONTAINER (about_scrwin), 8); | 142 about_text = gtk_text_new(NULL, NULL); |
144 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (about_scrwin), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | 143 gtk_widget_set_name(about_text, "about_text"); |
145 | 144 gtk_widget_ref(about_text); |
146 about_text = gtk_text_new (NULL, NULL); | 145 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_text", about_text, |
147 gtk_widget_set_name (about_text, "about_text"); | 146 (GtkDestroyNotify) gtk_widget_unref); |
148 gtk_widget_ref (about_text); | 147 gtk_widget_show(about_text); |
149 gtk_object_set_data_full (GTK_OBJECT (xs_aboutwin), "about_text", about_text, | 148 gtk_container_add(GTK_CONTAINER(about_scrwin), about_text); |
150 (GtkDestroyNotify) gtk_widget_unref); | 149 gtk_widget_set_usize(about_text, -2, 100); |
151 gtk_widget_show (about_text); | 150 gtk_text_insert(GTK_TEXT(about_text), NULL, NULL, NULL, |
152 gtk_container_add (GTK_CONTAINER (about_scrwin), about_text); | 151 "\n" |
153 gtk_widget_set_usize (about_text, -2, 100); | 152 "(C) Copyright 1999-2005\n" |
154 gtk_text_insert (GTK_TEXT (about_text), NULL, NULL, NULL, | 153 "\tTecnic Software productions (TNSP)\n" |
155 "\n" | 154 "\n" "Programming and design\n" "\tMatti 'ccr' Hämäläinen\n" "\n" |
156 "(C) Copyright 1999-2005\n" | |
157 "\tTecnic Software productions (TNSP)\n" | |
158 "\n" | |
159 "Programming and design\n" | |
160 "\tMatti 'ccr' Hämäläinen\n" | |
161 "\n" | |
162 #ifdef HAVE_SIDPLAY1 | 155 #ifdef HAVE_SIDPLAY1 |
163 "libSIDPlay1 created by\n" | 156 "libSIDPlay1 created by\n" "\tMichael Schwendt\n" "\n" |
164 "\tMichael Schwendt\n" | |
165 "\n" | |
166 #endif | 157 #endif |
167 #ifdef HAVE_SIDPLAY2 | 158 #ifdef HAVE_SIDPLAY2 |
168 "libSIDPlay2 and reSID created by\n" | 159 "libSIDPlay2 and reSID created by\n" |
169 "\tSimon White, Dag Lem,\n" | 160 "\tSimon White, Dag Lem,\n" "\tMichael Schwendt and rest.\n" "\n" |
170 "\tMichael Schwendt and rest.\n" | 161 #endif |
171 "\n" | 162 #ifdef HAVE_THEMETUNE |
172 #endif | 163 "\"Kummatti City\", theme of XMMS-SID 0.8\n" |
173 #ifdef HAVE_THEMETUNE | 164 "\tby Ari 'Agemixer' Yliaho\n" |
174 "\"Kummatti City\", theme of XMMS-SID 0.8\n" | 165 "\t(C) Copyright 1998 Scallop\n" "\t(Refer to README for license)\n" "\n" |
175 "\tby Ari 'Agemixer' Yliaho\n" | 166 #endif |
176 "\t(C) Copyright 1998 Scallop\n" | 167 "Original XMMS-SID (v0.4) by\n" "\tWillem Monsuwe\n" "\n", -1); |
177 "\t(Refer to README for license)\n" | 168 |
178 "\n" | 169 gtk_text_insert(GTK_TEXT(about_text), NULL, NULL, NULL, |
179 #endif | 170 "Greetings fly out to ...\n" |
180 "Original XMMS-SID (v0.4) by\n" | 171 "\tEveryone at #Linux.Fi, #Fireball,\n" |
181 "\tWillem Monsuwe\n" | 172 "\t#TNSP and #c-64 of IRCNet, #xmms\n" |
182 "\n", -1); | 173 "\tof Freenode.net.\n" |
183 | 174 "\n" |
184 gtk_text_insert (GTK_TEXT (about_text), NULL, NULL, NULL, | 175 "\tDekadence, PWP, Byterapers,\n" |
185 "Greetings fly out to ...\n" | 176 "\tmfx, Unique, Fairlight, iSO,\n" |
186 "\tEveryone at #Linux.Fi, #Fireball,\n" | 177 "\tWrath Designs, Padua, Extend,\n" |
187 "\t#TNSP and #c-64 of IRCNet, #xmms\n" | 178 "\tPHn, Creators, Cosine, tAAt,\n" "\tViruz, Crest and Skalaria.\n" "\n", -1); |
188 "\tof Freenode.net.\n" | 179 |
189 "\n" | 180 gtk_text_insert(GTK_TEXT(about_text), NULL, NULL, NULL, |
190 "\tDekadence, PWP, Byterapers,\n" | 181 "Special thanks\n" |
191 "\tmfx, Unique, Fairlight, iSO,\n" | 182 "\tGerfried 'Alfie' Fuchs\n" |
192 "\tWrath Designs, Padua, Extend,\n" | 183 "\tAndreas 'mrsid' Varga\n" "\tAll the betatesters.\n" "\tAll the users!\n", -1); |
193 "\tPHn, Creators, Cosine, tAAt,\n" | 184 |
194 "\tViruz, Crest and Skalaria.\n" | 185 alignment6 = gtk_alignment_new(0.5, 0.5, 0.18, 1); |
195 "\n", -1); | 186 gtk_widget_set_name(alignment6, "alignment6"); |
196 | 187 gtk_widget_ref(alignment6); |
197 gtk_text_insert (GTK_TEXT (about_text), NULL, NULL, NULL, | 188 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "alignment6", alignment6, |
198 "Special thanks\n" | 189 (GtkDestroyNotify) gtk_widget_unref); |
199 "\tGerfried 'Alfie' Fuchs\n" | 190 gtk_widget_show(alignment6); |
200 "\tAndreas 'mrsid' Varga\n" | 191 gtk_box_pack_start(GTK_BOX(about_vbox1), alignment6, FALSE, TRUE, 0); |
201 "\tAll the betatesters.\n" | 192 gtk_container_set_border_width(GTK_CONTAINER(alignment6), 8); |
202 "\tAll the users!\n", -1); | 193 |
203 | 194 about_close = gtk_button_new_with_label("Close"); |
204 alignment6 = gtk_alignment_new (0.5, 0.5, 0.18, 1); | 195 gtk_widget_set_name(about_close, "about_close"); |
205 gtk_widget_set_name (alignment6, "alignment6"); | 196 gtk_widget_ref(about_close); |
206 gtk_widget_ref (alignment6); | 197 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_close", about_close, |
207 gtk_object_set_data_full (GTK_OBJECT (xs_aboutwin), "alignment6", alignment6, | 198 (GtkDestroyNotify) gtk_widget_unref); |
208 (GtkDestroyNotify) gtk_widget_unref); | 199 gtk_widget_show(about_close); |
209 gtk_widget_show (alignment6); | 200 gtk_container_add(GTK_CONTAINER(alignment6), about_close); |
210 gtk_box_pack_start (GTK_BOX (about_vbox1), alignment6, FALSE, TRUE, 0); | 201 GTK_WIDGET_SET_FLAGS(about_close, GTK_CAN_DEFAULT); |
211 gtk_container_set_border_width (GTK_CONTAINER (alignment6), 8); | 202 |
212 | 203 gtk_signal_connect(GTK_OBJECT(about_close), "clicked", GTK_SIGNAL_FUNC(xs_about_ok), NULL); |
213 about_close = gtk_button_new_with_label ("Close"); | 204 |
214 gtk_widget_set_name (about_close, "about_close"); | 205 gtk_widget_show(xs_aboutwin); |
215 gtk_widget_ref (about_close); | |
216 gtk_object_set_data_full (GTK_OBJECT (xs_aboutwin), "about_close", about_close, | |
217 (GtkDestroyNotify) gtk_widget_unref); | |
218 gtk_widget_show (about_close); | |
219 gtk_container_add (GTK_CONTAINER (alignment6), about_close); | |
220 GTK_WIDGET_SET_FLAGS (about_close, GTK_CAN_DEFAULT); | |
221 | |
222 gtk_signal_connect (GTK_OBJECT (about_close), "clicked", GTK_SIGNAL_FUNC (xs_about_ok), NULL); | |
223 | |
224 gtk_widget_show(xs_aboutwin); | |
225 } | 206 } |
226 |