[perl-Glib] Create and register a GType for GConnectFlags



commit 95dcf159ca50da2f3d98546c3d230604f7183a6b
Author: Torsten SchÃnfeld <kaffeetisch gmx de>
Date:   Sun Apr 1 17:11:21 2012 +0200

    Create and register a GType for GConnectFlags
    
    This is needed by Gtk3 and maybe other Glib::Object::Introspection-based
    bindings.

 GSignal.xs |   19 +++++++++++++++++++
 NEWS       |    5 +++++
 2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/GSignal.xs b/GSignal.xs
index a82321c..a378a49 100644
--- a/GSignal.xs
+++ b/GSignal.xs
@@ -85,6 +85,23 @@ SvGSignalFlags (SV * sv)
 	return gperl_convert_flags (g_signal_flags_get_type (), sv);
 }
 
+/* GConnectFlags doesn't come with a GType either.  We don't use it in Glib
+ * directly, but Glib::Object::Introspection-based bindings might need it. */
+static GType
+gperl_connect_flags_get_type (void)
+{
+  static GType etype = 0;
+  if ( etype == 0 ) {
+    static const GFlagsValue values[] = {
+      { G_CONNECT_AFTER,   "G_CONNECT_AFTER",   "after" },
+      { G_CONNECT_SWAPPED, "G_CONNECT_SWAPPED", "swapped" },
+      { 0, NULL, NULL }
+    };
+    etype = g_flags_register_static ("GConnectFlags", values);
+  }
+  return etype;
+}
+
 SV *
 newSVGSignalInvocationHint (GSignalInvocationHint * ihint)
 {
@@ -539,6 +556,8 @@ directly.
 BOOT:
 	gperl_register_fundamental (g_signal_flags_get_type (),
 	                            "Glib::SignalFlags");
+	gperl_register_fundamental (gperl_connect_flags_get_type (),
+	                            "Glib::ConnectFlags");
 
 =for flags Glib::SignalFlags
 
diff --git a/NEWS b/NEWS
index 446a7f3..c07d899 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+Overview of changes in Glib <next>
+=================================
+
+* Create and register a GType for GConnectFlags
+
 Overview of changes in Glib 1.252
 =================================
 



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