aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@vega.ocn.ne.jp>2011-05-04 07:21:03 +0000
committerTatsuya Kinoshita <tats@vega.ocn.ne.jp>2011-05-04 07:21:03 +0000
commit2d9ece8bcb1c76c3d6990b83b00019e171c759d7 (patch)
treeb29dca9667fe151b2f01262c5907281ad2c7e3e8 /main.c
parentReleasing debian version 0.5.1-4 (diff)
downloadw3m-2d9ece8bcb1c76c3d6990b83b00019e171c759d7.tar.gz
w3m-2d9ece8bcb1c76c3d6990b83b00019e171c759d7.zip
Releasing debian version 0.5.1-5debian/0.5.1-5
Diffstat (limited to 'main.c')
-rw-r--r--main.c84
1 files changed, 45 insertions, 39 deletions
diff --git a/main.c b/main.c
index 79d6026..b11913f 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.242 2004/04/04 16:47:20 ukai Exp $ */
+/* $Id: main.c,v 1.252 2006/05/29 12:42:22 inu Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -51,7 +51,6 @@ static MySignalHandler SigAlarm(SIGNAL_ARG);
#ifdef SIGWINCH
static int need_resize_screen = FALSE;
static MySignalHandler resize_hook(SIGNAL_ARG);
-static MySignalHandler resize_handler(SIGNAL_ARG);
static void resize_screen(void);
#endif
@@ -294,10 +293,9 @@ wrap_GC_warn_proc(char *msg, GC_word arg)
for (; n > 0; --n, ++i) {
i %= sizeof(msg_ring) / sizeof(msg_ring[0]);
- disp_message_nsec(Sprintf
- (msg_ring[i].msg,
- (unsigned long)msg_ring[i].arg)->ptr, FALSE,
- 1, TRUE, FALSE);
+
+ printf(msg_ring[i].msg, (unsigned long)msg_ring[i].arg);
+ sleep_till_anykey(1, 1);
}
lock = 0;
@@ -384,9 +382,11 @@ main(int argc, char **argv, char **envp)
#endif
#endif
GC_init();
+#if ENABLE_NLS
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+#endif
#ifndef HAVE_SYS_ERRLIST
prepare_sys_errlist();
@@ -452,6 +452,7 @@ main(int argc, char **argv, char **envp)
SystemCharset = wc_guess_locale_charset(Locale, SystemCharset);
}
auto_detect = WcOption.auto_detect;
+ BookmarkCharset = DocumentCharset;
#endif
if (!non_null(HTTP_proxy) &&
@@ -1081,24 +1082,32 @@ main(int argc, char **argv, char **envp)
}
#endif
#ifdef SIGWINCH
- if (need_resize_screen) {
- need_resize_screen = FALSE;
- resize_screen();
- }
- mySignal(SIGWINCH, resize_handler);
+ mySignal(SIGWINCH, resize_hook);
#endif
#ifdef USE_IMAGE
if (activeImage && displayImage && Currentbuf->img &&
!Currentbuf->image_loaded) {
do {
+#ifdef SIGWINCH
+ if (need_resize_screen)
+ resize_screen();
+#endif
loadImage(Currentbuf, IMG_FLAG_NEXT);
} while (sleep_till_anykey(1, 0) <= 0);
}
+#ifdef SIGWINCH
+ else
+#endif
#endif
- c = getch();
#ifdef SIGWINCH
- mySignal(SIGWINCH, resize_hook);
+ {
+ do {
+ if (need_resize_screen)
+ resize_screen();
+ } while (sleep_till_anykey(1, 0) <= 0);
+ }
#endif
+ c = getch();
#ifdef USE_ALARM
if (CurrentAlarm->sec > 0) {
alarm(0);
@@ -1109,10 +1118,18 @@ main(int argc, char **argv, char **envp)
mouse_inactive();
#endif /* USE_MOUSE */
if (IS_ASCII(c)) { /* Ascii */
- if (((prec_num && c == '0') || '1' <= c) && (c <= '9')) {
- prec_num = prec_num * 10 + (int)(c - '0');
- if (prec_num > PREC_LIMIT)
- prec_num = PREC_LIMIT;
+ if( vi_prec_num ){
+ if(((prec_num && c == '0') || '1' <= c) && (c <= '9')) {
+ prec_num = prec_num * 10 + (int)(c - '0');
+ if (prec_num > PREC_LIMIT)
+ prec_num = PREC_LIMIT;
+ }
+ else {
+ set_buffer_environ(Currentbuf);
+ save_buffer_position(Currentbuf);
+ keyPressEventProc((int)c);
+ prec_num = 0;
+ }
}
else {
set_buffer_environ(Currentbuf);
@@ -1416,17 +1433,10 @@ resize_hook(SIGNAL_ARG)
SIGNAL_RETURN;
}
-static MySignalHandler
-resize_handler(SIGNAL_ARG)
-{
- resize_screen();
- mySignal(SIGWINCH, resize_handler);
- SIGNAL_RETURN;
-}
-
static void
resize_screen(void)
{
+ need_resize_screen = FALSE;
setlinescols();
setupscreen();
if (CurrentTab)
@@ -1963,6 +1973,7 @@ DEFUN(pipeBuf, PIPE_BUF, "Send rendered document to pipe")
buf->bufferprop |= (BP_INTERNAL | BP_NO_URL);
if (buf->type == NULL)
buf->type = "text/plain";
+ buf->currentURL.file = "-";
pushBuffer(buf);
}
displayBuffer(Currentbuf, B_FORCE_REDRAW);
@@ -4110,25 +4121,20 @@ DEFUN(adBmark, ADD_BOOKMARK, "Add current page to bookmark")
Str tmp;
FormList *request;
- tmp = Sprintf("mode=panel&cookie=%s&bmark=%s&url=%s&title=%s",
+ tmp = Sprintf("mode=panel&cookie=%s&bmark=%s&url=%s&title=%s"
+#ifdef USE_M17N
+ "&charset=%s"
+#endif
+ ,
(Str_form_quote(localCookie()))->ptr,
(Str_form_quote(Strnew_charp(BookmarkFile)))->ptr,
(Str_form_quote(parsedURL2Str(&Currentbuf->currentURL)))->
ptr,
#ifdef USE_M17N
-#if LANG == JA
- /* FIXME: why WC_CES_EUC_JP hardcoded?
- * backward compatibility.
- * w3mbookmark takes arguments as EUC-JP only?
- */
(Str_form_quote(wc_conv_strict(Currentbuf->buffername,
InnerCharset,
- WC_CES_EUC_JP)))->ptr);
-#else
- (Str_form_quote(wc_conv_strict(Currentbuf->buffername,
- InnerCharset,
- SystemCharset)))->ptr);
-#endif
+ BookmarkCharset)))->ptr,
+ wc_ces_to_charset(BookmarkCharset));
#else
(Str_form_quote(Strnew_charp(Currentbuf->buffername)))->ptr);
#endif
@@ -5323,7 +5329,7 @@ DEFUN(mouse, MOUSE, "mouse operation")
int btn, x, y;
btn = (unsigned char)getch() - 32;
-#if defined(__CYGWIN__)
+#if defined(__CYGWIN__) && CYGWIN_VERSION_DLL_MAJOR < 1005
if (cygwin_mouse_btn_swapped) {
if (btn == MOUSE_BTN2_DOWN)
btn = MOUSE_BTN3_DOWN;
@@ -5674,7 +5680,7 @@ searchKeyNum(void)
static char *
getCodePage(void)
{
- ULONG CpList[8], CpSize;
+ unsigned long CpList[8], CpSize;
if (!getenv("WINDOWID") && !DosQueryCp(sizeof(CpList), CpList, &CpSize))
return Sprintf("CP%d", *CpList)->ptr;