[Ttssh2-commit] [3507] Meta8Bitを拡張。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 6月 16日 (火) 19:53:55 JST


Revision: 3507
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3507
Author:   doda
Date:     2009-06-16 19:53:55 +0900 (Tue, 16 Jun 2009)

Log Message:
-----------
Meta8Bitを拡張。

  Meta8Bit=off  -- 従来通り ESC を前置する

  Meta8Bit=raw  -- MSBを立てた文字を、そのまま送出する

  Meta8Bit=text -- MSBを立てた文字を、送信漢字コードの設定に従って変換してから送出する
                   変更前の Meta8Bit=on の動作

  Meta8Bit=on   -- Meta8Bit=raw と同じ

Modified Paths:
--------------
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/teraterm/keyboard.c
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/ttpset/ttset.c


-------------- next part --------------
Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2009-06-16 10:02:22 UTC (rev 3506)
+++ trunk/teraterm/common/tttypes.h	2009-06-16 10:53:55 UTC (rev 3507)
@@ -221,6 +221,11 @@
 #define IdTitleChangeRequestAhead     2
 #define IdTitleChangeRequestLast      3
 
+// Meta8Bit mode
+#define IdMeta8BitOff   0
+#define IdMeta8BitRaw   1
+#define IdMeta8BitText  2
+
 #define TitleBuffSize  50
 
 // Eterm lookfeel alphablend structure

Modified: trunk/teraterm/teraterm/keyboard.c
===================================================================
--- trunk/teraterm/teraterm/keyboard.c	2009-06-16 10:02:22 UTC (rev 3506)
+++ trunk/teraterm/teraterm/keyboard.c	2009-06-16 10:53:55 UTC (rev 3507)
@@ -598,14 +598,20 @@
     CodeLength = VKey2KeyStr(VKey, HWin, Code, sizeof(Code), &CodeType, ModStat);
 
     if ((ts.MetaKey>0) && (CodeLength==1) && AltKey()) {
-      if (ts.Meta8Bit) {
-	Code[0] |= 0x80;
+      switch (ts.Meta8Bit) {
+        case IdMeta8BitRaw:
+	  Code[0] |= 0x80;
+	  CodeType = IdBinary;
+	  break;
+        case IdMeta8BitText:
+	  Code[0] |= 0x80;
+	  CodeType = IdText;
+	  break;
+	default:
+          Code[1] = Code[0];
+          Code[0] = 0x1b;
+          CodeLength = 2;
       }
-      else {
-        Code[1] = Code[0];
-        Code[0] = 0x1b;
-        CodeLength = 2;
-      }
       PeekMessage((LPMSG)&M,HWin,WM_SYSCHAR,WM_SYSCHAR,PM_REMOVE);
     }
   }

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2009-06-16 10:02:22 UTC (rev 3506)
+++ trunk/teraterm/teraterm/vtwin.cpp	2009-06-16 10:53:55 UTC (rev 3507)
@@ -2562,19 +2562,29 @@
 		if (!KeybEnabled || (TalkStatus!=IdTalkKeyb)) return;
 		Code = nChar;
 		for (i=1 ; i<=nRepCnt ; i++) {
-			if (ts.Meta8Bit) {
+			switch (ts.Meta8Bit) {
+			  case IdMeta8BitRaw:
 				Code |= 0x80;
-			}
-			else {
-				CommTextOut(&cv,&e,1);
+				CommBinaryBuffOut(&cv, &Code, 1);
 				if (ts.LocalEcho) {
-					CommTextEcho(&cv,&e,1);
+					CommBinaryEcho(&cv, &Code, 1);
 				}
+				break;
+			  case IdMeta8BitText:
+				Code |= 0x80;
+				CommTextOut(&cv, &Code, 1);
+				if (ts.LocalEcho) {
+					CommTextEcho(&cv, &Code, 1);
+				}
+				break;
+			  default:
+				CommTextOut(&cv, &e, 1);
+				CommTextOut(&cv, &Code, 1);
+				if (ts.LocalEcho) {
+					CommTextEcho(&cv, &e, 1);
+					CommTextEcho(&cv, &Code, 1);
+				}
 			}
-			CommTextOut(&cv,&Code,1);
-			if (ts.LocalEcho) {
-				CommTextEcho(&cv,&Code,1);
-			}
 		}
 		return;
 	}

Modified: trunk/teraterm/ttpset/ttset.c
===================================================================
--- trunk/teraterm/ttpset/ttset.c	2009-06-16 10:02:22 UTC (rev 3506)
+++ trunk/teraterm/ttpset/ttset.c	2009-06-16 10:53:55 UTC (rev 3507)
@@ -1296,6 +1296,15 @@
 	// Meta sets MSB
 	ts->Meta8Bit = GetOnOff(Section, "Meta8Bit", FName, FALSE);
 
+	// Meta sets MSB
+	GetPrivateProfileString(Section, "Meta8Bit", "off", Temp, sizeof(Temp), FName);
+	if (_stricmp(Temp, "raw") == 0 || _stricmp(Temp, "on") == 0)
+		ts->Meta8Bit = IdMeta8BitRaw;
+	else if (_stricmp(Temp, "text") == 0)
+		ts->Meta8Bit = IdMeta8BitText;
+	else
+		ts->Meta8Bit = IdMeta8BitOff;
+
 	// Window control sequence
 	if (GetOnOff(Section, "WindowCtrlSequence", FName, TRUE))
 		ts->WindowFlag |= WF_WINDOWCHANGE;
@@ -2261,7 +2270,16 @@
 	         ts->PasteDelayPerLine);
 
 	// Meta sets MSB
-	WriteOnOff(Section, "Meta8Bit", FName, ts->Meta8Bit);
+	switch (ts->Meta8Bit) {
+	  case IdMeta8BitRaw:
+		WritePrivateProfileString(Section, "Meta8Bit", "raw", FName);
+		break;
+	  case IdMeta8BitText:
+		WritePrivateProfileString(Section, "Meta8Bit", "text", FName);
+		break;
+	  default:
+		WritePrivateProfileString(Section, "Meta8Bit", "off", FName);
+	}
 
 	// Window control sequence
 	WriteOnOff(Section, "WindowCtrlSequence", FName,



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