X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fgtkcompat.h;h=27ade836070cbf3c440fec040546887bcca80e83;hb=095072fa46b2d7b8beafaddb2f873d2f500a1e10;hp=17351aef90cd647ea738286bcb41230dcc71a3bb;hpb=0ffc564351d5ca1ea88e545b0c5f4bec85ab00ea;p=PuTTY.git diff --git a/unix/gtkcompat.h b/unix/gtkcompat.h index 17351aef..27ade836 100644 --- a/unix/gtkcompat.h +++ b/unix/gtkcompat.h @@ -1,7 +1,7 @@ /* * Header file to make compatibility with older GTK versions less * painful, by #defining various things that are pure spelling changes - * between GTK1 and GTK2. + * between GTK1 and GTK2, or between 2 and 3. */ #if !GTK_CHECK_VERSION(2,0,0) @@ -153,6 +153,36 @@ #define GDK_KEY_Right GDK_Right #define GDK_KEY_Tab GDK_Tab #define GDK_KEY_Up GDK_Up +#define GDK_KEY_greater GDK_greater +#define GDK_KEY_less GDK_less #endif +#if GTK_CHECK_VERSION(3,0,0) +#define STANDARD_OK_LABEL "_OK" +#define STANDARD_OPEN_LABEL "_Open" +#define STANDARD_CANCEL_LABEL "_Cancel" +#else +#define STANDARD_OK_LABEL GTK_STOCK_OK +#define STANDARD_OPEN_LABEL GTK_STOCK_OPEN +#define STANDARD_CANCEL_LABEL GTK_STOCK_CANCEL +#endif + +#if GTK_CHECK_VERSION(3,0,0) +#define gtk_hseparator_new() gtk_separator_new(GTK_ORIENTATION_HORIZONTAL) +/* Fortunately, my hboxes and vboxes never actually set homogeneous to + * TRUE, so I can just wrap these deprecated constructors with a macro + * without also having to arrange a call to gtk_box_set_homogeneous. */ +#define gtk_hbox_new(homogeneous, spacing) \ + gtk_box_new(GTK_ORIENTATION_HORIZONTAL, spacing) +#define gtk_vbox_new(homogeneous, spacing) \ + gtk_box_new(GTK_ORIENTATION_VERTICAL, spacing) +#define gtk_vscrollbar_new(adjust) \ + gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, adjust) + +#define gdk_get_display() gdk_display_get_name(gdk_display_get_default()) + +#define gdk_cursor_new(cur) \ + gdk_cursor_new_for_display(gdk_display_get_default(), cur) + +#endif