Mercurial > mplayer.hg
annotate gui/mplayer/sw.c @ 32920:8661ae44ef39
Redefine button states.
This allows a button state initialized all-bits-zero to automatically
be disabled.
(It was intended to be a purely cosmetic patch, but it turned out
that there was a direct dependency between the value of the #defines
and the layout of the skin images. This dependency is now eliminated.)
author | ib |
---|---|
date | Thu, 03 Mar 2011 11:06:42 +0000 |
parents | 319ae9dc51a2 |
children | 9566100d88a1 |
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 void mplSubDraw( void ) | |
38 { | |
30516 | 39 if ( appMPlayer.subWindow.State == wsWindowClosed ) exit_player( EXIT_QUIT ); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
40 |
23077 | 41 if ( appMPlayer.subWindow.State == wsWindowFocusIn ) SubVisible++; |
42 if ( appMPlayer.subWindow.State == wsWindowFocusOut && metacity_hack != 3 ) SubVisible--; | |
43 | |
44 if ( !appMPlayer.subWindow.Mapped || | |
45 appMPlayer.subWindow.Visible == wsWindowNotVisible ) return; | |
46 | |
47 if ( guiIntfStruct.Playing ) mplSubRender=0; | |
48 | |
49 if ( mplSubRender && appMPlayer.subWindow.State == wsWindowExpose ) | |
50 { | |
51 if ( appMPlayer.sub.Bitmap.Image ) wsPutImage( &appMPlayer.subWindow ); | |
52 } | |
53 appMPlayer.subWindow.State=0; | |
54 } | |
55 | |
56 void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY ) | |
57 { | |
58 static int mplSubMoved = 0; | |
59 static int msButton = 0; | |
60 | |
61 mplPBShow( X,Y ); | |
62 | |
63 switch( Button ) | |
64 { | |
65 case wsRRMouseButton: | |
66 gtkShow( evShowPopUpMenu,NULL ); | |
67 break; | |
68 case wsPMMouseButton: | |
69 gtkShow( evHidePopUpMenu,NULL ); | |
70 mplShowMenu( RX,RY ); | |
71 msButton=wsPMMouseButton; | |
72 break; | |
73 case wsRMMouseButton: | |
74 mplHideMenu( RX,RY,1 ); | |
75 msButton=0; | |
76 break; | |
77 // --- | |
78 case wsPLMouseButton: | |
79 gtkShow( evHidePopUpMenu,NULL ); | |
80 sx=X; sy=Y; | |
81 msButton=wsPLMouseButton; | |
82 mplSubMoved=0; | |
83 break; | |
84 case wsMoveMouse: | |
85 switch ( msButton ) | |
86 { | |
87 case wsPLMouseButton: | |
88 mplSubMoved=1; | |
89 if ( !appMPlayer.subWindow.isFullScreen ) wsMoveWindow( &appMPlayer.subWindow,False,RX - sx,RY - sy ); | |
90 break; | |
91 case wsPMMouseButton: | |
92 mplMenuMouseHandle( X,Y,RX,RY ); | |
93 break; | |
94 default: mplPBShow( X,Y ); break; | |
95 } | |
96 break; | |
97 case wsRLMouseButton: | |
98 if ( ( !mplSubMoved )&&( appMPlayer.subWindow.isFullScreen ) ) | |
99 { | |
100 if( SubVisible++%2 ) wsMoveTopWindow( wsDisplay,appMPlayer.mainWindow.WindowID ); | |
101 else wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID ); | |
102 } | |
103 msButton=0; | |
104 mplSubMoved=0; | |
105 break; | |
106 } | |
107 } |