aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-11-11 15:33:28 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-11-11 15:33:28 +0000
commitd4b7c51b76414905f5c447eb9e2c1f327e72c2a1 (patch)
tree6748354cbea522a417836ce11ee21cccc62e8cab /main.c
parent[w3m-dev 03407] char GlobalKeymap -> unsigned char GlobalKeymap (diff)
downloadw3m-d4b7c51b76414905f5c447eb9e2c1f327e72c2a1.tar.gz
w3m-d4b7c51b76414905f5c447eb9e2c1f327e72c2a1.zip
[w3m-dev 03408] fix Bug#87472: MOUSE_SCROLL_LINE should be a run-time option
* fm.h (relative_wheel_scroll): added (fixed_wheel_scroll_count): added (relative_wheel_scroll_ratio): added * main.c (mouse_scroll_line): added (process_mouse): s/MOUSE_SCROLL_LINE/mouse_scroll_line()/ * menu.c (MOUSE_SCROLL_LINE): deleted * terms.h (MOUSE_SCROLL_LINE): deleted * rc.c (CMT_RELATIVE_WHEEL_SCROLL): added (CMT_RELATIVE_WHEEL_SCROLL_RATIO): added (CMT_FIXED_WHEEL_SCROLL_COUNT): added (wheelmode): added (params3): add relative_wheel_scroll, relative_wheel_scroll_ratio, fixed_wheel_scroll_count From: AIDA Shinra <aida-s@jcom.home.ne.jp>
Diffstat (limited to 'main.c')
-rw-r--r--main.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/main.c b/main.c
index 1bff1a8..e63ccba 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.126 2002/11/11 15:16:38 ukai Exp $ */
+/* $Id: main.c,v 1.127 2002/11/11 15:33:36 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -4656,6 +4656,15 @@ stopI(void)
#ifdef USE_MOUSE
+static int
+mouse_scroll_line(void)
+{
+ if (relative_wheel_scroll)
+ return (relative_wheel_scroll_ratio * LASTLINE + 99) / 100;
+ else
+ return fixed_wheel_scroll_count;
+}
+
static TabBuffer *
posTab(int x, int y)
{
@@ -4814,21 +4823,21 @@ process_mouse(int btn, int x, int y)
#endif /* USE_MENU */
break;
case MOUSE_BTN4_DOWN_RXVT:
- for (i = 0; i < MOUSE_SCROLL_LINE; i++)
+ for (i = 0; i < mouse_scroll_line(); i++)
ldown1();
break;
case MOUSE_BTN5_DOWN_RXVT:
- for (i = 0; i < MOUSE_SCROLL_LINE; i++)
+ for (i = 0; i < mouse_scroll_line(); i++)
lup1();
break;
}
}
else if (btn == MOUSE_BTN4_DOWN_XTERM) {
- for (i = 0; i < MOUSE_SCROLL_LINE; i++)
+ for (i = 0; i < mouse_scroll_line(); i++)
ldown1();
}
else if (btn == MOUSE_BTN5_DOWN_XTERM) {
- for (i = 0; i < MOUSE_SCROLL_LINE; i++)
+ for (i = 0; i < mouse_scroll_line(); i++)
lup1();
}