[Mplayer-cvslog] CVS: main/libvo x11_common.c,1.47,1.48 vo_gl.c,1.22,1.23 vo_gl2.c,1.15,1.16 vo_xv.c,1.54,1.55 vo_x11.c,1.62,1.63

Alban Bedel CVS albeu at mplayer.dev.hu
Mon Feb 11 12:44:53 CET 2002


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv14760/libvo

Modified Files:
	x11_common.c vo_gl.c vo_gl2.c vo_xv.c vo_x11.c 
Log Message:
Added new input mouse support in x11 vo


Index: x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- x11_common.c	31 Jan 2002 11:26:29 -0000	1.47
+++ x11_common.c	11 Feb 2002 11:44:50 -0000	1.48
@@ -29,6 +29,11 @@
 #include <X11/extensions/xf86vmode.h>
 #endif
 
+#ifdef HAVE_NEW_INPUT
+#include "../input/input.h"
+#include "../input/mouse.h"
+#endif
+
 /*
  * If SCAN_VISUALS is defined, vo_init() scans all available TrueColor
  * visuals for the 'best' visual for MPlayer video display.  Note that
@@ -425,6 +430,17 @@
                vo_x11_putkey( ( (keySym&0xff00) != 0?( (keySym&0x00ff) + 256 ):( keySym ) ) );
 	       ret|=VO_EVENT_KEYPRESS;
                break;
+#ifdef HAVE_NEW_INPUT
+          case ButtonPress:
+               // Ignore mouse whell press event
+               if(Event.xbutton.button == 4 || Event.xbutton.button == 5)
+                    break;
+               mplayer_put_key((MOUSE_BTN0+Event.xbutton.button-1)|MP_KEY_DOWN);
+               break;
+          case ButtonRelease:
+               mplayer_put_key(MOUSE_BTN0+Event.xbutton.button-1);
+               break;
+#endif
          }
       }
 #ifdef HAVE_NEW_GUI

Index: vo_gl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- vo_gl.c	9 Feb 2002 01:21:48 -0000	1.22
+++ vo_gl.c	11 Feb 2002 11:44:50 -0000	1.23
@@ -207,7 +207,11 @@
 //	bpp = myximage->bits_per_pixel;
 
 	//XSelectInput(mDisplay, mywindow, StructureNotifyMask); // !!!!
-        XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask );
+        XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask 
+#ifdef HAVE_NEW_INPUT
+		     | ButtonPressMask | ButtonReleaseMask
+#endif
+        );
 
 //  printf("Window setup ok\n");
 

Index: vo_gl2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl2.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- vo_gl2.c	9 Feb 2002 01:21:48 -0000	1.15
+++ vo_gl2.c	11 Feb 2002 11:44:50 -0000	1.16
@@ -711,7 +711,11 @@
 	XSync(mDisplay, False);
 
 	//XSelectInput(mDisplay, mywindow, StructureNotifyMask); // !!!!
-        XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask );
+        XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask
+#ifdef HAVE_NEW_INPUT
+		 | ButtonPressMask | ButtonReleaseMask
+#endif
+        );
 
   glVersion = glGetString(GL_VERSION);
 

Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- vo_xv.c	10 Feb 2002 01:43:35 -0000	1.54
+++ vo_xv.c	11 Feb 2002 11:44:50 -0000	1.55
@@ -416,7 +416,11 @@
    vo_x11_classhint( mDisplay,mywindow,"xv" );
    vo_hidecursor(mDisplay,mywindow);
 
-   XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask );
+   XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask 
+#ifdef HAVE_NEW_INPUT
+		| ButtonPressMask | ButtonReleaseMask
+#endif
+   );
    XSetStandardProperties(mDisplay, mywindow, hello, hello, None, NULL, 0, &hint);
    if ( mFullscreen ) vo_x11_decoration( mDisplay,mywindow,0 );
    XMapWindow(mDisplay, mywindow);

Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- vo_x11.c	10 Feb 2002 17:48:41 -0000	1.62
+++ vo_x11.c	11 Feb 2002 11:44:50 -0000	1.63
@@ -421,7 +421,11 @@
  if ( vo_window == None ) 
 #endif 
   {
-   XSelectInput( mDisplay,mywindow,StructureNotifyMask | KeyPressMask );
+   XSelectInput( mDisplay,mywindow,StructureNotifyMask | KeyPressMask 
+#ifdef HAVE_NEW_INPUT
+		 | ButtonPressMask | ButtonReleaseMask
+#endif
+    );
   }
  saver_off(mDisplay);
  return 0;




More information about the MPlayer-cvslog mailing list