Mercurial > mplayer.hg
annotate Gui/mplayer/sw.c @ 8674:93212da0032e
10l memory leak + bug fixes in ms to sample time conversion
author | anders |
---|---|
date | Tue, 31 Dec 2002 05:42:20 +0000 |
parents | 9246adcf95f0 |
children | b8c271750450 |
rev | line source |
---|---|
1693 | 1 |
2 // sub window | |
3 | |
8055 | 4 #include "../app.h" |
5 #include "../interface.h" | |
6 #include "../../help_mp.h" | |
7 #include "widgets.h" | |
8 | |
6794 | 9 int mplSubRender = 0; |
1852 | 10 int SubVisible = 0; |
1812 | 11 |
8055 | 12 extern int boxMoved; |
13 extern int sx,sy; | |
14 extern int i,pot; | |
15 | |
8058 | 16 void mplSubDraw( void ) |
1693 | 17 { |
5919 | 18 if ( appMPlayer.subWindow.State == wsWindowClosed ) exit_player( MSGTR_Exit_quit ); |
19 | |
2045 | 20 if ( appMPlayer.subWindow.State == wsWindowFocusIn ) SubVisible++; |
6622
da08877b9512
fix window hiding bug with some wms (kde, gnome, icewm, mwm, wmaker)
pontscho
parents:
6619
diff
changeset
|
21 if ( appMPlayer.subWindow.State == wsWindowFocusOut && wsWMType != wsWMKDE && wsWMType != wsWMIceWM ) SubVisible--; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2045
diff
changeset
|
22 |
1852 | 23 if ( !appMPlayer.subWindow.Mapped || |
24 appMPlayer.subWindow.Visible == wsWindowNotVisible ) return; | |
1823 | 25 |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
26 if ( guiIntfStruct.Playing ) mplSubRender=0; |
1693 | 27 |
6794 | 28 if ( mplSubRender && appMPlayer.subWindow.State == wsWindowExpose ) |
1693 | 29 { |
2029 | 30 if ( appMPlayer.sub.Bitmap.Image ) wsPutImage( &appMPlayer.subWindow ); |
1693 | 31 } |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2045
diff
changeset
|
32 appMPlayer.subWindow.State=0; |
1693 | 33 } |
34 | |
35 void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY ) | |
36 { | |
1812 | 37 static int mplSubMoved = 0; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2045
diff
changeset
|
38 static int msButton = 0; |
1812 | 39 |
1693 | 40 switch( Button ) |
41 { | |
6651 | 42 case wsPRMouseButton: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
43 gtkShow( evShowPopUpMenu,NULL ); |
2980 | 44 break; |
6651 | 45 case wsPMMouseButton: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
46 gtkShow( evHidePopUpMenu,NULL ); |
1693 | 47 mplShowMenu( RX,RY ); |
6651 | 48 msButton=wsPMMouseButton; |
1693 | 49 break; |
6651 | 50 case wsRMMouseButton: |
5919 | 51 mplHideMenu( RX,RY,1 ); |
1693 | 52 msButton=0; |
53 break; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2045
diff
changeset
|
54 // --- |
1693 | 55 case wsPLMouseButton: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
56 gtkShow( evHidePopUpMenu,NULL ); |
1693 | 57 sx=X; sy=Y; |
58 msButton=wsPLMouseButton; | |
59 mplSubMoved=0; | |
60 break; | |
61 case wsMoveMouse: | |
62 switch ( msButton ) | |
63 { | |
64 case wsPLMouseButton: | |
65 mplSubMoved=1; | |
2854 | 66 if ( !appMPlayer.subWindow.isFullScreen ) wsMoveWindow( &appMPlayer.subWindow,False,RX - sx,RY - sy ); |
1693 | 67 break; |
6651 | 68 case wsPMMouseButton: |
1693 | 69 mplMenuMouseHandle( X,Y,RX,RY ); |
70 break; | |
71 } | |
72 break; | |
73 case wsRLMouseButton: | |
5997
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
74 if ( ( !mplSubMoved )&&( appMPlayer.subWindow.isFullScreen ) ) |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2045
diff
changeset
|
75 { |
6146 | 76 if( SubVisible++%2 ) wsMoveTopWindow( wsDisplay,appMPlayer.mainWindow.WindowID ); |
6622
da08877b9512
fix window hiding bug with some wms (kde, gnome, icewm, mwm, wmaker)
pontscho
parents:
6619
diff
changeset
|
77 else if ( wsWMType != wsWMNetWM && wsWMType != wsWMKDE ) wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID ); |
6623 | 78 } |
1693 | 79 msButton=0; |
80 mplSubMoved=0; | |
81 break; | |
82 } | |
83 } |