]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
End of a night's work. Not a very useful state, but this is my branch and
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 20 Feb 1999 23:55:55 +0000 (23:55 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Sat, 20 Feb 1999 23:55:55 +0000 (23:55 +0000)
I'll do what I want with it.

Anyway, made a start on a Mac display for the terminal emulator, and the
enumeration of the global variables that will have to die.

Oh, and the licence is now in a TEXT resource -- I just have to work out
how to display it...

[originally from svn r53]

mac.c
macresid.h
putty.h
putty.r

diff --git a/mac.c b/mac.c
index 69d5b1af6451c169a0a582b090c67eb6160e14c2..646c36107ab43e716bbe27a7113b6f6b72c9cc1f 100644 (file)
--- a/mac.c
+++ b/mac.c
@@ -1,4 +1,4 @@
-/* $Id: mac.c,v 1.1.2.4 1999/02/20 22:10:33 ben Exp $ */
+/* $Id: mac.c,v 1.1.2.5 1999/02/20 23:55:55 ben Exp $ */
 /*
  * mac.c -- miscellaneous Mac-specific routines
  */
@@ -39,6 +39,8 @@ static void mac_closewindow(WindowPtr);
 static void mac_zoomwindow(WindowPtr, short);
 static void mac_shutdown(void);
 
+static void mac_newsession(void);
+
 int main (int argc, char **argv) {
 
     mac_startup();
@@ -230,6 +232,9 @@ static void mac_menucommand(long result) {
         break;
       case mFile:
         switch (item) {
+          case iNew:
+            mac_newsession();
+            break;
           case iClose:
             mac_closewindow(FrontWindow());
             break;
index f4f7bb7e281a2faad13cfd77e7616c73aaa42bb5..fbaf3a970955697a04b7258e0ab6752b29620c2c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: macresid.h,v 1.1.2.1 1999/02/20 22:10:34 ben Exp $ */
+/* $Id: macresid.h,v 1.1.2.2 1999/02/20 23:55:55 ben Exp $ */
 
 /*
  * macresid.h -- Mac resource IDs
@@ -18,8 +18,9 @@
 /* Apple menu */
 #define iAbout         1
 /* File menu */
-#define iClose         1
-#define iQuit          3
+#define iNew           1
+#define iClose         2
+#define iQuit          4
 
 /* Window types (and resource IDs) */
 #define wNone          0 /* Dummy value for no window */
diff --git a/putty.h b/putty.h
index 3eec196b3105e7ccb7ac60af9df97b5f5f2ee3e4..581225b3934bc83a141ab14acf69679b05418881 100644 (file)
--- a/putty.h
+++ b/putty.h
@@ -59,6 +59,24 @@ typedef HDC Context;
 #define GLOBAL extern
 #endif
 
+struct session {
+    /* Display state */
+    int rows, cols, savelines;
+    int font_width, font_height;
+    int has_focus;
+    /* Buffers */
+    unsigned char inbuf[INBUF_SIZE];
+    int inbuf_head, inbuf_reap;
+    unsigned char outbuf[OUTBUF_SIZE];
+    int outbuf_head, outbuf_reap;
+    /* Emulator state */
+    int app_cursor_keys, app_keypad_keys;
+    /* Backend */
+    Backend *back;
+    /* Config that created this session */
+    Config cfg;
+}
+
 GLOBAL int rows, cols, savelines;
 
 GLOBAL int font_width, font_height;
diff --git a/putty.r b/putty.r
index b0f0587d8295fa7420d23c97fcb11032ef2e2c5b..ab474078c080cb1f6a520d722d32923c2888f105 100644 (file)
--- a/putty.r
+++ b/putty.r
@@ -1,4 +1,4 @@
-/* $Id: putty.r,v 1.1.2.5 1999/02/20 22:10:34 ben Exp $ */
+/* $Id: putty.r,v 1.1.2.6 1999/02/20 23:55:55 ben Exp $ */
 /* PuTTY resources */
 
 #define PICT_RezTemplateVersion 1
@@ -271,9 +271,10 @@ resource 'MENU' (mFile, preload) {
     enabled,
     "File",
     {
-       "Close",                noicon, "W", nomark, plain,
+       "New Session"           noicon, "N",   nomark, plain,
+       "Close",                noicon, "W",   nomark, plain,
        "-",                    noicon, nokey, nomark, plain,
-       "Quit",                 noicon, "Q", nomark, plain,
+       "Quit",                 noicon, "Q",   nomark, plain,
     }
 };
 
@@ -309,6 +310,18 @@ resource 'DITL' (wFatal, "fatalbox", purgeable) {
        }
 };
 
+/* Terminal window */
+
+resource 'WIND' (wTerminal, "terminal", purgeable) {
+    { 0, 0, 0, 0 },
+    zoomDocProc,
+    invisible,
+    goAway,
+    0x0,
+    "untitled"
+    staggerParentWindowScreen
+};
+
 /* "About" box */
 
 resource 'DLOG' (wAbout, "about", purgeable) {