Mercurial > mplayer.hg
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 |
rev | line source |
---|---|
26458 | 1 /* |
2 * sub window | |
3 * | |
4 * This file is part of MPlayer. | |
5 * | |
6 * MPlayer is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * MPlayer is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License along | |
17 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
19 */ | |
23077 | 20 |
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 | 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 | 27 #include "mp_core.h" |
23077 | 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 | 32 #include "widgets.h" |
33 | |
34 int mplSubRender = 0; | |
35 int SubVisible = 0; | |
36 | |
37 extern int boxMoved; | |
38 extern int sx,sy; | |
39 extern int i,pot; | |
40 | |
41 void mplSubDraw( void ) | |
42 { | |
30516 | 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 | 45 if ( appMPlayer.subWindow.State == wsWindowFocusIn ) SubVisible++; |
46 if ( appMPlayer.subWindow.State == wsWindowFocusOut && metacity_hack != 3 ) SubVisible--; | |
47 | |
48 if ( !appMPlayer.subWindow.Mapped || | |
49 appMPlayer.subWindow.Visible == wsWindowNotVisible ) return; | |
50 | |
51 if ( guiIntfStruct.Playing ) mplSubRender=0; | |
52 | |
53 if ( mplSubRender && appMPlayer.subWindow.State == wsWindowExpose ) | |
54 { | |
55 if ( appMPlayer.sub.Bitmap.Image ) wsPutImage( &appMPlayer.subWindow ); | |
56 } | |
57 appMPlayer.subWindow.State=0; | |
58 } | |
59 | |
60 void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY ) | |
61 { | |
62 static int mplSubMoved = 0; | |
63 static int msButton = 0; | |
64 | |
65 mplPBShow( X,Y ); | |
66 | |
67 switch( Button ) | |
68 { | |
69 case wsRRMouseButton: | |
70 gtkShow( evShowPopUpMenu,NULL ); | |
71 break; | |
72 case wsPMMouseButton: | |
73 gtkShow( evHidePopUpMenu,NULL ); | |
74 mplShowMenu( RX,RY ); | |
75 msButton=wsPMMouseButton; | |
76 break; | |
77 case wsRMMouseButton: | |
78 mplHideMenu( RX,RY,1 ); | |
79 msButton=0; | |
80 break; | |
81 // --- | |
82 case wsPLMouseButton: | |
83 gtkShow( evHidePopUpMenu,NULL ); | |
84 sx=X; sy=Y; | |
85 msButton=wsPLMouseButton; | |
86 mplSubMoved=0; | |
87 break; | |
88 case wsMoveMouse: | |
89 switch ( msButton ) | |
90 { | |
91 case wsPLMouseButton: | |
92 mplSubMoved=1; | |
93 if ( !appMPlayer.subWindow.isFullScreen ) wsMoveWindow( &appMPlayer.subWindow,False,RX - sx,RY - sy ); | |
94 break; | |
95 case wsPMMouseButton: | |
96 mplMenuMouseHandle( X,Y,RX,RY ); | |
97 break; | |
98 default: mplPBShow( X,Y ); break; | |
99 } | |
100 break; | |
101 case wsRLMouseButton: | |
102 if ( ( !mplSubMoved )&&( appMPlayer.subWindow.isFullScreen ) ) | |
103 { | |
104 if( SubVisible++%2 ) wsMoveTopWindow( wsDisplay,appMPlayer.mainWindow.WindowID ); | |
105 else wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID ); | |
106 } | |
107 msButton=0; | |
108 mplSubMoved=0; | |
109 break; | |
110 } | |
111 } |