summaryrefslogtreecommitdiff
path: root/gtk/gtkwidgetprivate.h
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2011-02-08 14:49:31 +0100
committerMatthias Clasen <mclasen@redhat.com>2012-03-01 16:25:21 -0500
commit9f4bfff1b030fffa0d815557ec690d208cb4cd67 (patch)
treedcab443bc3a3a73a1cc0c57bbdbac870df310ab7 /gtk/gtkwidgetprivate.h
parent6c257040a54eb91cc9323c8441b6025667dace69 (diff)
downloadgtk+-9f4bfff1b030fffa0d815557ec690d208cb4cd67.tar.gz
gtk: Add a way to do event capture
This patch adds a capture phase to GTK+'s event propagation model. Events are first propagated from the toplevel (or the grab widget, if a grab is in place) down to the target widget and then back up. The second phase is using the existing ::event signal, the new capture phase is using a private API instead of a public signal for now. This mechanism can be used in many places where we currently have to prevent child widgets from getting events by putting an input-only window over them. It will also be used to implement kinetic scrolling in subsequent patches. http://bugzilla.gnome.org/show_bug.cgi?id=641836 We automatically request more motion events in behalf of the original widget if it listens to motion hints. So the capturing widget doesn't need to handle such implementation details. We are not making event capture part of the public API for 3.4, which is why there is no ::captured-event signal.
Diffstat (limited to 'gtk/gtkwidgetprivate.h')
-rw-r--r--gtk/gtkwidgetprivate.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 58dd0e0861..9774c13fe8 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -165,6 +165,13 @@ GtkStyle * _gtk_widget_get_style (GtkWidget *widget);
void _gtk_widget_set_style (GtkWidget *widget,
GtkStyle *style);
+typedef gboolean (*GtkCapturedEventHandler) (GtkWidget *widget, GdkEvent *event);
+
+void _gtk_widget_set_captured_event_handler (GtkWidget *widget,
+ GtkCapturedEventHandler handler);
+
+gboolean _gtk_widget_captured_event (GtkWidget *widget,
+ GdkEvent *event);
G_END_DECLS