move bug meg fileload bug fixed asszem.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2855 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
pontscho 2001-11-12 15:16:13 +00:00
parent a99541ef7d
commit ed79f1f1dd
9 changed files with 40 additions and 43 deletions

View File

@ -79,7 +79,7 @@ void mplShowMenu( int mx,int my )
mplMenuItem = 0; mplMenuItem = 0;
wsMoveWindow( &appMPlayer.menuWindow,x,y ); wsMoveWindow( &appMPlayer.menuWindow,False,x,y );
wsVisibleWindow( &appMPlayer.menuWindow,wsShowWindow ); wsVisibleWindow( &appMPlayer.menuWindow,wsShowWindow );
wsMoveTopWindow( &appMPlayer.menuWindow ); wsMoveTopWindow( &appMPlayer.menuWindow );
} }

View File

@ -50,15 +50,16 @@ void mplTimerHandler( int signum )
void mplInit( int argc,char* argv[], char *envp[], void* disp ) void mplInit( int argc,char* argv[], char *envp[], void* disp )
{ {
int i; int i;
// allocates shmem to gtkShMem
// fork() a process which runs gtkThreadProc() [gtkPID]
gtkInit( argc,argv,envp );
strcpy( gtkShMem->sb.name,skinName );
// allocates shmem to mplShMem // allocates shmem to mplShMem
// init fields of this struct to default values // init fields of this struct to default values
mplMPlayerInit( argc,argv,envp ); mplMPlayerInit( argc,argv,envp );
// allocates shmem to gtkShMem
// fork() a process which runs gtkThreadProc() [gtkPID]
gtkInit( argc,argv,envp );
strcpy( gtkShMem->sb.name,skinName );
message=mplErrorHandler; // error messagebox drawing function message=mplErrorHandler; // error messagebox drawing function
// opens X display, checks for extensions (XShape, DGA etc) // opens X display, checks for extensions (XShape, DGA etc)

View File

@ -170,10 +170,6 @@ void mplMainDraw( wsParamDisplay )
} }
} }
// --- erosen ideiglenes.
strcpy( gtkShMem->fs.filename,mplShMem->Filename );
// ---
if ( mplMainRender ) if ( mplMainRender )
{ {
memcpy( mplDrawBuffer,appMPlayer.main.Bitmap.Image,appMPlayer.main.Bitmap.ImageSize ); memcpy( mplDrawBuffer,appMPlayer.main.Bitmap.Image,appMPlayer.main.Bitmap.ImageSize );
@ -212,7 +208,7 @@ drawrenderedtext:
mplMainRender=0; mplMainRender=0;
} }
wsPutImage( &appMPlayer.mainWindow ); wsPutImage( &appMPlayer.mainWindow );
XFlush( wsDisplay ); // XFlush( wsDisplay );
} }
#define IZE(x) printf("@@@ " x " @@@\n"); #define IZE(x) printf("@@@ " x " @@@\n");
@ -501,7 +497,7 @@ rollerhandled:
switch ( itemtype ) switch ( itemtype )
{ {
case itPLMButton: case itPLMButton:
wsMoveWindow( &appMPlayer.mainWindow,RX - abs( sx ),RY - abs( sy ) ); wsMoveWindow( &appMPlayer.mainWindow,False,RX - abs( sx ),RY - abs( sy ) );
mplMainRender=0; mplMainRender=0;
break; break;
case itPRMButton: case itPRMButton:

View File

@ -40,7 +40,7 @@ void mplFullScreen( void )
if ( appMPlayer.subWindow.isFullScreen ) if ( appMPlayer.subWindow.isFullScreen )
{ {
wsResizeWindow( &appMPlayer.subWindow,sx,sy ); 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 ); wsWindowDecoration( &appMPlayer.subWindow,appMPlayer.subWindow.Decorations );
appMPlayer.subWindow.isFullScreen=0; appMPlayer.subWindow.isFullScreen=0;
} }
@ -48,7 +48,7 @@ void mplFullScreen( void )
{ {
sx=appMPlayer.subWindow.Width; sy=appMPlayer.subWindow.Height; sx=appMPlayer.subWindow.Width; sy=appMPlayer.subWindow.Height;
wsResizeWindow( &appMPlayer.subWindow,wsMaxX,wsMaxY ); wsResizeWindow( &appMPlayer.subWindow,wsMaxX,wsMaxY );
wsMoveWindow( &appMPlayer.subWindow,0,0 ); wsMoveWindow( &appMPlayer.subWindow,True,0,0 );
wsWindowDecoration( &appMPlayer.subWindow,0 ); wsWindowDecoration( &appMPlayer.subWindow,0 );
appMPlayer.subWindow.isFullScreen=1; appMPlayer.subWindow.isFullScreen=1;
} }
@ -70,7 +70,7 @@ void mplStop()
if ( !appMPlayer.subWindow.isFullScreen ) if ( !appMPlayer.subWindow.isFullScreen )
{ {
wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); 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; mplSubRender=1;
wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
@ -183,7 +183,7 @@ void ChangeSkin( void )
if ( ( !appMPlayer.subWindow.isFullScreen )&&( !mplShMem->Playing ) ) if ( ( !appMPlayer.subWindow.isFullScreen )&&( !mplShMem->Playing ) )
{ {
wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); 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 ); 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 ); if ( appMPlayer.sub.Bitmap.Image ) wsConvert( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Image,appMPlayer.sub.Bitmap.ImageSize );
@ -199,7 +199,7 @@ void ChangeSkin( void )
{ message( False,MSGTR_NEMDB ); return; } { message( False,MSGTR_NEMDB ); return; }
wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow ); wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow );
wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); 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 ); wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow ); mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow );
@ -222,6 +222,11 @@ void mplResizeToMovieSize( unsigned int width,unsigned int height )
if ( !appMPlayer.subWindow.isFullScreen ) if ( !appMPlayer.subWindow.isFullScreen )
{ {
wsResizeWindow( &appMPlayer.subWindow,width,height ); 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 );
}

View File

@ -91,4 +91,6 @@ extern void mplPlayerThread( void );
extern void ChangeSkin( void ); extern void ChangeSkin( void );
extern void EventHandling( void ); extern void EventHandling( void );
extern void mplSetFileName( char * fname );
#endif #endif

View File

@ -54,7 +54,7 @@ void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
{ {
case wsPLMouseButton: case wsPLMouseButton:
mplSubMoved=1; 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; break;
case wsPRMouseButton: case wsPRMouseButton:
mplMenuMouseHandle( X,Y,RX,RY ); mplMenuMouseHandle( X,Y,RX,RY );

View File

@ -107,7 +107,6 @@ inline int wsSearch( Window win );
void wsWindowDecoration( wsTWindow * win,long d ) void wsWindowDecoration( wsTWindow * win,long d )
{ {
//XUnmapWindow( wsDisplay,win->WindowID );
wsMotifHints=XInternAtom( wsDisplay,"_MOTIF_WM_HINTS",0 ); wsMotifHints=XInternAtom( wsDisplay,"_MOTIF_WM_HINTS",0 );
if ( wsMotifHints != None ) if ( wsMotifHints != None )
{ {
@ -118,17 +117,6 @@ void wsWindowDecoration( wsTWindow * win,long d )
XChangeProperty( wsDisplay,win->WindowID,wsMotifHints,wsMotifHints,32, XChangeProperty( wsDisplay,win->WindowID,wsMotifHints,wsMotifHints,32,
PropModeReplace,(unsigned char *)&wsMotifWmHints,5 ); 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,7 +844,9 @@ void wsPutImage( wsTWindow * win )
// ---------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------
// Move window to x, y. // Move window to x, y.
// ---------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------
void wsMoveWindow( wsTWindow * win,int x, int y ) void wsMoveWindow( wsTWindow * win,int b,int x, int y )
{
if ( b )
{ {
switch ( x ) switch ( x )
{ {
@ -870,6 +860,8 @@ void wsMoveWindow( wsTWindow * win,int x, int y )
case -2: win->Y=wsMaxY - win->Height; break; case -2: win->Y=wsMaxY - win->Height; break;
default: win->Y=y; break; default: win->Y=y; break;
} }
}
else { win->X=x; win->Y=y; }
win->SizeHint.flags=PPosition | PWinGravity; win->SizeHint.flags=PPosition | PWinGravity;
win->SizeHint.x=win->X; win->SizeHint.x=win->X;

View File

@ -203,7 +203,7 @@ extern void wsMainLoop( void );
// ---------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------
extern void wsCreateWindow( wsTWindow * win,int X,int Y,int wX,int hY,int bW,int cV,unsigned char D,char * label ); 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 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 wsResizeWindow( wsTWindow * win,int sx, int sy );
extern void wsIconify( wsTWindow win ); extern void wsIconify( wsTWindow win );
extern void wsMoveTopWindow( wsTWindow * win ); extern void wsMoveTopWindow( wsTWindow * win );

View File

@ -1018,6 +1018,7 @@ current_module="init_libvo";
moviewidth=screen_size_x=sh_video->disp_w; moviewidth=screen_size_x=sh_video->disp_w;
movieheight=screen_size_y=sh_video->disp_h; movieheight=screen_size_y=sh_video->disp_h;
mplShMem->StreamType=stream->type; mplShMem->StreamType=stream->type;
mplSetFileName( filename );
} }
#endif #endif