Add a list-signal test for using a GLib.List signal parameter
authorJohan Dahlin <johan@src.gnome.org>
Tue, 13 Jan 2009 13:14:26 +0000 (13:14 +0000)
committerJohan Dahlin <johan@src.gnome.org>
Tue, 13 Jan 2009 13:14:26 +0000 (13:14 +0000)
svn path=/trunk/; revision=1030

tests/scanner/annotation-1.0-expected.gir
tests/scanner/annotation-1.0-expected.tgir
tests/scanner/annotation.c

index 8a3f155..71d77dc 100644 (file)
           </parameter>
         </parameters>
       </glib:signal>
+      <glib:signal name="list-signal">
+        <return-value transfer-ownership="full">
+          <type name="none" c:type="void"/>
+        </return-value>
+        <parameters>
+          <parameter name="list" transfer-ownership="container">
+            <type name="GLib.List" c:type="gpointer">
+              <type name="utf8"/>
+            </type>
+          </parameter>
+        </parameters>
+      </glib:signal>
     </class>
     <record name="ObjectClass" c:type="AnnotationObjectClass">
       <field name="parent_class">
index 5ebf1b8..cdd3e9e 100644 (file)
           </parameter>
         </parameters>
       </glib:signal>
+      <glib:signal name="list-signal" when="LAST">
+        <return-value transfer-ownership="full">
+          <type name="none"/>
+        </return-value>
+        <parameters>
+          <parameter name="list" transfer-ownership="container">
+            <type name="GLib.List">
+              <type name="utf8"/>
+            </type>
+          </parameter>
+        </parameters>
+      </glib:signal>
     </class>
     <record name="ObjectClass">
       <field name="parent_class">
index 3c771dd..337b973 100644 (file)
@@ -11,6 +11,7 @@ enum {
 
 enum {
   STRING_SIGNAL,
+  LIST_SIGNAL,
   LAST_SIGNAL
 };
 
@@ -78,6 +79,22 @@ annotation_object_class_init (AnnotationObjectClass *klass)
                  (GSignalCMarshaller)g_cclosure_marshal_VOID__POINTER,
                  G_TYPE_NONE, 1, G_TYPE_POINTER);
 
+  /**
+   * AnnotationObject::list-signal:
+   * @annotation: the annotation object
+   * @list: (type GLib.List): (element-type utf8): (transfer container): a list of strings
+   *
+   * This is a signal which takes a list of strings, but it's not
+   * known by GObject as it's only marked as G_TYPE_POINTER
+   */
+  annotation_object_signals[LIST_SIGNAL] =
+    g_signal_new ("list-signal",
+                 G_OBJECT_CLASS_TYPE (gobject_class),
+                 G_SIGNAL_RUN_LAST,
+                 0,
+                 NULL, NULL,
+                 (GSignalCMarshaller)g_cclosure_marshal_VOID__POINTER,
+                 G_TYPE_NONE, 1, G_TYPE_POINTER);
 
   /**
    * AnnotationObject:string-property: