Mercurial > mplayer.hg
annotate Gui/mplayer/sw.c @ 8055:79ddb7291765
not needed
author | pontscho |
---|---|
date | Sat, 02 Nov 2002 18:57:14 +0000 |
parents | c3d790e4c600 |
children | 9246adcf95f0 |
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 | |
16 extern void mplHideMenu( int mx,int my,int w ); | |
17 extern void mplShowMenu( int mx,int my ); | |
18 extern void mplMenuMouseHandle( int X,int Y,int RX,int RY ); | |
19 | |
1693 | 20 void mplSubDraw( wsParamDisplay ) |
21 { | |
5919 | 22 if ( appMPlayer.subWindow.State == wsWindowClosed ) exit_player( MSGTR_Exit_quit ); |
23 | |
2045 | 24 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
|
25 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
|
26 |
1852 | 27 if ( !appMPlayer.subWindow.Mapped || |
28 appMPlayer.subWindow.Visible == wsWindowNotVisible ) return; | |
1823 | 29 |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
30 if ( guiIntfStruct.Playing ) mplSubRender=0; |
1693 | 31 |
6794 | 32 if ( mplSubRender && appMPlayer.subWindow.State == wsWindowExpose ) |
1693 | 33 { |
2029 | 34 if ( appMPlayer.sub.Bitmap.Image ) wsPutImage( &appMPlayer.subWindow ); |
1693 | 35 } |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2045
diff
changeset
|
36 appMPlayer.subWindow.State=0; |
1693 | 37 } |
38 | |
39 void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY ) | |
40 { | |
1812 | 41 static int mplSubMoved = 0; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2045
diff
changeset
|
42 static int msButton = 0; |
1812 | 43 |
1693 | 44 switch( Button ) |
45 { | |
6651 | 46 case wsPRMouseButton: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
47 gtkShow( evShowPopUpMenu,NULL ); |
2980 | 48 break; |
6651 | 49 case wsPMMouseButton: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
50 gtkShow( evHidePopUpMenu,NULL ); |
1693 | 51 mplShowMenu( RX,RY ); |
6651 | 52 msButton=wsPMMouseButton; |
1693 | 53 break; |
6651 | 54 case wsRMMouseButton: |
5919 | 55 mplHideMenu( RX,RY,1 ); |
1693 | 56 msButton=0; |
57 break; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2045
diff
changeset
|
58 // --- |
1693 | 59 case wsPLMouseButton: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
60 gtkShow( evHidePopUpMenu,NULL ); |
1693 | 61 sx=X; sy=Y; |
62 msButton=wsPLMouseButton; | |
63 mplSubMoved=0; | |
64 break; | |
65 case wsMoveMouse: | |
66 switch ( msButton ) | |
67 { | |
68 case wsPLMouseButton: | |
69 mplSubMoved=1; | |
2854 | 70 if ( !appMPlayer.subWindow.isFullScreen ) wsMoveWindow( &appMPlayer.subWindow,False,RX - sx,RY - sy ); |
1693 | 71 break; |
6651 | 72 case wsPMMouseButton: |
1693 | 73 mplMenuMouseHandle( X,Y,RX,RY ); |
74 break; | |
75 } | |
76 break; | |
77 case wsRLMouseButton: | |
5997
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
78 if ( ( !mplSubMoved )&&( appMPlayer.subWindow.isFullScreen ) ) |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2045
diff
changeset
|
79 { |
6146 | 80 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
|
81 else if ( wsWMType != wsWMNetWM && wsWMType != wsWMKDE ) wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID ); |
6623 | 82 } |
1693 | 83 msButton=0; |
84 mplSubMoved=0; | |
85 break; | |
86 } | |
87 } |