2001-08-25 21:04:29 +00:00
|
|
|
|
|
|
|
// sub window
|
|
|
|
|
|
|
|
int mplSubRender = 1;
|
2001-08-31 21:19:52 +00:00
|
|
|
|
|
|
|
int VisibleMainWindow( void )
|
|
|
|
{
|
|
|
|
Window root,parent,me,subw,mainw;
|
|
|
|
Window * childs;
|
|
|
|
int nchilds;
|
|
|
|
int i;
|
|
|
|
int visible = 0;
|
|
|
|
|
|
|
|
me=appMPlayer.mainWindow.WindowID;
|
|
|
|
for (;;)
|
|
|
|
{
|
|
|
|
XQueryTree( wsDisplay,me,&root,&parent,&childs,&nchilds);
|
|
|
|
XFree((char *) childs);
|
|
|
|
if (root == parent) break;
|
|
|
|
me=parent;
|
|
|
|
}
|
|
|
|
XQueryTree( wsDisplay,root,&root,&parent,&childs,&nchilds );
|
|
|
|
mainw=me;
|
|
|
|
|
|
|
|
me=appMPlayer.subWindow.WindowID;
|
|
|
|
for (;;)
|
|
|
|
{
|
|
|
|
XQueryTree( wsDisplay,me,&root,&parent,&childs,&nchilds);
|
|
|
|
XFree((char *) childs);
|
|
|
|
if (root == parent) break;
|
|
|
|
me=parent;
|
|
|
|
}
|
|
|
|
XQueryTree( wsDisplay,root,&root,&parent,&childs,&nchilds );
|
|
|
|
subw=me;
|
|
|
|
|
|
|
|
for (i=0; i < nchilds; i++) if ( childs[i]==me ) break;
|
|
|
|
for ( ;i<nchilds;i++ ) if ( childs[i] == mainw ) visible=1;
|
|
|
|
// printf( "-----------> visible main vindov: %d ---\n",visible );
|
|
|
|
return visible;
|
|
|
|
}
|
|
|
|
|
|
|
|
int mainisvisible1;
|
|
|
|
int mainisvisible2;
|
|
|
|
int count = 0;
|
2001-08-25 21:04:29 +00:00
|
|
|
|
|
|
|
void mplSubDraw( wsParamDisplay )
|
|
|
|
{
|
2001-08-31 21:19:52 +00:00
|
|
|
// if ( ( appMPlayer.subWindow.Visible == wsWindowNotVisible )||
|
|
|
|
// ( appMPlayer.subWindow.State != wsWindowExpose ) ) return;
|
2001-08-31 11:27:21 +00:00
|
|
|
|
2001-08-31 21:19:52 +00:00
|
|
|
if ( ( mplShMem->Playing ) )//&&( appMPlayer.subWindow.State == wsWindowExpose ) )
|
2001-08-31 11:27:21 +00:00
|
|
|
{
|
|
|
|
vo_expose=1;
|
2001-08-31 21:19:52 +00:00
|
|
|
mplSubRender=0;
|
2001-08-31 11:27:21 +00:00
|
|
|
}
|
2001-08-25 21:04:29 +00:00
|
|
|
|
|
|
|
if ( mplSubRender )
|
|
|
|
{
|
2001-08-31 22:07:53 +00:00
|
|
|
wsSetForegroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
|
|
|
|
XFillRectangle( wsDisplay,appMPlayer.subWindow.WindowID,appMPlayer.subWindow.wGC,0,0,
|
|
|
|
appMPlayer.subWindow.Width,appMPlayer.subWindow.Height );
|
2001-08-31 11:27:21 +00:00
|
|
|
if ( appMPlayer.sub.Bitmap.Image )
|
|
|
|
{
|
|
|
|
wsConvert( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Image,appMPlayer.sub.Bitmap.ImageSize );
|
|
|
|
wsPutImage( &appMPlayer.subWindow );
|
|
|
|
}
|
2001-08-28 15:55:02 +00:00
|
|
|
XFlush( wsDisplay );
|
2001-08-25 21:04:29 +00:00
|
|
|
}
|
2001-08-31 21:19:52 +00:00
|
|
|
appMPlayer.subWindow.State=0;
|
2001-08-25 21:04:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
|
|
|
|
{
|
2001-08-31 21:19:52 +00:00
|
|
|
static int mplSubMoved = 0;
|
|
|
|
static int oldmainisvisible = 0;
|
|
|
|
|
2001-08-25 21:04:29 +00:00
|
|
|
mplMouseTimer=mplMouseTimerConst;
|
|
|
|
wsVisibleMouse( &appMPlayer.subWindow,wsShowMouseCursor );
|
|
|
|
|
|
|
|
switch( Button )
|
|
|
|
{
|
|
|
|
case wsPRMouseButton:
|
|
|
|
mplShowMenu( RX,RY );
|
|
|
|
msButton=wsPRMouseButton;
|
|
|
|
break;
|
|
|
|
case wsRRMouseButton:
|
|
|
|
mplHideMenu( RX,RY );
|
|
|
|
msButton=0;
|
|
|
|
break;
|
2001-08-31 21:19:52 +00:00
|
|
|
// ---
|
2001-08-25 21:04:29 +00:00
|
|
|
case wsPLMouseButton:
|
2001-08-31 21:19:52 +00:00
|
|
|
oldmainisvisible=VisibleMainWindow();
|
|
|
|
printf( "----> %d %d\n",mainisvisible1,mainisvisible2 );
|
|
|
|
//=mainisvisible;
|
2001-08-25 21:04:29 +00:00
|
|
|
sx=X; sy=Y;
|
|
|
|
msButton=wsPLMouseButton;
|
|
|
|
mplSubMoved=0;
|
|
|
|
break;
|
|
|
|
case wsMoveMouse:
|
|
|
|
switch ( msButton )
|
|
|
|
{
|
|
|
|
case wsPLMouseButton:
|
|
|
|
mplSubMoved=1;
|
2001-08-30 16:50:03 +00:00
|
|
|
if ( !appMPlayer.subWindow.isFullScreen ) wsMoveWindow( &appMPlayer.subWindow,RX - sx,RY - sy );
|
2001-08-25 21:04:29 +00:00
|
|
|
break;
|
|
|
|
case wsPRMouseButton:
|
|
|
|
mplMenuMouseHandle( X,Y,RX,RY );
|
|
|
|
mplMouseTimer=mplMouseTimerConst;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case wsRLMouseButton:
|
2001-08-31 21:19:52 +00:00
|
|
|
if ( ( !mplSubMoved )&&
|
|
|
|
( appMPlayer.subWindow.isFullScreen )&&
|
|
|
|
( !VisibleMainWindow() ) )
|
2001-08-30 16:50:03 +00:00
|
|
|
{
|
2001-08-31 21:19:52 +00:00
|
|
|
wsMoveTopWindow( &appMPlayer.mainWindow );
|
|
|
|
// else wsMoveTopWindow( &appMPlayer.mainWindow );
|
2001-08-30 16:50:03 +00:00
|
|
|
}
|
2001-08-25 21:04:29 +00:00
|
|
|
msButton=0;
|
|
|
|
mplSubMoved=0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|