1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Reinstate all the GTK1-specific code under ifdefs, and verify that

we can now build and run successfully using both GTK1 and GTK2 by
giving appropriate options to make. (Specifically, to override the
default of GTK2 in favour of GTK1, "make GTK_CONFIG=gtk-config".)

[originally from svn r7966]
This commit is contained in:
Simon Tatham 2008-04-04 10:56:26 +00:00
parent 54e26eb7ef
commit ee92c21e53
4 changed files with 881 additions and 69 deletions

View File

@ -3,10 +3,8 @@ TODO for PuTTY GTK2 port before merging back into main trunk code
Things left to do:
- Make sure we haven't broken GTK1.
+ In particular, I know I _have_ broken GTK1 by taking out all
the GTK1-style list box code. Put it all back in under ifdefs,
which will be unpleasant but necessary.
- I apparently missed out a piece of code when doing the new GTK2
list box: shortcut activations for list boxes are missing.
- Merge to trunk. Colin is already mentioned in the licence in all
the branched copies, but mention him in the _website's_ licence

View File

@ -82,7 +82,7 @@ static gint (*columns_inherited_focus)(GtkContainer *container,
static void columns_class_init(ColumnsClass *klass)
{
#if !GTK_CHECK_VERSION(2,0,0)
GtkObjectClass *object_class = (GtkObjectClass *)klass;
/* GtkObjectClass *object_class = (GtkObjectClass *)klass; */
GtkWidgetClass *widget_class = (GtkWidgetClass *)klass;
GtkContainerClass *container_class = (GtkContainerClass *)klass;
#else
@ -92,9 +92,9 @@ static void columns_class_init(ColumnsClass *klass)
#endif
#if !GTK_CHECK_VERSION(2,0,0)
parent_class = g_type_class_peek_parent(klass);
#else
parent_class = gtk_type_class(GTK_TYPE_CONTAINER);
#else
parent_class = g_type_class_peek_parent(klass);
#endif
widget_class->map = columns_map;

File diff suppressed because it is too large Load Diff

View File

@ -670,8 +670,10 @@ static char *x11font_scale_fontname(GtkWidget *widget, const char *name,
return NULL; /* shan't */
}
#if GTK_CHECK_VERSION(2,0,0)
/* ----------------------------------------------------------------------
* Pango font implementation.
* Pango font implementation (for GTK 2 only).
*/
static void pangofont_draw_text(GdkDrawable *target, GdkGC *gc, unifont *font,
@ -1143,6 +1145,8 @@ static char *pangofont_scale_fontname(GtkWidget *widget, const char *name,
return retname;
}
#endif /* GTK_CHECK_VERSION(2,0,0) */
/* ----------------------------------------------------------------------
* Outermost functions which do the vtable dispatch.
*/
@ -1155,7 +1159,9 @@ static char *pangofont_scale_fontname(GtkWidget *widget, const char *name,
* of an explicit type-disambiguating prefix.)
*/
static const struct unifont_vtable *unifont_types[] = {
#if GTK_CHECK_VERSION(2,0,0)
&pangofont_vtable,
#endif
&x11font_vtable,
};
@ -1234,8 +1240,11 @@ void unifont_draw_text(GdkDrawable *target, GdkGC *gc, unifont *font,
wide, bold, cellwidth);
}
#if GTK_CHECK_VERSION(2,0,0)
/* ----------------------------------------------------------------------
* Implementation of a unified font selector.
* Implementation of a unified font selector. Used on GTK 2 only;
* for GTK 1 we still use the standard font selector.
*/
typedef struct fontinfo fontinfo;
@ -2417,3 +2426,5 @@ char *unifontsel_get_name(unifontsel *fontsel)
return dupstr(fs->selected->realname);
}
#endif /* GTK_CHECK_VERSION(2,0,0) */