X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/c1b55581a60251ae30a1e86578d2967711e0342d..5dc6132d3a8e6e4048698bf1914b486f9cf41e2c:/window.c diff --git a/window.c b/window.c index e97fc942..1ca1f050 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); @@ -115,10 +114,16 @@ 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 int session_closed; + +extern struct sesslist sesslist; /* imported from windlg.c */ + #define FONT_NORMAL 0 #define FONT_BOLD 1 #define FONT_UNDERLINE 2 @@ -400,6 +405,8 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) cfg.host[sizeof(cfg.host) - 1] = '\0'; got_host = 1; } + } else { + cmdline_error("unknown option \"%s\"", p); } } } @@ -498,7 +505,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) hwnd = NULL; - term = term_init(NULL); + term = term_init(&cfg, NULL); logctx = log_init(NULL); term_provide_logctx(term, logctx); @@ -636,7 +643,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) /* * Set up a line discipline. */ - ldisc = ldisc_create(term, back, backhandle, NULL); + ldisc = ldisc_create(&cfg, term, back, backhandle, NULL); session_closed = FALSE; @@ -683,10 +690,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); @@ -1692,9 +1701,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) @@ -2989,7 +2998,7 @@ void do_cursor(Context ctx, int x, int y, char *text, int len, /* This function gets the actual width of a character in the normal font. */ -int CharWidth(Context ctx, int uc) { +int char_width(Context ctx, int uc) { HDC hdc = ctx; int ibuf = 0;