annotate gui/mplayer/sw.c @ 31941:7ee3edf8418f

add matchware screen codec fourcc MWSC
author compn
date Fri, 27 Aug 2010 12:14:59 +0000
parents f4e017b6921a
children 1d9f646f8db3
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
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
21 #include <inttypes.h>
23305
22d3d12c6dfb Include string.h for memcpy, fastmemcpy.h alone is not enough.
reimar
parents: 23154
diff changeset
22 #include <string.h>
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
23
26382
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
24 #include "config.h"
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
25 #include "libvo/x11_common.h"
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
26 #include "help_mp.h"
30516
f4e017b6921a Fix exit_player() usage throughout the codebase.
diego
parents: 29263
diff changeset
27 #include "mp_core.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
28
23154
e564b9cd7290 Fix several implicit declarations of functions warnings.
diego
parents: 23077
diff changeset
29 #include "gmplayer.h"
26365
10dfbc523184 Add gui/ prefix to some #include paths so that compilation from the
diego
parents: 23374
diff changeset
30 #include "gui/app.h"
10dfbc523184 Add gui/ prefix to some #include paths so that compilation from the
diego
parents: 23374
diff changeset
31 #include "gui/interface.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
32 #include "widgets.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
33
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
34 int mplSubRender = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
35 int SubVisible = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
36
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
37 extern int boxMoved;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
38 extern int sx,sy;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
39 extern int i,pot;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
40
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
41 void mplSubDraw( void )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
42 {
30516
f4e017b6921a Fix exit_player() usage throughout the codebase.
diego
parents: 29263
diff changeset
43 if ( appMPlayer.subWindow.State == wsWindowClosed ) exit_player( EXIT_QUIT );
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26458
diff changeset
44
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
45 if ( appMPlayer.subWindow.State == wsWindowFocusIn ) SubVisible++;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
46 if ( appMPlayer.subWindow.State == wsWindowFocusOut && metacity_hack != 3 ) SubVisible--;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
47
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
48 if ( !appMPlayer.subWindow.Mapped ||
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
49 appMPlayer.subWindow.Visible == wsWindowNotVisible ) return;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
50
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
51 if ( guiIntfStruct.Playing ) mplSubRender=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
52
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
53 if ( mplSubRender && appMPlayer.subWindow.State == wsWindowExpose )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
54 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
55 if ( appMPlayer.sub.Bitmap.Image ) wsPutImage( &appMPlayer.subWindow );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
56 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
57 appMPlayer.subWindow.State=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
58 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
59
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
60 void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
61 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
62 static int mplSubMoved = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
63 static int msButton = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
64
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
65 mplPBShow( X,Y );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
66
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
67 switch( Button )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
68 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
69 case wsRRMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
70 gtkShow( evShowPopUpMenu,NULL );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
71 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
72 case wsPMMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
73 gtkShow( evHidePopUpMenu,NULL );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
74 mplShowMenu( RX,RY );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
75 msButton=wsPMMouseButton;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
76 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
77 case wsRMMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
78 mplHideMenu( RX,RY,1 );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
79 msButton=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
80 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
81 // ---
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
82 case wsPLMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
83 gtkShow( evHidePopUpMenu,NULL );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
84 sx=X; sy=Y;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
85 msButton=wsPLMouseButton;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
86 mplSubMoved=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
87 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
88 case wsMoveMouse:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
89 switch ( msButton )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
90 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
91 case wsPLMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
92 mplSubMoved=1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
93 if ( !appMPlayer.subWindow.isFullScreen ) wsMoveWindow( &appMPlayer.subWindow,False,RX - sx,RY - sy );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
94 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
95 case wsPMMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
96 mplMenuMouseHandle( X,Y,RX,RY );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
97 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
98 default: mplPBShow( X,Y ); break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
99 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
100 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
101 case wsRLMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
102 if ( ( !mplSubMoved )&&( appMPlayer.subWindow.isFullScreen ) )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
103 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
104 if( SubVisible++%2 ) wsMoveTopWindow( wsDisplay,appMPlayer.mainWindow.WindowID );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
105 else wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
106 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
107 msButton=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
108 mplSubMoved=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
109 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
110 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
111 }