Skip to content

Commit

Permalink
GTK2: Return 2.20 compatibility back
Browse files Browse the repository at this point in the history
Minimal version of gtk+ 2.24 required to compile PuTTY
after GTK3 prep commits. Provide more compatibility macroses
to allow build against gtk+ 2.20.

Signed-off-by: Leonid Lisovskiy <[email protected]>
  • Loading branch information
lly-dev authored and sgtatham committed Feb 23, 2017
1 parent 4c67f0b commit 7a0a404
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions unix/gtkcompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
#define gtk_adjustment_set_page_increment(a, val) ((a)->page_increment = (val))
#define gtk_adjustment_set_step_increment(a, val) ((a)->step_increment = (val))
#define gtk_adjustment_get_value(a) ((a)->value)
#define gdk_visual_get_depth(v) ((v)->depth)

#define gtk_widget_set_has_window(w, b) \
gtk1_widget_set_unset_flag(w, GTK_NO_WINDOW, !(b))
Expand All @@ -84,6 +83,16 @@
* return the GDK default display. */
#define GDK_DISPLAY_XDISPLAY(x) GDK_DISPLAY()

#endif /* 2.0 */

#if !GTK_CHECK_VERSION(2,22,0)

#define gdk_visual_get_depth(v) ((v)->depth)

#endif /* 2.22 */

#if !GTK_CHECK_VERSION(2,24,0)

#define GDK_KEY_Alt_L GDK_Alt_L
#define GDK_KEY_Alt_R GDK_Alt_R
#define GDK_KEY_BackSpace GDK_BackSpace
Expand Down Expand Up @@ -156,7 +165,10 @@
#define GDK_KEY_greater GDK_greater
#define GDK_KEY_less GDK_less

#endif
#define gdk_window_get_screen(w) gdk_drawable_get_screen(w)
#define gtk_combo_box_new_with_model_and_entry(t) gtk_combo_box_entry_new_with_model(t, 1)

#endif /* 2.24 */

#if GTK_CHECK_VERSION(3,0,0)
#define STANDARD_OK_LABEL "_OK"
Expand Down Expand Up @@ -185,4 +197,4 @@
#define gdk_cursor_new(cur) \
gdk_cursor_new_for_display(gdk_display_get_default(), cur)

#endif
#endif /* 3.0 */

0 comments on commit 7a0a404

Please sign in to comment.