changeset 1801:e16646a140fd

fix skin change
author pontscho
date Fri, 31 Aug 2001 13:05:37 +0000
parents f5ffb03ebdb5
children 82e77faa7341
files Gui/mplayer/mplayer.c Gui/mplayer/play.h Gui/mplayer/psignal.c
diffstat 3 files changed, 9 insertions(+), 68 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/mplayer.c	Fri Aug 31 12:59:04 2001 +0000
+++ b/Gui/mplayer/mplayer.c	Fri Aug 31 13:05:37 2001 +0000
@@ -15,6 +15,7 @@
 #include "../timer.h"
 #include "../language.h"
 #include "../error.h"
+#include "../config.h"
 
 #include "../../config.h"
 #include "../../libvo/x11_common.h"
@@ -36,7 +37,7 @@
 #include "menu.h"
 #include "mw.h"
 #include "sw.h"
-#include "widget.h"
+#include "widgets.h"
 
 void mplTimerHandler( int signum )
 {
@@ -56,6 +57,7 @@
  // allocates shmem to gtkShMem
  // fork() a process which runs gtkThreadProc()  [gtkPID]
  gtkInit( argc,argv,envp );
+ strcpy( gtkShMem->sb.name,cfgSkin ); 
 
  // allocates shmem to mplShMem
  // init fields of this struct to default values
--- a/Gui/mplayer/play.h	Fri Aug 31 12:59:04 2001 +0000
+++ b/Gui/mplayer/play.h	Fri Aug 31 13:05:37 2001 +0000
@@ -81,4 +81,6 @@
 extern void mplSendMessage( int msg );
 extern void mplPlayerThread( void );
 
-#endif
\ No newline at end of file
+extern void ChangeSkin( void );
+
+#endif
--- a/Gui/mplayer/psignal.c	Fri Aug 31 12:59:04 2001 +0000
+++ b/Gui/mplayer/psignal.c	Fri Aug 31 13:05:37 2001 +0000
@@ -163,16 +163,14 @@
  gtkShMem->message=0;
 }
 
-listItems tmpList;
-
 void mplMainSigHandler( int s )
 {
  if ( s != SIGTYPE ) return;
 
- #ifdef DEBUG
+// #ifdef DEBUG
   if ( gtkShMem->message ) dbprintf( 5,"[psignal] main sig handler gtk msg: %d\n",gtkShMem->message );
 //  if ( mplShMem->message ) dbprintf( 5,"[psignal] main sig handler mpl msg: %d\n",mplShMem->message );
- #endif
+// #endif
 
  switch ( gtkShMem->message )
   {
@@ -202,68 +200,7 @@
          }
         break;
    case evSkinBrowser:
-        if ( strcmp( cfgSkin,gtkShMem->sb.name ) )
-         {
-          int ret;
-          #ifdef DEBUG
-           dbprintf( 1,"[psignal] skin: %s\n",gtkShMem->sb.name );
-          #endif
-
-          mainVisible=0;
-
-          appInitStruct( &tmpList );
-          skinAppMPlayer=&tmpList;
-          ret=skinRead( gtkShMem->sb.name );
-
-          appInitStruct( &tmpList );
-          skinAppMPlayer=&appMPlayer;
-          appInitStruct( &appMPlayer );
-          if ( !ret ) strcpy( cfgSkin,gtkShMem->sb.name );
-          skinRead( cfgSkin );
-
-          if ( ret )
-           {
-            mainVisible=1;
-            break;
-           }
-
-//          appCopy( &appMPlayer,&tmpList );
-//          appInitStruct( &tmpList );
-//          skinAppMPlayer=&appMPlayer;
-//          strcpy( cfgSkin,gtkShMem->sb.name );
-
-          if ( mplDrawBuffer ) free( mplDrawBuffer );
-          if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
-           { message( False,langNEMDB ); break; }
-          wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
-          wsMoveWindow( &appMPlayer.mainWindow,appMPlayer.main.x,appMPlayer.main.y );
-          wsResizeImage( &appMPlayer.mainWindow );
-          wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
-          mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow );
-          btnModify( evSetVolume,mplShMem->Volume );
-          btnModify( evSetBalance,mplShMem->Balance );
-          btnModify( evSetMoviePosition,mplShMem->Position );
-
-          if ( appMPlayer.menuBase.Bitmap.Image )
-           {
-            if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer );
-            if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL )
-             { message( False,langNEMDB ); break; }
-            wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
-            wsResizeImage( &appMPlayer.menuWindow );
-           }
-
-          mplSkinChanged=1;
-          if ( !mplShMem->Playing )
-           {
-            mplSkinChanged=0;
-            if ( appMPlayer.subWindow.isFullScreen ) wsFullScreen( &appMPlayer.subWindow );
-            wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
-            wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y );
-            if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow );
-            mplSubRender=1; wsPostRedisplay( &appMPlayer.subWindow );
-           }
-         }
+        ChangeSkin();
         break;
    case evFileLoaded:
         strcpy( mplShMem->Filename,gtkShMem->fs.dir ); strcat( mplShMem->Filename,"/" ); strcat( mplShMem->Filename,gtkShMem->fs.filename );