diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-09-24 15:04:25 -0400 |
---|---|---|
committer | Anatoly Spektor <aspektor@redhat.com> | 2012-09-24 15:04:25 -0400 |
commit | 7c969e813af15a52716739e5489177e1a0db5e3d (patch) | |
tree | 504248c239fa00c646f6c972f5c6ff9a80661b20 | |
parent | a754695634bbf4177c903eb76191590677bc9067 (diff) | |
download | eclipse.platform.swt-gdk_cursor_unref.tar.gz eclipse.platform.swt-gdk_cursor_unref.tar.xz eclipse.platform.swt-gdk_cursor_unref.zip |
Replace gdk_cursor_unref with g_object_unref and remove gdk_cursor_unrefgdk_cursor_unref
9 files changed, 7 insertions, 30 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 4e3b0f2d57..845e17d5c6 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 @@ -4866,16 +4866,6 @@ fail: } #endif -#ifndef NO__1gdk_1cursor_1unref -JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1cursor_1unref) - (JNIEnv *env, jclass that, jintLong arg0) -{ - OS_NATIVE_ENTER(env, that, _1gdk_1cursor_1unref_FUNC); - gdk_cursor_unref((GdkCursor *)arg0); - OS_NATIVE_EXIT(env, that, _1gdk_1cursor_1unref_FUNC); -} -#endif - #ifndef NO__1gdk_1device_1grab JNIEXPORT jint JNICALL OS_NATIVE(_1gdk_1device_1grab) (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jboolean arg3, jint arg4, jintLong arg5, jint arg6) 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 3a8fbd3211..be48f87b24 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,6 +18,8 @@ #ifdef NATIVE_STATS +int OS_nativeFunctionCount = 1344; +int OS_nativeFunctionCallCount[1344]; char * OS_nativeFunctionNames[] = { #ifndef JNI64 "Call__IIII", @@ -418,7 +420,6 @@ char * OS_nativeFunctionNames[] = { "_1gdk_1cursor_1new", "_1gdk_1cursor_1new_1from_1pixbuf", "_1gdk_1cursor_1new_1from_1pixmap", - "_1gdk_1cursor_1unref", "_1gdk_1device_1grab", "_1gdk_1device_1manager_1get_1client_1pointer", "_1gdk_1display_1get_1default", @@ -1725,9 +1726,6 @@ char * OS_nativeFunctionNames[] = { "realpath", "strcmp", }; -#define NATIVE_FUNCTION_COUNT sizeof(OS_nativeFunctionNames) / sizeof(char*) -int OS_nativeFunctionCount = NATIVE_FUNCTION_COUNT; -int OS_nativeFunctionCallCount[NATIVE_FUNCTION_COUNT]; #define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func 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 607863df6f..9384c2ceb9 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 @@ -428,7 +428,6 @@ typedef enum { _1gdk_1cursor_1new_FUNC, _1gdk_1cursor_1new_1from_1pixbuf_FUNC, _1gdk_1cursor_1new_1from_1pixmap_FUNC, - _1gdk_1cursor_1unref_FUNC, _1gdk_1device_1grab_FUNC, _1gdk_1device_1manager_1get_1client_1pointer_FUNC, _1gdk_1display_1get_1default_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 421703038c..a69756e173 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 @@ -3612,16 +3612,6 @@ public static final int /*long*/ gdk_colormap_get_system() { lock.unlock(); } } -/** @param cursor cast=(GdkCursor *) */ -public static final native void _gdk_cursor_unref(int /*long*/ cursor); -public static final void gdk_cursor_unref(int /*long*/ cursor) { - lock.lock(); - try { - _gdk_cursor_unref(cursor); - } finally { - lock.unlock(); - } -} /** @param cursor_type cast=(GdkCursorType) */ public static final native int /*long*/ _gdk_cursor_new(int /*long*/ cursor_type); public static final int /*long*/ gdk_cursor_new(int /*long*/ cursor_type) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java index f66a8de530..c08cae803e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java @@ -449,7 +449,7 @@ int /*long*/ createCursor(byte[] sourceData, byte[] maskData, int width, int hei } void destroy() { - OS.gdk_cursor_unref(handle); + OS.g_object_unref (handle); handle = 0; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java index dbc04e8c55..aaa8974fc9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java @@ -412,7 +412,7 @@ void hookEvents () { void releaseWidget () { super.releaseWidget (); - if (defaultCursor != 0) OS.gdk_cursor_unref (defaultCursor); + if (defaultCursor != 0) OS.g_object_unref (defaultCursor); defaultCursor = 0; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java index 5f1a5416bc..f2e1693a73 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java @@ -1346,7 +1346,7 @@ int /*long*/ gtk_motion_notify_event (int /*long*/ widget, int /*long*/ event) { int /*long*/ window = gtk_widget_get_window (shellHandle); int /*long*/ cursor = OS.gdk_cursor_new (mode); OS.gdk_window_set_cursor (window, cursor); - OS.gdk_cursor_unref (cursor); + OS.g_object_unref (cursor); display.resizeMode = mode; } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java index fbb57ce8d4..f93504edcf 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java @@ -880,7 +880,7 @@ void setCursor (int /*long*/ cursor) { int /*long*/ defaultCursor = 0; if (cursor == 0) defaultCursor = OS.gdk_cursor_new (OS.GDK_XTERM); super.setCursor (cursor != 0 ? cursor : defaultCursor); - if (cursor == 0) OS.gdk_cursor_unref (defaultCursor); + if (cursor == 0) OS.g_object_unref (defaultCursor); } void setFontDescription (int /*long*/ font) { 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 fdcb01cd48..38ab478dee 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 @@ -2050,7 +2050,7 @@ void setCursor (int /*long*/ cursor) { int /*long*/ defaultCursor = 0; if (cursor == 0) defaultCursor = OS.gdk_cursor_new (OS.GDK_XTERM); super.setCursor (cursor != 0 ? cursor : defaultCursor); - if (cursor == 0) OS.gdk_cursor_unref (defaultCursor); + if (cursor == 0) OS.g_object_unref (defaultCursor); } /** |