Commit eb0a5721d96bc937daeb742c9c216549a9456eba

Bug 69872 – GTK_WIDGET_SET_FLAGS should be deprecated

Add gtk_widget_get_visible(). For symmetry reasons and for convenience
when a widget's visibility state is available as a boolean condition,
also add gtk_widget_set_visible() (which simply calls show()/hide()).
  
49984998gtk_widget_get_tooltip_window
49994999gtk_widget_get_toplevel
50005000gtk_widget_get_type G_GNUC_CONST
5001gtk_widget_get_visible
50015002gtk_widget_get_visual
50025003gtk_widget_grab_default
50035004gtk_widget_grab_focus
50775077gtk_widget_set_tooltip_markup
50785078gtk_widget_set_tooltip_text
50795079gtk_widget_set_tooltip_window
5080gtk_widget_set_visible
50805081gtk_widget_shape_combine_mask
50815082gtk_widget_input_shape_combine_mask
50825083gtk_widget_show
  
55785578}
55795579
55805580/**
5581 * gtk_widget_set_visible:
5582 * @widget: a #GtkWidget
5583 * @visible: whether the widget should be shown or not
5584 *
5585 * Sets the visibility state of @widget. Note that setting this to
5586 * %TRUE doesn't mean the widget is actually viewable, see
5587 * gtk_widget_get_visible().
5588 *
5589 * This function simply calls gtk_widget_show() or gtk_widget_hide()
5590 * but is nicer to use when the visibility of the widget depends on
5591 * some condition.
5592 *
5593 * Since: 2.18
5594 **/
5595void
5596gtk_widget_set_visible (GtkWidget *widget,
5597 gboolean visible)
5598{
5599 g_return_if_fail (GTK_IS_WIDGET (widget));
5600
5601 if (visible != GTK_WIDGET_VISIBLE (widget))
5602 {
5603 if (visible)
5604 gtk_widget_show (widget);
5605 else
5606 gtk_widget_hide (widget);
5607 }
5608}
5609
5610/**
5611 * gtk_widget_get_visible:
5612 * @widget: a #GtkWidget
5613 *
5614 * Determines whether the widget is visible. Note that this doesn't
5615 * take into account whether the widget's parent is also visible
5616 * or the widget is obscured in any way.
5617 *
5618 * See gtk_widget_set_visible().
5619 *
5620 * Return value: %TRUE if the widget is visible
5621 *
5622 * Since: 2.18
5623 **/
5624gboolean
5625gtk_widget_get_visible (GtkWidget *widget)
5626{
5627 g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
5628
5629 return (GTK_WIDGET_FLAGS (widget) & GTK_VISIBLE) != 0;
5630}
5631
5632/**
55815633 * gtk_widget_set_has_window:
55825634 * @widget: a #GtkWidget
55835635 * @has_window: whether or not @widget has a window.
  
574574gboolean gtk_widget_get_sensitive (GtkWidget *widget);
575575gboolean gtk_widget_is_sensitive (GtkWidget *widget);
576576
577void gtk_widget_set_visible (GtkWidget *widget,
578 gboolean visible);
579gboolean gtk_widget_get_visible (GtkWidget *widget);
580
577581void gtk_widget_set_has_window (GtkWidget *widget,
578582 gboolean has_window);
579583gboolean gtk_widget_get_has_window (GtkWidget *widget);