[gtk+] Deprecate widget flag: GTK_WIDGET_SENSITIVE



commit 64f526d34e1adc609944078e2fea38b2792f8230
Author: Javier Jardón <jjardon gnome org>
Date:   Mon Mar 1 05:58:37 2010 +0100

    Deprecate widget flag: GTK_WIDGET_SENSITIVE
    
    Use gtk_widget_get_sensitive() instead
    
    https://bugzilla.gnome.org/show_bug.cgi?id=69872

 gtk/gtkassistant.c                  |    2 +-
 gtk/gtkbutton.c                     |    2 +-
 gtk/gtkclist.c                      |    2 +-
 gtk/gtkcombobox.c                   |    2 +-
 gtk/gtkdnd-quartz.c                 |    2 +-
 gtk/gtkdnd.c                        |    2 +-
 gtk/gtkentry.c                      |    6 +++---
 gtk/gtkfilechooserdefault.c         |    2 +-
 gtk/gtkfontsel.c                    |    2 +-
 gtk/gtkoptionmenu.c                 |    4 ++--
 gtk/gtkpaned.c                      |    2 +-
 gtk/gtktoolitem.c                   |    4 ++--
 gtk/gtkwidget.c                     |    6 +++---
 gtk/gtkwidget.h                     |    2 ++
 modules/other/gail/gailcombo.c      |    4 ++--
 modules/other/gail/gailcombobox.c   |    4 ++--
 modules/other/gail/gailentry.c      |    4 ++--
 modules/other/gail/gailmenuitem.c   |    4 ++--
 modules/other/gail/gailoptionmenu.c |    4 ++--
 modules/other/gail/gailrange.c      |    4 ++--
 modules/other/gail/gailwidget.c     |    2 +-
 21 files changed, 34 insertions(+), 32 deletions(-)
---
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index a1a6365..33c54a0 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -599,7 +599,7 @@ set_current_page (GtkAssistant     *assistant,
       button[5] = assistant->last;
       for (i = 0; i < 6; i++)
         {
-          if (GTK_WIDGET_VISIBLE (button[i]) && GTK_WIDGET_SENSITIVE (button[i]))
+          if (GTK_WIDGET_VISIBLE (button[i]) && gtk_widget_get_sensitive (button[i]))
             {
               gtk_widget_grab_focus (button[i]);
               break;
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index d2b56d0..6862b18 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -1691,7 +1691,7 @@ gtk_button_leave_notify (GtkWidget        *widget,
 
   if ((event_widget == widget) &&
       (event->detail != GDK_NOTIFY_INFERIOR) &&
-      (GTK_WIDGET_SENSITIVE (event_widget)))
+      (gtk_widget_get_sensitive (event_widget)))
     {
       button->in_button = FALSE;
       gtk_button_leave (button);
diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c
index 765df57..2e8c14e 100644
--- a/gtk/gtkclist.c
+++ b/gtk/gtkclist.c
@@ -986,7 +986,7 @@ gtk_clist_get_arg (GtkObject      *object,
       GTK_VALUE_BOOL (*arg) = TRUE;
       for (i = 0; i < clist->columns; i++)
 	if (clist->column[i].button &&
-	    !GTK_WIDGET_SENSITIVE (clist->column[i].button))
+	    !gtk_widget_get_sensitive (clist->column[i].button))
 	  {
 	    GTK_VALUE_BOOL (*arg) = FALSE;
 	    break;
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 26da1cd..f4427bf 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -1120,7 +1120,7 @@ gtk_combo_box_button_state_changed (GtkWidget    *widget,
 	{
 	  if ((GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE) !=
 	      (GTK_WIDGET_STATE (priv->cell_view) == GTK_STATE_INSENSITIVE))
-	    gtk_widget_set_sensitive (priv->cell_view, GTK_WIDGET_SENSITIVE (widget));
+	    gtk_widget_set_sensitive (priv->cell_view, gtk_widget_get_sensitive (widget));
 	  
 	  gtk_widget_set_state (priv->cell_view, 
 				GTK_WIDGET_STATE (widget));
diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c
index 3d5a643..fe06230 100644
--- a/gtk/gtkdnd-quartz.c
+++ b/gtk/gtkdnd-quartz.c
@@ -667,7 +667,7 @@ gtk_drag_find_widget (GtkWidget       *widget,
   gint x_offset = 0;
   gint y_offset = 0;
 
-  if (data->found || !GTK_WIDGET_MAPPED (widget) || !GTK_WIDGET_SENSITIVE (widget))
+  if (data->found || !GTK_WIDGET_MAPPED (widget) || !gtk_widget_get_sensitive (widget))
     return;
 
   /* Note that in the following code, we only count the
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 8146cdd..c256b0e 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -1844,7 +1844,7 @@ gtk_drag_find_widget (GtkWidget       *widget,
   gint x_offset = 0;
   gint y_offset = 0;
 
-  if (data->found || !GTK_WIDGET_MAPPED (widget) || !GTK_WIDGET_SENSITIVE (widget))
+  if (data->found || !GTK_WIDGET_MAPPED (widget) || !gtk_widget_get_sensitive (widget))
     return;
 
   /* Note that in the following code, we only count the
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 58a5670..2d53876 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3430,7 +3430,7 @@ gtk_entry_draw_progress (GtkWidget      *widget,
     }
 
   state = GTK_STATE_SELECTED;
-  if (!GTK_WIDGET_SENSITIVE (widget))
+  if (!gtk_widget_get_sensitive (widget))
     state = GTK_STATE_INSENSITIVE;
 
   gtk_paint_box (widget->style, event->window,
@@ -5139,7 +5139,7 @@ gtk_entry_real_activate (GtkEntry *entry)
 	  if (window &&
 	      widget != window->default_widget &&
 	      !(widget == window->focus_widget &&
-		(!window->default_widget || !GTK_WIDGET_SENSITIVE (window->default_widget))))
+		(!window->default_widget || !gtk_widget_get_sensitive (window->default_widget))))
 	    gtk_window_activate_default (window);
 	}
     }
@@ -5588,7 +5588,7 @@ gtk_entry_draw_text (GtkEntry *entry)
       GtkStateType state;
 
       state = GTK_STATE_SELECTED;
-      if (!GTK_WIDGET_SENSITIVE (widget))
+      if (!gtk_widget_get_sensitive (widget))
         state = GTK_STATE_INSENSITIVE;
       text_color = widget->style->text[widget->state];
       bar_text_color = widget->style->fg[state];
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 3f634d3..f97c01e 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -3971,7 +3971,7 @@ browse_files_key_press_event_cb (GtkWidget   *widget,
       if (window
 	  && widget != window->default_widget
 	  && !(widget == window->focus_widget &&
-	       (!window->default_widget || !GTK_WIDGET_SENSITIVE (window->default_widget))))
+	       (!window->default_widget || !gtk_widget_get_sensitive (window->default_widget))))
 	{
 	  gtk_window_activate_default (window);
 	  return TRUE;
diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c
index 0dca0a7..3eb3d45 100644
--- a/gtk/gtkfontsel.c
+++ b/gtk/gtkfontsel.c
@@ -279,7 +279,7 @@ list_row_activated (GtkWidget *widget)
   if (window
       && widget != window->default_widget
       && !(widget == window->focus_widget &&
-	   (!window->default_widget || !GTK_WIDGET_SENSITIVE (window->default_widget))))
+	   (!window->default_widget || !gtk_widget_get_sensitive (window->default_widget))))
     {
       gtk_window_activate_default (window);
     }
diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c
index 7af0c7c..c1b9ed7 100644
--- a/gtk/gtkoptionmenu.c
+++ b/gtk/gtkoptionmenu.c
@@ -710,7 +710,7 @@ gtk_option_menu_select_first_sensitive (GtkOptionMenu *option_menu)
 
       while (children)
 	{
-	  if (GTK_WIDGET_SENSITIVE (children->data))
+	  if (gtk_widget_get_sensitive (children->data))
 	    {
 	      gtk_option_menu_set_history (option_menu, index);
 	      return;
@@ -729,7 +729,7 @@ gtk_option_menu_item_state_changed_cb (GtkWidget      *widget,
 {
   GtkWidget *child = GTK_BIN (option_menu)->child;
 
-  if (child && GTK_WIDGET_SENSITIVE (child) != gtk_widget_is_sensitive (widget))
+  if (child && gtk_widget_get_sensitive (child) != gtk_widget_is_sensitive (widget))
     gtk_widget_set_sensitive (child, gtk_widget_is_sensitive (widget));
 }
 
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 48f72e0..328f0ab 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -2040,7 +2040,7 @@ gtk_paned_restore_focus (GtkPaned *paned)
   if (gtk_widget_is_focus (GTK_WIDGET (paned)))
     {
       if (paned->priv->saved_focus &&
-	  GTK_WIDGET_SENSITIVE (paned->priv->saved_focus))
+	  gtk_widget_get_sensitive (paned->priv->saved_focus))
 	{
 	  gtk_widget_grab_focus (paned->priv->saved_focus);
 	}
diff --git a/gtk/gtktoolitem.c b/gtk/gtktoolitem.c
index 2d18d4e..eb4d800 100644
--- a/gtk/gtktoolitem.c
+++ b/gtk/gtktoolitem.c
@@ -425,7 +425,7 @@ gtk_tool_item_property_notify (GObject    *object,
 
   if (tool_item->priv->menu_item && strcmp (pspec->name, "sensitive") == 0)
     gtk_widget_set_sensitive (tool_item->priv->menu_item,
-			      GTK_WIDGET_SENSITIVE (tool_item));
+			      gtk_widget_get_sensitive (GTK_WIDGET (tool_item)));
 }
 
 static void
@@ -1445,7 +1445,7 @@ gtk_tool_item_set_proxy_menu_item (GtkToolItem *tool_item,
 	  g_object_ref_sink (menu_item);
 
 	  gtk_widget_set_sensitive (menu_item,
-				    GTK_WIDGET_SENSITIVE (tool_item));
+				    gtk_widget_get_sensitive (GTK_WIDGET (tool_item)));
 	}
       
       tool_item->priv->menu_item = menu_item;
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 691a49e..d06542a 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -2743,7 +2743,7 @@ gtk_widget_get_property (GObject         *object,
       g_value_set_boolean (value, (GTK_WIDGET_VISIBLE (widget) != FALSE));
       break;
     case PROP_SENSITIVE:
-      g_value_set_boolean (value, (GTK_WIDGET_SENSITIVE (widget) != FALSE));
+      g_value_set_boolean (value, (gtk_widget_get_sensitive (widget) != FALSE));
       break;
     case PROP_APP_PAINTABLE:
       g_value_set_boolean (value, (gtk_widget_get_app_paintable (widget) != FALSE));
@@ -6220,7 +6220,7 @@ gtk_widget_set_sensitive (GtkWidget *widget,
 
   sensitive = (sensitive != FALSE);
 
-  if (sensitive == (GTK_WIDGET_SENSITIVE (widget) != FALSE))
+  if (sensitive == (gtk_widget_get_sensitive (widget) != FALSE))
     return;
 
   if (sensitive)
@@ -6267,7 +6267,7 @@ gtk_widget_get_sensitive (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return GTK_WIDGET_SENSITIVE (widget);
+  return (GTK_OBJECT_FLAGS (widget) & GTK_SENSITIVE) != 0;
 }
 
 /**
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 9f97ddf..97bf956 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -253,6 +253,7 @@ typedef enum
 #define GTK_WIDGET_DRAWABLE(wid)	  (GTK_WIDGET_VISIBLE (wid) && GTK_WIDGET_MAPPED (wid))
 #endif
 
+#ifndef GTK_DISABLE_DEPRECATED
 /**
  * GTK_WIDGET_SENSITIVE:
  * @wid: a #GtkWidget.
@@ -260,6 +261,7 @@ typedef enum
  * Evaluates to %TRUE if the #GTK_SENSITIVE flag has be set on the widget.
  */
 #define GTK_WIDGET_SENSITIVE(wid)	  ((GTK_WIDGET_FLAGS (wid) & GTK_SENSITIVE) != 0)
+#endif
 
 /**
  * GTK_WIDGET_PARENT_SENSITIVE:
diff --git a/modules/other/gail/gailcombo.c b/modules/other/gail/gailcombo.c
index 6e3ac15..08ce2ea 100644
--- a/modules/other/gail/gailcombo.c
+++ b/modules/other/gail/gailcombo.c
@@ -267,7 +267,7 @@ gail_combo_do_action (AtkAction *action,
      */
     return FALSE;
 
-  if (!GTK_WIDGET_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
+  if (!gtk_widget_get_sensitive (widget) || !GTK_WIDGET_VISIBLE (widget))
     return FALSE;
 
   combo = GAIL_COMBO (action);
@@ -305,7 +305,7 @@ idle_do_action (gpointer data)
   gail_combo->action_idle_handler = 0;
   widget = GTK_ACCESSIBLE (gail_combo)->widget;
   if (widget == NULL /* State is defunct */ ||
-      !GTK_WIDGET_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
+      !gtk_widget_get_sensitive (widget) || !GTK_WIDGET_VISIBLE (widget))
     return FALSE;
 
   combo = GTK_COMBO (widget);
diff --git a/modules/other/gail/gailcombobox.c b/modules/other/gail/gailcombobox.c
index e246aa3..3b6fde6 100644
--- a/modules/other/gail/gailcombobox.c
+++ b/modules/other/gail/gailcombobox.c
@@ -284,7 +284,7 @@ gail_combo_box_do_action (AtkAction *action,
      */
     return FALSE;
 
-  if (!GTK_WIDGET_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
+  if (!gtk_widget_get_sensitive (widget) || !GTK_WIDGET_VISIBLE (widget))
     return FALSE;
 
   combo_box = GAIL_COMBO_BOX (action);
@@ -313,7 +313,7 @@ idle_do_action (gpointer data)
   gail_combo_box->action_idle_handler = 0;
   widget = GTK_ACCESSIBLE (gail_combo_box)->widget;
   if (widget == NULL || /* State is defunct */
-      !GTK_WIDGET_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
+      !gtk_widget_get_sensitive (widget) || !GTK_WIDGET_VISIBLE (widget))
     return FALSE;
 
   combo_box = GTK_COMBO_BOX (widget);
diff --git a/modules/other/gail/gailentry.c b/modules/other/gail/gailentry.c
index d72a923..5b01989 100644
--- a/modules/other/gail/gailentry.c
+++ b/modules/other/gail/gailentry.c
@@ -1204,7 +1204,7 @@ gail_entry_do_action (AtkAction *action,
      */
     return FALSE;
 
-  if (!GTK_WIDGET_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
+  if (!gtk_widget_get_sensitive (widget) || !GTK_WIDGET_VISIBLE (widget))
     return FALSE;
 
   switch (i)
@@ -1232,7 +1232,7 @@ idle_do_action (gpointer data)
   entry->action_idle_handler = 0;
   widget = GTK_ACCESSIBLE (entry)->widget;
   if (widget == NULL /* State is defunct */ ||
-      !GTK_WIDGET_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
+      !gtk_widget_get_sensitive (widget) || !GTK_WIDGET_VISIBLE (widget))
     return FALSE;
 
   gtk_widget_activate (widget);
diff --git a/modules/other/gail/gailmenuitem.c b/modules/other/gail/gailmenuitem.c
index 24b1a85..53257c8 100644
--- a/modules/other/gail/gailmenuitem.c
+++ b/modules/other/gail/gailmenuitem.c
@@ -291,7 +291,7 @@ gail_menu_item_do_action (AtkAction *action,
         /* State is defunct */
         return FALSE;
 
-      if (!GTK_WIDGET_SENSITIVE (item) || !GTK_WIDGET_VISIBLE (item))
+      if (!gtk_widget_get_sensitive (item) || !GTK_WIDGET_VISIBLE (item))
         return FALSE;
 
       gail_menu_item = GAIL_MENU_ITEM (action);
@@ -347,7 +347,7 @@ idle_do_action (gpointer data)
   menu_item->action_idle_handler = 0;
   item = GTK_ACCESSIBLE (menu_item)->widget;
   if (item == NULL /* State is defunct */ ||
-      !GTK_WIDGET_SENSITIVE (item) || !GTK_WIDGET_VISIBLE (item))
+      !gtk_widget_get_sensitive (item) || !GTK_WIDGET_VISIBLE (item))
     return FALSE;
 
   item_parent = gtk_widget_get_parent (item);
diff --git a/modules/other/gail/gailoptionmenu.c b/modules/other/gail/gailoptionmenu.c
index 230ec3e..a26325a 100644
--- a/modules/other/gail/gailoptionmenu.c
+++ b/modules/other/gail/gailoptionmenu.c
@@ -212,7 +212,7 @@ gail_option_menu_do_action (AtkAction *action,
      */
     return FALSE;
 
-  if (!GTK_WIDGET_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
+  if (!gtk_widget_get_sensitive (widget) || !GTK_WIDGET_VISIBLE (widget))
     return FALSE;
 
   switch (i)
@@ -243,7 +243,7 @@ idle_do_action (gpointer data)
 
   widget = GTK_ACCESSIBLE (gail_button)->widget;
   if (widget == NULL /* State is defunct */ ||
-      !GTK_WIDGET_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
+      !gtk_widget_get_sensitive (widget) || !GTK_WIDGET_VISIBLE (widget))
     return FALSE;
 
   button = GTK_BUTTON (widget); 
diff --git a/modules/other/gail/gailrange.c b/modules/other/gail/gailrange.c
index 2fc51ec..099d0c6 100644
--- a/modules/other/gail/gailrange.c
+++ b/modules/other/gail/gailrange.c
@@ -346,7 +346,7 @@ gail_range_do_action (AtkAction *action,
      * State is defunct
      */
     return FALSE;
-  if (!GTK_WIDGET_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
+  if (!gtk_widget_get_sensitive (widget) || !GTK_WIDGET_VISIBLE (widget))
     return FALSE;
   if(i==0)
    {
@@ -370,7 +370,7 @@ idle_do_action (gpointer data)
   range->action_idle_handler = 0;
   widget = GTK_ACCESSIBLE (range)->widget;
   if (widget == NULL /* State is defunct */ ||
-     !GTK_WIDGET_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
+     !gtk_widget_get_sensitive (widget) || !GTK_WIDGET_VISIBLE (widget))
     return FALSE;
 
    gtk_widget_activate (widget);
diff --git a/modules/other/gail/gailwidget.c b/modules/other/gail/gailwidget.c
index ea69cc7..96e0015 100644
--- a/modules/other/gail/gailwidget.c
+++ b/modules/other/gail/gailwidget.c
@@ -991,7 +991,7 @@ gail_widget_real_notify_gtk (GObject     *obj,
   else if (strcmp (pspec->name, "sensitive") == 0)
     {
       state = ATK_STATE_SENSITIVE;
-      value = GTK_WIDGET_SENSITIVE (widget);
+      value = gtk_widget_get_sensitive (widget);
     }
   else
     return;



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