| ︙ | | |
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
+
+
+
|
static int prev_rows, prev_cols;
static int pending_netevent = 0;
static WPARAM pend_netevent_wParam = 0;
static LPARAM pend_netevent_lParam = 0;
static void enact_pending_netevent(void);
static void flash_window(int mode);
static void sys_cursor_update(void);
static time_t last_movement = 0;
static int caret_x = -1, caret_y = -1;
#define FONT_NORMAL 0
#define FONT_BOLD 1
#define FONT_UNDERLINE 2
#define FONT_BOLDUND 3
#define FONT_WIDE 0x04
#define FONT_HIGH 0x08
|
| ︙ | | |
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
|
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
|
+
|
term_out();
term_update();
break;
case WM_KILLFOCUS:
show_mouseptr(1);
has_focus = FALSE;
DestroyCaret();
caret_x = caret_y = -1; /* ensure caret is replaced next time */
term_out();
term_update();
break;
case WM_ENTERSIZEMOVE:
#ifdef RDB_DEBUG_PATCH
debug((27, "WM_ENTERSIZEMOVE"));
#endif
|
| ︙ | | |
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
|
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
|
+
+
+
|
return rv;
}
/* break; (never reached) */
case WM_FULLSCR_ON_MAX:
fullscr_on_max = TRUE;
break;
case WM_MOVE:
sys_cursor_update();
break;
case WM_SIZE:
#ifdef RDB_DEBUG_PATCH
debug((27, "WM_SIZE %s (%d,%d)",
(wParam == SIZE_MINIMIZED) ? "SIZE_MINIMIZED":
(wParam == SIZE_MAXIMIZED) ? "SIZE_MAXIMIZED":
(wParam == SIZE_RESTORED && resizing) ? "to":
(wParam == SIZE_RESTORED) ? "SIZE_RESTORED":
|
| ︙ | | |
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
|
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
|
+
|
cfg.height = h;
cfg.width = w;
} else
reset_window(0);
}
}
sys_cursor_update();
return 0;
case WM_VSCROLL:
switch (LOWORD(wParam)) {
case SB_BOTTOM:
term_scroll(-1, 0);
break;
case SB_TOP:
|
| ︙ | | |
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
|
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
|
+
|
}
net_pending_errors();
return 0;
case WM_INPUTLANGCHANGE:
/* wParam == Font number */
/* lParam == Locale */
set_input_locale((HKL)lParam);
sys_cursor_update();
break;
case WM_IME_NOTIFY:
if(wParam == IMN_SETOPENSTATUS) {
HIMC hImc = ImmGetContext(hwnd);
ImmSetCompositionFont(hImc, &lfont);
ImmReleaseContext(hwnd, hImc);
return 0;
|
| ︙ | | |
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
|
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
-
-
+
+
|
* Move the system caret. (We maintain one, even though it's
* invisible, for the benefit of blind people: apparently some
* helper software tracks the system caret, so we should arrange to
* have one.)
*/
void sys_cursor(int x, int y)
{
int cx, cy;
if (!has_focus) return;
/*
* Avoid gratuitously re-updating the cursor position and IMM
* window if there's no actual change required.
*/
cx = x * font_width + offset_width;
cy = y * font_height + offset_height;
if (cx == caret_x && cy == caret_y)
return;
caret_x = cx;
caret_y = cy;
sys_cursor_update();
}
static void sys_cursor_update(void)
{
COMPOSITIONFORM cf;
HIMC hIMC;
if (!has_focus) return;
SetCaretPos(x * font_width + offset_width,
y * font_height + offset_height);
if (caret_x < 0 || caret_y < 0)
return;
SetCaretPos(caret_x, caret_y);
/* IMM calls on Win98 and beyond only */
if(osVersion.dwPlatformId == VER_PLATFORM_WIN32s) return; /* 3.11 */
if(osVersion.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS &&
osVersion.dwMinorVersion == 0) return; /* 95 */
/* we should have the IMM functions */
hIMC = ImmGetContext(hwnd);
cf.dwStyle = CFS_POINT;
cf.ptCurrentPos.x = x * font_width + offset_width;
cf.ptCurrentPos.y = y * font_height + offset_height;
cf.ptCurrentPos.x = caret_x;
cf.ptCurrentPos.y = caret_y;
ImmSetCompositionWindow(hIMC, &cf);
ImmReleaseContext(hwnd, hIMC);
}
/*
* Draw a line of text in the window, at given character
|
| ︙ | | |