Mercurial > mplayer.hg
annotate gui/ui/video.c @ 35532:4eedc654175d
Fix a wrong condition.
author | upsuper |
---|---|
date | Sun, 09 Dec 2012 02:22:08 +0000 |
parents | 8ad4d2fb46e8 |
children | 75c26c61fd3c |
rev | line source |
---|---|
34697 | 1 /* |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License along | |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
17 */ | |
18 | |
34699
ed0e00db4306
Cosmetic: Move, change and add some comments on GUI windows.
ib
parents:
34697
diff
changeset
|
19 /* video window */ |
ed0e00db4306
Cosmetic: Move, change and add some comments on GUI windows.
ib
parents:
34697
diff
changeset
|
20 |
34697 | 21 #include <string.h> |
22 | |
23 #include "libvo/x11_common.h" | |
24 #include "help_mp.h" | |
25 #include "mp_core.h" | |
26 | |
35528 | 27 #include "ui.h" |
35525 | 28 #include "gui/app/app.h" |
29 #include "gui/app/gui.h" | |
34697 | 30 #include "gui/interface.h" |
35529 | 31 #include "gui/dialog/dialog.h" |
34697 | 32 |
35493 | 33 int uiVideoRender = False; |
34697 | 34 int videoVisible = 0; |
35 | |
36 void uiVideoDraw( void ) | |
37 { | |
38 if ( guiApp.videoWindow.State == wsWindowClosed ) mplayer( MPLAYER_EXIT_GUI, EXIT_QUIT, 0 ); | |
39 | |
40 if ( guiApp.videoWindow.State == wsWindowFocusIn ) videoVisible++; | |
41 if ( guiApp.videoWindow.State == wsWindowFocusOut && metacity_hack != 3 ) videoVisible--; | |
42 | |
43 if ( !guiApp.videoWindow.Mapped || | |
44 guiApp.videoWindow.Visible == wsWindowNotVisible ) return; | |
45 | |
35493 | 46 if ( guiInfo.Playing ) uiVideoRender=False; |
34697 | 47 |
48 if ( uiVideoRender && guiApp.videoWindow.State == wsWindowExpose ) | |
49 { | |
50 if ( guiApp.video.Bitmap.Image ) wsPutImage( &guiApp.videoWindow ); | |
51 } | |
52 guiApp.videoWindow.State=0; | |
53 } | |
54 | |
55 void uiVideoMouseHandle( int Button,int X,int Y,int RX,int RY ) | |
56 { | |
57 static int mplVideoMoved = 0; | |
58 static int msButton = 0; | |
59 | |
60 uiPlaybarShow( Y ); | |
61 | |
62 switch( Button ) | |
63 { | |
64 case wsRRMouseButton: | |
65 gtkShow( ivShowPopUpMenu,NULL ); | |
66 break; | |
67 case wsPMMouseButton: | |
68 gtkShow( ivHidePopUpMenu,NULL ); | |
69 uiShowMenu( RX,RY ); | |
70 msButton=wsPMMouseButton; | |
71 break; | |
72 case wsRMMouseButton: | |
73 uiHideMenu( RX,RY,1 ); | |
74 msButton=0; | |
75 break; | |
76 /* --- */ | |
77 case wsPLMouseButton: | |
78 gtkShow( ivHidePopUpMenu,NULL ); | |
79 sx=X; sy=Y; | |
80 msButton=wsPLMouseButton; | |
81 mplVideoMoved=0; | |
82 break; | |
83 case wsMoveMouse: | |
84 switch ( msButton ) | |
85 { | |
86 case wsPLMouseButton: | |
87 mplVideoMoved=1; | |
88 if ( !guiApp.videoWindow.isFullScreen ) | |
89 { | |
90 wsMoveWindow( &guiApp.videoWindow,True,RX - sx,RY - sy ); | |
91 guiApp.video.x = guiApp.videoWindow.X; | |
92 guiApp.video.y = guiApp.videoWindow.Y; | |
93 // NOTE TO MYSELF: dragging the title bar goes unnoticed? | |
94 } | |
95 break; | |
96 case wsPMMouseButton: | |
97 uiMenuMouseHandle( RX,RY ); | |
98 break; | |
99 default: uiPlaybarShow( Y ); break; | |
100 } | |
101 break; | |
102 case wsRLMouseButton: | |
103 if ( ( !mplVideoMoved )&&( guiApp.videoWindow.isFullScreen ) ) | |
104 { | |
105 if( videoVisible++%2 ) wsRaiseWindowTop( wsDisplay,guiApp.mainWindow.WindowID ); | |
106 else wsRaiseWindowTop( wsDisplay,guiApp.videoWindow.WindowID ); | |
107 } | |
108 msButton=0; | |
109 mplVideoMoved=0; | |
110 break; | |
111 } | |
112 } |