Permalink
Browse files

At last, merge the putty-gtk2 branch back into the trunk!

git-svn-id: svn://svn.tartarus.org/sgt/putty@8037 cda61777-01e9-0310-a592-d414129be87e
  • Loading branch information...
1 parent 881da16 commit f160b7b8908cac4a7ca37b49928b7855fe0a11fe simon committed Jun 4, 2008
Showing with 1,387 additions and 551 deletions.
  1. +1 −1 LICENCE
  2. +1 −1 Recipe
  3. +1 −1 charset/macenc.c
  4. +9 −0 dialog.h
  5. +2 −2 doc/licence.but
  6. +1 −1 mac/mac_res.r
  7. +1 −1 mac/macabout.c
  8. +1 −1 mac/macpgen.c
  9. +1 −1 mac/macpgen.r
  10. +1 −1 mac/macpgkey.c
  11. +1 −1 mac/macpgrid.h
  12. +4 −0 mkauto.sh
  13. +8 −2 mkfiles.pl
  14. +23 −1 unix/configure.ac
  15. +70 −13 unix/gtkcols.c
  16. +1,107 −231 unix/gtkdlg.c
  17. +106 −275 unix/gtkwin.c
  18. +9 −13 unix/uxsel.c
  19. +37 −2 unix/uxstore.c
  20. +1 −1 windows/pageant.rc
  21. +1 −1 windows/puttygen.rc
  22. +1 −1 windows/win_res.rc2
View
@@ -3,7 +3,7 @@ PuTTY is copyright 1997-2008 Simon Tatham.
Portions copyright Robert de Bath, Joris van Rantwijk, Delian
Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry,
Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus
-Kuhn, and CORE SDI S.A.
+Kuhn, Colin Watson, and CORE SDI S.A.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
View
2 Recipe
@@ -245,7 +245,7 @@ GUITERM = TERMINAL window windlg winctrls sizetip winucs winprint
# Same thing on Unix.
UXTERM = TERMINAL uxcfg sercfg uxucs uxprint timing
-GTKTERM = UXTERM gtkwin gtkcfg gtkdlg gtkcols xkeysym
+GTKTERM = UXTERM gtkwin gtkcfg gtkdlg gtkfont gtkcols xkeysym
OSXTERM = UXTERM osxwin osxdlg osxctrls
# Non-SSH back ends (putty, puttytel, plink).
View
@@ -1,4 +1,4 @@
-/* $Id: macenc.c,v 1.2 2003/01/25 19:21:56 ben Exp $ */
+/* $Id$ */
/*
* Copyright (c) 2003 Ben Harris
* All rights reserved.
View
@@ -209,6 +209,10 @@ union control {
* has a drop-down list built in. (Note that a _non_-
* editable drop-down list is done as a special case of a
* list box.)
+ *
+ * Don't try setting has_list and password on the same
+ * control; front ends are not required to support that
+ * combination.
*/
int has_list;
/*
@@ -333,6 +337,11 @@ union control {
* the respective widths of `ncols' columns, which together
* will exactly fit the width of the list box. Otherwise
* `percentages' must be NULL.
+ *
+ * There should never be more than one column in a
+ * drop-down list (one with height==0), because front ends
+ * may have to implement it as a special case of an
+ * editable combo box.
*/
int ncols; /* number of columns */
int *percentages; /* % width of each column */
View
@@ -6,8 +6,8 @@ PuTTY is \i{copyright} 1997-2008 Simon Tatham.
Portions copyright Robert de Bath, Joris van Rantwijk, Delian
Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry,
-Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus Kuhn,
-and CORE SDI S.A.
+Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus
+Kuhn, Colin Watson, and CORE SDI S.A.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
View
@@ -1247,7 +1247,7 @@ resource 'TEXT' (wLicence, "licence", purgeable) {
"Portions copyright Robert de Bath, Joris van Rantwijk, Delian "
"Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry, "
"Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus "
- "Kuhn, and CORE SDI S.A.\n"
+ "Kuhn, Colin Watson, and CORE SDI S.A.\n"
"\n"
"Permission is hereby granted, free of charge, to any person "
"obtaining a copy of this software and associated documentation "
View
@@ -1,4 +1,4 @@
-/* $Id: macabout.c,v 1.3 2003/03/29 23:07:55 ben Exp $ */
+/* $Id$ */
/*
* Copyright (c) 1999, 2002, 2003 Ben Harris
* All rights reserved.
View
@@ -1,4 +1,4 @@
-/* $Id: macpgen.c,v 1.5 2003/02/23 13:31:12 ben Exp $ */
+/* $Id$ */
/*
* Copyright (c) 1999, 2003 Ben Harris
* All rights reserved.
View
@@ -448,7 +448,7 @@ resource 'TEXT' (wLicence, "licence", purgeable) {
"Portions copyright Robert de Bath, Joris van Rantwijk, Delian "
"Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry, "
"Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus "
- "Kuhn, and CORE SDI S.A.\n"
+ "Kuhn, Colin Watson, and CORE SDI S.A.\n"
"\n"
"Permission is hereby granted, free of charge, to any person "
"obtaining a copy of this software and associated documentation "
View
@@ -1,4 +1,4 @@
-/* $Id: macpgkey.c,v 1.5 2003/03/29 23:57:55 ben Exp $ */
+/* $Id$ */
/*
* Copyright (c) 2003 Ben Harris
* Copyright (c) 1997-2003 Simon Tatham
View
@@ -1,4 +1,4 @@
-/* $Id: macpgrid.h,v 1.4 2003/02/20 22:55:09 ben Exp $ */
+/* $Id$ */
/*
* macpgrid.h -- Mac resource IDs for PuTTYgen
View
@@ -3,6 +3,10 @@
# It's separate from mkfiles.pl because it won't work (and isn't needed)
# on a non-Unix system.
+# It's nice to be able to run this from inside the unix subdir as
+# well as from outside.
+test -f unix.h && cd ..
+
# Persuade automake to give us a copy of its install-sh. This is a
# pain because I don't actually want to have to _use_ automake.
# Instead, I construct a trivial unrelated automake project in a
View
@@ -924,12 +924,18 @@ sub manpages {
"# You can define this path to point at your tools if you need to\n".
"# TOOLPATH = /opt/gcc/bin\n".
"CC = \$(TOOLPATH)cc\n".
+ "# You can manually set this to `gtk-config' or `pkg-config gtk+-1.2'\n".
+ "# (depending on what works on your system) if you want to enforce\n".
+ "# building with GTK 1.2, or you can set it to `pkg-config gtk+-2.0'\n".
+ "# if you want to enforce 2.0. The default is to try 2.0 and fall back\n".
+ "# to 1.2 if it isn't found.\n".
+ "GTK_CONFIG = sh -c 'pkg-config gtk+-2.0 \$\$0 2>/dev/null || gtk-config \$\$0'\n".
"\n".
&splitline("CFLAGS = -O2 -Wall -Werror -g " .
(join " ", map {"-I$dirpfx$_"} @srcdirs) .
- " `gtk-config --cflags`").
+ " `\$(GTK_CONFIG) --cflags`").
" -D _FILE_OFFSET_BITS=64\n".
- "XLDFLAGS = \$(LDFLAGS) `gtk-config --libs`\n".
+ "XLDFLAGS = \$(LDFLAGS) `\$(GTK_CONFIG) --libs`\n".
"ULDFLAGS = \$(LDFLAGS)\n".
"INSTALL=install\n",
"INSTALL_PROGRAM=\$(INSTALL)\n",
View
@@ -18,7 +18,23 @@ AC_CHECK_HEADERS([utmpx.h sys/select.h],,,[
#include <sys/types.h>
#include <utmp.h>])
-AM_PATH_GTK([1.2.0], [all_targets="all-cli all-gtk"], [all_targets="all-cli"])
+# Look for both GTK 1 and GTK 2.
+AM_PATH_GTK([1.2.0], [gtk=1], [gtk=none])
+AM_PATH_GTK_2_0([2.0.0], [gtk=2], [])
+if test "$gtk" = "none"; then
+ all_targets="all-cli"
+else
+ all_targets="all-cli all-gtk"
+fi
+if test "$gtk" = "2"; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $GTK_CFLAGS"
+ LIBS="$GTK_LIBS $LIBS"
+ AC_CHECK_FUNCS([pango_font_family_is_monospace pango_font_map_list_families])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+fi
AC_SUBST([all_targets])
AC_SEARCH_LIBS([socket], [xnet])
@@ -48,4 +64,10 @@ AH_BOTTOM([
#ifndef HAVE_SYS_SELECT_H
# define HAVE_NO_SYS_SELECT_H
#endif
+#ifndef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
+# define PANGO_PRE_1POINT4
+#endif
+#ifndef HAVE_PANGO_FONT_MAP_LIST_FAMILIES
+# define PANGO_PRE_1POINT6
+#endif
])
View
@@ -3,24 +3,30 @@
*/
#include "gtkcols.h"
+#include <gtk/gtk.h>
static void columns_init(Columns *cols);
static void columns_class_init(ColumnsClass *klass);
static void columns_map(GtkWidget *widget);
static void columns_unmap(GtkWidget *widget);
+#if !GTK_CHECK_VERSION(2,0,0)
static void columns_draw(GtkWidget *widget, GdkRectangle *area);
static gint columns_expose(GtkWidget *widget, GdkEventExpose *event);
+#endif
static void columns_base_add(GtkContainer *container, GtkWidget *widget);
static void columns_remove(GtkContainer *container, GtkWidget *widget);
static void columns_forall(GtkContainer *container, gboolean include_internals,
GtkCallback callback, gpointer callback_data);
+#if !GTK_CHECK_VERSION(2,0,0)
static gint columns_focus(GtkContainer *container, GtkDirectionType dir);
+#endif
static GtkType columns_child_type(GtkContainer *container);
static void columns_size_request(GtkWidget *widget, GtkRequisition *req);
static void columns_size_allocate(GtkWidget *widget, GtkAllocation *alloc);
static GtkContainerClass *parent_class = NULL;
+#if !GTK_CHECK_VERSION(2,0,0)
GtkType columns_get_type(void)
{
static GtkType columns_type = 0;
@@ -42,42 +48,74 @@ GtkType columns_get_type(void)
return columns_type;
}
+#else
+GType columns_get_type(void)
+{
+ static GType columns_type = 0;
+
+ if (!columns_type) {
+ static const GTypeInfo columns_info = {
+ sizeof(ColumnsClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) columns_class_init,
+ NULL,
+ NULL,
+ sizeof(Columns),
+ 0,
+ (GInstanceInitFunc)columns_init,
+ };
+
+ columns_type = g_type_register_static(GTK_TYPE_CONTAINER, "Columns",
+ &columns_info, 0);
+ }
+
+ return columns_type;
+}
+#endif
+#if !GTK_CHECK_VERSION(2,0,0)
static gint (*columns_inherited_focus)(GtkContainer *container,
GtkDirectionType direction);
+#endif
static void columns_class_init(ColumnsClass *klass)
{
- GtkObjectClass *object_class;
- GtkWidgetClass *widget_class;
- GtkContainerClass *container_class;
-
- object_class = (GtkObjectClass *)klass;
- widget_class = (GtkWidgetClass *)klass;
- container_class = (GtkContainerClass *)klass;
-
+#if !GTK_CHECK_VERSION(2,0,0)
+ /* GtkObjectClass *object_class = (GtkObjectClass *)klass; */
+ GtkWidgetClass *widget_class = (GtkWidgetClass *)klass;
+ GtkContainerClass *container_class = (GtkContainerClass *)klass;
+#else
+ /* GObjectClass *object_class = G_OBJECT_CLASS(klass); */
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
+ GtkContainerClass *container_class = GTK_CONTAINER_CLASS(klass);
+#endif
+
+#if !GTK_CHECK_VERSION(2,0,0)
parent_class = gtk_type_class(GTK_TYPE_CONTAINER);
-
- /*
- * FIXME: do we have to do all this faffing with set_arg,
- * get_arg and child_arg_type? Ick.
- */
+#else
+ parent_class = g_type_class_peek_parent(klass);
+#endif
widget_class->map = columns_map;
widget_class->unmap = columns_unmap;
+#if !GTK_CHECK_VERSION(2,0,0)
widget_class->draw = columns_draw;
widget_class->expose_event = columns_expose;
+#endif
widget_class->size_request = columns_size_request;
widget_class->size_allocate = columns_size_allocate;
container_class->add = columns_base_add;
container_class->remove = columns_remove;
container_class->forall = columns_forall;
container_class->child_type = columns_child_type;
+#if !GTK_CHECK_VERSION(2,0,0)
/* Save the previous value of this method. */
if (!columns_inherited_focus)
columns_inherited_focus = container_class->focus;
container_class->focus = columns_focus;
+#endif
}
static void columns_init(Columns *cols)
@@ -135,6 +173,7 @@ static void columns_unmap(GtkWidget *widget)
gtk_widget_unmap(child->widget);
}
}
+#if !GTK_CHECK_VERSION(2,0,0)
static void columns_draw(GtkWidget *widget, GdkRectangle *area)
{
Columns *cols;
@@ -186,6 +225,7 @@ static gint columns_expose(GtkWidget *widget, GdkEventExpose *event)
}
return FALSE;
}
+#endif
static void columns_base_add(GtkContainer *container, GtkWidget *widget)
{
@@ -241,6 +281,9 @@ static void columns_remove(GtkContainer *container, GtkWidget *widget)
cols->taborder = g_list_remove_link(cols->taborder, children);
g_list_free(children);
+#if GTK_CHECK_VERSION(2,0,0)
+ gtk_container_set_focus_chain(container, cols->taborder);
+#endif
break;
}
}
@@ -284,7 +327,12 @@ GtkWidget *columns_new(gint spacing)
{
Columns *cols;
+#if !GTK_CHECK_VERSION(2,0,0)
cols = gtk_type_new(columns_get_type());
+#else
+ cols = g_object_new(TYPE_COLUMNS, NULL);
+#endif
+
cols->spacing = spacing;
return GTK_WIDGET(cols);
@@ -332,6 +380,10 @@ void columns_add(Columns *cols, GtkWidget *child,
gtk_widget_set_parent(child, GTK_WIDGET(cols));
+#if GTK_CHECK_VERSION(2,0,0)
+ gtk_container_set_focus_chain(GTK_CONTAINER(cols), cols->taborder);
+#endif
+
if (GTK_WIDGET_REALIZED(cols))
gtk_widget_realize(child);
@@ -382,10 +434,14 @@ void columns_taborder_last(Columns *cols, GtkWidget *widget)
cols->taborder = g_list_remove_link(cols->taborder, children);
g_list_free(children);
cols->taborder = g_list_append(cols->taborder, widget);
+#if GTK_CHECK_VERSION(2,0,0)
+ gtk_container_set_focus_chain(GTK_CONTAINER(cols), cols->taborder);
+#endif
break;
}
}
+#if !GTK_CHECK_VERSION(2,0,0)
/*
* Override GtkContainer's focus movement so the user can
* explicitly specify the tab order.
@@ -449,6 +505,7 @@ static gint columns_focus(GtkContainer *container, GtkDirectionType dir)
} else
return columns_inherited_focus(container, dir);
}
+#endif
/*
* Now here comes the interesting bit. The actual layout part is
Oops, something went wrong.

0 comments on commit f160b7b

Please sign in to comment.