summaryrefslogtreecommitdiffstats
path: root/Gui/mplayer/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'Gui/mplayer/gtk')
-rw-r--r--Gui/mplayer/gtk/about.c177
-rw-r--r--Gui/mplayer/gtk/about.h3
-rw-r--r--Gui/mplayer/gtk/fs.c28
-rw-r--r--Gui/mplayer/gtk/fs.h2
-rw-r--r--Gui/mplayer/gtk/mb.c53
-rw-r--r--Gui/mplayer/gtk/mb.h2
-rw-r--r--Gui/mplayer/gtk/sb.c58
-rw-r--r--Gui/mplayer/gtk/sb.h3
8 files changed, 204 insertions, 122 deletions
diff --git a/Gui/mplayer/gtk/about.c b/Gui/mplayer/gtk/about.c
index 058586b70b..23e69175dc 100644
--- a/Gui/mplayer/gtk/about.c
+++ b/Gui/mplayer/gtk/about.c
@@ -7,8 +7,24 @@
#include "../widgets.h"
#include "about.h"
+int gtkVAboutBox = 0;
+GtkWidget * AboutBox;
+
+void ShowAboutBox( void )
+{
+ if ( gtkVAboutBox ) gtkActive( AboutBox );
+ else AboutBox=create_About();
+ gtk_widget_show( AboutBox );
+}
+
+void ab_AboutBox_show( GtkButton * button,gpointer user_data )
+{ gtkVAboutBox=(int)user_data; }
+
void ab_Ok_released( GtkButton * button,gpointer user_data )
-{ gtk_widget_destroy( AboutBox ); }
+{
+ gtkVAboutBox=(int)user_data;
+ gtk_widget_destroy( AboutBox );
+}
GtkWidget * create_About( void )
{
@@ -32,7 +48,7 @@ GtkWidget * create_About( void )
GtkAccelGroup * accel_group;
- accel_group=gtk_accel_group_new( );
+ accel_group=gtk_accel_group_new();
About=gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_widget_set_name( About,MSGTR_About );
@@ -45,7 +61,7 @@ GtkWidget * create_About( void )
frame1=gtk_frame_new( NULL );
gtk_widget_set_name( frame1,"frame1" );
gtk_widget_ref( frame1 );
- gtk_object_set_data_full( GTK_OBJECT( About ),"frame1",frame1,( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( About ),"frame1",frame1,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( frame1 );
gtk_container_add( GTK_CONTAINER( About ),frame1 );
gtk_frame_set_shadow_type( GTK_FRAME( frame1 ),GTK_SHADOW_IN );
@@ -53,7 +69,7 @@ GtkWidget * create_About( void )
frame2=gtk_frame_new( NULL );
gtk_widget_set_name( frame2,"frame2" );
gtk_widget_ref( frame2 );
- gtk_object_set_data_full( GTK_OBJECT( About ),"frame2",frame2,( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( About ),"frame2",frame2,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( frame2 );
gtk_container_add( GTK_CONTAINER( frame1 ),frame2 );
gtk_frame_set_shadow_type( GTK_FRAME( frame2 ),GTK_SHADOW_NONE );
@@ -61,7 +77,7 @@ GtkWidget * create_About( void )
frame3=gtk_frame_new( NULL );
gtk_widget_set_name( frame3,"frame3" );
gtk_widget_ref( frame3 );
- gtk_object_set_data_full( GTK_OBJECT( About ),"frame3",frame3,( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( About ),"frame3",frame3,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( frame3 );
gtk_container_add( GTK_CONTAINER( frame2 ),frame3 );
gtk_frame_set_shadow_type( GTK_FRAME( frame3 ),GTK_SHADOW_ETCHED_OUT );
@@ -69,7 +85,7 @@ GtkWidget * create_About( void )
frame4=gtk_frame_new( NULL );
gtk_widget_set_name( frame4,"frame4" );
gtk_widget_ref( frame4 );
- gtk_object_set_data_full( GTK_OBJECT( About ),"frame4",frame4,( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( About ),"frame4",frame4,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( frame4 );
gtk_container_add( GTK_CONTAINER( frame3 ),frame4 );
gtk_frame_set_shadow_type( GTK_FRAME( frame4 ),GTK_SHADOW_NONE );
@@ -77,7 +93,7 @@ GtkWidget * create_About( void )
vbox1=gtk_vbox_new( FALSE,0 );
gtk_widget_set_name( vbox1,"vbox1" );
gtk_widget_ref( vbox1 );
- gtk_object_set_data_full( GTK_OBJECT( About ),"vbox1",vbox1,( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( About ),"vbox1",vbox1,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( vbox1 );
gtk_container_add( GTK_CONTAINER( frame4 ),vbox1 );
@@ -87,7 +103,7 @@ GtkWidget * create_About( void )
gtk_widget_set_name( pixmap1,"pixmap1" );
gtk_widget_ref( pixmap1 );
- gtk_object_set_data_full( GTK_OBJECT( About ),"pixmap1",pixmap1,( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( About ),"pixmap1",pixmap1,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( pixmap1 );
gtk_box_pack_start( GTK_BOX( vbox1 ),pixmap1,FALSE,FALSE,0 );
gtk_widget_set_usize( pixmap1,-2,174 );
@@ -95,7 +111,7 @@ GtkWidget * create_About( void )
hseparator2=gtk_hseparator_new( );
gtk_widget_set_name( hseparator2,"hseparator2" );
gtk_widget_ref( hseparator2 );
- gtk_object_set_data_full( GTK_OBJECT( About ),"hseparator2",hseparator2,( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( About ),"hseparator2",hseparator2,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( hseparator2 );
gtk_box_pack_start( GTK_BOX( vbox1 ),hseparator2,FALSE,FALSE,0 );
gtk_widget_set_usize( hseparator2,-2,7 );
@@ -103,7 +119,7 @@ GtkWidget * create_About( void )
scrolledwindow1=gtk_scrolled_window_new( NULL,NULL );
gtk_widget_set_name( scrolledwindow1,"scrolledwindow1" );
gtk_widget_ref( scrolledwindow1 );
- gtk_object_set_data_full( GTK_OBJECT( About ),"scrolledwindow1",scrolledwindow1,( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( About ),"scrolledwindow1",scrolledwindow1,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( scrolledwindow1 );
gtk_box_pack_start( GTK_BOX( vbox1 ),scrolledwindow1,TRUE,TRUE,0 );
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC );
@@ -111,69 +127,83 @@ GtkWidget * create_About( void )
AboutText=gtk_text_new( NULL,NULL );
gtk_widget_set_name( AboutText,"AboutText" );
gtk_widget_ref( AboutText );
- gtk_object_set_data_full( GTK_OBJECT( About ),"AboutText",AboutText,( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( About ),"AboutText",AboutText,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( AboutText );
gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),AboutText );
gtk_text_insert( GTK_TEXT( AboutText ),NULL,NULL,NULL,
- "\nMPlayer code:\n" \
- " fileformat detection,demuxers - A'rpi\n" \
- " DVD support - ( alpha version was: LGB ) now: ?\n" \
- " network streaming - Bertrand BAUDET\n" \
- " A-V sync code - A'rpi\n" \
- " subtitles file parser/reader - Lez( most of them )\n" \
- " config files & commandline parser - Szabi\n" \
- " fastmemcpy - Nick Kurshev\n" \
- " LIRC support - Acki\n" \
- " SUB/OSD renderer - Adam Tla/lka\n" \
- " Gui - Pontscho\n\nlibvo drivers:\n" \
- " vo_aa.c - Folke Ashberg\n" \
- " vo_dga.c - Acki\n" \
- " vo_fbdev.c - Szabi\n" \
- " vo_ggi.c - al3x\n" \
- " vo_gl.c - A'rpi\n" \
- " vo_md5.c - A'rpi\n" \
- " vo_mga.c - A'rpi\n" \
- " vo_null.c - A'rpi\n" \
- " vo_odivx.c - A'rpi\n" \
- " vo_pgm.c - A'rpi\n" \
- " vo_png.c - Atmos\n" \
- " vo_sdl.c - Atmos\n" \
- " vo_svga.c - se7en\n" \
- " vo_x11.c - Pontscho\n"\
- " vo_xmga.c - Pontscho\n"\
- " vo_xv.c - Pontscho\n" \
- " vo_aa.c - Folke Ashberg\n\n" \
- "libao2 drivers:\n" \
- " ao_alsa5.c - al3x\n" \
- " ao_alsa9.c - al3x( BUGGY,use oss )\n" \
- " ao_null.c - A'rpi\n" \
- " ao_oss.c - A'rpi\n" \
- " ao_pcm.c - Atmos\n" \
- " ao_sdl.c - Atmos\n" \
- " ao_sun.c - Jürgen Keil\n\n" \
- "Homepage:\n" \
- " Design: Chass\n" \
- " Contents: Gabucino\n" \
- " LGB\n\n" \
- "English documentation:\n" \
- " tech-*.txt: A'rpi\n" \
- " all the others: Gabucino\n\n" \
- "Documentation translations:\n" \
- " Hungarian - Gabucino\n" \
- " Spanish - TeLeNiEkO\n" \
- " Russian - Nick Kurshev\n" \
- " Polish - Dariush Pietrzak\n" \
- " German - Atmosfear\n\n" \
- "Platforms/ports:\n" \
- " DEBIAN packaging - Dariush Pietrzak\n" \
- " FreeBSD support - Vladimir Kushnir\n" \
- " Solaris 8 support - Jürgen Keil\n",1535 );
-
- hseparator1=gtk_hseparator_new( );
+ "\n" \
+ " MPlayer core team:\n" \
+ "\n" \
+ " * Arpad Gereoffy (A'rpi/ESP-team)\n" \
+ " * Zoltan Ponekker (Pontscho/Fresh!mindworkz)\n" \
+ " * Gabor Berczi (Gabucino)\n" \
+ " * Alex Beregszaszi (al3x)\n" \
+ " * Gabor Lenart (LGB)\n" \
+ " * Felix Bunemann (Atmos)\n" \
+ " * Alban Bedel (Albeu)\n" \
+ " * pl\n" \
+ " * Michael Niedermayer\n" \
+ "\n" \
+ " Additional codes:\n" \
+ "\n" \
+ " * Szabolcs Berecz (Szabi)\n" \
+ " * Laszlo Megyer (Lez, Laaz)\n" \
+ " * Gyula Laszlo (Chass, Tegla)\n" \
+ " * Zoltan Mark Vician (Se7en)\n" \
+ " * Andreas Ackermann (Acki)\n" \
+ " * TeLeNiEkO\n" \
+ " * Michael Graffam\n" \
+ " * Jens Hoffmann\n" \
+ " * German Gomez Garcia\n" \
+ " * Dariusz Pietrzak (Eyck)\n" \
+ " * Marcus Comstedt\n" \
+ " * Jurgen Keil\n" \
+ " * Vladimir Kushnir\n" \
+ " * Bertrand BAUDET\n" \
+ " * Derek J Witt\n" \
+ " * Artur Zaprzala\n" \
+ " * lanzz@lanzz.org\n" \
+ " * Adam Tla/lka\n" \
+ " * Folke Ashberg\n" \
+ " * Kamil Toman\n" \
+ " * Ivan Kalvatchev\n" \
+ " * Sven Goethel\n" \
+ " * joy_ping\n" \
+ " * Eric Anholt\n" \
+ " * Jiri Svoboda\n" \
+ " * Oliver Schoenbrunner\n" \
+ " * Jeroen Dobbelaere\n" \
+ " * David Holm\n" \
+ " * Panagiotis Issaris\n" \
+ " * Mike Melanson\n" \
+ " * Tobias Diedrich\n" \
+ " * Kilian A. Foth\n" \
+ " * Tim Ferguson\n" \
+ " * Sam Lin\n" \
+ " * Johannes Feigl\n" \
+ " * Kim Minh Kaplan\n" \
+ " * Brian Kuschak\n" \
+ " * Stephen Davies\n" \
+ " * Rik Snel\n" \
+ " * Anders Johansson\n" \
+ " * Roberto Togni\n" \
+ " * Wojtek Kaniewski\n" \
+ " * Fredrik Kuivinen\n" \
+ "\n" \
+ " Main testers:\n" \
+ "\n" \
+ " * Tibor Balazs (Tibcu)\n" \
+ " * Peter Sasi (SaPe)\n" \
+ " * Christoph H. Lampert\n" \
+ " * Attila Kinali\n" \
+ " * Dirk Vornheder\n" \
+ " * Bohdan Horst (Nexus)\n" \
+ "\n",1481 );
+
+ hseparator1=gtk_hseparator_new();
gtk_widget_set_name( hseparator1,"hseparator1" );
gtk_widget_ref( hseparator1 );
- gtk_object_set_data_full( GTK_OBJECT( About ),"hseparator1",hseparator1,
- ( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( About ),"hseparator1",hseparator1,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( hseparator1 );
gtk_box_pack_start( GTK_BOX( vbox1 ),hseparator1,FALSE,FALSE,0 );
gtk_widget_set_usize( hseparator1,-2,10 );
@@ -181,8 +211,7 @@ GtkWidget * create_About( void )
hbuttonbox1=gtk_hbutton_box_new( );
gtk_widget_set_name( hbuttonbox1,"hbuttonbox1" );
gtk_widget_ref( hbuttonbox1 );
- gtk_object_set_data_full( GTK_OBJECT( About ),"hbuttonbox1",hbuttonbox1,
- ( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( About ),"hbuttonbox1",hbuttonbox1,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_set_usize( hbuttonbox1,-2,25 );
gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),75,0 );
gtk_widget_show( hbuttonbox1 );
@@ -191,12 +220,14 @@ GtkWidget * create_About( void )
Ok=gtk_button_new_with_label( MSGTR_Ok );
gtk_widget_set_name( Ok,MSGTR_Ok );
gtk_widget_ref( Ok );
- gtk_object_set_data_full( GTK_OBJECT( About ),MSGTR_Ok,Ok,( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( About ),MSGTR_Ok,Ok,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( Ok );
gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Ok );
- gtk_signal_connect( GTK_OBJECT( About ),"destroy",GTK_SIGNAL_FUNC( ab_Ok_released ),NULL );
- gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( ab_Ok_released ),NULL );
+ gtk_signal_connect( GTK_OBJECT( About ),"destroy",GTK_SIGNAL_FUNC( ab_Ok_released ),0 );
+ gtk_signal_connect( GTK_OBJECT( About ),"show",GTK_SIGNAL_FUNC( ab_AboutBox_show ),1 );
+ gtk_signal_connect( GTK_OBJECT( About ),"hide",GTK_SIGNAL_FUNC( ab_AboutBox_show ),0 );
+ gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( ab_Ok_released ),0 );
gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
diff --git a/Gui/mplayer/gtk/about.h b/Gui/mplayer/gtk/about.h
index 494eece7bf..5ca03a929a 100644
--- a/Gui/mplayer/gtk/about.h
+++ b/Gui/mplayer/gtk/about.h
@@ -4,6 +4,9 @@
#include <gtk/gtk.h>
+extern GtkWidget * AboutBox;
+
extern GtkWidget * create_About( void );
+extern void ShowAboutBox( void );
#endif
diff --git a/Gui/mplayer/gtk/fs.c b/Gui/mplayer/gtk/fs.c
index 9eb60ac3d7..a3ffb2f28d 100644
--- a/Gui/mplayer/gtk/fs.c
+++ b/Gui/mplayer/gtk/fs.c
@@ -38,6 +38,8 @@ int fsPressed = 0;
int fsMessage = -1;
int fsType = 0;
+int gtkVFileSelect = 0;
+
#define fsNumberOfVideoFilterNames 9
char * fsVideoFilterNames[fsNumberOfVideoFilterNames+1][2] =
{ { "MPEG files (*.mpg,*.mpeg)", "*.mpg,*.mpeg" },
@@ -186,7 +188,9 @@ static int FirstInit = 1;
void ShowFileSelect( int type )
{
int i;
- FileSelect=create_FileSelect();
+
+ if ( gtkVFileSelect ) gtkActive( fsFileSelect );
+ else fsFileSelect=create_FileSelect();
if ( FirstInit )
{
@@ -231,11 +235,15 @@ void ShowFileSelect( int type )
gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsOtherFilterNames[fsNumberOfOtherFilterNames][0] );
break;
}
- gtk_widget_show( FileSelect );
+ gtk_widget_show( fsFileSelect );
}
void HideFileSelect( void )
-{ gtk_widget_destroy( fsFileSelect ); }
+{
+ gtk_widget_hide( fsFileSelect );
+ gtk_widget_destroy( fsFileSelect );
+ gtkVFileSelect=0;
+}
void fs_fsFileSelect_destroy( GtkObject * object,gpointer user_data )
{ HideFileSelect(); }
@@ -336,8 +344,6 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
return;
}
- HideFileSelect();
-
switch( fsPressed )
{
case 1:
@@ -346,7 +352,7 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
case 2:
str=gtk_entry_get_text( GTK_ENTRY( fsPathCombo ) );
fsSelectedFile=str;
- if ( !fsFileExist( fsSelectedFile ) ) return;
+ if ( !fsFileExist( fsSelectedFile ) ) { HideFileSelect(); return; }
fsSelectedDirectory=fsSelectedFile;
size=strlen( fsSelectedDirectory );
for ( j=0;j<size;j++ )
@@ -375,6 +381,9 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
guiSetDF( guiIntfStruct.Othername,fsSelectedDirectory,fsSelectedFile );
break;
}
+
+ HideFileSelect();
+
item=fsTopList_items;
while( item )
{
@@ -413,6 +422,9 @@ gboolean on_FileSelect_key_release_event( GtkWidget * widget,GdkEventKey * event
return FALSE;
}
+void fs_FileSelect_show( GtkWidget * widget,gpointer user_data )
+{ gtkVFileSelect=(int)user_data; }
+
GtkWidget * create_FileSelect( void )
{
GtkWidget * FSFrame;
@@ -639,6 +651,10 @@ GtkWidget * create_FileSelect( void )
gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"destroy",GTK_SIGNAL_FUNC( fs_fsFileSelect_destroy ),NULL );
gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL );
+
+ gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"show",GTK_SIGNAL_FUNC( fs_FileSelect_show ),1 );
+ gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"hide",GTK_SIGNAL_FUNC( fs_FileSelect_show ),0 );
+
gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsFilterCombo_changed ),fsFilterCombo );
gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"activate",GTK_SIGNAL_FUNC( fs_fsFilterCombo_activate ),fsFilterCombo );
gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsPathCombo_changed ),fsPathCombo );
diff --git a/Gui/mplayer/gtk/fs.h b/Gui/mplayer/gtk/fs.h
index 660dff8b4e..c0368394e0 100644
--- a/Gui/mplayer/gtk/fs.h
+++ b/Gui/mplayer/gtk/fs.h
@@ -7,6 +7,8 @@
#define fsSubtitleSelector 1
#define fsOtherSelector 2
+extern GtkWidget * fsFileSelect;
+
extern void HideFileSelect( void );
extern void ShowFileSelect( int type );
diff --git a/Gui/mplayer/gtk/mb.c b/Gui/mplayer/gtk/mb.c
index 65dc24806d..4594ea6d6b 100644
--- a/Gui/mplayer/gtk/mb.c
+++ b/Gui/mplayer/gtk/mb.c
@@ -10,9 +10,22 @@
#include "mb.h"
GtkWidget * gtkMessageBoxText;
+GtkWidget * MessageBox;
-static void on_MessageBox_Ok_released( GtkButton * button,gpointer user_data )
-{ gtk_widget_destroy( MessageBox ); }
+int gtkVMessageBox = 0;
+
+void ShowMessageBox( char * msg )
+{
+ if ( gtkVMessageBox ) gtkActive( MessageBox );
+ else MessageBox=create_MessageBox( 0 );
+ if ( strlen( msg ) < 20 ) gtk_widget_set_usize( MessageBox,196,-1 );
+}
+
+static void on_Ok_released( GtkButton * button,gpointer user_data )
+{ gtkVMessageBox=0; gtk_widget_destroy( MessageBox ); }
+
+static void on_MessageBox_show( GtkButton * button,gpointer user_data )
+{ gtkVMessageBox=(int)user_data; }
GtkWidget * create_MessageBox( int type )
{
@@ -45,7 +58,7 @@ GtkWidget * create_MessageBox( int type )
frame1=gtk_frame_new( NULL );
gtk_widget_set_name( frame1,"frame1" );
gtk_widget_ref( frame1 );
- gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame1",frame1,(GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame1",frame1,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( frame1 );
gtk_container_add( GTK_CONTAINER( MessageBox ),frame1 );
gtk_container_set_border_width( GTK_CONTAINER( frame1 ),1 );
@@ -54,7 +67,7 @@ GtkWidget * create_MessageBox( int type )
frame2=gtk_frame_new( NULL );
gtk_widget_set_name( frame2,"frame2" );
gtk_widget_ref( frame2 );
- gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame2",frame2,(GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame2",frame2,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( frame2 );
gtk_container_add( GTK_CONTAINER( frame1 ),frame2 );
gtk_frame_set_shadow_type( GTK_FRAME( frame2 ),GTK_SHADOW_NONE );
@@ -62,7 +75,7 @@ GtkWidget * create_MessageBox( int type )
frame3=gtk_frame_new( NULL );
gtk_widget_set_name( frame3,"frame3" );
gtk_widget_ref( frame3 );
- gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame3",frame3,(GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame3",frame3,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( frame3 );
gtk_container_add( GTK_CONTAINER( frame2 ),frame3 );
gtk_frame_set_shadow_type( GTK_FRAME( frame3 ),GTK_SHADOW_ETCHED_OUT );
@@ -70,7 +83,7 @@ GtkWidget * create_MessageBox( int type )
frame4=gtk_frame_new( NULL );
gtk_widget_set_name( frame4,"frame4" );
gtk_widget_ref( frame4 );
- gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame4",frame4,(GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame4",frame4,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( frame4 );
gtk_container_add( GTK_CONTAINER( frame3 ),frame4 );
gtk_frame_set_shadow_type( GTK_FRAME( frame4 ),GTK_SHADOW_NONE );
@@ -78,22 +91,22 @@ GtkWidget * create_MessageBox( int type )
vbox1=gtk_vbox_new( FALSE,0 );
gtk_widget_set_name( vbox1,"vbox1" );
gtk_widget_ref( vbox1 );
- gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"vbox1",vbox1,(GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"vbox1",vbox1,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( vbox1 );
gtk_container_add( GTK_CONTAINER( frame4 ),vbox1 );
hbox1=gtk_hbox_new( FALSE,0 );
gtk_widget_set_name( hbox1,"hbox1" );
gtk_widget_ref( hbox1 );
- gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"hbox1",hbox1,(GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"hbox1",hbox1,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( hbox1 );
gtk_box_pack_start( GTK_BOX( vbox1 ),hbox1,TRUE,TRUE,0 );
pixmapstyle=gtk_widget_get_style( MessageBox );
- pixmapwid=gdk_pixmap_colormap_create_from_xpm_d( MessageBox->window,gdk_colormap_get_system( ),&mask,&pixmapstyle->bg[GTK_STATE_NORMAL],(gchar ** )warning_xpm );
+ pixmapwid=gdk_pixmap_colormap_create_from_xpm_d( MessageBox->window,gdk_colormap_get_system(),&mask,&pixmapstyle->bg[GTK_STATE_NORMAL],(gchar ** )warning_xpm );
WarningPixmap=gtk_pixmap_new( pixmapwid,mask );
- pixmapwid=gdk_pixmap_colormap_create_from_xpm_d( MessageBox->window,gdk_colormap_get_system( ),&mask,&pixmapstyle->bg[GTK_STATE_NORMAL],(gchar ** )error_xpm );
+ pixmapwid=gdk_pixmap_colormap_create_from_xpm_d( MessageBox->window,gdk_colormap_get_system(),&mask,&pixmapstyle->bg[GTK_STATE_NORMAL],(gchar ** )error_xpm );
ErrorPixmap=gtk_pixmap_new( pixmapwid,mask );
gtk_widget_set_name( WarningPixmap,"pixmap1" );
@@ -113,24 +126,24 @@ GtkWidget * create_MessageBox( int type )
gtkMessageBoxText=gtk_label_new( "Text jol. Ha ezt megerted,akkor neked nagyon jo a magyar tudasod,te." );
gtk_widget_set_name( gtkMessageBoxText,"gtkMessageBoxText" );
gtk_widget_ref( gtkMessageBoxText );
- gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"gtkMessageBoxText",gtkMessageBoxText,(GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"gtkMessageBoxText",gtkMessageBoxText,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( gtkMessageBoxText );
gtk_box_pack_start( GTK_BOX( hbox1 ),gtkMessageBoxText,TRUE,TRUE,0 );
gtk_label_set_justify( GTK_LABEL( gtkMessageBoxText ),GTK_JUSTIFY_FILL );
- gtk_label_set_line_wrap( GTK_LABEL( gtkMessageBoxText ),TRUE );
+ gtk_label_set_line_wrap( GTK_LABEL( gtkMessageBoxText ),FALSE );
- hseparator1=gtk_hseparator_new( );
+ hseparator1=gtk_hseparator_new();
gtk_widget_set_name( hseparator1,"hseparator1" );
gtk_widget_ref( hseparator1 );
- gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"hseparator1",hseparator1,(GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"hseparator1",hseparator1,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( hseparator1 );
gtk_box_pack_start( GTK_BOX( vbox1 ),hseparator1,FALSE,FALSE,0 );
gtk_widget_set_usize( hseparator1,-2,9 );
- hbuttonbox1=gtk_hbutton_box_new( );
+ hbuttonbox1=gtk_hbutton_box_new();
gtk_widget_set_name( hbuttonbox1,"hbuttonbox1" );
gtk_widget_ref( hbuttonbox1 );
- gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"hbuttonbox1",hbuttonbox1,(GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"hbuttonbox1",hbuttonbox1,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( hbuttonbox1 );
gtk_widget_set_usize( hbuttonbox1,-2,25 );
gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),75,0 );
@@ -139,14 +152,16 @@ GtkWidget * create_MessageBox( int type )
Ok=gtk_button_new_with_label( MSGTR_Ok );
gtk_widget_set_name( Ok,MSGTR_Ok );
gtk_widget_ref( Ok );
- gtk_object_set_data_full( GTK_OBJECT( MessageBox ),MSGTR_Ok,Ok,(GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( MessageBox ),MSGTR_Ok,Ok,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( Ok );
gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Ok );
gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
- gtk_signal_connect( GTK_OBJECT( MessageBox ),"destroy_event",GTK_SIGNAL_FUNC( on_MessageBox_Ok_released ),NULL );
- gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( on_MessageBox_Ok_released ),NULL );
+ gtk_signal_connect( GTK_OBJECT( MessageBox ),"destroy_event",GTK_SIGNAL_FUNC( on_Ok_released ),NULL );
+ gtk_signal_connect( GTK_OBJECT( MessageBox ),"show",GTK_SIGNAL_FUNC( on_MessageBox_show ),1 );
+ gtk_signal_connect( GTK_OBJECT( MessageBox ),"hide",GTK_SIGNAL_FUNC( on_MessageBox_show ),0 );
+ gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( on_Ok_released ),NULL );
gtk_window_add_accel_group( GTK_WINDOW( MessageBox ),accel_group );
diff --git a/Gui/mplayer/gtk/mb.h b/Gui/mplayer/gtk/mb.h
index ef6c50f283..8cd18c12d1 100644
--- a/Gui/mplayer/gtk/mb.h
+++ b/Gui/mplayer/gtk/mb.h
@@ -5,7 +5,9 @@
#include <gtk/gtk.h>
extern GtkWidget * gtkMessageBoxText;
+extern GtkWidget * MessageBox;
extern GtkWidget * create_MessageBox( int type );
+extern void ShowMessageBox( char * msg );
#endif
diff --git a/Gui/mplayer/gtk/sb.c b/Gui/mplayer/gtk/sb.c
index 6488c83e3d..0c3a4a960b 100644
--- a/Gui/mplayer/gtk/sb.c
+++ b/Gui/mplayer/gtk/sb.c
@@ -22,6 +22,21 @@ char * sbMPlayerPrefixDir=NULL;
char * gtkOldSkin;
static char * prev;
+int gtkVSkinBrowser = 0;
+GtkWidget * SkinBrowser;
+
+void ShowSkinBrowser( void )
+{
+ if ( gtkVSkinBrowser ) gtkActive( SkinBrowser );
+ else SkinBrowser=create_SkinBrowser();
+}
+
+void HideSkinBrowser( void )
+{
+ gtkVSkinBrowser=0;
+ gtk_widget_destroy( SkinBrowser );
+}
+
int gtkFillSkinList( gchar * mdir )
{
gchar * str[2];
@@ -62,12 +77,15 @@ int gtkFillSkinList( gchar * mdir )
}
void on_SkinBrowser_destroy( GtkObject * object,gpointer user_data )
-{ gtk_widget_destroy( SkinBrowser ); }
+{ HideSkinBrowser(); }
+
+void on_SkinBrowser_show( GtkObject * object,gpointer user_data )
+{ gtkVSkinBrowser=(int)user_data; }
void on_SkinBrowser_Cancel( GtkObject * object,gpointer user_data )
{
if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) ChangeSkin( gtkOldSkin );
- gtk_widget_destroy( SkinBrowser );
+ HideSkinBrowser();
}
void on_SkinBrowser_Ok( GtkObject * object,gpointer user_data )
@@ -75,7 +93,7 @@ void on_SkinBrowser_Ok( GtkObject * object,gpointer user_data )
ChangeSkin( sbSelectedSkin );
if ( skinName ) free( skinName );
skinName=strdup( sbSelectedSkin );
- gtk_widget_destroy( SkinBrowser );
+ HideSkinBrowser();
}
void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data )
@@ -91,7 +109,7 @@ void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * be
{
if ( skinName ) free( skinName );
skinName=strdup( sbSelectedSkin );
- gtk_widget_destroy( SkinBrowser );
+ HideSkinBrowser();
}
}
@@ -130,8 +148,7 @@ GtkWidget * create_SkinBrowser( void )
frame5=gtk_frame_new( NULL );
gtk_widget_set_name( frame5,"frame5" );
gtk_widget_ref( frame5 );
- gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame5",frame5,
- ( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame5",frame5,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( frame5 );
gtk_container_add( GTK_CONTAINER( SkinBrowser ),frame5 );
gtk_frame_set_shadow_type( GTK_FRAME( frame5 ),GTK_SHADOW_IN );
@@ -139,8 +156,7 @@ GtkWidget * create_SkinBrowser( void )
frame6=gtk_frame_new( NULL );
gtk_widget_set_name( frame6,"frame6" );
gtk_widget_ref( frame6 );
- gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame6",frame6,
- ( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame6",frame6,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( frame6 );
gtk_container_add( GTK_CONTAINER( frame5 ),frame6 );
gtk_frame_set_shadow_type( GTK_FRAME( frame6 ),GTK_SHADOW_NONE );
@@ -148,8 +164,7 @@ GtkWidget * create_SkinBrowser( void )
frame7=gtk_frame_new( NULL );
gtk_widget_set_name( frame7,"frame7" );
gtk_widget_ref( frame7 );
- gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame7",frame7,
- ( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame7",frame7,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( frame7 );
gtk_container_add( GTK_CONTAINER( frame6 ),frame7 );
gtk_frame_set_shadow_type( GTK_FRAME( frame7 ),GTK_SHADOW_ETCHED_OUT );
@@ -157,8 +172,7 @@ GtkWidget * create_SkinBrowser( void )
frame8=gtk_frame_new( NULL );
gtk_widget_set_name( frame8,"frame8" );
gtk_widget_ref( frame8 );
- gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame8",frame8,
- ( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame8",frame8,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( frame8 );
gtk_container_add( GTK_CONTAINER( frame7 ),frame8 );
gtk_frame_set_shadow_type( GTK_FRAME( frame8 ),GTK_SHADOW_NONE );
@@ -166,16 +180,14 @@ GtkWidget * create_SkinBrowser( void )
vbox5=gtk_vbox_new( FALSE,0 );
gtk_widget_set_name( vbox5,"vbox5" );
gtk_widget_ref( vbox5 );
- gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"vbox5",vbox5,
- ( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"vbox5",vbox5,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( vbox5 );
gtk_container_add( GTK_CONTAINER( frame8 ),vbox5 );
label=gtk_label_new( MSGTR_SKIN_LABEL );
gtk_widget_set_name( label,"label" );
gtk_widget_ref( label );
- gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"label",label,
- ( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"label",label,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( label );
gtk_box_pack_start( GTK_BOX( vbox5 ),label,FALSE,FALSE,0 );
gtk_label_set_justify( GTK_LABEL( label ),GTK_JUSTIFY_RIGHT );
@@ -184,8 +196,7 @@ GtkWidget * create_SkinBrowser( void )
hseparator4=gtk_hseparator_new();
gtk_widget_set_name( hseparator4,"hseparator4" );
gtk_widget_ref( hseparator4 );
- gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"hseparator4",hseparator4,
- ( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"hseparator4",hseparator4,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( hseparator4 );
gtk_box_pack_start( GTK_BOX( vbox5 ),hseparator4,FALSE,TRUE,0 );
gtk_widget_set_usize( hseparator4,-2,5 );
@@ -193,8 +204,7 @@ GtkWidget * create_SkinBrowser( void )
scrolledwindow1=gtk_scrolled_window_new( NULL,NULL );
gtk_widget_set_name( scrolledwindow1,"scrolledwindow1" );
gtk_widget_ref( scrolledwindow1 );
- gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"scrolledwindow1",scrolledwindow1,
- ( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"scrolledwindow1",scrolledwindow1,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( scrolledwindow1 );
gtk_box_pack_start( GTK_BOX( vbox5 ),scrolledwindow1,TRUE,TRUE,0 );
gtk_container_set_border_width( GTK_CONTAINER( scrolledwindow1 ),2 );
@@ -203,8 +213,7 @@ GtkWidget * create_SkinBrowser( void )
SkinList=gtk_clist_new( 1 );
gtk_widget_set_name( SkinList,"SkinList" );
gtk_widget_ref( SkinList );
- gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"SkinList",SkinList,
- ( GtkDestroyNotify ) gtk_widget_unref );
+ gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"SkinList",SkinList,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( SkinList );
gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),SkinList );
gtk_clist_set_column_width( GTK_CLIST( SkinList ),0,80 );
@@ -256,7 +265,10 @@ GtkWidget * create_SkinBrowser( void )
gtk_widget_set_usize( Cancel,-2,22 );
gtk_widget_add_accelerator( Cancel,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
- gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"destroy",GTK_SIGNAL_FUNC( on_SkinBrowser_destroy ),NULL );
+ gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"destroy",GTK_SIGNAL_FUNC( on_SkinBrowser_destroy ),0 );
+ gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"show",GTK_SIGNAL_FUNC( on_SkinBrowser_show ),1 );
+ gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"hide",GTK_SIGNAL_FUNC( on_SkinBrowser_show ),0 );
+
gtk_signal_connect( GTK_OBJECT( SkinList ),"select_row",GTK_SIGNAL_FUNC( on_SkinList_select_row ),NULL );
gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( on_SkinBrowser_Ok ),NULL );
gtk_signal_connect( GTK_OBJECT( Cancel ),"released",GTK_SIGNAL_FUNC( on_SkinBrowser_Cancel ),NULL );
diff --git a/Gui/mplayer/gtk/sb.h b/Gui/mplayer/gtk/sb.h
index b30440470b..5831d5450f 100644
--- a/Gui/mplayer/gtk/sb.h
+++ b/Gui/mplayer/gtk/sb.h
@@ -7,8 +7,9 @@ extern GtkWidget * SkinList;
extern char * sbSelectedSkin;
extern char * sbMPlayerDirInHome;
extern char * sbMPlayerPrefixDir;
+extern GtkWidget * SkinBrowser;
-extern void HideSkinBrowser( void );
+extern void ShowSkinBrowser( void );
extern int gtkFillSkinList( gchar * mdir );
extern GtkWidget * create_SkinBrowser( void );