From 29f26a10503b94f7b4cf9d06cf660faa1223dece Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 20 Feb 1999 23:55:55 +0000 Subject: [PATCH] End of a night's work. Not a very useful state, but this is my branch and 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 | 7 ++++++- macresid.h | 7 ++++--- putty.h | 18 ++++++++++++++++++ putty.r | 19 ++++++++++++++++--- 4 files changed, 44 insertions(+), 7 deletions(-) diff --git a/mac.c b/mac.c index 69d5b1af..646c3610 100644 --- 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; diff --git a/macresid.h b/macresid.h index f4f7bb7e..fbaf3a97 100644 --- a/macresid.h +++ b/macresid.h @@ -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 3eec196b..581225b3 100644 --- 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 b0f0587d..ab474078 100644 --- 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) {