]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - putty.h
Menu items now turn on and off in a vaguely useful way.
[PuTTY.git] / putty.h
diff --git a/putty.h b/putty.h
index a456fdb7df4f5c860d3b34df4cdead89aac1487f..81a3b6b550e6b423bca476bec95526c39547896d 100644 (file)
--- a/putty.h
+++ b/putty.h
@@ -3,15 +3,22 @@
 
 #define PUTTY_REG_POS "Software\\SimonTatham\\PuTTY"
 
-/*
- * Global variables. Most modules declare these `extern', but
- * window.c will do `#define PUTTY_DO_GLOBALS' before including this
- * module, and so will get them properly defined.
- */
-#ifdef PUTTY_DO_GLOBALS
-#define GLOBAL
-#else
-#define GLOBAL extern
+#ifdef macintosh
+#define OPTIMISE_SCROLL
+#endif
+
+#ifdef macintosh
+#include <MacTypes.h>
+#include <Palettes.h>
+typedef UInt32 DWORD;
+struct mac_session;
+#endif /* macintosh */
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
 #endif
 
 #define ATTR_ACTCURS 0x80000000UL      /* active cursor (block) */
 #define ATTR_MASK    0xFFFFFF00UL
 #define CHAR_MASK    0x000000FFUL
 
+#ifdef macintosh
+struct mac_session;
+typedef struct mac_session *Context;
+#else /* not macintosh */
 typedef HDC Context;
+#endif /* not macintosh */
+
 #define SEL_NL { 13, 10 }
 
+/*
+ * Global variables. Most modules declare these `extern', but
+ * window.c will do `#define PUTTY_DO_GLOBALS' before including this
+ * module, and so will get them properly defined.
+ */
+#ifdef PUTTY_DO_GLOBALS
+#define GLOBAL
+#else
+#define GLOBAL extern
+#endif
+
 GLOBAL int rows, cols, savelines;
 
 GLOBAL int font_width, font_height;
@@ -80,8 +104,13 @@ typedef enum {
 } VT_Mode;
 
 typedef struct {
+#ifdef macintosh
+       char *(*init) (char *host, int port, char **realhost);
+       int (*msg)(void);
+#else /* not macintosh */
     char *(*init) (HWND hwnd, char *host, int port, char **realhost);
     int (*msg) (WPARAM wParam, LPARAM lParam);
+#endif /* not macintosh */
     void (*send) (char *buf, int len);
     void (*size) (void);
     void (*special) (Telnet_Special code);
@@ -95,6 +124,8 @@ typedef struct {
     int port;
     enum { PROT_TELNET, PROT_SSH } protocol;
     int close_on_exit;
+    /* SSH options */
+    int nopty;
     /* Telnet options */
     char termtype[32];
     char termspeed[32];
@@ -111,6 +142,7 @@ typedef struct {
     int savelines;
     int dec_om;
     int wrap_mode;
+    int lfhascr;
     int win_name_always;
     int width, height;
     char font[64];
@@ -120,14 +152,39 @@ typedef struct {
     /* Colour options */
     int try_palette;
     int bold_colour;
+#ifdef macintosh
+    PaletteHandle colours;
+#else /* not macintosh */
     unsigned char colours[22][3];
+#endif /* not macintosh */
     /* Selection options */
+#ifndef macintosh
     int mouse_is_xterm;
+#endif
     short wordness[256];
 } Config;
 
 GLOBAL Config cfg;
 
+typedef struct {
+    /* 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;
+} Session;
+
+
 /*
  * Exports from window.c.
  */
@@ -143,7 +200,8 @@ void palette_reset (void);
 void write_clip (void *, int);
 void get_clip (void **, int *);
 void optimised_move (int, int, int);
-void fatalbox (char *, ...);
+void do_scroll(int, int, int);
+void fatalbox (const char *, ...);
 void beep (void);
 #define OPTIMISE_IS_SCROLL 1
 
@@ -155,6 +213,7 @@ void noise_get_light(void (*func) (void *, int));
 void noise_ultralight(DWORD data);
 void random_save_seed(void);
 
+#ifndef macintosh
 /*
  * Exports from windlg.c.
  */
@@ -165,6 +224,7 @@ void lognegot (char *);
 void shownegot (HWND);
 void showabout (HWND);
 void verify_ssh_host_key(char *host, struct RSAKey *key);
+#endif
 
 /*
  * Exports from terminal.c.
@@ -223,6 +283,18 @@ void *safemalloc(size_t);
 void *saferealloc(void *, size_t);
 void safefree(void *);
 
+/*
+ * Exports from testback.c
+ */
+
+extern Backend null_backend;
+extern Backend loop_backend;
+
+/*
+ * Exports from version.c.
+ */
+extern char ver[];
+
 /*
  * A debug system.
  */