Deprecate widget flag: GTK_WIDGET_DRAWABLE

Use gtk_widget_is_drawable() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
This commit is contained in:
Javier Jardón 2010-01-07 16:47:35 +01:00
parent 6a9d4d8203
commit 4f78f70b15
52 changed files with 145 additions and 128 deletions

View File

@ -466,7 +466,7 @@ gtk_rotated_bin_expose (GtkWidget *widget,
gdouble s, c;
gdouble w, h;
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
if (event->window == widget->window)
{

View File

@ -369,7 +369,7 @@ gtk_mirror_bin_expose (GtkWidget *widget,
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
gint width, height;
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
if (event->window == widget->window)
{

View File

@ -365,7 +365,7 @@ gtk_accel_label_expose_event (GtkWidget *widget,
direction = gtk_widget_get_direction (widget);
if (GTK_WIDGET_DRAWABLE (accel_label))
if (gtk_widget_is_drawable (widget))
{
guint ac_width;

View File

@ -174,6 +174,8 @@ gtk_arrow_set (GtkArrow *arrow,
GtkArrowType arrow_type,
GtkShadowType shadow_type)
{
GtkWidget *widget;
g_return_if_fail (GTK_IS_ARROW (arrow));
if ( ((GtkArrowType) arrow->arrow_type != arrow_type)
@ -195,8 +197,9 @@ gtk_arrow_set (GtkArrow *arrow,
g_object_thaw_notify (G_OBJECT (arrow));
if (GTK_WIDGET_DRAWABLE (arrow))
gtk_widget_queue_draw (GTK_WIDGET (arrow));
widget = GTK_WIDGET (arrow);
if (gtk_widget_is_drawable (widget))
gtk_widget_queue_draw (widget);
}
}
@ -205,7 +208,7 @@ static gboolean
gtk_arrow_expose (GtkWidget *widget,
GdkEventExpose *event)
{
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
GtkArrow *arrow = GTK_ARROW (widget);
GtkMisc *misc = GTK_MISC (widget);

View File

@ -558,7 +558,7 @@ set_current_page (GtkAssistant *assistant,
GtkAssistantPage *old_page;
if (priv->current_page &&
GTK_WIDGET_DRAWABLE (priv->current_page->page))
gtk_widget_is_drawable (priv->current_page->page))
old_page = priv->current_page;
else
old_page = NULL;
@ -1276,11 +1276,11 @@ gtk_assistant_unmap (GtkWidget *widget)
gtk_widget_unmap (priv->header_image);
gtk_widget_unmap (priv->action_area);
if (GTK_WIDGET_DRAWABLE (priv->sidebar_image))
if (gtk_widget_is_drawable (priv->sidebar_image))
gtk_widget_unmap (priv->sidebar_image);
if (priv->current_page &&
GTK_WIDGET_DRAWABLE (priv->current_page->page))
gtk_widget_is_drawable (priv->current_page->page))
gtk_widget_unmap (priv->current_page->page);
g_slist_free (priv->visited_pages);
@ -1366,7 +1366,7 @@ gtk_assistant_expose (GtkWidget *widget,
GtkAssistantPrivate *priv = assistant->priv;
GtkContainer *container;
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
container = GTK_CONTAINER (widget);

View File

@ -1471,14 +1471,15 @@ _gtk_button_paint (GtkButton *button,
gboolean interior_focus;
gint focus_width;
gint focus_pad;
if (GTK_WIDGET_DRAWABLE (button))
widget = GTK_WIDGET (button);
if (gtk_widget_is_drawable (widget))
{
widget = GTK_WIDGET (button);
border_width = GTK_CONTAINER (widget)->border_width;
gtk_button_get_props (button, &default_border, &default_outside_border, NULL, &interior_focus);
gtk_widget_style_get (GTK_WIDGET (widget),
gtk_widget_style_get (widget,
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
NULL);
@ -1530,7 +1531,7 @@ _gtk_button_paint (GtkButton *button,
gint child_displacement_y;
gboolean displace_focus;
gtk_widget_style_get (GTK_WIDGET (widget),
gtk_widget_style_get (widget,
"child-displacement-y", &child_displacement_y,
"child-displacement-x", &child_displacement_x,
"displace-focus", &displace_focus,
@ -1568,7 +1569,7 @@ static gboolean
gtk_button_expose (GtkWidget *widget,
GdkEventExpose *event)
{
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
GtkButton *button = GTK_BUTTON (widget);

View File

@ -2666,7 +2666,7 @@ gtk_calendar_expose (GtkWidget *widget,
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
int i;
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
if (event->window == priv->main_win)
calendar_paint_main (calendar);
@ -3728,7 +3728,7 @@ gtk_calendar_select_day (GtkCalendar *calendar,
selected_day = calendar->selected_day;
calendar->selected_day = 0;
if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
if (gtk_widget_is_drawable (GTK_WIDGET (calendar)))
calendar_invalidate_day_num (calendar, selected_day);
}
@ -3737,7 +3737,7 @@ gtk_calendar_select_day (GtkCalendar *calendar,
/* Select the new day */
if (day != 0)
{
if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
if (gtk_widget_is_drawable (GTK_WIDGET (calendar)))
calendar_invalidate_day_num (calendar, day);
}

View File

@ -405,7 +405,7 @@ gtk_cell_view_expose (GtkWidget *widget,
cellview = GTK_CELL_VIEW (widget);
if (! GTK_WIDGET_DRAWABLE (widget))
if (!gtk_widget_is_drawable (widget))
return FALSE;
/* "blank" background */

View File

@ -133,7 +133,7 @@ gtk_check_button_paint (GtkWidget *widget,
{
GtkCheckButton *check_button = GTK_CHECK_BUTTON (widget);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
gint border_width;
gint interior_focus;
@ -307,7 +307,7 @@ gtk_check_button_expose (GtkWidget *widget,
toggle_button = GTK_TOGGLE_BUTTON (widget);
bin = GTK_BIN (widget);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
if (toggle_button->draw_indicator)
{
@ -356,10 +356,11 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
gint focus_width;
gint focus_pad;
gboolean interior_focus;
if (GTK_WIDGET_DRAWABLE (check_button))
widget = GTK_WIDGET (check_button);
if (gtk_widget_is_drawable (widget))
{
widget = GTK_WIDGET (check_button);
button = GTK_BUTTON (check_button);
toggle_button = GTK_TOGGLE_BUTTON (check_button);

View File

@ -441,7 +441,7 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
GtkShadowType shadow_type;
gint x, y;
if (GTK_WIDGET_DRAWABLE (check_menu_item))
if (gtk_widget_is_drawable (GTK_WIDGET (check_menu_item)))
{
guint offset;
guint toggle_size;

View File

@ -814,7 +814,7 @@ color_sample_draw_sample (GtkColorSelection *colorsel, int which)
priv = colorsel->private_data;
g_return_if_fail (priv->sample_area != NULL);
if (!GTK_WIDGET_DRAWABLE (priv->sample_area))
if (!gtk_widget_is_drawable (priv->sample_area))
return;
if (which == 0)

View File

@ -2512,7 +2512,7 @@ gtk_combo_box_expose_event (GtkWidget *widget,
GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
GtkComboBoxPrivate *priv = combo_box->priv;
if (GTK_WIDGET_DRAWABLE (widget) &&
if (gtk_widget_is_drawable (widget) &&
GTK_SHADOW_NONE != priv->shadow_type)
{
gtk_paint_shadow (widget->style, widget->window,

View File

@ -2301,7 +2301,7 @@ gtk_container_focus_move (GtkContainer *container,
return TRUE;
}
}
else if (GTK_WIDGET_DRAWABLE (child) &&
else if (gtk_widget_is_drawable (child) &&
gtk_widget_is_ancestor (child, GTK_WIDGET (container)))
{
if (gtk_widget_child_focus (child, direction))
@ -2638,7 +2638,7 @@ gtk_container_expose (GtkWidget *widget,
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
data.container = widget;
data.event = event;
@ -2720,7 +2720,7 @@ gtk_container_propagate_expose (GtkContainer *container,
g_assert (child->parent == GTK_WIDGET (container));
if (GTK_WIDGET_DRAWABLE (child) &&
if (gtk_widget_is_drawable (child) &&
!gtk_widget_get_has_window (child) &&
(child->window == event->window))
{

View File

@ -353,7 +353,7 @@ gtk_drag_highlight_expose (GtkWidget *widget,
{
gint x, y, width, height;
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
cairo_t *cr;
@ -757,7 +757,7 @@ gtk_drag_find_widget (GtkWidget *widget,
gtk_container_forall (GTK_CONTAINER (widget), prepend_and_ref_widget, &children);
for (tmp_list = children; tmp_list; tmp_list = tmp_list->next)
{
if (!new_data.found && GTK_WIDGET_DRAWABLE (tmp_list->data))
if (!new_data.found && gtk_widget_is_drawable (tmp_list->data))
gtk_drag_find_widget (tmp_list->data, &new_data);
g_object_unref (tmp_list->data);
}

View File

@ -1102,7 +1102,7 @@ gtk_drag_highlight_expose (GtkWidget *widget,
{
gint x, y, width, height;
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
cairo_t *cr;
@ -1934,7 +1934,7 @@ gtk_drag_find_widget (GtkWidget *widget,
gtk_container_forall (GTK_CONTAINER (widget), prepend_and_ref_widget, &children);
for (tmp_list = children; tmp_list; tmp_list = tmp_list->next)
{
if (!new_data.found && GTK_WIDGET_DRAWABLE (tmp_list->data))
if (!new_data.found && gtk_widget_is_drawable (tmp_list->data))
gtk_drag_find_widget (tmp_list->data, &new_data);
g_object_unref (tmp_list->data);
}

View File

@ -5579,7 +5579,7 @@ gtk_entry_draw_text (GtkEntry *entry)
if (gtk_entry_get_display_mode (entry) == DISPLAY_BLANK)
return;
if (GTK_WIDGET_DRAWABLE (entry))
if (gtk_widget_is_drawable (widget))
{
GdkColor text_color, bar_text_color;
gint pos_x, pos_y;
@ -5664,12 +5664,12 @@ static void
gtk_entry_draw_cursor (GtkEntry *entry,
CursorType type)
{
GtkWidget *widget = GTK_WIDGET (entry);
GdkKeymap *keymap = gdk_keymap_get_for_display (gtk_widget_get_display (GTK_WIDGET (entry)));
PangoDirection keymap_direction = gdk_keymap_get_direction (keymap);
if (GTK_WIDGET_DRAWABLE (entry))
if (gtk_widget_is_drawable (widget))
{
GtkWidget *widget = GTK_WIDGET (entry);
GdkRectangle cursor_location;
gboolean split_cursor;
PangoRectangle cursor_rect;
@ -5786,7 +5786,7 @@ gtk_entry_draw_cursor (GtkEntry *entry,
static void
gtk_entry_queue_draw (GtkEntry *entry)
{
if (GTK_WIDGET_DRAWABLE (entry))
if (gtk_widget_is_drawable (GTK_WIDGET (entry)))
gdk_window_invalidate_rect (entry->text_area, NULL, FALSE);
}
@ -9856,6 +9856,7 @@ void
gtk_entry_set_progress_fraction (GtkEntry *entry,
gdouble fraction)
{
GtkWidget *widget;
GtkEntryPrivate *private;
gdouble old_fraction;
gint x, y, width, height;
@ -9863,6 +9864,7 @@ gtk_entry_set_progress_fraction (GtkEntry *entry,
g_return_if_fail (GTK_IS_ENTRY (entry));
widget = GTK_WIDGET (entry);
private = GTK_ENTRY_GET_PRIVATE (entry);
if (private->progress_pulse_mode)
@ -9870,8 +9872,8 @@ gtk_entry_set_progress_fraction (GtkEntry *entry,
else
old_fraction = private->progress_fraction;
if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (entry)))
get_progress_area (GTK_WIDGET(entry), &old_x, &old_y, &old_width, &old_height);
if (gtk_widget_is_drawable (widget))
get_progress_area (widget, &old_x, &old_y, &old_width, &old_height);
fraction = CLAMP (fraction, 0.0, 1.0);
@ -9879,12 +9881,12 @@ gtk_entry_set_progress_fraction (GtkEntry *entry,
private->progress_pulse_mode = FALSE;
private->progress_pulse_current = 0.0;
if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (entry)))
if (gtk_widget_is_drawable (widget))
{
get_progress_area (GTK_WIDGET(entry), &x, &y, &width, &height);
get_progress_area (widget, &x, &y, &width, &height);
if ((x != old_x) || (y != old_y) || (width != old_width) || (height != old_height))
gtk_widget_queue_draw (GTK_WIDGET (entry));
gtk_widget_queue_draw (widget);
}
if (fraction != old_fraction)

View File

@ -560,7 +560,7 @@ static gboolean
gtk_event_box_expose (GtkWidget *widget,
GdkEventExpose *event)
{
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
if (gtk_widget_get_has_window (widget))
gtk_event_box_paint (widget, &event->area);

View File

@ -897,7 +897,7 @@ static gboolean
gtk_expander_expose (GtkWidget *widget,
GdkEventExpose *event)
{
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
GtkExpander *expander = GTK_EXPANDER (widget);

View File

@ -187,7 +187,7 @@ file_chooser_widget_default_size_changed (GtkWidget *widget,
/* Unset any previously set size */
gtk_widget_set_size_request (GTK_WIDGET (dialog), -1, -1);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
/* Force a size request of everything before we start. This will make sure
* that widget->requisition is meaningful. */

View File

@ -492,19 +492,22 @@ void
gtk_frame_set_shadow_type (GtkFrame *frame,
GtkShadowType type)
{
GtkWidget *widget;
g_return_if_fail (GTK_IS_FRAME (frame));
if ((GtkShadowType) frame->shadow_type != type)
{
widget = GTK_WIDGET (frame);
frame->shadow_type = type;
g_object_notify (G_OBJECT (frame), "shadow-type");
if (GTK_WIDGET_DRAWABLE (frame))
if (gtk_widget_is_drawable (widget))
{
gtk_widget_queue_draw (GTK_WIDGET (frame));
gtk_widget_queue_draw (widget);
}
gtk_widget_queue_resize (GTK_WIDGET (frame));
gtk_widget_queue_resize (widget);
}
}
@ -532,7 +535,7 @@ gtk_frame_paint (GtkWidget *widget,
GtkFrame *frame;
gint x, y, width, height;
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
frame = GTK_FRAME (widget);
@ -588,7 +591,7 @@ static gboolean
gtk_frame_expose (GtkWidget *widget,
GdkEventExpose *event)
{
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
gtk_frame_paint (widget, &event->area);

View File

@ -961,7 +961,7 @@ gtk_handle_box_expose (GtkWidget *widget,
{
GtkHandleBox *hb;
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
hb = GTK_HANDLE_BOX (widget);

View File

@ -1271,7 +1271,7 @@ gtk_hsv_expose (GtkWidget *widget,
hsv = GTK_HSV (widget);
priv = hsv->priv;
if (!(GTK_WIDGET_DRAWABLE (widget) && event->window == widget->window))
if (!(event->window == widget->window && gtk_widget_is_drawable (widget)))
return FALSE;
rect.x = widget->allocation.x;

View File

@ -1618,7 +1618,7 @@ animation_timeout (gpointer data)
gtk_widget_queue_draw (GTK_WIDGET (image));
if (GTK_WIDGET_DRAWABLE (image))
if (gtk_widget_is_drawable (GTK_WIDGET (image)))
gdk_window_process_updates (GTK_WIDGET (image)->window, TRUE);
}

View File

@ -3449,13 +3449,15 @@ get_cursor_direction (GtkLabel *label)
static void
gtk_label_draw_cursor (GtkLabel *label, gint xoffset, gint yoffset)
{
GtkWidget *widget;
if (label->select_info == NULL)
return;
if (GTK_WIDGET_DRAWABLE (label))
{
GtkWidget *widget = GTK_WIDGET (label);
widget = GTK_WIDGET (label);
if (gtk_widget_is_drawable (widget))
{
PangoDirection keymap_direction;
PangoDirection cursor_direction;
PangoRectangle strong_pos, weak_pos;

View File

@ -549,7 +549,7 @@ gtk_list_item_expose (GtkWidget *widget,
{
g_return_val_if_fail (widget != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
if (widget->state == GTK_STATE_NORMAL)
{

View File

@ -1905,7 +1905,7 @@ gtk_menu_reposition (GtkMenu *menu)
{
g_return_if_fail (GTK_IS_MENU (menu));
if (GTK_WIDGET_DRAWABLE (menu) && !menu->torn_off)
if (!menu->torn_off && gtk_widget_is_drawable (GTK_WIDGET (menu)))
gtk_menu_position (menu);
}
@ -2867,7 +2867,7 @@ gtk_menu_expose (GtkWidget *widget,
g_return_val_if_fail (GTK_IS_MENU (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
gtk_menu_paint (widget, event);

View File

@ -509,7 +509,7 @@ gtk_menu_bar_paint (GtkWidget *widget,
{
g_return_if_fail (GTK_IS_MENU_BAR (widget));
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
gint border;
@ -533,7 +533,7 @@ gtk_menu_bar_expose (GtkWidget *widget,
g_return_val_if_fail (GTK_IS_MENU_BAR (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
gtk_menu_bar_paint (widget, &event->area);

View File

@ -1197,7 +1197,7 @@ gtk_menu_item_paint (GtkWidget *widget,
gint x, y;
gint border_width = GTK_CONTAINER (widget)->border_width;
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
menu_item = GTK_MENU_ITEM (widget);
@ -1318,7 +1318,7 @@ gtk_menu_item_expose (GtkWidget *widget,
g_return_val_if_fail (GTK_IS_MENU_ITEM (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
gtk_menu_item_paint (widget, &event->area);

View File

@ -182,6 +182,8 @@ gtk_misc_set_alignment (GtkMisc *misc,
gfloat xalign,
gfloat yalign)
{
GtkWidget *widget;
g_return_if_fail (GTK_IS_MISC (misc));
if (xalign < 0.0)
@ -208,13 +210,9 @@ gtk_misc_set_alignment (GtkMisc *misc,
/* clear the area that was allocated before the change
*/
if (GTK_WIDGET_DRAWABLE (misc))
{
GtkWidget *widget;
widget = GTK_WIDGET (misc);
gtk_widget_queue_draw (widget);
}
widget = GTK_WIDGET (misc);
if (gtk_widget_is_drawable (widget))
gtk_widget_queue_draw (widget);
g_object_thaw_notify (G_OBJECT (misc));
}
@ -275,7 +273,7 @@ gtk_misc_set_padding (GtkMisc *misc,
requisition->width += misc->xpad * 2;
requisition->height += misc->ypad * 2;
if (GTK_WIDGET_DRAWABLE (misc))
if (gtk_widget_is_drawable (GTK_WIDGET (misc)))
gtk_widget_queue_resize (GTK_WIDGET (misc));
g_object_thaw_notify (G_OBJECT (misc));

View File

@ -2311,7 +2311,7 @@ gtk_notebook_expose (GtkWidget *widget,
gtk_container_propagate_expose (GTK_CONTAINER (notebook),
notebook->cur_page->tab_label, event);
}
else if (GTK_WIDGET_DRAWABLE (widget))
else if (gtk_widget_is_drawable (widget))
{
gtk_notebook_paint (widget, &event->area);
if (notebook->show_tabs)
@ -2328,7 +2328,7 @@ gtk_notebook_expose (GtkWidget *widget,
pages = pages->next;
if (page->tab_label->window == event->window &&
GTK_WIDGET_DRAWABLE (page->tab_label))
gtk_widget_is_drawable (page->tab_label))
gtk_container_propagate_expose (GTK_CONTAINER (notebook),
page->tab_label, event);
}
@ -2343,7 +2343,7 @@ gtk_notebook_expose (GtkWidget *widget,
for (i = 0; i < N_ACTION_WIDGETS; i++)
{
if (priv->action_widget[i] &&
GTK_WIDGET_DRAWABLE (priv->action_widget[i]))
gtk_widget_is_drawable (priv->action_widget[i]))
gtk_container_propagate_expose (GTK_CONTAINER (notebook),
priv->action_widget[i], event);
}
@ -3272,7 +3272,7 @@ gtk_notebook_draw_focus (GtkWidget *widget,
{
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
if (GTK_WIDGET_HAS_FOCUS (widget) && GTK_WIDGET_DRAWABLE (widget) &&
if (GTK_WIDGET_HAS_FOCUS (widget) && gtk_widget_is_drawable (widget) &&
notebook->show_tabs && notebook->cur_page &&
notebook->cur_page->tab_label->window == event->window)
{
@ -4837,7 +4837,7 @@ gtk_notebook_paint (GtkWidget *widget,
gboolean is_rtl;
gint tab_pos;
if (!GTK_WIDGET_DRAWABLE (widget))
if (!gtk_widget_is_drawable (widget))
return;
notebook = GTK_NOTEBOOK (widget);
@ -5014,7 +5014,9 @@ gtk_notebook_draw_arrow (GtkNotebook *notebook,
GtkArrowType arrow;
gboolean is_rtl, left;
if (GTK_WIDGET_DRAWABLE (notebook))
widget = GTK_WIDGET (notebook);
if (gtk_widget_is_drawable (widget))
{
gint scroll_arrow_hlength;
gint scroll_arrow_vlength;
@ -5022,8 +5024,6 @@ gtk_notebook_draw_arrow (GtkNotebook *notebook,
gtk_notebook_get_arrow_rect (notebook, &arrow_rect, nbarrow);
widget = GTK_WIDGET (notebook);
is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
left = (ARROW_IS_LEFT (nbarrow) && !is_rtl) ||
(!ARROW_IS_LEFT (nbarrow) && is_rtl);

View File

@ -531,7 +531,7 @@ gtk_progress_bar_expose (GtkWidget *widget,
pbar = GTK_PROGRESS_BAR (widget);
if (GTK_WIDGET_DRAWABLE (widget) && pbar->dirty)
if (pbar->dirty && gtk_widget_is_drawable (widget))
gtk_progress_bar_paint (GTK_PROGRESS (pbar));
return GTK_WIDGET_CLASS (gtk_progress_bar_parent_class)->expose_event (widget, event);
@ -1048,7 +1048,7 @@ gtk_progress_bar_set_bar_style_internal (GtkProgressBar *pbar,
{
pbar->bar_style = bar_style;
if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (pbar)))
if (gtk_widget_is_drawable (GTK_WIDGET (pbar)))
gtk_widget_queue_resize (GTK_WIDGET (pbar));
g_object_notify (G_OBJECT (pbar), "bar-style");
@ -1066,7 +1066,7 @@ gtk_progress_bar_set_discrete_blocks_internal (GtkProgressBar *pbar,
{
pbar->blocks = blocks;
if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (pbar)))
if (gtk_widget_is_drawable (GTK_WIDGET (pbar)))
gtk_widget_queue_resize (GTK_WIDGET (pbar));
g_object_notify (G_OBJECT (pbar), "discrete-blocks");
@ -1227,7 +1227,7 @@ gtk_progress_bar_set_orientation (GtkProgressBar *pbar,
{
pbar->orientation = orientation;
if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (pbar)))
if (gtk_widget_is_drawable (GTK_WIDGET (pbar)))
gtk_widget_queue_resize (GTK_WIDGET (pbar));
g_object_notify (G_OBJECT (pbar), "orientation");

View File

@ -686,9 +686,10 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
gint focus_pad;
gboolean interior_focus;
if (GTK_WIDGET_DRAWABLE (check_button))
widget = GTK_WIDGET (check_button);
if (gtk_widget_is_drawable (widget))
{
widget = GTK_WIDGET (check_button);
button = GTK_BUTTON (check_button);
toggle_button = GTK_TOGGLE_BUTTON (check_button);

View File

@ -2599,9 +2599,11 @@ static gboolean
force_repaint (gpointer data)
{
GtkRange *range = GTK_RANGE (data);
range->layout->repaint_id = 0;
if (GTK_WIDGET_DRAWABLE (range))
if (gtk_widget_is_drawable (GTK_WIDGET (range)))
gdk_window_process_updates (GTK_WIDGET (range)->window, FALSE);
return FALSE;
}

View File

@ -306,7 +306,7 @@ gtk_ruler_set_metric (GtkRuler *ruler,
ruler->metric = (GtkRulerMetric *) &ruler_metrics[metric];
if (GTK_WIDGET_DRAWABLE (ruler))
if (gtk_widget_is_drawable (GTK_WIDGET (ruler)))
gtk_widget_queue_draw (GTK_WIDGET (ruler));
g_object_notify (G_OBJECT (ruler), "metric");
@ -379,7 +379,7 @@ gtk_ruler_set_range (GtkRuler *ruler,
}
g_object_thaw_notify (G_OBJECT (ruler));
if (GTK_WIDGET_DRAWABLE (ruler))
if (gtk_widget_is_drawable (GTK_WIDGET (ruler)))
gtk_widget_queue_draw (GTK_WIDGET (ruler));
}
@ -554,7 +554,7 @@ static gboolean
gtk_ruler_expose (GtkWidget *widget,
GdkEventExpose *event)
{
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
GtkRuler *ruler = GTK_RULER (widget);
@ -632,7 +632,7 @@ gtk_ruler_real_draw_ticks (GtkRuler *ruler)
PangoLayout *layout;
PangoRectangle logical_rect, ink_rect;
if (!GTK_WIDGET_DRAWABLE (ruler))
if (!gtk_widget_is_drawable (widget))
return;
xthickness = widget->style->xthickness;
@ -833,7 +833,7 @@ gtk_ruler_real_draw_pos (GtkRuler *ruler)
gint ythickness;
gdouble increment;
if (GTK_WIDGET_DRAWABLE (ruler))
if (gtk_widget_is_drawable (widget))
{
xthickness = widget->style->xthickness;
ythickness = widget->style->ythickness;

View File

@ -819,7 +819,7 @@ gtk_scrolled_window_set_shadow_type (GtkScrolledWindow *scrolled_window,
{
scrolled_window->shadow_type = type;
if (GTK_WIDGET_DRAWABLE (scrolled_window))
if (gtk_widget_is_drawable (GTK_WIDGET (scrolled_window)))
gtk_widget_queue_draw (GTK_WIDGET (scrolled_window));
gtk_widget_queue_resize (GTK_WIDGET (scrolled_window));
@ -1063,7 +1063,7 @@ static gboolean
gtk_scrolled_window_expose (GtkWidget *widget,
GdkEventExpose *event)
{
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
gtk_scrolled_window_paint (widget, &event->area);

View File

@ -184,7 +184,7 @@ gtk_separator_expose (GtkWidget *widget,
gint separator_width;
gint separator_height;
if (!GTK_WIDGET_DRAWABLE (widget))
if (!gtk_widget_is_drawable (widget))
return FALSE;
gtk_widget_style_get (widget,

View File

@ -731,7 +731,7 @@ gtk_spin_button_expose (GtkWidget *widget,
{
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
if (event->window == spin->panel)
{
@ -804,7 +804,7 @@ gtk_spin_button_draw_arrow (GtkSpinButton *spin_button,
widget = GTK_WIDGET (spin_button);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
width = spin_button_get_arrow_size (spin_button) + 2 * widget->style->xthickness;

View File

@ -105,7 +105,7 @@ gtk_tearoff_menu_item_paint (GtkWidget *widget,
GtkArrowType arrow_type;
GtkTextDirection direction;
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
menu_item = GTK_MENU_ITEM (widget);

View File

@ -4679,7 +4679,7 @@ gtk_text_view_draw_focus (GtkWidget *widget)
"interior-focus", &interior_focus,
NULL);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
if (GTK_WIDGET_HAS_FOCUS (widget) && !interior_focus)
{

View File

@ -419,7 +419,7 @@ static gint
gtk_toggle_button_expose (GtkWidget *widget,
GdkEventExpose *event)
{
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
GtkWidget *child = GTK_BIN (widget)->child;
GtkButton *button = GTK_BUTTON (widget);

View File

@ -867,7 +867,7 @@ gtk_toolbar_expose (GtkWidget *widget,
border_width = GTK_CONTAINER (widget)->border_width;
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
gtk_paint_box (widget->style,
widget->window,

View File

@ -553,7 +553,7 @@ child_location_foreach (GtkWidget *child,
struct ChildLocation *child_loc = data;
/* Ignore invisible widgets */
if (!GTK_WIDGET_DRAWABLE (child))
if (!gtk_widget_is_drawable (child))
return;
x = 0;

View File

@ -212,7 +212,7 @@ gtk_tree_item_subtree_button_changed_state (GtkWidget *widget)
else
gdk_window_set_background (widget->window, &widget->style->bg[widget->state]);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
gdk_window_clear_area (widget->window, 0, 0,
widget->allocation.width, widget->allocation.height);
}
@ -603,7 +603,7 @@ gtk_tree_item_paint (GtkWidget *widget,
* line. (Like the way that the tree in Windows Explorer
* works).
*/
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
tree_item = GTK_TREE_ITEM(widget);
@ -681,7 +681,7 @@ gtk_tree_item_expose_child (GtkWidget *child,
GdkEventExpose *event;
} *data = client_data;
if (GTK_WIDGET_DRAWABLE (child) &&
if (gtk_widget_is_drawable (child) &&
!gtk_widget_get_has_window (child) &&
(child->window == data->event->window))
{
@ -709,7 +709,7 @@ gtk_tree_item_expose (GtkWidget *widget,
GdkEventExpose *event;
} data;
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
gtk_tree_item_paint (widget, &event->area);

View File

@ -671,7 +671,7 @@ static void
gtk_viewport_paint (GtkWidget *widget,
GdkRectangle *area)
{
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
GtkViewport *viewport = GTK_VIEWPORT (widget);
@ -688,7 +688,7 @@ gtk_viewport_expose (GtkWidget *widget,
{
GtkViewport *viewport;
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
viewport = GTK_VIEWPORT (widget);

View File

@ -3015,7 +3015,7 @@ gtk_widget_queue_draw_child (GtkWidget *widget)
GtkWidget *parent;
parent = widget->parent;
if (parent && GTK_WIDGET_DRAWABLE (parent))
if (parent && gtk_widget_is_drawable (parent))
gtk_widget_queue_draw_area (parent,
widget->allocation.x,
widget->allocation.y,
@ -3831,7 +3831,7 @@ gtk_widget_draw (GtkWidget *widget,
{
g_return_if_fail (GTK_IS_WIDGET (widget));
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
if (area)
gtk_widget_queue_draw_area (widget,
@ -4284,7 +4284,7 @@ gtk_widget_real_can_activate_accel (GtkWidget *widget,
guint signal_id)
{
/* widgets must be onscreen for accels to take effect */
return GTK_WIDGET_IS_SENSITIVE (widget) && GTK_WIDGET_DRAWABLE (widget) && gdk_window_is_viewable (widget->window);
return GTK_WIDGET_IS_SENSITIVE (widget) && gtk_widget_is_drawable (widget) && gdk_window_is_viewable (widget->window);
}
/**
@ -5786,7 +5786,7 @@ gtk_widget_set_state (GtkWidget *widget,
gtk_widget_propagate_state (widget, &data);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
gtk_widget_queue_draw (widget);
}
}
@ -6073,7 +6073,7 @@ gtk_widget_set_app_paintable (GtkWidget *widget,
else
GTK_WIDGET_UNSET_FLAGS (widget, GTK_APP_PAINTABLE);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
gtk_widget_queue_draw (widget);
g_object_notify (G_OBJECT (widget), "app-paintable");
@ -6240,7 +6240,7 @@ gtk_widget_set_sensitive (GtkWidget *widget,
data.parent_sensitive = TRUE;
gtk_widget_propagate_state (widget, &data);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
gtk_widget_queue_draw (widget);
g_object_notify (G_OBJECT (widget), "sensitive");

View File

@ -240,13 +240,17 @@ typedef enum
*/
#define GTK_WIDGET_VISIBLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_VISIBLE) != 0)
#ifndef GTK_DISABLE_DEPRECATED
/**
* GTK_WIDGET_DRAWABLE:
* @wid: a #GtkWidget.
*
* Evaluates to %TRUE if the widget is mapped and visible.
*
* Deprecated: 2.20: Use gtk_widget_is_drawable() instead.
*/
#define GTK_WIDGET_DRAWABLE(wid) (GTK_WIDGET_VISIBLE (wid) && GTK_WIDGET_MAPPED (wid))
#endif
/**
* GTK_WIDGET_SENSITIVE:

View File

@ -531,7 +531,7 @@ test_widgets_for_current_action (GtkFileChooserDialog *dialog,
&& impl->save_folder_label == NULL
&& impl->save_folder_combo == NULL
&& impl->save_expander == NULL
&& GTK_IS_CONTAINER (impl->browse_widgets) && GTK_WIDGET_DRAWABLE (impl->browse_widgets));
&& GTK_IS_CONTAINER (impl->browse_widgets) && gtk_widget_is_drawable (impl->browse_widgets));
}
else if (has_action (save_actions, G_N_ELEMENTS (save_actions), impl->action))
{
@ -539,11 +539,11 @@ test_widgets_for_current_action (GtkFileChooserDialog *dialog,
* _gtk_file_chooser_entry_get_type(), which is a non-exported symbol.
* So, we just test impl->location_entry for being non-NULL
*/
passed = passed && (GTK_IS_CONTAINER (impl->save_widgets) && GTK_WIDGET_DRAWABLE (impl->save_widgets)
&& impl->location_entry != NULL && GTK_WIDGET_DRAWABLE (impl->location_entry)
&& GTK_IS_LABEL (impl->save_folder_label) && GTK_WIDGET_DRAWABLE (impl->save_folder_label)
&& GTK_IS_COMBO_BOX (impl->save_folder_combo) && GTK_WIDGET_DRAWABLE (impl->save_folder_combo)
&& GTK_IS_EXPANDER (impl->save_expander) && GTK_WIDGET_DRAWABLE (impl->save_expander)
passed = passed && (GTK_IS_CONTAINER (impl->save_widgets) && gtk_widget_is_drawable (impl->save_widgets)
&& impl->location_entry != NULL && gtk_widget_is_drawable (impl->location_entry)
&& GTK_IS_LABEL (impl->save_folder_label) && gtk_widget_is_drawable (impl->save_folder_label)
&& GTK_IS_COMBO_BOX (impl->save_folder_combo) && gtk_widget_is_drawable (impl->save_folder_combo)
&& GTK_IS_EXPANDER (impl->save_expander) && gtk_widget_is_drawable (impl->save_expander)
&& GTK_IS_CONTAINER (impl->browse_widgets));
/* FIXME: we are in a SAVE mode; test the visibility and sensitivity of

View File

@ -666,7 +666,7 @@ gail_widget_get_extents (AtkComponent *component,
*width = widget->allocation.width;
*height = widget->allocation.height;
if (!gail_widget_on_screen (widget) || (!GTK_WIDGET_DRAWABLE (widget)))
if (!gail_widget_on_screen (widget) || (!gtk_widget_is_drawable (widget)))
{
*x = G_MININT;
*y = G_MININT;

View File

@ -576,7 +576,7 @@ gail_window_get_extents (AtkComponent *component,
*width = rect.width;
*height = rect.height;
if (!GTK_WIDGET_DRAWABLE (widget))
if (!gtk_widget_is_drawable (widget))
{
*x = G_MININT;
*y = G_MININT;

View File

@ -572,7 +572,7 @@ gtk_offscreen_box_expose (GtkWidget *widget,
{
GtkOffscreenBox *offscreen_box = GTK_OFFSCREEN_BOX (widget);
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
if (event->window == widget->window)
{

View File

@ -11720,7 +11720,7 @@ progressbar_toggle_ellipsize (GtkWidget *widget,
gpointer data)
{
ProgressData *pdata = data;
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
gint i = gtk_option_menu_get_history (GTK_OPTION_MENU (widget));
gtk_progress_bar_set_ellipsize (GTK_PROGRESS_BAR (pdata->pbar), i);
@ -12954,7 +12954,7 @@ scroll_test_adjustment_changed (GtkAdjustment *adj, GtkWidget *widget)
dy = scroll_test_pos - (int)adj->value;
scroll_test_pos = adj->value;
if (!GTK_WIDGET_DRAWABLE (widget))
if (!gtk_widget_is_drawable (widget))
return;
gdk_window_scroll (widget->window, 0, dy);
gdk_window_process_updates (widget->window, FALSE);

View File

@ -9,7 +9,7 @@ da_expose (GtkWidget *widget,
GdkPixmap *pixmap;
cairo_t *cr;
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
pixmap = gtk_offscreen_window_get_pixmap (offscreen);