[gobject-introspection] scanner: Support GStrv as signal parameters
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] scanner: Support GStrv as signal parameters
- Date: Thu, 21 Oct 2010 18:05:19 +0000 (UTC)
commit 78716bd269a1b2b770138b3ce5e00f2a9f479b55
Author: Colin Walters <walters verbum org>
Date: Thu Oct 21 14:07:59 2010 -0400
scanner: Support GStrv as signal parameters
giscanner/ast.py | 5 +++++
tests/scanner/Regress-1.0-expected.gir | 14 ++++++++++++++
tests/scanner/regress.c | 20 ++++++++++++++++++++
3 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/giscanner/ast.py b/giscanner/ast.py
index 1b1de5c..d4f251f 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -94,6 +94,11 @@ in contrast to the other create_type() functions."""
elif gtype_name in ('GArray', 'GPtrArray', 'GByteArray'):
return Array('GLib.' + gtype_name[1:], TYPE_ANY,
gtype_name=gtype_name)
+ elif gtype_name == 'GStrv':
+ bare_utf8 = TYPE_STRING.clone()
+ bare_utf8.ctype = None
+ return Array(None, bare_utf8, ctype=None, gtype_name=gtype_name,
+ is_const=False)
return cls(gtype_name=gtype_name)
def get_giname(self):
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index bf71521..ba3ce29 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -640,6 +640,20 @@ TpAccount::status-changed</doc>
</parameter>
</parameters>
</glib:signal>
+ <glib:signal name="sig-with-strv">
+ <doc xml:whitespace="preserve">Test GStrv as a param.</doc>
+ <return-value transfer-ownership="none">
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="object" transfer-ownership="none">
+ <doc xml:whitespace="preserve">strings</doc>
+ <array>
+ <type name="utf8"/>
+ </array>
+ </parameter>
+ </parameters>
+ </glib:signal>
<glib:signal name="test">
<return-value transfer-ownership="none">
<type name="none"/>
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index 839114f..b83ed98 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -1649,6 +1649,7 @@ regress_test_obj_default_matrix (RegressTestObj *obj, const char *somestr)
enum {
REGRESS_TEST_OBJ_SIGNAL_SIG_NEW_WITH_ARRAY_PROP,
REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_HASH_PROP,
+ REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_STRV,
N_REGRESS_TEST_OBJ_SIGNALS
};
@@ -1726,6 +1727,25 @@ regress_test_obj_class_init (RegressTestObjClass *klass)
1,
G_TYPE_HASH_TABLE);
+ /**
+ * RegressTestObj::sig-with-strv:
+ * @self: an object
+ * @strs: strings
+ *
+ * Test GStrv as a param.
+ */
+ regress_test_obj_signals[REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_STRV] =
+ g_signal_new ("sig-with-strv",
+ G_TYPE_FROM_CLASS (gobject_class),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__BOXED,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_STRV);
+
gobject_class->set_property = regress_test_obj_set_property;
gobject_class->get_property = regress_test_obj_get_property;
gobject_class->dispose = regress_test_obj_dispose;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]