gir/async-sync-out.gir \
gir/class.gir \
gir/class-final.gir \
+ gir/class-ref-unref-function.gir \
gir/constant.gir \
gir/delegate-alias-without-target.gir \
gir/delegate-anonymous.gir \
gir/parameter-nullable-out-simple-type.gir \
gir/property-non-readable.gir \
gir/signal-virtual.gir \
+ gir/record-copy-free-func.gir \
gir/symbol-redefined.gir \
gir/symbol-type-csuffix.gir \
gir/symbol-without-name.gir \
--- /dev/null
+<?xml version="1.0"?>
+<repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+<include name="GObject" version="2.0"/>
+<include name="GLib" version="2.0"/>
+<include name="Gio" version="2.0"/>
+<package name="test"/>
+<c:include name="test.h"/>
+<namespace name="Test" version="1.0" shared-library="test" c:prefix="Test" c:identifier-prefixes="Test" c:symbol-prefixes="test">
+<class name="Foo" c:type="TestFoo" c:symbol-prefix="foo" glib:type-name="TestFoo" glib:get-type="test_foo_get_type" glib:type-struct="TestFooClass" glib:fundamental="1" glib:ref-func="foo_custom_ref_function" glib:unref-func="foo_custom_unref_function">
+ <field name="u" writable="1">
+ <type name="guint" c:type="guint"/>
+ </field>
+</class>
+<record name="FooClass" c:type="TestFooClass" glib:is-gtype-struct-for="FooClass">
+ <field name="parent_class" readable="0" private="1">
+ <type name="GObject.TypeClass" c:type="GTypeClass"/>
+ </field>
+</record>
+</namespace>
+</repository>
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (cheader_filename = "test.h", ref_function = "foo_custom_ref_function", type_id = "test_foo_get_type ()", unref_function = "foo_custom_unref_function")]
+ public class Foo {
+ public uint u;
+ [CCode (has_construct_function = false)]
+ protected Foo ();
+ }
+}
--- /dev/null
+<?xml version="1.0"?>
+<repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+<include name="GObject" version="2.0"/>
+<include name="GLib" version="2.0"/>
+<include name="Gio" version="2.0"/>
+<package name="test"/>
+<c:include name="test.h"/>
+<namespace name="Test" version="1.0" shared-library="test" c:prefix="Test" c:identifier-prefixes="Test" c:symbol-prefixes="test">
+<record name="Foo" c:type="TestFoo" c:symbol-prefix="foo" glib:type-name="TestFoo" glib:get-type="test_foo_get_type" copy-function="foo_custom_copy_func" free-function="foo_custom_free_func">
+ <field name="u" writable="1">
+ <type name="guint" c:type="guint"/>
+ </field>
+</record>
+</namespace>
+</repository>
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (cheader_filename = "test.h", copy_function = "foo_custom_copy_func", free_function = "foo_custom_free_func", type_id = "test_foo_get_type ()")]
+ [Compact]
+ public class Foo {
+ public uint u;
+ }
+}
[CCode (has_construct_function = false)]
public CompactClass ();
}
- [CCode (cheader_filename = "girtest.h", type_id = "gir_test_deprecated_class_test_get_type ()")]
+ [CCode (cheader_filename = "girtest.h", ref_function = "gir_test_deprecated_class_test_ref", type_id = "gir_test_deprecated_class_test_get_type ()", unref_function = "gir_test_deprecated_class_test_unref")]
[Version (deprecated = true, deprecated_since = "0.1.2", since = "0.1.0")]
public class DeprecatedClassTest {
public int ref_count;
[NoAccessorMethod]
public GLib.Type t_type { get; construct; }
}
- [CCode (cheader_filename = "girtest.h", type_id = "gir_test_generics_test_get_type ()")]
+ [CCode (cheader_filename = "girtest.h", ref_function = "gir_test_generics_test_ref", type_id = "gir_test_generics_test_get_type ()", unref_function = "gir_test_generics_test_unref")]
public class GenericsTest {
public int ref_count;
[CCode (has_construct_function = false)]
public virtual signal void signal_with_default_handlder (int i1);
public signal void some_signal (int param);
}
- [CCode (cheader_filename = "girtest.h", cname = "GirTestNamedClass", lower_case_csuffix = "namedclass", type_id = "gir_test_namedclass_get_type ()")]
+ [CCode (cheader_filename = "girtest.h", cname = "GirTestNamedClass", lower_case_csuffix = "namedclass", ref_function = "gir_test_namedclass_ref", type_id = "gir_test_namedclass_get_type ()", unref_function = "gir_test_namedclass_unref")]
public class RenamedClass {
public int ref_count;
[CCode (has_construct_function = false)]
[CCode (has_construct_function = false)]
public SubTypeTest ();
}
- [CCode (cheader_filename = "girtest.h", type_id = "gir_test_typetest_get_type ()")]
+ [CCode (cheader_filename = "girtest.h", ref_function = "gir_test_typetest_ref", type_id = "gir_test_typetest_get_type ()", unref_function = "gir_test_typetest_unref")]
public class TypeTest {
public int ref_count;
[CCode (has_construct_function = false)]
if (metadata.has_argument (ArgumentType.REF_FUNCTION)) {
cl.set_attribute_string ("CCode", "ref_function", metadata.get_string (ArgumentType.REF_FUNCTION));
+ } else if (reader.has_attribute ("glib:ref-func")) {
+ cl.set_attribute_string ("CCode", "ref_function", reader.get_attribute ("glib:ref-func"));
}
if (metadata.has_argument (ArgumentType.REF_SINK_FUNCTION)) {
cl.set_attribute_string ("CCode", "ref_sink_function", metadata.get_string (ArgumentType.REF_SINK_FUNCTION));
}
if (metadata.has_argument (ArgumentType.UNREF_FUNCTION)) {
cl.set_attribute_string ("CCode", "unref_function", metadata.get_string (ArgumentType.UNREF_FUNCTION));
+ } else if (reader.has_attribute ("glib:unref-func")) {
+ cl.set_attribute_string ("CCode", "unref_function", reader.get_attribute ("glib:unref-func"));
}
if (metadata.has_argument (ArgumentType.TYPE_PARAMETERS)) {
parse_type_parameters_from_string (cl, metadata.get_string (ArgumentType.TYPE_PARAMETERS), metadata.get_source_reference (ArgumentType.TYPE_PARAMETERS));
}
if (metadata.has_argument (ArgumentType.COPY_FUNCTION)) {
cl.set_attribute_string ("CCode", "copy_function", metadata.get_string (ArgumentType.COPY_FUNCTION));
+ } else if (reader.has_attribute ("copy-function")) {
+ cl.set_attribute_string ("CCode", "copy_function", reader.get_attribute ("copy-function"));
}
if (metadata.has_argument (ArgumentType.FREE_FUNCTION)) {
cl.set_attribute_string ("CCode", "free_function", metadata.get_string (ArgumentType.FREE_FUNCTION));
+ } else if (reader.has_attribute ("free-function")) {
+ cl.set_attribute_string ("CCode", "free_function", reader.get_attribute ("free-function"));
}
if (metadata.has_argument (ArgumentType.REF_FUNCTION)) {
cl.set_attribute_string ("CCode", "ref_function", metadata.get_string (ArgumentType.REF_FUNCTION));
+ } else if (reader.has_attribute ("glib:ref-func")) {
+ cl.set_attribute_string ("CCode", "ref_function", reader.get_attribute ("glib:ref-func"));
}
if (metadata.has_argument (ArgumentType.REF_SINK_FUNCTION)) {
cl.set_attribute_string ("CCode", "ref_sink_function", metadata.get_string (ArgumentType.REF_SINK_FUNCTION));
}
if (metadata.has_argument (ArgumentType.UNREF_FUNCTION)) {
cl.set_attribute_string ("CCode", "unref_function", metadata.get_string (ArgumentType.UNREF_FUNCTION));
+ } else if (reader.has_attribute ("glib:unref-func")) {
+ cl.set_attribute_string ("CCode", "unref_function", reader.get_attribute ("glib:unref-func"));
}
next ();