[Ttssh2-commit] [8462] _DrawTextW() を tipwin.cpp から layer_for_unicode.cpp へ移動

scmno****@osdn***** scmno****@osdn*****
2020年 1月 10日 (金) 22:13:16 JST


Revision: 8462
          https://osdn.net/projects/ttssh2/scm/svn/commits/8462
Author:   zmatsuo
Date:     2020-01-10 22:13:15 +0900 (Fri, 10 Jan 2020)
Log Message:
-----------
_DrawTextW() を tipwin.cpp から layer_for_unicode.cpp へ移動

Modified Paths:
--------------
    trunk/teraterm/common/layer_for_unicode.cpp
    trunk/teraterm/common/layer_for_unicode.h
    trunk/teraterm/common/tipwin.cpp

-------------- next part --------------
Modified: trunk/teraterm/common/layer_for_unicode.cpp
===================================================================
--- trunk/teraterm/common/layer_for_unicode.cpp	2020-01-10 13:13:04 UTC (rev 8461)
+++ trunk/teraterm/common/layer_for_unicode.cpp	2020-01-10 13:13:15 UTC (rev 8462)
@@ -36,6 +36,7 @@
 
 #include "codeconv.h"
 #include "compat_win.h"
+#include "ttlib.h"		// for IsWindowsNTKernel()
 
 #include "layer_for_unicode.h"
 
@@ -285,3 +286,19 @@
 		lpString[0] = 0;
 	return 0;
 }
+
+/**
+ *	TODO:9x\x8Cn\x82\xC5DrawTextW\x82\xAA\x8Eg\x82\xA6\x82\xE9?
+ */
+int _DrawTextW(HDC hdc, LPCWSTR lpchText, int cchText, LPRECT lprc, UINT format)
+{
+	if (IsWindowsNTKernel()) {
+		return DrawTextW(hdc, lpchText, cchText, lprc, format);
+	}
+
+	char *strA = ToCharW(lpchText);
+	int strA_len = (int)strlen(strA);
+	int result = DrawTextA(hdc, strA, strA_len, lprc, format);
+	free(strA);
+	return result;
+}

Modified: trunk/teraterm/common/layer_for_unicode.h
===================================================================
--- trunk/teraterm/common/layer_for_unicode.h	2020-01-10 13:13:04 UTC (rev 8461)
+++ trunk/teraterm/common/layer_for_unicode.h	2020-01-10 13:13:15 UTC (rev 8462)
@@ -53,6 +53,7 @@
 							 int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance,
 							 LPVOID lpParam);
 ATOM _RegisterClassW(const WNDCLASSW *lpWndClass);
+int _DrawTextW(HDC hdc, LPCWSTR lpchText, int cchText, LPRECT lprc, UINT format);
 
 #ifdef __cplusplus
 }

Modified: trunk/teraterm/common/tipwin.cpp
===================================================================
--- trunk/teraterm/common/tipwin.cpp	2020-01-10 13:13:04 UTC (rev 8461)
+++ trunk/teraterm/common/tipwin.cpp	2020-01-10 13:13:15 UTC (rev 8462)
@@ -64,7 +64,7 @@
 #endif
 #include <crtdbg.h>
 
-#include "ttlib.h"		// for GetMessageboxFont(), IsWindowsNTKernel()
+#include "ttlib.h"		// for GetMessageboxFont()
 #include "codeconv.h"
 #include "layer_for_unicode.h"
 
@@ -85,24 +85,6 @@
 	int py;
 } TipWin;
 
-/**
- *	9x\x8Cn\x82\xC5DrawTextW\x82\xAA\x8Eg\x82\xA6\x82邩\x82悭\x82킩\x82\xE7\x82Ȃ\xA2
- *	\x82Ƃ肠\x82\xA6\x82\xB8\x82\xB1\x82̃t\x83@\x83C\x83\x8B\x82ł̂ݎg\x97p
- *	\x82\xBB\x82̂\xA4\x82\xBF layer_for_unicode.cpp \x82Ɉړ\xAE\x82\xB7\x82\xE9
- */
-static int _DrawTextW(HDC hdc, LPCWSTR lpchText, int cchText, LPRECT lprc, UINT format)
-{
-	if (IsWindowsNTKernel()) {
-		return DrawTextW(hdc, lpchText, cchText, lprc, format);
-	}
-
-	char *strA = ToCharW(lpchText);
-	size_t strA_len = strlen(strA);
-	int result = DrawTextA(hdc, strA, strA_len, lprc, format);
-	free(strA);
-	return result;
-}
-
 VOID CTipWin::CalcStrRect(VOID)
 {
 	HDC hdc = CreateCompatibleDC(NULL);


Ttssh2-commit メーリングリストの案内