annotate gui/mplayer/sw.c @ 23927:91ccac9cc015

Add test for GNUisms It currently tests for case ... ranges only, but other tests (like GNU extensions to libc) can be added later
author ivo
date Mon, 30 Jul 2007 18:08:26 +0000
parents 8b61dc798f48
children 10dfbc523184
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
2 // sub window
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
3
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
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
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
6
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
7 #include "../config.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
8 #include "../libvo/x11_common.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
9
23154
e564b9cd7290 Fix several implicit declarations of functions warnings.
diego
parents: 23077
diff changeset
10 #include "gmplayer.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
11 #include "app.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
12 #include "interface.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
13 #include "../help_mp.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
14 #include "widgets.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
15
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
16 int mplSubRender = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
17 int SubVisible = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
18
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
19 extern int boxMoved;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
20 extern int sx,sy;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
21 extern int i,pot;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
22
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
23 void mplSubDraw( void )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
24 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
25 if ( appMPlayer.subWindow.State == wsWindowClosed ) exit_player( MSGTR_Exit_quit );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
26
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
27 if ( appMPlayer.subWindow.State == wsWindowFocusIn ) SubVisible++;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
28 if ( appMPlayer.subWindow.State == wsWindowFocusOut && metacity_hack != 3 ) SubVisible--;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
29
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
30 if ( !appMPlayer.subWindow.Mapped ||
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
31 appMPlayer.subWindow.Visible == wsWindowNotVisible ) return;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
32
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
33 if ( guiIntfStruct.Playing ) mplSubRender=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
34
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
35 if ( mplSubRender && appMPlayer.subWindow.State == wsWindowExpose )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
36 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
37 if ( appMPlayer.sub.Bitmap.Image ) wsPutImage( &appMPlayer.subWindow );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
38 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
39 appMPlayer.subWindow.State=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
40 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
41
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
42 void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
43 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
44 static int mplSubMoved = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
45 static int msButton = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
46
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
47 mplPBShow( X,Y );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
48
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
49 switch( Button )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
50 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
51 case wsRRMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
52 gtkShow( evShowPopUpMenu,NULL );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
53 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
54 case wsPMMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
55 gtkShow( evHidePopUpMenu,NULL );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
56 mplShowMenu( RX,RY );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
57 msButton=wsPMMouseButton;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
58 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
59 case wsRMMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
60 mplHideMenu( RX,RY,1 );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
61 msButton=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
62 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
63 // ---
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
64 case wsPLMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
65 gtkShow( evHidePopUpMenu,NULL );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
66 sx=X; sy=Y;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
67 msButton=wsPLMouseButton;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
68 mplSubMoved=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
69 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
70 case wsMoveMouse:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
71 switch ( msButton )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
72 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
73 case wsPLMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
74 mplSubMoved=1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
75 if ( !appMPlayer.subWindow.isFullScreen ) wsMoveWindow( &appMPlayer.subWindow,False,RX - sx,RY - sy );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
76 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
77 case wsPMMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
78 mplMenuMouseHandle( X,Y,RX,RY );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
79 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
80 default: mplPBShow( X,Y ); break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
81 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
82 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
83 case wsRLMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
84 if ( ( !mplSubMoved )&&( appMPlayer.subWindow.isFullScreen ) )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
85 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
86 if( SubVisible++%2 ) wsMoveTopWindow( wsDisplay,appMPlayer.mainWindow.WindowID );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
87 else wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
88 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
89 msButton=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
90 mplSubMoved=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
91 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
92 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
93 }