[gtk+] Bug 69872 – GTK_WIDGET_SET_FLAGS should be deprecated



commit 8296bf70353180c7b975a02767c12339a768cf2e
Author: Michael Natterer <mitch gimp org>
Date:   Fri Aug 7 14:48:00 2009 +0200

    Bug 69872 â?? GTK_WIDGET_SET_FLAGS should be deprecated
    
    Add gtk_widget_has_grab() as replacement for GTK_WIDGET_HAS_GRAB().

 gtk/gtk.symbols |    3 ++-
 gtk/gtkwidget.c |   21 +++++++++++++++++++++
 gtk/gtkwidget.h |    2 ++
 3 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index bf2e861..64e69ab 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -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
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 28422b2..267bd40 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -5472,6 +5472,27 @@ gtk_widget_grab_default (GtkWidget *widget)
 }
 
 /**
+ * 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
  * @name: name for the widget
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index d5de8bd..3a79f55 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]