X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/ab2c86b9e339e4c0a7d824b1f7ec4efcce985d79..c85623f918b8a6c639afc15604414f9b113bb20d:/window.c diff --git a/window.c b/window.c index 1aa20908..aac6ac6a 100644 --- a/window.c +++ b/window.c @@ -87,7 +87,6 @@ static void init_fonts(int, int); static void another_font(int); static void deinit_fonts(void); static void set_input_locale(HKL); -static int do_mouse_wheel_msg(UINT message, WPARAM wParam, LPARAM lParam); static int is_full_screen(void); static void make_full_screen(void); @@ -108,12 +107,26 @@ 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 int is_shift_pressed(void); static int get_fullscreen_rect(RECT * ss); static time_t last_movement = 0; static int caret_x = -1, caret_y = -1; +static int kbd_codepage; + +static void *ldisc; +static Backend *back; +static void *backhandle; + +static struct unicode_data ucsdata; +static int session_closed; + +Config cfg; /* exported to windlg.c */ + +extern struct sesslist sesslist; /* imported from windlg.c */ + #define FONT_NORMAL 0 #define FONT_BOLD 1 #define FONT_UNDERLINE 2 @@ -168,7 +181,7 @@ static OSVERSIONINFO osVersion; static UINT wm_mousewheel = WM_MOUSEWHEEL; /* Dummy routine, only required in plink. */ -void ldisc_update(int echo, int edit) +void ldisc_update(void *frontend, int echo, int edit) { } @@ -319,7 +332,8 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) char *p = argv[i]; int ret; - ret = cmdline_process_param(p, i+1init((void *)term, + error = back->init((void *)term, &backhandle, &cfg, cfg.host, cfg.port, &realhost, cfg.tcp_nodelay); + back->provide_logctx(backhandle, logctx); if (error) { sprintf(msg, "Unable to open connection to\n" "%.800s\n" "%s", cfg.host, error); @@ -616,10 +637,20 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) title = msg; } sfree(realhost); - set_title(title); - set_icon(title); + set_title(NULL, title); + set_icon(NULL, title); } + /* + * Connect the terminal to the backend for resize purposes. + */ + term_provide_resize_fn(term, back->size, backhandle); + + /* + * Set up a line discipline. + */ + ldisc = ldisc_create(&cfg, term, back, backhandle, NULL); + session_closed = FALSE; /* @@ -665,10 +696,12 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) AppendMenu(m, MF_ENABLED, IDM_NEWSESS, "Ne&w Session..."); AppendMenu(m, MF_ENABLED, IDM_DUPSESS, "&Duplicate Session"); s = CreateMenu(); - get_sesslist(TRUE); - for (i = 1; i < ((nsessions < 256) ? nsessions : 256); i++) + get_sesslist(&sesslist, TRUE); + for (i = 1; + i < ((sesslist.nsessions < 256) ? sesslist.nsessions : 256); + i++) AppendMenu(s, MF_ENABLED, IDM_SAVED_MIN + (16 * i), - sessions[i]); + sesslist.sessions[i]); AppendMenu(m, MF_POPUP | MF_ENABLED, (UINT) s, "Sa&ved Sessions"); AppendMenu(m, MF_ENABLED, IDM_RECONF, "Chan&ge Settings..."); AppendMenu(m, MF_SEPARATOR, 0, 0); @@ -692,7 +725,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) /* * Open the initial log file if there is one. */ - logfopen(); + logfopen(logctx); /* * Finally show the window! @@ -850,7 +883,7 @@ char *do_select(SOCKET skt, int startup) /* * set or clear the "raw mouse message" mode */ -void set_raw_mouse_mode(int activate) +void set_raw_mouse_mode(void *frontend, int activate) { activate = activate && !cfg.no_mouse_rep; send_raw_mouse = activate; @@ -860,7 +893,7 @@ void set_raw_mouse_mode(int activate) /* * Print a message box and close the connection. */ -void connection_fatal(char *fmt, ...) +void connection_fatal(void *frontend, char *fmt, ...) { va_list ap; char stuff[200]; @@ -1082,16 +1115,15 @@ static void init_fonts(int pick_width, int pick_height) /* !!! Yes the next line is right */ if (cset == OEM_CHARSET) - font_codepage = GetOEMCP(); + ucsdata.font_codepage = GetOEMCP(); else - if (TranslateCharsetInfo - ((DWORD *) cset, &info, TCI_SRCCHARSET)) font_codepage = - info.ciACP; + if (TranslateCharsetInfo ((DWORD *) cset, &info, TCI_SRCCHARSET)) + ucsdata.font_codepage = info.ciACP; else - font_codepage = -1; + ucsdata.font_codepage = -1; - GetCPInfo(font_codepage, &cpinfo); - dbcs_screenfont = (cpinfo.MaxCharSize > 1); + GetCPInfo(ucsdata.font_codepage, &cpinfo); + ucsdata.dbcs_screenfont = (cpinfo.MaxCharSize > 1); } f(FONT_UNDERLINE, cfg.fontcharset, fw_dontcare, TRUE); @@ -1179,7 +1211,7 @@ static void init_fonts(int pick_width, int pick_height) } fontflag[0] = fontflag[1] = fontflag[2] = 1; - init_ucs_tables(); + init_ucs(&cfg, &ucsdata); } static void another_font(int fontno) @@ -1241,7 +1273,7 @@ static void deinit_fonts(void) } } -void request_resize(int w, int h) +void request_resize(void *frontend, int w, int h) { int width, height; @@ -1538,7 +1570,7 @@ static void click(Mouse_Button b, int x, int y, int shift, int ctrl, int alt) * Translate a raw mouse button designation (LEFT, MIDDLE, RIGHT) * into a cooked one (SELECT, EXTEND, PASTE). */ -Mouse_Button translate_button(Mouse_Button button) +Mouse_Button translate_button(void *frontend, Mouse_Button button) { if (button == MBT_LEFT) return MBT_SELECT; @@ -1610,7 +1642,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, time_t now; time(&now); if (now - last_movement > cfg.ping_interval) { - back->special(TS_PING); + back->special(backhandle, TS_PING); last_movement = now; } } @@ -1674,9 +1706,9 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, sprintf(c, "putty &%p", filemap); cl = c; } else if (wParam == IDM_SAVEDSESS) { - if ((lParam - IDM_SAVED_MIN) / 16 < nsessions) { + if ((lParam - IDM_SAVED_MIN) / 16 < sesslist.nsessions) { char *session = - sessions[(lParam - IDM_SAVED_MIN) / 16]; + sesslist.sessions[(lParam - IDM_SAVED_MIN) / 16]; cl = smalloc(16 + strlen(session)); /* 8, but play safe */ if (!cl) @@ -1732,18 +1764,15 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, } } - if (strcmp(prev_cfg.logfilename, cfg.logfilename) || - prev_cfg.logtype != cfg.logtype) { - logfclose(); /* reset logging */ - logfopen(); - } + /* Pass new config data to the logging module */ + log_reconfig(logctx, &cfg); sfree(logpal); /* * Flush the line discipline's edit buffer in the * case where local editing has just been disabled. */ - ldisc_send(NULL, 0, 0); + ldisc_send(ldisc, NULL, 0, 0); if (pal) DeleteObject(pal); logpal = NULL; @@ -1751,8 +1780,11 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, cfgtopalette(); init_palette(); - /* Give terminal a heads-up on miscellaneous stuff */ - term_reconfig(term); + /* Pass new config data to the terminal */ + term_reconfig(term, &cfg); + + /* Pass new config data to the back end */ + back->reconfig(backhandle, &cfg); /* Screen size changed ? */ if (cfg.height != prev_cfg.height || @@ -1825,7 +1857,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, init_lvl = 2; } - set_title(cfg.wintitle); + set_title(NULL, cfg.wintitle); if (IsIconic(hwnd)) { SetWindowText(hwnd, cfg.win_name_always ? window_name : @@ -1857,58 +1889,58 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, break; case IDM_RESET: term_pwron(term); - ldisc_send(NULL, 0, 0); + ldisc_send(ldisc, NULL, 0, 0); break; case IDM_TEL_AYT: - back->special(TS_AYT); + back->special(backhandle, TS_AYT); net_pending_errors(); break; case IDM_TEL_BRK: - back->special(TS_BRK); + back->special(backhandle, TS_BRK); net_pending_errors(); break; case IDM_TEL_SYNCH: - back->special(TS_SYNCH); + back->special(backhandle, TS_SYNCH); net_pending_errors(); break; case IDM_TEL_EC: - back->special(TS_EC); + back->special(backhandle, TS_EC); net_pending_errors(); break; case IDM_TEL_EL: - back->special(TS_EL); + back->special(backhandle, TS_EL); net_pending_errors(); break; case IDM_TEL_GA: - back->special(TS_GA); + back->special(backhandle, TS_GA); net_pending_errors(); break; case IDM_TEL_NOP: - back->special(TS_NOP); + back->special(backhandle, TS_NOP); net_pending_errors(); break; case IDM_TEL_ABORT: - back->special(TS_ABORT); + back->special(backhandle, TS_ABORT); net_pending_errors(); break; case IDM_TEL_AO: - back->special(TS_AO); + back->special(backhandle, TS_AO); net_pending_errors(); break; case IDM_TEL_IP: - back->special(TS_IP); + back->special(backhandle, TS_IP); net_pending_errors(); break; case IDM_TEL_SUSP: - back->special(TS_SUSP); + back->special(backhandle, TS_SUSP); net_pending_errors(); break; case IDM_TEL_EOR: - back->special(TS_EOR); + back->special(backhandle, TS_EOR); net_pending_errors(); break; case IDM_TEL_EOF: - back->special(TS_EOF); + back->special(backhandle, TS_EOF); net_pending_errors(); break; case IDM_ABOUT: @@ -2064,7 +2096,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, (p.rcPaint.left-offset_width)/font_width, (p.rcPaint.top-offset_height)/font_height, (p.rcPaint.right-offset_width-1)/font_width, - (p.rcPaint.bottom-offset_height-1)/font_height); + (p.rcPaint.bottom-offset_height-1)/font_height, + is_alt_pressed()); if (p.fErase || p.rcPaint.left < offset_width || @@ -2171,7 +2204,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, * 1) Keep the sizetip uptodate * 2) Make sure the window size is _stepped_ in units of the font size. */ - if (cfg.resize_action != RESIZE_FONT && !alt_pressed) { + if (cfg.resize_action != RESIZE_FONT && !is_alt_pressed()) { int width, height, w, h, ew, eh; LPRECT r = (LPRECT) lParam; @@ -2332,7 +2365,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, * down the connection during an NT opaque drag.) */ if (resizing) { - if (cfg.resize_action != RESIZE_FONT && !alt_pressed) { + if (cfg.resize_action != RESIZE_FONT && !is_alt_pressed()) { need_backend_resize = TRUE; w = (width-cfg.window_border*2) / font_width; if (w < 1) w = 1; @@ -2375,7 +2408,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, break; case WM_PALETTECHANGED: if ((HWND) wParam != hwnd && pal != NULL) { - HDC hdc = get_ctx(); + HDC hdc = get_ctx(NULL); if (hdc) { if (RealizePalette(hdc) > 0) UpdateColors(hdc); @@ -2385,7 +2418,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, break; case WM_QUERYNEWPALETTE: if (pal != NULL) { - HDC hdc = get_ctx(); + HDC hdc = get_ctx(NULL); if (hdc) { if (RealizePalette(hdc) > 0) UpdateColors(hdc); @@ -2445,7 +2478,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, * we're sent. */ term_seen_key_event(term); - ldisc_send(buf, len, 1); + ldisc_send(ldisc, buf, len, 1); show_mouseptr(0); } } @@ -2493,7 +2526,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, */ term_seen_key_event(term); for (i = 0; i < n; i += 2) { - luni_send((unsigned short *)(buff+i), 1, 1); + luni_send(ldisc, (unsigned short *)(buff+i), 1, 1); } free(buff); } @@ -2508,11 +2541,11 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, buf[1] = wParam; buf[0] = wParam >> 8; term_seen_key_event(term); - lpage_send(kbd_codepage, buf, 2, 1); + lpage_send(ldisc, kbd_codepage, buf, 2, 1); } else { char c = (unsigned char) wParam; term_seen_key_event(term); - lpage_send(kbd_codepage, &c, 1, 1); + lpage_send(ldisc, kbd_codepage, &c, 1, 1); } return (0); case WM_CHAR: @@ -2526,7 +2559,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, { char c = (unsigned char)wParam; term_seen_key_event(term); - lpage_send(CP_ACP, &c, 1, 1); + lpage_send(ldisc, CP_ACP, &c, 1, 1); } return 0; case WM_SETCURSOR: @@ -2536,7 +2569,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, } default: if (message == wm_mousewheel || message == WM_MOUSEWHEEL) { - int shift_pressed=0, control_pressed=0, alt_pressed=0; + int shift_pressed=0, control_pressed=0; if (message == WM_MOUSEWHEEL) { wheel_accumulator += (short)HIWORD(wParam); @@ -2596,7 +2629,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, * helper software tracks the system caret, so we should arrange to * have one.) */ -void sys_cursor(int x, int y) +void sys_cursor(void *frontend, int x, int y) { int cx, cy; @@ -2729,8 +2762,8 @@ void do_text(Context ctx, int x, int y, char *text, int len, if (lattr == LATTR_TOP || lattr == LATTR_BOT) text_adjust *= 2; attr &= ~CSET_MASK; - text[0] = (char) (unitab_xterm['q'] & CHAR_MASK); - attr |= (unitab_xterm['q'] & CSET_MASK); + text[0] = (char) (ucsdata.unitab_xterm['q'] & CHAR_MASK); + attr |= (ucsdata.unitab_xterm['q'] & CSET_MASK); if (attr & ATTR_UNDER) { attr &= ~ATTR_UNDER; force_manual_underline = 1; @@ -2791,7 +2824,7 @@ void do_text(Context ctx, int x, int y, char *text, int len, line_box.right = font_width*term->cols+offset_width; /* We're using a private area for direct to font. (512 chars.) */ - if (dbcs_screenfont && (attr & CSET_MASK) == ATTR_ACP) { + if (ucsdata.dbcs_screenfont && (attr & CSET_MASK) == ATTR_ACP) { /* Ho Hum, dbcs fonts are a PITA! */ /* To display on W9x I have to convert to UCS */ static wchar_t *uni_buf = 0; @@ -2804,15 +2837,15 @@ void do_text(Context ctx, int x, int y, char *text, int len, for(nlen = mptr = 0; mptr= ' ' && (uc&CHAR_MASK)<= '~') @@ -3170,8 +3203,6 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, } } - alt_pressed = (left_alt && key_down); - scan = (HIWORD(lParam) & (KF_UP | KF_EXTENDED | 0xFF)); shift_state = ((keystate[VK_SHIFT] & 0x80) != 0) + ((keystate[VK_CONTROL] & 0x80) != 0) * 2; @@ -3261,10 +3292,18 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, SendMessage(hwnd, WM_VSCROLL, SB_PAGEUP, 0); return 0; } + if (wParam == VK_PRIOR && shift_state == 2) { + SendMessage(hwnd, WM_VSCROLL, SB_LINEUP, 0); + return 0; + } if (wParam == VK_NEXT && shift_state == 1) { SendMessage(hwnd, WM_VSCROLL, SB_PAGEDOWN, 0); return 0; } + if (wParam == VK_NEXT && shift_state == 2) { + SendMessage(hwnd, WM_VSCROLL, SB_LINEDOWN, 0); + return 0; + } if (wParam == VK_INSERT && shift_state == 1) { term_do_paste(term); return 0; @@ -3459,7 +3498,7 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, *p++ = "\000\033\034\035\036\037\177"[wParam - '2']; return p - output; } - if (shift_state == 2 && wParam == 0xBD) { + if (shift_state == 2 && (wParam == 0xBD || wParam == 0xBF)) { *p++ = 0x1F; return p - output; } @@ -3730,7 +3769,7 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, #ifdef SHOW_TOASCII_RESULT if (r == 1 && !key_down) { if (alt_sum) { - if (in_utf(term) || dbcs_screenfont) + if (in_utf(term) || ucsdata.dbcs_screenfont) debug((", (U+%04x)", alt_sum)); else debug((", LCH(%d)", alt_sum)); @@ -3775,7 +3814,7 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, } keybuf = nc; term_seen_key_event(term); - luni_send(&keybuf, 1, 1); + luni_send(ldisc, &keybuf, 1, 1); continue; } @@ -3783,10 +3822,10 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, if (!key_down) { if (alt_sum) { - if (in_utf(term) || dbcs_screenfont) { + if (in_utf(term) || ucsdata.dbcs_screenfont) { keybuf = alt_sum; term_seen_key_event(term); - luni_send(&keybuf, 1, 1); + luni_send(ldisc, &keybuf, 1, 1); } else { ch = (char) alt_sum; /* @@ -3799,25 +3838,26 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, * everything we're sent. */ term_seen_key_event(term); - ldisc_send(&ch, 1, 1); + ldisc_send(ldisc, &ch, 1, 1); } alt_sum = 0; } else term_seen_key_event(term); - lpage_send(kbd_codepage, &ch, 1, 1); + lpage_send(ldisc, kbd_codepage, &ch, 1, 1); } else { if(capsOn && ch < 0x80) { WCHAR cbuf[2]; cbuf[0] = 27; cbuf[1] = xlat_uskbd2cyrllic(ch); term_seen_key_event(term); - luni_send(cbuf+!left_alt, 1+!!left_alt, 1); + luni_send(ldisc, cbuf+!left_alt, 1+!!left_alt, 1); } else { char cbuf[2]; cbuf[0] = '\033'; cbuf[1] = ch; term_seen_key_event(term); - lpage_send(kbd_codepage, cbuf+!left_alt, 1+!!left_alt, 1); + lpage_send(ldisc, kbd_codepage, + cbuf+!left_alt, 1+!!left_alt, 1); } } show_mouseptr(0); @@ -3832,7 +3872,7 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, if (!left_alt) keys[0] = 0; /* If we will be using alt_sum fix the 256s */ - else if (keys[0] && (in_utf(term) || dbcs_screenfont)) + else if (keys[0] && (in_utf(term) || ucsdata.dbcs_screenfont)) keys[0] = 10; } @@ -3849,7 +3889,7 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, return -1; } -void request_paste(void) +void request_paste(void *frontend) { /* * In Windows, pasting is synchronous: we can read the @@ -3859,7 +3899,7 @@ void request_paste(void) term_do_paste(term); } -void set_title(char *title) +void set_title(void *frontend, char *title) { sfree(window_name); window_name = smalloc(1 + strlen(title)); @@ -3868,7 +3908,7 @@ void set_title(char *title) SetWindowText(hwnd, title); } -void set_icon(char *title) +void set_icon(void *frontend, char *title) { sfree(icon_name); icon_name = smalloc(1 + strlen(title)); @@ -3877,7 +3917,7 @@ void set_icon(char *title) SetWindowText(hwnd, title); } -void set_sbar(int total, int start, int page) +void set_sbar(void *frontend, int total, int start, int page) { SCROLLINFO si; @@ -3894,7 +3934,7 @@ void set_sbar(int total, int start, int page) SetScrollInfo(hwnd, SB_VERT, &si, TRUE); } -Context get_ctx(void) +Context get_ctx(void *frontend) { HDC hdc; if (hwnd) { @@ -3925,7 +3965,7 @@ static void real_palette_set(int n, int r, int g, int b) colours[n] = RGB(r, g, b); } -void palette_set(int n, int r, int g, int b) +void palette_set(void *frontend, int n, int r, int g, int b) { static const int first[21] = { 0, 2, 4, 6, 8, 10, 12, 14, @@ -3936,14 +3976,14 @@ void palette_set(int n, int r, int g, int b) if (first[n] >= 18) real_palette_set(first[n] + 1, r, g, b); if (pal) { - HDC hdc = get_ctx(); + HDC hdc = get_ctx(frontend); UnrealizeObject(pal); RealizePalette(hdc); free_ctx(hdc); } } -void palette_reset(void) +void palette_reset(void *frontend) { int i; @@ -3964,13 +4004,13 @@ void palette_reset(void) if (pal) { HDC hdc; SetPaletteEntries(pal, 0, NCOLOURS, logpal->palPalEntry); - hdc = get_ctx(); + hdc = get_ctx(frontend); RealizePalette(hdc); free_ctx(hdc); } } -void write_aclip(char *data, int len, int must_deselect) +void write_aclip(void *frontend, char *data, int len, int must_deselect) { HGLOBAL clipdata; void *lock; @@ -4002,7 +4042,7 @@ void write_aclip(char *data, int len, int must_deselect) /* * Note: unlike write_aclip() this will not append a nul. */ -void write_clip(wchar_t * data, int len, int must_deselect) +void write_clip(void *frontend, wchar_t * data, int len, int must_deselect) { HGLOBAL clipdata, clipdata2, clipdata3; int len2; @@ -4165,7 +4205,7 @@ void write_clip(wchar_t * data, int len, int must_deselect) SendMessage(hwnd, WM_IGNORE_CLIP, FALSE, 0); } -void get_clip(wchar_t ** p, int *len) +void get_clip(void *frontend, wchar_t ** p, int *len) { static HGLOBAL clipdata = NULL; static wchar_t *converted = 0; @@ -4212,7 +4252,7 @@ void get_clip(wchar_t ** p, int *len) * Move `lines' lines from position `from' to position `to' in the * window. */ -void optimised_move(int to, int from, int lines) +void optimised_move(void *frontend, int to, int from, int lines) { RECT r; int min, max; @@ -4298,7 +4338,7 @@ static void flash_window(int mode) /* * Beep. */ -void beep(int mode) +void beep(void *frontend, int mode) { if (mode == BELL_DEFAULT) { /* @@ -4339,7 +4379,7 @@ void beep(int mode) * Minimise or restore the window in response to a server-side * request. */ -void set_iconic(int iconic) +void set_iconic(void *frontend, int iconic) { if (IsIconic(hwnd)) { if (!iconic) @@ -4353,7 +4393,7 @@ void set_iconic(int iconic) /* * Move the window in response to a server-side request. */ -void move_window(int x, int y) +void move_window(void *frontend, int x, int y) { if (cfg.resize_action == RESIZE_DISABLED || cfg.resize_action == RESIZE_FONT || @@ -4367,7 +4407,7 @@ void move_window(int x, int y) * Move the window to the top or bottom of the z-order in response * to a server-side request. */ -void set_zorder(int top) +void set_zorder(void *frontend, int top) { if (cfg.alwaysontop) return; /* ignore */ @@ -4378,7 +4418,7 @@ void set_zorder(int top) /* * Refresh the window in response to a server-side request. */ -void refresh_window(void) +void refresh_window(void *frontend) { InvalidateRect(hwnd, NULL, TRUE); } @@ -4387,7 +4427,7 @@ void refresh_window(void) * Maximise or restore the window in response to a server-side * request. */ -void set_zoomed(int zoomed) +void set_zoomed(void *frontend, int zoomed) { if (IsZoomed(hwnd)) { if (!zoomed) @@ -4401,7 +4441,7 @@ void set_zoomed(int zoomed) /* * Report whether the window is iconic, for terminal reports. */ -int is_iconic(void) +int is_iconic(void *frontend) { return IsIconic(hwnd); } @@ -4409,7 +4449,7 @@ int is_iconic(void) /* * Report the window's position, for terminal reports. */ -void get_window_pos(int *x, int *y) +void get_window_pos(void *frontend, int *x, int *y) { RECT r; GetWindowRect(hwnd, &r); @@ -4420,7 +4460,7 @@ void get_window_pos(int *x, int *y) /* * Report the window's pixel size, for terminal reports. */ -void get_window_pixels(int *x, int *y) +void get_window_pixels(void *frontend, int *x, int *y) { RECT r; GetWindowRect(hwnd, &r); @@ -4431,7 +4471,7 @@ void get_window_pixels(int *x, int *y) /* * Return the window or icon title. */ -char *get_window_title(int icon) +char *get_window_title(void *frontend, int icon) { return icon ? icon_name : window_name; } @@ -4554,7 +4594,7 @@ void flip_full_screen() } } -void frontend_keypress(void) +void frontend_keypress(void *handle) { /* * Keypress termination in non-Close-On-Exit mode is not