Revision: 8729 https://osdn.net/projects/ttssh2/scm/svn/commits/8729 Author: zmatsuo Date: 2020-04-14 00:21:14 +0900 (Tue, 14 Apr 2020) Log Message: ----------- デバグダイアログで描画APIのUnicode/ANSI切り替えができるようにした Modified Paths: -------------- branches/unicode_buf_2/teraterm/common/tt_res.h branches/unicode_buf_2/teraterm/teraterm/buffer.c branches/unicode_buf_2/teraterm/teraterm/buffer.h branches/unicode_buf_2/teraterm/teraterm/debug_pp.cpp branches/unicode_buf_2/teraterm/teraterm/debug_pp.rc branches/unicode_buf_2/teraterm/teraterm/setting.h branches/unicode_buf_2/teraterm/teraterm/vtterm.c branches/unicode_buf_2/teraterm/teraterm/vtwin.cpp -------------- next part -------------- Modified: branches/unicode_buf_2/teraterm/common/tt_res.h =================================================================== --- branches/unicode_buf_2/teraterm/common/tt_res.h 2020-04-13 15:21:05 UTC (rev 8728) +++ branches/unicode_buf_2/teraterm/common/tt_res.h 2020-04-13 15:21:14 UTC (rev 8729) @@ -256,6 +256,7 @@ #define IDC_SENDFILE_SEND_SIZE_LABEL 2603 #define IDC_SENDFILE_DELAYTIME_LABEL 2604 #define IDC_SENDFILE_DELAYTIME_EDIT 2605 +#define IDC_DEBUG_USE_UNICODE_API 2606 #define ID_ACC_SENDBREAK 50001 #define ID_ACC_COPY 50002 #define ID_ACC_NEWCONNECTION 50003 @@ -356,7 +357,7 @@ #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 128 #define _APS_NEXT_COMMAND_VALUE 52031 -#define _APS_NEXT_CONTROL_VALUE 2606 +#define _APS_NEXT_CONTROL_VALUE 2607 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif Modified: branches/unicode_buf_2/teraterm/teraterm/buffer.c =================================================================== --- branches/unicode_buf_2/teraterm/teraterm/buffer.c 2020-04-13 15:21:05 UTC (rev 8728) +++ branches/unicode_buf_2/teraterm/teraterm/buffer.c 2020-04-13 15:21:14 UTC (rev 8729) @@ -5447,3 +5447,8 @@ return Attr; } + +void BuffSetDispAPI(BOOL unicode) +{ + UseUnicodeApi = unicode; +} Modified: branches/unicode_buf_2/teraterm/teraterm/buffer.h =================================================================== --- branches/unicode_buf_2/teraterm/teraterm/buffer.h 2020-04-13 15:21:05 UTC (rev 8728) +++ branches/unicode_buf_2/teraterm/teraterm/buffer.h 2020-04-13 15:21:14 UTC (rev 8729) @@ -154,6 +154,7 @@ void BuffSetCursorCharAttr(int x, int y, TCharAttr Attr); TCharAttr BuffGetCursorCharAttr(int x, int y); BOOL BuffIsCombiningCharacter(int x, int y, unsigned int u32); +void BuffSetDispAPI(BOOL unicode); extern int StatusLine; extern int CursorTop, CursorBottom, CursorLeftM, CursorRightM; Modified: branches/unicode_buf_2/teraterm/teraterm/debug_pp.cpp =================================================================== --- branches/unicode_buf_2/teraterm/teraterm/debug_pp.cpp 2020-04-13 15:21:05 UTC (rev 8728) +++ branches/unicode_buf_2/teraterm/teraterm/debug_pp.cpp 2020-04-13 15:21:14 UTC (rev 8729) @@ -1,5 +1,5 @@ /* - * (C) 2019 TeraTerm Project + * (C) 2019-2020 TeraTerm Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -84,6 +84,9 @@ } } SetDlgItemTextA(IDC_DEBUG_CONSOLE_BUTTON, caption); + + // use unicode API + SetCheck(IDC_DEBUG_USE_UNICODE_API, UnicodeDebugParam.UseUnicodeApi); } BOOL CDebugPropPage::OnCommand(WPARAM wParam, LPARAM) @@ -128,4 +131,6 @@ UnicodeDebugParam.CodePopupKey1 = key_list[i].key_code; i = GetCurSel(IDC_DEBUG_POPUP_KEY2); UnicodeDebugParam.CodePopupKey2 = key_list[i].key_code; + + UnicodeDebugParam.UseUnicodeApi = GetCheck(IDC_DEBUG_USE_UNICODE_API); } Modified: branches/unicode_buf_2/teraterm/teraterm/debug_pp.rc =================================================================== --- branches/unicode_buf_2/teraterm/teraterm/debug_pp.rc 2020-04-13 15:21:05 UTC (rev 8728) +++ branches/unicode_buf_2/teraterm/teraterm/debug_pp.rc 2020-04-13 15:21:14 UTC (rev 8729) @@ -24,7 +24,7 @@ // Dialog // -IDD_TABSHEET_DEBUG DIALOGEX 0, 0, 175, 95 +IDD_TABSHEET_DEBUG DIALOGEX 0, 0, 175, 116 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Debug" FONT 8, "MS Shell Dlg", 400, 0, 0x1 @@ -36,6 +36,7 @@ LTEXT "1st Key",IDC_STATIC,23,33,25,8 LTEXT "2nd Key",IDC_STATIC,23,51,27,8 PUSHBUTTON "Display consol window",IDC_DEBUG_CONSOLE_BUTTON,10,71,93,14 + CONTROL "Use unicode API",IDC_DEBUG_USE_UNICODE_API,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,92,145,10 END @@ -80,7 +81,7 @@ VERTGUIDE, 23 VERTGUIDE, 61 VERTGUIDE, 155 - BOTTOMMARGIN, 88 + BOTTOMMARGIN, 109 HORZGUIDE, 37 HORZGUIDE, 55 END Modified: branches/unicode_buf_2/teraterm/teraterm/setting.h =================================================================== --- branches/unicode_buf_2/teraterm/teraterm/setting.h 2020-04-13 15:21:05 UTC (rev 8728) +++ branches/unicode_buf_2/teraterm/teraterm/setting.h 2020-04-13 15:21:14 UTC (rev 8729) @@ -36,11 +36,13 @@ BOOL CodePopupEnable; WORD CodePopupKey1; WORD CodePopupKey2; + BOOL UseUnicodeApi; CUnicodeDebugParam() { CodePopupEnable = TRUE; CodePopupKey1 = VK_CONTROL; CodePopupKey2 = VK_CONTROL; + UseUnicodeApi = FALSE; } }; Modified: branches/unicode_buf_2/teraterm/teraterm/vtterm.c =================================================================== --- branches/unicode_buf_2/teraterm/teraterm/vtterm.c 2020-04-13 15:21:05 UTC (rev 8728) +++ branches/unicode_buf_2/teraterm/teraterm/vtterm.c 2020-04-13 15:21:14 UTC (rev 8729) @@ -57,6 +57,7 @@ #include "ttime.h" #include "clipboar.h" #include "codeconv.h" +#include "unicode.h" #include "vtterm.h" Modified: branches/unicode_buf_2/teraterm/teraterm/vtwin.cpp =================================================================== --- branches/unicode_buf_2/teraterm/teraterm/vtwin.cpp 2020-04-13 15:21:05 UTC (rev 8728) +++ branches/unicode_buf_2/teraterm/teraterm/vtwin.cpp 2020-04-13 15:21:14 UTC (rev 8729) @@ -645,7 +645,8 @@ #endif /* Initialize scroll buffer */ - InitBuffer(IsWindowsNTKernel() ? TRUE : FALSE); + UnicodeDebugParam.UseUnicodeApi = IsWindowsNTKernel() ? TRUE : FALSE; + InitBuffer(UnicodeDebugParam.UseUnicodeApi); InitDisp(); @@ -4529,6 +4530,7 @@ // (2008.5.12 maya) changed to PropertySheet void CVTWindow::OnExternalSetup() { + BOOL old_use_unicode_api = UnicodeDebugParam.UseUnicodeApi; SetDialogFont(ts.DialogFontName, ts.DialogFontPoint, ts.DialogFontCharSet, ts.UILanguageFile, "Tera Term", "DLG_TAHOMA_FONT"); CAddSettingPropSheetDlg CAddSetting(m_hInst, HVTWin); @@ -4543,6 +4545,9 @@ DispSetNearestColors(IdBack, IdFore+8, NULL); ChangeWin(); ChangeFont(); + if (old_use_unicode_api != UnicodeDebugParam.UseUnicodeApi) { + BuffSetDispAPI(UnicodeDebugParam.UseUnicodeApi); + } } }