Mercurial > mplayer.hg
annotate Gui/mplayer/gtk/about.c @ 7250:27a1315d6af4
Checked if the connection succeeded before writing in the socket.
author | bertrand |
---|---|
date | Tue, 03 Sep 2002 01:25:31 +0000 |
parents | bab8be262e97 |
children | b82a3eb66d60 |
rev | line source |
---|---|
2901 | 1 |
2 #include "../../events.h" | |
3 #include "../../../config.h" | |
4 #include "../../../help_mp.h" | |
5 | |
6625 | 6 #include "mplayer/pixmaps/about.xpm" |
2901 | 7 #include "../widgets.h" |
8 #include "about.h" | |
9 | |
6146 | 10 int gtkVAboutBox = 0; |
11 GtkWidget * AboutBox; | |
12 | |
13 void ShowAboutBox( void ) | |
14 { | |
15 if ( gtkVAboutBox ) gtkActive( AboutBox ); | |
16 else AboutBox=create_About(); | |
17 gtk_widget_show( AboutBox ); | |
18 } | |
19 | |
20 void ab_AboutBox_show( GtkButton * button,gpointer user_data ) | |
21 { gtkVAboutBox=(int)user_data; } | |
22 | |
2901 | 23 void ab_Ok_released( GtkButton * button,gpointer user_data ) |
6146 | 24 { |
25 gtkVAboutBox=(int)user_data; | |
26 gtk_widget_destroy( AboutBox ); | |
27 } | |
2901 | 28 |
29 GtkWidget * create_About( void ) | |
30 { | |
31 GtkWidget * About; | |
32 GtkWidget * frame1; | |
33 GtkWidget * frame2; | |
34 GtkWidget * frame3; | |
35 GtkWidget * frame4; | |
36 GtkWidget * vbox1; | |
37 GtkWidget * pixmap1; | |
38 GtkWidget * hseparator2; | |
39 GtkWidget * scrolledwindow1; | |
40 GtkWidget * AboutText; | |
41 GtkWidget * hseparator1; | |
42 GtkWidget * hbuttonbox1; | |
43 GtkWidget * Ok; | |
44 | |
45 GtkStyle * pixmapstyle; | |
3616 | 46 GdkPixmap * pixmapwid; |
2901 | 47 GdkBitmap * mask; |
48 | |
49 GtkAccelGroup * accel_group; | |
50 | |
6146 | 51 accel_group=gtk_accel_group_new(); |
2901 | 52 |
53 About=gtk_window_new( GTK_WINDOW_TOPLEVEL ); | |
54 gtk_widget_set_name( About,MSGTR_About ); | |
55 gtk_object_set_data( GTK_OBJECT( About ),MSGTR_About,About ); | |
56 gtk_widget_set_usize( About,340,415 ); | |
57 gtk_window_set_title( GTK_WINDOW( About ),MSGTR_About ); | |
58 gtk_window_set_position( GTK_WINDOW( About ),GTK_WIN_POS_CENTER ); | |
59 gtk_window_set_policy( GTK_WINDOW( About ),TRUE,FALSE,FALSE ); | |
6651 | 60 gtk_window_set_wmclass( GTK_WINDOW( About ),MSGTR_About,"MPlayer" ); |
61 | |
62 gtk_widget_realize( About ); | |
63 gtkAddIcon( About ); | |
2901 | 64 |
65 frame1=gtk_frame_new( NULL ); | |
66 gtk_widget_set_name( frame1,"frame1" ); | |
67 gtk_widget_ref( frame1 ); | |
6146 | 68 gtk_object_set_data_full( GTK_OBJECT( About ),"frame1",frame1,(GtkDestroyNotify)gtk_widget_unref ); |
2901 | 69 gtk_widget_show( frame1 ); |
70 gtk_container_add( GTK_CONTAINER( About ),frame1 ); | |
71 gtk_frame_set_shadow_type( GTK_FRAME( frame1 ),GTK_SHADOW_IN ); | |
72 | |
73 frame2=gtk_frame_new( NULL ); | |
74 gtk_widget_set_name( frame2,"frame2" ); | |
75 gtk_widget_ref( frame2 ); | |
6146 | 76 gtk_object_set_data_full( GTK_OBJECT( About ),"frame2",frame2,(GtkDestroyNotify)gtk_widget_unref ); |
2901 | 77 gtk_widget_show( frame2 ); |
78 gtk_container_add( GTK_CONTAINER( frame1 ),frame2 ); | |
79 gtk_frame_set_shadow_type( GTK_FRAME( frame2 ),GTK_SHADOW_NONE ); | |
80 | |
81 frame3=gtk_frame_new( NULL ); | |
82 gtk_widget_set_name( frame3,"frame3" ); | |
83 gtk_widget_ref( frame3 ); | |
6146 | 84 gtk_object_set_data_full( GTK_OBJECT( About ),"frame3",frame3,(GtkDestroyNotify)gtk_widget_unref ); |
2901 | 85 gtk_widget_show( frame3 ); |
86 gtk_container_add( GTK_CONTAINER( frame2 ),frame3 ); | |
87 gtk_frame_set_shadow_type( GTK_FRAME( frame3 ),GTK_SHADOW_ETCHED_OUT ); | |
88 | |
89 frame4=gtk_frame_new( NULL ); | |
90 gtk_widget_set_name( frame4,"frame4" ); | |
91 gtk_widget_ref( frame4 ); | |
6146 | 92 gtk_object_set_data_full( GTK_OBJECT( About ),"frame4",frame4,(GtkDestroyNotify)gtk_widget_unref ); |
2901 | 93 gtk_widget_show( frame4 ); |
94 gtk_container_add( GTK_CONTAINER( frame3 ),frame4 ); | |
95 gtk_frame_set_shadow_type( GTK_FRAME( frame4 ),GTK_SHADOW_NONE ); | |
96 | |
97 vbox1=gtk_vbox_new( FALSE,0 ); | |
98 gtk_widget_set_name( vbox1,"vbox1" ); | |
99 gtk_widget_ref( vbox1 ); | |
6146 | 100 gtk_object_set_data_full( GTK_OBJECT( About ),"vbox1",vbox1,(GtkDestroyNotify)gtk_widget_unref ); |
2901 | 101 gtk_widget_show( vbox1 ); |
102 gtk_container_add( GTK_CONTAINER( frame4 ),vbox1 ); | |
103 | |
104 pixmapstyle=gtk_widget_get_style( About ); | |
3616 | 105 pixmapwid=gdk_pixmap_colormap_create_from_xpm_d( About->window,gdk_colormap_get_system(),&mask,&pixmapstyle->bg[GTK_STATE_NORMAL],about_xpm ); |
2901 | 106 pixmap1=gtk_pixmap_new( pixmapwid,mask ); |
107 | |
108 gtk_widget_set_name( pixmap1,"pixmap1" ); | |
109 gtk_widget_ref( pixmap1 ); | |
6146 | 110 gtk_object_set_data_full( GTK_OBJECT( About ),"pixmap1",pixmap1,(GtkDestroyNotify)gtk_widget_unref ); |
2901 | 111 gtk_widget_show( pixmap1 ); |
112 gtk_box_pack_start( GTK_BOX( vbox1 ),pixmap1,FALSE,FALSE,0 ); | |
113 gtk_widget_set_usize( pixmap1,-2,174 ); | |
114 | |
115 hseparator2=gtk_hseparator_new( ); | |
116 gtk_widget_set_name( hseparator2,"hseparator2" ); | |
117 gtk_widget_ref( hseparator2 ); | |
6146 | 118 gtk_object_set_data_full( GTK_OBJECT( About ),"hseparator2",hseparator2,(GtkDestroyNotify)gtk_widget_unref ); |
2901 | 119 gtk_widget_show( hseparator2 ); |
120 gtk_box_pack_start( GTK_BOX( vbox1 ),hseparator2,FALSE,FALSE,0 ); | |
121 gtk_widget_set_usize( hseparator2,-2,7 ); | |
122 | |
123 scrolledwindow1=gtk_scrolled_window_new( NULL,NULL ); | |
124 gtk_widget_set_name( scrolledwindow1,"scrolledwindow1" ); | |
125 gtk_widget_ref( scrolledwindow1 ); | |
6146 | 126 gtk_object_set_data_full( GTK_OBJECT( About ),"scrolledwindow1",scrolledwindow1,(GtkDestroyNotify)gtk_widget_unref ); |
2901 | 127 gtk_widget_show( scrolledwindow1 ); |
128 gtk_box_pack_start( GTK_BOX( vbox1 ),scrolledwindow1,TRUE,TRUE,0 ); | |
129 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC ); | |
130 | |
131 AboutText=gtk_text_new( NULL,NULL ); | |
132 gtk_widget_set_name( AboutText,"AboutText" ); | |
133 gtk_widget_ref( AboutText ); | |
6146 | 134 gtk_object_set_data_full( GTK_OBJECT( About ),"AboutText",AboutText,(GtkDestroyNotify)gtk_widget_unref ); |
2901 | 135 gtk_widget_show( AboutText ); |
136 gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),AboutText ); | |
137 gtk_text_insert( GTK_TEXT( AboutText ),NULL,NULL,NULL, | |
6146 | 138 "\n" \ |
139 " MPlayer core team:\n" \ | |
140 "\n" \ | |
141 " * Arpad Gereoffy (A'rpi/ESP-team)\n" \ | |
142 " * Zoltan Ponekker (Pontscho/Fresh!mindworkz)\n" \ | |
143 " * Gabor Berczi (Gabucino)\n" \ | |
144 " * Alex Beregszaszi (al3x)\n" \ | |
145 " * Gabor Lenart (LGB)\n" \ | |
7080
bab8be262e97
Fix small typo noticed by Francisco Javier Cabello <fjcabello@visual-tools.com>
atmos4
parents:
6903
diff
changeset
|
146 " * Felix Buenemann (Atmos)\n" \ |
6146 | 147 " * Alban Bedel (Albeu)\n" \ |
148 " * pl\n" \ | |
149 " * Michael Niedermayer\n" \ | |
150 "\n" \ | |
151 " Additional codes:\n" \ | |
152 "\n" \ | |
153 " * Szabolcs Berecz (Szabi)\n" \ | |
154 " * Laszlo Megyer (Lez, Laaz)\n" \ | |
155 " * Gyula Laszlo (Chass, Tegla)\n" \ | |
156 " * Zoltan Mark Vician (Se7en)\n" \ | |
157 " * Andreas Ackermann (Acki)\n" \ | |
158 " * TeLeNiEkO\n" \ | |
159 " * Michael Graffam\n" \ | |
160 " * Jens Hoffmann\n" \ | |
161 " * German Gomez Garcia\n" \ | |
162 " * Dariusz Pietrzak (Eyck)\n" \ | |
163 " * Marcus Comstedt\n" \ | |
164 " * Jurgen Keil\n" \ | |
165 " * Vladimir Kushnir\n" \ | |
166 " * Bertrand BAUDET\n" \ | |
167 " * Derek J Witt\n" \ | |
168 " * Artur Zaprzala\n" \ | |
169 " * lanzz@lanzz.org\n" \ | |
170 " * Adam Tla/lka\n" \ | |
171 " * Folke Ashberg\n" \ | |
172 " * Kamil Toman\n" \ | |
173 " * Ivan Kalvatchev\n" \ | |
174 " * Sven Goethel\n" \ | |
175 " * joy_ping\n" \ | |
176 " * Eric Anholt\n" \ | |
177 " * Jiri Svoboda\n" \ | |
178 " * Oliver Schoenbrunner\n" \ | |
179 " * Jeroen Dobbelaere\n" \ | |
180 " * David Holm\n" \ | |
181 " * Panagiotis Issaris\n" \ | |
182 " * Mike Melanson\n" \ | |
183 " * Tobias Diedrich\n" \ | |
184 " * Kilian A. Foth\n" \ | |
185 " * Tim Ferguson\n" \ | |
186 " * Sam Lin\n" \ | |
187 " * Johannes Feigl\n" \ | |
188 " * Kim Minh Kaplan\n" \ | |
189 " * Brian Kuschak\n" \ | |
190 " * Stephen Davies\n" \ | |
191 " * Rik Snel\n" \ | |
192 " * Anders Johansson\n" \ | |
193 " * Roberto Togni\n" \ | |
194 " * Wojtek Kaniewski\n" \ | |
195 " * Fredrik Kuivinen\n" \ | |
196 "\n" \ | |
197 " Main testers:\n" \ | |
198 "\n" \ | |
199 " * Tibor Balazs (Tibcu)\n" \ | |
200 " * Peter Sasi (SaPe)\n" \ | |
201 " * Christoph H. Lampert\n" \ | |
202 " * Attila Kinali\n" \ | |
203 " * Dirk Vornheder\n" \ | |
204 " * Bohdan Horst (Nexus)\n" \ | |
205 "\n",1481 ); | |
2901 | 206 |
6146 | 207 hseparator1=gtk_hseparator_new(); |
2901 | 208 gtk_widget_set_name( hseparator1,"hseparator1" ); |
209 gtk_widget_ref( hseparator1 ); | |
6146 | 210 gtk_object_set_data_full( GTK_OBJECT( About ),"hseparator1",hseparator1,(GtkDestroyNotify)gtk_widget_unref ); |
2901 | 211 gtk_widget_show( hseparator1 ); |
212 gtk_box_pack_start( GTK_BOX( vbox1 ),hseparator1,FALSE,FALSE,0 ); | |
213 gtk_widget_set_usize( hseparator1,-2,10 ); | |
214 | |
215 hbuttonbox1=gtk_hbutton_box_new( ); | |
216 gtk_widget_set_name( hbuttonbox1,"hbuttonbox1" ); | |
217 gtk_widget_ref( hbuttonbox1 ); | |
6146 | 218 gtk_object_set_data_full( GTK_OBJECT( About ),"hbuttonbox1",hbuttonbox1,(GtkDestroyNotify)gtk_widget_unref ); |
3616 | 219 gtk_widget_set_usize( hbuttonbox1,-2,25 ); |
220 gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),75,0 ); | |
2901 | 221 gtk_widget_show( hbuttonbox1 ); |
222 gtk_box_pack_start( GTK_BOX( vbox1 ),hbuttonbox1,FALSE,FALSE,0 ); | |
223 | |
224 Ok=gtk_button_new_with_label( MSGTR_Ok ); | |
225 gtk_widget_set_name( Ok,MSGTR_Ok ); | |
226 gtk_widget_ref( Ok ); | |
6146 | 227 gtk_object_set_data_full( GTK_OBJECT( About ),MSGTR_Ok,Ok,(GtkDestroyNotify)gtk_widget_unref ); |
2901 | 228 gtk_widget_show( Ok ); |
229 gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Ok ); | |
230 | |
6146 | 231 gtk_signal_connect( GTK_OBJECT( About ),"destroy",GTK_SIGNAL_FUNC( ab_Ok_released ),0 ); |
6794 | 232 gtk_signal_connect( GTK_OBJECT( About ),"show",GTK_SIGNAL_FUNC( ab_AboutBox_show ),(void *)1 ); |
6146 | 233 gtk_signal_connect( GTK_OBJECT( About ),"hide",GTK_SIGNAL_FUNC( ab_AboutBox_show ),0 ); |
234 gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( ab_Ok_released ),0 ); | |
2901 | 235 |
236 gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); | |
237 gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); | |
238 gtk_window_add_accel_group( GTK_WINDOW( About ),accel_group ); | |
239 | |
240 return About; | |
241 } |