[Ttssh2-commit] [8750] デバグダイアログで描画APIのUnicode/ANSI切り替えができるようにした

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2020年 4月 26日 (日) 23:35:41 JST


Revision: 8750
          https://osdn.net/projects/ttssh2/scm/svn/commits/8750
Author:   zmatsuo
Date:     2020-04-26 23:35:40 +0900 (Sun, 26 Apr 2020)
Log Message:
-----------
デバグダイアログで描画APIのUnicode/ANSI切り替えができるようにした

Modified Paths:
--------------
    trunk/teraterm/common/tt_res.h
    trunk/teraterm/teraterm/buffer.c
    trunk/teraterm/teraterm/buffer.h
    trunk/teraterm/teraterm/debug_pp.cpp
    trunk/teraterm/teraterm/debug_pp.rc
    trunk/teraterm/teraterm/setting.h
    trunk/teraterm/teraterm/vtterm.c
    trunk/teraterm/teraterm/vtwin.cpp

-------------- next part --------------
Modified: trunk/teraterm/common/tt_res.h
===================================================================
--- trunk/teraterm/common/tt_res.h	2020-04-26 14:35:29 UTC (rev 8749)
+++ trunk/teraterm/common/tt_res.h	2020-04-26 14:35:40 UTC (rev 8750)
@@ -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: trunk/teraterm/teraterm/buffer.c
===================================================================
--- trunk/teraterm/teraterm/buffer.c	2020-04-26 14:35:29 UTC (rev 8749)
+++ trunk/teraterm/teraterm/buffer.c	2020-04-26 14:35:40 UTC (rev 8750)
@@ -5447,3 +5447,8 @@
 
 	return Attr;
 }
+
+void BuffSetDispAPI(BOOL unicode)
+{
+	UseUnicodeApi = unicode;
+}

Modified: trunk/teraterm/teraterm/buffer.h
===================================================================
--- trunk/teraterm/teraterm/buffer.h	2020-04-26 14:35:29 UTC (rev 8749)
+++ trunk/teraterm/teraterm/buffer.h	2020-04-26 14:35:40 UTC (rev 8750)
@@ -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: trunk/teraterm/teraterm/debug_pp.cpp
===================================================================
--- trunk/teraterm/teraterm/debug_pp.cpp	2020-04-26 14:35:29 UTC (rev 8749)
+++ trunk/teraterm/teraterm/debug_pp.cpp	2020-04-26 14:35:40 UTC (rev 8750)
@@ -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: trunk/teraterm/teraterm/debug_pp.rc
===================================================================
--- trunk/teraterm/teraterm/debug_pp.rc	2020-04-26 14:35:29 UTC (rev 8749)
+++ trunk/teraterm/teraterm/debug_pp.rc	2020-04-26 14:35:40 UTC (rev 8750)
@@ -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: trunk/teraterm/teraterm/setting.h
===================================================================
--- trunk/teraterm/teraterm/setting.h	2020-04-26 14:35:29 UTC (rev 8749)
+++ trunk/teraterm/teraterm/setting.h	2020-04-26 14:35:40 UTC (rev 8750)
@@ -36,11 +36,13 @@
 	BOOL CodePopupEnable;
 	WORD CodePopupKey1;
 	WORD CodePopupKey2;
+	BOOL UseUnicodeApi;
 	CUnicodeDebugParam()
 	{
 		CodePopupEnable = TRUE;
 		CodePopupKey1 = VK_CONTROL;
 		CodePopupKey2 = VK_CONTROL;
+		UseUnicodeApi = FALSE;
 	}
 };
 

Modified: trunk/teraterm/teraterm/vtterm.c
===================================================================
--- trunk/teraterm/teraterm/vtterm.c	2020-04-26 14:35:29 UTC (rev 8749)
+++ trunk/teraterm/teraterm/vtterm.c	2020-04-26 14:35:40 UTC (rev 8750)
@@ -57,6 +57,7 @@
 #include "ttime.h"
 #include "clipboar.h"
 #include "codeconv.h"
+#include "unicode.h"
 
 #include "vtterm.h"
 

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2020-04-26 14:35:29 UTC (rev 8749)
+++ trunk/teraterm/teraterm/vtwin.cpp	2020-04-26 14:35:40 UTC (rev 8750)
@@ -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);
+		}
 	}
 }
 


Ttssh2-commit メーリングリストの案内
Back to archive index