[glade3] Use accessor functions instead direct access. Third patch



commit f8bbea40f05850a40ebecd2d38378c59acc444e8
Author: Javier Jardón <jjardon gnome org>
Date:   Thu Feb 11 01:07:48 2010 +0100

    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

 gladeui/glade-cursor.c                    |    2 +-
 gladeui/glade-custom.c                    |    4 ++--
 gladeui/glade-design-layout.c             |    6 +++---
 gladeui/glade-editor-property.c           |    2 +-
 gladeui/glade-editor-table.c              |    4 ++--
 gladeui/glade-named-icon-chooser-dialog.c |    8 ++++----
 gladeui/glade-placeholder.c               |    4 ++--
 gladeui/glade-utils.c                     |    2 +-
 gladeui/glade-widget.c                    |    8 ++++----
 plugins/gtk+/glade-activatable-editor.c   |    2 +-
 plugins/gtk+/glade-button-editor.c        |    2 +-
 plugins/gtk+/glade-cell-renderer-editor.c |    2 +-
 plugins/gtk+/glade-entry-editor.c         |    2 +-
 plugins/gtk+/glade-icon-factory-editor.c  |    2 +-
 plugins/gtk+/glade-image-editor.c         |    2 +-
 plugins/gtk+/glade-image-item-editor.c    |    2 +-
 plugins/gtk+/glade-label-editor.c         |    2 +-
 plugins/gtk+/glade-store-editor.c         |    2 +-
 plugins/gtk+/glade-tool-button-editor.c   |    2 +-
 plugins/gtk+/glade-treeview-editor.c      |    2 +-
 20 files changed, 31 insertions(+), 31 deletions(-)
---
diff --git a/gladeui/glade-cursor.c b/gladeui/glade-cursor.c
index f3b61e4..21587b4 100644
--- a/gladeui/glade-cursor.c
+++ b/gladeui/glade-cursor.c
@@ -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);
diff --git a/gladeui/glade-custom.c b/gladeui/glade-custom.c
index bf93436..ffafa2f 100644
--- a/gladeui/glade-custom.c
+++ b/gladeui/glade-custom.c
@@ -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,
diff --git a/gladeui/glade-design-layout.c b/gladeui/glade-design-layout.c
index 731af8f..d18900d 100644
--- a/gladeui/glade-design-layout.c
+++ b/gladeui/glade-design-layout.c
@@ -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));
 
diff --git a/gladeui/glade-editor-property.c b/gladeui/glade-editor-property.c
index b19e313..ebd611e 100644
--- a/gladeui/glade-editor-property.c
+++ b/gladeui/glade-editor-property.c
@@ -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);
diff --git a/gladeui/glade-editor-table.c b/gladeui/glade-editor-table.c
index 96932d0..5d12478 100644
--- a/gladeui/glade-editor-table.c
+++ b/gladeui/glade-editor-table.c
@@ -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;
diff --git a/gladeui/glade-named-icon-chooser-dialog.c b/gladeui/glade-named-icon-chooser-dialog.c
index 5244a13..4869bc7 100644
--- a/gladeui/glade-named-icon-chooser-dialog.c
+++ b/gladeui/glade-named-icon-chooser-dialog.c
@@ -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));
 }
 
diff --git a/gladeui/glade-placeholder.c b/gladeui/glade-placeholder.c
index 49caa96..a902e7a 100644
--- a/gladeui/glade-placeholder.c
+++ b/gladeui/glade-placeholder.c
@@ -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,
diff --git a/gladeui/glade-utils.c b/gladeui/glade-utils.c
index fc4454f..f4e0f25 100644
--- a/gladeui/glade-utils.c
+++ b/gladeui/glade-utils.c
@@ -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);
diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c
index c3dfe5a..67c48ac 100644
--- a/gladeui/glade-widget.c
+++ b/gladeui/glade-widget.c
@@ -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);
diff --git a/plugins/gtk+/glade-activatable-editor.c b/plugins/gtk+/glade-activatable-editor.c
index 30d48bb..f4a55fa 100644
--- a/plugins/gtk+/glade-activatable-editor.c
+++ b/plugins/gtk+/glade-activatable-editor.c
@@ -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 */
diff --git a/plugins/gtk+/glade-button-editor.c b/plugins/gtk+/glade-button-editor.c
index 1f27f7d..a9cb991 100644
--- a/plugins/gtk+/glade-button-editor.c
+++ b/plugins/gtk+/glade-button-editor.c
@@ -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 */
diff --git a/plugins/gtk+/glade-cell-renderer-editor.c b/plugins/gtk+/glade-cell-renderer-editor.c
index 7059dd1..dca3491 100644
--- a/plugins/gtk+/glade-cell-renderer-editor.c
+++ b/plugins/gtk+/glade-cell-renderer-editor.c
@@ -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 */
diff --git a/plugins/gtk+/glade-entry-editor.c b/plugins/gtk+/glade-entry-editor.c
index e9bb1f9..bbd9589 100644
--- a/plugins/gtk+/glade-entry-editor.c
+++ b/plugins/gtk+/glade-entry-editor.c
@@ -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 */
diff --git a/plugins/gtk+/glade-icon-factory-editor.c b/plugins/gtk+/glade-icon-factory-editor.c
index 2fcedd7..222bf02 100644
--- a/plugins/gtk+/glade-icon-factory-editor.c
+++ b/plugins/gtk+/glade-icon-factory-editor.c
@@ -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 */
diff --git a/plugins/gtk+/glade-image-editor.c b/plugins/gtk+/glade-image-editor.c
index 75f3a05..b365656 100644
--- a/plugins/gtk+/glade-image-editor.c
+++ b/plugins/gtk+/glade-image-editor.c
@@ -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 */
diff --git a/plugins/gtk+/glade-image-item-editor.c b/plugins/gtk+/glade-image-item-editor.c
index 5fef335..2482c30 100644
--- a/plugins/gtk+/glade-image-item-editor.c
+++ b/plugins/gtk+/glade-image-item-editor.c
@@ -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 */
diff --git a/plugins/gtk+/glade-label-editor.c b/plugins/gtk+/glade-label-editor.c
index ccc5d18..9837c28 100644
--- a/plugins/gtk+/glade-label-editor.c
+++ b/plugins/gtk+/glade-label-editor.c
@@ -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 */
diff --git a/plugins/gtk+/glade-store-editor.c b/plugins/gtk+/glade-store-editor.c
index d27ef60..1c601cd 100644
--- a/plugins/gtk+/glade-store-editor.c
+++ b/plugins/gtk+/glade-store-editor.c
@@ -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 */
diff --git a/plugins/gtk+/glade-tool-button-editor.c b/plugins/gtk+/glade-tool-button-editor.c
index 5159364..f89f356 100644
--- a/plugins/gtk+/glade-tool-button-editor.c
+++ b/plugins/gtk+/glade-tool-button-editor.c
@@ -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 */
diff --git a/plugins/gtk+/glade-treeview-editor.c b/plugins/gtk+/glade-treeview-editor.c
index 79297d1..cfcb96e 100644
--- a/plugins/gtk+/glade-treeview-editor.c
+++ b/plugins/gtk+/glade-treeview-editor.c
@@ -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 */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]