[prev in list] [next in list] [prev in thread] [next in thread] 

List:       w3m-dev-en
Subject:    [w3m-dev-en 00064] Re: Remaining difference xterm/gpm <-> sysmouse
From:       w3m-dev-en () mips ! rhein-neckar ! de (Christian Weisgerber)
Date:       2000-01-30 14:43:37
Message-ID: 871imp$14mu$1 () bigeye ! rhein-neckar ! de
[Download RAW message or body]

Hironori Sakamoto <hsaka@mth.biglobe.ne.jp> wrote:

> The sysmouse support dose not work on FreeBSD 2.2.8. I could not compile.

I have appended a patch below that makes it compile. I can't test
if it actually works, though.

> However, the names of function, macro and variable seem different.

Apparently, there's no way to fetch the console video mode and font
information on 2.2.x. At least not with the ioctls in <machine/console.h>,
as far as I can tell.

This poses a problem. sysmouse delivers mouse coordinates in pixels,
so a character grid application needs to know the font size. I've
made that default to 8x16, but 2.2.x already supported loading of
8x14 and 8x8 fonts.

> # The test on my machine is difficult because some trouble occurred
> # when the sysmouse was enable. Sorry...

I don't know if sysmouse actually works on the kernel side in 2.2.x.
It might be too broken to use.


--- terms.c.orig	Sun Jan 30 15:19:24 2000
+++ terms.c	Sun Jan 30 15:18:43 2000
@@ -17,10 +17,6 @@
 #endif
 #ifdef USE_SYSMOUSE
 #include <machine/console.h>
-#ifndef FBIO_GETMODE    /* FreeBSD 3.x */
-#define FBIO_GETMODE    CONS_GET
-#define FBIO_MODEINFO   CONS_MODEINFO
-#endif
 int (*sysm_handler)(int x, int y, int nbs, int obs);
 static int cwidth = 8, cheight = 16;
 static int xpix, ypix, nbs, obs = 0;
@@ -1528,7 +1524,6 @@
 #endif USE_GPM
 #ifdef USE_SYSMOUSE
   mouse_info_t mi;
-  video_info_t vi;
   extern int sysm_process_mouse();
 #endif
 
@@ -1552,11 +1547,19 @@
 #endif
 #ifdef USE_SYSMOUSE
   else {
+#if defined(FBIO_MODEINFO) || defined(CONS_MODEINFO)	/* FreeBSD > 2.x */
+#ifndef FBIO_GETMODE    /* FreeBSD 3.x */
+#define FBIO_GETMODE    CONS_GET
+#define FBIO_MODEINFO   CONS_MODEINFO
+#endif
+    video_info_t vi;
+
     if (ioctl(tty, FBIO_GETMODE, &vi.vi_mode) != -1 &&
         ioctl(tty, FBIO_MODEINFO, &vi) != -1) {
       cwidth = vi.vi_cwidth;
       cheight = vi.vi_cheight;
     }
+#endif
     signal(SIGUSR2, SIG_IGN);
     mi.operation = MOUSE_MODE;
     mi.u.mode.mode = 0;
-- 
Christian "naddy" Weisgerber                  naddy@mips.rhein-neckar.de


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic