summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkalignment.c4
-rw-r--r--gtk/gtkaspectframe.c2
-rw-r--r--gtk/gtkassistant.c20
-rw-r--r--gtk/gtkbbox.c7
-rw-r--r--gtk/gtkbin.c4
-rw-r--r--gtk/gtkbox.c18
-rw-r--r--gtk/gtkbutton.c4
-rw-r--r--gtk/gtkcheckbutton.c8
-rw-r--r--gtk/gtkclist.c22
-rw-r--r--gtk/gtkcombo.c2
-rw-r--r--gtk/gtkcombobox.c8
-rw-r--r--gtk/gtkcontainer.c4
-rw-r--r--gtk/gtkdialog.c2
-rw-r--r--gtk/gtkdnd.c2
-rw-r--r--gtk/gtkentry.c14
-rw-r--r--gtk/gtkentrycompletion.c4
-rw-r--r--gtk/gtkeventbox.c10
-rw-r--r--gtk/gtkexpander.c20
-rw-r--r--gtk/gtkfilechooserbutton.c2
-rw-r--r--gtk/gtkfilechooserdefault.c4
-rw-r--r--gtk/gtkfixed.c15
-rw-r--r--gtk/gtkfontbutton.c2
-rw-r--r--gtk/gtkframe.c14
-rw-r--r--gtk/gtkhandlebox.c6
-rw-r--r--gtk/gtkiconview.c2
-rw-r--r--gtk/gtkimage.c10
-rw-r--r--gtk/gtkimagemenuitem.c11
-rw-r--r--gtk/gtklabel.c2
-rw-r--r--gtk/gtklayout.c7
-rw-r--r--gtk/gtklist.c8
-rw-r--r--gtk/gtklistitem.c2
-rw-r--r--gtk/gtkmain.c2
-rw-r--r--gtk/gtkmenu.c18
-rw-r--r--gtk/gtkmenubar.c8
-rw-r--r--gtk/gtkmenuitem.c8
-rw-r--r--gtk/gtkmenushell.c16
-rw-r--r--gtk/gtkmenutoolbutton.c4
-rw-r--r--gtk/gtknotebook.c104
-rw-r--r--gtk/gtkoffscreenwindow.c6
-rw-r--r--gtk/gtkoptionmenu.c11
-rw-r--r--gtk/gtkpaned.c32
-rw-r--r--gtk/gtkpathbar.c2
-rw-r--r--gtk/gtkpixmap.c4
-rw-r--r--gtk/gtkplug.c8
-rw-r--r--gtk/gtkradiobutton.c2
-rw-r--r--gtk/gtkscale.c7
-rw-r--r--gtk/gtkscrolledwindow.c14
-rw-r--r--gtk/gtkstatusbar.c2
-rw-r--r--gtk/gtktable.c32
-rw-r--r--gtk/gtktextview.c7
-rw-r--r--gtk/gtktogglebutton.c2
-rw-r--r--gtk/gtktoolbar.c8
-rw-r--r--gtk/gtktoolitem.c4
-rw-r--r--gtk/gtktoolitemgroup.c19
-rw-r--r--gtk/gtktooltip.c2
-rw-r--r--gtk/gtktree.c14
-rw-r--r--gtk/gtktreeitem.c14
-rw-r--r--gtk/gtktreeview.c14
-rw-r--r--gtk/gtkuimanager.c4
-rw-r--r--gtk/gtkviewport.c12
-rw-r--r--gtk/gtkwidget.c38
-rw-r--r--gtk/gtkwidget.h4
-rw-r--r--gtk/gtkwin32embedwidget.c4
-rw-r--r--gtk/gtkwindow.c33
-rw-r--r--gtk/tests/filechooser.c4
65 files changed, 365 insertions, 338 deletions
diff --git a/gtk/gtkalignment.c b/gtk/gtkalignment.c
index 49c5271dc3..51fad6f3f8 100644
--- a/gtk/gtkalignment.c
+++ b/gtk/gtkalignment.c
@@ -421,7 +421,7 @@ gtk_alignment_size_request (GtkWidget *widget,
requisition->width = GTK_CONTAINER (widget)->border_width * 2;
requisition->height = GTK_CONTAINER (widget)->border_width * 2;
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkRequisition child_requisition;
@@ -456,7 +456,7 @@ gtk_alignment_size_allocate (GtkWidget *widget,
alignment = GTK_ALIGNMENT (widget);
bin = GTK_BIN (widget);
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
gtk_widget_get_child_requisition (bin->child, &child_requisition);
diff --git a/gtk/gtkaspectframe.c b/gtk/gtkaspectframe.c
index 2661b29d2b..db0a839454 100644
--- a/gtk/gtkaspectframe.c
+++ b/gtk/gtkaspectframe.c
@@ -261,7 +261,7 @@ gtk_aspect_frame_compute_child_allocation (GtkFrame *frame,
GtkBin *bin = GTK_BIN (frame);
gdouble ratio;
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkAllocation full_allocation;
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index 33c54a0b8a..0f112e6f3c 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -400,7 +400,7 @@ default_forward_function (gint current_page, gpointer data)
page_info = (GtkAssistantPage *) page_node->data;
- while (page_node && !GTK_WIDGET_VISIBLE (page_info->page))
+ while (page_node && !gtk_widget_get_visible (page_info->page))
{
page_node = page_node->next;
current_page++;
@@ -571,7 +571,7 @@ set_current_page (GtkAssistant *assistant,
g_signal_emit (assistant, signals [PREPARE], 0, priv->current_page->page);
- if (GTK_WIDGET_VISIBLE (priv->current_page->page) && GTK_WIDGET_MAPPED (assistant))
+ if (gtk_widget_get_visible (priv->current_page->page) && GTK_WIDGET_MAPPED (assistant))
{
gtk_widget_set_child_visible (priv->current_page->page, TRUE);
gtk_widget_map (priv->current_page->page);
@@ -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_get_sensitive (button[i]))
+ if (gtk_widget_get_visible (button[i]) && gtk_widget_get_sensitive (button[i]))
{
gtk_widget_grab_focus (button[i]);
break;
@@ -688,7 +688,7 @@ on_assistant_back (GtkWidget *widget,
g_slist_free_1 (page_node);
}
while (page_info->type == GTK_ASSISTANT_PAGE_PROGRESS ||
- !GTK_WIDGET_VISIBLE (page_info->page));
+ !gtk_widget_get_visible (page_info->page));
set_current_page (assistant, page_info);
}
@@ -923,7 +923,7 @@ remove_page (GtkAssistant *assistant,
*/
page_node = priv->pages;
- while (page_node && !GTK_WIDGET_VISIBLE (((GtkAssistantPage *) page_node->data)->page))
+ while (page_node && !gtk_widget_get_visible (((GtkAssistantPage *) page_node->data)->page))
page_node = page_node->next;
if (page_node == element)
@@ -1209,7 +1209,7 @@ gtk_assistant_size_allocate (GtkWidget *widget,
child_allocation.height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width -
priv->header_image->allocation.height - 2 * header_padding - ACTION_AREA_SPACING - priv->action_area->allocation.height - 2 * content_padding;
- if (GTK_WIDGET_VISIBLE (priv->sidebar_image))
+ if (gtk_widget_get_visible (priv->sidebar_image))
{
if (!rtl)
child_allocation.x += priv->sidebar_image->allocation.width;
@@ -1240,7 +1240,7 @@ gtk_assistant_map (GtkWidget *widget)
gtk_widget_map (priv->header_image);
gtk_widget_map (priv->action_area);
- if (GTK_WIDGET_VISIBLE (priv->sidebar_image) &&
+ if (gtk_widget_get_visible (priv->sidebar_image) &&
!GTK_WIDGET_MAPPED (priv->sidebar_image))
gtk_widget_map (priv->sidebar_image);
@@ -1250,7 +1250,7 @@ gtk_assistant_map (GtkWidget *widget)
{
page_node = priv->pages;
- while (page_node && !GTK_WIDGET_VISIBLE (((GtkAssistantPage *) page_node->data)->page))
+ while (page_node && !gtk_widget_get_visible (((GtkAssistantPage *) page_node->data)->page))
page_node = page_node->next;
if (page_node)
@@ -1258,7 +1258,7 @@ gtk_assistant_map (GtkWidget *widget)
}
if (page &&
- GTK_WIDGET_VISIBLE (page->page) &&
+ gtk_widget_get_visible (page->page) &&
!GTK_WIDGET_MAPPED (page->page))
set_current_page (assistant, page);
@@ -1338,7 +1338,7 @@ assistant_paint_colored_box (GtkWidget *widget)
content_x = content_padding + border_width;
content_width = widget->allocation.width - 2 * content_padding - 2 * border_width;
- if (GTK_WIDGET_VISIBLE (priv->sidebar_image))
+ if (gtk_widget_get_visible (priv->sidebar_image))
{
if (!rtl)
content_x += priv->sidebar_image->allocation.width;
diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c
index 3690a6b62c..5760509f1b 100644
--- a/gtk/gtkbbox.c
+++ b/gtk/gtkbbox.c
@@ -390,7 +390,8 @@ gtk_button_box_set_child_secondary (GtkButtonBox *widget,
gtk_widget_child_notify (child, "secondary");
- if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (child))
+ if (gtk_widget_get_visible (GTK_WIDGET (widget))
+ && gtk_widget_get_visible (child))
gtk_widget_queue_resize (child);
}
@@ -457,7 +458,7 @@ _gtk_button_box_child_requisition (GtkWidget *widget,
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
nchildren += 1;
gtk_widget_size_request (child->widget, &child_requisition);
@@ -773,7 +774,7 @@ gtk_button_box_size_allocate (GtkWidget *widget,
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
child_allocation.width = child_width;
child_allocation.height = child_height;
diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c
index e025994718..bb45aac32e 100644
--- a/gtk/gtkbin.c
+++ b/gtk/gtkbin.c
@@ -104,12 +104,12 @@ gtk_bin_remove (GtkContainer *container,
g_return_if_fail (bin->child == child);
- widget_was_visible = GTK_WIDGET_VISIBLE (child);
+ widget_was_visible = gtk_widget_get_visible (child);
gtk_widget_unparent (child);
bin->child = NULL;
- /* queue resize regardless of GTK_WIDGET_VISIBLE (container),
+ /* queue resize regardless of gtk_widget_get_visible (container),
* since that's what is needed by toplevels, which derive from GtkBin.
*/
if (widget_was_visible)
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index 50c588bb61..1e1f9dc924 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -273,7 +273,7 @@ gtk_box_size_request (GtkWidget *widget,
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
GtkRequisition child_requisition;
@@ -354,7 +354,7 @@ gtk_box_size_allocate (GtkWidget *widget,
{
child = children->data;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
nvis_children += 1;
if (child->expand)
@@ -414,7 +414,7 @@ gtk_box_size_allocate (GtkWidget *widget,
child = children->data;
children = children->next;
- if ((child->pack == GTK_PACK_START) && GTK_WIDGET_VISIBLE (child->widget))
+ if ((child->pack == GTK_PACK_START) && gtk_widget_get_visible (child->widget))
{
if (box->homogeneous)
{
@@ -513,7 +513,7 @@ gtk_box_size_allocate (GtkWidget *widget,
child = children->data;
children = children->next;
- if ((child->pack == GTK_PACK_END) && GTK_WIDGET_VISIBLE (child->widget))
+ if ((child->pack == GTK_PACK_END) && gtk_widget_get_visible (child->widget))
{
GtkRequisition child_requisition;
@@ -1060,7 +1060,8 @@ gtk_box_reorder_child (GtkBox *box,
box->children = g_list_insert_before (box->children, new_link, child_info);
gtk_widget_child_notify (child, "position");
- if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (box))
+ if (gtk_widget_get_visible (child)
+ && gtk_widget_get_visible (GTK_WIDGET (box)))
gtk_widget_queue_resize (child);
}
@@ -1162,7 +1163,8 @@ gtk_box_set_child_packing (GtkBox *box,
child_info->pack = GTK_PACK_START;
gtk_widget_child_notify (child, "pack-type");
- if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (box))
+ if (gtk_widget_get_visible (child)
+ && gtk_widget_get_visible (GTK_WIDGET (box)))
gtk_widget_queue_resize (child);
}
gtk_widget_thaw_child_notify (child);
@@ -1209,14 +1211,14 @@ gtk_box_remove (GtkContainer *container,
{
gboolean was_visible;
- was_visible = GTK_WIDGET_VISIBLE (widget);
+ was_visible = gtk_widget_get_visible (widget);
gtk_widget_unparent (widget);
box->children = g_list_remove_link (box->children, children);
g_list_free (children);
g_free (child);
- /* queue resize regardless of GTK_WIDGET_VISIBLE (container),
+ /* queue resize regardless of gtk_widget_get_visible (container),
* since that's what is needed by toplevels.
*/
if (was_visible)
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 860d91a0ef..8b44900a07 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -1360,7 +1360,7 @@ gtk_button_size_request (GtkWidget *widget,
requisition->height += default_border.top + default_border.bottom;
}
- if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child))
+ if (GTK_BIN (button)->child && gtk_widget_get_visible (GTK_BIN (button)->child))
{
GtkRequisition child_requisition;
@@ -1405,7 +1405,7 @@ gtk_button_size_allocate (GtkWidget *widget,
widget->allocation.width - border_width * 2,
widget->allocation.height - border_width * 2);
- if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child))
+ if (GTK_BIN (button)->child && gtk_widget_get_visible (GTK_BIN (button)->child))
{
child_allocation.x = widget->allocation.x + border_width + inner_border.left + xthickness;
child_allocation.y = widget->allocation.y + border_width + inner_border.top + ythickness;
diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c
index a9e34b29d2..4dd458bdfc 100644
--- a/gtk/gtkcheckbutton.c
+++ b/gtk/gtkcheckbutton.c
@@ -153,7 +153,7 @@ gtk_check_button_paint (GtkWidget *widget,
{
GtkWidget *child = GTK_BIN (widget)->child;
- if (interior_focus && child && GTK_WIDGET_VISIBLE (child))
+ if (interior_focus && child && gtk_widget_get_visible (child))
gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
area, widget, "checkbutton",
child->allocation.x - focus_width - focus_pad,
@@ -213,7 +213,7 @@ gtk_check_button_size_request (GtkWidget *widget,
&indicator_size, &indicator_spacing);
child = GTK_BIN (widget)->child;
- if (child && GTK_WIDGET_VISIBLE (child))
+ if (child && gtk_widget_get_visible (child))
{
GtkRequisition child_requisition;
@@ -264,7 +264,7 @@ gtk_check_button_size_allocate (GtkWidget *widget,
allocation->x, allocation->y,
allocation->width, allocation->height);
- if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child))
+ if (GTK_BIN (button)->child && gtk_widget_get_visible (GTK_BIN (button)->child))
{
GtkRequisition child_requisition;
gint border_width = GTK_CONTAINER (widget)->border_width;
@@ -376,7 +376,7 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
y = widget->allocation.y + (widget->allocation.height - indicator_size) / 2;
child = GTK_BIN (check_button)->child;
- if (!interior_focus || !(child && GTK_WIDGET_VISIBLE (child)))
+ if (!interior_focus || !(child && gtk_widget_get_visible (child)))
x += focus_width + focus_pad;
if (toggle_button->inconsistent)
diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c
index d66bd7e073..50a02161c5 100644
--- a/gtk/gtkclist.c
+++ b/gtk/gtkclist.c
@@ -1255,7 +1255,7 @@ gtk_clist_set_shadow_type (GtkCList *clist,
clist->shadow_type = type;
- if (GTK_WIDGET_VISIBLE (clist))
+ if (gtk_widget_get_visible (GTK_WIDGET (clist)))
gtk_widget_queue_resize (GTK_WIDGET (clist));
}
@@ -1379,7 +1379,7 @@ gtk_clist_column_title_active (GtkCList *clist,
NULL);
GTK_WIDGET_SET_FLAGS (clist->column[column].button, GTK_CAN_FOCUS);
- if (GTK_WIDGET_VISIBLE (clist))
+ if (gtk_widget_get_visible (GTK_WIDGET (clist)))
gtk_widget_queue_draw (clist->column[column].button);
}
@@ -1410,7 +1410,7 @@ gtk_clist_column_title_passive (GtkCList *clist,
NULL);
GTK_WIDGET_UNSET_FLAGS (clist->column[column].button, GTK_CAN_FOCUS);
- if (GTK_WIDGET_VISIBLE (clist))
+ if (gtk_widget_get_visible (GTK_WIDGET (clist)))
gtk_widget_queue_draw (clist->column[column].button);
}
@@ -1496,7 +1496,7 @@ gtk_clist_set_column_title (GtkCList *clist,
/* if this button didn't previously exist, then the
* column button positions have to be re-computed */
- if (GTK_WIDGET_VISIBLE (clist) && new_button)
+ if (gtk_widget_get_visible (GTK_WIDGET (clist)) && new_button)
size_allocate_title_buttons (clist);
}
@@ -1550,7 +1550,7 @@ gtk_clist_set_column_widget (GtkCList *clist,
/* if this button didn't previously exist, then the
* column button positions have to be re-computed */
- if (GTK_WIDGET_VISIBLE (clist) && new_button)
+ if (gtk_widget_get_visible (GTK_WIDGET (clist)) && new_button)
size_allocate_title_buttons (clist);
}
@@ -1671,7 +1671,7 @@ gtk_clist_set_column_resizeable (GtkCList *clist,
if (resizeable)
clist->column[column].auto_resize = FALSE;
- if (GTK_WIDGET_VISIBLE (clist))
+ if (gtk_widget_get_visible (GTK_WIDGET (clist)))
size_allocate_title_buttons (clist);
}
@@ -1700,7 +1700,7 @@ gtk_clist_set_column_auto_resize (GtkCList *clist,
}
}
- if (GTK_WIDGET_VISIBLE (clist))
+ if (gtk_widget_get_visible (GTK_WIDGET (clist)))
size_allocate_title_buttons (clist);
}
@@ -4692,7 +4692,7 @@ gtk_clist_map (GtkWidget *widget)
for (i = 0; i < clist->columns; i++)
{
if (clist->column[i].button &&
- GTK_WIDGET_VISIBLE (clist->column[i].button) &&
+ gtk_widget_get_visible (clist->column[i].button) &&
!GTK_WIDGET_MAPPED (clist->column[i].button))
gtk_widget_map (clist->column[i].button);
}
@@ -6161,7 +6161,7 @@ adjust_allocation_recurse (GtkWidget *widget,
if (!GTK_WIDGET_REALIZED (widget))
{
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
{
GdkRectangle tmp_rectangle = widget->allocation;
tmp_rectangle.x += scroll_data->dx;
@@ -6693,7 +6693,7 @@ title_focus_move (GtkCList *clist,
while (!return_val && j >= 0 && j < clist->columns)
{
if (clist->column[j].button &&
- GTK_WIDGET_VISIBLE (clist->column[j].button))
+ gtk_widget_get_visible (clist->column[j].button))
{
if (focus_column (clist, j, dir))
{
@@ -6713,7 +6713,7 @@ title_focus_move (GtkCList *clist,
while (!return_val && j != i)
{
if (clist->column[j].button &&
- GTK_WIDGET_VISIBLE (clist->column[j].button))
+ gtk_widget_get_visible (clist->column[j].button))
{
if (focus_column (clist, j, dir))
{
diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c
index 7c7e9b4ac0..a911697b3c 100644
--- a/gtk/gtkcombo.c
+++ b/gtk/gtkcombo.c
@@ -705,7 +705,7 @@ static void
gtk_combo_selection_changed (GtkList *list,
GtkCombo *combo)
{
- if (!GTK_WIDGET_VISIBLE (combo->popwin))
+ if (!gtk_widget_get_visible (combo->popwin))
gtk_combo_update_entry (combo);
}
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 5eb0737aaa..072e376957 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -1573,7 +1573,7 @@ gtk_combo_box_menu_position_over (GtkMenu *menu,
if (active == child)
break;
- if (GTK_WIDGET_VISIBLE (child))
+ if (gtk_widget_get_visible (child))
{
gtk_widget_get_child_requisition (child, &requisition);
menu_ypos -= requisition.height;
@@ -1627,7 +1627,7 @@ gtk_combo_box_menu_position (GtkMenu *menu,
gtk_combo_box_menu_position_over (menu, x, y, push_in, user_data);
}
- if (!GTK_WIDGET_VISIBLE (GTK_MENU (priv->popup_widget)->toplevel))
+ if (!gtk_widget_get_visible (GTK_MENU (priv->popup_widget)->toplevel))
gtk_window_set_type_hint (GTK_WINDOW (GTK_MENU (priv->popup_widget)->toplevel),
GDK_WINDOW_TYPE_HINT_COMBO);
}
@@ -2318,7 +2318,7 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
child.width -= child.x;
}
- if (GTK_WIDGET_VISIBLE (priv->popup_widget))
+ if (gtk_widget_get_visible (priv->popup_widget))
{
gint width;
GtkRequisition requisition;
@@ -2405,7 +2405,7 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
child.height -= delta_y * 2;
}
- if (GTK_WIDGET_VISIBLE (priv->popup_window))
+ if (gtk_widget_get_visible (priv->popup_window))
{
gint x, y, width, height;
gtk_combo_box_list_position (combo_box, &x, &y, &width, &height);
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 3f54017a99..2aa7ef6988 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -1379,7 +1379,7 @@ _gtk_container_queue_resize (GtkContainer *container)
if (resize_container)
{
- if (GTK_WIDGET_VISIBLE (resize_container) &&
+ if (gtk_widget_get_visible (GTK_WIDGET (resize_container)) &&
(gtk_widget_is_toplevel (GTK_WIDGET (resize_container)) || GTK_WIDGET_REALIZED (resize_container)))
{
switch (resize_container->resize_mode)
@@ -2655,7 +2655,7 @@ static void
gtk_container_map_child (GtkWidget *child,
gpointer client_data)
{
- if (GTK_WIDGET_VISIBLE (child) &&
+ if (gtk_widget_get_visible (child) &&
GTK_WIDGET_CHILD_VISIBLE (child) &&
!GTK_WIDGET_MAPPED (child))
gtk_widget_map (child);
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index 8d9dfe3fd7..d14e8ac9a5 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -1057,7 +1057,7 @@ gtk_dialog_run (GtkDialog *dialog)
if (!was_modal)
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- if (!GTK_WIDGET_VISIBLE (dialog))
+ if (!gtk_widget_get_visible (GTK_WIDGET (dialog)))
gtk_widget_show (GTK_WIDGET (dialog));
response_handler =
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index c256b0e55e..3488509417 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -3049,7 +3049,7 @@ gtk_drag_update_icon (GtkDragSourceInfo *info)
info->cur_x - hot_x,
info->cur_y - hot_y);
- if (GTK_WIDGET_VISIBLE (icon_window))
+ if (gtk_widget_get_visible (icon_window))
gdk_window_raise (icon_window->window);
else
gtk_widget_show (icon_window);
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 9d0df4d96c..9fbd962b66 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -7603,7 +7603,7 @@ gtk_entry_set_icon_from_pixbuf (GtkEntry *entry,
gtk_entry_ensure_pixbuf (entry, icon_pos);
- if (GTK_WIDGET_VISIBLE (entry))
+ if (gtk_widget_get_visible (GTK_WIDGET (entry)))
gtk_widget_queue_resize (GTK_WIDGET (entry));
g_object_thaw_notify (G_OBJECT (entry));
@@ -7670,7 +7670,7 @@ gtk_entry_set_icon_from_stock (GtkEntry *entry,
gtk_entry_ensure_pixbuf (entry, icon_pos);
- if (GTK_WIDGET_VISIBLE (entry))
+ if (gtk_widget_get_visible (GTK_WIDGET (entry)))
gtk_widget_queue_resize (GTK_WIDGET (entry));
g_object_thaw_notify (G_OBJECT (entry));
@@ -7740,7 +7740,7 @@ gtk_entry_set_icon_from_icon_name (GtkEntry *entry,
gtk_entry_ensure_pixbuf (entry, icon_pos);
- if (GTK_WIDGET_VISIBLE (entry))
+ if (gtk_widget_get_visible (GTK_WIDGET (entry)))
gtk_widget_queue_resize (GTK_WIDGET (entry));
g_object_thaw_notify (G_OBJECT (entry));
@@ -7807,7 +7807,7 @@ gtk_entry_set_icon_from_gicon (GtkEntry *entry,
gtk_entry_ensure_pixbuf (entry, icon_pos);
- if (GTK_WIDGET_VISIBLE (entry))
+ if (gtk_widget_get_visible (GTK_WIDGET (entry)))
gtk_widget_queue_resize (GTK_WIDGET (entry));
g_object_thaw_notify (G_OBJECT (entry));
@@ -9261,7 +9261,7 @@ gtk_entry_completion_timeout (gpointer data)
g_object_get (completion, "popup-single-match", &popup_single, NULL);
if ((matches > (popup_single ? 0: 1)) || actions > 0)
{
- if (GTK_WIDGET_VISIBLE (completion->priv->popup_window))
+ if (gtk_widget_get_visible (completion->priv->popup_window))
_gtk_entry_completion_resize_popup (completion);
else
_gtk_entry_completion_popup (completion);
@@ -9269,7 +9269,7 @@ gtk_entry_completion_timeout (gpointer data)
else
_gtk_entry_completion_popdown (completion);
}
- else if (GTK_WIDGET_VISIBLE (completion->priv->popup_window))
+ else if (gtk_widget_get_visible (completion->priv->popup_window))
_gtk_entry_completion_popdown (completion);
return FALSE;
@@ -9578,7 +9578,7 @@ gtk_entry_completion_changed (GtkWidget *entry,
if (completion->priv->minimum_key_length > 0 &&
strcmp ("", gtk_entry_get_text (GTK_ENTRY (entry))) == 0)
{
- if (GTK_WIDGET_VISIBLE (completion->priv->popup_window))
+ if (gtk_widget_get_visible (completion->priv->popup_window))
_gtk_entry_completion_popdown (completion);
return;
}
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
index dbb2e72560..c997e60a9f 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/gtkentrycompletion.c
@@ -1051,7 +1051,7 @@ gtk_entry_completion_set_model (GtkEntryCompletion *completion,
g_object_notify (G_OBJECT (completion), "model");
- if (GTK_WIDGET_VISIBLE (completion->priv->popup_window))
+ if (gtk_widget_get_visible (completion->priv->popup_window))
_gtk_entry_completion_resize_popup (completion);
}
@@ -1180,7 +1180,7 @@ gtk_entry_completion_complete (GtkEntryCompletion *completion)
gtk_tree_model_filter_refilter (completion->priv->filter_model);
- if (GTK_WIDGET_VISIBLE (completion->priv->popup_window))
+ if (gtk_widget_get_visible (completion->priv->popup_window))
_gtk_entry_completion_resize_popup (completion);
}
diff --git a/gtk/gtkeventbox.c b/gtk/gtkeventbox.c
index 9c8f6ffbb6..f6f57d9b32 100644
--- a/gtk/gtkeventbox.c
+++ b/gtk/gtkeventbox.c
@@ -246,7 +246,7 @@ gtk_event_box_set_visible_window (GtkEventBox *event_box,
{
if (GTK_WIDGET_REALIZED (widget))
{
- gboolean visible = GTK_WIDGET_VISIBLE (widget);
+ gboolean visible = gtk_widget_get_visible (widget);
if (visible)
gtk_widget_hide (widget);
@@ -265,7 +265,7 @@ gtk_event_box_set_visible_window (GtkEventBox *event_box,
gtk_widget_set_has_window (widget, visible_window);
}
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
gtk_widget_queue_resize (widget);
g_object_notify (G_OBJECT (event_box), "visible-window");
@@ -341,7 +341,7 @@ gtk_event_box_set_above_child (GtkEventBox *event_box,
}
else
{
- gboolean visible = GTK_WIDGET_VISIBLE (widget);
+ gboolean visible = gtk_widget_get_visible (widget);
if (visible)
gtk_widget_hide (widget);
@@ -355,7 +355,7 @@ gtk_event_box_set_above_child (GtkEventBox *event_box,
}
}
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
gtk_widget_queue_resize (widget);
g_object_notify (G_OBJECT (event_box), "above-child");
@@ -487,7 +487,7 @@ gtk_event_box_size_request (GtkWidget *widget,
requisition->width = GTK_CONTAINER (widget)->border_width * 2;
requisition->height = GTK_CONTAINER (widget)->border_width * 2;
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkRequisition child_requisition;
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index e96635b758..2362a2d3df 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -409,7 +409,7 @@ gtk_expander_realize (GtkWidget *widget)
get_expander_bounds (GTK_EXPANDER (widget), &expander_rect);
- if (priv->label_widget && GTK_WIDGET_VISIBLE (priv->label_widget))
+ if (priv->label_widget && gtk_widget_get_visible (priv->label_widget))
{
GtkRequisition label_requisition;
@@ -490,7 +490,7 @@ gtk_expander_size_request (GtkWidget *widget,
2 * focus_width + 2 * focus_pad;
requisition->height = interior_focus ? (2 * focus_width + 2 * focus_pad) : 0;
- if (priv->label_widget && GTK_WIDGET_VISIBLE (priv->label_widget))
+ if (priv->label_widget && gtk_widget_get_visible (priv->label_widget))
{
GtkRequisition label_requisition;
@@ -557,7 +557,7 @@ get_expander_bounds (GtkExpander *expander,
rect->x += widget->allocation.width - 2 * border_width -
expander_spacing - expander_size;
- if (priv->label_widget && GTK_WIDGET_VISIBLE (priv->label_widget))
+ if (priv->label_widget && gtk_widget_get_visible (priv->label_widget))
{
GtkAllocation label_allocation;
@@ -626,7 +626,7 @@ gtk_expander_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
- if (priv->label_widget && GTK_WIDGET_VISIBLE (priv->label_widget))
+ if (priv->label_widget && gtk_widget_get_visible (priv->label_widget))
{
GtkAllocation label_allocation;
GtkRequisition label_requisition;
@@ -765,7 +765,7 @@ gtk_expander_paint_prelight (GtkExpander *expander)
area.y = widget->allocation.y + container->border_width;
area.width = widget->allocation.width - (2 * container->border_width);
- if (priv->label_widget && GTK_WIDGET_VISIBLE (priv->label_widget))
+ if (priv->label_widget && gtk_widget_get_visible (priv->label_widget))
area.height = priv->label_widget->allocation.height;
else
area.height = 0;
@@ -847,7 +847,7 @@ gtk_expander_paint_focus (GtkExpander *expander,
if (priv->label_widget)
{
- if (GTK_WIDGET_VISIBLE (priv->label_widget))
+ if (gtk_widget_get_visible (priv->label_widget))
{
GtkAllocation label_allocation = priv->label_widget->allocation;
@@ -1686,6 +1686,7 @@ gtk_expander_set_label_widget (GtkExpander *expander,
GtkWidget *label_widget)
{
GtkExpanderPrivate *priv;
+ GtkWidget *widget;
g_return_if_fail (GTK_IS_EXPANDER (expander));
g_return_if_fail (label_widget == NULL || GTK_IS_WIDGET (label_widget));
@@ -1703,19 +1704,20 @@ gtk_expander_set_label_widget (GtkExpander *expander,
}
priv->label_widget = label_widget;
+ widget = GTK_WIDGET (expander);
if (label_widget)
{
priv->label_widget = label_widget;
- gtk_widget_set_parent (label_widget, GTK_WIDGET (expander));
+ gtk_widget_set_parent (label_widget, widget);
if (priv->prelight)
gtk_widget_set_state (label_widget, GTK_STATE_PRELIGHT);
}
- if (GTK_WIDGET_VISIBLE (expander))
- gtk_widget_queue_resize (GTK_WIDGET (expander));
+ if (gtk_widget_get_visible (widget))
+ gtk_widget_queue_resize (widget);
g_object_freeze_notify (G_OBJECT (expander));
g_object_notify (G_OBJECT (expander), "label-widget");
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c
index 771597a973..441c15b697 100644
--- a/gtk/gtkfilechooserbutton.c
+++ b/gtk/gtkfilechooserbutton.c
@@ -2443,7 +2443,7 @@ open_dialog (GtkFileChooserButton *button)
/* Setup the dialog parent to be chooser button's toplevel, and be modal
as needed. */
- if (!GTK_WIDGET_VISIBLE (priv->dialog))
+ if (!gtk_widget_get_visible (priv->dialog))
{
GtkWidget *toplevel;
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index b54865e493..2ced490d46 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -8030,14 +8030,14 @@ gtk_file_chooser_default_get_default_size (GtkFileChooserEmbed *chooser_embed,
if (impl->preview_widget_active &&
impl->preview_widget &&
- GTK_WIDGET_VISIBLE (impl->preview_widget))
+ gtk_widget_get_visible (impl->preview_widget))
{
gtk_widget_size_request (impl->preview_box, &req);
*default_width += PREVIEW_HBOX_SPACING + req.width;
}
if (impl->extra_widget &&
- GTK_WIDGET_VISIBLE (impl->extra_widget))
+ gtk_widget_get_visible (impl->extra_widget))
{
gtk_widget_size_request (impl->extra_align, &req);
*default_height += GTK_BOX (chooser_embed)->spacing + req.height;
diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c
index 191a5e0452..05a5a1e0f0 100644
--- a/gtk/gtkfixed.c
+++ b/gtk/gtkfixed.c
@@ -201,7 +201,8 @@ gtk_fixed_move_internal (GtkFixed *fixed,
gtk_widget_thaw_child_notify (widget);
- if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (fixed))
+ if (gtk_widget_get_visible (widget) &&
+ gtk_widget_get_visible (GTK_WIDGET (fixed)))
gtk_widget_queue_resize (GTK_WIDGET (fixed));
}
@@ -319,7 +320,7 @@ gtk_fixed_size_request (GtkWidget *widget,
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
gtk_widget_size_request (child->widget, &child_requisition);
@@ -369,7 +370,7 @@ gtk_fixed_size_allocate (GtkWidget *widget,
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
gtk_widget_get_child_requisition (child->widget, &child_requisition);
child_allocation.x = child->x + border_width;
@@ -401,9 +402,11 @@ gtk_fixed_remove (GtkContainer *container,
{
GtkFixed *fixed;
GtkFixedChild *child;
+ GtkWidget *widget_container;
GList *children;
fixed = GTK_FIXED (container);
+ widget_container = GTK_WIDGET (container);
children = fixed->children;
while (children)
@@ -412,7 +415,7 @@ gtk_fixed_remove (GtkContainer *container,
if (child->widget == widget)
{
- gboolean was_visible = GTK_WIDGET_VISIBLE (widget);
+ gboolean was_visible = gtk_widget_get_visible (widget);
gtk_widget_unparent (widget);
@@ -420,8 +423,8 @@ gtk_fixed_remove (GtkContainer *container,
g_list_free (children);
g_free (child);
- if (was_visible && GTK_WIDGET_VISIBLE (container))
- gtk_widget_queue_resize (GTK_WIDGET (container));
+ if (was_visible && gtk_widget_get_visible (widget_container))
+ gtk_widget_queue_resize (widget_container);
break;
}
diff --git a/gtk/gtkfontbutton.c b/gtk/gtkfontbutton.c
index 2f7e10819d..694c61874a 100644
--- a/gtk/gtkfontbutton.c
+++ b/gtk/gtkfontbutton.c
@@ -722,7 +722,7 @@ gtk_font_button_clicked (GtkButton *button)
G_CALLBACK (dialog_destroy), font_button);
}
- if (!GTK_WIDGET_VISIBLE (font_button->priv->font_dialog))
+ if (!gtk_widget_get_visible (font_button->priv->font_dialog))
{
font_dialog = GTK_FONT_SELECTION_DIALOG (font_button->priv->font_dialog);
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index 7e1b7226ee..3e09e7bb07 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -379,7 +379,7 @@ gtk_frame_set_label_widget (GtkFrame *frame,
if (frame->label_widget)
{
- need_resize = GTK_WIDGET_VISIBLE (frame->label_widget);
+ need_resize = gtk_widget_get_visible (frame->label_widget);
gtk_widget_unparent (frame->label_widget);
}
@@ -389,10 +389,10 @@ gtk_frame_set_label_widget (GtkFrame *frame,
{
frame->label_widget = label_widget;
gtk_widget_set_parent (label_widget, GTK_WIDGET (frame));
- need_resize |= GTK_WIDGET_VISIBLE (label_widget);
+ need_resize |= gtk_widget_get_visible (label_widget);
}
- if (GTK_WIDGET_VISIBLE (frame) && need_resize)
+ if (gtk_widget_get_visible (GTK_WIDGET (frame)) && need_resize)
gtk_widget_queue_resize (GTK_WIDGET (frame));
g_object_freeze_notify (G_OBJECT (frame));
@@ -609,7 +609,7 @@ gtk_frame_size_request (GtkWidget *widget,
GtkBin *bin = GTK_BIN (widget);
GtkRequisition child_requisition;
- if (frame->label_widget && GTK_WIDGET_VISIBLE (frame->label_widget))
+ if (frame->label_widget && gtk_widget_get_visible (frame->label_widget))
{
gtk_widget_size_request (frame->label_widget, &child_requisition);
@@ -623,7 +623,7 @@ gtk_frame_size_request (GtkWidget *widget,
requisition->height = 0;
}
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
gtk_widget_size_request (bin->child, &child_requisition);
@@ -659,12 +659,12 @@ gtk_frame_size_allocate (GtkWidget *widget,
new_allocation.height != frame->child_allocation.height))
gdk_window_invalidate_rect (widget->window, &widget->allocation, FALSE);
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
gtk_widget_size_allocate (bin->child, &new_allocation);
frame->child_allocation = new_allocation;
- if (frame->label_widget && GTK_WIDGET_VISIBLE (frame->label_widget))
+ if (frame->label_widget && gtk_widget_get_visible (frame->label_widget))
{
GtkRequisition child_requisition;
GtkAllocation child_allocation;
diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c
index 7a25be7a37..9fc9fc35e6 100644
--- a/gtk/gtkhandlebox.c
+++ b/gtk/gtkhandlebox.c
@@ -354,7 +354,7 @@ gtk_handle_box_map (GtkWidget *widget)
hb = GTK_HANDLE_BOX (widget);
if (bin->child &&
- GTK_WIDGET_VISIBLE (bin->child) &&
+ gtk_widget_get_visible (bin->child) &&
!GTK_WIDGET_MAPPED (bin->child))
gtk_widget_map (bin->child);
@@ -620,7 +620,7 @@ gtk_handle_box_size_allocate (GtkWidget *widget,
widget->allocation.height);
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkAllocation child_allocation;
guint border_width;
@@ -951,7 +951,7 @@ gtk_handle_box_paint (GtkWidget *widget,
event ? &event->area : area,
handle_orientation);
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
GTK_WIDGET_CLASS (gtk_handle_box_parent_class)->expose_event (widget, event);
}
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 872644c49e..15fdb6ff3e 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -1425,7 +1425,7 @@ gtk_icon_view_size_request (GtkWidget *widget,
tmp_list = tmp_list->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
gtk_widget_size_request (child->widget, &child_requisition);
}
}
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 8b9a9d5021..c92f7c69d7 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -2395,11 +2395,13 @@ gtk_image_update_size (GtkImage *image,
gint image_width,
gint image_height)
{
- GTK_WIDGET (image)->requisition.width = image_width + GTK_MISC (image)->xpad * 2;
- GTK_WIDGET (image)->requisition.height = image_height + GTK_MISC (image)->ypad * 2;
+ GtkWidget *widget = GTK_WIDGET (image);
+
+ widget->requisition.width = image_width + GTK_MISC (image)->xpad * 2;
+ widget->requisition.height = image_height + GTK_MISC (image)->ypad * 2;
- if (GTK_WIDGET_VISIBLE (image))
- gtk_widget_queue_resize (GTK_WIDGET (image));
+ if (gtk_widget_get_visible (widget))
+ gtk_widget_queue_resize (widget);
}
diff --git a/gtk/gtkimagemenuitem.c b/gtk/gtkimagemenuitem.c
index 4441145051..3c934766a3 100644
--- a/gtk/gtkimagemenuitem.c
+++ b/gtk/gtkimagemenuitem.c
@@ -326,7 +326,7 @@ gtk_image_menu_item_toggle_size_request (GtkMenuItem *menu_item,
*requisition = 0;
- if (image_menu_item->image && GTK_WIDGET_VISIBLE (image_menu_item->image))
+ if (image_menu_item->image && gtk_widget_get_visible (image_menu_item->image))
{
GtkRequisition image_requisition;
guint toggle_spacing;
@@ -420,7 +420,7 @@ gtk_image_menu_item_size_request (GtkWidget *widget,
image_menu_item = GTK_IMAGE_MENU_ITEM (widget);
- if (image_menu_item->image && GTK_WIDGET_VISIBLE (image_menu_item->image))
+ if (image_menu_item->image && gtk_widget_get_visible (image_menu_item->image))
{
GtkRequisition child_requisition;
@@ -464,7 +464,7 @@ gtk_image_menu_item_size_allocate (GtkWidget *widget,
GTK_WIDGET_CLASS (gtk_image_menu_item_parent_class)->size_allocate (widget, allocation);
- if (image_menu_item->image && GTK_WIDGET_VISIBLE (image_menu_item->image))
+ if (image_menu_item->image && gtk_widget_get_visible (image_menu_item->image))
{
gint x, y, offset;
GtkRequisition child_requisition;
@@ -977,12 +977,13 @@ gtk_image_menu_item_remove (GtkContainer *container,
{
gboolean widget_was_visible;
- widget_was_visible = GTK_WIDGET_VISIBLE (child);
+ widget_was_visible = gtk_widget_get_visible (child);
gtk_widget_unparent (child);
image_menu_item->image = NULL;
- if (GTK_WIDGET_VISIBLE (container) && widget_was_visible)
+ if (widget_was_visible &&
+ gtk_widget_get_visible (GTK_WIDGET (container)))
gtk_widget_queue_resize (GTK_WIDGET (container));
g_object_notify (G_OBJECT (image_menu_item), "image");
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index faa78e52b0..ccc9c895cb 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3557,7 +3557,7 @@ gtk_label_expose (GtkWidget *widget,
gtk_label_ensure_layout (label);
- if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget) &&
+ if (gtk_widget_get_visible (widget) && GTK_WIDGET_MAPPED (widget) &&
label->text && (*label->text != '\0'))
{
get_layout_location (label, &x, &y);
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c
index f46b473dc4..b4c58fdeae 100644
--- a/gtk/gtklayout.c
+++ b/gtk/gtklayout.c
@@ -409,8 +409,9 @@ gtk_layout_move_internal (GtkLayout *layout,
gtk_widget_thaw_child_notify (widget);
- if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (layout))
- gtk_widget_queue_resize (GTK_WIDGET (widget));
+ if (gtk_widget_get_visible (widget) &&
+ gtk_widget_get_visible (GTK_WIDGET (layout)))
+ gtk_widget_queue_resize (widget);
}
/**
@@ -915,7 +916,7 @@ gtk_layout_map (GtkWidget *widget)
GtkLayoutChild *child = tmp_list->data;
tmp_list = tmp_list->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
if (!GTK_WIDGET_MAPPED (child->widget))
gtk_widget_map (child->widget);
diff --git a/gtk/gtklist.c b/gtk/gtklist.c
index cf691f0676..9b9f4f08a3 100644
--- a/gtk/gtklist.c
+++ b/gtk/gtklist.c
@@ -382,7 +382,7 @@ gtk_list_size_request (GtkWidget *widget,
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child))
+ if (gtk_widget_get_visible (child))
{
GtkRequisition child_requisition;
@@ -430,7 +430,7 @@ gtk_list_size_allocate (GtkWidget *widget,
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child))
+ if (gtk_widget_get_visible (child))
{
GtkRequisition child_requisition;
gtk_widget_get_child_requisition (child, &child_requisition);
@@ -1204,7 +1204,7 @@ gtk_list_clear_items (GtkList *list,
}
}
- if (GTK_WIDGET_VISIBLE (list))
+ if (gtk_widget_get_visible (GTK_WIDGET (list)))
gtk_widget_queue_resize (GTK_WIDGET (list));
}
@@ -1337,7 +1337,7 @@ gtk_list_remove_items_internal (GtkList *list,
}
}
- if (GTK_WIDGET_VISIBLE (list))
+ if (gtk_widget_get_visible (GTK_WIDGET (list)))
gtk_widget_queue_resize (GTK_WIDGET (list));
}
diff --git a/gtk/gtklistitem.c b/gtk/gtklistitem.c
index 5f266446be..1983f9f99a 100644
--- a/gtk/gtklistitem.c
+++ b/gtk/gtklistitem.c
@@ -484,7 +484,7 @@ gtk_list_item_size_request (GtkWidget *widget,
requisition->height = 2 * (GTK_CONTAINER (widget)->border_width +
focus_width + focus_pad - 1);
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
gtk_widget_size_request (bin->child, &child_requisition);
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 660aed4379..4b1ae90af6 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -2564,7 +2564,7 @@ gtk_print (gchar *str)
gtk_text_insert (GTK_TEXT (text), NULL, NULL, NULL, str, -1);
level -= 1;
- if (!GTK_WIDGET_VISIBLE (window))
+ if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
}
#endif
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index bfa6c81fab..220862304a 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -1568,7 +1568,7 @@ gtk_menu_popup (GtkMenu *menu,
/* We need to show the menu here rather in the init function because
* code expects to be able to tell if the menu is onscreen by
- * looking at the GTK_WIDGET_VISIBLE (menu)
+ * looking at the gtk_widget_get_visible (menu)
*/
gtk_widget_show (GTK_WIDGET (menu));
@@ -1928,7 +1928,7 @@ gtk_menu_set_tearoff_hints (GtkMenu *menu,
if (!menu->tearoff_window)
return;
- if (GTK_WIDGET_VISIBLE (menu->tearoff_scrollbar))
+ if (gtk_widget_get_visible (menu->tearoff_scrollbar))
{
gtk_widget_size_request (menu->tearoff_scrollbar, NULL);
width += menu->tearoff_scrollbar->requisition.width;
@@ -2015,7 +2015,7 @@ gtk_menu_set_tearoff_state (GtkMenu *menu,
if (menu->torn_off)
{
- if (GTK_WIDGET_VISIBLE (menu))
+ if (gtk_widget_get_visible (GTK_WIDGET (menu)))
gtk_menu_popdown (menu);
if (!menu->tearoff_window)
@@ -2450,7 +2450,7 @@ gtk_menu_size_request (GtkWidget *widget,
child = children->data;
children = children->next;
- if (! GTK_WIDGET_VISIBLE (child))
+ if (! gtk_widget_get_visible (child))
continue;
get_effective_child_attach (child, &l, &r, &t, &b);
@@ -2597,7 +2597,7 @@ gtk_menu_size_allocate (GtkWidget *widget,
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child))
+ if (gtk_widget_get_visible (child))
{
gint i;
gint l, r, t, b;
@@ -2651,7 +2651,7 @@ gtk_menu_size_allocate (GtkWidget *widget,
{
if (allocation->height >= widget->requisition.height)
{
- if (GTK_WIDGET_VISIBLE (menu->tearoff_scrollbar))
+ if (gtk_widget_get_visible (menu->tearoff_scrollbar))
{
gtk_widget_hide (menu->tearoff_scrollbar);
gtk_menu_set_tearoff_hints (menu, allocation->width);
@@ -2676,7 +2676,7 @@ gtk_menu_size_allocate (GtkWidget *widget,
gtk_adjustment_changed (menu->tearoff_adjustment);
- if (!GTK_WIDGET_VISIBLE (menu->tearoff_scrollbar))
+ if (!gtk_widget_get_visible (menu->tearoff_scrollbar))
{
gtk_widget_show (menu->tearoff_scrollbar);
gtk_menu_set_tearoff_hints (menu, allocation->width);
@@ -4232,7 +4232,7 @@ gtk_menu_position (GtkMenu *menu)
private->initially_pushed_in = FALSE;
/* Set the type hint here to allow custom position functions to set a different hint */
- if (!GTK_WIDGET_VISIBLE (menu->toplevel))
+ if (!gtk_widget_get_visible (menu->toplevel))
gtk_window_set_type_hint (GTK_WINDOW (menu->toplevel), GDK_WINDOW_TYPE_HINT_POPUP_MENU);
if (menu->position_func)
@@ -5115,7 +5115,7 @@ child_at (GtkMenu *menu,
for (children = menu_shell->children; children; children = children->next)
{
- if (GTK_WIDGET_VISIBLE (children->data))
+ if (gtk_widget_get_visible (children->data))
{
GtkRequisition child_requisition;
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c
index 1d0f43c784..9e533a682e 100644
--- a/gtk/gtkmenubar.c
+++ b/gtk/gtkmenubar.c
@@ -291,7 +291,7 @@ gtk_menu_bar_size_request (GtkWidget *widget,
requisition->width = 0;
requisition->height = 0;
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
{
menu_bar = GTK_MENU_BAR (widget);
menu_shell = GTK_MENU_SHELL (widget);
@@ -305,7 +305,7 @@ gtk_menu_bar_size_request (GtkWidget *widget,
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child))
+ if (gtk_widget_get_visible (child))
{
gint toggle_size;
@@ -432,7 +432,7 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
ltr_x = allocation->width -
child_requisition.width - offset;
}
- if (GTK_WIDGET_VISIBLE (child))
+ if (gtk_widget_get_visible (child))
{
if ((direction == GTK_TEXT_DIR_LTR) == (priv->pack_direction == GTK_PACK_DIRECTION_LTR))
child_allocation.x = ltr_x;
@@ -482,7 +482,7 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
ltr_y = allocation->height -
child_requisition.height - offset;
}
- if (GTK_WIDGET_VISIBLE (child))
+ if (gtk_widget_get_visible (child))
{
if ((direction == GTK_TEXT_DIR_LTR) ==
(priv->pack_direction == GTK_PACK_DIRECTION_TTB))
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index 5dc010b6f6..5e474a8d69 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -982,7 +982,7 @@ gtk_menu_item_size_request (GtkWidget *widget,
(child_pack_dir == GTK_PACK_DIRECTION_TTB || child_pack_dir == GTK_PACK_DIRECTION_BTT))
requisition->height += 2 * horizontal_padding;
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkRequisition child_requisition;
@@ -1820,7 +1820,7 @@ gtk_menu_item_position_menu (GtkMenu *menu,
gtk_menu_set_monitor (menu, monitor_num);
- if (!GTK_WIDGET_VISIBLE (menu->toplevel))
+ if (!gtk_widget_get_visible (menu->toplevel))
{
gtk_window_set_type_hint (GTK_WINDOW (menu->toplevel), menu_item->from_menubar?
GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU : GDK_WINDOW_TYPE_HINT_POPUP_MENU);
@@ -1912,7 +1912,7 @@ gtk_menu_item_can_activate_accel (GtkWidget *widget,
guint signal_id)
{
/* Chain to the parent GtkMenu for further checks */
- return (gtk_widget_is_sensitive (widget) && GTK_WIDGET_VISIBLE (widget) &&
+ return (gtk_widget_is_sensitive (widget) && gtk_widget_get_visible (widget) &&
widget->parent && gtk_widget_can_activate_accel (widget->parent, signal_id));
}
@@ -2102,7 +2102,7 @@ _gtk_menu_item_is_selectable (GtkWidget *menu_item)
G_OBJECT_TYPE (menu_item) == GTK_TYPE_MENU_ITEM) ||
GTK_IS_SEPARATOR_MENU_ITEM (menu_item) ||
!gtk_widget_is_sensitive (menu_item) ||
- !GTK_WIDGET_VISIBLE (menu_item))
+ !gtk_widget_get_visible (menu_item))
return FALSE;
return TRUE;
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index c9b8949947..4a86b20376 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -612,7 +612,7 @@ gtk_menu_shell_button_press (GtkWidget *widget,
if (menu_item && _gtk_menu_item_is_selectable (menu_item) &&
GTK_MENU_ITEM (menu_item)->submenu != NULL &&
- !GTK_WIDGET_VISIBLE (GTK_MENU_ITEM (menu_item)->submenu))
+ !gtk_widget_get_visible (GTK_MENU_ITEM (menu_item)->submenu))
{
GtkMenuShellPrivate *priv;
@@ -922,7 +922,7 @@ gtk_menu_shell_enter_notify (GtkWidget *widget,
priv = GTK_MENU_SHELL_GET_PRIVATE (menu_item->parent);
priv->activated_submenu = TRUE;
- if (!GTK_WIDGET_VISIBLE (GTK_MENU_ITEM (menu_item)->submenu))
+ if (!gtk_widget_get_visible (GTK_MENU_ITEM (menu_item)->submenu))
{
gboolean touchscreen_mode;
@@ -954,7 +954,7 @@ gtk_menu_shell_leave_notify (GtkWidget *widget,
event->mode == GDK_CROSSING_STATE_CHANGED)
return TRUE;
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
{
GtkMenuShell *menu_shell = GTK_MENU_SHELL (widget);
GtkWidget *event_widget = gtk_get_event_widget ((GdkEvent*) event);
@@ -1007,7 +1007,7 @@ gtk_menu_shell_remove (GtkContainer *container,
GtkMenuShell *menu_shell = GTK_MENU_SHELL (container);
gint was_visible;
- was_visible = GTK_WIDGET_VISIBLE (widget);
+ was_visible = gtk_widget_get_visible (widget);
menu_shell->children = g_list_remove (menu_shell->children, widget);
if (widget == menu_shell->active_menu_item)
@@ -1018,7 +1018,7 @@ gtk_menu_shell_remove (GtkContainer *container,
gtk_widget_unparent (widget);
- /* queue resize regardless of GTK_WIDGET_VISIBLE (container),
+ /* queue resize regardless of gtk_widget_get_visible (container),
* since that's what is needed by toplevels.
*/
if (was_visible)
@@ -1329,7 +1329,7 @@ gtk_menu_shell_select_first (GtkMenuShell *menu_shell,
{
GtkWidget *child = tmp_list->data;
- if ((!search_sensitive && GTK_WIDGET_VISIBLE (child)) ||
+ if ((!search_sensitive && gtk_widget_get_visible (child)) ||
_gtk_menu_item_is_selectable (child))
{
to_select = child;
@@ -1356,7 +1356,7 @@ _gtk_menu_shell_select_last (GtkMenuShell *menu_shell,
{
GtkWidget *child = tmp_list->data;
- if ((!search_sensitive && GTK_WIDGET_VISIBLE (child)) ||
+ if ((!search_sensitive && gtk_widget_get_visible (child)) ||
_gtk_menu_item_is_selectable (child))
{
to_select = child;
@@ -1415,7 +1415,7 @@ gtk_real_menu_shell_move_current (GtkMenuShell *menu_shell,
if (touchscreen_mode &&
menu_shell->active_menu_item &&
GTK_MENU_ITEM (menu_shell->active_menu_item)->submenu &&
- GTK_WIDGET_VISIBLE (GTK_MENU_ITEM (menu_shell->active_menu_item)->submenu))
+ gtk_widget_get_visible (GTK_MENU_ITEM (menu_shell->active_menu_item)->submenu))
{
/* if we are on a menu item that has an open submenu but the
* focus is not in that submenu (e.g. because it's empty or
diff --git a/gtk/gtkmenutoolbutton.c b/gtk/gtkmenutoolbutton.c
index 0144409626..3e3cf07751 100644
--- a/gtk/gtkmenutoolbutton.c
+++ b/gtk/gtkmenutoolbutton.c
@@ -344,7 +344,7 @@ arrow_button_toggled_cb (GtkToggleButton *togglebutton,
return;
if (gtk_toggle_button_get_active (togglebutton) &&
- !GTK_WIDGET_VISIBLE (priv->menu))
+ !gtk_widget_get_visible (GTK_WIDGET (priv->menu)))
{
/* we get here only when the menu is activated by a key
* press, so that we can select the first menu item */
@@ -544,7 +544,7 @@ gtk_menu_tool_button_set_menu (GtkMenuToolButton *button,
if (priv->menu != GTK_MENU (menu))
{
- if (priv->menu && GTK_WIDGET_VISIBLE (priv->menu))
+ if (priv->menu && gtk_widget_get_visible (GTK_WIDGET (priv->menu)))
gtk_menu_shell_deactivate (GTK_MENU_SHELL (priv->menu));
if (priv->menu)
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 3c639da8c4..fd8075b7cf 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -1655,7 +1655,7 @@ gtk_notebook_get_event_window_position (GtkNotebook *notebook,
for (tmp_list = notebook->children; tmp_list; tmp_list = tmp_list->next)
{
GtkNotebookPage *page = tmp_list->data;
- if (GTK_WIDGET_VISIBLE (page->child))
+ if (gtk_widget_get_visible (page->child))
{
visible_page = page;
break;
@@ -1682,7 +1682,7 @@ gtk_notebook_get_event_window_position (GtkNotebook *notebook,
for (i = 0; i < N_ACTION_WIDGETS; i++)
{
if (priv->action_widget[i] &&
- GTK_WIDGET_VISIBLE (priv->action_widget[i]))
+ gtk_widget_get_visible (priv->action_widget[i]))
{
rectangle->width -= priv->action_widget[i]->allocation.width;
if ((!is_rtl && i == ACTION_WIDGET_START) ||
@@ -1701,7 +1701,7 @@ gtk_notebook_get_event_window_position (GtkNotebook *notebook,
for (i = 0; i < N_ACTION_WIDGETS; i++)
{
if (priv->action_widget[i] &&
- GTK_WIDGET_VISIBLE (priv->action_widget[i]))
+ gtk_widget_get_visible (priv->action_widget[i]))
{
rectangle->height -= priv->action_widget[i]->allocation.height;
@@ -1742,14 +1742,14 @@ gtk_notebook_map (GtkWidget *widget)
priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
if (notebook->cur_page &&
- GTK_WIDGET_VISIBLE (notebook->cur_page->child) &&
+ gtk_widget_get_visible (notebook->cur_page->child) &&
!GTK_WIDGET_MAPPED (notebook->cur_page->child))
gtk_widget_map (notebook->cur_page->child);
for (i = 0; i < N_ACTION_WIDGETS; i++)
{
if (priv->action_widget[i] &&
- GTK_WIDGET_VISIBLE (priv->action_widget[i]) &&
+ gtk_widget_get_visible (priv->action_widget[i]) &&
GTK_WIDGET_CHILD_VISIBLE (priv->action_widget[i]) &&
!GTK_WIDGET_MAPPED (priv->action_widget[i]))
gtk_widget_map (priv->action_widget[i]);
@@ -1767,7 +1767,7 @@ gtk_notebook_map (GtkWidget *widget)
children = children->next;
if (page->tab_label &&
- GTK_WIDGET_VISIBLE (page->tab_label) &&
+ gtk_widget_get_visible (page->tab_label) &&
!GTK_WIDGET_MAPPED (page->tab_label))
gtk_widget_map (page->tab_label);
}
@@ -1884,7 +1884,7 @@ gtk_notebook_size_request (GtkWidget *widget,
{
page = children->data;
- if (GTK_WIDGET_VISIBLE (page->child))
+ if (gtk_widget_get_visible (page->child))
{
vis_pages++;
gtk_widget_size_request (page->child, &child_requisition);
@@ -1895,7 +1895,7 @@ gtk_notebook_size_request (GtkWidget *widget,
child_requisition.height);
if (notebook->menu && page->menu_label->parent &&
- !GTK_WIDGET_VISIBLE (page->menu_label->parent))
+ !gtk_widget_get_visible (page->menu_label->parent))
gtk_widget_show (page->menu_label->parent);
}
else
@@ -1903,7 +1903,7 @@ gtk_notebook_size_request (GtkWidget *widget,
if (page == notebook->cur_page)
switch_page = TRUE;
if (notebook->menu && page->menu_label->parent &&
- GTK_WIDGET_VISIBLE (page->menu_label->parent))
+ gtk_widget_get_visible (page->menu_label->parent))
gtk_widget_hide (page->menu_label->parent);
}
}
@@ -1928,9 +1928,9 @@ gtk_notebook_size_request (GtkWidget *widget,
{
page = children->data;
- if (GTK_WIDGET_VISIBLE (page->child))
+ if (gtk_widget_get_visible (page->child))
{
- if (!GTK_WIDGET_VISIBLE (page->tab_label))
+ if (!gtk_widget_get_visible (page->tab_label))
gtk_widget_show (page->tab_label);
gtk_widget_size_request (page->tab_label,
@@ -1961,7 +1961,7 @@ gtk_notebook_size_request (GtkWidget *widget,
break;
}
}
- else if (GTK_WIDGET_VISIBLE (page->tab_label))
+ else if (gtk_widget_get_visible (page->tab_label))
gtk_widget_hide (page->tab_label);
}
@@ -2001,7 +2001,7 @@ gtk_notebook_size_request (GtkWidget *widget,
page = children->data;
children = children->next;
- if (!GTK_WIDGET_VISIBLE (page->child))
+ if (!gtk_widget_get_visible (page->child))
continue;
if (notebook->homogeneous)
@@ -2051,7 +2051,7 @@ gtk_notebook_size_request (GtkWidget *widget,
page = children->data;
children = children->next;
- if (!GTK_WIDGET_VISIBLE (page->child))
+ if (!gtk_widget_get_visible (page->child))
continue;
page->requisition.width = tab_width;
@@ -2097,7 +2097,7 @@ gtk_notebook_size_request (GtkWidget *widget,
{
page = children->data;
- if (page->tab_label && GTK_WIDGET_VISIBLE (page->tab_label))
+ if (page->tab_label && gtk_widget_get_visible (page->tab_label))
gtk_widget_hide (page->tab_label);
}
}
@@ -2114,14 +2114,14 @@ gtk_notebook_size_request (GtkWidget *widget,
children = children->next)
{
page = children->data;
- if (GTK_WIDGET_VISIBLE (page->child))
+ if (gtk_widget_get_visible (page->child))
{
gtk_notebook_switch_page (notebook, page);
break;
}
}
}
- else if (GTK_WIDGET_VISIBLE (widget))
+ else if (gtk_widget_get_visible (widget))
{
widget->requisition.width = GTK_CONTAINER (widget)->border_width * 2;
widget->requisition.height= GTK_CONTAINER (widget)->border_width * 2;
@@ -2266,7 +2266,7 @@ gtk_notebook_size_allocate (GtkWidget *widget,
page = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (page->child))
+ if (gtk_widget_get_visible (page->child))
gtk_widget_size_allocate (page->child, &child_allocation);
}
@@ -2618,7 +2618,7 @@ get_tab_at_pos (GtkNotebook *notebook, gint x, gint y)
{
page = children->data;
- if (GTK_WIDGET_VISIBLE (page->child) &&
+ if (gtk_widget_get_visible (page->child) &&
page->tab_label && GTK_WIDGET_MAPPED (page->tab_label) &&
(x >= page->allocation.x) &&
(y >= page->allocation.y) &&
@@ -2790,7 +2790,7 @@ get_drop_position (GtkNotebook *notebook,
page = children->data;
if ((priv->operation != DRAG_OPERATION_REORDER || page != notebook->cur_page) &&
- GTK_WIDGET_VISIBLE (page->child) &&
+ gtk_widget_get_visible (page->child) &&
page->tab_label &&
GTK_WIDGET_MAPPED (page->tab_label) &&
page->pack == pack)
@@ -3988,7 +3988,7 @@ focus_action_in (GtkNotebook *notebook,
GtkNotebookPrivate *priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
if (priv->action_widget[action] &&
- GTK_WIDGET_VISIBLE (priv->action_widget[action]))
+ gtk_widget_get_visible (priv->action_widget[action]))
return gtk_widget_child_focus (priv->action_widget[action], direction);
else
return FALSE;
@@ -4299,7 +4299,7 @@ page_visible_cb (GtkWidget *page,
if (notebook->cur_page &&
notebook->cur_page->child == page &&
- !GTK_WIDGET_VISIBLE (page))
+ !gtk_widget_get_visible (page))
{
list = g_list_find (notebook->children, notebook->cur_page);
if (list)
@@ -4371,7 +4371,7 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook,
if (tab_label)
{
- if (notebook->show_tabs && GTK_WIDGET_VISIBLE (child))
+ if (notebook->show_tabs && gtk_widget_get_visible (child))
gtk_widget_show (tab_label);
else
gtk_widget_hide (tab_label);
@@ -4640,7 +4640,8 @@ gtk_notebook_real_remove (GtkNotebook *notebook,
g_signal_handler_disconnect (page->child, page->notify_visible_handler);
- if (GTK_WIDGET_VISIBLE (page->child) && GTK_WIDGET_VISIBLE (notebook))
+ if (gtk_widget_get_visible (page->child) &&
+ gtk_widget_get_visible (GTK_WIDGET (notebook)))
need_resize = TRUE;
gtk_widget_unparent (page->child);
@@ -4710,11 +4711,11 @@ gtk_notebook_update_labels (GtkNotebook *notebook)
gtk_label_set_text (GTK_LABEL (page->tab_label), string);
}
- if (GTK_WIDGET_VISIBLE (page->child) &&
- !GTK_WIDGET_VISIBLE (page->tab_label))
+ if (gtk_widget_get_visible (page->child) &&
+ !gtk_widget_get_visible (page->tab_label))
gtk_widget_show (page->tab_label);
- else if (!GTK_WIDGET_VISIBLE (page->child) &&
- GTK_WIDGET_VISIBLE (page->tab_label))
+ else if (!gtk_widget_get_visible (page->child) &&
+ gtk_widget_get_visible (page->tab_label))
gtk_widget_hide (page->tab_label);
}
if (notebook->menu && page->default_menu)
@@ -4788,7 +4789,7 @@ gtk_notebook_search_page (GtkNotebook *notebook,
page = list->data;
if (page->pack == flag &&
(!find_visible ||
- (GTK_WIDGET_VISIBLE (page->child) &&
+ (gtk_widget_get_visible (page->child) &&
(!page->tab_label || NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page)))))
return list;
old_list = list;
@@ -4806,7 +4807,7 @@ gtk_notebook_search_page (GtkNotebook *notebook,
page = list->data;
if (page->pack != flag &&
(!find_visible ||
- (GTK_WIDGET_VISIBLE (page->child) &&
+ (gtk_widget_get_visible (page->child) &&
(!page->tab_label || NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page)))))
return list;
old_list = list;
@@ -4846,7 +4847,7 @@ gtk_notebook_paint (GtkWidget *widget,
tab_pos = get_effective_tab_pos (notebook);
if ((!notebook->show_tabs && !notebook->show_border) ||
- !notebook->cur_page || !GTK_WIDGET_VISIBLE (notebook->cur_page->child))
+ !notebook->cur_page || !gtk_widget_get_visible (notebook->cur_page->child))
return;
x = widget->allocation.x + border_width;
@@ -4932,7 +4933,7 @@ gtk_notebook_paint (GtkWidget *widget,
page = children->data;
children = gtk_notebook_search_page (notebook, children,
step, TRUE);
- if (!GTK_WIDGET_VISIBLE (page->child))
+ if (!gtk_widget_get_visible (page->child))
continue;
if (!GTK_WIDGET_MAPPED (page->tab_label))
showarrow = TRUE;
@@ -5140,7 +5141,7 @@ gtk_notebook_tab_space (GtkNotebook *notebook,
children = children->next;
if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) &&
- GTK_WIDGET_VISIBLE (page->child))
+ gtk_widget_get_visible (page->child))
*tab_space += page->requisition.width;
}
break;
@@ -5168,7 +5169,7 @@ gtk_notebook_tab_space (GtkNotebook *notebook,
children = children->next;
if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) &&
- GTK_WIDGET_VISIBLE (page->child))
+ gtk_widget_get_visible (page->child))
*tab_space += page->requisition.height;
}
break;
@@ -5268,7 +5269,7 @@ gtk_notebook_calculate_shown_tabs (GtkNotebook *notebook,
*remaining_space = tab_space;
if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, notebook->cur_page) &&
- GTK_WIDGET_VISIBLE (notebook->cur_page->child))
+ gtk_widget_get_visible (notebook->cur_page->child))
{
gtk_notebook_calc_tabs (notebook,
notebook->focus_tab,
@@ -5295,7 +5296,7 @@ gtk_notebook_calculate_shown_tabs (GtkNotebook *notebook,
/* Is first_tab really predecessor of focus_tab? */
page = notebook->first_tab->data;
if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) &&
- GTK_WIDGET_VISIBLE (page->child))
+ gtk_widget_get_visible (page->child))
for (children = notebook->focus_tab;
children && children != notebook->first_tab;
children = gtk_notebook_search_page (notebook,
@@ -5428,7 +5429,7 @@ gtk_notebook_calculate_shown_tabs (GtkNotebook *notebook,
children = children->next;
if (!NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) ||
- !GTK_WIDGET_VISIBLE (page->child))
+ !gtk_widget_get_visible (page->child))
continue;
c++;
@@ -5554,7 +5555,7 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook,
{
*children = (*children)->next;
- if (page->pack != GTK_PACK_END || !GTK_WIDGET_VISIBLE (page->child))
+ if (page->pack != GTK_PACK_END || !gtk_widget_get_visible (page->child))
continue;
}
@@ -5867,7 +5868,7 @@ gtk_notebook_page_allocate (GtkNotebook *notebook,
gboolean was_visible = page->tab_allocated_visible;
if (!page->tab_label ||
- !GTK_WIDGET_VISIBLE (page->tab_label) ||
+ !gtk_widget_get_visible (page->tab_label) ||
!gtk_widget_get_child_visible (page->tab_label))
{
page->tab_allocated_visible = FALSE;
@@ -5988,7 +5989,7 @@ gtk_notebook_calc_tabs (GtkNotebook *notebook,
{
page = children->data;
if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) &&
- GTK_WIDGET_VISIBLE (page->child))
+ gtk_widget_get_visible (page->child))
{
if (page->pack == pack)
{
@@ -6024,7 +6025,7 @@ gtk_notebook_calc_tabs (GtkNotebook *notebook,
{
page = children->data;
if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) &&
- GTK_WIDGET_VISIBLE (page->child))
+ gtk_widget_get_visible (page->child))
{
if (page->pack == pack)
{
@@ -6093,7 +6094,7 @@ gtk_notebook_real_switch_page (GtkNotebook *notebook,
{
gboolean child_has_focus;
- if (notebook->cur_page == page || !GTK_WIDGET_VISIBLE (page->child))
+ if (notebook->cur_page == page || !gtk_widget_get_visible (page->child))
return;
/* save the value here, changing visibility changes focus */
@@ -6280,7 +6281,7 @@ gtk_notebook_menu_item_create (GtkNotebook *notebook,
gtk_notebook_real_page_position (notebook, list));
g_signal_connect (menu_item, "activate",
G_CALLBACK (gtk_notebook_menu_switch_page), page);
- if (GTK_WIDGET_VISIBLE (page->child))
+ if (gtk_widget_get_visible (page->child))
gtk_widget_show (menu_item);
}
@@ -6331,7 +6332,8 @@ gtk_notebook_set_tab_border_internal (GtkNotebook *notebook,
notebook->tab_hborder = border_width;
notebook->tab_vborder = border_width;
- if (GTK_WIDGET_VISIBLE (notebook) && notebook->show_tabs)
+ if (notebook->show_tabs &&
+ gtk_widget_get_visible (GTK_WIDGET (notebook)))
gtk_widget_queue_resize (GTK_WIDGET (notebook));
g_object_freeze_notify (G_OBJECT (notebook));
@@ -6349,7 +6351,8 @@ gtk_notebook_set_tab_hborder_internal (GtkNotebook *notebook,
notebook->tab_hborder = tab_hborder;
- if (GTK_WIDGET_VISIBLE (notebook) && notebook->show_tabs)
+ if (notebook->show_tabs &&
+ gtk_widget_get_visible (GTK_WIDGET (notebook)))
gtk_widget_queue_resize (GTK_WIDGET (notebook));
g_object_notify (G_OBJECT (notebook), "tab-hborder");
@@ -6364,7 +6367,8 @@ gtk_notebook_set_tab_vborder_internal (GtkNotebook *notebook,
notebook->tab_vborder = tab_vborder;
- if (GTK_WIDGET_VISIBLE (notebook) && notebook->show_tabs)
+ if (notebook->show_tabs &&
+ gtk_widget_get_visible (GTK_WIDGET (notebook)))
gtk_widget_queue_resize (GTK_WIDGET (notebook));
g_object_notify (G_OBJECT (notebook), "tab-vborder");
@@ -6846,7 +6850,7 @@ gtk_notebook_set_show_border (GtkNotebook *notebook,
{
notebook->show_border = show_border;
- if (GTK_WIDGET_VISIBLE (notebook))
+ if (gtk_widget_get_visible (GTK_WIDGET (notebook)))
gtk_widget_queue_resize (GTK_WIDGET (notebook));
g_object_notify (G_OBJECT (notebook), "show-border");
@@ -6966,7 +6970,7 @@ gtk_notebook_set_tab_pos (GtkNotebook *notebook,
if (notebook->tab_pos != pos)
{
notebook->tab_pos = pos;
- if (GTK_WIDGET_VISIBLE (notebook))
+ if (gtk_widget_get_visible (GTK_WIDGET (notebook)))
gtk_widget_queue_resize (GTK_WIDGET (notebook));
}
@@ -7077,7 +7081,7 @@ gtk_notebook_set_scrollable (GtkNotebook *notebook,
{
notebook->scrollable = scrollable;
- if (GTK_WIDGET_VISIBLE (notebook))
+ if (gtk_widget_get_visible (GTK_WIDGET (notebook)))
gtk_widget_queue_resize (GTK_WIDGET (notebook));
g_object_notify (G_OBJECT (notebook), "scrollable");
@@ -7271,7 +7275,7 @@ gtk_notebook_set_tab_label (GtkNotebook *notebook,
G_CALLBACK (gtk_notebook_mnemonic_activate_switch_page),
notebook);
- if (notebook->show_tabs && GTK_WIDGET_VISIBLE (child))
+ if (notebook->show_tabs && gtk_widget_get_visible (child))
{
gtk_widget_show (page->tab_label);
gtk_widget_queue_resize (GTK_WIDGET (notebook));
diff --git a/gtk/gtkoffscreenwindow.c b/gtk/gtkoffscreenwindow.c
index 840995e183..56cce55b78 100644
--- a/gtk/gtkoffscreenwindow.c
+++ b/gtk/gtkoffscreenwindow.c
@@ -63,7 +63,7 @@ gtk_offscreen_window_size_request (GtkWidget *widget,
requisition->width = border_width * 2;
requisition->height = border_width * 2;
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkRequisition child_req;
@@ -100,7 +100,7 @@ gtk_offscreen_window_size_allocate (GtkWidget *widget,
allocation->width,
allocation->height);
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkAllocation child_alloc;
@@ -210,7 +210,7 @@ gtk_offscreen_window_check_resize (GtkContainer *container)
{
GtkWidget *widget = GTK_WIDGET (container);
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
gtk_offscreen_window_resize (widget);
}
diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c
index 4b077a6c2a..9da3fe0659 100644
--- a/gtk/gtkoptionmenu.c
+++ b/gtk/gtkoptionmenu.c
@@ -420,7 +420,7 @@ gtk_option_menu_size_request (GtkWidget *widget,
gtk_option_menu_get_props (option_menu, &props);
- if (GTK_BIN (option_menu)->child && GTK_WIDGET_VISIBLE (GTK_BIN (option_menu)->child))
+ if (GTK_BIN (option_menu)->child && gtk_widget_get_visible (GTK_BIN (option_menu)->child))
{
gtk_widget_size_request (GTK_BIN (option_menu)->child, &child_requisition);
@@ -464,7 +464,7 @@ gtk_option_menu_size_allocate (GtkWidget *widget,
allocation->width - border_width * 2, allocation->height - border_width * 2);
child = GTK_BIN (widget)->child;
- if (child && GTK_WIDGET_VISIBLE (child))
+ if (child && gtk_widget_get_visible (child))
{
gint xthickness = GTK_WIDGET (widget)->style->xthickness;
gint ythickness = GTK_WIDGET (widget)->style->ythickness;
@@ -846,7 +846,7 @@ gtk_option_menu_calc_size (GtkOptionMenu *option_menu)
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child))
+ if (gtk_widget_get_visible (child))
{
GtkWidget *inner = GTK_BIN (child)->child;
@@ -915,7 +915,7 @@ gtk_option_menu_position (GtkMenu *menu,
if (active == child)
break;
- if (GTK_WIDGET_VISIBLE (child))
+ if (gtk_widget_get_visible (child))
{
gtk_widget_get_child_requisition (child, &requisition);
menu_ypos -= requisition.height;
@@ -1014,7 +1014,8 @@ gtk_option_menu_scroll_event (GtkWidget *widget,
l = g_list_nth (GTK_MENU_SHELL (option_menu->menu)->children, index);
item = GTK_MENU_ITEM (l->data);
- if (GTK_WIDGET_VISIBLE (item) && gtk_widget_is_sensitive (GTK_WIDGET (item)))
+ if (gtk_widget_get_visible (GTK_WIDGET (item)) &&
+ gtk_widget_is_sensitive (GTK_WIDGET (item)))
{
gtk_option_menu_set_history (option_menu, index);
gtk_menu_item_activate (GTK_MENU_ITEM (item));
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 328f0ab744..7beb73780f 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -762,7 +762,7 @@ gtk_paned_size_request (GtkWidget *widget,
requisition->width = 0;
requisition->height = 0;
- if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1))
+ if (paned->child1 && gtk_widget_get_visible (paned->child1))
{
gtk_widget_size_request (paned->child1, &child_requisition);
@@ -770,7 +770,7 @@ gtk_paned_size_request (GtkWidget *widget,
requisition->width = child_requisition.width;
}
- if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
+ if (paned->child2 && gtk_widget_get_visible (paned->child2))
{
gtk_widget_size_request (paned->child2, &child_requisition);
@@ -791,8 +791,8 @@ gtk_paned_size_request (GtkWidget *widget,
requisition->width += GTK_CONTAINER (paned)->border_width * 2;
requisition->height += GTK_CONTAINER (paned)->border_width * 2;
- if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
- paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
+ if (paned->child1 && gtk_widget_get_visible (paned->child1) &&
+ paned->child2 && gtk_widget_get_visible (paned->child2))
{
gint handle_size;
@@ -824,8 +824,8 @@ gtk_paned_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
- if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
- paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
+ if (paned->child1 && gtk_widget_get_visible (paned->child1) &&
+ paned->child2 && gtk_widget_get_visible (paned->child2))
{
GtkRequisition child1_requisition;
GtkRequisition child2_requisition;
@@ -963,9 +963,9 @@ gtk_paned_size_allocate (GtkWidget *widget,
child_allocation.width = MAX (1, allocation->width - 2 * border_width);
child_allocation.height = MAX (1, allocation->height - 2 * border_width);
- if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1))
+ if (paned->child1 && gtk_widget_get_visible (paned->child1))
gtk_widget_size_allocate (paned->child1, &child_allocation);
- else if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
+ else if (paned->child2 && gtk_widget_get_visible (paned->child2))
gtk_widget_size_allocate (paned->child2, &child_allocation);
}
}
@@ -1012,8 +1012,8 @@ gtk_paned_realize (GtkWidget *widget)
widget->style = gtk_style_attach (widget->style, widget->window);
- if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
- paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
+ if (paned->child1 && gtk_widget_get_visible (paned->child1) &&
+ paned->child2 && gtk_widget_get_visible (paned->child2))
gdk_window_show (paned->handle);
}
@@ -1069,9 +1069,9 @@ gtk_paned_expose (GtkWidget *widget,
{
GtkPaned *paned = GTK_PANED (widget);
- if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget) &&
- paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
- paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
+ if (gtk_widget_get_visible (widget) && GTK_WIDGET_MAPPED (widget) &&
+ paned->child1 && gtk_widget_get_visible (paned->child1) &&
+ paned->child2 && gtk_widget_get_visible (paned->child2))
{
GtkStateType state;
@@ -1423,7 +1423,7 @@ gtk_paned_remove (GtkContainer *container,
gboolean was_visible;
paned = GTK_PANED (container);
- was_visible = GTK_WIDGET_VISIBLE (widget);
+ was_visible = gtk_widget_get_visible (widget);
if (paned->child1 == widget)
{
@@ -1431,7 +1431,7 @@ gtk_paned_remove (GtkContainer *container,
paned->child1 = NULL;
- if (was_visible && GTK_WIDGET_VISIBLE (container))
+ if (was_visible && gtk_widget_get_visible (GTK_WIDGET (container)))
gtk_widget_queue_resize_no_redraw (GTK_WIDGET (container));
}
else if (paned->child2 == widget)
@@ -1440,7 +1440,7 @@ gtk_paned_remove (GtkContainer *container,
paned->child2 = NULL;
- if (was_visible && GTK_WIDGET_VISIBLE (container))
+ if (was_visible && gtk_widget_get_visible (GTK_WIDGET (container)))
gtk_widget_queue_resize_no_redraw (GTK_WIDGET (container));
}
}
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index b86a8f421d..81d06c642d 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -714,7 +714,7 @@ static void
gtk_path_bar_remove_1 (GtkContainer *container,
GtkWidget *widget)
{
- gboolean was_visible = GTK_WIDGET_VISIBLE (widget);
+ gboolean was_visible = gtk_widget_get_visible (widget);
gtk_widget_unparent (widget);
if (was_visible)
gtk_widget_queue_resize (GTK_WIDGET (container));
diff --git a/gtk/gtkpixmap.c b/gtk/gtkpixmap.c
index 60e4bd0ed8..3f1a586f5e 100644
--- a/gtk/gtkpixmap.c
+++ b/gtk/gtkpixmap.c
@@ -135,7 +135,7 @@ gtk_pixmap_set (GtkPixmap *pixmap,
GTK_WIDGET (pixmap)->requisition.width = 0;
GTK_WIDGET (pixmap)->requisition.height = 0;
}
- if (GTK_WIDGET_VISIBLE (pixmap))
+ if (gtk_widget_get_visible (GTK_WIDGET (pixmap)))
{
if ((GTK_WIDGET (pixmap)->requisition.width != oldwidth) ||
(GTK_WIDGET (pixmap)->requisition.height != oldheight))
@@ -235,7 +235,7 @@ gtk_pixmap_set_build_insensitive (GtkPixmap *pixmap, gboolean build)
pixmap->build_insensitive = build;
- if (GTK_WIDGET_VISIBLE (pixmap))
+ if (gtk_widget_get_visible (GTK_WIDGET (pixmap)))
{
gtk_widget_queue_draw (GTK_WIDGET (pixmap));
}
diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c
index b41d385c10..34fa4cb619 100644
--- a/gtk/gtkplug.c
+++ b/gtk/gtkplug.c
@@ -392,7 +392,7 @@ _gtk_plug_remove_from_socket (GtkPlug *plug,
g_object_ref (plug);
g_object_ref (socket_);
- widget_was_visible = GTK_WIDGET_VISIBLE (plug);
+ widget_was_visible = gtk_widget_get_visible (widget);
gdk_window_hide (widget->window);
GTK_PRIVATE_SET_FLAG (plug, GTK_IN_REPARENT);
@@ -428,7 +428,7 @@ _gtk_plug_remove_from_socket (GtkPlug *plug,
g_object_unref (plug);
- if (widget_was_visible && GTK_WIDGET_VISIBLE (socket_))
+ if (widget_was_visible && gtk_widget_get_visible (GTK_WIDGET (socket_)))
gtk_widget_queue_resize (GTK_WIDGET (socket_));
g_object_unref (socket_);
@@ -690,7 +690,7 @@ gtk_plug_map (GtkWidget *widget)
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
if (bin->child &&
- GTK_WIDGET_VISIBLE (bin->child) &&
+ gtk_widget_get_visible (bin->child) &&
!GTK_WIDGET_MAPPED (bin->child))
gtk_widget_map (bin->child);
@@ -742,7 +742,7 @@ gtk_plug_size_allocate (GtkWidget *widget,
allocation->x, allocation->y,
allocation->width, allocation->height);
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkAllocation child_allocation;
diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c
index 2fcba3bb15..11e3c86d50 100644
--- a/gtk/gtkradiobutton.c
+++ b/gtk/gtkradiobutton.c
@@ -705,7 +705,7 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
y = widget->allocation.y + (widget->allocation.height - indicator_size) / 2;
child = GTK_BIN (check_button)->child;
- if (!interior_focus || !(child && GTK_WIDGET_VISIBLE (child)))
+ if (!interior_focus || !(child && gtk_widget_get_visible (child)))
x += focus_width + focus_pad;
if (toggle_button->inconsistent)
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 70fd4297ba..02222a08e0 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -654,15 +654,18 @@ void
gtk_scale_set_value_pos (GtkScale *scale,
GtkPositionType pos)
{
+ GtkWidget *widget;
+
g_return_if_fail (GTK_IS_SCALE (scale));
if (scale->value_pos != pos)
{
scale->value_pos = pos;
+ widget = GTK_WIDGET (scale);
_gtk_scale_clear_layout (scale);
- if (GTK_WIDGET_VISIBLE (scale) && GTK_WIDGET_MAPPED (scale))
- gtk_widget_queue_resize (GTK_WIDGET (scale));
+ if (gtk_widget_get_visible (widget) && GTK_WIDGET_MAPPED (widget))
+ gtk_widget_queue_resize (widget);
g_object_notify (G_OBJECT (scale), "value-pos");
}
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 8006fb674f..67274e7ecc 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -1259,7 +1259,7 @@ gtk_scrolled_window_size_request (GtkWidget *widget,
gtk_widget_size_request (scrolled_window->vscrollbar,
&vscrollbar_requisition);
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
gtk_widget_size_request (bin->child, &child_requisition);
@@ -1415,7 +1415,7 @@ gtk_scrolled_window_size_allocate (GtkWidget *widget,
else if (scrolled_window->vscrollbar_policy == GTK_POLICY_NEVER)
scrolled_window->vscrollbar_visible = FALSE;
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
gboolean previous_hvis;
gboolean previous_vvis;
@@ -1469,7 +1469,7 @@ gtk_scrolled_window_size_allocate (GtkWidget *widget,
gtk_widget_get_child_requisition (scrolled_window->hscrollbar,
&hscrollbar_requisition);
- if (!GTK_WIDGET_VISIBLE (scrolled_window->hscrollbar))
+ if (!gtk_widget_get_visible (scrolled_window->hscrollbar))
gtk_widget_show (scrolled_window->hscrollbar);
child_allocation.x = relative_allocation.x;
@@ -1508,13 +1508,13 @@ gtk_scrolled_window_size_allocate (GtkWidget *widget,
gtk_widget_size_allocate (scrolled_window->hscrollbar, &child_allocation);
}
- else if (GTK_WIDGET_VISIBLE (scrolled_window->hscrollbar))
+ else if (gtk_widget_get_visible (scrolled_window->hscrollbar))
gtk_widget_hide (scrolled_window->hscrollbar);
if (scrolled_window->vscrollbar_visible)
{
GtkRequisition vscrollbar_requisition;
- if (!GTK_WIDGET_VISIBLE (scrolled_window->vscrollbar))
+ if (!gtk_widget_get_visible (scrolled_window->vscrollbar))
gtk_widget_show (scrolled_window->vscrollbar);
gtk_widget_get_child_requisition (scrolled_window->vscrollbar,
@@ -1560,7 +1560,7 @@ gtk_scrolled_window_size_allocate (GtkWidget *widget,
gtk_widget_size_allocate (scrolled_window->vscrollbar, &child_allocation);
}
- else if (GTK_WIDGET_VISIBLE (scrolled_window->vscrollbar))
+ else if (gtk_widget_get_visible (scrolled_window->vscrollbar))
gtk_widget_hide (scrolled_window->vscrollbar);
}
@@ -1578,7 +1578,7 @@ gtk_scrolled_window_scroll_event (GtkWidget *widget,
else
range = GTK_SCROLLED_WINDOW (widget)->hscrollbar;
- if (range && GTK_WIDGET_VISIBLE (range))
+ if (range && gtk_widget_get_visible (range))
{
GtkAdjustment *adj = GTK_RANGE (range)->adjustment;
gdouble delta, new_value;
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c
index 125efef98b..04212be199 100644
--- a/gtk/gtkstatusbar.c
+++ b/gtk/gtkstatusbar.c
@@ -894,7 +894,7 @@ has_extra_children (GtkStatusbar *statusbar)
{
child = l->data;
- if (!GTK_WIDGET_VISIBLE (child->widget))
+ if (!gtk_widget_get_visible (child->widget))
continue;
if (frame->pack == GTK_PACK_START || child->pack == GTK_PACK_END)
diff --git a/gtk/gtktable.c b/gtk/gtktable.c
index a5d4b95f64..4c3b7b5477 100644
--- a/gtk/gtktable.c
+++ b/gtk/gtktable.c
@@ -372,7 +372,8 @@ gtk_table_set_child_property (GtkContainer *container,
GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
break;
}
- if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (table))
+ if (gtk_widget_get_visible (child) &&
+ gtk_widget_get_visible (GTK_WIDGET (table)))
gtk_widget_queue_resize (child);
}
@@ -626,7 +627,7 @@ gtk_table_set_row_spacing (GtkTable *table,
{
table->rows[row].spacing = spacing;
- if (GTK_WIDGET_VISIBLE (table))
+ if (gtk_widget_get_visible (GTK_WIDGET (table)))
gtk_widget_queue_resize (GTK_WIDGET (table));
}
}
@@ -663,7 +664,7 @@ gtk_table_set_col_spacing (GtkTable *table,
{
table->cols[column].spacing = spacing;
- if (GTK_WIDGET_VISIBLE (table))
+ if (gtk_widget_get_visible (GTK_WIDGET (table)))
gtk_widget_queue_resize (GTK_WIDGET (table));
}
}
@@ -700,7 +701,7 @@ gtk_table_set_row_spacings (GtkTable *table,
for (row = 0; row < table->nrows; row++)
table->rows[row].spacing = spacing;
- if (GTK_WIDGET_VISIBLE (table))
+ if (gtk_widget_get_visible (GTK_WIDGET (table)))
gtk_widget_queue_resize (GTK_WIDGET (table));
g_object_notify (G_OBJECT (table), "row-spacing");
@@ -736,7 +737,7 @@ gtk_table_set_col_spacings (GtkTable *table,
for (col = 0; col < table->ncols; col++)
table->cols[col].spacing = spacing;
- if (GTK_WIDGET_VISIBLE (table))
+ if (gtk_widget_get_visible (GTK_WIDGET (table)))
gtk_widget_queue_resize (GTK_WIDGET (table));
g_object_notify (G_OBJECT (table), "column-spacing");
@@ -771,7 +772,7 @@ gtk_table_set_homogeneous (GtkTable *table,
{
table->homogeneous = homogeneous;
- if (GTK_WIDGET_VISIBLE (table))
+ if (gtk_widget_get_visible (GTK_WIDGET (table)))
gtk_widget_queue_resize (GTK_WIDGET (table));
g_object_notify (G_OBJECT (table), "homogeneous");
@@ -862,6 +863,7 @@ gtk_table_remove (GtkContainer *container,
{
GtkTable *table = GTK_TABLE (container);
GtkTableChild *child;
+ GtkWidget *widget_container = GTK_WIDGET (container);
GList *children;
children = table->children;
@@ -873,15 +875,15 @@ gtk_table_remove (GtkContainer *container,
if (child->widget == widget)
{
- gboolean was_visible = GTK_WIDGET_VISIBLE (widget);
+ gboolean was_visible = gtk_widget_get_visible (widget);
gtk_widget_unparent (widget);
table->children = g_list_remove (table->children, child);
g_free (child);
- if (was_visible && GTK_WIDGET_VISIBLE (container))
- gtk_widget_queue_resize (GTK_WIDGET (container));
+ if (was_visible && gtk_widget_get_visible (widget_container))
+ gtk_widget_queue_resize (widget_container);
break;
}
}
@@ -932,7 +934,7 @@ gtk_table_size_request_init (GtkTable *table)
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
gtk_widget_size_request (child->widget, NULL);
if (child->left_attach == (child->right_attach - 1) && child->xexpand)
@@ -957,7 +959,7 @@ gtk_table_size_request_pass1 (GtkTable *table)
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
GtkRequisition child_requisition;
gtk_widget_get_child_requisition (child->widget, &child_requisition);
@@ -1020,7 +1022,7 @@ gtk_table_size_request_pass3 (GtkTable *table)
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
/* Child spans multiple columns.
*/
@@ -1173,7 +1175,7 @@ gtk_table_size_allocate_init (GtkTable *table)
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
if (child->left_attach == (child->right_attach - 1))
{
@@ -1208,7 +1210,7 @@ gtk_table_size_allocate_init (GtkTable *table)
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
if (child->left_attach != (child->right_attach - 1))
{
@@ -1545,7 +1547,7 @@ gtk_table_size_allocate_pass2 (GtkTable *table)
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
GtkRequisition child_requisition;
gtk_widget_get_child_requisition (child->widget, &child_requisition);
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 1e79bd119e..589e8af859 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -1501,7 +1501,7 @@ gtk_text_view_set_buffer (GtkTextView *text_view,
g_object_notify (G_OBJECT (text_view), "buffer");
- if (GTK_WIDGET_VISIBLE (text_view))
+ if (gtk_widget_get_visible (GTK_WIDGET (text_view)))
gtk_widget_queue_draw (GTK_WIDGET (text_view));
DV(g_print ("Invalidating due to set_buffer\n"));
@@ -7124,7 +7124,7 @@ adjust_allocation_recurse (GtkWidget *widget,
*/
if (!GTK_WIDGET_REALIZED (widget))
{
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
{
GdkRectangle tmp_rectangle = widget->allocation;
tmp_rectangle.x += scroll_data->dx;
@@ -9025,7 +9025,8 @@ gtk_text_view_move_child (GtkTextView *text_view,
vc->x = xpos;
vc->y = ypos;
- if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (text_view))
+ if (gtk_widget_get_visible (child) &&
+ gtk_widget_get_visible (GTK_WIDGET (text_view)))
gtk_widget_queue_resize (child);
}
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index 4350d82ec1..35c0f10d8e 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -310,7 +310,7 @@ gtk_toggle_button_set_mode (GtkToggleButton *toggle_button,
toggle_button->draw_indicator = draw_indicator;
GTK_BUTTON (toggle_button)->depress_on_activate = !draw_indicator;
- if (GTK_WIDGET_VISIBLE (toggle_button))
+ if (gtk_widget_get_visible (GTK_WIDGET (toggle_button)))
gtk_widget_queue_resize (GTK_WIDGET (toggle_button));
g_object_notify (G_OBJECT (toggle_button), "draw-indicator");
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index 229a5d99aa..44f6ad16ac 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -1802,7 +1802,7 @@ gtk_toolbar_size_allocate (GtkWidget *widget,
{
gtk_widget_hide (GTK_WIDGET (priv->arrow_button));
- if (priv->menu && GTK_WIDGET_VISIBLE (priv->menu))
+ if (priv->menu && gtk_widget_get_visible (GTK_WIDGET (priv->menu)))
gtk_menu_shell_deactivate (GTK_MENU_SHELL (priv->menu));
}
@@ -2673,7 +2673,7 @@ gtk_toolbar_arrow_button_clicked (GtkWidget *button,
GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar);
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->arrow_button)) &&
- (!priv->menu || !GTK_WIDGET_VISIBLE (priv->menu)))
+ (!priv->menu || !gtk_widget_get_visible (GTK_WIDGET (priv->menu))))
{
/* We only get here when the button is clicked with the keyboard,
* because mouse button presses result in the menu being shown so
@@ -4117,7 +4117,7 @@ toolbar_content_visible (ToolbarContent *content,
case TOOL_ITEM:
item = content->u.tool_item.item;
- if (!GTK_WIDGET_VISIBLE (item))
+ if (!gtk_widget_get_visible (GTK_WIDGET (item)))
return FALSE;
if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL &&
@@ -4133,7 +4133,7 @@ toolbar_content_visible (ToolbarContent *content,
case COMPATIBILITY:
if (content->u.compatibility.child.type != GTK_TOOLBAR_CHILD_SPACE)
- return GTK_WIDGET_VISIBLE (content->u.compatibility.child.widget);
+ return gtk_widget_get_visible (content->u.compatibility.child.widget);
else
return TRUE;
break;
diff --git a/gtk/gtktoolitem.c b/gtk/gtktoolitem.c
index eb4d8008e2..9b62ced72d 100644
--- a/gtk/gtktoolitem.c
+++ b/gtk/gtktoolitem.c
@@ -524,7 +524,7 @@ gtk_tool_item_size_request (GtkWidget *widget,
{
GtkWidget *child = GTK_BIN (widget)->child;
- if (child && GTK_WIDGET_VISIBLE (child))
+ if (child && gtk_widget_get_visible (child))
{
gtk_widget_size_request (child, requisition);
}
@@ -557,7 +557,7 @@ gtk_tool_item_size_allocate (GtkWidget *widget,
widget->allocation.width - border_width * 2,
widget->allocation.height - border_width * 2);
- if (child && GTK_WIDGET_VISIBLE (child))
+ if (child && gtk_widget_get_visible (child))
{
child_allocation.x = allocation->x + border_width;
child_allocation.y = allocation->y + border_width;
diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c
index d891008908..2c644f033e 100644
--- a/gtk/gtktoolitemgroup.c
+++ b/gtk/gtktoolitemgroup.c
@@ -589,7 +589,7 @@ gtk_tool_item_group_is_item_visible (GtkToolItemGroup *group,
return FALSE;
return
- (GTK_WIDGET_VISIBLE (child->item)) &&
+ (gtk_widget_get_visible (GTK_WIDGET (child->item))) &&
(GTK_ORIENTATION_VERTICAL == orientation ?
gtk_tool_item_get_visible_vertical (child->item) :
gtk_tool_item_get_visible_horizontal (child->item));
@@ -819,7 +819,7 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget,
inquery->height = 0;
/* figure out header widget size */
- if (GTK_WIDGET_VISIBLE (priv->header))
+ if (gtk_widget_get_visible (priv->header))
{
GtkRequisition child_requisition;
@@ -869,7 +869,7 @@ gtk_tool_item_group_real_size_allocate (GtkWidget *widget,
child_allocation.y = border_width;
/* place the header widget */
- if (GTK_WIDGET_VISIBLE (priv->header))
+ if (gtk_widget_get_visible (priv->header))
{
gtk_widget_size_request (priv->header, &child_requisition);
@@ -1390,7 +1390,9 @@ gtk_tool_item_group_set_item_packing (GtkToolItemGroup *group,
gtk_widget_thaw_child_notify (GTK_WIDGET (item));
- if (changed && GTK_WIDGET_VISIBLE (group) && GTK_WIDGET_VISIBLE (item))
+ if (changed
+ && gtk_widget_get_visible (GTK_WIDGET (group))
+ && gtk_widget_get_visible (GTK_WIDGET (item)))
gtk_widget_queue_resize (GTK_WIDGET (group));
}
@@ -1707,7 +1709,7 @@ gtk_tool_item_group_set_label_widget (GtkToolItemGroup *group,
priv->label_widget = label_widget;
- if (GTK_WIDGET_VISIBLE (group))
+ if (gtk_widget_get_visible (GTK_WIDGET (group)))
gtk_widget_queue_resize (GTK_WIDGET (group));
/* Only show the header widget if the group has children: */
@@ -1782,7 +1784,7 @@ gtk_tool_item_group_force_expose (GtkToolItemGroup *group)
gtk_widget_translate_coordinates (widget, parent, 0, 0, &x, &y);
- if (GTK_WIDGET_VISIBLE (priv->header))
+ if (gtk_widget_get_visible (priv->header))
{
height -= priv->header->allocation.height;
y += priv->header->allocation.height;
@@ -2097,7 +2099,8 @@ gtk_tool_item_group_set_item_position (GtkToolItemGroup *group,
priv->children = g_list_insert (priv->children, child, position);
gtk_widget_child_notify (GTK_WIDGET (item), "position");
- if (GTK_WIDGET_VISIBLE (group) && GTK_WIDGET_VISIBLE (item))
+ if (gtk_widget_get_visible (GTK_WIDGET (group)) &&
+ gtk_widget_get_visible (GTK_WIDGET (item)))
gtk_widget_queue_resize (GTK_WIDGET (group));
}
@@ -2292,7 +2295,7 @@ _gtk_tool_item_group_paint (GtkToolItemGroup *group,
v0 = v1 - 256;
- if (!GTK_WIDGET_VISIBLE (priv->header))
+ if (!gtk_widget_get_visible (priv->header))
v0 = MAX (v0, 0);
else if (GTK_ORIENTATION_VERTICAL == orientation)
v0 = MAX (v0, priv->header->allocation.height);
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index c94226cad3..87871e885c 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -79,7 +79,7 @@ struct _GtkTooltipClass
GObjectClass parent_class;
};
-#define GTK_TOOLTIP_VISIBLE(tooltip) ((tooltip)->current_window && GTK_WIDGET_VISIBLE ((tooltip)->current_window))
+#define GTK_TOOLTIP_VISIBLE(tooltip) ((tooltip)->current_window && gtk_widget_get_visible (GTK_WIDGET((tooltip)->current_window)))
static void gtk_tooltip_class_init (GtkTooltipClass *klass);
diff --git a/gtk/gtktree.c b/gtk/gtktree.c
index 625d04e22f..d1d4ee8d20 100644
--- a/gtk/gtktree.c
+++ b/gtk/gtktree.c
@@ -521,7 +521,7 @@ gtk_tree_map (GtkWidget *widget)
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child) &&
+ if (gtk_widget_get_visible (child) &&
!GTK_WIDGET_MAPPED (child))
gtk_widget_map (child);
@@ -529,7 +529,7 @@ gtk_tree_map (GtkWidget *widget)
{
child = GTK_WIDGET (GTK_TREE_ITEM (child)->subtree);
- if (GTK_WIDGET_VISIBLE (child) && !GTK_WIDGET_MAPPED (child))
+ if (gtk_widget_get_visible (child) && !GTK_WIDGET_MAPPED (child))
gtk_widget_map (child);
}
}
@@ -800,7 +800,7 @@ gtk_tree_remove_items (GtkTree *tree,
gtk_tree_select_child (root_tree, widget);
}
- if (GTK_WIDGET_VISIBLE (root_tree))
+ if (gtk_widget_get_visible (GTK_WIDGET (root_tree)))
{
#ifdef TREE_DEBUG
g_message("* query queue resizing for root_tree\n");
@@ -867,7 +867,7 @@ gtk_tree_size_allocate (GtkWidget *widget,
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child))
+ if (gtk_widget_get_visible (child))
{
GtkRequisition child_requisition;
gtk_widget_get_child_requisition (child, &child_requisition);
@@ -879,7 +879,7 @@ gtk_tree_size_allocate (GtkWidget *widget,
child_allocation.y += child_allocation.height;
if((subtree = GTK_TREE_ITEM(child)->subtree))
- if(GTK_WIDGET_VISIBLE (subtree))
+ if(gtk_widget_get_visible (subtree))
{
child_allocation.height = subtree->requisition.height;
gtk_widget_size_allocate (subtree, &child_allocation);
@@ -914,7 +914,7 @@ gtk_tree_size_request (GtkWidget *widget,
child = children->data;
children = children->next;
- if (GTK_WIDGET_VISIBLE (child))
+ if (gtk_widget_get_visible (child))
{
gtk_widget_size_request (child, &child_requisition);
@@ -922,7 +922,7 @@ gtk_tree_size_request (GtkWidget *widget,
requisition->height += child_requisition.height;
if((subtree = GTK_TREE_ITEM(child)->subtree) &&
- GTK_WIDGET_VISIBLE (subtree))
+ gtk_widget_get_visible (subtree))
{
gtk_widget_size_request (subtree, &child_requisition);
diff --git a/gtk/gtktreeitem.c b/gtk/gtktreeitem.c
index 5488872f4f..801b237404 100644
--- a/gtk/gtktreeitem.c
+++ b/gtk/gtktreeitem.c
@@ -204,7 +204,7 @@ gtk_tree_item_subtree_button_changed_state (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_EVENT_BOX (widget));
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
{
if (widget->state == GTK_STATE_NORMAL)
@@ -462,7 +462,7 @@ gtk_tree_item_size_request (GtkWidget *widget,
widget->style->xthickness) * 2;
requisition->height = GTK_CONTAINER (widget)->border_width * 2;
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkRequisition pix_requisition;
@@ -640,7 +640,7 @@ gtk_tree_item_paint (GtkWidget *widget,
gtk_tree_item_draw_lines(widget);
if (tree_item->pixmaps_box &&
- GTK_WIDGET_VISIBLE(tree_item->pixmaps_box) &&
+ gtk_widget_get_visible(tree_item->pixmaps_box) &&
gtk_widget_intersect (tree_item->pixmaps_box, area, &child_area))
{
gtk_widget_queue_draw_area (tree_item->pixmaps_box,
@@ -946,12 +946,12 @@ gtk_tree_item_map (GtkWidget *widget)
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
if(item->pixmaps_box &&
- GTK_WIDGET_VISIBLE (item->pixmaps_box) &&
+ gtk_widget_get_visible (item->pixmaps_box) &&
!GTK_WIDGET_MAPPED (item->pixmaps_box))
gtk_widget_map (item->pixmaps_box);
if (bin->child &&
- GTK_WIDGET_VISIBLE (bin->child) &&
+ gtk_widget_get_visible (bin->child) &&
!GTK_WIDGET_MAPPED (bin->child))
gtk_widget_map (bin->child);
@@ -969,12 +969,12 @@ gtk_tree_item_unmap (GtkWidget *widget)
gdk_window_hide (widget->window);
if(item->pixmaps_box &&
- GTK_WIDGET_VISIBLE (item->pixmaps_box) &&
+ gtk_widget_get_visible (item->pixmaps_box) &&
GTK_WIDGET_MAPPED (item->pixmaps_box))
gtk_widget_unmap (bin->child);
if (bin->child &&
- GTK_WIDGET_VISIBLE (bin->child) &&
+ gtk_widget_get_visible (bin->child) &&
GTK_WIDGET_MAPPED (bin->child))
gtk_widget_unmap (bin->child);
}
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 620ccfc44d..ead022f75c 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -1711,7 +1711,7 @@ gtk_tree_view_map_buttons (GtkTreeView *tree_view)
for (list = tree_view->priv->columns; list; list = list->next)
{
column = list->data;
- if (GTK_WIDGET_VISIBLE (column->button) &&
+ if (gtk_widget_get_visible (column->button) &&
!GTK_WIDGET_MAPPED (column->button))
gtk_widget_map (column->button);
}
@@ -1746,7 +1746,7 @@ gtk_tree_view_map (GtkWidget *widget)
GtkTreeViewChild *child = tmp_list->data;
tmp_list = tmp_list->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
if (!GTK_WIDGET_MAPPED (child->widget))
gtk_widget_map (child->widget);
@@ -2049,7 +2049,7 @@ gtk_tree_view_size_request (GtkWidget *widget,
tmp_list = tmp_list->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
gtk_widget_size_request (child->widget, &child_requisition);
}
}
@@ -10383,7 +10383,7 @@ gtk_tree_view_real_start_interactive_search (GtkTreeView *tree_view,
return FALSE;
if (tree_view->priv->search_window != NULL &&
- GTK_WIDGET_VISIBLE (tree_view->priv->search_window))
+ gtk_widget_get_visible (tree_view->priv->search_window))
return TRUE;
for (list = tree_view->priv->columns; list; list = list->next)
@@ -10517,7 +10517,7 @@ adjust_allocation_recurse (GtkWidget *widget,
*/
if (!GTK_WIDGET_REALIZED (widget))
{
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
{
GdkRectangle tmp_rectangle = widget->allocation;
tmp_rectangle.x += scroll_data->dx;
@@ -11660,7 +11660,7 @@ gtk_tree_view_scroll_to_cell (GtkTreeView *tree_view,
* scrolling code, we short-circuit validate_visible_area's immplementation as
* it is much slower than just going to the point.
*/
- if (! GTK_WIDGET_VISIBLE (tree_view) ||
+ if (! gtk_widget_get_visible (GTK_WIDGET (tree_view)) ||
! GTK_WIDGET_REALIZED (tree_view) ||
GTK_WIDGET_ALLOC_NEEDED (tree_view) ||
GTK_RBNODE_FLAG_SET (tree_view->priv->tree->root, GTK_RBNODE_DESCENDANTS_INVALID))
@@ -14171,7 +14171,7 @@ gtk_tree_view_search_dialog_hide (GtkWidget *search_dialog,
tree_view->priv->typeselect_flush_timeout = 0;
}
- if (GTK_WIDGET_VISIBLE (search_dialog))
+ if (gtk_widget_get_visible (search_dialog))
{
/* send focus-in event */
send_focus_change (GTK_WIDGET (tree_view->priv->search_entry), FALSE);
diff --git a/gtk/gtkuimanager.c b/gtk/gtkuimanager.c
index c5c7794a95..084f1bf0aa 100644
--- a/gtk/gtkuimanager.c
+++ b/gtk/gtkuimanager.c
@@ -2133,7 +2133,7 @@ _gtk_menu_is_empty (GtkWidget *menu)
cur = children;
while (cur)
{
- if (GTK_WIDGET_VISIBLE (cur->data))
+ if (gtk_widget_get_visible (cur->data))
{
if (!GTK_IS_TEAROFF_MENU_ITEM (cur->data) &&
!g_object_get_data (cur->data, "gtk-empty-menu-item"))
@@ -2214,7 +2214,7 @@ update_smart_separators (GtkWidget *proxy)
break;
}
}
- else if (GTK_WIDGET_VISIBLE (cur->data))
+ else if (gtk_widget_get_visible (cur->data))
{
last = NULL;
if (GTK_IS_TEAROFF_MENU_ITEM (cur->data) || cur->data == filler)
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index b4411cfb27..5d707d96fc 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -378,7 +378,7 @@ viewport_set_hadjustment_values (GtkViewport *viewport,
hadjustment->lower = 0;
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkRequisition child_requisition;
@@ -415,7 +415,7 @@ viewport_set_vadjustment_values (GtkViewport *viewport,
vadjustment->lower = 0;
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkRequisition child_requisition;
@@ -529,7 +529,7 @@ gtk_viewport_set_shadow_type (GtkViewport *viewport,
{
viewport->shadow_type = type;
- if (GTK_WIDGET_VISIBLE (viewport))
+ if (gtk_widget_get_visible (GTK_WIDGET (viewport)))
{
gtk_widget_size_allocate (GTK_WIDGET (viewport), &(GTK_WIDGET (viewport)->allocation));
gtk_widget_queue_draw (GTK_WIDGET (viewport));
@@ -738,7 +738,7 @@ gtk_viewport_size_request (GtkWidget *widget,
requisition->height += 2 * widget->style->ythickness;
}
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
gtk_widget_size_request (bin->child, &child_requisition);
requisition->width += child_requisition.width;
@@ -797,7 +797,7 @@ gtk_viewport_size_allocate (GtkWidget *widget,
child_allocation.width,
child_allocation.height);
}
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
gtk_widget_size_allocate (bin->child, &child_allocation);
gtk_adjustment_changed (hadjustment);
@@ -815,7 +815,7 @@ gtk_viewport_adjustment_value_changed (GtkAdjustment *adjustment,
GtkViewport *viewport = GTK_VIEWPORT (data);
GtkBin *bin = GTK_BIN (data);
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child) &&
+ if (bin->child && gtk_widget_get_visible (bin->child) &&
GTK_WIDGET_REALIZED (viewport))
{
GtkAdjustment *hadjustment = gtk_viewport_get_hadjustment (viewport);
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 34e27ac117..f22efb3fc0 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -2670,7 +2670,7 @@ gtk_widget_set_property (GObject *object,
tmp = (tooltip_window != NULL || tooltip_markup != NULL);
gtk_widget_real_set_has_tooltip (widget, tmp, FALSE);
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
gtk_widget_queue_tooltip_query (widget);
break;
case PROP_TOOLTIP_TEXT:
@@ -2691,7 +2691,7 @@ gtk_widget_set_property (GObject *object,
tmp = (tooltip_window != NULL || tooltip_markup != NULL);
gtk_widget_real_set_has_tooltip (widget, tmp, FALSE);
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
gtk_widget_queue_tooltip_query (widget);
break;
case PROP_DOUBLE_BUFFERED:
@@ -2740,7 +2740,7 @@ gtk_widget_get_property (GObject *object,
}
break;
case PROP_VISIBLE:
- g_value_set_boolean (value, (GTK_WIDGET_VISIBLE (widget) != FALSE));
+ g_value_set_boolean (value, (gtk_widget_get_visible (widget) != FALSE));
break;
case PROP_SENSITIVE:
g_value_set_boolean (value, (gtk_widget_get_sensitive (widget) != FALSE));
@@ -3178,7 +3178,7 @@ gtk_widget_show (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
- if (!GTK_WIDGET_VISIBLE (widget))
+ if (!gtk_widget_get_visible (widget))
{
g_object_ref (widget);
if (!gtk_widget_is_toplevel (widget))
@@ -3192,7 +3192,7 @@ gtk_widget_show (GtkWidget *widget)
static void
gtk_widget_real_show (GtkWidget *widget)
{
- if (!GTK_WIDGET_VISIBLE (widget))
+ if (!gtk_widget_get_visible (widget))
{
GTK_WIDGET_SET_FLAGS (widget, GTK_VISIBLE);
@@ -3259,7 +3259,7 @@ gtk_widget_hide (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
{
GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
@@ -3278,7 +3278,7 @@ gtk_widget_hide (GtkWidget *widget)
static void
gtk_widget_real_hide (GtkWidget *widget)
{
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
{
GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
@@ -3367,7 +3367,7 @@ void
gtk_widget_map (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (GTK_WIDGET_VISIBLE (widget));
+ g_return_if_fail (gtk_widget_get_visible (widget));
g_return_if_fail (GTK_WIDGET_CHILD_VISIBLE (widget));
if (!GTK_WIDGET_MAPPED (widget))
@@ -5832,7 +5832,7 @@ gtk_widget_set_visible (GtkWidget *widget,
{
g_return_if_fail (GTK_IS_WIDGET (widget));
- if (visible != GTK_WIDGET_VISIBLE (widget))
+ if (visible != gtk_widget_get_visible (widget))
{
if (visible)
gtk_widget_show (widget);
@@ -5860,7 +5860,7 @@ gtk_widget_get_visible (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- return (GTK_WIDGET_FLAGS (widget) & GTK_VISIBLE) != 0;
+ return (GTK_OBJECT_FLAGS (widget) & GTK_VISIBLE) != 0;
}
/**
@@ -6349,8 +6349,8 @@ gtk_widget_set_parent (GtkWidget *widget,
if (GTK_WIDGET_REALIZED (widget->parent))
gtk_widget_realize (widget);
- if (GTK_WIDGET_VISIBLE (widget->parent) &&
- GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget->parent) &&
+ gtk_widget_get_visible (widget))
{
if (GTK_WIDGET_CHILD_VISIBLE (widget) &&
GTK_WIDGET_MAPPED (widget->parent))
@@ -7446,7 +7446,7 @@ gtk_widget_set_child_visible (GtkWidget *widget,
{
if (GTK_WIDGET_MAPPED (widget->parent) &&
GTK_WIDGET_CHILD_VISIBLE (widget) &&
- GTK_WIDGET_VISIBLE (widget))
+ gtk_widget_get_visible (widget))
gtk_widget_map (widget);
else
gtk_widget_unmap (widget);
@@ -7647,7 +7647,7 @@ gtk_widget_child_focus (GtkWidget *widget,
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- if (!GTK_WIDGET_VISIBLE (widget) ||
+ if (!gtk_widget_get_visible (widget) ||
!gtk_widget_is_sensitive (widget))
return FALSE;
@@ -7823,7 +7823,7 @@ gtk_widget_set_uposition (GtkWidget *widget,
if (GTK_IS_WINDOW (widget) && aux_info->x_set && aux_info->y_set)
_gtk_window_reposition (GTK_WINDOW (widget), aux_info->x, aux_info->y);
- if (GTK_WIDGET_VISIBLE (widget) && widget->parent)
+ if (gtk_widget_get_visible (widget) && widget->parent)
gtk_widget_size_allocate (widget, &widget->allocation);
}
@@ -7852,7 +7852,7 @@ gtk_widget_set_usize_internal (GtkWidget *widget,
changed = TRUE;
}
- if (GTK_WIDGET_VISIBLE (widget) && changed)
+ if (gtk_widget_get_visible (widget) && changed)
gtk_widget_queue_resize (widget);
g_object_thaw_notify (G_OBJECT (widget));
@@ -8680,7 +8680,7 @@ gtk_widget_dispose (GObject *object)
if (widget->parent)
gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
- else if (GTK_WIDGET_VISIBLE (widget))
+ else if (gtk_widget_get_visible (widget))
gtk_widget_hide (widget);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
@@ -9559,7 +9559,7 @@ gtk_widget_get_snapshot (GtkWidget *widget,
GList *windows = NULL, *list;
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
- if (!GTK_WIDGET_VISIBLE (widget))
+ if (!gtk_widget_get_visible (widget))
return NULL;
/* the widget (and parent_window) must be realized to be drawable */
@@ -10953,7 +10953,7 @@ gtk_widget_set_tooltip_window (GtkWidget *widget,
has_tooltip = (custom_window != NULL || tooltip_markup != NULL);
gtk_widget_real_set_has_tooltip (widget, has_tooltip, FALSE);
- if (has_tooltip && GTK_WIDGET_VISIBLE (widget))
+ if (has_tooltip && gtk_widget_get_visible (widget))
gtk_widget_queue_tooltip_query (widget);
}
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index b3439a779f..0a22a98c5a 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -233,13 +233,17 @@ typedef enum
*/
#define GTK_WIDGET_MAPPED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_MAPPED) != 0)
+#ifndef GTK_DISABLE_DEPRECATED
/**
* GTK_WIDGET_VISIBLE:
* @wid: a #GtkWidget.
*
* Evaluates to %TRUE if the widget is visible.
+ *
+ * Deprecated: 2.20: Use gtk_widget_get_visible() instead.
*/
#define GTK_WIDGET_VISIBLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_VISIBLE) != 0)
+#endif
#ifndef GTK_DISABLE_DEPRECATED
/**
diff --git a/gtk/gtkwin32embedwidget.c b/gtk/gtkwin32embedwidget.c
index 6afd918a46..0d90d2bf8b 100644
--- a/gtk/gtkwin32embedwidget.c
+++ b/gtk/gtkwin32embedwidget.c
@@ -270,7 +270,7 @@ gtk_win32_embed_widget_map (GtkWidget *widget)
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
if (bin->child &&
- GTK_WIDGET_VISIBLE (bin->child) &&
+ gtk_widget_get_visible (bin->child) &&
!GTK_WIDGET_MAPPED (bin->child))
gtk_widget_map (bin->child);
@@ -297,7 +297,7 @@ gtk_win32_embed_widget_size_allocate (GtkWidget *widget,
allocation->x, allocation->y,
allocation->width, allocation->height);
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkAllocation child_allocation;
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index e28bffda4d..86a915a4a0 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -2037,6 +2037,8 @@ void
gtk_window_set_modal (GtkWindow *window,
gboolean modal)
{
+ GtkWidget *widget;
+
g_return_if_fail (GTK_IS_WINDOW (window));
modal = modal != FALSE;
@@ -2044,24 +2046,23 @@ gtk_window_set_modal (GtkWindow *window,
return;
window->modal = modal;
+ widget = GTK_WIDGET (window);
/* adjust desired modality state */
if (GTK_WIDGET_REALIZED (window))
{
- GtkWidget *widget = GTK_WIDGET (window);
-
if (window->modal)
gdk_window_set_modal_hint (widget->window, TRUE);
else
gdk_window_set_modal_hint (widget->window, FALSE);
}
- if (GTK_WIDGET_VISIBLE (window))
+ if (gtk_widget_get_visible (widget))
{
if (window->modal)
- gtk_grab_add (GTK_WIDGET (window));
+ gtk_grab_add (widget);
else
- gtk_grab_remove (GTK_WIDGET (window));
+ gtk_grab_remove (widget);
}
g_object_notify (G_OBJECT (window), "modal");
@@ -4564,7 +4565,7 @@ gtk_window_map (GtkWidget *widget)
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
if (window->bin.child &&
- GTK_WIDGET_VISIBLE (window->bin.child) &&
+ gtk_widget_get_visible (window->bin.child) &&
!GTK_WIDGET_MAPPED (window->bin.child))
gtk_widget_map (window->bin.child);
@@ -4939,7 +4940,7 @@ gtk_window_size_request (GtkWidget *widget,
requisition->width = GTK_CONTAINER (window)->border_width * 2;
requisition->height = GTK_CONTAINER (window)->border_width * 2;
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkRequisition child_requisition;
@@ -4960,7 +4961,7 @@ gtk_window_size_allocate (GtkWidget *widget,
window = GTK_WINDOW (widget);
widget->allocation = *allocation;
- if (window->bin.child && GTK_WIDGET_VISIBLE (window->bin.child))
+ if (window->bin.child && gtk_widget_get_visible (window->bin.child))
{
child_allocation.x = GTK_CONTAINER (window)->border_width;
child_allocation.y = GTK_CONTAINER (window)->border_width;
@@ -5305,7 +5306,7 @@ gtk_window_focus_in_event (GtkWidget *widget,
* the window is visible before actually handling the
* event
*/
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
{
_gtk_window_set_has_toplevel_focus (window, TRUE);
_gtk_window_set_is_active (window, TRUE);
@@ -5392,10 +5393,8 @@ gtk_window_client_event (GtkWidget *widget,
static void
gtk_window_check_resize (GtkContainer *container)
{
- GtkWindow *window = GTK_WINDOW (container);
-
- if (GTK_WIDGET_VISIBLE (container))
- gtk_window_move_resize (window);
+ if (gtk_widget_get_visible (GTK_WIDGET (container)))
+ gtk_window_move_resize (GTK_WINDOW (container));
}
static gboolean
@@ -6778,7 +6777,7 @@ gtk_window_present_with_time (GtkWindow *window,
widget = GTK_WIDGET (window);
- if (GTK_WIDGET_VISIBLE (window))
+ if (gtk_widget_get_visible (widget))
{
g_assert (widget->window != NULL);
@@ -7333,9 +7332,8 @@ gtk_window_begin_resize_drag (GtkWindow *window,
GdkWindow *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
- g_return_if_fail (GTK_WIDGET_VISIBLE (window));
-
widget = GTK_WIDGET (window);
+ g_return_if_fail (gtk_widget_get_visible (widget));
if (window->frame)
toplevel = window->frame;
@@ -7413,9 +7411,8 @@ gtk_window_begin_move_drag (GtkWindow *window,
GdkWindow *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
- g_return_if_fail (GTK_WIDGET_VISIBLE (window));
-
widget = GTK_WIDGET (window);
+ g_return_if_fail (gtk_widget_get_visible (widget));
if (window->frame)
toplevel = window->frame;
diff --git a/gtk/tests/filechooser.c b/gtk/tests/filechooser.c
index 6b99459232..dd5988fab4 100644
--- a/gtk/tests/filechooser.c
+++ b/gtk/tests/filechooser.c
@@ -517,9 +517,9 @@ test_widgets_for_current_action (GtkFileChooserDialog *dialog,
/* OPEN implies that the "new folder" button is hidden; otherwise it is shown */
if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN)
- passed = passed && !GTK_WIDGET_VISIBLE (impl->browse_new_folder_button);
+ passed = passed && !gtk_widget_get_visible (impl->browse_new_folder_button);
else
- passed = passed && GTK_WIDGET_VISIBLE (impl->browse_new_folder_button);
+ passed = passed && gtk_widget_get_visible (impl->browse_new_folder_button);
/* Check that the widgets are present/visible or not */
if (has_action (open_actions, G_N_ELEMENTS (open_actions), impl->action))