Commit 64f526d3 authored by Javier Jardón's avatar Javier Jardón

Deprecate widget flag: GTK_WIDGET_SENSITIVE

Use gtk_widget_get_sensitive() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
parent f5bde06e
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
......@@ -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));
......
......@@ -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
......
......@@ -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
......
......@@ -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];
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -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));
}
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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;
}
/**
......
......@@ -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:
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
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