changeset 1858:88a88d0a3f94

fix skin changing, xv fullscreen redraw bug, etc.
author pontscho
date Wed, 05 Sep 2001 18:17:22 +0000
parents 5bae42c5577b
children 35036f9a1672
files Gui/mplayer/play.c Gui/mplayer/play.h Gui/mplayer/psignal.c Gui/mplayer/psignal.h Gui/mplayer/sw.h Gui/wm/ws.c Gui/wm/ws.h libvo/vo_xv.c
diffstat 8 files changed, 29 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/play.c	Wed Sep 05 11:00:11 2001 +0000
+++ b/Gui/mplayer/play.c	Wed Sep 05 18:17:22 2001 +0000
@@ -67,6 +67,8 @@
  if ( mplShMem->Playing == 2 ) { mplPause(); return; }
  mplShMem->Playing=1;
  mplSubRender=0;
+ wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 );
+ wsClearWindow( appMPlayer.subWindow ); 
  wsPostRedisplay( &appMPlayer.subWindow );
 }
 
@@ -162,9 +164,10 @@
     { 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 );
+   wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
    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 );
@@ -175,17 +178,22 @@
      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 );
+     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=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 );
+//     if ( appMPlayer.subWindow.isFullScreen ) wsFullScreen( &appMPlayer.subWindow );
+     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 );
     }
   }
--- a/Gui/mplayer/play.h	Wed Sep 05 11:00:11 2001 +0000
+++ b/Gui/mplayer/play.h	Wed Sep 05 18:17:22 2001 +0000
@@ -87,7 +87,6 @@
 
 extern void mplPlayFork( void );
 extern void mplSigHandler( int s );
-extern void mplSendMessage( int msg );
 extern void mplPlayerThread( void );
 
 extern void ChangeSkin( void );
--- a/Gui/mplayer/psignal.c	Wed Sep 05 11:00:11 2001 +0000
+++ b/Gui/mplayer/psignal.c	Wed Sep 05 18:17:22 2001 +0000
@@ -177,15 +177,6 @@
 // mplShMem->message=0;
 }
 
-void mplSendMessage( int msg )
-{
- if ( !mplShMem->Playing ) return;
- mplShMem->message=msg;
-// kill( mplMPlayerPID,SIGTYPE ); usleep( 10 );
-// kill( mplMPlayerPID,SIGTYPE ); usleep( 10 );
- kill( mplMPlayerPID,SIGTYPE );
-}
-
 void gtkSendMessage( int msg )
 {
  if ( !gtkIsOk ) return;
--- a/Gui/mplayer/psignal.h	Wed Sep 05 11:00:11 2001 +0000
+++ b/Gui/mplayer/psignal.h	Wed Sep 05 18:17:22 2001 +0000
@@ -57,7 +57,6 @@
 extern void mplPlayerSigHandler( int s );
 extern void mplMainSigHandler( int s );
 
-extern void mplSendMessage( int msg );
 extern void gtkSendMessage( int msg );
 
 extern void mplErrorHandler( int critical,const char * format, ... );
--- a/Gui/mplayer/sw.h	Wed Sep 05 11:00:11 2001 +0000
+++ b/Gui/mplayer/sw.h	Wed Sep 05 18:17:22 2001 +0000
@@ -13,8 +13,8 @@
 
  if ( mplShMem->Playing )
   { 
-   wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 );
-   wsClearWindow( appMPlayer.subWindow );
+//   wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 );
+//   wsClearWindow( appMPlayer.subWindow );
    vo_expose=1; 
    mplSubRender=0;
   }
--- a/Gui/wm/ws.c	Wed Sep 05 11:00:11 2001 +0000
+++ b/Gui/wm/ws.c	Wed Sep 05 18:17:22 2001 +0000
@@ -452,7 +452,7 @@
  win->Rolled=0;
  if ( D & wsShowWindow ) XMapWindow( wsDisplay,win->WindowID );
 
- wsCreateImage( win );
+ wsCreateImage( win,win->Width,win->Height );
 // --- End of creating --------------------------------------------------------------------------
 
  wsWindowList[wsWLCount++]=win;
@@ -1006,14 +1006,14 @@
  win->xImage=NULL;
 }
 
-void wsCreateImage( wsTWindow * win )
+void wsCreateImage( wsTWindow * win,int Width,int Height )
 {
  int CompletionType = -1;
  if ( wsUseXShm )
   {
    CompletionType=XShmGetEventBase( wsDisplay ) + ShmCompletion;
    win->xImage=XShmCreateImage( wsDisplay,win->VisualInfo.visual,
-                   win->Attribs.depth,ZPixmap,NULL,&win->Shminfo,win->Width,win->Height );
+                   win->Attribs.depth,ZPixmap,NULL,&win->Shminfo,Width,Height );
    if ( win->xImage == NULL )
     {
      fprintf( stderr,"[ws] shared memory extension error.\n" );
@@ -1046,7 +1046,7 @@
   else
    {
     win->xImage=XCreateImage( wsDisplay,win->VisualInfo.visual,win->Attribs.depth,
-                              ZPixmap,0,0,win->Width,win->Height,
+                              ZPixmap,0,0,Width,Height,
                               (wsDepthOnScreen == 3) ? 32 : wsDepthOnScreen,
                               0 );
     if ( ( win->xImage->data=malloc( win->xImage->bytes_per_line * win->xImage->height ) ) == NULL )
@@ -1060,8 +1060,8 @@
  win->ImageDatadw=(unsigned int *)win->xImage->data;
 }
 
-void wsResizeImage( wsTWindow * win )
-{ wsDestroyImage( win ); wsCreateImage( win ); }
+void wsResizeImage( wsTWindow * win,int Width,int Height )
+{ wsDestroyImage( win ); wsCreateImage( win,Width,Height ); }
 
 int wsGetOutMask( void )
 {
--- a/Gui/wm/ws.h	Wed Sep 05 11:00:11 2001 +0000
+++ b/Gui/wm/ws.h	Wed Sep 05 18:17:22 2001 +0000
@@ -227,10 +227,10 @@
 // ----------------------------------------------------------------------------------------------
 // Image handling
 // ----------------------------------------------------------------------------------------------
-extern void wsCreateImage( wsTWindow * win );
+extern void wsCreateImage( wsTWindow * win,int Width,int Height );
 extern void wsConvert( wsTWindow * win,unsigned char * Image,unsigned int Size );
 extern void wsPutImage( wsTWindow * win );
-extern void wsResizeImage( wsTWindow * win );
+extern void wsResizeImage( wsTWindow * win,int Width,int Height );
 extern void wsDestroyImage( wsTWindow * win );
 extern int  wsGetOutMask( void );
 
--- a/libvo/vo_xv.c	Wed Sep 05 11:00:11 2001 +0000
+++ b/libvo/vo_xv.c	Wed Sep 05 18:17:22 2001 +0000
@@ -357,6 +357,11 @@
      printf( "[xv-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
     }
   }
+ if ( e & VO_EVENT_EXPOSE )
+  {
+   XvShmPutImage(mDisplay, xv_port, mywindow, mygc, xvimage[current_buf], 0, 0,  image_width, image_height, drwX, drwY, 1, 1, False);
+   XvShmPutImage(mDisplay, xv_port, mywindow, mygc, xvimage[current_buf], 0, 0,  image_width, image_height, drwX,drwY,drwWidth,(mFullscreen?drwHeight - 1:drwHeight), False);
+  }
 }
 
 static void draw_osd(void)