Commit 8296bf70 authored by Michael Natterer's avatar Michael Natterer 😴

Bug 69872 – GTK_WIDGET_SET_FLAGS should be deprecated

Add gtk_widget_has_grab() as replacement for GTK_WIDGET_HAS_GRAB().
parent 8a6bb818
......@@ -5002,7 +5002,9 @@ gtk_widget_get_visible
gtk_widget_get_visual
gtk_widget_grab_default
gtk_widget_grab_focus
gtk_widget_has_default
gtk_widget_has_focus
gtk_widget_has_grab
gtk_widget_has_screen
gtk_widget_hide
gtk_widget_hide_all
......@@ -5099,7 +5101,6 @@ gtk_widget_set_has_window
gtk_widget_get_has_window
gtk_widget_set_can_default
gtk_widget_get_can_default
gtk_widget_has_default
gtk_widget_set_can_focus
gtk_widget_get_can_focus
#endif
......
......@@ -5471,6 +5471,27 @@ gtk_widget_grab_default (GtkWidget *widget)
g_warning (G_STRLOC ": widget not within a GtkWindow");
}
/**
* gtk_widget_has_grab:
* @widget: a #GtkWidget
*
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
*
* Return value: %TRUE if the widget is in the grab_widgets stack
*
* Since: 2.18
**/
gboolean
gtk_widget_has_grab (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
return (GTK_WIDGET_FLAGS (widget) & GTK_HAS_GRAB) != 0;
}
/**
* gtk_widget_set_name:
* @widget: a #GtkWidget
......
......@@ -561,6 +561,8 @@ gboolean gtk_widget_get_can_default (GtkWidget *widget);
gboolean gtk_widget_has_default (GtkWidget *widget);
void gtk_widget_grab_default (GtkWidget *widget);
gboolean gtk_widget_has_grab (GtkWidget *widget);
void gtk_widget_set_name (GtkWidget *widget,
const gchar *name);
G_CONST_RETURN gchar* gtk_widget_get_name (GtkWidget *widget);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment