Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/teraterm/teraterm/vtterm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 9315 by zmatsuo, Sun Jun 20 01:08:06 2021 UTC revision 9354 by zmatsuo, Thu Aug 12 03:06:23 2021 UTC
# Line 57  Line 57 
57  #include "unicode.h"  #include "unicode.h"
58  #include "ttdde.h"  #include "ttdde.h"
59  #include "checkeol.h"  #include "checkeol.h"
60    #include "asprintf.h"
61    
62  #include "vtterm.h"  #include "vtterm.h"
63    
# Line 5071  void XsProcColor(int mode, unsigned int Line 5072  void XsProcColor(int mode, unsigned int
5072  static void XsProcClipboard(PCHAR buff)  static void XsProcClipboard(PCHAR buff)
5073  {  {
5074          int len, blen;          int len, blen;
5075          char *p, *cbbuff, hdr[20], notify_buff[256], notify_title[MAX_UIMSG];          char *p, *cbbuff, hdr[20];
5076            wchar_t *notify_buff, *notify_title;
5077          HGLOBAL cbmem;          HGLOBAL cbmem;
5078          int wide_len;          int wide_len;
5079          HGLOBAL wide_cbmem;          HGLOBAL wide_cbmem;
# Line 5086  static void XsProcClipboard(PCHAR buff) Line 5088  static void XsProcClipboard(PCHAR buff)
5088                  if (*p == '?' && *(p+1) == 0) { // Read access                  if (*p == '?' && *(p+1) == 0) { // Read access
5089                          if (ts.CtrlFlag & CSF_CBREAD) {                          if (ts.CtrlFlag & CSF_CBREAD) {
5090                                  if (ts.NotifyClipboardAccess) {                                  if (ts.NotifyClipboardAccess) {
5091                                          get_lang_msg("MSG_CBACCESS_TITLE", notify_title, sizeof(notify_title),                                          GetI18nStrWW("Tera Term", "MSG_CBACCESS_TITLE",
5092                                                       "Clipboard Access", ts.UILanguageFile);                                                                   L"Clipboard Access", ts.UILanguageFileW, &notify_title);
5093                                          get_lang_msg("MSG_CBACCESS_READ", notify_buff, sizeof(notify_buff),                                          GetI18nStrWW("Tera Term", "MSG_CBACCESS_READ",
5094                                                       "Remote host reads clipboard contents.", ts.UILanguageFile);                                                                   L"Remote host reads clipboard contents.", ts.UILanguageFileW, &notify_buff);
5095                                          NotifyInfoMessage(&cv, notify_buff, notify_title);                                          NotifyInfoMessageW(&cv, notify_buff, notify_title);
5096                                            free(notify_title);
5097                                            free(notify_buff);
5098                                  }                                  }
5099                                  strncpy_s(hdr, sizeof(hdr), "\033]52;", _TRUNCATE);                                  strncpy_s(hdr, sizeof(hdr), "\033]52;", _TRUNCATE);
5100                                  if (strncat_s(hdr, sizeof(hdr), buff, p - buff) == 0) {                                  if (strncat_s(hdr, sizeof(hdr), buff, p - buff) == 0) {
# Line 5098  static void XsProcClipboard(PCHAR buff) Line 5102  static void XsProcClipboard(PCHAR buff)
5102                                  }                                  }
5103                          }                          }
5104                          else if (ts.NotifyClipboardAccess) {                          else if (ts.NotifyClipboardAccess) {
5105                                  get_lang_msg("MSG_CBACCESS_REJECT_TITLE", notify_title, sizeof(notify_title),                                  GetI18nStrWW("Tera Term", "MSG_CBACCESS_REJECT_TITLE",
5106                                               "Rejected Clipboard Access", ts.UILanguageFile);                                               L"Rejected Clipboard Access", ts.UILanguageFileW, &notify_title);
5107                                  get_lang_msg("MSG_CBACCESS_READ_REJECT", notify_buff, sizeof(notify_buff),                                  GetI18nStrWW("Tera Term", "MSG_CBACCESS_READ_REJECT",
5108                                               "Reject clipboard read access from remote.", ts.UILanguageFile);                                               L"Reject clipboard read access from remote.", ts.UILanguageFileW, &notify_buff);
5109                                  NotifyWarnMessage(&cv, notify_buff, notify_title);                                  NotifyWarnMessageW(&cv, notify_buff, notify_title);
5110                                    free(notify_title);
5111                                    free(notify_buff);
5112                          }                          }
5113                  }                  }
5114                  else if (ts.CtrlFlag & CSF_CBWRITE) { // Write access                  else if (ts.CtrlFlag & CSF_CBWRITE) { // Write access
# Line 5129  static void XsProcClipboard(PCHAR buff) Line 5135  static void XsProcClipboard(PCHAR buff)
5135                          GlobalUnlock(cbmem);                          GlobalUnlock(cbmem);
5136    
5137                          if (ts.NotifyClipboardAccess) {                          if (ts.NotifyClipboardAccess) {
5138                                  get_lang_msg("MSG_CBACCESS_TITLE", notify_title, sizeof(notify_title),                                  wchar_t *buf;
5139                                               "Clipboard Access", ts.UILanguageFile);                                  GetI18nStrWW("Tera Term", "MSG_CBACCESS_TITLE",
5140                                  get_lang_msg("MSG_CBACCESS_WRITE", ts.UIMsg, sizeof(ts.UIMsg),                                               L"Clipboard Access", ts.UILanguageFileW, &notify_title);
5141                                               "Remote host wirtes clipboard.", ts.UILanguageFile);                                  GetI18nStrWW("Tera Term", "MSG_CBACCESS_WRITE",
5142                                  _snprintf_s(notify_buff, sizeof(notify_buff), _TRUNCATE, "%s\n--\n%s", ts.UIMsg, cbbuff);                                                           L"Remote host wirtes clipboard.", ts.UILanguageFileW, &buf);
5143                                  NotifyInfoMessage(&cv, notify_buff, notify_title);                                  aswprintf(&notify_buff, L"%s\n--\n%hs", buf, cbbuff);
5144                                    NotifyInfoMessageW(&cv, notify_buff, notify_title);
5145                                    free(buf);
5146                                    free(notify_title);
5147                                    free(notify_buff);
5148                          }                          }
5149    
5150                          wide_len = MultiByteToWideChar(CP_ACP, 0, cbbuff, -1, NULL, 0);                          wide_len = MultiByteToWideChar(CP_ACP, 0, cbbuff, -1, NULL, 0);
# Line 5155  static void XsProcClipboard(PCHAR buff) Line 5165  static void XsProcClipboard(PCHAR buff)
5165                          }                          }
5166                  }                  }
5167                  else if (ts.NotifyClipboardAccess) {                  else if (ts.NotifyClipboardAccess) {
5168                          get_lang_msg("MSG_CBACCESS_REJECT_TITLE", notify_title, sizeof(notify_title),                          GetI18nStrWW("Tera Term", "MSG_CBACCESS_REJECT_TITLE",
5169                                       "Rejected Clipboard Access", ts.UILanguageFile);                                       L"Rejected Clipboard Access", ts.UILanguageFileW, &notify_title);
5170                          get_lang_msg("MSG_CBACCESS_WRITE_REJECT", notify_buff, sizeof(notify_buff),                          GetI18nStrWW("Tera Term", "MSG_CBACCESS_WRITE_REJECT",
5171                                       "Reject clipboard write access from remote.", ts.UILanguageFile);                                                   L"Reject clipboard write access from remote.", ts.UILanguageFileW, &notify_buff);
5172                          NotifyWarnMessage(&cv, notify_buff, notify_title);                          NotifyWarnMessageW(&cv, notify_buff, notify_title);
5173                            free(notify_title);
5174                            free(notify_buff);
5175                  }                  }
5176          }          }
5177  }  }

Legend:
Removed from v.9315  
changed lines
  Added in v.9354

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26