w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit e443412fe59383f52c9bb5eab217f13c4e1ef113
parent 4ff53f7264a76771ce19dd3ac06ec3e4b98812f4
Author: ukai <ukai>
Date:   Thu, 15 Jul 2004 16:32:38 +0000

[w3m-dev 04092] remove __CYGWIN__ && LANG == JA
* remove condition LANG == JA && __CYGWIN__
* cygwin_mouse_btn_swapped enabled when before 1.5.x
From: WATANABE Katsuyuki <knabe@sannet.ne.jp>

Diffstat:
MChangeLog | 6++++++
Mconfig.h.in | 2--
Mdisplay.c | 4++--
Mfm.h | 6+++---
Mmain.c | 2+-
Mmenu.c | 2+-
Mterms.c | 33+++++++++++++++++++--------------
Mterms.h | 4++--
8 files changed, 34 insertions(+), 25 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,5 +1,11 @@ 2004-07-16 WATANABE Katsuyuki <knabe@sannet.ne.jp> + * [w3m-dev 04092] remove __CYGWIN__ && LANG == JA + * remove condition LANG == JA && __CYGWIN__ + * cygwin_mouse_btn_swapped enabled when before 1.5.x + +2004-07-16 WATANABE Katsuyuki <knabe@sannet.ne.jp> + * [w3m-dev 04091] option panel: gettextize select list * rc.c: gettextize option select list. * rc.c: add gettextize message. diff --git a/config.h.in b/config.h.in @@ -193,10 +193,8 @@ typedef RETSIGTYPE MySignalHandler; #if defined( __CYGWIN__ ) #define SUPPORT_NETBIOS_SHARE 1 -#if LANG == JA #define SUPPORT_WIN9X_CONSOLE_MBCS 1 #endif -#endif #if defined(__DJGPP__) #define DEFAULT_TERM "dosansi" diff --git a/display.c b/display.c @@ -433,11 +433,11 @@ displayBuffer(Buffer *buf, int mode) scroll(n); } else if (n < 0 && n > -buf->LINES) { -#if defined(__CYGWIN__) && LANG == JA +#if 0 /* defined(__CYGWIN__) */ move(LASTLINE + n + 1, 0); clrtoeolx(); refresh(); -#endif /* defined(__CYGWIN__) && LANG == JA */ +#endif /* defined(__CYGWIN__) */ rscroll(-n); } redrawNLine(buf, n); diff --git a/fm.h b/fm.h @@ -759,11 +759,11 @@ typedef struct http_request { */ extern int LINES, COLS; -#if defined(__CYGWIN__) && LANG == JA +#if defined(__CYGWIN__) extern int LASTLINE; -#else /* not defined(__CYGWIN__) || LANG != JA */ +#else /* not defined(__CYGWIN__) */ #define LASTLINE (LINES-1) -#endif /* not defined(__CYGWIN__) || LANG != JA */ +#endif /* not defined(__CYGWIN__) */ global int Tabstop init(8); global int IndentIncr init(4); diff --git a/main.c b/main.c @@ -5323,7 +5323,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; diff --git a/menu.c b/menu.c @@ -1183,7 +1183,7 @@ mMouse(char c) 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; diff --git a/terms.c b/terms.c @@ -56,8 +56,11 @@ static int tty; #include <windows.h> #include <sys/cygwin.h> static int isWinConsole = 0; +#define TERM_CYGWIN 1 +#define TERM_CYGWIN_RESERVE_IME 2 static int isLocalConsole = 0; -#ifdef USE_MOUSE + +#if CYGWIN_VERSION_DLL_MAJOR < 1005 && defined(USE_MOUSE) int cygwin_mouse_btn_swapped = 0; #endif @@ -79,9 +82,6 @@ check_win9x(void) } if (winVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { isWin95 = 1; - if (ttyslot() != -1) { - isLocalConsole = 0; - } } else { isWin95 = 0; @@ -200,7 +200,7 @@ GetConsoleHwnd(void) return (hwndFound); } -#ifdef USE_MOUSE +#if CYGWIN_VERSION_DLL_MAJOR < 1005 && defined(USE_MOUSE) static unsigned long cygwin_version(void) { @@ -223,7 +223,7 @@ check_cygwin_console(void) if (term == NULL) term = DEFAULT_TERM; if (term && strncmp(term, "cygwin", 6) == 0) { - isWinConsole = 1; + isWinConsole = TERM_CYGWIN; } if (isWinConsole) { hWnd = GetConsoleHwnd(); @@ -232,11 +232,17 @@ check_cygwin_console(void) isLocalConsole = 1; } } + if (strncmp(getenv("LANG"), "ja", 2) == 0) { + isWinConsole = TERM_CYGWIN_RESERVE_IME; + } #ifdef SUPPORT_WIN9X_CONSOLE_MBCS check_win9x(); + if (isWin95 && ttyslot() != -1) { + isLocalConsole = 0; + } #endif } -#ifdef USE_MOUSE +#if CYGWIN_VERSION_DLL_MAJOR < 1005 && defined(USE_MOUSE) if (cygwin_version() <= 1003015) { /* cygwin DLL 1.3.15 or earler */ cygwin_mouse_btn_swapped = 1; @@ -382,9 +388,10 @@ char *T_cd, *T_ce, *T_kr, *T_kl, *T_cr, *T_bt, *T_ta, *T_sc, *T_rc, *T_ti, *T_te, *T_nd, *T_as, *T_ae, *T_eA, *T_ac, *T_op; int LINES, COLS; -#if defined(__CYGWIN__) && LANG == JA +#if defined(__CYGWIN__) int LASTLINE; -#endif /* defined(__CYGWIN__) && LANG == JA */ +#endif /* defined(__CYGWIN__) */ + static int max_LINES = 0, max_COLS = 0; static int tab_step = 8; static int CurLine, CurColumn; @@ -763,9 +770,9 @@ setlinescols(void) COLS = MAX_COLUMN; if (LINES > MAX_LINE) LINES = MAX_LINE; -#if defined(__CYGWIN__) && LANG == JA - LASTLINE = LINES - (isWinConsole ? 2 : 1); -#endif /* defined(__CYGWIN__) && LANG == JA */ +#if defined(__CYGWIN__) + LASTLINE = LINES - (isWinConsole == TERM_CYGWIN_RESERVE_IME ? 2 : 1); +#endif /* defined(__CYGWIN__) */ } void @@ -1285,9 +1292,7 @@ refresh(void) * (COLS-1,LINES-1). */ #if !defined(USE_BG_COLOR) || defined(__CYGWIN__) -#if defined(__CYGWIN__) && LANG == JA if (isWinConsole) -#endif /* defined(__CYGWIN__) && LANG == JA */ if (line == LINES - 1 && col == COLS - 1) break; #endif /* !defined(USE_BG_COLOR) || defined(__CYGWIN__) */ diff --git a/terms.h b/terms.h @@ -3,7 +3,7 @@ #define TERMS_H extern int LINES, COLS; -#if defined(__CYGWIN__) && LANG == JA +#if defined(__CYGWIN__) extern int LASTLINE; #endif @@ -21,7 +21,7 @@ extern int LASTLINE; #endif #ifdef __CYGWIN__ -#ifdef USE_MOUSE +#if CYGWIN_VERSION_DLL_MAJOR < 1005 && defined(USE_MOUSE) extern int cygwin_mouse_btn_swapped; #endif #ifdef SUPPORT_WIN9X_CONSOLE_MBCS