Mercurial > mplayer.hg
annotate gui/ui/video.c @ 35757:b1d32b46514e
Get rid of uiVideoRender.
Directly use guiInfo.Playing instead.
author | ib |
---|---|
date | Thu, 24 Jan 2013 16:06:48 +0000 |
parents | 0d703832d865 |
children | 6742a91ba28a |
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 |
33 int videoVisible = 0; | |
34 | |
35 void uiVideoDraw( void ) | |
36 { | |
37 if ( guiApp.videoWindow.State == wsWindowClosed ) mplayer( MPLAYER_EXIT_GUI, EXIT_QUIT, 0 ); | |
38 | |
39 if ( guiApp.videoWindow.State == wsWindowFocusIn ) videoVisible++; | |
40 if ( guiApp.videoWindow.State == wsWindowFocusOut && metacity_hack != 3 ) videoVisible--; | |
41 | |
42 if ( !guiApp.videoWindow.Mapped || | |
35757 | 43 guiApp.videoWindow.Visible == wsWindowNotVisible || |
44 guiInfo.Playing) return; | |
34697 | 45 |
35757 | 46 if ( guiApp.videoWindow.State == wsWindowExpose ) |
34697 | 47 { |
35739 | 48 wsWindowBackground(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B); |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35664
diff
changeset
|
49 if ( guiApp.video.Bitmap.Image ) wsImageDraw( &guiApp.videoWindow ); |
34697 | 50 } |
51 } | |
52 | |
53 void uiVideoMouseHandle( int Button,int X,int Y,int RX,int RY ) | |
54 { | |
55 static int mplVideoMoved = 0; | |
56 static int msButton = 0; | |
57 | |
58 uiPlaybarShow( Y ); | |
59 | |
60 switch( Button ) | |
61 { | |
62 case wsRRMouseButton: | |
63 gtkShow( ivShowPopUpMenu,NULL ); | |
64 break; | |
65 case wsPMMouseButton: | |
66 gtkShow( ivHidePopUpMenu,NULL ); | |
67 uiShowMenu( RX,RY ); | |
68 msButton=wsPMMouseButton; | |
69 break; | |
70 case wsRMMouseButton: | |
71 uiHideMenu( RX,RY,1 ); | |
72 msButton=0; | |
73 break; | |
74 /* --- */ | |
75 case wsPLMouseButton: | |
76 gtkShow( ivHidePopUpMenu,NULL ); | |
77 sx=X; sy=Y; | |
78 msButton=wsPLMouseButton; | |
79 mplVideoMoved=0; | |
80 break; | |
81 case wsMoveMouse: | |
82 switch ( msButton ) | |
83 { | |
84 case wsPLMouseButton: | |
85 mplVideoMoved=1; | |
86 if ( !guiApp.videoWindow.isFullScreen ) | |
87 { | |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35664
diff
changeset
|
88 wsWindowMove( &guiApp.videoWindow,True,RX - sx,RY - sy ); |
34697 | 89 } |
90 break; | |
91 case wsPMMouseButton: | |
92 uiMenuMouseHandle( RX,RY ); | |
93 break; | |
94 default: uiPlaybarShow( Y ); break; | |
95 } | |
96 break; | |
97 case wsRLMouseButton: | |
98 if ( ( !mplVideoMoved )&&( guiApp.videoWindow.isFullScreen ) ) | |
99 { | |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35664
diff
changeset
|
100 // NOTE TO MYSELF: this doesn't work, fix later with wsWindowLayer()? |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35664
diff
changeset
|
101 if( videoVisible++%2 ) wsWindowRaiseTop( wsDisplay,guiApp.mainWindow.WindowID ); |
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35664
diff
changeset
|
102 else wsWindowRaiseTop( wsDisplay,guiApp.videoWindow.WindowID ); |
34697 | 103 } |
104 msButton=0; | |
105 mplVideoMoved=0; | |
106 break; | |
107 } | |
108 } |