Diff

Differences From Artifact [008654b50d]:

To Artifact [55aae64522]:


694
695
696
697
698
699
700




701

702
703
704
705
706
707

708
709

710
711
712
713
714
715
716
717
718

719

720
721
722
723
724
725
726
727

728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
	  case IDM_TEL_EOR: back->special (TS_EOR); break;
	  case IDM_TEL_EOF: back->special (TS_EOF); break;
	  case IDM_ABOUT:
	    showabout (hwnd);
	    break;
	}
	break;




      case WM_LBUTTONDOWN:

	click (MB_SELECT, LOWORD(lParam) / font_width,
	       HIWORD(lParam) / font_height);
	return 0;
      case WM_LBUTTONUP:
	term_mouse (MB_SELECT, MA_RELEASE, LOWORD(lParam) / font_width,
		    HIWORD(lParam) / font_height);

	return 0;
      case WM_MBUTTONDOWN:

	click (cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND,
	       LOWORD(lParam) / font_width,
	       HIWORD(lParam) / font_height);
	return 0;
      case WM_MBUTTONUP:
	term_mouse (cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND,
		    MA_RELEASE, LOWORD(lParam) / font_width,
		    HIWORD(lParam) / font_height);
	return 0;

      case WM_RBUTTONDOWN:

	click (cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE,
	       LOWORD(lParam) / font_width,
	       HIWORD(lParam) / font_height);
	return 0;
      case WM_RBUTTONUP:
	term_mouse (cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE,
		    MA_RELEASE, LOWORD(lParam) / font_width,
		    HIWORD(lParam) / font_height);

	return 0;
      case WM_MOUSEMOVE:
	/*
	 * Add the mouse position and message time to the random
	 * number noise, if we're using ssh.
	 */
	if (cfg.protocol == PROT_SSH)
	    noise_ultralight(lParam);

	if (wParam & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) {
	    Mouse_Button b;
	    if (wParam & MK_LBUTTON)
		b = MB_SELECT;
	    else if (wParam & MK_MBUTTON)
		b = cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND;
	    else
		b = cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE;
	    term_mouse (b, MA_DRAG, LOWORD(lParam) / font_width,
			HIWORD(lParam) / font_height);
	}
	lastbtn = MB_NOTHING;
	lastact = MA_NOTHING;
	lasttime = GetMessageTime();
	return 0;
      case WM_IGNORE_CLIP:
	ignore_clip = wParam;	       /* don't panic on DESTROYCLIPBOARD */







>
>
>
>

>
|
|


|
|
>


>

|
|



|
|

>

>

|
|



|
|
>

















|
|







694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
	  case IDM_TEL_EOR: back->special (TS_EOR); break;
	  case IDM_TEL_EOF: back->special (TS_EOF); break;
	  case IDM_ABOUT:
	    showabout (hwnd);
	    break;
	}
	break;

#define X_POS(l) ((int)(short)LOWORD(l))
#define Y_POS(l) ((int)(short)HIWORD(l))

      case WM_LBUTTONDOWN:
        SetCapture(hwnd);
	click (MB_SELECT, X_POS(lParam) / font_width,
	       Y_POS(lParam) / font_height);
	return 0;
      case WM_LBUTTONUP:
	term_mouse (MB_SELECT, MA_RELEASE, X_POS(lParam) / font_width,
		    Y_POS(lParam) / font_height);
        ReleaseCapture();
	return 0;
      case WM_MBUTTONDOWN:
        SetCapture(hwnd);
	click (cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND,
	       X_POS(lParam) / font_width,
	       Y_POS(lParam) / font_height);
	return 0;
      case WM_MBUTTONUP:
	term_mouse (cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND,
		    MA_RELEASE, X_POS(lParam) / font_width,
		    Y_POS(lParam) / font_height);
	return 0;
        ReleaseCapture();
      case WM_RBUTTONDOWN:
        SetCapture(hwnd);
	click (cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE,
	       X_POS(lParam) / font_width,
	       Y_POS(lParam) / font_height);
	return 0;
      case WM_RBUTTONUP:
	term_mouse (cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE,
		    MA_RELEASE, X_POS(lParam) / font_width,
		    Y_POS(lParam) / font_height);
        ReleaseCapture();
	return 0;
      case WM_MOUSEMOVE:
	/*
	 * Add the mouse position and message time to the random
	 * number noise, if we're using ssh.
	 */
	if (cfg.protocol == PROT_SSH)
	    noise_ultralight(lParam);

	if (wParam & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) {
	    Mouse_Button b;
	    if (wParam & MK_LBUTTON)
		b = MB_SELECT;
	    else if (wParam & MK_MBUTTON)
		b = cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND;
	    else
		b = cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE;
	    term_mouse (b, MA_DRAG, X_POS(lParam) / font_width,
			Y_POS(lParam) / font_height);
	}
	lastbtn = MB_NOTHING;
	lastact = MA_NOTHING;
	lasttime = GetMessageTime();
	return 0;
      case WM_IGNORE_CLIP:
	ignore_clip = wParam;	       /* don't panic on DESTROYCLIPBOARD */
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
    return 0;
}

void set_title (char *title) {
    sfree (window_name);
    window_name = smalloc(1+strlen(title));
    strcpy (window_name, title);
    if (!IsIconic(hwnd))
	SetWindowText (hwnd, title);
}

void set_icon (char *title) {
    sfree (icon_name);
    icon_name = smalloc(1+strlen(title));
    strcpy (icon_name, title);
    if (IsIconic(hwnd))
	SetWindowText (hwnd, title);
}

void set_sbar (int total, int start, int page) {
    SCROLLINFO si;
    si.cbSize = sizeof(si);
    si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS | SIF_DISABLENOSCROLL;







|







|







1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
    return 0;
}

void set_title (char *title) {
    sfree (window_name);
    window_name = smalloc(1+strlen(title));
    strcpy (window_name, title);
    if (cfg.win_name_always || !IsIconic(hwnd))
	SetWindowText (hwnd, title);
}

void set_icon (char *title) {
    sfree (icon_name);
    icon_name = smalloc(1+strlen(title));
    strcpy (icon_name, title);
    if (!cfg.win_name_always && IsIconic(hwnd))
	SetWindowText (hwnd, title);
}

void set_sbar (int total, int start, int page) {
    SCROLLINFO si;
    si.cbSize = sizeof(si);
    si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS | SIF_DISABLENOSCROLL;