Mercurial > mplayer.hg
annotate gui/mplayer/sw.c @ 23305:22d3d12c6dfb
Include string.h for memcpy, fastmemcpy.h alone is not enough.
author | reimar |
---|---|
date | Wed, 16 May 2007 21:45:46 +0000 |
parents | e564b9cd7290 |
children | 8b61dc798f48 |
rev | line source |
---|---|
23077 | 1 |
2 // sub window | |
3 | |
4 #include <inttypes.h> | |
23305
22d3d12c6dfb
Include string.h for memcpy, fastmemcpy.h alone is not enough.
reimar
parents:
23154
diff
changeset
|
5 #include <string.h> |
23077 | 6 |
7 #include "../config.h" | |
8 #include "../libvo/x11_common.h" | |
9 #include "../libvo/fastmemcpy.h" | |
10 | |
23154
e564b9cd7290
Fix several implicit declarations of functions warnings.
diego
parents:
23077
diff
changeset
|
11 #include "gmplayer.h" |
23077 | 12 #include "app.h" |
13 #include "interface.h" | |
14 #include "../help_mp.h" | |
15 #include "widgets.h" | |
16 | |
17 int mplSubRender = 0; | |
18 int SubVisible = 0; | |
19 | |
20 extern int boxMoved; | |
21 extern int sx,sy; | |
22 extern int i,pot; | |
23 | |
24 void mplSubDraw( void ) | |
25 { | |
26 if ( appMPlayer.subWindow.State == wsWindowClosed ) exit_player( MSGTR_Exit_quit ); | |
27 | |
28 if ( appMPlayer.subWindow.State == wsWindowFocusIn ) SubVisible++; | |
29 if ( appMPlayer.subWindow.State == wsWindowFocusOut && metacity_hack != 3 ) SubVisible--; | |
30 | |
31 if ( !appMPlayer.subWindow.Mapped || | |
32 appMPlayer.subWindow.Visible == wsWindowNotVisible ) return; | |
33 | |
34 if ( guiIntfStruct.Playing ) mplSubRender=0; | |
35 | |
36 if ( mplSubRender && appMPlayer.subWindow.State == wsWindowExpose ) | |
37 { | |
38 if ( appMPlayer.sub.Bitmap.Image ) wsPutImage( &appMPlayer.subWindow ); | |
39 } | |
40 appMPlayer.subWindow.State=0; | |
41 } | |
42 | |
43 void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY ) | |
44 { | |
45 static int mplSubMoved = 0; | |
46 static int msButton = 0; | |
47 | |
48 mplPBShow( X,Y ); | |
49 | |
50 switch( Button ) | |
51 { | |
52 case wsRRMouseButton: | |
53 gtkShow( evShowPopUpMenu,NULL ); | |
54 break; | |
55 case wsPMMouseButton: | |
56 gtkShow( evHidePopUpMenu,NULL ); | |
57 mplShowMenu( RX,RY ); | |
58 msButton=wsPMMouseButton; | |
59 break; | |
60 case wsRMMouseButton: | |
61 mplHideMenu( RX,RY,1 ); | |
62 msButton=0; | |
63 break; | |
64 // --- | |
65 case wsPLMouseButton: | |
66 gtkShow( evHidePopUpMenu,NULL ); | |
67 sx=X; sy=Y; | |
68 msButton=wsPLMouseButton; | |
69 mplSubMoved=0; | |
70 break; | |
71 case wsMoveMouse: | |
72 switch ( msButton ) | |
73 { | |
74 case wsPLMouseButton: | |
75 mplSubMoved=1; | |
76 if ( !appMPlayer.subWindow.isFullScreen ) wsMoveWindow( &appMPlayer.subWindow,False,RX - sx,RY - sy ); | |
77 break; | |
78 case wsPMMouseButton: | |
79 mplMenuMouseHandle( X,Y,RX,RY ); | |
80 break; | |
81 default: mplPBShow( X,Y ); break; | |
82 } | |
83 break; | |
84 case wsRLMouseButton: | |
85 if ( ( !mplSubMoved )&&( appMPlayer.subWindow.isFullScreen ) ) | |
86 { | |
87 if( SubVisible++%2 ) wsMoveTopWindow( wsDisplay,appMPlayer.mainWindow.WindowID ); | |
88 else wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID ); | |
89 } | |
90 msButton=0; | |
91 mplSubMoved=0; | |
92 break; | |
93 } | |
94 } |