]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - unix/unix.h
Unix buildinfo: stop saying 'GTK' in pure CLI utilities.
[PuTTY.git] / unix / unix.h
index 36bf02bb8b5c9c24381782f21f56495e49fe620c..7ab2ca24f229cbab0de48d9d8293c04d76b850e5 100644 (file)
@@ -11,6 +11,7 @@
 #include <dlfcn.h>                    /* Dynamic library loading */
 #endif /*  NO_LIBDL */
 #include "charset.h"
+#include <sys/types.h>         /* for mode_t */
 
 #ifdef OSX_GTK
 /*
 #define NOT_X_WINDOWS /* of course, all the X11 stuff should be disabled */
 #define NO_PTY_PRE_INIT /* OS X gets very huffy if we try to set[ug]id */
 #define SET_NONBLOCK_VIA_OPENPT /* work around missing fcntl functionality */
+#define OSX_META_KEY_CONFIG /* two possible Meta keys to choose from */
+/* this potential one of the Meta keys needs manual handling */
+#define META_MANUAL_MASK (GDK_MOD1_MASK)
+#define JUST_USE_GTK_CLIPBOARD_UTF8 /* low-level gdk_selection_* fails */
+#define DEFAULT_CLIPBOARD GDK_SELECTION_CLIPBOARD /* OS X has no PRIMARY */
+
+#define BUILDINFO_PLATFORM_GTK "OS X (GTK)"
+#define BUILDINFO_GTK
+
+#elif defined NOT_X_WINDOWS
+
+#define BUILDINFO_PLATFORM_GTK "Unix (pure GTK)"
+#define BUILDINFO_GTK
+
+#else
+
+#define BUILDINFO_PLATFORM_GTK "Unix (GTK + X11)"
+#define BUILDINFO_GTK
+
 #endif
 
+/* BUILDINFO_PLATFORM varies its expansion between the GTK and
+ * pure-CLI utilities, so that Unix Plink, PSFTP etc don't announce
+ * themselves incongruously as having something to do with GTK. */
+#define BUILDINFO_PLATFORM_CLI "Unix"
+extern const int buildinfo_gtk_relevant;
+#define BUILDINFO_PLATFORM (buildinfo_gtk_relevant ? \
+                            BUILDINFO_PLATFORM_GTK : BUILDINFO_PLATFORM_CLI)
+
+char *buildinfo_gtk_version(void);
+
 struct Filename {
     char *path;
 };
@@ -40,6 +70,8 @@ typedef void *Context;                 /* FIXME: probably needs changing */
 
 extern Backend pty_backend;
 
+#define BROKEN_PIPE_ERROR_CODE EPIPE   /* used in sshshare.c */
+
 typedef uint32_t uint32; /* C99: uint32_t defined in stdint.h */
 #define PUTTY_UINT32_DEFINED
 
@@ -67,7 +99,7 @@ typedef uint32_t uint32; /* C99: uint32_t defined in stdint.h */
 #define SEL_NL { 10 }
 
 /* Simple wraparound timer function */
-unsigned long getticks(void);         /* based on gettimeofday(2) */
+unsigned long getticks(void);
 #define GETTICKCOUNT getticks
 #define TICKSPERSEC    1000           /* we choose to use milliseconds */
 #define CURSORBLINK     450           /* no standard way to set this */
@@ -87,6 +119,21 @@ unsigned long getticks(void);              /* based on gettimeofday(2) */
  */
 #define FLAG_STDERR_TTY 0x1000
 
+/* The per-session frontend structure managed by gtkwin.c */
+struct gui_data;
+struct gui_data *new_session_window(Conf *conf, const char *geometry_string);
+
+/* Defined in gtkmain.c */
+void launch_duplicate_session(Conf *conf);
+void launch_new_session(void);
+void launch_saved_session(const char *str);
+#ifdef MAY_REFER_TO_GTK_IN_HEADERS
+GtkWidget *make_gtk_toplevel_window(void *frontend);
+#endif
+
+/* Defined in gtkcomm.c */
+void gtkcomm_setup(void);
+
 /* Things pty.c needs from pterm.c */
 const char *get_x_display(void *frontend);
 int font_dimension(void *frontend, int which);/* 0 for width, 1 for height */
@@ -108,8 +155,7 @@ void logevent_dlg(void *estuff, const char *string);
 int reallyclose(void *frontend);
 #ifdef MAY_REFER_TO_GTK_IN_HEADERS
 int messagebox(GtkWidget *parentwin, const char *title,
-               const char *msg, int minwid, ...);
-int string_width(const char *text);
+               const char *msg, int minwid, int selectable, ...);
 #endif
 
 /* Things pterm.c needs from {ptermm,uxputty}.c */
@@ -151,9 +197,6 @@ void unix_setup_config_box(struct controlbox *b, int midsession, int protocol);
 /* gtkcfg.c */
 void gtk_setup_config_box(struct controlbox *b, int midsession, void *window);
 
-/* Helper function which happens to be in gtkfont.c at the moment */
-void get_label_text_dimensions(const char *text, int *width, int *height);
-
 /*
  * In the Unix Unicode layer, DEFAULT_CODEPAGE is a special value
  * which causes mb_to_wc and wc_to_mb to call _libc_ rather than
@@ -178,6 +221,7 @@ void noncloexec(int);
 int nonblock(int);
 int no_nonblock(int);
 char *make_dir_and_check_ours(const char *dirname);
+char *make_dir_path(const char *path, mode_t mode);
 
 /*
  * Exports from unicode.c.