X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=macosx%2Fosxwin.m;h=062913694b06cfbdf9101d0212a1dec6c08d1fa3;hb=9dd9860cc84f82309de64c33e2813c6e9dc60749;hp=ba3a08ecb93c6756123c6c24dc9584a3b6538370;hpb=8719f92c1426609de7ead4a490a15d1d18875f53;p=PuTTY.git diff --git a/macosx/osxwin.m b/macosx/osxwin.m index ba3a08ec..06291369 100644 --- a/macosx/osxwin.m +++ b/macosx/osxwin.m @@ -109,11 +109,11 @@ nfg = nbg; nbg = t; } - if (cfg.bold_colour && (attr & ATTR_BOLD)) { + if ((cfg.bold_style & 2) && (attr & ATTR_BOLD)) { if (nfg < 16) nfg |= 8; else if (nfg >= 256) nfg |= 1; } - if (cfg.bold_colour && (attr & ATTR_BLINK)) { + if ((cfg.bold_style & 2) && (attr & ATTR_BLINK)) { if (nbg < 16) nbg |= 8; else if (nbg >= 256) nbg |= 1; } @@ -129,7 +129,7 @@ widefactor = 1; } - /* FIXME: ATTR_BOLD without cfg.bold_colour */ + /* FIXME: ATTR_BOLD if cfg.bold_style & 1 */ if ((lattr & LATTR_MODE) != LATTR_NORM) { x *= 2; @@ -232,15 +232,9 @@ /* * Set up a backend. */ - { - int i; + back = backend_from_proto(cfg.protocol); + if (!back) back = &pty_backend; - for (i = 0; backends[i].backend != NULL; i++) - if (backends[i].protocol == cfg.protocol) { - back = backends[i].backend; - break; - } - } { const char *error; @@ -743,23 +737,8 @@ case NSLeftArrowFunctionKey: xkey = 'D'; break; } if (xkey) { - /* - * The arrow keys normally do ESC [ A and so on. In - * app cursor keys mode they do ESC O A instead. - * Ctrl toggles the two modes. - */ - if (term->vt52_mode) { - output[end++] = '\033'; - output[end++] = xkey; - } else if (!term->app_cursor_keys ^ !(m & NSControlKeyMask)) { - output[end++] = '\033'; - output[end++] = 'O'; - output[end++] = xkey; - } else { - output[end++] = '\033'; - output[end++] = '['; - output[end++] = xkey; - } + end += format_arrow_key(output+end, term, xkey, + m & NSControlKeyMask); goto done; } } @@ -794,6 +773,11 @@ return term_data(term, is_stderr, data, len); } +- (int)fromBackendUntrusted:(const char *)data len:(int)len +{ + return term_data_untrusted(term, data, len); +} + - (void)startAlert:(NSAlert *)alert withCallback:(void (*)(void *, int))callback andCtx:(void *)ctx { @@ -885,6 +869,11 @@ // FIXME: else show restart menu item } +- (Terminal *)term +{ + return term; +} + @end int from_backend(void *frontend, int is_stderr, const char *data, int len) @@ -893,7 +882,13 @@ int from_backend(void *frontend, int is_stderr, const char *data, int len) return [win fromBackend:data len:len isStderr:is_stderr]; } -int get_userpass_input(prompts_t *p, unsigned char *in, int inlen) +int from_backend_untrusted(void *frontend, const char *data, int len) +{ + SessionWindow *win = (SessionWindow *)frontend; + return [win fromBackendUntrusted:data len:len]; +} + +int get_userpass_input(prompts_t *p, const unsigned char *in, int inlen) { SessionWindow *win = (SessionWindow *)p->frontend; Terminal *term = [win term]; @@ -912,7 +907,7 @@ void notify_remote_exit(void *frontend) [win notifyRemoteExit]; } -void ldisc_update(void *frontend, int echo, int edit) +void frontend_echoedit_update(void *frontend, int echo, int edit) { //SessionWindow *win = (SessionWindow *)frontend; /* @@ -922,7 +917,7 @@ void ldisc_update(void *frontend, int echo, int edit) char *get_ttymode(void *frontend, const char *mode) { - SessionWindow *win = (SessionWindow *)ctx; + SessionWindow *win = (SessionWindow *)frontend; Terminal *term = [win term]; return term_get_ttymode(term, mode); } @@ -939,7 +934,7 @@ void update_specials_menu(void *frontend) * may want to perform additional actions on any kind of bell (for * example, taskbar flashing in Windows). */ -void beep(void *frontend, int mode) +void do_beep(void *frontend, int mode) { //SessionWindow *win = (SessionWindow *)frontend; if (mode != BELL_VISUAL) @@ -962,7 +957,7 @@ void palette_set(void *frontend, int n, int r, int g, int b) if (n >= 16) n += 256 - 16; - if (n > NALLCOLOURS) + if (n >= NALLCOLOURS) return; [win setColour:n r:r/255.0 g:g/255.0 b:b/255.0]; @@ -1176,7 +1171,7 @@ void get_clip(void *frontend, wchar_t ** p, int *len) /* FIXME */ } -void write_clip(void *frontend, wchar_t * data, int len, int must_deselect) +void write_clip(void *frontend, wchar_t *data, int *attr, int len, int must_deselect) { //SessionWindow *win = (SessionWindow *)frontend; /* FIXME */