aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2011-11-16 14:25:45 (EST)
committerSilenio Quarti2011-11-16 14:25:45 (EST)
commit413c9491a928162b65715cf4be7506ad03721c18 (patch)
tree20592f0c4d5f27207f194df347dabbf745e2cc4b
parent41b69c14dce23c701db1a7f29e7a144c701cde03 (diff)
downloadeclipse.platform.swt-413c9491a928162b65715cf4be7506ad03721c18.zip
eclipse.platform.swt-413c9491a928162b65715cf4be7506ad03721c18.tar.gz
eclipse.platform.swt-413c9491a928162b65715cf4be7506ad03721c18.tar.bz2
Bug 362246 - Platform.launch doesn't work on gio only systems.
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Program/gtk/org/eclipse/swt/program/Program.java2
6 files changed, 40 insertions, 3 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 59dd5c7..d8d3f2e 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
@@ -3059,6 +3059,30 @@ fail:
}
#endif
+#ifndef NO__1g_1file_1new_1for_1commandline_1arg
+JNIEXPORT jintLong JNICALL OS_NATIVE(_1g_1file_1new_1for_1commandline_1arg)
+ (JNIEnv *env, jclass that, jbyteArray arg0)
+{
+ jbyte *lparg0=NULL;
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, _1g_1file_1new_1for_1commandline_1arg_FUNC);
+ if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
+/*
+ rc = (jintLong)g_file_new_for_commandline_arg(lparg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, g_file_new_for_commandline_arg)
+ if (fp) {
+ rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jbyte *))fp)(lparg0);
+ }
+ }
+fail:
+ if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
+ OS_NATIVE_EXIT(env, that, _1g_1file_1new_1for_1commandline_1arg_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO__1g_1file_1new_1for_1path
JNIEXPORT jintLong JNICALL OS_NATIVE(_1g_1file_1new_1for_1path)
(JNIEnv *env, jclass that, jbyteArray arg0)
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 4ceadff..4c7af50 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
@@ -280,6 +280,7 @@
#define g_file_icon_get_file_LIB LIB_GIO
#define g_file_info_get_content_type_LIB LIB_GIO
#define g_file_info_get_modification_time_LIB LIB_GIO
+#define g_file_new_for_commandline_arg_LIB LIB_GIO
#define g_file_new_for_path_LIB LIB_GIO
#define g_file_new_for_uri_LIB LIB_GIO
#define g_file_read_LIB LIB_GIO
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 d2d722c..e3e2493 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 = 1384;
-int OS_nativeFunctionCallCount[1384];
+int OS_nativeFunctionCount = 1385;
+int OS_nativeFunctionCallCount[1385];
char * OS_nativeFunctionNames[] = {
#ifndef JNI64
"Call__IIII",
@@ -250,6 +250,7 @@ char * OS_nativeFunctionNames[] = {
"_1g_1file_1icon_1get_1file",
"_1g_1file_1info_1get_1content_1type",
"_1g_1file_1info_1get_1modification_1time",
+ "_1g_1file_1new_1for_1commandline_1arg",
"_1g_1file_1new_1for_1path",
"_1g_1file_1new_1for_1uri",
"_1g_1file_1query_1info",
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 cc0282c..d11ec7b 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
@@ -258,6 +258,7 @@ typedef enum {
_1g_1file_1icon_1get_1file_FUNC,
_1g_1file_1info_1get_1content_1type_FUNC,
_1g_1file_1info_1get_1modification_1time_FUNC,
+ _1g_1file_1new_1for_1commandline_1arg_FUNC,
_1g_1file_1new_1for_1path_FUNC,
_1g_1file_1new_1for_1uri_FUNC,
_1g_1file_1query_1info_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 b43c8aa..53719f3 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
@@ -2123,6 +2123,16 @@ public static final int /*long*/ g_file_new_for_path(byte[] fileName) {
}
}
/** @method flags=dynamic */
+public static final native int /*long*/ _g_file_new_for_commandline_arg(byte[] fileName);
+public static final int /*long*/ g_file_new_for_commandline_arg(byte[] fileName) {
+ lock.lock();
+ try {
+ return _g_file_new_for_commandline_arg(fileName);
+ } finally {
+ lock.unlock();
+ }
+}
+/** @method flags=dynamic */
public static final native int /*long*/ _g_file_new_for_uri(byte[] fileName);
public static final int /*long*/ g_file_new_for_uri(byte[] fileName) {
lock.lock();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/gtk/org/eclipse/swt/program/Program.java b/bundles/org.eclipse.swt/Eclipse SWT Program/gtk/org/eclipse/swt/program/Program.java
index 80efc65..1c67940 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Program/gtk/org/eclipse/swt/program/Program.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Program/gtk/org/eclipse/swt/program/Program.java
@@ -954,7 +954,7 @@ static boolean gio_isExecutable(String fileName) {
static boolean gio_launch(String fileName) {
boolean result = false;
byte[] fileNameBuffer = Converter.wcsToMbcs (null, fileName, true);
- int /*long*/ file = OS.g_file_new_for_path (fileNameBuffer);
+ int /*long*/ file = OS.g_file_new_for_commandline_arg (fileNameBuffer);
if (file != 0) {
int /*long*/ uri = OS.g_file_get_uri (file);
if (uri != 0) {