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