changeset 2854:fd44ecf77f8d

move bug meg fileload bug fixed asszem.
author pontscho
date Mon, 12 Nov 2001 15:16:13 +0000
parents af5b47669254
children 8bb4e195d7d7
files Gui/mplayer/menu.h Gui/mplayer/mplayer.c Gui/mplayer/mw.h Gui/mplayer/play.c Gui/mplayer/play.h Gui/mplayer/sw.h Gui/wm/ws.c Gui/wm/ws.h mplayer.c
diffstat 9 files changed, 40 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/menu.h	Mon Nov 12 14:00:25 2001 +0000
+++ b/Gui/mplayer/menu.h	Mon Nov 12 15:16:13 2001 +0000
@@ -79,7 +79,7 @@
 
  mplMenuItem = 0;
 
- wsMoveWindow( &appMPlayer.menuWindow,x,y );
+ wsMoveWindow( &appMPlayer.menuWindow,False,x,y );
  wsVisibleWindow( &appMPlayer.menuWindow,wsShowWindow );
  wsMoveTopWindow( &appMPlayer.menuWindow );
 }
--- a/Gui/mplayer/mplayer.c	Mon Nov 12 14:00:25 2001 +0000
+++ b/Gui/mplayer/mplayer.c	Mon Nov 12 15:16:13 2001 +0000
@@ -50,15 +50,16 @@
 void mplInit( int argc,char* argv[], char *envp[], void* disp )
 {
  int i;
+
+ // allocates shmem to mplShMem
+ // init fields of this struct to default values
+ mplMPlayerInit( argc,argv,envp );
+
  // allocates shmem to gtkShMem
  // fork() a process which runs gtkThreadProc()  [gtkPID]
  gtkInit( argc,argv,envp );
  strcpy( gtkShMem->sb.name,skinName ); 
 
- // allocates shmem to mplShMem
- // init fields of this struct to default values
- mplMPlayerInit( argc,argv,envp );
-
  message=mplErrorHandler;  // error messagebox drawing function
 
  // opens X display, checks for extensions (XShape, DGA etc)
--- a/Gui/mplayer/mw.h	Mon Nov 12 14:00:25 2001 +0000
+++ b/Gui/mplayer/mw.h	Mon Nov 12 15:16:13 2001 +0000
@@ -170,10 +170,6 @@
          }
   }
 
-// --- erosen ideiglenes.
- strcpy( gtkShMem->fs.filename,mplShMem->Filename );
-// ---
-
  if ( mplMainRender )
   {
    memcpy( mplDrawBuffer,appMPlayer.main.Bitmap.Image,appMPlayer.main.Bitmap.ImageSize );
@@ -212,7 +208,7 @@
    mplMainRender=0;
   }
  wsPutImage( &appMPlayer.mainWindow );
- XFlush( wsDisplay );
+// XFlush( wsDisplay );
 }
 
 #define IZE(x) printf("@@@ " x " @@@\n");
@@ -501,7 +497,7 @@
           switch ( itemtype )
            {
             case itPLMButton:
-                 wsMoveWindow( &appMPlayer.mainWindow,RX - abs( sx ),RY - abs( sy ) );
+                 wsMoveWindow( &appMPlayer.mainWindow,False,RX - abs( sx ),RY - abs( sy ) );
                  mplMainRender=0;
                  break;
             case itPRMButton:
--- a/Gui/mplayer/play.c	Mon Nov 12 14:00:25 2001 +0000
+++ b/Gui/mplayer/play.c	Mon Nov 12 15:16:13 2001 +0000
@@ -40,7 +40,7 @@
  if ( appMPlayer.subWindow.isFullScreen )
   {
    wsResizeWindow( &appMPlayer.subWindow,sx,sy );
-   wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y );
+   wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
    wsWindowDecoration( &appMPlayer.subWindow,appMPlayer.subWindow.Decorations );
    appMPlayer.subWindow.isFullScreen=0;
   }
@@ -48,7 +48,7 @@
    {
     sx=appMPlayer.subWindow.Width; sy=appMPlayer.subWindow.Height;
     wsResizeWindow( &appMPlayer.subWindow,wsMaxX,wsMaxY );
-    wsMoveWindow( &appMPlayer.subWindow,0,0 );
+    wsMoveWindow( &appMPlayer.subWindow,True,0,0 );
     wsWindowDecoration( &appMPlayer.subWindow,0 );
     appMPlayer.subWindow.isFullScreen=1;
    }
@@ -70,7 +70,7 @@
  if ( !appMPlayer.subWindow.isFullScreen )
   {
    wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
-   wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y );
+   wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
   }
  mplSubRender=1;
  wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
@@ -183,7 +183,7 @@
  if ( ( !appMPlayer.subWindow.isFullScreen )&&( !mplShMem->Playing ) )
   {
    wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
-   wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y );
+   wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
   } 
  wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
  if ( appMPlayer.sub.Bitmap.Image ) wsConvert( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Image,appMPlayer.sub.Bitmap.ImageSize );
@@ -199,7 +199,7 @@
   { message( False,MSGTR_NEMDB ); return; }
  wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow );
  wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
- wsMoveWindow( &appMPlayer.mainWindow,appMPlayer.main.x,appMPlayer.main.y );
+ wsMoveWindow( &appMPlayer.mainWindow,True,appMPlayer.main.x,appMPlayer.main.y );
  wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
  wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
  mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow );
@@ -222,6 +222,11 @@
  if ( !appMPlayer.subWindow.isFullScreen )
   {
    wsResizeWindow( &appMPlayer.subWindow,width,height );
-   wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y );
+   wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
   } 
 }
+
+void mplSetFileName( char * fname )
+{
+ if ( ( fname )&&( gtkShMem ) ) strcpy( gtkShMem->fs.filename,fname );
+}
--- a/Gui/mplayer/play.h	Mon Nov 12 14:00:25 2001 +0000
+++ b/Gui/mplayer/play.h	Mon Nov 12 15:16:13 2001 +0000
@@ -91,4 +91,6 @@
 extern void ChangeSkin( void );
 extern void EventHandling( void );
 
+extern void mplSetFileName( char * fname );
+
 #endif
--- a/Gui/mplayer/sw.h	Mon Nov 12 14:00:25 2001 +0000
+++ b/Gui/mplayer/sw.h	Mon Nov 12 15:16:13 2001 +0000
@@ -54,7 +54,7 @@
            {
             case wsPLMouseButton:
                    mplSubMoved=1;
-                   if ( !appMPlayer.subWindow.isFullScreen ) wsMoveWindow( &appMPlayer.subWindow,RX - sx,RY - sy );
+                   if ( !appMPlayer.subWindow.isFullScreen ) wsMoveWindow( &appMPlayer.subWindow,False,RX - sx,RY - sy );
                    break;
             case wsPRMouseButton:
                    mplMenuMouseHandle( X,Y,RX,RY );
--- a/Gui/wm/ws.c	Mon Nov 12 14:00:25 2001 +0000
+++ b/Gui/wm/ws.c	Mon Nov 12 15:16:13 2001 +0000
@@ -107,7 +107,6 @@
 
 void wsWindowDecoration( wsTWindow * win,long d )
 {
-//XUnmapWindow( wsDisplay,win->WindowID );
  wsMotifHints=XInternAtom( wsDisplay,"_MOTIF_WM_HINTS",0 );
  if ( wsMotifHints != None )
   {
@@ -118,17 +117,6 @@
    XChangeProperty( wsDisplay,win->WindowID,wsMotifHints,wsMotifHints,32,
                     PropModeReplace,(unsigned char *)&wsMotifWmHints,5 );
   }
-//XMapWindow( wsDisplay,win->WindowID );
-// if ( d )
-//  {
-//   win->SizeHint.win_gravity=ForgetGravity;
-//  }
-//   else
-//    {
-//     win->SizeHint.win_gravity=StaticGravity;
-//    }
-// win->SizeHint.flags=PWinGravity;
-// XSetWMSizeHints( wsDisplay,win->WindowID,&win->SizeHint,win->AtomWMSizeHint );
 }
 
 // ----------------------------------------------------------------------------------------------
@@ -856,20 +844,24 @@
 // ----------------------------------------------------------------------------------------------
 //    Move window to x, y.
 // ----------------------------------------------------------------------------------------------
-void wsMoveWindow( wsTWindow * win,int x, int y )
+void wsMoveWindow( wsTWindow * win,int b,int x, int y )
 {
- switch ( x )
+ if ( b )
   {
-   case -1: win->X=( wsMaxX / 2 ) - ( win->Width / 2 ); break;
-   case -2: win->X=wsMaxX - win->Width; break;
-   default: win->X=x; break;
+   switch ( x )
+    {
+     case -1: win->X=( wsMaxX / 2 ) - ( win->Width / 2 ); break;
+     case -2: win->X=wsMaxX - win->Width; break;
+     default: win->X=x; break;
+    }
+   switch ( y )
+    {
+     case -1: win->Y=( wsMaxY / 2 ) - ( win->Height / 2 ); break;
+     case -2: win->Y=wsMaxY - win->Height; break;
+     default: win->Y=y; break;
+    }
   }
- switch ( y )
-  {
-   case -1: win->Y=( wsMaxY / 2 ) - ( win->Height / 2 ); break;
-   case -2: win->Y=wsMaxY - win->Height; break;
-   default: win->Y=y; break;
-  }
+  else { win->X=x; win->Y=y; }
 
  win->SizeHint.flags=PPosition | PWinGravity;
  win->SizeHint.x=win->X;
--- a/Gui/wm/ws.h	Mon Nov 12 14:00:25 2001 +0000
+++ b/Gui/wm/ws.h	Mon Nov 12 15:16:13 2001 +0000
@@ -203,7 +203,7 @@
 // ----------------------------------------------------------------------------------------------
 extern void wsCreateWindow( wsTWindow * win,int X,int Y,int wX,int hY,int bW,int cV,unsigned char D,char * label );
 extern void wsDestroyWindow( wsTWindow * win );
-extern void wsMoveWindow( wsTWindow * win,int x, int y );
+extern void wsMoveWindow( wsTWindow * win,int b,int x, int y );
 extern void wsResizeWindow( wsTWindow * win,int sx, int sy );
 extern void wsIconify( wsTWindow win );
 extern void wsMoveTopWindow( wsTWindow * win );
--- a/mplayer.c	Mon Nov 12 14:00:25 2001 +0000
+++ b/mplayer.c	Mon Nov 12 15:16:13 2001 +0000
@@ -1018,6 +1018,7 @@
      moviewidth=screen_size_x=sh_video->disp_w;
      movieheight=screen_size_y=sh_video->disp_h;
      mplShMem->StreamType=stream->type;
+     mplSetFileName( filename );
     }
 #endif
 
@@ -1893,7 +1894,7 @@
 
   video_out=NULL;
   audio_out=NULL;
-    
+
   goto play_next_file;
 }