comparison Gui/mplayer/sw.h @ 1841:08f21f4cadd9

hm. clean up
author pontscho
date Sun, 02 Sep 2001 18:30:55 +0000
parents a6c67352ccac
children 58dd326fcc4a
comparison
equal deleted inserted replaced
1840:07fd7d1b8cc9 1841:08f21f4cadd9
1 1
2 // sub window 2 // sub window
3 3
4 int mplSubRender = 1; 4 int mplSubRender = 1;
5 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 return visible;
39 }
40
41 int mainisvisible1;
42 int mainisvisible2;
43 int count = 0;
44
45 void mplSubDraw( wsParamDisplay ) 6 void mplSubDraw( wsParamDisplay )
46 { 7 {
47 // mainisvisible1=VisibleMainWindow();
48 // printf( "--------> main: %d ---\n",mainisvisible1 );
49
50 8
51 // if ( ( appMPlayer.subWindow.Visible == wsWindowNotVisible )|| 9 // if ( ( appMPlayer.subWindow.Visible == wsWindowNotVisible )||
52 // ( appMPlayer.subWindow.State != wsWindowExpose ) ) return; 10 // ( appMPlayer.subWindow.State != wsWindowExpose ) ) return;
53 11
54 if ( ( mplShMem->Playing ) )//&&( appMPlayer.subWindow.State == wsWindowExpose ) ) 12 if ( ( mplShMem->Playing ) )//&&( appMPlayer.subWindow.State == wsWindowExpose ) )
68 wsPutImage( &appMPlayer.subWindow ); 26 wsPutImage( &appMPlayer.subWindow );
69 } 27 }
70 XFlush( wsDisplay ); 28 XFlush( wsDisplay );
71 } 29 }
72 appMPlayer.subWindow.State=0; 30 appMPlayer.subWindow.State=0;
73 // mainis=0;
74 } 31 }
75 32
76 void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY ) 33 void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
77 { 34 {
78 static int mplSubMoved = 0; 35 static int mplSubMoved = 0;
79 static int oldmainisvisible = 0;
80 36
81 mplMouseTimer=mplMouseTimerConst; 37 mplMouseTimer=mplMouseTimerConst;
82 wsVisibleMouse( &appMPlayer.subWindow,wsShowMouseCursor ); 38 wsVisibleMouse( &appMPlayer.subWindow,wsShowMouseCursor );
83 39
84 switch( Button ) 40 switch( Button )
91 mplHideMenu( RX,RY ); 47 mplHideMenu( RX,RY );
92 msButton=0; 48 msButton=0;
93 break; 49 break;
94 // --- 50 // ---
95 case wsPLMouseButton: 51 case wsPLMouseButton:
96 //mainis=0;
97 sx=X; sy=Y; 52 sx=X; sy=Y;
98 msButton=wsPLMouseButton; 53 msButton=wsPLMouseButton;
99 mplSubMoved=0; 54 mplSubMoved=0;
100 break; 55 break;
101 case wsMoveMouse: 56 case wsMoveMouse:
110 mplMouseTimer=mplMouseTimerConst; 65 mplMouseTimer=mplMouseTimerConst;
111 break; 66 break;
112 } 67 }
113 break; 68 break;
114 case wsRLMouseButton: 69 case wsRLMouseButton:
115 // if ( ( appMPlayer.subWindow.Focused == 0 && appMPlayer.subWindow.OFocused == 2 ) )
116 // ( appMPlayer.mainWindow.Focused == 0 && appMPlayer.mainWindow.OFocused == 2 ) )
117 // if ( ( !mplSubMoved )&&( !appMPlayer.mainWindow.Focused ) )
118 printf( "-----> mainis: %d ---- \n",mainis );
119 if ( !mainis )
120 {
121 wsMoveTopWindow( &appMPlayer.mainWindow );
122 }
123 /*
124 if ( ( !mplSubMoved )&&
125 ( appMPlayer.subWindow.isFullScreen )&&
126 ( !VisibleMainWindow() ) )
127 {
128 wsMoveTopWindow( &appMPlayer.mainWindow );
129 // else wsMoveTopWindow( &appMPlayer.mainWindow );
130 }
131 */
132 msButton=0; 70 msButton=0;
133 mplSubMoved=0; 71 mplSubMoved=0;
134 break; 72 break;
135 } 73 }
136 } 74 }