[Mplayer-cvslog] CVS: main/Gui/mplayer/gtk about.c,1.2,1.3 fs.c,1.7,1.8 mb.c,1.3,1.4 menu.c,1.7,1.8 opts.c,1.1,1.2 pl.c,1.1,1.2 sb.c,1.3,1.4

Zoltan Ponekker pontscho at mplayer.dev.hu
Sat Feb 23 16:12:57 CET 2002


Update of /cvsroot/mplayer/main/Gui/mplayer/gtk
In directory mplayer:/var/tmp.root/cvs-serv25081/Gui/mplayer/gtk

Modified Files:
	about.c fs.c mb.c menu.c opts.c pl.c sb.c 
Log Message:
new gui interface, and gtk moved into mplayer process. fork ... bleh :)

Index: about.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/about.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- about.c	19 Dec 2001 16:53:34 -0000	1.2
+++ about.c	23 Feb 2002 15:12:54 -0000	1.3
@@ -10,7 +10,6 @@
 void ab_Ok_released( GtkButton * button,gpointer user_data )
 {
  gtk_widget_hide( AboutBox );
- gtkVisibleAboutBox=0;
 }
 
 GtkWidget * create_About( void )
@@ -157,7 +156,7 @@
                    "Homepage:\n" \
                    "        Design:  Chass\n" \
                    "        Contents: Gabucino\n" \
-		   "                  LGB\n\n" \
+                   "                  LGB\n\n" \
                    "English documentation:\n" \
                    "        tech-*.txt: A'rpi\n" \
                    "        all the others: Gabucino\n\n" \

Index: fs.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/fs.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- fs.c	21 Feb 2002 10:35:37 -0000	1.7
+++ fs.c	23 Feb 2002 15:12:54 -0000	1.8
@@ -7,14 +7,13 @@
 #include <unistd.h>
 
 #include "./mplayer.h"
-#include "psignal.h"
-#include "../error.h"
 
 #include "pixmaps/up.xpm"
 #include "pixmaps/dir.xpm"
 #include "pixmaps/file.xpm"
 
 #include "../../events.h"
+#include "../../interface.h"
 #include "../../../config.h"
 #include "../../../help_mp.h"
 
@@ -35,30 +34,30 @@
 gchar           fsFilter[8] = "*";
 
 int             fsPressed = 0;
-int		fsMessage = -1;
-int		fsType    = 0;
+int             fsMessage = -1;
+int             fsType    = 0;
 
 #define fsNumberOfVideoFilterNames 6
-char * fsVideoFilterNames[fsNumberOfVideoFilterNames+1][2] = 
+char * fsVideoFilterNames[fsNumberOfVideoFilterNames+1][2] =
          { { "MPEG files ( *.mpg )", "*.mpg" },
-	   { "VOB files ( *.vob )",  "*.vob" },
+           { "VOB files ( *.vob )",  "*.vob" },
            { "AVI files ( *.avi )",  "*.avi" },
-	   { "QT files ( *.mov )",   "*.mov" },
-	   { "ASF files ( *.asf )",  "*.asf" },
-  	   { "VIVO files ( *.viv )", "*.viv" },
+           { "QT files ( *.mov )",   "*.mov" },
+           { "ASF files ( *.asf )",  "*.asf" },
+           { "VIVO files ( *.viv )", "*.viv" },
            { "All files ( * )",      "*"     } };
-	   
+
 #define fsNumberOfSubtitleFilterNames 8
 char * fsSubtitleFilterNames[fsNumberOfSubtitleFilterNames+1][2] =
          { { "UTF ( *.utf )",   "*.utf" },
-	   { "SUB ( *.sub )",   "*.sub" },
-	   { "SRT ( *.srt )",   "*.str" },
+           { "SUB ( *.sub )",   "*.sub" },
+           { "SRT ( *.srt )",   "*.str" },
            { "SMI ( *.smi )",   "*.smi" },
            { "RT ( *.rt )",     "*.rt"  },
            { "TXT ( *.txt )",   "*.txt" },
            { "SSA ( *.ssa )",   "*.ssa" },
            { "AQT ( *.aqt )",   "*.aqt" },
-	   { "All files ( * )", "*"     } };
+           { "All files ( * )", "*"     } };
 
 #define fsNumberOfOtherFilterNames 0
 char * fsOtherFilterNames[fsNumberOfOtherFilterNames+1][2] =
@@ -99,7 +98,7 @@
  gtk_widget_hide( list );
  gtk_clist_clear( GTK_CLIST( list ) );
  str[0][0]=NULL;
- 
+
  pixmap=dpixmap; mask=dmask;
  str[0][0]=NULL; str[0][1]=(gchar *)malloc( 3 );
  strcpy( str[0][1],"." );  gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),0,0,pixmap,mask );
@@ -121,9 +120,9 @@
    free( str[0][1] );
   }
  globfree( &gg );
- 
+
  glob( fsFilter,0,NULL,&gg );
- 
+
 #if 0
  if ( !strcmp( fsFilter,"*" ) )
  {
@@ -132,7 +131,7 @@
   for( i=0;i<strlen( f );i++ )
    if ( ( f[i] >= 'A' )&&( f[i] <= 'Z' ) ) f[i]+=32;
   glob( f,GLOB_APPEND,NULL,&gg );
-  
+
   for( i=0;i<strlen( f );i++ )
    if ( ( f[i] >= 'a' )&&( f[i] <= 'z' ) ) f[i]-=32;
   glob( f,GLOB_APPEND,NULL,&gg );
@@ -163,13 +162,13 @@
 void ShowFileSelect( int type )
 {
  int i;
- if ( gtkVisibleFileSelect ) gtk_widget_hide( FileSelect );
+ gtk_widget_hide( FileSelect );
  fsType=type;
  switch ( type )
   {
    case fsVideoSelector:
         fsMessage=evFileLoaded;
-	gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect );
+        gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect );
         fsList_items=NULL;
         for( i=0;i<fsNumberOfVideoFilterNames + 1;i++ )
           fsList_items=g_list_append( fsList_items,fsVideoFilterNames[i][0] );
@@ -178,7 +177,7 @@
         gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsVideoFilterNames[fsNumberOfVideoFilterNames][0] );
         break;
    case fsSubtitleSelector:
-	gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_SubtitleSelect );
+        gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_SubtitleSelect );
         fsList_items=NULL;
         for( i=0;i<fsNumberOfSubtitleFilterNames + 1;i++ )
           fsList_items=g_list_append( fsList_items,fsSubtitleFilterNames[i][0] );
@@ -187,7 +186,7 @@
         gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsSubtitleFilterNames[fsNumberOfSubtitleFilterNames][0] );
         break;
    case fsOtherSelector:
-	gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_OtherSelect );
+        gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_OtherSelect );
         fsList_items=NULL;
         for( i=0;i<fsNumberOfSubtitleFilterNames + 1;i++ )
           fsList_items=g_list_append( fsList_items,fsOtherFilterNames[i][0] );
@@ -197,15 +196,11 @@
         break;
   }
  gtk_widget_show( FileSelect );
- gtkVisibleFileSelect=1;
 }
 
 void HideFileSelect( void )
 {
  gtk_widget_hide( fsFileSelect );
- gtkVisibleFileSelect=0;
- gtkShMem->vs.window=evLoad;
- gtkSendMessage( evHideWindow );
 }
 
 void fs_fsFileSelect_destroy( GtkObject * object,gpointer user_data )
@@ -223,35 +218,35 @@
  int    i;
 
  str=gtk_entry_get_text( GTK_ENTRY(user_data ) );
- 
+
  switch ( fsType )
   {
    case fsVideoSelector:
           for( i=0;i<fsNumberOfVideoFilterNames+1;i++ )
-           if( !strcmp( str,fsVideoFilterNames[i][0] ) ) 
+           if( !strcmp( str,fsVideoFilterNames[i][0] ) )
             {
- 	     strcpy( fsFilter,fsVideoFilterNames[i][1] );
- 	     CheckDir( fsFNameList,get_current_dir_name() );
- 	     break;
-  	    }
-	  break;
+             strcpy( fsFilter,fsVideoFilterNames[i][1] );
+             CheckDir( fsFNameList,get_current_dir_name() );
+             break;
+            }
+          break;
    case fsSubtitleSelector:
           for( i=0;i<fsNumberOfSubtitleFilterNames+1;i++ )
-           if( !strcmp( str,fsSubtitleFilterNames[i][0] ) ) 
+           if( !strcmp( str,fsSubtitleFilterNames[i][0] ) )
             {
- 	     strcpy( fsFilter,fsSubtitleFilterNames[i][1] );
- 	     CheckDir( fsFNameList,get_current_dir_name() );
- 	     break;
-  	    }
+             strcpy( fsFilter,fsSubtitleFilterNames[i][1] );
+             CheckDir( fsFNameList,get_current_dir_name() );
+             break;
+            }
           break;
    case fsOtherSelector:
           for( i=0;i<fsNumberOfOtherFilterNames+1;i++ )
-           if( !strcmp( str,fsOtherFilterNames[i][0] ) ) 
+           if( !strcmp( str,fsOtherFilterNames[i][0] ) )
             {
- 	     strcpy( fsFilter,fsOtherFilterNames[i][1] );
- 	     CheckDir( fsFNameList,get_current_dir_name() );
- 	     break;
-  	    }
+             strcpy( fsFilter,fsOtherFilterNames[i][1] );
+             CheckDir( fsFNameList,get_current_dir_name() );
+             break;
+            }
           break;
   }
 }
@@ -313,18 +308,10 @@
   {
    case 1:
         fsSelectedDirectory=(unsigned char *)get_current_dir_name();
-//        printf("[gtk-fs] 1-fsSelectedFile: %s\n",fsSelectedFile);
-//        #ifdef DEBUG
-//         dbprintf( 1,"[gtk-fs] fsSelectedFile: %s\n",fsSelectedFile );
-//        #endif
         break;
    case 2:
         str=gtk_entry_get_text( GTK_ENTRY( fsPathCombo ) );
         fsSelectedFile=str;
-//        printf("[gtk-fs] 2-fsSelectedFile: '%s'  \n",fsSelectedFile);
-//        #ifdef DEBUG
-//         dbprintf( 1,"[gtk-fs] fsSelectedFile: %s\n",fsSelectedFile );
-//        #endif
         if ( !fsFileExist( fsSelectedFile ) ) return;
         fsSelectedDirectory=fsSelectedFile;
         size=strlen( fsSelectedDirectory );
@@ -337,31 +324,21 @@
             break;
            }
          }
-//        printf("[gtk-fs-xxx] fsSelectedFile: '%s'  \n",fsSelectedFile);
-//        printf("[gtk-fs-xxx] fsSelectedDirectory: '%s'  \n",fsSelectedDirectory);
         break;
   }
-// printf( "----gtk---> directory: %s\n",fsSelectedDirectory );
-// printf( "----gtk---> filename: %s\n",fsSelectedFile );
  switch ( fsType )
   {
    case fsVideoSelector:
-          strcpy( gtkShMem->fs.dir,fsSelectedDirectory );
-	  strcpy( gtkShMem->fs.filename,fsSelectedFile );
-//          printf( "----gtksm-> directory: %s\n",gtkShMem->fs.dir );
-//          printf( "----gtksm-> filename: %s\n",gtkShMem->fs.filename );
-          gtkSendMessage( evFileLoaded );
-	  break;
+          guiSetDF( guiIntfStruct.Filename,fsSelectedDirectory,fsSelectedFile );
+          guiIntfStruct.StreamType=STREAMTYPE_FILE;
+          guiIntfStruct.FilenameChanged=1;
+          break;
    case fsSubtitleSelector:
-          strcpy( gtkShMem->fs.subtitlename,fsSelectedDirectory );
-	  strcat( gtkShMem->fs.subtitlename,"/" );
-	  strcat( gtkShMem->fs.subtitlename,fsSelectedFile );
-          gtkSendMessage( evSubtitleLoaded );
+          guiSetDF( guiIntfStruct.Subtitlename,fsSelectedDirectory,fsSelectedFile );
+          guiIntfStruct.SubtitleChanged=1;
           break;
    case fsOtherSelector:
-          strcpy( gtkShMem->fs.otherfilename,fsSelectedDirectory );
-	  strcat( gtkShMem->fs.subtitlename,"/" );
-	  strcat( gtkShMem->fs.otherfilename,fsSelectedFile );
+          guiSetDF( guiIntfStruct.Othername,fsSelectedDirectory,fsSelectedFile );
           break;
   }
  item=fsTopList_items;
@@ -375,6 +352,7 @@
    fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name() );
    gtk_combo_set_popdown_strings( GTK_COMBO( user_data ),fsTopList_items );
   }
+ if (  mplMainAutoPlay ) mplEventHandling( evPlay,0 );
 }
 
 void fs_Cancel_released( GtkButton * button,gpointer user_data )
@@ -382,7 +360,7 @@
 
 void fs_fsFNameList_select_row( GtkWidget * widget,gint row,gint column,GdkEventButton *bevent,gpointer user_data )
 {
- gtk_clist_get_text( GTK_CLIST(widget ),row,1,&fsSelectedFile ); 
+ gtk_clist_get_text( GTK_CLIST(widget ),row,1,&fsSelectedFile );
  fsPressed=1;
  if( !bevent ) return;
  if( bevent->type == GDK_2BUTTON_PRESS ) gtk_button_released( GTK_BUTTON( fsOk ) );

Index: mb.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/mb.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mb.c	19 Dec 2001 16:54:04 -0000	1.3
+++ mb.c	23 Feb 2002 15:12:54 -0000	1.4
@@ -21,14 +21,11 @@
   }
 */
  gtk_widget_hide( MessageBox  );
- gtkVisibleMessageBox=0;
 }
 
 void on_Ok_released( GtkButton * button,gpointer user_data  )
 {
  gtk_widget_hide( MessageBox  );
- gtkVisibleMessageBox=0;
- gtkSendMessage( evMessageBox  );
 }
 
 GtkWidget * create_MessageBox( int type )

Index: menu.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/menu.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- menu.c	19 Dec 2001 16:55:32 -0000	1.7
+++ menu.c	23 Feb 2002 15:12:54 -0000	1.8
@@ -14,10 +14,9 @@
 void ActivateMenuItem( int Item )
 {
 // fprintf( stderr,"[menu] item: %d.%d\n",Item&0xffff,Item>>16 );
- gtkShMem->popupmenu=Item & 0x0000ffff;
- gtkShMem->popupmenuparam=Item >> 16;
- gtkShMem->visiblepopupmenu=0;
- gtkSendMessage( evShowPopUpMenu );
+ gtkPopupMenu=Item & 0x0000ffff;
+ gtkPopupMenuParam=Item >> 16;
+ mplEventHandling( Item & 0x0000ffff,Item >> 16 );
 }
 
 GtkWidget * AddMenuItem( GtkWidget * Menu,char * label,int Number )
@@ -246,6 +245,7 @@
  int i;
  for ( i=0;i<sizeof( Languages ) / sizeof( Languages_t );i++ )
   if ( Languages[i].id == language ) return Languages[i].name;
+ return NULL;
 }
 
 GtkWidget * DVDSubMenu;
@@ -293,61 +293,61 @@
     AddMenuItem( DVDSubMenu,MSGTR_MENU_ShowDVDMenu, evNone );
     AddSeparator( DVDSubMenu );
     DVDTitleMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_Titles );
-     if ( gtkShMem->DVD.titles )
+     if ( guiIntfStruct.DVD.titles )
       {
        char tmp[32]; int i;
-       for ( i=0;i<gtkShMem->DVD.titles;i++ )
+       for ( i=0;i < guiIntfStruct.DVD.titles;i++ )
         {
          sprintf( tmp,MSGTR_MENU_Title,i+1 );
          AddMenuItem( DVDTitleMenu,tmp,( (i+1) << 16 ) + evSetDVDTitle );
         }
       }
-      else 
+      else
        {
         MenuItem=AddMenuItem( DVDTitleMenu,MSGTR_MENU_None,evNone );
         gtk_widget_set_sensitive( MenuItem,FALSE );
        }
     DVDChapterMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_Chapters );
-     if ( gtkShMem->DVD.chapters )
+     if ( guiIntfStruct.DVD.chapters )
       {
        char tmp[32]; int i;
-       for ( i=0;i<gtkShMem->DVD.chapters;i++ )
+       for ( i=0;i < guiIntfStruct.DVD.chapters;i++ )
         {
          sprintf( tmp,MSGTR_MENU_Chapter,i+1 );
          AddMenuItem( DVDChapterMenu,tmp,( (i+1) << 16 ) + evSetDVDChapter );
         }
       }
-      else 
+      else
        {
         MenuItem=AddMenuItem( DVDChapterMenu,MSGTR_MENU_None,evNone );
         gtk_widget_set_sensitive( MenuItem,FALSE );
        }
     DVDAudioLanguageMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_AudioLanguages );
-     if ( gtkShMem->DVD.nr_of_audio_channels )
+     if ( guiIntfStruct.DVD.nr_of_audio_channels )
       {
        char tmp[64]; int i;
-       for ( i=0;i<gtkShMem->DVD.nr_of_audio_channels;i++ )
+       for ( i=0;i < guiIntfStruct.DVD.nr_of_audio_channels;i++ )
         {
-         strcpy( tmp,GetLanguage( gtkShMem->DVD.audio_streams[i].language ) );
-         AddMenuItem( DVDAudioLanguageMenu,tmp,( gtkShMem->DVD.audio_streams[i].id << 16 ) + evSetDVDAudio );
+         strcpy( tmp,GetLanguage( guiIntfStruct.DVD.audio_streams[i].language ) );
+         AddMenuItem( DVDAudioLanguageMenu,tmp,( guiIntfStruct.DVD.audio_streams[i].id << 16 ) + evSetDVDAudio );
         }
       }
-      else 
+      else
        {
         MenuItem=AddMenuItem( DVDAudioLanguageMenu,MSGTR_MENU_None,evNone );
         gtk_widget_set_sensitive( MenuItem,FALSE );
        }
     DVDSubtitleLanguageMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_SubtitleLanguages );
-     if ( gtkShMem->DVD.nr_of_subtitles )
+     if ( guiIntfStruct.DVD.nr_of_subtitles )
       {
        char tmp[64]; int i;
-       for ( i=0;i<gtkShMem->DVD.nr_of_subtitles;i++ )
+       for ( i=0;i < guiIntfStruct.DVD.nr_of_subtitles;i++ )
         {
-         strcpy( tmp,GetLanguage( gtkShMem->DVD.subtitles[i].language ) );
-         AddMenuItem( DVDSubtitleLanguageMenu,tmp,( gtkShMem->DVD.subtitles[i].id << 16 ) + evSetDVDSubtitle );
+         strcpy( tmp,GetLanguage( guiIntfStruct.DVD.subtitles[i].language ) );
+         AddMenuItem( DVDSubtitleLanguageMenu,tmp,( guiIntfStruct.DVD.subtitles[i].id << 16 ) + evSetDVDSubtitle );
         }
       }
-      else 
+      else
        {
         MenuItem=AddMenuItem( DVDSubtitleLanguageMenu,MSGTR_MENU_None,evNone );
         gtk_widget_set_sensitive( MenuItem,FALSE );

Index: opts.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/opts.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- opts.c	14 Nov 2001 16:04:25 -0000	1.1
+++ opts.c	23 Feb 2002 15:12:54 -0000	1.2
@@ -1,7 +1,8 @@
 
+#include <stdlib.h>
+#include <stdio.h>
+
 #include "./mplayer.h"
-#include "psignal.h"
-#include "../error.h"
 
 #include "../../events.h"
 #include "../../../config.h"
@@ -27,14 +28,11 @@
 GtkWidget * opOk;
 GtkWidget * opCancel;
 
-int opShift = False;
+int opShift = 0;
 
 void HideOptions( void )
 {
  gtk_widget_hide( Options );
- gtkVisibleOptions=0;
- gtkShMem->vs.window=evPreferences;
- gtkSendMessage( evHideWindow );
 }
 
 gboolean on_window2_key_press_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data )
@@ -43,10 +41,10 @@
   {
    case GDK_Shift_L:
    case GDK_Shift_R:
-        opShift=True;
+        opShift=1;
         break;
   }
- return FALSE;
+ return 0;
 }
 
 gboolean on_window2_key_release_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data )
@@ -66,7 +64,7 @@
         break;
    case GDK_Shift_L:
    case GDK_Shift_R:
-        opShift=False;
+        opShift=0;
         break;
   }
  return FALSE;

Index: pl.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/pl.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pl.c	14 Nov 2001 16:04:25 -0000	1.1
+++ pl.c	23 Feb 2002 15:12:54 -0000	1.2
@@ -9,9 +9,6 @@
 void HidePlayList( void )
 {
  gtk_widget_hide( PlayList );
- gtkVisiblePlayList=0;
- gtkShMem->vs.window=evPlayList;
- gtkSendMessage( evHideWindow );
 }
 
 void pl_PlayList_destroy( GtkObject * object,gpointer user_data )

Index: sb.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/sb.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sb.c	18 Dec 2001 21:33:02 -0000	1.3
+++ sb.c	23 Feb 2002 15:12:54 -0000	1.4
@@ -4,6 +4,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <stdlib.h>
+#include <stdio.h>
 
 #include "sb.h"
 #include "../../events.h"
@@ -18,16 +19,7 @@
 char      * sbMPlayerDirInHome=NULL;
 char      * sbMPlayerPrefixDir=NULL;
 
-void HideSkinBrowser( void )
-{
- gtk_widget_hide( SkinBrowser );
- gtkVisibleSkinBrowser=0;
- gtkShMem->vs.window=evSkinBrowser;
- gtkSendMessage( evHideWindow );
- gtkSendMessage( evSkinBrowser );
-}
-
-char gtkOldSkin[128];
+char * gtkOldSkin;
 
 int gtkFillSkinList( gchar * mdir )
 {
@@ -37,7 +29,7 @@
  glob_t          gg;
  struct stat     fs;
 
- strcpy( gtkOldSkin,gtkShMem->sb.name );
+ gtkOldSkin=strdup( skinName );
  if ( ( str[0]=(char *)calloc( 1,7 ) ) == NULL )
   {
    gtkMessageBox( GTK_MB_FATAL,MSGTR_SKINBROWSER_NotEnoughMemory );
@@ -68,21 +60,28 @@
 }
 
 void on_SkinBrowser_destroy( GtkObject * object,gpointer user_data )
-{ HideSkinBrowser(); }
+{ gtk_widget_hide( SkinBrowser ); }
 
 void on_SkinBrowser_Cancel( GtkObject * object,gpointer user_data )
 {
- strcpy( gtkShMem->sb.name,gtkOldSkin );
- HideSkinBrowser();
+ ChangeSkin( skinName );
+ gtk_widget_hide( SkinBrowser );
+}
+
+void on_SkinBrowser_Ok( GtkObject * object,gpointer user_data )
+{
+ ChangeSkin( sbSelectedSkin );
+ if ( skinName ) free( skinName );
+ skinName=strdup( sbSelectedSkin );
+ gtk_widget_hide( SkinBrowser );
 }
 
 void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data )
 {
  gtk_clist_get_text( clist,row,0,&sbSelectedSkin );
- strcpy( gtkShMem->sb.name,sbSelectedSkin );
- gtkSendMessage( evSkinBrowser );
+ ChangeSkin( sbSelectedSkin );
  if( !bevent ) return;
- if( bevent->type == GDK_2BUTTON_PRESS ) HideSkinBrowser();
+ if( bevent->type == GDK_2BUTTON_PRESS ) gtk_widget_hide( SkinBrowser );
 }
 
 GtkWidget * create_SkinBrowser( void )
@@ -248,7 +247,7 @@
 
  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( Ok ),"released",GTK_SIGNAL_FUNC( on_SkinBrowser_Ok ),NULL );
  gtk_signal_connect( GTK_OBJECT( Cancel ),"released",GTK_SIGNAL_FUNC( on_SkinBrowser_Cancel ),NULL );
 
  if ( ( sbMPlayerDirInHome=(char *)calloc( 1,strlen( skinDirInHome ) + 4 ) ) != NULL )




More information about the MPlayer-cvslog mailing list