summaryrefslogtreecommitdiffstats
path: root/Gui
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-08-31 12:59:04 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-08-31 12:59:04 +0000
commit72af5c15db7d2ecd9cfa1affec21b42bd91caded (patch)
tree84ff6d1ac31642ed908729b277f23e28319198c7 /Gui
parent1fd27ecdeac8e1a4c816a0bb9069dbd55371ce56 (diff)
downloadmpv-72af5c15db7d2ecd9cfa1affec21b42bd91caded.tar.bz2
mpv-72af5c15db7d2ecd9cfa1affec21b42bd91caded.tar.xz
move skin changing here.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1801 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui')
-rw-r--r--Gui/mplayer/play.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/Gui/mplayer/play.c b/Gui/mplayer/play.c
index f6212c2691..3e39f73aa9 100644
--- a/Gui/mplayer/play.c
+++ b/Gui/mplayer/play.c
@@ -23,6 +23,11 @@ int moviex,moviey,moviewidth,movieheight;
#include "psignal.h"
#include "play.h"
+#include "../skin/skin.h"
+#include "../config.h"
+#include "../error.h"
+#include "../language.h"
+
mplCommStruct * mplShMem;
char * Filename = NULL;
@@ -134,3 +139,70 @@ void mplAbsSeek( float s )
// ---
}
+listItems tmpList;
+
+void ChangeSkin( void )
+{
+ 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;
+ return;
+ }
+
+// 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 ); return; }
+ 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 ); return; }
+ 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 );
+ }
+ }
+}