[Ttssh2-commit] [9138] 現在は使用していない従来のクリップボードに関連する部分を削除

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2021年 1月 27日 (水) 23:41:03 JST


Revision: 9138
          https://osdn.net/projects/ttssh2/scm/svn/commits/9138
Author:   zmatsuo
Date:     2021-01-27 23:41:03 +0900 (Wed, 27 Jan 2021)
Log Message:
-----------
現在は使用していない従来のクリップボードに関連する部分を削除

- 使用していない CBStartSend() を削除
- 使用されなくなる関数、代入だけ行われて参照されない変数削除
- 不要 include 削除
- IdTalkCB 削除 (tttypes.h)

Modified Paths:
--------------
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/teraterm/clipboar.c
    trunk/teraterm/teraterm/clipboar.h
    trunk/teraterm/teraterm/teraterm.cpp
    trunk/teraterm/teraterm/vtwin.cpp

-------------- next part --------------
Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2021-01-27 14:40:46 UTC (rev 9137)
+++ trunk/teraterm/common/tttypes.h	2021-01-27 14:41:03 UTC (rev 9138)
@@ -54,7 +54,6 @@
   /* Talker mode */
 typedef enum {
 	IdTalkKeyb = 0,
-	IdTalkCB = 1,
 	IdTalkFile = 2,
 	IdTalkQuiet = 3,
 	IdTalkSendMem,

Modified: trunk/teraterm/teraterm/clipboar.c
===================================================================
--- trunk/teraterm/teraterm/clipboar.c	2021-01-27 14:40:46 UTC (rev 9137)
+++ trunk/teraterm/teraterm/clipboar.c	2021-01-27 14:41:03 UTC (rev 9138)
@@ -30,89 +30,25 @@
 /* TERATERM.EXE, Clipboard routines */
 #include "teraterm.h"
 #include "tttypes.h"
-#include "vtdisp.h"
-#include "vtterm.h"
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <commctrl.h>
 #define _CRTDBG_MAP_ALLOC
 #include <crtdbg.h>
 #include <wchar.h>
 
 #include "ttwinman.h"
-#include "ttcommon.h"
 #include "ttlib.h"
-#include "dlglib.h"
 #include "codeconv.h"
 
 #include "clipboar.h"
-#include "tt_res.h"
 #include "fileread.h"
 #include "sendmem.h"
 #include "clipboarddlg.h"
 
-// for clipboard paste
-static HGLOBAL CBMemHandle = NULL;
-static PCHAR CBMemPtr = NULL;
-static LONG CBMemPtr2 = 0;
-static BYTE CBByte;
-static BOOL CBRetrySend;
-static BOOL CBRetryEcho;
-static BOOL CBSendCR;
-static BOOL CBEchoOnly;
-static BOOL CBInsertDelay = FALSE;
-
 static const wchar_t BracketStartW[] = L"\033[200~";
 static const wchar_t BracketEndW[] = L"\033[201~";
 
-static void CBEcho(void);
-
-/**
- * \x95\xB6\x8E\x9A\x97񑗐M
- * \x8E\x9F\x82̂Ƃ\xB1\x82납\x82\xE7\x8Eg\x97p\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9
- *  - DDE(TTL)
- *	- \x83u\x83\x8D\x81[\x83h\x83L\x83\x83\x83X\x83g
- */
-void CBStartSend(PCHAR DataPtr, int DataSize, BOOL EchoOnly)
-{
-	if (! cv.Ready) {
-		return;
-	}
-	if (TalkStatus!=IdTalkKeyb) {
-		return;
-	}
-
-	CBEchoOnly = EchoOnly;
-
-	if (CBMemHandle) {
-		GlobalFree(CBMemHandle);
-	}
-	CBMemHandle = NULL;
-	CBMemPtr = NULL;
-	CBMemPtr2 = 0;
-
-	CBInsertDelay = FALSE;
-
-	CBRetrySend = FALSE;
-	CBRetryEcho = FALSE;
-	CBSendCR = FALSE;
-
-	if ((CBMemHandle = GlobalAlloc(GHND, DataSize+1)) != NULL) {
-		if ((CBMemPtr = GlobalLock(CBMemHandle)) != NULL) {
-			memcpy(CBMemPtr, DataPtr, DataSize);
-			// WM_COPYDATA \x82ő\x97\x82\xE7\x82\xEA\x82ė\x88\x82\xBD\x83f\x81[\x83^\x82\xCD NUL Terminate \x82\xB3\x82\xEA\x82Ă\xA2\x82Ȃ\xA2\x82̂\xC5 NUL \x82\xF0\x95t\x89\xC1\x82\xB7\x82\xE9
-			CBMemPtr[DataSize] = 0;
-			GlobalUnlock(CBMemHandle);
-			CBMemPtr=NULL;
-			TalkStatus=IdTalkCB;
-		}
-	}
-	if (TalkStatus != IdTalkCB) {
-		CBEndPaste();
-	}
-}
-
 static void TrimTrailingNLW(wchar_t *src)
 {
 	wchar_t *tail = src + wcslen(src) - 1;
@@ -271,7 +207,6 @@
 
 void CBStartPaste(HWND HWin, BOOL AddCR, BOOL Bracketed)
 {
-//	unsigned int StrLen = 0;
 	wchar_t *str_w;
 	wchar_t *str_w_edited;
 
@@ -282,12 +217,9 @@
 		return;
 	}
 
-	CBEchoOnly = FALSE;
-
 	str_w = GetClipboardTextW(HWin, FALSE);
 	if (str_w == NULL || !IsTextW(str_w, 0)) {
 		// \x83N\x83\x8A\x83b\x83v\x83{\x81[\x83h\x82\xA9\x82當\x8E\x9A\x97\xF1\x82\xF0\x8E擾\x82ł\xAB\x82Ȃ\xA9\x82\xC1\x82\xBD
-		CBEndPaste();
 		return;
 	}
 
@@ -305,7 +237,6 @@
 
 	if (!CheckClipboardContentW(HWin, str_w, AddCR, &str_w_edited)) {
 		free(str_w);
-		CBEndPaste();
 		return;
 	}
 	if (str_w_edited != NULL) {
@@ -363,8 +294,6 @@
 		return;
 	}
 
-	CBEchoOnly = FALSE;
-
 	str_w = GetClipboardTextW(HWin, FALSE);
 	if (str_w == NULL || !IsTextW(str_w, 0)) {
 		// \x83N\x83\x8A\x83b\x83v\x83{\x81[\x83h\x82\xA9\x82當\x8E\x9A\x97\xF1\x82\xF0\x8E擾\x82ł\xAB\x82Ȃ\xA9\x82\xC1\x82\xBD
@@ -423,184 +352,5 @@
 	free(str_w);
 	free(str_mb);
 	free(str_b64);
-	CBEndPaste();
 	return;
 }
-
-// \x82\xB1\x82̊֐\x94\x82̓N\x83\x8A\x83b\x83v\x83{\x81[\x83h\x82\xA8\x82\xE6\x82\xD1DDE\x83f\x81[\x83^\x82\xF0\x92[\x96\x96\x82֑\x97\x82荞\x82ށB
-//
-// CBMemHandle\x83n\x83\x93\x83h\x83\x8B\x82̓O\x83\x8D\x81[\x83o\x83\x8B\x95ϐ\x94\x82Ȃ̂ŁA\x82\xB1\x82̊֐\x94\x82\xAA\x8FI\x97\xB9\x82\xB7\x82\xE9\x82܂ł́A
-// \x8E\x9F\x82̃N\x83\x8A\x83b\x83v\x83{\x81[\x83h\x82\xA8\x82\xE6\x82\xD1DDE\x83f\x81[\x83^\x82\xF0\x8F\x88\x97\x9D\x82\xB7\x82邱\x82Ƃ͂ł\xAB\x82Ȃ\xA2\x81i\x94j\x8A\xFC\x82\xB3\x82\xEA\x82\xE9\x89”\\x90\xAB\x82\xA0\x82\xE8\x81j\x81B
-// \x82܂\xBD\x81A\x83f\x81[\x83^\x97\xF1\x82\xC5 null-terminate \x82\xB3\x82\xEA\x82Ă\xA2\x82邱\x82Ƃ\xF0\x91O\x92\xF1\x82Ƃ\xB5\x82Ă\xA2\x82邽\x82߁A\x8C㑱\x82̃f\x81[\x83^\x97\xF1\x82\xCD
-// \x96\xB3\x8E\x8B\x82\xB3\x82\xEA\x82\xE9\x81B
-// (2006.11.6 yutaka)
-void CBSend()
-{
-	int c;
-	BOOL EndFlag;
-	static DWORD lastcr;
-	DWORD now;
-
-	if (CBMemHandle==NULL) {
-		return;
-	}
-
-	if (CBEchoOnly) {
-		CBEcho();
-		return;
-	}
-
-	if (CBInsertDelay) {
-		now = GetTickCount();
-		if (now - lastcr < (DWORD)ts.PasteDelayPerLine) {
-			return;
-		}
-	}
-
-	if (CBRetrySend) {
-		CBRetryEcho = (ts.LocalEcho>0);
-		c = CommTextOut(&cv,(PCHAR)&CBByte,1);
-		CBRetrySend = (c==0);
-		if (CBRetrySend) {
-			return;
-		}
-	}
-
-	if (CBRetryEcho) {
-		c = CommTextEcho(&cv,(PCHAR)&CBByte,1);
-		CBRetryEcho = (c==0);
-		if (CBRetryEcho) {
-			return;
-		}
-	}
-
-	CBMemPtr = GlobalLock(CBMemHandle);
-	if (CBMemPtr==NULL) {
-		return;
-	}
-
-	do {
-		if (CBSendCR && (CBMemPtr[CBMemPtr2]==0x0a)) {
-			CBMemPtr2++;
-			// added PasteDelayPerLine (2009.4.12 maya)
-			if (CBInsertDelay) {
-				lastcr = now;
-				CBSendCR = FALSE;
-				SetTimer(HVTWin, IdPasteDelayTimer, ts.PasteDelayPerLine, NULL);
-				break;
-			}
-		}
-
-		EndFlag = (CBMemPtr[CBMemPtr2]==0);
-		if (! EndFlag) {
-			CBByte = CBMemPtr[CBMemPtr2];
-			CBMemPtr2++;
-// Decoding characters which are encoded by MACRO
-//   to support NUL character sending
-//
-//  [encoded character] --> [decoded character]
-//         01 01        -->     00
-//         01 02        -->     01
-			if (CBByte==0x01) { /* 0x01 from MACRO */
-				CBByte = CBMemPtr[CBMemPtr2];
-				CBMemPtr2++;
-				CBByte = CBByte - 1; // character just after 0x01
-			}
-		}
-		else {
-			CBEndPaste();
-			return;
-		}
-
-		if (! EndFlag) {
-			c = CommTextOut(&cv,(PCHAR)&CBByte,1);
-			CBSendCR = (CBByte==0x0D);
-			CBRetrySend = (c==0);
-			if ((! CBRetrySend) &&
-			    (ts.LocalEcho>0)) {
-				c = CommTextEcho(&cv,(PCHAR)&CBByte,1);
-				CBRetryEcho = (c==0);
-			}
-		}
-		else {
-			c=0;
-		}
-	}
-	while (c>0);
-
-	if (CBMemPtr!=NULL) {
-		GlobalUnlock(CBMemHandle);
-		CBMemPtr=NULL;
-	}
-}
-
-static void CBEcho()
-{
-	if (CBMemHandle==NULL) {
-		return;
-	}
-
-	if (CBRetryEcho && CommTextEcho(&cv,(PCHAR)&CBByte,1) == 0) {
-		return;
-	}
-
-	if ((CBMemPtr = GlobalLock(CBMemHandle)) == NULL) {
-		return;
-	}
-
-	do {
-		if (CBSendCR && (CBMemPtr[CBMemPtr2]==0x0a)) {
-			CBMemPtr2++;
-		}
-
-		if (CBMemPtr[CBMemPtr2] == 0) {
-			CBRetryEcho = FALSE;
-			CBEndPaste();
-			return;
-		}
-
-		CBByte = CBMemPtr[CBMemPtr2];
-		CBMemPtr2++;
-
-		// Decoding characters which are encoded by MACRO
-		//   to support NUL character sending
-		//
-		//  [encoded character] --> [decoded character]
-		//         01 01        -->     00
-		//         01 02        -->     01
-		if (CBByte==0x01) { /* 0x01 from MACRO */
-			CBByte = CBMemPtr[CBMemPtr2];
-			CBMemPtr2++;
-			CBByte = CBByte - 1; // character just after 0x01
-		}
-
-		CBSendCR = (CBByte==0x0D);
-
-	} while (CommTextEcho(&cv,(PCHAR)&CBByte,1) > 0);
-
-	CBRetryEcho = TRUE;
-
-	if (CBMemHandle != NULL) {
-		GlobalUnlock(CBMemHandle);
-		CBMemPtr=NULL;
-	}
-}
-
-void CBEndPaste()
-{
-	TalkStatus = IdTalkKeyb;
-
-	if (CBMemHandle!=NULL) {
-		if (CBMemPtr!=NULL) {
-			GlobalUnlock(CBMemHandle);
-		}
-		GlobalFree(CBMemHandle);
-	}
-
-	CBMemHandle = NULL;
-	CBMemPtr = NULL;
-	CBMemPtr2 = 0;
-	CBEchoOnly = FALSE;
-	CBInsertDelay = FALSE;
-	_CrtCheckMemory();
-}

Modified: trunk/teraterm/teraterm/clipboar.h
===================================================================
--- trunk/teraterm/teraterm/clipboar.h	2021-01-27 14:40:46 UTC (rev 9137)
+++ trunk/teraterm/teraterm/clipboar.h	2021-01-27 14:41:03 UTC (rev 9138)
@@ -38,11 +38,8 @@
 /* prototypes */
 
 
-void CBStartSend(PCHAR DataPtr, int DataSize, BOOL EchoOnly);
 void CBStartPaste(HWND HWin, BOOL AddCR, BOOL Bracketed);
 void CBStartPasteB64(HWND HWin, PCHAR header, PCHAR footer);
-void CBSend(void);
-void CBEndPaste(void);
 
 
 #ifdef __cplusplus

Modified: trunk/teraterm/teraterm/teraterm.cpp
===================================================================
--- trunk/teraterm/teraterm/teraterm.cpp	2021-01-27 14:40:46 UTC (rev 9137)
+++ trunk/teraterm/teraterm/teraterm.cpp	2021-01-27 14:41:03 UTC (rev 9138)
@@ -192,9 +192,6 @@
 
 		/* Talker */
 		switch (TalkStatus) {
-		case IdTalkCB:
-			CBSend();
-			break; /* clip board */
 		case IdTalkFile:
 			FileSend();
 			break; /* file */

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2021-01-27 14:40:46 UTC (rev 9137)
+++ trunk/teraterm/teraterm/vtwin.cpp	2021-01-27 14:41:03 UTC (rev 9138)
@@ -5396,9 +5396,6 @@
 		SendMemContinuously();
 	}
 #endif
-	if (TalkStatus == IdTalkCB) {
-		CBSend();
-	}
 	// \x91\x97\x90M\x89”\\x82ȏ\xF3\x91ԂłȂ\xAF\x82\xEA\x82΃G\x83\x89\x81[
 	if (TalkStatus != IdTalkKeyb) {
 		return 0;


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