Bring the OS X front end up to date with recent changes to the main
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 18 Feb 2007 15:59:38 +0000 (15:59 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 18 Feb 2007 15:59:38 +0000 (15:59 +0000)
code base.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7296 cda61777-01e9-0310-a592-d414129be87e

macosx/osxclass.h
macosx/osxdlg.m
macosx/osxwin.m
testback.c

index e147bd9..e79290d 100644 (file)
@@ -64,10 +64,12 @@ struct alert_queue {
 - (void)doText:(wchar_t *)text len:(int)len x:(int)x y:(int)y
     attr:(unsigned long)attr lattr:(int)lattr;
 - (int)fromBackend:(const char *)data len:(int)len isStderr:(int)is_stderr;
+- (int)fromBackendUntrusted:(const char *)data len:(int)len;
 - (void)startAlert:(NSAlert *)alert
     withCallback:(void (*)(void *, int))callback andCtx:(void *)ctx;
 - (void)endSession:(int)clean;
 - (void)notifyRemoteExit;
+- (Terminal *)term;
 @end
 
 /*
index 094c955..295b675 100644 (file)
     ctrlbox = ctrl_new_box();
     setup_config_box(ctrlbox, FALSE /*midsession*/, aCfg.protocol,
                     0 /* protcfginfo */);
-    unix_setup_config_box(ctrlbox, FALSE /*midsession*/);
+    unix_setup_config_box(ctrlbox, FALSE /*midsession*/, aCfg.protocol);
 
     cfg = aCfg;                               /* structure copy */
 
index a4fac71..361f548 100644 (file)
     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
 {
     // 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,6 +903,12 @@ int from_backend(void *frontend, int is_stderr, const char *data, int len)
     return [win fromBackend:data len:len isStderr:is_stderr];
 }
 
+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, unsigned char *in, int inlen)
 {
     SessionWindow *win = (SessionWindow *)p->frontend;
@@ -922,7 +938,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);
 }
index ac0d206..159cdc5 100644 (file)
@@ -46,7 +46,7 @@ static int null_sendbuffer(void *);
 static void null_size(void *, int, int);
 static void null_special(void *, Telnet_Special);
 static const struct telnet_special *null_get_specials(void *handle);
-static Socket null_socket(void *);
+static int null_connected(void *);
 static int null_exitcode(void *);
 static int null_sendok(void *);
 static int null_ldisc(void *, int);
@@ -57,14 +57,14 @@ static int null_cfg_info(void *);
 
 Backend null_backend = {
     null_init, null_free, null_reconfig, null_send, null_sendbuffer, null_size,
-    null_special, null_get_specials, null_socket, null_exitcode, null_sendok,
+    null_special, null_get_specials, null_connected, null_exitcode, null_sendok,
     null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle,
     null_cfg_info, 0
 };
 
 Backend loop_backend = {
     loop_init, loop_free, null_reconfig, loop_send, null_sendbuffer, null_size,
-    null_special, null_get_specials, null_socket, null_exitcode, null_sendok,
+    null_special, null_get_specials, null_connected, null_exitcode, null_sendok,
     null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle,
     null_cfg_info, 0
 };
@@ -134,9 +134,9 @@ static const struct telnet_special *null_get_specials (void *handle) {
     return NULL;
 }
 
-static Socket null_socket(void *handle) {
+static int null_connected(void *handle) {
 
-    return NULL;
+    return 0;
 }
 
 static int null_exitcode(void *handle) {