comparison Gui/mplayer/sw.h @ 1812:d2d6a26ddb02

majd fix play&stop&pause&redraw
author pontscho
date Fri, 31 Aug 2001 21:19:52 +0000
parents ddeafb1dbc73
children eff8f3c200fa
comparison
equal deleted inserted replaced
1811:0483b88482f5 1812:d2d6a26ddb02
1 1
2 // sub window 2 // sub window
3 3
4 int mplSubRender = 1; 4 int mplSubRender = 1;
5 int mplSubMoved = 0; 5
6 int VisibleMainWindow( void )
7 {
8 Window root,parent,me,subw,mainw;
9 Window * childs;
10 int nchilds;
11 int i;
12 int visible = 0;
13
14 me=appMPlayer.mainWindow.WindowID;
15 for (;;)
16 {
17 XQueryTree( wsDisplay,me,&root,&parent,&childs,&nchilds);
18 XFree((char *) childs);
19 if (root == parent) break;
20 me=parent;
21 }
22 XQueryTree( wsDisplay,root,&root,&parent,&childs,&nchilds );
23 mainw=me;
24
25 me=appMPlayer.subWindow.WindowID;
26 for (;;)
27 {
28 XQueryTree( wsDisplay,me,&root,&parent,&childs,&nchilds);
29 XFree((char *) childs);
30 if (root == parent) break;
31 me=parent;
32 }
33 XQueryTree( wsDisplay,root,&root,&parent,&childs,&nchilds );
34 subw=me;
35
36 for (i=0; i < nchilds; i++) if ( childs[i]==me ) break;
37 for ( ;i<nchilds;i++ ) if ( childs[i] == mainw ) visible=1;
38 // printf( "-----------> visible main vindov: %d ---\n",visible );
39 return visible;
40 }
41
42 int mainisvisible1;
43 int mainisvisible2;
44 int count = 0;
6 45
7 void mplSubDraw( wsParamDisplay ) 46 void mplSubDraw( wsParamDisplay )
8 { 47 {
9 if ( ( appMPlayer.subWindow.Visible == wsWindowNotVisible )|| 48 // if ( ( appMPlayer.subWindow.Visible == wsWindowNotVisible )||
10 ( appMPlayer.subWindow.State != wsWindowExpose ) ) return; 49 // ( appMPlayer.subWindow.State != wsWindowExpose ) ) return;
11 50
12 if ( ( mplShMem->Playing )&&( appMPlayer.subWindow.State == wsWindowExpose ) ) 51 if ( ( mplShMem->Playing ) )//&&( appMPlayer.subWindow.State == wsWindowExpose ) )
13 { 52 {
53 printf( "------> redraw volib.\n" );
14 wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 ); 54 wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 );
15 wsClearWindow( appMPlayer.subWindow ); 55 wsClearWindow( appMPlayer.subWindow );
16 appMPlayer.subWindow.State=0;
17 vo_expose=1; 56 vo_expose=1;
18 return; 57 mplSubRender=0;
19 } 58 }
20 59
21 if ( mplSubRender ) 60 if ( mplSubRender )
22 { 61 {
62 printf( "------> redraw video.\n" );
23 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); 63 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
24 wsClearWindow( appMPlayer.subWindow ); 64 wsClearWindow( appMPlayer.subWindow );
25 if ( appMPlayer.sub.Bitmap.Image ) 65 if ( appMPlayer.sub.Bitmap.Image )
26 { 66 {
27 wsConvert( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Image,appMPlayer.sub.Bitmap.ImageSize ); 67 wsConvert( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Image,appMPlayer.sub.Bitmap.ImageSize );
28 wsPutImage( &appMPlayer.subWindow ); 68 wsPutImage( &appMPlayer.subWindow );
29 } 69 }
30 XFlush( wsDisplay ); 70 XFlush( wsDisplay );
31 } 71 }
72 appMPlayer.subWindow.State=0;
32 } 73 }
33 74
34 void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY ) 75 void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
35 { 76 {
77 static int mplSubMoved = 0;
78 static int oldmainisvisible = 0;
79
36 mplMouseTimer=mplMouseTimerConst; 80 mplMouseTimer=mplMouseTimerConst;
37 wsVisibleMouse( &appMPlayer.subWindow,wsShowMouseCursor ); 81 wsVisibleMouse( &appMPlayer.subWindow,wsShowMouseCursor );
38 82
39 switch( Button ) 83 switch( Button )
40 { 84 {
44 break; 88 break;
45 case wsRRMouseButton: 89 case wsRRMouseButton:
46 mplHideMenu( RX,RY ); 90 mplHideMenu( RX,RY );
47 msButton=0; 91 msButton=0;
48 break; 92 break;
93 // ---
49 case wsPLMouseButton: 94 case wsPLMouseButton:
95 oldmainisvisible=VisibleMainWindow();
96 printf( "----> %d %d\n",mainisvisible1,mainisvisible2 );
97 //=mainisvisible;
50 sx=X; sy=Y; 98 sx=X; sy=Y;
51 msButton=wsPLMouseButton; 99 msButton=wsPLMouseButton;
52 mplSubMoved=0; 100 mplSubMoved=0;
53 break; 101 break;
54 case wsMoveMouse: 102 case wsMoveMouse:
63 mplMouseTimer=mplMouseTimerConst; 111 mplMouseTimer=mplMouseTimerConst;
64 break; 112 break;
65 } 113 }
66 break; 114 break;
67 case wsRLMouseButton: 115 case wsRLMouseButton:
68 if ( !mplSubMoved ) 116 if ( ( !mplSubMoved )&&
117 ( appMPlayer.subWindow.isFullScreen )&&
118 ( !VisibleMainWindow() ) )
69 { 119 {
70 wsMoveTopWindow( &appMPlayer.mainWindow ); 120 wsMoveTopWindow( &appMPlayer.mainWindow );
121 // else wsMoveTopWindow( &appMPlayer.mainWindow );
71 } 122 }
72 msButton=0; 123 msButton=0;
73 mplSubMoved=0; 124 mplSubMoved=0;
74 break; 125 break;
75 } 126 }
76 } 127 }
77
78 //void mplSubResizeHandle( unsigned int X,unsigned int Y,unsigned int width,unsigned int height )
79 //{ mplResize( X,Y,width,height ); }