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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
1 /*
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
2 * This file is part of MPlayer.
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
3 *
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
7 * (at your option) any later version.
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
8 *
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
12 * GNU General Public License for more details.
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
13 *
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License along
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
17 */
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
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
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
21 #include <string.h>
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
22
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
23 #include "libvo/x11_common.h"
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
24 #include "help_mp.h"
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
25 #include "mp_core.h"
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
26
35528
ab07b17fddfb Rebuild GUI directory structure.
ib
parents: 35525
diff changeset
27 #include "ui.h"
35525
e27855a45128 Rebuild GUI directory structure.
ib
parents: 35493
diff changeset
28 #include "gui/app/app.h"
e27855a45128 Rebuild GUI directory structure.
ib
parents: 35493
diff changeset
29 #include "gui/app/gui.h"
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
30 #include "gui/interface.h"
35529
8ad4d2fb46e8 Rebuild GUI directory structure.
ib
parents: 35528
diff changeset
31 #include "gui/dialog/dialog.h"
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
32
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
33 int videoVisible = 0;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
34
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
35 void uiVideoDraw( void )
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
36 {
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
37 if ( guiApp.videoWindow.State == wsWindowClosed ) mplayer( MPLAYER_EXIT_GUI, EXIT_QUIT, 0 );
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
38
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
39 if ( guiApp.videoWindow.State == wsWindowFocusIn ) videoVisible++;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
40 if ( guiApp.videoWindow.State == wsWindowFocusOut && metacity_hack != 3 ) videoVisible--;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
41
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
42 if ( !guiApp.videoWindow.Mapped ||
35757
b1d32b46514e Get rid of uiVideoRender.
ib
parents: 35751
diff changeset
43 guiApp.videoWindow.Visible == wsWindowNotVisible ||
b1d32b46514e Get rid of uiVideoRender.
ib
parents: 35751
diff changeset
44 guiInfo.Playing) return;
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
45
35757
b1d32b46514e Get rid of uiVideoRender.
ib
parents: 35751
diff changeset
46 if ( guiApp.videoWindow.State == wsWindowExpose )
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
47 {
35739
6b82e3079aea Remove unnecessary wsWindowBackground() calls.
ib
parents: 35681
diff changeset
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
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
50 }
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
51 }
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
52
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
53 void uiVideoMouseHandle( int Button,int X,int Y,int RX,int RY )
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
54 {
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
55 static int mplVideoMoved = 0;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
56 static int msButton = 0;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
57
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
58 uiPlaybarShow( Y );
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
59
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
60 switch( Button )
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
61 {
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
62 case wsRRMouseButton:
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
63 gtkShow( ivShowPopUpMenu,NULL );
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
64 break;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
65 case wsPMMouseButton:
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
66 gtkShow( ivHidePopUpMenu,NULL );
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
67 uiShowMenu( RX,RY );
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
68 msButton=wsPMMouseButton;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
69 break;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
70 case wsRMMouseButton:
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
71 uiHideMenu( RX,RY,1 );
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
72 msButton=0;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
73 break;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
74 /* --- */
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
75 case wsPLMouseButton:
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
76 gtkShow( ivHidePopUpMenu,NULL );
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
77 sx=X; sy=Y;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
78 msButton=wsPLMouseButton;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
79 mplVideoMoved=0;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
80 break;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
81 case wsMoveMouse:
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
82 switch ( msButton )
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
83 {
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
84 case wsPLMouseButton:
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
85 mplVideoMoved=1;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
86 if ( !guiApp.videoWindow.isFullScreen )
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
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
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
89 }
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
90 break;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
91 case wsPMMouseButton:
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
92 uiMenuMouseHandle( RX,RY );
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
93 break;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
94 default: uiPlaybarShow( Y ); break;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
95 }
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
96 break;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
97 case wsRLMouseButton:
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
98 if ( ( !mplVideoMoved )&&( guiApp.videoWindow.isFullScreen ) )
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
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
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
103 }
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
104 msButton=0;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
105 mplVideoMoved=0;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
106 break;
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
107 }
ac6b38cd0d45 Rename sub window video window.
ib
parents:
diff changeset
108 }