summaryrefslogtreecommitdiff
path: root/tests/gir/delegate-closure-destroy-index-conflict.test
blob: 449136c905488832cd29dcd5c6f43e24e8071896 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
GIR

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"/>
  </return-value>
  <parameters>
    <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>
</function>

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);