[Ttssh2-commit] [4932] IMEの前後フィードバック対応を行った。

svnno****@sourc***** svnno****@sourc*****
2012年 5月 9日 (水) 01:36:57 JST


Revision: 4932
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4932
Author:   yutakapon
Date:     2012-05-09 01:36:57 +0900 (Wed, 09 May 2012)
Log Message:
-----------
IMEの前後フィードバック対応を行った。
ATOK2012で動作確認済み。

Modified Paths:
--------------
    trunk/doc/en/html/about/history.html
    trunk/doc/ja/html/about/history.html
    trunk/teraterm/teraterm/buffer.c
    trunk/teraterm/teraterm/buffer.h
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/teraterm/vtwin.h

-------------- next part --------------
Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2012-05-05 12:40:02 UTC (rev 4931)
+++ trunk/doc/en/html/about/history.html	2012-05-08 16:36:57 UTC (rev 4932)
@@ -72,6 +72,7 @@
         </ul></li>
       <li>added the LanguageUI entry on the <a href="..\menu\setup-general.html">General setup dialog</a>.</li>
       <li>A message dialog is shown when the cygterm.cfg has been saved on the Cygwin tab of the <a href="../menu/setup-additional.html">Additional settings dialog</a>.</li>
+      <li>added support for IME feedback back and forth function. </li>
     </ul>
   </li>
 

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2012-05-05 12:40:02 UTC (rev 4931)
+++ trunk/doc/ja/html/about/history.html	2012-05-08 16:36:57 UTC (rev 4932)
@@ -72,6 +72,10 @@
         </ul></li>
       <li><a href="..\menu\setup-general.html">General setup\x83_\x83C\x83A\x83\x8D\x83O</a>\x82Ō\xBE\x8C\xEA\x83t\x83@\x83C\x83\x8B\x82\xF0\x8Ew\x92\xE8\x82ł\xAB\x82\xE9\x82悤\x82ɂ\xB5\x82\xBD\x81B</li>
       <li><a href="../menu/setup-additional.html">Additional settings\x83_\x83C\x83A\x83\x8D\x83O</a>\x82\xCCCygwin\x83^\x83u\x82ŁA\x90ݒ\xE8\x95ۑ\xB6\x82ł\xAB\x82\xBD\x8Fꍇ\x81A\x83\x81\x83b\x83Z\x81[\x83W\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x95\\x8E\xA6\x82\xB7\x82\xE9\x82悤\x82ɂ\xB5\x82\xBD\x81B</li>
+      <li>IME\x82̑O\x8C\xE3\x8EQ\x8Dl\x95ϊ\xB7\x8B@\x94\\x82ɑΉ\x9E\x82\xB5\x82\xBD\x81B\x8E\x96\x91O\x82\xC9MS-IME/ATOK\x82ɐݒ肪\x95K\x97v\x81B<br>
+          cf. <a href="http://trendy.nikkeibp.co.jp/article/tec/word/20040317/108107/">\x91O\x8C\xE3\x82̕\xB6\x8E\x9A\x82\xF0\x8EQ\x8FƂ\xB5\x82Č\xF8\x97\xA6\x82悭\x95ϊ\xB7</a>,
+              <a href="http://d.hatena.ne.jp/topiyama/20070703">IME\x82̑O\x8C\xE3\x8EQ\x8Fƕϊ\xB7\x8B@\x94\\x82ɑΉ\x9E\x82\xB7\x82\xE9\x82ɂ\xCD</a>
+        </li>
     </ul>
   </li>
 

Modified: trunk/teraterm/teraterm/buffer.c
===================================================================
--- trunk/teraterm/teraterm/buffer.c	2012-05-05 12:40:02 UTC (rev 4931)
+++ trunk/teraterm/teraterm/buffer.c	2012-05-08 16:36:57 UTC (rev 4932)
@@ -3508,3 +3508,15 @@
 
 	BuffUpdateRect(0, 0, NumOfColumns-1, NumOfLines-1);
 }
+
+// \x8C\xBB\x8Dݍs\x82\xF0\x82܂邲\x82ƃo\x83b\x83t\x83@\x82Ɋi\x94[\x82\xB7\x82\xE9\x81B\x95Ԃ\xE8\x92l\x82͌\xBB\x8D݂̃J\x81[\x83\\x83\x8B\x88ʒu(X)\x81B
+int BuffGetCurrentLineData(char *buf, int bufsize)
+{
+	LONG Ptr;
+
+	Ptr = GetLinePtr(PageStart + CursorY);
+	memset(buf, 0, bufsize);
+	memcpy(buf, &CodeBuff[Ptr], min(NumOfColumns, bufsize - 1));
+	return (CursorX);
+}
+

Modified: trunk/teraterm/teraterm/buffer.h
===================================================================
--- trunk/teraterm/teraterm/buffer.h	2012-05-05 12:40:02 UTC (rev 4931)
+++ trunk/teraterm/teraterm/buffer.h	2012-05-08 16:36:57 UTC (rev 4932)
@@ -78,6 +78,7 @@
 void BuffSelectEraseBox(int XStart, int YStart, int XEnd, int YEnd);
 void BuffScrollLeft(int count);
 void BuffScrollRight(int count);
+int BuffGetCurrentLineData(char *buf, int bufsize);
 
 extern int StatusLine;
 extern int CursorTop, CursorBottom;

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2012-05-05 12:40:02 UTC (rev 4931)
+++ trunk/teraterm/teraterm/vtwin.cpp	2012-05-08 16:36:57 UTC (rev 4932)
@@ -124,6 +124,7 @@
 	ON_MESSAGE(WM_IME_COMPOSITION,OnIMEComposition)
 	ON_MESSAGE(WM_INPUTLANGCHANGE,OnIMEInputChange)
 	ON_MESSAGE(WM_IME_NOTIFY,OnIMENotify)
+	ON_MESSAGE(WM_IME_REQUEST,OnIMERequest)
 //<!--by AKASI
 	ON_MESSAGE(WM_WINDOWPOSCHANGING,OnWindowPosChanging)
 	ON_MESSAGE(WM_SETTINGCHANGE,OnSettingChange)
@@ -2993,6 +2994,45 @@
 	return CFrameWnd::DefWindowProc(WM_IME_NOTIFY,wParam,lParam);
 }
 
+// IME\x82̑O\x8C\xE3\x8EQ\x8Fƕϊ\xB7\x8B@\x94\\x82ւ̑Ή\x9E
+// cf. http://d.hatena.ne.jp/topiyama/20070703
+//     http://ice.hotmint.com/putty/#DOWNLOAD
+// (2012.5.9 yutaka)
+LONG CVTWindow::OnIMERequest(UINT wParam, LONG lParam)
+{
+	int size;
+	char buf[512];
+
+	if (wParam == IMR_DOCUMENTFEED) {
+		size = NumOfColumns + 1;
+		if (lParam == 0) {  // 1\x89\xF1\x96ڂ̌Ăяo\x82\xB5
+			// \x83o\x83b\x83t\x83@\x82̃T\x83C\x83Y\x82\xF0\x95Ԃ\xB7\x82̂݁B
+
+		} else {  // 2\x89\xF1\x96ڂ̌Ăяo\x82\xB5
+			//lParam \x82\xF0 RECONVERTSTRING \x82\xC6 \x95\xB6\x8E\x9A\x97\xF1\x8Ai\x94[\x83o\x83b\x83t\x83@\x82Ɏg\x97p\x82\xB7\x82\xE9
+			RECONVERTSTRING *pReconv   = (RECONVERTSTRING*)lParam;
+			char*  pszParagraph        = (char*)pReconv + sizeof(RECONVERTSTRING);
+			int cx;
+
+			cx = BuffGetCurrentLineData(buf, sizeof(buf));
+	        
+			pReconv->dwSize            = sizeof(RECONVERTSTRING);
+			pReconv->dwVersion         = 0;
+			pReconv->dwStrLen          = size;
+			pReconv->dwStrOffset       = sizeof(RECONVERTSTRING);
+			pReconv->dwCompStrLen      = 0;
+			pReconv->dwCompStrOffset   = 0;
+			pReconv->dwTargetStrLen    = 0;
+			pReconv->dwTargetStrOffset = cx;
+	        
+			memcpy(pszParagraph, buf, size);
+		}
+		return (sizeof(RECONVERTSTRING) + size);
+	}
+
+	return CFrameWnd::DefWindowProc(WM_IME_REQUEST,wParam,lParam);
+}
+
 LONG CVTWindow::OnAccelCommand(UINT wParam, LONG lParam)
 {
 	switch (wParam) {

Modified: trunk/teraterm/teraterm/vtwin.h
===================================================================
--- trunk/teraterm/teraterm/vtwin.h	2012-05-05 12:40:02 UTC (rev 4931)
+++ trunk/teraterm/teraterm/vtwin.h	2012-05-08 16:36:57 UTC (rev 4932)
@@ -99,6 +99,7 @@
 	afx_msg LONG OnIMEComposition(UINT wParam, LONG lParam);
 	afx_msg LONG OnIMEInputChange(UINT wParam, LONG lParam);
 	afx_msg LONG OnIMENotify(UINT wParam, LONG lParam);
+	afx_msg LONG OnIMERequest(UINT wParam, LONG lParam);
 	afx_msg LONG OnAccelCommand(UINT wParam, LONG lParam);
 	afx_msg LONG OnChangeMenu(UINT wParam, LONG lParam);
 	afx_msg LONG OnChangeTBar(UINT wParam, LONG lParam);



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