Commit 1934de4b authored by Javier Jardón's avatar Javier Jardón

Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_REALIZED)

Use new API instead: gtk_widget_set_realized ()

https://bugzilla.gnome.org/show_bug.cgi?id=69872
parent 24bafd86
......@@ -229,7 +229,7 @@ gtk_rotated_bin_realize (GtkWidget *widget)
gint border_width;
GtkRequisition child_requisition;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
border_width = GTK_CONTAINER (widget)->border_width;
......
......@@ -167,7 +167,7 @@ gtk_mirror_bin_realize (GtkWidget *widget)
gint border_width;
GtkRequisition child_requisition;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
border_width = GTK_CONTAINER (widget)->border_width;
......
......@@ -11925,7 +11925,7 @@ gtk_dial_realize (GtkWidget *widget)
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_DIAL (widget));
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
dial = GTK_DIAL (widget);
attributes.x = widget->allocation.x;
......@@ -15113,7 +15113,7 @@ gtk_dial_realize (GtkWidget *widget)
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_DIAL (widget));
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
dial = GTK_DIAL (widget);
attributes.x = widget->allocation.x;
......
......@@ -214,7 +214,7 @@ gtk_dial_realize (GtkWidget *widget)
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_DIAL (widget));
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
dial = GTK_DIAL (widget);
attributes.x = widget->allocation.x;
......
......@@ -1175,7 +1175,7 @@ gtk_button_realize (GtkWidget *widget)
gint border_width;
button = GTK_BUTTON (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
border_width = GTK_CONTAINER (widget)->border_width;
......
......@@ -1572,7 +1572,7 @@ gtk_calendar_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
......
......@@ -4458,7 +4458,7 @@ gtk_clist_realize (GtkWidget *widget)
clist = GTK_CLIST (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
border_width = GTK_CONTAINER (widget)->border_width;
......
......@@ -85,7 +85,7 @@ gtk_drawing_area_realize (GtkWidget *widget)
}
else
{
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
......
......@@ -2753,7 +2753,7 @@ gtk_entry_realize (GtkWidget *widget)
gint attributes_mask;
int i;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
entry = GTK_ENTRY (widget);
priv = GTK_ENTRY_GET_PRIVATE (entry);
......
......@@ -372,7 +372,7 @@ gtk_event_box_realize (GtkWidget *widget)
GtkEventBoxPrivate *priv;
gboolean visible_window;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
border_width = GTK_CONTAINER (widget)->border_width;
......
......@@ -403,7 +403,7 @@ gtk_expander_realize (GtkWidget *widget)
gint label_height;
priv = GTK_EXPANDER (widget)->priv;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
border_width = GTK_CONTAINER (widget)->border_width;
......
......@@ -277,7 +277,7 @@ gtk_fixed_realize (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_fixed_parent_class)->realize (widget);
else
{
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
......
......@@ -394,7 +394,7 @@ gtk_handle_box_realize (GtkWidget *widget)
hb = GTK_HANDLE_BOX (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
......
......@@ -279,7 +279,7 @@ gtk_hsv_realize (GtkWidget *widget)
hsv = GTK_HSV (widget);
priv = hsv->priv;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
/* Create window */
......
......@@ -1318,7 +1318,7 @@ gtk_icon_view_realize (GtkWidget *widget)
icon_view = GTK_ICON_VIEW (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
/* Make the main, clipping window */
attributes.window_type = GDK_WINDOW_CHILD;
......
......@@ -218,7 +218,7 @@ gtk_invisible_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
parent = gtk_widget_get_parent_window (widget);
if (parent == NULL)
......
......@@ -125,7 +125,7 @@ gtk_item_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
......
......@@ -847,7 +847,7 @@ gtk_layout_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (layout, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
......
......@@ -451,7 +451,7 @@ gtk_list_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
......
......@@ -431,7 +431,7 @@ gtk_list_item_realize (GtkWidget *widget)
g_return_if_fail (GTK_IS_LIST_ITEM (widget));
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
......
......@@ -2263,7 +2263,7 @@ gtk_menu_realize (GtkWidget *widget)
menu = GTK_MENU (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
......
......@@ -1129,7 +1129,7 @@ gtk_menu_item_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
widget->window = gtk_widget_get_parent_window (widget);
g_object_ref (widget->window);
......
......@@ -513,7 +513,7 @@ gtk_menu_shell_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
......
......@@ -308,7 +308,7 @@ gtk_misc_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
if (!gtk_widget_get_has_window (widget))
{
......
......@@ -1798,7 +1798,8 @@ gtk_notebook_realize (GtkWidget *widget)
GdkRectangle event_window_pos;
notebook = GTK_NOTEBOOK (widget);
GTK_WIDGET_SET_FLAGS (notebook, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
gtk_notebook_get_event_window_position (notebook, &event_window_pos);
......
......@@ -125,7 +125,7 @@ gtk_offscreen_window_realize (GtkWidget *widget)
bin = GTK_BIN (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
......
......@@ -978,7 +978,7 @@ gtk_paned_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
paned = GTK_PANED (widget);
widget->window = gtk_widget_get_parent_window (widget);
......
......@@ -408,7 +408,7 @@ gtk_path_bar_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
path_bar = GTK_PATH_BAR (widget);
widget->window = gtk_widget_get_parent_window (widget);
......
......@@ -607,7 +607,7 @@ gtk_plug_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD; /* XXX GDK_WINDOW_PLUG ? */
attributes.title = window->title;
......
......@@ -420,7 +420,7 @@ gtk_preview_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
......
......@@ -212,7 +212,7 @@ gtk_progress_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
......
......@@ -1495,7 +1495,7 @@ gtk_range_realize (GtkWidget *widget)
gtk_range_calc_layout (range, range->adjustment->value);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
widget->window = gtk_widget_get_parent_window (widget);
g_object_ref (widget->window);
......
......@@ -441,7 +441,8 @@ gtk_ruler_realize (GtkWidget *widget)
gint attributes_mask;
ruler = GTK_RULER (widget);
GTK_WIDGET_SET_FLAGS (ruler, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
......
......@@ -326,7 +326,7 @@ gtk_socket_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
......@@ -390,7 +390,7 @@ gtk_socket_unrealize (GtkWidget *widget)
{
GtkSocket *socket = GTK_SOCKET (widget);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, FALSE);
if (socket->plug_widget)
{
......
......@@ -1239,7 +1239,7 @@ gtk_text_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (text, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
......
......@@ -3827,7 +3827,8 @@ gtk_text_view_realize (GtkWidget *widget)
GSList *tmp_list;
text_view = GTK_TEXT_VIEW (widget);
GTK_WIDGET_SET_FLAGS (text_view, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
......
......@@ -813,7 +813,7 @@ gtk_toolbar_realize (GtkWidget *widget)
gint attributes_mask;
gint border_width;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
border_width = GTK_CONTAINER (widget)->border_width;
......
......@@ -462,7 +462,7 @@ gtk_tool_item_realize (GtkWidget *widget)
GtkToolItem *toolitem;
toolitem = GTK_TOOL_ITEM (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
widget->window = gtk_widget_get_parent_window (widget);
g_object_ref (widget->window);
......
......@@ -1181,7 +1181,7 @@ gtk_tool_item_group_realize (GtkWidget *widget)
gdk_window_set_user_data (widget->window, widget);
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
gtk_container_forall (GTK_CONTAINER (widget),
(GtkCallback) gtk_widget_set_parent_window,
......
......@@ -672,7 +672,7 @@ gtk_tool_palette_realize (GtkWidget *widget)
gdk_window_set_user_data (widget->window, widget);
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
gtk_container_forall (GTK_CONTAINER (widget),
(GtkCallback) gtk_widget_set_parent_window,
......
......@@ -560,7 +560,7 @@ gtk_tree_realize (GtkWidget *widget)
g_return_if_fail (GTK_IS_TREE (widget));
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
......
......@@ -1767,7 +1767,7 @@ gtk_tree_view_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
/* Make the main, clipping window */
attributes.window_type = GDK_WINDOW_CHILD;
......
......@@ -588,7 +588,7 @@ gtk_viewport_realize (GtkWidget *widget)
gint attributes_mask;
gint event_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.x = widget->allocation.x + border_width;
attributes.y = widget->allocation.y + border_width;
......
......@@ -5989,9 +5989,9 @@ gtk_widget_set_realized (GtkWidget *widget,
g_return_if_fail (GTK_IS_WIDGET (widget));
if (realized)
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
GTK_OBJECT_FLAGS (widget) |= GTK_REALIZED;
else
GTK_WIDGET_UNSET_FLAGS (widget, GTK_REALIZED);
GTK_OBJECT_FLAGS (widget) &= ~(GTK_REALIZED);
}
/**
......@@ -8793,7 +8793,7 @@ gtk_widget_real_realize (GtkWidget *widget)
{
g_assert (!gtk_widget_get_has_window (widget));
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
if (widget->parent)
{
widget->window = gtk_widget_get_parent_window (widget);
......@@ -8847,7 +8847,7 @@ gtk_widget_real_unrealize (GtkWidget *widget)
gtk_selection_remove_all (widget);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, FALSE);
}
static void
......
......@@ -200,7 +200,7 @@ gtk_win32_embed_widget_realize (GtkWidget *widget)
g_return_if_fail (!gtk_widget_get_realized (widget));
}
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.title = window->title;
......
......@@ -4742,7 +4742,7 @@ gtk_window_realize (GtkWidget *widget)
g_return_if_fail (!gtk_widget_get_realized (widget));
}
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
switch (window->type)
{
......
......@@ -238,7 +238,7 @@ gtk_offscreen_box_realize (GtkWidget *widget)
GtkRequisition child_requisition;
int start_y = 0;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
border_width = GTK_CONTAINER (widget)->border_width;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment