Input:
+<class name="Foo"
+ c:symbol-prefix="foo"
+ c:type="TestFoo"
+ parent="GLib.Object"
+ glib:type-name="TestFoo"
+ glib:get-type="test_foo_get_type"
+ glib:type-struct="FooClass">
+ <field name="parent">
+ <type name="GLib.Object" c:type="GObject"/>
+ </field>
+ <method name="function" c:identifier="test_function">
+ <return-value transfer-ownership="none">
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <instance-parameter name="self" transfer-ownership="none">
+ <type name="Test.Foo" c:type="TestFoo*"/>
+ </instance-parameter>
+ <parameter name="callback" transfer-ownership="none" allow-none="1" closure="1" scope="notified" destroy="2">
+ <type name="GLib.Func" c:type="GFunc"/>
+ </parameter>
+ <parameter name="callback_target" transfer-ownership="none" allow-none="1" closure="0">
+ <type name="gpointer" c:type="void*"/>
+ </parameter>
+ <parameter name="callback_target_destroy_notify" transfer-ownership="none" scope="call" destroy="0">
+ <type name="GLib.DestroyNotify" c:type="GDestroyNotify"/>
+ </parameter>
+ </parameters>
+ </method>
+</class>
+<record name="FooClass"
+ c:type="TestFooClass"
+ glib:is-gtype-struct-for="Foo">
+</record>
<function name="function" c:identifier="test_function">
<return-value transfer-ownership="none">
<type name="none"/>
Output:
+[CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
+public class Foo : GLib.Object {
+ [CCode (has_construct_function = false)]
+ protected Foo ();
+ [CCode (cname = "test_function")]
+ public void function (owned GLib.Func? callback);
+}
[CCode (cheader_filename = "test.h")]
public static void function (owned GLib.Func? callback);
var current_parameter_idx = -1;
while (current_token == MarkupTokenType.START_ELEMENT) {
- current_parameter_idx++;
-
var is_instance_parameter = (reader.name == "instance-parameter"
&& !(symbol_type == "function" || symbol_type == "constructor"));
+ if (!is_instance_parameter) {
+ current_parameter_idx++;
+ }
+
if (instance_idx > -2 && instance_idx == current_parameter_idx) {
skip_element ();
continue;