[gtk+/gestures] gdk: Make GdkEventSequence a boxed type



commit 00c2dc91143824649e74dafc298f7171bbd50fc1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue May 20 14:07:16 2014 +0200

    gdk: Make GdkEventSequence a boxed type
    
    Not much to copy nor free, but this'll make bindings happy

 gdk/gdkevents.c |   18 +++++++++++++++++-
 gdk/gdkevents.h |    4 ++++
 2 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index fb785cf..003c886 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -1952,7 +1952,7 @@ gdk_event_get_screen (const GdkEvent *event)
  * %GDK_TOUCH_END or %GDK_TOUCH_CANCEL, returns the #GdkEventSequence
  * to which the event belongs. Otherwise, return %NULL.
  *
- * Returns: the event sequence that the event belongs to
+ * Returns: (transfer none): the event sequence that the event belongs to
  *
  * Since: 3.4
  */
@@ -2209,6 +2209,22 @@ G_DEFINE_BOXED_TYPE (GdkEvent, gdk_event,
                      gdk_event_copy,
                      gdk_event_free)
 
+static GdkEventSequence *
+gdk_event_sequence_copy (GdkEventSequence *sequence)
+{
+  return sequence;
+}
+
+static void
+gdk_event_sequence_free (GdkEventSequence *sequence)
+{
+  /* Nothing to free here */
+}
+
+G_DEFINE_BOXED_TYPE (GdkEventSequence, gdk_event_sequence,
+                     gdk_event_sequence_copy,
+                     gdk_event_sequence_free)
+
 /**
  * gdk_setting_get:
  * @name: the name of the setting.
diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h
index e918983..18c95dc 100644
--- a/gdk/gdkevents.h
+++ b/gdk/gdkevents.h
@@ -51,6 +51,7 @@ G_BEGIN_DECLS
 
 
 #define GDK_TYPE_EVENT          (gdk_event_get_type ())
+#define GDK_TYPE_EVENT_SEQUENCE (gdk_event_sequence_get_type ())
 
 /**
  * GDK_PRIORITY_EVENTS:
@@ -1194,6 +1195,9 @@ union _GdkEvent
 GDK_AVAILABLE_IN_ALL
 GType     gdk_event_get_type            (void) G_GNUC_CONST;
 
+GDK_AVAILABLE_IN_3_14
+GType     gdk_event_sequence_get_type   (void) G_GNUC_CONST;
+
 GDK_AVAILABLE_IN_ALL
 gboolean  gdk_events_pending           (void);
 GDK_AVAILABLE_IN_ALL


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