[Ttssh2-commit] [3464] ウィンドウサイズ変更シーケンス ( ピクセル単位 ) に対応。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 6月 10日 (水) 23:22:14 JST


Revision: 3464
          http://svn.sourceforge.jp/view?root=ttssh2&view=rev&rev=3464
Author:   doda
Date:     2009-06-10 23:22:14 +0900 (Wed, 10 Jun 2009)

Log Message:
-----------
ウィンドウサイズ変更シーケンス(ピクセル単位)に対応。
  <CSI> 4 ; H ; W t
     H: ウィンドウの高さ
     W: ウィンドウの横幅

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


-------------- next part --------------
Modified: trunk/teraterm/teraterm/vtdisp.c
===================================================================
--- trunk/teraterm/teraterm/vtdisp.c	2009-06-10 14:19:30 UTC (rev 3463)
+++ trunk/teraterm/teraterm/vtdisp.c	2009-06-10 14:22:14 UTC (rev 3464)
@@ -3385,3 +3385,18 @@
 		break;
 	}
 }
+
+void DispResizeWin(int w, int h) {
+	RECT r;
+
+	if (w <= 0 || h <= 0) {
+		GetWindowRect(HVTWin,&r);
+		if (w <= 0) {
+			w = r.right - r.left;
+		}
+		if (h <= 0) {
+			h = r.bottom - r.top;
+		}
+	}
+	SetWindowPos(HVTWin, 0, 0, 0, w, h, SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE);
+}

Modified: trunk/teraterm/teraterm/vtdisp.h
===================================================================
--- trunk/teraterm/teraterm/vtdisp.h	2009-06-10 14:19:30 UTC (rev 3463)
+++ trunk/teraterm/teraterm/vtdisp.h	2009-06-10 14:22:14 UTC (rev 3464)
@@ -81,6 +81,7 @@
 void DispSetCurCharAttr(TCharAttr Attr);
 void DispMoveWindow(int x, int y);
 void DispShowWindow(int mode);
+void DispResizeWin(int w, int h);
 
 extern int WinWidth, WinHeight;
 extern HFONT VTFont[AttrFontMask+1];

Modified: trunk/teraterm/teraterm/vtterm.c
===================================================================
--- trunk/teraterm/teraterm/vtterm.c	2009-06-10 14:19:30 UTC (rev 3463)
+++ trunk/teraterm/teraterm/vtterm.c	2009-06-10 14:22:14 UTC (rev 3464)
@@ -1774,6 +1774,11 @@
 	if (NParam < 3) Param[3] = 0;
 	DispMoveWindow(Param[2], Param[3]);
 	break;
+      case 4: // set window size by pixel
+        if (NParam < 2) Param[2] = 0;
+	if (NParam < 3) Param[3] = 0;
+	DispResizeWin(Param[3], Param[2]);
+	break;
       case 5: // Raise window
 	DispShowWindow(WINDOW_RAISE);
 	break;



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