172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
static int dbltime, lasttime, lastact;
static Mouse_Button lastbtn;
/* this allows xterm-style mouse handling. */
static int send_raw_mouse = 0;
static int wheel_accumulator = 0;
static char *window_name, *icon_name;
static int compose_state = 0;
static UINT wm_mousewheel = WM_MOUSEWHEEL;
|
>
>
|
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
static int dbltime, lasttime, lastact;
static Mouse_Button lastbtn;
/* this allows xterm-style mouse handling. */
static int send_raw_mouse = 0;
static int wheel_accumulator = 0;
static int busy_status = BUSY_NOT;
static char *window_name, *icon_name;
static int compose_state = 0;
static UINT wm_mousewheel = WM_MOUSEWHEEL;
|
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
|
InsertMenu(popup_menus[j].menu,
popup_menus[j].specials_submenu_pos,
MF_BYPOSITION | MF_POPUP | MF_ENABLED,
(UINT) p, "S&pecial Command");
}
}
}
/*
* set or clear the "raw mouse message" mode
*/
void set_raw_mouse_mode(void *frontend, int activate)
{
activate = activate && !cfg.no_mouse_rep;
send_raw_mouse = activate;
SetCursor(LoadCursor(NULL, activate ? IDC_ARROW : IDC_IBEAM));
}
/*
* Print a message box and close the connection.
*/
void connection_fatal(void *frontend, char *fmt, ...)
{
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
|
InsertMenu(popup_menus[j].menu,
popup_menus[j].specials_submenu_pos,
MF_BYPOSITION | MF_POPUP | MF_ENABLED,
(UINT) p, "S&pecial Command");
}
}
}
static void update_mouse_pointer(void)
{
LPTSTR curstype;
int force_visible = FALSE;
static int forced_visible = FALSE;
switch (busy_status) {
case BUSY_NOT:
if (send_raw_mouse)
curstype = IDC_ARROW;
else
curstype = IDC_IBEAM;
break;
case BUSY_WAITING:
curstype = IDC_APPSTARTING; /* this may be an abuse */
force_visible = TRUE;
break;
case BUSY_CPU:
curstype = IDC_WAIT;
force_visible = TRUE;
break;
default:
assert(0);
}
{
HCURSOR cursor = LoadCursor(NULL, curstype);
SetClassLong(hwnd, GCL_HCURSOR, (LONG)cursor);
SetCursor(cursor); /* force redraw of cursor at current posn */
}
if (force_visible != forced_visible) {
/* We want some cursor shapes to be visible always.
* Along with show_mouseptr(), this manages the ShowCursor()
* counter such that if we switch back to a non-force_visible
* cursor, the previous visibility state is restored. */
ShowCursor(force_visible);
forced_visible = force_visible;
}
}
void set_busy_status(void *frontend, int status)
{
busy_status = status;
update_mouse_pointer();
}
/*
* set or clear the "raw mouse message" mode
*/
void set_raw_mouse_mode(void *frontend, int activate)
{
activate = activate && !cfg.no_mouse_rep;
send_raw_mouse = activate;
update_mouse_pointer();
}
/*
* Print a message box and close the connection.
*/
void connection_fatal(void *frontend, char *fmt, ...)
{
|
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
|
if (button == MBT_RIGHT)
return cfg.mouse_is_xterm == 1 ? MBT_EXTEND : MBT_PASTE;
return 0; /* shouldn't happen */
}
static void show_mouseptr(int show)
{
static int cursor_visible = 1;
if (!cfg.hide_mouseptr) /* override if this feature disabled */
show = 1;
if (cursor_visible && !show)
ShowCursor(FALSE);
else if (!cursor_visible && show)
ShowCursor(TRUE);
|
>
>
|
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
|
if (button == MBT_RIGHT)
return cfg.mouse_is_xterm == 1 ? MBT_EXTEND : MBT_PASTE;
return 0; /* shouldn't happen */
}
static void show_mouseptr(int show)
{
/* NB that the counter in ShowCursor() is also frobbed by
* update_mouse_pointer() */
static int cursor_visible = 1;
if (!cfg.hide_mouseptr) /* override if this feature disabled */
show = 1;
if (cursor_visible && !show)
ShowCursor(FALSE);
else if (!cursor_visible && show)
ShowCursor(TRUE);
|
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
|
{
char c = (unsigned char)wParam;
term_seen_key_event(term);
if (ldisc)
lpage_send(ldisc, CP_ACP, &c, 1, 1);
}
return 0;
case WM_SETCURSOR:
if (send_raw_mouse && LOWORD(lParam) == HTCLIENT) {
SetCursor(LoadCursor(NULL, IDC_ARROW));
return TRUE;
}
break;
case WM_SYSCOLORCHANGE:
if (cfg.system_colour) {
/* Refresh palette from system colours. */
/* XXX actually this zaps the entire palette. */
systopalette();
init_palette();
/* Force a repaint of the terminal window. */
|
<
<
<
<
<
<
|
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
|
{
char c = (unsigned char)wParam;
term_seen_key_event(term);
if (ldisc)
lpage_send(ldisc, CP_ACP, &c, 1, 1);
}
return 0;
case WM_SYSCOLORCHANGE:
if (cfg.system_colour) {
/* Refresh palette from system colours. */
/* XXX actually this zaps the entire palette. */
systopalette();
init_palette();
/* Force a repaint of the terminal window. */
|