Bug 570533 - [GTK4] Make separate GTK3.java and GTK4.java native
wrappers

- Move GtkFileChooser functions from GTK.java to their respective GTK
version specific java classes

Change-Id: Ice6a8794ce9b29dbc4e6784bbbf87e0d7f019ce3
Signed-off-by: Paul D'Pong <sdamrong@redhat.com>
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/179400
Tested-by: Platform Bot <platform-bot@eclipse.org>
Reviewed-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk3.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk3.c
index 4b4e0c7..c809726 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk3.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk3.c
@@ -333,6 +333,132 @@
 }
 #endif
 
+#ifndef NO_gtk_1file_1chooser_1get_1filename
+JNIEXPORT jlong JNICALL GTK3_NATIVE(gtk_1file_1chooser_1get_1filename)
+	(JNIEnv *env, jclass that, jlong arg0)
+{
+	jlong rc = 0;
+	GTK3_NATIVE_ENTER(env, that, gtk_1file_1chooser_1get_1filename_FUNC);
+	rc = (jlong)gtk_file_chooser_get_filename((GtkFileChooser *)arg0);
+	GTK3_NATIVE_EXIT(env, that, gtk_1file_1chooser_1get_1filename_FUNC);
+	return rc;
+}
+#endif
+
+#ifndef NO_gtk_1file_1chooser_1get_1filenames
+JNIEXPORT jlong JNICALL GTK3_NATIVE(gtk_1file_1chooser_1get_1filenames)
+	(JNIEnv *env, jclass that, jlong arg0)
+{
+	jlong rc = 0;
+	GTK3_NATIVE_ENTER(env, that, gtk_1file_1chooser_1get_1filenames_FUNC);
+	rc = (jlong)gtk_file_chooser_get_filenames((GtkFileChooser *)arg0);
+	GTK3_NATIVE_EXIT(env, that, gtk_1file_1chooser_1get_1filenames_FUNC);
+	return rc;
+}
+#endif
+
+#ifndef NO_gtk_1file_1chooser_1get_1uri
+JNIEXPORT jlong JNICALL GTK3_NATIVE(gtk_1file_1chooser_1get_1uri)
+	(JNIEnv *env, jclass that, jlong arg0)
+{
+	jlong rc = 0;
+	GTK3_NATIVE_ENTER(env, that, gtk_1file_1chooser_1get_1uri_FUNC);
+	rc = (jlong)gtk_file_chooser_get_uri((GtkFileChooser *)arg0);
+	GTK3_NATIVE_EXIT(env, that, gtk_1file_1chooser_1get_1uri_FUNC);
+	return rc;
+}
+#endif
+
+#ifndef NO_gtk_1file_1chooser_1get_1uris
+JNIEXPORT jlong JNICALL GTK3_NATIVE(gtk_1file_1chooser_1get_1uris)
+	(JNIEnv *env, jclass that, jlong arg0)
+{
+	jlong rc = 0;
+	GTK3_NATIVE_ENTER(env, that, gtk_1file_1chooser_1get_1uris_FUNC);
+	rc = (jlong)gtk_file_chooser_get_uris((GtkFileChooser *)arg0);
+	GTK3_NATIVE_EXIT(env, that, gtk_1file_1chooser_1get_1uris_FUNC);
+	return rc;
+}
+#endif
+
+#ifndef NO_gtk_1file_1chooser_1set_1current_1folder
+JNIEXPORT void JNICALL GTK3_NATIVE(gtk_1file_1chooser_1set_1current_1folder)
+	(JNIEnv *env, jclass that, jlong arg0, jlong arg1)
+{
+	GTK3_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1current_1folder_FUNC);
+	gtk_file_chooser_set_current_folder((GtkFileChooser *)arg0, (const gchar *)arg1);
+	GTK3_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1current_1folder_FUNC);
+}
+#endif
+
+#ifndef NO_gtk_1file_1chooser_1set_1current_1folder_1uri
+JNIEXPORT void JNICALL GTK3_NATIVE(gtk_1file_1chooser_1set_1current_1folder_1uri)
+	(JNIEnv *env, jclass that, jlong arg0, jbyteArray arg1)
+{
+	jbyte *lparg1=NULL;
+	GTK3_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1current_1folder_1uri_FUNC);
+	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
+	gtk_file_chooser_set_current_folder_uri((GtkFileChooser *)arg0, (const gchar *)lparg1);
+fail:
+	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
+	GTK3_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1current_1folder_1uri_FUNC);
+}
+#endif
+
+#ifndef NO_gtk_1file_1chooser_1set_1do_1overwrite_1confirmation
+JNIEXPORT void JNICALL GTK3_NATIVE(gtk_1file_1chooser_1set_1do_1overwrite_1confirmation)
+	(JNIEnv *env, jclass that, jlong arg0, jboolean arg1)
+{
+	GTK3_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1do_1overwrite_1confirmation_FUNC);
+	gtk_file_chooser_set_do_overwrite_confirmation((GtkFileChooser *)arg0, (gboolean)arg1);
+	GTK3_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1do_1overwrite_1confirmation_FUNC);
+}
+#endif
+
+#ifndef NO_gtk_1file_1chooser_1set_1extra_1widget
+JNIEXPORT void JNICALL GTK3_NATIVE(gtk_1file_1chooser_1set_1extra_1widget)
+	(JNIEnv *env, jclass that, jlong arg0, jlong arg1)
+{
+	GTK3_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1extra_1widget_FUNC);
+	gtk_file_chooser_set_extra_widget((GtkFileChooser *)arg0, (GtkWidget *)arg1);
+	GTK3_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1extra_1widget_FUNC);
+}
+#endif
+
+#ifndef NO_gtk_1file_1chooser_1set_1filename
+JNIEXPORT void JNICALL GTK3_NATIVE(gtk_1file_1chooser_1set_1filename)
+	(JNIEnv *env, jclass that, jlong arg0, jlong arg1)
+{
+	GTK3_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1filename_FUNC);
+	gtk_file_chooser_set_filename((GtkFileChooser *)arg0, (const gchar *)arg1);
+	GTK3_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1filename_FUNC);
+}
+#endif
+
+#ifndef NO_gtk_1file_1chooser_1set_1local_1only
+JNIEXPORT void JNICALL GTK3_NATIVE(gtk_1file_1chooser_1set_1local_1only)
+	(JNIEnv *env, jclass that, jlong arg0, jboolean arg1)
+{
+	GTK3_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1local_1only_FUNC);
+	gtk_file_chooser_set_local_only((GtkFileChooser *)arg0, (gboolean)arg1);
+	GTK3_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1local_1only_FUNC);
+}
+#endif
+
+#ifndef NO_gtk_1file_1chooser_1set_1uri
+JNIEXPORT void JNICALL GTK3_NATIVE(gtk_1file_1chooser_1set_1uri)
+	(JNIEnv *env, jclass that, jlong arg0, jbyteArray arg1)
+{
+	jbyte *lparg1=NULL;
+	GTK3_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1uri_FUNC);
+	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
+	gtk_file_chooser_set_uri((GtkFileChooser *)arg0, (const char *)lparg1);
+fail:
+	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
+	GTK3_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1uri_FUNC);
+}
+#endif
+
 #ifndef NO_gtk_1get_1current_1event
 JNIEXPORT jlong JNICALL GTK3_NATIVE(gtk_1get_1current_1event)
 	(JNIEnv *env, jclass that)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk3_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk3_stats.c
index a123840..3e79110 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk3_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk3_stats.c
@@ -49,6 +49,17 @@
 	"gtk_1drag_1get_1data",
 	"gtk_1drag_1set_1icon_1surface",
 	"gtk_1events_1pending",
+	"gtk_1file_1chooser_1get_1filename",
+	"gtk_1file_1chooser_1get_1filenames",
+	"gtk_1file_1chooser_1get_1uri",
+	"gtk_1file_1chooser_1get_1uris",
+	"gtk_1file_1chooser_1set_1current_1folder",
+	"gtk_1file_1chooser_1set_1current_1folder_1uri",
+	"gtk_1file_1chooser_1set_1do_1overwrite_1confirmation",
+	"gtk_1file_1chooser_1set_1extra_1widget",
+	"gtk_1file_1chooser_1set_1filename",
+	"gtk_1file_1chooser_1set_1local_1only",
+	"gtk_1file_1chooser_1set_1uri",
 	"gtk_1get_1current_1event",
 	"gtk_1get_1current_1event_1state",
 	"gtk_1get_1event_1widget",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk3_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk3_stats.h
index a2f1b05..607df2e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk3_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk3_stats.h
@@ -59,6 +59,17 @@
 	gtk_1drag_1get_1data_FUNC,
 	gtk_1drag_1set_1icon_1surface_FUNC,
 	gtk_1events_1pending_FUNC,
+	gtk_1file_1chooser_1get_1filename_FUNC,
+	gtk_1file_1chooser_1get_1filenames_FUNC,
+	gtk_1file_1chooser_1get_1uri_FUNC,
+	gtk_1file_1chooser_1get_1uris_FUNC,
+	gtk_1file_1chooser_1set_1current_1folder_FUNC,
+	gtk_1file_1chooser_1set_1current_1folder_1uri_FUNC,
+	gtk_1file_1chooser_1set_1do_1overwrite_1confirmation_FUNC,
+	gtk_1file_1chooser_1set_1extra_1widget_FUNC,
+	gtk_1file_1chooser_1set_1filename_FUNC,
+	gtk_1file_1chooser_1set_1local_1only_FUNC,
+	gtk_1file_1chooser_1set_1uri_FUNC,
 	gtk_1get_1current_1event_FUNC,
 	gtk_1get_1current_1event_1state_FUNC,
 	gtk_1get_1event_1widget_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk4.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk4.c
index 0014bb9..c4f61fe 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk4.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk4.c
@@ -319,6 +319,54 @@
 }
 #endif
 
+#ifndef NO_gtk_1file_1chooser_1get_1file
+JNIEXPORT jlong JNICALL GTK4_NATIVE(gtk_1file_1chooser_1get_1file)
+	(JNIEnv *env, jclass that, jlong arg0)
+{
+	jlong rc = 0;
+	GTK4_NATIVE_ENTER(env, that, gtk_1file_1chooser_1get_1file_FUNC);
+	rc = (jlong)gtk_file_chooser_get_file((GtkFileChooser *)arg0);
+	GTK4_NATIVE_EXIT(env, that, gtk_1file_1chooser_1get_1file_FUNC);
+	return rc;
+}
+#endif
+
+#ifndef NO_gtk_1file_1chooser_1get_1files
+JNIEXPORT jlong JNICALL GTK4_NATIVE(gtk_1file_1chooser_1get_1files)
+	(JNIEnv *env, jclass that, jlong arg0)
+{
+	jlong rc = 0;
+	GTK4_NATIVE_ENTER(env, that, gtk_1file_1chooser_1get_1files_FUNC);
+	rc = (jlong)gtk_file_chooser_get_files((GtkFileChooser *)arg0);
+	GTK4_NATIVE_EXIT(env, that, gtk_1file_1chooser_1get_1files_FUNC);
+	return rc;
+}
+#endif
+
+#ifndef NO_gtk_1file_1chooser_1set_1current_1folder
+JNIEXPORT jboolean JNICALL GTK4_NATIVE(gtk_1file_1chooser_1set_1current_1folder)
+	(JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2)
+{
+	jboolean rc = 0;
+	GTK4_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1current_1folder_FUNC);
+	rc = (jboolean)gtk_file_chooser_set_current_folder((GtkFileChooser *)arg0, (GFile *)arg1, (GError **)arg2);
+	GTK4_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1current_1folder_FUNC);
+	return rc;
+}
+#endif
+
+#ifndef NO_gtk_1file_1chooser_1set_1file
+JNIEXPORT jboolean JNICALL GTK4_NATIVE(gtk_1file_1chooser_1set_1file)
+	(JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2)
+{
+	jboolean rc = 0;
+	GTK4_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1file_FUNC);
+	rc = (jboolean)gtk_file_chooser_set_file((GtkFileChooser *)arg0, (GFile *)arg1, (GError **)arg2);
+	GTK4_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1file_FUNC);
+	return rc;
+}
+#endif
+
 #ifndef NO_gtk_1hsv_1to_1rgb
 JNIEXPORT void JNICALL GTK4_NATIVE(gtk_1hsv_1to_1rgb)
 	(JNIEnv *env, jclass that, jfloat arg0, jfloat arg1, jfloat arg2, jfloatArray arg3, jfloatArray arg4, jfloatArray arg5)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk4_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk4_stats.c
index 19e46ae..a07082a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk4_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk4_stats.c
@@ -48,6 +48,10 @@
 	"gtk_1drag_1source_1set_1icon",
 	"gtk_1drop_1target_1async_1new",
 	"gtk_1drop_1target_1async_1set_1formats",
+	"gtk_1file_1chooser_1get_1file",
+	"gtk_1file_1chooser_1get_1files",
+	"gtk_1file_1chooser_1set_1current_1folder",
+	"gtk_1file_1chooser_1set_1file",
 	"gtk_1hsv_1to_1rgb",
 	"gtk_1im_1context_1filter_1keypress",
 	"gtk_1init_1check",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk4_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk4_stats.h
index d802161..a26f0e2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk4_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk4_stats.h
@@ -58,6 +58,10 @@
 	gtk_1drag_1source_1set_1icon_FUNC,
 	gtk_1drop_1target_1async_1new_FUNC,
 	gtk_1drop_1target_1async_1set_1formats_FUNC,
+	gtk_1file_1chooser_1get_1file_FUNC,
+	gtk_1file_1chooser_1get_1files_FUNC,
+	gtk_1file_1chooser_1set_1current_1folder_FUNC,
+	gtk_1file_1chooser_1set_1file_FUNC,
 	gtk_1hsv_1to_1rgb_FUNC,
 	gtk_1im_1context_1filter_1keypress_FUNC,
 	gtk_1init_1check_FUNC,
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 f1e25ea..15df13b 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
@@ -5624,70 +5624,6 @@
 }
 #endif
 
-#ifndef NO_gtk_1file_1chooser_1get_1file
-JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1file_1chooser_1get_1file)
-	(JNIEnv *env, jclass that, jlong arg0)
-{
-	jlong rc = 0;
-	GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1get_1file_FUNC);
-	rc = (jlong)gtk_file_chooser_get_file((GtkFileChooser *)arg0);
-	GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1get_1file_FUNC);
-	return rc;
-}
-#endif
-
-#ifndef NO_gtk_1file_1chooser_1get_1filename
-JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1file_1chooser_1get_1filename)
-	(JNIEnv *env, jclass that, jlong arg0)
-{
-	jlong rc = 0;
-	GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1get_1filename_FUNC);
-/*
-	rc = (jlong)gtk_file_chooser_get_filename((GtkFileChooser *)arg0);
-*/
-	{
-		GTK_LOAD_FUNCTION(fp, gtk_file_chooser_get_filename)
-		if (fp) {
-			rc = (jlong)((jlong (CALLING_CONVENTION*)(GtkFileChooser *))fp)((GtkFileChooser *)arg0);
-		}
-	}
-	GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1get_1filename_FUNC);
-	return rc;
-}
-#endif
-
-#ifndef NO_gtk_1file_1chooser_1get_1filenames
-JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1file_1chooser_1get_1filenames)
-	(JNIEnv *env, jclass that, jlong arg0)
-{
-	jlong rc = 0;
-	GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1get_1filenames_FUNC);
-/*
-	rc = (jlong)gtk_file_chooser_get_filenames((GtkFileChooser *)arg0);
-*/
-	{
-		GTK_LOAD_FUNCTION(fp, gtk_file_chooser_get_filenames)
-		if (fp) {
-			rc = (jlong)((jlong (CALLING_CONVENTION*)(GtkFileChooser *))fp)((GtkFileChooser *)arg0);
-		}
-	}
-	GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1get_1filenames_FUNC);
-	return rc;
-}
-#endif
-
-#ifndef NO_gtk_1file_1chooser_1get_1files
-JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1file_1chooser_1get_1files)
-	(JNIEnv *env, jclass that, jlong arg0)
-{
-	jlong rc = 0;
-	GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1get_1files_FUNC);
-	rc = (jlong)gtk_file_chooser_get_files((GtkFileChooser *)arg0);
-	GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1get_1files_FUNC);
-	return rc;
-}
-#endif
-
 #ifndef NO_gtk_1file_1chooser_1get_1filter
 JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1file_1chooser_1get_1filter)
 	(JNIEnv *env, jclass that, jlong arg0)
@@ -5700,46 +5636,6 @@
 }
 #endif
 
-#ifndef NO_gtk_1file_1chooser_1get_1uri
-JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1file_1chooser_1get_1uri)
-	(JNIEnv *env, jclass that, jlong arg0)
-{
-	jlong rc = 0;
-	GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1get_1uri_FUNC);
-/*
-	rc = (jlong)gtk_file_chooser_get_uri((GtkFileChooser *)arg0);
-*/
-	{
-		GTK_LOAD_FUNCTION(fp, gtk_file_chooser_get_uri)
-		if (fp) {
-			rc = (jlong)((jlong (CALLING_CONVENTION*)(GtkFileChooser *))fp)((GtkFileChooser *)arg0);
-		}
-	}
-	GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1get_1uri_FUNC);
-	return rc;
-}
-#endif
-
-#ifndef NO_gtk_1file_1chooser_1get_1uris
-JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1file_1chooser_1get_1uris)
-	(JNIEnv *env, jclass that, jlong arg0)
-{
-	jlong rc = 0;
-	GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1get_1uris_FUNC);
-/*
-	rc = (jlong)gtk_file_chooser_get_uris((GtkFileChooser *)arg0);
-*/
-	{
-		GTK_LOAD_FUNCTION(fp, gtk_file_chooser_get_uris)
-		if (fp) {
-			rc = (jlong)((jlong (CALLING_CONVENTION*)(GtkFileChooser *))fp)((GtkFileChooser *)arg0);
-		}
-	}
-	GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1get_1uris_FUNC);
-	return rc;
-}
-#endif
-
 #ifndef NO_gtk_1file_1chooser_1native_1new
 JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1file_1chooser_1native_1new)
 	(JNIEnv *env, jclass that, jbyteArray arg0, jlong arg1, jint arg2, jbyteArray arg3, jbyteArray arg4)
@@ -5770,66 +5666,6 @@
 }
 #endif
 
-#ifndef NO_gtk_1file_1chooser_1set_1current_1folder__JJ
-JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1current_1folder__JJ)
-	(JNIEnv *env, jclass that, jlong arg0, jlong arg1)
-{
-	GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1current_1folder__JJ_FUNC);
-/*
-	gtk_file_chooser_set_current_folder((GtkFileChooser *)arg0, (const gchar *)arg1);
-*/
-	{
-		GTK_LOAD_FUNCTION(fp, gtk_file_chooser_set_current_folder)
-		if (fp) {
-			((void (CALLING_CONVENTION*)(GtkFileChooser *, const gchar *))fp)((GtkFileChooser *)arg0, (const gchar *)arg1);
-		}
-	}
-	GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1current_1folder__JJ_FUNC);
-}
-#endif
-
-#ifndef NO_gtk_1file_1chooser_1set_1current_1folder__JJJ
-JNIEXPORT jboolean JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1current_1folder__JJJ)
-	(JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2)
-{
-	jboolean rc = 0;
-	GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1current_1folder__JJJ_FUNC);
-/*
-	rc = (jboolean)gtk_file_chooser_set_current_folder((GtkFileChooser *)arg0, (GFile *)arg1, (GError **)arg2);
-*/
-	{
-		GTK_LOAD_FUNCTION(fp, gtk_file_chooser_set_current_folder)
-		if (fp) {
-			rc = (jboolean)((jboolean (CALLING_CONVENTION*)(GtkFileChooser *, GFile *, GError **))fp)((GtkFileChooser *)arg0, (GFile *)arg1, (GError **)arg2);
-		}
-	}
-	GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1current_1folder__JJJ_FUNC);
-	return rc;
-}
-#endif
-
-#ifndef NO_gtk_1file_1chooser_1set_1current_1folder_1uri
-JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1current_1folder_1uri)
-	(JNIEnv *env, jclass that, jlong arg0, jbyteArray arg1)
-{
-	jbyte *lparg1=NULL;
-	GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1current_1folder_1uri_FUNC);
-	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
-/*
-	gtk_file_chooser_set_current_folder_uri((GtkFileChooser *)arg0, (const gchar *)lparg1);
-*/
-	{
-		GTK_LOAD_FUNCTION(fp, gtk_file_chooser_set_current_folder_uri)
-		if (fp) {
-			((void (CALLING_CONVENTION*)(GtkFileChooser *, const gchar *))fp)((GtkFileChooser *)arg0, (const gchar *)lparg1);
-		}
-	}
-fail:
-	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
-	GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1current_1folder_1uri_FUNC);
-}
-#endif
-
 #ifndef NO_gtk_1file_1chooser_1set_1current_1name
 JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1current_1name)
 	(JNIEnv *env, jclass that, jlong arg0, jbyteArray arg1)
@@ -5844,80 +5680,6 @@
 }
 #endif
 
-#ifndef NO_gtk_1file_1chooser_1set_1do_1overwrite_1confirmation
-JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1do_1overwrite_1confirmation)
-	(JNIEnv *env, jclass that, jlong arg0, jboolean arg1)
-{
-	GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1do_1overwrite_1confirmation_FUNC);
-/*
-	gtk_file_chooser_set_do_overwrite_confirmation((GtkFileChooser *)arg0, (gboolean)arg1);
-*/
-	{
-		GTK_LOAD_FUNCTION(fp, gtk_file_chooser_set_do_overwrite_confirmation)
-		if (fp) {
-			((void (CALLING_CONVENTION*)(GtkFileChooser *, gboolean))fp)((GtkFileChooser *)arg0, (gboolean)arg1);
-		}
-	}
-	GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1do_1overwrite_1confirmation_FUNC);
-}
-#endif
-
-#ifndef NO_gtk_1file_1chooser_1set_1extra_1widget
-JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1extra_1widget)
-	(JNIEnv *env, jclass that, jlong arg0, jlong arg1)
-{
-	GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1extra_1widget_FUNC);
-/*
-	gtk_file_chooser_set_extra_widget((GtkFileChooser *)arg0, (GtkWidget *)arg1);
-*/
-	{
-		GTK_LOAD_FUNCTION(fp, gtk_file_chooser_set_extra_widget)
-		if (fp) {
-			((void (CALLING_CONVENTION*)(GtkFileChooser *, GtkWidget *))fp)((GtkFileChooser *)arg0, (GtkWidget *)arg1);
-		}
-	}
-	GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1extra_1widget_FUNC);
-}
-#endif
-
-#ifndef NO_gtk_1file_1chooser_1set_1file
-JNIEXPORT jboolean JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1file)
-	(JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2)
-{
-	jboolean rc = 0;
-	GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1file_FUNC);
-/*
-	rc = (jboolean)gtk_file_chooser_set_file((GtkFileChooser *)arg0, (GFile *)arg1, (GError **)arg2);
-*/
-	{
-		GTK_LOAD_FUNCTION(fp, gtk_file_chooser_set_file)
-		if (fp) {
-			rc = (jboolean)((jboolean (CALLING_CONVENTION*)(GtkFileChooser *, GFile *, GError **))fp)((GtkFileChooser *)arg0, (GFile *)arg1, (GError **)arg2);
-		}
-	}
-	GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1file_FUNC);
-	return rc;
-}
-#endif
-
-#ifndef NO_gtk_1file_1chooser_1set_1filename
-JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1filename)
-	(JNIEnv *env, jclass that, jlong arg0, jlong arg1)
-{
-	GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1filename_FUNC);
-/*
-	gtk_file_chooser_set_filename((GtkFileChooser *)arg0, (const gchar *)arg1);
-*/
-	{
-		GTK_LOAD_FUNCTION(fp, gtk_file_chooser_set_filename)
-		if (fp) {
-			((void (CALLING_CONVENTION*)(GtkFileChooser *, const gchar *))fp)((GtkFileChooser *)arg0, (const gchar *)arg1);
-		}
-	}
-	GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1filename_FUNC);
-}
-#endif
-
 #ifndef NO_gtk_1file_1chooser_1set_1filter
 JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1filter)
 	(JNIEnv *env, jclass that, jlong arg0, jlong arg1)
@@ -5928,24 +5690,6 @@
 }
 #endif
 
-#ifndef NO_gtk_1file_1chooser_1set_1local_1only
-JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1local_1only)
-	(JNIEnv *env, jclass that, jlong arg0, jboolean arg1)
-{
-	GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1local_1only_FUNC);
-/*
-	gtk_file_chooser_set_local_only((GtkFileChooser *)arg0, (gboolean)arg1);
-*/
-	{
-		GTK_LOAD_FUNCTION(fp, gtk_file_chooser_set_local_only)
-		if (fp) {
-			((void (CALLING_CONVENTION*)(GtkFileChooser *, gboolean))fp)((GtkFileChooser *)arg0, (gboolean)arg1);
-		}
-	}
-	GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1local_1only_FUNC);
-}
-#endif
-
 #ifndef NO_gtk_1file_1chooser_1set_1select_1multiple
 JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1select_1multiple)
 	(JNIEnv *env, jclass that, jlong arg0, jboolean arg1)
@@ -5956,28 +5700,6 @@
 }
 #endif
 
-#ifndef NO_gtk_1file_1chooser_1set_1uri
-JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1uri)
-	(JNIEnv *env, jclass that, jlong arg0, jbyteArray arg1)
-{
-	jbyte *lparg1=NULL;
-	GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1uri_FUNC);
-	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
-/*
-	gtk_file_chooser_set_uri((GtkFileChooser *)arg0, (const char *)lparg1);
-*/
-	{
-		GTK_LOAD_FUNCTION(fp, gtk_file_chooser_set_uri)
-		if (fp) {
-			((void (CALLING_CONVENTION*)(GtkFileChooser *, const char *))fp)((GtkFileChooser *)arg0, (const char *)lparg1);
-		}
-	}
-fail:
-	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
-	GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1uri_FUNC);
-}
-#endif
-
 #ifndef NO_gtk_1file_1filter_1add_1pattern
 JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1filter_1add_1pattern)
 	(JNIEnv *env, jclass that, jlong arg0, jbyteArray arg1)
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 74197d1..1e67c69 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
@@ -449,26 +449,11 @@
 	"gtk_1expander_1set_1expanded",
 	"gtk_1expander_1set_1label_1widget",
 	"gtk_1file_1chooser_1add_1filter",
-	"gtk_1file_1chooser_1get_1file",
-	"gtk_1file_1chooser_1get_1filename",
-	"gtk_1file_1chooser_1get_1filenames",
-	"gtk_1file_1chooser_1get_1files",
 	"gtk_1file_1chooser_1get_1filter",
-	"gtk_1file_1chooser_1get_1uri",
-	"gtk_1file_1chooser_1get_1uris",
 	"gtk_1file_1chooser_1native_1new",
-	"gtk_1file_1chooser_1set_1current_1folder__JJ",
-	"gtk_1file_1chooser_1set_1current_1folder__JJJ",
-	"gtk_1file_1chooser_1set_1current_1folder_1uri",
 	"gtk_1file_1chooser_1set_1current_1name",
-	"gtk_1file_1chooser_1set_1do_1overwrite_1confirmation",
-	"gtk_1file_1chooser_1set_1extra_1widget",
-	"gtk_1file_1chooser_1set_1file",
-	"gtk_1file_1chooser_1set_1filename",
 	"gtk_1file_1chooser_1set_1filter",
-	"gtk_1file_1chooser_1set_1local_1only",
 	"gtk_1file_1chooser_1set_1select_1multiple",
-	"gtk_1file_1chooser_1set_1uri",
 	"gtk_1file_1filter_1add_1pattern",
 	"gtk_1file_1filter_1get_1name",
 	"gtk_1file_1filter_1new",
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 36633b0..1ebba2f 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
@@ -447,26 +447,11 @@
 	gtk_1expander_1set_1expanded_FUNC,
 	gtk_1expander_1set_1label_1widget_FUNC,
 	gtk_1file_1chooser_1add_1filter_FUNC,
-	gtk_1file_1chooser_1get_1file_FUNC,
-	gtk_1file_1chooser_1get_1filename_FUNC,
-	gtk_1file_1chooser_1get_1filenames_FUNC,
-	gtk_1file_1chooser_1get_1files_FUNC,
 	gtk_1file_1chooser_1get_1filter_FUNC,
-	gtk_1file_1chooser_1get_1uri_FUNC,
-	gtk_1file_1chooser_1get_1uris_FUNC,
 	gtk_1file_1chooser_1native_1new_FUNC,
-	gtk_1file_1chooser_1set_1current_1folder__JJ_FUNC,
-	gtk_1file_1chooser_1set_1current_1folder__JJJ_FUNC,
-	gtk_1file_1chooser_1set_1current_1folder_1uri_FUNC,
 	gtk_1file_1chooser_1set_1current_1name_FUNC,
-	gtk_1file_1chooser_1set_1do_1overwrite_1confirmation_FUNC,
-	gtk_1file_1chooser_1set_1extra_1widget_FUNC,
-	gtk_1file_1chooser_1set_1file_FUNC,
-	gtk_1file_1chooser_1set_1filename_FUNC,
 	gtk_1file_1chooser_1set_1filter_FUNC,
-	gtk_1file_1chooser_1set_1local_1only_FUNC,
 	gtk_1file_1chooser_1set_1select_1multiple_FUNC,
-	gtk_1file_1chooser_1set_1uri_FUNC,
 	gtk_1file_1filter_1add_1pattern_FUNC,
 	gtk_1file_1filter_1get_1name_FUNC,
 	gtk_1file_1filter_1new_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 ad845bc..d383321 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
@@ -822,12 +822,6 @@
 	 */
 	public static final native void gtk_file_chooser_set_current_name(long chooser, byte[] name);
 	/**
-	 * @method flags=dynamic
-	 * @param chooser cast=(GtkFileChooser *)
-	 * @param extra_widget cast=(GtkWidget *)
-	 */
-	public static final native void gtk_file_chooser_set_extra_widget(long chooser, long extra_widget);
-	/**
 	 * @param chooser cast=(GtkFileChooser *)
 	 * @param filter cast=(GtkFileFilter *)
 	 */
@@ -838,85 +832,6 @@
 	 */
 	public static final native void gtk_file_chooser_set_select_multiple(long chooser, boolean select_multiple);
 
-	/* GtkFileChooser [GTK3] */
-	/**
-	 * @method flags=dynamic
-	 * @param chooser cast=(GtkFileChooser *)
-	 * */
-	public static final native long gtk_file_chooser_get_filename(long chooser);
-	/**
-	 * @method flags=dynamic
-	 * @param chooser cast=(GtkFileChooser *)
-	 * */
-	public static final native long gtk_file_chooser_get_filenames(long chooser);
-	/**
-	 * @method flags=dynamic
-	 * @param chooser cast=(GtkFileChooser *)
-	 * */
-	public static final native long gtk_file_chooser_get_uri(long chooser);
-	/**
-	 * @method flags=dynamic
-	 * @param chooser cast=(GtkFileChooser *)
-	 * */
-	public static final native long gtk_file_chooser_get_uris(long chooser);
-	/**
-	 * @method flags=dynamic
-	 * @param chooser cast=(GtkFileChooser *)
-	 * @param filename cast=(const gchar *)
-	 */
-	public static final native void gtk_file_chooser_set_current_folder(long chooser, long filename);
-	/**
-	 * @method flags=dynamic
-	 * @param chooser cast=(GtkFileChooser *)
-	 * @param uri cast=(const gchar *)
-	 */
-	public static final native void gtk_file_chooser_set_current_folder_uri(long chooser, byte [] uri);
-	/**
-	 * @method flags=dynamic
-	 * @param chooser cast=(GtkFileChooser *)
-	 * @param local_only cast=(gboolean)
-	 */
-	public static final native void gtk_file_chooser_set_local_only(long chooser, boolean local_only);
-	/**
-	 * @method flags=dynamic
-	 * @param chooser cast=(GtkFileChooser *)
-	 * @param do_overwrite_confirmation cast=(gboolean)
-	 */
-	public static final native void gtk_file_chooser_set_do_overwrite_confirmation(long chooser, boolean do_overwrite_confirmation);
-	/**
-	 * @method flags=dynamic
-	 * @param chooser cast=(GtkFileChooser *)
-	 * @param name cast=(const gchar *)
-	 */
-	public static final native void gtk_file_chooser_set_filename(long chooser, long name);
-	/**
-	 * @method flags=dynamic
-	 * @param chooser cast=(GtkFileChooser *)
-	 * @param uri cast=(const char *)
-	 */
-	public static final native void gtk_file_chooser_set_uri(long chooser, byte [] uri);
-
-	/* GtkFileChooser [GTK4] */
-	/** @param chooser cast=(GtkFileChooser *) */
-	public static final native long gtk_file_chooser_get_files(long chooser);
-	/** @param chooser cast=(GtkFileChooser *) */
-	public static final native long gtk_file_chooser_get_file(long chooser);
-	/**
-	 * @method flags=dynamic
-	 * @param chooser cast=(GtkFileChooser *)
-	 * @param file cast=(GFile *)
-	 * @param error cast=(GError **)
-	 */
-	public static final native boolean gtk_file_chooser_set_current_folder(long chooser, long file, long error);
-	/**
-	 * @method flags=dynamic
-	 * @param chooser cast=(GtkFileChooser *)
-	 * @param file cast=(GFile *)
-	 * @param error cast=(GError **)
-	 */
-	public static final native boolean gtk_file_chooser_set_file(long chooser, long file, long error);
-
-
 	/* GtkEventController */
 	/**
 	 * @param controller cast=(GtkEventController *)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk3/GTK3.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk3/GTK3.java
index ed043a6..22e67a0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk3/GTK3.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk3/GTK3.java
@@ -241,4 +241,49 @@
 	 * @param surface cast=(cairo_surface_t *)
 	 */
 	public static final native void gtk_drag_set_icon_surface(long context, long surface);
+
+	/* GtkFileChooser */
+	/** @param chooser cast=(GtkFileChooser *) */
+	public static final native long gtk_file_chooser_get_filename(long chooser);
+	/** @param chooser cast=(GtkFileChooser *) */
+	public static final native long gtk_file_chooser_get_filenames(long chooser);
+	/** @param chooser cast=(GtkFileChooser *) */
+	public static final native long gtk_file_chooser_get_uri(long chooser);
+	/** @param chooser cast=(GtkFileChooser *) */
+	public static final native long gtk_file_chooser_get_uris(long chooser);
+	/**
+	 * @param chooser cast=(GtkFileChooser *)
+	 * @param filename cast=(const gchar *)
+	 */
+	public static final native void gtk_file_chooser_set_current_folder(long chooser, long filename);
+	/**
+	 * @param chooser cast=(GtkFileChooser *)
+	 * @param uri cast=(const gchar *)
+	 */
+	public static final native void gtk_file_chooser_set_current_folder_uri(long chooser, byte [] uri);
+	/**
+	 * @param chooser cast=(GtkFileChooser *)
+	 * @param local_only cast=(gboolean)
+	 */
+	public static final native void gtk_file_chooser_set_local_only(long chooser, boolean local_only);
+	/**
+	 * @param chooser cast=(GtkFileChooser *)
+	 * @param do_overwrite_confirmation cast=(gboolean)
+	 */
+	public static final native void gtk_file_chooser_set_do_overwrite_confirmation(long chooser, boolean do_overwrite_confirmation);
+	/**
+	 * @param chooser cast=(GtkFileChooser *)
+	 * @param name cast=(const gchar *)
+	 */
+	public static final native void gtk_file_chooser_set_filename(long chooser, long name);
+	/**
+	 * @param chooser cast=(GtkFileChooser *)
+	 * @param uri cast=(const char *)
+	 */
+	public static final native void gtk_file_chooser_set_uri(long chooser, byte [] uri);
+	/**
+	 * @param chooser cast=(GtkFileChooser *)
+	 * @param extra_widget cast=(GtkWidget *)
+	 */
+	public static final native void gtk_file_chooser_set_extra_widget(long chooser, long extra_widget);
 }
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk4/GTK4.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk4/GTK4.java
index b9e54ab..19b0685 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk4/GTK4.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk4/GTK4.java
@@ -161,4 +161,22 @@
 	public static final native void gdk_content_formats_builder_add_mime_type(long builder, byte[] mime_type);
 	/** @param builder cast=(GdkContentFormatsBuilder *) */
 	public static final native long gdk_content_formats_builder_free_to_formats(long builder);
+
+	/* GtkFileChooser */
+	/** @param chooser cast=(GtkFileChooser *) */
+	public static final native long gtk_file_chooser_get_files(long chooser);
+	/** @param chooser cast=(GtkFileChooser *) */
+	public static final native long gtk_file_chooser_get_file(long chooser);
+	/**
+	 * @param chooser cast=(GtkFileChooser *)
+	 * @param file cast=(GFile *)
+	 * @param error cast=(GError **)
+	 */
+	public static final native boolean gtk_file_chooser_set_current_folder(long chooser, long file, long error);
+	/**
+	 * @param chooser cast=(GtkFileChooser *)
+	 * @param file cast=(GFile *)
+	 * @param error cast=(GError **)
+	 */
+	public static final native boolean gtk_file_chooser_set_file(long chooser, long file, long error);
 }
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java
index 344a839..2e6456e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java
@@ -20,6 +20,7 @@
 import org.eclipse.swt.internal.*;
 import org.eclipse.swt.internal.gtk.*;
 import org.eclipse.swt.internal.gtk3.*;
+import org.eclipse.swt.internal.gtk4.*;
 
 /**
  * Instances of this class allow the user to navigate
@@ -156,10 +157,10 @@
 		if (ptr != 0) {
 			if (GTK.GTK4) {
 				long file = OS.g_file_new_for_path(buffer);
-				GTK.gtk_file_chooser_set_current_folder (handle, file, 0);
+				GTK4.gtk_file_chooser_set_current_folder (handle, file, 0);
 				OS.g_object_unref(file);
 			} else {
-				GTK.gtk_file_chooser_set_current_folder (handle, ptr);
+				GTK3.gtk_file_chooser_set_current_folder (handle, ptr);
 			}
 			OS.g_free (ptr);
 		}
@@ -193,10 +194,10 @@
 	if (response == GTK.GTK_RESPONSE_ACCEPT) {
 		long path;
 		if (GTK.GTK4) {
-			long file = GTK.gtk_file_chooser_get_file (handle);
+			long file = GTK4.gtk_file_chooser_get_file (handle);
 			path = OS.g_file_get_path(file);
 		} else {
-			path = GTK.gtk_file_chooser_get_filename (handle);
+			path = GTK3.gtk_file_chooser_get_filename (handle);
 		}
 
 		if (path != 0) {
@@ -245,7 +246,7 @@
 
 		GTK.gtk_box_set_homogeneous(box, false);
 		GTK.gtk_label_set_justify(label, GTK.GTK_JUSTIFY_CENTER);
-		GTK.gtk_file_chooser_set_extra_widget(handle, box);
+		GTK3.gtk_file_chooser_set_extra_widget(handle, box);
 	}
 }
 
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java
index ca49bd2..6f40ee3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java
@@ -19,6 +19,8 @@
 import org.eclipse.swt.*;
 import org.eclipse.swt.internal.*;
 import org.eclipse.swt.internal.gtk.*;
+import org.eclipse.swt.internal.gtk3.*;
+import org.eclipse.swt.internal.gtk4.*;
 
 /**
  * Instances of this class allow the user to navigate
@@ -109,12 +111,12 @@
 	if ((style & SWT.MULTI) != 0) {
 		long list = 0;
 		if (GTK.GTK4) {
-			list = GTK.gtk_file_chooser_get_files(handle);
+			list = GTK4.gtk_file_chooser_get_files(handle);
 		} else {
 			if (uriMode) {
-				list = GTK.gtk_file_chooser_get_uris (handle);
+				list = GTK3.gtk_file_chooser_get_uris (handle);
 			} else {
-				list = GTK.gtk_file_chooser_get_filenames (handle);
+				list = GTK3.gtk_file_chooser_get_filenames (handle);
 			}
 		}
 
@@ -165,18 +167,18 @@
 		long utf8Ptr = 0;
 		if (uriMode) {
 			if (GTK.GTK4) {
-				long file = GTK.gtk_file_chooser_get_file(handle);
+				long file = GTK4.gtk_file_chooser_get_file(handle);
 				utf8Ptr = OS.g_file_get_uri(file);
 			} else {
-				utf8Ptr = GTK.gtk_file_chooser_get_uri (handle);
+				utf8Ptr = GTK3.gtk_file_chooser_get_uri (handle);
 			}
 		} else {
 			long path;
 			if (GTK.GTK4) {
-				long file = GTK.gtk_file_chooser_get_file(handle);
+				long file = GTK4.gtk_file_chooser_get_file(handle);
 				path = OS.g_file_get_path(file);
 			} else {
-				path = GTK.gtk_file_chooser_get_filename (handle);
+				path = GTK3.gtk_file_chooser_get_filename (handle);
 			}
 
 			if (path != 0) {
@@ -346,7 +348,7 @@
 
 	if (uriMode && !GTK.GTK4) {
 		// GTK4 file chooser works on GFiles and does not need to worry about this
-		GTK.gtk_file_chooser_set_local_only (handle, false);
+		GTK3.gtk_file_chooser_set_local_only (handle, false);
 	}
 	presetChooserDialog ();
 	display.addIdleProc ();
@@ -396,10 +398,10 @@
 
 				if (GTK.GTK4) {
 					long file = OS.g_file_new_for_uri(buffer);
-					GTK.gtk_file_chooser_set_current_folder (handle, file, 0);
+					GTK4.gtk_file_chooser_set_current_folder (handle, file, 0);
 					OS.g_object_unref(file);
 				} else {
-					GTK.gtk_file_chooser_set_current_folder_uri (handle, buffer);
+					GTK3.gtk_file_chooser_set_current_folder_uri (handle, buffer);
 				}
 
 			} else {
@@ -414,10 +416,10 @@
 				if (ptr != 0) {
 					if (GTK.GTK4) {
 						long file = OS.g_file_new_for_path(buffer);
-						GTK.gtk_file_chooser_set_current_folder (handle, file, 0);
+						GTK4.gtk_file_chooser_set_current_folder (handle, file, 0);
 						OS.g_object_unref(file);
 					} else {
-						GTK.gtk_file_chooser_set_current_folder (handle, ptr);
+						GTK3.gtk_file_chooser_set_current_folder (handle, ptr);
 					}
 					OS.g_free (ptr);
 				}
@@ -471,21 +473,21 @@
 			long file;
 			if (uriMode) {
 				file = OS.g_file_new_for_uri(buffer);
-				GTK.gtk_file_chooser_set_file (handle, file, 0);
+				GTK4.gtk_file_chooser_set_file (handle, file, 0);
 			} else {
 				file = OS.g_file_new_for_path(buffer);
 
 				if (fileName.length() > 0) {
-					GTK.gtk_file_chooser_set_file (handle, file, 0);
+					GTK4.gtk_file_chooser_set_file (handle, file, 0);
 				} else {
-					GTK.gtk_file_chooser_set_current_folder (handle, file, 0);
+					GTK4.gtk_file_chooser_set_current_folder (handle, file, 0);
 				}
 			}
 
 			OS.g_object_unref(file);
 		} else {
 			if (uriMode) {
-				GTK.gtk_file_chooser_set_uri (handle, buffer);
+				GTK3.gtk_file_chooser_set_uri (handle, buffer);
 			} else {
 				/*
 				 * in GTK version 2.10, gtk_file_chooser_set_current_folder requires path
@@ -495,9 +497,9 @@
 				long ptr = OS.realpath (buffer, null);
 				if (ptr != 0) {
 					if (fileName.length() > 0) {
-						GTK.gtk_file_chooser_set_filename (handle, ptr);
+						GTK3.gtk_file_chooser_set_filename (handle, ptr);
 					} else {
-						GTK.gtk_file_chooser_set_current_folder (handle, ptr);
+						GTK3.gtk_file_chooser_set_current_folder (handle, ptr);
 					}
 					OS.g_free (ptr);
 				}
@@ -510,7 +512,7 @@
 		if (GTK.GTK4) {
 			// TODO: GTK4 does not this property for the file chooser, not sure what the default behavior is. Must test before trying an alternative.
 		} else {
-			GTK.gtk_file_chooser_set_do_overwrite_confirmation (handle, overwrite);
+			GTK3.gtk_file_chooser_set_do_overwrite_confirmation (handle, overwrite);
 		}
 	}