[gtk+] Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_MAPPED)



commit 74ed719fa4e005ca2134489eb3cc1206e00018ee
Author: Javier Jardón <jjardon gnome org>
Date:   Sat Mar 6 12:02:21 2010 +0100

    Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_MAPPED)
    
    Use new API instead: gtk_widget_set_mapped ()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=69872

 gtk/gtkassistant.c        |    4 ++--
 gtk/gtkclist.c            |    6 +++---
 gtk/gtkcontainer.c        |    4 ++--
 gtk/gtkhandlebox.c        |    4 ++--
 gtk/gtklayout.c           |    2 +-
 gtk/gtklist.c             |    2 +-
 gtk/gtknotebook.c         |    4 ++--
 gtk/gtkplug.c             |    4 ++--
 gtk/gtktree.c             |    4 ++--
 gtk/gtktreeitem.c         |    4 ++--
 gtk/gtktreeview.c         |    2 +-
 gtk/gtkwidget.c           |   13 +++++++------
 gtk/gtkwin32embedwidget.c |    4 ++--
 gtk/gtkwindow.c           |    4 ++--
 14 files changed, 31 insertions(+), 30 deletions(-)
---
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index f6feb38..1e2c3ce 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -1235,7 +1235,7 @@ gtk_assistant_map (GtkWidget *widget)
   GList *page_node;
   GtkAssistantPage *page;
 
-  GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, TRUE);
 
   gtk_widget_map (priv->header_image);
   gtk_widget_map (priv->action_area);
@@ -1271,7 +1271,7 @@ gtk_assistant_unmap (GtkWidget *widget)
   GtkAssistant *assistant = GTK_ASSISTANT (widget);
   GtkAssistantPrivate *priv = assistant->priv;
 
-  GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, FALSE);
 
   gtk_widget_unmap (priv->header_image);
   gtk_widget_unmap (priv->action_area);
diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c
index 08216ae..eb37434 100644
--- a/gtk/gtkclist.c
+++ b/gtk/gtkclist.c
@@ -4618,7 +4618,7 @@ gtk_clist_unrealize (GtkWidget *widget)
   if (gtk_widget_get_mapped (widget))
     gtk_clist_unmap (widget);
 
-  GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, FALSE);
 
   /* detach optional row/cell styles */
   if (gtk_widget_get_realized (widget))
@@ -4686,7 +4686,7 @@ gtk_clist_map (GtkWidget *widget)
 
   if (!gtk_widget_get_mapped (widget))
     {
-      GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+      gtk_widget_set_mapped (widget, TRUE);
 
       /* map column buttons */
       for (i = 0; i < clist->columns; i++)
@@ -4725,7 +4725,7 @@ gtk_clist_unmap (GtkWidget *widget)
 
   if (gtk_widget_get_mapped (widget))
     {
-      GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+      gtk_widget_set_mapped (widget, FALSE);
 
       if (clist_has_grab (clist))
 	{
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index c7f429d..6bedc86 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -2665,7 +2665,7 @@ gtk_container_map_child (GtkWidget *child,
 static void
 gtk_container_map (GtkWidget *widget)
 {
-  GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, TRUE);
 
   gtk_container_forall (GTK_CONTAINER (widget),
 			gtk_container_map_child,
@@ -2678,7 +2678,7 @@ gtk_container_map (GtkWidget *widget)
 static void
 gtk_container_unmap (GtkWidget *widget)
 {
-  GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, FALSE);
 
   if (gtk_widget_get_has_window (widget))
     gdk_window_hide (widget->window);
diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c
index b3e12d3..25d61aa 100644
--- a/gtk/gtkhandlebox.c
+++ b/gtk/gtkhandlebox.c
@@ -348,7 +348,7 @@ gtk_handle_box_map (GtkWidget *widget)
   GtkBin *bin;
   GtkHandleBox *hb;
 
-  GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, TRUE);
 
   bin = GTK_BIN (widget);
   hb = GTK_HANDLE_BOX (widget);
@@ -373,7 +373,7 @@ gtk_handle_box_unmap (GtkWidget *widget)
 {
   GtkHandleBox *hb;
 
-  GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, FALSE);
 
   hb = GTK_HANDLE_BOX (widget);
 
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c
index be7917b..7e3e0b9 100644
--- a/gtk/gtklayout.c
+++ b/gtk/gtklayout.c
@@ -908,7 +908,7 @@ gtk_layout_map (GtkWidget *widget)
   GtkLayout *layout = GTK_LAYOUT (widget);
   GList *tmp_list;
 
-  GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, TRUE);
 
   tmp_list = layout->children;
   while (tmp_list)
diff --git a/gtk/gtklist.c b/gtk/gtklist.c
index 29a0c63..b792e48 100644
--- a/gtk/gtklist.c
+++ b/gtk/gtklist.c
@@ -490,7 +490,7 @@ gtk_list_unmap (GtkWidget *widget)
   if (!gtk_widget_get_mapped (widget))
     return;
 
-  GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, FALSE);
 
   if (list_has_grab (list))
     {
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index a8e99db..aa42268 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -1736,7 +1736,7 @@ gtk_notebook_map (GtkWidget *widget)
   GList *children;
   gint i;
 
-  GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, TRUE);
 
   notebook = GTK_NOTEBOOK (widget);
   priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
@@ -1782,7 +1782,7 @@ gtk_notebook_unmap (GtkWidget *widget)
 {
   stop_scrolling (GTK_NOTEBOOK (widget));
   
-  GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, FALSE);
 
   gdk_window_hide (GTK_NOTEBOOK (widget)->event_window);
 
diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c
index 8de5b2f..52d2b92 100644
--- a/gtk/gtkplug.c
+++ b/gtk/gtkplug.c
@@ -708,7 +708,7 @@ gtk_plug_map (GtkWidget *widget)
       GtkBin *bin = GTK_BIN (widget);
       GtkPlug *plug = GTK_PLUG (widget);
       
-      GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+      gtk_widget_set_mapped (widget, TRUE);
 
       if (bin->child &&
 	  gtk_widget_get_visible (bin->child) &&
@@ -732,7 +732,7 @@ gtk_plug_unmap (GtkWidget *widget)
     {
       GtkPlug *plug = GTK_PLUG (widget);
 
-      GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+      gtk_widget_set_mapped (widget, FALSE);
 
       gdk_window_hide (widget->window);
 
diff --git a/gtk/gtktree.c b/gtk/gtktree.c
index 1ac137a..7d842c1 100644
--- a/gtk/gtktree.c
+++ b/gtk/gtktree.c
@@ -513,7 +513,7 @@ gtk_tree_map (GtkWidget *widget)
   GtkWidget *child;
   GList *children;
   
-  GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, TRUE);
   
   children = tree->children;
   while (children)
@@ -948,7 +948,7 @@ gtk_tree_unmap (GtkWidget *widget)
   
   g_return_if_fail (GTK_IS_TREE (widget));
   
-  GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, FALSE);
   gdk_window_hide (widget->window);
   
 }
diff --git a/gtk/gtktreeitem.c b/gtk/gtktreeitem.c
index e86cbfa..8ea6c5c 100644
--- a/gtk/gtktreeitem.c
+++ b/gtk/gtktreeitem.c
@@ -943,7 +943,7 @@ gtk_tree_item_map (GtkWidget *widget)
   GtkBin *bin = GTK_BIN (widget);
   GtkTreeItem* item = GTK_TREE_ITEM(widget);
 
-  GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, TRUE);
 
   if(item->pixmaps_box &&
      gtk_widget_get_visible (item->pixmaps_box) &&
@@ -964,7 +964,7 @@ gtk_tree_item_unmap (GtkWidget *widget)
   GtkBin *bin = GTK_BIN (widget);
   GtkTreeItem* item = GTK_TREE_ITEM(widget);
 
-  GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, FALSE);
 
   gdk_window_hide (widget->window);
 
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index f11f6f2..0053d95 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -1738,7 +1738,7 @@ gtk_tree_view_map (GtkWidget *widget)
   GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
   GList *tmp_list;
 
-  GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, TRUE);
 
   tmp_list = tree_view->priv->children;
   while (tmp_list)
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 275f06e..b7b0b5e 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3551,7 +3551,8 @@ gtk_widget_unrealize (GtkWidget *widget)
       g_object_ref (widget);
       _gtk_tooltip_hide (widget);
       g_signal_emit (widget, widget_signals[UNREALIZE], 0);
-      GTK_WIDGET_UNSET_FLAGS (widget, GTK_REALIZED | GTK_MAPPED);
+      gtk_widget_set_realized (widget, FALSE);
+      gtk_widget_set_mapped (widget, FALSE);
       g_object_unref (widget);
     }
 }
@@ -6031,9 +6032,9 @@ gtk_widget_set_mapped (GtkWidget *widget,
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
   if (mapped)
-    GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+    GTK_OBJECT_FLAGS (widget) |= GTK_MAPPED;
   else
-    GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+    GTK_OBJECT_FLAGS (widget) &= ~(GTK_MAPPED);
 }
 
 /**
@@ -8753,7 +8754,7 @@ gtk_widget_real_map (GtkWidget *widget)
   
   if (!gtk_widget_get_mapped (widget))
     {
-      GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+      gtk_widget_set_mapped (widget, TRUE);
       
       if (gtk_widget_get_has_window (widget))
 	gdk_window_show (widget->window);
@@ -8773,7 +8774,7 @@ gtk_widget_real_unmap (GtkWidget *widget)
 {
   if (gtk_widget_get_mapped (widget))
     {
-      GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+      gtk_widget_set_mapped (widget, FALSE);
 
       if (gtk_widget_get_has_window (widget))
 	gdk_window_hide (widget->window);
@@ -8816,7 +8817,7 @@ gtk_widget_real_unrealize (GtkWidget *widget)
   if (gtk_widget_get_mapped (widget))
     gtk_widget_real_unmap (widget);
 
-  GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, FALSE);
 
   /* printf ("unrealizing %s\n", g_type_name (G_TYPE_FROM_INSTANCE (widget)));
    */
diff --git a/gtk/gtkwin32embedwidget.c b/gtk/gtkwin32embedwidget.c
index e710a8b..2e1a6b1 100644
--- a/gtk/gtkwin32embedwidget.c
+++ b/gtk/gtkwin32embedwidget.c
@@ -267,7 +267,7 @@ gtk_win32_embed_widget_map (GtkWidget *widget)
 {
   GtkBin *bin = GTK_BIN (widget);
   
-  GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, TRUE);
   
   if (bin->child &&
       gtk_widget_get_visible (bin->child) &&
@@ -280,7 +280,7 @@ gtk_win32_embed_widget_map (GtkWidget *widget)
 static void
 gtk_win32_embed_widget_unmap (GtkWidget *widget)
 {
-  GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, FALSE);
   gdk_window_hide (widget->window);
 }
 
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 577f672..778c471 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4567,7 +4567,7 @@ gtk_window_map (GtkWidget *widget)
   GdkWindow *toplevel;
   gboolean auto_mnemonics;
 
-  GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, TRUE);
 
   if (window->bin.child &&
       gtk_widget_get_visible (window->bin.child) &&
@@ -4677,7 +4677,7 @@ gtk_window_unmap (GtkWidget *widget)
   GtkWindowGeometryInfo *info;    
   GdkWindowState state;
 
-  GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, FALSE);
   if (window->frame)
     gdk_window_withdraw (window->frame);
   else 



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