[Ttssh2-commit] [8748] 描画APIをUnicode/ANSI切り替えできるようにした

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


Revision: 8748
          https://osdn.net/projects/ttssh2/scm/svn/commits/8748
Author:   zmatsuo
Date:     2020-04-26 23:35:19 +0900 (Sun, 26 Apr 2020)
Log Message:
-----------
描画APIをUnicode/ANSI切り替えできるようにした

Modified Paths:
--------------
    trunk/teraterm/teraterm/buffer.c
    trunk/teraterm/teraterm/buffer.h
    trunk/teraterm/teraterm/vtwin.cpp

-------------- next part --------------
Modified: trunk/teraterm/teraterm/buffer.c
===================================================================
--- trunk/teraterm/teraterm/buffer.c	2020-04-26 14:35:09 UTC (rev 8747)
+++ trunk/teraterm/teraterm/buffer.c	2020-04-26 14:35:19 UTC (rev 8748)
@@ -107,6 +107,7 @@
 // \x95`\x89\xE6
 static int StrChangeStart;	// \x95`\x89\xE6\x8AJ\x8En X (Y=CursorY)
 static int StrChangeCount;	// \x95`\x89\xE6\x83L\x83\x83\x83\x89\x83N\x83^\x90\x94(\x94\xBC\x8Ap\x92P\x88\xCA),0\x82̂Ƃ\xAB\x95`\x89悷\x82\xE9\x82\xE0\x82̂\xAA\x82Ȃ\xA2
+static BOOL UseUnicodeApi;
 
 static BOOL SeveralPageSelect;  // add (2005.5.15 yutaka)
 
@@ -458,10 +459,12 @@
 	return FALSE;
 }
 
-void InitBuffer()
+void InitBuffer(BOOL use_unicode_api)
 {
 	int Ny;
 
+	UseUnicodeApi = use_unicode_api;
+
 	/* setup terminal */
 	NumOfColumns = ts.TerminalWidth;
 	NumOfLines = ts.TerminalHeight;
@@ -3190,11 +3193,12 @@
 #endif
 
 			DispSetupDC(CurAttr, CurSelected);
-#if UNICODE_DISPLAY
-			DispStrW(bufW, bufWW, lenW, Y, &X);
-#else
-			DispStr(bufA, lenA, Y, &X);
-#endif
+			if (UseUnicodeApi) {
+				DispStrW(bufW, bufWW, lenW, Y, &X);
+			}
+			else {
+				DispStr(bufA, lenA, Y, &X);
+			}
 
 			lenA = 0;
 			lenW = 0;

Modified: trunk/teraterm/teraterm/buffer.h
===================================================================
--- trunk/teraterm/teraterm/buffer.h	2020-04-26 14:35:09 UTC (rev 8747)
+++ trunk/teraterm/teraterm/buffer.h	2020-04-26 14:35:19 UTC (rev 8748)
@@ -73,7 +73,7 @@
 
 typedef TCharAttr *PCharAttr;
 
-void InitBuffer();
+void InitBuffer(BOOL use_unicode_api);
 void LockBuffer();
 void UnlockBuffer();
 void FreeBuffer();

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2020-04-26 14:35:09 UTC (rev 8747)
+++ trunk/teraterm/teraterm/vtwin.cpp	2020-04-26 14:35:19 UTC (rev 8748)
@@ -644,7 +644,7 @@
 #endif
 
 	/* Initialize scroll buffer */
-	InitBuffer();
+	InitBuffer(IsWindowsNTKernel() ? TRUE : FALSE);
 
 	InitDisp();
 


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