[gtk+/wip/garnacho/gdkseat: 5/14] GdkEvent: Add GdkSeat getter and internal setter
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/garnacho/gdkseat: 5/14] GdkEvent: Add GdkSeat getter and internal setter
- Date: Thu, 26 Nov 2015 19:28:01 +0000 (UTC)
commit 373bb921210826d2dff415f73a0c440fa806169a
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Nov 26 19:53:09 2015 +0100
GdkEvent: Add GdkSeat getter and internal setter
docs/reference/gdk/gdk3-sections.txt | 1 +
gdk/gdkevents.c | 35 ++++++++++++++++++++++++++++++++++
gdk/gdkinternals.h | 4 +++
3 files changed, 40 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index f0852e8..7ffcf36 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -856,6 +856,7 @@ gdk_events_get_angle
gdk_events_get_center
gdk_events_get_distance
gdk_event_triggers_context_menu
+gdk_event_get_seat
<SUBSECTION>
gdk_event_handler_set
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index ed64913..87ea73c 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -2314,3 +2314,38 @@ gdk_event_get_event_type (const GdkEvent *event)
return event->type;
}
+
+/**
+ * gdk_event_get_seat:
+ * @event: a #GdkEvent
+ *
+ * Returns the #GdkSeat this event was generated for.
+ *
+ * Returns: The #GdkSeat of this event
+ *
+ * Since: 3.20
+ **/
+GdkSeat *
+gdk_event_get_seat (const GdkEvent *event)
+{
+ const GdkEventPrivate *priv;
+
+ if (!gdk_event_is_allocated (event))
+ return NULL;
+
+ priv = (const GdkEventPrivate *) event;
+ return priv->seat;
+}
+
+void
+gdk_event_set_seat (GdkEvent *event,
+ GdkSeat *seat)
+{
+ GdkEventPrivate *priv;
+
+ if (gdk_event_is_allocated (event))
+ {
+ priv = (GdkEventPrivate *) event;
+ priv->seat = seat;
+ }
+}
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index b75eb3a..c9aa524 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -185,6 +185,7 @@ struct _GdkEventPrivate
gpointer windowing_data;
GdkDevice *device;
GdkDevice *source_device;
+ GdkSeat *seat;
};
typedef struct _GdkWindowPaint GdkWindowPaint;
@@ -390,6 +391,9 @@ void _gdk_event_set_pointer_emulated (GdkEvent *event,
gboolean emulated);
gboolean _gdk_event_get_pointer_emulated (GdkEvent *event);
+void gdk_event_set_seat (GdkEvent *event,
+ GdkSeat *seat);
+
void _gdk_event_emit (GdkEvent *event);
GList* _gdk_event_queue_find_first (GdkDisplay *display);
void _gdk_event_queue_remove_link (GdkDisplay *display,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]