]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - macosx/osxwin.m
Giant const-correctness patch of doom!
[PuTTY.git] / macosx / osxwin.m
index f61e6bff73a9aee093e06cafb3cba06e08fe7872..062913694b06cfbdf9101d0212a1dec6c08d1fa3 100644 (file)
        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;
     }
        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;
          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;
        }
     }
@@ -903,7 +888,7 @@ int from_backend_untrusted(void *frontend, const char *data, int len)
     return [win fromBackendUntrusted:data len:len];
 }
 
-int get_userpass_input(prompts_t *p, unsigned char *in, int inlen)
+int get_userpass_input(prompts_t *p, const unsigned char *in, int inlen)
 {
     SessionWindow *win = (SessionWindow *)p->frontend;
     Terminal *term = [win term];
@@ -922,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;
     /*
@@ -972,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];