annotate gui/ui/sub.c @ 33836:99982afd6dc5

dec_video: drop some unnecessary casts
author diego
date Mon, 25 Jul 2011 23:30:21 +0000
parents cee9987bc81d
children afede91f9d5f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26458
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
1 /*
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
2 * sub window
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
3 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
4 * This file is part of MPlayer.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
5 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
6 * MPlayer is free software; you can redistribute it and/or modify
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
7 * it under the terms of the GNU General Public License as published by
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
9 * (at your option) any later version.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
10 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
11 * MPlayer is distributed in the hope that it will be useful,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
14 * GNU General Public License for more details.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
15 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
16 * You should have received a copy of the GNU General Public License along
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
17 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
19 */
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
20
23305
22d3d12c6dfb Include string.h for memcpy, fastmemcpy.h alone is not enough.
reimar
parents: 23154
diff changeset
21 #include <string.h>
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
22
26382
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
23 #include "config.h"
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
24 #include "libvo/x11_common.h"
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
25 #include "help_mp.h"
30516
f4e017b6921a Fix exit_player() usage throughout the codebase.
diego
parents: 29263
diff changeset
26 #include "mp_core.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
27
23154
e564b9cd7290 Fix several implicit declarations of functions warnings.
diego
parents: 23077
diff changeset
28 #include "gmplayer.h"
26365
10dfbc523184 Add gui/ prefix to some #include paths so that compilation from the
diego
parents: 23374
diff changeset
29 #include "gui/app.h"
10dfbc523184 Add gui/ prefix to some #include paths so that compilation from the
diego
parents: 23374
diff changeset
30 #include "gui/interface.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
31 #include "widgets.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
32
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
33 int uiSubRender = 0;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
34 int subVisible = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
35
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
36 void uiSubDraw( void )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
37 {
33768
cee9987bc81d Remove guiExit().
ib
parents: 33556
diff changeset
38 if ( guiApp.subWindow.State == wsWindowClosed ) mplayer( MPLAYER_EXIT_GUI, EXIT_QUIT, 0 );
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26458
diff changeset
39
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
40 if ( guiApp.subWindow.State == wsWindowFocusIn ) subVisible++;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
41 if ( guiApp.subWindow.State == wsWindowFocusOut && metacity_hack != 3 ) subVisible--;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
42
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
43 if ( !guiApp.subWindow.Mapped ||
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
44 guiApp.subWindow.Visible == wsWindowNotVisible ) return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
45
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
46 if ( guiInfo.Playing ) uiSubRender=0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
47
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
48 if ( uiSubRender && guiApp.subWindow.State == wsWindowExpose )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
49 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
50 if ( guiApp.sub.Bitmap.Image ) wsPutImage( &guiApp.subWindow );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
51 }
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
52 guiApp.subWindow.State=0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
53 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
54
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
55 void uiSubMouseHandle( int Button,int X,int Y,int RX,int RY )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
56 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
57 static int mplSubMoved = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
58 static int msButton = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
59
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
60 uiPlaybarShow( X,Y );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
61
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
62 switch( Button )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
63 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
64 case wsRRMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
65 gtkShow( evShowPopUpMenu,NULL );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
66 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
67 case wsPMMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
68 gtkShow( evHidePopUpMenu,NULL );
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
69 uiShowMenu( RX,RY );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
70 msButton=wsPMMouseButton;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
71 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
72 case wsRMMouseButton:
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
73 uiHideMenu( RX,RY,1 );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
74 msButton=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
75 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
76 // ---
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
77 case wsPLMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
78 gtkShow( evHidePopUpMenu,NULL );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
79 sx=X; sy=Y;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
80 msButton=wsPLMouseButton;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
81 mplSubMoved=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
82 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
83 case wsMoveMouse:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
84 switch ( msButton )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
85 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
86 case wsPLMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
87 mplSubMoved=1;
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
88 if ( !guiApp.subWindow.isFullScreen ) wsMoveWindow( &guiApp.subWindow,False,RX - sx,RY - sy );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
89 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
90 case wsPMMouseButton:
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
91 uiMenuMouseHandle( X,Y,RX,RY );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
92 break;
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
93 default: uiPlaybarShow( X,Y ); break;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
94 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
95 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
96 case wsRLMouseButton:
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
97 if ( ( !mplSubMoved )&&( guiApp.subWindow.isFullScreen ) )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
98 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
99 if( subVisible++%2 ) wsMoveTopWindow( wsDisplay,guiApp.mainWindow.WindowID );
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33263
diff changeset
100 else wsMoveTopWindow( wsDisplay,guiApp.subWindow.WindowID );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
101 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
102 msButton=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
103 mplSubMoved=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
104 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
105 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
106 }