Mercurial > mplayer.hg
annotate gui/mplayer/sw.c @ 33389:2672587086ad
Add MNG output support.
Patch by Stefan Schuermans, stefan blinkenarea dot org.
author | cboesch |
---|---|
date | Sat, 21 May 2011 15:04:50 +0000 |
parents | 5f527a9a9521 |
children | c5a19bbeac2b |
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 |
23305
22d3d12c6dfb
Include string.h for memcpy, fastmemcpy.h alone is not enough.
reimar
parents:
23154
diff
changeset
|
21 #include <string.h> |
23077 | 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 | 26 #include "mp_core.h" |
23077 | 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 | 31 #include "widgets.h" |
32 | |
33 int mplSubRender = 0; | |
34 int SubVisible = 0; | |
35 | |
36 void mplSubDraw( void ) | |
37 { | |
33263 | 38 if ( appMPlayer.subWindow.State == wsWindowClosed ) guiExit( EXIT_QUIT ); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
39 |
23077 | 40 if ( appMPlayer.subWindow.State == wsWindowFocusIn ) SubVisible++; |
41 if ( appMPlayer.subWindow.State == wsWindowFocusOut && metacity_hack != 3 ) SubVisible--; | |
42 | |
43 if ( !appMPlayer.subWindow.Mapped || | |
44 appMPlayer.subWindow.Visible == wsWindowNotVisible ) return; | |
45 | |
46 if ( guiIntfStruct.Playing ) mplSubRender=0; | |
47 | |
48 if ( mplSubRender && appMPlayer.subWindow.State == wsWindowExpose ) | |
49 { | |
50 if ( appMPlayer.sub.Bitmap.Image ) wsPutImage( &appMPlayer.subWindow ); | |
51 } | |
52 appMPlayer.subWindow.State=0; | |
53 } | |
54 | |
55 void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY ) | |
56 { | |
57 static int mplSubMoved = 0; | |
58 static int msButton = 0; | |
59 | |
60 mplPBShow( X,Y ); | |
61 | |
62 switch( Button ) | |
63 { | |
64 case wsRRMouseButton: | |
65 gtkShow( evShowPopUpMenu,NULL ); | |
66 break; | |
67 case wsPMMouseButton: | |
68 gtkShow( evHidePopUpMenu,NULL ); | |
69 mplShowMenu( RX,RY ); | |
70 msButton=wsPMMouseButton; | |
71 break; | |
72 case wsRMMouseButton: | |
73 mplHideMenu( RX,RY,1 ); | |
74 msButton=0; | |
75 break; | |
76 // --- | |
77 case wsPLMouseButton: | |
78 gtkShow( evHidePopUpMenu,NULL ); | |
79 sx=X; sy=Y; | |
80 msButton=wsPLMouseButton; | |
81 mplSubMoved=0; | |
82 break; | |
83 case wsMoveMouse: | |
84 switch ( msButton ) | |
85 { | |
86 case wsPLMouseButton: | |
87 mplSubMoved=1; | |
88 if ( !appMPlayer.subWindow.isFullScreen ) wsMoveWindow( &appMPlayer.subWindow,False,RX - sx,RY - sy ); | |
89 break; | |
90 case wsPMMouseButton: | |
91 mplMenuMouseHandle( X,Y,RX,RY ); | |
92 break; | |
93 default: mplPBShow( X,Y ); break; | |
94 } | |
95 break; | |
96 case wsRLMouseButton: | |
97 if ( ( !mplSubMoved )&&( appMPlayer.subWindow.isFullScreen ) ) | |
98 { | |
99 if( SubVisible++%2 ) wsMoveTopWindow( wsDisplay,appMPlayer.mainWindow.WindowID ); | |
100 else wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID ); | |
101 } | |
102 msButton=0; | |
103 mplSubMoved=0; | |
104 break; | |
105 } | |
106 } |