[Mplayer-cvslog] CVS: main/Gui/mplayer menu.c,1.15,1.16 play.c,1.81,1.82

Zoltan Ponekker pontscho at mplayerhq.hu
Tue Jan 14 00:38:51 CET 2003


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

Modified Files:
	menu.c play.c 
Log Message:


correct skin changing
(fix one critical bug)


Index: menu.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/menu.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- menu.c	2 Nov 2002 20:10:16 -0000	1.15
+++ menu.c	13 Jan 2003 23:38:48 -0000	1.16
@@ -15,6 +15,7 @@
 int             mplMenuItem = -1;
 int             mplOldMenuItem = -1;
 int             mplMenuX,mplMenuY;
+static int      mplMenuIsInitialized = 0;
 
 void mplHideMenu( int mx,int my,int w );
 
@@ -24,7 +25,7 @@
  uint32_t * drw = NULL;
  int             x,y,tmp;
 
- if ( !appMPlayer.menuBase.Bitmap.Image ) return;
+ if ( !appMPlayer.menuIsPresent || !appMPlayer.menuBase.Bitmap.Image ) return;
  if ( !mplMenuRender && !appMPlayer.menuWindow.Visible ) return;
 
  if ( mplMenuRender || mplMenuItem != mplOldMenuItem )
@@ -78,7 +79,7 @@
 {
  int x,y;
 
- if ( !appMPlayer.menuBase.Bitmap.Image ) return;
+ if ( !appMPlayer.menuIsPresent || !appMPlayer.menuBase.Bitmap.Image ) return;
 
  x=mx;
  if ( x + appMPlayer.menuWindow.Width > wsMaxX ) x=wsMaxX - appMPlayer.menuWindow.Width - 1;
@@ -101,7 +102,7 @@
 {
  int x,y,i=mplMenuItem;
 
- if ( !appMPlayer.menuBase.Bitmap.Image ) return;
+ if ( !appMPlayer.menuIsPresent || !appMPlayer.menuBase.Bitmap.Image ) return;
 
  x=mx-mplMenuX;
  y=my-mplMenuY;
@@ -126,7 +127,7 @@
 void mplMenuInit( void )
 {
 
- if ( !appMPlayer.menuBase.Bitmap.Image ) return;
+ if ( mplMenuIsInitialized || !appMPlayer.menuIsPresent || !appMPlayer.menuBase.Bitmap.Image ) return;
 
  appMPlayer.menuBase.x=0;
  appMPlayer.menuBase.y=0;
@@ -150,6 +151,7 @@
   mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[menu.h] menu: 0x%x\n",(int)appMPlayer.menuWindow.WindowID );
  #endif
 
+ mplMenuIsInitialized=1;
  appMPlayer.menuWindow.ReDraw=mplMenuDraw;
 // appMPlayer.menuWindow.MouseHandler=mplMenuMouseHandle;
 // appMPlayer.menuWindow.KeyHandler=mplMainKeyHandle;

Index: play.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/play.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- play.c	9 Jan 2003 20:47:10 -0000	1.81
+++ play.c	13 Jan 2003 23:38:48 -0000	1.82
@@ -191,6 +191,7 @@
 void ChangeSkin( char * name )
 {
  int ret;
+ int prev = appMPlayer.menuIsPresent;
 
  mainVisible=0;
 
@@ -208,7 +209,8 @@
    mainVisible=1;
    return;
   }
- if ( appMPlayer.menuBase.Bitmap.Image )
+
+ if ( prev && appMPlayer.menuIsPresent )
   {
    if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer );
    if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL )
@@ -217,7 +219,7 @@
    wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
    wsSetShape( &appMPlayer.menuWindow,appMPlayer.menuBase.Mask.Image );
    wsVisibleWindow( &appMPlayer.menuWindow,wsHideWindow );
-  }
+  } else { mplMenuInit(); }
 
  if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height );
  if ( ( !appMPlayer.subWindow.isFullScreen )&&( !guiIntfStruct.Playing ) )
@@ -238,7 +240,9 @@
  if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
   { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; }
 
- if ( vo_wm_type == vo_wm_Unknown ) wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow );
+#if 0
+// if ( vo_wm_type == vo_wm_Unknown ) 
+  wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow );
  wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
  wsMoveWindow( &appMPlayer.mainWindow,True,appMPlayer.main.x,appMPlayer.main.y );
  wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
@@ -246,7 +250,26 @@
  wsWindowDecoration( &appMPlayer.mainWindow,appMPlayer.mainDecoration );
  mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow );
  wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
+#else
+ wsDestroyWindow( &appMPlayer.mainWindow );
+
+ wsCreateWindow( &appMPlayer.mainWindow,
+   appMPlayer.main.x,appMPlayer.main.y,appMPlayer.main.width,appMPlayer.main.height,
+   wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsMaxSize|wsHideWindow,"MPlayer" );
+ wsCreateImage( &appMPlayer.mainWindow,appMPlayer.main.Bitmap.Width,appMPlayer.main.Bitmap.Height );
+ wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
+ wsSetIcon( wsDisplay,appMPlayer.mainWindow.WindowID,guiIcon,guiIconMask );
+
+ appMPlayer.mainWindow.ReDraw=(void *)mplMainDraw;
+ appMPlayer.mainWindow.MouseHandler=mplMainMouseHandle;
+ appMPlayer.mainWindow.KeyHandler=mplMainKeyHandle;
+ appMPlayer.mainWindow.DandDHandler=mplDandDHandler;
 
+ wsXDNDMakeAwareness( &appMPlayer.mainWindow );
+ if ( !appMPlayer.mainDecoration ) wsWindowDecoration( &appMPlayer.mainWindow,0 );
+ wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
+ mainVisible=1;
+#endif
  btnModify( evSetVolume,guiIntfStruct.Volume );
  btnModify( evSetBalance,guiIntfStruct.Balance );
  btnModify( evSetMoviePosition,guiIntfStruct.Position );



More information about the MPlayer-cvslog mailing list