Commit 8ea37e55 authored by Javier Jardon's avatar Javier Jardon Committed by Tristan Van Berkom
Browse files

Don't use GTK_WIDGET_STATE in internal code anymore

Use gtk_widget_get/set_state() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
parent ca43e7d3
......@@ -57,7 +57,7 @@ scribble_expose_event (GtkWidget *widget,
*/
gdk_draw_drawable (widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
widget->style->fg_gc[gtk_widget_get_state (widget)],
pixmap,
/* Only copy the area that was exposed. */
event->area.x, event->area.y,
......
......@@ -56,7 +56,7 @@ gboolean
expose_event_callback (GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
gdk_draw_arc (widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
widget->style->fg_gc[gtk_widget_get_state (widget)],
TRUE,
0, 0, widget->allocation.width, widget->allocation.height,
0, 64 * 360);
......
......@@ -12777,7 +12777,7 @@ static gboolean
expose_event( GtkWidget *widget, GdkEventExpose *event )
{
gdk_draw_drawable(widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
widget->style->fg_gc[gtk_widget_get_state (widget)],
pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
......@@ -12837,7 +12837,7 @@ contexts are:</para>
widget->style->white_gc
widget->style->black_gc
widget->style->fg_gc[GTK_STATE_NORMAL]
widget->style->bg_gc[GTK_WIDGET_STATE(widget)]
widget->style->bg_gc[gtk_widget_get_state(widget)]
</programlisting>
<para>The fields <literal>fg_gc</literal>, <literal>bg_gc</literal>, <literal>dark_gc</literal>, and
......@@ -13139,7 +13139,7 @@ draw_brush (GtkWidget *widget, GdkInputSource source,
switch (source)
{
case GDK_SOURCE_MOUSE:
gc = widget->style->dark_gc[GTK_WIDGET_STATE (widget)];
gc = widget->style->dark_gc[gtk_widget_get_state (widget)];
break;
case GDK_SOURCE_PEN:
gc = widget->style->black_gc;
......@@ -13148,7 +13148,7 @@ draw_brush (GtkWidget *widget, GdkInputSource source,
gc = widget->style->white_gc;
break;
default:
gc = widget->style->light_gc[GTK_WIDGET_STATE (widget)];
gc = widget->style->light_gc[gtk_widget_get_state (widget)];
}
update_rect.x = x - 10 * pressure;
......@@ -15706,7 +15706,7 @@ static gboolean expose_event( GtkWidget *widget,
GdkEventExpose *event )
{
gdk_draw_drawable (widget-&gt;window,
widget-&gt;style-&gt;fg_gc[GTK_WIDGET_STATE (widget)],
widget-&gt;style-&gt;fg_gc[gtk_widget_get_state (widget)],
pixmap,
event-&gt;area.x, event-&gt;area.y,
event-&gt;area.x, event-&gt;area.y,
......@@ -15897,7 +15897,7 @@ static gboolean
expose_event (GtkWidget *widget, GdkEventExpose *event)
{
gdk_draw_drawable (widget-&gt;window,
widget-&gt;style-&gt;fg_gc[GTK_WIDGET_STATE (widget)],
widget-&gt;style-&gt;fg_gc[gtk_widget_get_state (widget)],
pixmap,
event-&gt;area.x, event-&gt;area.y,
event-&gt;area.x, event-&gt;area.y,
......@@ -15918,7 +15918,7 @@ draw_brush (GtkWidget *widget, GdkInputSource source,
switch (source)
{
case GDK_SOURCE_MOUSE:
gc = widget-&gt;style-&gt;dark_gc[GTK_WIDGET_STATE (widget)];
gc = widget-&gt;style-&gt;dark_gc[gtk_widget_get_state (widget)];
break;
case GDK_SOURCE_PEN:
gc = widget-&gt;style-&gt;black_gc;
......@@ -15927,7 +15927,7 @@ draw_brush (GtkWidget *widget, GdkInputSource source,
gc = widget-&gt;style-&gt;white_gc;
break;
default:
gc = widget-&gt;style-&gt;light_gc[GTK_WIDGET_STATE (widget)];
gc = widget-&gt;style-&gt;light_gc[gtk_widget_get_state (widget)];
}
update_rect.x = x - 10 * pressure;
......
......@@ -50,7 +50,7 @@ static gboolean expose_event( GtkWidget *widget,
GdkEventExpose *event )
{
gdk_draw_drawable (widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
widget->style->fg_gc[gtk_widget_get_state (widget)],
pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
......
......@@ -49,7 +49,7 @@ static gboolean
expose_event (GtkWidget *widget, GdkEventExpose *event)
{
gdk_draw_drawable (widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
widget->style->fg_gc[gtk_widget_get_state (widget)],
pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
......@@ -70,7 +70,7 @@ draw_brush (GtkWidget *widget, GdkInputSource source,
switch (source)
{
case GDK_SOURCE_MOUSE:
gc = widget->style->dark_gc[GTK_WIDGET_STATE (widget)];
gc = widget->style->dark_gc[gtk_widget_get_state (widget)];
break;
case GDK_SOURCE_PEN:
gc = widget->style->black_gc;
......@@ -79,7 +79,7 @@ draw_brush (GtkWidget *widget, GdkInputSource source,
gc = widget->style->white_gc;
break;
default:
gc = widget->style->light_gc[GTK_WIDGET_STATE (widget)];
gc = widget->style->light_gc[gtk_widget_get_state (widget)];
}
update_rect.x = x - 10 * pressure;
......
......@@ -413,7 +413,7 @@ gtk_accel_label_expose_event (GtkWidget *widget,
gtk_paint_layout (widget->style,
widget->window,
GTK_WIDGET_STATE (widget),
gtk_widget_get_state (widget),
FALSE,
&event->area,
widget,
......
......@@ -1520,7 +1520,7 @@ _gtk_button_paint (GtkButton *button,
}
if (button->relief != GTK_RELIEF_NONE || button->depressed ||
GTK_WIDGET_STATE(widget) == GTK_STATE_PRELIGHT)
gtk_widget_get_state(widget) == GTK_STATE_PRELIGHT)
gtk_paint_box (widget->style, widget->window,
state_type,
shadow_type, area, widget, "button",
......@@ -1559,7 +1559,7 @@ _gtk_button_paint (GtkButton *button,
y += child_displacement_y;
}
gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
gtk_paint_focus (widget->style, widget->window, gtk_widget_get_state (widget),
area, widget, "button",
x, y, width, height);
}
......@@ -1575,7 +1575,7 @@ gtk_button_expose (GtkWidget *widget,
GtkButton *button = GTK_BUTTON (widget);
_gtk_button_paint (button, &event->area,
GTK_WIDGET_STATE (widget),
gtk_widget_get_state (widget),
button->depressed ? GTK_SHADOW_IN : GTK_SHADOW_OUT,
"button", "buttondefault");
......
......@@ -186,16 +186,16 @@ dates_difference(guint year1, guint mm1, guint dd1,
#define SCROLL_DELAY_FACTOR 5
/* Color usage */
#define HEADER_FG_COLOR(widget) (& (widget)->style->fg[GTK_WIDGET_STATE (widget)])
#define HEADER_BG_COLOR(widget) (& (widget)->style->bg[GTK_WIDGET_STATE (widget)])
#define HEADER_FG_COLOR(widget) (& (widget)->style->fg[gtk_widget_get_state (widget)])
#define HEADER_BG_COLOR(widget) (& (widget)->style->bg[gtk_widget_get_state (widget)])
#define SELECTED_BG_COLOR(widget) (& (widget)->style->base[gtk_widget_has_focus (widget) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE])
#define SELECTED_FG_COLOR(widget) (& (widget)->style->text[gtk_widget_has_focus (widget) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE])
#define NORMAL_DAY_COLOR(widget) (& (widget)->style->text[GTK_WIDGET_STATE (widget)])
#define PREV_MONTH_COLOR(widget) (& (widget)->style->mid[GTK_WIDGET_STATE (widget)])
#define NEXT_MONTH_COLOR(widget) (& (widget)->style->mid[GTK_WIDGET_STATE (widget)])
#define MARKED_COLOR(widget) (& (widget)->style->text[GTK_WIDGET_STATE (widget)])
#define BACKGROUND_COLOR(widget) (& (widget)->style->base[GTK_WIDGET_STATE (widget)])
#define HIGHLIGHT_BACK_COLOR(widget) (& (widget)->style->mid[GTK_WIDGET_STATE (widget)])
#define NORMAL_DAY_COLOR(widget) (& (widget)->style->text[gtk_widget_get_state (widget)])
#define PREV_MONTH_COLOR(widget) (& (widget)->style->mid[gtk_widget_get_state (widget)])
#define NEXT_MONTH_COLOR(widget) (& (widget)->style->mid[gtk_widget_get_state (widget)])
#define MARKED_COLOR(widget) (& (widget)->style->text[gtk_widget_get_state (widget)])
#define BACKGROUND_COLOR(widget) (& (widget)->style->base[gtk_widget_get_state (widget)])
#define HIGHLIGHT_BACK_COLOR(widget) (& (widget)->style->mid[gtk_widget_get_state (widget)])
enum {
ARROW_YEAR_LEFT,
......@@ -2685,7 +2685,7 @@ gtk_calendar_expose (GtkWidget *widget,
calendar_paint_week_numbers (calendar);
if (event->window == widget->window)
{
gtk_paint_shadow (widget->style, widget->window, GTK_WIDGET_STATE (widget),
gtk_paint_shadow (widget->style, widget->window, gtk_widget_get_state (widget),
GTK_SHADOW_IN, NULL, widget, "calendar",
0, 0, widget->allocation.width, widget->allocation.height);
}
......
......@@ -714,7 +714,7 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell,
if (!pixbuf)
return;
if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE || !cell->sensitive)
if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE || !cell->sensitive)
{
GtkIconSource *source;
......
......@@ -360,7 +360,7 @@ gtk_cell_renderer_spinner_render (GtkCellRenderer *cellr,
}
state = GTK_STATE_NORMAL;
if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE || !cellr->sensitive)
if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE || !cellr->sensitive)
{
state = GTK_STATE_INSENSITIVE;
}
......
......@@ -1649,13 +1649,13 @@ gtk_cell_renderer_text_render (GtkCellRenderer *cell,
state = GTK_STATE_ACTIVE;
}
else if ((flags & GTK_CELL_RENDERER_PRELIT) == GTK_CELL_RENDERER_PRELIT &&
GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT)
gtk_widget_get_state (widget) == GTK_STATE_PRELIGHT)
{
state = GTK_STATE_PRELIGHT;
}
else
{
if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE)
state = GTK_STATE_INSENSITIVE;
else
state = GTK_STATE_NORMAL;
......
......@@ -349,7 +349,7 @@ gtk_cell_renderer_toggle_render (GtkCellRenderer *cell,
else
shadow = celltoggle->active ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE || !cell->sensitive)
if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE || !cell->sensitive)
{
state = GTK_STATE_INSENSITIVE;
}
......
......@@ -473,9 +473,9 @@ gtk_cell_view_expose (GtkWidget *widget,
area.x = widget->allocation.x + (rtl ? widget->allocation.width : 0);
area.y = widget->allocation.y;
if (GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT)
if (gtk_widget_get_state (widget) == GTK_STATE_PRELIGHT)
state = GTK_CELL_RENDERER_PRELIT;
else if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
else if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE)
state = GTK_CELL_RENDERER_INSENSITIVE;
else
state = 0;
......
......@@ -154,14 +154,14 @@ gtk_check_button_paint (GtkWidget *widget,
GtkWidget *child = GTK_BIN (widget)->child;
if (interior_focus && child && gtk_widget_get_visible (child))
gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
gtk_paint_focus (widget->style, widget->window, gtk_widget_get_state (widget),
area, widget, "checkbutton",
child->allocation.x - focus_width - focus_pad,
child->allocation.y - focus_width - focus_pad,
child->allocation.width + 2 * (focus_width + focus_pad),
child->allocation.height + 2 * (focus_width + focus_pad));
else
gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
gtk_paint_focus (widget->style, widget->window, gtk_widget_get_state (widget),
area, widget, "checkbutton",
border_width + widget->allocation.x,
border_width + widget->allocation.y,
......@@ -398,7 +398,7 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
x = widget->allocation.x + widget->allocation.width - (indicator_size + x - widget->allocation.x);
if (GTK_WIDGET_STATE (toggle_button) == GTK_STATE_PRELIGHT)
if (gtk_widget_get_state (widget) == GTK_STATE_PRELIGHT)
{
GdkRectangle restrict_area;
GdkRectangle new_area;
......
......@@ -441,17 +441,17 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
GtkShadowType shadow_type;
gint x, y;
if (gtk_widget_is_drawable (GTK_WIDGET (check_menu_item)))
widget = GTK_WIDGET (check_menu_item);
if (gtk_widget_is_drawable (widget))
{
guint offset;
guint toggle_size;
guint toggle_spacing;
guint horizontal_padding;
guint indicator_size;
widget = GTK_WIDGET (check_menu_item);
gtk_widget_style_get (GTK_WIDGET (check_menu_item),
gtk_widget_style_get (widget,
"toggle-spacing", &toggle_spacing,
"horizontal-padding", &horizontal_padding,
"indicator-size", &indicator_size,
......@@ -477,9 +477,9 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
if (check_menu_item->active ||
check_menu_item->always_show_toggle ||
(GTK_WIDGET_STATE (check_menu_item) == GTK_STATE_PRELIGHT))
(gtk_widget_get_state (widget) == GTK_STATE_PRELIGHT))
{
state_type = GTK_WIDGET_STATE (widget);
state_type = gtk_widget_get_state (widget);
if (check_menu_item->inconsistent)
shadow_type = GTK_SHADOW_ETCHED_IN;
......
......@@ -1100,7 +1100,7 @@ gtk_combo_box_state_changed (GtkWidget *widget,
{
if (priv->tree_view && priv->cell_view)
gtk_cell_view_set_background_color (GTK_CELL_VIEW (priv->cell_view),
&widget->style->base[GTK_WIDGET_STATE (widget)]);
&widget->style->base[gtk_widget_get_state (widget)]);
}
gtk_widget_queue_draw (widget);
......@@ -1118,12 +1118,12 @@ gtk_combo_box_button_state_changed (GtkWidget *widget,
{
if (!priv->tree_view && priv->cell_view)
{
if ((GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE) !=
(GTK_WIDGET_STATE (priv->cell_view) == GTK_STATE_INSENSITIVE))
if ((gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE) !=
(gtk_widget_get_state (priv->cell_view) == GTK_STATE_INSENSITIVE))
gtk_widget_set_sensitive (priv->cell_view, gtk_widget_get_sensitive (widget));
gtk_widget_set_state (priv->cell_view,
GTK_WIDGET_STATE (widget));
gtk_widget_get_state (widget));
}
}
......@@ -1183,7 +1183,7 @@ gtk_combo_box_style_set (GtkWidget *widget,
if (priv->tree_view && priv->cell_view)
gtk_cell_view_set_background_color (GTK_CELL_VIEW (priv->cell_view),
&widget->style->base[GTK_WIDGET_STATE (widget)]);
&widget->style->base[gtk_widget_get_state (widget)]);
if (GTK_IS_ENTRY (GTK_BIN (combo_box)->child))
g_object_set (GTK_BIN (combo_box)->child, "shadow-type",
......@@ -3675,6 +3675,8 @@ gtk_combo_box_list_setup (GtkComboBox *combo_box)
{
GtkComboBoxPrivate *priv = combo_box->priv;
GtkTreeSelection *sel;
GtkStyle *style;
GtkWidget *widget = GTK_WIDGET (combo_box);
priv->button = gtk_toggle_button_new ();
gtk_widget_set_parent (priv->button,
......@@ -3691,8 +3693,9 @@ gtk_combo_box_list_setup (GtkComboBox *combo_box)
if (priv->cell_view)
{
gtk_cell_view_set_background_color (GTK_CELL_VIEW (priv->cell_view),
&GTK_WIDGET (combo_box)->style->base[GTK_WIDGET_STATE (combo_box)]);
style = gtk_widget_get_style (widget);
gtk_cell_view_set_background_color (GTK_CELL_VIEW (priv->cell_view),
&style->base[gtk_widget_get_state (widget)]);
priv->box = gtk_event_box_new ();
gtk_event_box_set_visible_window (GTK_EVENT_BOX (priv->box),
......
......@@ -2674,7 +2674,7 @@ realize_icon_info (GtkWidget *widget,
attributes_mask);
gdk_window_set_user_data (icon_info->window, widget);
gdk_window_set_background (icon_info->window,
&widget->style->base[GTK_WIDGET_STATE (widget)]);
&widget->style->base[gtk_widget_get_state (widget)]);
gtk_widget_queue_resize (widget);
}
......@@ -2796,8 +2796,8 @@ gtk_entry_realize (GtkWidget *widget)
widget->style = gtk_style_attach (widget->style, widget->window);
gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
gdk_window_set_background (entry->text_area, &widget->style->base[GTK_WIDGET_STATE (widget)]);
gdk_window_set_background (widget->window, &widget->style->base[gtk_widget_get_state (widget)]);
gdk_window_set_background (entry->text_area, &widget->style->base[gtk_widget_get_state (widget)]);
gdk_window_show (entry->text_area);
......@@ -3305,7 +3305,7 @@ gtk_entry_draw_frame (GtkWidget *widget,
gtk_widget_style_get (widget, "state-hint", &state_hint, NULL);
if (state_hint)
state = gtk_widget_has_focus (widget) ?
GTK_STATE_ACTIVE : GTK_WIDGET_STATE (widget);
GTK_STATE_ACTIVE : gtk_widget_get_state (widget);
else
state = GTK_STATE_NORMAL;
......@@ -3323,7 +3323,8 @@ gtk_entry_draw_frame (GtkWidget *widget,
width += 2 * priv->focus_width;
height += 2 * priv->focus_width;
gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
gtk_paint_focus (widget->style, widget->window,
gtk_widget_get_state (widget),
&event->area, widget, "entry",
0, 0, width, height);
}
......@@ -3455,9 +3456,9 @@ gtk_entry_expose (GtkWidget *widget,
gtk_widget_style_get (widget, "state-hint", &state_hint, NULL);
if (state_hint)
state = gtk_widget_has_focus (widget) ?
GTK_STATE_ACTIVE : GTK_WIDGET_STATE (widget);
GTK_STATE_ACTIVE : gtk_widget_get_state (widget);
else
state = GTK_WIDGET_STATE(widget);
state = gtk_widget_get_state(widget);
if (widget->window == event->window)
{
......@@ -3502,7 +3503,7 @@ gtk_entry_expose (GtkWidget *widget,
gdk_drawable_get_size (icon_info->window, &width, &height);
gtk_paint_flat_box (widget->style, icon_info->window,
GTK_WIDGET_STATE (widget), GTK_SHADOW_NONE,
gtk_widget_get_state (widget), GTK_SHADOW_NONE,
NULL, widget, "entry_bg",
0, 0, width, height);
......@@ -4244,13 +4245,13 @@ gtk_entry_state_changed (GtkWidget *widget,
if (gtk_widget_get_realized (widget))
{
gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
gdk_window_set_background (entry->text_area, &widget->style->base[GTK_WIDGET_STATE (widget)]);
gdk_window_set_background (widget->window, &widget->style->base[gtk_widget_get_state (widget)]);
gdk_window_set_background (entry->text_area, &widget->style->base[gtk_widget_get_state (widget)]);
for (i = 0; i < MAX_ICONS; i++)
{
EntryIconInfo *icon_info = priv->icons[i];
if (icon_info && icon_info->window)
gdk_window_set_background (icon_info->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
gdk_window_set_background (icon_info->window, &widget->style->base[gtk_widget_get_state (widget)]);
}
if (gtk_widget_is_sensitive (widget))
......@@ -4462,13 +4463,13 @@ gtk_entry_style_set (GtkWidget *widget,
if (previous_style && gtk_widget_get_realized (widget))
{
gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
gdk_window_set_background (entry->text_area, &widget->style->base[GTK_WIDGET_STATE (widget)]);
gdk_window_set_background (widget->window, &widget->style->base[gtk_widget_get_state (widget)]);
gdk_window_set_background (entry->text_area, &widget->style->base[gtk_widget_get_state (widget)]);
for (i = 0; i < MAX_ICONS; i++)
{
EntryIconInfo *icon_info = priv->icons[i];
if (icon_info && icon_info->window)
gdk_window_set_background (icon_info->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
gdk_window_set_background (icon_info->window, &widget->style->base[gtk_widget_get_state (widget)]);
}
}
......@@ -6448,38 +6449,41 @@ gtk_entry_ensure_pixbuf (GtkEntry *entry,
{
GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (entry);
EntryIconInfo *icon_info = priv->icons[icon_pos];
GdkScreen *screen;
GtkIconInfo *info;
GtkIconTheme *icon_theme;
GtkSettings *settings;
GtkStateType state;
GtkWidget *widget;
GdkScreen *screen;
gint width, height;
GtkIconInfo *info;
gint state;
if (!icon_info || icon_info->pixbuf)
return;
widget = GTK_WIDGET (entry);
switch (icon_info->storage_type)
{
case GTK_IMAGE_EMPTY:
case GTK_IMAGE_PIXBUF:
break;
case GTK_IMAGE_STOCK:
state = GTK_WIDGET_STATE (entry);
GTK_WIDGET_STATE (entry) = GTK_STATE_NORMAL;
icon_info->pixbuf = gtk_widget_render_icon (GTK_WIDGET (entry),
state = gtk_widget_get_state (widget);
gtk_widget_set_state (widget, GTK_STATE_NORMAL);
icon_info->pixbuf = gtk_widget_render_icon (widget,
icon_info->stock_id,
GTK_ICON_SIZE_MENU,
NULL);
if (!icon_info->pixbuf)
icon_info->pixbuf = gtk_widget_render_icon (GTK_WIDGET (entry),
icon_info->pixbuf = gtk_widget_render_icon (widget,
GTK_STOCK_MISSING_IMAGE,
GTK_ICON_SIZE_MENU,
NULL);
GTK_WIDGET_STATE (entry) = state;
gtk_widget_set_state (widget, state);
break;
case GTK_IMAGE_ICON_NAME:
screen = gtk_widget_get_screen (GTK_WIDGET (entry));
screen = gtk_widget_get_screen (widget);
if (screen)
{
icon_theme = gtk_icon_theme_get_for_screen (screen);
......@@ -6496,19 +6500,19 @@ gtk_entry_ensure_pixbuf (GtkEntry *entry,
if (icon_info->pixbuf == NULL)
{
state = GTK_WIDGET_STATE (entry);
GTK_WIDGET_STATE (entry) = GTK_STATE_NORMAL;
icon_info->pixbuf = gtk_widget_render_icon (GTK_WIDGET (entry),
state = gtk_widget_get_state (widget);
gtk_widget_set_state (widget, GTK_STATE_NORMAL);
icon_info->pixbuf = gtk_widget_render_icon (widget,
GTK_STOCK_MISSING_IMAGE,
GTK_ICON_SIZE_MENU,
NULL);
GTK_WIDGET_STATE (entry) = state;
gtk_widget_set_state (widget, state);
}
}
break;
case GTK_IMAGE_GICON:
screen = gtk_widget_get_screen (GTK_WIDGET (entry));
screen = gtk_widget_get_screen (widget);
if (screen)
{
icon_theme = gtk_icon_theme_get_for_screen (screen);
......@@ -6530,13 +6534,13 @@ gtk_entry_ensure_pixbuf (GtkEntry *entry,
if (icon_info->pixbuf == NULL)
{
state = GTK_WIDGET_STATE (entry);
GTK_WIDGET_STATE (entry) = GTK_STATE_NORMAL;
icon_info->pixbuf = gtk_widget_render_icon (GTK_WIDGET (entry),
state = gtk_widget_get_state (widget);
gtk_widget_set_state (widget, GTK_STATE_NORMAL);
icon_info->pixbuf = gtk_widget_render_icon (widget,
GTK_STOCK_MISSING_IMAGE,
GTK_ICON_SIZE_MENU,
NULL);
GTK_WIDGET_STATE (entry) = state;
gtk_widget_set_state (widget, state);
}
}
break;
......
......@@ -888,7 +888,7 @@ gtk_expander_paint_focus (GtkExpander *expander,
height = rect.height + 2 * focus_pad;
}
gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
gtk_paint_focus (widget->style, widget->window, gtk_widget_get_state (widget),
area, widget, "expander",
x, y, width, height);
}
......
......@@ -450,9 +450,9 @@ gtk_handle_box_realize (GtkWidget *widget)
gdk_window_set_type_hint (hb->float_window, GDK_WINDOW_TYPE_HINT_TOOLBAR);
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_WIDGET_STATE (hb));
gtk_style_set_background (widget->style, hb->bin_window, GTK_WIDGET_STATE (hb));
gtk_style_set_background (widget->style, hb->float_window, GTK_WIDGET_STATE (hb));
gtk_style_set_background (widget->style, widget->window, gtk_widget_get_state (widget));
gtk_style_set_background (widget->style, hb->bin_window, gtk_widget_get_state (widget));
gtk_style_set_background (widget->style, hb->float_window, gtk_widget_get_state (widget));
gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
}
......@@ -716,7 +716,7 @@ gtk_handle_box_draw_ghost (GtkHandleBox *hb)
}
gtk_paint_shadow (widget->style,
widget->window,
GTK_WIDGET_STATE (widget),
gtk_widget_get_state (widget),
GTK_SHADOW_ETCHED_IN,
NULL, widget, "handle",
x,
......@@ -727,7 +727,7 @@ gtk_handle_box_draw_ghost (GtkHandleBox *hb)
handle_position == GTK_POS_RIGHT)
gtk_paint_hline (widget->style,
widget->window,
GTK_WIDGET_STATE (widget),
gtk_widget_get_state (widget),
NULL, widget, "handlebox",
handle_position == GTK_POS_LEFT ? DRAG_HANDLE_SIZE : 0,