From ca5e588017b8795b03417457562b8f46567bc04f Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Wed, 10 Jul 2013 16:17:03 +0300 Subject: gtk_scrolled_window_add_with_viewport is deprecated in GTK 3.8. Use gtk_container_add for GTK 3.8 or newer. --- bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c | 8 ++++++++ bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h | 1 + .../Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java | 1 + .../Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java | 6 +++++- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c index 9905801d97..d363181c0d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c @@ -14369,7 +14369,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1scrolled_1window_1add_1with_1viewport) (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) { OS_NATIVE_ENTER(env, that, _1gtk_1scrolled_1window_1add_1with_1viewport_FUNC); +/* gtk_scrolled_window_add_with_viewport((GtkScrolledWindow *)arg0, (GtkWidget *)arg1); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_scrolled_window_add_with_viewport) + if (fp) { + ((void (CALLING_CONVENTION*)(GtkScrolledWindow *, GtkWidget *))fp)((GtkScrolledWindow *)arg0, (GtkWidget *)arg1); + } + } OS_NATIVE_EXIT(env, that, _1gtk_1scrolled_1window_1add_1with_1viewport_FUNC); } #endif diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h index e01da94898..2c429ffe93 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h @@ -290,6 +290,7 @@ #define gtk_style_render_icon_LIB LIB_GTK #define gtk_hscale_new_LIB LIB_GTK #define gtk_vscale_new_LIB LIB_GTK +#define gtk_scrolled_window_add_with_viewport_LIB LIB_GTK #define gtk_selection_data_get_data_LIB LIB_GTK #define gtk_selection_data_get_data_type_LIB LIB_GTK #define gtk_selection_data_get_format_LIB LIB_GTK diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java index c5cba55a2d..5b6aa53829 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java @@ -10406,6 +10406,7 @@ public static final void gtk_rc_style_set_text(long /*int*/ style, int index, Gd } } /** + * @method flags=dynamic * @param scrolled_window cast=(GtkScrolledWindow *) * @param child cast=(GtkWidget *) */ diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java index c13e0a31a0..6773fad7b8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java @@ -137,7 +137,11 @@ void createHandle (int index) { if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES); OS.gtk_scrolled_window_set_policy (scrolledHandle, OS.GTK_POLICY_NEVER, OS.GTK_POLICY_AUTOMATIC); OS.gtk_container_add (fixedHandle, scrolledHandle); - OS.gtk_scrolled_window_add_with_viewport (scrolledHandle, handle); + if (OS.VERSION(3, 8, 0)