comparison src/term.c @ 83644:0ece58f6e0aa

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 803-813) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 51-58) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 233-236) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-25
author Miles Bader <miles@gnu.org>
date Sun, 15 Jul 2007 02:05:20 +0000
parents 9c01792a3ce8 e6ed0991129c
children 65663fcd2caa
comparison
equal deleted inserted replaced
83643:70b38dec13a1 83644:0ece58f6e0aa
25 #include <stdio.h> 25 #include <stdio.h>
26 #include <ctype.h> 26 #include <ctype.h>
27 #include <string.h> 27 #include <string.h>
28 #include <errno.h> 28 #include <errno.h>
29 #include <sys/file.h> 29 #include <sys/file.h>
30 #include <unistd.h> /* For isatty. */ 30
31 #ifdef HAVE_UNISTD_H
32 #include <unistd.h>
33 #endif
31 34
32 #if HAVE_TERMIOS_H 35 #if HAVE_TERMIOS_H
33 #include <termios.h> /* For TIOCNOTTY. */ 36 #include <termios.h> /* For TIOCNOTTY. */
34 #endif 37 #endif
35 38
2341 2344
2342 #ifdef HAVE_GPM 2345 #ifdef HAVE_GPM
2343 void 2346 void
2344 term_mouse_moveto (int x, int y) 2347 term_mouse_moveto (int x, int y)
2345 { 2348 {
2349 /* TODO: how to set mouse position?
2346 const char *name; 2350 const char *name;
2347 int fd; 2351 int fd;
2348 /* TODO: how to set mouse position?
2349 name = (const char *) ttyname (0); 2352 name = (const char *) ttyname (0);
2350 fd = open (name, O_WRONLY); 2353 fd = open (name, O_WRONLY);
2351 SOME_FUNCTION (x, y, fd); 2354 SOME_FUNCTION (x, y, fd);
2352 close (fd); 2355 close (fd);
2353 last_mouse_x = x; 2356 last_mouse_x = x;
2357 static void 2360 static void
2358 term_show_mouse_face (enum draw_glyphs_face draw) 2361 term_show_mouse_face (enum draw_glyphs_face draw)
2359 { 2362 {
2360 struct window *w = XWINDOW (Qmouse_face_window); 2363 struct window *w = XWINDOW (Qmouse_face_window);
2361 int save_x, save_y; 2364 int save_x, save_y;
2362 int i, j; 2365 int i;
2363 2366
2364 struct frame *f = XFRAME (w->frame); 2367 struct frame *f = XFRAME (w->frame);
2365 struct tty_display_info *tty = FRAME_TTY (f); 2368 struct tty_display_info *tty = FRAME_TTY (f);
2366 2369
2367 if (/* If window is in the process of being destroyed, don't bother 2370 if (/* If window is in the process of being destroyed, don't bother
2880 2883
2881 int 2884 int
2882 handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event, struct input_event* hold_quit) 2885 handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event, struct input_event* hold_quit)
2883 { 2886 {
2884 struct frame *f = XFRAME (tty->top_frame); 2887 struct frame *f = XFRAME (tty->top_frame);
2885 int i, j, fd; 2888 int fd;
2886 struct input_event ie; 2889 struct input_event ie;
2887 int do_help = 0; 2890 int do_help = 0;
2888 int count = 0; 2891 int count = 0;
2889 2892
2890 EVENT_INIT (ie); 2893 EVENT_INIT (ie);
2904 2907
2905 arg[0] = arg[2] = (unsigned short) event->x + gpm_zerobased; 2908 arg[0] = arg[2] = (unsigned short) event->x + gpm_zerobased;
2906 arg[1] = arg[3] = (unsigned short) event->y + gpm_zerobased; 2909 arg[1] = arg[3] = (unsigned short) event->y + gpm_zerobased;
2907 arg[4] = (unsigned short) 3; 2910 arg[4] = (unsigned short) 3;
2908 2911
2909 name = (const char *) ttyname (0); 2912 name = ttyname (0);
2910 fd = open (name, O_WRONLY); 2913 fd = open (name, O_WRONLY);
2911 ioctl (fd, TIOCLINUX, buf + sizeof (short) - 1); 2914 ioctl (fd, TIOCLINUX, buf + sizeof (short) - 1);
2912 close (fd); 2915 close (fd);
2913 2916
2914 if (!term_mouse_movement (f, event)) 2917 if (!term_mouse_movement (f, event))