diff options
author | Johan Dahlin <johan@gnome.org> | 2010-05-27 00:17:56 -0300 |
---|---|---|
committer | Johan Dahlin <johan@gnome.org> | 2010-05-27 00:17:56 -0300 |
commit | 15cfa49be6976c0d8a5574164feca6b0212a7f4a (patch) | |
tree | a2475e3eefcc765c3422000689a881985777e8b0 | |
parent | e77f99fba5fce4dd0d4810707aa1aeac2ba0fb50 (diff) | |
download | gobject-introspection-15cfa49be6976c0d8a5574164feca6b0212a7f4a.tar.gz |
[g-ir-generate] Write out array type
For GLib arrays, write out the array type to the tgir
-rw-r--r-- | tests/scanner/annotation-1.0-expected.tgir | 2 | ||||
-rw-r--r-- | tests/scanner/foo-1.0-expected.tgir | 2 | ||||
-rw-r--r-- | tools/generate.c | 20 |
3 files changed, 22 insertions, 2 deletions
diff --git a/tests/scanner/annotation-1.0-expected.tgir b/tests/scanner/annotation-1.0-expected.tgir index aafd0701..94e8e85e 100644 --- a/tests/scanner/annotation-1.0-expected.tgir +++ b/tests/scanner/annotation-1.0-expected.tgir @@ -446,7 +446,7 @@ </return-value> <parameters> <parameter name="array" transfer-ownership="none"> - <array> + <array name="GLib.PtrArray"> <type name="GLib.Value"/> </array> </parameter> diff --git a/tests/scanner/foo-1.0-expected.tgir b/tests/scanner/foo-1.0-expected.tgir index c0bedbea..d46a318b 100644 --- a/tests/scanner/foo-1.0-expected.tgir +++ b/tests/scanner/foo-1.0-expected.tgir @@ -652,7 +652,7 @@ </function> <function name="test_array" c:identifier="foo_test_array"> <return-value transfer-ownership="container"> - <array> + <array name="GLib.Array"> <type name="utf8"/> </array> </return-value> diff --git a/tools/generate.c b/tools/generate.c index 42772da1..39235962 100644 --- a/tools/generate.c +++ b/tools/generate.c @@ -221,9 +221,29 @@ write_type_info (const gchar *namespace, else if (tag == GI_TYPE_TAG_ARRAY) { gint length, size; + char *name = NULL; xml_start_element (file, "array"); + switch (g_type_info_get_array_type (info)) { + case GI_ARRAY_TYPE_C: + break; + case GI_ARRAY_TYPE_ARRAY: + name = "GLib.Array"; + break; + case GI_ARRAY_TYPE_PTR_ARRAY: + name = "GLib.PtrArray"; + break; + case GI_ARRAY_TYPE_BYTE_ARRAY: + name = "GLib.ByteArray"; + break; + default: + break; + } + + if (name) + xml_printf (file, " name=\"%s\"", name); + type = g_type_info_get_param_type (info, 0); length = g_type_info_get_array_length (info); |