diff src/event-unixoid.c @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents 2f8bb876ab1d
children
line wrap: on
line diff
--- a/src/event-unixoid.c	Mon Aug 13 11:19:22 2007 +0200
+++ b/src/event-unixoid.c	Mon Aug 13 11:20:41 2007 +0200
@@ -41,6 +41,10 @@
 #include "sysproc.h"		/* select stuff */
 #include "systime.h"
 
+#ifdef HAVE_GPM
+#include "gpmevent.h"
+#endif
+
 /* Mask of bits indicating the descriptors that we wait for input on.
    These work as follows:
 
@@ -71,7 +75,7 @@
 int fake_event_occurred;
 
 int
-read_event_from_tty_or_stream_desc (Lisp_Event *event,
+read_event_from_tty_or_stream_desc (struct Lisp_Event *event,
 				    struct console *con, int fd)
 {
   unsigned char ch;
@@ -80,6 +84,12 @@
 
   XSETCONSOLE (console, con);
 
+#ifdef HAVE_GPM
+  if (fd == CONSOLE_TTY_MOUSE_FD (con)) {
+    return handle_gpm_read (event,con,fd);
+  }
+#endif
+
   nread = read (fd, &ch, 1);
   if (nread <= 0)
     {
@@ -174,7 +184,7 @@
 }
 
 static int
-get_process_infd (Lisp_Process *p)
+get_process_infd (struct Lisp_Process *p)
 {
   Lisp_Object instr, outstr;
   get_process_streams (p, &instr, &outstr);
@@ -183,7 +193,7 @@
 }
 
 int
-event_stream_unixoid_select_process (Lisp_Process *proc)
+event_stream_unixoid_select_process (struct Lisp_Process *proc)
 {
   int infd = get_process_infd (proc);
 
@@ -194,7 +204,7 @@
 }
 
 int
-event_stream_unixoid_unselect_process (Lisp_Process *proc)
+event_stream_unixoid_unselect_process (struct Lisp_Process *proc)
 {
   int infd = get_process_infd (proc);
 
@@ -225,7 +235,7 @@
 	{
 	  /* Something went seriously wrong; don't abort since maybe
 	     the TTY just died at the wrong time. */
-	  stderr_out ("xemacs: select failed: errno = %d\n", errno);
+	  fprintf (stderr, "xemacs: select failed: errno = %d\n", errno);
 	  return 0;
 	}
       /* else, we got interrupted by a signal, so try again. */