summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT PI
diff options
context:
space:
mode:
authorCarolyn MacLeod <carolyn>2008-01-05 22:58:49 +0000
committerCarolyn MacLeod <carolyn>2008-01-05 22:58:49 +0000
commit1c367491fe3c07b43ec99c54628c7b133b5c058f (patch)
tree7c94884ccc82cf25bc2fc2e16ae24147f9ac3a5e /bundles/org.eclipse.swt/Eclipse SWT PI
parent5f7fc100f82598ce1ed575675abf56bc3c557d75 (diff)
downloadeclipse.platform.swt-1c367491fe3c07b43ec99c54628c7b133b5c058f.tar.gz
eclipse.platform.swt-1c367491fe3c07b43ec99c54628c7b133b5c058f.tar.xz
eclipse.platform.swt-1c367491fe3c07b43ec99c54628c7b133b5c058f.zip
172784 - FileDialog should provide access to selected filter after closing
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c84
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java27
5 files changed, 122 insertions, 2 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 3db93f3f86..0de09e62a3 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
@@ -7921,6 +7921,35 @@ JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1file_1chooser_1get_1filenames)
}
#endif
+#ifndef NO__1gtk_1file_1chooser_1get_1filter
+JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1file_1chooser_1get_1filter)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, _1gtk_1file_1chooser_1get_1filter_FUNC);
+/*
+ rc = (jint)gtk_file_chooser_get_filter(arg0);
+*/
+ {
+ static int initialized = 0;
+ static void *handle = NULL;
+ typedef jint (*FPTR)(jint);
+ static FPTR fptr;
+ rc = 0;
+ if (!initialized) {
+ if (!handle) handle = dlopen(gtk_file_chooser_get_filter_LIB, RTLD_LAZY);
+ if (handle) fptr = (FPTR)dlsym(handle, "gtk_file_chooser_get_filter");
+ initialized = 1;
+ }
+ if (fptr) {
+ rc = (jint)(*fptr)(arg0);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1file_1chooser_1get_1filter_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO__1gtk_1file_1chooser_1set_1current_1folder
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1file_1chooser_1set_1current_1folder)
(JNIEnv *env, jclass that, jint arg0, jint arg1)
@@ -8029,6 +8058,32 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1file_1chooser_1set_1filename)
}
#endif
+#ifndef NO__1gtk_1file_1chooser_1set_1filter
+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1file_1chooser_1set_1filter)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ OS_NATIVE_ENTER(env, that, _1gtk_1file_1chooser_1set_1filter_FUNC);
+/*
+ gtk_file_chooser_set_filter(arg0, arg1);
+*/
+ {
+ static int initialized = 0;
+ static void *handle = NULL;
+ typedef void (*FPTR)(jint, jint);
+ static FPTR fptr;
+ if (!initialized) {
+ if (!handle) handle = dlopen(gtk_file_chooser_set_filter_LIB, RTLD_LAZY);
+ if (handle) fptr = (FPTR)dlsym(handle, "gtk_file_chooser_set_filter");
+ initialized = 1;
+ }
+ if (fptr) {
+ (*fptr)(arg0, arg1);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1file_1chooser_1set_1filter_FUNC);
+}
+#endif
+
#ifndef NO__1gtk_1file_1chooser_1set_1select_1multiple
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1file_1chooser_1set_1select_1multiple)
(JNIEnv *env, jclass that, jint arg0, jboolean arg1)
@@ -8085,6 +8140,35 @@ fail:
}
#endif
+#ifndef NO__1gtk_1file_1filter_1get_1name
+JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1file_1filter_1get_1name)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, _1gtk_1file_1filter_1get_1name_FUNC);
+/*
+ rc = (jint)gtk_file_filter_get_name(arg0);
+*/
+ {
+ static int initialized = 0;
+ static void *handle = NULL;
+ typedef jint (*FPTR)(jint);
+ static FPTR fptr;
+ rc = 0;
+ if (!initialized) {
+ if (!handle) handle = dlopen(gtk_file_filter_get_name_LIB, RTLD_LAZY);
+ if (handle) fptr = (FPTR)dlsym(handle, "gtk_file_filter_get_name");
+ initialized = 1;
+ }
+ if (fptr) {
+ rc = (jint)(*fptr)(arg0);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1file_1filter_1get_1name_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO__1gtk_1file_1filter_1new
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1file_1filter_1new)
(JNIEnv *env, jclass that)
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 1830b79985..d032c736c7 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
@@ -60,13 +60,16 @@
#define gtk_file_chooser_get_current_folder_LIB "libgtk-x11-2.0.so.0"
#define gtk_file_chooser_get_filename_LIB "libgtk-x11-2.0.so.0"
#define gtk_file_chooser_get_filenames_LIB "libgtk-x11-2.0.so.0"
+#define gtk_file_chooser_get_filter_LIB "libgtk-x11-2.0.so.0"
#define gtk_file_chooser_set_current_folder_LIB "libgtk-x11-2.0.so.0"
#define gtk_file_chooser_set_current_name_LIB "libgtk-x11-2.0.so.0"
#define gtk_file_chooser_set_extra_widget_LIB "libgtk-x11-2.0.so.0"
#define gtk_file_chooser_set_filename_LIB "libgtk-x11-2.0.so.0"
+#define gtk_file_chooser_set_filter_LIB "libgtk-x11-2.0.so.0"
#define gtk_file_chooser_set_select_multiple_LIB "libgtk-x11-2.0.so.0"
#define gtk_file_filter_add_pattern_LIB "libgtk-x11-2.0.so.0"
#define gtk_file_filter_new_LIB "libgtk-x11-2.0.so.0"
+#define gtk_file_filter_get_name_LIB "libgtk-x11-2.0.so.0"
#define gtk_file_filter_set_name_LIB "libgtk-x11-2.0.so.0"
#define gtk_expander_get_expanded_LIB "libgtk-x11-2.0.so.0"
#define gtk_expander_get_label_widget_LIB "libgtk-x11-2.0.so.0"
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 88b6789d88..d8d13d7310 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
@@ -18,8 +18,8 @@
#ifdef NATIVE_STATS
-int OS_nativeFunctionCount = 1243;
-int OS_nativeFunctionCallCount[1243];
+int OS_nativeFunctionCount = 1246;
+int OS_nativeFunctionCallCount[1246];
char * OS_nativeFunctionNames[] = {
"Call",
"GDK_1EVENT_1TYPE",
@@ -573,12 +573,15 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1file_1chooser_1get_1current_1folder",
"_1gtk_1file_1chooser_1get_1filename",
"_1gtk_1file_1chooser_1get_1filenames",
+ "_1gtk_1file_1chooser_1get_1filter",
"_1gtk_1file_1chooser_1set_1current_1folder",
"_1gtk_1file_1chooser_1set_1current_1name",
"_1gtk_1file_1chooser_1set_1extra_1widget",
"_1gtk_1file_1chooser_1set_1filename",
+ "_1gtk_1file_1chooser_1set_1filter",
"_1gtk_1file_1chooser_1set_1select_1multiple",
"_1gtk_1file_1filter_1add_1pattern",
+ "_1gtk_1file_1filter_1get_1name",
"_1gtk_1file_1filter_1new",
"_1gtk_1file_1filter_1set_1name",
"_1gtk_1file_1selection_1get_1filename",
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 9d53dc94ee..c3ab05c610 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
@@ -581,12 +581,15 @@ typedef enum {
_1gtk_1file_1chooser_1get_1current_1folder_FUNC,
_1gtk_1file_1chooser_1get_1filename_FUNC,
_1gtk_1file_1chooser_1get_1filenames_FUNC,
+ _1gtk_1file_1chooser_1get_1filter_FUNC,
_1gtk_1file_1chooser_1set_1current_1folder_FUNC,
_1gtk_1file_1chooser_1set_1current_1name_FUNC,
_1gtk_1file_1chooser_1set_1extra_1widget_FUNC,
_1gtk_1file_1chooser_1set_1filename_FUNC,
+ _1gtk_1file_1chooser_1set_1filter_FUNC,
_1gtk_1file_1chooser_1set_1select_1multiple_FUNC,
_1gtk_1file_1filter_1add_1pattern_FUNC,
+ _1gtk_1file_1filter_1get_1name_FUNC,
_1gtk_1file_1filter_1new_FUNC,
_1gtk_1file_1filter_1set_1name_FUNC,
_1gtk_1file_1selection_1get_1filename_FUNC,
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 199b07b88d..25a5e7adf0 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
@@ -4828,6 +4828,15 @@ public static final int /*long*/ gtk_file_chooser_get_filenames(int /*long*/ cho
lock.unlock();
}
}
+public static final native int /*long*/ _gtk_file_chooser_get_filter(int /*long*/ chooser);
+public static final int /*long*/ gtk_file_chooser_get_filter(int /*long*/ chooser) {
+ lock.lock();
+ try {
+ return _gtk_file_chooser_get_filter(chooser);
+ } finally {
+ lock.unlock();
+ }
+}
public static final native void _gtk_file_chooser_set_current_folder(int /*long*/ chooser, int /*long*/ filename);
public static final void gtk_file_chooser_set_current_folder(int /*long*/ chooser, int /*long*/ filename) {
lock.lock();
@@ -4864,6 +4873,15 @@ public static final void gtk_file_chooser_set_filename(int /*long*/ chooser, int
lock.unlock();
}
}
+public static final native void _gtk_file_chooser_set_filter(int /*long*/ chooser, int /*long*/ filter);
+public static final void gtk_file_chooser_set_filter(int /*long*/ chooser, int /*long*/ filter) {
+ lock.lock();
+ try {
+ _gtk_file_chooser_set_filter(chooser, filter);
+ } finally {
+ lock.unlock();
+ }
+}
public static final native void _gtk_file_chooser_set_select_multiple(int /*long*/ chooser, boolean select_multiple);
public static final void gtk_file_chooser_set_select_multiple(int /*long*/ chooser, boolean select_multiple) {
lock.lock();
@@ -4891,6 +4909,15 @@ public static final int /*long*/ gtk_file_filter_new() {
lock.unlock();
}
}
+public static final native int _gtk_file_filter_get_name(int /*long*/ filter);
+public static final int gtk_file_filter_get_name(int /*long*/ filter) {
+ lock.lock();
+ try {
+ return _gtk_file_filter_get_name(filter);
+ } finally {
+ lock.unlock();
+ }
+}
public static final native void _gtk_file_filter_set_name(int /*long*/ filter, byte[] name);
public static final void gtk_file_filter_set_name(int /*long*/ filter, byte[] name) {
lock.lock();