Mercurial > mplayer.hg
annotate gui/mplayer/sw.c @ 28590:d1ca19ff9b52
100l, reset ass_border when switching out of fullscreen mode.
author | reimar |
---|---|
date | Tue, 17 Feb 2009 08:05:14 +0000 |
parents | b0a7b35b78d2 |
children | 0f1b5b68af32 |
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" |
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 extern int boxMoved; | |
37 extern int sx,sy; | |
38 extern int i,pot; | |
39 | |
40 void mplSubDraw( void ) | |
41 { | |
42 if ( appMPlayer.subWindow.State == wsWindowClosed ) exit_player( MSGTR_Exit_quit ); | |
43 | |
44 if ( appMPlayer.subWindow.State == wsWindowFocusIn ) SubVisible++; | |
45 if ( appMPlayer.subWindow.State == wsWindowFocusOut && metacity_hack != 3 ) SubVisible--; | |
46 | |
47 if ( !appMPlayer.subWindow.Mapped || | |
48 appMPlayer.subWindow.Visible == wsWindowNotVisible ) return; | |
49 | |
50 if ( guiIntfStruct.Playing ) mplSubRender=0; | |
51 | |
52 if ( mplSubRender && appMPlayer.subWindow.State == wsWindowExpose ) | |
53 { | |
54 if ( appMPlayer.sub.Bitmap.Image ) wsPutImage( &appMPlayer.subWindow ); | |
55 } | |
56 appMPlayer.subWindow.State=0; | |
57 } | |
58 | |
59 void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY ) | |
60 { | |
61 static int mplSubMoved = 0; | |
62 static int msButton = 0; | |
63 | |
64 mplPBShow( X,Y ); | |
65 | |
66 switch( Button ) | |
67 { | |
68 case wsRRMouseButton: | |
69 gtkShow( evShowPopUpMenu,NULL ); | |
70 break; | |
71 case wsPMMouseButton: | |
72 gtkShow( evHidePopUpMenu,NULL ); | |
73 mplShowMenu( RX,RY ); | |
74 msButton=wsPMMouseButton; | |
75 break; | |
76 case wsRMMouseButton: | |
77 mplHideMenu( RX,RY,1 ); | |
78 msButton=0; | |
79 break; | |
80 // --- | |
81 case wsPLMouseButton: | |
82 gtkShow( evHidePopUpMenu,NULL ); | |
83 sx=X; sy=Y; | |
84 msButton=wsPLMouseButton; | |
85 mplSubMoved=0; | |
86 break; | |
87 case wsMoveMouse: | |
88 switch ( msButton ) | |
89 { | |
90 case wsPLMouseButton: | |
91 mplSubMoved=1; | |
92 if ( !appMPlayer.subWindow.isFullScreen ) wsMoveWindow( &appMPlayer.subWindow,False,RX - sx,RY - sy ); | |
93 break; | |
94 case wsPMMouseButton: | |
95 mplMenuMouseHandle( X,Y,RX,RY ); | |
96 break; | |
97 default: mplPBShow( X,Y ); break; | |
98 } | |
99 break; | |
100 case wsRLMouseButton: | |
101 if ( ( !mplSubMoved )&&( appMPlayer.subWindow.isFullScreen ) ) | |
102 { | |
103 if( SubVisible++%2 ) wsMoveTopWindow( wsDisplay,appMPlayer.mainWindow.WindowID ); | |
104 else wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID ); | |
105 } | |
106 msButton=0; | |
107 mplSubMoved=0; | |
108 break; | |
109 } | |
110 } |