elif [ "$1" = "D-Bus" ]; then
DBUSTEST=1
run_prefix="dbus-run-session -- $run_prefix"
- elif [ "$1" = "GIR" ]; then
- GIRTEST=1
elif [ "$1" = "GIRWriter" ]; then
GIRWRITERTEST=1
fi
ns=${ns//-/_}
SOURCEFILE=$ns.vala
SOURCEFILES="$SOURCEFILES $SOURCEFILE"
- elif [ $GIRTEST -eq 1 ]; then
- if [ "$1" = "Input:" ]; then
- ns=$testpath
- SOURCEFILE=$ns.gir
- cat <<EOF > $SOURCEFILE
-<?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="GLib" version="2.0"/>
- <include name="GObject" version="2.0"/>
- <include name="Gio" version="2.0"/>
- <c:include name="test.h"/>
- <namespace name="Test"
- version="1.2"
- c:identifier-prefixes="Test"
- c:symbol-prefixes="test">
-EOF
- elif [ "$1" = "Output:" ]; then
- SOURCEFILE=$testpath.vapi.ref
- fi
elif [ $GIRWRITERTEST -eq 1 ]; then
if [ "$1" = "Input:" ]; then
ns=$testpath
echo "RET=\$?" >> check
echo "if [ \$RET -ne 1 ]; then exit 1; fi" >> check
echo "exit 0" >> check
- elif [ $GIRTEST -eq 1 ]; then
- if [ $PART -eq 1 ]; then
- echo " </namespace>" >> $SOURCEFILE
- echo "</repository>" >> $SOURCEFILE
- fi
- PACKAGEFLAGS=$([ -z "$PACKAGES" ] || echo $PACKAGES | xargs -n 1 echo -n " --pkg")
- echo "$VAPIGEN $VAPIGENFLAGS $PACKAGEFLAGS --library $ns $ns.gir && tail -n +5 $ns.vapi|sed '\$d'|diff -wu $ns.vapi.ref -" > check
elif [ $GIRWRITERTEST -eq 1 ]; then
if [ $PART -eq 1 ]; then
echo "}" >> $SOURCEFILE
fi
./$testpath$EXEEXT
;;
+*.gir)
+ SOURCEFILE=$testpath.gir
+ cat "$abs_srcdir/$testfile" > ./$SOURCEFILE
+ PACKAGEFLAGS=$([ -z "$PACKAGES" ] || echo $PACKAGES | xargs -n 1 echo -n " --pkg")
+ $VAPIGEN $VAPIGENFLAGS $PACKAGEFLAGS --library $testpath $SOURCEFILE || exit 1
+ tail -n +3 ${SOURCEFILE%.*}.vapi | diff -wu $abs_srcdir/${testfile%.*}.vapi-expected - || exit 1
+ ;;
*.test)
rm -f prepare check
echo 'set -e' >> prepare
PART=0
INHEADER=1
INVALIDCODE=0
- GIRTEST=0
GIRWRITERTEST=0
DBUSTEST=0
ISSERVER=0
noinst_PROGRAMS = \
$(NULL)
-TEST_EXTENSIONS = .vala .gs .test
+TEST_EXTENSIONS = .vala .gs .gir .test
TEST_RUNNER = $(abs_top_srcdir)/build-aux/testrunner.sh
VALA_LOG_COMPILER = $(TEST_RUNNER)
GS_LOG_COMPILER = $(TEST_RUNNER)
+GIR_LOG_COMPILER = $(TEST_RUNNER)
TEST_LOG_COMPILER = $(TEST_RUNNER)
AM_TESTS_ENVIRONMENT = \
dbus/bug792277.vala \
dbus/rawvariants.test \
dbus/interface-info.test \
- gir/bug651773.test \
- gir/bug667751.test \
- gir/bug742012.test \
- gir/bug788775.test \
- gir/bug792998.test \
- gir/alias.test \
- gir/array-fixed-length.test \
- gir/async-creation-method.test \
- gir/async-result-pos.test \
- gir/async-sync-out.test \
- gir/class.test \
- gir/class-final.test \
- gir/constant.test \
- gir/delegate-alias-without-target.test \
- gir/delegate-anonymous.test \
- gir/delegate-array-length-type.test \
- gir/delegate-closure-destroy-index-conflict.test \
- gir/delegate-error-pos.test \
- gir/enum.test \
- gir/errordomain.test \
- gir/gtype-struct-name.test \
- gir/instance-parameter-owned.test \
- gir/method-array-length-type.test \
- gir/method-class.test \
- gir/method-nowrapper.test \
- gir/parameter-array-length-type.test \
- gir/parameter-nullable-out-simple-type.test \
- gir/property-non-readable.test \
- gir/signal-virtual.test \
- gir/symbol-redefined.test \
- gir/symbol-type-csuffix.test \
- gir/symbol-without-name.test \
- gir/union.test \
- gir/union-transparent.test \
+ gir/bug651773.gir \
+ gir/bug667751.gir \
+ gir/bug742012.gir \
+ gir/bug788775.gir \
+ gir/bug792998.gir \
+ gir/alias.gir \
+ gir/array-fixed-length.gir \
+ gir/async-creation-method.gir \
+ gir/async-result-pos.gir \
+ gir/async-sync-out.gir \
+ gir/class.gir \
+ gir/class-final.gir \
+ gir/constant.gir \
+ gir/delegate-alias-without-target.gir \
+ gir/delegate-anonymous.gir \
+ gir/delegate-array-length-type.gir \
+ gir/delegate-closure-destroy-index-conflict.gir \
+ gir/delegate-error-pos.gir \
+ gir/enum.gir \
+ gir/errordomain.gir \
+ gir/gtype-struct-name.gir \
+ gir/instance-parameter-owned.gir \
+ gir/method-array-length-type.gir \
+ gir/method-class.gir \
+ gir/method-nowrapper.gir \
+ gir/parameter-array-length-type.gir \
+ gir/parameter-nullable-out-simple-type.gir \
+ gir/property-non-readable.gir \
+ gir/signal-virtual.gir \
+ gir/symbol-redefined.gir \
+ gir/symbol-type-csuffix.gir \
+ gir/symbol-without-name.gir \
+ gir/union.gir \
+ gir/union-transparent.gir \
girwriter/class-final.test \
girwriter/combined.test \
gtktemplate/gtkcallback-incompatible.test \
$(TESTS) \
$(LINUX_TESTS) \
$(wildcard $(srcdir)/*/*.c-expected) \
+ $(wildcard $(srcdir)/*/*.vapi-expected) \
$(NULL)
--- /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">
+<alias name="Foo" c:type="TestFoo">
+ <type name="gint" c:type="int"/>
+</alias>
+</namespace>
+</repository>
+++ /dev/null
-GIR
-
-Input:
-
-<alias name="Foo" c:type="TestFoo">
- <type name="gint" c:type="int"/>
-</alias>
-
-Output:
-
-[CCode (cheader_filename = "test.h")]
-[SimpleType]
-public struct Foo : int {
-}
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (cheader_filename = "test.h")]
+ [SimpleType]
+ public struct Foo : int {
+ }
+}
-GIR
-
-Input:
-
+<?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">
<function name="get_array_return" c:identifier="test_get_array_return">
<return-value transfer-ownership="none">
<array zero-terminated="0" c:type="gpointer*" fixed-size="16">
</parameter>
</parameters>
</function>
-
-Output:
-
-[CCode (cheader_filename = "test.h")]
-public static void change_array ([CCode (array_length = false)] ref uint8 array[2]);
-[CCode (cheader_filename = "test.h")]
-public static void get_array_out ([CCode (array_length = false)] out uint8 array[8]);
-[CCode (array_length = false, array_length_cexpr = "16", cheader_filename = "test.h")]
-public static unowned uint8[] get_array_return ();
-[CCode (cheader_filename = "test.h")]
-public static void set_array ([CCode (array_length = false)] uint8 array[4]);
+</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")]
+ public static void change_array ([CCode (array_length = false)] ref uint8 array[2]);
+ [CCode (cheader_filename = "test.h")]
+ public static void get_array_out ([CCode (array_length = false)] out uint8 array[8]);
+ [CCode (array_length = false, array_length_cexpr = "16", cheader_filename = "test.h")]
+ public static unowned uint8[] get_array_return ();
+ [CCode (cheader_filename = "test.h")]
+ public static void set_array ([CCode (array_length = false)] uint8 array[4]);
+}
-GIR
-
-Input:
-
+<?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:symbol-prefix="foo"
c:type="TestFoo"
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
</record>
-
-Output:
-
-[CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
-public class Foo : GLib.Object {
- [CCode (cname = "test_foo_new_async", has_construct_function = false)]
- public async Foo (GLib.Cancellable? cancellable) throws GLib.Error;
-}
+</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", type_id = "test_foo_get_type ()")]
+ public class Foo : GLib.Object {
+ [CCode (cname = "test_foo_new_async", has_construct_function = false)]
+ public async Foo (GLib.Cancellable? cancellable) throws GLib.Error;
+ }
+}
-GIR
-
-Input:
-
+<?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" glib:type-name="TestFoo" glib:get-type="test_foo_get_type" glib:type-struct="FooClass" parent="GObject.Object">
<method name="method_async" c:identifier="test_foo_method_async">
<return-value transfer-ownership="none">
</return-value>
</constructor>
</class>
-
-Output:
-
-[CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
-public class Foo : GLib.Object {
- [CCode (has_construct_function = false)]
- public Foo ();
- [CCode (async_result_pos = 2.1)]
- public async void method_async (string input, out string output) throws GLib.Error;
-}
+</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", type_id = "test_foo_get_type ()")]
+ public class Foo : GLib.Object {
+ [CCode (has_construct_function = false)]
+ public Foo ();
+ [CCode (async_result_pos = 2.1)]
+ public async void method_async (string input, out string output) throws GLib.Error;
+ }
+}
-GIR
-
-Input:
-
+<?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" glib:type-name="TestFoo" glib:get-type="test_foo_get_type" glib:type-struct="FooClass" parent="GObject.Object">
<method name="method_async" c:identifier="test_foo_method_async">
<return-value transfer-ownership="none">
</return-value>
</constructor>
</class>
-
-Output:
-
-[CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
-public class Foo : GLib.Object {
- [CCode (has_construct_function = false)]
- public Foo ();
- public async void method_async (string input, string* sync_output, out string output) throws GLib.Error;
-}
+</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", type_id = "test_foo_get_type ()")]
+ public class Foo : GLib.Object {
+ [CCode (has_construct_function = false)]
+ public Foo ();
+ public async void method_async (string input, string* sync_output, out string output) throws GLib.Error;
+ }
+}
--- /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">
+<function name="get_array" c:identifier="test_get_array">
+ <return-value transfer-ownership="none">
+ <array length="0" c:type="guchar*">
+ <type name="guint8" c:type="guchar"/>
+ </array>
+ </return-value>
+ <parameters>
+ <parameter name="len"
+ direction="out"
+ caller-allocates="1"
+ transfer-ownership="full">
+ <type name="gsize" c:type="gsize*"/>
+ </parameter>
+ </parameters>
+</function>
+</namespace>
+</repository>
+++ /dev/null
-GIR
-
-Input:
-
-<function name="get_array" c:identifier="test_get_array">
- <return-value transfer-ownership="none">
- <array length="0" c:type="guchar*">
- <type name="guint8" c:type="guchar"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="len"
- direction="out"
- caller-allocates="1"
- transfer-ownership="full">
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
-</function>
-
-Output:
-
-[CCode (array_length_pos = 0.1, array_length_type = "gsize", cheader_filename = "test.h")]
-public static unowned uint8[] get_array ();
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (array_length_pos = 0.1, array_length_type = "gsize", cheader_filename = "test.h")]
+ public static unowned uint8[] get_array ();
+}
-GIR
-
-Input:
-
+<?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">
<alias name="RemoteConnectionCommitFunc"
c:type="NMRemoteConnectionCommitFunc">
<type name="RemoteConnectionResultFunc"
</parameter>
</parameters>
</callback>
-
-Output:
-
-[CCode (cheader_filename = "test.h", cname = "NMRemoteConnectionResultFunc", instance_pos = 1.9)]
-public delegate void RemoteConnectionCommitFunc (GLib.Error error);
-[CCode (cheader_filename = "test.h", cname = "NMRemoteConnectionResultFunc", instance_pos = 1.9)]
-public delegate void RemoteConnectionResultFunc (GLib.Error error);
+</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", cname = "NMRemoteConnectionResultFunc", instance_pos = 1.9)]
+ public delegate void RemoteConnectionCommitFunc (GLib.Error error);
+ [CCode (cheader_filename = "test.h", cname = "NMRemoteConnectionResultFunc", instance_pos = 1.9)]
+ public delegate void RemoteConnectionResultFunc (GLib.Error error);
+}
-GIR
-
-Input:
-
+<?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="CertificateRenderer"
c:symbol-prefix="certificate_renderer"
c:type="GcrCertificateRenderer"
<type name="GObject.TypeInterface" c:type="GTypeInterface"/>
</field>
</record>
-
-Output:
-
-[CCode (cheader_filename = "test.h", cname = "GcrCertificateRenderer", type_id = "gcr_certificate_renderer_get_type ()")]
-public class CertificateRenderer : GLib.Object, Test.Renderer {
- [CCode (has_construct_function = false)]
- protected CertificateRenderer ();
-}
-[CCode (cheader_filename = "test.h", cname = "GcrRenderer", type_id = "gcr_renderer_get_type ()")]
-public interface Renderer : GLib.Object {
- [CCode (cname = "gcr_renderer_get_attributes")]
- public unowned GLib.List get_attributes ();
- [CCode (cname = "gcr_renderer_set_attributes")]
- public void set_attributes (GLib.List? attrs);
- [NoAccessorMethod]
- public abstract GLib.List attributes { owned get; set; }
-}
+</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", cname = "GcrCertificateRenderer", type_id = "gcr_certificate_renderer_get_type ()")]
+ public class CertificateRenderer : GLib.Object, Test.Renderer {
+ [CCode (has_construct_function = false)]
+ protected CertificateRenderer ();
+ }
+ [CCode (cheader_filename = "test.h", cname = "GcrRenderer", type_id = "gcr_renderer_get_type ()")]
+ public interface Renderer : GLib.Object {
+ [CCode (cname = "gcr_renderer_get_attributes")]
+ public unowned GLib.List get_attributes ();
+ [CCode (cname = "gcr_renderer_set_attributes")]
+ public void set_attributes (GLib.List? attrs);
+ [NoAccessorMethod]
+ public abstract GLib.List attributes { owned get; set; }
+ }
+}
-GIR
-
-Input:
-
+<?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">
<function name="get_string_list" c:identifier="test_get_string_list">
<return-value transfer-ownership="full">
<array length="1" zero-terminated="1" c:type="gchar**">
</parameter>
</parameters>
</function>
-
-Output:
-
-[CCode (array_length = true, array_length_pos = 1.1, array_length_type = "gsize", array_null_terminated = true, cheader_filename = "test.h")]
-public static string[] get_string_list (string key);
+</namespace>
+</repository>
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (array_length = true, array_length_pos = 1.1, array_length_type = "gsize", array_null_terminated = true, cheader_filename = "test.h")]
+ public static string[] get_string_list (string key);
+}
-GIR
-
-Input:
-
+<?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" 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">
</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; }
-}
+</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", 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; }
+ }
+}
-GIR
-
-Input:
-
+<?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" glib:type-name="TestFoo" glib:get-type="test_foo_get_type" glib:type-struct="FooClass" parent="GObject.Object">
</class>
<record name="FooClass" c:type="TestFooClass" glib:is-gtype-struct-for="Foo">
<record name="BarClass" c:type="TestBarClass" glib:is-gtype-struct-for="Bar">
</record>
<record name="BarPrivate" c:type="TestBarPrivate" disguised="1"/>
-
-Output:
-
-[CCode (cheader_filename = "test.h", type_id = "test_bar_get_type ()")]
-public sealed class Bar : Test.Foo {
- [CCode (has_construct_function = false)]
- protected Bar ();
-}
-[CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
-public class Foo : GLib.Object {
- [CCode (has_construct_function = false)]
- protected Foo ();
-}
+</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", type_id = "test_bar_get_type ()")]
+ public sealed class Bar : Test.Foo {
+ [CCode (has_construct_function = false)]
+ protected Bar ();
+ }
+ [CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
+ public class Foo : GLib.Object {
+ [CCode (has_construct_function = false)]
+ protected Foo ();
+ }
+}
-GIR
-
-Input:
-
+<?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">
<alias name="Bar" c:type="TestBar">
<type name="Foo" c:type="TestFoo"/>
</alias>
</callback>
</field>
</record>
-
-Output:
-
-[CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
-public class Bar : Test.Foo {
- [CCode (has_construct_function = false)]
- protected Bar ();
-}
-[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")]
-public interface IBar : Test.IFoo, GLib.Object {
-}
-[CCode (cheader_filename = "test.h", type_id = "test_ifoo_get_type ()")]
-public interface IFoo : GLib.Object {
- public abstract void method () throws GLib.Error;
-}
+</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", type_id = "test_foo_get_type ()")]
+ public class Bar : Test.Foo {
+ [CCode (has_construct_function = false)]
+ protected Bar ();
+ }
+ [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")]
+ public interface IBar : Test.IFoo, GLib.Object {
+ }
+ [CCode (cheader_filename = "test.h", type_id = "test_ifoo_get_type ()")]
+ public interface IFoo : GLib.Object {
+ public abstract void method () throws GLib.Error;
+ }
+}
--- /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">
+<constant name="FOO_CONSTANT"
+ value="foo-constant-string-value"
+ c:type="TEST_FOO_CONSTANT">
+ <type name="utf8" c:type="gchar*"/>
+</constant>
+<constant name="FOO_CONSTANT_ARRAY"
+ c:type="TEST_FOO_CONSTANT_ARRAY">
+ <array c:type="const gchar**">
+ <type name="utf8" c:type="const gchar*"/>
+ </array>
+</constant>
+</namespace>
+</repository>
+++ /dev/null
-GIR
-
-Input:
-
-<constant name="FOO_CONSTANT"
- value="foo-constant-string-value"
- c:type="TEST_FOO_CONSTANT">
- <type name="utf8" c:type="gchar*"/>
-</constant>
-<constant name="FOO_CONSTANT_ARRAY"
- c:type="TEST_FOO_CONSTANT_ARRAY">
- <array c:type="const gchar**">
- <type name="utf8" c:type="const gchar*"/>
- </array>
-</constant>
-
-Output:
-
-[CCode (cheader_filename = "test.h", cname = "TEST_FOO_CONSTANT")]
-public const string FOO_CONSTANT;
-[CCode (array_length = false, array_null_terminated = true, cheader_filename = "test.h", cname = "TEST_FOO_CONSTANT_ARRAY")]
-public const string[] FOO_CONSTANT_ARRAY;
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (cheader_filename = "test.h", cname = "TEST_FOO_CONSTANT")]
+ public const string FOO_CONSTANT;
+ [CCode (array_length = false, array_null_terminated = true, cheader_filename = "test.h", cname = "TEST_FOO_CONSTANT_ARRAY")]
+ public const string[] FOO_CONSTANT_ARRAY;
+}
--- /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">
+<alias name="Foo" c:type="TestFoo">
+ <type name="Bar" c:type="TestBar"/>
+</alias>
+
+<callback name="Bar" c:type="TestBar">
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+</callback>
+</namespace>
+</repository>
+++ /dev/null
-GIR
-
-Input:
-
-<alias name="Foo" c:type="TestFoo">
- <type name="Bar" c:type="TestBar"/>
-</alias>
-
-<callback name="Bar" c:type="TestBar">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
-</callback>
-
-Output:
-
-[CCode (cheader_filename = "test.h", has_target = false)]
-public delegate void Bar ();
-[CCode (cheader_filename = "test.h", has_target = false)]
-public delegate void Foo ();
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (cheader_filename = "test.h", has_target = false)]
+ public delegate void Bar ();
+ [CCode (cheader_filename = "test.h", has_target = false)]
+ public delegate void Foo ();
+}
-GIR
-
-Input:
-
+<?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">
<field name="bar_callback">
<callback name="bar_callback" throws="1">
</callback>
</field>
</record>
-
-Output:
-
-[CCode (cheader_filename = "test.h", has_type_id = false)]
-public struct Foo {
- public weak Test.FooBarCallbackFunc bar_callback;
-}
-[CCode (cheader_filename = "test.h", has_target = false, has_typedef = false)]
-public delegate void* FooBarCallbackFunc (GLib.SourceFunc func) throws GLib.Error;
+</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", has_type_id = false)]
+ public struct Foo {
+ public weak Test.FooBarCallbackFunc bar_callback;
+ }
+ [CCode (cheader_filename = "test.h", has_target = false, has_typedef = false)]
+ public delegate void* FooBarCallbackFunc (GLib.SourceFunc func) throws GLib.Error;
+}
-GIR
-
-Input:
-
+<?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">
<callback name="Foo" c:type="TestFoo">
<return-value transfer-ownership="full">
<array length="0" c:type="gchar**">
</parameter>
</parameters>
</callback>
-
-Output:
-
-[CCode (array_length_pos = 0.1, array_length_type = "gsize", cheader_filename = "test.h", instance_pos = 0.9)]
-public delegate string[] Foo ();
+</namespace>
+</repository>
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (array_length_pos = 0.1, array_length_type = "gsize", cheader_filename = "test.h", instance_pos = 0.9)]
+ public delegate string[] Foo ();
+}
-GIR
-
-Input:
-
+<?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:symbol-prefix="foo"
c:type="TestFoo"
</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);
+</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", 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);
+}
-GIR
-
-Input:
-
+<?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">
<callback name="Foo" c:type="TestFoo">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</parameter>
</parameters>
</callback>
-
-Output:
-
-[CCode (cheader_filename = "test.h", error_pos = 1.8, instance_pos = 1.9)]
-public delegate void Foo (string s) throws GLib.Error;
+</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", error_pos = 1.8, instance_pos = 1.9)]
+ public delegate void Foo (string s) throws GLib.Error;
+}
-GIR
-
-Input:
-
+<?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">
<enumeration name="Test"
c:type="Test">
<member name="bar"
glib:nick="foo">
</member>
</bitfield>
-
-Output:
-
-[CCode (cheader_filename = "test.h", cname = "Test", cprefix = "TEST_", has_type_id = false)]
-public enum Test {
- BAR,
- FOO
-}
-[CCode (cheader_filename = "test.h", cname = "TestFlag", cprefix = "TEST_FLAG_", has_type_id = false)]
-[Flags]
-public enum TestFlag {
- BAR,
- FOO
-}
-[CCode (cheader_filename = "test.h", cname = "TestFlagWithType", cprefix = "TEST_FLAG_WITH_TYPE_", type_id = "test_flag_with_type_get_type ()")]
-[Flags]
-public enum TestFlagWithType {
- BAR,
- FOO
-}
-[CCode (cheader_filename = "test.h", cname = "TestWithType", cprefix = "TEST_WITH_TYPE_", type_id = "test_with_type_get_type ()")]
-public enum TestWithType {
- BAR,
- FOO
-}
+</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", cname = "Test", cprefix = "TEST_", has_type_id = false)]
+ public enum Test {
+ BAR,
+ FOO
+ }
+ [CCode (cheader_filename = "test.h", cname = "TestFlag", cprefix = "TEST_FLAG_", has_type_id = false)]
+ [Flags]
+ public enum TestFlag {
+ BAR,
+ FOO
+ }
+ [CCode (cheader_filename = "test.h", cname = "TestFlagWithType", cprefix = "TEST_FLAG_WITH_TYPE_", type_id = "test_flag_with_type_get_type ()")]
+ [Flags]
+ public enum TestFlagWithType {
+ BAR,
+ FOO
+ }
+ [CCode (cheader_filename = "test.h", cname = "TestWithType", cprefix = "TEST_WITH_TYPE_", type_id = "test_with_type_get_type ()")]
+ public enum TestWithType {
+ BAR,
+ FOO
+ }
+}
-GIR
-
-Input:
-
+<?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">
<enumeration name="TestError"
c:type="TestError"
glib:error-domain="test-error-quark">
glib:nick="foo">
</member>
</enumeration>
-
-Output:
-
-[CCode (cheader_filename = "test.h", cname = "TestError", cprefix = "TEST_ERROR_", has_type_id = false)]
-public errordomain TestError {
- BAR,
- FOO
-}
-[CCode (cheader_filename = "test.h", cname = "TestErrorWithType", cprefix = "TEST_ERROR_WITH_TYPE_", type_id = "test_error_with_type_get_type ()")]
-public errordomain TestErrorWithType {
- BAR,
- FOO
-}
+</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", cname = "TestError", cprefix = "TEST_ERROR_", has_type_id = false)]
+ public errordomain TestError {
+ BAR,
+ FOO
+ }
+ [CCode (cheader_filename = "test.h", cname = "TestErrorWithType", cprefix = "TEST_ERROR_WITH_TYPE_", type_id = "test_error_with_type_get_type ()")]
+ public errordomain TestErrorWithType {
+ BAR,
+ FOO
+ }
+}
-GIR
-
-Input:
-
+<?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">
<interface name="Foo"
c:symbol-prefix="foo"
c:type="TestFoo"
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
</record>
-
-Output:
-
-[CCode (cheader_filename = "test.h", type_cname = "TestBarKlass", type_id = "test_bar_get_type ()")]
-public class Bar : GLib.Object {
- [CCode (has_construct_function = false)]
- protected Bar ();
-}
-[CCode (cheader_filename = "test.h", type_cname = "TestFooInterface", type_id = "test_foo_get_type ()")]
-public interface Foo : GLib.Object {
-}
+</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", type_cname = "TestBarKlass", type_id = "test_bar_get_type ()")]
+ public class Bar : GLib.Object {
+ [CCode (has_construct_function = false)]
+ protected Bar ();
+ }
+ [CCode (cheader_filename = "test.h", type_cname = "TestFooInterface", type_id = "test_foo_get_type ()")]
+ public interface Foo : GLib.Object {
+ }
+}
-GIR
-
-Input:
-
+<?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"
glib:type-name="TestFoo"
</parameters>
</method>
</record>
-
-Output:
-
-[CCode (cheader_filename = "test.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "test_foo_get_type ()")]
-[Compact]
-public class Foo {
- [CCode (has_construct_function = false)]
- public Foo ();
- [DestroysInstance]
- public Test.Foo bar ();
- [DestroysInstance]
- public void baz ();
-}
+</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 = "g_boxed_copy", free_function = "g_boxed_free", type_id = "test_foo_get_type ()")]
+ [Compact]
+ public class Foo {
+ [CCode (has_construct_function = false)]
+ public Foo ();
+ [DestroysInstance]
+ public Test.Foo bar ();
+ [DestroysInstance]
+ public void baz ();
+ }
+}
--- /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">
+<function name="function" c:identifier="test_function">
+ <return-value transfer-ownership="full">
+ <array length="0" c:type="gchar**">
+ <type name="utf8"/>
+ </array>
+ </return-value>
+ <parameters>
+ <parameter name="result_length" direction="out" transfer-ownership="none">
+ <type name="gsize" c:type="gsize*"/>
+ </parameter>
+ </parameters>
+</function>
+</namespace>
+</repository>
+++ /dev/null
-GIR
-
-Input:
-
-<function name="function" c:identifier="test_function">
- <return-value transfer-ownership="full">
- <array length="0" c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="result_length" direction="out" transfer-ownership="none">
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
-</function>
-
-Output:
-
-[CCode (array_length_pos = 0.1, array_length_type = "gsize", cheader_filename = "test.h")]
-public static string[] function ();
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (array_length_pos = 0.1, array_length_type = "gsize", cheader_filename = "test.h")]
+ public static string[] function ();
+}
-GIR
-
-Input:
-
+<?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:symbol-prefix="foo"
c:type="TestFoo"
</parameters>
</method>
</record>
-
-Output:
-
-[CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
-public abstract class Foo : GLib.Object {
- [CCode (has_construct_function = false)]
- protected Foo ();
- [CCode (cname = "test_foo_class_bar")]
- public class void bar ();
-}
+</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", type_id = "test_foo_get_type ()")]
+ public abstract class Foo : GLib.Object {
+ [CCode (has_construct_function = false)]
+ protected Foo ();
+ [CCode (cname = "test_foo_class_bar")]
+ public class void bar ();
+ }
+}
-GIR
-
-Input:
-
+<?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:symbol-prefix="foo"
c:type="TestFoo"
</callback>
</field>
</record>
-
-Output:
-
-[CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
-public abstract class Foo : GLib.Object {
- [CCode (has_construct_function = false)]
- protected Foo ();
- [NoWrapper]
- public virtual bool bar ();
-}
+</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", type_id = "test_foo_get_type ()")]
+ public abstract class Foo : GLib.Object {
+ [CCode (has_construct_function = false)]
+ protected Foo ();
+ [NoWrapper]
+ public virtual bool bar ();
+ }
+}
--- /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">
+<function name="function" c:identifier="test_function">
+ <return-value transfer-ownership="none">
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="foo" transfer-ownership="none">
+ <array length="1" c:type="gchar**">
+ <type name="utf8"/>
+ </array>
+ </parameter>
+ <parameter name="foo_length" transfer-ownership="none">
+ <type name="gsize" c:type="gsize"/>
+ </parameter>
+ </parameters>
+</function>
+</namespace>
+</repository>
+++ /dev/null
-GIR
-
-Input:
-
-<function name="function" c:identifier="test_function">
- <return-value transfer-ownership="none">
- <type name="none"/>
- </return-value>
- <parameters>
- <parameter name="foo" transfer-ownership="none">
- <array length="1" c:type="gchar**">
- <type name="utf8"/>
- </array>
- </parameter>
- <parameter name="foo_length" transfer-ownership="none">
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
-</function>
-
-Output:
-
-[CCode (cheader_filename = "test.h")]
-public static void function ([CCode (array_length_cname = "foo_length", array_length_pos = 1.1, array_length_type = "gsize")] string[] foo);
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (cheader_filename = "test.h")]
+ public static void function ([CCode (array_length_cname = "foo_length", array_length_pos = 1.1, array_length_type = "gsize")] string[] 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">
+<function name="function" c:identifier="test_function">
+ <return-value transfer-ownership="none">
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="i" direction="out" transfer-ownership="full" nullable="1">
+ <type name="gint" c:type="gint*"/>
+ </parameter>
+ </parameters>
+</function>
+</namespace>
+</repository>
+++ /dev/null
-GIR
-
-Input:
-
-<function name="function" c:identifier="test_function">
- <return-value transfer-ownership="none">
- <type name="none"/>
- </return-value>
- <parameters>
- <parameter name="i" direction="out" transfer-ownership="full" nullable="1">
- <type name="gint" c:type="gint*"/>
- </parameter>
- </parameters>
-</function>
-
-Output:
-
-[CCode (cheader_filename = "test.h")]
-public static void function (out int i);
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (cheader_filename = "test.h")]
+ public static void function (out int i);
+}
--- /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" glib:type-name="TestFoo" glib:get-type="test_foo_get_type" glib:type-struct="FooClass" parent="GObject.Object">
+ <property name="prop" readable="0" writable="1" construct-only="1">
+ <type name="gint" c:type="gint"/>
+ </property>
+</class>
+<record name="FooClass" c:type="TestFooClass" glib:is-gtype-struct-for="Foo"/>
+</namespace>
+</repository>
+++ /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">
- <property name="prop" readable="0" writable="1" construct-only="1">
- <type name="gint" c:type="gint"/>
- </property>
-</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 ();
- [NoAccessorMethod]
- public int prop { construct; }
-}
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
+ public class Foo : GLib.Object {
+ [CCode (has_construct_function = false)]
+ protected Foo ();
+ [NoAccessorMethod]
+ public int prop { construct; }
+ }
+}
-GIR
-
-Input:
-
+<?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" glib:type-name="TestFoo" glib:get-type="test_foo_get_type" glib:type-struct="FooClass" parent="GObject.Object">
<virtual-method name="signal_virtual">
<return-value transfer-ownership="full">
</callback>
</field>
</record>
-
-Output:
-
-[CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
-public class Foo : GLib.Object {
- [CCode (has_construct_function = false)]
- public Foo ();
- public virtual signal void signal_virtual ();
-}
+</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", type_id = "test_foo_get_type ()")]
+ public class Foo : GLib.Object {
+ [CCode (has_construct_function = false)]
+ public Foo ();
+ public virtual signal void signal_virtual ();
+ }
+}
--- /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">
+<enumeration name="Test"
+ c:type="Test">
+ <member name="bar"
+ value="0"
+ c:identifier="TEST_BAR">
+ </member>
+ <member name="foo"
+ value="1"
+ c:identifier="TEST_FOO">
+ </member>
+ <member name="bar"
+ value="0"
+ c:identifier="TEST_BAR">
+ </member>
+</enumeration>
+</namespace>
+</repository>
+++ /dev/null
-GIR
-
-Input:
-
-<enumeration name="Test"
- c:type="Test">
- <member name="bar"
- value="0"
- c:identifier="TEST_BAR">
- </member>
- <member name="foo"
- value="1"
- c:identifier="TEST_FOO">
- </member>
- <member name="bar"
- value="0"
- c:identifier="TEST_BAR">
- </member>
-</enumeration>
-
-Output:
-
-[CCode (cheader_filename = "test.h", cname = "Test", cprefix = "TEST_", has_type_id = false)]
-public enum Test {
- BAR,
- FOO
-}
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (cheader_filename = "test.h", cname = "Test", cprefix = "TEST_", has_type_id = false)]
+ public enum Test {
+ BAR,
+ FOO
+ }
+}
-GIR
-
-Input:
-
+<?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="TypeFoo" c:type="TestTypeFoo" glib:type-name="TestTypeFoo" glib:get-type="test_foo_get_type" glib:type-struct="TypeFooClass" parent="GObject.Object">
<constructor name="new" c:identifier="test_type_foo_new">
<return-value transfer-ownership="full">
</return-value>
</method>
</class>
-
-Output:
-
-[CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
-public class TypeFoo : GLib.Object {
- [CCode (cname = "test_type_foo_new", has_construct_function = false)]
- public TypeFoo ();
- [CCode (cname = "test_type_foo_bar")]
- public void bar ();
-}
+</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", type_id = "test_foo_get_type ()")]
+ public class TypeFoo : GLib.Object {
+ [CCode (cname = "test_type_foo_new", has_construct_function = false)]
+ public TypeFoo ();
+ [CCode (cname = "test_type_foo_bar")]
+ public void bar ();
+ }
+}
--- /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">
+<function name="" c:identifier="test_foo">
+ <return-value transfer-ownership="none">
+ <type name="void"/>
+ </return-value>
+</function>
+<function name="bar" c:identifier="test_bar">
+ <return-value transfer-ownership="none">
+ <type name="void"/>
+ </return-value>
+</function>
+</namespace>
+</repository>
+++ /dev/null
-GIR
-
-Input:
-
-<function name="" c:identifier="test_foo">
- <return-value transfer-ownership="none">
- <type name="void"/>
- </return-value>
-</function>
-<function name="bar" c:identifier="test_bar">
- <return-value transfer-ownership="none">
- <type name="void"/>
- </return-value>
-</function>
-
-Output:
-
-[CCode (cheader_filename = "test.h")]
-public static void bar ();
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (cheader_filename = "test.h")]
+ public static void bar ();
+}
--- /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">
+ <field name="u" writable="1">
+ <type name="guint" c:type="guint"/>
+ </field>
+ <union>
+ <field name="a" writable="1">
+ <array zero-terminated="0" fixed-size="2">
+ <type name="int" c:type="int*"/>
+ </array>
+ </field>
+ <field name="pad" readable="0" private="1">
+ <array zero-terminated="0" fixed-size="4">
+ <type name="guint" c:type="guint"/>
+ </array>
+ </field>
+ </union>
+</record>
+</namespace>
+</repository>
+++ /dev/null
-GIR
-
-Input:
-
-<record name="Foo" c:type="TestFoo">
- <field name="u" writable="1">
- <type name="guint" c:type="guint"/>
- </field>
- <union>
- <field name="a" writable="1">
- <array zero-terminated="0" fixed-size="2">
- <type name="int" c:type="int*"/>
- </array>
- </field>
- <field name="pad" readable="0" private="1">
- <array zero-terminated="0" fixed-size="4">
- <type name="guint" c:type="guint"/>
- </array>
- </field>
- </union>
-</record>
-
-Output:
-
-[CCode (cheader_filename = "test.h", has_type_id = false)]
-public struct Foo {
- public uint u;
- [CCode (array_length = false)]
- public weak int a[2];
-}
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (cheader_filename = "test.h", has_type_id = false)]
+ public struct Foo {
+ public uint u;
+ [CCode (array_length = false)]
+ public weak int a[2];
+ }
+}
--- /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">
+<union name="Foo" c:type="TestFoo">
+ <field name="bar" writable="1">
+ <type name="guint" c:type="guint"/>
+ </field>
+ <field name="manam" writable="1">
+ <type name="gint" c:type="gint"/>
+ </field>
+</union>
+</namespace>
+</repository>
+++ /dev/null
-GIR
-
-Input:
-
-<union name="Foo" c:type="TestFoo">
- <field name="bar" writable="1">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="manam" writable="1">
- <type name="gint" c:type="gint"/>
- </field>
-</union>
-
-Output:
-
-[CCode (cheader_filename = "test.h")]
-public struct Foo {
- public uint bar;
- public int manam;
-}
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (cheader_filename = "test.h")]
+ public struct Foo {
+ public uint bar;
+ public int manam;
+ }
+}