Tera Termの個人的な作業用リポジトリ
修订版 | 866eaa0b8abd476d32876bc7aa41ba1030d44477 (tree) |
---|---|
时间 | 2020-04-26 23:35:19 |
作者 | zmatsuo <zmatsuo@user...> |
Commiter | zmatsuo |
描画APIをUnicode/ANSI切り替えできるようにした
git-svn-id: svn+ssh://svn.osdn.net/svnroot/ttssh2/trunk@8748 f5f01b69-1e22-0410-acbf-894ab4bd6246
@@ -107,6 +107,7 @@ static POINT DblClkStart, DblClkEnd; | ||
107 | 107 | // 描画 |
108 | 108 | static int StrChangeStart; // 描画開始 X (Y=CursorY) |
109 | 109 | static int StrChangeCount; // 描画キャラクタ数(半角単位),0のとき描画するものがない |
110 | +static BOOL UseUnicodeApi; | |
110 | 111 | |
111 | 112 | static BOOL SeveralPageSelect; // add (2005.5.15 yutaka) |
112 | 113 |
@@ -458,10 +459,12 @@ allocate_error: | ||
458 | 459 | return FALSE; |
459 | 460 | } |
460 | 461 | |
461 | -void InitBuffer() | |
462 | +void InitBuffer(BOOL use_unicode_api) | |
462 | 463 | { |
463 | 464 | int Ny; |
464 | 465 | |
466 | + UseUnicodeApi = use_unicode_api; | |
467 | + | |
465 | 468 | /* setup terminal */ |
466 | 469 | NumOfColumns = ts.TerminalWidth; |
467 | 470 | NumOfLines = ts.TerminalHeight; |
@@ -3190,11 +3193,12 @@ static void BuffDrawLineI(int DrawX, int DrawY, int SY, int IStart, int IEnd) | ||
3190 | 3193 | #endif |
3191 | 3194 | |
3192 | 3195 | DispSetupDC(CurAttr, CurSelected); |
3193 | -#if UNICODE_DISPLAY | |
3194 | - DispStrW(bufW, bufWW, lenW, Y, &X); | |
3195 | -#else | |
3196 | - DispStr(bufA, lenA, Y, &X); | |
3197 | -#endif | |
3196 | + if (UseUnicodeApi) { | |
3197 | + DispStrW(bufW, bufWW, lenW, Y, &X); | |
3198 | + } | |
3199 | + else { | |
3200 | + DispStr(bufA, lenA, Y, &X); | |
3201 | + } | |
3198 | 3202 | |
3199 | 3203 | lenA = 0; |
3200 | 3204 | lenW = 0; |
@@ -73,7 +73,7 @@ typedef struct { | ||
73 | 73 | |
74 | 74 | typedef TCharAttr *PCharAttr; |
75 | 75 | |
76 | -void InitBuffer(); | |
76 | +void InitBuffer(BOOL use_unicode_api); | |
77 | 77 | void LockBuffer(); |
78 | 78 | void UnlockBuffer(); |
79 | 79 | void FreeBuffer(); |
@@ -644,7 +644,7 @@ CVTWindow::CVTWindow(HINSTANCE hInstance) | ||
644 | 644 | #endif |
645 | 645 | |
646 | 646 | /* Initialize scroll buffer */ |
647 | - InitBuffer(); | |
647 | + InitBuffer(IsWindowsNTKernel() ? TRUE : FALSE); | |
648 | 648 | |
649 | 649 | InitDisp(); |
650 | 650 |