[Ttssh2-commit] [5090] DECFRAに対応。

svnno****@sourc***** svnno****@sourc*****
2012年 12月 4日 (火) 12:59:27 JST


Revision: 5090
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5090
Author:   doda
Date:     2012-12-04 12:59:26 +0900 (Tue, 04 Dec 2012)
Log Message:
-----------
DECFRAに対応。

Modified Paths:
--------------
    trunk/teraterm/teraterm/buffer.c
    trunk/teraterm/teraterm/buffer.h
    trunk/teraterm/teraterm/vtterm.c

-------------- next part --------------
Modified: trunk/teraterm/teraterm/buffer.c
===================================================================
--- trunk/teraterm/teraterm/buffer.c	2012-12-04 00:54:13 UTC (rev 5089)
+++ trunk/teraterm/teraterm/buffer.c	2012-12-04 03:59:26 UTC (rev 5090)
@@ -962,6 +962,45 @@
 	BuffUpdateRect(XStart,YStart,XEnd,YEnd);
 }
 
+void BuffFillBox(char ch, int XStart, int YStart, int XEnd, int YEnd)
+{
+	int Cols, i;
+	LONG Ptr;
+
+	if (XEnd>NumOfColumns-1) {
+		XEnd = NumOfColumns-1;
+	}
+	if (YEnd>NumOfLines-1-StatusLine) {
+		YEnd = NumOfLines-1-StatusLine;
+	}
+	if (XStart>XEnd) {
+		return;
+	}
+	if (YStart>YEnd) {
+		return;
+	}
+	Cols = XEnd-XStart+1;
+	Ptr = GetLinePtr(PageStart+YStart);
+	for (i=YStart; i<=YEnd; i++) {
+		if ((XStart>0) &&
+		    ((AttrBuff[Ptr+XStart-1] & AttrKanji) != 0)) {
+			CodeBuff[Ptr+XStart-1] = 0x20;
+			AttrBuff[Ptr+XStart-1] ^= AttrKanji;
+		}
+		if ((XStart+Cols<NumOfColumns) &&
+		    ((AttrBuff[Ptr+XStart+Cols-1] & AttrKanji) != 0)) {
+			CodeBuff[Ptr+XStart+Cols] = 0x20;
+		}
+		memset(&(CodeBuff[Ptr+XStart]), ch, Cols);
+		memset(&(AttrBuff[Ptr+XStart]), CurCharAttr.Attr, Cols);
+		memset(&(AttrBuff2[Ptr+XStart]), CurCharAttr.Attr2 & Attr2ColorMask, Cols);
+		memset(&(AttrBuffFG[Ptr+XStart]), CurCharAttr.Fore, Cols);
+		memset(&(AttrBuffBG[Ptr+XStart]), CurCharAttr.Back, Cols);
+		Ptr = NextLinePtr(Ptr);
+	}
+	BuffUpdateRect(XStart, YStart, XEnd, YEnd);
+}
+
 void BuffCopyBox(
 	int SrcXStart, int SrcYStart, int SrcXEnd, int SrcYEnd, int SrcPage,
 	int DstX, int DstY, int DstPage)

Modified: trunk/teraterm/teraterm/buffer.h
===================================================================
--- trunk/teraterm/teraterm/buffer.h	2012-12-04 00:54:13 UTC (rev 5089)
+++ trunk/teraterm/teraterm/buffer.h	2012-12-04 03:59:26 UTC (rev 5090)
@@ -29,6 +29,7 @@
 void BuffFillWithE();
 void BuffDrawLine(TCharAttr Attr, int Direction, int C);
 void BuffEraseBox(int XStart, int YStart, int XEnd, int YEnd);
+void BuffFillBox(char c, int XStart, int YStart, int XEnd, int YEnd);
 void BuffCopyBox(int SrcXStart, int SrcYStart, int SrcXEnd, int SrcYEnd, int SrcPage, int DstX, int DstY, int DstPage);
 void BuffCBCopy(BOOL Table);
 void BuffPrint(BOOL ScrollRegion);

Modified: trunk/teraterm/teraterm/vtterm.c
===================================================================
--- trunk/teraterm/teraterm/vtterm.c	2012-12-04 00:54:13 UTC (rev 5089)
+++ trunk/teraterm/teraterm/vtterm.c	2012-12-04 03:59:26 UTC (rev 5090)
@@ -2842,6 +2842,30 @@
 	  BuffCopyBox(Param[2], Param[1], Param[4], Param[3], Param[5], Param[7], Param[6], Param[8]);
 	}
 	break;
+      case 'x': // DECFRA
+	if (NParam < 1 || Param[1] < 32 || (Param[1] > 127 && Param[1] < 160) || Param[1] > 255) {
+	  return;
+	}
+	if (Param[2] < 1 || NParam < 2) Param[2] = 1;
+	if (Param[3] < 1 || NParam < 3) Param[3] = 1;
+	if (Param[4] < 1 || NParam < 4) Param[4] = NumOfLines-StatusLine;
+	if (Param[5] < 1 || NParam < 5) Param[5] = NumOfColumns;
+	if (Param[2] > Param[4] || Param[3] > Param[5]) {
+	  return;
+	}
+	if (RelativeOrgMode) {
+	  Param[2] += CursorTop;
+	  if (Param[2] > CursorBottom) {
+	    Param[2] = CursorBottom + 1;
+	  }
+	  Param[4] += CursorTop;
+	  if (Param[4] > CursorBottom) {
+	    Param[4] = CursorBottom + 1;
+	  }
+	}
+	BuffFillBox(Param[1], Param[3]-1, Param[2]-1, Param[5]-1, Param[4]-1);
+	break;
+
       case 'z': // DECERA
       case '{': // DECSERA
 	if (Param[1] < 1 || NParam < 1) Param[1]=1;



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