diff options
Diffstat (limited to 'Gui/mplayer/gtk')
-rw-r--r-- | Gui/mplayer/gtk/about.c | 4 | ||||
-rw-r--r-- | Gui/mplayer/gtk/fs.c | 130 | ||||
-rw-r--r-- | Gui/mplayer/gtk/mb.c | 254 | ||||
-rw-r--r-- | Gui/mplayer/gtk/opts.c | 4 | ||||
-rw-r--r-- | Gui/mplayer/gtk/pl.c | 2 | ||||
-rw-r--r-- | Gui/mplayer/gtk/sb.c | 8 |
6 files changed, 165 insertions, 237 deletions
diff --git a/Gui/mplayer/gtk/about.c b/Gui/mplayer/gtk/about.c index 3f881aee2d..058586b70b 100644 --- a/Gui/mplayer/gtk/about.c +++ b/Gui/mplayer/gtk/about.c @@ -8,9 +8,7 @@ #include "about.h" void ab_Ok_released( GtkButton * button,gpointer user_data ) -{ - gtk_widget_hide( AboutBox ); -} +{ gtk_widget_destroy( AboutBox ); } GtkWidget * create_About( void ) { diff --git a/Gui/mplayer/gtk/fs.c b/Gui/mplayer/gtk/fs.c index a193ea455c..2a01385ca6 100644 --- a/Gui/mplayer/gtk/fs.c +++ b/Gui/mplayer/gtk/fs.c @@ -181,10 +181,24 @@ void CheckDir( GtkWidget * list,char * directory ) gtk_widget_show( list ); } +static int FirstInit = 1; + void ShowFileSelect( int type ) { int i; - gtk_widget_hide( FileSelect ); + FileSelect=create_FileSelect(); + + if ( FirstInit ) + { + fsTopList_items=g_list_append( fsTopList_items,(gchar *)get_current_dir_name() ); + if ( getenv( "HOME" ) ) fsTopList_items=g_list_append( fsTopList_items,getenv( "HOME" ) ); + fsTopList_items=g_list_append( fsTopList_items,"/home" ); + fsTopList_items=g_list_append( fsTopList_items,"/mnt" ); + fsTopList_items=g_list_append( fsTopList_items,"/" ); + FirstInit=0; + } + gtk_combo_set_popdown_strings( GTK_COMBO( fsCombo4 ),fsTopList_items ); + fsType=type; switch ( type ) { @@ -221,9 +235,7 @@ void ShowFileSelect( int type ) } void HideFileSelect( void ) -{ - gtk_widget_hide( fsFileSelect ); -} +{ gtk_widget_destroy( fsFileSelect ); } void fs_fsFileSelect_destroy( GtkObject * object,gpointer user_data ) { HideFileSelect(); } @@ -369,11 +381,7 @@ void fs_Ok_released( GtkButton * button,gpointer user_data ) if ( !strcmp( item->data,fsSelectedDirectory ) ) i=0; item=item->next; } - if ( i ) - { - fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name() ); - gtk_combo_set_popdown_strings( GTK_COMBO( user_data ),fsTopList_items ); - } + if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name() ); if ( mplMainAutoPlay ) mplEventHandling( evPlay,0 ); } @@ -446,8 +454,7 @@ GtkWidget * create_FileSelect( void ) FSFrame=gtk_frame_new( NULL ); gtk_widget_set_name( FSFrame,"FSFrame" ); gtk_widget_ref( FSFrame ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"FSFrame",FSFrame, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"FSFrame",FSFrame,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( FSFrame ); gtk_container_add( GTK_CONTAINER( fsFileSelect ),FSFrame ); gtk_container_set_border_width( GTK_CONTAINER( FSFrame ),1 ); @@ -456,8 +463,7 @@ GtkWidget * create_FileSelect( void ) frame2=gtk_frame_new( NULL ); gtk_widget_set_name( frame2,"frame2" ); gtk_widget_ref( frame2 ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"frame2",frame2, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"frame2",frame2,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( frame2 ); gtk_container_add( GTK_CONTAINER( FSFrame ),frame2 ); gtk_frame_set_shadow_type( GTK_FRAME( frame2 ),GTK_SHADOW_NONE ); @@ -465,8 +471,7 @@ GtkWidget * create_FileSelect( void ) frame3=gtk_frame_new( NULL ); gtk_widget_set_name( frame3,"frame3" ); gtk_widget_ref( frame3 ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"frame3",frame3, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"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 ); @@ -474,8 +479,7 @@ GtkWidget * create_FileSelect( void ) frame4=gtk_frame_new( NULL ); gtk_widget_set_name( frame4,"frame4" ); gtk_widget_ref( frame4 ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"frame4",frame4, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"frame4",frame4,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( frame4 ); gtk_container_add( GTK_CONTAINER( frame3 ),frame4 ); gtk_container_set_border_width( GTK_CONTAINER( frame4 ),1 ); @@ -484,47 +488,36 @@ GtkWidget * create_FileSelect( void ) vbox4=gtk_vbox_new( FALSE,0 ); gtk_widget_set_name( vbox4,"vbox4" ); gtk_widget_ref( vbox4 ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"vbox4",vbox4, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"vbox4",vbox4,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( vbox4 ); gtk_container_add( GTK_CONTAINER( frame4 ),vbox4 ); hbox4=gtk_hbox_new( FALSE,0 ); gtk_widget_set_name( hbox4,"hbox4" ); gtk_widget_ref( hbox4 ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hbox4",hbox4, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hbox4",hbox4,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( hbox4 ); gtk_box_pack_start( GTK_BOX( vbox4 ),hbox4,FALSE,FALSE,0 ); fsCombo4=gtk_combo_new(); gtk_widget_set_name( fsCombo4,"fsCombo4" ); gtk_widget_ref( fsCombo4 ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"fsCombo4",fsCombo4, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"fsCombo4",fsCombo4,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( fsCombo4 ); gtk_box_pack_start( GTK_BOX( hbox4 ),fsCombo4,TRUE,TRUE,0 ); gtk_widget_set_usize( fsCombo4,-2,20 ); - fsTopList_items=g_list_append( fsTopList_items,(gchar *)get_current_dir_name() ); - if ( getenv( "HOME" ) ) fsTopList_items=g_list_append( fsTopList_items,getenv( "HOME" ) ); - fsTopList_items=g_list_append( fsTopList_items,"/home" ); - fsTopList_items=g_list_append( fsTopList_items,"/mnt" ); - fsTopList_items=g_list_append( fsTopList_items,"/" ); - gtk_combo_set_popdown_strings( GTK_COMBO( fsCombo4 ),fsTopList_items ); - fsPathCombo=GTK_COMBO( fsCombo4 )->entry; gtk_widget_set_name( fsPathCombo,"fsPathCombo" ); gtk_widget_ref( fsPathCombo ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"fsPathCombo",fsPathCombo,( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"fsPathCombo",fsPathCombo,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( fsPathCombo ); gtk_widget_set_usize( fsPathCombo,-2,20 ); vseparator1=gtk_vseparator_new(); gtk_widget_set_name( vseparator1,"vseparator1" ); gtk_widget_ref( vseparator1 ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"vseparator1",vseparator1, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"vseparator1",vseparator1,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( vseparator1 ); gtk_box_pack_start( GTK_BOX( hbox4 ),vseparator1,FALSE,TRUE,0 ); gtk_widget_set_usize( vseparator1,7,20 ); @@ -543,8 +536,7 @@ GtkWidget * create_FileSelect( void ) hseparator1=gtk_hseparator_new(); gtk_widget_set_name( hseparator1,"hseparator1" ); gtk_widget_ref( hseparator1 ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hseparator1",hseparator1, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hseparator1",hseparator1,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( hseparator1 ); gtk_box_pack_start( GTK_BOX( vbox4 ),hseparator1,FALSE,TRUE,0 ); gtk_widget_set_usize( hseparator1,-2,8 ); @@ -552,16 +544,14 @@ GtkWidget * create_FileSelect( void ) hbox6=gtk_hbox_new( FALSE,0 ); gtk_widget_set_name( hbox6,"hbox6" ); gtk_widget_ref( hbox6 ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hbox6",hbox6, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hbox6",hbox6,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( hbox6 ); gtk_box_pack_start( GTK_BOX( vbox4 ),hbox6,TRUE,TRUE,0 ); fsFNameListWindow=gtk_scrolled_window_new( NULL,NULL ); gtk_widget_set_name( fsFNameListWindow,"fsFNameListWindow" ); gtk_widget_ref( fsFNameListWindow ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"fsFNameListWindow",fsFNameListWindow, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"fsFNameListWindow",fsFNameListWindow,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( fsFNameListWindow ); gtk_box_pack_start( GTK_BOX( hbox6 ),fsFNameListWindow,TRUE,TRUE,0 ); gtk_widget_set_usize( fsFNameListWindow,-2,145 ); @@ -570,8 +560,7 @@ GtkWidget * create_FileSelect( void ) fsFNameList=gtk_clist_new( 2 ); gtk_widget_set_name( fsFNameList,"fsFNameList" ); gtk_widget_ref( fsFNameList ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"fsFNameList",fsFNameList, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"fsFNameList",fsFNameList,(GtkDestroyNotify)gtk_widget_unref ); gtk_container_add( GTK_CONTAINER( fsFNameListWindow ),fsFNameList ); gtk_clist_set_column_width( GTK_CLIST( fsFNameList ),0,80 ); gtk_clist_set_selection_mode( GTK_CLIST( fsFNameList ),GTK_SELECTION_BROWSE ); @@ -582,16 +571,14 @@ GtkWidget * create_FileSelect( void ) label1=gtk_label_new( "label1" ); gtk_widget_set_name( label1,"label1" ); gtk_widget_ref( label1 ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"label1",label1, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"label1",label1,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( label1 ); gtk_clist_set_column_widget( GTK_CLIST( fsFNameList ),0,label1 ); hseparator2=gtk_hseparator_new(); gtk_widget_set_name( hseparator2,"hseparator2" ); gtk_widget_ref( hseparator2 ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hseparator2",hseparator2, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hseparator2",hseparator2,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( hseparator2 ); gtk_box_pack_start( GTK_BOX( vbox4 ),hseparator2,FALSE,TRUE,0 ); gtk_widget_set_usize( hseparator2,-2,9 ); @@ -599,8 +586,7 @@ GtkWidget * create_FileSelect( void ) List=gtk_combo_new(); gtk_widget_set_name( List,"List" ); gtk_widget_ref( List ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"List",List, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"List",List,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( List ); gtk_box_pack_start( GTK_BOX( vbox4 ),List,FALSE,FALSE,0 ); gtk_widget_set_usize( List,-2,20 ); @@ -613,8 +599,7 @@ GtkWidget * create_FileSelect( void ) fsFilterCombo=GTK_COMBO( List )->entry; gtk_widget_set_name( fsFilterCombo,"fsFilterCombo" ); gtk_widget_ref( fsFilterCombo ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"fsFilterCombo",fsFilterCombo, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"fsFilterCombo",fsFilterCombo,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( fsFilterCombo ); gtk_entry_set_editable (GTK_ENTRY( fsFilterCombo ),FALSE ); gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsVideoFilterNames[fsNumberOfVideoFilterNames - 1][0] ); @@ -622,8 +607,7 @@ GtkWidget * create_FileSelect( void ) hseparator3=gtk_hseparator_new(); gtk_widget_set_name( hseparator3,"hseparator3" ); gtk_widget_ref( hseparator3 ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hseparator3",hseparator3, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hseparator3",hseparator3,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( hseparator3 ); gtk_box_pack_start( GTK_BOX( vbox4 ),hseparator3,FALSE,TRUE,0 ); gtk_widget_set_usize( hseparator3,-2,7 ); @@ -631,8 +615,7 @@ GtkWidget * create_FileSelect( void ) hbuttonbox3=gtk_hbutton_box_new(); gtk_widget_set_name( hbuttonbox3,"hbuttonbox3" ); gtk_widget_ref( hbuttonbox3 ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hbuttonbox3",hbuttonbox3, - ( GtkDestroyNotify ) gtk_widget_unref ); + gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hbuttonbox3",hbuttonbox3,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( hbuttonbox3 ); gtk_box_pack_start( GTK_BOX( vbox4 ),hbuttonbox3,FALSE,TRUE,0 ); gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox3 ),GTK_BUTTONBOX_END ); @@ -654,37 +637,16 @@ GtkWidget * create_FileSelect( void ) gtk_container_add( GTK_CONTAINER( hbuttonbox3 ),fsCancel ); gtk_widget_show( fsCancel ); - 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( 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 ); - gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"activate", - GTK_SIGNAL_FUNC( fs_fsPathCombo_activate ), - fsPathCombo ); - gtk_signal_connect( GTK_OBJECT( fsUp ),"released", - GTK_SIGNAL_FUNC( fs_Up_released ), - fsFNameList ); - gtk_signal_connect( GTK_OBJECT( fsOk ),"released", - GTK_SIGNAL_FUNC( fs_Ok_released ), - fsCombo4 ); - gtk_signal_connect( GTK_OBJECT( fsCancel ),"released", - GTK_SIGNAL_FUNC( fs_Cancel_released ), - NULL ); - - gtk_signal_connect( GTK_OBJECT( fsFNameList ),"select_row", - ( GtkSignalFunc ) fs_fsFNameList_select_row, - NULL ); + 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( 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 ); + gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"activate",GTK_SIGNAL_FUNC( fs_fsPathCombo_activate ),fsPathCombo ); + gtk_signal_connect( GTK_OBJECT( fsUp ),"released",GTK_SIGNAL_FUNC( fs_Up_released ),fsFNameList ); + gtk_signal_connect( GTK_OBJECT( fsOk ),"released",GTK_SIGNAL_FUNC( fs_Ok_released ),fsCombo4 ); + gtk_signal_connect( GTK_OBJECT( fsCancel ),"released",GTK_SIGNAL_FUNC( fs_Cancel_released ),NULL ); + gtk_signal_connect( GTK_OBJECT( fsFNameList ),"select_row",(GtkSignalFunc)fs_fsFNameList_select_row,NULL ); gtk_widget_grab_focus( fsFNameList ); diff --git a/Gui/mplayer/gtk/mb.c b/Gui/mplayer/gtk/mb.c index 31ae2f1ea8..65dc24806d 100644 --- a/Gui/mplayer/gtk/mb.c +++ b/Gui/mplayer/gtk/mb.c @@ -11,22 +11,8 @@ GtkWidget * gtkMessageBoxText; -void on_MessageBox_destroy( GtkObject * object,gpointer user_data ) -{ -/* - switch( (int)user_data ) - { - case GTK_MB_ERROR: gtk_widget_hide( ErrorMessageBox ); break; - case GTK_MB_WARNING: gtk_widget_hide( WarningMessageBox ); break; - } -*/ - gtk_widget_hide( MessageBox ); -} - -void on_Ok_released( GtkButton * button,gpointer user_data ) -{ - gtk_widget_hide( MessageBox ); -} +static void on_MessageBox_Ok_released( GtkButton * button,gpointer user_data ) +{ gtk_widget_destroy( MessageBox ); } GtkWidget * create_MessageBox( int type ) { @@ -45,140 +31,124 @@ GtkWidget * create_MessageBox( int type ) GtkPixmap * pixmapwid; GdkBitmap * mask; - accel_group = gtk_accel_group_new (); - - MessageBox = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (MessageBox, "MessageBox"); - gtk_object_set_data (GTK_OBJECT (MessageBox), "MessageBox", MessageBox); - gtk_widget_set_events (MessageBox, GDK_EXPOSURE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_VISIBILITY_NOTIFY_MASK); - gtk_window_set_title (GTK_WINDOW (MessageBox), "MPlayer ..."); - gtk_window_set_position (GTK_WINDOW (MessageBox), GTK_WIN_POS_CENTER); - gtk_window_set_modal (GTK_WINDOW (MessageBox), TRUE); - gtk_window_set_policy (GTK_WINDOW (MessageBox), TRUE, TRUE, FALSE); - - 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_widget_show (frame1); - gtk_container_add (GTK_CONTAINER (MessageBox), frame1); - gtk_container_set_border_width (GTK_CONTAINER (frame1), 1); - gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_IN); - - 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_widget_show (frame2); - gtk_container_add (GTK_CONTAINER (frame1), frame2); - gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_NONE); - - 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_widget_show (frame3); - gtk_container_add (GTK_CONTAINER (frame2), frame3); - gtk_frame_set_shadow_type (GTK_FRAME (frame3), GTK_SHADOW_ETCHED_OUT); - - 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_widget_show (frame4); - gtk_container_add (GTK_CONTAINER (frame3), frame4); - gtk_frame_set_shadow_type (GTK_FRAME (frame4), GTK_SHADOW_NONE); - - 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_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_widget_show (hbox1); - gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0); + accel_group=gtk_accel_group_new(); + + MessageBox=gtk_window_new( GTK_WINDOW_TOPLEVEL ); + gtk_widget_set_name( MessageBox,"MessageBox" ); + gtk_object_set_data( GTK_OBJECT( MessageBox ),"MessageBox",MessageBox ); + gtk_widget_set_events( MessageBox,GDK_EXPOSURE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_VISIBILITY_NOTIFY_MASK ); + gtk_window_set_title( GTK_WINDOW( MessageBox ),"MPlayer ..." ); + gtk_window_set_position( GTK_WINDOW( MessageBox ),GTK_WIN_POS_CENTER ); + gtk_window_set_modal( GTK_WINDOW( MessageBox ),TRUE ); + gtk_window_set_policy( GTK_WINDOW( MessageBox ),TRUE,TRUE,FALSE ); + + 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_widget_show( frame1 ); + gtk_container_add( GTK_CONTAINER( MessageBox ),frame1 ); + gtk_container_set_border_width( GTK_CONTAINER( frame1 ),1 ); + gtk_frame_set_shadow_type( GTK_FRAME( frame1 ),GTK_SHADOW_IN ); + + 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_widget_show( frame2 ); + gtk_container_add( GTK_CONTAINER( frame1 ),frame2 ); + gtk_frame_set_shadow_type( GTK_FRAME( frame2 ),GTK_SHADOW_NONE ); + + 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_widget_show( frame3 ); + gtk_container_add( GTK_CONTAINER( frame2 ),frame3 ); + gtk_frame_set_shadow_type( GTK_FRAME( frame3 ),GTK_SHADOW_ETCHED_OUT ); + + 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_widget_show( frame4 ); + gtk_container_add( GTK_CONTAINER( frame3 ),frame4 ); + gtk_frame_set_shadow_type( GTK_FRAME( frame4 ),GTK_SHADOW_NONE ); + + 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_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_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"); - gtk_widget_ref (WarningPixmap); - gtk_object_set_data_full (GTK_OBJECT (MessageBox), "pixmap1", WarningPixmap,(GtkDestroyNotify)gtk_widget_unref); - gtk_widget_hide (WarningPixmap); - gtk_box_pack_start (GTK_BOX (hbox1), WarningPixmap, FALSE, FALSE, 0); - gtk_widget_set_usize (WarningPixmap, 55, -2); - - gtk_widget_set_name (ErrorPixmap, "pixmap1"); - gtk_widget_ref (ErrorPixmap); - gtk_object_set_data_full (GTK_OBJECT (MessageBox), "pixmap1", ErrorPixmap,(GtkDestroyNotify)gtk_widget_unref); - gtk_widget_hide (ErrorPixmap); - gtk_box_pack_start (GTK_BOX (hbox1), ErrorPixmap, FALSE, FALSE, 0); - gtk_widget_set_usize (ErrorPixmap, 55, -2); - - 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_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); - - 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_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 (); - 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_widget_show (hbuttonbox1); + gtk_widget_set_name( WarningPixmap,"pixmap1" ); + gtk_widget_ref( WarningPixmap ); + gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"pixmap1",WarningPixmap,(GtkDestroyNotify )gtk_widget_unref ); + gtk_widget_hide( WarningPixmap ); + gtk_box_pack_start( GTK_BOX( hbox1 ),WarningPixmap,FALSE,FALSE,0 ); + gtk_widget_set_usize( WarningPixmap,55,-2 ); + + gtk_widget_set_name( ErrorPixmap,"pixmap1" ); + gtk_widget_ref( ErrorPixmap ); + gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"pixmap1",ErrorPixmap,(GtkDestroyNotify )gtk_widget_unref ); + gtk_widget_hide( ErrorPixmap ); + gtk_box_pack_start( GTK_BOX( hbox1 ),ErrorPixmap,FALSE,FALSE,0 ); + gtk_widget_set_usize( ErrorPixmap,55,-2 ); + + 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_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 ); + + 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_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( ); + 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_widget_show( hbuttonbox1 ); gtk_widget_set_usize( hbuttonbox1,-2,25 ); gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),75,0 ); - gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, FALSE, 0); - - 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_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_destroy), - NULL); - gtk_signal_connect (GTK_OBJECT (Ok), "released",GTK_SIGNAL_FUNC (on_Ok_released),NULL); - - gtk_window_add_accel_group (GTK_WINDOW (MessageBox), accel_group); + gtk_box_pack_start( GTK_BOX( vbox1 ),hbuttonbox1,FALSE,FALSE,0 ); + + 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_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_window_add_accel_group( GTK_WINDOW( MessageBox ),accel_group ); return MessageBox; } diff --git a/Gui/mplayer/gtk/opts.c b/Gui/mplayer/gtk/opts.c index 90981f28c9..d51c8be6ed 100644 --- a/Gui/mplayer/gtk/opts.c +++ b/Gui/mplayer/gtk/opts.c @@ -31,9 +31,7 @@ GtkWidget * opCancel; int opShift = 0; void HideOptions( void ) -{ - gtk_widget_hide( Options ); -} +{ gtk_widget_destroy( Options ); } gboolean on_window2_key_press_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data ) { diff --git a/Gui/mplayer/gtk/pl.c b/Gui/mplayer/gtk/pl.c index ecd2b86b86..7eecc021a4 100644 --- a/Gui/mplayer/gtk/pl.c +++ b/Gui/mplayer/gtk/pl.c @@ -8,7 +8,7 @@ void HidePlayList( void ) { - gtk_widget_hide( PlayList ); + gtk_widget_destroy( PlayList ); } void pl_PlayList_destroy( GtkObject * object,gpointer user_data ) diff --git a/Gui/mplayer/gtk/sb.c b/Gui/mplayer/gtk/sb.c index 6de1cf76b2..6488c83e3d 100644 --- a/Gui/mplayer/gtk/sb.c +++ b/Gui/mplayer/gtk/sb.c @@ -62,12 +62,12 @@ int gtkFillSkinList( gchar * mdir ) } void on_SkinBrowser_destroy( GtkObject * object,gpointer user_data ) -{ gtk_widget_hide( SkinBrowser ); } +{ gtk_widget_destroy( SkinBrowser ); } void on_SkinBrowser_Cancel( GtkObject * object,gpointer user_data ) { if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) ChangeSkin( gtkOldSkin ); - gtk_widget_hide( SkinBrowser ); + gtk_widget_destroy( SkinBrowser ); } void on_SkinBrowser_Ok( GtkObject * object,gpointer user_data ) @@ -75,7 +75,7 @@ void on_SkinBrowser_Ok( GtkObject * object,gpointer user_data ) ChangeSkin( sbSelectedSkin ); if ( skinName ) free( skinName ); skinName=strdup( sbSelectedSkin ); - gtk_widget_hide( SkinBrowser ); + gtk_widget_destroy( SkinBrowser ); } void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data ) @@ -91,7 +91,7 @@ void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * be { if ( skinName ) free( skinName ); skinName=strdup( sbSelectedSkin ); - gtk_widget_hide( SkinBrowser ); + gtk_widget_destroy( SkinBrowser ); } } |