Mercurial > mplayer.hg
changeset 8299:5b67aed0fc28
- remove some unused/nonusable variables
- remove unneded gtk function
- replace some gtk function
- small bug fixes
author | pontscho |
---|---|
date | Wed, 27 Nov 2002 22:48:56 +0000 |
parents | 3dfaa9b97035 |
children | bf8e8144dfa6 |
files | Gui/mplayer/gtk/about.c Gui/mplayer/gtk/about.h Gui/mplayer/gtk/common.c Gui/mplayer/gtk/common.h Gui/mplayer/gtk/eq.c Gui/mplayer/gtk/fs.c Gui/mplayer/gtk/mb.c Gui/mplayer/gtk/mb.h Gui/mplayer/gtk/menu.c Gui/mplayer/gtk/opts.c Gui/mplayer/gtk/opts.h Gui/mplayer/gtk/pl.c Gui/mplayer/gtk/sb.c Gui/mplayer/gtk/url.c Gui/mplayer/widgets.c |
diffstat | 15 files changed, 466 insertions(+), 1568 deletions(-) [+] |
line wrap: on
line diff
--- a/Gui/mplayer/gtk/about.c Wed Nov 27 22:45:54 2002 +0000 +++ b/Gui/mplayer/gtk/about.c Wed Nov 27 22:48:56 2002 +0000 @@ -6,40 +6,23 @@ #include "mplayer/pixmaps/about.xpm" #include "../widgets.h" #include "about.h" +#include "common.h" -int gtkVAboutBox = 0; -GtkWidget * AboutBox; +GtkWidget * About = NULL; 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 ) -{ - gtkVAboutBox=(int)user_data; - gtk_widget_destroy( AboutBox ); + if ( About ) gtkActive( About ); + else About=create_About(); + gtk_widget_show( About ); } GtkWidget * create_About( void ) { - GtkWidget * About; - GtkWidget * frame1; - GtkWidget * frame2; - GtkWidget * frame3; - GtkWidget * frame4; - GtkWidget * vbox1; + GtkWidget * vbox; GtkWidget * pixmap1; - GtkWidget * hseparator2; GtkWidget * scrolledwindow1; GtkWidget * AboutText; - GtkWidget * hseparator1; - GtkWidget * hbuttonbox1; GtkWidget * Ok; GtkStyle * pixmapstyle; @@ -57,81 +40,32 @@ gtk_window_set_title( GTK_WINDOW( About ),MSGTR_About ); gtk_window_set_position( GTK_WINDOW( About ),GTK_WIN_POS_CENTER ); gtk_window_set_policy( GTK_WINDOW( About ),TRUE,FALSE,FALSE ); - gtk_window_set_wmclass( GTK_WINDOW( About ),MSGTR_About,"MPlayer" ); + gtk_window_set_wmclass( GTK_WINDOW( About ),"About","MPlayer" ); gtk_widget_realize( About ); gtkAddIcon( About ); - - 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_widget_show( frame1 ); - gtk_container_add( GTK_CONTAINER( About ),frame1 ); - 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( 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 ); - - 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_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( 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 ); - - 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_widget_show( vbox1 ); - gtk_container_add( GTK_CONTAINER( frame4 ),vbox1 ); + + vbox=AddVBox( AddDialogFrame( About ),0 ); pixmapstyle=gtk_widget_get_style( About ); pixmapwid=gdk_pixmap_colormap_create_from_xpm_d( About->window,gdk_colormap_get_system(),&mask,&pixmapstyle->bg[GTK_STATE_NORMAL],about_xpm ); pixmap1=gtk_pixmap_new( pixmapwid,mask ); 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_widget_show( pixmap1 ); - gtk_box_pack_start( GTK_BOX( vbox1 ),pixmap1,FALSE,FALSE,0 ); + gtk_box_pack_start( GTK_BOX( vbox ),pixmap1,FALSE,FALSE,0 ); gtk_widget_set_usize( pixmap1,-2,174 ); - 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_widget_show( hseparator2 ); - gtk_box_pack_start( GTK_BOX( vbox1 ),hseparator2,FALSE,FALSE,0 ); - gtk_widget_set_usize( hseparator2,-2,7 ); + AddHSeparator( vbox ); 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_widget_show( scrolledwindow1 ); - gtk_box_pack_start( GTK_BOX( vbox1 ),scrolledwindow1,TRUE,TRUE,0 ); + gtk_box_pack_start( GTK_BOX( vbox ),scrolledwindow1,TRUE,TRUE,0 ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC ); 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_widget_show( AboutText ); gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),AboutText ); gtk_text_insert( GTK_TEXT( AboutText ),NULL,NULL,NULL, @@ -207,37 +141,14 @@ " * 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_widget_show( hseparator1 ); - gtk_box_pack_start( GTK_BOX( vbox1 ),hseparator1,FALSE,FALSE,0 ); - gtk_widget_set_usize( hseparator1,-2,10 ); + AddHSeparator( vbox ); + Ok=AddButton( MSGTR_Ok,AddHButtonBox( vbox ) ); - 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_widget_set_usize( hbuttonbox1,-2,25 ); - gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),75,0 ); - gtk_widget_show( hbuttonbox1 ); - gtk_box_pack_start( GTK_BOX( vbox1 ),hbuttonbox1,FALSE,FALSE,0 ); + gtk_signal_connect( GTK_OBJECT( About ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&About ); + gtk_signal_connect_object( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( gtk_widget_destroy ),GTK_OBJECT( About ) ); - 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_widget_show( Ok ); - gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Ok ); - - 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 ),(void *)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 ); + gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); gtk_window_add_accel_group( GTK_WINDOW( About ),accel_group ); return About;
--- a/Gui/mplayer/gtk/about.h Wed Nov 27 22:45:54 2002 +0000 +++ b/Gui/mplayer/gtk/about.h Wed Nov 27 22:48:56 2002 +0000 @@ -4,7 +4,7 @@ #include <gtk/gtk.h> -extern GtkWidget * AboutBox; +extern GtkWidget * About; extern GtkWidget * create_About( void ); extern void ShowAboutBox( void );
--- a/Gui/mplayer/gtk/common.c Wed Nov 27 22:45:54 2002 +0000 +++ b/Gui/mplayer/gtk/common.c Wed Nov 27 22:48:56 2002 +0000 @@ -2,12 +2,24 @@ #include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> +#include "common.h" + +GtkWidget * AddDialogFrame( GtkWidget * parent ) +{ + GtkWidget * frame; + frame=AddFrame( NULL,GTK_SHADOW_IN,parent,1 ); + gtk_container_set_border_width( GTK_CONTAINER( frame ),1 ); + frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); + frame=AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,frame,1 ); + frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); + return frame; +} + GtkWidget * AddFrame( char * title,int type,GtkWidget * parent,int add ) { GtkWidget * frame = NULL; frame=gtk_frame_new( title ); gtk_widget_set_name( frame,"frame" ); - gtk_widget_ref( frame ); gtk_widget_show( frame ); if ( add ) gtk_container_add( GTK_CONTAINER( parent ),frame ); else gtk_box_pack_start( GTK_BOX( parent ),frame,FALSE,FALSE,0 ); @@ -27,14 +39,17 @@ return label; } -GtkWidget * AddVBox( GtkWidget * parent ) +GtkWidget * AddVBox( GtkWidget * parent,int type ) { GtkWidget * vbox; vbox=gtk_vbox_new( FALSE,0 ); gtk_widget_set_name( vbox,"vbox" ); - gtk_widget_ref( vbox ); gtk_widget_show( vbox ); - gtk_container_add( GTK_CONTAINER( parent ),vbox ); + if ( parent ) + { + if ( type ) gtk_box_pack_start( GTK_BOX( parent ),vbox,FALSE,FALSE,0 ); + else gtk_container_add( GTK_CONTAINER( parent ),vbox ); + } return vbox; } @@ -43,10 +58,12 @@ GtkWidget * hbox; hbox=gtk_hbox_new( FALSE,0 ); gtk_widget_set_name( hbox,"hbox" ); - gtk_widget_ref( hbox ); gtk_widget_show( hbox ); - if ( type ) gtk_box_pack_start( GTK_BOX( parent ),hbox,FALSE,FALSE,0 ); - else gtk_container_add( GTK_CONTAINER( parent ),hbox ); + if ( parent ) + { + if ( type ) gtk_box_pack_start( GTK_BOX( parent ),hbox,FALSE,FALSE,0 ); + else gtk_container_add( GTK_CONTAINER( parent ),hbox ); + } return hbox; } @@ -55,7 +72,6 @@ GtkWidget * CB; CB=gtk_check_button_new_with_label( title ); gtk_widget_set_name( CB,"CB" ); - gtk_widget_ref( CB ); gtk_widget_show( CB ); gtk_box_pack_start( GTK_BOX( parent ),CB,FALSE,FALSE,0 ); return CB; @@ -67,7 +83,6 @@ RB=gtk_radio_button_new_with_label( *group,title ); *group=gtk_radio_button_group( GTK_RADIO_BUTTON( RB ) ); gtk_widget_set_name( RB,"RB" ); - gtk_widget_ref( RB ); gtk_widget_show( RB ); gtk_box_pack_start( GTK_BOX( parent ),RB,FALSE,FALSE,0 ); return RB; @@ -78,7 +93,6 @@ GtkWidget * B; B=gtk_button_new_with_label( title ); gtk_widget_set_name( B,"B" ); - gtk_widget_ref( B ); gtk_widget_show( B ); gtk_container_add( GTK_CONTAINER( parent ),B ); return B; @@ -89,7 +103,6 @@ GtkWidget * hseparator; hseparator=gtk_hseparator_new(); gtk_widget_set_name( hseparator,"hseparator1" ); - gtk_widget_ref( hseparator ); gtk_widget_show( hseparator ); gtk_box_pack_start( GTK_BOX( parent ),hseparator,FALSE,FALSE,0 ); gtk_widget_set_usize( hseparator,-2,6 ); @@ -101,7 +114,6 @@ GtkWidget * hbuttonbox; hbuttonbox=gtk_hbutton_box_new(); gtk_widget_set_name( hbuttonbox,"hbuttonbox" ); - gtk_widget_ref( hbuttonbox ); gtk_widget_show( hbuttonbox ); gtk_box_pack_start( GTK_BOX( parent ),hbuttonbox,FALSE,FALSE,0 ); gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox ),85,20 ); @@ -113,10 +125,32 @@ GtkWidget * HS; HS=gtk_hscale_new( adj ); gtk_widget_set_name( HS,"HS" ); - gtk_widget_ref( HS ); gtk_widget_show( HS ); if ( parent ) gtk_box_pack_start( GTK_BOX( parent ),HS,TRUE,TRUE,0 ); gtk_scale_set_value_pos( GTK_SCALE( HS ),GTK_POS_RIGHT ); gtk_scale_set_digits( GTK_SCALE( HS ),digit ); return HS; } + +GtkWidget * AddVScaler( GtkAdjustment * adj,GtkWidget * parent,int digit ) +{ + GtkWidget * VS; + VS=gtk_vscale_new( adj ); + gtk_widget_set_name( VS,"VS" ); + gtk_widget_show( VS ); + if ( parent ) gtk_box_pack_start( GTK_BOX( parent ),VS,TRUE,TRUE,0 ); +// gtk_scale_set_value_pos( GTK_SCALE( VS ),GTK_POS_RIGHT ); + if ( digit == -1 ) gtk_scale_set_draw_value( GTK_SCALE( VS ),FALSE ); + else gtk_scale_set_digits( GTK_SCALE( VS ),digit ); + return VS; +} + +GtkWidget * AddComboBox( GtkWidget * parent ) +{ + GtkWidget * CB; + CB=gtk_combo_new(); + gtk_widget_set_name( CB,"CB" ); + gtk_widget_show( CB ); + if ( parent ) gtk_box_pack_start( GTK_BOX( parent ),CB,TRUE,TRUE,0 ); + return CB; +}
--- a/Gui/mplayer/gtk/common.h Wed Nov 27 22:45:54 2002 +0000 +++ b/Gui/mplayer/gtk/common.h Wed Nov 27 22:48:56 2002 +0000 @@ -5,9 +5,10 @@ #include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> +extern GtkWidget * AddDialogFrame( GtkWidget * parent ); extern GtkWidget * AddFrame( char * title,int type,GtkWidget * parent,int add ); extern GtkWidget * AddLabel( char * title,GtkWidget * parent ); -extern GtkWidget * AddVBox( GtkWidget * parent ); +extern GtkWidget * AddVBox( GtkWidget * parent,int type ); extern GtkWidget * AddHBox( GtkWidget * parent,int type ); extern GtkWidget * AddCheckButton( char * title, GtkWidget * parent ); extern GtkWidget * AddRadioButton( char * title,GSList ** group,GtkWidget * parent ); @@ -15,5 +16,7 @@ extern GtkWidget * AddHSeparator( GtkWidget * parent ); extern GtkWidget * AddHButtonBox( GtkWidget * parent ); extern GtkWidget * AddHScaler( GtkAdjustment * adj,GtkWidget * parent,int digit ); +extern GtkWidget * AddVScaler( GtkAdjustment * adj,GtkWidget * parent,int digit ); +extern GtkWidget * AddComboBox( GtkWidget * parent ); #endif
--- a/Gui/mplayer/gtk/eq.c Wed Nov 27 22:45:54 2002 +0000 +++ b/Gui/mplayer/gtk/eq.c Wed Nov 27 22:48:56 2002 +0000 @@ -21,10 +21,12 @@ #include "../mplayer.h" #include "eq.h" +#include "common.h" #define eqRange 15 -GtkWidget * Equalizer; +GtkWidget * Equalizer = NULL; +static GtkWidget * EquConfig; static GtkWidget * Notebook; static GtkWidget * ChannelsList; @@ -35,8 +37,6 @@ static GtkAdjustment * A3125adj, * A125adj, * A6250adj, * A250adj, * A500adj, * A1000adj, * A2000adj, * A4000adj, * A8000adj, * A16000adj; static int Channel = -1; -static int gtkVEqualizer = 0; -static int gtkVEquConfig = 0; // --- @@ -107,7 +107,7 @@ void ShowEqualizer( void ) { - if ( gtkVEqualizer ) gtkActive( Equalizer ); + if ( Equalizer ) gtkActive( Equalizer ); else Equalizer=create_Equalizer(); if ( !gtkEquChannel1 ) gtkEquChannel1=strdup( MSGTR_EQU_Front_Right ); @@ -149,11 +149,11 @@ void HideEqualizer( void ) { - if ( !gtkVEqualizer ) return; - gtkVEqualizer=0; + if ( !Equalizer ) return; gtk_widget_hide( Equalizer ); gtk_widget_destroy( Equalizer ); - if ( gtkVEquConfig ) HideEquConfig(); + Equalizer=NULL; + if ( EquConfig ) HideEquConfig(); } static gboolean eqHScaleMotion( GtkWidget * widget,GdkEventMotion * event,gpointer user_data ) @@ -227,12 +227,6 @@ } } -gboolean eqDestroy( GtkWidget * widget,GdkEvent * event,gpointer user_data ) -{ HideEqualizer(); return FALSE; } - -static void eqShow( GtkWidget * widget,gpointer user_data ) -{ gtkVEqualizer=(int)user_data; } - static void eqFocus( GtkWindow * window,GtkWidget * widget,gpointer user_data ) { eqSetBands( Channel ); } @@ -257,35 +251,11 @@ GtkWidget * create_Equalizer( void ) { - GtkWidget * frame1; - GtkWidget * frame2; - GtkWidget * frame3; - GtkWidget * frame4; GtkWidget * vbox1; GtkWidget * hbox1; GtkWidget * scrolledwindow1; GtkWidget * table1; - GtkWidget * label3; - GtkWidget * label4; - GtkWidget * label5; - GtkWidget * label6; - GtkWidget * label7; - GtkWidget * label8; - GtkWidget * label9; - GtkWidget * label10; - GtkWidget * label11; - GtkWidget * label12; - GtkWidget * label1; - GtkWidget * hbox2; - GtkWidget * vbox2; - GtkWidget * label13; - GtkWidget * label14; - GtkWidget * label15; - GtkWidget * label16; - GtkWidget * vbox3; - GtkWidget * label2; GtkWidget * hbuttonbox1; - GtkWidget * hseparator1; GtkAccelGroup * accel_group; accel_group=gtk_accel_group_new(); @@ -293,74 +263,27 @@ Equalizer=gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_widget_set_name( Equalizer,MSGTR_Equalizer ); gtk_object_set_data( GTK_OBJECT( Equalizer ),MSGTR_Equalizer,Equalizer ); - gtk_widget_set_usize( Equalizer,550,256 ); + gtk_widget_set_usize( Equalizer,-1,256 ); gtk_window_set_title( GTK_WINDOW( Equalizer ),MSGTR_Equalizer ); gtk_window_set_position( GTK_WINDOW( Equalizer ),GTK_WIN_POS_CENTER ); gtk_window_set_policy( GTK_WINDOW( Equalizer ),FALSE,FALSE,FALSE ); - gtk_window_set_wmclass( GTK_WINDOW( Equalizer ),MSGTR_Equalizer,"MPlayer" ); + gtk_window_set_wmclass( GTK_WINDOW( Equalizer ),"Equalizer","MPlayer" ); gtk_widget_realize( Equalizer ); gtkAddIcon( Equalizer ); - - frame1=gtk_frame_new( NULL ); - gtk_widget_set_name( frame1,"frame1" ); - gtk_widget_ref( frame1 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"frame1",frame1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( frame1 ); - gtk_container_add( GTK_CONTAINER( Equalizer ),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( Equalizer ),"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( Equalizer ),"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( Equalizer ),"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( Equalizer ),"vbox1",vbox1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( vbox1 ); - gtk_container_add( GTK_CONTAINER( frame4 ),vbox1 ); + vbox1=AddVBox( AddDialogFrame( Equalizer ),0 ); Notebook=gtk_notebook_new(); gtk_widget_set_name( Notebook,"Notebook" ); - gtk_widget_ref( Notebook ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"Notebook",Notebook,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( Notebook ); gtk_box_pack_start( GTK_BOX( vbox1 ),Notebook,TRUE,TRUE,0 ); gtk_container_set_border_width( GTK_CONTAINER( Notebook ),1 ); - hbox1=gtk_hbox_new( FALSE,0 ); - gtk_widget_set_name( hbox1,"hbox1" ); - gtk_widget_ref( hbox1 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"hbox1",hbox1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( hbox1 ); - gtk_container_add( GTK_CONTAINER( Notebook ),hbox1 ); + hbox1=AddHBox( Notebook,0 ); scrolledwindow1=gtk_scrolled_window_new( NULL,NULL ); gtk_widget_set_name( scrolledwindow1,"scrolledwindow1" ); - gtk_widget_ref( scrolledwindow1 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"scrolledwindow1",scrolledwindow1,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( scrolledwindow1 ); gtk_box_pack_start( GTK_BOX( hbox1 ),scrolledwindow1,FALSE,FALSE,0 ); gtk_widget_set_usize( scrolledwindow1,106,-2 ); @@ -368,8 +291,6 @@ ChannelsList=gtk_clist_new( 1 ); gtk_widget_set_name( ChannelsList,"ChannelsList" ); - gtk_widget_ref( ChannelsList ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"ChannelsList",ChannelsList,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( ChannelsList ); gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),ChannelsList ); gtk_clist_set_column_width( GTK_CLIST( ChannelsList ),0,80 ); @@ -377,342 +298,152 @@ table1=gtk_table_new( 2,10,FALSE ); gtk_widget_set_name( table1,"table1" ); - gtk_widget_ref( table1 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"table1",table1,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( table1 ); gtk_box_pack_start( GTK_BOX( hbox1 ),table1,FALSE,FALSE,0 ); gtk_table_set_row_spacings( GTK_TABLE( table1 ),4 ); gtk_table_set_col_spacings( GTK_TABLE( table1 ),9 ); A3125adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); - A3125=gtk_vscale_new( A3125adj ); - gtk_widget_set_name( A3125,"A3125" ); - gtk_widget_ref( A3125 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"A3125",A3125,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( A3125 ); - gtk_table_attach( GTK_TABLE( table1 ),A3125,0,1,0,1,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( GTK_EXPAND | GTK_FILL ),0,0 ); - gtk_scale_set_draw_value( GTK_SCALE( A3125 ),FALSE ); - + A3125=AddVScaler( A3125adj,NULL,-1 ); + gtk_table_attach( GTK_TABLE( table1 ),A3125,0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); + A6250adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); - A6250=gtk_vscale_new( A6250adj ); - gtk_widget_set_name( A6250,"A6250" ); - gtk_widget_ref( A6250 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"A6250",A6250,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( A6250 ); - gtk_table_attach( GTK_TABLE( table1 ),A6250,1,2,0,1,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( GTK_EXPAND | GTK_FILL ),0,0 ); - gtk_scale_set_draw_value( GTK_SCALE( A6250 ),FALSE ); + A6250=AddVScaler( A6250adj,NULL,-1 ); + gtk_table_attach( GTK_TABLE( table1 ),A6250,1,2,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); A125adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); - A125=gtk_vscale_new( A125adj ); - gtk_widget_set_name( A125,"A125" ); - gtk_widget_ref( A125 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"A125",A125,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( A125 ); - gtk_table_attach( GTK_TABLE( table1 ),A125,2,3,0,1,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( GTK_EXPAND | GTK_FILL ),0,0 ); - gtk_scale_set_draw_value( GTK_SCALE( A125 ),FALSE ); + A125=AddVScaler( A125adj,NULL,-1 ); + gtk_table_attach( GTK_TABLE( table1 ),A125,2,3,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); A250adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); - A250=gtk_vscale_new( A250adj ); - gtk_widget_set_name( A250,"A250" ); - gtk_widget_ref( A250 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"A250",A250,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( A250 ); - gtk_table_attach( GTK_TABLE( table1 ),A250,3,4,0,1,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( GTK_EXPAND | GTK_FILL ),0,0 ); - gtk_scale_set_draw_value( GTK_SCALE( A250 ),FALSE ); + A250=AddVScaler( A250adj,NULL,-1 ); + gtk_table_attach( GTK_TABLE( table1 ),A250,3,4,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); A500adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); - A500=gtk_vscale_new( A500adj ); - gtk_widget_set_name( A500,"A500" ); - gtk_widget_ref( A500 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"A500",A500,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( A500 ); - gtk_table_attach( GTK_TABLE( table1 ),A500,4,5,0,1,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( GTK_EXPAND | GTK_FILL ),0,0 ); - gtk_scale_set_draw_value( GTK_SCALE( A500 ),FALSE ); + A500=AddVScaler( A500adj,NULL,-1 ); + gtk_table_attach( GTK_TABLE( table1 ),A500,4,5,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); A1000adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); - A1000=gtk_vscale_new( A1000adj ); - gtk_widget_set_name( A1000,"A1000" ); - gtk_widget_ref( A1000 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"A1000",A1000,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( A1000 ); - gtk_table_attach( GTK_TABLE( table1 ),A1000,5,6,0,1,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( GTK_EXPAND | GTK_FILL ),0,0 ); - gtk_scale_set_draw_value( GTK_SCALE( A1000 ),FALSE ); + A1000=AddVScaler( A1000adj,NULL,-1 ); + gtk_table_attach( GTK_TABLE( table1 ),A1000,5,6,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); A2000adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); - A2000=gtk_vscale_new( A2000adj ); - gtk_widget_set_name( A2000,"A2000" ); - gtk_widget_ref( A2000 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"A2000",A2000,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( A2000 ); - gtk_table_attach( GTK_TABLE( table1 ),A2000,6,7,0,1,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( GTK_EXPAND | GTK_FILL ),0,0 ); - gtk_scale_set_draw_value( GTK_SCALE( A2000 ),FALSE ); + A2000=AddVScaler( A2000adj,NULL,-1 ); + gtk_table_attach( GTK_TABLE( table1 ),A2000,6,7,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); A4000adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); - A4000=gtk_vscale_new( A4000adj ); - gtk_widget_set_name( A4000,"A4000" ); - gtk_widget_ref( A4000 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"A4000",A4000,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( A4000 ); - gtk_table_attach( GTK_TABLE( table1 ),A4000,7,8,0,1,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( GTK_EXPAND | GTK_FILL ),0,0 ); - gtk_scale_set_draw_value( GTK_SCALE( A4000 ),FALSE ); + A4000=AddVScaler( A4000adj,NULL,-1 ); + gtk_table_attach( GTK_TABLE( table1 ),A4000,7,8,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); A8000adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); - A8000=gtk_vscale_new( A8000adj ); - gtk_widget_set_name( A8000,"A8000" ); - gtk_widget_ref( A8000 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"A8000",A8000,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( A8000 ); - gtk_table_attach( GTK_TABLE( table1 ),A8000,8,9,0,1,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( GTK_EXPAND | GTK_FILL ),0,0 ); - gtk_scale_set_draw_value( GTK_SCALE( A8000 ),FALSE ); + A8000=AddVScaler( A8000adj,NULL,-1 ); + gtk_table_attach( GTK_TABLE( table1 ),A8000,8,9,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); A16000adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); - A16000=gtk_vscale_new( A16000adj ); - gtk_widget_set_name( A16000,"A16000" ); - gtk_widget_ref( A16000 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"A16000",A16000,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( A16000 ); - gtk_table_attach( GTK_TABLE( table1 ),A16000,9,10,0,1,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( GTK_EXPAND | GTK_FILL ),0,0 ); - gtk_scale_set_draw_value( GTK_SCALE( A16000 ),FALSE ); + A16000=AddVScaler( A16000adj,NULL,-1 ); + gtk_table_attach( GTK_TABLE( table1 ),A16000,9,10,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); - label3=gtk_label_new( "31.25" ); - gtk_widget_set_name( label3,"label3" ); - gtk_widget_ref( label3 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label3",label3,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label3 ); - gtk_table_attach( GTK_TABLE( table1 ),label3,0,1,1,2,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label3 ),0,0.5 ); - gtk_misc_set_padding( GTK_MISC( label3 ),2,0 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "31.25",NULL ), + 0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - label4=gtk_label_new( "62.50" ); - gtk_widget_set_name( label4,"label4" ); - gtk_widget_ref( label4 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label4",label4,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label4 ); - gtk_table_attach( GTK_TABLE( table1 ),label4,1,2,1,2,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label4 ),0,0.5 ); - gtk_misc_set_padding( GTK_MISC( label4 ),1,0 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "62.50",NULL ), + 1,2,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - label5=gtk_label_new( "125" ); - gtk_widget_set_name( label5,"label5" ); - gtk_widget_ref( label5 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label5",label5,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label5 ); - gtk_table_attach( GTK_TABLE( table1 ),label5,2,3,1,2,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label5 ),0,0.5 ); - gtk_misc_set_padding( GTK_MISC( label5 ),5,0 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "125",NULL ), + 2,3,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - label6=gtk_label_new( "250" ); - gtk_widget_set_name( label6,"label6" ); - gtk_widget_ref( label6 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label6",label6,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label6 ); - gtk_table_attach( GTK_TABLE( table1 ),label6,3,4,1,2,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label6 ),0,0.5 ); - gtk_misc_set_padding( GTK_MISC( label6 ),5,0 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "250",NULL ), + 3,4,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - label7=gtk_label_new( "500" ); - gtk_widget_set_name( label7,"label7" ); - gtk_widget_ref( label7 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label7",label7,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label7 ); - gtk_table_attach( GTK_TABLE( table1 ),label7,4,5,1,2,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label7 ),0,0.5 ); - gtk_misc_set_padding( GTK_MISC( label7 ),7,0 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "500",NULL ), + 4,5,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - label8=gtk_label_new( "1000" ); - gtk_widget_set_name( label8,"label8" ); - gtk_widget_ref( label8 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label8",label8,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label8 ); - gtk_table_attach( GTK_TABLE( table1 ),label8,5,6,1,2,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label8 ),0,0.5 ); - gtk_misc_set_padding( GTK_MISC( label8 ),5,0 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "1000",NULL ), + 5,6,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - label9=gtk_label_new( "2000" ); - gtk_widget_set_name( label9,"label9" ); - gtk_widget_ref( label9 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label9",label9,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label9 ); - gtk_table_attach( GTK_TABLE( table1 ),label9,6,7,1,2,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label9 ),0,0.5 ); - gtk_misc_set_padding( GTK_MISC( label9 ),2,0 ); - - label10=gtk_label_new( "4000" ); - gtk_widget_set_name( label10,"label10" ); - gtk_widget_ref( label10 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label10",label10,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label10 ); - gtk_table_attach( GTK_TABLE( table1 ),label10,7,8,1,2,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label10 ),0,0.5 ); - gtk_misc_set_padding( GTK_MISC( label10 ),3,0 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "2000",NULL ), + 6,7,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - label11=gtk_label_new( "8000" ); - gtk_widget_set_name( label11,"label11" ); - gtk_widget_ref( label11 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label11",label11,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label11 ); - gtk_table_attach( GTK_TABLE( table1 ),label11,8,9,1,2,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label11 ),0,0.5 ); - gtk_misc_set_padding( GTK_MISC( label11 ),1,0 ); - - label12=gtk_label_new( "16000" ); - gtk_widget_set_name( label12,"label12" ); - gtk_widget_ref( label12 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label12",label12,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label12 ); - gtk_table_attach( GTK_TABLE( table1 ),label12,9,10,1,2,( GtkAttachOptions )( GTK_FILL ),( GtkAttachOptions )( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label12 ),0,0.5 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "4000",NULL ), + 7,8,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - label1=gtk_label_new( MSGTR_EQU_Audio ); - gtk_widget_set_name( label1,"label1" ); - gtk_widget_ref( label1 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label1",label1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label1 ); - gtk_notebook_set_tab_label( GTK_NOTEBOOK( Notebook ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( Notebook ),0 ),label1 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "8000",NULL ), + 8,9,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - hbox2=gtk_hbox_new( FALSE,0 ); - gtk_widget_set_name( hbox2,"hbox2" ); - gtk_widget_ref( hbox2 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"hbox2",hbox2,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( hbox2 ); - gtk_container_add( GTK_CONTAINER( Notebook ),hbox2 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "16000",NULL ), + 9,10,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - vbox2=gtk_vbox_new( TRUE,0 ); - gtk_widget_set_name( vbox2,"vbox2" ); - gtk_widget_ref( vbox2 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"vbox2",vbox2,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( vbox2 ); - gtk_box_pack_start( GTK_BOX( hbox2 ),vbox2,FALSE,FALSE,0 ); + gtk_notebook_set_tab_label( GTK_NOTEBOOK( Notebook ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( Notebook ),0 ), + AddLabel( MSGTR_EQU_Audio,NULL ) ); - label13=gtk_label_new( MSGTR_EQU_Contrast ); - gtk_widget_set_name( label13,"label13" ); - gtk_widget_ref( label13 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label13",label13,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label13 ); - gtk_box_pack_start( GTK_BOX( vbox2 ),label13,FALSE,FALSE,0 ); - gtk_label_set_justify( GTK_LABEL( label13 ),GTK_JUSTIFY_LEFT ); - gtk_misc_set_alignment( GTK_MISC( label13 ),0.02,0.5 ); - - label14=gtk_label_new( MSGTR_EQU_Brightness ); - gtk_widget_set_name( label14,"label14" ); - gtk_widget_ref( label14 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label14",label14,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label14 ); - gtk_box_pack_start( GTK_BOX( vbox2 ),label14,FALSE,FALSE,0 ); - gtk_label_set_justify( GTK_LABEL( label14 ),GTK_JUSTIFY_LEFT ); - gtk_misc_set_alignment( GTK_MISC( label14 ),0.02,0.5 ); + table1=gtk_table_new( 4,2,FALSE ); + gtk_widget_set_name( table1,"table1" ); + gtk_widget_show( table1 ); + gtk_container_add( GTK_CONTAINER( Notebook ),table1 ); + + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( MSGTR_EQU_Contrast,NULL ), + 0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - label15=gtk_label_new( MSGTR_EQU_Hue ); - gtk_widget_set_name( label15,"label15" ); - gtk_widget_ref( label15 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label15",label15,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label15 ); - gtk_box_pack_start( GTK_BOX( vbox2 ),label15,FALSE,FALSE,0 ); - gtk_label_set_justify( GTK_LABEL( label15 ),GTK_JUSTIFY_LEFT ); - gtk_misc_set_alignment( GTK_MISC( label15 ),0.02,0.5 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( MSGTR_EQU_Brightness,NULL ), + 0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - label16=gtk_label_new( MSGTR_EQU_Saturation ); - gtk_widget_set_name( label16,"label16" ); - gtk_widget_ref( label16 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label16",label16,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label16 ); - gtk_box_pack_start( GTK_BOX( vbox2 ),label16,FALSE,FALSE,0 ); - gtk_label_set_justify( GTK_LABEL( label16 ),GTK_JUSTIFY_LEFT ); - gtk_misc_set_alignment( GTK_MISC( label16 ),0.02,0.5 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( MSGTR_EQU_Hue,NULL ), + 0,1,2,3,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - vbox3=gtk_vbox_new( TRUE,0 ); - gtk_widget_set_name( vbox3,"vbox3" ); - gtk_widget_ref( vbox3 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"vbox3",vbox3,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( vbox3 ); - gtk_box_pack_start( GTK_BOX( hbox2 ),vbox3,TRUE,TRUE,0 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( MSGTR_EQU_Saturation,NULL ), + 0,1,3,4,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); VContrastadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) ); - VContrast=gtk_hscale_new( VContrastadj ); - gtk_widget_set_name( VContrast,"VContrast" ); - gtk_widget_ref( VContrast ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"VContrast",VContrast,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( VContrast ); - gtk_box_pack_start( GTK_BOX( vbox3 ),VContrast,TRUE,TRUE,0 ); - gtk_scale_set_value_pos( GTK_SCALE( VContrast ),GTK_POS_RIGHT ); + VContrast=AddHScaler( VContrastadj,NULL,1 ); + gtk_table_attach( GTK_TABLE( table1 ),VContrast,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); + gtk_widget_set_usize( VContrast,-1,45 ); VBrightnessadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) ); - VBrightness=gtk_hscale_new( VBrightnessadj ); - gtk_widget_set_name( VBrightness,"VBrightness" ); - gtk_widget_ref( VBrightness ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"VBrightness",VBrightness,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( VBrightness ); - gtk_box_pack_start( GTK_BOX( vbox3 ),VBrightness,TRUE,TRUE,0 ); - gtk_scale_set_value_pos( GTK_SCALE( VBrightness ),GTK_POS_RIGHT ); + VBrightness=AddHScaler( VBrightnessadj,NULL,1 ); + gtk_table_attach( GTK_TABLE( table1 ),VBrightness,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); + gtk_widget_set_usize( VBrightness,-1,45 ); VHueadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) ); - VHue=gtk_hscale_new( VHueadj ); - gtk_widget_set_name( VHue,"VHue" ); - gtk_widget_ref( VHue ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"VHue",VHue,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( VHue ); - gtk_box_pack_start( GTK_BOX( vbox3 ),VHue,TRUE,TRUE,0 ); - gtk_scale_set_value_pos( GTK_SCALE( VHue ),GTK_POS_RIGHT ); + VHue=AddHScaler( VHueadj,NULL,1 ); + gtk_table_attach( GTK_TABLE( table1 ),VHue,1,2,2,3,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); + gtk_widget_set_usize( VHue,-1,45 ); VSaturationadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) ); - VSaturation=gtk_hscale_new( VSaturationadj ); - gtk_widget_set_name( VSaturation,"VSaturation" ); - gtk_widget_ref( VSaturation ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"VSaturation",VSaturation,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( VSaturation ); - gtk_box_pack_start( GTK_BOX( vbox3 ),VSaturation,TRUE,TRUE,0 ); - gtk_scale_set_value_pos( GTK_SCALE( VSaturation ),GTK_POS_RIGHT ); + VSaturation=AddHScaler( VSaturationadj,NULL,1 ); + gtk_table_attach( GTK_TABLE( table1 ),VSaturation,1,2,3,4,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); + gtk_widget_set_usize( VSaturation,-1,45 ); - label2=gtk_label_new( MSGTR_EQU_Video ); - gtk_widget_set_name( label2,"label2" ); - gtk_widget_ref( label2 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"label2",label2,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label2 ); - gtk_notebook_set_tab_label( GTK_NOTEBOOK( Notebook ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( Notebook ),1 ),label2 ); + gtk_notebook_set_tab_label( GTK_NOTEBOOK( Notebook ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( Notebook ),1 ), + AddLabel( MSGTR_EQU_Video,NULL ) ); - hbuttonbox1=gtk_hbutton_box_new(); - gtk_widget_set_name( hbuttonbox1,"hbuttonbox1" ); - gtk_widget_ref( hbuttonbox1 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"hbuttonbox1",hbuttonbox1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( hbuttonbox1 ); - gtk_box_pack_end( GTK_BOX( vbox1 ),hbuttonbox1,FALSE,TRUE,0 ); - gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); - gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); - gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),85,20 ); + AddHSeparator( vbox1 ); - Config=gtk_button_new_with_label( MSGTR_Config ); - gtk_widget_set_name( Config,"Config" ); - gtk_widget_ref( Config ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"Config",Config,(GtkDestroyNotify)gtk_widget_unref ); - gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Config ); - - Clear=gtk_button_new_with_label( MSGTR_Clear ); - gtk_widget_set_name( Clear,"Clear" ); - gtk_widget_ref( Clear ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"Clear",Clear,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( Clear ); - gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Clear ); + hbuttonbox1=AddHButtonBox( vbox1 ); + gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); + gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); - Ok=gtk_button_new_with_label( MSGTR_Ok ); - gtk_widget_set_name( Ok,"Ok" ); - gtk_widget_ref( Ok ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"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_Escape,0,GTK_ACCEL_VISIBLE ); - gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); + Config=AddButton( MSGTR_Config,hbuttonbox1 ); + Clear=AddButton( MSGTR_Clear,hbuttonbox1 ); + Ok=AddButton( MSGTR_Ok,hbuttonbox1 ); + + gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); - hseparator1=gtk_hseparator_new(); - gtk_widget_set_name( hseparator1,"hseparator1" ); - gtk_widget_ref( hseparator1 ); - gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"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,5 ); - - gtk_signal_connect( GTK_OBJECT( Equalizer ),"destroy",GTK_SIGNAL_FUNC( eqDestroy ),NULL ); - gtk_signal_connect( GTK_OBJECT( Equalizer ),"show",GTK_SIGNAL_FUNC( eqShow ),(void *)1 ); - gtk_signal_connect( GTK_OBJECT( Equalizer ),"hide",GTK_SIGNAL_FUNC( eqShow ),(void *)0 ); + gtk_signal_connect( GTK_OBJECT( Equalizer ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&Equalizer ); gtk_signal_connect( GTK_OBJECT( Equalizer ),"focus_in_event",GTK_SIGNAL_FUNC( eqFocus ),(void *)2 ); gtk_signal_connect( GTK_OBJECT( ChannelsList ),"select_row",GTK_SIGNAL_FUNC( eqSelectChannelsListRow ),NULL ); @@ -733,9 +464,9 @@ gtk_signal_connect( GTK_OBJECT( VHue ),"motion_notify_event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void*)3 ); gtk_signal_connect( GTK_OBJECT( VSaturation ),"motion_notify_event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void *)4 ); - gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)0 ); - gtk_signal_connect( GTK_OBJECT( Clear ),"released",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)1 ); - gtk_signal_connect( GTK_OBJECT( Config ),"released",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)2 ); + gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)0 ); + gtk_signal_connect( GTK_OBJECT( Clear ),"clicked",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)1 ); + gtk_signal_connect( GTK_OBJECT( Config ),"clicked",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)2 ); gtk_signal_connect( GTK_OBJECT( Notebook ),"switch_page",GTK_SIGNAL_FUNC( eqNotebook ),NULL ); @@ -746,7 +477,6 @@ // --- equalizer config dialog box -static GtkWidget * EquConfig; static GtkWidget * CBChannel1; static GtkWidget * CEChannel1; static GtkWidget * CBChannel2; @@ -768,7 +498,7 @@ { GList * Items = NULL; - if ( gtkVEquConfig ) gtkActive( EquConfig ); + if ( EquConfig ) gtkActive( EquConfig ); else EquConfig=create_EquConfig(); Items=g_list_append( Items,(gpointer)MSGTR_EQU_Front_Right ); @@ -799,16 +529,11 @@ } void HideEquConfig( void ) -{ gtk_widget_hide( EquConfig ); gtk_widget_destroy( EquConfig ); gtkVEquConfig=0; } - -static void ecHandler( GtkObject * object,gpointer user_data ) { - switch ( (int)user_data ) - { - case 0: HideEquConfig(); break; - case 1: gtkVEquConfig=1; break; - case 2: gtkVEquConfig=0; break; - } + if ( !EquConfig ) return; + gtk_widget_hide( EquConfig ); + gtk_widget_destroy( EquConfig ); + EquConfig=NULL; } static void ecButtonReleased( GtkButton * button,gpointer user_data ) @@ -828,19 +553,8 @@ GtkWidget * create_EquConfig( void ) { - GtkWidget * frame1; - GtkWidget * frame2; - GtkWidget * frame3; - GtkWidget * frame4; GtkWidget * vbox1; GtkWidget * table1; - GtkWidget * label1; - GtkWidget * label2; - GtkWidget * label3; - GtkWidget * label4; - GtkWidget * label5; - GtkWidget * label6; - GtkWidget * hseparator1; GtkWidget * hbuttonbox1; GtkAccelGroup * accel_group; @@ -860,224 +574,97 @@ gtk_widget_realize( EquConfig ); gtkAddIcon( EquConfig ); - frame1=gtk_frame_new( NULL ); - gtk_widget_set_name( frame1,"frame1" ); - gtk_widget_ref( frame1 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"frame1",frame1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( frame1 ); - gtk_container_add( GTK_CONTAINER( EquConfig ),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( EquConfig ),"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( EquConfig ),"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( EquConfig ),"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( EquConfig ),"vbox1",vbox1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( vbox1 ); - gtk_container_add( GTK_CONTAINER( frame4 ),vbox1 ); + vbox1=AddVBox( AddDialogFrame( EquConfig ),0 ); table1=gtk_table_new( 6,2,FALSE ); gtk_widget_set_name( table1,"table1" ); - gtk_widget_ref( table1 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"table1",table1,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( table1 ); gtk_box_pack_start( GTK_BOX( vbox1 ),table1,TRUE,TRUE,0 ); gtk_table_set_row_spacings( GTK_TABLE( table1 ),4 ); gtk_table_set_col_spacings( GTK_TABLE( table1 ),4 ); - label1=gtk_label_new( "Channel 1:" ); - gtk_widget_set_name( label1,"label1" ); - gtk_widget_ref( label1 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"label1",label1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label1 ); - gtk_table_attach( GTK_TABLE( table1 ),label1,0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label1 ),0,0.5 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "Channel 1:",NULL ), + 0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - label2=gtk_label_new( "Channel 2:" ); - gtk_widget_set_name( label2,"label2" ); - gtk_widget_ref( label2 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"label2",label2,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label2 ); - gtk_table_attach( GTK_TABLE( table1 ),label2,0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label2 ),0,0.5 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "Channel 2:",NULL ), + 0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - label3=gtk_label_new( "Channel 3:" ); - gtk_widget_set_name( label3,"label3" ); - gtk_widget_ref( label3 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"label3",label3,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label3 ); - gtk_table_attach( GTK_TABLE( table1 ),label3,0,1,2,3,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label3 ),0,0.5 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "Channel 3:",NULL ), + 0,1,2,3,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - label4=gtk_label_new( "Channel 4:" ); - gtk_widget_set_name( label4,"label4" ); - gtk_widget_ref( label4 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"label4",label4,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label4 ); - gtk_table_attach( GTK_TABLE( table1 ),label4,0,1,3,4,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label4 ),0,0.5 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "Channel 4:",NULL ), + 0,1,3,4,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - label5=gtk_label_new( "Channel 5:" ); - gtk_widget_set_name( label5,"label5" ); - gtk_widget_ref( label5 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"label5",label5,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label5 ); - gtk_table_attach( GTK_TABLE( table1 ),label5,0,1,4,5,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label5 ),0,0.5 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "Channel 5:",NULL ), + 0,1,4,5,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - label6=gtk_label_new( "Channel 6:" ); - gtk_widget_set_name( label6,"label6" ); - gtk_widget_ref( label6 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"label6",label6,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label6 ); - gtk_table_attach( GTK_TABLE( table1 ),label6,0,1,5,6,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - gtk_misc_set_alignment( GTK_MISC( label6 ),0,0.5 ); + gtk_table_attach( GTK_TABLE( table1 ), + AddLabel( "Channel 6:",NULL ), + 0,1,5,6,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - CBChannel1=gtk_combo_new(); - gtk_widget_set_name( CBChannel1,"CBChannel1" ); - gtk_widget_ref( CBChannel1 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"CBChannel1",CBChannel1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( CBChannel1 ); - gtk_table_attach( GTK_TABLE( table1 ),CBChannel1,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); + CBChannel1=AddComboBox( NULL ); + gtk_table_attach( GTK_TABLE( table1 ),CBChannel1,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); CEChannel1=GTK_COMBO( CBChannel1 )->entry; gtk_widget_set_name( CEChannel1,"CEChannel1" ); - gtk_widget_ref( CEChannel1 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"CEChannel1",CEChannel1,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( CEChannel1 ); - CBChannel2=gtk_combo_new(); - gtk_widget_set_name( CBChannel2,"CBChannel2" ); - gtk_widget_ref( CBChannel2 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"CBChannel2",CBChannel2,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( CBChannel2 ); - gtk_table_attach( GTK_TABLE( table1 ),CBChannel2,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); + CBChannel2=AddComboBox( NULL ); + gtk_table_attach( GTK_TABLE( table1 ),CBChannel2,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); CEChannel2=GTK_COMBO( CBChannel2 )->entry; gtk_widget_set_name( CEChannel2,"CEChannel2" ); - gtk_widget_ref( CEChannel2 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"CEChannel2",CEChannel2,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( CEChannel2 ); - CBChannel3=gtk_combo_new(); - gtk_widget_set_name( CBChannel3,"CBChannel3" ); - gtk_widget_ref( CBChannel3 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"CBChannel3",CBChannel3,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( CBChannel3 ); - gtk_table_attach( GTK_TABLE( table1 ),CBChannel3,1,2,2,3,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); + CBChannel3=AddComboBox( NULL ); + gtk_table_attach( GTK_TABLE( table1 ),CBChannel3,1,2,2,3,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); CEChannel3=GTK_COMBO( CBChannel3 )->entry; gtk_widget_set_name( CEChannel3,"CEChannel3" ); - gtk_widget_ref( CEChannel3 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"CEChannel3",CEChannel3,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( CEChannel3 ); - CBChannel4=gtk_combo_new(); - gtk_widget_set_name( CBChannel4,"CBChannel4" ); - gtk_widget_ref( CBChannel4 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"CBChannel4",CBChannel4,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( CBChannel4 ); - gtk_table_attach( GTK_TABLE( table1 ),CBChannel4,1,2,3,4,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); + CBChannel4=AddComboBox( NULL ); + gtk_table_attach( GTK_TABLE( table1 ),CBChannel4,1,2,3,4,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); CEChannel4=GTK_COMBO( CBChannel4 )->entry; gtk_widget_set_name( CEChannel4,"CEChannel4" ); - gtk_widget_ref( CEChannel4 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"CEChannel4",CEChannel4,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( CEChannel4 ); - CBChannel5=gtk_combo_new(); - gtk_widget_set_name( CBChannel5,"CBChannel5" ); - gtk_widget_ref( CBChannel5 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"CBChannel5",CBChannel5,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( CBChannel5 ); - gtk_table_attach( GTK_TABLE( table1 ),CBChannel5,1,2,4,5,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); + CBChannel5=AddComboBox( NULL ); + gtk_table_attach( GTK_TABLE( table1 ),CBChannel5,1,2,4,5,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); CEChannel5=GTK_COMBO( CBChannel5 )->entry; gtk_widget_set_name( CEChannel5,"CEChannel5" ); - gtk_widget_ref( CEChannel5 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"CEChannel5",CEChannel5,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( CEChannel5 ); - CBChannel6=gtk_combo_new(); - gtk_widget_set_name( CBChannel6,"CBChannel6" ); - gtk_widget_ref( CBChannel6 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"CBChannel6",CBChannel6,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( CBChannel6 ); - gtk_table_attach( GTK_TABLE( table1 ),CBChannel6,1,2,5,6,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); + CBChannel6=AddComboBox( NULL ); + gtk_table_attach( GTK_TABLE( table1 ),CBChannel6,1,2,5,6,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); CEChannel6=GTK_COMBO( CBChannel6 )->entry; gtk_widget_set_name( CEChannel6,"CEChannel6" ); - gtk_widget_ref( CEChannel6 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"CEChannel6",CEChannel6,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( CEChannel6 ); - hseparator1=gtk_hseparator_new(); - gtk_widget_set_name( hseparator1,"hseparator1" ); - gtk_widget_ref( hseparator1 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"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,6 ); + AddHSeparator( vbox1 ); - hbuttonbox1=gtk_hbutton_box_new(); - gtk_widget_set_name( hbuttonbox1,"hbuttonbox1" ); - gtk_widget_ref( hbuttonbox1 ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"hbuttonbox1",hbuttonbox1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( hbuttonbox1 ); - gtk_box_pack_start( GTK_BOX( vbox1 ),hbuttonbox1,FALSE,FALSE,0 ); - gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); - gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); - gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),-1,20 ); - gtk_button_box_set_child_ipadding( GTK_BUTTON_BOX( hbuttonbox1 ),0,-1 ); + hbuttonbox1=AddHButtonBox( vbox1 ); + gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); + gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); - ecOk=gtk_button_new_with_label( "Ok" ); - gtk_widget_set_name( ecOk,"Ok" ); - gtk_widget_ref( ecOk ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"ecOk",ecOk,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( ecOk ); - gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),ecOk ); - GTK_WIDGET_UNSET_FLAGS( ecOk,GTK_CAN_FOCUS ); - gtk_widget_add_accelerator( ecOk,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); + ecOk=AddButton( MSGTR_Ok,hbuttonbox1 ); + ecCancel=AddButton( MSGTR_Cancel,hbuttonbox1 ); - ecCancel=gtk_button_new_with_label( "Cancel" ); - gtk_widget_set_name( ecCancel,"Cancel" ); - gtk_widget_ref( ecCancel ); - gtk_object_set_data_full( GTK_OBJECT( EquConfig ),"ecCancel",ecCancel,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( ecCancel ); - gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),ecCancel ); - GTK_WIDGET_UNSET_FLAGS( ecCancel,GTK_CAN_FOCUS ); - gtk_widget_add_accelerator( ecCancel,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( ecOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( ecCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); - gtk_signal_connect( GTK_OBJECT( EquConfig ),"destroy",GTK_SIGNAL_FUNC( ecHandler ),(void *)0 ); - gtk_signal_connect( GTK_OBJECT( EquConfig ),"show",GTK_SIGNAL_FUNC( ecHandler ),(void *)1 ); - gtk_signal_connect( GTK_OBJECT( EquConfig ),"hide",GTK_SIGNAL_FUNC( ecHandler ),(void *)2 ); + gtk_signal_connect( GTK_OBJECT( EquConfig ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&EquConfig ); - gtk_signal_connect( GTK_OBJECT( ecOk ),"released",GTK_SIGNAL_FUNC( ecButtonReleased ),(void *)1 ); - gtk_signal_connect( GTK_OBJECT( ecCancel ),"released",GTK_SIGNAL_FUNC( ecButtonReleased ),(void *)0 ); + gtk_signal_connect( GTK_OBJECT( ecOk ),"clicked",GTK_SIGNAL_FUNC( ecButtonReleased ),(void *)1 ); + gtk_signal_connect( GTK_OBJECT( ecCancel ),"clicked",GTK_SIGNAL_FUNC( ecButtonReleased ),(void *)0 ); gtk_window_add_accel_group( GTK_WINDOW( EquConfig ),accel_group );
--- a/Gui/mplayer/gtk/fs.c Wed Nov 27 22:45:54 2002 +0000 +++ b/Gui/mplayer/gtk/fs.c Wed Nov 27 22:48:56 2002 +0000 @@ -21,6 +21,7 @@ #include "../widgets.h" #include "fs.h" #include "opts.h" +#include "common.h" #ifndef __linux__ #define get_current_dir_name() getcwd(NULL, PATH_MAX) @@ -38,8 +39,6 @@ int fsPressed = 0; int fsType = 0; -int gtkVFileSelect = 0; - char * fsVideoFilterNames[][2] = { { "MPEG files (*.mpg,*.mpeg,*.m1v)", "*.mpg,*.mpeg,*.m1v" }, { "VOB files (*.vob)", "*.vob" }, @@ -56,9 +55,9 @@ { "MP3 files (*.mp3,mp2)", "*.mp3,*.mp2" }, { "Wave files (*.wav)", "*.wav" }, { "WMA files (*.wma)", "*.wma" }, - { "Audio files (*.wav,*.ogg,*.mp2,*.mp3,*.wma)", "*.wav,*.ogg,*.mp2,*.mp3,*.wma" }, - { "All video files", "*.mpg,*.mpeg,*.m1v,*.vob,*.avi,*.divx,*.mov,*.qt,*.asf,*.viv,*.rm,*.wmv,*.ogm,*.fli,*.flc,*.nuv" }, - { "All files (*)", "*" }, + { "Audio files", "*.wav,*.ogg,*.mp2,*.mp3,*.wma" }, + { "Video files", "*.asf,*.avi,*.divx,*.fli,*.flc,*.ogm,*.mpg,*.mpeg,*.m1v,*.mov,*.nuv,*.qt,*.rm,*.vob,*.viv,*.wmv" }, + { "All files", "*" }, { NULL,NULL } }; @@ -71,14 +70,14 @@ { "TXT (*.txt)", "*.txt" }, { "SSA (*.ssa)", "*.ssa" }, { "AQT (*.aqt)", "*.aqt" }, - { "Subtitles (*.utf,*.sub,*.srt,*.smi,*.rt,*.txt,*.ssa,*.aqt)", "*.utf,*.sub,*.srt,*.smi,*.rt,*.txt,*.ssa,*.aqt" }, - { "All files ( * )", "*" }, + { "Subtitles", "*.utf,*.sub,*.srt,*.smi,*.rt,*.txt,*.ssa,*.aqt" }, + { "All files", "*" }, { NULL,NULL } }; char * fsOtherFilterNames[][2] = { - { "All files ( * )", "*" }, + { "All files", "*" }, { NULL,NULL } }; @@ -87,8 +86,8 @@ { "WAV files (*.wav)", "*.wav" }, { "MP3 files (*.mp2, *.mp3)", "*.mp2,*.mp3" }, { "OGG Vorbis files (*.ogg)", "*.ogg" }, - { "Audio files (*.wav,*.mp2,*.mp3,*.ogg)", "*.wav,*.mp2,*.mp3,*.ogg" }, - { "All files ( * )", "*" }, + { "Audio files", "*.ogg,*.mp2,*.mp3,*.wav" }, + { "All files", "*" }, { NULL, NULL } }; @@ -99,13 +98,13 @@ #else { "font files (*.desc)", "*.desc" }, #endif - { "All files ( * )", "*" }, + { "All files", "*" }, { NULL,NULL } }; GtkWidget * fsFileNamesList; GtkWidget * fsFNameList; -GtkWidget * fsFileSelect; +GtkWidget * fsFileSelect = NULL; GdkColormap * fsColorMap; GtkWidget * fsOk; GtkWidget * fsUp; @@ -232,7 +231,7 @@ int i; char * tmp = NULL; - if ( gtkVFileSelect ) gtkActive( fsFileSelect ); + if ( fsFileSelect ) gtkActive( fsFileSelect ); else fsFileSelect=create_FileSelect(); fsType=type; @@ -323,15 +322,12 @@ void HideFileSelect( void ) { - if ( !gtkVFileSelect ) return; + if ( !fsFileSelect ) return; gtk_widget_hide( fsFileSelect ); gtk_widget_destroy( fsFileSelect ); - gtkVFileSelect=0; + fsFileSelect=NULL; } -void fs_fsFileSelect_destroy( GtkObject * object,gpointer user_data ) -{ HideFileSelect(); } - void fs_fsFilterCombo_activate( GtkEditable * editable,gpointer user_data ) { fsFilter=gtk_entry_get_text( GTK_ENTRY( user_data ) ); @@ -476,7 +472,7 @@ #if defined( USE_OSD ) || defined( USE_SUB ) guiLoadFont(); #endif - if ( gtkVPreferences ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name ); + if ( Preferences ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name ); break; } @@ -499,8 +495,7 @@ { gtk_clist_get_text( GTK_CLIST(widget ),row,1,&fsSelectedFile ); fsPressed=1; - if( !bevent ) return; - if( bevent->type == GDK_BUTTON_PRESS ) gtk_button_released( GTK_BUTTON( fsOk ) ); + if( bevent && bevent->type == GDK_BUTTON_PRESS ) gtk_button_released( GTK_BUTTON( fsOk ) ); } gboolean on_FileSelect_key_release_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data ) @@ -520,9 +515,6 @@ return FALSE; } -void fs_FileSelect_show( GtkWidget * widget,gpointer user_data ) -{ gtkVFileSelect=(int)user_data; } - GtkWidget * create_FileSelect( void ) { GtkWidget * FSFrame; @@ -554,7 +546,7 @@ gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect ); gtk_window_set_position( GTK_WINDOW( fsFileSelect ),GTK_WIN_POS_CENTER ); gtk_window_set_policy( GTK_WINDOW( fsFileSelect ),TRUE,TRUE,TRUE ); - gtk_window_set_wmclass( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect,"MPlayer" ); + gtk_window_set_wmclass( GTK_WINDOW( fsFileSelect ),"FileSelect","MPlayer" ); fsColorMap=gdk_colormap_get_system(); gtk_widget_realize( fsFileSelect ); @@ -564,73 +556,22 @@ dpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&dmask,&style->bg[GTK_STATE_NORMAL],(gchar **)dir_xpm ); fpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&fmask,&style->bg[GTK_STATE_NORMAL],(gchar **)file_xpm ); - 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_widget_show( FSFrame ); - gtk_container_add( GTK_CONTAINER( fsFileSelect ),FSFrame ); - gtk_container_set_border_width( GTK_CONTAINER( FSFrame ),1 ); - gtk_frame_set_shadow_type( GTK_FRAME( FSFrame ),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( 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 ); - - 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_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( 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 ); - gtk_frame_set_shadow_type( GTK_FRAME( frame4 ),GTK_SHADOW_NONE ); - - 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_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_widget_show( hbox4 ); - gtk_box_pack_start( GTK_BOX( vbox4 ),hbox4,FALSE,FALSE,0 ); + vbox4=AddVBox( AddDialogFrame( fsFileSelect ),0 ); + hbox4=AddHBox( vbox4,1 ); 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_widget_show( fsCombo4 ); gtk_box_pack_start( GTK_BOX( hbox4 ),fsCombo4,TRUE,TRUE,0 ); gtk_widget_set_usize( fsCombo4,-2,20 ); 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_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_widget_show( vseparator1 ); gtk_box_pack_start( GTK_BOX( hbox4 ),vseparator1,FALSE,TRUE,0 ); gtk_widget_set_usize( vseparator1,7,20 ); @@ -646,25 +587,13 @@ gtk_box_pack_start( GTK_BOX( hbox4 ),fsUp,FALSE,FALSE,0 ); gtk_widget_set_usize( fsUp,65,15 ); - 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_widget_show( hseparator1 ); - gtk_box_pack_start( GTK_BOX( vbox4 ),hseparator1,FALSE,TRUE,0 ); - gtk_widget_set_usize( hseparator1,-2,8 ); + AddHSeparator( vbox4 ); - 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_widget_show( hbox6 ); - gtk_box_pack_start( GTK_BOX( vbox4 ),hbox6,TRUE,TRUE,0 ); + hbox6=AddHBox( NULL,0 ); + 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_widget_show( fsFNameListWindow ); gtk_box_pack_start( GTK_BOX( hbox6 ),fsFNameListWindow,TRUE,TRUE,0 ); gtk_widget_set_usize( fsFNameListWindow,-2,145 ); @@ -672,29 +601,13 @@ 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_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 ); gtk_clist_column_titles_hide( GTK_CLIST( fsFNameList ) ); gtk_clist_set_shadow_type( GTK_CLIST( fsFNameList ),GTK_SHADOW_ETCHED_OUT ); - CheckDir( fsFNameList,get_current_dir_name() ); - 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_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_widget_show( hseparator2 ); - gtk_box_pack_start( GTK_BOX( vbox4 ),hseparator2,FALSE,TRUE,0 ); - gtk_widget_set_usize( hseparator2,-2,9 ); + AddHSeparator( vbox4 ); List=gtk_combo_new(); gtk_widget_set_name( List,"List" ); @@ -706,50 +619,21 @@ 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_widget_show( fsFilterCombo ); gtk_entry_set_editable (GTK_ENTRY( fsFilterCombo ),FALSE ); - 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_widget_show( hseparator3 ); - gtk_box_pack_start( GTK_BOX( vbox4 ),hseparator3,FALSE,TRUE,0 ); - gtk_widget_set_usize( hseparator3,-2,7 ); + AddHSeparator( vbox4 ); - 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_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 ); - gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox3 ),10 ); - gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox3 ),85,20 ); - gtk_button_box_set_child_ipadding( GTK_BUTTON_BOX( hbuttonbox3 ),0,0 ); + hbuttonbox3=AddHButtonBox( vbox4 ); + gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox3 ),GTK_BUTTONBOX_END ); + gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox3 ),10 ); - fsOk=gtk_button_new_with_label( MSGTR_Ok ); - gtk_widget_set_name( fsOk,MSGTR_Ok ); - gtk_widget_ref( fsOk ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),MSGTR_Ok,fsOk,( GtkDestroyNotify )gtk_widget_unref ); - gtk_container_add( GTK_CONTAINER( hbuttonbox3 ),fsOk ); - gtk_widget_show( fsOk ); + fsOk=AddButton( MSGTR_Ok,hbuttonbox3 ); + fsCancel=AddButton( MSGTR_Cancel,hbuttonbox3 ); - fsCancel=gtk_button_new_with_label( MSGTR_Cancel ); - gtk_widget_set_name( fsCancel,MSGTR_Cancel ); - gtk_widget_ref( fsCancel ); - gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),MSGTR_Cancel,fsCancel,( GtkDestroyNotify )gtk_widget_unref ); - 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 ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&fsFileSelect ); 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 ),(void *)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 );
--- a/Gui/mplayer/gtk/mb.c Wed Nov 27 22:45:54 2002 +0000 +++ b/Gui/mplayer/gtk/mb.c Wed Nov 27 22:48:56 2002 +0000 @@ -8,35 +8,29 @@ #include "../widgets.h" #include "mb.h" +#include "common.h" GtkWidget * gtkMessageBoxText; GtkWidget * MessageBox; -int gtkVMessageBox = 0; - void ShowMessageBox( char * msg ) { - if ( gtkVMessageBox ) { gtk_widget_hide( MessageBox ); gtk_widget_destroy( MessageBox ); } + if ( MessageBox ) { gtk_widget_hide( MessageBox ); gtk_widget_destroy( MessageBox ); } 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_hide( MessageBox ); gtk_widget_destroy( MessageBox ); } - -static void on_MessageBox_show( GtkButton * button,gpointer user_data ) -{ gtkVMessageBox=(int)user_data; } +{ + gtk_widget_hide( MessageBox ); + gtk_widget_destroy( MessageBox ); + MessageBox=NULL; +} GtkWidget * create_MessageBox( int type ) { - GtkWidget * MessageBox; - GtkWidget * frame1; - GtkWidget * frame2; - GtkWidget * frame3; - GtkWidget * frame4; GtkWidget * vbox1; GtkWidget * hbox1; - GtkWidget * hseparator1; GtkWidget * hbuttonbox1; GtkWidget * Ok; GtkAccelGroup * accel_group; @@ -59,52 +53,8 @@ gtk_widget_realize( MessageBox ); gtkAddIcon( MessageBox ); - 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 ); + vbox1=AddVBox( AddDialogFrame( MessageBox ),0 ); + hbox1=AddHBox( vbox1,1 ); pixmapstyle=gtk_widget_get_style( MessageBox ); @@ -114,59 +64,32 @@ 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_justify( GTK_LABEL( gtkMessageBoxText ),GTK_JUSTIFY_CENTER ); gtk_label_set_line_wrap( GTK_LABEL( gtkMessageBoxText ),FALSE ); - 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 ); + AddHSeparator( vbox1 ); + hbuttonbox1=AddHButtonBox( vbox1 ); + Ok=AddButton( MSGTR_Ok,hbuttonbox1 ); - 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 ); + gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); - 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_Ok_released ),NULL ); - gtk_signal_connect( GTK_OBJECT( MessageBox ),"show",GTK_SIGNAL_FUNC( on_MessageBox_show ),(void *)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_signal_connect( GTK_OBJECT( MessageBox ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&MessageBox ); + gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( on_Ok_released ),NULL ); gtk_window_add_accel_group( GTK_WINDOW( MessageBox ),accel_group );
--- a/Gui/mplayer/gtk/mb.h Wed Nov 27 22:45:54 2002 +0000 +++ b/Gui/mplayer/gtk/mb.h Wed Nov 27 22:48:56 2002 +0000 @@ -6,7 +6,6 @@ extern GtkWidget * gtkMessageBoxText; extern GtkWidget * MessageBox; -extern int gtkVMessageBox; extern GtkWidget * create_MessageBox( int type ); extern void ShowMessageBox( char * msg );
--- a/Gui/mplayer/gtk/menu.c Wed Nov 27 22:45:54 2002 +0000 +++ b/Gui/mplayer/gtk/menu.c Wed Nov 27 22:48:56 2002 +0000 @@ -6,6 +6,7 @@ #include "../../../config.h" #include "../../../help_mp.h" #include "../../../mplayer.h" +#include "../../../mixer.h" #include "../../app.h" @@ -417,7 +418,8 @@ AddMenuItem( AspectMenu,"2.35",( 4 << 16 ) + evSetAspect ); AddSeparator( Menu ); - AddMenuItem( Menu,MSGTR_MENU_Mute, evMute ); + MenuItem=AddMenuCheckItem( Menu,MSGTR_MENU_Mute,muted,evMute ); + if ( !guiIntfStruct.AudioType ) gtk_widget_set_sensitive( MenuItem,FALSE ); AddMenuItem( Menu,MSGTR_MENU_PlayList, evPlayList ); AddMenuItem( Menu,MSGTR_MENU_SkinBrowser, evSkinBrowser ); AddMenuItem( Menu,MSGTR_MENU_Preferences, evPreferences );
--- a/Gui/mplayer/gtk/opts.c Wed Nov 27 22:45:54 2002 +0000 +++ b/Gui/mplayer/gtk/opts.c Wed Nov 27 22:48:56 2002 +0000 @@ -27,7 +27,7 @@ #include "../../../libmpcodecs/vd.h" #include "../../../libmpcodecs/ad.h" - GtkWidget * Preferences; + GtkWidget * Preferences = NULL; static GtkWidget * AConfig; static GtkWidget * VConfig; //static GtkWidget * BLoadSubtitle; @@ -128,7 +128,6 @@ char * lCEncoding = NULL; #endif - int gtkVPreferences = 0; static int old_audio_driver = 0; static char * ao_driver[3]; static char * vo_driver[3]; @@ -153,7 +152,7 @@ void ShowPreferences( void ) { - if ( gtkVPreferences ) gtkActive( Preferences ); + if ( Preferences ) gtkActive( Preferences ); else Preferences=create_Preferences(); // -- 1. page @@ -372,7 +371,6 @@ gtk_signal_connect( GTK_OBJECT( CLADrivers ),"select_row",GTK_SIGNAL_FUNC( prCListRow ),(void*)0 ); gtk_signal_connect( GTK_OBJECT( CLVDrivers ),"select_row",GTK_SIGNAL_FUNC( prCListRow ),(void*)1 ); - gtkVPreferences=1; gtk_widget_show( Preferences ); gtkSetLayer( Preferences ); gtkMessageBox( GTK_MB_WARNING,MSGTR_PREFERENCES_Message ); @@ -380,9 +378,10 @@ void HidePreferences( void ) { - if ( !gtkVPreferences ) return; - gtkVPreferences=0; - gtk_widget_hide( Preferences ); gtk_widget_destroy( Preferences ); + if ( !Preferences ) return; + gtk_widget_hide( Preferences ); + gtk_widget_destroy( Preferences ); + Preferences=NULL; #ifdef USE_OSS_AUDIO HideOSSConfig(); #endif @@ -404,12 +403,6 @@ } #endif -static void prDestroy( GtkObject * object,gpointer user_data ) -{ HidePreferences(); } - -static void prShow( GtkWidget * widget,gpointer user_data ) -{ gtkVPreferences=(int)user_data; } - #define bAConfig 0 #define bVconfig 1 #define bOk 2 @@ -501,12 +494,14 @@ HidePreferences(); break; case bAConfig: + if ( !ao_driver[0] ) break; gtk_widget_set_sensitive( AConfig,FALSE ); #ifdef USE_OSS_AUDIO if ( !strncmp( ao_driver[0],"oss",3 ) ) { ShowOSSConfig(); gtk_widget_set_sensitive( AConfig,TRUE ); } #endif break; case bVconfig: + if ( !vo_driver[0] ) break; gtk_widget_set_sensitive( VConfig,FALSE ); #ifdef HAVE_DXR3 if ( !gstrcmp( vo_driver[0],"dxr3" ) ) { ShowDXR3Config(); gtk_widget_set_sensitive( VConfig,TRUE ); } @@ -670,18 +665,9 @@ gtk_widget_realize( Preferences ); gtkAddIcon( Preferences ); - frame=AddFrame( NULL,GTK_SHADOW_IN,Preferences,1 ); - gtk_container_set_border_width( GTK_CONTAINER( frame ),1 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - frame=AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,frame,1 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - - vbox1=AddVBox( frame ); - + vbox1=AddVBox( AddDialogFrame( Preferences ),0 ); notebook1=gtk_notebook_new(); gtk_widget_set_name( notebook1,"notebook1" ); - gtk_widget_ref( notebook1 ); - gtk_object_set_data_full( GTK_OBJECT( Preferences ),"notebook1",notebook1,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( notebook1 ); gtk_box_pack_start( GTK_BOX( vbox1 ),notebook1,TRUE,TRUE,0 ); @@ -690,36 +676,31 @@ frame=AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox1,1 ); frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - vbox2=AddVBox( frame ); + vbox2=AddVBox( frame,0 ); scrolledwindow3=gtk_scrolled_window_new( NULL,NULL ); gtk_widget_set_name( scrolledwindow3,"scrolledwindow3" ); - gtk_widget_ref( scrolledwindow3 ); - gtk_object_set_data_full( GTK_OBJECT( Preferences ),"scrolledwindow3",scrolledwindow3,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( scrolledwindow3 ); gtk_box_pack_start( GTK_BOX( vbox2 ),scrolledwindow3,TRUE,TRUE,0 ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow3 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC ); CLADrivers=gtk_clist_new( 2 ); gtk_widget_set_name( CLADrivers,"CLADrivers" ); - gtk_widget_ref( CLADrivers ); - gtk_object_set_data_full( GTK_OBJECT( Preferences ),"CLADrivers",CLADrivers,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( CLADrivers ); gtk_container_add( GTK_CONTAINER( scrolledwindow3 ),CLADrivers ); gtk_clist_set_column_width( GTK_CLIST( CLADrivers ),0,50 ); gtk_clist_column_titles_show( GTK_CLIST( CLADrivers ) ); gtk_clist_set_shadow_type( GTK_CLIST( CLADrivers ),GTK_SHADOW_NONE ); gtk_widget_set_usize( CLADrivers,200,-2 ); - - label=AddLabel( MSGTR_PREFERENCES_AvailableDrivers,NULL ); - gtk_clist_set_column_widget( GTK_CLIST( CLADrivers ),0,label ); + gtk_clist_set_column_widget( GTK_CLIST( CLADrivers ),0, + AddLabel( MSGTR_PREFERENCES_AvailableDrivers,NULL ) ); - hbuttonbox2=AddHButtonBox( vbox2 ); - AConfig=AddButton( MSGTR_ConfigDriver,hbuttonbox2 ); + AConfig=AddButton( MSGTR_ConfigDriver, + AddHButtonBox( vbox2 ) ); - frame=AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox1,1 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - vbox3=AddVBox( frame ); + vbox3=AddVBox( + AddFrame( NULL,GTK_SHADOW_NONE, + AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox1,1 ),1 ),0 ); gtk_widget_set_usize( vbox3,250,-2 ); CBNoSound=AddCheckButton( MSGTR_PREFERENCES_DoNotPlaySound,vbox3 ); @@ -747,22 +728,18 @@ gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),0 ),label ); hbox2=AddHBox( notebook1,0 ); - frame=AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox2,1 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - vbox4=AddVBox( frame ); + vbox4=AddVBox( + AddFrame( NULL,GTK_SHADOW_NONE, + AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox2,1 ),1 ),0 ); scrolledwindow2=gtk_scrolled_window_new( NULL,NULL ); gtk_widget_set_name( scrolledwindow2,"scrolledwindow2" ); - gtk_widget_ref( scrolledwindow2 ); - gtk_object_set_data_full( GTK_OBJECT( Preferences ),"scrolledwindow2",scrolledwindow2,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( scrolledwindow2 ); gtk_box_pack_start( GTK_BOX( vbox4 ),scrolledwindow2,TRUE,TRUE,0 ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow2 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC ); CLVDrivers=gtk_clist_new( 2 ); gtk_widget_set_name( CLVDrivers,"CLVDrivers" ); - gtk_widget_ref( CLVDrivers ); - gtk_object_set_data_full( GTK_OBJECT( Preferences ),"CLVDrivers",CLVDrivers,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( CLVDrivers ); gtk_container_add( GTK_CONTAINER( scrolledwindow2 ),CLVDrivers ); gtk_clist_set_column_width( GTK_CLIST( CLVDrivers ),0,50 ); @@ -776,9 +753,9 @@ hbuttonbox3=AddHButtonBox( vbox4 ); VConfig=AddButton( MSGTR_ConfigDriver,hbuttonbox3 ); - frame=AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox2,1 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - vbox5=AddVBox( frame ); + vbox5=AddVBox( + AddFrame( NULL,GTK_SHADOW_NONE, + AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox2,1 ),1 ),0 ); gtk_widget_set_usize( vbox5,250,-2 ); CBDoubleBuffer=AddCheckButton( MSGTR_PREFERENCES_DoubleBuffer,vbox5 ); @@ -797,19 +774,20 @@ label=AddLabel( MSGTR_PREFERENCES_Video,NULL ); gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),1 ),label ); - vbox6=AddVBox( notebook1 ); + + vbox6=AddVBox( notebook1,0 ); - frame=AddFrame( MSGTR_PREFERENCES_FRAME_OSD_Level,GTK_SHADOW_ETCHED_OUT,vbox6,1 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - vbox600=AddVBox( frame ); + vbox600=AddVBox( + AddFrame( NULL,GTK_SHADOW_NONE, + AddFrame( MSGTR_PREFERENCES_FRAME_OSD_Level,GTK_SHADOW_ETCHED_OUT,vbox6,1 ),1 ),0 ); RBOSDNone=AddRadioButton( MSGTR_PREFERENCES_None,&OSD_group,vbox600 ); RBOSDTandP=AddRadioButton( MSGTR_PREFERENCES_OSDTimer,&OSD_group,vbox600 ); RBOSDIndicator=AddRadioButton( MSGTR_PREFERENCES_OSDProgress,&OSD_group,vbox600 ); - frame=AddFrame( MSGTR_PREFERENCES_FRAME_Subtitle,GTK_SHADOW_ETCHED_OUT,vbox6,1 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - vbox7=AddVBox( frame ); + vbox7=AddVBox( + AddFrame( NULL,GTK_SHADOW_NONE, + AddFrame( MSGTR_PREFERENCES_FRAME_Subtitle,GTK_SHADOW_ETCHED_OUT,vbox6,1 ),1 ),0 ); #if 0 hbox4=AddHBox( vbox7,1 ); @@ -818,8 +796,6 @@ ESubtitleName=gtk_entry_new(); gtk_widget_set_name( ESubtitleName,"ESubtitleName" ); - gtk_widget_ref( ESubtitleName ); - gtk_object_set_data_full( GTK_OBJECT( Preferences ),"ESubtitleName",ESubtitleName,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( ESubtitleName ); gtk_box_pack_start( GTK_BOX( hbox4 ),ESubtitleName,TRUE,TRUE,0 ); @@ -828,12 +804,10 @@ BLoadSubtitle=AddButton( MSGTR_Browse,hbuttonbox4 ); #endif - vbox8=AddVBox( vbox7 ); + vbox8=AddVBox( vbox7,0 ); table1=gtk_table_new( 3,2,FALSE ); gtk_widget_set_name( table1,"table1" ); - gtk_widget_ref( table1 ); - gtk_object_set_data_full( GTK_OBJECT( Preferences ),"table1",table1,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( table1 ); gtk_box_pack_start( GTK_BOX( vbox8 ),table1,FALSE,FALSE,0 ); @@ -858,16 +832,16 @@ HSSubFPS=AddHScaler( HSSubFPSadj,NULL,1 ); gtk_table_attach( GTK_TABLE( table1 ),HSSubFPS,1,2,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - vbox9=AddVBox( vbox8 ); + vbox9=AddVBox( vbox8,0 ); CBNoAutoSub=AddCheckButton( MSGTR_PREFERENCES_SUB_AutoLoad,vbox9 ); CBSubUnicode=AddCheckButton( MSGTR_PREFERENCES_SUB_Unicode,vbox9 ); CBDumpMPSub=AddCheckButton( MSGTR_PREFERENCES_SUB_MPSUB,vbox9 ); CBDumpSrt=AddCheckButton( MSGTR_PREFERENCES_SUB_SRT,vbox9 ); - frame=AddFrame( MSGTR_PREFERENCES_FRAME_Font,GTK_SHADOW_ETCHED_OUT,vbox6,1 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - vbox603=AddVBox( frame ); + vbox603=AddVBox( + AddFrame( NULL,GTK_SHADOW_NONE, + AddFrame( MSGTR_PREFERENCES_FRAME_Font,GTK_SHADOW_ETCHED_OUT,vbox6,1 ),1 ),0 ); hbox6=AddHBox( vbox603,1 ); @@ -875,8 +849,6 @@ prEFontName=gtk_entry_new(); gtk_widget_set_name( prEFontName,"prEFontName" ); - gtk_widget_ref( prEFontName ); - gtk_object_set_data_full( GTK_OBJECT( Preferences ),"prEFontName",prEFontName,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( prEFontName ); gtk_box_pack_start( GTK_BOX( hbox6 ),prEFontName,TRUE,TRUE,0 ); @@ -898,8 +870,6 @@ table1=gtk_table_new( 3,2,FALSE ); gtk_widget_set_name( table1,"table1" ); - gtk_widget_ref( table1 ); - gtk_object_set_data_full( GTK_OBJECT( Preferences ),"table1",table1,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( table1 ); gtk_box_pack_start( GTK_BOX( vbox603 ),table1,FALSE,FALSE,0 ); @@ -908,7 +878,6 @@ CBFontEncoding=gtk_combo_new(); gtk_widget_set_name( CBFontEncoding,"CBFontEncoding" ); - gtk_widget_ref( CBFontEncoding ); gtk_widget_show( CBFontEncoding ); gtk_table_attach( GTK_TABLE( table1 ),CBFontEncoding,1,2,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); { @@ -921,8 +890,6 @@ EFontEncoding=GTK_COMBO( CBFontEncoding )->entry; gtk_widget_set_name( EFontEncoding,"EFontEncoding" ); gtk_entry_set_editable( GTK_ENTRY( EFontEncoding ),FALSE ); - gtk_widget_ref( EFontEncoding ); - gtk_object_set_data_full( GTK_OBJECT( Preferences ),"EFontEncoding",EFontEncoding,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( EFontEncoding ); label=AddLabel( MSGTR_PREFERENCES_FontBlur,NULL ); @@ -956,11 +923,11 @@ label=AddLabel( MSGTR_PREFERENCES_SubtitleOSD,NULL ); gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),2 ),label ); - vbox601=AddVBox( notebook1 ); + vbox601=AddVBox( notebook1,0 ); - frame=AddFrame( MSGTR_PREFERENCES_FRAME_PostProcess,GTK_SHADOW_ETCHED_OUT,vbox601,0 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - vbox602=AddVBox( frame ); + vbox602=AddVBox( + AddFrame( NULL,GTK_SHADOW_NONE, + AddFrame( MSGTR_PREFERENCES_FRAME_PostProcess,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); CBPostprocess=AddCheckButton( MSGTR_PREFERENCES_PostProcess,vbox602 ); @@ -972,9 +939,9 @@ else HSPPQualityadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0,0,0 ) ); HSPPQuality=AddHScaler( HSPPQualityadj,hbox5,0 ); - frame=AddFrame( MSGTR_PREFERENCES_FRAME_CodecDemuxer,GTK_SHADOW_ETCHED_OUT,vbox601,0 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - vbox602=AddVBox( frame ); + vbox602=AddVBox( + AddFrame( NULL,GTK_SHADOW_NONE, + AddFrame( MSGTR_PREFERENCES_FRAME_CodecDemuxer,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); CBNonInterlaved=AddCheckButton( MSGTR_PREFERENCES_NI,vbox602 ); CBIndex=AddCheckButton( MSGTR_PREFERENCES_IDX,vbox602 ); @@ -985,15 +952,12 @@ CBVFM=gtk_combo_new(); gtk_widget_set_name( CBVFM,"CBVFM" ); - gtk_widget_ref( CBVFM ); gtk_widget_show( CBVFM ); gtk_box_pack_start( GTK_BOX( hbox5 ),CBVFM,TRUE,TRUE,0 ); EVFM=GTK_COMBO( CBVFM )->entry; gtk_widget_set_name( EVFM,"CEVFM" ); gtk_entry_set_editable( GTK_ENTRY( EVFM ),FALSE ); - gtk_widget_ref( EVFM ); - gtk_object_set_data_full( GTK_OBJECT( Preferences ),"EVFM",EVFM,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( EVFM ); hbox5=AddHBox( vbox602,1 ); @@ -1002,20 +966,17 @@ CBAFM=gtk_combo_new(); gtk_widget_set_name( CBAFM,"CBAFM" ); - gtk_widget_ref( CBAFM ); gtk_widget_show( CBAFM ); gtk_box_pack_start( GTK_BOX( hbox5 ),CBAFM,TRUE,TRUE,0 ); EAFM=GTK_COMBO( CBAFM )->entry; gtk_widget_set_name( EAFM,"EAFM" ); gtk_entry_set_editable( GTK_ENTRY( EAFM ),FALSE ); - gtk_widget_ref( EAFM ); - gtk_object_set_data_full( GTK_OBJECT( Preferences ),"EAFM",EAFM,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( EAFM ); - frame=AddFrame( MSGTR_PREFERENCES_FRAME_Cache,GTK_SHADOW_ETCHED_OUT,vbox601,0 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - vbox602=AddVBox( frame ); + vbox602=AddVBox( + AddFrame( NULL,GTK_SHADOW_NONE, + AddFrame( MSGTR_PREFERENCES_FRAME_Cache,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); CBCache=AddCheckButton( MSGTR_PREFERENCES_Cache,vbox602 ); @@ -1025,14 +986,12 @@ SBCacheadj=GTK_ADJUSTMENT( gtk_adjustment_new( 2048,4,65535,1,10,10 ) ); SBCache=gtk_spin_button_new( GTK_ADJUSTMENT( SBCacheadj ),1,0 ); - gtk_widget_ref( SBCache ); - gtk_object_set_data_full( GTK_OBJECT( Preferences ),"SBCache",SBCache,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( SBCache ); gtk_box_pack_start( GTK_BOX( hbox5 ),SBCache,TRUE,TRUE,0 ); - frame=AddFrame( MSGTR_PREFERENCES_FRAME_Misc,GTK_SHADOW_ETCHED_OUT,vbox601,0 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - vbox602=AddVBox( frame ); + vbox602=AddVBox( + AddFrame( NULL,GTK_SHADOW_NONE, + AddFrame( MSGTR_PREFERENCES_FRAME_Misc,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); CBLoadFullscreen=AddCheckButton( MSGTR_PREFERENCES_LoadFullscreen,vbox602 ); @@ -1047,21 +1006,19 @@ BOk=AddButton( MSGTR_Ok,hbuttonbox1 ); BCancel=AddButton( MSGTR_Cancel,hbuttonbox1 ); - gtk_widget_add_accelerator( BOk,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); - gtk_widget_add_accelerator( BCancel,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( BOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( BCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); - gtk_signal_connect( GTK_OBJECT( Preferences ),"destroy",GTK_SIGNAL_FUNC( prDestroy ),NULL ); - gtk_signal_connect( GTK_OBJECT( Preferences ),"show",GTK_SIGNAL_FUNC( prShow ),(void*)1 ); - gtk_signal_connect( GTK_OBJECT( Preferences ),"hide",GTK_SIGNAL_FUNC( prShow ),(void*)0 ); + gtk_signal_connect( GTK_OBJECT( Preferences ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&Preferences ); - gtk_signal_connect( GTK_OBJECT( AConfig ),"released",GTK_SIGNAL_FUNC( prButton ),(void*)bAConfig ); - gtk_signal_connect( GTK_OBJECT( BOk ),"released",GTK_SIGNAL_FUNC( prButton ),(void*)bOk ); - gtk_signal_connect( GTK_OBJECT( BCancel ),"released",GTK_SIGNAL_FUNC( prButton ),(void*)bCancel ); - gtk_signal_connect( GTK_OBJECT( VConfig ),"released",GTK_SIGNAL_FUNC( prButton ),(void*)bVconfig ); + gtk_signal_connect( GTK_OBJECT( AConfig ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bAConfig ); + gtk_signal_connect( GTK_OBJECT( BOk ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bOk ); + gtk_signal_connect( GTK_OBJECT( BCancel ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bCancel ); + gtk_signal_connect( GTK_OBJECT( VConfig ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bVconfig ); #if 0 - gtk_signal_connect( GTK_OBJECT( BLoadSubtitle ),"released",GTK_SIGNAL_FUNC( prButton ),(void*)bLSubtitle ); + gtk_signal_connect( GTK_OBJECT( BLoadSubtitle ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bLSubtitle ); #endif - gtk_signal_connect( GTK_OBJECT( BLoadFont ),"released",GTK_SIGNAL_FUNC( prButton ),(void*)bLFont ); + gtk_signal_connect( GTK_OBJECT( BLoadFont ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bLFont ); #if 0 gtk_signal_connect( GTK_OBJECT( CBNoSound ),"toggled",GTK_SIGNAL_FUNC( on_CBNoSound_toggled ),NULL ); @@ -1114,11 +1071,9 @@ static GtkWidget * BOssOk; static GtkWidget * BOssCancel; - int gtkVOSSConfig = 0; - void ShowOSSConfig( void ) { - if ( gtkVOSSConfig ) gtkActive( OSSConfig ); + if ( OSSConfig ) gtkActive( OSSConfig ); else OSSConfig=create_OSSConfig(); gtk_entry_set_text( GTK_ENTRY( CEOssMixer ),gtkAOOSSMixer ); @@ -1126,23 +1081,16 @@ gtk_widget_show( OSSConfig ); gtkSetLayer( OSSConfig ); - gtkVOSSConfig=1; } void HideOSSConfig( void ) { - if ( !gtkVOSSConfig ) return; + if ( !OSSConfig ) return; gtk_widget_hide( OSSConfig ); gtk_widget_destroy( OSSConfig ); - gtkVOSSConfig=0; + OSSConfig=NULL; } -static void ossDestroy( GtkObject * object,gpointer user_data ) -{ HideOSSConfig(); } - -static void ossShow( GtkWidget * widget,gpointer user_data ) -{ gtkVOSSConfig=(int)user_data; } - static void ossButton( GtkButton * button,gpointer user_data ) { switch( (int)user_data ) @@ -1158,9 +1106,8 @@ GtkWidget * create_OSSConfig( void ) { - GList * CBOssDevice_items=NULL; - GList * CBOssMixer_items=NULL; - GtkWidget * frame; + GList * CBOssDevice_items=NULL; + GList * CBOssMixer_items=NULL; GtkWidget * vbox604; GtkWidget * table2; GtkWidget * label; @@ -1181,18 +1128,10 @@ gtk_widget_realize( OSSConfig ); gtkAddIcon( OSSConfig ); - frame=AddFrame( NULL,GTK_SHADOW_IN,OSSConfig,1 ); - gtk_container_set_border_width( GTK_CONTAINER( frame ),1 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - frame=AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,frame,1 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - - vbox604=AddVBox( frame ); + vbox604=AddVBox( AddDialogFrame( OSSConfig ),0 ); table2=gtk_table_new( 2,2,FALSE ); gtk_widget_set_name( table2,"table2" ); - gtk_widget_ref( table2 ); - gtk_object_set_data_full( GTK_OBJECT( OSSConfig ),"table2",table2,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( table2 ); gtk_box_pack_start( GTK_BOX( vbox604 ),table2,TRUE,TRUE,0 ); @@ -1202,11 +1141,7 @@ label=AddLabel( MSGTR_PREFERENCES_OSS_Mixer,NULL ); gtk_table_attach( GTK_TABLE( table2 ),label,0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); - CBOssDevice=gtk_combo_new(); - gtk_widget_set_name( CBOssDevice,"CBOssDevice" ); - gtk_widget_ref( CBOssDevice ); - gtk_object_set_data_full( GTK_OBJECT( OSSConfig ),"CBOssDevice",CBOssDevice,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( CBOssDevice ); + CBOssDevice=AddComboBox( NULL ); gtk_table_attach( GTK_TABLE( table2 ),CBOssDevice,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); CBOssDevice_items=g_list_append( CBOssDevice_items,(gpointer)"/dev/dsp" ); CBOssDevice_items=g_list_append( CBOssDevice_items,(gpointer)"/dev/dsp0" ); @@ -1225,16 +1160,10 @@ CEOssDevice=GTK_COMBO( CBOssDevice )->entry; gtk_widget_set_name( CEOssDevice,"CEOssDevice" ); - gtk_widget_ref( CEOssDevice ); - gtk_object_set_data_full( GTK_OBJECT( OSSConfig ),"CEOssDevice",CEOssDevice,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( CEOssDevice ); - CBOssMixer=gtk_combo_new(); - gtk_widget_set_name( CBOssMixer,"CBOssMixer" ); - gtk_widget_ref( CBOssMixer ); - gtk_object_set_data_full( GTK_OBJECT( OSSConfig ),"CBOssMixer",CBOssMixer,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( CBOssMixer ); - gtk_table_attach( GTK_TABLE( table2 ),CBOssMixer,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); + CBOssMixer=AddComboBox( NULL ); + gtk_table_attach( GTK_TABLE( table2 ),CBOssMixer,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); CBOssMixer_items=g_list_append( CBOssMixer_items,(gpointer)"/dev/mixer" ); CBOssMixer_items=g_list_append( CBOssMixer_items,(gpointer)"/dev/mixer0" ); CBOssMixer_items=g_list_append( CBOssMixer_items,(gpointer)"/dev/mixer1" ); @@ -1245,8 +1174,6 @@ CEOssMixer=GTK_COMBO( CBOssMixer )->entry; gtk_widget_set_name( CEOssMixer,"CEOssMixer" ); - gtk_widget_ref( CEOssMixer ); - gtk_object_set_data_full( GTK_OBJECT( OSSConfig ),"CEOssMixer",CEOssMixer,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( CEOssMixer ); AddHSeparator( vbox604 ); @@ -1257,15 +1184,13 @@ BOssOk=AddButton( MSGTR_Ok,hbuttonbox6 ); BOssCancel=AddButton( MSGTR_Cancel,hbuttonbox6 ); - gtk_signal_connect( GTK_OBJECT( OSSConfig ),"destroy",GTK_SIGNAL_FUNC( ossDestroy ),NULL ); - gtk_signal_connect( GTK_OBJECT( OSSConfig ),"hide",GTK_SIGNAL_FUNC( ossShow ),(void*)0 ); - gtk_signal_connect( GTK_OBJECT( OSSConfig ),"show",GTK_SIGNAL_FUNC( ossShow ),(void*)1 ); + gtk_signal_connect( GTK_OBJECT( OSSConfig ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&OSSConfig ); - gtk_signal_connect( GTK_OBJECT( BOssOk ),"released",GTK_SIGNAL_FUNC( ossButton ),(void*)1 ); - gtk_signal_connect( GTK_OBJECT( BOssCancel ),"released",GTK_SIGNAL_FUNC( ossButton ),(void*)0 ); + gtk_signal_connect( GTK_OBJECT( BOssOk ),"clicked",GTK_SIGNAL_FUNC( ossButton ),(void*)1 ); + gtk_signal_connect( GTK_OBJECT( BOssCancel ),"clicked",GTK_SIGNAL_FUNC( ossButton ),(void*)0 ); - gtk_widget_add_accelerator( BOssOk,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); - gtk_widget_add_accelerator( BOssCancel,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( BOssOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( BOssCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); gtk_window_add_accel_group( GTK_WINDOW( OSSConfig ),accel_group ); @@ -1290,13 +1215,11 @@ static GtkWidget * dxr3BOk; static GtkWidget * dxr3BCancel; -static int gtkVDXR3Config = 0; - GtkWidget * create_DXR3Config( void ); void ShowDXR3Config( void ) { - if ( gtkVDXR3Config ) gtkActive( DXR3Config ); + if ( DXR3Config ) gtkActive( DXR3Config ); else DXR3Config=create_DXR3Config(); gtk_entry_set_text( GTK_ENTRY( CEDXR3Device ),gtkDXR3Device ); @@ -1311,15 +1234,14 @@ gtk_widget_show( DXR3Config ); gtkSetLayer( DXR3Config ); - gtkVDXR3Config=1; } void HideDXR3Config( void ) { - if ( !gtkVDXR3Config ) return; + if ( !DXR3Config ) return; gtk_widget_hide( DXR3Config ); gtk_widget_destroy( DXR3Config ); - gtkVDXR3Config=0; + DXR3Config=NULL; } static void dxr3Button( GtkButton * button,gpointer user_data ) @@ -1334,22 +1256,14 @@ #ifdef USE_LIBFAME gtkVopFAME=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBVFame ) ); #endif - case 2: // Destroy case 1: // Cancel HideDXR3Config(); break; - case 3: // Show - gtkVDXR3Config=1; - break; - case 4: // Hide - gtkVDXR3Config=0; - break; } } GtkWidget * create_DXR3Config( void ) { - GtkWidget * frame; GtkWidget * vbox1; GtkWidget * vbox2; GtkWidget * hbox1; @@ -1368,30 +1282,19 @@ GTK_WIDGET_SET_FLAGS( DXR3Config,GTK_CAN_DEFAULT ); gtk_window_set_title( GTK_WINDOW( DXR3Config ),"DXR3/H+" ); gtk_window_set_position( GTK_WINDOW( DXR3Config ),GTK_WIN_POS_CENTER ); - gtk_window_set_modal( GTK_WINDOW( DXR3Config ),TRUE ); gtk_window_set_policy( GTK_WINDOW( DXR3Config ),FALSE,FALSE,FALSE ); gtk_window_set_wmclass( GTK_WINDOW( DXR3Config ),"DXR3","MPlayer" ); gtk_widget_realize( DXR3Config ); gtkAddIcon( DXR3Config ); - frame=AddFrame( NULL,GTK_SHADOW_IN,DXR3Config,1 ); - gtk_container_set_border_width( GTK_CONTAINER( frame ),1 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - frame=AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,frame,1 ); - frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); - - vbox1=AddVBox( frame ); - vbox2=AddVBox( vbox1 ); + vbox1=AddVBox( AddDialogFrame( DXR3Config ),0 ); + vbox2=AddVBox( vbox1,0 ); hbox1=AddHBox( vbox2,1 ); AddLabel( MSGTR_PREFERENCES_OSS_Device,hbox1 ); - CBDevice=gtk_combo_new(); - gtk_widget_set_name( CBDevice,"CBDevice" ); - gtk_widget_ref( CBDevice ); - gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"CBDevice",CBDevice,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( CBDevice ); - gtk_box_pack_start( GTK_BOX( hbox1 ),CBDevice,TRUE,TRUE,0 ); + CBDevice=AddComboBox( hbox1 ); + CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300" ); CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-0" ); CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-1" ); @@ -1402,14 +1305,12 @@ CEDXR3Device=GTK_COMBO( CBDevice )->entry; gtk_widget_set_name( CEDXR3Device,"CEDXR3Device" ); - gtk_widget_ref( CEDXR3Device ); - gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"CEDXR3Device",CEDXR3Device,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( CEDXR3Device ); gtk_entry_set_text( GTK_ENTRY( CEDXR3Device ),"/dev/em8300" ); #if defined( USE_LIBAVCODEC ) || defined( USE_LIBFAME ) AddHSeparator( vbox2 ); - vbox3=AddVBox( vbox2 ); + vbox3=AddVBox( vbox2,0 ); AddLabel( MSGTR_PREFERENCES_DXR3_VENC,vbox3 ); RBVNone=AddRadioButton( MSGTR_PREFERENCES_None,&VEncoder_group,vbox3 ); #ifdef USE_LIBAVCODEC @@ -1429,15 +1330,13 @@ dxr3BOk=AddButton( MSGTR_Ok,hbuttonbox1 ); dxr3BCancel=AddButton( MSGTR_Cancel,hbuttonbox1 ); - gtk_widget_add_accelerator( dxr3BOk,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); - gtk_widget_add_accelerator( dxr3BCancel,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( dxr3BOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( dxr3BCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); - gtk_signal_connect( GTK_OBJECT( DXR3Config ),"destroy",GTK_SIGNAL_FUNC( dxr3Button ),(void *)2 ); - gtk_signal_connect( GTK_OBJECT( DXR3Config ),"show",GTK_SIGNAL_FUNC( dxr3Button ),(void *)3 ); - gtk_signal_connect( GTK_OBJECT( DXR3Config ),"hide",GTK_SIGNAL_FUNC( dxr3Button ),(void *)4 ); + gtk_signal_connect( GTK_OBJECT( DXR3Config ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&DXR3Config ); - gtk_signal_connect( GTK_OBJECT( dxr3BOk ),"released",GTK_SIGNAL_FUNC( dxr3Button ),(void *)0 ); - gtk_signal_connect( GTK_OBJECT( dxr3BCancel ),"released",GTK_SIGNAL_FUNC( dxr3Button ),(void *)1 ); + gtk_signal_connect( GTK_OBJECT( dxr3BOk ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),(void *)0 ); + gtk_signal_connect( GTK_OBJECT( dxr3BCancel ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),(void *)1 ); gtk_window_add_accel_group( GTK_WINDOW( DXR3Config ),accel_group );
--- a/Gui/mplayer/gtk/opts.h Wed Nov 27 22:45:54 2002 +0000 +++ b/Gui/mplayer/gtk/opts.h Wed Nov 27 22:48:56 2002 +0000 @@ -6,7 +6,6 @@ extern GtkWidget * OSSConfig; extern GtkWidget * Preferences; -extern int gtkVPreferences; extern GtkWidget * prEFontName; extern GtkWidget * create_Preferences( void );
--- a/Gui/mplayer/gtk/pl.c Wed Nov 27 22:45:54 2002 +0000 +++ b/Gui/mplayer/gtk/pl.c Wed Nov 27 22:48:56 2002 +0000 @@ -17,6 +17,7 @@ #include "../../interface.h" #include "../widgets.h" #include "pl.h" +#include "common.h" static char * book_open_xpm[] = { "16 16 4 1", @@ -66,7 +67,7 @@ " .. ", " "}; - GtkWidget * PlayList; + GtkWidget * PlayList = NULL; static GtkWidget * CTDirTree; static GtkWidget * CLFiles; static GtkWidget * CLSelected; @@ -79,7 +80,6 @@ static GdkBitmap * msOpenedBook; static GdkBitmap * msClosedBook; -static int gtkVPlaylist = 0; static int NrOfEntrys = 0; static int NrOfSelected = 0; static int * CLFileSelected = NULL; @@ -114,7 +114,7 @@ void ShowPlayList( void ) { - if ( gtkVPlaylist ) gtkActive( PlayList ); + if ( PlayList ) gtkActive( PlayList ); else PlayList=create_PlayList(); if ( old_path && *old_path ) @@ -175,18 +175,15 @@ void HidePlayList( void ) { - if ( !gtkVPlaylist ) return; - gtkVPlaylist=NrOfSelected=NrOfEntrys=0; - if ( CLListSelected ) free( CLListSelected ); CLListSelected=NULL; - if ( CLFileSelected ) free( CLFileSelected ); CLFileSelected=NULL; + if ( !PlayList ) return; + NrOfSelected=NrOfEntrys=0; + gfree( (void **)&CLListSelected ); gfree( (void **)&CLFileSelected ); if ( old_path ) free( old_path ); old_path=strdup( current_path ); gtk_widget_hide( PlayList ); gtk_widget_destroy( PlayList ); + PlayList=NULL; } -static void plDestroy( GtkObject * object,gpointer user_data ) -{ HidePlayList(); } - static void plRowSelect( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data ) { switch ( (int) user_data ) @@ -392,40 +389,26 @@ if ( CLFileSelected ) free( CLFileSelected ); CLFileSelected=calloc( 1,NrOfEntrys * sizeof( int ) ); } -static void plShow( GtkWidget * widget,gpointer user_data ) -{ gtkVPlaylist=(int)user_data; } - GtkWidget * create_PlayList( void ) { - GtkWidget * frame1; - GtkWidget * frame2; - GtkWidget * frame3; - GtkWidget * frame4; GtkWidget * vbox1; GtkWidget * hbox1; - GtkWidget * frame5; GtkWidget * scrolledwindow1; - GtkWidget * label2; - GtkWidget * frame6; GtkWidget * vbox2; GtkWidget * scrolledwindow2; - GtkWidget * label3; - GtkWidget * hseparator2; GtkWidget * scrolledwindow3; - GtkWidget * label5; - GtkWidget * hseparator1; GtkWidget * hbuttonbox1; GtkAccelGroup * accel_group; - GdkColor transparent = { 0 }; - gchar * root = "/"; - gchar * dummy = "dummy"; + GdkColor transparent = { 0,0,0,0 }; + gchar * root = "/"; + gchar * dummy = "dummy"; DirNodeType * DirNode; accel_group=gtk_accel_group_new(); PlayList=gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_object_set_data( GTK_OBJECT( PlayList ),"PlayList",PlayList ); - gtk_widget_set_usize( PlayList,512,300 ); + gtk_widget_set_usize( PlayList,512,384 ); gtk_window_set_title( GTK_WINDOW( PlayList ),MSGTR_PlayList ); gtk_window_set_position( GTK_WINDOW( PlayList ),GTK_WIN_POS_CENTER ); // gtk_window_set_policy( GTK_WINDOW( PlayList ),FALSE,FALSE,FALSE ); @@ -434,64 +417,17 @@ gtk_widget_realize( PlayList ); gtkAddIcon( PlayList ); - frame1=gtk_frame_new( NULL ); - gtk_widget_ref( frame1 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"frame1",frame1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( frame1 ); - gtk_container_add( GTK_CONTAINER( PlayList ),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_ref( frame2 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"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_ref( frame3 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"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_ref( frame4 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"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_ref( vbox1 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"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_ref( hbox1 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"hbox1",hbox1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( hbox1 ); - gtk_box_pack_start( GTK_BOX( vbox1 ),hbox1,TRUE,TRUE,0 ); - - frame5=gtk_frame_new( NULL ); - gtk_widget_ref( frame5 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"frame5",frame5,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( frame5 ); - gtk_box_pack_start( GTK_BOX( hbox1 ),frame5,TRUE,TRUE,0 ); - gtk_frame_set_shadow_type( GTK_FRAME( frame5 ),GTK_SHADOW_ETCHED_OUT ); + vbox1=AddVBox( AddDialogFrame( PlayList ),0 ); + hbox1=AddHBox( NULL,1 ); + gtk_box_pack_start( GTK_BOX( vbox1 ),hbox1,TRUE,TRUE,0 ); scrolledwindow1=gtk_scrolled_window_new( NULL,NULL ); - gtk_widget_ref( scrolledwindow1 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"scrolledwindow1",scrolledwindow1,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( scrolledwindow1 ); - gtk_container_add( GTK_CONTAINER( frame5 ),scrolledwindow1 ); + gtk_container_add( GTK_CONTAINER( + AddFrame( NULL,0,hbox1,1 ) ),scrolledwindow1 ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC ); CTDirTree=gtk_ctree_new( 1,0 ); - gtk_widget_ref( CTDirTree ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"CTDirTree",CTDirTree,(GtkDestroyNotify)gtk_widget_unref ); gtk_signal_connect( GTK_OBJECT( CTDirTree ),"tree_expand",GTK_SIGNAL_FUNC( plCTree ),(void*)0 ); gtk_signal_connect( GTK_OBJECT( CTDirTree ),"select_row",GTK_SIGNAL_FUNC( plCTRow ),(void *)0 ); gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),CTDirTree ); @@ -502,8 +438,6 @@ gtk_clist_column_titles_show( GTK_CLIST( CTDirTree ) ); gtk_clist_set_shadow_type( GTK_CLIST( CTDirTree ),GTK_SHADOW_NONE ); - gtk_widget_realize( PlayList ); - if ( !pxOpenedBook ) pxOpenedBook=gdk_pixmap_create_from_xpm_d( PlayList->window,&msOpenedBook,&transparent,book_closed_xpm ); if ( !pxClosedBook ) pxClosedBook=gdk_pixmap_create_from_xpm_d( PlayList->window,&msClosedBook,&transparent,book_open_xpm ); @@ -514,38 +448,20 @@ sibling=gtk_ctree_insert_node( GTK_CTREE( CTDirTree ),parent,NULL,&dummy,4,NULL,NULL,NULL,NULL,TRUE,TRUE ); gtk_ctree_expand( GTK_CTREE( CTDirTree ),parent ); gtk_widget_show( CTDirTree ); + - label2=gtk_label_new( MSGTR_PLAYLIST_DirectoryTree ); - gtk_widget_ref( label2 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"label2",label2,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label2 ); - gtk_clist_set_column_widget( GTK_CLIST( CTDirTree ),0,label2 ); - gtk_misc_set_alignment( GTK_MISC( label2 ),0.02,0.5 ); - - frame6=gtk_frame_new( NULL ); - gtk_widget_ref( frame6 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"frame6",frame6,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( frame6 ); - gtk_box_pack_start( GTK_BOX( hbox1 ),frame6,TRUE,TRUE,0 ); - gtk_widget_set_usize( frame6,170,-2 ); - gtk_frame_set_shadow_type( GTK_FRAME( frame6 ),GTK_SHADOW_ETCHED_OUT ); - - vbox2=gtk_vbox_new( FALSE,0 ); - gtk_widget_ref( vbox2 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"vbox2",vbox2,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( vbox2 ); - gtk_container_add( GTK_CONTAINER( frame6 ),vbox2 ); + gtk_clist_set_column_widget( GTK_CLIST( CTDirTree ),0, + AddLabel( MSGTR_PLAYLIST_DirectoryTree,NULL ) ); + + vbox2=AddVBox( + AddFrame( NULL,1,hbox1,1 ),0 ); scrolledwindow2=gtk_scrolled_window_new( NULL,NULL ); - gtk_widget_ref( scrolledwindow2 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"scrolledwindow2",scrolledwindow2,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( scrolledwindow2 ); gtk_box_pack_start( GTK_BOX( vbox2 ),scrolledwindow2,TRUE,TRUE,0 ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow2 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC ); CLFiles=gtk_clist_new( 1 ); - gtk_widget_ref( CLFiles ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"CLFiles",CLFiles,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( CLFiles ); gtk_container_add( GTK_CONTAINER( scrolledwindow2 ),CLFiles ); gtk_clist_set_column_width( GTK_CLIST( CLFiles ),0,80 ); @@ -553,30 +469,17 @@ gtk_clist_column_titles_show( GTK_CLIST( CLFiles ) ); gtk_clist_set_shadow_type( GTK_CLIST( CLFiles ),GTK_SHADOW_NONE ); - label3=gtk_label_new( MSGTR_PLAYLIST_Files ); - gtk_widget_ref( label3 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"label3",label3,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label3 ); - gtk_clist_set_column_widget( GTK_CLIST( CLFiles ),0,label3 ); - gtk_misc_set_alignment( GTK_MISC( label3 ),0.02,0.5 ); + gtk_clist_set_column_widget( GTK_CLIST( CLFiles ),0, + AddLabel( MSGTR_PLAYLIST_Files,NULL ) ); - hseparator2=gtk_hseparator_new(); - gtk_widget_ref( hseparator2 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"hseparator2",hseparator2,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( hseparator2 ); - gtk_box_pack_start( GTK_BOX( vbox2 ),hseparator2,FALSE,FALSE,0 ); - gtk_widget_set_usize( hseparator2,-2,3 ); + AddHSeparator( vbox2 ); scrolledwindow3=gtk_scrolled_window_new( NULL,NULL ); - gtk_widget_ref( scrolledwindow3 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"scrolledwindow3",scrolledwindow3,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( scrolledwindow3 ); gtk_box_pack_start( GTK_BOX( vbox2 ),scrolledwindow3,TRUE,TRUE,0 ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow3 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC ); CLSelected=gtk_clist_new( 2 ); - gtk_widget_ref( CLSelected ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"CLSelected",CLSelected,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( CLSelected ); gtk_container_add( GTK_CONTAINER( scrolledwindow3 ),CLSelected ); gtk_clist_set_column_width( GTK_CLIST( CLSelected ),0,295 ); @@ -585,80 +488,36 @@ gtk_clist_column_titles_show( GTK_CLIST( CLSelected ) ); gtk_clist_set_shadow_type( GTK_CLIST( CLSelected ),GTK_SHADOW_NONE ); - label5=gtk_label_new( MSGTR_PLAYLIST_Selected ); - gtk_widget_ref( label5 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"label5",label5,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label5 ); - gtk_clist_set_column_widget( GTK_CLIST( CLSelected ),0,label5 ); - gtk_misc_set_alignment( GTK_MISC( label5 ),0.02,0.5 ); - - label5=gtk_label_new( MSGTR_PLAYLIST_Path ); - gtk_widget_ref( label5 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"label5",label5,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label5 ); - gtk_clist_set_column_widget( GTK_CLIST( CLSelected ),1,label5 ); - gtk_misc_set_alignment( GTK_MISC( label5 ),0.02,0.5 ); + gtk_clist_set_column_widget( GTK_CLIST( CLSelected ),0, + AddLabel( MSGTR_PLAYLIST_Selected,NULL ) ); - hseparator1=gtk_hseparator_new(); - gtk_widget_ref( hseparator1 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"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,6 ); + gtk_clist_set_column_widget( GTK_CLIST( CLSelected ),1, + AddLabel( MSGTR_PLAYLIST_Path,NULL ) ); - hbuttonbox1=gtk_hbutton_box_new(); - gtk_widget_ref( hbuttonbox1 ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"hbuttonbox1",hbuttonbox1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( hbuttonbox1 ); - gtk_box_pack_start( GTK_BOX( vbox1 ),hbuttonbox1,FALSE,FALSE,0 ); - gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); - gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); - gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),-1,20 ); - gtk_button_box_set_child_ipadding( GTK_BUTTON_BOX( hbuttonbox1 ),0,-1 ); + AddHSeparator( vbox1 ); - Add=gtk_button_new_with_label( MSGTR_Add ); - gtk_widget_ref( Add ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"Add",Add,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( Add ); - gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Add ); - GTK_WIDGET_UNSET_FLAGS( Add,GTK_CAN_FOCUS ); - - Remove=gtk_button_new_with_label( MSGTR_Remove ); - gtk_widget_ref( Remove ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"Remove",Remove,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( Remove ); - gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Remove ); - GTK_WIDGET_UNSET_FLAGS( Remove,GTK_CAN_FOCUS ); + hbuttonbox1=AddHButtonBox( vbox1 ); + gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); + gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); - Ok=gtk_button_new_with_label( MSGTR_Ok ); - gtk_widget_ref( Ok ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"Ok",Ok,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( Ok ); - gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Ok ); - GTK_WIDGET_UNSET_FLAGS( Ok,GTK_CAN_FOCUS ); -// gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); + Add=AddButton( MSGTR_Add,hbuttonbox1 ); + Remove=AddButton( MSGTR_Remove,hbuttonbox1 ); + Ok=AddButton( MSGTR_Ok,hbuttonbox1 ); + Cancel=AddButton( MSGTR_Cancel,hbuttonbox1 ); - Cancel=gtk_button_new_with_label( MSGTR_Cancel ); - gtk_widget_ref( Cancel ); - gtk_object_set_data_full( GTK_OBJECT( PlayList ),"Cancel",Cancel,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( Cancel ); - gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Cancel ); - GTK_WIDGET_UNSET_FLAGS( Cancel,GTK_CAN_FOCUS ); - gtk_widget_add_accelerator( Cancel,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); - gtk_signal_connect( GTK_OBJECT( PlayList ),"destroy",GTK_SIGNAL_FUNC( plDestroy ),NULL ); - gtk_signal_connect( GTK_OBJECT( PlayList ),"show",GTK_SIGNAL_FUNC( plShow ),(void *)1 ); - gtk_signal_connect( GTK_OBJECT( PlayList ),"hide",GTK_SIGNAL_FUNC( plShow ),(void *)0 ); + gtk_signal_connect( GTK_OBJECT( PlayList ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&PlayList ); gtk_signal_connect( GTK_OBJECT( CLFiles ),"select_row",GTK_SIGNAL_FUNC( plRowSelect ),(void *)0 ); gtk_signal_connect( GTK_OBJECT( CLFiles ),"unselect_row",GTK_SIGNAL_FUNC( plUnRowSelect ),(void *)0 ); sigSel=gtk_signal_connect( GTK_OBJECT( CLSelected ),"select_row",GTK_SIGNAL_FUNC( plRowSelect ),(void*)1 ); sigUnsel=gtk_signal_connect( GTK_OBJECT( CLSelected ),"unselect_row",GTK_SIGNAL_FUNC( plUnRowSelect ),(void*)1 ); - gtk_signal_connect( GTK_OBJECT( Add ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)3 ); - gtk_signal_connect( GTK_OBJECT( Remove ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)2 ); - gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)1 ); - gtk_signal_connect( GTK_OBJECT( Cancel ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)0 ); + gtk_signal_connect( GTK_OBJECT( Add ),"clicked",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)3 ); + gtk_signal_connect( GTK_OBJECT( Remove ),"clicked",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)2 ); + gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)1 ); + gtk_signal_connect( GTK_OBJECT( Cancel ),"clicked",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)0 ); gtk_window_add_accel_group( GTK_WINDOW( PlayList ),accel_group );
--- a/Gui/mplayer/gtk/sb.c Wed Nov 27 22:45:54 2002 +0000 +++ b/Gui/mplayer/gtk/sb.c Wed Nov 27 22:48:56 2002 +0000 @@ -7,6 +7,8 @@ #include <stdio.h> #include "sb.h" +#include "common.h" + #include "../../app.h" #include "../../../config.h" #include "../../../help_mp.h" @@ -14,7 +16,7 @@ #include "../widgets.h" #include "../app.h" -GtkWidget * SkinList; +GtkWidget * SkinList = NULL; char * sbSelectedSkin=NULL; char * sbMPlayerDirInHome=NULL; char * sbMPlayerPrefixDir=NULL; @@ -22,20 +24,20 @@ char * gtkOldSkin; static char * prev; -int gtkVSkinBrowser = 0; -GtkWidget * SkinBrowser; +GtkWidget * SkinBrowser = NULL; void ShowSkinBrowser( void ) { - if ( gtkVSkinBrowser ) gtkActive( SkinBrowser ); + if ( SkinBrowser ) gtkActive( SkinBrowser ); else SkinBrowser=create_SkinBrowser(); } void HideSkinBrowser( void ) { - if ( !gtkVSkinBrowser ) return; - gtkVSkinBrowser=0; + if ( !SkinBrowser ) return; + gtk_widget_hide( SkinBrowser ); gtk_widget_destroy( SkinBrowser ); + SkinBrowser=NULL; } int gtkFillSkinList( gchar * mdir ) @@ -59,7 +61,7 @@ free( str[0] ); glob( mdir,GLOB_NOSORT,NULL,&gg ); - for( i=0;i<gg.gl_pathc;i++ ) + for( i=0;i<(int)gg.gl_pathc;i++ ) { if ( !strcmp( gg.gl_pathv[i],"." ) || !strcmp( gg.gl_pathv[i],".." ) ) continue; stat( gg.gl_pathv[i],&fs ); @@ -77,27 +79,23 @@ return 1; } -void on_SkinBrowser_destroy( GtkObject * object,gpointer user_data ) -{ HideSkinBrowser(); } - -void on_SkinBrowser_show( GtkObject * object,gpointer user_data ) -{ gtkVSkinBrowser=(int)user_data; } - -void on_SkinBrowser_Cancel( GtkObject * object,gpointer user_data ) +static void prButton( GtkObject * object,gpointer user_data ) { - if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) ChangeSkin( gtkOldSkin ); + switch ( (int)user_data ) + { + case 0: // cancel + if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) ChangeSkin( gtkOldSkin ); + break; + case 1: // ok + ChangeSkin( sbSelectedSkin ); + if ( skinName ) free( skinName ); + skinName=strdup( sbSelectedSkin ); + break; + } HideSkinBrowser(); } -void on_SkinBrowser_Ok( GtkObject * object,gpointer user_data ) -{ - ChangeSkin( sbSelectedSkin ); - if ( skinName ) free( skinName ); - skinName=strdup( sbSelectedSkin ); - HideSkinBrowser(); -} - -void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data ) +static void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data ) { gtk_clist_get_text( clist,row,0,&sbSelectedSkin ); if ( strcmp( prev,sbSelectedSkin ) ) @@ -117,17 +115,8 @@ GtkWidget * create_SkinBrowser( void ) { - GtkWidget * SkinBrowser; - GtkWidget * frame5; - GtkWidget * frame6; - GtkWidget * frame7; - GtkWidget * frame8; GtkWidget * vbox5; - GtkWidget * label; - GtkWidget * hseparator4; GtkWidget * scrolledwindow1; - GtkWidget * label2; - GtkWidget * hseparator5; GtkWidget * hbuttonbox4; GtkWidget * Cancel; GtkWidget * Ok; @@ -140,72 +129,19 @@ gtk_object_set_data( GTK_OBJECT( SkinBrowser ),MSGTR_SkinBrowser,SkinBrowser ); gtk_widget_set_usize( SkinBrowser,256,320 ); gtk_container_set_border_width( GTK_CONTAINER( SkinBrowser ),1 ); -// GTK_WIDGET_SET_FLAGS( SkinBrowser,GTK_CAN_FOCUS ); GTK_WIDGET_SET_FLAGS( SkinBrowser,GTK_CAN_DEFAULT ); gtk_widget_set_events( SkinBrowser,GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK ); gtk_window_set_title( GTK_WINDOW( SkinBrowser ),MSGTR_SkinBrowser ); gtk_window_set_position( GTK_WINDOW( SkinBrowser ),GTK_WIN_POS_CENTER ); gtk_window_set_policy( GTK_WINDOW( SkinBrowser ),FALSE,FALSE,TRUE ); - gtk_window_set_wmclass( GTK_WINDOW( SkinBrowser ),MSGTR_SkinBrowser,"MPlayer" ); + gtk_window_set_wmclass( GTK_WINDOW( SkinBrowser ),"SkinBrowser","MPlayer" ); gtk_widget_realize( SkinBrowser ); gtkAddIcon( SkinBrowser ); - 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_widget_show( frame5 ); - gtk_container_add( GTK_CONTAINER( SkinBrowser ),frame5 ); - gtk_frame_set_shadow_type( GTK_FRAME( frame5 ),GTK_SHADOW_IN ); - - 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_widget_show( frame6 ); - gtk_container_add( GTK_CONTAINER( frame5 ),frame6 ); - gtk_frame_set_shadow_type( GTK_FRAME( frame6 ),GTK_SHADOW_NONE ); - - 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_widget_show( frame7 ); - gtk_container_add( GTK_CONTAINER( frame6 ),frame7 ); - gtk_frame_set_shadow_type( GTK_FRAME( frame7 ),GTK_SHADOW_ETCHED_OUT ); - - 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_widget_show( frame8 ); - gtk_container_add( GTK_CONTAINER( frame7 ),frame8 ); - gtk_frame_set_shadow_type( GTK_FRAME( frame8 ),GTK_SHADOW_NONE ); - - 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_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_widget_show( label ); - gtk_box_pack_start( GTK_BOX( vbox5 ),label,FALSE,FALSE,0 ); - gtk_label_set_justify( GTK_LABEL( label ),GTK_JUSTIFY_RIGHT ); - gtk_misc_set_alignment( GTK_MISC( label ),7.45058e-09,7.45058e-09 ); - - 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_widget_show( hseparator4 ); - gtk_box_pack_start( GTK_BOX( vbox5 ),hseparator4,FALSE,TRUE,0 ); - gtk_widget_set_usize( hseparator4,-2,5 ); + vbox5=AddVBox( AddDialogFrame( SkinBrowser ),0 ); + AddLabel( MSGTR_SKIN_LABEL,vbox5 ); + AddHSeparator( vbox5 ); scrolledwindow1=gtk_scrolled_window_new( NULL,NULL ); gtk_widget_set_name( scrolledwindow1,"scrolledwindow1" ); @@ -227,57 +163,22 @@ gtk_clist_column_titles_hide( GTK_CLIST( SkinList ) ); gtk_clist_set_shadow_type( GTK_CLIST( SkinList ),GTK_SHADOW_ETCHED_OUT ); - label2=gtk_label_new( "label2" ); - gtk_widget_set_name( label2,"label2" ); - gtk_widget_ref( label2 ); - gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"label2",label2,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label2 ); - gtk_clist_set_column_widget( GTK_CLIST( SkinList ),0,label2 ); + AddHSeparator( vbox5 ); - hseparator5=gtk_hseparator_new(); - gtk_widget_set_name( hseparator5,"hseparator5" ); - gtk_widget_ref( hseparator5 ); - gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"hseparator5",hseparator5,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( hseparator5 ); - gtk_box_pack_start( GTK_BOX( vbox5 ),hseparator5,FALSE,TRUE,0 ); - gtk_widget_set_usize( hseparator5,-2,9 ); - - hbuttonbox4=gtk_hbutton_box_new(); - gtk_widget_set_name( hbuttonbox4,"hbuttonbox4" ); - gtk_widget_ref( hbuttonbox4 ); - gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"hbuttonbox4",hbuttonbox4,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_set_usize( hbuttonbox4,-2,25 ); - gtk_widget_show( hbuttonbox4 ); - gtk_box_pack_start( GTK_BOX( vbox5 ),hbuttonbox4,FALSE,TRUE,0 ); - gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox4 ),GTK_BUTTONBOX_END ); - gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox4 ),5 ); - gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox4 ),75,0 ); + hbuttonbox4=AddHButtonBox( vbox5 ); + gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox4 ),GTK_BUTTONBOX_SPREAD ); + gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox4 ),10 ); - 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( SkinBrowser ),MSGTR_Ok,Ok,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( Ok ); - gtk_container_add( GTK_CONTAINER( hbuttonbox4 ),Ok ); - gtk_widget_set_usize( Ok,-2,22 ); - gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); + Ok=AddButton( MSGTR_Ok,hbuttonbox4 ); + Cancel=AddButton( MSGTR_Cancel,hbuttonbox4 ); - Cancel=gtk_button_new_with_label( MSGTR_Cancel ); - gtk_widget_set_name( Cancel,MSGTR_Cancel ); - gtk_widget_ref( Cancel ); - gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),MSGTR_Cancel,Cancel,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( Cancel ); - gtk_container_add( GTK_CONTAINER( hbuttonbox4 ),Cancel ); - gtk_widget_set_usize( Cancel,-2,22 ); - gtk_widget_add_accelerator( Cancel,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); - 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 ),(void *)1 ); - gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"hide",GTK_SIGNAL_FUNC( on_SkinBrowser_show ),0 ); - + gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&SkinBrowser ); 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 ); + gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void *)1 ); + gtk_signal_connect( GTK_OBJECT( Cancel ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void *)0 ); if ( ( sbMPlayerDirInHome=(char *)calloc( 1,strlen( skinDirInHome ) + 4 ) ) != NULL ) { strcpy( sbMPlayerDirInHome,skinDirInHome ); strcat( sbMPlayerDirInHome,"/*" ); }
--- a/Gui/mplayer/gtk/url.c Wed Nov 27 22:45:54 2002 +0000 +++ b/Gui/mplayer/gtk/url.c Wed Nov 27 22:48:56 2002 +0000 @@ -10,13 +10,13 @@ #include <gtk/gtk.h> #include "url.h" +#include "common.h" #include "../../interface.h" #include "../../app.h" #include "../widgets.h" #include "../../help_mp.h" -GtkWidget * URL; -int gtkVURLDialogBox = 0; +GtkWidget * URL = NULL; static GtkWidget * URLCombo; static GtkWidget * URLEntry; @@ -24,7 +24,7 @@ void ShowURLDialogBox( void ) { - if ( gtkVURLDialogBox ) gtkActive( URL ); + if ( URL ) gtkActive( URL ); else URL=create_URL(); if ( URLList ) @@ -46,21 +46,14 @@ } gtk_widget_show( URL ); - gtkVURLDialogBox=1; } void HideURLDialogBox( void ) { - if ( !gtkVURLDialogBox ) return; + if ( !URL ) return; gtk_widget_hide( URL ); gtk_widget_destroy( URL ); - gtkVURLDialogBox=0; -} - -static gboolean on_URL_destroy_event( GtkWidget * widget,GdkEvent * event,gpointer user_data ) -{ - HideURLDialogBox(); - return FALSE; + URL=0; } static void on_Button_pressed( GtkButton * button,gpointer user_data ) @@ -93,19 +86,10 @@ HideURLDialogBox(); } -static void ab_URL_show( GtkButton * button,gpointer user_data ) -{ gtkVURLDialogBox=(int)user_data; } - GtkWidget * create_URL( void ) { - GtkWidget * frame1; - GtkWidget * frame2; - GtkWidget * frame3; - GtkWidget * frame4; GtkWidget * vbox1; GtkWidget * hbox1; - GtkWidget * label1; - GtkWidget * hsep; GtkWidget * hbuttonbox1; GtkWidget * Ok; GtkWidget * Cancel; @@ -121,128 +105,41 @@ gtk_window_set_title( GTK_WINDOW( URL ),MSGTR_Network ); gtk_window_set_position( GTK_WINDOW( URL ),GTK_WIN_POS_CENTER ); gtk_window_set_policy( GTK_WINDOW( URL ),TRUE,TRUE,FALSE ); - gtk_window_set_wmclass( GTK_WINDOW( URL ),MSGTR_Network,"MPlayer" ); + gtk_window_set_wmclass( GTK_WINDOW( URL ),"Network","MPlayer" ); gtk_widget_realize( URL ); gtkAddIcon( URL ); - frame1=gtk_frame_new( NULL ); - gtk_widget_set_name( frame1,"frame1" ); - gtk_widget_ref( frame1 ); - gtk_object_set_data_full( GTK_OBJECT( URL ),"frame1",frame1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( frame1 ); - gtk_container_add( GTK_CONTAINER( URL ),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( URL ),"frame2",frame2,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( frame2 ); - gtk_container_add( GTK_CONTAINER( frame1 ),frame2 ); - gtk_container_set_border_width( GTK_CONTAINER( frame2 ),1 ); - 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( URL ),"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 ); + vbox1=AddVBox( AddDialogFrame( URL ),0 ); + hbox1=AddHBox( vbox1,1 ); + AddLabel( "URL: ",hbox1 ); - frame4=gtk_frame_new( NULL ); - gtk_widget_set_name( frame4,"frame4" ); - gtk_widget_ref( frame4 ); - gtk_object_set_data_full( GTK_OBJECT( URL ),"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( URL ),"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( URL ),"hbox1",hbox1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( hbox1 ); - gtk_box_pack_start( GTK_BOX( vbox1 ),hbox1,TRUE,TRUE,0 ); - - label1=gtk_label_new( "URL: " ); - gtk_widget_set_name( label1,"label1" ); - gtk_widget_ref( label1 ); - gtk_object_set_data_full( GTK_OBJECT( URL ),"label1",label1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( label1 ); - gtk_box_pack_start( GTK_BOX( hbox1 ),label1,FALSE,FALSE,0 ); - gtk_widget_set_usize( label1,38,-2 ); - gtk_label_set_justify( GTK_LABEL( label1 ),GTK_JUSTIFY_FILL ); - gtk_misc_set_alignment( GTK_MISC( label1 ),0.5,0.49 ); - - URLCombo=gtk_combo_new(); + URLCombo=AddComboBox( hbox1 ); +/* + gtk_combo_new(); gtk_widget_set_name( URLCombo,"URLCombo" ); - gtk_widget_ref( URLCombo ); - gtk_object_set_data_full( GTK_OBJECT( URL ),"URLCombo",URLCombo,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( URLCombo ); gtk_box_pack_start( GTK_BOX( hbox1 ),URLCombo,TRUE,TRUE,0 ); - +*/ URLEntry=GTK_COMBO( URLCombo )->entry; gtk_widget_set_name( URLEntry,"URLEntry" ); - gtk_widget_ref( URLEntry ); - gtk_object_set_data_full( GTK_OBJECT( URL ),"URLEntry",URLEntry,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( URLEntry ); - hsep=gtk_hseparator_new(); - gtk_widget_set_name( hsep,"hsep" ); - gtk_widget_ref( hsep ); - gtk_object_set_data_full( GTK_OBJECT( URL ),"hsep",hsep,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( hsep ); - gtk_box_pack_start( GTK_BOX( vbox1 ),hsep,FALSE,TRUE,0 ); - gtk_widget_set_usize( hsep,-2,8 ); + AddHSeparator( vbox1 ); - hbuttonbox1=gtk_hbutton_box_new(); - gtk_widget_set_name( hbuttonbox1,"hbuttonbox1" ); - gtk_widget_ref( hbuttonbox1 ); - gtk_object_set_data_full( GTK_OBJECT( URL ),"hbuttonbox1",hbuttonbox1,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( hbuttonbox1 ); - gtk_box_pack_start( GTK_BOX( vbox1 ),hbuttonbox1,FALSE,FALSE,0 ); - gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); - gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); - gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),85,20 ); - gtk_button_box_set_child_ipadding( GTK_BUTTON_BOX( hbuttonbox1 ),0,0 ); + hbuttonbox1=AddHButtonBox( vbox1 ); + gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); + gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); - Ok=gtk_button_new_with_label( MSGTR_Ok ); - gtk_widget_set_name( Ok,"Ok" ); - gtk_widget_ref( Ok ); - gtk_object_set_data_full( GTK_OBJECT( URL ),"Ok",Ok,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( Ok ); - gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Ok ); - - Cancel=gtk_button_new_with_label( MSGTR_Cancel ); - gtk_widget_set_name( Cancel,"Cancel" ); - gtk_widget_ref( Cancel ); - gtk_object_set_data_full( GTK_OBJECT( URL ),"Cancel",Cancel,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( Cancel ); - gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Cancel ); + Ok=AddButton( MSGTR_Ok,hbuttonbox1 ); + Cancel=AddButton( MSGTR_Cancel,hbuttonbox1 ); - gtk_widget_add_accelerator( Ok,"pressed",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); -// gtk_widget_add_accelerator( Ok,"pressed",accel_group,GDK_O,GDK_MOD1_MASK,GTK_ACCEL_VISIBLE ); -// gtk_widget_add_accelerator( Ok,"pressed",accel_group,GDK_o,GDK_MOD1_MASK,GTK_ACCEL_VISIBLE ); - gtk_widget_add_accelerator( Cancel,"pressed",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); -// gtk_widget_add_accelerator( Cancel,"pressed",accel_group,GDK_C,GDK_MOD1_MASK,GTK_ACCEL_VISIBLE ); -// gtk_widget_add_accelerator( Cancel,"pressed",accel_group,GDK_c,GDK_MOD1_MASK,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); - gtk_signal_connect( GTK_OBJECT( URL ),"destroy",GTK_SIGNAL_FUNC( on_URL_destroy_event ),NULL ); - gtk_signal_connect( GTK_OBJECT( URL ),"show",GTK_SIGNAL_FUNC( ab_URL_show ),(void *)1 ); - gtk_signal_connect( GTK_OBJECT( URL ),"hide",GTK_SIGNAL_FUNC( ab_URL_show ),0 ); - - gtk_signal_connect( GTK_OBJECT( Ok ),"pressed",GTK_SIGNAL_FUNC( on_Button_pressed ),(void *)1 ); - gtk_signal_connect( GTK_OBJECT( Cancel ),"pressed",GTK_SIGNAL_FUNC( on_Button_pressed ),NULL ); + gtk_signal_connect( GTK_OBJECT( URL ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&URL ); + gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( on_Button_pressed ),(void *)1 ); + gtk_signal_connect( GTK_OBJECT( Cancel ),"clicked",GTK_SIGNAL_FUNC( on_Button_pressed ),NULL ); gtk_widget_grab_focus( URLEntry ); gtk_window_add_accel_group( GTK_WINDOW( URL ),accel_group );
--- a/Gui/mplayer/widgets.c Wed Nov 27 22:45:54 2002 +0000 +++ b/Gui/mplayer/widgets.c Wed Nov 27 22:48:56 2002 +0000 @@ -146,7 +146,7 @@ gtkSetLayer( MessageBox ); gtkActive( MessageBox ); if ( type == GTK_MB_FATAL ) - while ( gtkVMessageBox ) gtk_main_iteration_do( 0 ); + while ( MessageBox ) gtk_main_iteration_do( 0 ); } void gtkSetLayer( GtkWidget * wdg ) @@ -204,7 +204,7 @@ break; case evAbout: ShowAboutBox(); - gtkSetLayer( AboutBox ); + gtkSetLayer( About ); break; case evShowPopUpMenu: gtkPopupMenu=evNone;