summaryrefslogtreecommitdiff
path: root/gtk/gtkpointerfocusprivate.h
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2017-03-31 17:22:00 +0200
committerCarlos Garnacho <carlosg@gnome.org>2017-05-25 16:25:58 +0200
commitba92dceab2c94872977b19df01321162d76a4948 (patch)
tree422d67c9f1ddb3a7f35df984356cad50c567c840 /gtk/gtkpointerfocusprivate.h
parentf50875f8d06b175e3dd3ca5232475897e4e757cf (diff)
downloadgtk+-ba92dceab2c94872977b19df01321162d76a4948.tar.gz
gtk: Introduce GtkPointerFocus
These objects (tied to a toplevel) track the focus of a pointer/touchpoint. The info in these basically consists of current toplevel coordinates and the current target widget.
Diffstat (limited to 'gtk/gtkpointerfocusprivate.h')
-rw-r--r--gtk/gtkpointerfocusprivate.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/gtk/gtkpointerfocusprivate.h b/gtk/gtkpointerfocusprivate.h
new file mode 100644
index 0000000000..56735d8dcd
--- /dev/null
+++ b/gtk/gtkpointerfocusprivate.h
@@ -0,0 +1,52 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2017 - Red Hat Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _GTK_POINTER_FOCUS_PRIVATE_H_
+#define _GTK_POINTER_FOCUS_PRIVATE_H_
+
+#include <gtk/gtk.h>
+
+typedef struct _GtkPointerFocus GtkPointerFocus;
+
+struct _GtkPointerFocus
+{
+ GdkDevice *device;
+ GdkEventSequence *sequence;
+ GtkWindow *toplevel;
+ GtkWidget *target; /* Unaffected by the implicit grab */
+ GtkWidget *grab_widget;
+ gdouble x, y; /* In toplevel coordinates */
+};
+
+GtkPointerFocus * gtk_pointer_focus_new (GtkWindow *toplevel,
+ GtkWidget *widget,
+ GdkDevice *device,
+ GdkEventSequence *sequence,
+ gdouble x,
+ gdouble y);
+void gtk_pointer_focus_free (GtkPointerFocus *focus);
+
+void gtk_pointer_focus_set_coordinates (GtkPointerFocus *focus,
+ gdouble x,
+ gdouble y);
+void gtk_pointer_focus_set_target (GtkPointerFocus *focus,
+ GtkWidget *target);
+GtkWidget * gtk_pointer_focus_get_target (GtkPointerFocus *focus);
+
+void gtk_pointer_focus_repick_target (GtkPointerFocus *focus);
+
+#endif /* _GTK_POINTER_FOCUS_PRIVATE_H_ */