--- /dev/null
+GIR
+
+Input:
+
+<class name="Foo" c:type="TestFoo" glib:type-name="TestFoo" glib:get-type="test_foo_get_type" glib:type-struct="FooClass" parent="GObject.Object">
+ <method name="get_prop1" c:identifier="test_foo_get_prop1" throws="1">
+ <return-value transfer-ownership="full">
+ <type name="gint" c:type="gint"/>
+ </return-value>
+ </method>
+ <method name="set_prop2" c:identifier="test_foo_set_prop2" throws="1">
+ <return-value transfer-ownership="full">
+ <type name="gboolean" c:type="gboolean"/>
+ </return-value>
+ <parameters>
+ <parameter name="i" transfer-ownership="none">
+ <type name="gint" c:type="gint"/>
+ </parameter>
+ </parameters>
+ </method>
+ <property name="prop1" writable="1">
+ <type name="gint" c:type="gint"/>
+ </property>
+ <method name="set_prop1" c:identifier="test_foo_set_prop1">
+ <return-value transfer-ownership="none">
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="value" transfer-ownership="none">
+ <type name="gint" c:type="gint"/>
+ </parameter>
+ </parameters>
+ </method>
+ <property name="prop2" writable="1">
+ <type name="gint" c:type="gint"/>
+ </property>
+ <method name="get_prop2" c:identifier="test_foo_get_prop2">
+ <return-value transfer-ownership="none">
+ <type name="gint" c:type="gint"/>
+ </return-value>
+ </method>
+</class>
+<record name="FooClass" c:type="TestFooClass" glib:is-gtype-struct-for="Foo"/>
+
+Output:
+
+[CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
+public class Foo : GLib.Object {
+ [CCode (has_construct_function = false)]
+ protected Foo ();
+ public int get_prop1 () throws GLib.Error;
+ public int get_prop2 ();
+ public void set_prop1 (int value);
+ public bool set_prop2 (int i) throws GLib.Error;
+ [NoAccessorMethod]
+ public int prop1 { get; set; }
+ [NoAccessorMethod]
+ public int prop2 { get; set; }
+}
--- /dev/null
+GIR
+
+Input:
+
+<class name="Foo" c:type="TestFoo" glib:type-name="TestFoo" glib:get-type="test_foo_get_type" glib:type-struct="FooClass" parent="GObject.Object">
+ <implements name="Test.IFoo"/>
+ <method name="method_virtual" c:identifier="test_foo_method_virtual" throws="1">
+ <return-value transfer-ownership="full">
+ <type name="none"/>
+ </return-value>
+ </method>
+ <virtual-method name="method_virtual" invoker="method_virtual" throws="1">
+ <return-value transfer-ownership="full">
+ <type name="none"/>
+ </return-value>
+ </virtual-method>
+ <method name="method_async" c:identifier="test_foo_method_async">
+ <return-value transfer-ownership="none">
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="input" transfer-ownership="none">
+ <type name="utf8" c:type="const gchar*"/>
+ </parameter>
+ <parameter name="_callback_" transfer-ownership="none" allow-none="1" closure="2" scope="async">
+ <type name="Gio.AsyncReadyCallback" c:type="GAsyncReadyCallback"/>
+ </parameter>
+ <parameter name="_callback__target" transfer-ownership="none" allow-none="1">
+ <type name="gpointer" c:type="void*"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="method_finish" c:identifier="test_foo_method_finish" throws="1">
+ <return-value transfer-ownership="full">
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="_res_" transfer-ownership="none">
+ <type name="Gio.AsyncResult" c:type="GAsyncResult*"/>
+ </parameter>
+ <parameter name="output" direction="out" transfer-ownership="full">
+ <type name="utf8" c:type="gchar**"/>
+ </parameter>
+ </parameters>
+ </method>
+ <constructor name="new" c:identifier="test_foo_new">
+ <return-value transfer-ownership="full">
+ <type name="Test.Foo" c:type="TestFoo*"/>
+ </return-value>
+ </constructor>
+ <constructor name="bar" c:identifier="test_foo_new_bar">
+ <return-value transfer-ownership="full">
+ <type name="Test.Foo" c:type="TestFoo*"/>
+ </return-value>
+ </constructor>
+ <property name="prop" writable="1" construct="1">
+ <type name="utf8" c:type="gchar*"/>
+ </property>
+ <method name="get_prop" c:identifier="test_foo_get_prop">
+ <return-value transfer-ownership="full">
+ <type name="utf8" c:type="gchar*"/>
+ </return-value>
+ </method>
+ <method name="set_prop" c:identifier="test_foo_set_prop">
+ <return-value transfer-ownership="none">
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="value" transfer-ownership="none">
+ <type name="utf8" c:type="const gchar*"/>
+ </parameter>
+ </parameters>
+ </method>
+ <glib:signal name="sig">
+ <return-value transfer-ownership="full">
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="arg" transfer-ownership="none">
+ <type name="utf8" c:type="const gchar*"/>
+ </parameter>
+ </parameters>
+ </glib:signal>
+</class>
+<record name="FooClass" c:type="TestFooClass" glib:is-gtype-struct-for="Foo">
+ <field name="method_virtual">
+ <callback name="method_virtual" c:type="method_virtual" throws="1">
+ <return-value transfer-ownership="full">
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="self" transfer-ownership="none">
+ <type name="Test.Foo" c:type="TestFoo*"/>
+ </parameter>
+ </parameters>
+ </callback>
+ </field>
+</record>
+<record name="FooPrivate" c:type="TestFooPrivate" disguised="1"/>
+<interface name="IFoo" c:type="TestIFoo" glib:type-name="TestIFoo" glib:get-type="test_ifoo_get_type" glib:type-struct="IFooIface">
+ <prerequisite name="GObject.Object"/>
+ <method name="method" c:identifier="test_ifoo_method" throws="1">
+ <return-value transfer-ownership="full">
+ <type name="none"/>
+ </return-value>
+ </method>
+ <virtual-method name="method" invoker="method" throws="1">
+ <return-value transfer-ownership="full">
+ <type name="none"/>
+ </return-value>
+ </virtual-method>
+</interface>
+<record name="IFooIface" c:type="TestIFooIface" glib:is-gtype-struct-for="IFoo">
+ <field name="method">
+ <callback name="method" c:type="method" throws="1">
+ <return-value transfer-ownership="full">
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="self" transfer-ownership="none">
+ <type name="Test.IFoo" c:type="TestIFoo*"/>
+ </parameter>
+ </parameters>
+ </callback>
+ </field>
+</record>
+
+Output:
+
+[CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
+public class Foo : GLib.Object, Test.IFoo {
+ [CCode (has_construct_function = false)]
+ public Foo ();
+ [CCode (cname = "test_foo_new_bar", has_construct_function = false)]
+ public Foo.bar ();
+ public string get_prop ();
+ public async void method_async (string input, out string output) throws GLib.Error;
+ public virtual void method_virtual () throws GLib.Error;
+ public void set_prop (string value);
+ public string prop { owned get; set construct; }
+ public signal void sig (string arg);
+}
+[CCode (cheader_filename = "test.h", type_id = "test_ifoo_get_type ()")]
+public interface IFoo : GLib.Object {
+ public abstract void method () throws GLib.Error;
+}