[Ttssh2-commit] [3469] ウィンドウ位置報告制御シーケンスに対応。

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2009年 6月 12日 (金) 17:43:03 JST


Revision: 3469
          http://svn.sourceforge.jp/view?root=ttssh2&view=rev&rev=3469
Author:   doda
Date:     2009-06-12 17:43:03 +0900 (Fri, 12 Jun 2009)

Log Message:
-----------
ウィンドウ位置報告制御シーケンスに対応。
  <CSI> 13 t
    応答: <CSI> 3 ; X ; Y t
           X,Y: ウィンドウの位置

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-12 05:45:04 UTC (rev 3468)
+++ trunk/teraterm/teraterm/vtdisp.c	2009-06-12 08:43:03 UTC (rev 3469)
@@ -3405,3 +3405,22 @@
 BOOL DispWindowIconified() {
 	return IsIconic(HVTWin);
 }
+
+void DispGetWindowPos(int *x, int *y) {
+	WINDOWPLACEMENT wndpl;
+
+	wndpl.length = sizeof(WINDOWPLACEMENT);
+	GetWindowPlacement(HVTWin, &wndpl);
+
+	switch (wndpl.showCmd) {
+	  case SW_SHOWMAXIMIZED:
+		*x = wndpl.ptMaxPosition.x;
+		*y = wndpl.ptMaxPosition.y;
+		break;
+	  default:
+	  	*x = wndpl.rcNormalPosition.left;
+		*y = wndpl.rcNormalPosition.top;
+	}
+
+	return;
+}

Modified: trunk/teraterm/teraterm/vtdisp.h
===================================================================
--- trunk/teraterm/teraterm/vtdisp.h	2009-06-12 05:45:04 UTC (rev 3468)
+++ trunk/teraterm/teraterm/vtdisp.h	2009-06-12 08:43:03 UTC (rev 3469)
@@ -83,6 +83,7 @@
 void DispShowWindow(int mode);
 void DispResizeWin(int w, int h);
 BOOL DispWindowIconified();
+void DispGetWindowPos(int *x, int *y);
 
 extern int WinWidth, WinHeight;
 extern HFONT VTFont[AttrFontMask+1];

Modified: trunk/teraterm/teraterm/vtterm.c
===================================================================
--- trunk/teraterm/teraterm/vtterm.c	2009-06-12 05:45:04 UTC (rev 3468)
+++ trunk/teraterm/teraterm/vtterm.c	2009-06-12 08:43:03 UTC (rev 3469)
@@ -1760,6 +1760,7 @@
 
   void CSSunSequence() /* Sun terminal private sequences */
   {
+    int x, y;
     char Report[16];
 
     switch (Param[1]) {
@@ -1808,6 +1809,14 @@
 	  _snprintf_s_l(Report, sizeof(Report), _TRUNCATE, "\033[%dt", CLocale, DispWindowIconified()?2:1);
 	CommBinaryOut(&cv,Report,strlen(Report));
 	break;
+      case 13: // Report window position
+	DispGetWindowPos(&x, &y);
+	if (Send8BitMode)
+	  _snprintf_s_l(Report, sizeof(Report), _TRUNCATE, "\2333;%d;%dt", CLocale, x, y);
+	else
+	  _snprintf_s_l(Report, sizeof(Report), _TRUNCATE, "\033[3;%d;%dt", CLocale, x, y);
+	CommBinaryOut(&cv,Report,strlen(Report));
+	break;
       case 14: /* get window size??? */
 	/* this is not actual window size */
 	if (Send8BitMode)



Ttssh2-commit メーリングリストの案内
アーカイブの一覧に戻る