Mercurial > mplayer.hg
changeset 1907:83291fafe66c
add new features. and fix skin error loop.
author | pontscho |
---|---|
date | Mon, 17 Sep 2001 21:16:00 +0000 |
parents | 01bab6f60ede |
children | b27a56d158de |
files | Gui/mplayer/gtk/mb.h Gui/mplayer/gtk/sb.h Gui/mplayer/menu.h Gui/mplayer/play.c Gui/mplayer/psignal.c Gui/mplayer/widgets.c Gui/mplayer/widgets.h Gui/skin/font.c |
diffstat | 8 files changed, 232 insertions(+), 251 deletions(-) [+] |
line wrap: on
line diff
--- a/Gui/mplayer/gtk/mb.h Mon Sep 17 21:15:14 2001 +0000 +++ b/Gui/mplayer/gtk/mb.h Mon Sep 17 21:16:00 2001 +0000 @@ -4,155 +4,163 @@ GtkWidget * gtkMessageBoxText; -void on_MessageBox_destroy( GtkObject * object,gpointer user_data ) +void on_MessageBox_destroy( GtkObject * object,gpointer user_data ) { - gtk_widget_hide( MessageBox ); + gtk_widget_hide( MessageBox ); gtkVisibleMessageBox=0; } -void on_Ok_released( GtkButton * button,gpointer user_data ) +void on_Ok_released( GtkButton * button,gpointer user_data ) { - gtk_widget_hide( MessageBox ); + gtk_widget_hide( MessageBox ); gtkVisibleMessageBox=0; - gtkSendMessage( evMessageBox ); + gtkSendMessage( evMessageBox ); } -GtkWidget * create_MessageBox( void ) +GtkWidget * create_MessageBox( int type ) { - GtkWidget *MessageBox; - GtkWidget *frame1; - GtkWidget *frame2; - GtkWidget *frame3; - GtkWidget *frame4; - GtkWidget *vbox1; - GtkWidget *vbox2; - GtkWidget *hseparator1; - GtkWidget *hbuttonbox1; - GtkWidget *Ok; - GtkAccelGroup *accel_group; + GtkWidget * MessageBox; + GtkWidget * frame1; + GtkWidget * frame2; + GtkWidget * frame3; + GtkWidget * frame4; + GtkWidget * vbox1; + GtkWidget * hbox1; + GtkWidget * pixmap1; + GtkWidget * hseparator1; + GtkWidget * hbuttonbox1; + GtkWidget * Ok; + GtkAccelGroup * accel_group; + GtkStyle * pixmapstyle; + GtkPixmap * pixmapwid; + GdkBitmap * mask; - accel_group=gtk_accel_group_new(); - - MessageBox=gtk_window_new( GTK_WINDOW_DIALOG ); - gtk_widget_set_name( MessageBox,MSGTR_MessageBox ); - gtk_object_set_data( GTK_OBJECT( MessageBox ),MSGTR_MessageBox,MessageBox ); - gtk_widget_set_usize( MessageBox,420,128 ); - GTK_WIDGET_SET_FLAGS( MessageBox,GTK_CAN_FOCUS ); - GTK_WIDGET_SET_FLAGS( MessageBox,GTK_CAN_DEFAULT ); - gtk_widget_set_events( MessageBox,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 ); - gtk_window_set_title( GTK_WINDOW( MessageBox ),MSGTR_MessageBox ); - gtk_window_set_position( GTK_WINDOW( MessageBox ),GTK_WIN_POS_CENTER ); - gtk_window_set_modal( GTK_WINDOW( MessageBox ),TRUE ); - gtk_window_set_policy( GTK_WINDOW( MessageBox ),FALSE,FALSE,FALSE ); - gtk_window_set_wmclass( GTK_WINDOW( MessageBox ),MSGTR_MessageBox,MSGTR_MessageBox ); + accel_group = gtk_accel_group_new (); + + MessageBox = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (MessageBox, "MessageBox"); + gtk_object_set_data (GTK_OBJECT (MessageBox), "MessageBox", MessageBox); + gtk_widget_set_events (MessageBox, GDK_EXPOSURE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_VISIBILITY_NOTIFY_MASK); + gtk_window_set_title (GTK_WINDOW (MessageBox), "MPlayer ..."); + gtk_window_set_position (GTK_WINDOW (MessageBox), GTK_WIN_POS_CENTER); + gtk_window_set_modal (GTK_WINDOW (MessageBox), TRUE); + gtk_window_set_policy (GTK_WINDOW (MessageBox), TRUE, TRUE, FALSE); - frame1=gtk_frame_new( NULL ); - gtk_widget_set_name( frame1,"frame1" ); - gtk_widget_ref( frame1 ); - gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame1",frame1, - ( GtkDestroyNotify ) gtk_widget_unref ); - gtk_widget_show( frame1 ); - gtk_container_add( GTK_CONTAINER( MessageBox ),frame1 ); - gtk_frame_set_shadow_type( GTK_FRAME( frame1 ),GTK_SHADOW_IN ); + 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 ); + 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 ); + 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 ); + 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 ); + 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); - vbox2=gtk_vbox_new( FALSE,0 ); - gtk_widget_set_name( vbox2,"vbox2" ); - gtk_widget_ref( vbox2 ); - gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"vbox2",vbox2, - ( GtkDestroyNotify ) gtk_widget_unref ); - gtk_widget_show( vbox2 ); - gtk_box_pack_start( GTK_BOX( vbox1 ),vbox2,TRUE,FALSE,0 ); + 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); - gtkMessageBoxText=gtk_label_new( "Ez." ); - 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( vbox2 ),gtkMessageBoxText,FALSE,FALSE,0 ); -// gtk_widget_set_usize( gtkMessageBoxText,-2,77 ); - gtk_widget_set_usize( gtkMessageBoxText,384,77 ); - gtk_label_set_justify( GTK_LABEL( gtkMessageBoxText ),GTK_JUSTIFY_FILL ); - gtk_label_set_line_wrap( GTK_LABEL( gtkMessageBoxText ),TRUE ); + pixmapstyle=gtk_widget_get_style( MessageBox ); + pixmapwid=gdk_pixmap_colormap_create_from_xpm_d( MessageBox->window,gdk_colormap_get_system(),&mask,&pixmapstyle->bg[GTK_STATE_NORMAL],(gchar ** )error_xpm ); + pixmap1=gtk_pixmap_new( pixmapwid,mask ); + + gtk_widget_set_name (pixmap1, "pixmap1"); + gtk_widget_ref (pixmap1); + gtk_object_set_data_full (GTK_OBJECT (MessageBox), "pixmap1", pixmap1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (pixmap1); + gtk_box_pack_start (GTK_BOX (hbox1), pixmap1, FALSE, FALSE, 0); + gtk_widget_set_usize (pixmap1, 55, -2); - 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( vbox2 ),hseparator1,TRUE,TRUE,0 ); + gtkMessageBoxText = gtk_label_new ( "Text jol. Ha ezt megerted, akkor neked nagyon jo a magyar tudasod, te."); + gtk_widget_set_name (gtkMessageBoxText, "gtkMessageBoxText"); + gtk_widget_ref (gtkMessageBoxText); + gtk_object_set_data_full (GTK_OBJECT (MessageBox), "gtkMessageBoxText", gtkMessageBoxText, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (gtkMessageBoxText); + gtk_box_pack_start (GTK_BOX (hbox1), gtkMessageBoxText, TRUE, TRUE, 0); + gtk_label_set_justify (GTK_LABEL (gtkMessageBoxText), GTK_JUSTIFY_FILL); + gtk_label_set_line_wrap (GTK_LABEL (gtkMessageBoxText), TRUE); - 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_box_pack_start( GTK_BOX( vbox1 ),hbuttonbox1,FALSE,FALSE,0 ); - GTK_WIDGET_SET_FLAGS( hbuttonbox1,GTK_CAN_FOCUS ); - GTK_WIDGET_SET_FLAGS( hbuttonbox1,GTK_CAN_DEFAULT ); - gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),0 ); - gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),60,0 ); - gtk_button_box_set_child_ipadding( GTK_BUTTON_BOX( hbuttonbox1 ),10,0 ); + hseparator1 = gtk_hseparator_new (); + gtk_widget_set_name (hseparator1, "hseparator1"); + gtk_widget_ref (hseparator1); + gtk_object_set_data_full (GTK_OBJECT (MessageBox), "hseparator1", hseparator1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hseparator1); + gtk_box_pack_start (GTK_BOX (vbox1), hseparator1, FALSE, FALSE, 0); + gtk_widget_set_usize (hseparator1, -2, 9); + + hbuttonbox1 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox1, "hbuttonbox1"); + gtk_widget_ref (hbuttonbox1); + gtk_object_set_data_full (GTK_OBJECT (MessageBox), "hbuttonbox1", hbuttonbox1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hbuttonbox1); + gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, FALSE, 0); - Ok=gtk_button_new_with_label( MSGTR_Ok ); - gtk_widget_set_name( Ok,MSGTR_Ok ); - gtk_widget_ref( Ok ); - gtk_object_set_data_full( GTK_OBJECT( MessageBox ),MSGTR_Ok,Ok, - ( GtkDestroyNotify ) gtk_widget_unref ); - gtk_widget_show( Ok ); - gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Ok ); - gtk_widget_set_usize( Ok,100,-2 ); - GTK_WIDGET_SET_FLAGS( Ok,GTK_CAN_DEFAULT ); - gtk_widget_add_accelerator( Ok,"released",accel_group, - GDK_Return,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_SET_FLAGS (Ok, GTK_CAN_DEFAULT); + 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", - GTK_SIGNAL_FUNC( on_MessageBox_destroy ), - NULL ); - gtk_signal_connect( GTK_OBJECT( Ok ),"released", - GTK_SIGNAL_FUNC( on_Ok_released ), - NULL ); + gtk_signal_connect (GTK_OBJECT (MessageBox), "destroy_event", + GTK_SIGNAL_FUNC (on_MessageBox_destroy), + NULL); + gtk_signal_connect (GTK_OBJECT (Ok), "released",GTK_SIGNAL_FUNC (on_Ok_released),NULL); - gtk_window_add_accel_group( GTK_WINDOW( MessageBox ),accel_group ); + gtk_window_add_accel_group (GTK_WINDOW (MessageBox), accel_group); - return MessageBox; + return MessageBox; } #endif
--- a/Gui/mplayer/gtk/sb.h Mon Sep 17 21:15:14 2001 +0000 +++ b/Gui/mplayer/gtk/sb.h Mon Sep 17 21:16:00 2001 +0000 @@ -11,7 +11,6 @@ #include "../app.h" GtkWidget * SkinList; -GtkWidget * sbOk; char * sbSelectedSkin=NULL; char * sbMPlayerDirInHome=NULL; char * sbMPlayerPrefixDir=NULL; @@ -38,7 +37,7 @@ strcpy( gtkOldSkin,gtkShMem->sb.name ); if ( ( str[0]=(char *)calloc( 1,7 ) ) == NULL ) { - gtkMessageBox( MSGTR_SKINBROWSER_NotEnoughMemory ); + gtkMessageBox( GTK_MB_FATAL,MSGTR_SKINBROWSER_NotEnoughMemory ); return 0; } str[1]=""; @@ -55,7 +54,7 @@ { tmp=strrchr( gg.gl_pathv[i],'/' ); tmp++; if ( !strcmp( tmp,"default" ) ) continue; - if ( ( str[0]=(char *)malloc( strlen( tmp ) + 1 ) ) == NULL ) { gtkMessageBox( MSGTR_SKINBROWSER_NotEnoughMemory ); return 0; } + if ( ( str[0]=(char *)malloc( strlen( tmp ) + 1 ) ) == NULL ) { gtkMessageBox( GTK_MB_FATAL,MSGTR_SKINBROWSER_NotEnoughMemory ); return 0; } strcpy( str[0],tmp ); if ( gtkFindCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str ); free( str[0] ); @@ -83,16 +82,6 @@ if( bevent->type == GDK_2BUTTON_PRESS ) HideSkinBrowser(); } -gboolean on_SkinBrowser_key_release_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data ) -{ - switch ( event->keyval ) - { - case GDK_Escape: on_SkinBrowser_Cancel( NULL,0 ); break; - case GDK_Return: HideSkinBrowser(); break; - } - return FALSE; -} - GtkWidget * create_SkinBrowser( void ) { GtkWidget * SkinBrowser; @@ -108,6 +97,10 @@ GtkWidget * hseparator5; GtkWidget * hbuttonbox4; GtkWidget * Cancel; + GtkWidget * Ok; + GtkAccelGroup * accel_group; + + accel_group = gtk_accel_group_new (); SkinBrowser=gtk_window_new( GTK_WINDOW_DIALOG ); gtk_widget_set_name( SkinBrowser,MSGTR_SkinBrowser ); @@ -209,16 +202,14 @@ 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_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 ); 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_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 ); @@ -226,55 +217,44 @@ 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_object_set_data_full( GTK_OBJECT( SkinBrowser ),"hbuttonbox4",hbuttonbox4,(GtkDestroyNotify)gtk_widget_unref ); 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 ),0 ); gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox4 ),80,0 ); - sbOk=gtk_button_new_with_label( MSGTR_Ok ); - gtk_widget_set_name( sbOk,MSGTR_Ok ); - gtk_widget_ref( sbOk ); - gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),MSGTR_Ok,sbOk, - ( GtkDestroyNotify ) gtk_widget_unref ); - gtk_widget_show( sbOk ); - gtk_container_add( GTK_CONTAINER( hbuttonbox4 ),sbOk ); - gtk_widget_set_usize( sbOk,-2,33 ); - GTK_WIDGET_SET_FLAGS( sbOk,GTK_CAN_DEFAULT ); + 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,33 ); + GTK_WIDGET_SET_FLAGS( Ok,GTK_CAN_DEFAULT ); + gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); 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_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,33 ); GTK_WIDGET_SET_FLAGS( Cancel,GTK_CAN_DEFAULT ); + gtk_widget_add_accelerator( Cancel,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); - gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"destroy", - GTK_SIGNAL_FUNC( on_SkinBrowser_destroy ), - NULL ); - gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"key_release_event", - GTK_SIGNAL_FUNC( on_SkinBrowser_key_release_event ), - NULL ); - gtk_signal_connect( GTK_OBJECT( SkinList ),"select_row", - GTK_SIGNAL_FUNC( on_SkinList_select_row ), - NULL ); - gtk_signal_connect( GTK_OBJECT( sbOk ),"released", - GTK_SIGNAL_FUNC( on_SkinBrowser_destroy ), - NULL ); - gtk_signal_connect( GTK_OBJECT( Cancel ),"released", - GTK_SIGNAL_FUNC( on_SkinBrowser_Cancel ), - NULL ); + gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"destroy",GTK_SIGNAL_FUNC( on_SkinBrowser_destroy ),NULL ); + 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_destroy ),NULL ); + gtk_signal_connect( GTK_OBJECT( Cancel ),"released",GTK_SIGNAL_FUNC( on_SkinBrowser_Cancel ),NULL ); if ( ( sbMPlayerDirInHome=(char *)calloc( 1,strlen( skinDirInHome ) + 4 ) ) != NULL ) { strcpy( sbMPlayerDirInHome,skinDirInHome ); strcat( sbMPlayerDirInHome,"/*" ); } if ( ( sbMPlayerPrefixDir=(char *)calloc( 1,strlen( skinMPlayerDir ) + 4 ) ) != NULL ) { strcpy( sbMPlayerPrefixDir,skinMPlayerDir ); strcat( sbMPlayerPrefixDir,"/*" ); } + gtk_window_add_accel_group( GTK_WINDOW( SkinBrowser ),accel_group ); gtk_widget_grab_focus( SkinList ); return SkinBrowser;
--- a/Gui/mplayer/menu.h Mon Sep 17 21:15:14 2001 +0000 +++ b/Gui/mplayer/menu.h Mon Sep 17 21:16:00 2001 +0000 @@ -123,7 +123,7 @@ #ifdef DEBUG dbprintf( 1,MSGTR_NEMFMR ); #endif - gtkMessageBox( MSGTR_NEMFMR ); + gtkMessageBox( GTK_MB_FATAL,MSGTR_NEMFMR ); return; }
--- a/Gui/mplayer/play.c Mon Sep 17 21:15:14 2001 +0000 +++ b/Gui/mplayer/play.c Mon Sep 17 21:16:00 2001 +0000 @@ -127,78 +127,73 @@ void ChangeSkin( void ) { - if ( strcmp( skinName,gtkShMem->sb.name ) ) - { - int ret; + int ret; + if ( !strcmp( skinName,gtkShMem->sb.name ) ) return; #ifdef DEBUG - dbprintf( 1,"[psignal] skin: %s\n",gtkShMem->sb.name ); + dbprintf( 1,"[psignal] skin: %s\n",gtkShMem->sb.name ); #endif - mainVisible=0; - - appInitStruct( &tmpList ); - skinAppMPlayer=&tmpList; - ret=skinRead( gtkShMem->sb.name ); + mainVisible=0; - fntFreeFont(); - - appInitStruct( &tmpList ); - skinAppMPlayer=&appMPlayer; - appInitStruct( &appMPlayer ); - if ( !ret ) strcpy( skinName,gtkShMem->sb.name ); - skinRead( skinName ); + appInitStruct( &tmpList ); + skinAppMPlayer=&tmpList; + fntFreeFont(); + ret=skinRead( gtkShMem->sb.name ); - if ( ret ) - { - mainVisible=1; - return; - } + appInitStruct( &tmpList ); + skinAppMPlayer=&appMPlayer; + appInitStruct( &appMPlayer ); + if ( !ret ) strcpy( skinName,gtkShMem->sb.name ); + skinRead( skinName ); + if ( ret ) + { + mainVisible=1; + return; + } - if ( appMPlayer.menuBase.Bitmap.Image ) - { - if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer ); - if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL ) - { message( False,MSGTR_NEMDB ); return; } - wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); - wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); - } + if ( appMPlayer.menuBase.Bitmap.Image ) + { + if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer ); + if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL ) + { message( False,MSGTR_NEMDB ); return; } + wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); + wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); + } - mplSkinChanged=1; - if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height ); - if ( !mplShMem->Playing ) + mplSkinChanged=1; + if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height ); + if ( !mplShMem->Playing ) + { + mplSkinChanged=0; + if ( !appMPlayer.subWindow.isFullScreen ) { - mplSkinChanged=0; - if ( !appMPlayer.subWindow.isFullScreen ) - { - wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); - wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y ); - } - wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); - wsClearWindow( appMPlayer.subWindow ); - mplSubRender=1; wsPostRedisplay( &appMPlayer.subWindow ); - } + wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); + wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y ); + } + wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); + wsClearWindow( appMPlayer.subWindow ); + mplSubRender=1; wsPostRedisplay( &appMPlayer.subWindow ); + } - if ( mplDrawBuffer ) free( mplDrawBuffer ); - if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL ) - { message( False,MSGTR_NEMDB ); return; } - wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow ); - wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); - wsMoveWindow( &appMPlayer.mainWindow,appMPlayer.main.x,appMPlayer.main.y ); - wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); - wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); - mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow ); - wsWindowDecoration( &appMPlayer.mainWindow,appMPlayer.mainDecoration ); - wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); + if ( mplDrawBuffer ) free( mplDrawBuffer ); + if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL ) + { message( False,MSGTR_NEMDB ); return; } + wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow ); + wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); + wsMoveWindow( &appMPlayer.mainWindow,appMPlayer.main.x,appMPlayer.main.y ); + wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); + wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); + mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow ); + wsWindowDecoration( &appMPlayer.mainWindow,appMPlayer.mainDecoration ); + wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); - btnModify( evSetVolume,mplShMem->Volume ); - btnModify( evSetBalance,mplShMem->Balance ); - btnModify( evSetMoviePosition,mplShMem->Position ); - } - mplShMem->SkinChange=0; + btnModify( evSetVolume,mplShMem->Volume ); + btnModify( evSetBalance,mplShMem->Balance ); + btnModify( evSetMoviePosition,mplShMem->Position ); } void EventHandling( void ) { wsHandleEvents();mplTimerHandler(0); // handle GUI timer events - if ( mplShMem->SkinChange ) ChangeSkin(); + if ( mplShMem->SkinChange ) { ChangeSkin(); mplShMem->SkinChange=0; } }
--- a/Gui/mplayer/psignal.c Mon Sep 17 21:15:14 2001 +0000 +++ b/Gui/mplayer/psignal.c Mon Sep 17 21:16:00 2001 +0000 @@ -16,7 +16,6 @@ #include "../../config.h" #include "../../libvo/x11_common.h" -//#include "../../libvo/sub.h" #include "./mplayer.h" @@ -41,7 +40,7 @@ n=vsnprintf( p,512,format,ap ); va_end( ap ); mplCriticalError=critical; - gtkMessageBox( p ); + gtkMessageBox( GTK_MB_ERROR,p ); } void gtkSigHandler( int s ) @@ -63,8 +62,7 @@ case evSkinBrowser: if ( gtkVisibleSkinBrowser ) gtk_widget_hide( SkinBrowser ); gtkClearList( SkinList ); - if ( !gtkFillSkinList( sbMPlayerPrefixDir ) ) break; - if ( gtkFillSkinList( sbMPlayerDirInHome ) ) + if ( gtkFillSkinList( sbMPlayerPrefixDir )&>kFillSkinList( sbMPlayerDirInHome ) ) { gtkSetDefaultToCList( SkinList,skinName ); gtk_widget_show( SkinBrowser ); @@ -97,8 +95,6 @@ break; case evMessageBox: gtk_label_set_text( gtkMessageBoxText,(char *)gtkShMem->mb.str ); - gtk_widget_set_usize( MessageBox,gtkShMem->mb.sx,gtkShMem->mb.sy ); - gtk_widget_set_usize( gtkMessageBoxText,gtkShMem->mb.tsx,gtkShMem->mb.tsy ); if ( gtkVisibleMessageBox ) gtk_widget_hide( MessageBox ); gtk_widget_show( MessageBox ); gtkVisibleMessageBox=1;
--- a/Gui/mplayer/widgets.c Mon Sep 17 21:15:14 2001 +0000 +++ b/Gui/mplayer/widgets.c Mon Sep 17 21:16:00 2001 +0000 @@ -27,6 +27,9 @@ #include "pixmaps/file.xpm" #include "pixmaps/logo.xpm" #include "pixmaps/about.xpm" +#include "pixmaps/stop.xpm" +#include "pixmaps/error.xpm" +#include "pixmaps/warning.xpm" GtkWidget * SkinBrowser; GtkWidget * PlayList; @@ -57,7 +60,7 @@ SkinBrowser=create_SkinBrowser(); PlayList=create_PlayList(); FileSelect=create_FileSelect(); - MessageBox=create_MessageBox(); + MessageBox=create_MessageBox(0); Options=create_Options(); } @@ -103,17 +106,9 @@ kill( gtkPID,SIGKILL ); } -void gtkMessageBox( gchar * str ) +void gtkMessageBox( int type,gchar * str ) { - gtkShMem->mb.sx=420; gtkShMem->mb.sy=128; - gtkShMem->mb.tsx=384; gtkShMem->mb.tsy=77; - if ( strlen( str ) > 200 ) - { - gtkShMem->mb.sx=512; - gtkShMem->mb.sy=128; - gtkShMem->mb.tsx=476; - gtkShMem->mb.tsy=77; - } + gtkShMem->mb.type=type; strcpy( gtkShMem->mb.str,str ); gtkSendMessage( evMessageBox ); }
--- a/Gui/mplayer/widgets.h Mon Sep 17 21:15:14 2001 +0000 +++ b/Gui/mplayer/widgets.h Mon Sep 17 21:16:00 2001 +0000 @@ -7,6 +7,12 @@ #include "../../linux/shmem.h" +#define GTK_MB_SIMPLE 0 +#define GTK_MB_MODAL 1 +#define GTK_MB_FATAL 2 +#define GTK_MB_ERROR 4 +#define GTK_MB_WARNING 8 + typedef struct { char dir[ 1024 ]; @@ -19,6 +25,7 @@ int sy; int tsx; int tsy; + int type; char str[512]; } gtkMessageBoxStruct; @@ -73,7 +80,7 @@ extern void gtkInit( int argc,char* argv[], char *envp[] ); extern void gtkDone( void ); -extern void gtkMessageBox( gchar * str ); +extern void gtkMessageBox( int type,gchar * str ); extern int gtkFillSkinList( gchar * dir ); extern void gtkClearList( GtkWidget * list ); extern void gtkSetDefaultToCList( GtkWidget * list,char * item );
--- a/Gui/skin/font.c Mon Sep 17 21:15:14 2001 +0000 +++ b/Gui/skin/font.c Mon Sep 17 21:16:00 2001 +0000 @@ -77,7 +77,7 @@ cutItem( param,tmp,',',2 ); Fonts[id]->Fnt[i].sx=atoi( tmp ); cutItem( param,tmp,',',3 ); Fonts[id]->Fnt[i].sy=atoi( tmp ); #ifdef DEBUG - dbprintf( 0,"[font] char: '%s' params: %d,%d %dx%d\n",command,Fonts[id]->Fnt[i].x,Fonts[id]->Fnt[i].y,Fonts[id]->Fnt[i].sx,Fonts[id]->Fnt[i].sy ); + dbprintf( 3,"[font] char: '%s' params: %d,%d %dx%d\n",command,Fonts[id]->Fnt[i].x,Fonts[id]->Fnt[i].y,Fonts[id]->Fnt[i].sx,Fonts[id]->Fnt[i].sy ); #endif } else @@ -86,7 +86,7 @@ { strcpy( tmp,path ); strcat( tmp,param ); #ifdef DEBUG - dbprintf( 0,"[font] font imagefile: %s\n",tmp ); + dbprintf( 3,"[font] font imagefile: %s\n",tmp ); #endif if ( skinBPRead( tmp,&Fonts[id]->Bitmap ) ) return -2; }