From 93ef02b4e8cf0612529dad4a86eaa68569b011de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Wed, 22 Aug 2012 09:18:45 +0000 Subject: [PATCH] [GB.GTK] * BUG: Make gb.gtk compile with GTK+ 2.16. git-svn-id: svn://localhost/gambas/trunk@5067 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.gtk/src/gmouse.cpp | 8 -------- gb.gtk/src/gtools.cpp | 16 ++++++++++++++++ gb.gtk/src/gtools.h | 9 ++++++++- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/gb.gtk/src/gmouse.cpp b/gb.gtk/src/gmouse.cpp index b41a309ad..a376d44ba 100644 --- a/gb.gtk/src/gmouse.cpp +++ b/gb.gtk/src/gmouse.cpp @@ -246,14 +246,6 @@ double gMouse::getAxis(GdkAxisUse axis) return 0.0; } -#if GTK_CHECK_VERSION(2, 22, 0) -#else -static int gdk_device_get_source(GdkDevice *device) -{ - return device->source; -} -#endif - int gMouse::getType() { diff --git a/gb.gtk/src/gtools.cpp b/gb.gtk/src/gtools.cpp index db054cf86..15e78db8a 100644 --- a/gb.gtk/src/gtools.cpp +++ b/gb.gtk/src/gtools.cpp @@ -1673,3 +1673,19 @@ void gt_lower_widget(GtkWidget *widget) if (parent) gtk_container_foreach(parent, (GtkCallback)add_again, widget); } + +#if GTK_CHECK_VERSION(2, 22, 0) +#else +int gdk_device_get_source(GdkDevice *device) +{ + return device->source; +} + +GtkWidget *_gtk_window_group_get_current_grab(GtkWindowGroup *window_group); + +GtkWidget *gtk_window_group_get_current_grab(GtkWindowGroup *window_group) +{ + return _gtk_window_group_get_current_grab(window_group); +} +#endif + diff --git a/gb.gtk/src/gtools.h b/gb.gtk/src/gtools.h index 226d1ee13..4eac8fd77 100644 --- a/gb.gtk/src/gtools.h +++ b/gb.gtk/src/gtools.h @@ -138,7 +138,7 @@ gPicture *gt_grab_window(GdkWindow *win, int x = 0, int y = 0, int w = 0, int h void gt_layout_alignment(PangoLayout *layout, float w, float h, float *tw, float *th, int align, float *offX, float *offY); -#if GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 18 +#if GTK_CHECK_VERSION(2, 18, 0) #else void gtk_widget_set_can_focus(GtkWidget *widget, gboolean can_focus); @@ -146,4 +146,11 @@ gtk_widget_set_can_focus(GtkWidget *widget, gboolean can_focus); void gt_lower_widget(GtkWidget *widget); +#if GTK_CHECK_VERSION(2, 22, 0) +#else +int gdk_device_get_source(GdkDevice *device); +GtkWidget *gtk_window_group_get_current_grab(GtkWindowGroup *window_group); +#endif + + #endif