diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT')
7 files changed, 14 insertions, 6 deletions
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 2e1a82bf05..00a8b635b9 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); - OS.gtk_object_sink (groupHandle); + 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 3da092920c..64968d6e78 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 @@ -128,7 +128,7 @@ void createHandle(int index) { labelHandle = OS.gtk_label_new (null); if (labelHandle == 0) error (SWT.ERROR_NO_HANDLES); OS.g_object_ref (labelHandle); - OS.gtk_object_sink (labelHandle); + g_object_ref_sink (labelHandle); clientHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0); if (clientHandle == 0) error (SWT.ERROR_NO_HANDLES); OS.gtk_container_add (fixedHandle, handle); 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 59526c575b..dfca6d22da 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); - OS.gtk_object_sink (groupHandle); + g_object_ref_sink (groupHandle); int /*long*/ 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 2a62e480cc..001b4cb64a 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 @@ -2461,7 +2461,7 @@ void setToolTipText (int /*long*/ rootWidget, int /*long*/ tipWidget, String str tooltipsHandle = OS.gtk_tooltips_new (); if (tooltipsHandle == 0) error (SWT.ERROR_NO_HANDLES); OS.g_object_ref (tooltipsHandle); - OS.gtk_object_sink (tooltipsHandle); + 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 c7da6c4393..a205e6ef96 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 @@ -278,7 +278,7 @@ void createHandle (int index) { OS.gtk_tooltips_force_window (handle); } OS.g_object_ref (handle); - OS.gtk_object_sink (handle); + 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 2a82fb8e45..95dad533dc 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 @@ -591,7 +591,7 @@ public void setToolTipText (String string) { tooltipsHandle = OS.gtk_tooltips_new (); if (tooltipsHandle == 0) error (SWT.ERROR_NO_HANDLES); OS.g_object_ref (tooltipsHandle); - OS.gtk_object_sink (tooltipsHandle); + g_object_ref_sink (tooltipsHandle); } if (OS.GTK_VERSION >= OS.VERSION (2, 10, 0)) { OS.gtk_status_icon_set_tooltip (handle, buffer); 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 6aa4be97f3..389c5fce7b 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 @@ -1681,6 +1681,14 @@ int /*long*/ sizeAllocateProc (int /*long*/ handle, int /*long*/ arg0, int /*lon int /*long*/ sizeRequestProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) { return 0; } +int /*long*/ g_object_ref_sink (int /*long*/ 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 (int /*long*/ widget) { if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { |