Commit 16a59ad9 authored by Javier Jardon's avatar Javier Jardon

Deprecate widget flag: GTK_WIDGET_REALIZED

Use gtk_widget_get_realized() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
parent 1fe7d3ce
......@@ -410,7 +410,7 @@ gtk_rotated_bin_size_allocate (GtkWidget *widget,
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
allocation->x + border_width,
allocation->y + border_width,
......@@ -436,7 +436,7 @@ gtk_rotated_bin_size_allocate (GtkWidget *widget,
child_allocation.width = MIN ((w - s * child_allocation.height) / c,
(h - c * child_allocation.height) / s);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (bin->offscreen_window,
child_allocation.x,
child_allocation.y,
......
......@@ -327,7 +327,7 @@ gtk_mirror_bin_size_allocate (GtkWidget *widget,
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
allocation->x + border_width,
allocation->y + border_width,
......@@ -344,7 +344,7 @@ gtk_mirror_bin_size_allocate (GtkWidget *widget,
child_allocation.height = child_requisition.height;
child_allocation.width = child_requisition.width;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (bin->offscreen_window,
allocation->x + border_width,
allocation->y + border_width,
......
......@@ -11997,7 +11997,7 @@ gtk_dial_size_allocate (GtkWidget *widget,
g_return_if_fail (allocation != NULL);
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
dial = GTK_DIAL (widget);
......@@ -15160,7 +15160,7 @@ gtk_dial_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
dial = GTK_DIAL (widget);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
......
......@@ -261,7 +261,7 @@ gtk_dial_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
dial = GTK_DIAL (widget);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
......
......@@ -1726,7 +1726,7 @@ gtk_assistant_insert_page (GtkAssistant *assistant,
gtk_widget_set_parent (page_info->page, GTK_WIDGET (assistant));
gtk_widget_set_parent (page_info->title, GTK_WIDGET (assistant));
if (GTK_WIDGET_REALIZED (GTK_WIDGET (assistant)))
if (gtk_widget_get_realized (GTK_WIDGET (assistant)))
{
gtk_widget_realize (page_info->page);
gtk_widget_realize (page_info->title);
......
......@@ -1399,7 +1399,7 @@ gtk_button_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (button->event_window,
widget->allocation.x + border_width,
widget->allocation.y + border_width,
......@@ -1754,7 +1754,7 @@ gtk_real_button_activate (GtkButton *button)
priv = GTK_BUTTON_GET_PRIVATE (button);
if (GTK_WIDGET_REALIZED (button) && !button->activate_timeout)
if (gtk_widget_get_realized (widget) && !button->activate_timeout)
{
time = gtk_get_current_event_time ();
if (gdk_keyboard_grab (button->event_window, TRUE, time) ==
......
......@@ -2024,7 +2024,7 @@ gtk_calendar_size_allocate (GtkWidget *widget,
priv->week_width = 0;
}
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
......@@ -3219,7 +3219,7 @@ calendar_set_background (GtkWidget *widget)
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
gint i;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
for (i = 0; i < 4; i++)
{
......@@ -3249,7 +3249,7 @@ static void
gtk_calendar_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
if (previous_style && GTK_WIDGET_REALIZED (widget))
if (previous_style && gtk_widget_get_realized (widget))
calendar_set_background (widget);
}
......@@ -3557,7 +3557,7 @@ gtk_calendar_set_display_options (GtkCalendar *calendar,
old_flags = calendar->display_flags;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if ((flags ^ calendar->display_flags) & GTK_CALENDAR_NO_MONTH_CHANGE)
{
......
......@@ -259,7 +259,7 @@ gtk_check_button_size_allocate (GtkWidget *widget,
NULL);
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (button->event_window,
allocation->x, allocation->y,
allocation->width, allocation->height);
......
......@@ -1940,7 +1940,7 @@ size_allocate_title_buttons (GtkCList *clist)
gint last_button = 0;
gint i;
if (!GTK_WIDGET_REALIZED (clist))
if (!gtk_widget_get_realized (GTK_WIDGET (clist)))
return;
button_allocation.x = clist->hoffset;
......@@ -2135,7 +2135,7 @@ column_button_create (GtkCList *clist,
button = clist->column[column].button = gtk_button_new ();
gtk_widget_pop_composite_child ();
if (GTK_WIDGET_REALIZED (clist) && clist->title_window)
if (gtk_widget_get_realized (GTK_WIDGET (clist)) && clist->title_window)
gtk_widget_set_parent_window (clist->column[column].button,
clist->title_window);
gtk_widget_set_parent (button, GTK_WIDGET (clist));
......@@ -3221,7 +3221,7 @@ gtk_clist_set_foreground (GtkCList *clist,
{
clist_row->foreground = *color;
clist_row->fg_set = TRUE;
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (clist)),
&clist_row->foreground, FALSE, TRUE);
}
......@@ -3250,7 +3250,7 @@ gtk_clist_set_background (GtkCList *clist,
{
clist_row->background = *color;
clist_row->bg_set = TRUE;
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (clist)),
&clist_row->background, FALSE, TRUE);
}
......@@ -3296,7 +3296,7 @@ gtk_clist_set_cell_style (GtkCList *clist,
if (clist_row->cell[column].style)
{
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
gtk_style_detach (clist_row->cell[column].style);
g_object_unref (clist_row->cell[column].style);
}
......@@ -3307,7 +3307,7 @@ gtk_clist_set_cell_style (GtkCList *clist,
{
g_object_ref (clist_row->cell[column].style);
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
clist_row->cell[column].style =
gtk_style_attach (clist_row->cell[column].style,
clist->clist_window);
......@@ -3375,7 +3375,7 @@ gtk_clist_set_row_style (GtkCList *clist,
if (clist_row->style)
{
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
gtk_style_detach (clist_row->style);
g_object_unref (clist_row->style);
}
......@@ -3386,7 +3386,7 @@ gtk_clist_set_row_style (GtkCList *clist,
{
g_object_ref (clist_row->style);
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
clist_row->style = gtk_style_attach (clist_row->style,
clist->clist_window);
}
......@@ -4621,7 +4621,7 @@ gtk_clist_unrealize (GtkWidget *widget)
GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
/* detach optional row/cell styles */
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
GtkCListRow *clist_row;
GList *list;
......@@ -4829,7 +4829,7 @@ gtk_clist_style_set (GtkWidget *widget,
GTK_WIDGET_CLASS (parent_class)->style_set (widget, previous_style);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gtk_style_set_background (widget->style, widget->window, widget->state);
gtk_style_set_background (widget->style, clist->title_window, GTK_STATE_SELECTED);
......@@ -5406,7 +5406,7 @@ gtk_clist_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
border_width = GTK_CONTAINER (widget)->border_width;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
allocation->x + border_width,
......@@ -5440,7 +5440,7 @@ gtk_clist_size_allocate (GtkWidget *widget,
clist->clist_window_width = clist_allocation.width;
clist->clist_window_height = clist_allocation.height;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (clist->clist_window,
clist_allocation.x,
......@@ -5454,7 +5454,7 @@ gtk_clist_size_allocate (GtkWidget *widget,
clist->column_title_area.y = widget->style->ythickness;
clist->column_title_area.width = clist_allocation.width;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (clist->title_window,
clist->column_title_area.x,
......@@ -6159,7 +6159,7 @@ adjust_allocation_recurse (GtkWidget *widget,
{
ScrollData *scroll_data = data;
if (!GTK_WIDGET_REALIZED (widget))
if (!gtk_widget_get_realized (widget))
{
if (gtk_widget_get_visible (widget))
{
......@@ -6189,7 +6189,7 @@ adjust_allocation (GtkWidget *widget,
{
ScrollData scroll_data;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
scroll_data.window = ALLOCATION_WINDOW (widget);
else
scroll_data.window = NULL;
......@@ -6224,7 +6224,7 @@ hadjustment_value_changed (GtkAdjustment *adjustment,
dx = -value - clist->hoffset;
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
gdk_window_scroll (clist->title_window, dx, 0);
/* adjust the column button's allocations */
......@@ -6394,7 +6394,7 @@ row_delete (GtkCList *clist,
(clist, clist_row, i, GTK_CELL_EMPTY, NULL, 0, NULL, NULL);
if (clist_row->cell[i].style)
{
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
gtk_style_detach (clist_row->cell[i].style);
g_object_unref (clist_row->cell[i].style);
}
......@@ -6402,7 +6402,7 @@ row_delete (GtkCList *clist,
if (clist_row->style)
{
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
gtk_style_detach (clist_row->style);
g_object_unref (clist_row->style);
}
......
......@@ -403,7 +403,7 @@ gtk_color_button_style_set (GtkWidget *widget,
GTK_WIDGET_CLASS (gtk_color_button_parent_class)->style_set (widget, previous_style);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (color_button->priv->pixbuf != NULL)
g_object_unref (color_button->priv->pixbuf);
......
......@@ -1331,7 +1331,7 @@ popup_position_func (GtkMenu *menu,
widget = GTK_WIDGET (user_data);
g_return_if_fail (GTK_WIDGET_REALIZED (widget));
g_return_if_fail (gtk_widget_get_realized (widget));
gdk_window_get_origin (widget->window, &root_x, &root_y);
......
......@@ -1096,7 +1096,7 @@ gtk_combo_box_state_changed (GtkWidget *widget,
GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
GtkComboBoxPrivate *priv = combo_box->priv;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (priv->tree_view && priv->cell_view)
gtk_cell_view_set_background_color (GTK_CELL_VIEW (priv->cell_view),
......@@ -1114,7 +1114,7 @@ gtk_combo_box_button_state_changed (GtkWidget *widget,
GtkComboBox *combo_box = GTK_COMBO_BOX (data);
GtkComboBoxPrivate *priv = combo_box->priv;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (!priv->tree_view && priv->cell_view)
{
......@@ -1911,7 +1911,7 @@ gtk_combo_box_real_popup (GtkComboBox *combo_box)
GtkTreePath *path = NULL, *ppath;
GtkWidget *toplevel;
if (!GTK_WIDGET_REALIZED (combo_box))
if (!gtk_widget_get_realized (GTK_WIDGET (combo_box)))
return;
if (gtk_widget_get_mapped (priv->popup_widget))
......@@ -2011,7 +2011,7 @@ gtk_combo_box_popdown (GtkComboBox *combo_box)
return;
}
if (!GTK_WIDGET_REALIZED (GTK_WIDGET (combo_box)))
if (!gtk_widget_get_realized (GTK_WIDGET (combo_box)))
return;
gtk_grab_remove (priv->popup_window);
......
......@@ -1143,7 +1143,7 @@ gtk_container_set_border_width (GtkContainer *container,
container->border_width = border_width;
g_object_notify (G_OBJECT (container), "border-width");
if (GTK_WIDGET_REALIZED (container))
if (gtk_widget_get_realized (GTK_WIDGET (container)))
gtk_widget_queue_resize (GTK_WIDGET (container));
}
}
......@@ -1380,7 +1380,8 @@ _gtk_container_queue_resize (GtkContainer *container)
if (resize_container)
{
if (gtk_widget_get_visible (GTK_WIDGET (resize_container)) &&
(gtk_widget_is_toplevel (GTK_WIDGET (resize_container)) || GTK_WIDGET_REALIZED (resize_container)))
(gtk_widget_is_toplevel (GTK_WIDGET (resize_container)) ||
gtk_widget_get_realized (GTK_WIDGET (resize_container))))
{
switch (resize_container->resize_mode)
{
......@@ -2250,7 +2251,7 @@ _gtk_container_focus_sort (GtkContainer *container,
while (children)
{
if (GTK_WIDGET_REALIZED (children->data))
if (gtk_widget_get_realized (children->data))
visible_children = g_list_prepend (visible_children, children->data);
children = children->next;
}
......
......@@ -769,7 +769,7 @@ gtk_ctree_unrealize (GtkWidget *widget)
ctree = GTK_CTREE (widget);
clist = GTK_CLIST (widget);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
GtkCTreeNode *node;
GtkCTreeNode *child;
......@@ -3246,7 +3246,7 @@ row_delete (GtkCTree *ctree,
(clist, &(ctree_row->row), i, GTK_CELL_EMPTY, NULL, 0, NULL, NULL);
if (ctree_row->row.cell[i].style)
{
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gtk_style_detach (ctree_row->row.cell[i].style);
g_object_unref (ctree_row->row.cell[i].style);
}
......@@ -3254,7 +3254,7 @@ row_delete (GtkCTree *ctree,
if (ctree_row->row.style)
{
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gtk_style_detach (ctree_row->row.style);
g_object_unref (ctree_row->row.style);
}
......@@ -5007,7 +5007,7 @@ gtk_ctree_node_set_cell_style (GtkCTree *ctree,
if (GTK_CTREE_ROW (node)->row.cell[column].style)
{
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gtk_style_detach (GTK_CTREE_ROW (node)->row.cell[column].style);
g_object_unref (GTK_CTREE_ROW (node)->row.cell[column].style);
}
......@@ -5018,7 +5018,7 @@ gtk_ctree_node_set_cell_style (GtkCTree *ctree,
{
g_object_ref (GTK_CTREE_ROW (node)->row.cell[column].style);
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
GTK_CTREE_ROW (node)->row.cell[column].style =
gtk_style_attach (GTK_CTREE_ROW (node)->row.cell[column].style,
clist->clist_window);
......@@ -5079,7 +5079,7 @@ gtk_ctree_node_set_row_style (GtkCTree *ctree,
if (GTK_CTREE_ROW (node)->row.style)
{
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gtk_style_detach (GTK_CTREE_ROW (node)->row.style);
g_object_unref (GTK_CTREE_ROW (node)->row.style);
}
......@@ -5090,7 +5090,7 @@ gtk_ctree_node_set_row_style (GtkCTree *ctree,
{
g_object_ref (GTK_CTREE_ROW (node)->row.style);
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
GTK_CTREE_ROW (node)->row.style =
gtk_style_attach (GTK_CTREE_ROW (node)->row.style,
clist->clist_window);
......@@ -5129,7 +5129,7 @@ gtk_ctree_node_set_foreground (GtkCTree *ctree,
{
GTK_CTREE_ROW (node)->row.foreground = *color;
GTK_CTREE_ROW (node)->row.fg_set = TRUE;
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (ctree)),
&GTK_CTREE_ROW (node)->row.foreground,
FALSE, TRUE);
......@@ -5152,7 +5152,7 @@ gtk_ctree_node_set_background (GtkCTree *ctree,
{
GTK_CTREE_ROW (node)->row.background = *color;
GTK_CTREE_ROW (node)->row.bg_set = TRUE;
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (ctree)),
&GTK_CTREE_ROW (node)->row.background,
FALSE, TRUE);
......@@ -5346,25 +5346,25 @@ gtk_ctree_set_line_style (GtkCTree *ctree,
clist->column[ctree->tree_column].width + 3);
}
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
{
gint8 dashes[] = { 1, 1 };
switch (line_style)
{
case GTK_CTREE_LINES_SOLID:
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gdk_gc_set_line_attributes (ctree->lines_gc, 1, GDK_LINE_SOLID,
GDK_CAP_BUTT, GDK_JOIN_MITER);
break;
case GTK_CTREE_LINES_DOTTED:
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gdk_gc_set_line_attributes (ctree->lines_gc, 1,
GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_MITER);
gdk_gc_set_dashes (ctree->lines_gc, 0, dashes, G_N_ELEMENTS (dashes));
break;
case GTK_CTREE_LINES_TABBED:
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gdk_gc_set_line_attributes (ctree->lines_gc, 1, GDK_LINE_SOLID,
GDK_CAP_BUTT, GDK_JOIN_MITER);
break;
......
......@@ -521,7 +521,7 @@ gtk_drag_dest_set (GtkWidget *widget,
gtk_drag_dest_unset (widget);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gtk_drag_dest_realized (widget, site);
g_signal_connect (widget, "realize",
......@@ -1218,7 +1218,7 @@ gtk_drag_begin (GtkWidget *widget,
GdkEvent *event)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
g_return_val_if_fail (targets != NULL, NULL);
return gtk_drag_begin_internal (widget, NULL, targets,
......
......@@ -1200,7 +1200,7 @@ gtk_drag_dest_set_internal (GtkWidget *widget,
site->track_motion = old_site->track_motion;
}
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gtk_drag_dest_realized (widget);
g_signal_connect (widget, "realize",
......@@ -2089,7 +2089,7 @@ gtk_drag_dest_hierarchy_changed (GtkWidget *widget,
{
GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
if (gtk_widget_is_toplevel (toplevel) && GTK_WIDGET_REALIZED (toplevel))
if (gtk_widget_is_toplevel (toplevel) && gtk_widget_get_realized (toplevel))
gdk_window_register_dnd (toplevel->window);
}
......@@ -2571,7 +2571,7 @@ gtk_drag_begin (GtkWidget *widget,
GdkEvent *event)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
g_return_val_if_fail (targets != NULL, NULL);
return gtk_drag_begin_internal (widget, NULL, targets,
......
......@@ -119,7 +119,7 @@ gtk_drawing_area_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (gtk_widget_get_has_window (widget))
gdk_window_move_resize (widget->window,
......
......@@ -2691,7 +2691,7 @@ construct_icon_info (GtkWidget *widget,
icon_info = g_slice_new0 (EntryIconInfo);
priv->icons[icon_pos] = icon_info;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
realize_icon_info (widget, icon_pos);
return icon_info;
......@@ -2704,7 +2704,7 @@ gtk_entry_map (GtkWidget *widget)
EntryIconInfo *icon_info = NULL;
gint i;
if (GTK_WIDGET_REALIZED (widget) && !gtk_widget_get_mapped (widget))
if (gtk_widget_get_realized (widget) && !gtk_widget_get_mapped (widget))
{
GTK_WIDGET_CLASS (gtk_entry_parent_class)->map (widget);
......@@ -2994,7 +2994,7 @@ gtk_entry_get_text_area_size (GtkEntry *entry,
gtk_widget_get_child_requisition (widget, &requisition);
_gtk_entry_get_borders (entry, &xborder, &yborder);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_drawable_get_size (widget->window, NULL, &frame_height);
else
frame_height = requisition.height;
......@@ -3102,7 +3102,7 @@ gtk_entry_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
/* We call gtk_widget_get_child_requisition, since we want (for
* backwards compatibility reasons) the realization here to
......@@ -4242,7 +4242,7 @@ gtk_entry_state_changed (GtkWidget *widget,
GdkCursor *cursor;
gint i;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
gdk_window_set_background (entry->text_area, &widget->style->base[GTK_WIDGET_STATE (widget)]);
......@@ -4460,7 +4460,7 @@ gtk_entry_style_set (GtkWidget *widget,
gtk_entry_recompute (entry);
if (previous_style && GTK_WIDGET_REALIZED (widget))
if (previous_style && gtk_widget_get_realized (widget))
{
gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
gdk_window_set_background (entry->text_area, &widget->style->base[GTK_WIDGET_STATE (widget)]);
......@@ -5907,7 +5907,7 @@ gtk_entry_adjust_scroll (GtkEntry *entry)
PangoLayoutLine *line;
PangoRectangle logical_rect;
if (!GTK_WIDGET_REALIZED (entry))
if (!gtk_widget_get_realized (GTK_WIDGET (entry)))
return;
_gtk_entry_effective_inner_border (entry, &inner_border);
......@@ -6349,7 +6349,7 @@ gtk_entry_update_primary_selection (GtkEntry *entry)
gint start, end;
gint n_targets;
if (!GTK_WIDGET_REALIZED (entry))
if (!gtk_widget_get_realized (GTK_WIDGET (entry)))
return;
list = gtk_target_list_new (NULL, 0);
......@@ -7845,7 +7845,7 @@ gtk_entry_set_icon_activatable (GtkEntry *entry,
{
icon_info->nonactivatable = !activatable;
if (GTK_WIDGET_REALIZED (GTK_WIDGET (entry)))
if (gtk_widget_get_realized (GTK_WIDGET (entry)))
update_cursors (GTK_WIDGET (entry));
g_object_notify (G_OBJECT (entry),
......@@ -8049,7 +8049,7 @@ gtk_entry_set_icon_sensitive (GtkEntry *entry,
icon_info->pressed = FALSE;
icon_info->prelight = FALSE;
if (GTK_WIDGET_REALIZED (GTK_WIDGET (entry)))
if (gtk_widget_get_realized (GTK_WIDGET (entry)))
update_cursors (GTK_WIDGET (entry));
gtk_widget_queue_draw (GTK_WIDGET (entry));
......@@ -8566,7 +8566,7 @@ popup_position_func (GtkMenu *menu,
GtkBorder inner_border;
gint monitor_num, strong_x, height;
g_return_if_fail (GTK_WIDGET_REALIZED (entry));
g_return_if_fail (gtk_widget_get_realized (widget));
gdk_window_get_origin (entry->text_area, x, y);
......@@ -8623,7 +8623,7 @@ popup_targets_received (GtkClipboard *clipboard,
PopupInfo *info = user_data;
GtkEntry *entry = info->entry;
if (GTK_WIDGET_REALIZED (entry))
if (gtk_widget_get_realized (GTK_WIDGET (entry)))
{
DisplayMode mode;
gboolean clipboard_contains_text;
......
......@@ -244,7 +244,7 @@ gtk_event_box_set_visible_window (GtkEventBox *event_box,
if (visible_window != gtk_widget_get_has_window (widget))
{
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gboolean visible = gtk_widget_get_visible (widget);
......@@ -330,7 +330,7 @@ gtk_event_box_set_above_child (GtkEventBox *event_box,
{
priv->above_child = above_child;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (!gtk_widget_get_has_window (widget))
{
......@@ -522,7 +522,7 @@ gtk_event_box_size_allocate (GtkWidget *widget,
child_allocation.width = MAX (allocation->width - GTK_CONTAINER (widget)->border_width * 2, 0);
child_allocation.height = MAX (allocation->height - GTK_CONTAINER (widget)->border_width * 2, 0);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
priv = GTK_EVENT_BOX_GET_PRIVATE (widget);
......
......@@ -669,7 +669,7 @@ gtk_expander_size_allocate (GtkWidget *widget,
label_height = 0;
}
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
GdkRectangle rect;
......@@ -966,7 +966,7 @@ gtk_expander_redraw_expander (GtkExpander *expander)
widget = GTK_WIDGET (expander);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_invalidate_rect (widget->window, &widget->allocation, FALSE);
}
......@@ -1318,7 +1318,7 @@ gtk_expander_animation_timeout (GtkExpander *expander)
GdkRectangle area;
gboolean finish = FALSE;
if (GTK_WIDGET_REALIZED (expander))
if (gtk_widget_get_realized (GTK_WIDGET (expander)))
{
get_expander_bounds (expander, &area);
gdk_window_invalidate_rect (GTK_WIDGET (expander)->window, &area, TRUE);
......@@ -1406,7 +1406,7 @@ gtk_expander_set_expanded (GtkExpander *expander,
g_object_get (settings, "gtk-enable-animations", &enable_animations, NULL);
if (enable_animations && GTK_WIDGET_REALIZED (expander))
if (enable_animations && gtk_widget_get_realized (GTK_WIDGET (expander)))
{
gtk_expander_start_animation (expander);
}
......
......@@ -4279,7 +4279,7 @@ popup_position_func (GtkMenu *menu,
gint monitor_num;
GdkRectangle monitor;
g_return_if_fail (GTK_WIDGET_REALIZED (widget));