Commit f8bbea40 authored by Javier Jardón's avatar Javier Jardón
Browse files

Use accessor functions instead direct access. Third patch

Substitute GTK_WIDGET_REALIZED() and GTK_WIDGET_MAPPED()

https://bugzilla.gnome.org/show_bug.cgi?id=594957
parent 82f055a7
......@@ -41,7 +41,7 @@ set_cursor_recurse (GtkWidget *widget,
GList *children, *list;
if (!gtk_widget_get_visible (widget) ||
!GTK_WIDGET_REALIZED (widget))
!gtk_widget_get_realized (widget))
return;
gdk_window_set_cursor (gtk_widget_get_window (widget), gdk_cursor);
......
......@@ -113,7 +113,7 @@ glade_custom_realize (GtkWidget *widget)
custom = GLADE_CUSTOM (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
gtk_widget_get_allocation (widget, &allocation);
......@@ -156,7 +156,7 @@ glade_custom_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
gtk_widget_set_allocation (widget, allocation);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (gtk_widget_get_window (widget),
allocation->x, allocation->y,
......
......@@ -244,7 +244,7 @@ glade_design_layout_find_inside_container (GtkWidget *widget, GladeFindInContain
gtk_widget_translate_coordinates (data->toplevel, widget, data->x, data->y, &x, &y);
gtk_widget_get_allocation (widget, &allocation);
if (GTK_WIDGET_MAPPED(widget) &&
if (gtk_widget_get_mapped(widget) &&
x >= 0 && x < allocation.width && y >= 0 && y < allocation.height)
{
if (glade_widget_get_from_gobject (widget) || data->any)
......@@ -546,7 +546,7 @@ glade_design_layout_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
gtk_widget_set_allocation (widget, allocation);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (priv->event_window)
gdk_window_move_resize (priv->event_window,
......@@ -625,7 +625,7 @@ glade_design_layout_realize (GtkWidget *widget)
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
......
......@@ -259,7 +259,7 @@ eprop_item_label_size_allocate_after (GtkWidget *widget, GtkAllocation *allocati
gint width = EDITOR_COLUMN_SIZE;
gint icon_width = 0;
if (gtk_widget_get_visible (eprop->warning) && GTK_WIDGET_MAPPED (eprop->warning))
if (gtk_widget_get_visible (eprop->warning) && gtk_widget_get_mapped (eprop->warning))
{
GtkRequisition req = { -1, -1 };
gtk_widget_size_request (eprop->warning, &req);
......
......@@ -99,7 +99,7 @@ glade_editor_table_grab_focus (GtkWidget *widget)
{
GladeEditorTable *editor_table = GLADE_EDITOR_TABLE (widget);
if (editor_table->name_entry && GTK_WIDGET_MAPPED (editor_table->name_entry))
if (editor_table->name_entry && gtk_widget_get_mapped (editor_table->name_entry))
gtk_widget_grab_focus (editor_table->name_entry);
else if (editor_table->properties)
gtk_widget_grab_focus (GTK_WIDGET (editor_table->properties->data));
......@@ -113,7 +113,7 @@ widget_name_changed (GladeWidget *widget,
GParamSpec *pspec,
GladeEditorTable *table)
{
if (!GTK_WIDGET_MAPPED (table))
if (!gtk_widget_get_mapped (GTK_WIDGET (table)))
return;
table->loading = TRUE;
......
......@@ -442,7 +442,7 @@ set_busy_cursor (GladeNamedIconChooserDialog *dialog,
GdkDisplay *display;
GdkCursor *cursor;
if (!GTK_WIDGET_REALIZED (dialog))
if (!gtk_widget_get_realized (GTK_WIDGET (dialog)))
return;
display = gtk_widget_get_display (GTK_WIDGET (dialog));
......@@ -820,7 +820,7 @@ centre_selected_row (GladeNamedIconChooserDialog *dialog)
l = gtk_tree_selection_get_selected_rows (dialog->priv->selection, NULL);
if (l) {
g_assert (GTK_WIDGET_MAPPED (dialog));
g_assert (gtk_widget_get_mapped (GTK_WIDGET (dialog)));
g_assert (gtk_widget_get_visible (GTK_WIDGET (dialog)));
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (dialog->priv->icons_view),
......@@ -1042,7 +1042,7 @@ glade_named_icon_chooser_dialog_screen_changed (GtkWidget *widget,
if (GTK_WIDGET_CLASS (glade_named_icon_chooser_dialog_parent_class)->screen_changed)
GTK_WIDGET_CLASS (glade_named_icon_chooser_dialog_parent_class)->screen_changed (widget, previous_screen);
if (GTK_WIDGET_MAPPED (widget))
if (gtk_widget_get_mapped (widget))
change_icon_theme (dialog);
}
......@@ -1162,7 +1162,7 @@ static void
glade_named_icon_chooser_dialog_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
if (gtk_widget_has_screen (widget) && GTK_WIDGET_MAPPED (widget))
if (gtk_widget_has_screen (widget) && gtk_widget_get_mapped (widget))
change_icon_theme (GLADE_NAMED_ICON_CHOOSER_DIALOG (widget));
}
......
......@@ -187,7 +187,7 @@ glade_placeholder_realize (GtkWidget *widget)
placeholder = GLADE_PLACEHOLDER (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
gtk_widget_get_allocation (widget, &allocation);
......@@ -234,7 +234,7 @@ glade_placeholder_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
gtk_widget_set_allocation (widget, allocation);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (gtk_widget_get_window (widget),
allocation->x, allocation->y,
......
......@@ -1703,7 +1703,7 @@ glade_util_get_placeholder_from_pointer (GtkContainer *container)
child = l->data;
if (GLADE_IS_PLACEHOLDER (child) &&
GTK_WIDGET_MAPPED (child))
gtk_widget_get_mapped (child))
{
gtk_widget_translate_coordinates (toplevel, child,
x, y, &x2, &y2);
......
......@@ -1977,7 +1977,7 @@ glade_widget_show (GladeWidget *widget)
if (!layout)
return;
if (GTK_WIDGET_REALIZED (layout))
if (gtk_widget_get_realized (layout))
glade_widget_add_to_layout (widget, layout);
else
g_signal_connect_data (G_OBJECT (layout), "map",
......@@ -4208,7 +4208,7 @@ embedded_window_realize_handler (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.wclass = GDK_INPUT_OUTPUT;
......@@ -4257,7 +4257,7 @@ embedded_window_size_allocate_handler (GtkWidget *widget)
{
GtkAllocation allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gtk_widget_get_allocation (widget, &allocation);
gdk_window_move_resize (gtk_widget_get_window (widget),
......@@ -4288,7 +4288,7 @@ glade_widget_embed (GladeWidget *gwidget)
if (glade_window_is_embedded (window)) return TRUE;
if (GTK_WIDGET_REALIZED (widget)) gtk_widget_unrealize (widget);
if (gtk_widget_get_realized (widget)) gtk_widget_unrealize (widget);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_TOPLEVEL);
gtk_container_set_resize_mode (GTK_CONTAINER (window), GTK_RESIZE_PARENT);
......
......@@ -62,7 +62,7 @@ project_changed (GladeProject *project,
GladeActivatableEditor *activatable_editor)
{
if (activatable_editor->modifying ||
!GTK_WIDGET_MAPPED (activatable_editor))
!gtk_widget_get_mapped (GTK_WIDGET (activatable_editor)))
return;
/* Reload on all commands */
......
......@@ -62,7 +62,7 @@ project_changed (GladeProject *project,
GladeButtonEditor *button_editor)
{
if (button_editor->modifying ||
!GTK_WIDGET_MAPPED (button_editor))
!gtk_widget_get_mapped (GTK_WIDGET (button_editor)))
return;
/* Reload on all commands */
......
......@@ -77,7 +77,7 @@ project_changed (GladeProject *project,
GladeCellRendererEditor *renderer_editor)
{
if (renderer_editor->modifying ||
!GTK_WIDGET_MAPPED (renderer_editor))
!gtk_widget_get_mapped (GTK_WIDGET (renderer_editor)))
return;
/* Reload on all commands */
......
......@@ -63,7 +63,7 @@ project_changed (GladeProject *project,
GladeEntryEditor *entry_editor)
{
if (entry_editor->modifying ||
!GTK_WIDGET_MAPPED (entry_editor))
!gtk_widget_get_mapped (GTK_WIDGET (entry_editor)))
return;
/* Reload on all commands */
......
......@@ -61,7 +61,7 @@ project_changed (GladeProject *project,
gboolean execute,
GladeIconFactoryEditor *factory_editor)
{
if (!GTK_WIDGET_MAPPED (factory_editor))
if (!gtk_widget_get_mapped (GTK_WIDGET (factory_editor)))
return;
/* Reload on all commands */
......
......@@ -62,7 +62,7 @@ project_changed (GladeProject *project,
GladeImageEditor *image_editor)
{
if (image_editor->modifying ||
!GTK_WIDGET_MAPPED (image_editor))
!gtk_widget_get_mapped (GTK_WIDGET (image_editor)))
return;
/* Reload on all commands */
......
......@@ -62,7 +62,7 @@ project_changed (GladeProject *project,
GladeImageItemEditor *item_editor)
{
if (item_editor->modifying ||
!GTK_WIDGET_MAPPED (item_editor))
!gtk_widget_get_mapped (GTK_WIDGET (item_editor)))
return;
/* Reload on all commands */
......
......@@ -65,7 +65,7 @@ project_changed (GladeProject *project,
GladeLabelEditor *label_editor)
{
if (label_editor->modifying ||
!GTK_WIDGET_MAPPED (label_editor))
!gtk_widget_get_mapped (GTK_WIDGET (label_editor)))
return;
/* Reload on all commands */
......
......@@ -61,7 +61,7 @@ project_changed (GladeProject *project,
gboolean execute,
GladeStoreEditor *store_editor)
{
if (!GTK_WIDGET_MAPPED (store_editor))
if (!gtk_widget_get_mapped (GTK_WIDGET (store_editor)))
return;
/* Reload on all commands */
......
......@@ -62,7 +62,7 @@ project_changed (GladeProject *project,
GladeToolButtonEditor *button_editor)
{
if (button_editor->modifying ||
!GTK_WIDGET_MAPPED (button_editor))
!gtk_widget_get_mapped (GTK_WIDGET (button_editor)))
return;
/* Reload on all commands */
......
......@@ -63,7 +63,7 @@ project_changed (GladeProject *project,
gboolean execute,
GladeTreeViewEditor *view_editor)
{
if (!GTK_WIDGET_MAPPED (view_editor))
if (!gtk_widget_get_mapped (GTK_WIDGET (view_editor)))
return;
/* Reload on all commands */
......
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