diff options
author | Paul D'Pong | 2020-08-19 20:14:08 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2020-09-04 20:32:19 +0000 |
commit | 07e00b6afdbac167fa940c135b167e1044537562 (patch) | |
tree | 52430df4566cb50c893346e9d15e7169e5c48ed1 | |
parent | 0b7e94b494d2d16cb4bee1b9402f6928e5d75c08 (diff) | |
download | eclipse.platform.swt-07e00b6afdbac167fa940c135b167e1044537562.tar.gz eclipse.platform.swt-07e00b6afdbac167fa940c135b167e1044537562.tar.xz eclipse.platform.swt-07e00b6afdbac167fa940c135b167e1044537562.zip |
Bug 566203 - [GTK4] Update to GTK3.99 and maintain successful
compilation
Updated GTK4 libraries to 3.99.0 in order to fix a signature bug for
event handlers.
Removed all accessibility support for GTK4 for the time being. Needs to
be converted to the new GtkAccessible interface.
Changed signature for gtk_scrolled_window_new.
Change-Id: I52901c252d4e75cbd8c51bd9466533ba4b50df77
Signed-off-by: Paul D'Pong <sdamrong@redhat.com>
13 files changed, 93 insertions, 71 deletions
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 27401aad01..16fa01ccbc 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 @@ -8846,14 +8846,26 @@ JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1scrolled_1window_1get_1vscrollbar) } #endif -#ifndef NO_gtk_1scrolled_1window_1new -JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1scrolled_1window_1new) +#ifndef NO_gtk_1scrolled_1window_1new__ +JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1scrolled_1window_1new__) + (JNIEnv *env, jclass that) +{ + jlong rc = 0; + GTK_NATIVE_ENTER(env, that, gtk_1scrolled_1window_1new___FUNC); + rc = (jlong)gtk_scrolled_window_new(); + GTK_NATIVE_EXIT(env, that, gtk_1scrolled_1window_1new___FUNC); + return rc; +} +#endif + +#ifndef NO_gtk_1scrolled_1window_1new__JJ +JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1scrolled_1window_1new__JJ) (JNIEnv *env, jclass that, jlong arg0, jlong arg1) { jlong rc = 0; - GTK_NATIVE_ENTER(env, that, gtk_1scrolled_1window_1new_FUNC); + GTK_NATIVE_ENTER(env, that, gtk_1scrolled_1window_1new__JJ_FUNC); rc = (jlong)gtk_scrolled_window_new((GtkAdjustment *)arg0, (GtkAdjustment *)arg1); - GTK_NATIVE_EXIT(env, that, gtk_1scrolled_1window_1new_FUNC); + GTK_NATIVE_EXIT(env, that, gtk_1scrolled_1window_1new__JJ_FUNC); return rc; } #endif diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h index 7a3483d883..9321cb8f1a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h @@ -95,7 +95,7 @@ #if defined(GDK_WINDOWING_X11) -#if !GTK_CHECK_VERSION(3,98,4) +#if !GTK_CHECK_VERSION(3,99,0) #include <gtk/gtkx.h> #define NO_gdk_1x11_1surface_1get_1xid #define NO_gdk_1x11_1surface_1lookup_1for_1display @@ -108,7 +108,7 @@ #define NO_gtk_1socket_1get_1id #define NO_gtk_1socket_1new #endif -#if !GTK_CHECK_VERSION(3,98,4) +#if !GTK_CHECK_VERSION(3,99,0) #include <gdk/gdkx.h> #else #include <gdk/x11/gdkx.h> @@ -168,7 +168,7 @@ #endif -#if GTK_CHECK_VERSION(3,98,4) +#if GTK_CHECK_VERSION(3,99,0) #define GTK4 1 // Structs which do not exist on GTK4 @@ -485,6 +485,13 @@ // GtkBin removed #define NO_gtk_1bin_1get_1child +// Accessibility interface changes +#define NO_GTK_1TYPE_1TEXT_1VIEW_1ACCESSIBLE +#define NO_swt_1fixed_1accessible_1register_1accessible + +// GtkScrolledWindow changes +#define NO_gtk_1scrolled_1window_1new__JJ + #else /** @@ -620,6 +627,9 @@ #define NO_swt_1fixed_1add #define NO_swt_1fixed_1remove +// GtkScrolledWindow signature change +#define NO_gtk_1scrolled_1window_1new__ + #endif #include "os_custom.h" diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c index d8c5e72b88..958ee181f9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c @@ -708,7 +708,6 @@ static void swt_fixed_get_property (GObject *object, guint prop_id, GValue *valu static void swt_fixed_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void swt_fixed_finalize (GObject *object); static void swt_fixed_map (GtkWidget *widget); -static AtkObject *swt_fixed_get_accessible (GtkWidget *widget); static void swt_fixed_measure (GtkWidget *widget, GtkOrientation orientation, int for_size, int *minimum, int *natural, int *minimum_baseline, int *natural_baseline); static void swt_fixed_size_allocate (GtkWidget *widget, const GtkAllocation *allocation, int baseline); @@ -736,9 +735,6 @@ static void swt_fixed_class_init (SwtFixedClass *class) { widget_class->map = swt_fixed_map; widget_class->measure = swt_fixed_measure; widget_class->size_allocate = swt_fixed_size_allocate; - - /* Accessibility implementation */ - widget_class->get_accessible = swt_fixed_get_accessible; } void swt_fixed_restack (SwtFixed *fixed, GtkWidget *widget, GtkWidget *sibling, gboolean above) { @@ -805,7 +801,6 @@ static void swt_fixed_finalize (GObject *object) { g_object_unref (priv->hadjustment); g_object_unref (priv->vadjustment); - g_clear_object (&widget->accessible); G_OBJECT_CLASS (swt_fixed_parent_class)->finalize (object); } @@ -912,16 +907,6 @@ static void swt_fixed_map (GtkWidget *widget) { return GTK_WIDGET_CLASS (swt_fixed_parent_class)->map (widget); } -/* Accessibility */ -static AtkObject *swt_fixed_get_accessible (GtkWidget *widget) { - SwtFixed *fixed = SWT_FIXED (widget); - - if (!fixed->accessible) { - fixed->accessible = swt_fixed_accessible_new (widget); - } - return fixed->accessible; -} - static void swt_fixed_measure (GtkWidget *widget, GtkOrientation orientation, int for_size, int *minimum, int *natural, int *minimum_baseline, int *natural_baseline) { SwtFixed *fixed = SWT_FIXED (widget); @@ -1083,6 +1068,8 @@ void swt_fixed_remove (GtkWidget *container, GtkWidget *widget) { } #endif + +#if !defined(GTK4) static void swt_fixed_accessible_class_init (SwtFixedAccessibleClass *klass); static void swt_fixed_accessible_finalize (GObject *object); static void swt_fixed_accessible_initialize (AtkObject *obj, gpointer data); @@ -1113,7 +1100,6 @@ struct _SwtFixedAccessiblePrivate { GtkWidget *widget; }; -#if !defined(GTK4) G_DEFINE_TYPE_WITH_CODE (SwtFixedAccessible, swt_fixed_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE, G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, swt_fixed_accessible_action_iface_init) G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, swt_fixed_accessible_component_iface_init) @@ -1124,18 +1110,6 @@ G_DEFINE_TYPE_WITH_CODE (SwtFixedAccessible, swt_fixed_accessible, GTK_TYPE_CONT G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, swt_fixed_accessible_text_iface_init) G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, swt_fixed_accessible_value_iface_init) G_ADD_PRIVATE (SwtFixedAccessible)) -#else -G_DEFINE_TYPE_WITH_CODE (SwtFixedAccessible, swt_fixed_accessible, GTK_TYPE_WIDGET_ACCESSIBLE, - G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, swt_fixed_accessible_action_iface_init) - G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, swt_fixed_accessible_component_iface_init) - G_IMPLEMENT_INTERFACE (ATK_TYPE_EDITABLE_TEXT, swt_fixed_accessible_editable_text_iface_init) - G_IMPLEMENT_INTERFACE (ATK_TYPE_HYPERTEXT, swt_fixed_accessible_hypertext_iface_init) - G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, swt_fixed_accessible_selection_iface_init) - G_IMPLEMENT_INTERFACE (ATK_TYPE_TABLE, swt_fixed_accessible_table_iface_init) - G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, swt_fixed_accessible_text_iface_init) - G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, swt_fixed_accessible_value_iface_init) - G_ADD_PRIVATE (SwtFixedAccessible)) -#endif // Fully qualified Java class name for the Java implementation of ATK functions const char *ACCESSIBILITY_CLASS_NAME = "org/eclipse/swt/accessibility/AccessibleObject"; @@ -2244,7 +2218,6 @@ jlong call_accessible_object_function (const char *method_name, const char *meth return result; } -#if !defined(GTK4) //Add ability to debug gtk warnings for SWT snippets via SWT_FATAL_WARNINGS=1 // env variable. Please see Eclipse bug 471477. // PLEASE NOTE: this functionality is only available on GTK3. 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 13ecba6ea1..17c473ae45 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 @@ -39,9 +39,9 @@ #define LIB_FONTCONFIG "libfontconfig-1.dll" #else #if defined(GTK4) -#define LIB_GTK "libgtk-4.so.0.9804.0" +#define LIB_GTK "libgtk-4.so.0.9900.0" // Point GDK to GTK for GTK4 -#define LIB_GDK "libgtk-4.so.0.9804.0" +#define LIB_GDK "libgtk-4.so.0.9900.0" #else #define LIB_GTK "libgtk-3.so.0" #define LIB_GDK "libgdk-3.so.0" @@ -107,9 +107,6 @@ struct _SwtFixed /*< private >*/ SwtFixedPrivate *priv; - - /* Accessibility */ - AtkObject *accessible; }; struct _SwtFixedClass @@ -144,7 +141,9 @@ void swt_fixed_restack(SwtFixed *fixed, GtkWidget *widget, GtkWidget *sibling, g void swt_fixed_move(SwtFixed *fixed, GtkWidget *widget, gint x, gint y); void swt_fixed_resize(SwtFixed *fixed, GtkWidget *widget, gint width, gint height); +#if !defined(GTK4) #include <gtk/gtk-a11y.h> +#endif #define SWT_TYPE_FIXED_ACCESSIBLE (swt_fixed_accessible_get_type ()) #define SWT_FIXED_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWT_TYPE_FIXED_ACCESSIBLE, SwtFixedAccessible)) @@ -157,14 +156,11 @@ typedef struct _SwtFixedAccessibleClass SwtFixedAccessibleClass; #if defined(GTK4) struct _SwtFixedAccessible { - GtkWidgetAccessible parent; - SwtFixedAccessiblePrivate *priv; }; struct _SwtFixedAccessibleClass { - GtkWidgetAccessibleClass parent_class; }; #else struct _SwtFixedAccessible @@ -181,8 +177,10 @@ struct _SwtFixedAccessibleClass #endif GType swt_fixed_accessible_get_type (void) G_GNUC_CONST; +#if !defined(GTK4) AtkObject *swt_fixed_accessible_new (GtkWidget *widget); void swt_fixed_accessible_register_accessible (AtkObject *obj, gboolean is_native, GtkWidget *to_map); +#endif jlong call_accessible_object_function (const char *method_name, const char *method_signature,...); void swt_debug_on_fatal_warnings() ; diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c index 57ab895c90..6d976014ea 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c @@ -705,7 +705,8 @@ char * GTK_nativeFunctionNames[] = { "gtk_1scrolled_1window_1get_1shadow_1type", "gtk_1scrolled_1window_1get_1vadjustment", "gtk_1scrolled_1window_1get_1vscrollbar", - "gtk_1scrolled_1window_1new", + "gtk_1scrolled_1window_1new__", + "gtk_1scrolled_1window_1new__JJ", "gtk_1scrolled_1window_1set_1has_1frame", "gtk_1scrolled_1window_1set_1policy", "gtk_1scrolled_1window_1set_1shadow_1type", diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h index 928858104c..2500681741 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h @@ -703,7 +703,8 @@ typedef enum { gtk_1scrolled_1window_1get_1shadow_1type_FUNC, gtk_1scrolled_1window_1get_1vadjustment_FUNC, gtk_1scrolled_1window_1get_1vscrollbar_FUNC, - gtk_1scrolled_1window_1new_FUNC, + gtk_1scrolled_1window_1new___FUNC, + gtk_1scrolled_1window_1new__JJ_FUNC, gtk_1scrolled_1window_1set_1has_1frame_FUNC, gtk_1scrolled_1window_1set_1policy_FUNC, gtk_1scrolled_1window_1set_1shadow_1type_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java index a930209b43..b48b283351 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java @@ -2152,15 +2152,14 @@ public class GTK extends OS { * @param draw_value cast=(gboolean) */ public static final native void gtk_scale_set_draw_value(long scale, boolean draw_value); - /** - * @param scrollable cast=(GtkScrollable *) - */ + /** @param scrollable cast=(GtkScrollable *) */ public static final native long gtk_scrollable_get_vadjustment(long scrollable); + + + /* GtkScrolledWindow */ /** @param scrolled_window cast=(GtkScrolledWindow *) */ public static final native long gtk_scrolled_window_get_hadjustment(long scrolled_window); - /** - * @param scrolled_window cast=(GtkScrolledWindow *) - */ + /** @param scrolled_window cast=(GtkScrolledWindow *) */ public static final native long gtk_scrolled_window_get_hscrollbar(long scrolled_window); /** * @param scrolled_window cast=(GtkScrolledWindow *) @@ -2175,11 +2174,6 @@ public class GTK extends OS { */ public static final native long gtk_scrolled_window_get_vscrollbar(long scrolled_window); /** - * @param hadjustment cast=(GtkAdjustment *) - * @param vadjustment cast=(GtkAdjustment *) - */ - public static final native long gtk_scrolled_window_new(long hadjustment, long vadjustment); - /** * @param scrolled_window cast=(GtkScrolledWindow *) * @param hscrollbar_policy cast=(GtkPolicyType) * @param vscrollbar_policy cast=(GtkPolicyType) @@ -2190,22 +2184,29 @@ public class GTK extends OS { * @param scrolled_window cast=(GtkScrolledWindow *) */ public static final native boolean gtk_scrolled_window_get_overlay_scrolling(long scrolled_window); + + /* GtkScrolledWindow [GTK3 only, if-def'd in os.h] */ + /** + * @param hadjustment cast=(GtkAdjustment *) + * @param vadjustment cast=(GtkAdjustment *) + */ + public static final native long gtk_scrolled_window_new(long hadjustment, long vadjustment); /** * @param scrolled_window cast=(GtkScrolledWindow *) * @param type cast=(GtkShadowType) */ - /* [GTK3 only, if-def'd in os.h] */ public static final native void gtk_scrolled_window_set_shadow_type(long scrolled_window, int type); /** @param scrolled_window cast=(GtkScrolledWindow *) */ - /* [GTK3 only, if-def'd in os.h] */ public static final native int gtk_scrolled_window_get_shadow_type(long scrolled_window); + + /* GtkScrolledWindow [GTK4 only, if-def'd in os.h] */ + public static final native long gtk_scrolled_window_new(); /** @param scrolled_window cast=(GtkScrolledWindow *) */ - /* [GTK4 only, if-def'd in os.h] */ public static final native void gtk_scrolled_window_set_has_frame(long scrolled_window, boolean has_frame); /** @param scrolled_window cast=(GtkScrolledWindow *) */ - /* [GTK4 only, if-def'd in os.h] */ public static final native boolean gtk_scrolled_window_get_has_frame(long scrolled_window); + public static final native long gtk_settings_get_default(); /** @param selection_data cast=(GtkSelectionData *) */ public static final native void gtk_selection_data_free(long selection_data); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java index 15fe11427b..0e5f7017d1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java @@ -305,11 +305,17 @@ void createHandle (int index, boolean fixed, boolean scrolled) { if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES); gtk_widget_set_has_surface_or_window (fixedHandle, true); } - long vadj = GTK.gtk_adjustment_new (0, 0, 100, 1, 10, 10); - if (vadj == 0) error (SWT.ERROR_NO_HANDLES); - long hadj = GTK.gtk_adjustment_new (0, 0, 100, 1, 10, 10); - if (hadj == 0) error (SWT.ERROR_NO_HANDLES); - scrolledHandle = GTK.gtk_scrolled_window_new (hadj, vadj); + + if (GTK.GTK4) { + scrolledHandle = GTK.gtk_scrolled_window_new(); + } else { + long vadj = GTK.gtk_adjustment_new (0, 0, 100, 1, 10, 10); + if (vadj == 0) error (SWT.ERROR_NO_HANDLES); + long hadj = GTK.gtk_adjustment_new (0, 0, 100, 1, 10, 10); + if (hadj == 0) error (SWT.ERROR_NO_HANDLES); + scrolledHandle = GTK.gtk_scrolled_window_new (hadj, vadj); + } + if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES); } handle = OS.g_object_new (display.gtk_fixed_get_type (), 0); 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 a9f079b08c..127071d229 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 @@ -140,7 +140,11 @@ void createHandle (int index) { handle = gtk_box_new (GTK.GTK_ORIENTATION_VERTICAL, false, 0); if (handle == 0) error (SWT.ERROR_NO_HANDLES); if ((style & SWT.V_SCROLL) != 0) { - scrolledHandle = GTK.gtk_scrolled_window_new (0, 0); + if (GTK.GTK4) { + scrolledHandle = GTK.gtk_scrolled_window_new(); + } else { + scrolledHandle = GTK.gtk_scrolled_window_new (0, 0); + } if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES); GTK.gtk_scrolled_window_set_policy (scrolledHandle, GTK.GTK_POLICY_NEVER, GTK.GTK_POLICY_AUTOMATIC); GTK.gtk_container_add (fixedHandle, scrolledHandle); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java index b1ae62ee5b..78665f6e63 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java @@ -203,7 +203,11 @@ void createHandle (int index) { fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0); if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES); gtk_widget_set_has_surface_or_window (fixedHandle, true); - scrolledHandle = GTK.gtk_scrolled_window_new (0, 0); + if (GTK.GTK4) { + scrolledHandle = GTK.gtk_scrolled_window_new(); + } else { + scrolledHandle = GTK.gtk_scrolled_window_new (0, 0); + } if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES); /* * Columns: diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java index b446b9a481..1b80a4060b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java @@ -641,7 +641,11 @@ void createHandle (int index) { fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0); if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES); gtk_widget_set_has_surface_or_window (fixedHandle, true); - scrolledHandle = GTK.gtk_scrolled_window_new (0, 0); + if (GTK.GTK4) { + scrolledHandle = GTK.gtk_scrolled_window_new(); + } else { + scrolledHandle = GTK.gtk_scrolled_window_new (0, 0); + } if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES); long [] types = getColumnTypes (1); modelHandle = GTK.gtk_list_store_newv (types.length, types); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java index ef642173c0..7dc456c8bd 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java @@ -242,7 +242,11 @@ void createHandle (int index) { GTK.gtk_entry_set_alignment (handle, alignment); } } else { - scrolledHandle = GTK.gtk_scrolled_window_new (0, 0); + if (GTK.GTK4) { + scrolledHandle = GTK.gtk_scrolled_window_new(); + } else { + scrolledHandle = GTK.gtk_scrolled_window_new (0, 0); + } if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES); handle = GTK.gtk_text_view_new (); if (handle == 0) error (SWT.ERROR_NO_HANDLES); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java index 84c2af4c39..c828997498 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java @@ -793,7 +793,11 @@ void createHandle (int index) { fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0); if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES); gtk_widget_set_has_surface_or_window (fixedHandle, true); - scrolledHandle = GTK.gtk_scrolled_window_new (0, 0); + if (GTK.GTK4) { + scrolledHandle = GTK.gtk_scrolled_window_new(); + } else { + scrolledHandle = GTK.gtk_scrolled_window_new (0, 0); + } if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES); long [] types = getColumnTypes (1); modelHandle = GTK.gtk_tree_store_newv (types.length, types); |