Commit fbb2e3f4 authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

deprecated floating/sink API and implemented it in terms of the GObject

Wed Nov 23 18:55:47 2005  Tim Janik  <timj@imendio.com>

        * gtk/gtkobject.[hc]: deprecated floating/sink API and implemented it
        in terms of the GObject floating/sink API.

        * gtk/gtkaboutdialog.c:
        * gtk/gtkaction.c:
        * gtk/gtkcellview.c:
        * gtk/gtkclist.c:
        * gtk/gtkcolorsel.c:
        * gtk/gtkcombobox.c:
        * gtk/gtkfilechooserdefault.c:
        * gtk/gtkiconview.c:
        * gtk/gtkinvisible.c:
        * gtk/gtkitemfactory.c:
        * gtk/gtklayout.c:
        * gtk/gtkmenu.c:
        * gtk/gtkmenutoolbutton.c:
        * gtk/gtknotebook.c:
        * gtk/gtkprogress.c:
        * gtk/gtkrange.c:
        * gtk/gtkspinbutton.c:
        * gtk/gtkstatusicon.c:
        * gtk/gtktext.c:
        * gtk/gtktextview.c:
        * gtk/gtktoolbar.c:
        * gtk/gtktoolbutton.c:
        * gtk/gtktoolitem.c:
        * gtk/gtktreeitem.c:
        * gtk/gtktreeview.c:
        * gtk/gtktreeviewcolumn.c:
        * gtk/gtkuimanager.c:
        * gtk/gtkviewport.c:
        * gtk/gtkwidget.c:
        * gtk/gtkwindow.c:
        ported to use GObject's g_object_ref_sink().

        * gtk/gtkcolorsel.c:
        * gtk/gtkfilechooserdefault.c:
        * gtk/gtkaboutdialog.c:
        fixed compiler warnings.
parent 9856c1b2
Wed Nov 23 18:55:47 2005 Tim Janik <timj@imendio.com>
* gtk/gtkobject.[hc]: deprecated floating/sink API and implemented it
in terms of the GObject floating/sink API.
* gtk/gtkaboutdialog.c:
* gtk/gtkaction.c:
* gtk/gtkcellview.c:
* gtk/gtkclist.c:
* gtk/gtkcolorsel.c:
* gtk/gtkcombobox.c:
* gtk/gtkfilechooserdefault.c:
* gtk/gtkiconview.c:
* gtk/gtkinvisible.c:
* gtk/gtkitemfactory.c:
* gtk/gtklayout.c:
* gtk/gtkmenu.c:
* gtk/gtkmenutoolbutton.c:
* gtk/gtknotebook.c:
* gtk/gtkprogress.c:
* gtk/gtkrange.c:
* gtk/gtkspinbutton.c:
* gtk/gtkstatusicon.c:
* gtk/gtktext.c:
* gtk/gtktextview.c:
* gtk/gtktoolbar.c:
* gtk/gtktoolbutton.c:
* gtk/gtktoolitem.c:
* gtk/gtktreeitem.c:
* gtk/gtktreeview.c:
* gtk/gtktreeviewcolumn.c:
* gtk/gtkuimanager.c:
* gtk/gtkviewport.c:
* gtk/gtkwidget.c:
* gtk/gtkwindow.c:
ported to use GObject's g_object_ref_sink().
* gtk/gtkcolorsel.c:
* gtk/gtkfilechooserdefault.c:
* gtk/gtkaboutdialog.c:
fixed compiler warnings.
2005-11-23 Matthias Clasen <mclasen@redhat.com>
* gtk/gtksettings.c (gtk_settings_class_init): Add some docs
......
Wed Nov 23 18:55:47 2005 Tim Janik <timj@imendio.com>
* gtk/gtkobject.[hc]: deprecated floating/sink API and implemented it
in terms of the GObject floating/sink API.
* gtk/gtkaboutdialog.c:
* gtk/gtkaction.c:
* gtk/gtkcellview.c:
* gtk/gtkclist.c:
* gtk/gtkcolorsel.c:
* gtk/gtkcombobox.c:
* gtk/gtkfilechooserdefault.c:
* gtk/gtkiconview.c:
* gtk/gtkinvisible.c:
* gtk/gtkitemfactory.c:
* gtk/gtklayout.c:
* gtk/gtkmenu.c:
* gtk/gtkmenutoolbutton.c:
* gtk/gtknotebook.c:
* gtk/gtkprogress.c:
* gtk/gtkrange.c:
* gtk/gtkspinbutton.c:
* gtk/gtkstatusicon.c:
* gtk/gtktext.c:
* gtk/gtktextview.c:
* gtk/gtktoolbar.c:
* gtk/gtktoolbutton.c:
* gtk/gtktoolitem.c:
* gtk/gtktreeitem.c:
* gtk/gtktreeview.c:
* gtk/gtktreeviewcolumn.c:
* gtk/gtkuimanager.c:
* gtk/gtkviewport.c:
* gtk/gtkwidget.c:
* gtk/gtkwindow.c:
ported to use GObject's g_object_ref_sink().
* gtk/gtkcolorsel.c:
* gtk/gtkfilechooserdefault.c:
* gtk/gtkaboutdialog.c:
fixed compiler warnings.
2005-11-23 Matthias Clasen <mclasen@redhat.com>
* gtk/gtksettings.c (gtk_settings_class_init): Add some docs
......
......@@ -2306,10 +2306,10 @@ gtk_object_set_data_by_id
gtk_object_set_data_by_id_full
gtk_object_set_data_full
gtk_object_set_user_data
gtk_object_sink
#endif
gtk_object_destroy
gtk_object_get_type G_GNUC_CONST
gtk_object_sink
#endif
#endif
......
......@@ -1979,7 +1979,7 @@ add_credits_page (GtkAboutDialog *about,
{
GtkTextIter end;
gchar *link;
gchar *link_type;
const gchar *link_type;
GtkTextTag *tag;
gtk_text_buffer_insert_at_cursor (buffer, q0, q1 - q0);
......@@ -2283,8 +2283,7 @@ gtk_show_about_dialog (GtkWindow *parent,
{
dialog = gtk_about_dialog_new ();
g_object_ref (dialog);
gtk_object_sink (GTK_OBJECT (dialog));
g_object_ref_sink (dialog);
g_signal_connect (dialog, "delete_event", G_CALLBACK (gtk_widget_hide_on_delete), NULL);
......
......@@ -779,8 +779,7 @@ gtk_action_create_menu_proxy (GtkToolItem *tool_item,
{
menu_item = gtk_action_create_menu_item (action);
g_object_ref (menu_item);
gtk_object_sink (GTK_OBJECT (menu_item));
g_object_ref_sink (menu_item);
gtk_tool_item_set_proxy_menu_item (tool_item,
"gtk-action-menu-item", menu_item);
......
......@@ -590,8 +590,7 @@ gtk_cell_view_cell_layout_pack_start (GtkCellLayout *layout,
g_return_if_fail (GTK_IS_CELL_RENDERER (renderer));
g_return_if_fail (!gtk_cell_view_get_cell_info (cellview, renderer));
g_object_ref (renderer);
gtk_object_sink (GTK_OBJECT (renderer));
g_object_ref_sink (renderer);
info = g_new0 (GtkCellViewCellInfo, 1);
info->cell = renderer;
......@@ -613,8 +612,7 @@ gtk_cell_view_cell_layout_pack_end (GtkCellLayout *layout,
g_return_if_fail (GTK_IS_CELL_RENDERER (renderer));
g_return_if_fail (!gtk_cell_view_get_cell_info (cellview, renderer));
g_object_ref (renderer);
gtk_object_sink (GTK_OBJECT (renderer));
g_object_ref_sink (renderer);
info = g_new0 (GtkCellViewCellInfo, 1);
info->cell = renderer;
......
......@@ -1187,8 +1187,7 @@ gtk_clist_set_hadjustment (GtkCList *clist,
if (clist->hadjustment)
{
gtk_object_ref (GTK_OBJECT (clist->hadjustment));
gtk_object_sink (GTK_OBJECT (clist->hadjustment));
g_object_ref_sink (clist->hadjustment);
gtk_signal_connect (GTK_OBJECT (clist->hadjustment), "changed",
(GtkSignalFunc) hadjustment_changed,
......@@ -1235,8 +1234,7 @@ gtk_clist_set_vadjustment (GtkCList *clist,
if (clist->vadjustment)
{
gtk_object_ref (GTK_OBJECT (clist->vadjustment));
gtk_object_sink (GTK_OBJECT (clist->vadjustment));
g_object_ref_sink (clist->vadjustment);
gtk_signal_connect (GTK_OBJECT (clist->vadjustment), "changed",
(GtkSignalFunc) vadjustment_changed,
......
......@@ -1289,7 +1289,7 @@ mouse_release (GtkWidget *invisible,
GdkEventButton *event,
gpointer data)
{
GtkColorSelection *colorsel = data;
/* GtkColorSelection *colorsel = data; */
if (event->button != 1)
return FALSE;
......@@ -1391,7 +1391,7 @@ mouse_press (GtkWidget *invisible,
GdkEventButton *event,
gpointer data)
{
GtkColorSelection *colorsel = data;
/* GtkColorSelection *colorsel = data; */
if (event->type == GDK_BUTTON_PRESS &&
event->button == 1)
......@@ -1931,8 +1931,7 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
priv->default_alpha_set = FALSE;
priv->tooltips = gtk_tooltips_new ();
g_object_ref (priv->tooltips);
gtk_object_sink (GTK_OBJECT (priv->tooltips));
g_object_ref_sink (priv->tooltips);
gtk_box_set_spacing (GTK_BOX (colorsel), 4);
top_hbox = gtk_hbox_new (FALSE, 8);
......
......@@ -2535,8 +2535,7 @@ gtk_combo_box_menu_setup (GtkComboBox *combo_box,
/* the column is needed in tree_column_row_is_sensitive() */
combo_box->priv->column = gtk_tree_view_column_new ();
g_object_ref (combo_box->priv->column);
gtk_object_sink (GTK_OBJECT (combo_box->priv->column));
g_object_ref_sink (combo_box->priv->column);
gtk_combo_box_sync_cells (combo_box,
GTK_CELL_LAYOUT (combo_box->priv->column));
......@@ -3837,8 +3836,7 @@ gtk_combo_box_cell_layout_pack_start (GtkCellLayout *layout,
combo_box = GTK_COMBO_BOX (layout);
g_object_ref (cell);
gtk_object_sink (GTK_OBJECT (cell));
g_object_ref_sink (cell);
info = g_new0 (ComboCellInfo, 1);
info->cell = cell;
......@@ -3894,8 +3892,7 @@ gtk_combo_box_cell_layout_pack_end (GtkCellLayout *layout,
combo_box = GTK_COMBO_BOX (layout);
g_object_ref (cell);
gtk_object_sink (GTK_OBJECT (cell));
g_object_ref_sink (cell);
info = g_new0 (ComboCellInfo, 1);
info->cell = cell;
......
......@@ -676,8 +676,7 @@ gtk_file_chooser_default_init (GtkFileChooserDefault *impl)
gtk_box_set_spacing (GTK_BOX (impl), 12);
impl->tooltips = gtk_tooltips_new ();
g_object_ref (impl->tooltips);
gtk_object_sink (GTK_OBJECT (impl->tooltips));
g_object_ref_sink (impl->tooltips);
profile_end ("end", NULL);
}
......@@ -5775,8 +5774,7 @@ gtk_file_chooser_default_add_filter (GtkFileChooser *chooser,
return;
}
g_object_ref (filter);
gtk_object_sink (GTK_OBJECT (filter));
g_object_ref_sink (filter);
impl->filters = g_slist_append (impl->filters, filter);
name = gtk_file_filter_get_name (filter);
......@@ -6583,8 +6581,7 @@ set_current_filter (GtkFileChooserDefault *impl,
impl->current_filter = filter;
if (impl->current_filter)
{
g_object_ref (impl->current_filter);
gtk_object_sink (GTK_OBJECT (filter));
g_object_ref_sink (impl->current_filter);
}
if (impl->filters)
......@@ -6920,7 +6917,7 @@ path_bar_clicked (GtkPathBar *path_bar,
*/
if (child_path != NULL)
{
gtk_file_chooser_default_select_path (impl, child_path, NULL);
gtk_file_chooser_default_select_path (GTK_FILE_CHOOSER (impl), child_path, NULL);
browse_files_center_selected_row (impl);
}
}
......@@ -7075,7 +7072,7 @@ list_mtime_data_func (GtkTreeViewColumn *tree_column,
{
GtkFileChooserDefault *impl;
const GtkFileInfo *info;
GtkFileTime time_mtime, time_now;
GtkFileTime time_mtime;
GDate mtime, now;
int days_diff;
char buf[256];
......@@ -7099,10 +7096,10 @@ list_mtime_data_func (GtkTreeViewColumn *tree_column,
strcpy (buf, _("Unknown"));
else
{
g_date_set_time (&mtime, (GTime) time_mtime);
time_now = (GTime ) time (NULL);
g_date_set_time (&now, (GTime) time_now);
time_t time_now;
g_date_set_time_t (&mtime, time_mtime);
time_now = time (NULL);
g_date_set_time_t (&now, time_now);
days_diff = g_date_get_julian (&now) - g_date_get_julian (&mtime);
......
......@@ -2220,8 +2220,7 @@ gtk_icon_view_set_adjustments (GtkIconView *icon_view,
if (icon_view->priv->hadjustment != hadj)
{
icon_view->priv->hadjustment = hadj;
g_object_ref (icon_view->priv->hadjustment);
gtk_object_sink (GTK_OBJECT (icon_view->priv->hadjustment));
g_object_ref_sink (icon_view->priv->hadjustment);
g_signal_connect (icon_view->priv->hadjustment, "value_changed",
G_CALLBACK (gtk_icon_view_adjustment_changed),
......@@ -2232,8 +2231,7 @@ gtk_icon_view_set_adjustments (GtkIconView *icon_view,
if (icon_view->priv->vadjustment != vadj)
{
icon_view->priv->vadjustment = vadj;
g_object_ref (icon_view->priv->vadjustment);
gtk_object_sink (GTK_OBJECT (icon_view->priv->vadjustment));
g_object_ref_sink (icon_view->priv->vadjustment);
g_signal_connect (icon_view->priv->vadjustment, "value_changed",
G_CALLBACK (gtk_icon_view_adjustment_changed),
......@@ -4166,8 +4164,7 @@ gtk_icon_view_cell_layout_pack_start (GtkCellLayout *layout,
g_return_if_fail (GTK_IS_CELL_RENDERER (renderer));
g_return_if_fail (!gtk_icon_view_get_cell_info (icon_view, renderer));
g_object_ref (renderer);
gtk_object_sink (GTK_OBJECT (renderer));
g_object_ref_sink (renderer);
info = g_new0 (GtkIconViewCellInfo, 1);
info->cell = renderer;
......@@ -4190,8 +4187,7 @@ gtk_icon_view_cell_layout_pack_end (GtkCellLayout *layout,
g_return_if_fail (GTK_IS_CELL_RENDERER (renderer));
g_return_if_fail (!gtk_icon_view_get_cell_info (icon_view, renderer));
g_object_ref (renderer);
gtk_object_sink (GTK_OBJECT (renderer));
g_object_ref_sink (renderer);
info = g_new0 (GtkIconViewCellInfo, 1);
info->cell = renderer;
......
......@@ -128,8 +128,7 @@ gtk_invisible_init (GtkInvisible *invisible)
GTK_WIDGET_UNSET_FLAGS (invisible, GTK_NO_WINDOW);
GTK_WIDGET_SET_FLAGS (invisible, GTK_TOPLEVEL);
g_object_ref (invisible);
gtk_object_sink (GTK_OBJECT (invisible));
g_object_ref_sink (invisible);
invisible->has_user_ref_count = TRUE;
invisible->screen = gdk_screen_get_default ();
......
......@@ -453,8 +453,7 @@ gtk_item_factory_construct (GtkItemFactory *ifactory,
ifactory->widget = g_object_connect (gtk_widget_new (container_type, NULL),
"signal::destroy", gtk_widget_destroyed, &ifactory->widget,
NULL);
g_object_ref (ifactory);
gtk_object_sink (GTK_OBJECT (ifactory));
g_object_ref_sink (ifactory);
gtk_item_factory_add_item (ifactory,
"", NULL,
......@@ -525,8 +524,7 @@ gtk_item_factory_destroy (GtkObject *object)
dobj = GTK_OBJECT (ifactory->widget);
g_object_ref (dobj);
gtk_object_sink (dobj);
g_object_ref_sink (dobj);
gtk_object_destroy (dobj);
g_object_unref (dobj);
......
......@@ -228,8 +228,7 @@ gtk_layout_set_adjustments (GtkLayout *layout,
if (layout->hadjustment != hadj)
{
layout->hadjustment = hadj;
g_object_ref (layout->hadjustment);
gtk_object_sink (GTK_OBJECT (layout->hadjustment));
g_object_ref_sink (layout->hadjustment);
gtk_layout_set_adjustment_upper (layout->hadjustment, layout->width, FALSE);
g_signal_connect (layout->hadjustment, "value_changed",
......@@ -241,8 +240,7 @@ gtk_layout_set_adjustments (GtkLayout *layout,
if (layout->vadjustment != vadj)
{
layout->vadjustment = vadj;
g_object_ref (layout->vadjustment);
gtk_object_sink (GTK_OBJECT (layout->vadjustment));
g_object_ref_sink (layout->vadjustment);
gtk_layout_set_adjustment_upper (layout->vadjustment, layout->height, FALSE);
g_signal_connect (layout->vadjustment, "value_changed",
......
......@@ -877,7 +877,7 @@ gtk_menu_init (GtkMenu *menu)
/* Refloat the menu, so that reference counting for the menu isn't
* affected by it being a child of the toplevel
*/
GTK_WIDGET_SET_FLAGS (menu, GTK_FLOATING);
g_object_force_floating (G_OBJECT (menu));
menu->needs_destruction_ref_count = TRUE;
menu->view_window = NULL;
......@@ -1031,8 +1031,7 @@ gtk_menu_attach_to_widget (GtkMenu *menu,
return;
}
g_object_ref (menu);
gtk_object_sink (GTK_OBJECT (menu));
g_object_ref_sink (menu);
data = g_new (GtkMenuAttachData, 1);
data->attach_widget = attach_widget;
......@@ -3904,10 +3903,9 @@ gtk_menu_reparent (GtkMenu *menu,
{
GtkObject *object = GTK_OBJECT (menu);
GtkWidget *widget = GTK_WIDGET (menu);
gboolean was_floating = GTK_OBJECT_FLOATING (object);
gboolean was_floating = g_object_is_floating (object);
g_object_ref (object);
gtk_object_sink (object);
g_object_ref_sink (object);
if (unrealize)
{
......@@ -3920,7 +3918,7 @@ gtk_menu_reparent (GtkMenu *menu,
gtk_widget_reparent (GTK_WIDGET (menu), new_parent);
if (was_floating)
GTK_OBJECT_SET_FLAGS (object, GTK_FLOATING);
g_object_force_floating (G_OBJECT (object));
else
g_object_unref (object);
}
......
......@@ -573,8 +573,7 @@ gtk_menu_tool_button_set_menu (GtkMenuToolButton *button,
if (priv->menu)
{
g_object_ref (priv->menu);
gtk_object_sink (GTK_OBJECT (priv->menu));
g_object_ref_sink (priv->menu);
gtk_widget_set_sensitive (priv->arrow_button, TRUE);
......
......@@ -4355,8 +4355,7 @@ gtk_notebook_insert_page_menu (GtkNotebook *notebook,
page->default_menu = TRUE;
else
{
g_object_ref (page->menu_label);
gtk_object_sink (GTK_OBJECT (page->menu_label));
g_object_ref_sink (page->menu_label);
}
if (notebook->menu)
......@@ -5207,8 +5206,7 @@ gtk_notebook_set_menu_label (GtkNotebook *notebook,
if (menu_label)
{
page->menu_label = menu_label;
g_object_ref (page->menu_label);
gtk_object_sink (GTK_OBJECT(page->menu_label));
g_object_ref_sink (page->menu_label);
page->default_menu = FALSE;
}
else
......
......@@ -348,7 +348,6 @@ static void
gtk_object_init (GtkObject *object,
GtkObjectClass *klass)
{
GTK_OBJECT_FLAGS (object) = GTK_FLOATING;
}
/********************************************
......@@ -396,13 +395,12 @@ gtk_object_finalize (GObject *gobject)
{
GtkObject *object = GTK_OBJECT (gobject);
if (GTK_OBJECT_FLOATING (object))
if (g_object_is_floating (object))
{
g_warning ("A floating object was finalized. This means that someone\n"
"called g_object_unref() on an object that had only a floating\n"
"reference; the initial floating reference is not owned by anyone\n"
"and must be removed with gtk_object_sink() after a normal\n"
"reference is obtained with g_object_ref().");
"and must be removed with g_object_ref_sink().");
}
gtk_object_notify_weaks (object);
......@@ -449,24 +447,12 @@ gtk_object_get_property (GObject *object,
}
}
/*****************************************
* gtk_object_sink:
*
* arguments:
*
* results:
*****************************************/
void
gtk_object_sink (GtkObject *object)
{
g_return_if_fail (GTK_IS_OBJECT (object));
if (GTK_OBJECT_FLOATING (object))
{
GTK_OBJECT_UNSET_FLAGS (object, GTK_FLOATING);
g_object_unref (object);
}
g_object_ref_sink (object);
g_object_unref (object);
}
/*****************************************
......
......@@ -58,7 +58,9 @@ G_BEGIN_DECLS
typedef enum
{
GTK_IN_DESTRUCTION = 1 << 0, /* Used internally during dispose */
#ifndef GTK_DISABLE_DEPRECATED
GTK_FLOATING = 1 << 1,
#endif
GTK_RESERVED_1 = 1 << 2,
GTK_RESERVED_2 = 1 << 3
} GtkObjectFlags;
......@@ -66,7 +68,9 @@ typedef enum
/* Macros for extracting the object_flags from GtkObject.
*/
#define GTK_OBJECT_FLAGS(obj) (GTK_OBJECT (obj)->flags)
#ifndef GTK_DISABLE_DEPRECATED
#define GTK_OBJECT_FLOATING(obj) ((GTK_OBJECT_FLAGS (obj) & GTK_FLOATING) != 0)
#endif
/* Macros for setting and clearing bits in the object_flags field of GtkObject.
*/
......@@ -117,7 +121,9 @@ struct _GtkObjectClass
GtkType gtk_object_get_type (void) G_GNUC_CONST;
#ifndef GTK_DISABLE_DEPRECATED
void gtk_object_sink (GtkObject *object);
#endif
void gtk_object_destroy (GtkObject *object);
/****************************************************************/
......
......@@ -535,8 +535,7 @@ gtk_progress_set_adjustment (GtkProgress *progress,
progress->adjustment = adjustment;
if (adjustment)
{
g_object_ref (adjustment);
gtk_object_sink (GTK_OBJECT (adjustment));
g_object_ref_sink (adjustment);
g_signal_connect (adjustment, "changed",
G_CALLBACK (gtk_progress_changed),
progress);
......
......@@ -619,8 +619,7 @@ gtk_range_set_adjustment (GtkRange *range,
}
range->adjustment = adjustment;
g_object_ref (adjustment);
gtk_object_sink (GTK_OBJECT (adjustment));
g_object_ref_sink (adjustment);
g_signal_connect (adjustment, "changed",
G_CALLBACK (gtk_range_adjustment_changed),
......
......@@ -1686,8 +1686,7 @@ gtk_spin_button_set_adjustment (GtkSpinButton *spin_button,
spin_button->adjustment = adjustment;
if (adjustment)
{
g_object_ref (adjustment);
gtk_object_sink (GTK_OBJECT (adjustment));
g_object_ref_sink (adjustment);
g_signal_connect (adjustment, "value_changed",
G_CALLBACK (gtk_spin_button_value_changed),
spin_button);
......
......@@ -407,8 +407,7 @@ gtk_status_icon_init (GtkStatusIcon *status_icon)
gtk_widget_show (status_icon->priv->tray_icon);
status_icon->priv->tooltips = gtk_tooltips_new ();
g_object_ref (status_icon->priv->tooltips);
gtk_object_sink (GTK_OBJECT (status_icon->priv->tooltips));
g_object_ref_sink (status_icon->priv->tooltips);
#endif
#ifdef GDK_WINDOWING_WIN32
......
......@@ -877,8 +877,7 @@ gtk_text_set_adjustments (GtkText *text,
if (text->hadj != hadj)
{
text->hadj = hadj;
gtk_object_ref (GTK_OBJECT (text->hadj));
gtk_object_sink (GTK_OBJECT (text->hadj));
g_object_ref_sink (text->hadj);
gtk_signal_connect (GTK_OBJECT (text->hadj), "changed",
(GtkSignalFunc) gtk_text_adjustment,
......@@ -897,8 +896,7 @@ gtk_text_set_adjustments (GtkText *text,
if (text->vadj != vadj)
{
text->vadj = vadj;
gtk_object_ref (GTK_OBJECT (text->vadj));
gtk_object_sink (GTK_OBJECT (text->vadj));
g_object_ref_sink (text->vadj);
gtk_signal_connect (GTK_OBJECT (text->vadj), "changed",
(GtkSignalFunc) gtk_text_adjustment,
......
......@@ -6437,8 +6437,7 @@ gtk_text_view_set_scroll_adjustments (GtkTextView *text_view,
if (text_view->hadjustment != hadj)
{
text_view->hadjustment = hadj;
g_object_ref (text_view->hadjustment);
gtk_object_sink (GTK_OBJECT (text_view->hadjustment));
g_object_ref_sink (text_view->hadjustment);
g_signal_connect (text_view->hadjustment, "value_changed",
G_CALLBACK (gtk_text_view_value_changed),
......@@ -6449,8 +6448,7 @@ gtk_text_view_set_scroll_adjustments (GtkTextView *text_view,
if (text_view->vadjustment != vadj)
{
text_view->vadjustment = vadj;
g_object_ref (text_view->vadjustment);
gtk_object_sink (GTK_OBJECT (text_view->vadjustment));
g_object_ref_sink (text_view->vadjustment);
g_signal_connect (text_view->vadjustment, "value_changed",
G_CALLBACK (gtk_text_view_value_changed),
......
......@@ -696,8 +696,7 @@ gtk_toolbar_init (GtkToolbar *toolbar)
toolbar->style = DEFAULT_TOOLBAR_STYLE;
toolbar->icon_size = DEFAULT_ICON_SIZE;
toolbar->tooltips = gtk_tooltips_new ();
g_object_ref (toolbar->tooltips);
gtk_object_sink (GTK_OBJECT (toolbar->tooltips));
g_object_ref_sink (toolbar->tooltips);
priv->arrow_button = gtk_toggle_button_new ();
g_signal_connect (priv->arrow_button, "button_press_event",
......@@ -2286,8 +2285,7 @@ gtk_toolbar_set_drop_highlight_item (GtkToolbar *toolbar,
if (priv->highlight_tool_item)
g_object_unref (priv->highlight_tool_item);
g_object_ref (tool_item);
gtk_object_sink (GTK_OBJECT (tool_item));
g_object_ref_sink (tool_item);
priv->highlight_tool_item = tool_item;
......
......@@ -925,8 +925,7 @@ gtk_tool_button_set_icon_widget (GtkToolButton *button,
if (icon_widget)
{
g_object_ref (icon_widget);
gtk_object_sink (GTK_OBJECT (icon_widget));
g_object_ref_sink (icon_widget);
}
button->priv->icon_widget = icon_widget;
......@@ -972,8 +971,7 @@ gtk_tool_button_set_label_widget (GtkToolButton *button,
if (label_widget)
{
g_object_ref (label_widget);
gtk_object_sink (GTK_OBJECT (label_widget));
g_object_ref_sink (label_widget);
}
button->priv->label_widget = label_widget;
......
......@@ -1109,8 +1109,7 @@ gtk_tool_item_set_proxy_menu_item (GtkToolItem *tool_item,
if (menu_item)
{
g_object_ref (menu_item);
gtk_object_sink (GTK_OBJECT (menu_item));
g_object_ref_sink (menu_item);
gtk_widget_set_sensitive (menu_item,
GTK_WIDGET_SENSITIVE (tool_item));
......
......@@ -248,8 +248,7 @@ gtk_tree_item_init (GtkTreeItem *tree_item)
gtk_container_add (GTK_CONTAINER (eventbox), pixmapwid);
gtk_widget_show (pixmapwid);
tree_item->plus_pix_widget = pixmapwid;
gtk_widget_ref (tree_item->plus_pix_widget);
gtk_object_sink (GTK_OBJECT (tree_item->plus_pix_widget));
g_object_ref_sink (tree_item->plus_pix_widget);
/* create pixmap for button '-' */
pixmapwid = gtk_type_new (gtk_pixmap_get_type ());
......@@ -257,8 +256,7 @@ gtk_tree_item_init (GtkTreeItem *tree_item)
gtk_container_add (GTK_CONTAINER (eventbox), pixmapwid);
gtk_widget_show (pixmapwid);
tree_item->minus_pix_widget = pixmapwid;
gtk_widget_ref (tree_item->minus_pix_widget);
gtk_object_sink (GTK_OBJECT (tree_item->minus_pix_widget));
g_object_ref_sink (tree_item->minus_pix_widget);
gtk_widget_set_parent (eventbox, GTK_WIDGET (tree_item));
}
......
......@@ -6988,8 +6988,7 @@ gtk_tree_view_set_adjustments (GtkTreeView *tree_view,
if (tree_view->priv->hadjustment != hadj)
{
tree_view->priv->hadjustment = hadj;
g_object_ref (tree_view->priv->hadjustment);
gtk_object_sink (GTK_OBJECT (tree_view->priv->hadjustment));
g_object_ref_sink (tree_view->priv->hadjustment);
g_signal_connect (tree_view->priv->hadjustment, "value_changed",
G_CALLBACK (gtk_tree_view_adjustment_changed),
......@@ -7000,8 +6999,7 @@ gtk_tree_view_set_adjustments (GtkTreeView *tree_view,
if (tree_view->priv->vadjustment != vadj)
{
tree_view->priv->vadjustment = vadj;
g_object_ref (tree_view->priv->vadjustment);
gtk_object_sink (GTK_OBJECT (tree_view->priv->vadjustment));
g_object_ref_sink (tree_view->priv->vadjustment);
g_signal_connect (tree_view->priv->vadjustment, "value_changed",
G_CALLBACK (gtk_tree_view_adjustment_changed),
......@@ -9987,8 +9985,7 @@ gtk_tree_view_insert_column (GtkTreeView *tree_view,
g_return_val_if_fail (gtk_tree_view_column_get_sizing (column)
== GTK_TREE_VIEW_COLUMN_FIXED, -1);
g_object_ref (column);
gtk_object_sink (GTK_OBJECT (column));
g_object_ref_sink (column);
if (tree_view->priv->n_columns == 0 &&
GTK_WIDGET_REALIZED (tree_view) &&
......
......@@ -642,8 +642,7 @@ gtk_tree_view_column_cell_layout_pack_start (GtkCellLayout *cell_layout,
column = GTK_TREE_VIEW_COLUMN (cell_layout);
g_return_if_fail (! gtk_tree_view_column_get_cell_info (column, cell));
g_object_ref (cell);
gtk_object_sink (GTK_OBJECT (cell));
g_object_ref_sink (cell);
cell_info = g_new0 (GtkTreeViewColumnCellInfo, 1);
cell_info->cell = cell;
......@@ -667,8 +666,7 @@ gtk_tree_view_column_cell_layout_pack_end (GtkCellLayout *cell_layout,
column = GTK_TREE_VIEW_COLUMN (cell_layout);
g_return_if_fail (! gtk_tree_view_column_get_cell_info (column, cell));
g_object_ref (cell);
gtk_object_sink (GTK_OBJECT (cell));
g_object_ref_sink (cell);
cell_info = g_new0 (GtkTreeViewColumnCellInfo, 1);
cell_info->cell = cell;
......@@ -2218,10 +2216,7 @@ gtk_tree_view_column_set_widget (GtkTreeViewColumn *tree_column,
g_return_if_fail (widget == NULL || GTK_IS_WIDGET (widget));
if (widget)