• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision7486 (tree)
Time2019-03-15 00:54:31
Authorzmatsuo

Log Message

LoadIME()#ttime.cのエラー表示処理を呼び元のvtdisp.cに移動した

Change Summary

Incremental Difference

--- trunk/teraterm/teraterm/ttime.c (revision 7485)
+++ trunk/teraterm/teraterm/ttime.c (revision 7486)
@@ -45,7 +45,8 @@
4545 #include "buffer.h" // for BuffGetCurrentLineData()
4646 #endif
4747
48-#if 0 // #ifndef _IMM_
48+// imm.h が include できれば _IMM_ が define される → このブロック不要?
49+#ifndef _IMM_
4950 #define _IMM_
5051
5152 typedef DWORD HIMC;
@@ -81,33 +82,8 @@
8182 static HANDLE HIMEDLL = NULL;
8283 static LOGFONTA lfIME;
8384
84-#if 1
85-static void show_message()
85+BOOL LoadIME(void)
8686 {
87-#if 0
88- PTTSet tempts;
89-#endif
90- char uimsg[MAX_UIMSG];
91- get_lang_msg("MSG_TT_ERROR", uimsg, sizeof(uimsg), "Tera Term: Error", ts.UILanguageFile);
92- get_lang_msg("MSG_USE_IME_ERROR", ts.UIMsg, sizeof(ts.UIMsg), "Can't use IME", ts.UILanguageFile);
93- MessageBoxA(0,ts.UIMsg,uimsg,MB_ICONEXCLAMATION);
94- WritePrivateProfileStringA("Tera Term","IME","off",ts.SetupFName);
95- ts.UseIME = 0;
96-#if 0
97- tempts = (PTTSet)malloc(sizeof(TTTSet));
98- if (tempts!=NULL)
99- {
100- GetDefaultSet(tempts);
101- tempts->UseIME = 0;
102- ChangeDefaultSet(tempts,NULL);
103- free(tempts);
104- }
105-#endif
106-}
107-#endif
108-
109-BOOL LoadIME()
110-{
11187 BOOL Err;
11288 char imm32_dll[MAX_PATH];
11389
@@ -117,7 +93,6 @@
11793 HIMEDLL = LoadLibraryA(imm32_dll);
11894 if (HIMEDLL == NULL)
11995 {
120- show_message();
12196 return FALSE;
12297 }
12398
@@ -179,7 +154,7 @@
179154 FreeLibrary(HTemp);
180155 }
181156
182-BOOL CanUseIME()
157+BOOL CanUseIME(void)
183158 {
184159 return (HIMEDLL != NULL);
185160 }
@@ -280,7 +255,8 @@
280255
281256 }
282257
283-void SetIMEOpenStatus(HWND hWnd, BOOL stat) {
258+void SetIMEOpenStatus(HWND hWnd, BOOL stat)
259+{
284260 HIMC hIMC;
285261
286262 if (HIMEDLL==NULL) return;
--- trunk/teraterm/teraterm/ttime.h (revision 7485)
+++ trunk/teraterm/teraterm/ttime.h (revision 7486)
@@ -34,9 +34,9 @@
3434 #endif
3535
3636 /* proto types */
37-BOOL LoadIME();
37+BOOL LoadIME(void);
3838 void FreeIME(HWND hWnd);
39-BOOL CanUseIME();
39+BOOL CanUseIME(void);
4040 void SetConversionWindow(HWND HWnd, int X, int Y);
4141 void SetConversionLogFont(HWND HWnd, PLOGFONTA lf);
4242 BOOL GetIMEOpenStatus(HWND hWnd);
--- trunk/teraterm/teraterm/vtdisp.c (revision 7485)
+++ trunk/teraterm/teraterm/vtdisp.c (revision 7486)
@@ -2058,8 +2058,14 @@
20582058 {
20592059 if (ts.UseIME==0)
20602060 FreeIME(HVTWin);
2061- else if (! LoadIME())
2061+ else if (! LoadIME()) {
2062+ char uimsg[MAX_UIMSG];
2063+ get_lang_msg("MSG_TT_ERROR", uimsg, sizeof(uimsg), "Tera Term: Error", ts.UILanguageFile);
2064+ get_lang_msg("MSG_USE_IME_ERROR", ts.UIMsg, sizeof(ts.UIMsg), "Can't use IME", ts.UILanguageFile);
2065+ MessageBoxA(0,ts.UIMsg,uimsg,MB_ICONEXCLAMATION);
2066+ WritePrivateProfileStringA("Tera Term","IME","off",ts.SetupFName);
20622067 ts.UseIME = 0;
2068+ }
20632069
20642070 if (ts.UseIME>0)
20652071 {
--- trunk/teraterm/teraterm/vtwin.cpp (revision 7485)
+++ trunk/teraterm/teraterm/vtwin.cpp (revision 7486)
@@ -3226,22 +3226,23 @@
32263226 size_t len;
32273227 const wchar_t *lpstr = GetConvString(HVTWin, wParam, lParam, &len);
32283228 if (lpstr != NULL) {
3229+ const wchar_t *output_wstr = lpstr;
32293230 if (len == 1 && ControlKey()) {
32303231 const static wchar_t code_ctrl_space = 0;
32313232 const static wchar_t code_ctrl_backslash = 0x1c;
32323233 switch(*lpstr) {
32333234 case 0x20:
3234- lpstr = &code_ctrl_space;
3235+ output_wstr = &code_ctrl_space;
32353236 break;
32363237 case 0x5c: // Ctrl-\ support for NEC-PC98
3237- lpstr = &code_ctrl_backslash;
3238+ output_wstr = &code_ctrl_backslash;
32383239 break;
32393240 }
32403241 }
32413242 if (ts.LocalEcho>0) {
3242- CommTextEchoW(&cv,lpstr,len);
3243+ CommTextEchoW(&cv,output_wstr,len);
32433244 }
3244- CommTextOutW(&cv,lpstr,len);
3245+ CommTextOutW(&cv,output_wstr,len);
32453246 free((void *)lpstr);
32463247 return 0;
32473248 }
Show on old repository browser