diff options
author | Alexander Kurtakov <akurtako@redhat.com> | 2012-04-11 12:06:32 +0300 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-06-26 15:24:44 -0400 |
commit | 1e94525534695ca6bcba1ad1e902d7cb7ec23a38 (patch) | |
tree | 6d79497a56b8fbbc6b4dbd9a263f6498f980d4d1 | |
parent | cbf5be467f3ace014430967dd9e7e0732d5ae7d1 (diff) | |
download | eclipse.platform.swt-1e94525534695ca6bcba1ad1e902d7cb7ec23a38.tar.gz eclipse.platform.swt-1e94525534695ca6bcba1ad1e902d7cb7ec23a38.tar.xz eclipse.platform.swt-1e94525534695ca6bcba1ad1e902d7cb7ec23a38.zip |
Remove glib function bindings from gnome.
For some reason glib functions bindings were available via both GNOME
and OS. This patch fixes them to be available only via OS and fixes all
references to them.
5 files changed, 14 insertions, 132 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/library/gnome.c b/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/library/gnome.c index be0abfc537..03c2742820 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/library/gnome.c +++ b/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/library/gnome.c @@ -17,9 +17,7 @@ #include "gnome_structs.h" #include "gnome_stats.h" -#ifndef GNOME_NATIVE #define GNOME_NATIVE(func) Java_org_eclipse_swt_internal_gnome_GNOME_##func -#endif #ifndef NO_GnomeVFSMimeApplication_1sizeof JNIEXPORT jint JNICALL GNOME_NATIVE(GnomeVFSMimeApplication_1sizeof) @@ -33,60 +31,6 @@ JNIEXPORT jint JNICALL GNOME_NATIVE(GnomeVFSMimeApplication_1sizeof) } #endif -#ifndef NO__1g_1free -JNIEXPORT void JNICALL GNOME_NATIVE(_1g_1free) - (JNIEnv *env, jclass that, jintLong arg0) -{ - GNOME_NATIVE_ENTER(env, that, _1g_1free_FUNC); - g_free((gpointer)arg0); - GNOME_NATIVE_EXIT(env, that, _1g_1free_FUNC); -} -#endif - -#ifndef NO__1g_1list_1append -JNIEXPORT jintLong JNICALL GNOME_NATIVE(_1g_1list_1append) - (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) -{ - jintLong rc = 0; - GNOME_NATIVE_ENTER(env, that, _1g_1list_1append_FUNC); - rc = (jintLong)g_list_append((GList *)arg0, (gpointer)arg1); - GNOME_NATIVE_EXIT(env, that, _1g_1list_1append_FUNC); - return rc; -} -#endif - -#ifndef NO__1g_1list_1free -JNIEXPORT void JNICALL GNOME_NATIVE(_1g_1list_1free) - (JNIEnv *env, jclass that, jintLong arg0) -{ - GNOME_NATIVE_ENTER(env, that, _1g_1list_1free_FUNC); - g_list_free((GList *)arg0); - GNOME_NATIVE_EXIT(env, that, _1g_1list_1free_FUNC); -} -#endif - -#ifndef NO__1g_1list_1next -JNIEXPORT jintLong JNICALL GNOME_NATIVE(_1g_1list_1next) - (JNIEnv *env, jclass that, jintLong arg0) -{ - jintLong rc = 0; - GNOME_NATIVE_ENTER(env, that, _1g_1list_1next_FUNC); - rc = (jintLong)g_list_next(arg0); - GNOME_NATIVE_EXIT(env, that, _1g_1list_1next_FUNC); - return rc; -} -#endif - -#ifndef NO__1g_1object_1unref -JNIEXPORT void JNICALL GNOME_NATIVE(_1g_1object_1unref) - (JNIEnv *env, jclass that, jintLong arg0) -{ - GNOME_NATIVE_ENTER(env, that, _1g_1object_1unref_FUNC); - g_object_unref((gpointer)arg0); - GNOME_NATIVE_EXIT(env, that, _1g_1object_1unref_FUNC); -} -#endif - #ifndef NO__1gnome_1icon_1lookup JNIEXPORT jintLong JNICALL GNOME_NATIVE(_1gnome_1icon_1lookup) (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jbyteArray arg2, jbyteArray arg3, jintLong arg4, jbyteArray arg5, jint arg6, jintArray arg7) diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/library/gnome_stats.c b/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/library/gnome_stats.c index 27d6a54825..ca36b97f22 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/library/gnome_stats.c +++ b/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/library/gnome_stats.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. All rights reserved. + * Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved. * The contents of this file are made available under the terms * of the GNU Lesser General Public License (LGPL) Version 2.1 that * accompanies this distribution (lgpl-v21.txt). The LGPL is also @@ -18,15 +18,10 @@ #ifdef NATIVE_STATS -int GNOME_nativeFunctionCount = 25; -int GNOME_nativeFunctionCallCount[25]; +int GNOME_nativeFunctionCount = 20; +int GNOME_nativeFunctionCallCount[20]; char * GNOME_nativeFunctionNames[] = { "GnomeVFSMimeApplication_1sizeof", - "_1g_1free", - "_1g_1list_1append", - "_1g_1list_1free", - "_1g_1list_1next", - "_1g_1object_1unref", "_1gnome_1icon_1lookup", "_1gnome_1icon_1theme_1lookup_1icon", "_1gnome_1icon_1theme_1new", diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/library/gnome_stats.h b/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/library/gnome_stats.h index eea5ffee19..9de0b5bfb4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/library/gnome_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/library/gnome_stats.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. All rights reserved. + * Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved. * The contents of this file are made available under the terms * of the GNU Lesser General Public License (LGPL) Version 2.1 that * accompanies this distribution (lgpl-v21.txt). The LGPL is also @@ -30,11 +30,6 @@ extern char* GNOME_nativeFunctionNames[]; typedef enum { GnomeVFSMimeApplication_1sizeof_FUNC, - _1g_1free_FUNC, - _1g_1list_1append_FUNC, - _1g_1list_1free_FUNC, - _1g_1list_1next_FUNC, - _1g_1object_1unref_FUNC, _1gnome_1icon_1lookup_FUNC, _1gnome_1icon_1theme_1lookup_1icon_FUNC, _1gnome_1icon_1theme_1new_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/org/eclipse/swt/internal/gnome/GNOME.java b/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/org/eclipse/swt/internal/gnome/GNOME.java index 30f539d136..80e5449919 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/org/eclipse/swt/internal/gnome/GNOME.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Program/gnome/org/eclipse/swt/internal/gnome/GNOME.java @@ -38,58 +38,6 @@ public static final native int GnomeVFSMimeApplication_sizeof(); /** Natives */ -/** @param mem cast=(gpointer) */ -public static final native void _g_free(int /*long*/ mem); -public static final void g_free(int /*long*/ mem) { - lock.lock(); - try { - _g_free(mem); - } finally { - lock.unlock(); - } -} -/** - * @param list cast=(GList *) - * @param data cast=(gpointer) - */ -public static final native int /*long*/ _g_list_append(int /*long*/ list, int /*long*/ data); -public static final int /*long*/ g_list_append(int /*long*/ list, int /*long*/ data) { - lock.lock(); - try { - return _g_list_append(list, data); - } finally { - lock.unlock(); - } -} -/** @param list cast=(GList *) */ -public static final native void _g_list_free(int /*long*/ list); -public static final void g_list_free(int /*long*/ list) { - lock.lock(); - try { - _g_list_free(list); - } finally { - lock.unlock(); - } -} -public static final native int /*long*/ _g_list_next(int /*long*/ list); -public static final int /*long*/ g_list_next(int /*long*/ list) { - lock.lock(); - try { - return _g_list_next(list); - } finally { - lock.unlock(); - } -} -/** @param object cast=(gpointer) */ -public static final native void _g_object_unref(int /*long*/ object); -public static final void g_object_unref(int /*long*/ object) { - lock.lock(); - try { - _g_object_unref(object); - } finally { - lock.unlock(); - } -} /** * @param icon_theme cast=(GnomeIconTheme *) * @param thumbnail_factory cast=(GnomeThumbnailFactory *) 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 82f46fdddd..1381d1bcaa 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 @@ -381,11 +381,11 @@ boolean gnome_24_execute(String fileName) { int /*long*/ ptr = GNOME.gnome_vfs_mime_get_default_application(mimeTypeBuffer); byte[] fileNameBuffer = Converter.wcsToMbcs(null, fileName, true); int /*long*/ uri = GNOME.gnome_vfs_make_uri_from_input_with_dirs(fileNameBuffer, GNOME.GNOME_VFS_MAKE_URI_DIR_CURRENT); - int /*long*/ list = GNOME.g_list_append(0, uri); + int /*long*/ list = OS.g_list_append(0, uri); int result = GNOME.gnome_vfs_mime_application_launch(ptr, list); GNOME.gnome_vfs_mime_application_free(ptr); - GNOME.g_free(uri); - GNOME.g_list_free(list); + OS.g_free(uri); + OS.g_list_free(list); return result == GNOME.GNOME_VFS_OK; } @@ -396,7 +396,7 @@ static boolean gnome_24_launch(String fileName) { byte[] fileNameBuffer = Converter.wcsToMbcs(null, fileName, true); int /*long*/ uri = GNOME.gnome_vfs_make_uri_from_input_with_dirs(fileNameBuffer, GNOME.GNOME_VFS_MAKE_URI_DIR_CURRENT); int result = GNOME.gnome_vfs_url_show(uri); - GNOME.g_free(uri); + OS.g_free(uri); return (result == GNOME.GNOME_VFS_OK); } @@ -415,7 +415,7 @@ boolean gnome_execute(String fileName) { OS.memmove(buffer, uri, length); fileName = new String(Converter.mbcsToWcs(null, buffer)); } - GNOME.g_free(uri); + OS.g_free(uri); } } @@ -495,12 +495,12 @@ static Hashtable gnome_getMimeInfo() { String extension = new String(Converter.mbcsToWcs(null, extensionBuffer)); extension = '.' + extension; extensions.addElement(extension); - extensionElement = GNOME.g_list_next(extensionElement); + extensionElement = OS.g_list_next(extensionElement); } GNOME.gnome_vfs_mime_extensions_list_free(extensionList); if (extensions.size() > 0) mimeInfo.put(mimeType, extensions); } - mimeElement = GNOME.g_list_next(mimeElement); + mimeElement = OS.g_list_next(mimeElement); } if (mimeList != 0) GNOME.gnome_vfs_mime_registered_mime_type_list_free(mimeList); return mimeInfo; @@ -553,9 +553,9 @@ static Program gnome_getProgram(Display display, String mimeType) { OS.memmove(buffer, path, length); program.iconPath = new String(Converter.mbcsToWcs(null, buffer)); } - GNOME.g_free(path); + OS.g_free(path); } - if (icon_name != 0) GNOME.g_free(icon_name); + if (icon_name != 0) OS.g_free(icon_name); GNOME.gnome_vfs_mime_application_free(ptr); } return program; @@ -577,7 +577,7 @@ static boolean gnome_isExecutable(String fileName) { /* check if the mime type is executable */ int /*long*/ uri = GNOME.gnome_vfs_make_uri_from_input(fileNameBuffer); int /*long*/ mimeType = GNOME.gnome_vfs_get_mime_type(uri); - GNOME.g_free(uri); + OS.g_free(uri); byte[] exeType = Converter.wcsToMbcs (null, "application/x-executable", true); //$NON-NLS-1$ boolean result = GNOME.gnome_vfs_mime_type_get_equivalence(mimeType, exeType) != GNOME.GNOME_VFS_MIME_UNRELATED; |