summaryrefslogtreecommitdiff
path: root/giscanner
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-06-02 19:36:59 +0200
committerTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-06-02 19:36:59 +0200
commitb7804cc7114657f367f6371ddfe9805dad8c67ff (patch)
tree9e7169a9f339ba2fcf0f4530134bae8bbd705dc4 /giscanner
parent2cdd4e9a3eb7944eb8cfeed17eb50185fc7623d1 (diff)
downloadgobject-introspection-b7804cc7114657f367f6371ddfe9805dad8c67ff.tar.gz
Fix marshalling of GStrv.GOBJECT_INTROSPECTION_0_6_13
* gir/gimarshallingtests.[hc]: Add a test for GStrv in function args and as struct fields. * girepository/giroffsets.c: Correctly compute the size of structs with array fields * girepository/girparser.c: Set is_pointer to FALSE for arrays with fixed size that are inside structs. * giscanner/glibtransformer.py: Special case GStrv as arrays of utf8. * giscanner/annotationparser.py: Make full transfer the default for arrays of char* returned by functions. https://bugzilla.gnome.org/show_bug.cgi?id=620170
Diffstat (limited to 'giscanner')
-rw-r--r--giscanner/annotationparser.py6
-rw-r--r--giscanner/glibtransformer.py5
2 files changed, 9 insertions, 2 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index 85237cd3..d632174c 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -934,7 +934,11 @@ class AnnotationApplier(object):
else:
return PARAM_TRANSFER_NONE
elif isinstance(node, Return):
- if (node.type.canonical in BASIC_GIR_TYPES or
+ if (isinstance(node.type, Array) and
+ node.type.element_type is not None and
+ node.type.element_type.name == 'utf8'):
+ return PARAM_TRANSFER_FULL
+ elif (node.type.canonical in BASIC_GIR_TYPES or
(node.type.canonical in [TYPE_NONE, TYPE_ANY] and
node.type.is_const)):
return PARAM_TRANSFER_NONE
diff --git a/giscanner/glibtransformer.py b/giscanner/glibtransformer.py
index ca43eb09..2e45b134 100644
--- a/giscanner/glibtransformer.py
+++ b/giscanner/glibtransformer.py
@@ -28,7 +28,7 @@ import subprocess
from .ast import (Alias, Bitfield, Callback, Constant, Enum, Function, Member,
Namespace, Parameter, Property, Record, Return, Type, Union,
Field, VFunction, type_name_from_ctype,
- default_array_types, TYPE_UINT8, PARAM_TRANSFER_FULL)
+ default_array_types, TYPE_UINT8, PARAM_TRANSFER_FULL, Array)
from .transformer import Names
from .glibast import (GLibBoxed, GLibEnum, GLibEnumMember, GLibFlags,
GLibInterface, GLibObject, GLibSignal, GLibBoxedStruct,
@@ -845,6 +845,9 @@ class GLibTransformer(object):
# Workaround glib bug #548689, to be included in 2.18.0
if ptype.name == "GParam":
ptype.name = "GObject.ParamSpec"
+ elif ptype.name == "GObject.Strv":
+ return Array(None, ptype.ctype, Type('utf8'))
+
return self._transformer.resolve_param_type_full(ptype,
self._names,
**kwargs)