gobject-introspection 2.0.2-x86-mingw32 → 2.0.3-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +5 -2
- data/ext/gobject-introspection/rb-gi-argument.c +215 -4
- data/ext/gobject-introspection/rb-gi-loader.c +7 -2
- data/ext/gobject-introspection/rb-gi-struct-info.c +1 -1
- data/lib/1.9/gobject_introspection.so +0 -0
- data/lib/2.0/gobject_introspection.so +0 -0
- data/test/test-function-info.rb +3 -1
- data/vendor/local/bin/g-ir-compiler.exe +0 -0
- data/vendor/local/bin/g-ir-generate.exe +0 -0
- data/vendor/local/bin/libgirepository-1.0-1.dll +0 -0
- data/vendor/local/lib/girepository-1.0/DBus-1.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/DBusGLib-1.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/GIRepository-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/GLib-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/GModule-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/GObject-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/Gio-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/win32-1.0.typelib +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.py +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.py +52 -47
- data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ast.py +48 -42
- data/vendor/local/lib/gobject-introspection/giscanner/ast.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ast.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/cachestore.py +11 -10
- data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/codegen.py +7 -5
- data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/__init__.py +22 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/__init__.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/__init__.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/ordereddict.py +120 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/ordereddict.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/ordereddict.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docmain.py +14 -2
- data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docwriter.py +19 -10
- data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/dumper.py +18 -11
- data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.py +10 -13
- data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girparser.py +24 -30
- data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girwriter.py +11 -12
- data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.py +25 -21
- data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.py +1 -1
- data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.py +98 -100
- data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/message.py +10 -8
- data/vendor/local/lib/gobject-introspection/giscanner/message.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/message.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/scannermain.py +28 -16
- data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.py +83 -9
- data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/shlibs.py +5 -1
- data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.py +20 -21
- data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.py +3 -0
- data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/transformer.py +32 -41
- data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/utils.py +9 -0
- data/vendor/local/lib/gobject-introspection/giscanner/utils.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/utils.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.py +9 -11
- data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyo +0 -0
- data/vendor/local/lib/libgirepository-1.0.a +0 -0
- data/vendor/local/lib/libgirepository-1.0.dll.a +0 -0
- data/vendor/local/lib/libgirepository-1.0.la +1 -1
- data/vendor/local/lib/pkgconfig/gobject-introspection-1.0.pc +1 -1
- data/vendor/local/lib/pkgconfig/gobject-introspection-no-export-1.0.pc +1 -1
- data/vendor/local/share/gir-1.0/GIRepository-2.0.gir +691 -691
- data/vendor/local/share/gir-1.0/GLib-2.0.gir +6972 -6467
- data/vendor/local/share/gir-1.0/GModule-2.0.gir +103 -4
- data/vendor/local/share/gir-1.0/GObject-2.0.gir +2085 -1955
- data/vendor/local/share/gir-1.0/Gio-2.0.gir +10955 -9269
- data/vendor/local/share/gir-1.0/win32-1.0.gir +19 -0
- data/vendor/local/share/gobject-introspection-1.0/Makefile.introspection +2 -2
- data/vendor/local/share/gobject-introspection-1.0/gdump.c +7 -2
- data/vendor/local/share/gobject-introspection-1.0/tests/annotation.c +15 -15
- data/vendor/local/share/gobject-introspection-1.0/tests/annotation.h +1 -1
- data/vendor/local/share/gobject-introspection-1.0/tests/gimarshallingtests.c +14 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/gimarshallingtests.h +2 -2
- data/vendor/local/share/gobject-introspection-1.0/tests/regress.c +8 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/regress.h +9 -0
- metadata +20 -21
- data/vendor/local/lib/gobject-introspection/giscanner/odict.py +0 -50
- data/vendor/local/lib/gobject-introspection/giscanner/odict.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/odict.pyo +0 -0
@@ -165,7 +165,7 @@ blob containing data gleaned from GObject's primitive introspection."""
|
|
165
165
|
try:
|
166
166
|
try:
|
167
167
|
subprocess.check_call(args, stdout=sys.stdout, stderr=sys.stderr)
|
168
|
-
except subprocess.CalledProcessError
|
168
|
+
except subprocess.CalledProcessError as e:
|
169
169
|
# Clean up temporaries
|
170
170
|
raise SystemExit(e)
|
171
171
|
return parse(out_path)
|
@@ -203,8 +203,7 @@ blob containing data gleaned from GObject's primitive introspection."""
|
|
203
203
|
|
204
204
|
def _initparse_gobject_record(self, record):
|
205
205
|
if (record.name.startswith('ParamSpec')
|
206
|
-
|
207
|
-
'ParamSpecTypeInfo')):
|
206
|
+
and not record.name in ('ParamSpecPool', 'ParamSpecClass', 'ParamSpecTypeInfo')):
|
208
207
|
parent = None
|
209
208
|
if record.name != 'ParamSpec':
|
210
209
|
parent = ast.Type(target_giname='GObject.ParamSpec')
|
@@ -251,7 +250,7 @@ blob containing data gleaned from GObject's primitive introspection."""
|
|
251
250
|
(get_type, c_symbol_prefix) = self._split_type_and_symbol_prefix(xmlnode)
|
252
251
|
try:
|
253
252
|
enum_name = self._transformer.strip_identifier(type_name)
|
254
|
-
except TransformerException
|
253
|
+
except TransformerException as e:
|
255
254
|
message.fatal(e)
|
256
255
|
|
257
256
|
# The scanned member values are more accurate than the values that the
|
@@ -280,7 +279,6 @@ blob containing data gleaned from GObject's primitive introspection."""
|
|
280
279
|
member.attrib['name'],
|
281
280
|
member.attrib['nick']))
|
282
281
|
|
283
|
-
|
284
282
|
if xmlnode.tag == 'flags':
|
285
283
|
klass = ast.Bitfield
|
286
284
|
else:
|
@@ -316,7 +314,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide
|
|
316
314
|
(get_type, c_symbol_prefix) = self._split_type_and_symbol_prefix(xmlnode)
|
317
315
|
try:
|
318
316
|
object_name = self._transformer.strip_identifier(type_name)
|
319
|
-
except TransformerException
|
317
|
+
except TransformerException as e:
|
320
318
|
message.fatal(e)
|
321
319
|
node = ast.Class(object_name, None,
|
322
320
|
gtype_name=type_name,
|
@@ -346,7 +344,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide
|
|
346
344
|
(get_type, c_symbol_prefix) = self._split_type_and_symbol_prefix(xmlnode)
|
347
345
|
try:
|
348
346
|
interface_name = self._transformer.strip_identifier(type_name)
|
349
|
-
except TransformerException
|
347
|
+
except TransformerException as e:
|
350
348
|
message.fatal(e)
|
351
349
|
node = ast.Interface(interface_name, None,
|
352
350
|
gtype_name=type_name,
|
@@ -391,7 +389,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide
|
|
391
389
|
|
392
390
|
try:
|
393
391
|
name = self._transformer.strip_identifier(type_name)
|
394
|
-
except TransformerException
|
392
|
+
except TransformerException as e:
|
395
393
|
message.fatal(e)
|
396
394
|
# This one doesn't go in the main namespace; we associate it with
|
397
395
|
# the struct or union
|
@@ -437,7 +435,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide
|
|
437
435
|
if i == 0:
|
438
436
|
argname = 'object'
|
439
437
|
else:
|
440
|
-
argname = 'p%s' % (i-1, )
|
438
|
+
argname = 'p%s' % (i - 1, )
|
441
439
|
pctype = parameter.attrib['type']
|
442
440
|
ptype = ast.Type.create_from_gtype_name(pctype)
|
443
441
|
param = ast.Parameter(argname, ptype)
|
@@ -465,7 +463,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide
|
|
465
463
|
(get_type, c_symbol_prefix) = self._split_type_and_symbol_prefix(xmlnode)
|
466
464
|
try:
|
467
465
|
fundamental_name = self._transformer.strip_identifier(type_name)
|
468
|
-
except TransformerException
|
466
|
+
except TransformerException as e:
|
469
467
|
message.warn(e)
|
470
468
|
return
|
471
469
|
|
@@ -509,7 +507,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide
|
|
509
507
|
def _pair_boxed_type(self, boxed):
|
510
508
|
try:
|
511
509
|
name = self._transformer.strip_identifier(boxed.gtype_name)
|
512
|
-
except TransformerException
|
510
|
+
except TransformerException as e:
|
513
511
|
message.fatal(e)
|
514
512
|
pair_node = self._namespace.get(name)
|
515
513
|
if not pair_node:
|
@@ -526,8 +524,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide
|
|
526
524
|
return False
|
527
525
|
|
528
526
|
def _strip_class_suffix(self, name):
|
529
|
-
if (name.endswith('Class') or
|
530
|
-
name.endswith('Iface')):
|
527
|
+
if (name.endswith('Class') or name.endswith('Iface')):
|
531
528
|
return name[:-5]
|
532
529
|
elif name.endswith('Interface'):
|
533
530
|
return name[:-9]
|
Binary file
|
Binary file
|
@@ -101,9 +101,8 @@ class GIRParser(object):
|
|
101
101
|
assert root.tag == _corens('repository')
|
102
102
|
version = root.attrib['version']
|
103
103
|
if version != COMPATIBLE_GIR_VERSION:
|
104
|
-
raise SystemExit("%s: Incompatible version %s (supported: %s)"
|
105
|
-
|
106
|
-
version, COMPATIBLE_GIR_VERSION))
|
104
|
+
raise SystemExit("%s: Incompatible version %s (supported: %s)" %
|
105
|
+
(self._get_current_file(), version, COMPATIBLE_GIR_VERSION))
|
107
106
|
|
108
107
|
for node in root.getchildren():
|
109
108
|
if node.tag == _corens('include'):
|
@@ -122,9 +121,9 @@ class GIRParser(object):
|
|
122
121
|
if symbol_prefixes:
|
123
122
|
symbol_prefixes = symbol_prefixes.split(',')
|
124
123
|
self._namespace = ast.Namespace(ns.attrib['name'],
|
125
|
-
|
126
|
-
|
127
|
-
|
124
|
+
ns.attrib['version'],
|
125
|
+
identifier_prefixes=identifier_prefixes,
|
126
|
+
symbol_prefixes=symbol_prefixes)
|
128
127
|
if 'shared-library' in ns.attrib:
|
129
128
|
self._namespace.shared_libraries = ns.attrib['shared-library'].split(',')
|
130
129
|
self._namespace.includes = self._includes
|
@@ -140,8 +139,7 @@ class GIRParser(object):
|
|
140
139
|
_corens('interface'): self._parse_object_interface,
|
141
140
|
_corens('record'): self._parse_record,
|
142
141
|
_corens('union'): self._parse_union,
|
143
|
-
_glibns('boxed'): self._parse_boxed
|
144
|
-
}
|
142
|
+
_glibns('boxed'): self._parse_boxed}
|
145
143
|
|
146
144
|
if not self._types_only:
|
147
145
|
parser_methods[_corens('constant')] = self._parse_constant
|
@@ -153,8 +151,7 @@ class GIRParser(object):
|
|
153
151
|
method(node)
|
154
152
|
|
155
153
|
def _parse_include(self, node):
|
156
|
-
include = ast.Include(node.attrib['name'],
|
157
|
-
node.attrib['version'])
|
154
|
+
include = ast.Include(node.attrib['name'], node.attrib['version'])
|
158
155
|
self._includes.add(include)
|
159
156
|
|
160
157
|
def _parse_pkgconfig_package(self, node):
|
@@ -165,9 +162,7 @@ class GIRParser(object):
|
|
165
162
|
|
166
163
|
def _parse_alias(self, node):
|
167
164
|
typeval = self._parse_type(node)
|
168
|
-
alias = ast.Alias(node.attrib['name'],
|
169
|
-
typeval,
|
170
|
-
node.attrib.get(_cns('type')))
|
165
|
+
alias = ast.Alias(node.attrib['name'], typeval, node.attrib.get(_cns('type')))
|
171
166
|
self._parse_generic_attribs(node, alias)
|
172
167
|
self._namespace.append(alias)
|
173
168
|
|
@@ -427,7 +422,8 @@ class GIRParser(object):
|
|
427
422
|
return ast.Type(ctype=ctype)
|
428
423
|
elif name in ['GLib.List', 'GLib.SList']:
|
429
424
|
subchild = self._find_first_child(typenode,
|
430
|
-
|
425
|
+
map(_corens, ('callback', 'array',
|
426
|
+
'varargs', 'type')))
|
431
427
|
if subchild is not None:
|
432
428
|
element_type = self._parse_type(typenode)
|
433
429
|
else:
|
@@ -438,9 +434,7 @@ class GIRParser(object):
|
|
438
434
|
subchildren_types = map(self._parse_type_simple, subchildren)
|
439
435
|
while len(subchildren_types) < 2:
|
440
436
|
subchildren_types.append(ast.TYPE_ANY)
|
441
|
-
return ast.Map(subchildren_types[0],
|
442
|
-
subchildren_types[1],
|
443
|
-
ctype=ctype)
|
437
|
+
return ast.Map(subchildren_types[0], subchildren_types[1], ctype=ctype)
|
444
438
|
else:
|
445
439
|
return self._namespace.type_from_name(name, ctype)
|
446
440
|
else:
|
@@ -462,8 +456,8 @@ class GIRParser(object):
|
|
462
456
|
lenidx = typenode.attrib.get('length')
|
463
457
|
if lenidx is not None:
|
464
458
|
idx = int(lenidx)
|
465
|
-
assert idx < len(parent.parameters), "%r %d >= %d"
|
466
|
-
|
459
|
+
assert idx < len(parent.parameters), "%r %d >= %d" % (parent, idx,
|
460
|
+
len(parent.parameters))
|
467
461
|
typeval.length_param_name = parent.parameters[idx].argname
|
468
462
|
|
469
463
|
def _parse_boxed(self, node):
|
@@ -509,11 +503,11 @@ class GIRParser(object):
|
|
509
503
|
assert node.tag == _corens('field'), node.tag
|
510
504
|
type_node = self._parse_type(node)
|
511
505
|
field = ast.Field(node.attrib.get('name'),
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
506
|
+
type_node,
|
507
|
+
node.attrib.get('readable') != '0',
|
508
|
+
node.attrib.get('writable') == '1',
|
509
|
+
node.attrib.get('bits'),
|
510
|
+
anonymous_node=anonymous_node)
|
517
511
|
field.private = node.attrib.get('private') == '1'
|
518
512
|
field.parent = parent
|
519
513
|
self._parse_generic_attribs(node, field)
|
@@ -521,12 +515,12 @@ class GIRParser(object):
|
|
521
515
|
|
522
516
|
def _parse_property(self, node, parent):
|
523
517
|
prop = ast.Property(node.attrib['name'],
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
518
|
+
self._parse_type(node),
|
519
|
+
node.attrib.get('readable') != '0',
|
520
|
+
node.attrib.get('writable') == '1',
|
521
|
+
node.attrib.get('construct') == '1',
|
522
|
+
node.attrib.get('construct-only') == '1',
|
523
|
+
node.attrib.get('transfer-ownership'))
|
530
524
|
self._parse_generic_attribs(node, prop)
|
531
525
|
prop.parent = parent
|
532
526
|
return prop
|
Binary file
|
Binary file
|
@@ -28,14 +28,15 @@ from .xmlwriter import XMLWriter
|
|
28
28
|
# Compatible changes we just make inline
|
29
29
|
COMPATIBLE_GIR_VERSION = '1.2'
|
30
30
|
|
31
|
+
|
31
32
|
class GIRWriter(XMLWriter):
|
32
33
|
|
33
34
|
def __init__(self, namespace):
|
34
35
|
super(GIRWriter, self).__init__()
|
35
36
|
self.write_comment(
|
36
|
-
'
|
37
|
-
To affect the contents of this file, edit the original C definitions
|
38
|
-
and/or use gtk-doc annotations. '
|
37
|
+
'This file was automatically generated from C sources - DO NOT EDIT!\n'
|
38
|
+
'To affect the contents of this file, edit the original C definitions,\n'
|
39
|
+
'and/or use gtk-doc annotations. ')
|
39
40
|
self._write_repository(namespace)
|
40
41
|
|
41
42
|
def _write_repository(self, namespace):
|
@@ -43,8 +44,7 @@ and/or use gtk-doc annotations. ''')
|
|
43
44
|
('version', COMPATIBLE_GIR_VERSION),
|
44
45
|
('xmlns', 'http://www.gtk.org/introspection/core/1.0'),
|
45
46
|
('xmlns:c', 'http://www.gtk.org/introspection/c/1.0'),
|
46
|
-
('xmlns:glib', 'http://www.gtk.org/introspection/glib/1.0')
|
47
|
-
]
|
47
|
+
('xmlns:glib', 'http://www.gtk.org/introspection/glib/1.0')]
|
48
48
|
with self.tagcontext('repository', attrs):
|
49
49
|
for include in sorted(namespace.includes):
|
50
50
|
self._write_include(include)
|
@@ -126,7 +126,7 @@ and/or use gtk-doc annotations. ''')
|
|
126
126
|
for key, value in node.attributes:
|
127
127
|
self.write_tag('attribute', [('name', key), ('value', value)])
|
128
128
|
if hasattr(node, 'doc') and node.doc:
|
129
|
-
self.write_tag('doc', [('xml:
|
129
|
+
self.write_tag('doc', [('xml:space', 'preserve')],
|
130
130
|
node.doc)
|
131
131
|
|
132
132
|
def _append_node_generic(self, node, attrs):
|
@@ -292,8 +292,8 @@ and/or use gtk-doc annotations. ''')
|
|
292
292
|
attrs.append(('fixed-size', '%d' % (ntype.size, )))
|
293
293
|
if ntype.length_param_name is not None:
|
294
294
|
assert function
|
295
|
-
|
296
|
-
|
295
|
+
length = function.get_parameter_index(ntype.length_param_name)
|
296
|
+
attrs.insert(0, ('length', '%d' % (length, )))
|
297
297
|
|
298
298
|
with self.tagcontext('array', attrs):
|
299
299
|
self._write_type(ntype.element_type)
|
@@ -482,7 +482,7 @@ and/or use gtk-doc annotations. ''')
|
|
482
482
|
attrs = list(extra_attrs)
|
483
483
|
if record.name is not None:
|
484
484
|
attrs.append(('name', record.name))
|
485
|
-
if record.ctype is not None:
|
485
|
+
if record.ctype is not None: # the record might be anonymous
|
486
486
|
attrs.append(('c:type', record.ctype))
|
487
487
|
if record.disguised:
|
488
488
|
attrs.append(('disguised', '1'))
|
@@ -513,7 +513,7 @@ and/or use gtk-doc annotations. ''')
|
|
513
513
|
attrs = []
|
514
514
|
if union.name is not None:
|
515
515
|
attrs.append(('name', union.name))
|
516
|
-
if union.ctype is not None:
|
516
|
+
if union.ctype is not None: # the union might be anonymous
|
517
517
|
attrs.append(('c:type', union.ctype))
|
518
518
|
self._append_version(union, attrs)
|
519
519
|
self._append_node_generic(union, attrs)
|
@@ -544,8 +544,7 @@ and/or use gtk-doc annotations. ''')
|
|
544
544
|
elif isinstance(field.anonymous_node, ast.Union):
|
545
545
|
self._write_union(field.anonymous_node)
|
546
546
|
else:
|
547
|
-
raise AssertionError("Unknown field anonymous: %r"
|
548
|
-
% (field.anonymous_node, ))
|
547
|
+
raise AssertionError("Unknown field anonymous: %r" % (field.anonymous_node, ))
|
549
548
|
else:
|
550
549
|
attrs = [('name', field.name)]
|
551
550
|
self._append_node_generic(field, attrs)
|
Binary file
|
Binary file
|
@@ -21,6 +21,7 @@ from . import ast
|
|
21
21
|
from . import message
|
22
22
|
from .annotationparser import TAG_RETURNS
|
23
23
|
|
24
|
+
|
24
25
|
class IntrospectablePass(object):
|
25
26
|
|
26
27
|
def __init__(self, transformer, blocks):
|
@@ -58,7 +59,7 @@ class IntrospectablePass(object):
|
|
58
59
|
else:
|
59
60
|
context = "return value: "
|
60
61
|
if block:
|
61
|
-
return_tag = block.
|
62
|
+
return_tag = block.tags.get(TAG_RETURNS)
|
62
63
|
if return_tag:
|
63
64
|
position = return_tag.position
|
64
65
|
message.warn_node(parent, prefix + context + text,
|
@@ -79,7 +80,7 @@ class IntrospectablePass(object):
|
|
79
80
|
|
80
81
|
if not node.type.resolved:
|
81
82
|
self._parameter_warning(parent, node,
|
82
|
-
"Unresolved type: %r" % (node.type.unresolved_string, ))
|
83
|
+
"Unresolved type: %r" % (node.type.unresolved_string, ))
|
83
84
|
parent.introspectable = False
|
84
85
|
return
|
85
86
|
|
@@ -88,22 +89,23 @@ class IntrospectablePass(object):
|
|
88
89
|
return
|
89
90
|
|
90
91
|
if (isinstance(node.type, (ast.List, ast.Array))
|
91
|
-
|
92
|
+
and node.type.element_type == ast.TYPE_ANY):
|
92
93
|
self._parameter_warning(parent, node, "Missing (element-type) annotation")
|
93
94
|
parent.introspectable = False
|
94
95
|
return
|
95
96
|
|
96
97
|
if (is_parameter
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
98
|
+
and isinstance(target, ast.Callback)
|
99
|
+
and not node.type.target_giname in ('GLib.DestroyNotify', 'Gio.AsyncReadyCallback')
|
100
|
+
and node.scope is None):
|
101
|
+
self._parameter_warning(
|
102
|
+
parent,
|
103
|
+
node,
|
104
|
+
"Missing (scope) annotation for callback without "
|
105
|
+
"GDestroyNotify (valid: %s, %s)" % (ast.PARAM_SCOPE_CALL, ast.PARAM_SCOPE_ASYNC))
|
106
|
+
|
107
|
+
parent.introspectable = False
|
108
|
+
return
|
107
109
|
|
108
110
|
if is_return and isinstance(target, ast.Callback):
|
109
111
|
self._parameter_warning(parent, node, "Callbacks cannot be return values; use (skip)")
|
@@ -111,12 +113,14 @@ class IntrospectablePass(object):
|
|
111
113
|
return
|
112
114
|
|
113
115
|
if (is_return
|
114
|
-
|
115
|
-
|
116
|
-
|
116
|
+
and isinstance(target, (ast.Record, ast.Union))
|
117
|
+
and target.get_type is None
|
118
|
+
and not target.foreign):
|
117
119
|
if node.transfer != ast.PARAM_TRANSFER_NONE:
|
118
|
-
self._parameter_warning(
|
119
|
-
|
120
|
+
self._parameter_warning(
|
121
|
+
parent, node,
|
122
|
+
"Invalid non-constant return of bare structure or union; "
|
123
|
+
"register as boxed type or (skip)")
|
120
124
|
parent.introspectable = False
|
121
125
|
return
|
122
126
|
|
@@ -143,10 +147,10 @@ class IntrospectablePass(object):
|
|
143
147
|
# These are not introspectable pending us adding
|
144
148
|
# larger type tags to the typelib (in theory these could
|
145
149
|
# be 128 bit or larger)
|
146
|
-
|
147
|
-
ast.TYPE_LONG_DOUBLE)):
|
150
|
+
elif typeval.is_equiv((ast.TYPE_LONG_LONG, ast.TYPE_LONG_ULONG, ast.TYPE_LONG_DOUBLE)):
|
148
151
|
return False
|
149
|
-
|
152
|
+
else:
|
153
|
+
return True
|
150
154
|
target = self._transformer.lookup_typenode(typeval)
|
151
155
|
if not target:
|
152
156
|
return False
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|