Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2013-07-12 11:54:29 -0400
committerAlexander Kurtakov2013-07-12 11:54:29 -0400
commitb23ea2e24f758a54ab6758b6481dfb86a9443288 (patch)
tree8e7f5e690b78aa0ee9f4fb94f7764dfecfa38636
parent7d865938b30c1ae03ba599023ba96f0087c84faf (diff)
downloadeclipse.platform.swt-b23ea2e24f758a54ab6758b6481dfb86a9443288.tar.gz
eclipse.platform.swt-b23ea2e24f758a54ab6758b6481dfb86a9443288.tar.xz
eclipse.platform.swt-b23ea2e24f758a54ab6758b6481dfb86a9443288.zip
Get rid of gtk_object_sink.
It's obsoleted since Gtk 2.10 and g_object_ref_sink can be safely used instead.
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c1
-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.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java8
12 files changed, 10 insertions, 56 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 fd2ace6a78..909b4c4b78 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
@@ -3551,15 +3551,7 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1g_1object_1ref_1sink)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, _1g_1object_1ref_1sink_FUNC);
-/*
- rc = (jintLong)g_object_ref_sink(arg0);
-*/
- {
- OS_LOAD_FUNCTION(fp, g_object_ref_sink)
- if (fp) {
- rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jintLong))fp)(arg0);
- }
- }
+ rc = (jintLong)g_object_ref_sink((GObject *)arg0);
OS_NATIVE_EXIT(env, that, _1g_1object_1ref_1sink_FUNC);
return rc;
}
@@ -12102,24 +12094,6 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1notebook_1set_1tab_1pos)
}
#endif
-#ifndef NO__1gtk_1object_1sink
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1object_1sink)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- OS_NATIVE_ENTER(env, that, _1gtk_1object_1sink_FUNC);
-/*
- gtk_object_sink(arg0);
-*/
- {
- OS_LOAD_FUNCTION(fp, gtk_object_sink)
- if (fp) {
- ((void (CALLING_CONVENTION*)(jintLong))fp)(arg0);
- }
- }
- OS_NATIVE_EXIT(env, that, _1gtk_1object_1sink_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1orientable_1set_1orientation
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1orientable_1set_1orientation)
(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
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 2c429ffe93..369d98af87 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
@@ -389,7 +389,6 @@
#define gdk_colormap_alloc_color_LIB LIB_GDK
#define gdk_colormap_free_colors_LIB LIB_GDK
#define gtk_enumerate_printers_LIB LIB_GTK
-#define gtk_object_sink_LIB LIB_GTK
#define gtk_orientable_set_orientation_LIB LIB_GTK
#define gtk_paint_arrow_LIB LIB_GTK
#define gtk_paint_box_LIB LIB_GTK
@@ -523,7 +522,6 @@
#define g_icon_to_string_LIB LIB_GIO
#define g_icon_new_for_string_LIB LIB_GIO
#define g_file_query_info_LIB LIB_GIO
-#define g_object_ref_sink_LIB LIB_GOBJECT
// GTK3 only
#define gtk_widget_draw_LIB LIB_GTK
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 92680c1b34..fe58a914b3 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
@@ -903,7 +903,6 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1notebook_1set_1scrollable",
"_1gtk_1notebook_1set_1show_1tabs",
"_1gtk_1notebook_1set_1tab_1pos",
- "_1gtk_1object_1sink",
"_1gtk_1orientable_1set_1orientation",
"_1gtk_1page_1setup_1get_1bottom_1margin",
"_1gtk_1page_1setup_1get_1left_1margin",
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 27152acee5..a0b7eef9ab 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
@@ -913,7 +913,6 @@ typedef enum {
_1gtk_1notebook_1set_1scrollable_FUNC,
_1gtk_1notebook_1set_1show_1tabs_FUNC,
_1gtk_1notebook_1set_1tab_1pos_FUNC,
- _1gtk_1object_1sink_FUNC,
_1gtk_1orientable_1set_1orientation_FUNC,
_1gtk_1page_1setup_1get_1bottom_1margin_FUNC,
_1gtk_1page_1setup_1get_1left_1margin_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 3b64195768..3a02e87b4c 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
@@ -8998,17 +8998,9 @@ public static final void gtk_notebook_set_tab_pos(long /*int*/ notebook, int pos
lock.unlock();
}
}
-/** @method flags=dynamic */
-public static final native void _gtk_object_sink(long /*int*/ object);
-public static final void gtk_object_sink(long /*int*/ object) {
- lock.lock();
- try {
- _gtk_object_sink(object);
- } finally {
- lock.unlock();
- }
-}
-/** @method flags=dynamic */
+/**
+ * @param object cast=(GObject *)
+ */
public static final native long /*int*/ _g_object_ref_sink(long /*int*/ object);
public static final long /*int*/ g_object_ref_sink(long /*int*/ object) {
lock.lock();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
index e7aa8a072a..65fe0c4f9b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
@@ -294,7 +294,7 @@ void createHandle (int index) {
groupHandle = OS.gtk_radio_button_new (0);
if (groupHandle == 0) error (SWT.ERROR_NO_HANDLES);
OS.g_object_ref (groupHandle);
- g_object_ref_sink (groupHandle);
+ OS.g_object_ref_sink (groupHandle);
handle = OS.gtk_radio_button_new (OS.gtk_radio_button_get_group (groupHandle));
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
break;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
index 9ea3a294d5..5b118050bf 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
@@ -130,7 +130,7 @@ void createHandle(int index) {
labelHandle = OS.gtk_label_new (null);
if (labelHandle == 0) error (SWT.ERROR_NO_HANDLES);
OS.g_object_ref (labelHandle);
- g_object_ref_sink (labelHandle);
+ OS.g_object_ref_sink (labelHandle);
clientHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (clientHandle == 0) error (SWT.ERROR_NO_HANDLES);
if (OS.GTK3) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
index 4f2a77114e..ae2f94ae98 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
@@ -257,7 +257,7 @@ void createHandle (int index) {
groupHandle = OS.gtk_radio_menu_item_new (0);
if (groupHandle == 0) error (SWT.ERROR_NO_HANDLES);
OS.g_object_ref (groupHandle);
- g_object_ref_sink (groupHandle);
+ OS.g_object_ref_sink (groupHandle);
long /*int*/ group = OS.gtk_radio_menu_item_get_group (groupHandle);
handle = OS.gtk_radio_menu_item_new_with_label (group, buffer);
break;
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 2f00f6fe87..cbccf62181 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
@@ -2579,7 +2579,7 @@ void setToolTipText (long /*int*/ rootWidget, long /*int*/ tipWidget, String str
tooltipsHandle = OS.gtk_tooltips_new ();
if (tooltipsHandle == 0) error (SWT.ERROR_NO_HANDLES);
OS.g_object_ref (tooltipsHandle);
- g_object_ref_sink (tooltipsHandle);
+ OS.g_object_ref_sink (tooltipsHandle);
}
/*
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
index 56a4232c78..8784c9b5f6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
@@ -286,7 +286,7 @@ void createHandle (int index) {
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
OS.gtk_tooltips_force_window (handle);
OS.g_object_ref (handle);
- g_object_ref_sink (handle);
+ OS.g_object_ref_sink (handle);
}
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java
index 45504e5968..ef14ca07a6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java
@@ -596,7 +596,7 @@ public void setToolTipText (String string) {
tooltipsHandle = OS.gtk_tooltips_new ();
if (tooltipsHandle == 0) error (SWT.ERROR_NO_HANDLES);
OS.g_object_ref (tooltipsHandle);
- g_object_ref_sink (tooltipsHandle);
+ OS.g_object_ref_sink (tooltipsHandle);
}
OS.gtk_tooltips_set_tip (tooltipsHandle, handle, buffer, null);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
index 8fa996abaa..f9666a80ba 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
@@ -1829,14 +1829,6 @@ long /*int*/ sizeAllocateProc (long /*int*/ handle, long /*int*/ arg0, long /*in
long /*int*/ sizeRequestProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ user_data) {
return 0;
}
-long /*int*/ g_object_ref_sink (long /*int*/ object) {
- if (OS.GLIB_VERSION >= OS.VERSION (2, 10, 0)) {
- return OS.g_object_ref_sink (object);
- } else {
- OS.gtk_object_sink (object);
- }
- return 0;
-}
boolean gtk_widget_get_sensitive (long /*int*/ widget) {
if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {

Back to the top